repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
h3llrais3r/SickRage
tests/sickrage_tests/system/restart_tests.py
11
2065
# coding=utf-8 # This file is part of SickRage. # # URL: https://SickRage.GitHub.io # Git: https://github.com/SickRage/SickRage.git # # SickRage 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...
gpl-3.0
-2,386,048,170,170,041,300
26.171053
92
0.634867
false
heke123/chromium-crosswalk
tools/perf/benchmarks/benchmark_unittest.py
9
3252
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """For all the benchmarks that set options, test that the options are valid.""" from collections import defaultdict import os import unittest from core imp...
bsd-3-clause
5,760,761,009,831,713,000
34.347826
79
0.72294
false
android-ia/platform_external_chromium_org
tools/telemetry/telemetry/util/find_dependencies.py
44
9255
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import fnmatch import imp import logging import modulefinder import optparse import os import sys import zipfile from telemetry import benchmark from teleme...
bsd-3-clause
6,997,971,101,533,571,000
34.056818
79
0.690438
false
yamt/ryu
ryu/contrib/tinyrpc/client.py
41
3068
#!/usr/bin/env python # -*- coding: utf-8 -*- from .exc import RPCError class RPCClient(object): """Client for making RPC calls to connected servers. :param protocol: An :py:class:`~tinyrpc.RPCProtocol` instance. :param transport: A :py:class:`~tinyrpc.transports.ClientTransport` i...
apache-2.0
4,046,889,542,201,563,600
32.714286
75
0.602673
false
ran5515/DeepDecision
tensorflow/contrib/keras/api/keras/losses/__init__.py
46
2097
# 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...
apache-2.0
-6,870,872,283,188,723,000
47.767442
88
0.787792
false
jwaterfield/echidna
echidna/core/config.py
3
30495
""" Echidna's config module. Contains the :class:`Config` class and all classes that inherit from it. """ from echidna.core.parameter import (RateParameter, ScaleParameter, ShiftParameter, ResolutionParameter, SpectraParameter) import echidna.util...
mit
1,853,991,416,891,235,600
35.608643
79
0.56629
false
takeshineshiro/django
django/contrib/gis/geos/geometry.py
62
23807
""" This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. """ from __future__ import unicode_literals import json from ctypes import addressof, byref, c_double from django.contrib.gis import gdal from django.contrib.gis.geometry.regex import hex_regex, json_regex, wkt_...
bsd-3-clause
-2,943,236,041,467,925,500
34.113569
98
0.610241
false
kjenagan/support-tools
wiki_to_md/impl/constants.py
151
6658
# Copyright 2014 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 by applicable law or a...
apache-2.0
-7,799,813,987,998,022,000
34.604278
80
0.55377
false
njmube/erpnext
erpnext/accounts/report/gross_profit/gross_profit.py
2
11352
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, scrub from erpnext.stock.utils import get_incoming_rate from frappe.utils import flt def execute(filters=None): i...
agpl-3.0
3,431,795,502,308,422,000
37.744027
133
0.672569
false
bauruine/ansible
lib/ansible/utils/module_docs.py
37
3751
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () gmail.com> # # 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...
gpl-3.0
1,847,067,734,821,391,600
37.27551
98
0.564916
false
christabor/csscms
csscms/parser.py
1
18081
from tinycss.page3 import CSSPage3Parser import css_properties from css_options import css_opts from validations import ValidationHelpersMixin DEBUG = True if __name__ == '__main__' else False class MissingTokenType(Exception): def __init__(self): print('Invalid token type: please add a ' ...
mit
3,827,365,593,276,648,400
42.05
80
0.489907
false
geekaia/edx-platform
common/lib/xmodule/xmodule/modulestore/xml_importer.py
2
34084
import logging import os import mimetypes from path import path import json from .xml import XMLModuleStore, ImportSystem, ParentTracker from xblock.runtime import KvsFieldData, DictKeyValueStore from xmodule.x_module import XModuleDescriptor from opaque_keys.edx.keys import UsageKey from xblock.fields import Scope, R...
agpl-3.0
5,372,706,767,173,254,000
41.287841
132
0.574845
false
linucks/ample
ample/util/benchmark_util.py
1
21169
""" Created on 24 Oct 2014 @author: jmht """ import copy import glob import logging import os import pandas as pd import shutil import sys from ample.util import ample_util, csymmatch, mtz_util, pdb_edit, pdb_model, reforigin, residue_map, rio, shelxe, tm_util logger = logging.getLogger(__name__) _oldroot = None _...
bsd-3-clause
-1,597,505,587,474,846,000
36.073555
121
0.604752
false
jijo-paulose/django-profile
userprofile/forms.py
8
5911
from django import forms from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils.translation import ugettext as _ from django.conf import settings from django.contrib.auth.models import User, SiteProfileNotAvailable fro...
bsd-2-clause
-1,129,405,634,935,675,900
34.824242
191
0.655219
false
Stavitsky/neutron
neutron/tests/functional/sanity/test_sanity.py
16
2331
# Copyright (c) 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...
apache-2.0
-344,964,345,661,523,300
32.782609
78
0.716431
false
HyperBaton/ansible
lib/ansible/modules/network/onyx/onyx_syslog_files.py
9
9770
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
-4,161,985,767,672,920,600
37.769841
141
0.571546
false
auth0/auth0-python
auth0/v3/management/roles.py
1
6446
from .rest import RestClient class Roles(object): """Auth0 roles endpoints Args: domain (str): Your Auth0 domain, e.g: 'username.auth0.com' token (str): Management API v2 Token telemetry (bool, optional): Enable or disable Telemetry (defaults to True) timeout (f...
mit
5,198,107,932,430,788,000
32.572917
94
0.578964
false
jaj42/GraPhysio
graphysio/ui/filter.py
2
1823
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'filter.ui' # # Created by: PyQt5 UI code generator 5.12.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Filter(object): def setupUi(self, Filter): Filter.setObjec...
isc
-8,363,552,881,860,783,000
39.511111
74
0.704334
false
chrisfilda/edx_platform
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
10
5756
import json import logging from dogapi import dog_stats_api from .grading_service_module import GradingService, GradingServiceError log = logging.getLogger(__name__) class PeerGradingService(GradingService): """ Interface with the grading controller for peer grading """ METRIC_NAME = 'edxapp.open_e...
agpl-3.0
4,439,894,083,890,909,000
37.373333
139
0.602675
false
sallaire/Sick-Beard
sickbeard/history.py
35
2768
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
1,924,477,128,454,491,400
32.197531
132
0.682081
false
jdahlin/pygobject
tests/test_overrides.py
1
79982
# -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab import unittest import sys sys.path.insert(0, "../") from compathelper import _long, _unicode, _bytes from gi.repository import GLib from gi.repository import GObject from gi.repository import Gdk from gi.repository import Gtk from ...
lgpl-2.1
-6,499,490,523,823,670,000
38.303194
105
0.549461
false
Ant-OS/android_packages_apps_OTAUpdates
jni/boost_1_57_0/libs/mpi/test/python/scan_test.py
64
1125
# Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. # Use, modification and distribution is subject to the Boost Software # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Test scan() collective. import boost.parallel.mpi as mpi from gen...
apache-2.0
-2,406,138,908,375,356,400
37.793103
97
0.669333
false
myerpengine/odoo
openerp/addons/base/res/res_company.py
37
21361
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-6,809,513,469,689,821,000
50.72155
168
0.587285
false
MortalViews/incubator-airflow
airflow/operators/mysql_operator.py
16
2061
# -*- coding: utf-8 -*- # # 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 agreed to in writing, software ...
apache-2.0
-1,672,155,234,579,200,300
36.472727
79
0.67443
false
jsgreenwell/teaching-python
classnotes/Knapsack/make_change.alpha.py
1
1842
from collections import OrderedDict import pprint '''Basic change making program using 100 base (American Currency): will create full knapsack version in later example. This example will also be expanded, in steps, until it becomes a simple OO-based (ie. we'll add classes) POS system with database tie-in.''' d...
mit
-5,619,207,900,094,432,000
38.191489
103
0.67481
false
rhattersley/iris
lib/iris/tests/unit/analysis/test_RMS.py
17
3959
# (C) British Crown Copyright 2013 - 2015, 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...
lgpl-3.0
4,602,450,948,508,187,000
36.349057
78
0.629957
false
joshrule/LOTlib
LOTlib/Examples/Number/Adapt.py
2
1558
# -*- coding: utf-8 -*- """ Use optimal adaptation code to adapt show possible adpatations to the Number grammar. """ import pickle import LOTlib from LOTlib.Examples.Number.Model import * from LOTlib.Miscellaneous import Infinity from LOTlib.sandbox.OptimalGrammarAdaptation import print_subtree_adaptations ## WHAT ...
gpl-3.0
-967,178,254,044,213,400
34.409091
105
0.689987
false
timlinux/QGIS
python/pyplugin_installer/unzip.py
53
2524
# -*- coding:utf-8 -*- """ /*************************************************************************** Plugin Installer module unzip function ------------------- Date : May 2013 Copyright : (C) 2013 ...
gpl-2.0
240,422,428,439,734,620
38.4375
82
0.482964
false
appsecyogi/Mobile-Security-Framework-MobSF
install/windows/rpc_client.py
4
5192
"""MobSF rpc_client for static windows app analysis.""" # pylint: disable=C0325,W0603,C0103 import os from os.path import expanduser import re import subprocess import configparser # pylint: disable-msg=E0401 import hashlib import random import string import base64 from xmlrpc.server import SimpleXMLRPCServer # pylint...
gpl-3.0
5,088,853,456,776,950,000
26.183246
96
0.622304
false
manmeetsaini/etools
etools-module/backup/find_callid.py
1
1271
# Python Regex module to find Call ID in SIP Trace #function will search first for SIP event "INVITE sip:" and Start Loggin Information #Logging will be continued till string "Content-Length:" which indicates end of SIP Message #A sub-function will search for sting "CallID:" and print that entire line import re ...
gpl-3.0
722,944,002,184,813,300
50.958333
152
0.56727
false
robgolding63/tasklib
setup.py
2
1199
from setuptools import setup, find_packages install_requirements = ['pytz', 'tzlocal'] version = '2.3.0' try: import importlib except ImportError: install_requirements.append('importlib') setup( name='tasklib', version=version, description='Python Task Warrior library', long_description=open...
bsd-3-clause
-8,372,051,320,592,953,000
30.552632
71
0.642202
false
djmonta/iTerm2
tests/esctest/tests/decset_tite_inhibit.py
31
2003
from tests.save_restore_cursor import SaveRestoreCursorTests import esccmd from escutil import knownBug class DECSETTiteInhibitTests(SaveRestoreCursorTests): def __init__(self): SaveRestoreCursorTests.__init__(self) def saveCursor(self): esccmd.DECSET(esccmd.SaveRestoreCursor) def restoreCursor(self): ...
gpl-2.0
-4,726,400,558,133,171,000
39.877551
78
0.8003
false
photoninger/ansible
test/units/plugins/test_plugins.py
51
5435
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # 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) an...
gpl-3.0
5,929,484,473,491,812,000
38.384058
103
0.627599
false
pcm17/tensorflow
tensorflow/contrib/rnn/python/kernel_tests/rnn_test.py
34
19680
# Copyright 2015 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...
apache-2.0
3,418,193,453,613,424,000
42.063457
80
0.611636
false
icereval/raven-python
raven/contrib/pylons/__init__.py
8
1113
""" raven.contrib.pylons ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from raven.middleware import Sentry as Middleware from raven.base import Client def list_from_setting(conf...
bsd-3-clause
390,201,523,557,938,700
31.735294
76
0.628032
false
vganapath/rally
doc/ext/cli_reference.py
5
8151
# Copyright 2016: Mirantis 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...
apache-2.0
-6,511,918,581,245,153,000
38.567961
79
0.600049
false
toshywoshy/ansible
lib/ansible/modules/remote_management/ucs/ucs_vhba_template.py
5
11061
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
-5,834,770,573,656,416,000
39.494505
139
0.594934
false
thaim/ansible
lib/ansible/module_utils/mysql.py
8
4390
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
mit
-6,785,427,000,747,164,000
40.809524
149
0.68656
false
campbe13/openhatch
vendor/packages/twisted/twisted/conch/test/test_knownhosts.py
18
34421
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.client.knownhosts}. """ import os from binascii import Error as BinasciiError, b2a_base64, a2b_base64 try: import Crypto import pyasn1 except ImportError: skip = "PyCrypto and PyASN1 required for twisted...
agpl-3.0
5,378,683,661,628,814,000
34.159346
96
0.625432
false
sabi0/intellij-community
python/testData/highlighting/builtins.py
21
1169
# bg is always black. # effect is white # func decl: red bold # class decl: blue bold # predefined decl: green bold # predefined usage: yellow bold <info descr="PY.BUILTIN_NAME" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">len</info>("") len = []...
apache-2.0
-1,065,888,940,072,022,400
52.136364
231
0.737382
false
pkscout/script.argustv-helper
resources/common/fileops.py
1
2425
# v.0.3.0 import ntpath, xbmcvfs def checkDir( path ): log_lines = [] log_lines.append( 'checking for directory ' + path ) if not xbmcvfs.exists( path ): log_lines.append( 'directory does not exist, creating it' ) xbmcvfs.mkdirs( path ) return False, log_lines else: lo...
gpl-2.0
-5,305,518,762,724,362,000
31.346667
86
0.57732
false
joshloyal/scikit-learn
sklearn/cross_decomposition/cca_.py
151
3192
from .pls_ import _PLS __all__ = ['CCA'] class CCA(_PLS): """CCA Canonical Correlation Analysis. CCA inherits from PLS with mode="B" and deflation_mode="canonical". Read more in the :ref:`User Guide <cross_decomposition>`. Parameters ---------- n_components : int, (default 2). numb...
bsd-3-clause
6,797,747,534,564,379,000
28.831776
77
0.591792
false
AIML/scikit-learn
sklearn/svm/bounds.py
280
2911
"""Determination of parameter bounds""" # Author: Paolo Losi # License: BSD 3 clause from warnings import warn import numpy as np from ..preprocessing import LabelBinarizer from ..utils.validation import check_consistent_length, check_array from ..utils.extmath import safe_sparse_dot def l1_min_c(X, y, loss='squar...
bsd-3-clause
-3,627,204,125,854,289,400
34.938272
75
0.639299
false
simone/django-gb
tests/view_tests/tests/test_csrf.py
20
2641
from django.test import TestCase, override_settings, Client from django.utils.translation import override class CsrfViewTests(TestCase): urls = "view_tests.urls" def setUp(self): super(CsrfViewTests, self).setUp() self.client = Client(enforce_csrf_checks=True) @override_settings( ...
bsd-3-clause
7,417,635,440,847,023
39.630769
80
0.560015
false
sarvex/tensorflow
tensorflow/python/ops/linalg/linear_operator_tridiag.py
6
15035
# Copyright 2019 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...
apache-2.0
-1,361,036,921,529,727,500
37.551282
99
0.642102
false
woobe/h2o
py/testdir_single_jvm/test_players_NA_fvec.py
1
1180
import unittest, random, sys, time sys.path.extend(['.','..','py']) import h2o_hosts import h2o, h2o_cmd, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_localhost() if ...
apache-2.0
-6,627,453,217,927,929,000
32.714286
102
0.634746
false
minixalpha/SourceLearning
webpy/src/web/net.py
14
6188
""" Network Utilities (from web.py) """ __all__ = [ "validipaddr", "validip6addr", "validipport", "validip", "validaddr", "urlquote", "httpdate", "parsehttpdate", "htmlquote", "htmlunquote", "websafe", ] import urllib, time try: import datetime except ImportError: pass import re import socket def validip6ad...
apache-2.0
-3,048,900,467,812,724,700
24.360656
91
0.507595
false
gangadharkadam/saloon_erp_install
erpnext/patches/v5_4/notify_system_managers_regarding_wrong_tax_calculation.py
17
1431
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.email import sendmail_to_system_managers from frappe.utils import get_url_to_form def execute(): wrong_records = [] for ...
agpl-3.0
-8,569,094,847,322,845,000
33.926829
280
0.703704
false
MKaptein/streamingbandit
app/app.py
2
4233
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Imports of external stuff that is needed import tornado.escape import tornado.ioloop import tornado.web import logging import os,yaml import logging.handlers # import scheduling ingredients from apscheduler.schedulers.tornado import TornadoScheduler from core.jobs impor...
mit
4,419,560,470,096,845,000
32.070313
109
0.700685
false
makiftasova/hangoutsbot
hangupsbot/plugins/monitoradds.py
4
3384
""" Plugin for monitoring new adds to HOs and alerting if users were not added by an admin or mod. Add mods to the config.json file either globally or on an individual HO basis. Add a "watch_new_adds": true parameter to individual HOs in the config.json file. Author: @Riptides """ import logging import hangups impo...
agpl-3.0
-2,890,979,573,270,586,000
36.186813
94
0.615544
false
pulilab/rapidpro
temba/orgs/tests.py
1
148553
from __future__ import unicode_literals import json import nexmo import pytz import six from bs4 import BeautifulSoup from context_processors import GroupPermWrapper from datetime import timedelta from dateutil.relativedelta import relativedelta from decimal import Decimal from django.conf import settings from djang...
agpl-3.0
256,906,765,567,054,940
45.263781
211
0.619429
false
ormnv/os_final_project
django/contrib/formtools/wizard/storage/base.py
216
3949
from django.core.files.uploadedfile import UploadedFile from django.utils.datastructures import MultiValueDict from django.utils.functional import lazy_property from django.utils import six from django.contrib.formtools.wizard.storage.exceptions import NoFileStorageConfigured class BaseStorage(object): step_key ...
bsd-3-clause
-8,880,234,629,230,541,000
35.229358
86
0.612813
false
blowmage/gcloud-python
gcloud/datastore/test_helpers.py
1
21896
# Copyright 2014 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 by applicable law or a...
apache-2.0
5,399,180,068,628,099,000
31.729447
77
0.610659
false
yuuki0xff/conoha-cli
conoha/api.py
1
4205
# -*- coding: utf8 -*- from urllib.request import Request, urlopen import json __all__ = 'API'.split() class DictWrapper(dict): """ dictインスタンスへインスタンス変数を追加するために使用する """ pass class BytesWrapper(bytes): """ bytesインスタンスへインスタンス変数を追加するために使用する """ pass class API: """全てのConoHa APIを呼び出すクラスのスーパークラス""" def __init__(self...
mit
-2,840,345,970,994,860,500
25.375
82
0.663228
false
lewischeng-ms/pox
tools/gui/communication.py
5
6464
''' This module implements the communication between - the topology view and the monitoring backend that feeds it - the log view and NOX's logger - the json command prompt and NOX's json messenger @author Kyriakos Zarifis ''' from PyQt4 import QtGui, QtCore import SocketServer import socket ...
gpl-3.0
4,608,129,796,024,915,500
33.333333
92
0.552908
false
andremiller/beets
test/test_info.py
1
2980
# This file is part of beets. # Copyright 2015, Thomas Scholtes. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
mit
-8,962,617,192,949,331,000
29.721649
71
0.631208
false
erja-gp/openthread
tools/harness-automation/cases/leader_9_2_19.py
1
1877
#!/usr/bin/env python # # Copyright (c) 2018, The OpenThread Authors. # 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...
bsd-3-clause
9,147,256,269,640,792,000
42.651163
77
0.76292
false
zbassett/curling-robot
RaspberryPi/DjangoSite/mysite/curling/migrations/0011_auto_20170212_1701.py
1
1906
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-12 17:01 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('curling', '0010_auto_20170212_0059'), ] operations = [...
apache-2.0
-298,829,525,224,297,300
29.741935
74
0.564008
false
bestvibes/neo4j-social-network
env/lib/python2.7/encodings/utf_8_sig.py
412
3685
""" Python 'utf-8-sig' Codec This work similar to UTF-8 with the following changes: * On encoding/writing a UTF-8 encoded BOM will be prepended/written as the first three bytes. * On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these bytes will be skipped. """ import codecs ### Codec APIs ...
mit
-3,957,171,078,987,142,700
30.495726
86
0.594844
false
lyarwood/sosreport
sos/plugins/tuned.py
12
1405
# Copyright (C) 2014 Red Hat, Inc., Peter Portante <peter.portante@redhat.com> # This program 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 the License, or # (at your option) any later v...
gpl-2.0
-8,787,321,416,193,321,000
31.674419
78
0.64484
false
gustavla/dotfiles
ipython_config.py
1
19767
# Configuration file for ipython. c = get_config() #------------------------------------------------------------------------------ # InteractiveShellApp configuration #------------------------------------------------------------------------------ # A Mixin for applications that start InteractiveShell instances. # #...
bsd-3-clause
-2,714,081,084,654,380,000
36.156015
417
0.678403
false
renfufei/shadowsocks
setup.py
16
1321
import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name="shadowsocks", version="2.6.9", license='http://www.apache.org/licenses/LICENSE-2.0', description="A fast tunnel proxy that help you get through firewalls", ...
apache-2.0
671,132,354,688,114,700
32.871795
74
0.628312
false
didrocks/notifythis
setup.py
1
3960
#!/usr/bin/env python # -*- coding: utf-8 -*- ### BEGIN LICENSE # Copyright (C) 2009 Didier Roche <didrocks@ubuntu.com> #This program 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 ...
gpl-3.0
-6,710,332,967,694,194,000
37.407767
227
0.598079
false
nacc/autotest
tko/parsers/base.py
6
2468
import traceback from autotest.tko import status_lib, utils as tko_utils class parser(object): """ Abstract parser base class. Provides a generic implementation of the standard parser interfaction functions. The derived classes must implement a state_iterator method for this class to be useful. "...
gpl-2.0
7,442,934,286,513,475,000
34.257143
72
0.58752
false
Mercy-Nekesa/sokoapp
sokoapp/coupons/tests/runtests.py
1
1632
#!/usr/bin/env python """ Inspired by https://github.com/mbrochh/tdd-with-django-reusable-app Thanks a lot! """ import os import sys from django.conf import settings EXTERNAL_APPS = [ 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django...
mit
-2,425,353,090,264,759,300
23.727273
89
0.655025
false
jasonzio/azure-linux-extensions
TestHandlerLinux/bin/update.py
16
1941
#!/usr/bin/env python """ Example Azure Handler script for Linux IaaS Update example Reads port from Public Config if present. Creates service_port.txt in resources dir. Copies the service to /usr/bin and updates it with the resource path. """ import os import sys import imp import time waagent=imp.load_source('waage...
apache-2.0
6,453,885,694,542,302,000
35.622642
202
0.741886
false
ofekd/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_config.py
166
19617
import py, pytest import _pytest._code from _pytest.config import getcfg, get_common_ancestor, determine_setup from _pytest.main import EXIT_NOTESTSCOLLECTED class TestParseIni: def test_getcfg_and_config(self, testdir, tmpdir): sub = tmpdir.mkdir("sub") sub.chdir() tmpdir.join("setup.cfg"...
mpl-2.0
-4,517,664,339,345,212,000
33.415789
79
0.560126
false
danigonza/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/encoder.py
484
25695
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
4,529,076,061,507,872,300
32.413524
80
0.67663
false
aml-development/ozp-backend
ozpcenter/api/listing/elasticsearch_util.py
1
31164
""" Elasticsearch Utils -------------------------- Contains Elasticsearch common functions ===== Code was developed to work with Elasticsearch 2.4.* Reference number_of_shards number_of_replicas https://www.elastic.co/guide/en/elasticsearch/guide/current/_how_primary_and_replica_shards_interact.html ...
apache-2.0
4,865,171,994,808,371,000
29.824926
186
0.509755
false
luxnovalabs/enjigo_door
web_interface/djangoappengine/tests/test_order.py
28
2128
from django.test import TestCase from .models import OrderedModel class OrderTest(TestCase): def create_ordered_model_items(self): pks = [] priorities = [5, 2, 9, 1] for pk, priority in enumerate(priorities): pk += 1 model = OrderedModel(pk=pk, priority=priority) ...
unlicense
-5,903,230,919,851,812,000
32.777778
72
0.595395
false
sookasa/heroku-buildpack-python-pipeline
vendor/pip-1.2.1/tests/test_pip.py
9
21936
#!/usr/bin/env python import os import sys import tempfile import shutil import glob import atexit import textwrap import site from scripttest import TestFileEnvironment, FoundDir from tests.path import Path, curdir, u from pip.util import rmtree pyversion = sys.version[:3] # the directory containing all the tests h...
mit
-8,443,685,254,185,968,000
34.495146
119
0.602571
false
aaossa/Dear-Notebooks
Web scraping/Download big files/download_big_files_asynchronous.py
1
1220
# https://community.nitrous.io/tutorials/asynchronous-programming-with-python-3 import aiohttp import asyncio import itertools async def download(url, parts=16): print("URL: {}".format(url)) async def get_partial_content(_url, _part, start, end): print("Part {}/{} (Bytes {} to {})".format(_part, pa...
gpl-3.0
982,819,040,774,631,800
31.105263
84
0.62377
false
yawnosnorous/python-for-android
python-modules/twisted/twisted/words/xish/xpathparser.py
54
19140
# Copyright (c) 2001-2007 Twisted Matrix Laboratories. # See LICENSE for details. # DO NOT EDIT xpathparser.py! # # It is generated from xpathparser.g using Yapps. Make needed changes there. # This also means that the generated Python may not conform to Twisted's coding # standards. # HOWTO Generate me: # # 1.) Grab ...
apache-2.0
2,842,590,002,102,800,000
36.677165
161
0.539812
false
att-comdev/armada
armada/common/policies/service.py
1
1640
# 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 agreed to in writing, software # distributed under t...
apache-2.0
996,674,534,165,874,000
37.139535
78
0.679268
false
adelina-t/nova
nova/tests/functional/v3/test_hypervisors.py
15
2770
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
apache-2.0
181,188,094,280,143,840
38.571429
79
0.647292
false
priomsrb/fixthecode
wsgi/fixthecode/wsgi.py
1
1431
""" WSGI config for fixthecode project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION...
gpl-2.0
-7,313,665,083,643,825,000
43.71875
79
0.794549
false
kingfisher1337/tns
tnslib/tebd.py
1
14341
import numpy as np from numpy import dot, einsum from numpy import tensordot as tdot from scipy.optimize import minimize import ctm import gates def _make_double_layer_tensor(a, D): return einsum(a, [8,0,2,4,6], a.conj(), [8,1,3,5,7]).reshape([D**2]*4) def _itebd_square_fu_singlebond(a, b, abg, env): tdot(b, ...
gpl-3.0
-7,851,900,125,077,569,000
44.382911
174
0.48832
false
indictranstech/fbd_erpnext
erpnext/accounts/report/gst_sales_details/gst_sales_details.py
1
1362
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, getdate, cstr from frappe import _ from datetime import date, timedelta def execute(filters=None): columns, res = ...
agpl-3.0
-4,494,135,122,879,182,300
33.05
117
0.684288
false
guorendong/iridium-browser-ubuntu
third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/parse/parser.py
32
13000
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generates a syntax tree from a Mojo IDL file.""" import imp import os.path import sys def _GetDirAbove(dirname): """Returns the directory "above" this...
bsd-3-clause
-2,771,780,858,649,125,000
30.25
80
0.575077
false
niboshi/chainer
tests/chainer_tests/functions_tests/array_tests/test_concat.py
8
3200
import unittest import numpy from chainer import functions from chainer import testing from chainer.testing import backend @backend.inject_backend_tests( None, # CPU tests testing.product({ 'use_cuda': [False], 'use_ideep': ['never', 'always'], }) # GPU tests + [{'use_cuda': ...
mit
-4,437,385,667,340,061,000
34.555556
79
0.505938
false
crmccreary/openerp_server
openerp/addons/l10n_ch/account_wizard.py
8
1854
# -*- encoding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA # # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
-2,450,864,651,463,428,000
39.26087
108
0.639309
false
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/bayesflow/python/ops/custom_grad.py
44
1222
# Copyright 2017 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...
mit
353,235,550,795,910,660
34.941176
80
0.715221
false
hashemd/Advanced-Virtual-Digest
libs/bs4/tests/test_html5lib.py
20
2299
"""Tests to ensure that the html5lib tree builder generates good trees.""" import warnings try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError, e: HTML5LIB_PRESENT = False from bs4.element import SoupStrainer from bs4.testing import ( HTML5TreeBuilderSmokeTest, ...
mit
-4,729,682,335,137,385
30.930556
81
0.581557
false
wyom/sympy
sympy/functions/combinatorial/tests/test_comb_factorials.py
16
12552
from sympy import (S, Symbol, symbols, factorial, factorial2, binomial, rf, ff, gamma, polygamma, EulerGamma, O, pi, nan, oo, zoo, simplify, expand_func, Product) from sympy.functions.combinatorial.factorials import subfactorial from sympy.functions.special.gamma_functions import u...
bsd-3-clause
4,443,702,297,015,131,000
33.866667
90
0.616077
false
cadeef/murano-app-incubator
io.murano.apps.openstack.MuranoDashboard/Resources/scripts/settings.py
5
5035
import logging import os import sys import tempfile from openstack_dashboard import exceptions ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) BIN_DIR = os.path.abspath(os.path.join(ROOT_PATH, '..', 'bin')) if ROOT_PATH not in sys.path: sys.path.append(ROOT_PATH) DEBUG = False TEMPLATE_DEBUG = DEBUG MET...
apache-2.0
4,834,889,914,309,666,000
28.450292
78
0.693744
false
jasonzzz/ansible
lib/ansible/plugins/callback/syslog_json.py
54
2725
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import logging import logging.handlers import socket from ansible.plugins.callback import CallbackBase class CallbackModule(CallbackBase): """ logs ansible-playbook a...
gpl-3.0
-4,654,480,889,485,450,000
40.287879
145
0.67633
false
viniciusgama/blog_gae
djangoappengine/settings_base.py
13
1463
# Initialize App Engine SDK if necessary try: from google.appengine.api import api_proxy_stub_map except ImportError: from .boot import setup_env setup_env() from djangoappengine.utils import on_production_server, have_appserver DEBUG = not on_production_server TEMPLATE_DEBUG = DEBUG ROOT_URLCONF = 'urls...
bsd-3-clause
6,489,333,417,500,055,000
26.603774
77
0.713602
false
mhnatiuk/phd_sociology_of_religion
scrapper/build/cryptography/src/cryptography/exceptions.py
2
1131
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function class _Reasons(object): BACKEND_MISSING_INTERFACE = object() UNS...
gpl-2.0
7,549,449,954,346,308,000
19.563636
79
0.714412
false
alejob/mdanalysis
package/MDAnalysis/lib/formats/__init__.py
1
1067
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- http://www.mdanalysis.org # Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under th...
gpl-2.0
7,067,743,097,824,127,000
43.458333
79
0.710403
false
liminspace/dju-common
dju_common/db.py
1
2044
# coding=utf-8 import gc from django.shortcuts import _get_queryset def get_object_or_None(klass, *args, **kwargs): """ Uses get() to return an object or None if the object does not exist. klass may be a Model, Manager, or QuerySet object. All other passed arguments and keyword arguments are used in t...
mit
622,101,551,345,548,300
29.969697
104
0.562133
false
undoware/neutron-drive
google_appengine/lib/django_1_3/django/contrib/gis/utils/geoip.py
316
14811
""" This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R) C API (http://www.maxmind.com/app/c). This is an alternative to the GPL licensed Python GeoIP interface provided by MaxMind. GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts. For IP-based geolocation, t...
bsd-3-clause
6,743,414,932,545,714,000
40.027701
117
0.625414
false
kkopachev/thumbor
thumbor/detectors/face_detector/__init__.py
2
1450
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from thumbor.detectors.local_detector import CascadeLoaderDetector f...
mit
7,522,784,922,359,123,000
31.222222
88
0.617931
false
mano3m/CouchPotatoServer
libs/migrate/versioning/schema.py
53
7595
""" Database schema version management. """ import sys import logging from sqlalchemy import (Table, Column, MetaData, String, Text, Integer, create_engine) from sqlalchemy.sql import and_ from sqlalchemy import exceptions as sa_exceptions from sqlalchemy.sql import bindparam from migrate import exceptions fro...
gpl-3.0
-3,910,936,555,446,583,000
33.522727
82
0.616195
false
btoconnor/ddby
ddby/serializer.py
1
1436
# -*- coding: utf-8 -*- from .money import Money class Serializer: """Serialize a Money object for sending over the wire. It is not recommended to use the utility of this class to store in the database. This would prevent you from doing anything with aggregate functions in SQL, such as SUM, MAX,...
mit
2,111,841,295,586,036,200
30.911111
95
0.610028
false
lordmuffin/aws-cfn-plex
functions/credstash/cryptography/utils.py
13
3919
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import binascii import inspect import sys import warnings # ...
mit
-6,652,670,604,716,353,000
27.605839
79
0.639449
false
Sup3Roque/Pancas
plugin.video.loganaddon/resources/lib/libraries/playcount_cp.py
9
4289
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda This program 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 l...
gpl-2.0
6,095,900,826,754,694,000
31.740458
138
0.63931
false
kurdd/Oauth
social_auth/backends/contrib/yandex.py
3
4660
""" Yandex OpenID and OAuth2 support. This contribution adds support for Yandex.ru OpenID service in the form openid.yandex.ru/user. Username is retrieved from the identity url. If username is not specified, OpenID 2.0 url used for authentication. """ from django.utils import simplejson from urllib import urlencode ...
apache-2.0
1,128,196,562,051,191,600
28.125
75
0.590558
false
adamewing/tebreak
scripts/misc/genotype_ref.py
1
4350
#!/usr/bin/env python import argparse import csv import os import pysam def break_count(bam, chrom, poslist, minpad=5, flex=1, minmapq=10): ''' ref = number of reads spanning TSD, alt = number of reads clipped at breakpoint in poslist ''' altcount = 0 refcount = 0 discards = 0 poslist = list(po...
mit
6,110,236,832,210,215,000
28.794521
117
0.534023
false
ericlink/adms-server
playframework-dist/1.1-src/python/Lib/idlelib/ParenMatch.py
2
6783
"""ParenMatch -- An IDLE extension for parenthesis matching. When you hit a right paren, the cursor should move briefly to the left paren. Paren here is used generically; the matching applies to parentheses, square brackets, and curly braces. """ from HyperParser import HyperParser from configHandler import ...
mit
6,704,288,359,054,777,000
37.436047
80
0.603125
false
xpac1985/ansible
test/units/module_utils/basic/test_heuristic_log_sanitize.py
48
3908
# -*- coding: utf-8 -*- # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # 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 # (a...
gpl-3.0
7,098,303,629,626,021,000
41.945055
122
0.633828
false