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
LighthouseUK/koalacore
koalacore/config.py
1
2449
""" This configuration parser takes a platform argument and uses that for the sections of the config file i.e. Production, Development, Testing All you need to do is use the corresponding get methods for the data you need. The platform is automatically used where applicable. """ from __future__ import absolute_import ...
lgpl-3.0
8,982,907,238,179,946,000
36.676923
113
0.679053
false
isandlaTech/cohorte-demos
led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-1.0.0-20141201.234602-19-python-distribution/repo/sleekxmpp/features/feature_session/session.py
12
1398
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2011 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import logging from sleekxmpp.stanza import Iq, StreamFeatures from sleekxmpp.xmlstream import register_stanza_plugin from sleekxmpp.plugins im...
apache-2.0
5,106,323,120,280,622,000
24.888889
62
0.642346
false
zhukaixy/kbengine
kbe/res/scripts/common/Lib/distutils/tests/test_build_ext.py
71
18085
import sys import os from io import StringIO import textwrap from distutils.core import Distribution from distutils.command.build_ext import build_ext from distutils import sysconfig from distutils.tests.support import (TempdirManager, LoggingSilencer, copy_xxmodule_c, fixup_build_...
lgpl-3.0
3,797,777,132,041,692,700
36.059426
83
0.582195
false
AMICI-developer/AMICI
tests/generateTestConfig/example_calvetti.py
3
1029
#!/usr/bin/env python3 import sys import numpy as np from example import AmiciExample class ExampleCalvetti(AmiciExample): def __init__(self): AmiciExample.__init__( self ) self.numX = 6 self.numP = 0 self.numK = 6 self.modelOptions['theta'] = [] self.modelOption...
bsd-2-clause
-887,145,872,941,134,700
22.386364
76
0.592809
false
m000/cliutils
dotfiles/j2_tests.py
1
1327
# -*- coding: utf-8 -*- import os assert sys.version_info >= (2,5), "Need at least Python 2.5." if sys.version_info < (3,0): from shutilwhich import which else: from shutil import which ### Tests ########################################################### def exists(p): ''' Returns true if path p exists. ...
mit
4,960,320,225,315,289,000
26.645833
73
0.585531
false
varunkamra/kuma
vendor/packages/pygments/formatters/img.py
78
18002
# -*- coding: utf-8 -*- """ pygments.formatters.img ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for Pixmap output. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Formatter from pygments.util import ge...
mpl-2.0
1,930,199,049,884,242,200
31.146429
84
0.546828
false
xulesc/algos
knn/scripts/exp3.py
1
6922
# -*- coding: utf-8 -*- """ Created on Mon Jun 23 12:12:31 2014 @author: anuj """ print(__doc__) from time import time import numpy as np import pylab as pl from sklearn import metrics from sklearn.cluster import KMeans from sklearn.datasets import load_digits from sklearn.decomposition import PCA from sklearn.prep...
gpl-3.0
-6,247,069,177,228,122,000
35.819149
116
0.648223
false
w3nd1go/android_external_skia
tools/skp/page_sets/skia_theverge_desktop.py
26
1224
# 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
8,595,825,506,550,447,000
28.853659
74
0.703431
false
bewest/openxshareble
openxshareble/app.py
1
5980
import Adafruit_BluefruitLE from Adafruit_BluefruitLE.services import UART as OriginalUART # from ble import uart from ble.uart import UART from ble.readdata import Device import time import atexit import logging log = logging.getLogger(__name__) class App (object): """ A high level application object. Any appli...
mit
-5,777,387,970,777,378,000
36.848101
112
0.655518
false
imankulov/sentry
src/sentry/rules/base.py
15
3204
""" sentry.rules.base ~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. Rules apply either before an event gets stored, or immediately after. Basic actions: - I want to get notified when [X] - I want to group events when [X] - ...
bsd-3-clause
-1,254,140,393,992,291,000
25.92437
81
0.640449
false
will-cromar/needy
ProofOfConcept/toyNetwork.py
1
1982
class Neuron: 'Represents a neuron' currentVal = 0 threshold = 1 connections = [] identity = 0 def displayVal(self): print(self.identity,":",self.currentVal) for c in self.connections: print(self.identity," connected to ",c.end.identity) def addSynapse(self,desti...
mit
-801,217,288,847,883,000
25.44
78
0.608981
false
mantidproject/mantid
Framework/PythonInterface/test/python/plugins/functions/PrimStretchedExpFTTest.py
3
1898
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
gpl-3.0
2,611,006,478,260,727,000
39.382979
89
0.632244
false
Drooids/odoo
addons/mail/tests/test_mail_features.py
172
59265
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
-5,033,150,761,180,360,000
64.041712
175
0.61261
false
ofanoyi/sumatrapdf
scripts/gen_settings_html.py
1
9699
#!/usr/bin/env python import os, util2, gen_settingsstructs, trans_langs """ TODO: * for gen_langs_html, show languages that don't have enough translations in a separate table """ g_version = util2.get_sumatrapdf_version() html_tmpl = """\ <!doctype html> <html> <head> <meta http-equiv="Conten...
gpl-3.0
-9,178,916,788,926,531,000
28.214953
140
0.576864
false
CodeScaleInc/log4django
log4django/templatetags/log4django.py
1
1853
import json from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe from django.utils.text import normalize_newlines from ..models import LogRecord from ..settings import EXTRA_DATA_INDENT, PAGINATOR_RANGE register = template.Library() @reg...
bsd-3-clause
4,271,474,956,007,900,000
29.883333
96
0.685915
false
youdonghai/intellij-community
python/lib/Lib/site-packages/django/test/testcases.py
71
24716
import re import sys from urlparse import urlsplit, urlunsplit from xml.dom.minidom import parseString, Node from django.conf import settings from django.core import mail from django.core.management import call_command from django.core.urlresolvers import clear_url_caches from django.db import transaction, connection,...
apache-2.0
5,807,502,767,625,504,000
38.294118
116
0.579665
false
rnehra01/tanner
tanner/reporting/log_mongodb.py
1
1148
import json try: import pymongo MONGO = True except ImportError: MONGO = False from bson.objectid import ObjectId from gridfs import GridFS from tanner import config class Reporting(): def __init__(self): if MONGO: # Create the connection mongo_uri = config.TannerConfi...
gpl-3.0
2,444,609,451,415,730,700
25.72093
79
0.600174
false
dewtx29/python_ann
project/cg/opengl/cos4102/rectMoveTheta.py
1
2744
from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * window = 0 width, height = 500, 400 theta = [0.0] sign = [1.0] xMin = [-10.0] xMax = [10.0] yMin = [-10.0] yMax= [10.0] def initialization(): glClearColor(0.0,0.0,0.0,0.0) glMatrixMode(GL_...
gpl-3.0
-4,649,586,430,156,827,000
19.325926
55
0.494898
false
otherness-space/myProject
my_project_001/lib/python2.7/site-packages/django/db/models/fields/__init__.py
13
47949
from __future__ import unicode_literals import copy import datetime import decimal import math import warnings from itertools import tee from django.db import connection from django.db.models.query_utils import QueryWrapper from django.conf import settings from django import forms from django.core import exceptions, ...
mit
1,544,302,207,578,246,700
36.343458
83
0.59313
false
zaabjuda/django-vkontakte-groups-statistic
vkontakte_groups_statistic/migrations/0003_auto__add_field_groupstat_traffic_search_systems__add_field_groupstat_.py
1
27133
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'GroupStat.traffic_search_systems' db.add_column('vkontakte_groups_groupstat', 'traffic_searc...
bsd-3-clause
-3,150,960,748,678,707,000
79.041298
213
0.578742
false
ice9js/servo
tests/wpt/css-tests/css-fonts-3_dev/html/support/fonts/makegsubfonts.py
1616
14125
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
-6,827,572,882,166,484,000
28.063786
135
0.649628
false
tusharmakkar08/Diamond
src/diamond/handler/mysql.py
3
2933
# coding=utf-8 """ Insert the collected values into a mysql table """ from Handler import Handler import MySQLdb class MySQLHandler(Handler): """ Implements the abstract Handler class, sending data to a mysql table """ conn = None def __init__(self, config=None): """ Create a ne...
mit
-2,602,224,973,308,052,500
25.908257
78
0.506308
false
timpalpant/calibre
src/calibre/gui2/actions/show_quickview.py
14
3875
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from PyQt5.Qt import QAction from calibre.gui2.actions import InterfaceAction from calibre.gui2.dialogs.quickview import...
gpl-3.0
5,251,983,651,033,428,000
40.223404
96
0.633548
false
amyvmiwei/kbengine
kbe/src/lib/python/Lib/test/test_decorators.py
182
9828
import unittest from test import support def funcattrs(**kwds): def decorate(func): func.__dict__.update(kwds) return func return decorate class MiscDecorators (object): @staticmethod def author(name): def decorate(func): func.__dict__['author'] = name r...
lgpl-3.0
2,148,118,671,515,291,600
30.805825
98
0.529406
false
trdean/grEME
grc/python/expr_utils.py
7
5486
""" Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any l...
gpl-3.0
6,109,285,493,461,117,000
29.99435
95
0.633431
false
cryptobanana/ansible
lib/ansible/modules/network/cloudengine/ce_vxlan_arp.py
22
24179
#!/usr/bin/python # # 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 distribut...
gpl-3.0
-4,251,261,156,965,559,300
34.246356
106
0.563588
false
vipulroxx/sympy
sympy/liealgebras/type_e.py
4
9860
from sympy.core import Rational from sympy.core.compatibility import range from .cartan_type import Standard_Cartan from sympy.matrices import eye class TypeE(Standard_Cartan): def __new__(cls, n): if n < 6 or n > 8: raise ValueError("Invalid value of n") return Standard_Cartan.__new_...
bsd-3-clause
691,532,899,652,707,100
33.355401
99
0.341886
false
TinyOS-Camp/DDEA-DEV
Archive/[14_10_11] Dr_Jung_Update/shared_constants.py
1
3460
# -*- coding: utf-8 -*- """ Created on Fri Mar 14 02:04:12 2014 @author: deokwoo * Description - This file defines constant values shared among python modules. - Should be included all python modules first. """ ############################################################################### # Constant global variab...
gpl-2.0
-4,760,140,127,857,824,000
33.959596
122
0.633526
false
Denisolt/IEEE-NYIT-MA
local/lib/python2.7/site-packages/django/db/models/sql/aggregates.py
77
4846
""" Classes to represent the default SQL aggregate functions """ import copy import warnings from django.db.models.fields import FloatField, IntegerField from django.db.models.query_utils import RegisterLookupMixin from django.utils.deprecation import RemovedInDjango110Warning from django.utils.functional import cache...
gpl-3.0
1,755,255,112,814,422,300
30.264516
91
0.627115
false
TRESCLOUD/odoo
openerp/addons/base/ir/ir_ui_menu.py
58
17374
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP SA (<http://openerp.com>). # # This program is free software: you can ...
agpl-3.0
3,871,050,278,813,709,000
43.321429
199
0.544262
false
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/offline_user_data_job_service/transports/grpc.py
1
16240
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-5,768,659,833,520,609,000
45.267806
120
0.623214
false
aurarad/auroracoin
test/functional/feature_dersig.py
1
6371
#!/usr/bin/env python3 # Copyright (c) 2009-2019 The Bitcoin Core developers # Copyright (c) 2014-2019 The DigiByte Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test BIP66 (DER SIG). Test that the DERSIG soft...
mit
4,940,157,119,081,665,000
41.473333
183
0.648407
false
bbangert/velruse
velruse/providers/yahoo.py
3
3776
from __future__ import absolute_import from openid.extensions import ax import requests from requests_oauthlib import OAuth1 from pyramid.security import NO_PERMISSION_REQUIRED from ..api import register_provider from ..compat import parse_qsl from .oid_extensions import OAuthRequest from .openid import ( Open...
mit
4,376,776,380,193,603,600
32.122807
77
0.605932
false
tow/dnspython
dns/namedict.py
99
2106
# Copyright (C) 2003-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 "...
isc
-5,176,188,284,169,628,000
34.694915
72
0.648623
false
ninuxorg/netengine
netengine/backends/ssh/airos.py
1
5763
from cached_property import cached_property from netengine.backends.ssh import SSH __all__ = ['AirOS'] class AirOS(SSH): """ Ubiquiti AirOS SSH backend Version 5.5.8 """ def __str__(self): """ print a human readable object description """ return u"<SSH (Ubiquity AirOS): %s@%s>"...
mit
-3,169,432,203,465,434,000
29.015625
77
0.516051
false
jiumx60rus/grishyGhost
node_modules/nodegit/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
388
47235
# 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. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import os import re import subprocess import sys fr...
mit
-3,786,306,663,090,686,000
42.857939
80
0.657817
false
alexston/calibre-webserver
src/odf/meta.py
98
2136
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # 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 you...
gpl-3.0
5,097,257,572,925,608,000
31.348485
80
0.708665
false
ecederstrand/django
tests/template_tests/syntax_tests/test_if.py
73
23743
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import TestObj, setup class IfTagTests(SimpleTestCase): @setup({'if-tag01': '{% if foo %}yes{% else %}no{% endif %}'}) def test_if_tag01(self): output = self.engine.render_to_string('if-tag01', {'foo'...
bsd-3-clause
886,110,714,126,005,500
43.882798
105
0.574696
false
RenqinCai/python_dataset
LR/shuffle_v8.py
2
13109
###new function:shuffling the reviewing time and debug the program ###R is set to a constant value import simplejson as json import datetime import time import numpy as np import math from multiprocessing import Pool from multiprocessing.dummy import Pool as ThreadPool from dateutil.relativedelta import * from sklearn...
gpl-2.0
7,831,754,431,706,486,000
28.131111
135
0.731101
false
kohnle-lernmodule/exeLearningPlus1_04
twisted/internet/posixbase.py
14
15431
# -*- test-case-name: twisted.test.test_internet -*- # $Id: default.py,v 1.90 2004/01/06 22:35:22 warner Exp $ # # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """Posix reactor base class API Stability: stable Maintainer: U{Itamar Shtull-Trauring<mailto:twisted@itamarst.org>} """ ...
gpl-2.0
6,491,614,993,888,082,000
32.472885
108
0.623809
false
adazey/Muzez
libs/youtube_dl/extractor/cracked.py
170
3213
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_iso8601, str_to_int, ) class CrackedIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?cracked\.com/video_(?P<id>\d+)_[\da-z-]+\.html' _TESTS = [{ 'url': 'http://www.cracked.com/...
gpl-3.0
5,546,044,954,490,807,000
34.307692
111
0.516651
false
aadebuger/docker-apprtc
src/third_party/oauth2client/anyjson.py
302
1044
# Copyright (C) 2010 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 agreed to in writ...
bsd-3-clause
2,524,516,898,203,198,000
31.625
74
0.744253
false
Fedik/gramps
gramps/gen/filters/rules/repository/_hasreferencecountof.py
5
1737
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2007 Stephane Charette # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your optio...
gpl-2.0
-3,611,541,252,253,918,000
38.477273
79
0.561313
false
gtko/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/brightcove.py
4
10498
# encoding: utf-8 from __future__ import unicode_literals import re import json import xml.etree.ElementTree from .common import InfoExtractor from ..utils import ( compat_urllib_parse, find_xpath_attr, fix_xml_ampersands, compat_urlparse, compat_str, compat_urllib_request, compat_parse_qs...
gpl-3.0
5,925,626,176,430,747,000
40.800797
193
0.569863
false
ilyashrn/ilyashrn.github.io
node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/dotnet.py
197
26727
# -*- coding: utf-8 -*- """ pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ...
mit
47,234,803,839,739,560
38.831595
84
0.447375
false
ZubairLK/CI20_linux
tools/perf/scripts/python/sched-migration.py
1910
11965
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
4,787,123,094,976,010,000
25.01087
88
0.679733
false
flumotion-mirror/flumotion
flumotion/test/test_flavors.py
3
15234
# -*- Mode: Python; test-case-name: flumotion.test.test_flavors -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified un...
lgpl-2.1
-7,720,369,496,067,587,000
33.310811
78
0.604897
false
narurien/ganeti-ceph
lib/__init__.py
8
1196
# # # Copyright (C) 2006, 2007, 2012 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is ...
gpl-2.0
7,883,533,817,714,225,000
34.176471
78
0.720736
false
herilalaina/scikit-learn
sklearn/learning_curve.py
27
15421
"""Utilities to evaluate models with respect to a variable """ # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import warnings import numpy as np from .base import is_classifier, clone from .cross_validation import check_cv from .externals.joblib import Parallel, delayed fro...
bsd-3-clause
8,882,318,032,998,034,000
41.836111
79
0.640814
false
mateusz-holenko/gf
utils.py
1
1321
#!/usr/bin/python3 import codecs ########################################################################################################## # # # Based on: ...
mit
-4,922,440,124,433,611,000
39.030303
106
0.348221
false
f-enye/Lister
Lister/forms.py
1
1160
from flask.ext.wtf import Form from wtforms import TextField, PasswordField, BooleanField, IntegerField from wtforms.validators import Required, Email, EqualTo class LoginForm(Form): user_name = TextField('user_name', validators = [Required(), Email(message=u'Invalid email address')]) #Not an encrypted password pas...
mit
4,811,601,060,408,015,000
42
125
0.738793
false
akosthekiss/fuzzinator
tests/resources/mock_tool.py
2
1955
#!/usr/bin/env python3 # Copyright (c) 2016 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import argparse import os import signal import ...
bsd-3-clause
7,403,249,259,583,787,000
35.203704
105
0.623529
false
oesteban/tract_querier
tract_querier/tractography/trackvis.py
1
3309
from itertools import izip from warnings import warn import numpy from tractography import Tractography from nibabel import trackvis def tractography_to_trackvis_file(filename, tractography, affine=None, image_dimensions=None): trk_header = trackvis.empty_header() if affine is not None: pass e...
bsd-3-clause
-6,762,158,326,531,147,000
29.638889
94
0.570565
false
gangadharkadam/verveerp
erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py
6
1220
# 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 import _ from frappe.utils import flt from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, ...
agpl-3.0
-326,651,965,682,978,940
31.105263
98
0.727049
false
crdx/face
module.py
1
2271
import traceback import imp class Module(): def __init__(self, module_filename): # the filename e.g. mod_list.py self.filename = module_filename # the filename without extension self.name = module_filename[:-3] # start marked as unloaded, so this will hold true if anything...
mit
-4,608,306,803,859,073,000
32.895522
89
0.563628
false
kuangtu/OpenMAMA
mama/c_cpp/src/regression/c_cpp/scripts/regression.py
11
1631
#!/usr/bin/python import unittest import optparse from common import check_env from regressionc import TestOpenmamac from regressioncpp import TestOpenmamacpp import globals if __name__ == '__main__': parser = optparse.OptionParser() parser.add_option("--tport", dest="transport",nargs=2,help='Name of pub and...
lgpl-2.1
8,499,315,104,238,466,000
38.780488
132
0.692826
false
sio2project/sioworkers
sio/workers/util.py
1
8159
from __future__ import absolute_import from contextlib import contextmanager import pkg_resources import time import logging import stat import os import json import tempfile import shutil import threading import six logger = logging.getLogger(__name__) def first_entry_point(group, name=None): for ep in pkg_reso...
gpl-3.0
2,986,877,489,215,617,500
26.657627
82
0.585611
false
guorendong/iridium-browser-ubuntu
tools/perf/page_sets/mse_cases.py
11
2033
# 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class MseCasesPage(page_module.Page): def __init__(...
bsd-3-clause
-5,869,827,624,236,792,000
42.255319
104
0.719626
false
quom/google-cloud-python
speech/unit_tests/test_operation.py
3
4075
# Copyright 2016 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 agreed to in writing, ...
apache-2.0
7,644,044,069,742,198,000
34.434783
74
0.644663
false
andrewjrobinson/FreeCAD_sf_master
src/Mod/Web/Init.py
3
2471
# FreeCAD init script of the Web module # (c) 2001 Juergen Riegel #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@web.de) 2002 * #* * #* This f...
lgpl-2.1
2,400,063,932,515,068,400
50.574468
80
0.460138
false
wcybxzj/django_xadmin17
demo_app/polls/models.py
1
1814
import datetime from django.db import models from django.utils import timezone from django.contrib.auth.models import User class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __str__(self): # __unicode__ on Pytho...
bsd-3-clause
5,847,153,851,304,024,000
28.274194
71
0.644432
false
redhat-openstack/manila
manila/api/auth.py
4
1414
# Copyright (c) 2013 OpenStack, LLC. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
3,575,692,297,736,211,000
37.216216
78
0.69024
false
joone/chromium-crosswalk
tools/metrics/histograms/print_style.py
25
1809
# 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. """Holds the constants for pretty printing histograms.xml.""" import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))...
bsd-3-clause
6,914,631,645,876,960,000
29.661017
80
0.635158
false
citrix-openstack-build/nova
nova/api/openstack/compute/contrib/volumes.py
11
24507
# Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
-7,660,357,670,572,134,000
32.943213
79
0.599869
false
aetilley/scikit-learn
sklearn/datasets/samples_generator.py
45
56433
""" Generate samples of synthetic data sets. """ # Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel, # G. Louppe, J. Nothman # License: BSD 3 clause import numbers import warnings import array import numpy as np from scipy import linalg import scipy.sparse as sp from ..preprocessing impo...
bsd-3-clause
7,597,670,310,769,805,000
33.326642
79
0.616714
false
timsnyder/bokeh
tests/integration/tools/test_poly_draw_tool.py
5
9020
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
bsd-3-clause
-434,002,051,971,621,700
36.119342
118
0.575942
false
selpp/TidmarshCWD
src/web/website/settings.py
1
3708
""" Django settings for website project. Generated by 'django-admin startproject' using Django 1.11.6. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os...
gpl-3.0
-9,157,656,981,170,509,000
24.22449
91
0.666127
false
leilihh/nova
nova/db/sqlalchemy/migrate_repo/versions/228_add_metrics_in_compute_nodes.py
47
1583
# Copyright 2013 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
3,904,094,944,710,098,400
34.977273
78
0.727732
false
addgene/research
toolkit/utils.py
1
1283
import argparse import logging import os import sys from Bio import SeqIO from setuptools import glob L = logging.getLogger(__name__) def read_fastq_file(file_name): # type: (str) -> List[str] reads = [] with open(file_name, "rU") as handle: for record in SeqIO.parse(handle, "fastq"): ...
gpl-3.0
8,681,008,888,895,365,000
25.204082
100
0.654716
false
tom31203120/POSTMan-Chrome-Extension
tests/selenium/pmtests/postman_tests_layout.py
104
1075
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.select import Select from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys import selenium.webdriver.chrome.service as service import inspect ...
apache-2.0
-3,393,964,256,090,353,000
33.677419
74
0.67907
false
jmetzen/scikit-learn
examples/linear_model/plot_logistic.py
312
1426
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logit function ========================================================= Show in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or two, u...
bsd-3-clause
-6,200,865,334,653,854,000
20.938462
66
0.614306
false
hoxmark/TDT4501-Specialization-Project
vse/data.py
1
13775
import torch import torch.utils.data as data import torchvision.transforms as transforms import os import nltk from PIL import Image # from pycocotools.coco import COCO import numpy as np import json as jsonmod def get_paths(path, name='coco', use_restval=False): """ Returns paths to images and annotations fo...
mit
-8,470,512,414,975,171,000
37.370474
79
0.531543
false
olivierdalang/stdm
data/importexport/writer.py
1
5017
#begin: 26th March 2012 #copyright: (c) 2012 by John Gitau #email: gkahiu@gmail.com #about: Wrapper class for writing PostgreSQL/PostGIS tables to user-defined OGR formats import sys, logging from PyQt4.QtCore import * from PyQt4.QtGui import * try: from osgeo i...
gpl-2.0
8,475,736,998,902,070,000
31.019737
119
0.484353
false
docprofsky/gr-rds
python/rdspanel.py
2
7742
# -*- coding: UTF-8 -*- import wx import pmt from gnuradio import gr, blocks wxDATA_EVENT = wx.NewEventType() def EVT_DATA_EVENT(win, func): win.Connect(-1, -1, wxDATA_EVENT, func) class DataEvent(wx.PyEvent): def __init__(self, data): wx.PyEvent.__init__(self) self.SetEventType (wxDATA_EVENT) self.data = da...
gpl-2.0
5,637,691,268,546,287,000
33.717489
75
0.690519
false
terasaur/seedbank
src/seedbank/cli/create_command.py
1
3141
# # Copyright 2012 ibiblio # # 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.txt # # Unless required by applicable law or agreed to in writing...
apache-2.0
-1,144,621,993,123,599,500
34.292135
79
0.625597
false
museumvictoria/nodel-recipes
Group/script.py
2
14096
'''A node that groups members for control propagation and status monitoring - see script.py for notes''' # For disappearing member support: # (see readme, requires at least Nodel Host rev. 322 or later) # # - remote "Disappearing" signals should be wired to the actual signals # - the usual remote signals shou...
mit
1,293,657,446,865,031,400
39.739884
235
0.647134
false
NoahFlowa/glowing-spoon
venv/lib/python2.7/site-packages/pip/commands/hash.py
514
1597
from __future__ import absolute_import import hashlib import logging import sys from pip.basecommand import Command from pip.status_codes import ERROR from pip.utils import read_chunks from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES logger = logging.getLogger(__name__) class HashCommand(Command): ""...
apache-2.0
9,102,590,725,559,541,000
27.017544
73
0.599875
false
colloquium/spacewalk
client/tools/rhncfg/config_management/rhncfg-manager.py
1
1362
#!/usr/bin/python # # Copyright (c) 2008 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have ...
gpl-2.0
-458,780,216,665,991,900
26.24
73
0.643906
false
rpspringuel/cluster
stats.py
1
24321
"""Cluster _support which are method independant. Routines which calculate _support for data and clustering results. _support in this package do not care what the particluar clustering methodology is. A complete version history and licence and copyright information are located in the source code. """ import numpy fr...
bsd-3-clause
-4,286,703,930,995,231,000
44.975425
102
0.629867
false
googleapis/python-dialogflow
google/cloud/dialogflow_v2beta1/types/document.py
1
16280
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-2,505,329,625,319,576,600
39.197531
121
0.656388
false
emonty/ansible
test/units/playbook/test_playbook.py
58
2089
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
-3,941,936,610,408,545,000
33.245902
94
0.661082
false
home-assistant/home-assistant
homeassistant/components/shelly/logbook.py
8
1069
"""Describe Shelly logbook events.""" from homeassistant.const import ATTR_DEVICE_ID from homeassistant.core import callback from .const import ( ATTR_CHANNEL, ATTR_CLICK_TYPE, ATTR_DEVICE, DOMAIN, EVENT_SHELLY_CLICK, ) from .utils import get_device_name, get_device_wrapper @callback def async_d...
apache-2.0
-3,139,449,943,533,126,000
27.891892
100
0.652011
false
alexsmx/djangoAppengineSrcTemplate
django/contrib/messages/storage/session.py
456
1213
from django.contrib.messages.storage.base import BaseStorage class SessionStorage(BaseStorage): """ Stores messages in the session (that is, django.contrib.sessions). """ session_key = '_messages' def __init__(self, request, *args, **kwargs): assert hasattr(request, 'session'), "The sessi...
bsd-3-clause
-2,354,885,119,528,291,300
35.757576
78
0.620775
false
onecloud/neutron
neutron/plugins/ml2/db.py
13
5143
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
-7,846,316,465,486,387,000
36.816176
79
0.616955
false
i-DAT-Qualia/Qualia-AC
qualia/tools/api.py
3
1406
from tastypie.serializers import Serializer from tastypie.authentication import Authentication from tastypie.http import HttpUnauthorized from django.utils.timezone import is_naive class ISOSerializer(Serializer): """ Our own serializer to format datetimes in ISO 8601 but with timezone offset. """ ...
gpl-3.0
7,908,463,362,962,133,000
29.586957
72
0.622333
false
andreaso/ansible
lib/ansible/utils/module_docs_fragments/aws.py
135
3168
# (c) 2014, Will Thames <will@thames.id.au> # # 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...
gpl-3.0
-7,619,411,816,202,523,000
38.111111
143
0.697285
false
tenvick/hugula
Client/tools/site-packages/PIL/BufrStubImagePlugin.py
14
1548
# # The Python Imaging Library # $Id: BufrStubImagePlugin.py 2134 2004-10-06 08:55:20Z fredrik $ # # BUFR stub adapter # # Copyright (c) 1996-2003 by Fredrik Lundh # # See the README file for information on usage and redistribution. # import Image, ImageFile _handler = None ## # Install application-specific BUFR ima...
mit
946,857,316,286,926,600
21.764706
73
0.597545
false
ray-zhong/github_trend_spider
ENV/Lib/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py
360
2852
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager imp...
mit
6,994,113,337,796,225,000
28.708333
84
0.719144
false
mulkieran/justbytes
src/justbytes/_constants.py
1
4224
# Copyright (C) 2015 - 2019 Red Hat, Inc. # # 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 any later version. # # This library is distributed in t...
gpl-2.0
8,119,109,462,130,799,000
25.4
81
0.611742
false
akaminsky/ghost_blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_lassobuiltins.py
293
130675
# -*- coding: utf-8 -*- """ pygments.lexers._lassobuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Built-in Lasso types, traits, methods, and members. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ BUILTINS = { 'Types': [ 'null', ...
mit
-3,760,406,231,728,194,000
24.265855
70
0.493369
false
sbuss/voteswap
lib/django/templatetags/l10n.py
337
1735
from django.template import Library, Node, TemplateSyntaxError from django.utils import formats from django.utils.encoding import force_text register = Library() @register.filter(is_safe=False) def localize(value): """ Forces a value to be rendered as a localized value, regardless of the value of ``setti...
mit
2,824,667,929,690,543,600
26.109375
82
0.632277
false
PyBorg/PyBorg
pyborg-msnp.py
3
4812
#! /usr/bin/env python # # PyBorg MSN module # # Copyright (c) 2006 Sebastien Dailly # # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) an...
gpl-2.0
1,246,532,129,342,823,000
27.642857
105
0.672901
false
zhangxiaolins/python_base
tests/test_notifier.py
2
12210
# Copyright 2011 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 req...
apache-2.0
6,776,317,366,234,459,000
35.447761
78
0.599017
false
molobrakos/home-assistant
homeassistant/components/zwave/cover.py
8
6283
"""Support for Z-Wave covers.""" import logging from homeassistant.core import callback from homeassistant.components.cover import ( DOMAIN, SUPPORT_OPEN, SUPPORT_CLOSE, ATTR_POSITION) from homeassistant.components.cover import CoverDevice from homeassistant.helpers.dispatcher import async_dispatcher_connect from ....
apache-2.0
4,874,898,263,248,677,000
32.77957
77
0.636161
false
ThinkingBridge/platform_external_chromium_org
media/tools/bug_hunter/bug_hunter_unittest.py
47
6473
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit Tests for bug hunter.""" import logging from optparse import Values import smtplib import sys import unittest from bug_hunter import BugHunter ...
bsd-3-clause
-3,044,106,016,738,337,300
34.565934
80
0.630156
false
wanghongjuan/crosswalk-test-suite
webapi/webapi-iap-xwalk-tests/inst.apk.py
1996
3186
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
bsd-3-clause
1,980,234,993,638,683,000
28.775701
92
0.54457
false
filterfoundry/django-mailer
django_mailer/management/commands/retry_deferred.py
31
1131
from django.core.management.base import NoArgsCommand from django_mailer import models from django_mailer.management.commands import create_handler from optparse import make_option import logging class Command(NoArgsCommand): help = 'Place deferred messages back in the queue.' option_list = NoArgsCommand.opti...
mit
6,898,434,033,276,580
39.392857
76
0.642794
false
Reagankm/KnockKnock
venv/lib/python3.4/site-packages/mpl_toolkits/mplot3d/art3d.py
8
23462
#!/usr/bin/python # art3d.py, original mplot3d version by John Porter # Parts rewritten by Reinier Heeres <reinier@heeres.eu> # Minor additions by Ben Axelrod <baxelrod@coroware.com> ''' Module containing 3D artist code and functions to convert 2D artists into 3D versions which can be added to an Axes3D. ''' from __fu...
gpl-2.0
-7,040,686,215,300,797,000
31.228022
89
0.579618
false
flotre/Sick-Beard
sickbeard/providers/xthor.py
8
9852
# -*- coding: latin-1 -*- # Author: Raver2046 <raver2046@gmail.com> # based on tpi.py # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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
2,272,520,082,890,294,500
46.815534
169
0.574518
false
mgedmin/cloneall
ghcloneall.py
1
36053
#!/usr/bin/python3 """ Clone all Git repositories for a GitHub user or organisation. """ from __future__ import print_function import argparse import fnmatch import os import subprocess import sys import threading from concurrent import futures from operator import attrgetter try: # Python 2 from ConfigPars...
mit
-8,850,432,707,497,072,000
36.0154
79
0.574599
false