code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import unittest
import os
from pprint import pprint
from .. import lib
from .. import lib_localfilesystem as lfs
class TestCmdGet(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.finder = lib.create_finder()
cls.fixt = lib.CMD_FIXT['cmd_get.txt']
cls.src = os.path.join(lfs.... | dmdm/Pym-elFinder | pym_elfinder_tests/t002_functional/test_3100_cmd_get.py | Python | bsd-3-clause | 1,154 |
from django.conf.urls import url
from . import views
urlpatterns = [
# Auth
url(r"^login/$", views.UserLoginView.as_view(), name="user_login"),
url(r"^logout/$", views.UserLogoutView.as_view(), name="user_logout"),
url(r"^whoami/$", views.WhoAmIView.as_view(), name="user_whoami"),
url(r"^setpassw... | emanuelschuetze/OpenSlides | openslides/users/urls.py | Python | mit | 657 |
#!/usr/bin/env python
import argparse
import numpy as np
from mapTools import *
from plotTools import addContourf
from utilities import vtkWriteDataStructured2d, writeLog
import matplotlib.pyplot as plt
'''
Description:
Author: Mikko Auvinen
mikko.auvinen@helsinki.fi
University of Helsinki &
... | saskartt/P4UL | pyRaster/rasterToVtk.py | Python | mit | 2,045 |
"""
UnicodeHexDump.py
Simple routine for dumping any kind of string, ascii, encoded, or
unicode, to a standard hex dump.
Also two simple routines for reading and writing unicode strings
as encoded strings in a file.
Based on ASPN: Hex dumper -- Sebastien Keim & Raymond Hettinger
http://aspn.activestate.com/ASPN/Co... | ActiveState/code | recipes/Python/572181_Unicode_String_Hex_Dump/recipe-572181.py | Python | mit | 2,699 |
# -*- encoding: utf-8 -*-
# Copyright (c) 2016 b<>com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | openstack/watcher | watcher/decision_engine/goal/efficacy/indicators.py | Python | apache-2.0 | 8,243 |
#!/usr/bin/env python
#coding: utf-8
import asyncore
import fcntl
import codecs
import os
import pyinotify
import sys
import time
from optparse import OptionParser
from parsers import CeleryParser, HashParser, GunicornParser, NginxParser
from sinks import PrinterSink, GraphiteSink, StatsiteSink
BUFFER_SIZE = 4096
... | lensvol/voron | voron/voron.py | Python | bsd-3-clause | 4,452 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'NeuronSummary.cluster_xval'
db.add_column('neuroelectro_neuronsummary', 'cluste... | neuroelectro/neuroelectro_org | neuroelectro/south_migrations/0032_auto__add_field_neuronsummary_cluster_xval__add_field_neuronsummary_cl.py | Python | gpl-2.0 | 20,857 |
import pytest
import requests
@pytest.mark.fxa_login
@pytest.mark.desktop_only
@pytest.mark.nondestructive
@pytest.mark.withoutresponses
def test_devhub_home_loads_addons(base_url, selenium, devhub_login):
"""Test devhub home loads correct number of addons listed."""
devhub = devhub_login
r = requests.get... | atiqueahmedziad/addons-server | tests/ui/test_devhub.py | Python | bsd-3-clause | 1,146 |
from __future__ import division, print_function, unicode_literals
import six
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import pyglet
from pyglet.gl import *
from pyglet import image
from pyglet.window import key
from pyglet.window import mouse
from cocos.director import... | PFML239/Dungeon-defenders | game_view.py | Python | mit | 21,902 |
#!/usr/bin/python
#-*- coding: UTF-8 -*-
#**************************************************************
#
# °æÈ¨ËùÓÐ (C), 2001-2012,»ªÎª¼¼ÊõÓÐÏÞ¹«Ë¾
#
#**************************************************************
#ÎļþÃû transfer_sh.py
#°æ±¾ºÅ £º³õ¸å
#×÷Õß £ºl00167020
#Éú³ÉÈÕÆÚ £º2013Ä... | gabry3795/android_kernel_huawei_mt7_l09 | drivers/vendor/hisi/build/scripts/transfer_sh.py | Python | gpl-2.0 | 3,462 |
from collections import defaultdict
from contextlib import contextmanager
from functools import wraps, lru_cache
from threading import local
from django.contrib.auth import get_permission_codename, get_user_model
from django.contrib.auth.models import Group
from django.db.models import Q
from cms.constants import RO... | divio/django-cms | cms/utils/permissions.py | Python | bsd-3-clause | 11,116 |
import numpy as np
from retrieve_model_tools import retrieve_NGram, retrieve_SkipGramNN
from dynamic_programming_tools import shortest_path
def test_continuations():
# optimal ones...
MAX_LEN = 6
model = retrieve_NGram()
start_chord = 'C'
fixed = { 1: start_chord }
fixed[MAX_LEN] = start_c... | czhuang/ChordRipple | app/test_dynamic_programming_tools.py | Python | mit | 4,902 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | flv0/qutebrowser | tests/unit/utils/test_log.py | Python | gpl-3.0 | 9,751 |
#!/usr/bin/env python
import sys
import os
import re
import glob
import shutil
import logging
import argparse
import subprocess
import simplejson as json
from jinja2 import Environment, FileSystemLoader
base_dir = os.path.abspath(os.path.dirname(__file__))
logging.basicConfig(level=logging.DEBUG)
parser = argparse.A... | aaalgo/xnn | eval-caffe.py | Python | bsd-2-clause | 2,629 |
#
# Copyright (C) 2013 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope... | hmpf/nav | python/nav/web/messages/urls.py | Python | gpl-3.0 | 1,573 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the ... | scality/manila | manila/tests/test_conf.py | Python | apache-2.0 | 3,006 |
"""
ltisys -- a collection of classes and functions for modeling linear
time invariant systems.
"""
#
# Author: Travis Oliphant 2001
#
# Feb 2010: Warren Weckesser
# Rewrote lsim2 and added impulse2.
#
from filter_design import tf2zpk, zpk2tf, normalize
import numpy
from numpy import product, zeros, array, dot, tra... | lesserwhirls/scipy-cwt | scipy/signal/ltisys.py | Python | bsd-3-clause | 23,885 |
"""A setuptools based setup module for agilepoint"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from distutils.command.install import INSTALL_SCHEMES
# To use a consistent encoding
from codecs import open
from os import path
for scheme in INSTALL_SCHEMES.values():
scheme... | blade2005/py-agilepoint | setup.py | Python | gpl-3.0 | 1,395 |
#function for cleaning an x and y set of data that isn't regularly spaced
#on the x axis.
#Based on a program written by F W Skiff in MATLAB.
import numpy as np
def clean(x, y):
"""
Regularizes the distances in x of the data. Interpolates gaps in the y
data or averages repeating values.
T... | Smattacus/data-analysis | python/modules/clean.py | Python | gpl-2.0 | 795 |
"""
SocksiPy - Python SOCKS module.
Version 1.5.0
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notic... | vecna/onionshare | onionshare/socks.py | Python | gpl-3.0 | 20,546 |
"""
Source type-dependencies.
Helioviewer JPEG2000 files have stretched images compared to the FITS data.
"""
from astropy.visualization import LinearStretch
# pylint: disable=W0221,W0222,E1121
__author__ = "Jack Ireland"
__email__ = "jack.ireland@nasa.gov"
__all__ = ['from_helioviewer_project', 'source_stretch']
... | dpshelio/sunpy | sunpy/map/sources/source_type.py | Python | bsd-2-clause | 1,544 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/creation_data.py | Python | mit | 2,521 |
# -*- coding: utf-8 -*-
from datetime import date
from datetime import datetime
from skosprovider_sqlalchemy.models import Concept
from skosprovider_sqlalchemy.models import ConceptScheme
from skosprovider_sqlalchemy.models import LabelType
from skosprovider_sqlalchemy.models import Language
from sqlalchemy.orm.exc im... | OnroerendErfgoed/atramhasis | tests/test_datamanagers.py | Python | gpl-3.0 | 8,091 |
#! /usr/bin/python3
from gi.repository import Gio, CScreensaver
from dbusdepot.baseClient import BaseClient
class CinnamonClient(BaseClient):
"""
Simple client to talk to Cinnamon's dbus interface. Currently
its only use is for attempting to force an exit from overview
and expo mode (both of which d... | hackoon/cinnamon-screensaver-mplayer-fs | src/dbusdepot/cinnamonClient.py | Python | gpl-2.0 | 1,184 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | alisidd/tensorflow | tensorflow/contrib/layers/python/ops/sparse_ops.py | Python | apache-2.0 | 9,192 |
#!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | lociii/googleads-python-lib | examples/adspygoogle/dfp/v201311/user_service/get_current_user.py | Python | apache-2.0 | 1,421 |
import operator
from numbers import Number
import numpy as np
import tlz as toolz
from ..base import tokenize, wait
from ..blockwise import blockwise
from ..highlevelgraph import HighLevelGraph
from ..utils import derived_from, apply
from .core import dotmany, Array, concatenate
from .creation import eye
from .random... | ContinuumIO/dask | dask/array/linalg.py | Python | bsd-3-clause | 46,292 |
# python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"... | google/python-spanner-orm | spanner_orm/metadata.py | Python | apache-2.0 | 4,669 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of t... | egabancho/invenio | invenio/legacy/bibformat/dblayer.py | Python | gpl-2.0 | 17,777 |
ip_list = '''wysextplwqpvipxdv[srzvtwbfzqtspxnethm]syqbzgtboxxzpwr[kljvjjkjyojzrstfgrw]obdhcczonzvbfby[svotajtpttohxsh]cooktbyumlpxostt
emzopymywhhxulxuctj[dwwvkzhoigmbmnf]nxgbgfwqvrypqxppyq[qozsihnhpztcrpbdc]rnhnakmrdcowatw[rhvchmzmyfxlolwe]uysecbspabtauvmixa
bqooxxweoytjghrqn[hkwwukixothfyglw]kpasnmikmbzcbfi[vlnyszif... | Korred/advent_of_code_2016 | day_7_part_2.py | Python | mit | 180,795 |
from django.views.generic.edit import CreateView, UpdateView
from django.core.urlresolvers import reverse
from .forms import DetailForm
from .models import Impression
class ImpressionRegisterView(CreateView):
template_name = "detail.html"
form_class = DetailForm
def get_success_url(self):
return... | thinkAmi-sandbox/Django_Djangae_sample | mysite/views.py | Python | unlicense | 590 |
#!/usr/bin/env python
#
# Copyright 2007 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | GoogleCloudPlatform/appengine-python-standard | tests/google/appengine/api/taskqueue/taskqueue_test.py | Python | apache-2.0 | 147,935 |
from __future__ import print_function
from googlevoice import Voice, settings
def run():
voice = Voice()
voice.login()
for feed in settings.FEEDS:
print(feed.title())
for message in getattr(voice, feed)().messages:
print('\t', message)
__name__ == '__main__' and run()
| pettazz/pygooglevoice | examples/folders.py | Python | bsd-3-clause | 315 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to upload images to wikipedia.
Arguments:
-keep Keep the filename as is
-filename Target filename without the namespace prefix
-noverify Do not ask for verification of the upload description if one
is given
-abortonwarn: Abor... | eranroz/hewiktionary_checker | upload.py | Python | mit | 8,269 |
from __future__ import absolute_import
from tests.settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '',
}
}
| frankier/django-betterforms | tests/tests/sqlite_test_settings.py | Python | bsd-2-clause | 177 |
from HTMLParser import HTMLParser
from werkzeug.security import generate_password_hash
from werkzeug.security import check_password_hash
def hash_pass(password):
return generate_password_hash(password, 'pbkdf2:sha256:3000',
salt_length=8)
def is_complete_tags(feed):
parser... | spaceexperiment/forum-app | app/api/helpers.py | Python | mit | 1,226 |
# Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Ben Swartzlander. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2014 Bob Callaw... | saeki-masaki/cinder | cinder/volume/drivers/netapp/dataontap/nfs_cmode.py | Python | apache-2.0 | 24,067 |
from coinpy.tools.bitcoin.sha256 import double_sha256_2_input
from coinpy.lib.transactions.hash_tx import hash_tx
from coinpy.model.protocol.structures.uint256 import Uint256
def next_merkle_level(hashes):
"""hashes: list of bytestring hashes ( use Uint256.get_bytestr() )"""
n = len(hashes)
result = []
... | sirk390/coinpy | coinpy-lib/src/coinpy/lib/transactions/merkle_tree.py | Python | lgpl-3.0 | 3,126 |
# encoding: utf-8
# module PyKDE4.kdecore
# from /usr/lib/python3/dist-packages/PyKDE4/kdecore.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtNetwork as __PyQt4_QtNetwork
class KUser(): # skipped bases: <class 'sip.wrapper'>
# no doc
... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdecore/KUser.py | Python | gpl-2.0 | 2,592 |
# encoding: utf-8
# ******************************************************
# Author : zzw922cn
# Last modified: 2017-12-09 11:00
# Email : zzw922cn@gmail.com
# Filename : calcmfcc.py
# Description : Calculating MFCC feature for Automatic Speech Recognition
# *******************************************... | zzw922cn/Automatic_Speech_Recognition | speechvalley/feature/core/calcmfcc.py | Python | mit | 10,079 |
# -*- coding: utf-8 -*-
from zerver.lib.test_classes import WebhookTestCase
class UpdownHookTests(WebhookTestCase):
STREAM_NAME = 'updown'
URL_TEMPLATE = u"/api/v1/external/updown?stream={stream}&api_key={api_key}"
FIXTURE_DIR_NAME = 'updown'
def test_updown_check_down_event(self):
# type: () ... | sonali0901/zulip | zerver/webhooks/updown/tests.py | Python | apache-2.0 | 2,054 |
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are
#met:
#
... | DLR-SC/DataFinder | src/datafinder/gui/user/models/constants.py | Python | bsd-3-clause | 2,006 |
from Config import addFilter
# It's true, our server-side man pages are deficient
addFilter(r'(beaker-server|beaker-lab-controller)\.noarch: W: no-manual-page-for-binary')
# Kid templates produce a .pyc without a corresponding .py when they are compiled
addFilter(r'python-bytecode-without-source /usr/lib/python.*/si... | beaker-project/beaker | Misc/rpmlint-config.py | Python | gpl-2.0 | 3,395 |
#
# Copyright (c) 2001--2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | dmacvicar/spacewalk | client/rhel/rhnlib/rhn/UserDictCase.py | Python | gpl-2.0 | 2,771 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api
class Partner(models.Model):
_name = 'res.partner'
_inherit = 'res.partner'
property_product_pricelist = fields.Many2one(
'product.pricelist', 'Sale Pricelist',... | chienlieu2017/it_management | odoo/addons/product/models/res_partner.py | Python | gpl-3.0 | 1,853 |
from .PyCurrency import convert, codes
| SiddharthSaxena/PyCurrency-Converter | PyCurrency_Converter/__init__.py | Python | gpl-3.0 | 39 |
# Python - 3.6.0
def testing(actual, expected):
Test.assert_equals(actual, expected)
Test.describe('common_left_edge')
Test.it('Basic tests')
testing(no_boring_zeros(1450), 145)
testing(no_boring_zeros(960000), 96)
testing(no_boring_zeros(1050), 105)
testing(no_boring_zeros(-1050), -105)
testing(no_boring_zeros(0... | RevansChen/online-judge | Codewars/8kyu/no-zeros-for-heros/Python/test.py | Python | mit | 326 |
#!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P netwo... | aurarad/auroracoin | test/functional/p2p_segwit.py | Python | mit | 96,584 |
# Generated by Django 2.2.10 on 2020-02-23 07:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dojo', '0029_cve_regex'),
]
operations = [
migrations.AlterModelOptions(
name='product_type',
options={'ordering': ('name',... | rackerlabs/django-DefectDojo | dojo/db_migrations/0030_prod_type_meta.py | Python | bsd-3-clause | 341 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | ntt-sic/heat | heat/tests/test_event.py | Python | apache-2.0 | 6,185 |
# -*- coding: utf-8 -*-
#
# Candy Basket documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 11 14:14:42 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | ghachey/candy-basket | docs/source/conf.py | Python | gpl-3.0 | 8,073 |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | PaddlePaddle/Paddle | python/paddle/fluid/dygraph/dygraph_to_static/basic_api_transformer.py | Python | apache-2.0 | 5,356 |
# class generated by DeVIDE::createDeVIDEModuleFromVTKObject
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
class vtkImageSeedConnectivity(SimpleVTKClassModuleBase):
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
... | nagyistoce/devide | modules/vtk_basic/vtkImageSeedConnectivity.py | Python | bsd-3-clause | 505 |
from struct import *
print pack('>H', 1)[0]
| uublive/ZenBot | node_modules/namf/test.py | Python | mit | 45 |
import os
import stat
from mimetypes import guess_type
from rest_framework import serializers
from hav.utils.imaginary import generate_thumbnail_url, generate_srcset_urls
from hav.utils.exif import get_exif_data
import logging
logger = logging.getLogger(__name__)
def is_hidden(fn):
return fn.startswith(".")
c... | whav/hav | src/hav/apps/sources/filesystem/api/serializers.py | Python | gpl-3.0 | 4,892 |
# Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | xkcd1253/Mimi | flask/lib/python2.7/site-packages/whoosh/query/compound.py | Python | gpl-2.0 | 21,864 |
import click
import json
from .bloomsky_api import BloomSkyAPIClient, BLOOMSKY_API_KEY_VARIABLE
@click.command(help='Retrieve data from the BloomSky API and output it as JSON.')
@click.option('--api-key', envvar=BLOOMSKY_API_KEY_VARIABLE,
help='BloomSky API key (can be set via env var {0}).'.format(
... | tylerdave/bloomsky-api | bloomsky_api/cli.py | Python | mit | 1,127 |
import os
import threading
import subprocess
import functools
import sublime
import time
class AsyncProcess(object):
def __init__(self, cmd, listener):
self.cmd = cmd
self.listener = listener
self.proc = subprocess.Popen(self.cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ... | EslintSublimePlugin/JSubLint | asyncprocess.py | Python | apache-2.0 | 2,088 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache/incubator-airflow | tests/sensors/test_sql_sensor.py | Python | apache-2.0 | 9,299 |
from unittest.mock import patch
from flask import Flask
from backend.common.deferred.defer_handler import handle_defer, install_defer_routes
from backend.common.url_converters import install_regex_url_converter
def test_install_defer_routes():
route = '/_ah/queue/<regex("deferred.*?"):path>'
app = Flask(__n... | the-blue-alliance/the-blue-alliance | src/backend/common/deferred/tests/defer_handler_test.py | Python | mit | 1,824 |
# -*- coding: utf-8 -*-
import unittest
import trytond.tests.test_tryton
from test_transaction import TestTransaction
def suite():
"""
Define suite
"""
test_suite = trytond.tests.test_tryton.suite()
test_suite.addTests([
unittest.TestLoader().loadTestsFromTestCase(TestTransaction),
])... | prakashpp/trytond-payment-gateway-authorize-net | tests/__init__.py | Python | bsd-3-clause | 426 |
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | DataONEorg/d1_python | test_utilities/src/d1_test/xml_normalize.py | Python | apache-2.0 | 7,611 |
# ***************************************************************************
# * *
# * Copyright (c) 2013-2015 - Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * Th... | bblacey/FreeCAD-MacOS-CI | src/Mod/Fem/PyGui/_CommandFemMeshNetgenFromShape.py | Python | lgpl-2.1 | 3,519 |
import nflgame
def interceptions_thrown(game, home_team):
interceptions_thrown = 0
players = game.max_player_stats()
for player in players:
if 'passing_int' in player.stats and player.home == home_team:
interceptions_thrown += player.stats['passing_int']
return interceptions_thrown
def fumbles_lost(game, h... | MIGreenberg/NFLPredict | scripts/utilities.py | Python | mit | 3,634 |
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import os
import sys
from mailserver.message import EmailRequest
from mailserver.handlers import BaseMessageHandler
from mailserver.exceptions import *
from django.utils import translation
class Command(BaseCommand):... | telenieko/django-mailserver | src/mailserver/management/commands/readmail.py | Python | bsd-3-clause | 902 |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | garyjyao1/ansible | lib/ansible/modules/core/files/stat.py | Python | gpl-3.0 | 13,076 |
"""
Generic test utilities.
"""
import os
import re
import sys
__all__ = ['PytestTester', 'check_free_memory']
class FPUModeChangeWarning(RuntimeWarning):
"""Warning about FPU mode change"""
pass
class PytestTester:
"""
Pytest test runner entry point.
"""
def __init__(self, module_name)... | WarrenWeckesser/scipy | scipy/_lib/_testutils.py | Python | bsd-3-clause | 4,016 |
# coding=utf-8
from pymongo import MongoClient, DESCENDING
from bson.objectid import ObjectId
from datetime import datetime
import time
class BaseModel(object):
client = MongoClient('localhost', 27017)
db = client['disaster']
def process_event(self, event):
if event['latitude'] < 0:
e... | godsarmy/DisasterAnalysis | model.py | Python | gpl-2.0 | 2,860 |
from setuptools import setup
setup(name='bark',
version='0.2',
description='tools for reading and writing Bark formatted data',
url='http://github.com/kylerbrown/bark',
author='Kyler Brown',
author_email='kylerjbrown@gmail.com',
license='GPL',
packages=['bark',
... | gfetterman/bark | setup.py | Python | gpl-2.0 | 2,804 |
# ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# Copyright (c) 2009-2015 Richard Jones, Claudio Canepa
# All rights reserved.
#
# Redistribution and use in source and binary forms, with o... | vyscond/cocos | cocos/scene.py | Python | bsd-3-clause | 6,552 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@authors: Andrés Felipe Calderón andres.calderon@correlibre.org
Sebastián Ortiz V. neoecos@gmail.com
@license: GNU AFFERO GENERAL PUBLIC LICENSE
Caliope Server is the web server of Caliope's Framework
Copyright (C) 2013 Fundación Correlibre
This prog... | CaliopeProject/CaliopeServer | src/utilities/import_colombia_bogota_barrios.py | Python | agpl-3.0 | 6,427 |
"""
Commands
Commands describe the input the player can do to the game.
"""
from evennia import Command as BaseCommand
from evennia import utils
from evennia.commands.default.muxcommand import MuxCommand
from world import rules
from world import english_utils
from random import randint
from evennia.util... | whitehorse-io/encarnia | Encarnia/commands/command.py | Python | mit | 95,381 |
"""
Unit tests for Python ICE-CASCADE hillslope-only example case
"""
import os
import unittest
import py_ice_cascade.examples
class hill_only_TestCase(unittest.TestCase):
def test_run_successfully(self):
"""Confirm the example runs without error"""
file_name = py_ice_cascade.examples.hill_only(... | keithfma/py_ice_cascade | py_ice_cascade/examples/tests/test_hill_only.py | Python | mit | 398 |
# @MUNTJAC_COPYRIGHT@
# @MUNTJAC_LICENSE@
"""Defines a tab sheet component."""
from warnings import warn
from muntjac.terminal.key_mapper import KeyMapper
from muntjac.terminal.paintable import IRepaintRequestListener,\
RepaintRequestEvent
from muntjac.ui.component import IComponent, Event as ComponentEvent
fro... | rwl/muntjac | muntjac/ui/tab_sheet.py | Python | apache-2.0 | 32,530 |
class ValidationException(Exception):
pass
class ValueTypeException(ValidationException):
pass
| neumark/unimodel | unimodel/validation.py | Python | apache-2.0 | 105 |
import json
import unittest
from contextlib import contextmanager
@contextmanager
def mock_stderr():
from cStringIO import StringIO
import sys
_stderr = sys.stderr
sys.stderr = StringIO()
try:
yield sys.stderr
finally:
sys.stderr = _stderr
cla... | leonth/private-configs | sublime-text-3/Packages/Jedi - Python autocompletion/sublime_jedi/test_daemon.py | Python | mit | 1,336 |
# -*- coding: utf-8 -*-
import pytest
import pandas.util.testing as tm
from pandas.core.indexes.api import Index, CategoricalIndex
from .common import Base
from pandas.compat import range, PY3
import numpy as np
from pandas import Categorical, IntervalIndex, compat, notna
from pandas.util.testing import assert_alm... | DGrady/pandas | pandas/tests/indexes/test_category.py | Python | bsd-3-clause | 40,167 |
from amitools.vamos.astructs import AccessStruct, AnchorPathStruct, AChainStruct, FileInfoBlockStruct
from .PathMatch import PathMatch
from amitools.vamos.label import LabelStruct
from .Error import *
class MatchFirstNext:
DODIR = 4
DIDDIR = 8
def __init__(self, path_mgr, lock_mgr, lock, pattern, anchor):
... | FrodeSolheim/fs-uae-launcher | amitools/vamos/lib/dos/MatchFirstNext.py | Python | gpl-2.0 | 5,401 |
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^star_test/', include('star_test.foo.urls')),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs... | jasonculverhouse/django-ca-star | star_test/urls.py | Python | mit | 542 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
url(
r'^$',
'lists.views.home_page',
name='home'),
url(
r'^lists/',
include('lists.urls')),
# url(r'^blog/', include('blog.urls')),
... | JedrzMar/djlearn | djlearn/djlearn/urls.py | Python | unlicense | 367 |
#!/usr/bin/env python
from ncclient import manager
import sys
from lxml import etree
# Set the device variables
DEVICES = ['172.16.30.101', '172.16.30.102']
USER = 'admin'
PASS = 'admin'
PORT = 830
LOOPBACK_IP = {
'172.16.30.101': {'loopback': 'lo101', 'ip': '10.101.1.1/24', 'name': 'Loopback101'},
'172.16.... | DevNetSandbox/sbx_nxos | learning_labs/yang/01-yang/add_loopback_full.py | Python | mit | 2,542 |
"""
Simple contact map plotting 2
=============================
This script contains a simple example of how you can plot
contact maps with a reference structure using ConKit
"""
import conkit.io
import conkit.plot
# Define the input variables
sequence_file = "toxd/toxd.fasta"
sequence_format = "fasta"
contact_file... | rigdenlab/conkit | docs/examples/code/plot_map_reference.py | Python | bsd-3-clause | 1,711 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... | pombredanne/pants | tests/python/pants_test/backend/graph_info/tasks/test_sorttargets.py | Python | apache-2.0 | 2,045 |
"""
import openstackutils,time
from basics import test_resources
from dateutil.parser import parse as parse_date
cwlib = openstackutils.OpenStackUtils()
global test_resources
def test_hard_reboot():
last_boot_before_reboot = get_last_boot_date()
print last_boot_before_reboot
cwlib.server_reboot(test_r... | dalitun/os_image_factory | test-tools/pytesting_os_fe/basics/test_reboot.py | Python | gpl-3.0 | 1,070 |
# (C) British Crown Copyright 2010 - 2018, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | dkillick/iris | lib/iris/__init__.py | Python | lgpl-3.0 | 16,714 |
import SimpleITK as sitk
import sys
import os
if len(sys.argv) < 3:
print('Usage: ' + sys.argv[0] + ' <sequence_file> <output_dir>')
sys.exit(1)
sequence_file = sys.argv[1]
output_dir = sys.argv[2]
input_image = sitk.ReadImage(sequence_file)
number_of_frames = input_image.GetSize()[2]
frame_size = list(inpu... | thewtex/USVolumeReconstructionPresentation | src/compare-sequential.py | Python | apache-2.0 | 1,389 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import SUPERUSER_ID
from odoo.http import Controller, request, route
class TestAssetsBundleController(Controller):
@route('/test_assetsbundle/js', type='http', auth='user')
def bundle(self):
en... | jeremiahyan/odoo | odoo/addons/test_assetsbundle/controllers/main.py | Python | gpl-3.0 | 436 |
# Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | zsoltdudas/lis-tempest | tempest/api/database/versions/test_versions.py | Python | apache-2.0 | 1,580 |
#!/usr/bin/env python
import argparse
import tempfile
import sys
import subprocess
from Bio import SeqIO
from Bio import Seq
from Bio import SeqRecord
import os
import Tools
ap = argparse.ArgumentParser(description="Look to see if an assembly contains an inverted duplication")
ap.add_argument("assembly", help="Asse... | yunlongliukm/chm1_scripts | InvDup/CheckInvDup.py | Python | mit | 6,027 |
import sys
import math
import time
import numpy as np
from actlearn.log.logger import actlearn_logger
class AlFeature(object):
"""
AlFeature class implements the interface of generating data for various
training models.
"""
def __init__(self):
self.logger = actlearn_logger.get_logger('AlF... | TinghuiWang/ActivityLearning | actlearn/data/AlFeature.py | Python | bsd-3-clause | 29,675 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | adamhaney/airflow | airflow/contrib/utils/weekday.py | Python | apache-2.0 | 1,639 |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 13 11:12:22 2017
@author: tih
"""
import gdal
import glob
import os
# directory to the CHIRPS data
Input_folder = r'D:\Python_Training\CHIRPS'
# Change working directory
os.chdir(Input_folder)
# Get all files in working directory ending with tiff
Fil... | Olsthoorn/IHE-python-course-2017 | exercises/Mar14/Tim_Hessels/3_gdal.py | Python | gpl-2.0 | 844 |
# coding=utf-8
"""
Test encoding
"""
# pylint: disable=line-too-long
import locale
import os.path
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../lib')))
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import sickbeard
fro... | Maximilian-Reuter/SickRage-1 | tests/encoding_tests.py | Python | gpl-3.0 | 1,728 |
import requests
class PyDomainr(object):
def __init__(self, domain):
"""
Prepare the API urls
"""
self.DOMAIN = domain
self.SEARCH = "https://domai.nr/api/json/search?q=" + self.DOMAIN
self.INFO = "https://domai.nr/api/json/info?q=" + self.DOMAIN
def _api_sear... | davidhax0r/PyDomainr | pydomainr/PyDomainr.py | Python | mit | 3,253 |
# This file is part of OpenHatch.
# Copyright (C) 2010 Jack Grigg
# Copyright (C) 2010 John Stumpo
# Copyright (C) 2010, 2011 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundat... | jledbetter/openhatch | mysite/missions/svn/forms.py | Python | agpl-3.0 | 1,123 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#--------------------------------------------------------------------
# Copyright (c) 2014 Eren Inan Canpolat
# Author: Eren Inan Canpolat <eren.canpolat@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General... | canpolat/bookbinder | bookbinder/templates.py | Python | gpl-3.0 | 2,011 |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from . instructions import *
class Assembler:
# Tokens
TOK_FUNCTION = "function"
TOK_LOOP = 'loop'
TOK_SPECIAL = [')', '}']
# List of addresses where... | lowRISC/ot-dsim | bignum_lib/assembler.py | Python | apache-2.0 | 6,745 |
import logging
from vcftoolbox import Genotype
from puzzle.models import Genotype as puzzle_genotype
logger = logging.getLogger(__name__)
class GenotypeExtras(object):
"""Class to store methods that deals with genotyping"""
def _add_genotype_calls(self, variant_obj, variant_line, case_obj):
"""Add ... | robinandeer/puzzle | puzzle/plugins/vcf/mixins/variant_extras/genotype.py | Python | mit | 1,708 |
import logging
import re
from typing import Any, TYPE_CHECKING, Tuple
from aiohttp import web
import aiohttp_cors
import trafaret as t
from ai.backend.common import msgpack
from ai.backend.common.logging import BraceStyleAdapter
from ..models import (
keypairs,
vfolders,
query_accessible_vfolders,
qu... | lablup/backend.ai-manager | src/ai/backend/manager/api/userconfig.py | Python | lgpl-3.0 | 9,366 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2019 Satpy developers
#
# This file is part of satpy.
#
# satpy is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the Licens... | pytroll/satpy | satpy/readers/geocat.py | Python | gpl-3.0 | 11,177 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.