repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
stadtgestalten/stadtgestalten
grouprise/features/polls/migrations/0014_auto_20180222_1033.py
1
1195
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-02-22 09:33 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('polls', '0013_auto_20180109_1302'), ] operations ...
agpl-3.0
609,654,144,037,724,400
29.641026
147
0.555649
false
4.252669
false
false
false
vdrhtc/Measurement-automation
lib2/RabiFromFrequencyTEST.py
1
25499
from lib2.Measurement import Measurement from lib2.MeasurementResult import MeasurementResult from lib2.DispersiveRabiOscillations import DispersiveRabiOscillations from lib2.DispersiveRamsey import DispersiveRamsey from copy import deepcopy import csv import numpy as np from scipy.optimize import minimize from scip...
gpl-3.0
6,906,129,381,883,194,000
45.193841
129
0.597474
false
3.844264
false
false
false
JulyKikuAkita/PythonPrac
cs15211/SubsetsII.py
1
6213
__source__ = 'https://leetcode.com/problems/subsets-ii/' # https://github.com/kamyu104/LeetCode/blob/master/Python/subsets-ii.py # Time: O(n * 2^n) # Space: O(1) # Brute Force Search # # Description: Leetcode # 90. Subsets II # # Given a collection of integers that might contain duplicates, S, return all possible subs...
apache-2.0
7,576,013,052,442,571,000
29.014493
126
0.521648
false
3.214175
true
false
false
ellerrs/lunkalytics
settings.py
1
2988
MONGO_HOST = 'localhost' MONGO_PORT = 27017 #MONGO_USERNAME = 'user' #MONGO_PASSWORD = 'user' MONGO_DBNAME = 'lunk' RESOURCE_METHODS = ['GET', 'POST', 'DELETE'] ITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE'] # TesTing people = { # 'title' tag used in item links. 'item_title': 'person', # by default t...
gpl-2.0
370,469,079,028,163,700
28.303922
79
0.520415
false
3.890625
false
false
false
eliasdesousa/indico
indico/modules/events/papers/forms.py
2
11103
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
5,771,837,576,072,308,000
44.134146
120
0.649914
false
4.03452
false
false
false
tensorflow/federated
tensorflow_federated/python/core/impl/executors/federated_composing_strategy.py
1
30010
# Copyright 2019, The TensorFlow Federated Authors. # # 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 o...
apache-2.0
-3,132,600,903,502,816,000
43.002933
91
0.687937
false
3.765843
false
false
false
Reilithion/xmms2-reilithion
wafadmin/Tools/d.py
1
13178
#!/usr/bin/env python # encoding: utf-8 # Carlos Rafael Giani, 2007 (dv) # Thomas Nagy, 2007-2008 (ita) import os, sys, re, optparse import ccroot # <- leave this import TaskGen, Utils, Task, Configure, Logs, Build from Logs import debug, error from TaskGen import taskgen, feature, after, before, extension EXT_D = ['...
lgpl-2.1
-1,930,467,779,734,388,200
24.638132
109
0.615723
false
2.708736
false
false
false
michaelconnor00/gbdxtools
tests/unit/test_interface.py
1
1779
import gbdxtools from auth_mock import get_mock_gbdx_session """ How to use the mock_gbdx_session and vcr to create unit tests: 1. Add a new test that is dependent upon actually hitting GBDX APIs. 2. Decorate the test with @vcr appropriately, supply a yaml file path to gbdxtools/tests/unit/cassettes note: a yaml f...
mit
8,340,447,059,783,082,000
42.390244
110
0.721192
false
3.115587
true
false
false
SingularityHA/WebUI
infrastructure/api.py
1
1461
from tastypie.resources import ModelResource from tastypie import fields from tastypie.constants import ALL, ALL_WITH_RELATIONS from infrastructure.models import Device, Module, Server, Module_List import json class Module_ActuatorResource(ModelResource): class Meta: queryset = Module_List.objects.all() filtering...
gpl-3.0
-975,456,455,708,244,500
24.189655
69
0.717317
false
3.374134
false
false
false
hasgeek/funnel
funnel/models/site_membership.py
1
3850
from __future__ import annotations from typing import Set from sqlalchemy.ext.declarative import declared_attr from werkzeug.utils import cached_property from . import User, db from .helpers import reopen from .membership_mixin import ImmutableUserMembershipMixin __all__ = ['SiteMembership'] class SiteMembership...
agpl-3.0
7,489,319,098,843,708,000
28.615385
86
0.584416
false
4.148707
false
false
false
zbigniewwojna/text-rcnn
box_coders/square_box_coder.py
26
4276
# 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
-6,877,158,689,040,633,000
32.936508
80
0.649906
false
3.65158
false
false
false
solus-project/evolve-sc
xng/featured.py
2
9088
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # This file is part of solus-sc # # Copyright © 2014-2018 Ikey Doherty <ikey@solus-project.com> # # 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 Founda...
gpl-2.0
-7,607,819,648,595,569,000
33.154135
73
0.61596
false
3.432187
false
false
false
miquelramirez/LAPKT-public
planners/siw_plus/siw_plus.py
2
1474
#! /usr/bin/env python import fd.grounding import sys import os from libsiw_plus import SIW_Plus_Planner # MRJ: Profiler imports #from prof import profiler_start, profiler_stop def main( domain_file, problem_file, plan_file ) : task = SIW_Plus_Planner( ) fd.grounding.default( domain_file, problem_file, task ) #M...
gpl-3.0
-8,985,157,896,766,017,000
26.811321
121
0.712347
false
2.807619
false
false
false
StefanKopieczek/gramatyk
predict_engine.py
1
2235
#!/usr/bin/python # -*- coding: UTF-8 -*- from __future__ import unicode_literals import exceptions import words import wordutils from collections import Counter from itertools import product _PRESENT_TENSE_ENDINGS = [ [['ę'], ['esz'], ['e'], ['emy'], ['ecie'], ['ą']], [['ę'], ['isz', 'ysz'], ['i', 'y'], [...
gpl-2.0
-7,469,883,954,145,028,000
28.693333
85
0.594073
false
3.374242
false
false
false
scottynomad/flatland-europython-2010
examples/flaskr_flatland/flaskr_flatland/forms.py
2
2169
from flatland import Dict, Form, List, Boolean, String from flatland.validation import LengthBetween, Present, ValuesEqual class RegistrationForm(Form): username = String.using( label='Username', validators=[Present(), LengthBetween(4,25)] ) email = String.using( label='Email Addres...
mit
-8,796,907,859,393,947,000
23.931034
67
0.572614
false
4.364185
false
false
false
MotorolaMobilityLLC/external-chromium_org
tools/perf/metrics/timeline.py
23
2196
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections TRACING_MODE = 'tracing-mode' TIMELINE_MODE = 'timeline-mode' class TimelineMetrics(object): def __init__(self, mode): assert mode ...
bsd-3-clause
5,652,614,246,855,279,000
31.776119
76
0.635701
false
3.690756
false
false
false
tvtsoft/odoo8
openerp-wsgi.py
52
1744
# WSGI Handler sample configuration file. # # Change the appropriate settings below, in order to provide the parameters # that would normally be passed in the command-line. # (at least conf['addons_path']) # # For generic wsgi handlers a global application is defined. # For uwsgi this should work: # $ uwsgi_python --...
agpl-3.0
-3,819,688,103,906,548,700
31.90566
77
0.582569
false
4.21256
true
false
false
theodric/nsclock
release/nscliclock.py
1
3500
#!/usr/bin/env python2.7 #https://github.com/theodric/nsclock #theodric 20170811 #rev2 - fix handling of no departure platform import sys import requests import xmltodict from collections import OrderedDict ## This script makes use of the NS API, documented extensively here: ## http://www.ns.nl/en/travel-information...
lgpl-3.0
8,405,362,974,926,948,000
39.697674
116
0.692857
false
3.441495
false
false
false
rasathus/pigredients
pigredients/ics/lpd8806.py
1
5523
import spidev import time import random # All set commands set the state only, and so require a write command to be displayed. class LPD8806_Chain(object): def __init__(self, ics_in_chain=32, spi_address_hardware=0, spi_address_output=0): # default to 32 ics in the chain, equating to 1 metre s...
mit
-4,986,816,253,379,394,000
37.089655
157
0.504255
false
3.30323
false
false
false
Grimar/hotfolder
client.py
1
1792
from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import pyqtSlot import sys import hotfolder from ui import mainwindow, folderDialog import os.path import shelve class HfMain(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): def __init__(self, parent=None): super(HfMain, self).__init__(pare...
gpl-3.0
-4,920,220,320,503,782,000
28.896552
72
0.589844
false
3.991091
false
false
false
introprogramming/exercises
exercises/mp3player/pygletMp3Player.py
1
1707
import sys import pyglet from pyglet.window import key # Pyglet implementation # # DEPRECATED! # We don't intend on using Pyglet in the course anylonger. # # Doesn't work so well with the sample.wav :P # Only supports WAV unless one also installs AVBin file = 'sample.wav' if len(sys.argv)>1: file = sys.argv[1] w...
mit
-2,833,390,599,135,030,300
20.3375
65
0.60164
false
3.483673
false
false
false
fcrepo4-archive/RDFDatabank
rdfdatabank/tools/broadcastDatasets.py
2
2229
#-*- coding: utf-8 -*- """ Copyright (c) 2012 University of Oxford 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,...
mit
8,667,801,598,879,980,000
36.431034
90
0.680126
false
3.727425
false
false
false
clchiou/garage
py/g1/messaging/g1/messaging/reqrep/clients.py
1
2550
__all__ = [ 'Client', 'ServerTimeoutError', ] import logging import nng import nng.asyncs from g1.bases import classes from g1.bases import collections from g1.bases.assertions import ASSERT from . import utils LOG = logging.getLogger(__name__) # This is just an alias for now. ServerTimeoutError = nng.err...
mit
-6,277,805,485,287,667,000
27.333333
78
0.613725
false
3.811659
false
false
false
Bplotka/serenity-pypeline
serenity_pypeline/filters/cf_executor.py
1
3736
import numpy as np from sklearn.decomposition import FactorAnalysis from serenity_pypeline.logger import log from serenity_pypeline.db.important_consts import DATA_FIELD from serenity_pypeline.filters.filter import Filter from serenity_pypeline.filters.cf_finisher import CfFinisher class CfExecutor(Filter): def...
apache-2.0
-6,611,847,259,941,698,000
31.486957
89
0.531852
false
4.132743
false
false
false
mattdw/django-dps
dps/models.py
1
5033
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from datetime import datetime import uuid def make_uuid(): """the hyphens in uuids are unnecessary, and brevity will be an advantage in our urls.""" u = uuid.uuid4() r...
bsd-2-clause
-6,058,237,092,531,518,000
35.208633
85
0.633419
false
4.309075
false
false
false
danielhb/kimchi
tests/iso_gen.py
2
7108
# # Project Kimchi # # Copyright IBM, Corp. 2013-2015 # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # Thi...
lgpl-3.0
6,435,153,044,294,717,000
32.528302
78
0.556134
false
3.025968
false
false
false
songfj/calibre
src/calibre/gui2/convert/gui_conversion.py
24
2612
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2009, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' from optparse import OptionParser from calibre.customize.conversion import OptionRecommendation, DummyReporter from calibre.ebooks.conversion.plumber import Plumber from ca...
gpl-3.0
1,785,345,619,674,717,200
36.314286
92
0.699847
false
3.852507
false
false
false
bjtrost/TCAG-WGS-CNV-workflow
compare_with_RLCR_definition.py
1
3831
#!/usr/bin/env python # Compare a list of CNV calls to a list of repetitive and low-complexity regions (RLCRs) # Determine how many bases of each CNV overlap with these unclean regions, what percentage overlap, # and what types of regions overlap # Usage: compare_with_RLCR_definition.py RLCR_definition_filename CNV_f...
mit
-5,542,635,046,738,922,000
46.296296
257
0.69799
false
3.600564
false
false
false
xaedes/canopen_301_402
src/canopen_301_402_old/canopen_msgs/msg_sdo_read_request.py
1
2407
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import can from canopen_301_402.constants import * from canopen_301_402.canopen_msgs.msg import CanOpenMessage from canopen_301_402.canopen_301.cob import CanOpenId from canopen_301_402.assertions import Assertions class CanOpenMessageSdoReadRequest(CanOpenMessage): ...
mit
4,000,027,443,470,339,600
30.25974
106
0.602825
false
3.81458
false
false
false
onoga/wm
src/gnue/common/utils/CaselessDict.py
2
11852
# GNU Enterprise Common - Utilities - Caseinsensitive Dictionary # # Copyright 2001-2007 Free Software Foundation # # This file is part of GNU Enterprise # # GNU Enterprise 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
6,438,593,231,715,056,000
30.026178
79
0.505484
false
4.742697
false
false
false
Shrulik/Open-Knesset
laws/listeners.py
9
2628
#encoding: utf-8 from django.db.models.signals import m2m_changed, post_save from django.contrib.contenttypes.models import ContentType from actstream import action from actstream.models import Action from knesset.utils import cannonize, disable_for_loaddata from mks.models import Member, Party from laws.models import...
bsd-3-clause
-5,684,592,265,147,616,000
43.542373
127
0.72793
false
3.541779
false
false
false
QiJune/Paddle
python/paddle/fluid/transpiler/distribute_transpiler.py
1
71817
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
apache-2.0
2,033,703,372,215,441,000
41.799166
106
0.538201
false
4.09517
false
false
false
siulkilulki/mass-scraper
get_utterances.py
1
6400
#!/usr/bin/env python3 import sys import urllib import logging import redis from utils import iterator from extractor.find_hours import hours_iterator import re import pickle class Utterance(): def __init__(self, utterance, url, button_text, depth, filename, line_no): "docstring" self.utterance = ...
gpl-3.0
2,241,497,143,295,706,400
34.505556
162
0.586919
false
3.37434
false
false
false
dmille56/codesamples
src/SpartanCheckers.py
1
32595
import re, tkFont, copy, random, time, tkMessageBox, json, os.path, ttk, math from Tkinter import * from tkFileDialog import askopenfilename, asksaveasfilename from functools import partial from PIL import ImageTk import multiprocessing from multiprocessing import Process from Queue import Empty, Queue from CheckersMo...
mit
3,222,215,005,378,586,000
32.057809
102
0.605123
false
3.619254
false
false
false
deepmind/trfl
trfl/retrace_ops.py
1
18769
# coding=utf8 # Copyright 2018 The trfl 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 ...
apache-2.0
5,493,258,904,379,298,000
44.166265
80
0.666026
false
3.799716
false
false
false
hastexo/django-oscar-vat_moss
oscar_vat_moss/address/forms.py
1
5147
from oscar.apps.address.forms import UserAddressForm as CoreUserAddressForm from django.utils.translation import ugettext_lazy as _ from oscar_vat_moss import vat class UserAddressForm(CoreUserAddressForm): class Meta(CoreUserAddressForm.Meta): fields = CoreUserAddressForm.Meta.fields + ['vatin'] de...
bsd-3-clause
-1,448,957,489,640,966,000
44.955357
77
0.549835
false
4.761332
false
false
false
Preston4tw/elearning
practice/small_coding_questions.py
1
1648
#!/usr/bin/python3 # Write a function to reverse a string def reverse_string(string): new_string = "" # Damn off-by-one errors for i in range(len(string)): new_string += string[-i-1] return new_string # Write a function to compute fibonacci numbers def fib(n): if n == 0: return 0 ...
mit
4,489,074,811,576,229,400
22.884058
64
0.57949
false
3.21875
false
false
false
openatx/weditor
weditor/web/jsonrpc_client.py
1
2962
# coding: utf-8 # import uuid import json import os import signal import subprocess import sys from subprocess import PIPE from typing import Union from logzero import logger class ConsoleKernel(): __instance = {} @classmethod def get_singleton(cls, name='default'): if cls.__instance.get(name) ...
mit
-7,659,827,437,299,128,000
28.929293
98
0.538825
false
4.040928
false
false
false
threerings/farbot
farb/builder.py
1
35389
# builder.py vi:ts=4:sw=4:expandtab: # # Copyright (c) 2006-2008 Three Rings 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: # 1. Redistributions of source code must retain the abov...
bsd-3-clause
5,361,049,795,804,998,000
34.855117
146
0.6131
false
4.041224
true
false
false
Bristol-Braille/canute-ui
ui/driver/driver_emulated.py
1
4551
import asyncio import logging import sys from multiprocessing import Process, Queue from queue import Empty from . import comms_codes as comms from . import qt_display from .driver import Driver log = logging.getLogger(__name__) class Emulated(Driver): # hardware defs CHARS = 40 ROWS = 9 '''driver...
gpl-3.0
-1,263,546,459,349,406,000
30.825175
79
0.573281
false
4.103697
false
false
false
jeffhernandez1995/machinelearning
random_processes/get_data.py
1
2522
import os import os.path import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import UnivariateSpline path=os.getcwd() path+='/' def gambler(start,prob=0.5,max_steps=20): rw=np.zeros(max_steps, dtype=float) rw[0]=start for i in range(1,max_steps): sample=np.random.binomial(1...
gpl-3.0
3,185,593,501,069,199,000
31.333333
145
0.586836
false
2.888889
false
false
false
matteobachetti/srt-single-dish-tools
experiments/mbfits.py
1
2196
from astropy.io import fits import os import numpy as np from srttools.converters.mbfits import MBFITS_creator class MBFits_template(object): def __init__(self, mbfits_dir='.'): self.mbfits_dir = mbfits_dir self.GROUPING = fits.open(os.path.join(mbfits_dir, 'GROUPING.fits')) self.files = s...
bsd-3-clause
9,132,828,647,243,809,000
30.371429
76
0.59745
false
3.07563
false
false
false
jimzhan/tornext
tornext/commands/create.py
1
2089
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2014 Jim Zhan <jim.zhan@me.com> # # 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 ...
apache-2.0
829,626,487,728,010,800
31.625
91
0.698755
false
3.669596
false
false
false
MikiLoz92/pyqx
image.py
1
3048
#!/usr/bin/env python #coding: utf-8 from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import Qt class Image: def __init__(self, fileName, image, bg, context): self.fileName = fileName self.image = image self.bgColor = bg self.context = context self.zoom = 1 self.selection = None self.hi...
gpl-3.0
-8,406,909,600,732,948,000
25.051282
90
0.689304
false
2.886364
false
false
false
allo-/mpdsongvote
models.py
1
2510
from django.db import models class Song(models.Model): filename = models.CharField(max_length=2048) title = models.CharField(max_length=255) artist = models.CharField(max_length=255) attribution = models.ForeignKey( "Attribution", blank=True, default=None, null=True) def __unicode__(self)...
agpl-3.0
-3,018,688,510,576,474,600
26.888889
79
0.661753
false
3.495822
false
false
false
cfe-lab/MiCall
micall/utils/externals.py
1
10455
import subprocess import os import sys import re from subprocess import CalledProcessError class AssetWrapper(object): """ Wraps a packaged asset, and finds its path. """ def __init__(self, path, **kwargs): # noinspection PyArgumentList super(AssetWrapper, self).__init__(**kwargs) app_...
agpl-3.0
-967,200,344,690,227,200
40.324111
92
0.569775
false
4.632255
false
false
false
neuroelectro/neuroelectro_org
neuroelectro/migrations/0023_auto_20160604_1620.py
1
1068
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('neuroelectro', '0022_auto_20160604_1550'), ] operations = [ migrations.AddField( model_name='datatablestat', ...
gpl-2.0
2,187,917,049,628,495,600
26.384615
52
0.552434
false
4.377049
false
false
false
chemelnucfin/tensorflow
tensorflow/python/kernel_tests/unicode_decode_op_test.py
6
32036
# -*- coding: utf-8 -*- # Copyright 2018 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 # # Un...
apache-2.0
4,555,347,001,609,208,300
42.497238
80
0.521053
false
3.146054
true
false
false
dasbruns/netzob
src/netzob/Common/Models/Protocol.py
1
3848
#-*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communication protocols...
gpl-3.0
6,331,192,122,021,783,000
43.662791
78
0.347826
false
5.197564
false
false
false
jasaarim/bups
bups/backup_loop.py
1
6111
import fnmatch import shutil import logging from os import stat, listdir, remove, mkdir from os.path import join, exists, isdir, isfile, basename, sep logger = logging.getLogger(__name__) COPIED = [] ERRORS = [] class BackupNode(object): """Data structure controlling copying files and folders to destination"""...
mit
417,903,146,228,599,040
30.828125
87
0.601375
false
4.041667
true
false
false
chris-belcher/joinmarket-clientserver
jmbitcoin/jmbitcoin/secp256k1_deterministic.py
1
3219
from jmbitcoin.secp256k1_main import * import hmac import hashlib from binascii import hexlify # Below code ASSUMES binary inputs and compressed pubkeys MAINNET_PRIVATE = b'\x04\x88\xAD\xE4' MAINNET_PUBLIC = b'\x04\x88\xB2\x1E' TESTNET_PRIVATE = b'\x04\x35\x83\x94' TESTNET_PUBLIC = b'\x04\x35\x87\xCF' PRIVATE = [MAINN...
gpl-3.0
-595,194,336,267,397,200
33.98913
79
0.633427
false
2.934366
false
false
false
hariharshankar/pygeo
geo/db/connection.py
1
1217
""" Instantiate a db connection. """ import mysql.connector as mysql from mysql.connector.pooling import MySQLConnectionPool class Db(object): """ Instantiate a db connection. """ def __init__(self): dbconfig = { "database": "geoDev", "user": "geo", "pass...
mit
5,115,972,187,327,291,000
23.836735
62
0.53903
false
4.182131
false
false
false
jaraco/irc
scripts/servermap.py
1
3847
#! /usr/bin/env python # # Example program using irc.client. # # servermap connects to an IRC server and finds out what other IRC # servers there are in the net and prints a tree-like map of their # interconnections. # # Example: # # % ./servermap irc.dal.net somenickname # Connecting to server... # Getting links... # ...
mit
2,191,245,996,219,884,500
23.04375
86
0.59085
false
2.87304
false
false
false
theirc/ServiceInfo
services/migrations/0007_load_geo.py
1
4802
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from django.conf import settings from django.contrib.gis.gdal import DataSource from django.contrib.gis.utils import LayerMapping from django.db import models, migrations # map the field names in our LebanonRegion model to the geo fields in le...
bsd-3-clause
1,582,842,292,919,634,000
30.078947
83
0.620872
false
2.815256
false
false
false
tsnaomi/finnsyll
finnsyll/phonology.py
1
6406
# coding=utf-8 from __future__ import unicode_literals from .utilities import FLAGS import re # Finnish phones -------------------------------------------------------------- # Finnish vowels VOWELS = 'ieaouäöy' # Finnish phonemic inventory PHONEMIC_INVENTORY = VOWELS + 'dhjklmnprstv -=' # Finnish diphthongs DIPHT...
bsd-2-clause
4,388,212,340,433,751,000
25.065306
79
0.549483
false
3.230147
false
false
false
onexeno/plow
lib/python/plow/gui/common/widgets.py
1
18299
"""Non-Plow specific widgets.""" from itertools import izip_longest from plow.gui.manifest import QtGui, QtCore from plow.gui.common.help import getHelp, getHelpTextWidget from plow.gui import constants class TableWidget(QtGui.QTableView): def __init__(self, *args, **kwargs): super(TableWidget, self)._...
apache-2.0
-5,084,011,868,062,843,000
30.826087
111
0.613968
false
3.849989
false
false
false
a-detiste/game-data-packager
tools/expand_vars.py
1
1034
#!/usr/bin/python3 # encoding=utf-8 # # Copyright © 2016 Simon McVittie <smcv@debian.org> # # 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)...
gpl-2.0
9,143,694,271,233,313,000
31.28125
70
0.704743
false
3.443333
false
false
false
gt-ros-pkg/hrl-haptic-manip
hrl_dynamic_mpc/src/data_skin_recorder.py
1
8113
#!/usr/bin/python # # # Copyright (c) 2013, Georgia Tech Research Corporation # 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 copyrigh...
apache-2.0
7,412,847,611,387,714,000
41.47644
139
0.57981
false
3.747344
false
false
false
rcosnita/fantastico
virtual_env/libs/mysql-connector/python2/examples/transaction.py
2
3884
#!/usr/bin/env python # -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most...
mit
-6,427,632,535,365,923,000
29.582677
82
0.645211
false
3.864677
true
false
false
zhlinh/leetcode
0264.Ugly Number II/solution.py
1
1601
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ***************************************** Author: zhlinh Email: zhlinhng@gmail.com Version: 0.0.1 Created Time: 2016-05-07 Last_modify: 2016-05-07 ****************************************** ''' ''' Write a program to find the n-th ugly numb...
apache-2.0
-8,870,541,641,049,135,000
27.087719
91
0.552155
false
3.102713
false
false
false
mthh/python-osrm
osrm/core.py
1
19068
# -*- coding: utf-8 -*- import numpy as np from polyline.codec import PolylineCodec from polyline import encode as polyline_encode from pandas import DataFrame from . import RequestConfig try: from urllib.request import urlopen, Request from urllib.parse import quote except: from urllib2 import urlopen, Re...
mit
-4,754,783,665,822,963,000
36.46169
109
0.555958
false
4.186169
true
false
false
fyabc/Py2016
shift/utils/basicUtils.py
1
2840
# -*- coding: utf-8 -*- __author__ = 'fyabc' # Standard libraries. from collections import defaultdict # Dependent libraries. import pygame.font import pygame.locals # Local libraries. from config.gameConfig import KEYMAP_DIR, RECORDS_DIR, FONT_NAME, CELL_SIZE, GAME_SCREEN_SIZE,\ DEFAULT_LEVELS_NAME, DEFAULT_FON...
mit
-8,527,029,418,889,371,000
23.695652
95
0.618662
false
3.216308
false
false
false
MilosAtz/repositoryOptimization
footprint/data/repository/granite.py
1
1361
################################################################################### """ Last edited on June 29, 2018 @author: matz comments: Data for the calculation of heat in a granite repository as per the SNL/LLNL 2011 report. """ ####################################################...
mit
6,744,314,749,972,505,000
36.805556
83
0.435709
false
3.92219
false
false
false
ampax/edx-platform-backup
openedx/core/djangoapps/course_groups/views.py
9
11597
from django_future.csrf import ensure_csrf_cookie from django.views.decorators.http import require_POST from django.contrib.auth.models import User from django.core.paginator import Paginator, EmptyPage from django.core.urlresolvers import reverse from django.http import Http404, HttpResponse, HttpResponseBadRequest fr...
agpl-3.0
7,078,663,481,828,743,000
36.898693
116
0.614038
false
4.153653
false
false
false
drscream/teamvault
src/teamvault/apps/secrets/migrations/0001_initial.py
1
4628
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django.utils.timezone class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('auth', '0001...
gpl-3.0
651,861,081,335,271,600
50.422222
140
0.575627
false
4.458574
false
false
false
hschh86/usersong-extractor
commons/dgxdump.py
1
1338
import collections from .dumpdata.messages import SongDumpSection, RegDumpSection from .util import YAMAHA from .mido_util import writeout_bytes def filter_yamaha_sysex(messages): return (m for m in messages if m.type == 'sysex' and m.data[0] == YAMAHA) class DgxDump(object): # Object-Orientation? # Mo...
mit
-8,578,480,222,725,658,000
27.468085
77
0.602392
false
3.665753
false
false
false
rapidpro/tracpro-old
tracpro/utils/tests.py
1
1318
from __future__ import unicode_literals from django.contrib.auth.models import User from tracpro.test import TracProTest from tracpro.utils import get_cacheable_attr class InitTest(TracProTest): def test_get_cacheable_attr(self): # and when cached value is a non-empty string calculate = lambda: ...
agpl-3.0
-5,376,600,906,825,753,000
38.939394
83
0.663885
false
3.899408
false
false
false
apache/incubator-superset
superset/migrations/versions/3b626e2a6783_sync_db_with_models.py
4
4611
# 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
-815,324,109,494,691,800
33.410448
88
0.609412
false
3.887858
false
false
false
glennhickey/contigSim
src/sampleTree.py
1
4814
#!/usr/bin/env python #Copyright (C) 2012 by Glenn Hickey # #Released under the MIT license, see LICENSE.txt import os import sys import copy import random from collections import defaultdict """ In order to quickly sample contigs (uniformly based on their weights) we keep them in a b-tree. This way sampling can be...
mit
-8,467,462,628,615,746,000
32.430556
79
0.591192
false
4.157168
false
false
false
Jianlong-Peng/pytools
miscellaneous/extract_structures.py
1
1610
''' #============================================================================= # FileName: extract_structures.py # Desc: # Author: jlpeng # Email: jlpeng1201@gmail.com # HomePage: # Version: 0.0.1 # Created: 2015-04-09 20:18:19 # LastChange: 2015-04-09 20:29:39 # Hist...
gpl-2.0
2,775,833,000,624,580,600
28.272727
78
0.465839
false
3.926829
false
false
false
t10471/python
practice/src/design_pattern/factory/table.py
1
1896
# -*- coding: utf-8 -*- import factory class TableFactory(factory.Factory): def createLink(self, caption, url): return TableLink(caption, url) def createTray(self, caption): return TableTray(caption) def createPage(self, title, author): return TablePage(title, author) class TableLi...
mit
2,253,575,104,551,452,400
38.5
126
0.588608
false
3.447273
false
false
false
ivanovev/alt
tools/firfilt.py
1
6290
import tkinter as tk import tkinter.ttk as ttk import sys import pylab from collections import OrderedDict as OD from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from numpy import arange, sin, pi from util import Data, Control try: imp...
gpl-3.0
250,341,684,603,394,600
30.293532
88
0.554054
false
3.183198
false
false
false
squidicuzz/p2pool
p2pool/bitcoin/helper.py
2
5850
import sys import time from twisted.internet import defer import p2pool from p2pool.bitcoin import data as bitcoin_data from p2pool.util import deferral, jsonrpc @deferral.retry('Error while checking Bitcoin connection:', 1) @defer.inlineCallbacks def check(bitcoind, net): if not (yield net.PARENT.RPC_CHECK(bitc...
gpl-3.0
-865,095,388,765,685,800
50.769912
209
0.679829
false
3.738019
false
false
false
sensorian/sensorian-firmware
Apps_Python/P01-EmailLED/checkMail.py
1
2171
#!/usr/bin/env python from imapclient import IMAPClient import time import RPi.GPIO as GPIO HOSTNAME = 'imap-mail.outlook.com' MAILBOX = 'Inbox' USERNAME = '' PASSWORD = '' NEWMAIL_OFFSET = 1 MAIL_CHECK_PERIOD = 60 # check mail every 60 seconds SENSORIAN_LED = 12 # LED pin already_loggedIn = False """Setup the p...
lgpl-3.0
7,467,027,952,325,687,000
21.381443
64
0.672501
false
2.978052
false
false
false
hazelcast/hazelcast-python-client
benchmarks/simple_dict_bench.py
1
2518
import logging import random import sys import threading import time from os.path import dirname from hazelcast.config import SerializationConfig from hazelcast.serialization import SerializationServiceV1 from hazelcast import six from hazelcast.six.moves import range sys.path.append(dirname(dirname(dirname(__file__)...
apache-2.0
-3,094,788,044,499,277,300
31.701299
116
0.540905
false
3.735905
false
false
false
ghorn/debian-casadi
experimental/joel/quadtank/quadtank.py
1
4916
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl, # K.U. Leuven. All rights reserved. # Copyright (C) 2011-2014 Greg Horn # # CasADi is free software; you can...
lgpl-3.0
1,189,473,665,195,814,400
23.703518
159
0.701993
false
2.587368
false
false
false
chfoo/ircloggery
ircloggery/bif.py
1
1545
import datetime import re import sys def read_bif(file): for line in file: line = line.strip() if not line: continue match = re.match(r'(\d{2})-(\d{2})-(\d{4}) (\d{2}):(\d{2}):(\d{2}) ([<>!-]+) (\S+) (.*)', line) if not match: print('bif: unknown line ', ...
gpl-3.0
-1,589,578,945,987,837,000
27.611111
103
0.400647
false
4.098143
false
false
false
timlinux/geonode
geonode/tests/base.py
2
2162
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2018 OSGeo # # 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 ver...
gpl-3.0
7,032,620,217,094,797,000
28.027778
78
0.617484
false
4.255906
true
false
false
tejoesperanto/pasportaservo
maps/management/commands/update_countries_geodata.py
3
19348
""" This management command generates or updates a local database of boundaries and center points for the countries defined by the django_countries module. The countries are geocoded using the OpenCage API, with local modifications when necessary. Note: The OpenCage's database is very volatile and there is no guarante...
agpl-3.0
-8,289,164,411,776,764,000
45.205742
117
0.576628
false
3.692925
false
false
false
getpatchwork/patchwork
patchwork/views/cover.py
1
2593
# Patchwork - automated patch tracking system # Copyright (C) 2016 Intel Corporation # # SPDX-License-Identifier: GPL-2.0-or-later from django.http import Http404 from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.shortcuts impor...
gpl-2.0
-9,149,266,023,975,663,000
30.621951
79
0.625145
false
4.038941
false
false
false
MicroDroid/ezzybot
ezzybot/builtin.py
4
1611
events = [] def help_bot(conn=None, info=None): """Shows help for commands""" #conn.bot.send("PRIVMSG #ezzybot :{} {}".format(conn, info)) for command in [func for func in conn.bot.events if func._event == "command"]: if command._commandname == info.args.lstrip(): conn.notice(info.nick,...
gpl-3.0
72,919,995,550,203,600
31.877551
96
0.653631
false
3.056926
false
false
false
Achifaifa/max7219
examples/sevensegment_test.py
5
2392
#!/usr/bin/env python import max7219.led as led import time import random from datetime import datetime def date(device, deviceId): now = datetime.now() day = now.day month = now.month year = now.year - 2000 # Set day device.letter(deviceId, 8, int(day / 10)) # Tens device.letter(dev...
mit
4,165,842,148,027,294,700
24.72043
71
0.606605
false
3.07455
false
false
false
AKAMobi/goods-counter
src/data_tf.py
1
2753
#coding:utf-8 import os from PIL import Image import numpy as np #读取图片,分为训练集、验证集、测试集,比例6:2:2 #若图片为灰度图,则为1通道,data[i,:,:,:] = arr #如果是将彩色图作为输入,则为3通道,data[i,:,:,:] = [arr[:,:,0],arr[:,:,1],arr[:,:,2]] def load_data(path_positive,path_negative): imgs_positive = os.listdir(path_positive) imgs_negative = os.listdir(pat...
apache-2.0
4,986,735,012,010,285,000
46.375
129
0.529212
false
2.445161
true
false
false
mperrin/misc_astro
idlastro_ports/ccm_unred.py
1
6803
from numpy.lib.polynomial import poly1d import numpy import pylab def ccm_unred(wave, flux, a_v=None, ebv=None, r_v=3.1): """ NAME: CCM_UNRED PURPOSE: Deredden a flux vector using the CCM 1989 parameterization EXPLANATION: The reddening curve is that of Cardell...
bsd-3-clause
5,818,142,359,916,620,000
40.481707
113
0.504777
false
3.130695
false
false
false
ItsLastDay/academic_university_2016-2018
subjects/FormalLanguages/formal_languages/regular/test.py
1
6533
from dfa import DFA from nfa import NFA from fa import FiniteAutomata from regexp import EmptyRE, EpsilonRE, LetterRE, KleeneRE, ParensRE, UnionRE, ConcatRE EPS = NFA.EPS def test_minimize_hw2_1(): # Automaton is already complete. # Should reduce to a 3-state one. automaton = DFA({'A', 'B', 'D', 'C', '...
gpl-3.0
-7,293,244,746,081,753,000
31.994949
87
0.434257
false
3.416841
true
false
false
moleculea/replacement
main.py
1
3759
#! /usr/bin/env python # -*- coding: utf-8 -*- import sys import os import platform from scripts import utilities from scripts.replacement import * ALGORITHM_CODES = ['fifo', 'second', 'lru'] CLASS_CODES = ['FIFO', 'Second_Chance', 'LRU'] def detect_system(): if platform.system() == 'Windows': print "WAR...
bsd-2-clause
2,937,126,385,240,860,700
29.08
91
0.58074
false
3.556291
false
false
false
it-depends/CPSG-Nand2Tetris
DebrisFromExercises/06/Assemble-py/Assemble_py.py
1
2464
import os import re import sys symbolTable = { "SP": 0, "LCL": 1, "ARG": 2, "THIS": 3, "THAT": 4, "SCREEN": 16384, "KBD": 24576, "R0": 0, "R1": 1, "R2": 2, "R3": 3, "R4": 4, "R5": 5, "R6": 6, "R7": 7, "R8": 8, "R9": 9, "R10": 10, "R11": 11, ...
mit
-894,702,895,717,385,000
18.401575
93
0.485795
false
2.881871
false
false
false
ubuntunux/PyEngine3D
Resource/Scripts/main.py
1
4801
from PyEngine3D.Common import logger from PyEngine3D.Utilities import Singleton, Float3, Float4 from PyEngine3D.App.GameBackend import Keyboard class ScriptManager(Singleton): def __init__(self): logger.info("ScriptManager::__init__") self.core_manager = None self.renderer = None s...
bsd-2-clause
-9,197,556,985,922,317,000
38.677686
135
0.628411
false
3.407381
false
false
false
freedomhui/cinder
cinder/api/openstack/volume/volumes.py
2
11699
# 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,919,676,299,361,347,000
31.678771
79
0.617318
false
4.150053
false
false
false
tensorflow/quantum
tensorflow_quantum/python/differentiators/differentiator.py
1
23664
# Copyright 2020 The TensorFlow Quantum 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...
apache-2.0
1,116,711,846,789,733,400
50.668122
80
0.599476
false
4.53768
false
false
false
MokaCreativeLLC/XNATSlicer
XNATSlicer/XnatSlicerLib/settings/Settings_Hosts.py
1
30946
__author__ = "Sunil Kumar (kumar.sunil.p@gmail.com)" __copyright__ = "Copyright 2014, Washington University in St. Louis" __credits__ = ["Sunil Kumar", "Steve Pieper", "Dan Marcus"] __license__ = "XNAT Software License Agreement " + \ "(see: http://xnat.org/about/license.php)" __version__ = "2.1.1" __main...
bsd-3-clause
6,848,757,625,318,106,000
27.627197
80
0.511795
false
4.521625
false
false
false
codesy/codesy
auctions/admin.py
1
2356
from django.contrib import admin from .models import (Bid, Claim, Issue, Offer, OfferFee, Payout, PayoutCredit, PayoutFee, Vote) class BidAdmin(admin.ModelAdmin): list_display = ('user', 'url', 'ask', 'offer', 'created', 'modified') list_filter = ('ask_match_sent',) search_fields = [...
agpl-3.0
-6,468,091,422,890,042,000
32.657143
78
0.647708
false
3.542857
false
false
false
vedujoshi/tempest
tempest/lib/services/volume/v1/backups_client.py
2
4121
# Copyright 2014 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
-1,210,057,286,072,288,000
36.807339
79
0.640136
false
3.970135
false
false
false
lkundrak/scraperwiki
scraperlibs/python/scraperwiki/datastore.py
2
5871
# -*- coding: utf-8 -*- import cgi import datetime import os import re import socket import socket import string import types import urllib import urllib2 try : import json except: import simplejson as json import scraperwiki m_socket = None m_host = None m_port = None m_scrapername = None m_runid = None m_attach...
agpl-3.0
4,350,402,553,948,568,600
28.80203
123
0.651167
false
3.521896
false
false
false
athena-voice/athena-voice-client
athena/brain.py
1
7744
""" The "Brain" class handles most of Hey Athena's processing. To listen for input, use ``brain.inst.run()`` """ import traceback import os import yaml import re from athena import settings, stt, tts, apis, mods inst = None def init(): global inst inst = Brain() class Brain():...
gpl-3.0
8,139,331,834,030,864,000
33.2
106
0.462035
false
4.093023
false
false
false
dugan/mockit
mockit/manager.py
1
4360
# -*- mode: python -*- # # Copyright (c) 2006-2008,2010 rPath, Inc. All Rights Reserved. # Copyright (c) 2010 David Christian. All Rights Reserved. # # This file is licensed under the MIT License, which is available from # http://www.opensource.org/licenses/mit-license.php from mockit.utils import Call _NO_VALUE = ...
mit
-9,178,784,451,611,186,000
31.537313
108
0.581881
false
3.723313
false
false
false
lukashermann/pytorch-rl
core/envs/atari_ram.py
3
1921
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from copy import deepcopy from gym.spaces.box import Box import inspect from utils.helpers import Experience # NOTE: here state0 is always "None" from utils.helpers import preproce...
mit
5,669,887,294,482,565,000
33.927273
110
0.651223
false
3.666031
false
false
false
kaosbeat/datakamp
RFIDIOt-master/rfidiot-cli.py
1
16476
#!/usr/bin/python # rfidiot-cli.py - CLI for rfidiot # # Adam Laurie <adam@algroup.co.uk> # http://rfidiot.org/ # # This code is copyright (c) Adam Laurie, 2012, All rights reserved. # For non-commercial use only, the following terms apply - for all other # uses, please contact the author: # # This code is...
mit
-2,616,616,209,672,398,300
29.796262
118
0.591648
false
3.034254
false
false
false
yesudeep/cmc
app/configuration.py
1
7998
#!/usr/bin/env python # -*- coding: utf-8; mode: python; tab-width: 4; indent-tabs-mode: nil; -*- # Application configuration. # Copyright (c) 2009 happychickoo. # # The MIT License # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (th...
mit
-7,476,782,915,306,939,000
35.857143
97
0.672668
false
3.201761
false
false
false
ganggbang/scrapy_boards
first/spiders/test.py
1
24021
# -*- coding:utf8 -*- import re #from first.items import FirstItem from first.items import Board #from scrapy.selector import HtmlXPathSelector from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.contrib.loader import XPathItemLoader #from scrapy.contrib.loader.processor import Compose from ...
gpl-2.0
-7,480,904,449,368,698,000
39
235
0.514458
false
3.331945
false
false
false