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
Dunkas12/BeepBoopBot
lib/youtube_dl/extractor/pokemon.py
51
2317
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( extract_attributes, int_or_none, ) class PokemonIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?pokemon\.com/[a-z]{2}(?:.*?play=(?P<id>[a-z0-9]{32})|/[^/]+/\d+_\d+-(?P<display_i...
gpl-3.0
3,996,347,385,433,522,700
38.931034
132
0.55829
false
izgzhen/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/resultlog.py
208
3536
""" log machine-parseable test session result information in a plain text file. """ import py import os def pytest_addoption(parser): group = parser.getgroup("terminal reporting", "resultlog plugin options") group.addoption('--resultlog', '--result-log', action="store", metavar="path", default=None, ...
mpl-2.0
7,872,866,473,546,982,000
33
78
0.58767
false
obulpathi/cloud
ml/vision/python/label/label.py
1
2368
#!/usr/bin/env python # Copyright 2015 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...
apache-2.0
-2,875,126,609,304,342,500
31.438356
78
0.649916
false
qq2588258/floweers
libs/external/emscripten/src/relooper/fuzzer.py
3
3123
import random, subprocess, difflib while True: # Random decisions num = random.randint(2, 250) density = random.random() * random.random() decisions = [random.randint(1, num*20) for x in range(num*3)] branches = [0]*num defaults = [0]*num for i in range(num): b = set([]) bs = random.randint(1, m...
mit
4,878,335,177,032,548,000
25.922414
197
0.54691
false
Work4Labs/lettuce
tests/integration/lib/Django-1.3/django/db/models/query.py
52
53941
""" The main QuerySet implementation. This provides the public API for the ORM. """ from itertools import izip from django.db import connections, router, transaction, IntegrityError from django.db.models.aggregates import Aggregate from django.db.models.fields import DateField from django.db.models.query_utils import...
gpl-3.0
4,492,861,006,274,674,700
36.56337
127
0.566322
false
markgw/jazzparser
src/jazzparser/utils/config.py
1
14444
"""Config file parsing All of the scripts in this project use the optparse package to handle command line options. This module provides a very simple mechanism for taking config files as input instead of specifying options on the command line. This is convenient, for example, for running experiments repeatedly whe...
gpl-3.0
-2,498,370,605,871,303,700
43.718266
128
0.543547
false
xodus7/tensorflow
tensorflow/python/summary/text_summary_test.py
9
1932
# 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
1,904,053,059,986,164,200
35.45283
80
0.702381
false
OpenHydrology/StatisticalFloodEstimationTool
floodestimationgui/CatchmentDescriptors.py
1
18940
''' Created on 27 Apr 2014 @author: Neil Nutt, neilnutt[at]googlemail[dot]com Tab used to store/collect catchment descriptors Statistical Flood Estimation Tool Copyright (C) 2014 Neil Nutt, neilnutt[at]googlemail[dot]com https://github.com/OpenHydrology/StatisticalFloodEstimationTool This program i...
gpl-3.0
4,439,912,203,816,518,700
41.756208
151
0.598469
false
mlhenderson/data_api
lib/doekbase/data_api/tests/test_memory_monitor.py
2
3276
import logging import sys import time import unittest from doekbase.data_api.util import MonitorMemory, get_logger, basic_config _log = get_logger(__name__) alerted = {} MB = 1024 * 1024 def icanhaz_alert(mm, avail, thresh, name): assert avail < thresh alerted[name] = avail _log.debug('\nalerted: {:d} M...
mit
-4,861,151,977,504,841,000
31.117647
74
0.549145
false
killerstorm/ngcccbase
ngcccbase/txdb.py
4
10324
from time import time from urllib2 import HTTPError import threading import os from pycoin.encoding import double_sha256 from coloredcoinlib.store import DataStore, DataStoreConnection, PersistentDictStore, unwrap1 from ngcccbase.services.blockchain import BlockchainInfoInterface from txcons import RawTxSpec from blo...
mit
-6,558,138,948,925,719,000
35.224561
104
0.590081
false
rmeertens/paparazzi
sw/tools/parrot/parrot_utils.py
11
3082
# # Copyright (C) 2012-2014 The Paparazzi Team # # This file is part of Paparazzi. # # Paparazzi 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, or (at your option) # any later version. # # P...
gpl-2.0
3,436,803,029,949,765,000
27.537037
136
0.656716
false
KAsante95/osf.io
website/addons/base/logger.py
13
2120
import abc class AddonNodeLogger(object): """Helper class for adding correctly-formatted addon logs to nodes. :param Node node: The node to add logs to :param Auth auth: Authorization of the person who did the action. """ __metaclass__ = abc.ABCMeta @abc.abstractproperty def addon_short_n...
apache-2.0
-2,952,949,905,901,469,000
33.754098
129
0.553774
false
pfig/CmdrKeen
cmdrkeen/config.py
1
3434
import json import logging logger = logging.getLogger(__name__) class Config(object): """A configuration for a Commander Keen bot This will read and parse a configuration file containing parameters for a Commander Keen Slack bot. Configurations are made of a set of JSON-encoded variables. Commande...
mit
-8,532,339,425,697,877,000
33.686869
78
0.593186
false
ned14/BEurtle
Installer/test/ZSI-2.1-a1/ZSI/wstools/test/test_wsdl.py
17
5500
#!/usr/bin/env python ############################################################################ # Joshua R. Boverhof, David W. Robertson, LBNL # See LBNLCopyright for copyright notice! ########################################################################### import sys, unittest import ConfigParser from ZSI.wsto...
lgpl-2.1
4,782,972,966,040,860,000
33.375
82
0.588364
false
zwChan/VATEC
~/eb-virt/Lib/site-packages/jinja2/debug.py
335
11553
# -*- coding: utf-8 -*- """ jinja2.debug ~~~~~~~~~~~~ Implements the debug interface for Jinja. This module does some pretty ugly stuff with the Python traceback system in order to achieve tracebacks with correct line numbers, locals and contents. :copyright: (c) 2010 by the Jinja Team. :...
apache-2.0
-8,665,649,667,907,768,000
32.008571
78
0.586168
false
cloakedcode/CouchPotatoServer
libs/suds/xsd/schema.py
192
14328
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
gpl-3.0
-7,479,637,573,317,427,000
32.952607
86
0.568537
false
shermanng10/superathletebuilder
env/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py
99
11451
from __future__ import unicode_literals import base64 import logging import string from datetime import datetime, timedelta from django.conf import settings from django.contrib.sessions.exceptions import SuspiciousSession from django.core.exceptions import SuspiciousOperation from django.utils import timezone from dj...
mit
-9,199,874,371,447,444,000
33.18209
94
0.61523
false
chartly/portfolio
ditfw-gfx/deps/wxwidgets/build/tools/builder.py
8
7907
import os import subprocess import sys import time class BuildError(Exception): def __init__(self, value): self.value = value def __repr__(self): return repr(self.value) def runInDir(command, dir=None, verbose=True): if dir: olddir = os.getcwd() os.chdir(dir) commandS...
mit
-1,009,459,991,297,197,300
30.007843
101
0.565322
false
BlindHunter/django
tests/migrations/test_autodetector.py
28
114100
# -*- coding: utf-8 -*- import re from django.apps import apps from django.conf import settings from django.contrib.auth.models import AbstractBaseUser from django.core.validators import RegexValidator, validate_slug from django.db import connection, models from django.db.migrations.autodetector import MigrationAutode...
bsd-3-clause
5,485,844,206,485,755,000
51.971216
119
0.642261
false
mufaddalq/cloudstack-datera-driver
test/integration/component/test_redundant_router_services.py
1
16945
# 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
536,404,981,862,063,600
43.127604
128
0.394925
false
Solinea/horizon
openstack_dashboard/dashboards/project/data_processing/utils/workflow_helpers.py
30
10029
# 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 the...
apache-2.0
5,602,993,333,762,732,000
34.438163
79
0.594077
false
rbian/tp-libvirt
libguestfs/tests/guestfs_list_operations.py
8
8006
import logging import re from autotest.client.shared import error from virttest import utils_test def test_list_with_mount(vm, params): """ 1) Fall into guestfish session w/o inspector 2) Do some necessary check 3) Try to mount root filesystem to / """ params['libvirt_domain'] = vm.name pa...
gpl-2.0
-6,920,142,925,648,255,000
31.412955
76
0.644517
false
heartsucker/securedrop
securedrop/tests/functional/source_navigation_steps.py
2
10246
import tempfile import time from selenium.webdriver.common.action_chains import ActionChains class SourceNavigationStepsMixin: def _is_on_source_homepage(self): return self.wait_for( lambda: self.driver.find_element_by_id("source-index") ) def _is_logged_in(self): return ...
agpl-3.0
706,447,468,305,728,500
38.867704
98
0.649619
false
JioCloud/python-ironicclient
ironicclient/common/http.py
2
13727
# -*- coding: utf-8 -*- # # Copyright 2012 OpenStack LLC. # 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
5,178,980,046,061,930,000
34.934555
79
0.577548
false
mishravikas/geonode-cas
geonode/maps/populate_maplayers.py
1
3222
from geonode.maps.models import Map, MapLayer from django.conf import settings maplayers = [ { "fixed": False, "group": "background", "layer_params": "", "map": 1, "name": "geonode:CA", "ows_url": "http://localhost:8080/geoserver/wms", "source_params": "", ...
gpl-3.0
-2,287,301,870,688,731,100
34.406593
284
0.524829
false
jmartiuk5/python-mode
pymode/libs3/rope/base/evaluate.py
32
12459
import rope.base.builtins import rope.base.pynames import rope.base.pyobjects from rope.base import ast, astutils, exceptions, pyobjects, arguments, worder BadIdentifierError = exceptions.BadIdentifierError def eval_location(pymodule, offset): """Find the pyname at the offset""" return eval_location2(pymodul...
lgpl-3.0
8,163,721,356,141,089,000
37.335385
84
0.604382
false
lavalamp-/ws-backend-community
wselasticsearch/models/dns/base.py
1
4055
# -*- coding: utf-8 -*- from __future__ import absolute_import from ..organizations.base import BaseOrganizationModel from ..types import * class BaseDomainNameModel(BaseOrganizationModel): """ This is a base Elasticsearch model for representing data that is tied to a given domain name. """ # Cl...
gpl-3.0
-2,550,735,540,396,028,000
27.356643
103
0.657213
false
brandond/ansible
lib/ansible/modules/cloud/cloudstack/cs_ip_address.py
14
8325
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2015, Darren Worrall <darren@iweb.co.uk> # Copyright (c) 2015, René Moser <mail@renemoser.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'sta...
gpl-3.0
3,937,866,440,452,648,400
29.375912
99
0.619368
false
smkr/pyclipse
plugins/org.python.pydev.jython/Lib/encodings/cp737.py
9
7185
""" Python Character Mapping Codec generated from 'CP737.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,error...
epl-1.0
4,901,343,003,126,645,000
40.773256
79
0.753236
false
salguarnieri/intellij-community
python/lib/Lib/site-packages/django/core/management/__init__.py
145
17405
import os import sys from optparse import OptionParser, NO_DEFAULT import imp import django from django.core.management.base import BaseCommand, CommandError, handle_default_options from django.utils.importlib import import_module # For backwards compatibility: get_version() used to be in this module. get_version = d...
apache-2.0
2,515,160,776,034,532,000
38.737443
105
0.617639
false
zhDai/CToFun
ML/KMeans/BKMeans.py
2
2388
# coding:utf-8 #二分KMeans方法 #依赖于KMeans里面的一些方法 import numpy as np from KMeans import * from pylab import * #进行多次(n次),寻找到近似最小SSE def choose_min_SSE(n,data_1): min_sse = np.inf i = 0 while i<n : data_2=choose_initil_point(2, data_1) [outcomes,poly_point]=k_means(data_1, data_2) sse = 0 ...
gpl-2.0
-7,190,267,978,395,914,000
26.301205
89
0.508826
false
bitglue/pyflakes
setup.py
3
1644
#!/usr/bin/env python # Copyright 2005-2011 Divmod, Inc. # Copyright 2013 Florent Xicluna. See LICENSE file for details from __future__ import with_statement import os.path try: from setuptools import setup except ImportError: from distutils.core import setup extra = {'scripts': ["bin/pyflakes"]} else: ...
mit
-558,444,265,279,335,740
27.344828
64
0.597324
false
debugger22/sympy
sympy/simplify/tests/test_sqrtdenest.py
98
6451
from sympy import sqrt, root, S, Symbol, sqrtdenest, Integral, cos from sympy.simplify.sqrtdenest import _subsets as subsets r2, r3, r5, r6, r7, r10, r15, r29 = [sqrt(x) for x in [2, 3, 5, 6, 7, 10, 15, 29]] def test_sqrtdenest(): d = {sqrt(5 + 2 * r6): r2 + r3, ...
bsd-3-clause
-3,471,872,096,651,337,000
36.074713
77
0.494342
false
namccart/gnuradio
docs/doxygen/doxyxml/generated/compoundsuper.py
348
359948
#!/usr/bin/env python # # Generated Thu Jun 11 18:44:25 2009 by generateDS.py. # import sys import getopt from string import lower as str_lower from xml.dom import minidom from xml.dom import Node # # User methods # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these metho...
gpl-3.0
-5,307,285,770,715,876,000
42.148885
641
0.596233
false
kingvuplus/Rudream-gui
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
12
6022
from Screens.Wizard import WizardSummary from Screens.WizardLanguage import WizardLanguage from Screens.Rc import Rc from VideoHardware import video_hw from Components.Pixmap import Pixmap, MovingPixmap, MultiPixmap from Components.config import config, ConfigBoolean, configfile from Tools.Directories import resolveF...
gpl-2.0
-8,061,970,865,398,514,000
30.528796
124
0.684158
false
mcus/SickRage
tests/test_ssl_sni.py
3
1988
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # Author: echel0n <sickrage.tv@gmail.com> # URL: http://www.github.com/sickragetv/sickrage/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
gpl-3.0
6,696,266,236,148,010,000
32.15
93
0.673541
false
sebrandon1/nova
nova/conf/api.py
3
11106
# Copyright 2015 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
-7,286,891,407,214,667,000
29.935933
78
0.700252
false
DirtyUnicorns/android_external_chromium-org
tools/json_schema_compiler/code.py
82
4811
# 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. class Code(object): """A convenience object for constructing code. Logically each object should be a block of code. All methods except |Render| an...
bsd-3-clause
4,358,812,257,982,782,000
32.880282
78
0.648514
false
daviddupont69/CouchPotatoServer
libs/oauthlib/oauth1/rfc5849/utils.py
112
4269
# -*- coding: utf-8 -*- """ oauthlib.utils ~~~~~~~~~~~~~~ This module contains utility methods used by various parts of the OAuth spec. """ import string import time import urllib2 from random import getrandbits, choice from oauthlib.common import quote, unquote UNICODE_ASCII_CHARACTER_SET = (string.ascii_letters....
gpl-3.0
792,937,349,515,096,700
29.276596
85
0.676505
false
bottompawn/kbengine
kbe/res/scripts/common/Lib/lib2to3/pygram.py
170
1114
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Export the Python grammar and symbols.""" # Python imports import os # Local imports from .pgen2 import token from .pgen2 import driver from . import pytree # The grammar file _GRAMMAR_FILE = os.path.join(os.path....
lgpl-3.0
6,996,471,122,414,451,000
26.85
70
0.685817
false
timothyjamesbecker/FusorSV
bin/FusorSV.py
1
37134
#!/usr/bin/env python import argparse import glob import gc import os import time import multiprocessing as mp #pip installed libs import numpy as np #local libs import fusorsv.svu_utils as su import fusorsv.read_utils as ru import fusorsv.fusor_utils as fusor des = """ FusorSV - A Data Fusion Method for Multi Source ...
gpl-3.0
-2,152,202,177,989,663,700
61.728041
166
0.541525
false
chromium/chromium
third_party/blink/tools/blinkpy/common/net/file_uploader.py
6
4675
# 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 the ...
bsd-3-clause
2,939,239,171,772,385,300
41.117117
114
0.675294
false
jayceyxc/hue
desktop/core/ext-py/Django-1.6.10/tests/m2m_regress/models.py
105
2481
from django.contrib.auth import models as auth from django.db import models from django.utils.encoding import python_2_unicode_compatible # No related name is needed here, since symmetrical relations are not # explicitly reversible. @python_2_unicode_compatible class SelfRefer(models.Model): name = models.CharFiel...
apache-2.0
2,380,544,753,007,796,000
30.0125
80
0.730754
false
JingJunYin/tensorflow
tensorflow/contrib/layers/python/layers/encoders_test.py
111
5276
# 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
1,410,228,938,144,565,800
40.21875
80
0.63931
false
tafaRU/server-tools
__unported__/fetchmail_attach_from_folder/match_algorithm/__init__.py
15
1087
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Therp BV (<http://therp.nl>) # All Rights Reserved # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
-892,060,780,337,527,400
40.807692
78
0.620055
false
HyShai/youtube-dl
youtube_dl/extractor/common.py
1
42324
from __future__ import unicode_literals import base64 import datetime import hashlib import json import netrc import os import re import socket import sys import time import xml.etree.ElementTree from ..compat import ( compat_cookiejar, compat_HTTPError, compat_http_client, compat_urllib_error, co...
unlicense
7,163,178,896,792,075,000
40.739645
138
0.540781
false
AlexandroPQC/sara-ani
Saranani/apps/users/models.py
1
1604
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin class UserManager(BaseUserManager): def _create_user(self, username, email, password, is_staff, is_superuser, **extra_fields): email = self.norma...
gpl-3.0
-6,903,834,264,146,133,000
37.190476
135
0.705736
false
simonpf/root
tutorials/dataframe/tdf001_introduction.py
6
4805
## \file ## \ingroup tutorial_tdataframe ## \notebook -nodraw ## This tutorial illustrates the basic features of the TDataFrame class, ## a utility which allows to interact with data stored in TTrees following ## a functional-chain like approach. ## ## \macro_code ## ## \date May 2017 ## \author Danilo Piparo import R...
lgpl-2.1
649,033,428,334,190,600
37.134921
140
0.716129
false
repotvsupertuga/tvsupertuga.repository
instal/script.module.schism.common/lib/js2py/legecy_translators/jsparser.py
42
9809
""" The process of translating JS will go like that: # TOP = 'imports and scope set' 1. Remove all the comments 2. Replace number, string and regexp literals with markers 4. Remove global Functions and move their translation to the TOP. Also add register code there. 5. Replace inline functions with lvals 6. Rem...
gpl-2.0
1,334,227,787,882,954,000
30.954397
117
0.569069
false
pedro2d10/SickRage-FR
lib/sqlalchemy/dialects/sybase/base.py
78
28800
# sybase/base.py # Copyright (C) 2010-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # get_select_precolumns(), limit_clause() implementation # copyright (C) 2007 Fisch Asset Management # AG http://www.fam.ch, with coding by Alexander Houben # alexander.houben@thor-solutions.ch # # This module is part ...
gpl-3.0
-5,883,753,517,675,479,000
34.294118
84
0.556528
false
joergdietrich/astropy
astropy/cosmology/tests/test_cosmology.py
2
69922
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) from io import StringIO import numpy as np from .. import core, funcs from ...tests.helper import pytest, quantity_allclose as allclose from ......
bsd-3-clause
-6,125,801,571,545,640,000
43.908157
78
0.579918
false
ihcfan/NautiPlot
hmi-cocos2d-x/plugin/tools/toolsForGame/main.py
265
3576
import sys, string, os from Tkinter import * import steps Plugins = sys.argv[1] print Plugins pluginList = Plugins.split(':') maxStep = 2 curStep = 1 stepList = [] # functions # show step on the num index def showStep(num): global stepList stepNum = len(stepList) if num >= stepNum or num <= 0 : ...
gpl-2.0
-4,848,347,241,615,998,000
24.726619
97
0.602349
false
ilayn/scipy
scipy/_lib/_disjoint_set.py
12
5483
""" Disjoint set data structure """ class DisjointSet: """ Disjoint set data structure for incremental connectivity queries. .. versionadded:: 1.6.0 Attributes ---------- n_subsets : int The number of subsets. Methods ------- add merge connected subset subset...
bsd-3-clause
-4,949,324,370,391,902,000
23.048246
79
0.511216
false
saurabh6790/omnit-app
patches/march_2013/p05_payment_reconciliation.py
30
1321
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import webnotes def execute(): # delete wrong gle entries created due to a bug in make_gl_entries of Account Controller # when using payment reconciliation res = webnotes.conn.sql_list(...
agpl-3.0
3,879,704,523,059,212,300
40.3125
89
0.703255
false
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/test/sortperf.py
9
4806
"""Sort performance test. See main() for command line syntax. See tabulate() for output format. """ import sys import time import random import marshal import tempfile import os td = tempfile.gettempdir() def randfloats(n): """Return a list of n random floats in [0, 1).""" # Generating floats is expensive,...
apache-2.0
8,331,333,069,390,195,000
27.43787
79
0.516022
false
DDMAL/Gamera
gamera/plugins/corelation.py
1
3823
# # Copyright (C) 2001-2005 Ichiro Fujinaga, Michael Droettboom, and Karl MacMillan # # 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 l...
gpl-2.0
2,282,306,106,691,394,300
35.066038
81
0.633272
false
NervanaSystems/neon
tests/test_misc.py
1
1558
# ****************************************************************************** # Copyright 2014-2018 Intel Corporation # # 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
7,141,608,769,392,618,000
35.232558
80
0.62837
false
colinnewell/odoo
openerp/pooler.py
374
2561
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
2,121,568,429,217,800,200
41.683333
104
0.691136
false
mdboom/astropy-helpers
astropy_helpers/sphinx/ext/phantom_import.py
84
5684
""" ============== phantom_import ============== Sphinx extension to make directives from ``sphinx.ext.autodoc`` and similar extensions to use docstrings loaded from an XML file. This extension loads an XML file in the Pydocweb format [1] and creates a dummy module that contains the specified docstrings. This can be ...
bsd-3-clause
-8,638,503,560,804,362,000
34.08642
79
0.526918
false
fireduck64/electrum
gui/stdio.py
3
7681
from decimal import Decimal _ = lambda x:x #from i18n import _ from electrum import WalletStorage, Wallet from electrum.util import format_satoshis, set_verbosity from electrum.bitcoin import is_valid, COIN, TYPE_ADDRESS from electrum.network import filter_protocol import sys, getpass, datetime # minimal fdisk like gu...
mit
6,110,061,859,007,401,000
32.107759
147
0.524411
false
t10471/python
practice/src/design_pattern/Command.py
1
1845
# -*- coding: utf-8 -*- #大体chain of responseibilityと同じだが、 #chain of responseibilityはhandlerと実処理が一緒なのに対して #commandはhandlerと実処理が別になっている class File(object): def __init__(self, name): self.name = name def getName(self): return self.name def decompress(self): print self.name + u'を展開し...
mit
-8,066,927,314,307,536,000
20.675
79
0.582804
false
echizentm/CompactDataStructures
chapter_02/get_huffman_codes.py
1
1189
# coding: utf-8 import sys from queue import PriorityQueue class Node: def __init__(self, value, left=None, right=None): self.value = value self.left = left self.right = right self.codes = [] def __lt__(self, other): return self.value < other.value def huffman_cod...
apache-2.0
-489,896,086,584,011,260
23.770833
66
0.544996
false
ecoal95/servo
tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/common/bufsocket.py
38
8385
# -*- coding: utf-8 -*- """ hyper/http20/bufsocket.py ~~~~~~~~~~~~~~~~~~~~~~~~~ This file implements a buffered socket wrapper. The purpose of this is to avoid the overhead of unnecessary syscalls while allowing small reads from the network. This represents a potentially massive performance optimisation at the cost o...
mpl-2.0
7,539,667,078,385,995,000
33.9375
78
0.587478
false
tempbottle/rethinkdb
test/rql_test/connections/http_support/decorator/decorator.py
112
10639
########################## LICENCE ############################### # Copyright (c) 2005-2012, Michele Simionato # 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 so...
agpl-3.0
-7,363,914,938,791,069,000
41.386454
80
0.568944
false
aperigault/ansible
lib/ansible/modules/network/f5/bigip_firewall_policy.py
38
16743
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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
5,741,053,908,837,142,000
30.471805
103
0.581975
false
nelmiux/CarnotKE
jyhton/Lib/test/test_collections.py
10
43841
import unittest, doctest, operator import inspect from test import test_support from collections import namedtuple, Counter, OrderedDict from test import mapping_tests import pickle, cPickle, copy from random import randrange, shuffle import keyword import re import sys from collections import Hashable, Iterable, Iter...
apache-2.0
2,459,999,093,959,128,000
40.833015
107
0.517027
false
theo-l/django
django/db/models/indexes.py
15
5245
from django.db.backends.utils import names_digest, split_identifier from django.db.models.query_utils import Q from django.db.models.sql import Query __all__ = ['Index'] class Index: suffix = 'idx' # The max length of the name of the index (restricted to 30 for # cross-database compatibility with Oracle)...
bsd-3-clause
3,816,267,956,104,137,000
43.82906
109
0.601907
false
cypreess/csvkit
tests/test_utilities/test_csvcut.py
4
3586
#!/usr/bin/env python import StringIO import unittest from csvkit import CSVKitReader from csvkit.utilities.csvcut import CSVCut from csvkit.exceptions import ColumnIdentifierError, RequiredHeaderError class TestCSVCut(unittest.TestCase): def test_simple(self): args = ['-c', '1,3', 'examples/dummy.csv'] ...
mit
3,556,259,747,567,594,000
30.182609
75
0.601785
false
ToonBoxEntertainment/rez
src/rezgui/dialogs/ProcessDialog.py
4
3642
from rezgui.qt import QtCore, QtGui from rezgui.util import create_pane from rezgui.mixins.StoreSizeMixin import StoreSizeMixin from rezgui.widgets.StreamableTextEdit import StreamableTextEdit from rezgui.objects.App import app from threading import Thread, Lock class ProcessDialog(QtGui.QDialog, StoreSizeMixin): ...
lgpl-3.0
-8,973,418,921,305,654,000
34.359223
87
0.623009
false
frivoal/reftest-converter
ref-conv.py
1
1182
#!/usr/bin/python import sys def generate_tag( ref, xml=False ): ref_name, match = ref return "<link rel='"+ ["mismatch","match"][match] + "' href='" + ref_name + "'"+ [">"," />"][xml] def find_refs(reftest_list): tests = {} for entry in reftest_list: if entry.strip() == '': continue split_entry = entry.sp...
mit
8,125,895,361,305,081,000
23.625
98
0.620135
false
okunishinishi/python-stringcase
stringcase.py
1
4629
""" String convert functions """ import re def camelcase(string): """ Convert string into camel case. Args: string: String to convert. Returns: string: Camel case string. """ string = re.sub(r"^[\-_\.]", '', str(lowercase(string))) if not string: return string ...
mit
-7,107,563,749,576,898,000
17.893878
118
0.598617
false
indrajitr/ansible
test/units/module_utils/common/parameters/test_list_deprecations.py
37
1535
# -*- coding: utf-8 -*- # Copyright (c) 2019 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 import pytest from ansible.module_utils.common.parameters import list_depreca...
gpl-3.0
-6,676,102,381,518,683,000
33.886364
119
0.579805
false
airmonitor/home_air_monitor
micropython/main.py
1
6163
from random import random import connect_wifi import ujson import urequests import utime from boot import ( API_KEY, API_URL, LAT, LONG, PARTICLE_SENSOR, SSID, TEMP_HUM_PRESS_SENSOR, TVOC_CO2_SENSOR, WIFI_PASSWORD, ) from i2c import I2CAdapter from lib import logging from machine im...
gpl-3.0
5,816,522,483,912,856,000
25.679654
83
0.535778
false
bsmith3541/rapcollab
venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/site.py
358
2418
def __boot(): import sys, os, os.path PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys,'path_importer_cache',{}) stdpath = sys.path[len...
mit
1,653,484,108,272,885,000
28.13253
79
0.542597
false
adrianholovaty/django
django/views/defaults.py
95
2430
from django import http from django.template import (Context, RequestContext, loader, TemplateDoesNotExist) from django.views.decorators.csrf import requires_csrf_token # This can be called when CsrfViewMiddleware.process_view has not run, # therefore need @requires_csrf_token in case the...
bsd-3-clause
5,991,564,114,041,314,000
35.818182
103
0.708642
false
danielkitta/libsigrokdecode
decoders/sdcard_sd/lists.py
3
5992
## ## This file is part of the sigrok project. ## ## Copyright (C) 2015 Uwe Hermann <uwe@hermann-uwe.de> ## ## 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...
gpl-3.0
-7,834,774,936,438,476,000
31.389189
76
0.638351
false
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/structured/solutions/serving/application/lib/pyasn1/type/opentype.py
15
2848
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # __all__ = ['OpenType'] class OpenType(object): """Create ASN.1 type map indexed by a value The *OpenType* object models an untyped field of a construct...
apache-2.0
-8,584,625,128,118,751,000
26.384615
72
0.582865
false
kvar/ansible
lib/ansible/plugins/doc_fragments/proxysql.py
44
1391
# -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt class ModuleDocFragment(object): # Documentation fragment for ProxySQL connectivity CONNECTIVITY = r''' options: login_user: description: - T...
gpl-3.0
-5,056,948,263,868,147,000
24.759259
91
0.666427
false
mementum/backtrader
backtrader/filters/renko.py
1
4627
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
gpl-3.0
1,827,244,835,362,619,100
32.28777
83
0.543549
false
krishna-pandey-git/django
tests/view_tests/models.py
281
1329
""" Regression tests for Django built-in views. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.name def get_absolute_ur...
bsd-3-clause
-5,470,493,543,649,117,000
22.315789
78
0.676448
false
untom/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
249
1095
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
-7,506,350,657,247,853,000
25.707317
67
0.550685
false
pratikmallya/hue
desktop/core/ext-py/Django-1.6.10/tests/inspectdb/models.py
53
2394
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.db import models class People(models.Model): name = models.CharField(max_length=255) parent = models.ForeignKey('self') class Message(models.Model): from_field = models.ForeignKey(People, db_column='from_id') class PeopleData...
apache-2.0
3,433,569,586,215,974,000
38.883333
80
0.719599
false
ai-course-project/shrdlite-course-project
cgi-bin/physics.py
1
2349
"""make sure that we don't break the physics!""" def check_physics_all(preds, objects): return (all(check_physics(pred, objects) for pred in preds) and check_uniqueness(preds)) def check_uniqueness(preds): """Check that we dont want to put two things inside a box or one thing inside two boxes ...
gpl-3.0
4,441,482,950,194,907,000
27.301205
91
0.55513
false
nicolas-petit/website
website_event_register_free/controllers/website_event.py
16
3356
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
-2,836,570,046,774,298,600
44.351351
79
0.572706
false
zhaobin19918183/zhaobinCode
zhaobin/mysite/mysite/settings.py
1
4649
# -*- coding:UTF-8 -*- #必须在第一行或者第二行 # -*- coding:gb2312 -*- #必须在第一行或者第二行 # -*- coding:GBK -*- #必须在第一行或者第二行 """ Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.9.1. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full li...
gpl-3.0
-121,806,304,878,724,460
24.811429
91
0.657516
false
vmarkovtsev/django
django/contrib/gis/db/backends/postgis/operations.py
168
15689
import re from django.conf import settings from django.contrib.gis.db.backends.base.operations import \ BaseSpatialOperations from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter from django.contrib.gis.db.backends.postgis.pgraster import ( from_pgraster, to_pgraster, ) from django.contrib...
bsd-3-clause
-8,330,046,366,486,328,000
40.070681
107
0.606858
false
arthurlogilab/raven-python
raven/contrib/celery/__init__.py
2
1974
""" raven.contrib.celery ~~~~~~~~~~~~~~~~~~~~ :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 celery.signals import after_setup_logger, task_failure from raven.handlers.logging impor...
bsd-3-clause
8,862,033,615,615,508,000
31.9
76
0.628166
false
ysekky/GPy
GPy/likelihoods/bernoulli.py
2
10515
# Copyright (c) 2012-2014 The GPy authors (see AUTHORS.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np from ..util.univariate_Gaussian import std_norm_pdf, std_norm_cdf, derivLogCdfNormal, logCdfNormal from . import link_functions from .likelihood import Likelihood class Bernoulli(...
bsd-3-clause
-3,582,881,975,466,693,600
38.679245
148
0.563766
false
chauhanhardik/populo_2
cms/djangoapps/contentstore/management/commands/fix_not_found.py
108
1110
""" Script for fixing the item not found errors in a course """ from django.core.management.base import BaseCommand, CommandError from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore from xmodule.modulestore import ModuleStoreEnum # To run from command line: ./manage.py cms fix...
agpl-3.0
-1,485,021,999,755,647,200
38.642857
87
0.697297
false
sol/pygments
pygments/lexers/erlang.py
25
18936
# -*- coding: utf-8 -*- """ pygments.lexers.erlang ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Erlang. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions, \ ...
bsd-2-clause
-7,040,259,556,622,078,000
34.527205
96
0.451046
false
kisna72/django
django/contrib/gis/gdal/libgdal.py
449
3598
from __future__ import unicode_literals import logging import os import re from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int from ctypes.util import find_library from django.contrib.gis.gdal.error import GDALException from django.core.exceptions import ImproperlyConfigured logger = logging.getLogger('django.contri...
bsd-3-clause
211,143,747,534,938,600
29.235294
86
0.68149
false
sestrella/ansible
test/lib/ansible_test/_internal/sanity/validate_modules.py
19
3400
"""Sanity test using validate-modules.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os from .. import types as t from ..sanity import ( SanitySingleVersion, SanityMessage, SanityFailure, SanitySuccess, SANITY_ROOT, ) from ..target ...
gpl-3.0
5,790,397,563,971,029,000
26.868852
147
0.582059
false
manipopopo/tensorflow
tensorflow/contrib/model_pruning/python/learning.py
27
8058
# 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,202,627,028,170,639,000
41.188482
80
0.671258
false
MinerKasch/dd-agent
utils/debug.py
5
1832
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from pprint import pprint import inspect import os import sys # datadog from config import get_checksd_path, get_confd_path from util import get_os def run_check(name, path=None): """ Test cust...
bsd-3-clause
-8,540,210,387,805,926,000
26.343284
101
0.630459
false
pombredanne/0install
zeroinstall/injector/packagekit.py
2
13740
""" PackageKit integration. """ # Copyright (C) 2010, Aleksey Lim # See the README file for details, or visit http://0install.net. import os, sys import locale import logging from zeroinstall import _, SafeException from zeroinstall.support import tasks, unicode from zeroinstall.injector import download, model _log...
lgpl-2.1
-3,112,404,326,785,588,700
30.441648
145
0.676419
false
googlearchive/storage-getting-started-python
gcs/gcs_error.py
2
1381
# 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 ...
apache-2.0
-3,868,058,061,612,055,600
30.386364
74
0.701665
false
hmpf/nav
doc/conf.py
1
9193
# -*- coding: utf-8 -*- # # NAV documentation build configuration file, created by # sphinx-quickstart on Tue Feb 8 10:54:59 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All con...
gpl-3.0
9,081,795,660,404,484,000
32.187726
107
0.688241
false
osstech-jp/samba
third_party/dnspython/dns/rdtypes/IN/IPSECKEY.py
100
5993
# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
gpl-3.0
-4,190,082,561,235,364,400
36.691824
81
0.574003
false
thnee/ansible
test/units/modules/network/cnos/test_cnos_static_route.py
38
3285
# (c) 2016 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # 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 late...
gpl-3.0
-6,410,196,725,795,152,000
43.391892
109
0.671537
false
sertac/django
tests/utils_tests/test_jslex.py
169
9708
# -*- coding: utf-8 -*- """Tests for jslex.""" # originally from https://bitbucket.org/ned/jslex from __future__ import unicode_literals from django.test import SimpleTestCase from django.utils.jslex import JsLexer, prepare_js_for_gettext class JsTokensTest(SimpleTestCase): LEX_CASES = [ # ids ("...
bsd-3-clause
-8,562,562,542,462,582,000
43.009091
159
0.369035
false