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
sensidev/drf-requests-jwt
drf_requests_jwt/services.py
1
4894
""" Services. """ import logging import requests from urllib.parse import urlparse, parse_qs from drf_requests_jwt import settings from drf_requests_jwt.backends.utils import build_url logger = logging.getLogger(__name__) class HttpRequestService(object): obtain_jwt_allowed_fail_attempts = settings.DEFAULTS.get...
mit
-6,559,862,687,840,582,000
31.410596
101
0.596036
false
UrusTeam/android_ndk_toolchain_cross
lib/python2.7/lib2to3/fixes/fix_sys_exc.py
327
1039
"""Fixer for sys.exc_{type, value, traceback} sys.exc_type -> sys.exc_info()[0] sys.exc_value -> sys.exc_info()[1] sys.exc_traceback -> sys.exc_info()[2] """ # By Jeff Balogh and Benjamin Peterson # Local imports from .. import fixer_base from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms clas...
gpl-2.0
8,030,890,179,667,635,000
33.633333
72
0.616939
false
MarishaYasko/interactive-stories-stands
InteractiveStands/Lib/copyreg.py
165
6833
"""Helper to provide extensibility for pickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] dispatch_table = {} def pickle(ob_typ...
mit
8,624,719,848,230,675,000
32.826733
77
0.604127
false
catapult-project/catapult-csm
trace_processor/third_party/cloudstorage/common.py
129
12326
# Copyright 2012 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 ag...
bsd-3-clause
-1,954,761,002,360,891,000
27.731935
80
0.639624
false
dnidever/noaosourcecatalog
python/nsc_instcal_combine.py
1
27777
#!/usr/bin/env python import os import sys import numpy as np import warnings from astropy.io import fits from astropy.utils.exceptions import AstropyWarning from astropy.table import Table, vstack, Column from astropy.time import Time import healpy as hp from dlnpyutils import utils, coords import subprocess import t...
mit
329,439,110,446,213,800
44.387255
182
0.572596
false
sbt9uc/osf.io
framework/mongo/utils.py
11
1888
# -*- coding: utf-8 -*- import re import httplib as http import pymongo from modularodm.exceptions import ValidationValueError from framework.exceptions import HTTPError # MongoDB forbids field names that begin with "$" or contain ".". These # utilities map to and from Mongo field names. mongo_map = { '.': '__...
apache-2.0
5,962,020,813,483,322,000
24.173333
77
0.591102
false
holmes/intellij-community
python/helpers/epydoc/apidoc.py
90
92479
# epydoc -- API Documentation Classes # # Copyright (C) 2005 Edward Loper # Author: Edward Loper <edloper@loper.org> # URL: <http://epydoc.sf.net> # # $Id: apidoc.py 1675 2008-01-29 17:12:56Z edloper $ """ Classes for encoding API documentation about Python programs. These classes are used as a common representation f...
apache-2.0
8,770,389,486,572,857,000
40.978665
82
0.587928
false
kabrapratik28/Stanford_courses
cs224n/assignment1/q4_sentiment.py
1
8150
#!/usr/bin/env python import argparse import numpy as np import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import itertools from utils.treebank import StanfordSentiment import utils.glove as glove from q3_sgd import load_saved_params, sgd # We will use sklearn here because it will run faster t...
apache-2.0
4,027,457,613,679,352,000
30.835938
80
0.622577
false
xzturn/tensorflow
tensorflow/python/kernel_tests/proto/encode_proto_op_test_base.py
26
8489
# ============================================================================= # Copyright 2018 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 #...
apache-2.0
-645,645,493,953,483,900
39.8125
105
0.629756
false
lepricon49/headphones
lib/bs4/builder/__init__.py
73
11234
from collections import defaultdict import itertools import sys from bs4.element import ( CharsetMetaAttributeValue, ContentMetaAttributeValue, whitespace_re ) __all__ = [ 'HTMLTreeBuilder', 'SAXTreeBuilder', 'TreeBuilder', 'TreeBuilderRegistry', ] # Some useful features for a Tree...
gpl-3.0
1,191,731,705,983,103,200
33.67284
80
0.602368
false
fw1121/genomics
bcftbx/Pipeline.py
1
28839
#!/usr/bin/env python # # Pipeline.py: classes for running scripts iteratively # Copyright (C) University of Manchester 2011 Peter Briggs # ######################################################################## # # Pipeline.py # ######################################################################### """ Cl...
artistic-2.0
-8,238,330,618,129,812,000
36.846457
94
0.576303
false
buntyke/Flask
microblog/flask/lib/python2.7/site-packages/wtforms/meta.py
79
3822
from wtforms.utils import WebobInputWrapper from wtforms import i18n class DefaultMeta(object): """ This is the default Meta class which defines all the default values and therefore also the 'API' of the class Meta interface. """ # -- Basic form primitives def bind_field(self, form, unbound_...
mit
-1,531,494,448,635,667,500
30.586777
113
0.621664
false
abhishekgahlot/scikit-learn
examples/linear_model/plot_sgd_separating_hyperplane.py
260
1219
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ print(__doc__) import numpy as n...
bsd-3-clause
5,239,517,398,036,559,000
28.02381
77
0.648072
false
2013Commons/HUE-SHARK
desktop/core/ext-py/Django-1.2.3/django/core/serializers/json.py
107
2053
""" Serialize data to/from JSON """ import datetime import decimal from StringIO import StringIO from django.core.serializers.python import Serializer as PythonSerializer from django.core.serializers.python import Deserializer as PythonDeserializer from django.utils import datetime_safe from django.utils import simpl...
apache-2.0
8,950,096,234,089,235,000
30.584615
89
0.669264
false
moyogo/tachyfont
run_time/src/gae_server/third_party/old-fonttools-master/Lib/fontTools/ttLib/tables/E_B_L_C_.py
11
25091
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.misc import sstruct from . import DefaultTable from fontTools.misc.textTools import safeEval from .BitmapGlyphMetrics import BigGlyphMetrics, bigGlyphMetricsFormat, SmallGlyphMetrics, smallGlyphMetricsForma...
apache-2.0
2,088,799,548,908,137,500
39.666126
139
0.740544
false
tjanez/ansible
lib/ansible/plugins/terminal/iosxr.py
19
1850
# # (c) 2016 Red Hat 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 version. # # Ansible is d...
gpl-3.0
-3,848,447,093,796,002,000
33.259259
82
0.637838
false
knowsis/django
tests/mail/tests.py
48
36821
# coding: utf-8 from __future__ import unicode_literals import asyncore from email.mime.text import MIMEText import os import shutil import smtpd import sys import tempfile import threading from django.core import mail from django.core.mail import (EmailMessage, mail_admins, mail_managers, EmailMultiAlternati...
bsd-3-clause
3,697,639,605,785,755,600
46.016624
237
0.6347
false
IONISx/edx-platform
openedx/core/lib/extract_tar.py
135
2427
""" Safe version of tarfile.extractall which does not extract any files that would be, or symlink to a file that is, outside of the directory extracted in. Adapted from: http://stackoverflow.com/questions/10060069/safely-extract-zip-or-tar-using-python """ from os.path import abspath, realpath, dirname, join as joinpa...
agpl-3.0
5,292,224,991,190,633,000
32.246575
92
0.660486
false
EliteTK/PyBot
Modules/requests/packages/urllib3/util/retry.py
699
9924
import time import logging from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, ) from ..packages import six log = logging.getLogger(__name__) class Retry(object): """ Retry configuration. Each retry attempt will create a new Re...
gpl-3.0
-7,587,537,545,977,619,000
33.821053
104
0.6184
false
samthor/intellij-community
python/lib/Lib/_strptime.py
90
19538
"""Strptime-related classes and functions. CLASSES: LocaleTime -- Discovers and stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing time information FUNCTIONS: _getlang -- Figure out what language is being used for the locale ...
apache-2.0
1,566,149,884,057,280,000
42.321508
105
0.546832
false
vitorio/bite-project
deps/gdata-python-client/samples/apps/marketplace_sample/gdata/tlslite/api.py
359
2965
"""Import this module for easy access to TLS Lite objects. The TLS Lite API consists of classes, functions, and variables spread throughout this package. Instead of importing them individually with:: from tlslite.TLSConnection import TLSConnection from tlslite.HandshakeSettings import HandshakeSettings f...
apache-2.0
6,781,431,970,549,082,000
38.533333
79
0.790556
false
kitefishlabs/CorpusDB2
corpusdb2/nodegraph.py
1
6336
# nodegraph.py - nodegraphs # CorpusDB2 - Corpus-based processing for audio. """ Graph of Nodes. Nodes encapsulate audio processsing. 1:M relationship to source file (optional). 1:1 relationship to (potential) DataCollections. """ __version__ = '1.0' __author__ = 'Thomas Stoll' __copyright__...
gpl-3.0
-8,220,952,945,913,133,000
34.601124
139
0.559343
false
hynekcer/django
tests/admin_inlines/models.py
276
6824
""" Testing of admin inline formsets. """ from __future__ import unicode_literals import random from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible @pyt...
bsd-3-clause
-4,537,177,001,815,998,000
24.750943
93
0.722743
false
giacomov/3ML
threeML/utils/spectrum/pha_spectrum.py
1
34989
from __future__ import division from builtins import range from past.utils import old_div import collections import astropy.io.fits as fits import numpy as np import os import warnings import six from threeML.io.progress_bar import progress_bar from threeML.utils.OGIP.response import OGIPResponse, InstrumentResponse...
bsd-3-clause
7,735,432,735,798,420,000
26.25
132
0.559604
false
pjuu/pjuu
tests/test_parser.py
1
5540
# -*- coding: utf8 -*- """Post backend tests. :license: AGPL v3, see LICENSE for more details :copyright: 2014-2021 Joe Doherty """ from pjuu.auth.backend import create_account, activate from pjuu.lib.parser import (parse_hashtags, parse_links, parse_mentions, parse_post) from tests im...
agpl-3.0
-6,101,324,134,235,354,000
41.244275
79
0.612035
false
hunch/hunch-gift-app
django/contrib/gis/db/backends/postgis/creation.py
12
2905
from django.conf import settings from django.db.backends.postgresql.creation import DatabaseCreation class PostGISCreation(DatabaseCreation): geom_index_type = 'GIST' geom_index_opts = 'GIST_GEOMETRY_OPS' def sql_indexes_for_field(self, model, f, style): "Return any spatial index creation ...
mit
1,325,786,248,027,895,300
46.416667
93
0.481239
false
PiafPowaz/MultiCode
multicode.py
1
2682
#DEFINE_TYPE_CODE#py #sDEFINE_TYPE_CODE#py # -*- coding: utf-8 -*- import platform import os def main(): if int(platform.python_version_tuple()[0]) < 3: fullPathFile = raw_input("File's path :") else: fullPathFile = input("File's path :") pathFileNoExt = fullPathFile.split('.')[0] nameFileNoExt = p...
gpl-3.0
4,394,695,285,595,441,700
32.384615
84
0.629381
false
nigelb/simpleui
simpleui/cli_impl/impl.py
1
2102
# simpleui implements a number of simple UI patterns with fallback to CLI if the # selected GUI fails. # # Copyright (C) 2012 NigelB # # 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 vers...
gpl-3.0
2,391,133,582,813,218,300
33.459016
88
0.62274
false
lowitty/sendtrap
lib/pysnmp/entity/rfc3413/ntforg.py
3
16905
import sys from pyasn1.compat.octets import null from pysnmp.entity.rfc3413 import config from pysnmp.proto.proxy import rfc2576 from pysnmp.proto.api import v2c from pysnmp.proto import error from pysnmp import nextid from pysnmp import debug getNextHandle = nextid.Integer(0x7fffffff) class NotificationOriginator: ...
mit
5,982,526,749,757,127,000
42.235294
326
0.542325
false
40223148/2015cda_g5
static/Brython3.1.1-20150328-091302/Lib/urllib/parse.py
735
35170
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
gpl-3.0
-5,291,321,667,042,135,000
35.10883
88
0.588939
false
kosgroup/odoo
addons/stock/models/stock_location.py
4
13345
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime from dateutil import relativedelta from odoo import api, fields, models, _ from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT class Location(models.Model): _name = "stock.location"...
gpl-3.0
-5,531,126,282,891,788,000
59.659091
356
0.667291
false
sfluo/Mr.Bot
crypto/pycrypto-2.6/build/lib.macosx-10.7-intel-2.7/Crypto/Hash/hashalgo.py
124
3984
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
bsd-3-clause
2,363,372,076,258,632,000
33.344828
99
0.610693
false
reddraggone9/youtube-dl
youtube_dl/extractor/infoq.py
92
2315
from __future__ import unicode_literals import base64 from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_urlparse, ) class InfoQIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?infoq\.com/(?:[^/]+/)+(?P<id>[^/]+)' _TESTS = [{ 'url': 'http://www....
unlicense
-1,128,485,824,751,588,400
33.044118
169
0.554212
false
phoenixstar7/libsvm
tools/subset.py
124
3202
#!/usr/bin/env python import os, sys, math, random from collections import defaultdict if sys.version_info[0] >= 3: xrange = range def exit_with_help(argv): print("""\ Usage: {0} [options] dataset subset_size [output1] [output2] This script randomly selects a subset of the dataset. options: -s method : method of...
bsd-3-clause
946,341,884,544,384,600
25.683333
84
0.68426
false
anaran/kuma
vendor/packages/translate/filters/test_prefilters.py
33
1123
#!/usr/bin/env python # -*- coding: utf-8 -*- """tests decoration handling functions that are used by checks""" from translate.filters import prefilters def test_removekdecomments(): assert prefilters.removekdecomments(u"Some sṱring") == u"Some sṱring" assert prefilters.removekdecomments(u"_: Commenṱ\\n\nSo...
mpl-2.0
-6,775,069,672,364,273,000
35.833333
88
0.709502
false
hpcloud-mon/tempest
tempest/api_schema/response/compute/version.py
16
2153
# Copyright 2014 NEC Corporation. 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 ...
apache-2.0
-8,302,505,869,527,729,000
38.145455
79
0.391547
false
peiyuwang/pants
tests/python/pants_test/backend/python/tasks/interpreter_cache_test_mixin.py
17
1196
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os class In...
apache-2.0
7,725,585,480,457,705,000
41.714286
93
0.720736
false
implemento/domino
app/app/urls.py
1
1107
from django.conf.urls import include, url from django.contrib import admin from django.conf.urls import url, include from django.contrib.auth.models import User from rest_framework import routers, serializers, viewsets # Serializers define the API representation. class UserSerializer(serializers.HyperlinkedModelSeria...
gpl-3.0
9,174,950,371,001,252,000
34.709677
82
0.730804
false
dimmddr/roadSignsNN
prepare_images.py
1
8513
import cv2 import matplotlib.pyplot as plt import numpy as np from numpy.lib.stride_tricks import as_strided import nn from settings import COVER_PERCENT IMG_WIDTH = 1025 IMG_HEIGHT = 523 IMG_LAYERS = 3 SUB_IMG_WIDTH = 48 SUB_IMG_HEIGHT = 48 SUB_IMG_LAYERS = 3 WIDTH = 2 HEIGHT = 1 LAYERS = 0 XMIN = 0 YMIN = 1 XMAX ...
mit
6,245,023,130,045,099,000
37.695431
118
0.599764
false
ZHAW-INES/rioxo-uClinux-dist
user/python/python-2.4.4/Lib/test/test_operations.py
5
2028
# Python test set -- part 3, built-in operations. print '3. Operations' print 'XXX Mostly not yet implemented' print '3.1 Dictionary lookups succeed even if __cmp__() raises an exception' class BadDictKey: already_printed_raising_error = 0 def __hash__(self): return hash(self.__class__) def _...
gpl-2.0
-8,823,277,903,149,683,000
26.780822
76
0.627712
false
eric-haibin-lin/mxnet
example/profiler/profiler_ndarray.py
27
11345
# 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 u...
apache-2.0
-7,061,829,489,534,903,000
32.764881
101
0.571617
false
coreos/autotest
client/setup.py
3
2278
from distutils.core import setup import os try: import autotest.common as common except ImportError: import common from autotest.client.shared import version # Mostly needed when called one level up if os.path.isdir('client'): client_dir = 'client' else: client_dir = '.' autotest_dir = os.path.join(...
gpl-2.0
5,488,052,051,032,430,000
25.8
73
0.604917
false
leafjungle/luigi
luigi/mock.py
48
5473
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
-6,067,764,320,559,909,000
29.747191
104
0.565869
false
jsrudani/HadoopHDFSProject
dev-support/relnotes.py
62
7865
#!/usr/bin/python # 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, sof...
apache-2.0
6,230,308,597,149,682,000
27.70438
189
0.617165
false
wlach/treeherder
treeherder/model/error_summary.py
2
8237
import json import logging import re from django.conf import settings from django.core.urlresolvers import reverse logger = logging.getLogger(__name__) LEAK_RE = re.compile(r'\d+ bytes leaked \((.+)\)$') CRASH_RE = re.compile(r'.+ application crashed \[@ (.+)\]$') MOZHARNESS_RE = re.compile( r'^\d+:\d+:\d+[ ]+(...
mpl-2.0
1,784,334,657,268,240,100
32.21371
93
0.606653
false
ambitioninc/kmatch
kmatch/tests/mixin_tests.py
1
1208
import unittest from kmatch import KmatchTestMixin class MixinTestUsingMixin(KmatchTestMixin, unittest.TestCase): def test_matches(self): """ Test .assertMatches() using the mixin on a true match """ self.assertKmatches(['<=', 'f', 0], {'f': -1}) def test_matches_raises_erro...
mit
-4,141,386,362,831,977,000
29.974359
75
0.557947
false
mrkm4ntr/incubator-airflow
tests/test_utils/hdfs_utils.py
8
7310
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
5,413,529,356,039,544,000
36.295918
84
0.452668
false
tima/ansible
lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py
16
13352
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 ANS...
gpl-3.0
-3,439,006,784,755,109,000
36.931818
148
0.56059
false
fredrik-johansson/mpmath
mpmath/calculus/quadrature.py
1
42371
import math from ..libmp.backend import xrange class QuadratureRule(object): """ Quadrature rules are implemented using this class, in order to simplify the code and provide a common infrastructure for tasks such as error estimation and node caching. You can implement a custom quadrature rule by ...
bsd-3-clause
-3,030,196,217,709,281,000
37.069182
127
0.54103
false
Endika/OpenUpgrade
addons/l10n_fr/report/compute_resultant_report.py
374
4004
# -*- coding: utf-8 -*- # # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users w...
agpl-3.0
-6,236,081,410,930,613,000
39.857143
96
0.648352
false
justathoughtor2/atomicApe
cygwin/lib/python2.7/site-packages/pylint/checkers/newstyle.py
3
6974
# Copyright (c) 2005-2014 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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, o...
gpl-3.0
-1,876,628,342,176,921,000
40.266272
85
0.575136
false
piffey/ansible
lib/ansible/modules/cloud/amazon/aws_ses_identity_policy.py
78
7303
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: aws_ses_identity_policy s...
gpl-3.0
216,714,438,025,741,980
36.64433
129
0.689853
false
oktie/linkedct
ctdjango/chardet/universaldetector.py
190
6635
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
apache-2.0
8,797,377,409,774,949,000
42.084416
104
0.577091
false
OBIGOGIT/etch
binding-python/runtime/src/test/python/tests/binding/support/TestValidator_string.py
6
1079
# 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
8,494,853,113,510,465,000
48.045455
65
0.595922
false
Observer-Wu/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
121
3180
# Copyright (C) 2010 Google Inc. 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 conditions and th...
bsd-3-clause
4,755,179,142,633,721,000
53.827586
144
0.726101
false
skarra/CalDAVClientLibrary
caldavclientlibrary/client/account.py
1
1580
## # Copyright (c) 2006-2013 Apple 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 l...
apache-2.0
-2,167,797,317,913,153,500
39.512821
115
0.739873
false
pierreg/tensorflow
tensorflow/python/kernel_tests/summary_ops_test.py
10
3656
# 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
7,716,234,374,586,960,000
33.490566
80
0.61488
false
marc-sensenich/ansible
lib/ansible/modules/database/influxdb/influxdb_user.py
15
5857
#!/usr/bin/python # (c) 2017, Vitaliy Zhhuta <zhhuta () gmail.com> # insipred by Kamil Szczygiel <kamil.szczygiel () intel.com> influxdb_database module # 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 __meta...
gpl-3.0
-6,453,436,341,432,425,000
28.730964
111
0.632406
false
googleinterns/learnbase
learnbase/src/main/webapp/WEB-INF/Lib/macurl2path.py
332
3275
"""Macintosh-specific module for conversion between pathnames and URLs. Do not import directly; use urllib instead.""" import urllib import os __all__ = ["url2pathname","pathname2url"] def url2pathname(pathname): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not r...
apache-2.0
3,826,687,261,916,262,400
32.762887
81
0.544122
false
cschenck/blender_sim
fluid_sim_deps/blender-2.69/2.69/scripts/addons/netrender/slave.py
2
17536
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 version. # # This program is distrib...
gpl-3.0
-6,414,949,882,943,779,000
40.261176
262
0.495096
false
diegoguimaraes/django
tests/validators/tests.py
14
14725
# -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime, timedelta import re import types from unittest import TestCase from django.core.exceptions import ValidationError from django.core.validators import ( BaseValidator, EmailValidator, MaxLengthValidator, MaxValueValidator...
bsd-3-clause
3,520,677,181,863,817,700
39.482094
111
0.618033
false
heli522/scikit-learn
examples/model_selection/plot_roc.py
96
4487
""" ======================================= Receiver Operating Characteristic (ROC) ======================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality. ROC curves typically feature true positive rate on the Y axis, and false positive rate on the X a...
bsd-3-clause
-6,613,291,094,440,805,000
34.054688
79
0.646534
false
yinsu/grpc
src/python/grpcio_test/grpc_test/_junkdrawer/math_pb2.py
47
8463
# Copyright 2015, Google Inc. # 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 conditions and the f...
bsd-3-clause
-5,199,041,853,896,959,000
30.815789
709
0.707551
false
Nowheresly/odoo
addons/l10n_at/account_wizard.py
379
1234
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus.at # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
agpl-3.0
-4,378,851,601,850,910,700
34.257143
79
0.628039
false
blitzagency/flowbee
flowbee/deciders/events.py
1
13786
"""SWF Event Types Possible Decider Events: http://boto3.readthedocs.org/en/latest/reference/services/swf.html#SWF.Client.poll_for_decision_task WorkflowExecutionStarted WorkflowExecutionCancelRequested WorkflowExecutionCompleted CompleteWorkflowExecutionFailed WorkflowExecutionFailed FailWorkflowExecutionFailed Work...
mit
6,722,834,459,077,588,000
33.123762
177
0.65066
false
afaheem88/tempest_neutron
tempest/api/compute/admin/test_networks.py
8
2055
# Copyright 2014 Hewlett-Packard Development Company, L.P. # 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...
apache-2.0
-1,241,243,410,981,666,800
38.519231
78
0.6618
false
Davidjohnwilson/sympy
sympy/functions/special/tests/test_delta_functions.py
32
2856
from sympy import ( adjoint, conjugate, DiracDelta, Heaviside, nan, pi, sign, sqrt, symbols, transpose, Symbol, Piecewise, I, S, Eq ) from sympy.utilities.pytest import raises from sympy.core.function import ArgumentIndexError x, y = symbols('x y') def test_DiracDelta(): assert DiracDelta(1) == 0 a...
bsd-3-clause
8,411,965,287,998,585,000
35.615385
69
0.655812
false
zubron/servo
tests/wpt/web-platform-tests/cors/resources/status.py
220
1223
def main(request, response): response.headers.set("Access-Control-Allow-Origin", request.headers.get("origin") ) response.headers.set("Access-Control-Expose-Headers", "X-Request-Method") if request.method == 'OPTIONS': response.headers.set("Access-Control-Allow-Methods", "GET, CHICKEN, HEAD, POST,...
mpl-2.0
-7,800,282,483,235,899,000
32.054054
107
0.649223
false
xodus7/tensorflow
tensorflow/contrib/bigtable/python/ops/bigtable_api.py
4
28480
# Copyright 2018 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,786,309,422,389,752,000
37.176944
80
0.65934
false
yanchen036/tensorflow
tensorflow/python/kernel_tests/check_ops_test.py
2
53746
# 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
-4,060,775,781,880,462,000
40.343077
80
0.66418
false
andalexo/bgv
bgvDataDisp/guiqt.py
1
8538
""" The PyQt4 GUI classes for the bgvdata package. """ from __future__ import print_function, division import logging from os.path import splitext try: from PyQt4.QtGui import QMainWindow, QDockWidget from PyQt4 import QtCore except ImportError: from PyQt5.QtWidgets import QMainWindow, QDockWidget fr...
mit
2,357,605,885,022,094,300
42.340102
79
0.501757
false
huongttlan/statsmodels
statsmodels/stats/tests/test_inter_rater.py
34
11513
# -*- coding: utf-8 -*- """ Created on Mon Dec 10 09:18:14 2012 Author: Josef Perktold """ import numpy as np from numpy.testing import assert_almost_equal, assert_equal from statsmodels.stats.inter_rater import (fleiss_kappa, cohens_kappa, to_table, aggregate_raters) cla...
bsd-3-clause
-4,133,153,892,323,069,400
34.643963
194
0.505429
false
t0in4/django
tests/admin_checks/models.py
281
1836
""" Tests of ModelAdmin system checks logic. """ from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible class Album(models.Model): title = models.CharFie...
bsd-3-clause
-1,933,984,206,519,987,700
26
80
0.726035
false
meziti/bigbullions-test
p2pool/bitcoin/worker_interface.py
230
5901
from __future__ import division import StringIO import json import random import sys from twisted.internet import defer import p2pool from p2pool.bitcoin import data as bitcoin_data, getwork from p2pool.util import expiring_dict, jsonrpc, pack, variable class _Provider(object): def __init__(self, parent, long_p...
gpl-3.0
-7,274,254,705,382,987,000
40.556338
196
0.604813
false
polynomial/nixops
nixops/resources/gce_image.py
3
3281
# -*- coding: utf-8 -*- # Automatic provisioning of GCE Images. import os import libcloud.common.google from nixops.util import attr_property from nixops.gce_common import ResourceDefinition, ResourceState class GCEImageDefinition(ResourceDefinition): """Definition of a GCE Image""" @classmethod def g...
lgpl-3.0
-2,458,562,005,144,659,500
29.95283
108
0.583359
false
sergio-incaser/odoo
openerp/service/__init__.py
380
1613
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you c...
agpl-3.0
3,975,492,726,096,804,000
37.404762
78
0.66088
false
MihaiMoldovanu/ansible
test/units/modules/cloud/amazon/test_kinesis_stream.py
28
9780
import pytest import unittest boto3 = pytest.importorskip("boto3") botocore = pytest.importorskip("botocore") import ansible.modules.cloud.amazon.kinesis_stream as kinesis_stream aws_region = 'us-west-2' class AnsibleKinesisStreamFunctions(unittest.TestCase): def test_convert_to_lower(self): example =...
gpl-3.0
6,306,916,094,429,408,000
31.6
89
0.520757
false
sciurus/python_koans
python3/runner/sensei.py
59
9937
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import re import sys import os import glob from . import helper from .mockable_test_result import MockableTestResult from runner import path_to_enlightenment from libs.colorama import init, Fore, Style init() # init colorama class Sensei(MockableTestResu...
mit
-5,399,442,842,129,708,000
36.217228
101
0.529838
false
tqchen/tvm
tests/python/topi/python/test_topi_group_conv2d.py
1
11141
# 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 u...
apache-2.0
8,500,505,208,735,133,000
32.760606
98
0.532986
false
landism/pants
tests/python/pants_test/binaries/test_binary_util.py
8
8219
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import re ...
apache-2.0
7,448,616,268,781,142,000
42.031414
100
0.583283
false
goodwinnk/intellij-community
python/helpers/py2only/docutils/languages/nl.py
200
1865
# $Id: nl.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Martijn Pieters <mjpieters@users.sourceforge.net> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must ...
apache-2.0
8,914,560,059,603,353,000
30.083333
76
0.612869
false
percipient/raven-python
raven/contrib/bottle/utils.py
25
1045
""" raven.contrib.bottle.utils ~~~~~~~~~~~~~~~~~~~~~~~~~~ :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 import logging from raven.utils.compat import _urlparse from raven.utils.wsgi import get_header...
bsd-3-clause
8,132,754,021,142,023,000
25.794872
83
0.600957
false
sauloal/pycluster
pypy-1.9_64/lib-python/2.7/plat-mac/lib-scriptpackages/Explorer/Microsoft_Internet_Explorer.py
82
3140
"""Suite Microsoft Internet Explorer Suite: Events defined by Internet Explorer Level 1, version 1 Generated from /Applications/Internet Explorer.app AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'MSIE' class Microsoft_Internet_Explorer_Events: def GetSource(self,...
mit
-5,842,879,973,335,420,000
31.708333
148
0.627707
false
ujenmr/ansible
lib/ansible/modules/cloud/digital_ocean/digital_ocean_certificate_facts.py
29
3228
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ = ty...
gpl-3.0
2,237,879,689,643,854,800
27.069565
94
0.67596
false
kajgan/e2
lib/python/Plugins/SystemPlugins/VideoEnhancement/VideoEnhancement.py
44
11758
from os import path as os_path from Components.config import config, ConfigSubsection, ConfigSlider, ConfigSelection, ConfigBoolean, ConfigNothing, NoSave # The "VideoEnhancement" is the interface to /proc/stb/vmpeg/0. class VideoEnhancement: firstRun = True def __init__(self): self.last_modes_preferred = [ ] ...
gpl-2.0
6,331,951,586,189,336,000
31.661111
130
0.674094
false
oudalab/phyllo
phyllo/extractors/anselmDB.py
1
5827
import sqlite3 import urllib import re from urllib.request import urlopen from bs4 import BeautifulSoup from phyllo.phyllo_logger import logger import nltk from itertools import cycle nltk.download('punkt') from nltk import sent_tokenize anselmSOUP="" idx = -1 cha_array=[] suburl = [] verse = [] ...
apache-2.0
-278,816,513,929,801,020
36.589404
148
0.519478
false
binghongcha08/pyQMD
GWP/2D/1.0.1/comp.py
29
1292
##!/usr/bin/python import numpy as np import pylab as plt data = np.genfromtxt(fname='t100/wf.dat') data1 = np.genfromtxt(fname='t300/wf.dat') data2 = np.genfromtxt(fname='t500/wf.dat') data3 = np.genfromtxt(fname='t600/wf.dat') data00 = np.genfromtxt('../spo_1d/t100') data01 = np.genfromtxt('../spo_1d/t300') data02 ...
gpl-3.0
7,853,780,900,382,726,000
23.846154
65
0.629257
false
SOKP/external_chromium_org
content/test/gpu/gpu_tests/webgl_conformance.py
26
5126
# 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 optparse import os import sys import webgl_conformance_expectations from telemetry import benchmark as benchmark_module from telemetr...
bsd-3-clause
-7,109,474,740,519,521,000
29.331361
80
0.665821
false
TinyOS-Camp/DDEA-DEV
Archive/[14_10_03] Data_Collection_Sample/DB access sample code/vtt/sampling_density_VTT.py
1
6262
import os import sys import json from datetime import datetime import time import math import numpy as np import scipy as sp import matplotlib.pyplot as plt import pylab as pl import pickle ###### ### Configurations ###### UUID_FILE = 'finland_ids.csv' #DATA_FOLDER = 'VTT_week/' DATA_FOLDER = 'data_year/' DATA_EXT = ...
gpl-2.0
-1,401,599,265,538,142,000
29.696078
108
0.583041
false
jobiols/odoomrp-wip
mrp_byproduct_operations/__openerp__.py
27
1453
# -*- encoding: utf-8 -*- ############################################################################## # # Daniel Campos (danielcampos@avanzosc.es) Date: 29/09/2014 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as publi...
agpl-3.0
-6,540,752,538,776,238,000
37.236842
79
0.585685
false
echristophe/lic
src/RectanglePacker.py
5
11617
"""This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT A...
gpl-3.0
530,481,519,200,735,170
44.282869
95
0.648188
false
dhelbegor/omelette
project_name/settings/base.py
1
3526
""" Django settings for {{ project_name }} project. Generated by 'django-admin startproject' using Django {{ django_version }}. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.c...
mit
-1,956,583,953,818,279,400
25.511278
93
0.681225
false
dahlstrom-g/intellij-community
python/testData/refactoring/move/optimizeImportsAfterMoveInvalidatesMembersToBeMoved/after/src/src.py
22
2358
# -*- coding: utf-8 -*- # (c) 2017 Tuomas Airaksinen # # This file is part of Serviceform. # # Serviceform 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)...
apache-2.0
-4,469,407,654,177,266,000
38.966102
116
0.790925
false
globau/servo
tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_treewalkers.py
429
13692
from __future__ import absolute_import, division, unicode_literals import os import sys import unittest import warnings from difflib import unified_diff try: unittest.TestCase.assertEqual except AttributeError: unittest.TestCase.assertEqual = unittest.TestCase.assertEquals from .support import get_data_files...
mpl-2.0
-5,193,673,637,854,518,000
37.787535
115
0.545428
false
lsinfo/odoo
addons/calendar/contacts.py
389
1414
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
-2,749,465,891,768,291,000
39.428571
89
0.586987
false
TeamExodus/external_chromium_org
tools/memory_inspector/memory_inspector/data/serialization.py
89
4465
# 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. """This module handles the JSON de/serialization of the core classes. This is needed for both long term storage (e.g., loading/storing traces to local files...
bsd-3-clause
-3,681,701,840,853,906,000
38.522124
80
0.677268
false
ToonTownInfiniteRepo/ToontownInfinite
Panda3D-1.9.0/python/Lib/distutils/command/check.py
98
5557
"""distutils.command.check Implements the Distutils 'check' command. """ __revision__ = "$Id$" from distutils.core import Command from distutils.dist import PKG_INFO_ENCODING from distutils.errors import DistutilsSetupError try: # docutils is installed from docutils.utils import Reporter from docutils.pa...
mit
-5,648,363,922,742,182,000
36.295302
78
0.567572
false
thaim/ansible
lib/ansible/modules/network/fortios/fortios_system_replacemsg_icap.py
13
10063
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
mit
-1,622,123,057,668,313,900
28.684366
105
0.584219
false
mydongistiny/external_chromium_org_third_party_WebKit
Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver.py
21
4523
# Copyright (C) 2014 Google Inc. 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 conditions and the ...
bsd-3-clause
-2,603,503,911,096,511,000
48.703297
96
0.696662
false
amyliu345/zulip
zerver/views/events_register.py
10
2542
from __future__ import absolute_import from django.http import HttpRequest, HttpResponse from typing import Text from typing import Iterable, Optional, Sequence from zerver.lib.actions import do_events_register from zerver.lib.request import REQ, has_request_variables from zerver.lib.response import json_success from...
apache-2.0
-6,723,230,971,731,152,000
48.843137
132
0.675846
false