repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
compmem/ptsa
ptsa/contributed.py
1
5088
#emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- #ex: set sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See the COPYING file distributed along with the PTSA package for the # copyright and license terms. # ### ### ### ### ### ### ### #...
gpl-3.0
476,988,255,454,992,800
46.111111
87
0.608491
false
3.741176
false
false
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.2/Lib/curses/textpad.py
1
6125
"""Simple textbox editing widget with Emacs-like keybindings.""" import sys, curses, ascii def rectangle(win, uly, ulx, lry, lrx): "Draw a rectangle." win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1) win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1) win.hline(lry, ulx+1, curses.ACS_HLINE, l...
mit
-3,937,226,348,817,307,000
35.676647
83
0.513469
false
3.417969
false
false
false
yausern/stlab
devices/BFWrapper.py
1
12067
"""BFWrapper - Driver to communicate with the custom BFDaemon Temperature server This driver is NOT based on a VISA instrument. It only implements a TCP socket via the standard socket package. The socket implementation is in :any:`stlab.utils.MySocket`. The idea is that the server script is run on the fridge control...
gpl-3.0
-8,915,909,912,912,926,000
33.167139
195
0.583865
false
4.347873
false
false
false
ImageIntelligence/mimiron
mimiron/core/commands/bump.py
1
5673
# -*- coding: utf-8 -*- import humanize from datetime import datetime from mimiron.core.commands import Command as _Command from mimiron.core import io from mimiron.core.util.time import pretty_print_datetime from mimiron.exceptions.vendor import NoChangesEmptyCommit from mimiron.exceptions.commands import InvalidOpe...
mit
1,390,949,644,996,104,000
45.884298
117
0.657677
false
4.037722
true
false
false
daniel-noland/MemoryOracle
memoryoracle/memoryoracle/migrations/0003_auto_20150402_2000.py
1
2135
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('memoryoracle', '0002_auto_20150402_2000'), ] operations = [ migrations.AlterField( model_name='commit', ...
lgpl-3.0
-5,411,211,044,535,046,000
37.125
133
0.599532
false
3.612521
false
false
false
nano-bio/fitlib
chemlib.py
1
3731
from suds.client import Client import suds import time import helplib as hl #be aware that you need a chemspider_token.txt in the directory for the app to work #the chemspider_token.txt should only contain the token (available online for free) class ChemicalObject(): def __init__(self, name = '', cas = '', inchi...
bsd-3-clause
8,625,205,568,586,592,000
33.229358
115
0.575985
false
4.206313
false
false
false
joeladams/patternlets
patternlets/mpi4py/12reduction.py
1
1457
# # Illustrates reducing single computed values # in each process to one final value. Both sum and max # of the value are illustratrated. # # Libby Shoop, Macalester College, July 2019 # # Example usage: # python run.py ./12reduction.py N # Here the N signifies the number of processes to start up in mpi...
gpl-2.0
-5,984,983,994,155,611,000
30
75
0.647907
false
3.597531
false
false
false
RNAEDITINGPLUS/main
node/reditools-1.0.4/reditools/AnnotateTable.py
1
7260
#!/home/epicardi/bin/python27/bin/python # Copyright (c) 2013-2014 Ernesto Picardi <ernesto.picardi@uniba.it> # # 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 ...
apache-2.0
3,923,152,039,977,170,400
29.504202
139
0.596556
false
2.469388
false
false
false
fred49/linshare-api
linshareapi/admin/domains.py
1
6787
#! /usr/bin/env python # -*- coding: utf-8 -*- # This file is part of Linshare api. # # LinShare api is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any...
gpl-3.0
-5,950,143,216,252,916,000
34.7
93
0.566416
false
3.843059
false
false
false
Gobie/gjslinter
tools/closure_linter/ecmalintrules.py
1
35029
#!/usr/bin/env python # # Copyright 2008 The Closure Linter 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 #...
mit
-4,138,106,295,904,785,000
42.299135
80
0.621599
false
4.181069
false
false
false
dmlc/xgboost
tests/python-gpu/test_gpu_training_continuation.py
1
1868
import numpy as np import xgboost as xgb import json rng = np.random.RandomState(1994) class TestGPUTrainingContinuation: def test_training_continuation(self): kRows = 64 kCols = 32 X = np.random.randn(kRows, kCols) y = np.random.randn(kRows) dtrain = xgb.DMatrix(X, y) ...
apache-2.0
-2,706,841,553,778,259,500
37.122449
78
0.500535
false
3.271454
false
false
false
lonecow/FantasyFootballData
Source/DataStore/EspnParser/EspnKickerParser.py
1
2796
''' Created on Aug 23, 2015 @author: robertbitel ''' from bs4 import BeautifulSoup try: import urllib2 # @UnresolvedImport @UnusedImport except: import urllib.request as urllib2 # @Reimport class EspnKickerStatHeader(object): def __init__(self, soup): '''for now we are just going to hard code it...
gpl-2.0
887,798,076,194,873,700
37.847222
148
0.567239
false
3.548223
false
false
false
lchamon/pubs2html
pubs2html.py
1
3841
#! /usr/bin/python # -*- coding: utf-8 -*- import os import argparse from copy import deepcopy import bibtexparser from bibtexparser.bparser import BibTexParser from jinja2 import Environment, FileSystemLoader from auxfun import * PATH = os.getcwdu() # Create command line arguments parser parser = argparse.Argumen...
mit
-1,782,709,776,626,373,000
33.603604
93
0.644103
false
4.051688
false
false
false
lanceman2/quickplot
CORNET-3D-Backend/nodes/spectrum_sensing.py
1
6182
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Spectrum Sensing Nikita # Generated: Wed Feb 26 12:29:17 2014 ################################################## from gnuradio import blocks from gnuradio import eng_notation from gnuradio import fft from gnu...
gpl-3.0
3,438,281,338,201,884,000
36.695122
125
0.56438
false
3.767215
false
false
false
erudit/zenon
eruditorg/core/authorization/migrations/0007_auto_20180308_0909.py
1
1352
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2018-03-08 14:09 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('authorization', '0006_auto_20180228_1538'), ] operations = [ migrations.Alt...
gpl-3.0
5,970,252,888,303,922,000
65.9
908
0.727952
false
3.716667
false
false
false
dmlc/xgboost
demo/guide-python/data_iterator.py
1
3333
'''A demo for defining data iterator. .. versionadded:: 1.2.0 The demo that defines a customized iterator for passing batches of data into `xgboost.DeviceQuantileDMatrix` and use this `DeviceQuantileDMatrix` for training. The feature is used primarily designed to reduce the required GPU memory for training on di...
apache-2.0
590,476,135,665,943,400
29.027027
79
0.622562
false
3.703333
false
false
false
dlhocker/neurocontrol-
tf_funs.py
1
13943
import tensorflow as tf import numpy as np import math def mvMul(m,v): #Function for matrix vector multiplication of form Mv #where v is rank 1 tensor and M is rank 2 return tf.squeeze(tf.matmul(m,tf.expand_dims(v,axis=1))) def vmMul(v,m): #Function for matrix vector multiplication of form vM #whe...
bsd-2-clause
-711,695,298,691,742,000
40.870871
111
0.650936
false
2.700562
false
false
false
necaris/python3-openid
openid/test/test_consumer.py
1
79190
import urllib.parse import time import warnings import pprint from openid.message import Message, OPENID_NS, OPENID2_NS, IDENTIFIER_SELECT, \ OPENID1_NS, BARE_NS from openid import cryptutil, oidutil, kvform from openid.store.nonce import mkNonce, split as splitNonce from openid.consumer.discover import OpenIDSer...
apache-2.0
-540,875,542,752,631,940
34.368468
146
0.610974
false
4.075237
true
false
false
ornlneutronimaging/iBeatles
ibeatles/_version.py
1
15763
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
mit
7,472,152,808,798,418,000
33.267391
79
0.577809
false
3.894022
false
false
false
GFibrizo/TPS_7529
TP2/TSP/tsp.py
1
4668
#coding=utf-8 import itertools import sys import time def read_distance_matrix(file_name): '''file_name: the name of a file that stores a matrix. Each line is a row and columns are separated by whitespace. Returns a dictionary with the following format {Vertex:{neighbour: distance, neighbour: distance...
apache-2.0
-2,306,639,255,912,888,000
39.912281
115
0.647084
false
3.952542
false
false
false
frederick623/HTI
frr/conv_csv_xlsx.py
1
3805
import xlsxwriter import sqlite3 import csv import decimal from tkinter import * def dec(s): if s == "": return s try: return decimal.Decimal(str(s)) except: return s def question_marks(st): question_marks = '?' for i in range(0, len(st.split(','))-1): question_marks = question_marks + ",?" ...
apache-2.0
3,680,814,356,078,966,000
30.196721
176
0.659396
false
2.560565
false
false
false
interlegis/sapl
sapl/protocoloadm/migrations/0035_auto_20201013_1147.py
1
1888
# Generated by Django 2.2.13 on 2020-10-13 14:47 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('protocoloadm', '0034_auto_20200708_1312'), ] operations = [ migrations.AlterModelOptions( name='acompanhamentodocumento', o...
gpl-3.0
-3,086,279,697,714,313,700
44.780488
190
0.62227
false
3.799595
false
false
false
rafaels88/py2docx
py2docx/elements/text.py
1
4310
# coding: utf-8 import re class IsNotTextTypeException(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) class Text(object): pass class Break(Text): def __init__(self): self.xml = """<w:br/>""" def _get_xml(self): ...
mit
-4,237,594,371,022,444,000
30.691176
79
0.427378
false
3.987049
false
false
false
phith0n/mooder
managements/migrations/0001_initial.py
1
1376
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-10 14:23 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
lgpl-3.0
4,721,096,928,858,244,000
41.774194
193
0.638009
false
3.714286
false
false
false
TariqEE/PrivEx
S2/S2-netified/exit_weight.py
1
3218
import argparse import binascii from base64 import b64encode #parser = argparse.ArgumentParser(description='') #parser.add_argument('-c','--consensus', help='consensus filei of exit',required=True) #parser.add_argument('-p','--fingerprint', help='Input fingerprint file',required=True) #args = parser.parse_args() #fin...
bsd-3-clause
3,162,704,049,264,275,000
31.505051
102
0.544438
false
3.387368
false
false
false
AlexandraMercier/RULEngine
Gui/VSSL.py
1
18242
#Under MIT License, see LICENSE.txt import sys, math from PyQt4 import QtGui, QtCore class MainLoop(QtCore.QThread): updateField = QtCore.pyqtSignal() def __init__(self, target): super(MainLoop, self).__init__() self.target = target def run(self): run_loop = self.target em...
mit
-7,983,244,941,307,863,000
42.227488
295
0.607828
false
3.380652
false
false
false
ph1l/halo_radio
WebRoot/userInfo.py
1
2329
import HaloRadio.TopWeb as TopWeb class plugin(TopWeb.TopWeb): def GetReqs(self): return "amv" def handler(self, context): import HaloRadio.UserSongStatsListMaker as UserSongStatsListMaker import HaloRadio.UserSongStats as UserSongStats import HaloRadio.Song as Song import HaloRadio.Use...
gpl-2.0
4,962,631,253,909,114,000
29.644737
96
0.67368
false
2.951838
false
false
false
Brocade-OpenSource/OpenStack-DNRM
dnrm/openstack/common/rpc/impl_zmq.py
1
26383
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Cloudscaling Group, 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/LI...
apache-2.0
6,411,135,958,319,191,000
31.292534
78
0.565743
false
4.043372
false
false
false
troych/PlexKodiConnect
resources/lib/musicutils.py
1
11073
# -*- coding: utf-8 -*- ################################################################################################# import logging import os import xbmc import xbmcaddon import xbmcvfs from mutagen.flac import FLAC, Picture from mutagen.id3 import ID3 from mutagen import id3 import base64 import read_embyser...
gpl-2.0
8,538,066,247,943,820,000
37.318339
169
0.579969
false
4.153413
false
false
false
kk71/kkblog
kkblog/blog/admin.py
1
4876
from datetime import datetime from django.utils import timezone from django.contrib import admin import django.db.models import django.forms from django.utils.timezone import template_localtime from . import models @admin.register(models.config) class configAdmin(admin.ModelAdmin): list_display = ("enabled","dom...
mit
-2,627,663,060,335,687,700
29.324841
93
0.659244
false
3.606061
false
false
false
OFAI/hub-toolbox-python3
tests/approximate_test.py
1
3435
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This file is part of the HUB TOOLBOX available at https://github.com/OFAI/hub-toolbox-python3/ The HUB TOOLBOX is licensed under the terms of the GNU GPLv3. (c) 2018, Roman Feldbauer Austrian Research Institute for Artificial Intelligence (OFAI) Contact: <roman.feldba...
gpl-3.0
1,570,747,357,017,596,700
38.034091
78
0.560408
false
3.754098
true
false
false
hugokernel/LaVieDePoule
core/fake.py
1
3343
class Twython(): def __init__(self, consumer_key, consumer_secret, oauth_token, oauth_secret): pass def update_status(self, status, media=None): pass def update_status_with_media(self, status, media): pass def get_mentions_timeline(self): return [] class TwythonError(Ex...
gpl-2.0
236,444,738,955,579,940
19.260606
105
0.563566
false
3.428718
false
false
false
davidcox/glumpy
demos/demo-game-of-life.py
1
1848
#!/usr/bin/env python # -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (C) 2009-2010 Nicolas P. Rougier # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #---------------...
bsd-3-clause
-7,891,641,923,093,851,000
27.875
78
0.510281
false
2.733728
false
false
false
akszydelko/django-track-history
track_history/migrations/0001_initial.py
1
2138
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb import django.db.models.deletion from django.conf import settings from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_cont...
bsd-3-clause
3,954,619,766,035,894,000
56.783784
216
0.652011
false
4.276
false
false
false
rysiekpl/pytoxcore
examples/echobot.py
1
27506
#!/usr/bin/env python # -*- coding: utf-8 -*- __title__ = "echobot" __version__ = "0.0.11" __author__ = "Anton Batenev" __license__ = "BSD" import sys import os import time import re from pytoxcore import ToxCore # PEP-8 try: import configparser as EchoBotConfigParser except ImportError: import Conf...
gpl-3.0
6,515,783,769,299,530,000
33.685984
171
0.564945
false
3.081168
false
false
false
Rbeaty88/ginga
ginga/gtkw/plugins/Contents.py
1
6808
# # Contents.py -- Table of Contents plugin for fits viewer # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from ginga import GingaPlugin from ginga.misc import Bunch ...
bsd-3-clause
-1,265,078,857,768,437,500
31.574163
68
0.548032
false
3.588824
false
false
false
maweis1981/hey001
mayversion/mayversion/locations/views.py
1
11407
#!/usr/bin/env python # encoding: utf-8 from django.shortcuts import render_to_response, get_object_or_404, HttpResponse, get_list_or_404 from locations.models import Location from reminds.models import Remind, RemindLocation, REMINDS_STATUS, RemindSendResult from django.http import HttpResponse from django.contrib.au...
lgpl-3.0
-7,115,315,267,056,703,000
39.351064
134
0.591616
false
3.887598
false
false
false
msmexplorer/msmexplorer
examples/plot_msm_network.py
1
1085
""" MSM Network Plot ================ """ from msmbuilder.example_datasets import FsPeptide from msmbuilder.featurizer import DihedralFeaturizer from msmbuilder.decomposition import tICA from msmbuilder.cluster import MiniBatchKMeans from msmbuilder.msm import MarkovStateModel import numpy as np import msmexplorer as...
mit
4,521,890,556,250,788,400
26.820513
72
0.76129
false
2.862797
false
true
false
thecoinproject/ccointestbed
contrib/bitrpc/bitrpc.py
1
7832
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") else: access = Ser...
mit
4,159,428,778,615,045,000
23.17284
79
0.661517
false
3.053411
false
false
false
karstenw/nodebox-pyobjc
examples/New Functions/Example arc 5.py
1
3119
size(780,780) background(None) import math import pprint nofill() stroke(0) speed(36) def drawArcedCircle(x,y,r,n,s,sw,t,o): """x,y - center r - radius n - no of segments s - gray intensity sw - strokewidth t - alpha o - orientation (angle) """ n = int(n) sw ...
mit
-9,111,633,262,801,859,000
21.933824
103
0.595704
false
2.91768
false
false
false
kybi/django-haystack
test_haystack/test_discovery.py
2
1616
from django.conf import settings from django.test import TestCase from haystack import connections, connection_router from haystack.query import SearchQuerySet from haystack.utils.loading import UnifiedIndex from test_haystack.discovery.models import Foo from test_haystack.discovery.search_indexes import FooIndex, Ba...
bsd-3-clause
7,599,241,469,486,641,000
34.130435
132
0.688738
false
3.912833
true
false
false
hlin117/scikit-learn
sklearn/metrics/classification.py
1
72721
"""Metrics to assess performance on classification task given class prediction Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramf...
bsd-3-clause
-1,315,448,386,885,776,600
37.193803
90
0.603622
false
3.91668
false
false
false
a-gibbon/verbose-journey
pe_scanner/pe_scanner.py
1
35198
#!/usr/bin/env python from __future__ import print_function import argparse import base64 import binascii import cgi import contextlib import cPickle import datetime import hashlib import os import psutil import re import string import StringIO import sys try: import pefile import peutils except ImportError:...
gpl-3.0
7,959,678,950,276,369,000
46.05615
240
0.514433
false
4.281474
false
false
false
scionrep/scioncc
src/pyon/ion/service.py
1
16397
#!/usr/bin/env python """Service process base class and service management""" __author__ = 'Adam R. Smith, Michael Meisinger' import json from types import ModuleType from zope.interface import implementedBy from pyon.core.exception import BadRequest, ServerError, NotFound from pyon.util.log import log from pyon.ut...
bsd-2-clause
-7,876,503,320,026,529,000
38.133652
141
0.589376
false
4.301417
false
false
false
cosmopod/MIT_6001
hangman/ps3_hangman.py
1
5163
# 6.00 Problem Set 3 # # Hangman game # # ----------------------------------- # Helper code # You don't need to understand this helper code, # but you will have to know how to use the functions # (so be sure to read the docstrings!) import random import string WORDLIST_FILENAME = "/home/paco/workspace/MIT_6001/hangm...
mit
-8,770,799,421,853,816,000
30.674847
105
0.639357
false
4.197561
false
false
false
lenck/vlb
python/verifiers/mlesac.py
1
5229
"""MLESAC implementation from https://github.com/vcg-uvic/learned-correspondence-release/blob/master/tests.py""" import cv2 import numpy as np from verifiers.VerificationTemplate import VerificationTemplate MIN_PT_NUM = 8 class MLESAC(VerificationTemplate): def __init__(self): super( MLESAC...
bsd-2-clause
-2,878,683,303,937,815,600
30.884146
100
0.596672
false
3.180657
false
false
false
undu/query-bot
querybot.py
1
3141
#encoding: utf-8 from irc import IRCBot from google.googleSearch import GoogleSearch from music.musicStatus import MusicStatus from urlshortener.shortener import Shortener from wolfram.wolfram import Wolfram from ConfigParser import SafeConfigParser import random import codecs config_name_g = u'config' class QueryBot...
mpl-2.0
-461,915,542,803,741,500
43.239437
144
0.608087
false
4.105882
true
false
false
cheral/orange3
Orange/widgets/model/owtree.py
1
4165
"""Tree learner widget""" from AnyQt.QtCore import Qt from collections import OrderedDict from Orange.data import Table from Orange.modelling.tree import TreeLearner from Orange.widgets import gui from Orange.widgets.settings import Setting from Orange.widgets.utils.owlearnerwidget import OWBaseLearner class OWTree...
bsd-2-clause
-4,523,151,340,148,928,500
36.522523
80
0.609604
false
3.835175
false
false
false
vidartf/hyperspyUI
hyperspyui/mainwindowbase.py
1
16865
# -*- coding: utf-8 -*- # Copyright 2014-2016 The HyperSpyUI developers # # This file is part of HyperSpyUI. # # HyperSpyUI 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
3,408,245,657,871,225,000
34.282427
79
0.634806
false
4.141699
false
false
false
williballenthin/synapse
synapse/tests/test_tools_easycert.py
1
2193
from synapse.tests.common import * import synapse.tools.easycert as s_easycert #pars.add_argument('--certdir', default='~/.syn/certs', help='Directory for certs/keys') ##pars.add_argument('--signas', help='sign the new cert with the given cert name') #pars.add_argument('--ca', default=False, action='stor...
apache-2.0
-4,019,805,239,567,408,000
40.377358
114
0.582763
false
3.431925
true
false
false
ttx/openstack-releasing
upload_release.py
1
5770
#!/usr/bin/python # # Script to upload an OpenStack release to Launchpad # # Copyright 2011-2013 Thierry Carrez <thierry@openstack.org> # 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 # ...
apache-2.0
2,027,131,115,071,402,800
33.550898
79
0.645061
false
3.526895
false
false
false
sbradley7777/sx
lib/sx/__init__.py
1
13006
#!/usr/bin/env python """ This contains Global variables for sx. @author : Shane Bradley @contact : sbradley@redhat.com @version : 2.17 @copyright : GPLv2 """ import sys import os.path import logging import datetime from sx.logwriter import LogWriter """ @cvar MAIN_LOGGER_NAME: The name of the main logger ...
gpl-2.0
-8,577,914,449,003,987,000
38.531915
146
0.61141
false
4.237862
true
false
false
tysonholub/twilio-python
twilio/rest/api/v2010/account/sip/__init__.py
1
4766
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base.page import Page from twilio.rest.api.v2010.account.sip.credential_list ...
mit
4,709,373,387,061,639,000
29.551282
98
0.619387
false
3.96836
false
false
false
mandarjog/cfawsinit
genhosts.py
1
2523
#!/usr/bin/env python import socket import sys import yaml from boto3.session import Session def genhosts(elbip, sysdomain, outfile=sys.stdout): SYS_PREFIXES = [ 'console', 'uaa', 'apps', 'login', 'api', 'loggregator', 'doppler'] print >>outfile, elbip,...
apache-2.0
-7,059,568,654,757,416,000
28.337209
74
0.619104
false
3.470426
false
false
false
obitec/django-maslow
maslow/models.py
1
5045
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from django.contrib.contenttypes.models import ContentType from django.contrib.flatpages.models import FlatPage from django.contrib.postgres.fields import JSONField from mptt.models import MPTTModel, T...
mit
5,375,735,433,910,312,000
29.029762
112
0.656293
false
3.685172
false
false
false
ivankreso/stereo-vision
scripts/stereo_model/generate_features_without_noise.py
1
12412
#!/bin/python import os, shutil import numpy as np import matplotlib.pyplot as plt import np_helper as nph # generate 3D points around points in pts_center using gaussian distribution def generate_points(Rt_inv, pts_center, pts_sigma, pts_fixed, pts_num, axis_range): # allocate mem for points points = np.zeros...
bsd-3-clause
5,381,356,208,981,378,000
35.940476
124
0.591444
false
2.453449
false
false
false
electrumalt/electrum-doge
lib/util.py
1
10486
import os, sys, re, json import platform import shutil from datetime import datetime from i18n import _ class NotEnoughFunds(Exception): pass class InvalidPassword(Exception): def __str__(self): return _("Incorrect password") class MyEncoder(json.JSONEncoder): def default(self, obj): from tra...
gpl-3.0
-2,593,915,115,404,252,700
27.728767
103
0.566374
false
3.721079
false
false
false
rahulnadella/Sort_Algorithms
countingsort/countingsort.py
1
1805
""" Counting sort is applicable when each input is known to belong to a particular set, S, of possibilities. The algorithm runs in O(|S| + n) time and O(|S|) memory where n is the length of the input. It works by creating an integer array of size |S| and using the ith bin to count the occurrences of the ith member of S...
bsd-2-clause
-8,898,163,919,927,407,000
35.1
83
0.711357
false
3.752599
false
false
false
ace02000/pyload
module/plugins/hoster/OboomCom.py
1
5010
# -*- coding: utf-8 -*- # # Test links: # https://www.oboom.com/B7CYZIEB/10Mio.dat import re from module.common.json_layer import json_loads from module.plugins.internal.Hoster import Hoster from module.plugins.captcha.ReCaptcha import ReCaptcha class OboomCom(Hoster): __name__ = "OboomCom" __type__ =...
gpl-3.0
8,578,525,133,948,145,000
33.315068
121
0.531936
false
3.627806
false
false
false
raybesiga/postie
postie/main.py
1
4174
from jinja2 import Template from mailthon.postman import Postman from mailthon import email from mailthon.middleware import TLS, Auth from collections import OrderedDict from threading import Thread import twilio from twilio.rest import TwilioRestClient import csv class Postie(object): def __init__(self, args):...
mit
2,404,502,805,721,415,700
30.862595
77
0.566124
false
4.207661
false
false
false
saifulazad/myApp
app/models.py
1
2513
from app import db # create Question model class Question(db.Model): questionID = db.Column(db.Integer, primary_key=True) description = db.Column(db.String(300), unique=True) categoryID = db.Column(db.Integer, db.ForeignKey('category.ID')) userID = db.Column(db.Integer, db.ForeignKey('register...
bsd-3-clause
814,156,518,849,443,600
30.217949
86
0.654596
false
3.451923
false
false
false
wusung/ipython-notebook-tabs
kyper/nbformat/reader.py
1
2054
"""API for reading notebooks of different versions""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import json class NotJSONError(ValueError): pass def parse_json(s, **kwargs): """Parse a JSON string into a dict.""" try: nb_dict = json.load...
apache-2.0
-8,334,260,586,620,415,000
23.746988
88
0.630477
false
4.141129
false
false
false
MartinThoma/algorithms
wiki-images/wikicommons.py
1
7613
#!/usr/bin/env python """Get all images of a wikipedia commons category.""" import json import logging import os import sys import urllib # images import urllib2 # text import xmltodict logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.DEBUG, ...
mit
-2,422,800,461,101,435,400
29.947154
78
0.575857
false
3.954805
false
false
false
lionicsheriff/tagi
tests/test_db.py
1
7480
import unittest import os from os.path import dirname, isfile, isdir import shutil from sqlalchemy import create_engine from sqlalchemy.sql import text from context import tagi from tagi import data from tagi.data import Document, Tag, Tagi import string import random def create_test_database(): # if isfile('ta...
mit
1,948,154,779,794,434,600
35.487805
120
0.59746
false
3.283582
true
false
false
macosforge/ccs-calendarserver
txdav/who/test/test_xml.py
1
4229
## # Copyright (c) 2014-2017 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
8,154,189,853,401,566,000
31.282443
77
0.597777
false
4.162402
true
false
false
novel/fbsd-libvirt
src/esx/esx_vi_generator.py
1
67472
#!/usr/bin/env python # # esx_vi_generator.py: generates most of the SOAP type mapping code # # Copyright (C) 2010-2012 Matthias Bolte <matthias.bolte@googlemail.com> # # 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...
lgpl-2.1
4,610,629,601,734,102,500
33.689974
108
0.515651
false
3.984881
false
false
false
xenserver/xsconsole
plugins-oem/XSFeatureOEMRestore.py
1
4596
# Copyright (c) 2008-2009 Citrix Systems Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 only. # # This program is distributed in the hope that it will be useful, # but WITHOUT ...
gpl-2.0
-4,565,042,161,348,850,700
39.315789
173
0.585292
false
4.528079
false
false
false
hartwork/wnpp.debian.net
wnpp_debian_net/pagination.py
1
3019
# Copyright (C) 2021 Sebastian Pipping <sebastian@pipping.org> # Licensed under GNU Affero GPL v3 or later # # 7dda3eab17f495d5b972fc8c67e69d47c12aedb4347116d1443778b05e7839c4 from typing import Optional _DEFAULT_MAX_ITEM_COUNT = 11 _DEFAULT_ENDING_ITEM_COUNT = 2 ELLIPSIS = None def iterate_page_items(total_page_c...
gpl-2.0
4,984,557,916,747,566,000
40.930556
99
0.635972
false
3.434585
false
false
false
pmquang/python-anyconfig
anyconfig/template.py
1
4137
# # Jinja2 (http://jinja.pocoo.org) based template renderer. # # Author: Satoru SATOH <ssato redhat.com> # License: MIT # # pylint: disable=unused-argument """Template rendering module for jinja2-based template config files. """ from __future__ import absolute_import import logging import os import anyconfig.compat ...
mit
7,037,113,749,154,182,000
28.76259
79
0.610104
false
3.906516
false
false
false
AllanYangZhou/oppia
core/domain/story_domain.py
1
37976
# Copyright 2018 The Oppia 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 applicable ...
apache-2.0
893,305,299,091,704,700
38.271975
80
0.592374
false
4.213002
false
false
false
giruenf/GRIPy
algo/clustering.py
1
2926
# -*- coding: utf-8 -*- import numpy as np from sklearn.cluster import KMeans from sklearn.mixture import GMM from sklearn.preprocessing import scale from sklearn import metrics def locate_nans(data): return np.sum(np.isnan(data), axis=1, dtype=bool) def reorder_clusters(clusters, centers, covars=None): n...
apache-2.0
8,800,667,600,104,488,000
26.866667
81
0.566986
false
3.010288
false
false
false
CognizantOneDevOps/Insights
PlatformAgents/com/cognizant/devops/platformagents/agents/alm/rally/RallyAgent3.py
1
21307
#------------------------------------------------------------------------------- # Copyright 2017 Cognizant Technology Solutions # # 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:...
apache-2.0
-1,252,210,250,207,332,600
67.514469
247
0.54522
false
5.093713
true
false
false
sarojaerabelli/HVGS
CareerTinderServer/CareerTinder/migrations/0002_auto_20160918_0011.py
1
2489
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-18 04:11 from __future__ import unicode_literals import CareerTinder.listfield from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('CareerTinder', '0001_initial'), ] operations = [ ...
mit
-312,604,067,760,723,900
30.1125
143
0.530735
false
4.148333
false
false
false
SKLCC-Python/SKLCC_MSZ_YCL
sklcc/rawSql.py
1
3606
# -*- coding: utf-8 -*- __author__ = 'XuWeitao' from django.db.transaction import connections from django.db import transaction from tempfile import TemporaryFile class Raw_sql(object): """ 创建Django与数据库的短连接,通过给sql传递原始sql语句,query_one来返回单条记录,query_all返回所有查询结果的记录 如果查询不到返回False,若对数据库执行删除,插入或者更新操作,需要在传入SQL之后,调用update函数...
apache-2.0
-3,673,018,033,803,256,300
24.535714
81
0.707343
false
2.123237
false
false
false
RapidLzj/Scheduler
xao/conf/nowt_new/fieldcheck.py
1
1565
""" NOWT field check, compare with SDSS DR12 catalog """ import MySQLdb #from matplotlib import pyplot as plt #%matplotlib inline import math import time if __name__ == "__main__" : conn = MySQLdb.connect("localhost", "uvbys", "uvbySurvey", "surveylog") cur = conn.cursor() sql_f = "select field_id, ...
gpl-3.0
4,148,203,642,001,364,000
29.096154
117
0.538019
false
2.679795
false
false
false
tetherless-world/satoru
whyis/blueprint/sparql/sparql_view.py
1
1537
import requests from flask import request, redirect, url_for, current_app, Response from whyis.blueprint.sparql import sparql_blueprint from whyis.decorator import conditional_login_required @sparql_blueprint.route('/sparql', methods=['GET', 'POST']) @conditional_login_required def sparql_view(): has_query = Fal...
apache-2.0
-1,220,158,731,202,788,600
40.540541
89
0.643461
false
3.930946
false
false
false
google/upvote
upvote/gae/bigquery/tables.py
1
18037
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-4,160,475,148,344,117,000
36.113169
113
0.674003
false
3.925354
false
false
false
asta-kit/friwahl-legacy
Client/wahlbet/wahlbet2.py
1
6020
#! /usr/bin/env python2 import pgdb import time import sys db = pgdb.connect(database="wahl") fs_wahl = 2 berechtigte = {} berechtigte[0] = 22552 berechtigte[1] = 22552 # StuPa berechtigte[2] = 0 # FS berechtigte[3] = 3543 # Auslaender berechtigte[4] = 5998 # Frauen fs_berechtigte = {} fs_berechtigte['bau'] = ...
gpl-2.0
9,033,287,500,921,363,000
38.346405
169
0.634385
false
2.104159
false
false
false
edouardpoitras/NowTrade
nowtrade/neural_network.py
1
7380
""" Module that enables the use of neural networks with NowTrade. """ import cPickle import numpy as np from pybrain.tools.shortcuts import buildNetwork from pybrain.datasets.supervised import SupervisedDataSet from pybrain.supervised.trainers.backprop import BackpropTrainer from nowtrade import logger # Networks FEED...
mit
2,857,161,219,565,210,000
35.35468
97
0.613144
false
4.221968
false
false
false
larsks/cloud-init
cloudinit/config/cc_ssh_import_id.py
1
2951
# Copyright (C) 2009-2010 Canonical Ltd. # Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # # This file is part of cloud-init. See LICENSE file for license information. """ SSH Import Id ---------...
gpl-3.0
5,647,572,267,971,931,000
26.073394
79
0.589631
false
3.572639
false
false
false
Ocramius/FrameworkBenchmarks
dart-stream/setup.py
1
2740
import subprocess import sys import setup_util import os def start(args, logfile, errfile): setup_util.replace_text('dart-stream/postgresql.yaml', 'host: .*', 'host: ' + args.database_host) setup_util.replace_text('dart-stream/mongodb.yaml', 'host: .*', 'host: ' + args.database_host) try: # # install dar...
bsd-3-clause
730,512,041,500,943,000
35.533333
190
0.612044
false
3.305187
false
false
false
violarium/file-pyncoder
lib/filters.py
1
1173
import re def match_regexp(reg): """ Get filter, which check if string matches regular expression """ compiled_reg = re.compile(reg) def check_regexp(text): return compiled_reg.match(text) is not None return check_regexp def do_not_match_regexp(reg): """ Get filter, which ch...
mit
3,347,033,490,133,715,500
22.019608
71
0.608696
false
3.949495
false
false
false
CantemoInternal/django-comments-xtd
django_comments_xtd/forms.py
1
1956
from django import forms from django.contrib.comments.forms import CommentForm from django.utils.translation import ugettext_lazy as _ from django_comments_xtd.conf import settings from django_comments_xtd.models import TmpXtdComment class XtdCommentForm(CommentForm): followup = forms.BooleanField( requir...
bsd-2-clause
-7,602,059,996,940,410,000
43.454545
87
0.621677
false
4.224622
false
false
false
alexandermendes/pybossa-github-builder
tests/test_github_repo.py
1
2749
# -*- coding: utf8 -*- import json from default import Test from nose.tools import assert_raises from pybossa_github_builder.github_repo import GitHubRepo, GitHubURLError from pybossa_github_builder.github_repo import InvalidPybossaProjectError from mock import MagicMock, patch class TestGitHubRepo(Test): def s...
bsd-3-clause
2,400,905,389,438,158,300
41.953125
79
0.615497
false
3.537967
true
false
false
clusterpy/clusterpy
clusterpy/core/geometry/centroids.py
1
2025
"""Centroids calculation module """ __author__ = "Juan C. Duque, Alejandro Betancourt" __credits__= "Copyright (c) 2009-10 Juan C. Duque" __license__ = "New BSD License" __version__ = "1.0.0" __maintainer__ = "RiSE Group" __email__ = "contacto@rise-group.org" __all__ = ['getCentroids'] def getCentroids(layer): ""...
bsd-3-clause
7,795,227,984,554,539,000
32.75
78
0.567901
false
3.352649
false
false
false
soedinglab/hh-suite
scripts/hh_reader.py
1
7196
#!/usr/bin/env python """ Parser for hhr result files created with hhblits|hhsearch|hhalign -o <hhr_file> """ import sys from collections import namedtuple __author__ = 'Markus Meier (markus.meier@mpibpc.mpg.de)' __version__ = '1.0' __license__ = "GPL-3" hhr_alignment = namedtuple('hhr_alignment', ['query_id', '...
gpl-3.0
-3,291,334,199,836,723,700
34.27451
112
0.496804
false
4.152337
false
false
false
linuxscout/mishkal
interfaces/web/adawaty.py
1
6234
#!/usr/bin/python # -*- coding: UTF-8 -*- #------------------------------------------------------------------------------- # Name: adawaty # Purpose: web interface tools for manipulating arabic texts. # # Author: Taha Zerrouki (taha.zerrouki[at]gmail.com) # # Created: 31-10-2011 # Copyright: (c) Ta...
gpl-3.0
6,652,621,765,697,517,000
29.181373
95
0.573006
false
3.390419
false
false
false
bikash/pyhsmm
internals/transitions.py
1
21202
from __future__ import division import numpy as np import scipy.stats as stats from numpy import newaxis as na np.seterr(invalid='raise') import operator import copy from scipy.special import digamma, gammaln from ..basic.abstractions import GibbsSampling from ..basic.distributions import GammaCompoundDirichlet, Mult...
mit
-1,459,834,514,646,146,300
35.304795
100
0.654325
false
3.467212
false
false
false
Hanaasagi/Ushio
app/user/handler.py
1
8483
# -*-coding:UTF-8-*- import os import tornado.web import tornado.gen from hashlib import md5 from bson import ObjectId from app.user.model import UserModel from ushio._base import BaseHandler class ProfileHandler(BaseHandler): def initialize(self): super(ProfileHandler, self).initialize() @tornado.w...
mit
-4,958,927,093,340,616,000
29.702206
77
0.502096
false
4.095635
false
false
false
SciVis/Orfan
orfan.py
1
1902
import argparse import json import os import shutil missing_modules = {} try: import orfan except ImportError: missing_modules['orfan'] = "main Orfan module missing" if len(missing_modules)>0: print("Error: Missing python modules:") for k,v in missing_modules.items(): print(" {:20s} {}".fo...
bsd-3-clause
-404,678,531,715,429,300
30.7
102
0.599895
false
3.622857
false
false
false
zhaochunqi/simiki
setup.py
1
1418
#!/usr/bin/env python from __future__ import with_statement import os from setuptools import setup, find_packages import simiki entry_points = { "console_scripts": [ "simiki = simiki.cli:main", ] } with open("requirements.txt") as f: requires = [l for l in f.read().splitlines() if l] readme = "R...
mit
-1,391,033,791,607,931,400
26.269231
72
0.623413
false
3.741425
false
false
false
zaqwes8811/matlab_ext
identification/hided/app-zero-point.py
1
3540
# coding: utf8 """ TODO(?): что будет есть характеристика колебательная? """ # Other from pylab import * from numpy import * from scipy.optimize import leastsq import scipy.interpolate as interpolators # App import dsp_modules.signal_generator as generator from app_math.simple_math_operators import XAxis from dsp...
apache-2.0
-6,201,980,882,857,033,000
21.82069
68
0.536114
false
2.662108
false
false
false
rougier/Neurosciences
basal-ganglia/topalidou-et-al-2014/cython/Piron-C3.py
1
2371
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. # # Contributors: Nicolas P. Rougier (Nicolas.Rougier@inria.fr) # ------------------------------------------------------------------...
bsd-3-clause
2,853,421,431,013,432,300
32.871429
79
0.454239
false
3.436232
false
false
false
selective-inference/selective-inference
doc/learning_examples/calibration/lasso_calibration.py
3
2889
import functools import numpy as np from scipy.stats import norm as ndist import regreg.api as rr from selection.tests.instance import gaussian_instance from selection.learning.utils import full_model_inference, pivot_plot from selection.learning.core import normal_sampler, logit_fit def simulate(n=200, p=100, s=1...
bsd-3-clause
-4,658,582,114,106,776,000
30.402174
85
0.48702
false
3.852
false
false
false
luisbg/gst-introspection
gstgengui/config.py
1
1136
#!/ur/bin/env python # -*- coding: utf-8 -*- """ gst-gengui configuration: * define here your pipelines in the pipeline_desc string * define the named elements you would like to scan for properties * define the properties you would like to skip Copyright 2009, Florent Thiery, under the terms of LGPL """ ignore_list...
lgpl-2.1
8,340,858,921,353,682,000
62.111111
386
0.742077
false
3.37092
false
false
false
ADEQUATeDQ/portalmonitor
odpw/web_rest/rest/odpw_restapi.py
1
1412
# -*- coding: utf-8 -*- import logging import traceback from flask import Blueprint, jsonify, render_template, Response from flask import current_app from odpw.web_rest.rest import settings from sqlalchemy.orm.exc import NoResultFound log = logging.getLogger(__name__) from flask_restplus import Api api = Api(vers...
gpl-3.0
-2,506,452,756,662,868,000
25.641509
85
0.661473
false
3.353919
false
false
false
Xion/SublimeScold
scold/system.py
1
9147
""" Utilities for opening files or URLs in the registered default application and for sending e-mail using the user's preferred composer. Taken from the following recipe: http://code.activestate.com/recipes/511443-cross-platform-startfile-and-mailto-functions/ """ __version__ = '1.1' __all__ = ['open', 'mailto'] imp...
bsd-2-clause
7,890,296,191,320,566,000
30.760417
89
0.58183
false
4.341243
false
false
false
zeldin/libsigrokdecode
decoders/edid/pd.py
1
20600
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012 Bert Vermeulen <bert@biot.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 Foundation; either version 3 of the Lice...
gpl-3.0
2,287,904,141,099,369,500
40.78499
96
0.523689
false
3.397098
false
false
false
KamranMackey/Aurora
plugins/misc/kernel.py
1
1163
# # Copyright (C) 2016-2017 Kamran Mackey and contributors # # 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 option) any later version. import re ...
gpl-3.0
3,291,862,190,493,314,600
34.242424
78
0.661221
false
3.657233
false
false
false
devoidfury/WSGIFire
wsgifire/dispatcher.py
1
1768
import re from wsgifire.helpers import func_from_str from wsgifire.core.helpers import permanent_redirect from wsgifire.exceptions import NoMatchingURL, ViewFunctionDoesNotExist def dispatcher(request, url_seq): """ Match the requested url against patterns defined in settings.URLS and return the resulting ...
agpl-3.0
2,939,113,218,774,517,000
44.333333
130
0.609729
false
4.322738
false
false
false