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
wndhydrnt/airflow
tests/impersonation.py
15
4984
# -*- 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 #...
apache-2.0
-1,288,370,095,071,658,500
33.136986
90
0.617376
false
czgu/metaHack
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py
214
4109
## Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass class HTTPWarning(Warning): "Base warning used by this module." pass class PoolError(HTTPError): "Base exception for errors caused within a pool." def __init__(self, pool, message): self.pool ...
apache-2.0
-1,309,910,139,783,370,800
24.842767
79
0.693843
false
acfogarty/espressopp
contrib/mpi4py/mpi4py-2.0.0/test/test_cco_buf.py
8
29323
from mpi4py import MPI import mpiunittest as unittest import arrayimpl from functools import reduce prod = lambda sequence,start=1: reduce(lambda x, y: x*y, sequence, start) def maxvalue(a): try: typecode = a.typecode except AttributeError: typecode = a.dtype.char if typecode == ('f'): ...
gpl-3.0
7,526,859,064,038,450,000
43.699695
78
0.406677
false
habeanf/Open-Knesset
laws/migrations/0007_add_laws_votes_and_committee_meetings.py
15
17457
# 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 M2M table for field committee_meetings on 'PrivateProposal' db.create_table('laws_privateprop...
bsd-3-clause
7,926,997,081,651,635,000
78.712329
243
0.56516
false
dstndstn/astrometry.net
net/urls.py
1
10681
from django.conf.urls import include, url from astrometry.net import settings # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = [] from astrometry.net.views.home import home, support, api_help, explore urlpatterns.extend([ url(r'^/?$', h...
bsd-3-clause
-8,091,784,264,775,065,000
51.615764
142
0.626346
false
AlexOugh/horizon
openstack_dashboard/dashboards/admin/volumes/snapshots/tests.py
34
4219
# 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
4,593,846,409,698,950,000
38.064815
75
0.61863
false
deadRaccoons/TestAirlines
tabo/cherrypy/cherrypy/_cplogging.py
29
17181
""" Simple config ============= Although CherryPy uses the :mod:`Python logging module <logging>`, it does so behind the scenes so that simple logging is simple, but complicated logging is still possible. "Simple" logging means that you can log to the screen (i.e. console/stdout) or to a file, and that you can easily ...
gpl-2.0
4,138,049,395,004,126,000
36.431373
89
0.591584
false
Nick-Hall/gramps
gramps/gen/filters/rules/person/_hasevent.py
5
2501
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 you...
gpl-2.0
-6,473,808,834,303,804,000
35.779412
79
0.52579
false
SwagColoredKitteh/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/stash.py
125
5248
import base64 import json import os import uuid from multiprocessing.managers import BaseManager, DictProxy class ServerDictManager(BaseManager): shared_data = {} def _get_shared(): return ServerDictManager.shared_data ServerDictManager.register("get_dict", callable=_get_shared, ...
mpl-2.0
5,669,681,233,254,622,000
35.699301
91
0.653582
false
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Google/Contacts/GetContactsWithQuery.py
4
5460
# -*- coding: utf-8 -*- ############################################################################### # # GetContactsWithQuery # Retrieves the contact or contacts in that account that match a specified query term. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License...
apache-2.0
7,804,602,259,109,926,000
45.666667
254
0.68956
false
chrisfilo/NeuroVault
neurovault/apps/statmaps/migrations/0060_auto_20160103_0406.py
4
2687
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('statmaps', '0059_auto_20160101_0410'), ] operations = [ migrations.AlterField( model_name='collection', ...
mit
-3,079,881,030,167,169,000
60.068182
437
0.607741
false
UKTradeInvestment/export-wins-data
users/managers.py
1
1308
from django.contrib.auth.models import UserManager as BaseUserManager class UserManager(BaseUserManager): """ Much of this is just copied out of BaseUserManager, excluding the requirement for a username. """ def _create_user(self, email, password, **extra_fields): """ Creates and ...
gpl-3.0
920,223,047,484,598,800
37.470588
77
0.656728
false
PyQwt/PyQwt
junk/PyEdit.py
1
2691
#!/usr/bin/env python import sys from PQTokenize import * from keyword import * from qt import * class PyEdit(QTextEdit): def __init__(self, parent=None): QTextEdit.__init__(self, parent) # user interface setup self.setTextFormat(QTextEdit.PlainText) #self.setWrapPolicy(QTextEdit...
gpl-2.0
419,868,076,798,819,400
25.382353
68
0.537347
false
whs/django
django/db/backends/base/creation.py
20
11972
import sys from io import StringIO from django.apps import apps from django.conf import settings from django.core import serializers from django.db import router # The prefix to put on the default database name when creating # the test database. TEST_DATABASE_PREFIX = 'test_' class BaseDatabaseCreation: """ ...
bsd-3-clause
977,843,107,964,615,700
39.445946
112
0.590628
false
gitcoinco/web
app/marketing/management/commands/debug_test.py
1
1299
''' Copyright (C) 2021 Gitcoin Core 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 Foundation, either version 3 of the License, or (at your option) any later version. This progra...
agpl-3.0
-9,020,515,574,637,600,000
33.184211
76
0.692071
false
mikkylok/mikky.lu
venv/lib/python2.7/site-packages/setuptools/sandbox.py
80
14549
import os import sys import tempfile import operator import functools import itertools import re import contextlib import pickle import textwrap from setuptools.extern import six from setuptools.extern.six.moves import builtins, map import pkg_resources.py31compat if sys.platform.startswith('java'): import org.p...
mit
5,749,805,116,473,076,000
28.391919
105
0.584782
false
playm2mboy/edx-platform
lms/djangoapps/courseware/migrations/0010_rename_xblock_field_content_to_user_state_summary.py
114
11590
# -*- coding: 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): # Removing unique constraint on 'XModuleSettingsField', fields ['usage_id', 'field_name'] db.delete_unique('...
agpl-3.0
-7,849,357,143,172,789,000
77.310811
182
0.570406
false
fhamborg/news-please
newsplease/crawler/simple_crawler.py
1
3455
import socket import copy import threading import logging import requests import urllib3 from .response_decoder import decode_response MAX_FILE_SIZE = 20000000 MIN_FILE_SIZE = 10 LOGGER = logging.getLogger(__name__) # customize headers HEADERS = { 'Connection': 'close', 'User-Agent': 'Mozilla/5.0 (Macintos...
apache-2.0
-9,049,761,197,355,281,000
36.150538
142
0.626339
false
alexkogon/ansible
test/units/plugins/connections/test_connection.py
86
3988
# (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 # (at your option) any later...
gpl-3.0
219,620,443,908,750,980
38.098039
104
0.721916
false
collmot/ardupilot
libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32H743xx.py
11
34833
#!/usr/bin/env python ''' these tables are generated from the STM32 datasheets for the STM32H743bi ''' # additional build information for ChibiOS build = { "CHIBIOS_STARTUP_MK" : "os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32h7xx.mk", "CHIBIOS_PLATFORM_MK" : "os/hal/ports/STM32/STM32H7xx/platform.mk...
gpl-3.0
-7,450,128,902,233,794,000
26.579572
93
0.463842
false
dcifuen/cloudbday
src/lib/gae_mini_profiler/instrumented_profiler.py
13
2781
"""CPU profiler that works by instrumenting all function calls (uses cProfile). This profiler provides detailed function timings for all function calls during a request. This is just a simple wrapper for cProfile with result formatting. See http://docs.python.org/2/library/profile.html for more. PRO: since every fun...
mit
-4,401,228,729,856,172,500
38.728571
131
0.651924
false
837468220/python-for-android
python-build/python-libs/gdata/src/gdata/apps/migration/__init__.py
168
8177
#!/usr/bin/python # # Copyright (C) 2008 Google # # 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 ag...
apache-2.0
7,756,443,806,551,413,000
37.570755
78
0.650238
false
eayunstack/nova
nova/virt/xenapi/agent.py
13
17806
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2010-2012 OpenStack Foundation # # 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/LICENS...
apache-2.0
9,087,289,819,498,324,000
38.834452
79
0.587555
false
mapennell/ansible
v1/ansible/module_utils/ec2.py
127
7586
# 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...
gpl-3.0
-2,112,749,422,810,793,000
39.351064
217
0.6599
false
dennis-sheil/commandergenius
project/jni/python/src/Lib/test/test_structmembers.py
56
3373
from _testcapi import test_structmembersType, \ CHAR_MAX, CHAR_MIN, UCHAR_MAX, \ SHRT_MAX, SHRT_MIN, USHRT_MAX, \ INT_MAX, INT_MIN, UINT_MAX, \ LONG_MAX, LONG_MIN, ULONG_MAX, \ LLONG_MAX, LLONG_MIN, ULLONG_MAX import warnings, exceptions, unittest, sys from test import test_support ts=test_structm...
lgpl-2.1
5,947,859,968,518,795,000
30.523364
74
0.587015
false
malderete/ninja-ide
ninja_ide/gui/editor/checkers/migration_lists.py
6
6160
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
gpl-3.0
-273,480,780,578,547,500
40.066667
79
0.639773
false
pombredanne/teamwork
wsgi/static/Brython2.1.0-20140419-113919/Lib/signal.py
743
1646
"""This module provides mechanisms to use signal handlers in Python. Functions: alarm() -- cause SIGALRM after a specified time [Unix only] setitimer() -- cause a signal (described below) after a specified float time and the timer may restart then [Unix only] getitimer() -- get current value of timer [...
gpl-2.0
-4,923,245,676,673,309,000
31.27451
77
0.713244
false
marcsans/cnn-physics-perception
phy/lib/python2.7/site-packages/setuptools/command/install.py
529
4683
from distutils.errors import DistutilsArgError import inspect import glob import warnings import platform import distutils.command.install as orig import setuptools # Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for # now. See https://github.com/pypa/setuptools/issues/199/ _install = orig.in...
mit
-6,555,732,058,541,053,000
36.464
79
0.629297
false
ol-loginov/intellij-community
python/helpers/epydoc/markup/doctest.py
90
13069
# # doctest.py: Syntax Highlighting for doctest blocks # Edward Loper # # Created [06/28/03 02:52 AM] # $Id: restructuredtext.py 1210 2006-04-10 13:25:50Z edloper $ # """ Syntax highlighting for doctest blocks. This module defines two functions, L{doctest_to_html()} and L{doctest_to_latex()}, which can be used to per...
apache-2.0
-4,414,908,360,113,901,600
41.022508
77
0.556278
false
atopuzov/nitro-python
nssrc/com/citrix/netscaler/nitro/resource/config/cmp/cmpparameter.py
3
14320
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # 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 l...
apache-2.0
7,903,772,029,268,354,000
34.979899
432
0.730307
false
noxrepo/nox-classic
src/utilities/switch_command.py
16
2438
#!/usr/bin/python # # Send arbitrary command to a switch # import getopt,sys,os import httplib import simplejson import urllib # TODO: need to set the path for this from nox.webapps.webserviceclient.simple import PersistentLogin, NOXWSClient def usage(): print """ Usage: switch_command.py -d <direc...
gpl-3.0
3,113,700,057,408,678,000
24.93617
77
0.52338
false
piquadrat/django
django/middleware/csrf.py
11
13363
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ import logging import re import string from urllib.parse import urlparse from django.conf import settings from django.core.exceptions import ImproperlyConfigured from...
bsd-3-clause
-2,424,096,308,959,632,400
40.629283
95
0.611464
false
Hao-Liu/avocado-vt
virttest/staging/utils_cgroup.py
12
26346
#!/usr/bin/python # -*- coding: utf-8 -*- """ Helpers for cgroup testing. :copyright: 2011 Red Hat Inc. :author: Lukas Doktor <ldoktor@redhat.com> """ import logging import os import shutil import subprocess import time import re import random import commands from tempfile import mkdtemp from avocado.core import exce...
gpl-2.0
3,445,026,473,874,547,000
33.03876
81
0.53864
false
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/sklearn/metrics/cluster/bicluster.py
359
2797
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
mit
-738,968,909,015,872,600
31.523256
73
0.618162
false
molebot/brython
www/src/Lib/test/test_osx_env.py
112
1342
""" Test suite for OS X interpreter environment variables. """ from test.support import EnvironmentVarGuard, run_unittest import subprocess import sys import sysconfig import unittest @unittest.skipUnless(sys.platform == 'darwin' and sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'), ...
bsd-3-clause
7,619,578,172,360,802,000
38.470588
81
0.608048
false
hhbyyh/spark
python/pyspark/sql/group.py
24
12490
# # 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 us...
apache-2.0
-4,901,048,634,372,044,000
38.400631
99
0.592554
false
171121130/SWI
venv/Lib/site-packages/mako/ext/pygmentplugin.py
61
4530
# ext/pygmentplugin.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from pygments.lexers.web import \ HtmlLexer, XmlLexer, JavascriptLexer, CssLexer from pyg...
mit
-7,723,480,301,563,723,000
34.669291
78
0.482119
false
iambibhas/django
django/conf/locale/cs/formats.py
115
1702
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G:i' DATET...
bsd-3-clause
-5,997,429,931,952,557,000
36.822222
77
0.528202
false
renyi533/tensorflow
tensorflow/python/keras/optimizer_v2/adadelta_test.py
2
8161
# 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,629,726,258,422,017,000
40.01005
118
0.612915
false
sammerry/ansible
lib/ansible/executor/playbook_executor.py
24
11332
# (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
-7,361,176,889,410,322,000
38.761404
171
0.53671
false
zozo123/buildbot
master/buildbot/monkeypatches/python14653.py
3
1194
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-3.0
-7,702,567,610,173,340,000
34.117647
79
0.720268
false
sameetb-cuelogic/edx-platform-test
common/lib/logsettings.py
39
5740
import os import platform import sys from logging.handlers import SysLogHandler LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] def get_logger_config(log_dir, logging_env="no_env", tracking_filename="tracking.log", edx_filename="edx.log...
agpl-3.0
-5,121,424,778,819,755,000
34
78
0.482404
false
wichovw/tca-gt
server/tca/cars.py
1
1570
import uuid import random class Car: speed = 0 change_lane_intention = 0 street = None next_street = None probability = {} def __init__(self, **kwargs): if 'id' in kwargs: self.id = kwargs['id'] else: self.id = str(uuid.uuid4()) if 'speed' in...
mit
4,677,770,845,122,248,000
30.42
72
0.541401
false
brianinnes/pycupi
python/vPiP/generators/concircle.py
2
3534
# Copyright 2016 Mark Benson, portions Copyright 2016 Brian Innes # # 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 app...
apache-2.0
5,599,764,699,299,146,000
46.756757
117
0.645161
false
daenamkim/ansible
lib/ansible/modules/network/illumos/ipadm_ifprop.py
33
8192
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@gmail.com> # 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', ...
gpl-3.0
2,574,775,804,214,782,000
27.536585
93
0.564469
false
MrSurly/micropython
tests/extmod/ubinascii_a2b_base64.py
14
1248
try: try: import ubinascii as binascii except ImportError: import binascii except ImportError: print("SKIP") raise SystemExit print(binascii.a2b_base64(b"")) print(binascii.a2b_base64(b"Zg==")) print(binascii.a2b_base64(b"Zm8=")) print(binascii.a2b_base64(b"Zm9v")) print(binascii.a2b_ba...
mit
-6,808,688,034,242,745,000
26.130435
50
0.710737
false
Gebesa-Dev/Addons-gebesa
account_invoice_stock_picking_id/models/account_invoice.py
1
18261
# -*- coding: utf-8 -*- # © <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import _, api, fields, models from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from datetime import datetime, timedelta from d...
agpl-3.0
3,185,353,754,241,811,000
44.764411
105
0.506791
false
inares/edx-platform
lms/djangoapps/shoppingcart/admin.py
63
5399
"""Django admin interface for the shopping cart models. """ from ratelimitbackend import admin from shoppingcart.models import ( PaidCourseRegistrationAnnotation, Coupon, DonationConfiguration, Invoice, CourseRegistrationCodeInvoiceItem, InvoiceTransaction ) class SoftDeleteCouponAdmin(admin.M...
agpl-3.0
-401,813,303,067,745,300
29.162011
116
0.584182
false
DennisDenuto/puppet-commonscripts
files/aws_cli/AWS-ElasticBeanstalk-CLI-2.6.3/eb/linux/python3/lib/elasticbeanstalk/request.py
8
11961
#!/usr/bin/env python #============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the...
mit
-1,687,809,147,231,134,500
34.390533
99
0.583563
false
seladb/PcapPlusPlus
Tests/ExamplesTest/tests/test_pcapsplitter.py
1
9849
import pytest import os import ipaddress from scapy.all import rdpcap, IP, IPv6, TCP, UDP from .test_utils import ExampleTest class TestPcapSplitter(ExampleTest): pytestmark = [pytest.mark.pcapsplitter, pytest.mark.no_network] def test_split_by_file_size(self, tmpdir): args = { '-f': os.path.join('pcap_exampl...
unlicense
1,424,568,888,895,467,000
34.301075
115
0.663824
false
yongtang/tensorflow
tensorflow/python/saved_model/simple_save.py
25
4169
# 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...
apache-2.0
7,956,265,648,587,948,000
44.813187
121
0.718638
false
ktan2020/legacy-automation
win/Lib/test/test_descr.py
7
162732
import __builtin__ import sys import types import unittest from copy import deepcopy from test import test_support class OperatorsTest(unittest.TestCase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) self.binops = { 'add': '+', ...
mit
-3,669,173,849,560,812,500
32.928525
92
0.465102
false
cloakedcode/CouchPotatoServer
libs/sqlalchemy/engine/base.py
12
120156
# engine/base.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Basic components for SQL execution and interfacing with DB-API. Defines the basic ...
gpl-3.0
3,220,195,430,714,375,700
34.04112
96
0.595384
false
ChanderG/numpy
numpy/polynomial/tests/test_polyutils.py
202
3094
"""Tests for polyutils module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.polyutils as pu from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_module_suite) class TestMisc(TestCase): def...
bsd-3-clause
-6,775,931,855,215,705,000
27.385321
64
0.51616
false
SanPen/PracticalGridModeling
examples/substation.py
1
1669
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 20 16:40:22 2017 @author: santi """ import pandas as pd import numpy as np import networkx as nx from matplotlib import pyplot as plt if __name__ == "__main__": # load data conn_df = pd.read_excel('substation.xl...
gpl-3.0
-6,445,472,641,222,862,000
26.833333
117
0.559617
false
sergiorua/libcloud
libcloud/dns/drivers/zerigo.py
31
18314
# 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 use ...
apache-2.0
-1,290,362,106,318,931,000
36.838843
79
0.548378
false
FlaPer87/django-nonrel
tests/regressiontests/forms/localflavor/au.py
25
3528
# -*- coding: utf-8 -*- # Tests for the contrib/localflavor/ AU form fields. tests = r""" ## AUPostCodeField ########################################################## A field that accepts a four digit Australian post code. >>> from django.contrib.localflavor.au.forms import AUPostCodeField >>> f = AUPostCodeField()...
bsd-3-clause
1,668,811,620,110,908,400
25.328358
78
0.655896
false
madeleinel/WoMentor
twitter/tweetparse.py
1
2950
import re from acceptedlangs import accepted_langs_normal, accepted_langs_lower def tweetParse(tweetString): # first identify if mentor or mentee isMentorBool = '#mentor' in tweetString.lower() isMentor = 'mentor' if isMentorBool else 'mentee' # then identify indices of '-'s in string indices = [i ...
mit
383,105,652,616,799,360
34.542169
121
0.657288
false
catsop/CATMAID
django/applications/djsopnet/control/segment.py
1
25749
import json from collections import namedtuple import pysopnet from django.core.exceptions import ValidationError from django.db import connection from django.http import Http404, HttpResponse from django.shortcuts import get_object_or_404 from catmaid.control.authentication import requires_user_role from catmaid.mo...
gpl-3.0
-4,706,078,231,796,918,000
46.073126
142
0.618937
false
thinkopensolutions/geraldo
site/newsite/django_1_0/django/utils/_os.py
27
1041
from os.path import join, normcase, abspath, sep def safe_join(base, *paths): """ Joins one or more path components to the base path component intelligently. Returns a normalized, absolute version of the final path. The final path must be located inside of the base path component (otherwise a Valu...
lgpl-3.0
4,715,391,284,949,720,000
44.26087
79
0.682037
false
akionakamura/scikit-learn
sklearn/linear_model/tests/test_coordinate_descent.py
40
23697
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from sys import version_info import numpy as np from scipy import interpolate, sparse from copy import deepcopy from sklearn.datasets import load_boston from sklearn.utils.testing ...
bsd-3-clause
1,159,046,163,677,068,300
36.614286
79
0.632401
false
M4rtinK/modrana
core/bundle/upoints/weather_stations.py
2
12056
# # vim: set sw=4 sts=4 et tw=80 fileencoding=utf-8: # """weather_stations - Imports weather station data files""" # Copyright (C) 2007-2010 James Rowe # # 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 Fou...
gpl-3.0
6,454,139,926,710,481,000
41.4947
96
0.537668
false
jcftang/ansible
lib/ansible/modules/network/cumulus/cl_ports.py
27
7194
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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...
gpl-3.0
-6,587,150,567,870,983,000
31.405405
80
0.608007
false
Jenselme/servo
components/script/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py
276
1626
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface AttrSequenceType { attribute sequence<object> foo; }; """) results = parser.finish() except: threw = True harness.ok(threw, "Attribute type must not be a...
mpl-2.0
5,059,815,133,552,012,000
23.268657
100
0.54551
false
openstack/watcher
watcher/conf/clients_auth.py
2
1085
# -*- encoding: utf-8 -*- # Copyright (c) 2016 Intel Corp # # Authors: Prudhvi Rao Shedimbi <prudhvi.rao.shedimbi@intel.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.apa...
apache-2.0
-8,110,194,161,111,848,000
34
74
0.743779
false
SlimRoms/android_external_chromium_org
chrome/common/extensions/docs/server2/template_data_source_test.py
15
2395
#!/usr/bin/env python # Copyright (c) 2012 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 json import unittest from extensions_paths import SERVER2 from server_instance import ServerInstance from template_data_sou...
bsd-3-clause
88,308,094,389,760,880
34.746269
76
0.704802
false
elainenaomi/sciwonc-dataflow-examples
sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/python2.7/dist-packages/Pegasus/netlogger/configobj.py
1
88638
# configobj.py # A config file reader/writer that supports nested sections in config files. # Copyright (C) 2005-2008 Michael Foord, Nicola Larosa # E-mail: fuzzyman AT voidspace DOT org DOT uk # nico AT tekNico DOT net # ConfigObj 4 # http://www.voidspace.org.uk/python/configobj.html # Released subject to th...
gpl-3.0
-6,598,068,543,771,221,000
34.441024
114
0.517949
false
mcepl/youtube-dl
devscripts/make_lazy_extractors.py
14
2840
from __future__ import unicode_literals, print_function from inspect import getsource import os from os.path import dirname as dirn import sys print('WARNING: Lazy loading extractors is an experimental feature that may not always work', file=sys.stderr) sys.path.insert(0, dirn(dirn((os.path.abspath(__file__))))) la...
unlicense
-8,533,442,020,545,719,000
27.979592
110
0.628521
false
duke605/RunePy
commands/viswax.py
1
2553
from discord.ext import commands from datetime import datetime from bs4 import BeautifulSoup import discord import re class VisWax: def __init__(self, bot): self.bot = bot @commands.command(pass_context=True, aliases=['wax'], description='Shows the combination of runes needed f...
mit
-5,793,612,808,431,848,000
31.316456
113
0.579318
false
adafruit/micropython
py/makeqstrdefs.py
1
5324
""" This script processes the output from the C preprocessor and extracts all qstr. Each qstr is transformed into a qstr definition of the form 'Q(...)'. This script works with Python 2.6, 2.7, 3.3 and 3.4. """ from __future__ import print_function import re import sys import os # Python 2/3 compatibility: # - it...
mit
-3,632,125,016,525,531,000
30.134503
86
0.570624
false
nkoep/pymanopt
examples/dominant_eigenvector.py
1
1598
import numpy as np import theano.tensor as T from numpy import linalg as la, random as rnd import pymanopt from pymanopt.manifolds import Sphere from pymanopt.solvers import ConjugateGradient def dominant_eigenvector(A): """ Returns the dominant eigenvector of the symmetric matrix A. Note: For the same ...
bsd-3-clause
-846,844,877,710,737,700
27.035088
79
0.642053
false
mluke93/osf.io
scripts/osfstorage/correct_moved_node_settings.py
18
1767
import sys import logging from scripts import utils as script_utils from framework.transactions.context import TokuTransaction from website.app import init_app from website.addons.osfstorage import model logger = logging.getLogger(__name__) def do_migration(): count = 0 errored = 0 for node_settings in ...
apache-2.0
4,646,523,653,252,619,000
31.722222
111
0.59253
false
mitnk/letsencrypt
acme/acme/challenges.py
6
16438
"""ACME Identifier Validation Challenges.""" import abc import functools import hashlib import logging import socket from cryptography.hazmat.primitives import hashes import OpenSSL import requests from acme import errors from acme import crypto_util from acme import fields from acme import jose logger = logging.ge...
apache-2.0
7,318,644,579,231,647,000
29.782772
80
0.622703
false
maelnor/nova
nova/tests/api/openstack/compute/contrib/test_migrate_server.py
9
10692
# Copyright 2011 OpenStack Foundation # 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 ...
apache-2.0
-4,689,889,968,578,455,000
45.285714
78
0.555462
false
mith1979/ansible_automation
applied_python/applied_python/lib/python2.7/site-packages/django/db/migrations/executor.py
71
10728
from __future__ import unicode_literals from django.apps.registry import apps as global_apps from django.db import migrations from .loader import MigrationLoader from .recorder import MigrationRecorder from .state import ProjectState class MigrationExecutor(object): """ End-to-end migration execution - load...
apache-2.0
-6,066,182,043,974,451,000
46.68
115
0.604866
false
flyher/pymo
android/pgs4a-0.9.6/python-install/lib/python2.7/test/test_index.py
84
9958
import unittest from test import test_support import operator from sys import maxint maxsize = test_support.MAX_Py_ssize_t minsize = -maxsize-1 class oldstyle: def __index__(self): return self.ind class newstyle(object): def __index__(self): return self.ind class TrapInt(int): def __index...
mit
-340,691,552,157,945,600
29.829721
73
0.582547
false
kch8qx/osf.io
scripts/clone_wiki_pages.py
17
2766
""" Create copies of wiki pages for existing forks and registrations instead of using the same NodeWikiPage objects as the original node. """ import logging import sys from modularodm import Q from framework.mongo import database as db from framework.transactions.context import TokuTransaction from website.addons.wi...
apache-2.0
8,754,956,162,399,454,000
36.378378
122
0.579899
false
hakanozadam/bal
bal/core/step.py
1
10734
# AUTHORS: # Hakan Ozadam # Rachel Brown # # Moore Laboratory # UMASS Medical School / HHMI # RNA Therapeutics Institute # Albert Sherman Center, ASC4-1009 # 368 Plantation Street # Worcester, MA 01605 # USA # ##############################################...
gpl-2.0
8,892,057,931,742,915,000
36.013793
118
0.421465
false
Endika/c2c-rd-addons
c2c_budget_report/__init__.py
4
1415
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) Camptocamp SA - http://www.camptocamp.com # Author: Arnaud WÃŒst ported by nbessi # # This file is part of the c2c_budget module # # WARNING: This program as such is intended to be used by profes...
agpl-3.0
4,126,045,833,576,229,400
41.818182
78
0.726115
false
HSAnet/glimpse_client
3rdparty/breakpad/src/tools/gyp/test/defines-escaping/gyptest-defines-escaping.py
350
4737
#!/usr/bin/env python # Copyright (c) 2010 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies build of an executable with C++ define specified by a gyp define using various special characters such as quotes, commas, etc. ...
bsd-3-clause
4,476,692,772,891,680,000
24.744565
80
0.610724
false
larsbergstrom/servo
tests/wpt/web-platform-tests/tools/third_party/funcsigs/funcsigs/__init__.py
48
30011
# Copyright 2001-2013 Python Software Foundation; All Rights Reserved """Function signature objects for callables Back port of Python 3.3's function signature tools from the inspect module, modified to be compatible with Python 2.6, 2.7 and 3.2+. """ from __future__ import absolute_import, division, print_function imp...
mpl-2.0
4,730,335,099,548,167,000
35.688264
84
0.534937
false
msscully/datamart
datamart/secure_redirect.py
1
1259
""" Takend from http://flask.pocoo.org/snippets/63/ """ from urlparse import urlparse, urljoin from flask import request, url_for, redirect from flask.ext.wtf import Form from wtforms import HiddenField def is_safe_url(target): ref_url = urlparse(request.host_url) test_url = urlparse(urljoin(request.host_ur...
mit
7,074,207,917,548,230,000
31.282051
63
0.640191
false
wd15/corr
corr-db/corrdb/common/models/profile_model.py
1
1739
import datetime from ..core import db from ..models import UserModel from ..models import FileModel import json from bson import ObjectId class ProfileModel(db.Document): created_at = db.StringField(default=str(datetime.datetime.utcnow())) user = db.ReferenceField(UserModel, reverse_delete_rule=db.CA...
mit
-8,851,955,223,543,814,000
33.098039
91
0.59632
false
Chemcy/vnpy
vn.trader/ctaStrategy/datayesClient.py
14
2853
# encoding: UTF-8 '''一个简单的通联数据客户端,主要使用requests开发,比通联官网的python例子更为简洁。''' import requests import json FILENAME = 'datayes.json' HTTP_OK = 200 ######################################################################## class DatayesClient(object): """通联数据客户端""" name = u'通联数据客户端' #---------------------...
mit
-1,699,145,424,408,366,300
30.277108
78
0.422736
false
bestwpw/mysql-5.6
xtrabackup/test/python/BytesIO.py
31
3807
# http://wiki.python.org/moin/BytesIO # # A skeleton one used for systems that don't have BytesIO. # # It's enough for subunit at least.... class BytesIO(object): """ A file-like API for reading and writing bytes objects. Mostly like StringIO, but write() calls modify the underlying bytes object. >>...
gpl-2.0
8,136,669,554,864,091,000
26.992647
75
0.514053
false
whitmo/ansible-charm
setup.py
1
1123
#!/usr/bin/env python import os from setuptools import setup from setuptools import find_packages PROJECT = u'AnsibleCharm' VERSION = '0.1' URL = "https://blog.juju.solutions" AUTHOR = u'Whit Morriss <whit.morriss@canonical.com>' AUTHOR_EMAIL = u'whit.morriss@canonical.com' DESC = "Python library for charming with ans...
gpl-3.0
3,254,846,126,577,697,000
23.955556
89
0.634907
false
koobonil/Boss2D
Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/distributions/python/kernel_tests/bijectors/inline_test.py
79
3122
# 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...
mit
-1,808,946,516,139,238,000
38.518987
80
0.641576
false
yiliaofan/brotli
setup.py
67
7796
import distutils from distutils.core import setup, Extension from distutils.command.build_ext import build_ext from distutils.cmd import Command import platform import os import re CURR_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) # when compiling for Windows Python 2.7, force distutils to use ...
apache-2.0
-7,698,049,254,385,871,000
36.661836
86
0.486916
false
mosesfistos1/beetbox
beetsplug/web/__init__.py
4
9737
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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 t...
mit
4,445,219,949,372,369,400
27.223188
78
0.593509
false
levixie/zulip
api/integrations/asana/zulip_asana_config.py
124
2157
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2014 Zulip, Inc. # # 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 #...
apache-2.0
8,089,554,989,680,768,000
36.824561
79
0.757885
false
maciekcc/tensorflow
tensorflow/tools/test/run_and_gather_logs.py
137
4918
# 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
8,436,995,212,506,113,000
32.455782
80
0.674258
false
fossoult/odoo
addons/l10n_eu_service/__openerp__.py
254
3277
# -*- encoding: utf-8 -*- ############################################################################## # # Odoo, Open Source Business Applications # Copyright (C) 2015 Odoo S.A. <http://www.odoo.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU A...
agpl-3.0
-5,532,073,746,884,992,000
37.552941
93
0.671346
false
hefnrh/PyChat
client/rabin.py
1
5671
from math import * from random import * class rabin: def __init__(self): pass def get_big(self, bit): #get a big number x that x % 4 = 3 big = 1 for i in range(bit-3): temp = randrange(0,2) big = big * 2 + temp big = big * 4 + 3 ret...
gpl-2.0
-7,962,915,172,225,592,000
26.786802
65
0.33398
false
gnieboer/tensorflow
tensorflow/compiler/tests/variable_ops_test.py
30
3939
# 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...
apache-2.0
-8,504,005,277,652,749,000
37.617647
80
0.623762
false
gimarg/dynamotors
node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
1247
# Copyright 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
gpl-2.0
-8,748,347,717,480,633,000
26.108696
72
0.687249
false
irvingpop/digital-beer-menu
src/lib/flask_admin/tests/test_model.py
9
23799
import wtforms from nose.tools import eq_, ok_ from flask import Flask from werkzeug.wsgi import DispatcherMiddleware from werkzeug.test import Client from wtforms import fields from flask_admin import Admin, form from flask_admin._compat import iteritems, itervalues from flask_admin.model import base, filters fro...
gpl-2.0
-8,445,781,883,579,038,000
28.935849
112
0.599059
false
jcushman/pywb
pywb/manager/manager.py
1
16268
import os import shutil import sys import logging import heapq import yaml import re from distutils.util import strtobool from pkg_resources import resource_string from argparse import ArgumentParser, RawTextHelpFormatter from pywb.utils.loaders import load_yaml_config from pywb.utils.timeutils import timestamp20_no...
gpl-3.0
172,270,082,011,508,380
32.132383
78
0.581694
false
anpingli/openshift-ansible
roles/openshift_health_checker/openshift_checks/logging/elasticsearch.py
45
9996
"""Check for an aggregated logging Elasticsearch deployment""" import json import re from openshift_checks import OpenShiftCheckException, OpenShiftCheckExceptionList from openshift_checks.logging.logging import LoggingCheck class Elasticsearch(LoggingCheck): """Check for an aggregated logging Elasticsearch dep...
apache-2.0
5,177,781,629,475,662,000
46.150943
120
0.569228
false
Refefer/pylearn2
pylearn2/datasets/norb.py
44
14401
""" An interface to the small NORB dataset. Unlike `./norb_small.py`, this reads the original NORB file format, not the LISA lab's `.npy` version. Currently only supports the Small NORB Dataset. Download the dataset from `here <http://www.cs.nyu.edu/~ylclab/data/norb-v1.0-small/>`_. NORB dataset(s) by Fu Jie Huang a...
bsd-3-clause
-6,875,548,610,523,638,000
37.300532
79
0.539338
false
appop/bitcoin
qa/rpc-tests/invalidateblock.py
1
3083
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The nealcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the invalidateblock RPC.""" from test_framework.test_framework import nealcoinTestFramework from...
mit
5,249,238,998,935,978,000
41.232877
95
0.630879
false