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
fergalbyrne/nupic
examples/opf/experiments/multistep/hotgym/permutations.py
38
3713
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
-8,808,456,688,313,874,000
37.278351
155
0.695125
false
ncrocfer/weevely3
testsuite/test_file_download.py
14
4127
from testsuite.base_test import BaseTest from testfixtures import log_capture from testsuite import config from core.sessions import SessionURL from core import modules from core import messages import subprocess import tempfile import datetime import logging import os class FileDOwnload(BaseTest): def setUp(self...
gpl-3.0
-1,280,130,105,265,299,200
36.862385
99
0.611825
false
CERNDocumentServer/invenio
modules/bibformat/lib/elements/bfe_record_stats.py
1
10296
# This file is part of Invenio. # Copyright (C) 2009, 2010, 2011 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 the # License, or (at your option) any later version. # # ...
gpl-2.0
2,485,560,308,210,374,000
39.535433
189
0.355769
false
Netflix/security_monkey
security_monkey/auditors/openstack/openstack_security_group.py
1
1657
# Copyright (c) 2017 AT&T Intellectual Property. 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 # ...
apache-2.0
8,831,156,913,663,788,000
40.425
102
0.732649
false
dd00/commandergenius
project/jni/python/src/Lib/test/test_popen2.py
51
3151
#! /usr/bin/env python """Test script for popen2.py""" import warnings warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*", DeprecationWarning) warnings.filterwarnings("ignore", "os\.popen. is deprecated.*", DeprecationWarning) import os import sys impor...
lgpl-2.1
-7,763,450,345,820,361,000
31.153061
74
0.607426
false
dudepare/django
django/middleware/gzip.py
478
1831
import re from django.utils.cache import patch_vary_headers from django.utils.text import compress_sequence, compress_string re_accepts_gzip = re.compile(r'\bgzip\b') class GZipMiddleware(object): """ This middleware compresses content if the browser allows gzip compression. It sets the Vary header acco...
bsd-3-clause
-2,015,083,589,667,243,300
37.957447
86
0.650464
false
prculley/gramps
gramps/gui/widgets/selectionwidget.py
3
31444
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2013 Artem Glebov <artem.glebov@gmail.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, ...
gpl-2.0
-2,122,692,044,978,758,400
35.351445
83
0.51393
false
596acres/livinglots-philly
livinglotsphilly/survey/forms.py
2
1197
from django import forms from django.contrib.contenttypes.models import ContentType from forms_builder.forms.forms import FormForForm from .models import SurveyFieldEntry, SurveyFormEntry class SurveyFormForForm(FormForForm): field_entry_model = SurveyFieldEntry content_type = forms.ModelChoiceField( ...
gpl-3.0
-8,244,202,802,462,454,000
31.351351
82
0.637427
false
xiangel/hue
desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_ipv6.py
117
2847
from __future__ import unicode_literals from django.utils import unittest from django.utils.ipv6 import is_valid_ipv6_address, clean_ipv6_address class TestUtilsIPv6(unittest.TestCase): def test_validates_correct_plain_address(self): self.assertTrue(is_valid_ipv6_address('fe80::223:6cff:fe8a:2e8a')) ...
apache-2.0
1,071,698,958,201,193,100
52.716981
100
0.659642
false
nishigori/boto
boto/s3/bucketlogging.py
153
3183
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
-8,182,228,788,610,597,000
37.349398
98
0.605718
false
jbfavre/exaproxy
lib/exaproxy/util/cache.py
4
1214
# encoding: utf-8 try: from collections import OrderedDict except ImportError: # support installable ordereddict module in older python versions from ordereddict import OrderedDict from time import time class TimeCache (dict): __default = object() def __init__ (self,timeout): self.timeout = timeout self.la...
bsd-2-clause
2,259,029,456,114,532,400
20.298246
72
0.658155
false
SmartElect/SmartElect
civil_registry/migrations/0001_initial.py
1
5409
# Generated by Django 2.2 on 2019-05-03 14:05 import civil_registry.models from django.db import migrations, models import libya_elections.libya_bread class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Citizen',...
apache-2.0
-8,229,213,199,297,642,000
66.6125
225
0.615086
false
nirmeshk/oh-mainline
vendor/packages/Django/django/conf/__init__.py
95
9136
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import logging import os import sys import time # Needed fo...
agpl-3.0
-2,055,214,328,506,800,600
38.2103
116
0.624124
false
epssy/hue
desktop/core/ext-py/pysaml2-2.4.0/example/idp2_repoze/idp_user.py
33
1617
USERS = { "haho0032": { "sn": "Hoerberg", "givenName": "Hans", "eduPersonScopedAffiliation": "staff@example.com", "eduPersonPrincipalName": "haho@example.com", "uid": "haho", "eduPersonTargetedID": "one!for!all", "c": "SE", "o": "Example Co.", ...
apache-2.0
4,938,187,637,861,631,000
28.962963
64
0.525665
false
moijes12/oh-mainline
vendor/packages/Django/django/middleware/common.py
101
7433
import hashlib import logging import re from django.conf import settings from django import http from django.core.mail import mail_managers from django.utils.http import urlquote from django.utils import six from django.core import urlresolvers logger = logging.getLogger('django.request') class CommonMiddleware(ob...
agpl-3.0
5,329,805,152,882,812,000
43.508982
104
0.56599
false
neumerance/deploy
.venv/lib/python2.7/site-packages/requests/structures.py
67
3576
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
apache-2.0
441,589,889,107,711,940
26.9375
75
0.582494
false
xq262144/hue
desktop/core/ext-py/pysaml2-2.4.0/src/saml2/metadata.py
31
24394
#!/usr/bin/env python from saml2.md import AttributeProfile from saml2.sigver import security_context from saml2.config import Config from saml2.validate import valid_instance from saml2.time_util import in_a_while from saml2.extension import mdui from saml2.extension import idpdisc from saml2.extension import shibmd f...
apache-2.0
977,239,929,829,353,700
30.805737
79
0.563745
false
mysz/versionner
versionner/config.py
2
5820
"""Configuration-related classes for versionner""" import codecs import configparser import pathlib import re import sys from versionner import defaults ENV_VERSIONNER_PROJECT_CONFIG_FILE = 'VERSIONNER_PROJECT_CONFIG_FILE' # pylint: disable=too-many-instance-attributes,too-few-public-methods class FileConfig: ...
mit
6,680,834,695,407,195,000
30.122995
132
0.549828
false
jimmymunoz/jeuxdemots
public/package/node_modules/node-gyp/gyp/pylib/gyp/common.py
1292
20063
# Copyright (c) 2012 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. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
bsd-3-clause
8,775,038,177,345,021,000
31.998355
83
0.66361
false
williamthegrey/swift
test/unit/proxy/controllers/test_account.py
2
15815
# Copyright (c) 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/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
-4,818,286,084,352,963,000
40.618421
79
0.553525
false
applicationdevm/XlsxWriter
xlsxwriter/test/comparison/test_chart_name04.py
8
1935
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
-7,750,065,231,574,683,000
25.148649
79
0.509044
false
nmearl/pyqtgraph
pyqtgraph/SRTTransform3D.py
45
10879
# -*- coding: utf-8 -*- from .Qt import QtCore, QtGui from .Vector import Vector from .Transform3D import Transform3D from .Vector import Vector import numpy as np class SRTTransform3D(Transform3D): """4x4 Transform matrix that can always be represented as a combination of 3 matrices: scale * rotate * translate ...
mit
1,438,805,295,212,093,000
33.536508
117
0.524221
false
sander76/home-assistant
homeassistant/components/thethingsnetwork/sensor.py
5
4925
"""Support for The Things Network's Data storage integration.""" import asyncio import logging import aiohttp from aiohttp.hdrs import ACCEPT, AUTHORIZATION import async_timeout import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ( ATT...
apache-2.0
5,296,179,162,585,522,000
30.570513
87
0.620508
false
slowfranklin/samba
source4/heimdal/lib/wind/rfc3454.py
88
2296
#!/usr/local/bin/python # -*- coding: iso-8859-1 -*- # $Id$ # Copyright (c) 2004 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following...
gpl-3.0
-7,528,530,628,747,683,000
37.25
77
0.664924
false
rockneurotiko/django
tests/field_deconstruction/tests.py
189
18358
from __future__ import unicode_literals from django.apps import apps from django.db import models from django.test import SimpleTestCase, override_settings from django.test.utils import isolate_lru_cache from django.utils import six class FieldDeconstructionTests(SimpleTestCase): """ Tests the deconstruct() ...
bsd-3-clause
-3,762,096,207,059,471,000
45.358586
114
0.638032
false
aaigner/LIGGGHTS-PUBLIC
python/install.py
2
2208
#!/usr/bin/env python # copy LIGGGHTS src/libliggghts.so and liggghts.py to system dirs instructions = """ Syntax: python install.py [-h] [libdir] [pydir] libdir = target dir for src/libliggghts.so, default = /usr/local/lib pydir = target dir for liggghts.py, default = Python site-packages dir """ im...
gpl-2.0
9,108,740,366,643,753,000
30.098592
109
0.671649
false
turon/openthread
tests/scripts/thread-cert/Cert_5_1_10_RouterAttachLinkQuality.py
1
6969
#!/usr/bin/env python # # Copyright (c) 2016, 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 # ...
bsd-3-clause
9,154,540,873,371,013,000
39.754386
79
0.694361
false
kingland/runtime
deps/v8/tools/testrunner/server/main.py
12
8953
# Copyright 2012 the V8 project 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
apache-2.0
6,778,309,564,730,051,000
35.542857
78
0.685804
false
alikins/ansible
lib/ansible/module_utils/network/common/config.py
38
13532
# 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
-1,920,168,921,701,054,200
29.477477
106
0.551803
false
Thhhza/XlsxWriter
xlsxwriter/test/comparison/test_chart_title01.py
8
1535
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
-8,200,257,901,563,032,000
24.583333
79
0.542671
false
trbs/django-oauth-toolkit
oauth2_provider/ext/rest_framework/permissions.py
11
1922
import logging from django.core.exceptions import ImproperlyConfigured from rest_framework.permissions import BasePermission from ...settings import oauth2_settings log = logging.getLogger('oauth2_provider') SAFE_HTTP_METHODS = ['GET', 'HEAD', 'OPTIONS'] class TokenHasScope(BasePermission): """ The requ...
bsd-2-clause
6,172,054,866,437,923,000
30.508197
94
0.651925
false
saurabh6790/OFF-RISAPP
patches/april_2013/p05_update_file_data.py
30
2406
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import webnotes, webnotes.utils, os def execute(): webnotes.reload_doc("core", "doctype", "file_data") webnotes.reset_perms("File Data") singles = get_single_doctypes() for doctype...
agpl-3.0
-1,996,610,951,925,007,600
30.657895
91
0.672901
false
wyvernnot/learn_python_through_unittest
tests/ClassMagicTest.py
1
2708
import unittest from unittest.mock import Mock class ClassMagicTest(unittest.TestCase): def test_new(self): class A(object): def __new__(cls, *args, **kwargs): # 重载 __new__ 必须返回 return object.__new__(cls, *args, **kwargs) def __init__(self): ...
mit
8,066,743,159,398,102,000
21.25
59
0.437828
false
kaushik94/boto
boto/ec2/reservedinstance.py
17
12948
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
-130,505,028,038,792,800
35.994286
78
0.614149
false
bqbn/addons-server
src/olympia/git/tests/test_admin.py
1
2320
from django.contrib.admin.sites import AdminSite from pyquery import PyQuery as pq from olympia.amo.tests import TestCase, addon_factory, user_factory from olympia.amo.urlresolvers import reverse from olympia.git.admin import GitExtractionEntryAdmin from olympia.git.models import GitExtractionEntry class TestGitExt...
bsd-3-clause
-6,525,388,924,771,073,000
34.692308
77
0.66681
false
pranavtendolkr/horizon
openstack_dashboard/dashboards/admin/metadata_defs/urls.py
62
1253
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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
5,348,798,606,228,972,000
39.419355
78
0.702314
false
ghtmtt/QGIS
tests/src/python/test_layer_dependencies.py
31
14442
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsSnappingUtils (complement to C++-based tests) .. note:: 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 ...
gpl-2.0
-150,756,860,004,319,140
42.63142
196
0.632876
false
topxiaoke/myedx
lms/djangoapps/certificates/migrations/0011_auto__del_field_generatedcertificate_certificate_id__add_field_generat.py
188
5961
# -*- 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): # Deleting field 'GeneratedCertificate.certificate_id' db.delete_column('certificates_generatedcertificate',...
agpl-3.0
3,137,861,653,596,457,000
65.233333
182
0.572052
false
JuliBakagianni/CEF-ELRC
lib/python2.7/site-packages/django/conf/locale/pt/formats.py
232
1532
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \de F \de Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = r'j \de F \de Y à...
bsd-3-clause
2,282,631,868,811,984,000
37.275
90
0.52776
false
catlinman/input-dungeon
interface.py
1
5859
# This interface module contains additional behavior for curses to make it more suited for # the current aim of this project. It enables quick interaction between curses and the # actual game while still attempting to be flexible and expendable at the same time. # Developer note: It should be good practice to allow t...
mit
5,287,872,878,099,049,000
42.080882
142
0.644479
false
robinro/ansible-modules-core
cloud/google/gce_pd.py
51
9869
#!/usr/bin/python # Copyright 2013 Google Inc. # # 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 vers...
gpl-3.0
-5,226,139,787,287,253,000
31.357377
95
0.599959
false
jhartford/pybo
tests/test_acquisitions.py
1
1134
""" Unit tests for different acquisition functions. This mainly tests that the gradients of each acquisition function are computed correctly. """ # future imports from __future__ import division from __future__ import absolute_import from __future__ import print_function # global imports import numpy as np import num...
bsd-2-clause
-8,453,243,416,616,783,000
24.2
74
0.685185
false
egor-tensin/sorting_algorithms
algorithms/impl/heapsort.py
2
1858
# Copyright (c) 2015 Egor Tensin <Egor.Tensin@gmail.com> # This file is part of the "Sorting algorithms" project. # For details, see https://github.com/egor-tensin/sorting-algorithms. # Distributed under the MIT License. import sys from ..algorithm import SortingAlgorithm # Disclaimer: implemented in the most litera...
mit
-6,606,844,577,005,573,000
21.658537
69
0.593111
false
mlcommons/training
single_stage_detector/ssd/distributed.py
1
3611
import torch from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors import torch.distributed as dist from torch.nn.modules import Module ''' This version of DistributedDataParallel is designed to be used in conjunction with the multiproc.py launcher included with this example. It assumes that your r...
apache-2.0
253,998,514,403,053,860
43.036585
103
0.593464
false
amir-qayyum-khan/edx-platform
lms/djangoapps/courseware/tests/test_lti_integration.py
10
9292
"""LTI integration tests""" from collections import OrderedDict import json import mock from nose.plugins.attrib import attr import oauthlib import urllib from django.conf import settings from django.core.urlresolvers import reverse from courseware.tests import BaseTestXmodule from courseware.views.views import get_...
agpl-3.0
6,483,814,333,690,496,000
41.429224
117
0.620426
false
Thhhza/XlsxWriter
xlsxwriter/test/worksheet/test_worksheet04.py
8
2180
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet from ...format ...
bsd-2-clause
-3,940,445,809,904,033,000
34.737705
171
0.52156
false
bobobox/ansible
lib/ansible/module_utils/dellos6.py
21
8111
# # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # # Copyright (c) 2016 Dell Inc. # # 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 ...
gpl-3.0
-8,090,575,197,356,559,000
35.868182
102
0.58772
false
stxnext-csr/volontulo
apps/volontulo/models.py
1
10920
# -*- coding: utf-8 -*- u""" .. module:: models """ import logging import os # pylint: disable=unused-import import uuid from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.db.models import F from django.utils import timezone logger = logging.getLogg...
mit
5,361,875,853,644,664,000
29.674157
78
0.616117
false
WendellDuncan/or-tools
examples/data/nonogram_regular/nonogram_p200.py
74
1810
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 applica...
apache-2.0
-6,396,195,999,448,267,000
22.506494
75
0.507182
false
pennersr/django-allauth
allauth/socialaccount/providers/draugiem/tests.py
2
4796
from hashlib import md5 from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.urls import reverse from django.utils.http import urlencode from allauth.socialaccount import providers from allauth.socialaccount.models import SocialApp, SocialToken from allauth.tests import...
mit
2,807,772,772,233,389,600
35.333333
87
0.562761
false
40223117cda/w16cdaa
static/Brython3.1.0-20150301-090019/Lib/multiprocessing/pool.py
694
23263
# # Module providing the `Pool` class for managing a process pool # # multiprocessing/pool.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = ['Pool'] # # Imports # import threading import queue import itertools import collections import time from multiprocessing ...
gpl-3.0
-7,496,801,489,265,051,000
30.867123
83
0.543438
false
peterbarker/MAVProxy
MAVProxy/modules/mavproxy_antenna.py
16
2064
#!/usr/bin/env python ''' antenna pointing module Andrew Tridgell June 2012 ''' import sys, os, time from cuav.lib import cuav_util from MAVProxy.modules.lib import mp_module class AntennaModule(mp_module.MPModule): def __init__(self, mpstate): super(AntennaModule, self).__init__(mpstate, "antenna", "ante...
gpl-3.0
3,427,887,423,603,498,500
35.857143
92
0.58624
false
garnaat/boto
boto/sns/__init__.py
131
2117
# Copyright (c) 2010-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010-2011, Eucalyptus Systems, 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, includin...
mit
-5,651,908,945,571,717,000
38.203704
75
0.729806
false
jbedorf/tensorflow
tensorflow/contrib/gan/python/eval/python/summaries_impl.py
5
11802
# 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
9,098,161,463,842,176,000
36.230284
80
0.694882
false
jcoady9/youtube-dl
youtube_dl/extractor/beatportpro.py
142
3423
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import int_or_none class BeatportProIE(InfoExtractor): _VALID_URL = r'https?://pro\.beatport\.com/track/(?P<display_id>[^/]+)/(?P<id>[0-9]+)' _TESTS = [{ '...
unlicense
725,830,475,123,532,300
32.23301
90
0.472393
false
nhuntwalker/astroML
examples/algorithms/plot_bayesian_blocks.py
3
2706
""" Bayesian Blocks for Histograms ------------------------------ .. currentmodule:: astroML Bayesian Blocks is a dynamic histogramming method which optimizes one of several possible fitness functions to determine an optimal binning for data, where the bins are not necessarily uniform width. The astroML implementatio...
bsd-2-clause
-5,005,010,556,680,249,000
33.692308
79
0.627494
false
jalavik/invenio-records
invenio_records/providers/recid.py
4
1834
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 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 the # License, or (at your option) any...
gpl-2.0
-2,090,704,761,326,657,000
30.62069
77
0.663032
false
cycotech/WAR-app
env/lib/python3.5/site-packages/django/conf/locale/fr/formats.py
504
1454
# -*- 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 F Y' TIME_FORMAT = 'H:i' DATETI...
mit
754,449,604,454,348,900
39.388889
77
0.566713
false
linjoahow/W16_test1
static/Brython3.1.3-20150514-095342/Lib/VFS_import.py
738
3059
import os from browser import doc #_scripts=doc.createElement('script') #_scripts.src="/src/py_VFS.js" #_scripts.type="text/javascript" #doc.get(tag='head')[0].appendChild(_scripts) VFS=dict(JSObject(__BRYTHON__.py_VFS)) class VFSModuleFinder: def __init__(self, path_entry): print("in VFSModuleFinder") ...
gpl-3.0
-2,127,311,724,851,457,800
34.16092
84
0.567833
false
antonve/s4-project-mooc
lms/djangoapps/instructor/access.py
83
2634
""" Access control operations for use by instructor APIs. Does not include any access control, be sure to check access before calling. TO DO sync instructor and staff flags e.g. should these be possible? {instructor: true, staff: false} {instructor: true, staff: true} """ import logging from djan...
agpl-3.0
-4,383,224,409,923,555,300
24.823529
98
0.651481
false
guewen/odoo
openerp/report/render/rml2pdf/__init__.py
381
1101
# -*- 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...
agpl-3.0
-5,183,721,119,589,142,000
41.346154
79
0.614896
false
gechr/ansible-modules-extras
packaging/os/slackpkg.py
131
6382
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kim Nørgaard # Written by Kim Nørgaard <jasen@jasen.dk> # Based on pkgng module written by bleader <bleader@ratonland.org> # that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com> # that was based on pacman module written by Afterburn <htt...
gpl-3.0
-7,659,245,710,266,280,000
31.055276
120
0.58865
false
KohlsTechnology/ansible
lib/ansible/modules/utilities/logic/async_status.py
22
3006
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # 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...
gpl-3.0
3,813,427,270,067,078,700
28.762376
151
0.634398
false
bplancher/odoo
addons/account_tax_exigible/models/account_move.py
12
1726
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import fields, models, api class AccountMoveLine(models.Model): _inherit = "account.move.line" tax_exigible = fields.Boolean(string='Appears in VAT report', default=True, help="Technical fi...
agpl-3.0
-5,645,034,495,406,240,000
48.314286
298
0.670336
false
TylerKirby/cltk
cltk/stem/akkadian/cv_pattern.py
2
2145
""" Return a CV patterned string based on the word. """ __author__ = ['M. Willis Monroe <willismonroe@gmail.com>'] __license__ = 'MIT License. See LICENSE.' from cltk.stem.akkadian.syllabifier import AKKADIAN class CVPattern(object): """Return a patterned string representing the consonants and vowels of th...
mit
-7,393,484,848,156,466,000
30.984848
104
0.44055
false
ky822/scikit-learn
sklearn/utils/estimator_checks.py
9
51912
from __future__ import print_function import types import warnings import sys import traceback import inspect import pickle from copy import deepcopy import numpy as np from scipy import sparse import struct from sklearn.externals.six.moves import zip from sklearn.externals.joblib import hash, Memory from sklearn.ut...
bsd-3-clause
-7,728,675,816,565,337,000
34.92526
81
0.618855
false
Rav3nPL/doubloons-0.10
qa/rpc-tests/mempool_coinbase_spends.py
143
3850
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test re-org scenarios with a mempool that contains transactions # that spend (directly or indirectly) coin...
mit
-2,729,291,827,385,604,000
39.957447
98
0.655844
false
kmggh/python-guess-number
guess_num_player.py
1
1325
#!/usr/bin/env python # Fri 2013-05-03 23:49:55 -0400 # Copyright (c) 2013 by Ken Guyton. All Rights Reserved. """A game for guessing a number. Used as a Python class example. A computer player plays the game. """ __author__ = 'Ken Guyton' import argparse import guess_num2 import player MAX_DEFAULT = 100 MIN_DEF...
artistic-2.0
-4,024,513,252,216,439,000
22.660714
71
0.634717
false
rpip/mpower-python
setup.py
2
2405
from setuptools import setup, Command from unittest import TextTestRunner, TestLoader from glob import glob from os.path import splitext, basename, join as pjoin try: from os.path import walk except ImportError: from os import walk import os class TestCommand(Command): user_options = [] def initializ...
mit
6,796,190,529,577,032,000
26.329545
61
0.577963
false
diofant/diofant
diofant/core/power.py
1
47841
import math from mpmath.libmp import sqrtrem as mpmath_sqrtrem from ..logic import true from ..utilities import sift from .add import Add from .cache import cacheit from .compatibility import as_int from .evalf import PrecisionExhausted from .evaluate import global_evaluate from .expr import Expr from .function impor...
bsd-3-clause
-1,297,017,511,015,771,400
35.106415
96
0.433561
false
openaid-IATI/deprecated-version-OIPA-v2
iati/data/migrations/0013_auto__add_field_country_dac_region_code__add_field_country_dac_region_.py
1
19581
# -*- 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): # Adding field 'Country.dac_region_code' db.add_column('data_country', 'dac_region_code', ...
agpl-3.0
6,472,893,859,356,375,000
71.525926
182
0.547163
false
axsauze/eventsfinder
django/db/backends/postgresql_psycopg2/creation.py
107
4139
import psycopg2.extensions from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can conta...
bsd-3-clause
-4,742,521,401,117,939,000
46.574713
146
0.566079
false
Exterminus/harpia
harpia/bpGUI/matchTem.py
2
8161
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
gpl-2.0
2,609,609,050,396,005,400
41.056701
187
0.51244
false
pschella/scipy
scipy/_lib/tests/test__util.py
25
2076
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_equal, assert_, assert_raises from scipy._lib._util import _aligned_zeros, check_random_state def test__aligned_zeros(): niter = 10 def check(shape, dtype, order, align): err_msg = r...
bsd-3-clause
-5,754,178,822,858,437,000
36.745455
76
0.585742
false
seanli9jan/tensorflow
tensorflow/contrib/memory_stats/__init__.py
53
1224
# 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,454,416,519,961,227,000
38.483871
85
0.732843
false
Philmod/mongo-connector
mongo_connector/doc_managers/solr_doc_manager.py
8
11225
# Copyright 2013-2014 MongoDB, 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 law or agreed to in writin...
apache-2.0
7,439,807,118,916,180,000
36.667785
80
0.588686
false
Srisai85/scipy
scipy/linalg/tests/test_lapack.py
28
17002
#!/usr/bin/env python # # Created by: Pearu Peterson, September 2002 # from __future__ import division, print_function, absolute_import from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_array_almost_equal, assert_, assert_raises, assert_allclose, \ assert_almost_equal import numpy ...
bsd-3-clause
5,038,684,073,976,007,000
34.945032
111
0.463416
false
edx/edx-analytics-dashboard
analytics_dashboard/learner_analytics_api/v0/views.py
1
6267
from requests.exceptions import ConnectTimeout from rest_framework.exceptions import PermissionDenied from rest_framework.generics import RetrieveAPIView from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from .clients import LearnerAPIClient from .permissions import Ha...
agpl-3.0
-2,609,789,061,055,679,500
35.436047
120
0.676081
false
schlueter/ansible
lib/ansible/modules/commands/telnet.py
33
2576
# this is a virtual module that is entirely implemented server side # 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...
gpl-3.0
-6,912,494,424,368,098,000
23.769231
102
0.643634
false
wshallum/ansible
lib/ansible/modules/network/netvisor/pn_vrouterbgp.py
29
15078
#!/usr/bin/python """ PN-CLI vrouter-bgp-add/vrouter-bgp-remove/vrouter-bgp-modify """ # # 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 Lice...
gpl-3.0
-9,021,961,218,522,632,000
30.810127
79
0.610359
false
therandomcode/Fanalytics
lib/oauth2client/service_account.py
52
5038
# 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 ...
apache-2.0
4,068,466,516,727,695,400
36.879699
76
0.611552
false
donald-pinckney/EM-Simulator
EM Sim/EM SimContent/Lib/lib2to3/pgen2/token.py
353
1244
#! /usr/bin/env python """Token constants (from "token.h").""" # Taken from Python (r53757) and modified to include some tokens # originally monkeypatched in by pgen2.tokenize #--start constants-- ENDMARKER = 0 NAME = 1 NUMBER = 2 STRING = 3 NEWLINE = 4 INDENT = 5 DEDENT = 6 LPAR = 7 RPAR = 8 LSQB = 9 RSQB = 10 C...
apache-2.0
-4,524,195,969,985,903,600
14.170732
65
0.676045
false
wbinventor/openmc
openmc/data/kalbach_mann.py
1
14224
from collections.abc import Iterable from numbers import Real, Integral from warnings import warn import numpy as np import openmc.checkvalue as cv from openmc.stats import Tabular, Univariate, Discrete, Mixture from .function import Tabulated1D, INTERPOLATION_SCHEME from .angle_energy import AngleEnergy from .data i...
mit
6,583,787,950,731,069,000
34.383085
86
0.559618
false
bclau/nova
nova/tests/integrated/test_servers.py
8
19688
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara # 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.apach...
apache-2.0
-1,159,182,078,609,849,900
37.303502
79
0.625203
false
havard024/prego
sales/api/tests.py
3
17262
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license #-*- codeing: utf-8 -*- import json from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse from django.contrib.auth.models import User as DjangoU...
mit
4,903,779,124,763,055,000
46.293151
132
0.609605
false
iwoca/django-deep-collector
tests/test_serializer.py
1
1514
from copy import copy import json from django.test import TestCase from .factories import ChildModelFactory from deep_collector.compat.serializers import MultiModelInheritanceSerializer class TestMultiModelInheritanceSerializer(TestCase): def test_that_parent_model_fields_are_in_serializated_object_if_parent_is...
bsd-3-clause
-4,081,760,577,509,073,400
42.257143
97
0.729194
false
garyjyao1/ansible
lib/ansible/plugins/connection/docker.py
15
8622
# Based on the chroot connection plugin by Maykel Moya # # Connection plugin for configuring docker containers # (c) 2014, Lorin Hochstein # (c) 2015, Leendert Brouwer # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # Maintainer: Leendert Brouwer (https://github.com/objectified) # # This file is part of Ansible #...
gpl-3.0
-5,472,440,659,272,386,000
42.326633
121
0.63338
false
c0defreak/python-for-android
python3-alpha/extra_modules/gdata/geo/__init__.py
45
6005
# -*-*- encoding: utf-8 -*-*- # # This is gdata.photos.geo, implementing geological positioning in gdata structures # # $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $ # # Copyright 2007 Håvard Gulldahl # Portions copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License");...
apache-2.0
-141,531,355,547,288,300
31.448649
103
0.686657
false
ycaihua/kbengine
kbe/res/scripts/common/Lib/encodings/rot_13.py
155
2428
#!/usr/bin/env python """ Python Character Mapping Codec for ROT13. This codec de/encodes from str to str. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self, input, errors='strict'): return (input.translate(rot13_map), len(input...
lgpl-3.0
6,333,234,198,888,007,000
20.486726
57
0.663097
false
woutersmet/Molmodsummer
lib/molmod/io/dlpoly.py
1
9363
# MolMod is a collection of molecular modelling tools for python. # Copyright (C) 2007 - 2008 Toon Verstraelen <Toon.Verstraelen@UGent.be> # # This file is part of MolMod. # # MolMod 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...
gpl-3.0
5,444,467,297,642,824,000
39.184549
158
0.548756
false
Empeeric/dirometer
django/views/csrf.py
289
3834
from django.http import HttpResponseForbidden from django.template import Context, Template from django.conf import settings # We include the template inline since we need to be able to reliably display # this error message, especially for the sake of developers, and there isn't any # other way of making it available ...
mit
-5,320,599,471,362,799,000
36.588235
133
0.675013
false
lucalianas/openmicroscopy
components/tools/OmeroPy/src/omero/gateway/scripts/testdb_create.py
9
9835
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Library for gateway tests Copyright 2009 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import omero from omero.rtypes import rstring from omero.gateway.scripts import dbhelpers dbhelpers.USERS = { ...
gpl-2.0
-877,442,211,466,764,400
35.835206
79
0.59939
false
blacklin/kbengine
kbe/src/lib/python/Lib/test/test_pickle.py
72
4522
import pickle import io import collections from test import support from test.pickletester import AbstractPickleTests from test.pickletester import AbstractPickleModuleTests from test.pickletester import AbstractPersistentPicklerTests from test.pickletester import AbstractPicklerUnpicklerObjectTests from test.picklet...
lgpl-3.0
3,059,946,087,810,033,000
27.987179
76
0.671827
false
mottosso/pyblish-magenta
pyblish_magenta/vendor/cquery/vendor/nose/result.py
68
6711
""" Test Result ----------- Provides a TextTestResult that extends unittest's _TextTestResult to provide support for error classes (such as the builtin skip and deprecated classes), and hooks for plugins to take over or extend reporting. """ import logging try: # 2.7+ from unittest.runner import _TextTestResu...
lgpl-3.0
118,256,144,930,173,840
32.555
77
0.567874
false
ivankelly/Rhythmbox-Spotify-Plugin
plugins/rb/__init__.py
2
3597
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- # # Copyright 2006, James Livingston <doclivingston@gmail.com> # Copyright 2006, Ed Catmur <ed@catmur.co.uk> # Copyright 2007, Jonathan Matthew # # This program is free software; you can redistribute it and/or modify # it under the terms of the G...
gpl-2.0
-6,092,515,768,749,965,000
30.008621
79
0.70392
false
Intel-bigdata/s3-tests
s3tests/functional/__init__.py
3
12312
import ConfigParser import boto.exception import boto.s3.connection import bunch import itertools import os import random import string from .utils import region_sync_meta s3 = bunch.Bunch() config = bunch.Bunch() targets = bunch.Bunch() # this will be assigned by setup() prefix = None calling_formats = dict( o...
mit
4,699,205,822,177,889,000
30.248731
91
0.574643
false
imtapps/django-imt-fork
django/db/backends/__init__.py
52
38612
from django.db.utils import DatabaseError try: from django.utils.six.moves import _thread as thread except ImportError: from django.utils.six.moves import _dummy_thread as thread from contextlib import contextmanager from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.db.backen...
bsd-3-clause
710,411,669,456,865,800
34.133758
110
0.62263
false
westinedu/newertrends
django/views/generic/date_based.py
246
14025
import datetime import time from django.template import loader, RequestContext from django.core.exceptions import ObjectDoesNotExist from django.core.xheaders import populate_xheaders from django.db.models.fields import DateTimeField from django.http import Http404, HttpResponse import warnings warnings.warn( 'Fu...
bsd-3-clause
2,064,579,753,707,283,700
36.4
156
0.624171
false
keen99/SickRage
lib/github/CommitStatus.py
49
4721
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
-3,011,692,638,393,350,000
38.672269
103
0.518111
false
xuweiliang/Codelibrary
novaclient/exceptions.py
1
8967
# Copyright 2010 Jacob Kaplan-Moss # # 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 ...
apache-2.0
-1,046,662,721,080,125,000
26.934579
79
0.616929
false