repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
maria-msu-seclab/mpotrDevelopment
libraries/dbus-python-1.2.0/test/test-signals.py
1
6184
#!/usr/bin/env python # Copyright (C) 2004 Red Hat Inc. <http://www.redhat.com/> # Copyright (C) 2005-2007 Collabora Ltd. <http://www.collabora.co.uk/> # # 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 t...
gpl-2.0
-5,020,675,400,546,335,000
36.93865
105
0.654754
false
3.860175
true
false
false
sergiohr/NeuroDB
test/test_nodos.py
1
7625
''' Created on Apr 5, 2015 @author: sergio ''' import numpy as np import ctypes import numpy.ctypeslib as npct import matplotlib.pyplot as plt import psycopg2 import time import neurodb.neodb.core from math import e, pow from scipy.optimize import leastsq import neurodb import random from sklearn.cluster import KMeans...
gpl-3.0
-619,141,681,476,917,100
30.508264
137
0.582951
false
3.094562
false
false
false
dandanvidi/catalytic-rates
scripts/get_data_subunits_composition.py
1
1713
from bs4 import BeautifulSoup import pandas as pd from scripts.kapp import CACHABLE import urllib C = CACHABLE() reactions = C.map_model_reaction_to_genes().set_index(0) genes = {row[0:5]:row[56:63] for row in open('data/all_ecoli_genes.txt', 'r') if row[0:5] in reactions.valu...
mit
7,014,327,657,803,190,000
21.25974
87
0.502627
false
3.137363
false
false
false
Silvenga/LinuxScripts
solusvm/emailed-status.py
1
5038
#!/usr/bin/env python ###################################################################### # # Email Status of SolusVM VPS's # Designed as a Cron script # ###################################################################### # # Example # #Node0 # bw: # 15.5GB/1.0TB # [#---------------------------------...
gpl-2.0
-8,179,583,440,252,265,000
25.239583
101
0.462485
false
3.275683
false
false
false
eonpatapon/nova
nova/api/openstack/__init__.py
18
17376
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
apache-2.0
-6,131,045,606,676,235,000
38.312217
79
0.587132
false
4.500389
true
false
false
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/relay/testing/mlp.py
2
2916
# 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
4,633,262,919,590,435,000
30.021277
74
0.64369
false
3.71465
false
false
false
Starch/paperwork
src/paperwork/frontend/util/canvas/animators.py
3
3783
# Paperwork - Using OCR to grep dead trees the easy way # Copyright (C) 2014 Jerome Flesch # # Paperwork 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 # ...
gpl-3.0
8,807,668,755,939,996,000
33.706422
74
0.595559
false
3.760437
false
false
false
daviddoria/itkHoughTransform
Wrapping/WrapITK/Languages/SwigInterface/pygccxml-1.0.0/pygccxml/declarations/container_traits.py
13
20892
# Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) """ defines few algorithms, that deals with different properties of std containers """ import types import string import calld...
apache-2.0
8,086,877,949,867,987,000
42.076289
171
0.531543
false
4.150179
false
false
false
mcfletch/AutobahnPython
examples/twisted/wamp/auth/persona/server.py
7
9085
############################################################################### ## ## Copyright (C) 2011-2014 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
-6,196,339,740,024,204,000
29.901361
141
0.628398
false
4.255269
false
false
false
Pakketeretet2/lammps
python/lammps.py
1
38678
# ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator # http://lammps.sandia.gov, Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # # Copyright (2003) Sandia Corporation. Under the terms of Contract # DE...
gpl-2.0
8,843,681,301,166,624,000
31.917447
165
0.60939
false
3.292866
false
false
false
datalogics/scons
test/Errors/preparation.py
2
2136
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, copy, modify, merge, publish, ...
mit
-6,140,333,870,987,321,000
30.880597
73
0.711142
false
3.753954
true
false
false
duncant/stupid_python_tricks
primes.py
1
8937
# This file is part of stupid_python_tricks written by Duncan Townsend. # # stupid_python_tricks 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, or (at your # option) an...
lgpl-3.0
2,632,453,963,812,360,700
32.347015
107
0.511805
false
4.164492
false
false
false
gangadhar-kadam/sapphire_app
accounts/doctype/shipping_rule/test_shipping_rule.py
1
2126
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt import webnotes import unittest from accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, OverlappingConditionError class TestShippingRule(unittest.TestCase):...
agpl-3.0
-1,303,449,078,409,612,000
29.385714
130
0.674036
false
2.940526
true
false
false
zstars/weblabdeusto
experiments/unmanaged/vm_services/unix_passwd/launch.py
4
2236
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- # # Copyright (C) 2005-2009 University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individuals, ...
bsd-2-clause
-8,197,825,213,115,346,000
29.616438
97
0.600447
false
3.907343
false
false
false
NORDUnet/niscanner
ni_scanner.py
1
1971
from configparser import ConfigParser from utils.cli import CLI from api.queue import Queue from api.nerds import NerdsApi from scanner.host import HostScanner from scanner.exceptions import ScannerExeption from utils.url import url_concat import logging FORMAT = '%(name)s - %(levelname)s - %(message)s' logging.basicC...
bsd-3-clause
-1,758,669,678,059,107,800
28.41791
81
0.593607
false
3.60989
true
false
false
onedata/web-client
bamboos/docker/environment/docker.py
1
6982
# coding=utf-8 """Author: Konrad Zemek Copyright (C) 2015 ACK CYFRONET AGH This software is released under the MIT license cited in 'LICENSE.txt' Functions wrapping capabilities of docker binary. """ import json import os import subprocess import sys # noinspection PyDefaultArgument def run(image, docker_host=None,...
mit
4,307,532,115,299,974,000
25.24812
86
0.589229
false
3.755783
false
false
false
youlanhai/directory_cache
gen_dir_list.py
1
1422
# -*- coding: utf-8 -*- import os import sys import struct USAGE = """ python gen_dir_list.py src_path [dst_path] """ def usage(): print USAGE def format_path(path): if len(path) == 0: return "./" path = path.replace('\\', '/') if path[-1] != '/': path += '/' return path def list_all_files(path): ret = [] ...
mit
8,937,673,335,269,717,000
17.710526
58
0.635021
false
2.729367
false
false
false
pojdrovic/Miscellaneous_Files
sentiment_price.py
1
5415
import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages import datetime import csv from numpy import * from scipy.stats.kde import gaussian_kde import os ############################## # Petar Ojdrovic ############################## # parses sentiment data # compares with underlying prices...
apache-2.0
-7,030,200,346,733,347,000
36.611111
97
0.618283
false
2.464725
false
false
false
pandegroup/vs-utils
vs_utils/utils/rdkit_utils/tests/test_conformers.py
2
4580
""" Tests for conformers.py. """ import numpy as np import unittest from rdkit import Chem from vs_utils.utils.rdkit_utils import conformers class TestConformerGenerator(unittest.TestCase): """ Tests for ConformerGenerator. """ def setUp(self): """ Set up tests. """ a...
gpl-3.0
-8,888,732,276,072,261,000
33.69697
74
0.641048
false
3.788255
true
false
false
tonygalmiche/is_mrp
wizard/generate_previsions.py
1
30993
# -*- coding: utf-8 -*- import time import datetime from openerp.osv import fields, osv from openerp.tools.translate import _ from openerp import netsvc class mrp_generate_previsions(osv.osv_memory): _name = "mrp.previsions.generate" _description = "Generate previsions" _columns = { ...
lgpl-3.0
-4,707,348,792,026,300,000
50.4
219
0.478328
false
4.033925
false
false
false
USGSDenverPychron/pychron
pychron/dvc/dvc.py
1
41939
# =============================================================================== # Copyright 2015 Jake Ross # # 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
502,340,480,352,728,260
35.853251
120
0.557023
false
3.910032
false
false
false
alfa-addon/addon
plugin.video.alfa/channels/pornxbit.py
1
4893
# -*- coding: utf-8 -*- #------------------------------------------------------------ import sys PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int if PY3: import urllib.parse as urlparse # Es muy lento en PY2. En PY3 es nativo else: import...
gpl-3.0
-1,498,140,840,486,068,000
36.899225
130
0.608713
false
3.426069
false
false
false
rnowotniak/qclib
gpent3.py
1
7110
#!/usr/bin/python # # Genetic Programming algorithm for for evolving # 3-qubit entanglement production quantum circuit # # Copyright (C) 2006 Robert Nowotniak <rnowotniak@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
gpl-3.0
8,001,447,439,096,344,000
28.625
108
0.533333
false
3.535554
false
false
false
Trion/nightsky
client/Communicator.py
1
3683
""" Communication class """ import sys import glob import serial import time class Communicator: """ Class that's responsible for communication with the arduino """ class CommunicationFaultException(Exception): """ Exception for communication problems """ def __init__...
mit
-2,156,457,496,349,875,000
27.550388
79
0.537877
false
4.475091
false
false
false
nardorb/OneStop
handlers/editor.py
1
3213
from webapp2_extras import security from handlers import base from library import messages from models.profile import Profile from forms.profile import ProfileForm from forms.profile_update import ProfileUpdateForm class EditorHandler(base.BaseHandler): def create(self): form = ProfileForm(self.request.POST) ...
gpl-2.0
-8,371,113,525,092,969,000
32.123711
77
0.626517
false
3.705882
false
false
false
odoo-turkiye/odoo
addons/l10n_tr/res_partner.py
1
1403
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013-2014 7Gates Interactive Technologies # <http://www.7gates.co> # @author Erdem Uney # # This program is free software: you can redistribute it an...
agpl-3.0
8,542,456,350,436,746,000
40.294118
99
0.597292
false
4.200599
false
false
false
qilicun/python
python2/diveintopythonzh-cn-5.4b/roman/stage2/roman2.py
4
1300
"""Convert to and from Roman numerals This program is part of "Dive Into Python", a free Python book for experienced programmers. Visit http://diveintopython.org/ for the latest version. """ __author__ = "Mark Pilgrim (mark@diveintopython.org)" __version__ = "$Revision: 1.2 $" __date__ = "$Date: 2004/05/05 21:57:20 ...
gpl-3.0
6,807,275,561,479,470,000
27.26087
66
0.52
false
3.68272
false
false
false
anatolikalysch/VMAttack
setup.py
1
1739
# coding=utf-8 __author__ = 'Anatoli Kalysch' import pip import sys from os import getcwd, system, remove from shutil import copyfile def do(action, dependency): return pip.main([action, dependency]) def usage(): print "Usage: python setup.py <install | uninstall>" dependencies = ["distorm3", 'idacute'] ...
mit
2,384,027,443,882,719,000
27.048387
101
0.570443
false
3.772234
false
false
false
janol77/flask-app
app/modules/user/models.py
2
1267
from app.db import db from werkzeug import generate_password_hash from libs.tools import code_generator class User(db.Document): name = db.StringField(required=True) state = db.StringField(required=True) code = db.StringField(required=True) active = db.BooleanField(required=True, default=True) pas...
gpl-3.0
185,565,925,932,048,540
31.487179
77
0.66693
false
4.251678
false
false
false
GNOME/libical-glib
tests/recurrence-type.py
1
3366
#!/usr/bin/env python3 #GI_TYPELIB_PATH=$PREFIX/lib/girepository-1.0/ ./recurrence-type.py ############################################################################### # # Copyright (C) 2015 William Yu <williamyu@gnome.org> # # This library is free software: you can redistribute it and/or modify it # under the term...
lgpl-2.1
-7,128,049,963,211,403,000
36.820225
98
0.68776
false
3.024259
false
false
false
RhubarbSin/arin-whois-rws
payload/poc.py
1
114862
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011,2012,2013 American Registry for Internet Numbers # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear i...
mit
-6,584,860,182,229,985,000
43.763055
352
0.592276
false
4.060019
false
false
false
wagnerand/zamboni
mkt/monolith/resources.py
2
1858
import json import logging from django.db import transaction from rest_framework import mixins, serializers, status, viewsets from rest_framework.response import Response from mkt.api.authentication import RestOAuthAuthentication from mkt.api.authorization import GroupPermission from mkt.api.base import CORSMixin fr...
bsd-3-clause
2,453,797,273,857,822,000
31.034483
76
0.678149
false
3.928118
false
false
false
diafygi/ascentsolar
server.py
1
2596
import reads import writes import re import MySQLdb #Run in the command line: "python server.py" #Open browser and go to http://localhost:8888/ #Go to http://localhost:8888/recreate/ to reset database to example def URLS(): yield ("^/$", writes.login) yield ("^/logout/$", writes.logout) yield ("^/manufact...
gpl-2.0
2,646,338,254,056,790,000
38.333333
111
0.604777
false
3.131484
false
false
false
ntoll/mu
mu/virtual_environment.py
1
25044
import os import sys import datetime from collections import namedtuple import functools import glob import logging import subprocess import time from PyQt5.QtCore import ( QObject, QProcess, pyqtSignal, QTimer, QProcessEnvironment, ) from . import wheels from . import settings ...
gpl-3.0
5,771,718,422,164,241,000
32.259918
79
0.554903
false
4.636061
false
false
false
josiah-wolf-oberholtzer/consort
consort/tools/MusicSpecifierSequence.py
1
5595
import abjad import collections from abjad.tools import abctools from abjad.tools import mathtools from abjad.tools import rhythmmakertools class MusicSpecifierSequence(abctools.AbjadValueObject): r'''A music specifier sequence. :: >>> sequence_a = consort.MusicSpecifierSequence( ... mus...
mit
-2,756,695,303,295,140,000
32.502994
77
0.560858
false
4.320463
false
false
false
nysan/yocto-autobuilder
lib/python2.6/site-packages/buildbot-0.8.4p1-py2.6.egg/buildbot/steps/source.py
4
58316
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
-4,113,521,986,634,069,500
41.535376
116
0.558132
false
4.683264
false
false
false
UQ-UQx/edx-platform_lti
lms/djangoapps/courseware/tests/test_recommender.py
2
32023
""" This test file will run through some XBlock test scenarios regarding the recommender system """ import json import itertools import StringIO from ddt import ddt, data from copy import deepcopy from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_setti...
agpl-3.0
2,393,517,875,017,542,000
39.382093
134
0.593448
false
3.913835
true
false
false
Curbfeeler/PinbotFromES
multiball.py
1
10422
################################################################################# ##____ ___ _ _ ____ ___ _____ ____ ___ #| _ \_ _| \ | | __ ) / _ \_ _| |___ \ / _ \ #| |_) | || \| | _ \| | | || | __) || | | | #| __/| || |\ | |_) | |_|...
mit
-5,230,343,648,591,653,000
38.778626
111
0.644982
false
2.713356
false
false
false
Vagab0nd/SiCKRAGE
lib3/twilio/rest/bulkexports/v1/export_configuration.py
1
9958
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource f...
gpl-3.0
7,873,266,434,988,749,000
33.66899
108
0.652362
false
4.574713
true
false
false
cherrypy/magicbus
magicbus/compat.py
1
2070
"""Compatibility code for using magicbus with various versions of Python. Magic Bus 3.3 is compatible with Python versions 2.7+. This module provides a useful abstraction over the differences between Python versions, sometimes by preferring a newer idiom, sometimes an older one, and sometimes a custom one. In particu...
bsd-3-clause
3,203,971,497,558,720,500
31.34375
77
0.717874
false
4.215886
false
false
false
derekjchow/models
research/global_objectives/util_test.py
4
13413
# Copyright 2018 The TensorFlow Global Objectives 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 r...
apache-2.0
1,391,438,213,405,433,900
39.279279
80
0.659584
false
3.635945
true
false
false
da-mkay/subsynco
src/subsynco/gst/player.py
1
11288
#!/usr/bin/env python ''' SubSynco - a tool for synchronizing subtitle files Copyright (C) 2015 da-mkay This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your o...
gpl-3.0
-3,769,176,288,573,613,600
40.19708
80
0.601967
false
3.987284
false
false
false
pla93/django-mantis-actionables
mantis_actionables/templatetags/actionables_tags.py
2
1383
__author__ = 'Philipp Lang' from django import template from dingos import DINGOS_TEMPLATE_FAMILY from mantis_actionables.forms import TagForm from mantis_actionables.models import Status register = template.Library() @register.filter def lookup_status_processing(value): return Status.PROCESSING_MAP.get(valu...
gpl-2.0
-4,653,241,711,023,776,000
24.611111
110
0.683297
false
3.440299
false
false
false
gvkalra/gladieter
gladieter/gladieter/lib/utils.py
1
1426
from defaults import ONS_PEER_ROOT from error import GladieterLibError from defaults import ONS_SUPPORTED_REGEX from xml.dom.minidom import parse import urllib import ons def gtin_to_fqdn(gtin, peer_root=ONS_PEER_ROOT): aus = gtin[0:1] + "." + gtin[12:13] + "." + gtin[11:12] + "." \ + gtin[10:11] + "." + gtin[9:10...
mit
2,814,091,997,375,439,000
28.122449
98
0.638149
false
2.380634
false
false
false
charanpald/sandbox
sandbox/ranking/leafrank/SVMLeafRank.py
1
2491
import numpy import logging from sandbox.util.Sampling import Sampling from sandbox.predictors.LibSVM import LibSVM class SVMLeafRank(LibSVM): """ This is a subclass of LibSVM which will do model selection before learning. """ def __init__(self, paramDict, folds, sampleSize=None, numProcesses=1): ...
gpl-3.0
-7,128,618,342,529,609,000
36.179104
100
0.616218
false
3.998395
false
false
false
Inboxen/Inboxen
inboxen/account/tasks.py
1
5836
## # Copyright (C) 2013, 2014, 2015, 2016, 2017 Jessica Tallon & Matt Molyneaux # # This file is part of Inboxen. # # Inboxen 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 versio...
agpl-3.0
6,240,896,996,204,487,000
31.065934
101
0.681289
false
3.387115
false
false
false
HKuz/Test_Code
CodeFights/floatRange.py
1
1284
#!/usr/local/bin/python # Code Fights Float Range Problem from itertools import count, takewhile def floatRange(start, stop, step): gen = takewhile(lambda x: x < stop, count(start, step)) return list(gen) def main(): tests = [ [-0.9, 0.45, 0.2, [-0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3]], ...
mit
-144,380,351,648,928,930
31.923077
79
0.425234
false
2.326087
false
false
false
frankvdp/django
django/contrib/gis/geos/libgeos.py
38
5127
""" This module houses the ctypes initialization procedures, as well as the notice and error handler function callbacks (get called when an error occurs in GEOS). This module also houses GEOS Pointer utilities, including get_pointer_arr(), and GEOM_PTR. """ import logging import os from ctypes import CDLL, CFUNCT...
bsd-3-clause
-6,973,117,126,197,560,000
28.297143
95
0.6575
false
3.726017
false
false
false
manashmndl/LearningPyQt
pyqt/chap11/ypipewidget.py
1
6172
#!/usr/bin/env python # Copyright (c) 2008-14 Qtrac Ltd. All rights reserved. # This program or module is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by the Free Software Foundation, either version 2 of the License, or # version 3 of the Lic...
mit
-3,199,703,286,188,070,000
35.52071
74
0.603046
false
3.5553
false
false
false
PyJAX/foodie
foodie/settings.py
1
2013
""" Django settings for foodie project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
isc
-2,277,805,838,004,729,600
22.964286
71
0.718331
false
3.200318
false
false
false
sbg2133/miscellaneous_projects
carina/velocityMaps/vdisp.py
1
1943
import numpy as np from lpf import lowpass_cosine as filt import matplotlib.pyplot as plt plt.ion() def fwhm(v_array, vmin, vmax): v_array = v_array[:,1000:-1000,] steps = v_array.shape[1] print steps, vmax, vmin vres = (vmax - vmin)/steps v = np.arange(vmin, vmax, vres)/1.0e3 tau = 1.0 f...
gpl-3.0
2,516,412,777,968,482,000
34.327273
85
0.487905
false
3.402802
false
false
false
burkesquires/pyeq2
Models_2D/Power.py
3
23359
from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import # pyeq2 is a collection of equations expressed as Python classes # # Copyright (C) 2013 James R. Phillips # 2548 Vera Cruz Drive # Birmingham, AL 35235 USA # # email: zunzun@zunzun.com # ...
bsd-2-clause
2,006,532,823,001,543,400
33.605926
121
0.70521
false
3.792661
false
false
false
quantopian/serializable-traitlets
setup.py
1
1476
from setuptools import setup, find_packages from sys import version_info def install_requires(): requires = [ 'traitlets>=4.1', 'six>=1.9.0', 'pyyaml>=3.11', ] if (version_info.major, version_info.minor) < (3, 4): requires.append('singledispatch>=3.4.0') return requires...
apache-2.0
-1,732,214,769,954,039,300
25.836364
67
0.536585
false
3.874016
false
false
false
iarroyof/lxmls-toolkit
lxmls/deep_learning/sgd.py
3
4091
import sys import numpy as np import time import theano import theano.tensor as T def class_acc(hat_y, y_ref): ''' Computes percent accuracy and log probability given estimated and reference class indices ''' # Check probability of devel set pred = hat_y[y_ref, np.arange(y_ref.shape[0])]...
mit
-8,543,377,877,708,973,000
35.526786
122
0.523588
false
3.652679
false
false
false
fuzzycode/RoboPi
robot/utils/iterators.py
1
1689
# -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2015 Björn Larsson # # 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 r...
mit
8,327,679,356,106,653,000
35.695652
80
0.692536
false
4.137255
false
false
false
ColdrickSotK/storyboard
storyboard/tests/db/migration/test_migrations.py
1
4632
# Copyright 2014 OpenStack Foundation # Copyright 2014 Mirantis 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 ...
apache-2.0
57,971,858,778,312,310
36.658537
78
0.697755
false
3.882649
true
false
false
flipjack/suventa
project/app/views.py
1
5804
# -*- encoding: utf-8 -*- from django.shortcuts import render from django.contrib.auth import login, authenticate, logout from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.contrib import messages from django.views.decorators.csrf import csrf_exempt impor...
bsd-3-clause
-6,158,858,356,048,572,000
35.670886
84
0.718626
false
3.104502
false
false
false
dslutz/qemu
scripts/qapi/gen.py
11
8280
# -*- coding: utf-8 -*- # # QAPI code generation # # Copyright (c) 2018-2019 Red Hat Inc. # # Authors: # Markus Armbruster <armbru@redhat.com> # Marc-André Lureau <marcandre.lureau@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. imp...
gpl-2.0
7,214,599,436,790,775,000
27.064407
79
0.553811
false
3.593316
false
false
false
CivicKnowledge/ambry
ambry/orm/code.py
1
2703
"""Object-Rlational Mapping classess, based on Sqlalchemy, for representing the dataset, partitions, configuration, tables and columns. Copyright (c) 2015 Civic Knowledge. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ __docformat__ = 'restructuredtex...
bsd-2-clause
-4,505,728,845,002,071,000
30.430233
142
0.625601
false
3.78042
false
false
false
eph214/webpymail
webpymail/mailapp/templatetags/webtags.py
7
1891
# -*- coding: utf-8 -*- # WebPyMail - IMAP python/django web mail client # Copyright (C) 2008 Helder Guerreiro ## This file is part of WebPyMail. ## ## WebPyMail 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 Foundat...
gpl-3.0
666,743,244,955,380,400
31.050847
72
0.68588
false
3.859184
false
false
false
BackupGGCode/annetgpgpu
examples/misc/runSOMNet.py
2
1098
from ANPyNetCPU import * black = vectorf([0,0,0]) white = vectorf([1,1,1]) red = vectorf([1,0,0]) green = vectorf([0,1,0]) blue = vectorf([0,0,1]) trainSet = TrainingSet() trainSet.AddInput(black) trainSet.AddInput(white) trainSet.AddInput(red) trainSet.AddInput(green) trainSet.AddInput(blue) widthMap = 4 height...
lgpl-2.1
215,936,719,292,420,540
21.428571
92
0.724044
false
2.671533
false
false
false
churchlab/ulutil
ulutil/qPCR2quantitation.py
1
3390
# Copyright 2014 Uri Laserson # # 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
-2,069,403,091,796,338,700
33.958763
105
0.620944
false
3.779264
false
false
false
Coder-Yu/SDLib
shillingmodels/bandwagonAttack.py
1
2252
#coding:utf-8 #author:Yu Junliang import random import numpy as np from attack import Attack class BandWagonAttack(Attack): def __init__(self,conf): super(BandWagonAttack, self).__init__(conf) self.hotItems = sorted(self.itemProfile.iteritems(), key=lambda d: len(d[1]), reverse=True)[ ...
gpl-3.0
-3,365,530,411,611,354,600
38.105263
122
0.631059
false
3.664474
false
false
false
akmcinto/TodoApp
ToDoApp/todo/migrations/0009_auto_20160126_1426.py
1
1146
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-26 21:26 from __future__ import unicode_literals import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.sw...
apache-2.0
-2,449,670,075,222,136,000
32.705882
128
0.630017
false
3.965398
false
false
false
timsnyder/bokeh
bokeh/application/handlers/code_runner.py
2
6272
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
-7,543,560,056,578,469,000
29.745098
131
0.449139
false
5.192053
false
false
false
bc-python-tools/mistool
test/string/multisplit/iterator/test_multisplit_iterator.py
1
1659
#!/usr/bin/env python3 # --------------------- # # -- SEVERAL IMPORTS -- # # --------------------- # from pathlib import Path from pytest import fixture, raises from orpyste.data import ReadBlock as READ # ------------------- # # -- MODULE TESTED -- # # ------------------- # from mistool import string_use from mi...
gpl-3.0
-4,821,293,765,038,772,000
20.545455
65
0.512357
false
3.463466
true
false
false
Lazar-T/image_compressor
compress.py
1
1153
#!/usr/bin/python import os from sys import argv from PIL import Image script, rootdir = argv COLOR_WHITE = "\033[1;37m{0}\033[00m" COLOR_BLUE = "\033[1;36m{0}\033[00m" folder_size = 0 for (path, dirs, files) in os.walk(rootdir): for file in files: filename = os.path.join(path, file) folder_size...
mit
-801,296,573,217,265,900
25.813953
85
0.626193
false
2.926396
false
false
false
mission-peace/interview
python/graph/disjointset.py
1
1697
# disjoint sets # https://github.com/mission-peace/interview/blob/master/src/com/interview/graph/DisjointSet.java class Node(object): def __init__(self, data, parent = None, rank = 0): self.data = data self.parent = parent self.rank = rank def __str__(self): return str(self.da...
apache-2.0
-8,107,211,652,950,265,000
21.038961
97
0.542133
false
3.20794
false
false
false
anselmobd/fo2
src/lotes/migrations/0010_lote.py
1
1354
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-03-28 17:49 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lotes', '0009_remove_modelotermica_receita'), ] operations = [ migrations.C...
mit
991,786,391,476,645,600
40
114
0.566888
false
3.800562
false
false
false
clubit/sale-workflow
sale_franco_check/wizard/confirm_sale_order_franco.py
1
1610
from openerp import models, fields, api, _ from openerp import netsvc from openerp import tools from itertools import groupby class confirm_quotation_franco(models.TransientModel): _name = 'confirm.sale.order.franco' _description = 'Confirm Sale Order' @api.multi def confirm_sale_order_franco(self): ...
agpl-3.0
-5,945,792,633,498,405,000
47.787879
118
0.662733
false
3.718245
false
false
false
spatialaudio/python-sounddevice
sounddevice.py
1
107862
# Copyright (c) 2015-2020 Matthias Geier # # 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, copy, modify, merge, publish,...
mit
6,031,826,291,675,383,000
36.47811
80
0.610855
false
4.429651
false
false
false
openstack/ironic
ironic/api/controllers/v1/volume_target.py
1
18441
# Copyright (c) 2017 Hitachi, Ltd. # # 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
1,114,913,847,609,829,500
40.440449
79
0.579253
false
4.453272
false
false
false
wadester/wh_test_py
py_utc_timestamp.py
1
1090
#!/usr/bin/env python # Module: py_utc_timestamp.py # Purpose: Python UTC timestamp # Date: N/A # Notes: # 1) ... # Ref: # http://stackoverflow.com/questions/8777753/converting-datetime-date-to-utc-timestamp-in-python # """py_utc_timestamp.py: Python UTC timestamp test""" from __future__ import division from d...
gpl-2.0
6,463,227,694,067,315,000
27.684211
97
0.63211
false
2.906667
false
false
false
Micronaet/micronaet-lognaet
lognaet/lognaet.py
1
3724
# -*- coding: utf-8 -*- ############################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
-5,641,202,321,804,962,000
34.807692
79
0.597744
false
4.083333
false
false
false
lukasjuhrich/pycroft
hades_logs/app.py
1
1259
from celery import Celery class HadesCelery(Celery): """Celery subclass complying with the Hades RPC API This subclass sets a few options in :meth:`__init__` such as the default exchange and hooks into :meth:`signature` to set a routing key if given. :param str routing_key: The routing key to en...
apache-2.0
-7,818,587,323,205,741,000
39.612903
70
0.610802
false
3.659884
false
false
false
creamidea/Mushroom
NodeSite/NodeSite/accounts/views.py
1
2235
# -*- coding: utf-8 -*- # Create your views here. from django.shortcuts import render from django.http import (HttpResponse, HttpResponseRedirect) from django.contrib.auth.views import (login, logout) from django.contrib.auth.forms import UserCreationForm from django.contrib import messages from django.contrib.auth.d...
mit
-2,341,865,873,242,403,300
33.296875
126
0.649658
false
3.771478
false
false
false
robjstan/modelling-course
notebooks/python/f04.py
1
2908
# setup ipython environment from ipywidgets import interact, fixed # setup python environment import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') col = plt.rcParams['axes.color_cycle'] def mc(p, q, tmax = 1, x0 = 0): x = x0 r = np.random.rand(tmax+1) for t in range(tmax+1): ...
mit
4,165,750,053,726,287,000
26.961538
80
0.525791
false
2.24556
false
false
false
tensorflow/models
research/seq_flow_lite/layers/dense_layers.py
1
3708
# Copyright 2020 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 applicab...
apache-2.0
8,344,653,043,419,898,000
33.654206
80
0.666667
false
3.753036
false
false
false
stackdio/stackdio
stackdio/api/search/serializers.py
2
1170
# -*- coding: utf-8 -*- # Copyright 2017, Digital Reasoning # # 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
-2,793,053,900,935,845,000
30.621622
87
0.750427
false
4.193548
false
false
false
darrell24015/FutureLearn
Python/Week3/character.py
1
1637
class Character(): # Create a character def __init__(self, char_name, char_description): self.name = char_name self.description = char_description self.conversation = None # Describe this character def describe(self): print( self.name + " is here!" ) print( self...
gpl-3.0
1,497,780,064,817,535,700
24.578125
67
0.651191
false
3.403326
false
false
false
openprocurement/openprocurement.tender.openeu
openprocurement/tender/openeu/tests/question_blanks.py
1
3648
# -*- coding: utf-8 -*- # TenderQuestionResourceTest def patch_tender_question(self): response = self.app.post_json('/tenders/{}/questions'.format( self.tender_id), {'data': {'title': 'question title', 'description': 'question description', 'author': self.test_bids_data[...
apache-2.0
-766,566,000,831,895,900
47.64
116
0.644737
false
3.703553
false
false
false
simar7/build-mozharness
mozharness/base/log.py
7
14897
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # 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/. # ***** END LICENSE BLOCK ***** """Generic logging, the way I rem...
mpl-2.0
2,744,077,304,454,648,300
36.905852
87
0.57139
false
3.86333
true
false
false
a10networks/a10sdk-python
a10sdk/core/techreport/techreport_priority_partition.py
2
1363
from a10sdk.common.A10BaseClass import A10BaseClass class PriorityPartition(A10BaseClass): """Class Description:: Configure partition to always poll for techreport. Class priority-partition supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for t...
apache-2.0
4,059,860,966,536,163,300
34.868421
216
0.65077
false
3.775623
false
false
false
hubbardgary/AdventOfCode
day25.py
1
4511
# --- Day 25: Let It Snow --- # # Merry Christmas! Santa is booting up his weather machine; looks like you might get a white Christmas after all. # # The weather machine beeps! On the console of the machine is a copy protection message asking you to enter a code from # the instruction manual. Apparently, it refuses to ...
mit
-3,800,924,078,984,257,500
42.796117
120
0.674795
false
3.25
false
false
false
rreece/pyframe
test/read_tree.py
1
3725
#!/usr/bin/env python """ NAME read_tree.py - a pyframe example script SYNOPSIS ./read_tree.py myntuple.root DESCRIPTION Demonstrates how to read trees in pyframe and make some histograms. OPTIONS -h, --help Prints this manual and exits. -o, --output output.hists.root Out...
gpl-2.0
-6,439,672,346,281,726,000
27.219697
116
0.435168
false
4.247434
false
false
false
OriHoch/pysiogame
game_boards/game004.py
1
6831
# -*- coding: utf-8 -*- import classes.level_controller as lc import classes.game_driver as gd import classes.extras as ex import classes.board import random import pygame class Board(gd.BoardGame): def __init__(self, mainloop, speaker, config, screen_w, screen_h): self.level = lc.Level(self,mainloop,36...
gpl-3.0
6,998,048,290,850,005,000
36.95
160
0.51398
false
3.311197
false
false
false
codingkevin/suds
tools/run_all_tests.py
1
4633
# -*- coding: utf-8 -*- # This program is free software; you can redistribute it and/or modify it under # the terms of the (LGPL) GNU Lesser General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is distributed i...
lgpl-3.0
-1,672,474,241,241,148,400
33.066176
79
0.668034
false
3.976824
true
false
false
prezi/python-github3
pygithub3/resources/issues.py
8
1421
#!/usr/bin/env python # -*- encoding: utf-8 -*- import re from .base import Resource from .users import User from .pull_requests import PullRequest class Label(Resource): @staticmethod def is_valid_color(color): valid_color = re.compile(r'[0-9abcdefABCDEF]{6}') match = valid_color.match(col...
isc
3,395,134,593,891,507,700
20.861538
64
0.549613
false
3.474328
false
false
false
OpenOil-UG/aleph
aleph/archive/archive.py
1
1055
import os from aleph.util import checksum class Archive(object): def _get_file_path(self, meta): ch = meta.content_hash if ch is None: raise ValueError("No content hash available.") path = os.path.join(ch[:2], ch[2:4], ch[4:6], ch) file_name = 'data' if meta.fi...
mit
9,021,590,469,122,582,000
27.513514
67
0.583886
false
3.864469
false
false
false
wildlava/explore
python/modular/run_explore.py
1
1552
# # Explore # - The Adventure Interpreter # # Copyright (C) 2006 Joe Peterson # import sys import Explore filename = None no_delay = False trs_compat = False for arg_num in range(len(sys.argv)): if sys.argv[arg_num] == "-f": if len(sys.argv) > (arg_num + 1) and (len(sys.argv[arg_num + 1]) == 0 or sy...
mit
8,505,619,847,493,570,000
33.488889
114
0.537371
false
2.811594
false
false
false
michaelneuder/connect_four
app/bin/main_widget.py
1
6141
#!/usr/bin/env python3 from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * import sqlite3 from main_widgets.home_main_widget import home_main_widget from main_widgets.pvp_main_widget import pvp_main_widget from main_widgets.pvai_main_widget import pvai_main_widget from main_widgets.how_to...
mit
4,348,574,129,228,213,000
38.365385
93
0.657385
false
3.623009
false
false
false
autostack/pytest-autostack
autostack/redisq.py
1
2867
#!/usr/bin/env python # -*- coding: UTF-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import redis #import zmq import time from uuid import uuid4 from autostack.utils import get_open_port __author__ = 'Avi Tal <avi3tal@gmail.com>' __date__ = 'Sep ...
mit
-8,005,998,425,748,914,000
26.304762
79
0.553889
false
3.574813
false
false
false
saschwarz/django-periodicals
periodicals/urls.py
1
4810
from django.contrib import admin from django.conf import settings from django.conf.urls import patterns, url from django.views.generic import TemplateView from haystack.views import SearchView from haystack.query import SearchQuerySet from .views import (AuthorList, AuthorDetail, ArticleDetail, Arti...
bsd-3-clause
-8,323,299,732,640,862,000
36.874016
109
0.477755
false
4.069374
false
false
false
thcrock/map-matching-visualizer
core/matchers/osrm.py
1
3294
''' Basic utilities for matching coordinates to the street grid using the OSRM match endpoint ''' import logging import requests from django.conf import settings from core.matchers.base import BaseMatcher logger = logging.getLogger(__name__) class OsrmMatcher(BaseMatcher): def _match_output(self): ...
gpl-3.0
7,802,764,669,465,882,000
34.042553
82
0.549787
false
4.41555
false
false
false
appleseedhq/cortex
test/IECoreScene/SmoothSmoothSkinningWeightsOpTest.py
5
20115
########################################################################## # # Copyright (c) 2010, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
bsd-3-clause
6,765,676,124,956,696,000
45.454965
142
0.693711
false
2.972074
true
false
false
Saevon/webdnd
shared/management/__init__.py
1
1120
from django.db.models.signals import post_syncdb from django.conf import settings from django.core import management import os import re FIXTURE_RE = re.compile(r'^[^.]*.json$') def load_data(sender, **kwargs): """ Loads fixture data after loading the last installed app """ if kwargs['app'].__name__...
mit
-2,741,098,657,701,872,600
30.111111
76
0.6125
false
3.708609
false
false
false
kmoocdev2/edx-platform
openedx/core/djangoapps/lang_pref/api.py
13
3474
# -*- coding: utf-8 -*- """ Python API for language and translation management. """ from collections import namedtuple from django.conf import settings from django.utils.translation import ugettext as _ from openedx.core.djangoapps.dark_lang.models import DarkLangConfig from openedx.core.djangoapps.site_configuratio...
agpl-3.0
-8,022,781,380,228,279,000
35.946809
119
0.716384
false
4.368553
false
false
false
Quantify-world/apification
src/apification/utils/writeonce.py
1
2624
from itertools import chain import warnings class writeonce(object): def __init__(self, *args, **kwargs): self.name = None self.__doc__ = kwargs.pop('writeonce_doc', None) self.msg = kwargs.pop('writeonce_msg', None) self.args = args # for class decorator case self.kwargs =...
mit
7,823,749,600,766,490,000
40
126
0.564405
false
4.1
false
false
false
etkirsch/legends-of-erukar
erukar/system/server/DifferentialMessageEngine.py
1
4310
from erukar.system.engine.commands import Map, Inventory, Skills, Stats class DifferentialMessageEngine: '''' The Differential Message Engine takes messages that need to be sent to real life players and minimizes them before they are sent out. This should reduce bandwidth drastically ''' MapSt...
agpl-3.0
-5,780,901,964,227,090,000
34.04065
78
0.5529
false
3.751088
false
false
false
shirtsgroup/physical-validation
physical_validation/data/lammps_parser.py
1
20326
########################################################################### # # # physical_validation, # # a python package to test the physical validity of MD results # # ...
lgpl-2.1
-3,521,935,147,181,849,000
34.659649
89
0.409033
false
4.583089
false
false
false