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
pforret/python-for-android
python-modules/twisted/twisted/python/text.py
49
6637
# -*- test-case-name: twisted.test.test_text -*- # # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Miscellany of text-munging functions. """ import string, types from twisted.python import deprecate, versions def stringyString(object, indentation=''): """ Expansive st...
apache-2.0
5,628,938,258,515,619,000
26.42562
74
0.544372
false
blacklin/kbengine
kbe/src/lib/python/Lib/test/test_platform.py
88
12413
from unittest import mock import os import platform import subprocess import sys import tempfile import unittest import warnings from test import support class PlatformTest(unittest.TestCase): def test_architecture(self): res = platform.architecture() @support.skip_unless_symlink def test_archite...
lgpl-3.0
-726,462,007,365,651,500
37.790625
113
0.529687
false
Team-Zeus/okapi
setup.py
1
1584
#!/usr/bin/env python3 import os from distutils.core import setup from setuptools import find_packages import okapi def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() README = read('README.rst') CHANGES = read('CHANGES.rst') setup( name='tz-okapi', version=okapi.__ver...
mit
5,354,504,600,956,319,000
25.847458
70
0.559343
false
lsqtongxin/django
django/contrib/auth/management/__init__.py
348
6851
""" Creates permissions for all installed apps that need permissions. """ from __future__ import unicode_literals import getpass import unicodedata from django.apps import apps from django.contrib.auth import get_permission_codename from django.core import exceptions from django.core.management.base import CommandErr...
bsd-3-clause
-7,436,557,772,019,163,000
34.314433
100
0.63436
false
delfick/harpoon
tests/test_formatter.py
1
2761
# coding: spec from harpoon.errors import BadOptionFormat, NoSuchEnvironmentVariable from harpoon.formatter import MergedOptionStringFormatter from tests.helpers import HarpoonCase from delfick_project.errors_pytest import assertRaises from delfick_project.option_merge import MergedOptions from delfick_project.norms...
mit
6,301,117,012,641,921,000
36.821918
96
0.633466
false
MatthewSilverstein/pystach2
pystache/template_spec.py
50
1725
# coding: utf-8 """ Provides a class to customize template information on a per-view basis. To customize template properties for a particular view, create that view from a class that subclasses TemplateSpec. The "spec" in TemplateSpec stands for "special" or "specified" template information. """ class TemplateSpec...
mit
3,149,037,546,100,516,400
31.54717
79
0.726957
false
cn-app-registry/cnr-server
appr/models/kv/models_index_base.py
2
13077
from __future__ import absolute_import, division, print_function import datetime import json import appr.semver from appr.exception import (PackageAlreadyExists, PackageNotFound, ResourceNotFound, raise_channel_not_found, raise_package_not_found) DEFAULT_LOCK_TIMEOUT = 3 class ModelsInd...
apache-2.0
-3,535,560,254,784,361,000
35.83662
94
0.570544
false
talha81/TACTIC-DEV
src/tactic/command/queue.py
4
13922
############################################################ # # Copyright (c) 2010, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way witho...
epl-1.0
-365,501,592,028,530,100
26.568317
117
0.505818
false
nginxxx/ansible
lib/ansible/parsing/splitter.py
118
11100
# (c) 2014 James Cammarata, <jcammarata@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
2,515,793,668,723,894,000
39.808824
120
0.595586
false
willthames/ansible
test/utils/shippable/tools/download.py
124
10149
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK # (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 yo...
gpl-3.0
1,001,444,422,788,284,300
29.848024
151
0.558676
false
groschovskiy/keyczar
cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Node/Alias.py
19
4271
"""scons.Node.Alias Alias nodes. This creates a hash of global Aliases (dummy targets). """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation fi...
apache-2.0
8,833,891,774,415,578,000
26.915033
89
0.646219
false
kleinee/jns
scripts/dnld_julia-1.1.0-arm32bit.py
1
1372
#!/home/pi/.venv/jns/bin/python # # last modified 2019/05/26 # # Python helper script to download Julia 1.1.0 binaries # not meant to be executed manually # https://stackoverflow.com/questions/38511444/python-download-files-from-google-drive-using-url # FILE_ID = '1fj6pNAJgmUD7bsSXqh8ocC1wESx8jkRh' DESTINATION = './j...
mit
3,266,843,025,720,555,000
27.583333
96
0.669096
false
sloanyang/android_external_webkit
Tools/Scripts/webkitpy/common/newstringio.py
18
1761
#!/usr/bin/env python # 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 ...
gpl-2.0
7,421,863,607,433,810,000
43.025
72
0.763771
false
indictranstech/phr-frappe
frappe/utils/email_lib/smtp.py
29
3466
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import smtplib import _socket from frappe.utils import cint from frappe import _ def send(email, as_bulk=False): """send the message or add it to Outbox Email"...
mit
-1,843,349,488,836,042,000
29.13913
93
0.700231
false
albertomurillo/ansible
lib/ansible/module_utils/rax.py
38
12105
# 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
-4,781,894,215,898,560,000
35.570997
78
0.601239
false
kralf/morsel
python/lib/morsel/nodes/ode/scene.py
1
3228
from morsel.panda import * from solid import Solid from body import Body from joint import Joint from morsel.nodes.iterator import Iterator from morsel.nodes.scene import Scene as Base #------------------------------------------------------------------------------- class Scene(Base): def __init__(self, **kargs): ...
gpl-2.0
-8,356,162,541,334,064,000
29.17757
80
0.452602
false
markand/duktape
testrunner/run_commit_test.py
1
38382
#!/usr/bin/env python2 # # Python commit test run script. # # Intended to work on Linux, OS X, and Windows (both Cygwin and command # prompt). Some notes for portability: # # * Use os.path.join() to join paths. # # * Use tarfile, zipfile, etc instead of native commands to avoid awkward # situations on Wi...
mit
2,321,936,308,054,739,000
33.609558
180
0.580663
false
keimlink/django-cms
cms/tests/test_apphooks.py
3
36973
# -*- coding: utf-8 -*- import sys from django.contrib.admin.models import CHANGE, LogEntry from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import clear_url_caches, reverse, resolve...
bsd-3-clause
3,106,361,398,651,064,300
46.707097
133
0.641387
false
SerpentCS/odoo
openerp/addons/base/ir/ir_ui_view.py
44
52067
# -*- 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
5,799,285,392,967,668,000
44.672807
155
0.54426
false
MziRintu/kitsune
kitsune/kbforums/tests/test_templates.py
13
14727
import time from nose.tools import eq_ from pyquery import PyQuery as pq from kitsune.flagit.models import FlaggedObject from kitsune.kbforums.models import Post, Thread from kitsune.kbforums.tests import KBForumTestCase, thread, post as post_ from kitsune.sumo.urlresolvers import reverse from kitsune.sumo.tests impo...
bsd-3-clause
8,976,989,862,593,583,000
38.802703
84
0.577579
false
Limags/MissionPlanner
Lib/site-packages/scipy/fftpack/tests/test_convolve.py
51
4016
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" """ Test functions for fftpack.convolve, in particular behaviour of callbacks. This is present to assist in switching from f2py to fwrap, to make sure results are the same. True results are derived from running the tes...
gpl-3.0
-4,946,364,882,051,132,000
30.375
100
0.511952
false
SUSE-Cloud/nova
nova/db/sqlalchemy/migrate_repo/versions/208_expand_compute_node.py
11
1943
# Copyright 2013 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 ...
apache-2.0
398,642,265,992,140,200
42.177778
78
0.729285
false
matthewoliver/swift
swift/common/middleware/dlo.py
2
19051
# Copyright (c) 2013 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 agreed to ...
apache-2.0
1,968,642,596,527,118,000
42.594966
79
0.609784
false
alexcuellar/odoo
addons/payment_authorize/models/authorize.py
33
7015
# -*- coding: utf-'8' "-*-" import hashlib import hmac import logging import time import urlparse from openerp import api, fields, models from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_authorize.controllers.main import AuthorizeController from openerp.tools.floa...
agpl-3.0
602,155,450,500,473,300
41.515152
152
0.57819
false
mmohiudd/xhtml2pdf
testrender/testrender.py
147
10887
#!/usr/bin/env python import datetime import os import shutil import sys import glob from optparse import OptionParser from subprocess import Popen, PIPE from xhtml2pdf import pisa def render_pdf(filename, output_dir, options): if options.debug: print 'Rendering %s' % filename basename = os.path.base...
apache-2.0
8,775,024,525,645,846,000
39.623134
128
0.560118
false
wbsavage/shinken
test/test_reactionner_tag_get_notif.py
2
5747
#!/usr/bin/env python # Copyright (C) 2009-2010: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the F...
agpl-3.0
2,371,147,001,844,643,300
44.251969
139
0.625196
false
jazzmes/ryu
ryu/services/protocols/bgp/api/import_map.py
52
2700
# Copyright (C) 2014 Nippon Telegraph and Telephone 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.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
-5,125,049,853,650,091,000
33.177215
74
0.688889
false
piotroxp/scibibscan
scib/lib/python3.5/site-packages/astropy/io/votable/tests/table_test.py
1
5035
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test the conversion to/from astropy.table """ # TEST_UNICODE_LITERALS import io import os import numpy as np from ....utils.data import get_pkg_data_filename, get_pkg_data_fileobj from ..table import parse, writeto from .. import tree def test_ta...
mit
-1,733,246,654,057,973,000
31.908497
85
0.588679
false
dex4er/django
django/core/cache/__init__.py
105
4876
""" Caching framework. This package defines set of cache backends that all conform to a simple API. In a nutshell, a cache is a set of values -- which can be any object that may be pickled -- identified by string keys. For the complete API, see the abstract BaseCache class in django.core.cache.backends.base. Client ...
bsd-3-clause
6,210,745,961,820,591,000
34.333333
84
0.658942
false
neutronpy/neutronpy
neutronpy/fileio/data.py
3
7117
# -*- coding: utf-8 -*- import copy import numbers import numpy as np from .instrument import save_instrument from .loaders import DcsMslice, Grasp, Ice, Icp, Mad, Neutronpy, Spice def load_data(files, filetype='auto', tols=1e-4, build_hkl=True, load_instrument=False): r"""Loads one or more files and creates a ...
mit
1,645,883,483,429,984,300
31.35
144
0.550513
false
takeflight/django
tests/view_tests/tests/test_defaults.py
11
3203
from __future__ import unicode_literals from django.test import TestCase from django.test.utils import override_settings from ..models import UrlArticle @override_settings(ROOT_URLCONF='view_tests.urls') class DefaultsTests(TestCase): """Test django views in django/views/defaults.py""" fixtures = ['testdata...
bsd-3-clause
-5,648,554,886,995,247,000
40.597403
89
0.615361
false
mlperf/training_results_v0.6
NVIDIA/benchmarks/minigo/implementations/tensorflow/minigo/freeze_graph.py
1
1220
# Copyright 2018 Google LLC # # 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, ...
apache-2.0
3,293,302,887,187,341,000
31.105263
74
0.711475
false
gsmartway/odoo
openerp/addons/test_inherits/tests/test_inherits.py
266
1066
# -*- coding: utf-8 -*- from openerp.tests import common class test_inherits(common.TransactionCase): def test_create_3_levels_inherits(self): """ Check that we can create an inherits on 3 levels """ pallet = self.env['test.pallet'].create({ 'name': 'B', 'field_in_box': 'b...
agpl-3.0
-8,008,652,988,363,563,000
37.071429
86
0.596623
false
alexeyum/scikit-learn
sklearn/feature_selection/tests/test_feature_select.py
43
24671
""" Todo: cross-check the F-value with stats model """ from __future__ import division import itertools import warnings import numpy as np from scipy import stats, sparse from numpy.testing import run_module_suite from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from...
bsd-3-clause
-5,320,471,421,229,552,000
38.727858
80
0.614081
false
BuildingLink/sentry
src/sentry/south_migrations/0097_auto__del_affecteduserbygroup__del_unique_affecteduserbygroup_project_.py
36
25874
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'TrackedUser', fields ['project', 'ident'] db.delete_unique('sentry_trackedu...
bsd-3-clause
-413,544,826,333,965,000
82.734628
223
0.558978
false
computersalat/ansible
test/support/windows-integration/plugins/modules/win_ping.py
146
1451
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (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) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_ME...
gpl-3.0
-7,093,437,951,108,306,000
25.381818
92
0.675396
false
javrasya/watchdog
tests/test_skip_repeats_queue.py
9
2322
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> # Copyright 2012 Google, 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 # # ...
apache-2.0
-2,004,234,078,010,420,200
26.975904
92
0.605943
false
alexgorban/models
research/struct2depth/optimize.py
4
19564
# 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
-3,342,244,886,397,403,600
50.08094
80
0.619914
false
sensarliar/paparazzi
sw/lib/python/pprz_msg/messages_xml_map.py
6
6512
#!/usr/bin/env python from __future__ import absolute_import, print_function import os # if PAPARAZZI_HOME not set, then assume the tree containing this # file is a reasonable substitute PPRZ_HOME = os.getenv("PAPARAZZI_HOME", os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ...
gpl-2.0
-4,611,298,091,769,177,600
37.081871
117
0.609183
false
ilpianista/ansible
lib/ansible/modules/packaging/os/apt_key.py
27
12742
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2012, Jayson Vantuyl <jayson@aggressive.ly> # 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_...
gpl-3.0
3,745,640,744,745,369,000
34.493036
158
0.611599
false
smart-developerr/my-first-blog
Lib/site-packages/django/contrib/staticfiles/finders.py
478
9854
import os from collections import OrderedDict from django.apps import apps from django.conf import settings from django.contrib.staticfiles import utils from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import ( FileSystemStorage, Storage, default_storage, ) from django.utils i...
gpl-3.0
-6,652,688,837,978,941,000
34.574007
103
0.587376
false
XiaosongWei/chromium-crosswalk
third_party/pycoverage/coverage/fullcoverage/encodings.py
164
2386
"""Imposter encodings module that installs a coverage-style tracer. This is NOT the encodings module; it is an imposter that sets up tracing instrumentation and then replaces itself with the real encodings module. If the directory that holds this file is placed first in the PYTHONPATH when using "coverage" to run Pyt...
bsd-3-clause
5,814,010,267,557,563,000
40.859649
79
0.7171
false
viki9698/jizhanggroup
django/contrib/databrowse/datastructures.py
100
9090
""" These classes are light wrappers around Django's database API that provide convenience functionality and permalink functions for the databrowse app. """ from __future__ import unicode_literals from django.db import models from django.utils import formats from django.utils.text import capfirst from django.utils.enc...
bsd-3-clause
2,913,766,360,194,679,300
41.476636
189
0.612431
false
jsatch/creamas-matricula
CreamasMatricula/Creamas/urls.py
1
1854
from django.conf.urls import patterns, include, url from django.conf import settings # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'Creamas.views.home', name='home'), # url(r'^Creamas/', include...
apache-2.0
-8,620,991,920,142,252,000
45.35
101
0.723301
false
shangwuhencc/scikit-learn
sklearn/utils/tests/test_testing.py
107
4210
import warnings import unittest import sys from nose.tools import assert_raises from sklearn.utils.testing import ( _assert_less, _assert_greater, assert_less_equal, assert_greater_equal, assert_warns, assert_no_warnings, assert_equal, set_random_state, assert_raise_message) from ...
bsd-3-clause
6,998,460,719,129,928,000
29.071429
76
0.641805
false
sg00dwin/origin
vendor/github.com/google/certificate-transparency/python/ct/client/db/log_db.py
35
2021
import abc class LogDB(object): """Database interface for storing client-side CT data.""" __metaclass__ = abc.ABCMeta # The largest BSON can handle timestamp_max = 2**63-1 @abc.abstractmethod def add_log(self, metadata): """Store log metadata. This creates the necessary mappings betwe...
apache-2.0
8,589,528,568,062,249,000
33.844828
80
0.625433
false
angr/cle
cle/backends/symbol.py
1
4158
from enum import Enum import logging from ..address_translator import AT l = logging.getLogger(name=__name__) class SymbolType(Enum): """ ABI-agnostic symbol types """ TYPE_OTHER = 0 TYPE_NONE = 1 TYPE_FUNCTION = 2 TYPE_OBJECT = 3 TYPE_SECTION = 4 TYPE_TLS_OBJECT = 5 class Symb...
bsd-2-clause
-5,740,829,340,367,421,000
29.350365
121
0.616883
false
ihatevim/aetherbot
plugins/steam_user.py
33
2667
import requests from lxml import etree from cloudbot import hook from cloudbot.util import formatting # security parser = etree.XMLParser(resolve_entities=False, no_network=True) API_URL = "http://steamcommunity.com/id/{}/" ID_BASE = 76561197960265728 headers = {} class SteamError(Exception): pass def conve...
gpl-3.0
-2,445,590,810,197,459,500
24.160377
111
0.610049
false
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py
679
3293
import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is_connection_dropped(conn): # Platform-...
gpl-2.0
8,876,783,086,339,543,000
32.602041
76
0.627088
false
TUDelftNAS/SDN-OpenNetMon
forwarding.py
1
13257
# #Copyright (C) 2013, Delft University of Technology, Faculty of Electrical Engineering, Mathematics and Computer Science, Network Architectures and Services, Niels van Adrichem # # This file is part of OpenNetMon. # # OpenNetMon is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
gpl-3.0
-2,688,814,910,458,416,000
32.392947
241
0.686882
false
n0trax/ansible
lib/ansible/modules/cloud/openstack/os_volume.py
19
6392
#!/usr/bin/python # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # This module 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
-4,718,536,373,753,268,000
30.333333
88
0.639393
false
putcn/Paddle
python/paddle/fluid/tests/unittests/test_calc_gradient.py
4
1449
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
-3,416,342,459,311,036,400
36.153846
74
0.703934
false
knifenomad/django
tests/dispatch/tests.py
346
6627
import gc import sys import time import unittest import weakref from types import TracebackType from django.dispatch import Signal, receiver if sys.platform.startswith('java'): def garbage_collect(): # Some JVM GCs will execute finalizers in a different thread, meaning # we need to wait for that t...
bsd-3-clause
-7,733,427,907,892,729,000
32.301508
81
0.623208
false
rouault/mapnik
scons/scons-local-2.3.4/SCons/Tool/dvi.py
9
2335
"""SCons.Tool.dvi Common DVI Builder definition for various other Tool modules that use it. """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # 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 ...
lgpl-2.1
-4,592,330,949,473,446,000
35.484375
88
0.66167
false
wfarner/aurora
src/main/python/apache/thermos/monitoring/detector.py
10
5703
# # 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 ...
apache-2.0
-412,200,461,801,932,800
30.508287
99
0.622129
false
eeshangarg/oh-mainline
vendor/packages/zope.interface/src/zope/interface/tests/test_verify.py
22
4553
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
agpl-3.0
2,563,868,150,392,289,000
21.765
78
0.577202
false
ntuecon/server
pyenv/Lib/site-packages/django/utils/translation/trans_real.py
38
28271
"""Translation helper functions.""" from __future__ import unicode_literals import gettext as gettext_module import os import re import sys import warnings from collections import OrderedDict from threading import local from django.apps import apps from django.conf import settings from django.conf.locale import LANG_...
bsd-3-clause
-7,224,532,537,028,158,000
36.247694
105
0.575678
false
Salat-Cx65/python-for-android
python3-alpha/python3-src/Doc/includes/dbpickle.py
100
2863
# Simple example presenting how persistent ID can be used to pickle # external objects by reference. import pickle import sqlite3 from collections import namedtuple # Simple class representing a record in our database. MemoRecord = namedtuple("MemoRecord", "key, task") class DBPickler(pickle.Pickler): def persi...
apache-2.0
9,068,865,255,466,599,000
31.908046
79
0.637793
false
ionrock/designate
designate/sqlalchemy/session.py
6
1613
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
-7,412,725,465,789,396
30.627451
75
0.727216
false
retr0h/saltmeter
tests/test_utils.py
1
1036
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013, John Dewey # 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/lice...
apache-2.0
-3,524,614,382,492,063,000
31.375
78
0.699807
false
zbanks/musicazoo
musicazoo/volume/__main__.py
1
1864
import shmooze.lib.service as service import shmooze.settings as settings import os import signal import math try: import alsaaudio except: alsaaudio = None try: import osax except: osax = None exp=0.6 # approximate def human_to_computer(val): return int(100*(float(val)/100)**exp) def computer_to_...
mit
8,193,148,605,450,269,000
22.3
79
0.622854
false
mancoast/CPythonPyc_test
cpython/222_test_richcmp.py
10
7187
# Tests for rich comparisons from test_support import TestFailed, verify, verbose class Number: def __init__(self, x): self.x = x def __lt__(self, other): return self.x < other def __le__(self, other): return self.x <= other def __eq__(self, other): return self.x ==...
gpl-3.0
2,306,043,799,072,634,400
26.536398
78
0.51454
false
idovear/odoo
addons/stock/tests/test_stock_flow.py
219
74767
# -*- coding: utf-8 -*- from openerp.addons.stock.tests.common import TestStockCommon from openerp.tools import mute_logger, float_round class TestStockFlow(TestStockCommon): @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.models') def test_00_picking_create_and_transfer_quantity(self): """...
agpl-3.0
7,607,855,970,017,117,000
64.072237
175
0.574853
false
lgscofield/odoo
addons/account_analytic_analysis/res_config.py
426
1408
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
3,508,316,766,085,933,000
44.419355
118
0.627841
false
bartslinger/paparazzi
sw/ground_segment/joystick/gb2ivy.py
3
6801
#!/usr/bin/env python from __future__ import print_function import sys from os import path, getenv # if PAPARAZZI_SRC not set, then assume the tree containing this # file is a reasonable substitute PPRZ_SRC = getenv("PAPARAZZI_SRC", path.normpath(path.join(path.dirname(path.abspath(__file__)), '../../../'))) sys.pat...
gpl-2.0
2,017,566,515,587,399,400
29.09292
111
0.548449
false
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib/python2.7/test/test_int.py
32
16374
import sys import unittest from test.test_support import run_unittest, have_unicode import math L = [ ('0', 0), ('1', 1), ('9', 9), ('10', 10), ('99', 99), ('100', 100), ('314', 314), (' 314', 314), ('314 ', 314), (' \t\t 314 \t\t ', ...
gpl-2.0
-5,674,781,805,654,154,000
39.330049
82
0.552828
false
citrix-openstack-build/nova
nova/tests/api/openstack/compute/contrib/test_used_limits.py
7
9282
# vim: tabstop=5 shiftwidth=4 softtabstop=4 # Copyright 2012 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.apach...
apache-2.0
6,878,331,601,721,976,000
35.98008
79
0.572398
false
percy-g2/Novathor_xperia_u8500
6.1.1.B.0.253/external/webkit/Tools/QueueStatusServer/main.py
15
3238
# Copyright (C) 2009 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...
gpl-2.0
270,519,471,672,207,230
39.475
72
0.75386
false
jmcarp/django
django/core/files/uploadhandler.py
149
6877
""" Base file upload handler classes, and the built-in concrete subclasses """ from __future__ import unicode_literals from io import BytesIO from django.conf import settings from django.core.files.uploadedfile import ( InMemoryUploadedFile, TemporaryUploadedFile, ) from django.utils.encoding import python_2_uni...
bsd-3-clause
1,280,840,770,809,719,300
30.401826
118
0.626581
false
wisdark/Empire
data/agent/stagers/common/get_sysinfo.py
7
2133
import os import sys import pwd import socket import subprocess def get_sysinfo(nonce='00000000'): # NOTE: requires global variable "server" to be set # nonce | listener | domainname | username | hostname | internal_ip | os_details | os_details | high_integrity | process_name | process_id | language | languag...
bsd-3-clause
-5,199,269,374,312,758,000
31.815385
173
0.6015
false
zooba/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/unittest/test/test_break.py
16
9493
import gc import io import os import sys import signal import weakref import unittest @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") class TestBreak(unittest.TestCase): int_handler = None def setUp(self): self...
apache-2.0
7,124,845,495,088,616,000
32.903571
79
0.60908
false
StackStorm/mistral
mistral/policies/workbook.py
2
2249
# 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 agreed to in...
apache-2.0
1,817,907,017,098,586,400
27.1125
78
0.550022
false
airbnb/airflow
airflow/api/common/experimental/get_dag_run_state.py
4
1372
# # 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
8,768,392,663,593,276,000
37.111111
83
0.741254
false
bwhite/hadoopy
hadoopy/thirdparty/pyinstaller/PyInstaller/hooks/hook-vtkpython.py
4
1321
# Copyright (C) 2005, Giovanni Bajo # Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, 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 2 # of the...
gpl-3.0
-1,221,093,239,547,498,800
56.434783
219
0.778198
false
iambibhas/django
django/contrib/gis/gdal/geometries.py
9
24207
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" u...
bsd-3-clause
-845,576,008,032,043,600
32.998596
108
0.613294
false
endlessm/chromium-browser
third_party/chromite/api/field_handler.py
1
11972
# -*- coding: utf-8 -*- # Copyright 2019 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Field handler classes. The field handlers are meant to parse information from or do some other generic action for a specific f...
bsd-3-clause
8,220,518,884,409,412,000
31.182796
80
0.686351
false
cloudera/hue
desktop/core/ext-py/SQLAlchemy-1.3.17/test/orm/test_update_delete.py
2
36647
from sqlalchemy import Boolean from sqlalchemy import case from sqlalchemy import column from sqlalchemy import exc from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import Integer from sqlalchemy import or_ from sqlalchemy import select from sqlalchemy import String from sqlalchemy import t...
apache-2.0
-1,365,377,186,279,749,000
28.940359
78
0.526291
false
panxia6679/ursula
library/modprobe.py
36
3566
#!/usr/bin/python #coding: utf-8 -*- # This module 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. # # This software is distributed in...
mit
10,396,032,035,354,388
29.478632
87
0.573472
false
xpansa/pmis
stock_analytic_account/model/stock_picking.py
2
1611
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Eficent (<http://www.eficent.com/>) # Jordi Ballester Alomar <jordi.ballester@eficent.com> # # This program is free software: you can redistribute it and/or modify # it und...
agpl-3.0
-9,042,594,287,709,742,000
37.357143
78
0.579143
false
pombreda/labyrinth
src/PeriodicSaveThread.py
5
1160
# PeriodicSaveThread.py # This file is part of Labyrinth # # Copyright (C) 2008 - Labyrinth-Dev-Team # # Labyrinth 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
-578,109,300,139,764,200
31.222222
70
0.707759
false
caktus/rapidsms-appointments
appointments/models.py
1
4145
from __future__ import unicode_literals import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ try: from django.utils.timezone import now except ImportError: # Django < 1.4 now = datetime.datetime.now class Timeline(models.Model): "A series of milestones wh...
bsd-3-clause
1,284,743,270,431,051,800
34.42735
114
0.676236
false
gojira/tensorflow
tensorflow/python/keras/applications/vgg16_test.py
13
1842
# 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
3,140,393,244,381,356,500
35.84
80
0.652552
false
wrouesnel/ansible
lib/ansible/modules/net_tools/lldp.py
47
2503
#!/usr/bin/python -tt # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['previe...
gpl-3.0
578,131,336,422,036,400
28.447059
92
0.572913
false
nuagenetworks/vspk-python
vspk/v5_0/nusubnettemplate.py
1
21014
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
bsd-3-clause
3,178,583,797,248,488,400
29.545058
276
0.583706
false
shaftoe/home-assistant
homeassistant/components/light/sensehat.py
15
3087
""" Support for Sense Hat LEDs. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.sensehat/ """ import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.light import ( ATTR_BRIGHT...
apache-2.0
4,914,746,314,164,139,000
26.5625
79
0.622287
false
ddurdle/KODI-OneDrive
resources/lib/crashreport.py
3
4141
''' Copyright (C) 2014 ddurdle This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distrib...
gpl-2.0
1,880,857,961,432,276,000
39.203883
322
0.611929
false
mihow/headers-to-image
app.py
1
11813
# -*- coding: utf-8 -*- from __future__ import print_function import os import StringIO import datetime as dt import random import logging import md5 import boto3 from flask import Flask, request, send_file, redirect, url_for, jsonify, render_template_string from flask.json import JSONEncoder from raven.contrib.flask...
gpl-3.0
6,690,816,277,942,089,000
26.156322
95
0.559045
false
MPC-Berkeley/barc
Dator/data_api/migrations/0015_auto_20151029_2013.py
3
1797
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('auth', '0006_require_contenttypes_0002'), ('data_api', '0014_auto_20150901_1640'), ] operations = [ migrations.Creat...
mit
6,233,128,631,461,393,000
34.235294
114
0.540902
false
openstack/dragonflow
dragonflow/tests/unit/test_os_ken_base_app.py
1
3398
# Copyright (c) 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...
apache-2.0
-5,405,356,775,246,107,000
38.057471
79
0.636551
false
codefollower/Cassandra-Research
pylib/cqlshlib/test/test_cql_parsing.py
4
35160
# 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
-2,817,304,798,826,118,700
48.243697
83
0.334357
false
jramsay42/Artillery
src/Gun.py
1
2295
""" Class representing a single artillery piece. """ from math import sin from math import cos from math import radians from math import floor EXIT_VELOCITY = 120 GRAVITY = 9.8 DEFAULT_ELEVATION = 45 DEFAULT_AZIMUTH = 45 DEFAULT_AMMO = 10 class Gun(object): """ Class for representing a particular artillery piece...
gpl-3.0
-985,301,328,438,609,000
29.6
83
0.562527
false
ataylor32/django
django/contrib/admindocs/middleware.py
477
1198
from django import http from django.conf import settings class XViewMiddleware(object): """ Adds an X-View header to internal HEAD requests -- used by the documentation system. """ def process_view(self, request, view_func, view_args, view_kwargs): """ If the request method is HEAD and...
bsd-3-clause
-8,508,664,743,208,967,000
48.916667
100
0.636895
false
gazpachoking/Flexget
flexget/components/sites/sites/rmz.py
4
3817
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import re from flexget import plugin from flexget.event import event from flexget.components.sites.urlrewriting import UrlRewritingError from flexget.utils....
mit
-3,330,194,474,358,703,600
32.778761
91
0.59366
false
guorendong/iridium-browser-ubuntu
ppapi/generators/idl_c_proto.py
46
25722
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Generator for C style prototypes and definitions """ import glob import os import sys from idl_log import ErrOut, InfoOut, Wa...
bsd-3-clause
-1,430,677,687,465,738,200
30.406593
79
0.580787
false
chrisidefix/devide
modules/user/imageCurvature.py
7
2555
import gen_utils from module_base import ModuleBase from module_mixins import NoConfigModuleMixin import module_utils import vtktud class imageCurvature(ModuleBase, NoConfigModuleMixin): """Calculates image curvature with VTKTUD vtkImageCurvature filter. You need 8 inputs, and in the following sequence: d...
bsd-3-clause
2,405,072,744,274,530,300
30.54321
75
0.632877
false
pfmoore/invoke
tests/loader.py
1
2601
import imp import os import sys from spec import Spec, eq_, raises from invoke.loader import Loader, FilesystemLoader as FSLoader from invoke.collection import Collection from invoke.exceptions import CollectionNotFound from _util import support class _BasicLoader(Loader): """ Tests top level Loader behavi...
bsd-2-clause
5,900,820,417,299,214,000
29.964286
79
0.653595
false
shankisg/wye
wye/organisations/forms.py
3
1988
from django import forms # import autocomplete_light from .models import Organisation, User class OrganisationForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(OrganisationForm, self).__init__(*args, **kwargs) class Meta: model = Organisation exclude = ('user', 'cre...
mit
3,581,996,525,120,626,700
32.694915
87
0.6167
false
jtux270/translate
ovirt/3.6_source/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/provisioning/postgres.py
7
7319
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 Red Hat, 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 # # Unl...
gpl-3.0
2,486,344,222,340,780,500
31.100877
78
0.564831
false
python-dirbtuves/Misago
misago/models/settingmodel.py
3
5724
import base64 from django.core import validators from django.db import models from django.utils.translation import ugettext_lazy as _ import floppyforms as forms from misago.utils.timezones import tzlist try: import cPickle as pickle except ImportError: import pickle class Setting(models.Model): setting = ...
gpl-3.0
-4,483,951,995,666,973,000
39.309859
106
0.506289
false
ppizarror/Hero-of-Antair
bin/MySQLdb/cursors.py
1
18173
"""MySQLdb Cursors This module implements Cursors of various types for MySQLdb. By default, MySQLdb uses the Cursor class. """ import re import sys from _mysql_exceptions import Warning, Error, InterfaceError, DataError, \ DatabaseError, OperationalError, IntegrityError, InternalError, \ NotSupp...
gpl-2.0
-8,657,665,275,708,690,000
31.716141
84
0.561382
false