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
tudyzhb/yichui
django/contrib/localflavor/us/forms.py
87
4651
""" USA-specific Form helpers """ from __future__ import absolute_import import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, CharField from django.utils.encoding import smart_unicode from django.utils.translatio...
bsd-3-clause
1,748,559,875,399,369,700
35.912698
112
0.615567
false
HKUST-SING/tensorflow
tensorflow/contrib/learn/python/learn/utils/gc_test.py
11
4567
# 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
7,169,241,631,864,201,000
35.246032
80
0.60543
false
axinging/chromium-crosswalk
tools/perf/page_sets/page_reload_cases.py
22
1393
# Copyright 2015 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. from telemetry.page import shared_page_state from telemetry import story from page_sets import top_pages def _Reload(action_runner): # Numbers below are ...
bsd-3-clause
-4,537,727,320,754,828,000
31.395349
74
0.741565
false
jeorryb/datarambler
plugins/creole_reader/creole_reader.py
71
2939
#-*- conding: utf-8 -*- ''' Creole Reader ------------- This plugins allows you to write your posts using the wikicreole syntax. Give to these files the creole extension. For the syntax, look at: http://www.wikicreole.org/ ''' from pelican import readers from pelican import signals from pelican import settings from...
mit
-5,585,572,248,908,343,000
28.09901
83
0.585233
false
vFense/vFenseAgent-nix
agent/deps/mac/Python-2.7.5/lib/python2.7/uuid.py
187
21095
r"""UUID objects (universally unique identifiers) according to RFC 4122. This module provides immutable UUID objects (class UUID) and the functions uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122. If all you want is a unique ID, you should probably call uuid1() ...
lgpl-3.0
1,605,752,220,072,277,000
36.669643
79
0.600711
false
slivkamiro/sample_kafka_producer
src/sample_producer.py
1
2551
import sys from argparse import ArgumentParser from threading import Timer from time import time from confluent_kafka import avro from confluent_kafka.avro import AvroProducer from random import randint, random from sample_source_props import random_movie, random_series, random_user, random_tags, random_sentence clas...
apache-2.0
-7,673,462,590,672,210,000
29.73494
102
0.558996
false
nurey/disclosed
app2/common/appenginepatch/ragendja/sites/dynamicsite.py
10
1805
from django.conf import settings from django.core.cache import cache from django.contrib.sites.models import Site from ragendja.dbutils import db_create from ragendja.pyutils import make_tls_property _default_site_id = getattr(settings, 'SITE_ID', None) SITE_ID = settings.__class__.SITE_ID = make_tls_property() class...
mit
7,877,798,877,407,397,000
36.604167
75
0.544044
false
huzq/scikit-learn
sklearn/neighbors/_nearest_centroid.py
4
7789
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..met...
bsd-3-clause
-6,476,400,131,214,968,000
37.369458
82
0.598922
false
mancoast/CPythonPyc_test
cpython/212_test_traceback.py
5
1336
"""Test cases for traceback module""" import unittest from test_support import run_unittest import traceback class TracebackCases(unittest.TestCase): # For now, a very minimal set of tests. I want to be sure that # formatting of SyntaxErrors works based on changes for 2.1. def get_exception_format(self...
gpl-3.0
-3,526,156,217,490,305,500
32.4
72
0.595808
false
hitsl/bouser
bouser/utils.py
1
5738
# -*- coding: utf-8 -*- import datetime import json import functools from Queue import Queue import six from twisted.application.service import Service from twisted.internet import defer from bouser.excs import SerializableBaseException, ExceptionWrapper from twisted.web.http import Request from bouser.web.cors import...
isc
8,326,185,576,004,615,000
26.851485
100
0.599893
false
lindsayad/sympy
sympy/combinatorics/prufer.py
93
11915
from __future__ import print_function, division from sympy.core import Basic from sympy.core.compatibility import iterable, as_int, range from sympy.utilities.iterables import flatten from collections import defaultdict class Prufer(Basic): """ The Prufer correspondence is an algorithm that describes the ...
bsd-3-clause
-7,313,743,341,271,998,000
26.517321
101
0.469492
false
scottdangelo/cinderclient-api-microversions
cinderclient/tests/unit/test_utils.py
2
6782
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
apache-2.0
2,705,776,508,783,013,000
27.258333
76
0.560012
false
fcnmx/slapcomp
unittests.py
1
4049
""" Slapcomp Unit Tests ~~~~~~~~~~~~~~~~~~~~ Testing DAG functions. :Version 0.1 Written by Daniel Hayes (d@fcn.mx) June 2012 """ #import os import sys sys.path.append("/Users/d/Dropbox/work/") sys.path.append("/home/d/Dropbox/work/") import unittest from slapcomp.core.dag import Dag from slapcomp.no...
bsd-3-clause
-1,061,832,395,072,447,700
30.632813
95
0.651766
false
openstack/tempest
tempest/api/volume/base.py
1
14970
# 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
-2,675,335,339,997,184,500
42.517442
79
0.618303
false
tobikausk/nest-simulator
pynest/nest/tests/test_vogels_sprekeler_synapse.py
16
8546
# -*- coding: utf-8 -*- # # test_vogels_sprekeler_synapse.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, either version 2 ...
gpl-2.0
-8,308,673,340,109,282,000
35.211864
79
0.585186
false
andmos/ansible
lib/ansible/plugins/terminal/edgeswitch.py
63
3190
# # (c) 2018 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
8,244,367,137,450,748,000
35.666667
141
0.619436
false
azureplus/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/comments/moderation.py
121
13553
""" A generic comment-moderation system which allows configuration of moderation options on a per-model basis. To use, do two things: 1. Create or import a subclass of ``CommentModerator`` defining the options you want. 2. Import ``moderator`` from this module and register one or more models, passing the model...
apache-2.0
-226,269,732,647,441,120
37.070225
132
0.664797
false
ericd/redeem
redeem/gcodes/M562.py
2
1398
""" GCode M562 Example: M562 P0 Reset temperature fault Author: Elias Bakken License: CC BY-SA: http://creativecommons.org/licenses/by-sa/2.0/ """ from GCodeCommand import GCodeCommand import numpy as np import logging class M562(GCodeCommand): def execute(self, g): if g.has_letter("P"): ...
gpl-3.0
3,063,899,440,051,370,000
32.285714
77
0.59299
false
silenceli/nova
nova/tests/unit/api/openstack/compute/contrib/test_suspend_server.py
9
2838
# Copyright 2013 IBM Corp. # # 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
4,474,874,372,122,212,400
38.416667
78
0.659267
false
yqm/sl4a
python/src/Demo/pdist/cvslib.py
47
10175
"""Utilities for CVS administration.""" import string import os import time import md5 import fnmatch if not hasattr(time, 'timezone'): time.timezone = 0 class File: """Represent a file's status. Instance variables: file -- the filename (no slashes), None if uninitialized lseen -- true if the ...
apache-2.0
-2,520,517,040,276,042,000
26.953297
74
0.539853
false
dmwelch/Py6S
Py6S/Params/ground_reflectance.py
2
17014
# This file is part of Py6S. # # Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file. # # Py6S 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 3 of the License, o...
gpl-3.0
-6,849,331,897,747,732,000
38.752336
339
0.652639
false
dchenbecker/kafka-sbt
system_test/replication_testsuite/replica_basic_test.py
3
25648
# 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
531,991,306,670,953,700
55.369231
192
0.516064
false
avidity/racconto
racconto/hooks/__init__.py
1
2994
from datetime import datetime as d from distutils.dir_util import copy_tree import os from racconto.generator import Generator from racconto.settings_manager import SettingsManager as SETTINGS def generate_archive(pages, posts): """ Generate archive from posts. Assumes posts have been generated (i.e directori...
mit
-1,378,435,422,145,141,500
40.013699
151
0.629927
false
rvalyi/OpenUpgrade
addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py
39
13980
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
-7,195,024,284,713,317,000
49.623188
334
0.599628
false
toontownfunserver/Panda3D-1.9.0
direct/controls/ControlManager.py
11
14176
from direct.showbase.InputStateGlobal import inputState #from DirectGui import * #from PythonUtil import * #from IntervalGlobal import * #from otp.avatar import Avatar from direct.directnotify import DirectNotifyGlobal #import GhostWalker #import GravityWalker #import NonPhysicsWalker #import PhysicsWalker #if __debu...
bsd-3-clause
-287,931,260,197,643,420
40.089855
115
0.637839
false
Benniphx/server-tools
mass_editing/wizard/__init__.py
62
1052
# -*- coding: utf-8 -*- ############################################################################## # # This module uses OpenERP, Open Source Management Solution Framework. # Copyright (C): # 2012-Today Serpent Consulting Services (<http://www.serpentcs. # # This program is free software: you can red...
agpl-3.0
5,289,073,766,875,143,000
44.73913
78
0.609316
false
miquelo/caviar
setup.py
1
1856
# # This file is part of CAVIAR. # # CAVIAR 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. # # CAVIAR is distributed in the hope that ...
gpl-3.0
-4,734,879,420,031,935,000
19.853933
70
0.700431
false
pquentin/libcloud
setup.py
3
5864
# 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 use ...
apache-2.0
-6,177,325,183,546,756,000
33.093023
79
0.644611
false
bdh1011/cupeye
venv/lib/python2.7/site-packages/whoosh/codec/base.py
52
24009
# Copyright 2011 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
bsd-3-clause
388,125,596,306,667,500
27.480427
82
0.633762
false
zasdfgbnm/qutip
qutip/tests/test_basis_transformation.py
1
4351
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
bsd-3-clause
-9,208,505,146,090,276,000
38.554545
79
0.663066
false
theislab/dca
dca/utils.py
1
4911
import scanpy as sc import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import scipy as sp import tensorflow as tf from tensorflow.contrib.opt import ScipyOptimizerInterface nb_zero = lambda t, mu: (t/(mu+t))**t zinb_zero = lambda t, mu, p: p + ((1.-p)*((t/(mu+t))**t)) sigmoid...
apache-2.0
-5,718,507,196,226,868,000
30.480769
119
0.576054
false
rajanil/mkboost
src/generate_features.py
1
8882
import urllib import json import time import mismatch import csv import numpy as np import cPickle import os import pdb class Protein(): """ Class describing a protein in terms of its amino acid sequence Arguments name : string name of the protein """ def __init__(self,name): ...
mit
2,363,267,163,295,000,000
28.905724
118
0.524206
false
jakirkham/lazyflow
tests/test_blockwise_view.py
2
3090
import numpy import logging from lazyflow.utility import blockwise_view logger = logging.getLogger("tests.test_blockwise_view") def test_2d(): # Adapted from: # http://stackoverflow.com/a/8070716/162094 n=4 m=5 a = numpy.arange(1,n*m+1).reshape(n,m) logger.debug("original data:\n{}".format(a)...
lgpl-3.0
-7,970,719,502,584,422,000
32.956044
94
0.61165
false
seem-sky/kbengine
kbe/res/scripts/common/Lib/test/test_sys_setprofile.py
177
11355
import gc import pprint import sys import unittest from test import support class TestGetProfile(unittest.TestCase): def setUp(self): sys.setprofile(None) def tearDown(self): sys.setprofile(None) def test_empty(self): self.assertIsNone(sys.getprofile()) def test_setget(self)...
lgpl-3.0
6,119,936,073,358,118,000
28.417098
78
0.413474
false
lesina/Hack70
env/lib/python3.5/site-packages/gunicorn/workers/geventlet.py
22
3796
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from functools import partial import errno import sys try: import eventlet except ImportError: raise RuntimeError("You need eventlet installed to use this worker.") # validate the ev...
gpl-3.0
5,126,536,680,657,431,000
27.118519
75
0.609062
false
firebase/firebase-ios-sdk
Firestore/Protos/nanopb_cpp_generator.py
2
14326
#!/usr/bin/env python # Copyright 2018 Google # # 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 agr...
apache-2.0
3,649,042,105,356,782,600
32.238979
143
0.718903
false
clearlylin/folly
folly/build/generate_format_tables.py
61
2378
#!/usr/bin/env python # # Generate Format tables import os from optparse import OptionParser OUTPUT_FILE = "FormatTables.cpp" def generate_table(f, type_name, name, map): f.write("extern const {0} {1}[] = {{".format(type_name, name)) for i in range(0, 256): if i % 2 == 0: f.write("\n ")...
apache-2.0
-4,899,808,193,175,913,000
29.101266
75
0.539529
false
CTSRD-SOAAP/chromium-42.0.2311.135
tools/metrics/rappor/pretty_print.py
6
4494
#!/usr/bin/env python # Copyright 2015 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 logging import sys import os # Import the metrics/common module for pretty print xml. sys.path.append(os.path.join(os.path.dirn...
bsd-3-clause
-5,903,140,779,668,324,000
25.91018
79
0.677348
false
badock/nova
nova/virt/hyperv/utilsfactory.py
23
3635
# Copyright 2013 Cloudbase Solutions Srl # 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 r...
apache-2.0
-189,822,360,918,983,800
33.292453
79
0.701238
false
joelstanner/python-social-auth
examples/django_me_example/example/app/views.py
111
2194
import json from django.conf import settings from django.http import HttpResponse, HttpResponseBadRequest from django.shortcuts import redirect from django.contrib.auth.decorators import login_required from django.contrib.auth import logout as auth_logout, login from social.backends.oauth import BaseOAuth1, BaseOAuth...
bsd-3-clause
3,986,857,956,288,996,000
28.648649
77
0.703737
false
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/encodings/idna.py
3
8783
# This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep) import stringprep, re, codecs from unicodedata import ucd_3_2_0 as unicodedata # IDNA section 3.1 dots = re.compile("[\u002E\u3002\uFF0E\uFF61]") # IDNA section 5 ace_prefix = b"xn--" sace_prefix = "xn--" # This assumes query strings, so ...
gpl-2.0
4,039,780,245,495,196,700
28.602787
73
0.545372
false
trondhindenes/ansible
lib/ansible/modules/cloud/scaleway/scaleway_security_group_facts.py
48
2816
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2018, Yanis Guenane <yanis+ansible@guenane.org> # 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':...
gpl-3.0
-2,037,376,893,660,642,800
25.317757
111
0.619318
false
fergalbyrne/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/pyparsing.py
72
143924
# module pyparsing.py # # Copyright (c) 2003-2008 Paul T. McGuire # # 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 Software without restriction, including # without limitation the rights to use, cop...
agpl-3.0
6,588,566,769,123,336,000
38.978889
196
0.580633
false
matrix-org/sydent
sydent/db/hashing_metadata.py
1
5081
# Copyright 2019 The Matrix.org Foundation C.I.C. # # 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
3,694,630,129,018,332,700
33.80137
95
0.599488
false
zenoss/ZenPacks.zenoss.CloudStack
ZenPacks/zenoss/CloudStack/Cluster.py
1
1449
########################################################################### # # This program is part of Zenoss Core, an open source monitoring platform. # Copyright (C) 2011, Zenoss Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License versi...
gpl-2.0
-1,869,371,782,264,665,900
31.2
75
0.561767
false
bazz-erp/erpnext
erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
21
3899
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, getdate, nowdate, fmt_money from frappe import msgprint, _ from frappe.model.document import Document form_...
gpl-3.0
5,150,375,922,205,581,000
38.383838
111
0.68556
false
paralect/robomongo
bin/set-mongo-warning-level-3.py
2
1283
import os from os.path import join ### def force_warning_level_3(file): with open(file, "r") as in_file: buf = in_file.readlines() push = '#pragma warning(push, 3)\n' pop = '#pragma warning(pop)\n' last_line_has_mongo = False with open(file, "w") as out_file: for line in buf: ...
gpl-3.0
-7,342,277,451,555,015,000
29.571429
71
0.492595
false
ashray/VTK-EVM
ThirdParty/Twisted/twisted/internet/glib2reactor.py
64
1115
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This module provides support for Twisted to interact with the glib mainloop. This is like gtk2, but slightly faster and does not require a working $DISPLAY. However, you cannot run GUIs under this reactor: for that you must use the gtk2reactor...
bsd-3-clause
-7,536,578,052,860,199,000
24.340909
76
0.706726
false
MycroftAI/mycroft-core
mycroft/skills/fallback_skill.py
2
7989
# Copyright 2019 Mycroft AI 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 agreed to in writin...
apache-2.0
8,017,305,746,952,988,000
39.145729
78
0.569158
false
juanriaza/django-rest-framework-msgpack
rest_framework_msgpack/renderers.py
1
1132
import msgpack import decimal import datetime from rest_framework.renderers import BaseRenderer class MessagePackEncoder(object): def encode(self, obj): if isinstance(obj, datetime.datetime): return {'__class__': 'datetime', 'as_str': obj.isoformat()} elif isinstance(obj, datetime.da...
bsd-3-clause
-7,274,615,940,589,601,000
28.025641
71
0.606007
false
dlopes-samba/dlopes-maps-sambatech
django/db/backends/mysql/base.py
101
13899
""" MySQL database backend for Django. Requires MySQLdb: http://sourceforge.net/projects/mysql-python """ import re import sys try: import MySQLdb as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) ...
bsd-3-clause
2,011,468,015,102,285,800
39.521866
127
0.627527
false
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/tools/gyp/test/small/gyptest-small.py
29
1480
#!/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. """ Runs small tests. """ import imp import os import sys import unittest import TestGyp test = TestGyp.TestGyp() # Add pylib to the im...
mit
180,349,866,991,038,600
25.909091
72
0.716892
false
ycl2045/nova-master
nova/keymgr/not_implemented_key_mgr.py
112
1417
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
apache-2.0
-5,678,126,832,116,887,000
33.560976
79
0.702188
false
wuhengzhi/chromium-crosswalk
tools/site_compare/scrapers/chrome/chrome011010.py
189
1183
# Copyright (c) 2011 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. """Does scraping for versions of Chrome from 0.1.101.0 up.""" from drivers import windowing import chromebase # Default version version = "0.1.101.0" ...
bsd-3-clause
-1,374,675,226,595,494,700
27.166667
72
0.734573
false
BNIA/tidyall
src/modules/tidydate.py
2
2523
#!/usr/bin/env python # -*- coding: utf-8 -*- """tidydate This file declares and implements the TidyDate class for TidyAll. TidyDate converts and formats valid date columns into ISO 8601 (yyyy-mm-dd). """ import sys from dateutil import parser as date_parser import numpy as np import pandas as pd from .settings im...
mit
9,200,284,781,386,265,000
21.526786
78
0.523583
false
Polarcraft/KbveBot
scripts/parselogs.py
1
4376
#!/usr/bin/env python3 # Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson # # 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 Softwar...
gpl-2.0
-4,509,065,561,740,912,000
33.456693
134
0.606261
false
sfu-natlang/glm-parser
scripts/train.py
1
2296
import sys sys.path.append("../src/") from backend import data_set, dependency_tree from feature import feature_set from learn import weight_learner from evaluate import evaluator import glm_parser def write_file(msg): f = open(output_file, "a+") f.write(msg) f.close() return if __name__ == "__main_...
mit
-774,660,007,755,611,900
31.8
93
0.587108
false
frohoff/Empire
lib/listeners/http_mapi.py
2
31659
import logging import base64 import random import os import ssl import time import copy from pydispatch import dispatcher from flask import Flask, request, make_response # Empire imports from lib.common import helpers from lib.common import agents from lib.common import encryption from lib.common import packets from l...
bsd-3-clause
-6,463,136,576,085,958,000
47.556748
260
0.515177
false
poeschlr/kicad-3d-models-in-freecad
cadquery/FCAD_script_generator/GW_QFP_SOIC_SSOP_TSSOP_SOT/cq_parameters_sot.py
1
40529
# -*- coding: utf8 -*- #!/usr/bin/python # # This is derived from a cadquery script for generating QFP/GullWings models in X3D format. # # from https://bitbucket.org/hyOzd/freecad-macros # author hyOzd # # Dimensions are from Jedec MS-026D document. ## file of parametric definitions from Params import * class Series...
gpl-2.0
3,820,980,870,025,996,300
52.680795
161
0.546424
false
isc-projects/forge
tests/dhcpv6/kea_only/host_reservation/test_host_reservation_address_conflicts_mysql.py
1
22101
"""Host Reservation DHCPv6""" # pylint: disable=invalid-name,line-too-long import pytest import srv_msg import misc import srv_control @pytest.mark.v6 @pytest.mark.host_reservation @pytest.mark.kea_only def test_v6_host_reservation_mysql_duplicate_reservation_duid(): misc.test_setup() srv_control.config_sr...
isc
5,909,088,142,708,498,000
39.110708
119
0.669698
false
joelpinheiro/safebox-smartcard-auth
Server/veserver/lib/python2.7/site-packages/pip/util.py
343
24172
import sys import shutil import os import stat import re import posixpath import zipfile import tarfile import subprocess import textwrap from pip.exceptions import InstallationError, BadCommand, PipError from pip.backwardcompat import(WindowsError, string_types, raw_input, console_to_s...
gpl-2.0
-1,741,642,234,478,347,300
32.572222
113
0.5803
false
ArnossArnossi/django
django/core/files/images.py
429
2428
""" Utility functions for handling images. Requires Pillow as you might imagine. """ import struct import zlib from django.core.files import File class ImageFile(File): """ A mixin for use alongside django.core.files.base.File, which provides additional features for dealing with images. """ def ...
bsd-3-clause
-3,415,522,611,512,021,500
29.35
79
0.563839
false
badlands-model/BayesLands
pyBadlands/surface/FVmethod.py
1
12118
##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~## ## ## ## This file forms part of the Badlands surface processes modelling application. ## ## ...
gpl-3.0
8,554,590,818,393,844,000
33.039326
98
0.596386
false
jelly/calibre
src/calibre/ebooks/metadata/archive.py
2
5477
#!/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__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import os from contextlib import closing from calibre.customize import FileTypePlug...
gpl-3.0
3,909,825,084,442,737,700
30.477011
84
0.53679
false
pxsdirac/vnpy
vn.demo/ltsdemo/demoApi.py
46
32062
# encoding: UTF-8 """ 该文件中包含的是交易平台的底层接口相关的部分, 主要对API进行了一定程度的简化封装,方便开发。 """ import os from vnltsmd import MdApi from vnltstd import * from vnltsl2 import * from eventEngine import * from lts_data_type import defineDict #---------------------------------------------------------------------- def print_dict(d): """...
mit
8,420,904,436,257,976,000
34.249689
114
0.402664
false
binary13/Python_Koans
python3/koans/about_scoring_project.py
107
2207
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # A greed roll is scored as follows: # # * A set of three ones is 100...
mit
-8,649,388,877,482,066,000
29.666667
79
0.633892
false
GeriLife/wellbeing
test-automation/app/accessibility_tasks.py
2
2733
from aloe import world from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.select import Select from selenium.webdriver.support.wait import WebDriverWait # Do not remove this import. Without it the hook will not be ran from app.ho...
agpl-3.0
-6,179,602,755,478,945,000
31.164706
107
0.739846
false
JeanKossaifi/scikit-learn
benchmarks/bench_plot_nmf.py
90
5742
""" Benchmarks of Non-Negative Matrix Factorization """ from __future__ import print_function from collections import defaultdict import gc from time import time import numpy as np from scipy.linalg import norm from sklearn.decomposition.nmf import NMF, _initialize_nmf from sklearn.datasets.samples_generator import...
bsd-3-clause
-3,445,365,372,588,492,300
33.590361
79
0.564437
false
RPI-OPENEDX/edx-platform
lms/djangoapps/instructor/tests/test_enrollment_store_provider.py
136
2709
""" Exercises tests on the base_store_provider file """ from django.test import TestCase from instructor.enrollment_report import AbstractEnrollmentReportProvider from instructor.paidcourse_enrollment_report import PaidCourseEnrollmentReportProvider class BadImplementationAbstractEnrollmentReportProvider(AbstractEnr...
agpl-3.0
2,800,437,345,769,286,700
35.12
107
0.717239
false
vietch2612/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/buildbot_results.py
120
8022
#!/usr/bin/env python # Copyright (C) 2012 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 ...
bsd-3-clause
-8,814,810,580,129,945,000
47.035928
146
0.628272
false
kidibox/kidibox-py
kidibox/api/download.py
1
1238
import contextlib import logging import re import shutil import ssl import urllib logger = logging.getLogger(__name__) re_filename = re.compile(r"filename=(.+)") class DownloadApiMixin(object): def download(self, token, **kwargs): context = ssl.create_default_context() if not self.session.verify...
mit
-5,828,181,639,554,103,000
33.388889
78
0.581583
false
queer1/bitcurator
externals/py3fpdf/tutorial/tuto6.py
8
2389
from fpdf import * import re class PDF(FPDF): def __init__(self, orientation='P',unit='mm',format='A4'): #Call parent constructor FPDF.__init__(self,orientation,unit,format) #Initialization self.b=0 self.i=0 self.u=0 self.href='' self.page_links={} def write_html(self, html): #HTML pars...
gpl-3.0
8,108,825,958,047,700,000
22.653465
63
0.574299
false
spektom/incubator-airflow
airflow/migrations/versions/2e82aab8ef20_rename_user_table.py
7
1174
# # 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
6,736,824,641,403,685,000
28.35
62
0.752129
false
andreadelrio/bedrock
bedrock/mozorg/tests/test_decorators.py
45
1378
# 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/. import time from math import floor from django.test import RequestFactory from django.utils.http import parse_http_date...
mpl-2.0
-5,861,925,280,577,175,000
31.809524
75
0.648766
false
noironetworks/networking-cisco
networking_cisco/tests/base.py
2
1196
# -*- coding: utf-8 -*- # Copyright 2010-2011 OpenStack Foundation # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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 # # htt...
apache-2.0
8,957,687,956,446,248,000
28.170732
75
0.727425
false
wxkdesky/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/optparser.py
175
19377
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and...
bsd-3-clause
2,712,707,106,193,968,600
41.400438
118
0.622903
false
SimVascular/VTK
ThirdParty/Twisted/twisted/conch/test/test_insults.py
27
17887
# -*- test-case-name: twisted.conch.test.test_insults -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.test.proto_helpers import StringTransport from twisted.conch.insults.insults import ServerProtocol, ClientProtocol from twisted.conch.insult...
bsd-3-clause
-337,773,518,706,419,650
35.0625
104
0.616537
false
AdmiralNemo/ansible-modules-extras
system/alternatives.py
8
5401
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage symbolic link alternatives. (c) 2014, Gabe Mulley <gabe.mulley@gmail.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 S...
gpl-3.0
5,097,399,329,412,210,000
32.339506
123
0.614331
false
gregdek/ansible
lib/ansible/modules/network/aci/aci_epg.py
12
10462
#!/usr/bin/python # -*- coding: utf-8 -*- # 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': ['preview'], ...
gpl-3.0
6,057,483,131,562,388,000
26.174026
141
0.600076
false
guozhongxin/shadowsocks
shadowsocks/local.py
1015
2248
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2015 clowwindy # # 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 r...
apache-2.0
-8,999,709,761,849,014,000
30.222222
78
0.650356
false
cheza/ActivityDynamics
lib/network.py
1
23860
from __future__ import division from time import sleep from lib.util import * from config import config import math import random import numpy as np from numpy.lib.type_check import real, imag import datetime from graph_tool.all import * import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from r...
gpl-2.0
4,146,733,195,096,192,000
41.761649
136
0.569992
false
philippeback/urbit
outside/commonmark/man/make_man_page.py
23
3778
#!/usr/bin/env python # Creates a man page from a C file. # Comments beginning with `/**` are treated as Groff man, except that # 'this' is converted to \fIthis\fR, and ''this'' to \fBthis\fR. # Non-blank lines immediately following a man page comment are treated # as function signatures or examples and parsed into ...
mit
4,619,756,855,841,592,000
36.039216
161
0.518528
false
clovett/MissionPlanner
Lib/encodings/cp1258.py
93
13927
""" Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def d...
gpl-3.0
5,217,066,418,409,577,000
43.364821
119
0.529188
false
thombashi/typepy
docs/conf.py
1
5980
import os import sys import sphinx_rtd_theme from typepy import __author__, __copyright__, __name__, __version__ sys.path.insert(0, os.path.abspath('../typepy')) # -- General configuration ------------------------------------------------ # Add any Sphinx extension module names here, as strings. They can be # ext...
mit
-686,889,992,870,604,400
28.751244
112
0.648829
false
run2/citytour
4symantec/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py
2769
1967
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
1,203,505,830,306,728,200
35.425926
69
0.687341
false
ZenHarbinger/snapcraft
snapcraft/integrations/__init__.py
7
1763
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
7,309,220,205,975,057,000
32.264151
75
0.669881
false
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/boto/cloudsearch/sourceattribute.py
153
3156
# Copyright (c) 202 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 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 # "Software"), to deal in the Software without ...
mit
-4,519,906,756,001,287,700
41.648649
74
0.686946
false
sandeepgupta2k4/tensorflow
tensorflow/examples/benchmark/sample_benchmark.py
94
1605
# 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,684,058,946,779,763,000
31.1
80
0.653583
false
AfonsoFGarcia/swift
swift/common/middleware/list_endpoints.py
29
10059
# 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 to ...
apache-2.0
5,093,425,525,608,067,000
37.247148
79
0.626603
false
Jgarcia-IAS/Fidelizacion_odoo
openerp/extras/jasper_reports/JasperReports/JasperServer.py
2
4411
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. # http://www.NaN-tic.com # Copyright (C) 2013 Tadeus Prastowo <tadeus.prastowo@infi-nity.com> # Vi...
agpl-3.0
-4,841,828,315,225,069,000
38.035398
166
0.59669
false
2013Commons/HUE-SHARK
apps/oozie/src/oozie/migrations/0015_auto__add_field_dataset_advanced_start_instance__add_field_dataset_ins.py
39
24089
# encoding: 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): # Adding field 'Dataset.advanced_start_instance' db.add_column('oozie_dataset', 'advanced_start_instance', self.gf...
apache-2.0
1,985,949,521,486,942,700
75.473016
194
0.534186
false
idea4bsd/idea4bsd
python/lib/Lib/site-packages/django/contrib/localflavor/fr/fr_department.py
314
3326
# -*- coding: utf-8 -*- DEPARTMENT_ASCII_CHOICES = ( ('01', '01 - Ain'), ('02', '02 - Aisne'), ('03', '03 - Allier'), ('04', '04 - Alpes-de-Haute-Provence'), ('05', '05 - Hautes-Alpes'), ('06', '06 - Alpes-Maritimes'), ('07', '07 - Ardeche'), ('08', '08 - Ardennes'), ('09', '09 - Ar...
apache-2.0
5,197,315,587,399,114,000
29.236364
54
0.427841
false
lokI8/haas
haas/dev_support.py
3
1857
# Copyright 2013-2014 Massachusetts Open Cloud Contributors # # 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 applicab...
apache-2.0
-3,497,684,135,909,523,500
40.266667
76
0.686053
false
jaronson/googletest
scripts/upload_gtest.py
1963
2851
#!/usr/bin/env python # # Copyright 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...
bsd-3-clause
8,485,753,991,826,604,000
35.551282
72
0.727815
false
bobcyw/django
django/contrib/gis/db/backends/postgis/introspection.py
330
5441
from django.contrib.gis.gdal import OGRGeomType from django.db.backends.postgresql.introspection import DatabaseIntrospection class GeoIntrospectionError(Exception): pass class PostGISIntrospection(DatabaseIntrospection): # Reverse dictionary for PostGIS geometry types not populated until # introspectio...
bsd-3-clause
8,129,264,130,956,830,000
41.507813
95
0.582613
false
motion2015/a3
common/djangoapps/third_party_auth/tests/testutil.py
38
3875
""" Utilities for writing third_party_auth tests. Used by Django and non-Django tests; must not have Django deps. """ from contextlib import contextmanager import unittest import mock from third_party_auth import provider AUTH_FEATURES_KEY = 'ENABLE_THIRD_PARTY_AUTH' class FakeDjangoSettings(object): """A fa...
agpl-3.0
-3,371,552,657,916,452,000
31.563025
99
0.668903
false
oscar810429/mysql-5.6_facebook
xtrabackup/test/kewpie/lib/test_mgmt/test_management.py
22
11911
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2010 Patrick Crews # # 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 ...
gpl-2.0
-7,305,844,249,234,813,000
38.703333
119
0.582319
false
thruflo/ntorque
src/ntorque/work/requeue.py
1
3511
# -*- coding: utf-8 -*- """Provides ``RequeuePoller``, a utility that polls the db and add tasks to the queue. """ __all__ = [ 'RequeuePoller', ] import logging logger = logging.getLogger(__name__) import time import transaction from datetime import datetime from redis.exceptions import RedisError from sqlal...
unlicense
6,958,564,042,194,017,000
30.348214
82
0.59869
false
jacobraj/MAMA
site_scons/version_helper.py
15
1706
import os,re,posixpath ## Get the Module Versions # # Walk the project tree looking for VERSION.scons files. Read in these files # and parse the versions accordingly, generating versions which can help # facilitate building later. The dictionary is then passed to the environment # for easy access def get_project_vers...
lgpl-2.1
-8,966,528,124,624,635,000
31.807692
82
0.471278
false
gganis/root
interpreter/llvm/src/docs/conf.py
22
8481
# -*- coding: utf-8 -*- # # LLVM documentation build configuration file. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented...
lgpl-2.1
-2,629,782,856,322,310,700
32.521739
80
0.690838
false