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
miptliot/edx-platform
common/lib/calc/calc/functions.py
279
1521
""" Provide the mathematical functions that numpy doesn't. Specifically, the secant/cosecant/cotangents and their inverses and hyperbolic counterparts """ import numpy # Normal Trig def sec(arg): """ Secant """ return 1 / numpy.cos(arg) def csc(arg): """ Cosecant """ return 1 / nump...
agpl-3.0
625,129,516,719,884,200
14.363636
118
0.597633
false
raildo/python-keystoneclient
python-keystoneclient-0.4.1.7.gdca1d42/keystoneclient/v2_0/roles.py
13
3136
# Copyright 2011 OpenStack Foundation # Copyright 2011 Nebula, 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/...
apache-2.0
2,415,041,381,080,994,300
34.636364
78
0.602041
false
DARKPOP/external_chromium_org_third_party_skia
platform_tools/android/gyp_gen/tool_makefile_writer.py
17
3228
#!/usr/bin/python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Code for generating Android.mk for a tool.""" import android_framework_gyp import gypd_parser import makefile_writer import os import vars_dict_lib def write_to...
bsd-3-clause
3,501,114,462,943,051,000
32.625
76
0.680607
false
koolspin/rosetta
filters/logger_sink.py
1
3694
import binascii from graph.filter_base import FilterBase, FilterState, FilterType from graph.pad_template import PadTemplate from graph.pad_capabilities import PadCapabilities from graph.input_pin import InputPin from graph.output_pin import OutputPin class LoggerSink(FilterBase): """ A logger sink filter. ...
mit
3,797,629,015,583,295,000
40.505618
130
0.63346
false
execuc/LCInterlocking
lasercut/hingesproperties.py
1
6521
#!/usr/bin/env python # -*- coding: utf-8 -*- # *************************************************************************** # * * # * Copyright (c) 2016 execuc * # * ...
lgpl-2.1
-7,342,155,936,896,913,000
47.664179
119
0.557737
false
Juniper/nova
nova/tests/unit/objects/test_migration_context.py
6
4720
# 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
2,887,861,947,916,896,000
41.142857
79
0.662076
false
k3nnyfr/s2a_fr-nsis
s2a/Python/Lib/gzip.py
57
18694
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import struct, sys, time, os import zlib import io import __builtin__ __all__ = ["GzipFile"...
gpl-3.0
2,349,142,523,044,428,300
35.088803
79
0.548251
false
noironetworks/nova
nova/tests/unit/fake_policy.py
30
17674
# Copyright (c) 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
3,047,207,951,487,704,600
40.782506
75
0.645298
false
gangadhar-kadam/nassimapp
patches/december_2012/stock_entry_cleanup.py
30
2060
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import webnotes def execute(): # removed following fields webnotes.reload_doc("stock", "doctype", "stock_entry") custom_fields() deprecate_process() webnotes.delete_doc("doctype", "san...
agpl-3.0
-6,921,551,644,133,850,000
25.423077
84
0.643204
false
CxyYuan/luyoutec_lanyou5_2
node_modules/pangyp/gyp/pylib/gyp/win_tool.py
395
12634
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os impor...
mit
-4,781,020,966,900,570,000
39.49359
80
0.635982
false
trunca/enigma2
lib/python/Components/Converter/genre.py
72
4163
# # Genre types taken from DVB standards documentation # # some broadcaster do define other types so this list # may grow or be replaced.. # maintype = [ _("Reserved"), _("Movie/Drama"), _("News Current Affairs"), _("Show Games show"), _("Sports"), _("Children/Youth"), _("Music/Ballet/Dance"), _("Arts/Cul...
gpl-2.0
6,028,734,346,655,447,000
23.488235
61
0.563776
false
dwaynebailey/translate
translate/storage/factory.py
2
8230
# -*- coding: utf-8 -*- # # Copyright 2006-2010 Zuza Software Foundation # # This file is part of translate. # # translate 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-2.0
-7,701,718,596,935,078,000
34.782609
124
0.625638
false
spartonia/django-oscar
src/oscar/apps/dashboard/pages/app.py
49
1113
from django.conf.urls import url from oscar.core.application import Application from oscar.core.loading import get_class class FlatPageManagementApplication(Application): name = None default_permissions = ['is_staff', ] list_view = get_class('dashboard.pages.views', 'PageListView') create_view = get...
bsd-3-clause
-6,139,218,865,902,140,000
34.903226
78
0.62354
false
scattering/ipeek
server/sans/data.py
1
5336
#!/usr/bin/env python import struct import sys import vaxutils import numpy import math def readNCNRData(inputfile): f = open(inputfile, 'rb') data = f.read() f.close() #filename dat = struct.unpack('<21s',data[2:23]) filename = dat[0].replace(' ','') #metadata metadata = {} ...
unlicense
2,369,856,551,176,222,000
25.029268
103
0.618816
false
jjmiranda/edx-platform
lms/djangoapps/instructor/services.py
15
4813
""" Implementation of "Instructor" service """ import logging from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey, UsageKey from commerce.signals import create_zendesk_ticket from courseware.models import StudentModule from instructor.views.tools import get_student_from_identifier from ...
agpl-3.0
-8,529,253,008,391,440,000
38.77686
114
0.621442
false
vmax-feihu/hue
desktop/core/ext-py/pysaml2-2.4.0/src/xmldsig/__init__.py
32
63554
#!/usr/bin/env python # # Generated Mon May 2 14:23:33 2011 by parse_xsd.py version 0.4. # import saml2 from saml2 import SamlBase NAMESPACE = 'http://www.w3.org/2000/09/xmldsig#' ENCODING_BASE64 = 'http://www.w3.org/2000/09/xmldsig#base64' # digest and signature algorithms (not implemented = commented out) DIGES...
apache-2.0
6,723,802,185,933,169,000
35.907085
130
0.635995
false
chauhanmohit/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
117
39195
# Copyright (c) 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple Inc. All rights reserved. # Copyright (c) 2010 Research In Motion Limited. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are...
bsd-3-clause
-4,192,370,528,999,366,000
45.220519
229
0.621584
false
palaniyappanBala/sulley
sulley/__init__.py
6
29146
import sulley.blocks import sulley.instrumentation import sulley.legos import sulley.pedrpc import sulley.primitives import sulley.sex import sulley.sessions import sulley.utils BIG_ENDIAN = ">" LITTLE_ENDIAN = "<" ##################################################################################...
gpl-2.0
-2,301,549,357,500,957,000
42.362253
162
0.628422
false
PersonalGenomesOrg/open-humans-data-processing
sources/go_viral.py
2
2529
""" Create data files from a user's GoViral data. Copyright (C) 2016 PersonalGenomes.org This software is shared under the "MIT License" license (aka "Expat License"), see LICENSE.TXT for full license text. """ import json import os import requests from base_source import BaseSource GO_VIRAL_DATA_URL = 'https://w...
mit
-2,421,935,346,013,312,000
26.48913
79
0.569395
false
quantopian/serializable-traitlets
straitlets/ext/tests/test_click.py
1
4991
import re from textwrap import dedent import click from click.testing import CliRunner import pytest from straitlets import ( Serializable, StrictSerializable, Bool, Unicode, Integer, ) from straitlets.ext.click import ( JsonConfigFile, YamlConfigFile, ) from straitlets.test_utils import a...
apache-2.0
8,224,359,379,216,159,000
22.431925
64
0.568223
false
kailIII/geraldo
site/newsite/django_1_0/django/utils/text.py
12
8731
import re from django.conf import settings from django.utils.encoding import force_unicode from django.utils.functional import allow_lazy from django.utils.translation import ugettext_lazy from htmlentitydefs import name2codepoint # Capitalizes the first letter of a string. capfirst = lambda x: x and force_unicode(x)[...
lgpl-3.0
-3,010,944,318,325,054,500
34.205645
132
0.548391
false
hackers-terabit/portage
pym/portage/manifest.py
1
24994
# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals import errno import io import logging import re import stat import sys import warnings import portage portage.proxy.lazyimport.lazyimport(globals(), 'portage.checksum:ha...
gpl-2.0
4,076,481,428,368,328,700
33.617729
110
0.704609
false
PythonNut/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/performance/concatenation.py
451
1145
from __future__ import absolute_import, division, unicode_literals def f1(): x = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" y = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" z = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" x += y + z def f2(): x = "ABCDEFGHIJKLMNOP...
mpl-2.0
9,006,869,633,295,099,000
30.805556
68
0.731878
false
indictranstech/erpnext
erpnext/healthcare/setup.py
6
16695
from __future__ import unicode_literals import frappe from frappe import _ from erpnext.setup.utils import insert_record def setup_healthcare(): if frappe.db.exists('Medical Department', 'Cardiology'): # already setup return create_medical_departments() create_antibiotics() create_test_uom() create_duration(...
agpl-3.0
-2,234,480,820,139,612,700
62.721374
243
0.620246
false
SlimRemix/android_external_chromium_org
chrome/common/extensions/docs/server2/api_list_data_source_test.py
78
8013
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import json from api_list_data_source import APIListDataSource from api_models import ContentScriptAPI from extensions...
bsd-3-clause
-6,999,332,250,755,634,000
29.701149
80
0.554724
false
arjoly/scikit-learn
doc/sphinxext/github_link.py
314
2661
from operator import attrgetter import inspect import subprocess import os import sys from functools import partial REVISION_CMD = 'git rev-parse --short HEAD' def _get_git_revision(): try: revision = subprocess.check_output(REVISION_CMD.split()).strip() except subprocess.CalledProcessError: ...
bsd-3-clause
-5,490,306,509,088,772,000
30.678571
78
0.57873
false
akretion/odoo
odoo/cli/deploy.py
26
3620
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import os import requests import sys import tempfile import zipfile from . import Command class Deploy(Command): """Deploy a module on an Odoo instance""" def __init__(self): super(Deploy, self).__init_...
agpl-3.0
-4,288,437,620,716,231,700
39.674157
152
0.578729
false
dbbhattacharya/kitsune
kitsune/wiki/migrations/0003_add_afrikaans.py
4
15018
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """Create the Afrikaans Locale.""" orm.Locale.objects.create(locale='af') def backwards(self, orm): ...
bsd-3-clause
-1,958,555,978,025,439,500
81.972376
187
0.552404
false
AnotherIvan/calibre
src/calibre/utils/ipc/server.py
11
12195
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import sys, os, cPickle, time, tempfile, errno from math import ceil from threading ...
gpl-3.0
650,024,511,870,985,500
33.352113
109
0.542517
false
ol-loginov/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/utils/ogrinfo.py
389
1973
""" This module includes some utility functions for inspecting the layout of a GDAL data source -- the functionality is analogous to the output produced by the `ogrinfo` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.geometries import GEO_CLASSES def ogrinfo(data_source, num_...
apache-2.0
-8,440,097,620,210,969,000
36.226415
89
0.560568
false
sharbison3/python-docs-samples
bigquery/api/streaming.py
5
3152
#!/usr/bin/env python # Copyright 2015, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
5,889,598,798,325,609,000
29.901961
77
0.64816
false
pmquang/python-anyconfig
anyconfig/backend/tests/json.py
1
1856
# # Copyright (C) 2012 - 2015 Satoru SATOH <ssato @ redhat.com> # License: MIT # # pylint: disable=missing-docstring import os.path import unittest import anyconfig.backend.json as TT import anyconfig.tests.common from anyconfig.tests.common import dicts_equal CNF_0_S = """{ "a": 0, "b": "bbb", "sect0": { ...
mit
2,208,347,314,238,579,500
24.424658
72
0.612069
false
damaggu/SAMRI
samri/plotting/aggregate.py
1
4664
import matplotlib.pyplot as plt import pandas as pd import seaborn.apionly as sns from os import path from matplotlib import rcParams EXTRA_COLORSET = ["#797979","#000000","#505050","#FFFFFF","#B0B0B0",] def registration_qc(df, cmap="Set3", extra=False, extra_cmap=EXTRA_COLORSET, group={"sub":"Subject"}, repeat=...
gpl-3.0
-3,282,102,504,061,336,000
40.274336
350
0.723199
false
sport-monkey/GYP
test/generator-output/gyptest-rules.py
198
1768
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies --generator-output= behavior when using rules. """ import TestGyp # Android doesn't support --generator-output. test = TestGy...
bsd-3-clause
2,502,467,908,997,443,600
28.966102
72
0.706448
false
evgchz/scikit-learn
examples/ensemble/plot_gradient_boosting_regularization.py
355
2843
""" ================================ Gradient Boosting regularization ================================ Illustration of the effect of different regularization strategies for Gradient Boosting. The example is taken from Hastie et al 2009. The loss function used is binomial deviance. Regularization via shrinkage (``lear...
bsd-3-clause
-6,795,946,588,933,364,000
34.987342
99
0.60816
false
qwertyjune/BethSaidaBible
venv/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py
54
25297
""" This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. """ from __future__ import unicode_literals # Python, ctypes and types dependencies. from ctypes import addressof, byref, c_double from django.contrib.gis import memoryview # super-class for mutable list behavio...
gpl-3.0
4,981,267,194,281,748,000
34.679831
109
0.623315
false
SmartPeople/zulip
zerver/management/commands/delete_old_unclaimed_attachments.py
46
1892
from __future__ import absolute_import from __future__ import print_function from typing import Any from argparse import ArgumentParser from django.core.management.base import BaseCommand from zerver.lib.actions import do_delete_old_unclaimed_attachments from zerver.models import Attachment, get_old_unclaimed_attach...
apache-2.0
1,785,363,240,710,975,000
38.416667
94
0.593552
false
svagionitis/youtube-dl
youtube_dl/extractor/mpora.py
12
2006
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import int_or_none class MporaIE(InfoExtractor): _VALID_URL = r'^https?://(www\.)?mpora\.(?:com|de)/videos/(?P<id>[^?#/]+)' IE_NAME = 'MPORA' _TEST = { 'url': 'http://mpora.de/videos/AAd...
unlicense
-6,700,136,055,098,500,000
30.34375
78
0.488534
false
dzan/xenOnArm
tools/xm-test/lib/XmTestLib/Console.py
37
9322
#!/usr/bin/python """ XmConsole.py - Interact with a xen console, getting return codes and output from commands executed there. Copyright (C) International Business Machines Corp., 2005 Author: Dan Smith <danms@us.ibm.com> This program is free software; you can redistribute it and/or modify it un...
gpl-2.0
-2,820,709,509,132,362,000
29.86755
108
0.526604
false
rhinstaller/anaconda
pyanaconda/modules/security/__main__.py
5
1150
# # Security DBus service launcher. # # Copyright (C) 2020 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is dist...
gpl-2.0
3,022,060,618,808,334,300
45
77
0.778261
false
neraliu/tainted-phantomjs
src/breakpad/src/tools/gyp/test/generator-output/gyptest-actions.py
151
1953
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies --generator-output= behavior when using actions. """ import TestGyp test = TestGyp.TestGyp() # All the generated files shoul...
bsd-3-clause
-30,789,419,755,870,684
33.263158
80
0.733231
false
zasdfgbnm/tensorflow
tensorflow/contrib/boosted_trees/estimator_batch/custom_export_strategy_test.py
47
9513
# 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
691,085,421,546,323,800
25.134615
88
0.381898
false
MrNuggles/HeyBoet-Telegram-Bot
temboo/Library/InfluenceExplorer/EntityOverview.py
5
3664
# -*- coding: utf-8 -*- ############################################################################### # # EntityOverview # Returns general information about a particular politician, individual, or organization with a given entity id. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed unde...
gpl-3.0
3,664,627,150,964,209,700
38.826087
205
0.68286
false
nathania/data-science-from-scratch
code/gradient_descent.py
53
5895
from __future__ import division from collections import Counter from linear_algebra import distance, vector_subtract, scalar_multiply import math, random def sum_of_squares(v): """computes the sum of squared elements in v""" return sum(v_i ** 2 for v_i in v) def difference_quotient(f, x, h): return (f(x +...
unlicense
8,939,434,456,052,744,000
32.117978
79
0.56743
false
K-Constantine/Amaraki
core/deps/gyp/test/msvs/filters/gyptest-filters-2008.py
166
1599
#!/usr/bin/env python # Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that extra filters are pruned correctly for Visual Studio 2008. """ import re import TestGyp def strip_ws(str): return r...
mit
-6,003,698,991,972,284,000
22.514706
74
0.623515
false
abusse/cinder
cinder/tests/test_fusionio_ioControl.py
3
41319
# Copyright (c) 2014 Fusion-io, 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 requi...
apache-2.0
2,602,999,919,827,129,000
48.247914
79
0.537283
false
phaethon/scapy
kamene/contrib/eigrp.py
1
16003
#!/usr/bin/env python # kamene.contrib.description = EIGRP # kamene.contrib.status = loads """ EIGRP Scapy Extension ~~~~~~~~~~~~~~~~~~~~~ :version: 2009-08-13 :copyright: 2009 by Jochen Bartl :e-mail: lobo@c3a.de / jochen.bartl@gmail.com :license: GPL v2 This program is free ...
gpl-2.0
8,420,822,240,517,604,000
31.793033
106
0.530588
false
Charlotte-Morgan/inasafe
safe/datastore/test/test_geopackage.py
6
5376
# coding=utf-8 """ InaSAFE Disaster risk assessment tool by AusAid - **Clipper test suite.** Contact : ole.moller.nielsen@gmail.com .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation...
gpl-3.0
-92,434,726,042,814,610
32.811321
78
0.640067
false
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/test_dist_tree_index.py
2
8950
# Copyright (c) 2020 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 appli...
apache-2.0
536,337,000,443,630,200
44.20202
80
0.544469
false
Ashaba/rms
rmslocalenv/lib/python2.7/site-packages/django/contrib/gis/db/models/lookups.py
104
10927
from __future__ import unicode_literals import re from django.core.exceptions import FieldDoesNotExist from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import Col, Expression from django.db.models.lookups import Lookup from django.utils import six gis_lookups = {} class GISLookup...
mit
2,841,797,446,093,182,500
30.950292
101
0.66322
false
orgito/ansible
test/units/modules/network/onyx/test_onyx_ptp.py
63
5200
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
-3,969,286,518,614,845,000
36.681159
104
0.659615
false
Johnetordoff/osf.io
api_tests/base/test_root.py
6
5164
# -*- coding: utf-8 -*- import itsdangerous import mock from nose.tools import * # noqa: import unittest from django.utils import timezone import pytest from tests.base import ApiTestCase from osf_tests.factories import ( AuthUserFactory, ApiOAuth2ScopeFactory, ) from api.base.settings.defaults import API_BA...
apache-2.0
-2,539,273,557,859,089,000
33.198675
96
0.603215
false
aabbox/kbengine
kbe/res/scripts/common/Lib/test/test_pulldom.py
118
12467
import io import unittest import sys import xml.sax from xml.sax.xmlreader import AttributesImpl from xml.dom import pulldom from test.support import run_unittest, findfile tstfile = findfile("test.xml", subdir="xmltestdata") # A handy XML snippet, containing attributes, a namespace prefix, and a # self-closing ta...
lgpl-3.0
-4,793,337,851,864,432,000
34.927954
98
0.621802
false
thedrow/django
django/db/backends/sqlite3/creation.py
193
2859
import os import sys from django.core.exceptions import ImproperlyConfigured from django.db.backends.base.creation import BaseDatabaseCreation from django.utils.six.moves import input class DatabaseCreation(BaseDatabaseCreation): def _get_test_db_name(self): test_database_name = self.connection.settings...
bsd-3-clause
3,538,231,032,007,628,000
41.671642
97
0.583771
false
PuZZleDucK/pixelated-platform
test/features/page_objects/pixelated_page.py
2
2282
# # Copyright (c) 2015 ThoughtWorks, Inc. # # Pixelated 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 Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Pixelated is distrib...
agpl-3.0
-964,646,073,502,102,300
39.75
138
0.706398
false
Yarrick13/hwasp
tests/sat/Models/c745.180.SAT.dimacs.test.py
5
10374
input = """ c num blocks = 1 c num vars = 180 c minblockids[0] = 1 c maxblockids[0] = 180 p cnf 180 745 -91 56 -175 0 118 74 115 0 -36 -83 167 0 16 44 142 0 -88 33 20 0 177 132 -8 0 115 121 2 0 -13 -47 28 0 48 -174 163 0 -67 -54 123 0 -130 -132 -71 0 -171 -158 2 0 -35 23 83 0 129 109 -137 0 -8 -139 75 0 -52 -42 -79 0 5...
apache-2.0
-3,356,203,640,484,546,000
12.758621
22
0.59919
false
iamsarin/geonode
geonode/groups/tests.py
27
16338
import json from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from django.core.urlresolvers import reverse from django.test import TestCase from django.conf import settings from guardian.shortcuts import get_anonymous_user from geonode.groups.models import GroupProfile, Group...
gpl-3.0
4,236,723,625,146,992,600
36.472477
115
0.634411
false
DarkPurple141/Maps
MapGen/voronoi.py
1
28973
#!/usr/bin/env python3 import pygame, os, random, numpy, math, color_palettes, queue, name_gen, triangle from pygame.locals import * from geom import * from PIL import ImageFilter, Image class City: """docstring for City.""" def __init__(self, location, name="default"): self.name = name self.l...
gpl-3.0
-7,163,129,235,569,233,000
32.966002
157
0.534946
false
HybridF5/jacket
jacket/db/compute/sqlalchemy/migrate_repo/versions/274_update_instances_project_id_index.py
2
1616
# Copyright 2014 Rackspace Hosting # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
4,172,629,964,468,528,000
34.130435
78
0.667079
false
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/urbansim/household_x_gridcell/income_less_housing_cost_scaled.py
2
2763
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from urbansim.functions import attribute_label from numpy import reshape class income_less_housing_cost_scaled(Variable): """ (income - ...
gpl-2.0
-7,771,296,120,767,414,000
37.5
93
0.572204
false
G-P-S/depot_tools
third_party/gsutil/gslib/command_runner.py
45
4281
#!/usr/bin/env python # coding=utf8 # 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 # # Un...
bsd-3-clause
-776,416,551,816,814,000
40.970588
80
0.66947
false
sysalexis/kbengine
kbe/src/lib/python/Lib/idlelib/GrepDialog.py
61
5143
import os import fnmatch import re # for htest import sys from tkinter import StringVar, BooleanVar, Checkbutton # for GrepDialog from tkinter import Tk, Text, Button, SEL, END # for htest from idlelib import SearchEngine import itertools from idlelib.SearchDialogBase import SearchDialogBase # Importing OutputWindow...
lgpl-3.0
1,487,930,355,043,669,000
31.345912
77
0.547346
false
stefanv/aandete
app/lib/pygments/styles/autumn.py
31
2144
# -*- coding: utf-8 -*- """ pygments.styles.autumn ~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.to...
bsd-3-clause
1,127,542,771,530,311,300
31.984615
70
0.454757
false
ApuliaSoftware/odoo
addons/account_asset/__openerp__.py
314
2182
# -*- encoding: 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 G...
agpl-3.0
-7,980,590,764,373,972,000
35.983051
81
0.603116
false
takeshineshiro/nova
nova/cells/scheduler.py
46
11483
# Copyright (c) 2012 Rackspace Hosting # 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 req...
apache-2.0
-3,286,769,689,796,123,000
43.855469
79
0.584429
false
zentyal/sogo
Tests/Integration/test-davacl.py
2
47735
#!/usr/bin/python from config import hostname, port, username, password, subscriber_username, subscriber_password, \ superuser, superuser_password import sys import unittest import webdavlib import time import sogotests import utilities # TODO: # - cal: complete test for "modify": "respond to" causes a 204 but...
gpl-2.0
6,056,120,240,345,011,000
41.188663
159
0.547397
false
jeroendierckx/Camelot
camelot/core/utils.py
1
9051
# ============================================================================ # # Copyright (C) 2007-2012 Conceptive Engineering bvba. All rights reserved. # www.conceptive.be / project-camelot@conceptive.be # # This file is part of the Camelot Library. # # This file may be used under the terms of the GNU General...
gpl-2.0
-2,714,353,653,525,843,500
35.059761
90
0.644238
false
triveous/LearnFlask
flask/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/sax.py
1835
1661
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
apache-2.0
2,050,399,941,254,434,600
36.75
74
0.577363
false
bjss/BJSS_liveobs_selenium
liveobs_ui/selectors/desktop/nursing_shift_change_selectors.py
2
1670
""" Selectors for Nursing Shift Change Wizard """ from selenium.webdriver.common.by import By WIZARD_STAGE_CONTAINER = ( By.CSS_SELECTOR, '.modal .oe_form_field_status' ) WIZARD_STAGE = ( By.CSS_SELECTOR, '.modal .oe_form_field_status .label' ) WIZARD_BUTTON = ( By.CSS_SELECTOR, '.modal .oe_fo...
gpl-3.0
-8,910,009,778,438,738,000
22.521127
68
0.644311
false
ttsubo/ryu
ryu/contrib/ovs/reconnect.py
54
23121
# Copyright (c) 2010, 2011, 2012 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
-1,076,777,287,067,087,100
38.321429
79
0.599196
false
BartoszCichecki/onlinepython
onlinepython/pypy-2.4.0-win32/lib-python/2.7/lib2to3/tests/pytree_idempotency.py
129
2385
#!/usr/bin/env python # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Main program for testing the infrastructure.""" __author__ = "Guido van Rossum <guido@python.org>" # Support imports (need to be imported first) from . import support # Python imports import ...
gpl-2.0
-1,352,538,701,067,245,300
24.923913
75
0.556813
false
luci/luci-py
client/third_party/oauth2client/_pycrypto_crypt.py
6
4295
# 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 ...
apache-2.0
-4,763,661,975,142,986,000
32.554688
79
0.606752
false
hhru/ansible
lib/ansible/module_utils/a10.py
322
4194
# 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,125,465,357,700,714,000
39.718447
134
0.68288
false
sogelink/ansible
lib/ansible/module_utils/vyos.py
14
4939
# 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
8,325,332,701,635,017,000
38.512
120
0.674428
false
epitron/youtube-dl
youtube_dl/extractor/nba.py
27
5956
from __future__ import unicode_literals import functools import re from .turner import TurnerBaseIE from ..compat import ( compat_urllib_parse_urlencode, compat_urlparse, ) from ..utils import ( OnDemandPagedList, remove_start, ) class NBAIE(TurnerBaseIE): _VALID_URL = r'https?://(?:watch\.|www\...
unlicense
-8,731,880,009,368,587,000
37.675325
128
0.537945
false
andyneff/voxel-globe
voxel_globe/ingest/metadata/tools.py
1
6144
import os import json from celery.utils.log import get_task_logger from vsi.iglob import glob as iglob logger = get_task_logger(__name__); #Move to ingest.tools when done devving def match_images(images, camera_names, json_config={}): ''' returns dictionary camera_name:image pairs json example: {...
mit
-2,643,956,268,025,758,000
31.167539
94
0.62207
false
stvstnfrd/edx-platform
lms/djangoapps/grades/tests/test_signals.py
5
9726
""" Tests for the score change signals defined in the courseware models module. """ import re from datetime import datetime from unittest.mock import MagicMock, patch import ddt import pytest import pytz from django.test import TestCase from submissions.models import score_reset, score_set from common.djangoapps.ut...
agpl-3.0
8,278,451,390,750,295,000
36.264368
117
0.646617
false
fidomason/kbengine
kbe/res/scripts/common/Lib/encodings/hex_codec.py
202
1508
"""Python 'hex_codec' Codec - 2-digit hex content transfer encoding. This codec de/encodes from bytes to bytes. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs import binascii ### Codec APIs def hex_encode(input, errors='strict'): assert errors == 'strict' return (binascii.b2a_hex(input)...
lgpl-3.0
-4,636,386,729,070,934,000
26.418182
68
0.690981
false
meletakis/collato
lib/python2.7/site-packages/django/templatetags/static.py
114
4022
try: from urllib.parse import urljoin except ImportError: # Python 2 from urlparse import urljoin from django import template from django.template.base import Node from django.utils.encoding import iri_to_uri register = template.Library() class PrefixNode(template.Node): def __repr__(self): ...
gpl-2.0
-100,361,763,294,115,340
23.981366
76
0.583541
false
termie/nova-migration-demo
nova/tests/test_volume.py
2
14447
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 compli...
apache-2.0
-7,138,295,600,292,105,000
37.940701
79
0.579567
false
ivanovev/hm
srv/ANASAT.py
1
8497
from util import CachedDict from util.serial import query_serial cache = CachedDict() table_act = { 'TEMP': 0, 'TXOUT': 1, 'RXOUT': 1, 'P12V': 3, 'PA3': 4, 'PA4': 5, 'PA5': 6, 'PA6': 7, 'N5V': 8, 'OSLPLL': 9, 'TXPLL': 10, 'RXPLL': 11, 'LNBV': 12,...
gpl-3.0
5,377,424,108,538,703,000
28.783465
128
0.540862
false
ggalancs/marionette
marionette_tg/record_layer.py
3
5370
#!/usr/bin/env python # -*- coding: utf-8 -*- import binascii PAYLOAD_HEADER_SIZE_IN_BITS = 200 PAYLOAD_HEADER_SIZE_IN_BYTES = PAYLOAD_HEADER_SIZE_IN_BITS / 8 NORMAL = 0x1 END_OF_STREAM = 0x2 class Cell(object): def __init__(self, model_uuid, model_instance_id, stream_id, seq_id, length=0, ce...
apache-2.0
6,674,765,388,339,571,000
27.716578
122
0.616201
false
WojciechMigda/TCO-PCFStupskiPrize1
src/cell_patches_dbscan.py
1
8930
#!/opt/anaconda2/bin/python # -*- coding: utf-8 -*- """ ################################################################################ # # Copyright (c) 2015 Wojciech Migda # All rights reserved # Distributed under the terms of the MIT license # ####################################################################...
mit
6,738,072,678,740,741,000
29.477816
131
0.51299
false
nis-sdn/odenos
src/main/python/org/o3project/odenos/remoteobject/manager/event_subscription.py
6
2243
# -*- coding:utf-8 -*- # Copyright 2015 NEC Corporation. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License...
apache-2.0
-450,179,615,224,841,100
44.77551
76
0.553277
false
kjw0106/GCM_app_server
venv/lib/python2.7/site-packages/sqlalchemy/ext/instrumentation.py
147
14856
"""Extensible class instrumentation. The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate systems of class instrumentation within the ORM. Class instrumentation refers to how the ORM places attributes on the class which maintain data and track changes to that data, as well as event hooks installed...
mit
-6,569,322,856,772,764,000
34.884058
79
0.677908
false
ModdedPA/android_external_chromium_org
build/android/pylib/instrumentation/test_package.py
61
1121
# Copyright (c) 2013 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 representing instrumentation test apk and jar.""" import os from pylib.utils import apk_helper import test_jar class TestPackage(test_jar.T...
bsd-3-clause
8,245,221,166,787,114,000
28.5
77
0.694915
false
imruahmed/microblog
flask/lib/python2.7/site-packages/sqlalchemy/sql/__init__.py
49
1737
# sql/__init__.py # Copyright (C) 2005-2015 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 from .expression import ( Alias, ClauseElement, ColumnCollection, Co...
bsd-3-clause
-6,101,496,341,284,583,000
17.880435
77
0.631549
false
sunny94/temp
sympy/mpmath/tests/test_ode.py
39
1834
#from sympy.mpmath.calculus import ODE_step_euler, ODE_step_rk4, odeint, arange from sympy.mpmath import odefun, cos, sin, mpf, sinc, mp ''' solvers = [ODE_step_euler, ODE_step_rk4] def test_ode1(): """ Let's solve: x'' + w**2 * x = 0 i.e. x1 = x, x2 = x1': x1' = x2 x2' = -x1 """ d...
bsd-3-clause
6,367,299,841,544,207,000
24.123288
79
0.498364
false
llhe/tensorflow
tensorflow/python/training/basic_session_run_hooks.py
21
27030
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-4,489,342,480,737,299,500
33.922481
83
0.664373
false
grueni75/GeoDiscoverer
Source/Platform/Target/Android/core/src/main/jni/libxml2-2.9.2/python/tests/reader.py
35
12521
#!/usr/bin/python -u # -*- coding: ISO-8859-1 -*- # # this tests the basic APIs of the XmlTextReader interface # import libxml2 import sys try: import StringIO str_io = StringIO.StringIO except: import io str_io = io.StringIO # Memory debug specific libxml2.debugMemory(1) f = str_io("""<a><b b1="b1"/>...
gpl-3.0
1,726,076,395,339,499,500
27.073991
308
0.627106
false
viki9698/jizhanggroup
django/contrib/auth/tests/basic.py
95
8948
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import locale from django.contrib.auth import get_user_model from django.contrib.auth.management.commands import createsuperuser from django.contrib.auth.models import User, AnonymousUser from django.contrib.auth.tests.custom_user import CustomUser fro...
bsd-3-clause
627,545,090,465,441,700
37.230769
105
0.623854
false
campbe13/openhatch
vendor/packages/mechanize/mechanize/_headersutil.py
133
8371
"""Utility functions for HTTP header value parsing and construction. Copyright 1997-1998, Gisle Aas Copyright 2002-2006, John J. Lee This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included with the distribution). """ impo...
agpl-3.0
-6,573,428,278,352,441,000
33.73444
80
0.526699
false
meletakis/collato
lib/python2.7/site-packages/django/contrib/admin/views/main.py
85
16606
import operator from functools import reduce from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.paginator import InvalidPage from django.core.urlresolvers import reverse from django.db import models from django.db.models.fields import FieldDoesNotExist from django.utils.datas...
gpl-2.0
-1,182,978,941,842,017,300
42.244792
95
0.575093
false
andersonresende/django
django/contrib/formtools/wizard/storage/base.py
79
4920
from django.core.files.uploadedfile import UploadedFile from django.utils.datastructures import MultiValueDict from django.utils.functional import lazy_property from django.utils import six from django.contrib.formtools.wizard.storage.exceptions import NoFileStorageConfigured class BaseStorage(object): step_key ...
bsd-3-clause
-6,207,015,620,240,306,000
36.846154
86
0.606098
false
CMUSV-VisTrails/WorkflowRecommendation
vistrails/db/versions/v0_9_3/translate/v0_9_1.py
1
3964
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
bsd-3-clause
-6,161,103,926,757,486,000
45.093023
79
0.646065
false
yesudeep/old-milsalumni
app/console/app/pygments/cmdline.py
19
12149
# -*- coding: utf-8 -*- """ pygments.cmdline ~~~~~~~~~~~~~~~~ Command line interface. :copyright: 2006-2008 by Georg Brandl. :license: BSD, see LICENSE for more details. """ import sys import getopt from textwrap import dedent from pygments import __version__, __author__, highlight from pygments....
mit
-8,288,775,479,969,491,000
29.071782
88
0.53346
false
wang701/nexus_9_flounder_kernel_src
scripts/tracing/dma-api/smmu.py
96
7013
"""Low-level memory management tracking""" VERBOSITY = 0 # TODO: use logging class Bitmap(object): """Just a raw bitmap for reserving the pages""" def __init__(self, size, verbosity): self._size = size self._bits = 0 self._verbosity = verbosity self._bits_allocd = 0 def _m...
gpl-2.0
-7,347,577,056,315,862,000
33.717822
136
0.550549
false
TheoChevalier/bedrock
bedrock/mozorg/tests/test_models.py
3
4006
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from django.core.cache import cache from django.db.utils import DatabaseError from django.db.mod...
mpl-2.0
1,801,702,636,119,820,800
34.451327
86
0.645032
false
h4ck3rm1k3/ansible
docsite/build-site.py
211
2937
#!/usr/bin/env python # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of the Ansible Documentation # # 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 th...
gpl-3.0
760,449,326,179,315,300
29.59375
86
0.562138
false
myfluxi/android_kernel_lge_hammerhead
scripts/gcc-wrapper.py
181
3495
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0
-2,484,906,475,570,192,400
33.95
97
0.666667
false