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
Wang-OuYang/WarChess
cocos2d/plugin/tools/toolsForGame/modifyProject.py
255
1300
import sys, string, os from xml.etree import ElementTree as ET from xml.dom import minidom projFile = sys.argv[1] targetPath = sys.argv[2] def getLinkElement(): global targetPath ret = ET.Element('link') nameEle = ET.Element('name') nameEle.text = 'plugin-x' typeEle = ET.Element('type') typeEl...
gpl-2.0
-4,793,567,892,764,936,000
27.26087
48
0.625385
false
insertnamehere1/maraschino
lib/sqlalchemy/util/deprecations.py
22
3906
# util/deprecations.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Helpers related to deprecation of functions, methods, classes, other functiona...
mit
6,539,030,083,043,506,000
32.101695
84
0.632616
false
moonboots/tensorflow
tensorflow/python/tools/freeze_graph.py
15
5585
# 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 by applicable law or a...
apache-2.0
2,427,096,558,926,360,000
40.679104
80
0.660877
false
Cloudino/Cloudino-Arduino-IDE
libraries/PubSubClient/tests/testcases/mqtt_publish_in_callback.py
42
1938
import unittest import settings import time import mosquitto import serial def on_message(mosq, obj, msg): obj.message_queue.append(msg) class mqtt_publish_in_callback(unittest.TestCase): message_queue = [] @classmethod def setUpClass(self): self.client = mosquitto.Mosquitto("pubsubclient_ut", cle...
lgpl-2.1
-7,806,991,388,532,683,000
29.28125
90
0.691434
false
smartforceplus/SmartForceplus
addons/email_template/wizard/mail_compose_message.py
27
11709
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
2,072,564,636,107,835,600
55.023923
229
0.599283
false
erickt/hue
desktop/core/ext-py/Django-1.6.10/django/db/models/fields/subclassing.py
227
1815
""" Convenience routines for creating non-trivial Field subclasses, as well as backwards compatibility utilities. Add SubfieldBase as the metaclass for your Field subclass, implement to_python() and the other necessary methods and everything will work seamlessly. """ class SubfieldBase(type): """ A metaclass ...
apache-2.0
1,066,983,397,992,928,800
33.245283
79
0.658953
false
chouseknecht/ansible
test/units/modules/cloud/amazon/test_redshift_cross_region_snapshots.py
42
1356
from ansible.modules.cloud.amazon import redshift_cross_region_snapshots as rcrs mock_status_enabled = { 'SnapshotCopyGrantName': 'snapshot-us-east-1-to-us-west-2', 'DestinationRegion': 'us-west-2', 'RetentionPeriod': 1, } mock_status_disabled = {} mock_request_illegal = { 'snapshot_copy_grant': 'cha...
gpl-3.0
-2,105,421,349,610,966,500
27.25
90
0.698378
false
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/OpenGL/GL/NV/framebuffer_multisample_coverage.py
4
1564
'''OpenGL extension NV.framebuffer_multisample_coverage This module customises the behaviour of the OpenGL.raw.GL.NV.framebuffer_multisample_coverage to provide a more Python-friendly API Overview (from the spec) This extension extends the EXT_framebuffer_multisample specification by providing a new function, ...
agpl-3.0
6,858,507,290,239,634,000
41.297297
76
0.817136
false
norrs/debian-tomahawk
thirdparty/breakpad/third_party/protobuf/protobuf/gtest/test/gtest_env_var_test.py
233
3509
#!/usr/bin/env python # # Copyright 2008, 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-3.0
-4,224,353,121,045,318,700
32.419048
79
0.707324
false
lulandco/SickRage
lib/stevedore/driver.py
21
5496
from .exception import NoMatches, MultipleMatches from .named import NamedExtensionManager class DriverManager(NamedExtensionManager): """Load a single plugin with a given name from the namespace. :param namespace: The namespace for the entry points. :type namespace: str :param name: The name of the ...
gpl-3.0
-8,855,668,794,292,591,000
40.323308
79
0.629731
false
Lilykos/invenio
invenio/modules/previewer/bundles.py
11
1881
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
-6,028,170,673,305,525,000
25.871429
74
0.694312
false
samirasnoun/django_cms_gallery_image
cms/south_migrations/0064_staticplaceholder_site_change.py
63
17484
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): for sp in orm['cms.StaticPlaceholder'].objects.all(): sp.site = None ...
bsd-3-clause
5,541,275,249,890,862,000
85.554455
196
0.554907
false
hakonsbm/nest-simulator
pynest/nest/tests/test_connect_symmetric_pairwise_bernoulli.py
2
5160
# -*- coding: utf-8 -*- # # test_connect_symmetric_pairwise_bernoulli.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, eithe...
gpl-2.0
2,637,815,305,552,644,600
32.72549
79
0.601357
false
Edraak/circleci-edx-platform
lms/djangoapps/instructor/views/gradebook_api.py
28
4309
""" Grade book view for instructor and pagination work (for grade book) which is currently use by ccx and instructor apps. """ import math from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import transaction from django.views.decorators.cache import cache_control ...
agpl-3.0
601,749,986,283,421,300
34.319672
117
0.67974
false
shiminasai/ciat_plataforma
guias_cacao/models.py
2
153154
# -*- coding: utf-8 -*- from django.db import models from django.contrib.auth.models import User from mapeo.models import Persona from sorl.thumbnail import ImageField from multiselectfield import MultiSelectField # Create your models here. class FichaSombra(models.Model): productor = models.ForeignKey( Pe...
mit
5,736,390,111,348,182,000
37.740102
166
0.538431
false
mute/elasticsearch
dev-tools/build_release.py
27
34065
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
apache-2.0
7,291,763,827,722,033,000
43.587696
177
0.666755
false
hojel/calibre
src/calibre/utils/opensearch/query.py
24
2570
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL 3' __copyright__ = '2006, Ed Summers <ehs@pobox.com>' __docformat__ = 'restructuredtext en' from urlparse import urlparse, urlunparse, parse_qs from urllib import urlencode class Query(obj...
gpl-3.0
-1,125,455,849,593,397,600
33.72973
97
0.615175
false
clofresh/xbmc-vhx
resources/lib/requests/sessions.py
4
8911
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ from .defaults import defaults from .models import Request from .hooks import dispatch_hook from .utils import header_expand from .packages...
bsd-3-clause
8,464,740,603,990,731,000
29.940972
116
0.596117
false
m0ppers/arangodb
3rdParty/V8/V8-5.0.71.39/tools/perf-to-html.py
32
9164
#!/usr/bin/env python # Copyright 2015 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ''' python %prog Convert a perf trybot JSON file into a pleasing HTML page. It can read from standard input or via the --filename opt...
apache-2.0
-4,082,405,983,968,669,700
23.243386
82
0.608795
false
savoirfairelinux/OpenUpgrade
openerp/addons/base/module/wizard/base_module_upgrade.py
40
4914
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
-5,504,812,534,162,090,000
44.5
157
0.556166
false
prutseltje/ansible
lib/ansible/modules/cloud/amazon/aws_caller_facts.py
12
2484
#!/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_caller_facts short_de...
gpl-3.0
-4,568,065,596,767,225,300
28.223529
149
0.696055
false
bankonmeOS/cjdns
node_build/dependencies/cnacl/crypto_sign/ed25519/ref10/base2.py
77
1231
b = 256 q = 2**255 - 19 l = 2**252 + 27742317777372353535851937790883648493 def expmod(b,e,m): if e == 0: return 1 t = expmod(b,e/2,m)**2 % m if e & 1: t = (t*b) % m return t def inv(x): return expmod(x,q-2,q) d = -121665 * inv(121666) I = expmod(2,(q-1)/4,q) def xrecover(y): xx = (y*y-1) * inv(d*y*y+1)...
gpl-3.0
-2,945,460,050,342,223,000
19.516667
51
0.495532
false
orcasgit/django-template-field
setup.py
1
2109
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import templatefield try: from setuptools import setup except ImportError: from distutils.core import setup version = templatefield.__version__ if sys.argv[-1] == 'publish': try: import wheel except ImportError: prin...
bsd-3-clause
-2,239,667,263,795,204,600
30.014706
110
0.618777
false
clemenshage/grslra
experiments/plot_lpnorms.py
1
1564
import matplotlib from matplotlib import pyplot as plt import numpy as np matplotlib.rcParams.update({'font.size': 24}) matplotlib.rcParams.update({'text.usetex': True}) def lpnorm_scaled(x, p, mu): return (lpnorm(x, p, mu) - lpnorm(0, p, mu)) / (lpnorm(1, p, mu) - lpnorm(0, p, mu)) def lpnorm(x, p, mu): r...
mit
-6,860,694,988,216,912,000
23.061538
110
0.61445
false
vladpopovici/WSItk
WSItk/tools/wsi_bot_apply.py
2
4768
# -*- coding: utf-8 -*- """ WSI_BOT_APPLY Assigns all patches in an image to one of the clusters in the codebook. @author: vlad """ from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * __author__ = 'Vlad Popovici' __version__ = 0.01 import argparse as opt from...
mit
2,712,699,262,163,993,600
32.815603
96
0.574874
false
Juniper/tempest
tempest/lib/api_schema/response/compute/v2_1/interfaces.py
13
2276
# 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,009,416,958,306,773,000
30.178082
78
0.539543
false
naojsoft/qplan
qplan/plugins/AirMassChart.py
1
4344
# # AirMassChart.py -- AirMass chart plugin # # Eric Jeschke (eric@naoj.org) # from datetime import timedelta #from dateutil import tz from ginga.gw import Widgets, Plot from ginga.misc import Bunch from qplan.plugins import PlBase from qplan.plots.airmass import AirMassPlot class AirMassChart(PlBase.Plugin): ...
bsd-3-clause
7,869,490,230,310,091,000
31.661654
85
0.570672
false
skywin/p2pool
p2pool/test/bitcoin/test_data.py
272
4635
import unittest from p2pool.bitcoin import data, networks from p2pool.util import pack class Test(unittest.TestCase): def test_header_hash(self): assert data.hash256(data.block_header_type.pack(dict( version=1, previous_block=0x000000000000038a2a86b72387f93c51298298a732079b3b686df...
gpl-3.0
8,825,139,221,212,417,000
58.423077
206
0.759871
false
pre-commit/pre-commit
tests/languages/ruby_test.py
1
2645
import os.path import tarfile from unittest import mock import pytest import pre_commit.constants as C from pre_commit import parse_shebang from pre_commit.languages import ruby from pre_commit.prefix import Prefix from pre_commit.util import cmd_output from pre_commit.util import resource_bytesio from testing.util i...
mit
7,314,362,821,007,725,000
29.402299
70
0.69414
false
minixalpha/spark
python/pyspark/mllib/tree.py
46
24110
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
4,547,943,435,604,069,000
35.530303
100
0.585981
false
radianbaskoro/mathdoku-solver
mathdokusolver/Solver.py
1
13846
''' MathDoku solver module. @author: Radian Baskoro ''' import itertools from datetime import datetime from Utility import Utility class Solver: ''' Solver class used to solve the MathDoku problem. ''' __debugLevel = 0 __iterationCount = 0 __initFlag = False boardSize = 0 ...
apache-2.0
3,681,311,420,551,957,000
31.969048
166
0.472122
false
jhoos/django
django/contrib/admin/helpers.py
7
14344
from __future__ import unicode_literals import warnings from django import forms from django.conf import settings from django.contrib.admin.templatetags.admin_static import static from django.contrib.admin.utils import ( display_for_field, flatten_fieldsets, help_text_for_field, label_for_field, lookup_field,...
bsd-3-clause
7,036,172,005,141,722,000
38.844444
101
0.603737
false
WoLpH/EventGhost
lib27/site-packages/requests/packages/chardet/euctwfreq.py
3133
34872
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-2.0
4,838,385,599,595,571,000
80.476636
87
0.737382
false
great-expectations/great_expectations
tests/execution_engine/test_sqlalchemy_execution_engine.py
1
23179
import logging import os import pandas as pd import pytest from great_expectations.core.batch_spec import ( RuntimeQueryBatchSpec, SqlAlchemyDatasourceBatchSpec, ) from great_expectations.data_context.util import file_relative_path from great_expectations.exceptions import GreatExpectationsError from great_ex...
apache-2.0
-6,351,222,790,242,677,000
36.205457
115
0.638725
false
ThiefMaster/indico
indico/modules/designer/pdf.py
4
6842
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import re from collections import namedtuple from io import BytesIO from PIL import Image from reportlab....
mit
-3,504,634,376,774,931,500
37.223464
119
0.592955
false
gurneyalex/odoo
doc/_extensions/odoo_ext/switcher.py
27
1543
from docutils import nodes, utils from docutils.parsers.rst import Directive from pygments.lexers import get_lexer_by_name, PythonLexer PythonLexer.name = 'Python 2' def setup(app): app.add_directive('switcher', SwitcherDirective) app.add_directive('case', CaseDirective) class SwitcherDirective(Directive): ...
agpl-3.0
3,295,887,983,838,336,500
33.288889
81
0.612443
false
thatchristoph/namebench
nb_third_party/httplib2/__init__.py
451
51082
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyrigh...
apache-2.0
3,884,937,465,673,966,600
41.497504
235
0.587585
false
paulmadore/Eric-IDE
6-6.0.9/eric/Helpviewer/UserAgent/UserAgentManager.py
2
7095
# -*- coding: utf-8 -*- # Copyright (c) 2012 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a user agent manager. """ from __future__ import unicode_literals import os from PyQt5.QtCore import pyqtSignal, QObject, QXmlStreamReader from E5Gui import E5MessageBox from Utilities.AutoSa...
gpl-3.0
4,850,899,038,745,484,000
28.936709
77
0.511628
false
xq262144/hue
desktop/core/ext-py/Django-1.6.10/django/db/backends/dummy/base.py
114
2198
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends import * from django.db.back...
apache-2.0
-5,012,662,173,055,536,000
29.109589
80
0.707006
false
lintzc/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/filerep/Filerep_Resync/test_filerep_resync.py
9
4156
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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,607,097,580,561,235,000
41.408163
157
0.704764
false
apollo13/ansible
test/integration/targets/collections/collections/ansible_collections/testns/content_adj/plugins/inventory/statichost.py
44
2221
# Copyright (c) 2018 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 DOCUMENTATION = ''' inventory: statichost short_description: Add a single host descripti...
gpl-3.0
357,028,382,000,179,900
31.661765
94
0.646105
false
csantoshc/Synapse-Detection
Tools/libsvm-3.12/libsvm-3.12/tools/easy.py
152
2699
#!/usr/bin/env python import sys import os from subprocess import * if len(sys.argv) <= 1: print('Usage: {0} training_file [testing_file]'.format(sys.argv[0])) raise SystemExit # svm, grid, and gnuplot executable files is_win32 = (sys.platform == 'win32') if not is_win32: svmscale_exe = "../svm-scale" svmtrain_...
mit
-2,536,760,666,112,030,000
33.164557
104
0.675065
false
Bismarrck/pymatgen
pymatgen/alchemy/transmuters.py
1
16738
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import unicode_literals """ This module implements various transmuter classes. Transmuters are essentially classes that generate TransformedStructures from various data sources. They enable the...
mit
-7,860,778,371,550,230,000
37.389908
79
0.604911
false
hrishioa/Aviato
flask/Lib/site-packages/setuptools/_backport/hashlib/_sha.py
77
9982
# -*- coding: iso-8859-1 -*- """A sample implementation of SHA-1 in pure Python. Framework adapted from Dinu Gherman's MD5 implementation by J. Hallén and L. Creighton. SHA-1 implementation based directly on the text of the NIST standard FIPS PUB 180-1. """ __date__ = '2004-11-17' __version__ = 0.91 # Mo...
gpl-2.0
-7,590,031,919,178,044,000
26.799443
86
0.516834
false
rrooij/youtube-dl
youtube_dl/extractor/wdr.py
23
12523
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( determine_ext, ExtractorError, js_to_json, strip_jsonp, try_get, unified_strdate, update_url_query, ur...
unlicense
2,935,271,388,771,855,400
36.942424
140
0.490935
false
spectra-cluster/spectra-cluster-py
spectra_cluster/ui/clustering_stats.py
1
4988
"""clustering_stats Extracts basic statistics (ie. number of clusters, incorrectly clustered spectra) from .clustering files. This script only creates meaningful results if the .clustering file contains identification data which will be used to evaluate correctly and incorrectly clustered spectra. Usage: clusteri...
apache-2.0
5,820,387,546,306,267,000
38.587302
121
0.642542
false
benjaminrigaud/django
django/utils/numberformat.py
337
1775
from django.conf import settings from django.utils.safestring import mark_safe from django.utils import six def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', force_grouping=False): """ Gets a number (as a number or string), and returns it as a string, using formats ...
bsd-3-clause
-5,775,835,507,334,951,000
35.979167
78
0.619718
false
tdhopper/scikit-learn
examples/linear_model/plot_ols_ridge_variance.py
387
2060
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Ordinary Least Squares and Ridge Regression Variance ========================================================= Due to the few points in each dimension and the straight line that linear regression uses to follow thes...
bsd-3-clause
4,857,500,489,896,474,000
28
71
0.636717
false
seanli9jan/tensorflow
tensorflow/python/kernel_tests/decode_bmp_op_test.py
8
3135
# 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
-5,603,516,539,380,122,000
20.770833
80
0.498884
false
LinuxChristian/home-assistant
homeassistant/components/scene/__init__.py
10
3131
""" Allow users to set and activate scenes. For more details about this component, please refer to the documentation at https://home-assistant.io/components/scene/ """ import asyncio import logging import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_TURN_ON) from hom...
apache-2.0
-9,169,512,291,614,710,000
25.760684
75
0.678058
false
ScorpionResponse/freelancefinder
freelancefinder/notifications/models.py
1
5186
"""Define the notification type and track sent notifications.""" import logging from smtplib import SMTPException from future.utils import python_2_unicode_compatible from model_utils import Choices from model_utils.fields import MonitorField from model_utils.models import TimeStampedModel from django.conf import se...
bsd-3-clause
8,297,725,856,170,889,000
42.579832
172
0.672773
false
Jusedawg/SickRage
sickbeard/metadata/tivo.py
7
13573
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # Author: Gordon Turner <gordonturner@gordonturner.ca> # URL: http://code.google.com/p/sickbeard/ # # 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 publis...
gpl-3.0
-7,018,672,377,653,194,000
39.275964
219
0.584248
false
OneRom/external_skia
tools/skp/page_sets/skia_ugamsolutions_desktop.py
30
1252
# 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. # pylint: disable=W0401,W0614 from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class SkiaBuildbotDesk...
bsd-3-clause
-2,375,430,855,129,136,000
29.536585
74
0.709265
false
BaichuanWu/Blog_on_django
site-packages/django/contrib/redirects/tests.py
112
3358
from django import http from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, modify_settings, override_settings from django.utils import six from .middleware import RedirectFallbackMiddleware from .models...
mit
8,769,787,655,816,849,000
38.505882
78
0.686718
false
crafty78/ansible
lib/ansible/modules/utilities/logic/include_role.py
34
2684
#!/usr/bin/python # -*- mode: python -*- # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the...
gpl-3.0
7,204,397,245,564,539,000
28.494505
310
0.674739
false
samvarankashyap/linch-pin
linchpin/provision/roles/openshift/files/inventory.py
3
1896
#!/usr/bin/env python from __future__ import absolute_import from collections import OrderedDict from linchpin.InventoryFilters.InventoryFilter import InventoryFilter class Inventory(InventoryFilter): DEFAULT_HOSTNAMES = ['metadata.name'] def get_host_data(self, res, cfgs): """ Returns a d...
gpl-3.0
4,904,975,322,589,555,000
35.461538
80
0.618671
false
debkbanerji/super-mem
ocrtest/myenv/lib/python2.7/site-packages/pip/compat/__init__.py
342
4672
"""Stuff that differs in different Python versions and platform distributions.""" from __future__ import absolute_import, division import os import sys from pip._vendor.six import text_type try: from logging.config import dictConfig as logging_dictConfig except ImportError: from pip.compat.dictconfig import ...
mit
-180,387,082,229,420,160
27.487805
79
0.635274
false
captiosus/treadmill
treadmill/sproc/appmonitor.py
1
6275
"""Syncronizes cell Zookeeper with LDAP data. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import collections import itertools import logging import math import time import click import six from treadmill im...
apache-2.0
-7,566,902,269,665,612,000
29.759804
79
0.548526
false
kustodian/ansible
lib/ansible/module_utils/facts/system/platform.py
66
4075
# 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 distributed in the hope that ...
gpl-3.0
4,528,745,511,534,211,000
41.010309
104
0.615215
false
postlund/home-assistant
tests/components/zwave/test_switch.py
11
2347
"""Test Z-Wave switches.""" from unittest.mock import patch from homeassistant.components.zwave import switch from tests.mock.zwave import MockEntityValues, MockNode, MockValue, value_changed def test_get_device_detects_switch(mock_openzwave): """Test get_device returns a Z-Wave switch.""" node = MockNode()...
apache-2.0
-5,161,523,521,290,978,000
28.3375
83
0.695782
false
leighpauls/k2cro4
third_party/webdriver/pylib/test/selenium/test_default_server.py
16
2107
""" Copyright 2011 Software Freedom Conservancy. 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...
bsd-3-clause
1,772,317,822,838,821,000
38.519231
134
0.693403
false
MuckRock/muckrock
muckrock/crowdsource/rules.py
1
2301
"""Rules based permissions for the crowdsource app""" # pylint: disable=missing-docstring, unused-argument, invalid-unary-operand-type # Third Party from rules import add_perm, always_deny, is_staff, predicate # MuckRock from muckrock.foia.rules import has_feature_level, skip_if_not_obj, user_authenticated @predic...
agpl-3.0
-2,457,823,619,117,531,600
25.147727
87
0.75402
false
BaconPancakes/valor
lib/youtube_dl/extractor/metacritic.py
73
2675
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( fix_xml_ampersands, ) class MetacriticIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?metacritic\.com/.+?/trailers/(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.metacritic.com/game/plays...
gpl-3.0
-6,303,119,287,255,196,000
40.153846
221
0.557757
false
tzewangdorje/SIPserv
Twisted-13.1.0/twisted/names/test/test_common.py
9
4287
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.names.common}. """ from __future__ import division, absolute_import from zope.interface.verify import verifyClass from twisted.internet.interfaces import IResolver from twisted.trial.unittest import SynchronousTestCase f...
gpl-3.0
-2,898,577,170,225,793,500
30.522059
80
0.661068
false
miaecle/deepchem
examples/hopv/hopv_graph_conv.py
4
1203
""" Script that trains graph-conv models on HOPV dataset. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import numpy as np from deepchem.models import GraphConvModel np.random.seed(123) import tensorflow as tf tf.random.set_seed(123) import deepchem...
mit
1,040,589,151,000,129,300
24.595745
79
0.752286
false
pulpocoders/pulpo-forms-examples
pulpo_example/fields.py
2
1110
from pulpo_forms.fieldtypes import ModelField from pulpo_forms.fieldtypes import FieldFactory from .models import PulpoUser, Club, Country class PulpoUserField(ModelField.ModelField): prp_template_name = "usuario/properties.html" model = PulpoUser name = "PulpoUser" def get_assets(): return [...
apache-2.0
6,408,723,395,385,056,000
23.666667
68
0.694595
false
chenc10/Spark-PAF
dist/ec2/lib/boto-2.34.0/tests/unit/sqs/test_connection.py
90
12763
#!/usr/bin/env python # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # ...
apache-2.0
6,448,625,943,218,231,000
39.776358
343
0.650317
false
eliran-stratoscale/inaugurator
inaugurator/pyudev/device.py
3
37036
# -*- coding: utf-8 -*- # Copyright (C) 2011, 2012 Sebastian Wiesner <lunaryorn@gmail.com> # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version 2.1 of the License, or (at your ...
apache-2.0
-2,232,850,869,718,405,400
33.706654
91
0.608339
false
Mendeley/mendeley-python-sdk
mendeley/models/profiles.py
2
2355
import arrow from mendeley.models.common import Discipline, Photo, Location, Education, Employment from mendeley.response import SessionResponseObject class Profile(SessionResponseObject): """ A Mendeley profile. .. attribute:: id .. attribute:: first_name .. attribute:: last_name .. attribu...
apache-2.0
-2,967,958,589,252,361,000
26.068966
103
0.564756
false
maliciamrg/xbmc-addon-tvtumbler
resources/lib/dns/message.py
28
42234
# Copyright (C) 2001-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
1,249,923,726,944,479,200
37.151762
94
0.581925
false
DennisDenuto/puppet-commonscripts
files/aws_cli/AWS-ElasticBeanstalk-CLI-2.6.3/eb/macosx/python2.7/lib/aws/http_client.py
11
1992
#!/usr/bin/env python #============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the...
mit
-5,413,345,270,159,729,000
36.603774
83
0.563755
false
misttechnologies/selenium
py/test/selenium/webdriver/common/select_class_tests.py
19
15214
#!/usr/bin/python # Copyright 2011 Software Freedom Conservancy. # # 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
-6,014,779,002,560,066,000
47.762821
139
0.64112
false
hsteinhaus/ardupilot
mk/PX4/Tools/genmsg/src/genmsg/__init__.py
215
2116
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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 ...
gpl-3.0
-6,286,293,121,900,127,000
51.9
104
0.782136
false
mfriesen/tentacle
src/tentacle/cthulhu/__init__.py
1
2464
#!python import json import os.path import cherrypy from cherrypy import tools from mako.lookup import TemplateLookup from tentacle.cthulhu.operation import CthulhuData from tentacle.cthulhu.datastore import * from tentacle.shared.screed import Screed from aetypes import end print '------------- CThulhu is alive' c...
apache-2.0
6,372,135,295,274,400,000
27.333333
73
0.557224
false
litvinchuck/python-scripts
daemon/daemon_builder.py
2
1062
import signal from .daemon import Daemon from .signal_handler import SignalHandler class DaemonBuilder: """Builder class for Daemon""" @staticmethod def build(main_function, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): """Builds the daemon and returns SignalHandler instanc...
mit
-2,351,785,487,826,478,000
39.846154
127
0.642185
false
ouiliame/ps.py
xlwt/Row.py
30
11779
# -*- coding: windows-1252 -*- import BIFFRecords import Style from Cell import StrCell, BlankCell, NumberCell, FormulaCell, MulBlankCell, BooleanCell, ErrorCell, \ _get_cells_biff_data_mul import ExcelFormula import datetime as dt from Formatting import Font try: from decimal import Decimal except ImportErro...
mit
7,098,422,304,819,662,000
38.526846
110
0.564989
false
40223221/w16b_test
static/Brython3.1.1-20150328-091302/Lib/xml/dom/xmlbuilder.py
873
12377
"""Implementation of the DOM Level 3 'LS-Load' feature.""" import copy import xml.dom from xml.dom.NodeFilter import NodeFilter __all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"] class Options: """Features object that has variables set for each DOMBuilder feature. The DOMBuilder class uses a...
gpl-3.0
-6,285,760,420,174,575,000
31.064767
75
0.59142
false
rahulunair/nova
nova/tests/unit/scheduler/client/test_report.py
1
174484
# 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 # d...
apache-2.0
6,993,091,408,026,062,000
40.842686
79
0.561364
false
gram526/VTK
ThirdParty/Twisted/twisted/conch/test/test_scripts.py
41
1874
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the command-line interfaces to conch. """ try: import pyasn1 except ImportError: pyasn1Skip = "Cannot run without PyASN1" else: pyasn1Skip = None try: import Crypto except ImportError: cryptoSkip = "can't run w...
bsd-3-clause
599,565,038,529,021,200
21.853659
79
0.657951
false
mskrzypkows/servo
tests/wpt/css-tests/tools/wptserve/wptserve/handlers.py
86
12804
import cgi import json import os import traceback import urllib import urlparse from constants import content_types from pipes import Pipeline, template from ranges import RangeParser from request import Authentication from response import MultipartContent from utils import HTTPException __all__ = ["file_handler", "p...
mpl-2.0
-772,738,974,558,436,400
33.793478
113
0.568963
false
firstval/micropython
examples/SDdatalogger/datalogger.py
98
1168
# datalogger.py # Logs the data from the acceleromter to a file on the SD-card import pyb # creating objects accel = pyb.Accel() blue = pyb.LED(4) switch = pyb.Switch() # loop while True: # wait for interrupt # this reduces power consumption while waiting for switch press pyb.wfi() # start if switc...
mit
7,404,614,637,984,403,000
34.393939
92
0.526541
false
ChemiKhazi/Sprytile
rx/testing/coldobservable.py
2
1816
from rx.core import ObservableBase, Observer, AnonymousObserver, Disposable from rx.disposables import CompositeDisposable from .subscription import Subscription from .reactive_assert import AssertList class ColdObservable(ObservableBase): def __init__(self, scheduler, messages): super(ColdObservable, se...
mit
-2,289,883,310,561,014,000
35.32
87
0.657489
false
almarklein/scikit-image
doc/examples/plot_gabors_from_lena.py
3
3341
""" ======================================================= Gabors / Primary Visual Cortex "Simple Cells" from Lena ======================================================= How to build a (bio-plausible) "sparse" dictionary (or 'codebook', or 'filterbank') for e.g. image classification without any fancy math and with j...
bsd-3-clause
-639,255,843,378,714,100
36.122222
75
0.701586
false
smohsinali/HPOlib
optimizers/tpe/random_hyperopt_august2013_mod.py
5
7067
#!/usr/bin/env python ## # wrapping: A program making it easy to use hyperparameter # optimization software. # Copyright (C) 2013 Katharina Eggensperger and Matthias Feurer # # 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 # ...
gpl-3.0
-5,870,126,357,634,644,000
40.087209
114
0.603226
false
UOMx/edx-platform
cms/djangoapps/contentstore/tests/test_crud.py
15
5989
from xmodule import templates from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE from xmodule.course_module import CourseDescriptor from xmodule.seq...
agpl-3.0
-7,758,565,671,564,435,000
43.362963
99
0.649858
false
mathLab/RBniCS
rbnics/utils/decorators/reduction_method_decorator_for.py
1
1598
# Copyright (C) 2015-2021 by the RBniCS authors # # This file is part of RBniCS. # # SPDX-License-Identifier: LGPL-3.0-or-later import inspect import types from rbnics.utils.cache import cache from rbnics.utils.decorators.dispatch import dispatch def ReductionMethodDecoratorFor(Algorithm, replaces=None, replaces_if=...
lgpl-3.0
6,988,180,498,172,286,000
38.95
104
0.775344
false
markYoungH/chromium.src
third_party/typ/typ/stats.py
82
2958
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
bsd-3-clause
-4,962,195,880,804,257,000
34.638554
76
0.433401
false
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/boto/sdb/db/test_db.py
153
5427
import logging import time from datetime import datetime from boto.sdb.db.model import Model from boto.sdb.db.property import StringProperty, IntegerProperty, BooleanProperty from boto.sdb.db.property import DateTimeProperty, FloatProperty, ReferenceProperty from boto.sdb.db.property import PasswordProperty, ListPrope...
mit
-7,970,908,529,136,002,000
22.493506
84
0.62963
false
kraj/systemd
test/run-unit-tests.py
35
1710
#!/usr/bin/env python3 import argparse import dataclasses import glob import os import subprocess import sys try: import colorama as c GREEN = c.Fore.GREEN YELLOW = c.Fore.YELLOW RED = c.Fore.RED RESET_ALL = c.Style.RESET_ALL BRIGHT = c.Style.BRIGHT except ImportError: GREEN = YELLOW = RED ...
gpl-2.0
-7,978,921,594,462,081,000
27.032787
103
0.636257
false
peterbrook/assetjet
deploy/setup_esky.py
1
2048
import sys, os from esky.bdist_esky import Executable from distutils.core import setup import assetjet from deploy import exeName, appName from glob import glob def get_data_files(dirs): """ Recursively include data directories. """ results = [] for directory in dirs: for root, dirs, files ...
gpl-3.0
5,405,371,887,186,185,000
38.384615
181
0.546387
false
lento/cortex
test/IECore/ops/splineInput/splineInput-1.py
12
2469
########################################################################## # # Copyright (c) 2009-2010, Image Engine Design 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: # # * Redis...
bsd-3-clause
5,876,734,715,506,473,000
33.291667
76
0.654516
false
ltiao/networkx
networkx/utils/tests/test_heaps.py
64
3979
from nose.tools import * import networkx as nx from networkx.utils import * class X(object): def __eq__(self, other): raise self is other def __ne__(self, other): raise self is not other def __lt__(self, other): raise TypeError('cannot compare') def __le__(self, other): ...
bsd-3-clause
-1,065,087,916,432,072,100
29.607692
72
0.522493
false
joeythesaint/yocto-autobuilder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/words/tap.py
60
2422
# -*- test-case-name: twisted.words.test.test_tap -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Shiny new words service maker """ import sys, socket from twisted.application import strports from twisted.application.service import MultiService from twisted.python import usage from twi...
gpl-2.0
7,722,449,431,258,370,000
31.72973
90
0.662263
false
VanirAOSP/external_chromium_org
native_client_sdk/src/doc/conf.py
24
5904
# -*- coding: utf-8 -*- # # Native Client documentation build configuration file, created by # sphinx-quickstart on Thu Aug 15 11:31:06 2013. # # 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. #...
bsd-3-clause
3,541,189,941,350,883,300
31.262295
80
0.713584
false
Mercador/python-keystoneclient
keystoneclient/auth/cli.py
6
3244
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
-223,217,072,245,477,200
37.164706
79
0.679716
false
xantin/qualitybots
src/webdriver/chrome_resize.py
26
4879
#!/usr/bin/python2.6 # # Copyright 2011 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,181,843,374,474,967,300
29.304348
79
0.677803
false
deepinsight/Deformable-ConvNets
Cdiscount/symbols/resnet.py
56
9630
# 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
-3,005,134,276,289,180,700
48.132653
147
0.59242
false
HellerCommaA/flask-angular
lib/python2.7/site-packages/gunicorn/sock.py
31
6594
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import errno import os import socket import stat import sys import time from gunicorn import util from gunicorn.six import string_types SD_LISTEN_FDS_START = 3 class BaseSocket(object): ...
mit
-4,486,810,133,232,059,400
29.387097
93
0.553988
false
Havate/havate-openstack
proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/images_and_snapshots/images/forms.py
4
9619
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
-5,266,949,676,437,746,000
44.587678
78
0.515126
false
grumpyjames/buck
third-party/py/unittest2/unittest2/loader.py
139
13421
"""Loading unittests.""" import os import re import sys import traceback import types import unittest from fnmatch import fnmatch from unittest2 import case, suite try: from os.path import relpath except ImportError: from unittest2.compatibility import relpath __unittest = True def _CmpToKey(mycmp): ...
apache-2.0
-3,935,298,354,076,203,500
40.680124
123
0.594218
false