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
BillyLiggins/fitting
first.py
1
7031
import copy import echidna import echidna.output.plot as plot import echidna.core.spectra as spectra from echidna.output import store import matplotlib.pyplot as plt import argparse import glob import numpy as np import os def convertor(path): flist=np.array(glob.glob(path)) for ntuple in flist: os.sy...
mit
7,131,510,302,467,341,000
34.331658
208
0.594226
false
3.070306
false
false
false
AirChen/MachineLearningDoc
collective_intelligence/chapter_7/treepredict.py
1
6590
#!/usr/bin/python from math import log from PIL import Image, ImageDraw my_data=[['slashdot','USA','yes',18,'None'], ['google','France','yes',23,'Premium'], ['digg','USA','yes',24,'Basic'], ['kiwitobes','France','yes',23,'Basic'], ['google','UK','no',21,'Premium'], ['(direct)','New Zealand','no',12,'None'], ['(...
mit
-6,750,698,513,289,226,000
23.685393
106
0.606222
false
2.636
false
false
false
audunv/andp
python/andp/view/web/remote.py
1
3288
# -*- coding: utf-8; -*- # Copyright (C) 2009 Østfold University College # # This file is part of ANDP. # # ANDP 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 you...
gpl-2.0
-2,934,864,935,421,723,000
30.912621
146
0.653179
false
3.620044
false
false
false
neslihanturan/artge
app/signals.py
1
2014
from django.db.models.signals import post_save, pre_delete, pre_save from django.dispatch import receiver from app.forms import MenuForm from django import forms from app.models import * from django.core.exceptions import ObjectDoesNotExist #from django.db.models.base import ObjectDoesNotExist @receiver(post_save, sen...
gpl-3.0
-2,247,177,136,050,063,400
50.641026
142
0.705561
false
3.722736
false
false
false
jobelenus/thegreco
ignore/tracegen.py
1
1364
#!/usr/bin/env python # vim:ts=4:sts=4:sw=4:et:wrap:ai:fileencoding=utf-8: import collections #import matplotlib.pyplot as plt factor = 1/4 class TraceGenerator(): def __init__(self): fname='/Users/jobelenus/work/thegreco/cpu.entries' self.fname = fname with open(self.fname) as ...
gpl-3.0
8,861,294,036,673,050,000
24.259259
65
0.597507
false
3.037862
false
false
false
sbelharbi/structured-output-ae
sop_embed/experiments/lfpw_4l_out_unl.py
1
14984
from sop_embed.da import DenoisingAutoencoder from sop_embed.tools import NonLinearity from sop_embed.tools import CostType from sop_embed.tools import ModelMLP from sop_embed.tools import train_one_epoch_chuncks from sop_embed.tools import theano_fns from sop_embed.tools import sharedX_value from sop_embed.tools impor...
lgpl-3.0
-4,196,589,584,420,531,700
36.553885
79
0.507475
false
3.122968
false
false
false
gavinhungry/hashbrowns
hashbrowns.py
1
3014
#!/usr/bin/env python2 # # Name: hashbrowns # Auth: Gavin Lloyd <gavinhungry@gmail.com> # Desc: Provides cryptographic hashes with a minimal UI # import os, sys import pygtk, gtk import hashlib import pango import re class Hashbrowns: def __init__(self, filename): self.hash_algs = ['md5', 'sha1', 'sha256', 'sh...
mit
-7,338,854,927,634,280,000
26.4
74
0.627074
false
3.223529
false
false
false
brianjimenez/lightdock
lightdock/pdbutil/PDBIO.py
1
7384
"""Parses Atomic coordinates entries from PDB files""" import math from lightdock.error.lightdock_errors import PDBParsingError, PDBParsingWarning from lightdock.structure.atom import Atom, HetAtom from lightdock.structure.residue import Residue from lightdock.structure.chain import Chain from lightdock.util.logger im...
gpl-3.0
3,553,418,247,596,338,700
39.571429
112
0.492551
false
4.167043
false
false
false
erikriver/eduIntelligent-cynin
src/eduintelligent.courses/eduintelligent/courses/content/coursecontent.py
1
1190
"""Definition of the Lessons content type. """ from zope.interface import implements from Products.Archetypes import atapi from Products.ATContentTypes.content import folder from Products.ATContentTypes.content.schemata import finalizeATCTSchema from eduintelligent.courses.interfaces import ICourseContent from edui...
gpl-3.0
-6,633,798,422,943,174,000
32.055556
77
0.811765
false
4.089347
false
false
false
HELIO-HFC/SDOSS
lib/python/net/pycurl.py
1
1034
#! /usr/bin/env python import sys import subprocess import argparse def pycurl(url, *args, **kwargs): cmd = "curl" if (args): for arg in args: cmd += " "+arg if (kwargs): for k,v in kwargs.iteritems(): if (len(k) == 1): if (v): cmd += " -"+k+" "+v ...
mit
-1,120,644,544,877,389,600
21.977778
74
0.51354
false
3.692857
false
false
false
rfhk/awo-custom
sale_line_quant_extended/models/stock_move.py
1
10584
# -*- coding: utf-8 -*- # Copyright 2015-2017 Quartile Limted # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api, _ class StockMove(models.Model): _inherit = "stock.move" pick_partner_id = fields.Many2one( related='picking_id.partner_id', ...
lgpl-3.0
7,031,241,485,843,623,000
43.470588
148
0.543651
false
3.867008
false
false
false
paris-saclay-cds/ramp-workflow
rampwf/score_types/soft_accuracy.py
1
1665
"""A generalization of the classification accuracy with cross-class scores. Soften the accuracy score by giving scores through certain misclassifications defined by the score matrix. For example, in ordinal regression we may want not to penalize too much misclassifications to neighbor classes. The score also generaliz...
bsd-3-clause
-7,537,339,566,954,264,000
38.642857
79
0.693093
false
3.93617
false
false
false
python-recsys/mrec
mrec/evaluation/metrics.py
1
5143
""" Metrics to evaluate recommendations: * with hit rate, following e.g. Karypis lab SLIM and FISM papers * with prec@k and MRR """ import numpy as np from collections import defaultdict # classes to access known items for each test user class get_known_items_from_dict(object): def __init__(self,data): ...
bsd-3-clause
5,941,773,935,980,116,000
30.746914
85
0.624538
false
3.619282
true
false
false
ischeinfeld/py_nlp
tests_deprecated/test.py
1
1056
"""Tests examples of the parameters q and e""" from preprocessing import import_wsj, replace_rarities from parameters import sx_counts, uvs_counts, uv_counts, s_counts, q, e sentences = import_wsj("train") #print(sentences[0]) new_sentences = replace_rarities(sentences) #print(new_sentences[0]) sx_counts = sx_count...
mit
-2,406,479,407,315,898,400
21.978261
78
0.619318
false
2.508314
false
false
false
yiwen-luo/LeetCode
Python/word-ladder.py
1
1785
# Time: O(n * d), n is length of string, d is size of dictionary # Space: O(d) # # Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: # # Only one letter can be changed at a time # Each intermediate word must exist in the dictionary # F...
mit
1,898,654,603,200,111,900
32.055556
134
0.556303
false
3.89738
false
false
false
ntduong/ML
Twitter-Analysis/top_ten.py
1
1032
''' Created on May 6, 2013 @author: Administrator ''' import json import sys from collections import defaultdict def parseTweets(tweet_file='tweets.txt'): parsed_tweets = [] with open(tweet_file, 'r') as fin: for line in fin: tweet = json.loads(line) if 'text' in tweet: ...
mit
7,851,779,728,419,153,000
22.477273
62
0.579457
false
3.621053
false
false
false
Reuben-Thorpe/Code.Eval
code.eval/01-hard/as_quick_as_a_flash/as.quick.as.a.flash.py
1
1235
# Reuben Thorpe (2016), CodeEval [As Quick As A Flash v1.0] from sys import argv def swap(seq, x, y): seq[x], seq[y] = seq[y], seq[x] def q_sort_pivots(seq, begin, end): """ Code Evals implimentation of the quick sort algorithm, returns the number of pivots enacted during a complete sort. ...
gpl-3.0
-339,455,370,179,563,800
24.729167
74
0.489069
false
3.548851
false
false
false
migueldsw/TL-DA-TF
NETWORKS/vgg.py
1
10291
# from tflearn examples: https://github.com/tflearn/tflearn/blob/master/examples/images/vgg_network.py """ Very Deep Convolutional Networks for Large-Scale Visual Recognition. Applying VGG 11 and 16-layers convolutional network to MNIST and SVHN Dataset classification task. 28x28x3 shape References: Very Deep Conv...
apache-2.0
6,515,410,261,578,882,000
50.974747
114
0.639005
false
3.295229
false
false
false
heliopython/heliopy
doc/source/conf.py
1
11504
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # heliopy documentation build configuration file, created by # sphinx-quickstart # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
gpl-3.0
-2,292,222,765,677,599,500
28.649485
98
0.676895
false
3.516967
true
false
false
rcosnita/fantastico
fantastico/mvc/tests/itest_model_facade.py
1
10388
''' Copyright 2013 Cosnita Radu Viorel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribu...
mit
6,665,480,441,102,607,000
46.00905
126
0.674047
false
4.015462
true
false
false
tfwillems/STRValidator
pedigree_analysis.py
1
23183
import matplotlib as mpl mpl.use('Agg') import collections import sys import numpy import matplotlib.pyplot as plt import vcf from matplotlib.backends.backend_pdf import PdfPages from fractions import Fraction class TRIO: def __init__(self, child, mother, father): self.child = child self.mother =...
gpl-3.0
-1,392,284,342,982,536,000
47.398747
177
0.55187
false
3.116413
false
false
false
ctb/pygr
pygr/nlmsa_utils.py
1
17639
import classutil, logger import os, types class NLMSASeqList(list): def __init__(self, nlmsaSeqDict): list.__init__(self) self.nlmsaSeqDict = nlmsaSeqDict def __getitem__(self, nlmsaID): 'return NLMSASequence for a given nlmsa_id' try: return list.__getitem__(self,n...
bsd-3-clause
7,531,787,476,518,567,000
37.5131
92
0.597426
false
3.807252
false
false
false
tommy-u/chaco
examples/demo/advanced/asynchronous_updates.py
1
8087
""" Perform expensive calculations based on user interactions while keeping the GUI responsive. This makes use of asynchronous programming tools in the encore package. Move the slider to blur the image. Note the slider stays responsive even though the blurring may lag the slider. Uncheck "Asynchronous" and note that t...
bsd-3-clause
-7,469,744,734,406,055,000
36.439815
79
0.568814
false
4.249606
false
false
false
akshayka/projection-methods
projection_methods/projectables/polyhedron.py
1
2281
from projection_methods.projectables.halfspace import Halfspace from projection_methods.projectables.hyperplane import Hyperplane from projection_methods.projectables.projectable import Projectable class Polyhedron(Projectable): """A projectable polyhedron Defines a polyhedron via a set of hyperplanes and ha...
gpl-3.0
-5,145,808,269,231,277,000
38.327586
79
0.647961
false
4.463796
false
false
false
Pikecillo/genna
external/4Suite-XML-1.0.2/Ft/Xml/XPath/ParsedRelativeLocationPath.py
1
1412
######################################################################## # $Header: /var/local/cvsroot/4Suite/Ft/Xml/XPath/ParsedRelativeLocationPath.py,v 1.4 2005/02/09 11:10:54 mbrown Exp $ """ A parsed token that represents a relative location path in the parsed result tree. Copyright 2005 Fourthought, Inc. (...
gpl-2.0
-7,323,416,474,104,998,000
30.377778
118
0.55949
false
4.034286
false
false
false
thp44/delphin_6_automation
data_process/2d_1d/archieve/temperature.py
1
18075
__author__ = "Christian Kongsgaard" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules import matplotlib.pyplot as plt import numpy as np import os import datetime import matplotlib.dates as mdates import pan...
mit
7,053,188,227,556,436,000
44.762025
120
0.52
false
3.097156
false
false
false
weechat/weechat.org
weechat/news/views.py
1
3923
# # Copyright (C) 2003-2021 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat.org. # # WeeChat.org 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
6,434,592,163,771,946,000
31.683333
77
0.63845
false
3.611418
false
false
false
pdinges/class-language
visitor/util.py
1
1477
# -*- coding: utf-8 -*- # Copyright (c) 2008--2012 Peter Dinges <pdinges@acm.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 3 of the License, or # (at your option) any l...
gpl-3.0
6,511,576,019,489,726,000
32.568182
75
0.682464
false
3.541966
false
false
false
mkhutornenko/incubator-aurora
src/main/python/apache/aurora/executor/common/health_checker.py
1
4022
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
apache-2.0
1,872,825,315,312,484,000
35.563636
100
0.704127
false
4.013972
true
false
false
ESMG/ESMG-configs
CCS1/plot_vort.py
1
2295
import numpy as np import netCDF4 import os import sys import subprocess import pyroms from pyroms_toolbox import jday2date from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt from datetime import datetime # draw line around map projection limb. # color background of map projec...
gpl-3.0
-1,542,112,058,386,299,400
29.6
83
0.630065
false
2.77845
false
false
false
coreboot/chrome-ec
util/flash_cr50.py
2
27330
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Flash Cr50 using gsctool or cr50-rescue. gsctool example: util/flash_cr50.py --image cr50.bin.prod util/...
bsd-3-clause
-6,824,272,800,519,585,000
34.447471
80
0.585145
false
3.898716
false
false
false
vandersonmota/silk
silk/model_factory.py
1
10193
import json import logging import sys import traceback from django.core.urlresolvers import resolve from silk import models from silk.collector import DataCollector from silk.config import SilkyConfig Logger = logging.getLogger('silk') content_types_json = ['application/json', 'application/x-...
mit
-4,047,684,252,602,792,000
40.439024
150
0.559207
false
4.404927
false
false
false
getsentry/zeus
zeus/factories/filecoverage.py
1
1220
import factory import factory.fuzzy from faker import Factory faker = Factory.create() from random import randint from zeus import models from .base import ModelFactory from .types import GUIDFactory class FileCoverageFactory(ModelFactory): id = GUIDFactory() filename = factory.LazyAttribute( lamb...
apache-2.0
-894,895,196,959,768,200
28.756098
82
0.65
false
3.708207
false
false
false
andlima/olheiro
olheiro.py
1
3435
#!/usr/bin/python import os import mercado ARQUIVO_MOD = 'olheiro.mod' ARQUIVO_DAT = 'olheiro.dat' GLPSOL_EXEC = 'glpsol -m %s -d %s' % (ARQUIVO_MOD, ARQUIVO_DAT) LISTA_CONJUNTOS = ['S_Jogadores', 'S_Posicoes', 'S_Formacoes'] LISTA_PARAMETROS = ['P_Patrimonio', 'P_Preco', 'P_Media', 'Pe_Posicao',...
bsd-3-clause
-3,347,016,942,463,733,000
26.261905
78
0.496361
false
2.739234
false
false
false
GuessWhoSamFoo/pandas
pandas/tests/frame/conftest.py
1
5594
import numpy as np import pytest from pandas import DataFrame, NaT, compat, date_range import pandas.util.testing as tm @pytest.fixture def float_frame(): """ Fixture for DataFrame of floats with index of unique strings Columns are ['A', 'B', 'C', 'D']. """ return DataFrame(tm.getSeriesData()) ...
bsd-3-clause
7,388,398,271,799,593,000
24.312217
79
0.556668
false
3.400608
true
false
false
anderson1008/NOCulator
hring/src/Script/my_print.py
1
8437
#!/usr/bin/python import sys import os import re import fnmatch import string import matplotlib.pyplot as plt def print_period(stat): # use to profile the application running solo. # stat is an iterator or array i = 0 for item in stat: plt.plot(item, label=str(i)) p...
mit
872,045,989,612,368,500
37.060185
347
0.585279
false
2.664877
false
false
false
dnephin/openLETS
src/openlets/core/db.py
1
7160
""" Database Acess Layer """ import datetime import itertools import operator from django.db.models import Q from django.db import transaction from django.core.exceptions import ObjectDoesNotExist from openlets.core import models def get_balance(persona, personb, currency): """Load a balance between two persons. ...
bsd-3-clause
2,736,846,597,716,906,500
25.6171
79
0.73324
false
3.264934
false
false
false
mathuin/pyment
django/inventory/models.py
1
7620
from django.urls import reverse from django.db import models from meadery.models import Product from django.core.exceptions import ValidationError class Warehouse(models.Model): number = models.IntegerField() slug = models.SlugField(max_length=50, unique=True, help_text="Unique value for warehouse page URL, c...
mit
4,820,107,616,232,479,000
27.646617
124
0.638714
false
3.690073
false
false
false
mrroach/CentralServer
csrv/model/cards/runner/card01020.py
1
2867
from csrv.model import actions from csrv.model import timing_phases from csrv.model.cards import card_info from csrv.model.cards import event class ChooseUnrezzedIce(timing_phases.BasePhase): """Choose unrezzed ice to force the corp to rez or trash it.""" DESCRIPTION = 'Choose unrezzed ice to force the corp to r...
apache-2.0
940,326,648,398,857,700
28.255102
80
0.674573
false
3.239548
false
false
false
wpjesus/codematch
ietf/doc/lastcall.py
1
2727
# helpers for handling last calls on Internet Drafts import datetime from django.db.models import Q from ietf.doc.models import Document, State, DocEvent, LastCallDocEvent, WriteupDocEvent from ietf.doc.models import save_document_in_history from ietf.doc.models import IESG_SUBSTATE_TAGS from ietf.person.models impo...
bsd-3-clause
-4,666,970,755,027,649,000
39.701493
107
0.672901
false
3.297461
false
false
false
urfonline/api
config/settings/base.py
1
11017
""" Django settings for api project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ import environ ROOT_DIR = environ.Path(__file__) - 3 # (api/config/settings/b...
mit
7,556,345,583,744,921,000
33.974603
101
0.620496
false
3.924831
true
false
false
itpubs/reflecting
apps/users/views.py
1
7234
from django.shortcuts import render, HttpResponseRedirect, reverse, HttpResponse from django.contrib.auth import authenticate, login, logout from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.hashers import make_password from django.contrib.auth.backends import ModelBackend from users.models...
mit
-2,013,729,352,498,566,100
40.88535
109
0.585766
false
3.560368
false
false
false
nortikin/sverchok
node_scripts/SNLite_templates/demo/recursive_subdivision.py
1
1833
""" in quad_verts v in quad_faces s in seed s d=1 n=2 in random_factor s d=0.1 n=2 in iterations s d=1 n=2 out verts v out edges s out faces s """ from sverchok.utils.modules.geom_utils import interp_v3_v3v3 as lerp from sverchok.utils.sv_mesh_utils import mesh_join from sverchok.utils.sv_bmesh_utils import remove_dou...
gpl-3.0
-594,537,117,307,471,200
28.095238
79
0.567376
false
2.660377
false
false
false
acercado/jd-ph-cms
jd-ph-cms/accounts/models.py
1
3986
from decimal import Decimal from django.db import models from django.core.validators import MinValueValidator from ..notifications.models import NotificationMessage from ..users.models import User class Answer(models.Model): question = models.ForeignKey('contests.contest', related_name='answer', ...
bsd-3-clause
6,135,343,380,632,455,000
38.465347
151
0.670848
false
3.829011
false
false
false
darkerego/learning-python
pygoogle.py
1
8928
#!/usr/bin/python """ Google AJAX Search Module http://code.google.com/apis/ajaxsearch/documentation/reference.html Needs Python 2.6 or later """ try: import json except ImportError, e: print e exit() import sys import urllib import logging import argparse __author__ = "Nikhil. R" __version__ = "0.2" URL ...
gpl-3.0
-433,689,590,236,023,100
37.482759
123
0.573701
false
4.23128
false
false
false
andreadean5/python-hpOneView
hpOneView/resources/facilities/racks.py
1
6758
# -*- coding: utf-8 -*- ### # (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP # # 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 limi...
mit
-3,318,023,692,670,209,500
38.752941
119
0.648565
false
4.765867
false
false
false
ColaLightOriginal/GraphV
Source/Graph_Class.py
1
17088
# -*- coding: utf-8 -*- from graph_tool.all import * from Queue_Class import * from Visitor_Example_Class import * from Graph_Window_Main_Class import * from gi.repository import Gtk, Gdk, GdkPixbuf, GObject, Pango import numpy as np from numpy.random import random import sys class Graph(): g = Graph() g.se...
unlicense
-2,976,734,726,275,527,000
34.084189
209
0.565843
false
3.50986
false
false
false
Bumpybox/pyblish-bumpybox
pyblish_bumpybox/plugins/hiero/extract_ftrack_components.py
1
3223
from pyblish import api from pyblish_bumpybox import inventory class ExtractFtrackComponents(api.InstancePlugin): """ Extracting data to ftrack components. Offset to get shot data from "extract_ftrack_shot" """ families = ["ftrack"] label = "Ftrack Components" hosts = ["hiero"] order = i...
lgpl-3.0
-8,472,396,748,663,667,000
32.926316
70
0.441514
false
5.028081
false
false
false
jskye/car-classifier-research
src/hyp.verification.tools/py/deprecated/batch_detect_lab.py
1
5347
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################### # Copyright (c) 2015, Julius Sky # # 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...
mit
-5,656,936,288,881,098,000
31.017964
86
0.660557
false
3.513141
false
false
false
nederhoed/bitstamp-python-client
test/trading_client.py
1
2123
__author__ = 'kmadac' import unittest import bitstamp.client import os class bitstamp_trading_TestCase(unittest.TestCase): client = bitstamp.client.trading(os.environ['bs_user'], os.environ['bs_key'], os.environ['bs_secret']) def test_account_ballance(self): account_balance = self.client.account_bal...
mit
4,440,491,225,083,864,600
34.383333
106
0.671691
false
3.586149
true
false
false
wayneclancy/creepercoin
contrib/bitrpc/bitrpc.py
1
7844
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:9451") else: access = Ser...
mit
4,535,098,076,821,634,000
23.209877
79
0.662035
false
3.053328
false
false
false
PurpleMyst/porcupine
porcupine/_session.py
1
10859
import functools import logging import traceback import webbrowser import pygments.styles import pygments.token import porcupine from porcupine import _dialogs, dirs, filetypes, menubar, settings, tabs, utils log = logging.getLogger(__name__) # global state makes some things a lot easier _main_window = None _tab_ma...
mit
-4,324,250,939,349,076,000
36.704861
79
0.621144
false
3.782306
false
false
false
ledvina/zencoin
test/util/bitcoin-util-test.py
1
6594
#!/usr/bin/env python3 # Copyright 2014 BitPay Inc. # Copyright 2016-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test framework for zencoin utils. Runs automatically during `make check`. Ca...
mit
2,901,066,813,528,356,000
36.68
125
0.623294
false
4.088035
true
false
false
rouault/Quantum-GIS
python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
1
5765
# -*- coding: utf-8 -*- """ *************************************************************************** SagaAlgorithmProvider.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************...
gpl-2.0
-8,369,260,172,697,600,000
38.486301
166
0.539809
false
4.641707
true
false
false
ToonTownInfiniteRepo/ToontownInfinite
toontown/catalog/CatalogAccessoryItem.py
1
16172
import CatalogItem from CatalogAccessoryItemGlobals import * from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from toontown.toon import ToonDNA import random, types from direct.showbase import PythonUtil from direct.gui.DirectGui import * from pandac.PandaModules import * class C...
mit
-5,898,559,049,240,956,000
37.051765
118
0.573213
false
3.652213
false
false
false
adamfisk/littleshoot-client
server/appengine/boto/pyami/installers/ubuntu/mysql.py
1
4361
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
gpl-2.0
3,813,052,428,190,060,000
41.754902
157
0.650768
false
3.80541
true
false
false
Eksmo/calibre
src/calibre/gui2/store/stores/diesel_ebooks_plugin.py
1
4624
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL 3' __copyright__ = '2011, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import random import re import urllib from contextlib import closing from lxml import ...
gpl-3.0
-4,748,780,427,432,712,000
36.901639
131
0.508218
false
3.866221
false
false
false
smartchicago/chicago-early-learning
python/ecep/portal/management/commands/update_ecm.py
1
9296
from geopy.geocoders import GoogleV3 import csv import logging import os import paramiko import re import time from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import NoArgsCommand from django.conf import settings from portal.models import Location class Command(NoArgsCommand)...
mit
-7,032,715,717,010,872,000
38.058824
153
0.577668
false
3.531915
false
false
false
pajlada/pajbot
pajbot/managers/emote.py
1
13594
from typing import Optional import logging import random from pajbot.managers.redis import RedisManager from pajbot.managers.schedule import ScheduleManager from pajbot.models.emote import Emote, EmoteInstance, EmoteInstanceCount from pajbot.streamhelper import StreamHelper from pajbot.utils import iterate_split_wit...
mit
-7,774,251,602,182,761,000
34.217617
117
0.636678
false
3.331863
false
false
false
ceelian/Flatty
setup.py
1
1423
from setuptools import setup, find_packages from distutils.cmd import Command import codecs import sys, os import doctest from glob import glob sys.path.insert(0,'src/') init_pyc = 'src/flatty/__init__.pyc' if os.path.exists(init_pyc): os.remove(init_pyc) import flatty if os.path.exists("doc/source/introduction...
bsd-3-clause
-386,371,517,929,796,860
24.410714
86
0.6409
false
3.804813
false
false
false
20c/xbahn
xbahn/connection/memory.py
1
1497
from xbahn.connection import ( register, Poller as BasePoller, Receiver as BaseReceiver, Sender as BaseSender ) receivers = {} senders = {} class Poller(BasePoller): def __init__(self, name): super(Poller, self).__init__() self.name = name class Receiver(BaseReceiver): can_sen...
apache-2.0
-6,020,486,932,516,457,000
20.695652
53
0.595858
false
3.678133
false
false
false
mtholder/bootstrap-open-tree-software
open_tree_env.py
1
5325
#!/usr/bin/env python '''Wraps common operations on settings and environmental variables needed during build. ''' import os _DEF_OPEN_TREE_VERSION = '0.0.1' _build_env_var_list = ['OPEN_TREE_USER_SETTINGS_DIR', 'OPEN_TREE_INSTALL_DIR', 'OPEN_TREE_VERSION', ...
bsd-2-clause
-827,426,976,048,111,100
37.586957
104
0.539155
false
3.270885
false
false
false
krelbel/ALttPLinkSpriteSwapper
Main.py
1
4488
import logging import argparse import os __version__ = '0.1-dev' #Usage: python Main.py --write --sprite zelda.spr --rom lttpromtobepatched.sfc #generates zelda_lttpromtobepatched.sfc # python Main.py --read --sprite zelda.spr --rom lttpromtobescanned.sfc #generates zelda.spr #General rom patching logic copied ...
mit
-3,170,415,711,394,690,000
34.904
206
0.66377
false
3.462963
false
false
false
rogerfan/simpleml
simpleml/metrics.py
1
1076
''' Metric functions. ''' import numpy as np import numexpr as ne __all__ = ('entropy', 'gini', 'misclass', 'tanh', 'logistic') # Purity measures for binary variables. def entropy(prop): return ne.evaluate('where((prop != 0) & (prop != 1),' '-prop*log(prop) - (1-prop)*log(1-prop), 0)') de...
mpl-2.0
2,234,151,379,116,587,800
22.911111
68
0.574349
false
2.915989
false
false
false
byaka/flaskJSONRPCServer
bench/utils.py
1
3754
#!/usr/bin/env python # -*- coding: utf-8 -*- __all__=['arrMin', 'arrMax', 'arrMedian', 'arrTrimean', 'arrMode', 'arrAverage', 'oGet', 'arrUnique'] def arrUnique(arr, key=None): #unique elements of array if not(arr): return [] tArr1=arr if key: tArr1=[key(s) for s in tArr1] tArr1=set(list(tArr1)) re...
apache-2.0
8,772,848,630,889,374,000
31.362069
101
0.639052
false
2.599723
false
false
false
usc-isi/horizon-old
horizon/horizon/dashboards/syspanel/flavors/forms.py
1
2657
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
6,767,016,554,147,480,000
37.507246
78
0.641325
false
4.204114
false
false
false
lmazuel/azure-sdk-for-python
azure-batch/azure/batch/models/job_schedule_patch_options.py
1
3130
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-6,753,804,175,990,424,000
49.483871
191
0.691374
false
4.224022
false
false
false
samskeller/zeroclickinfo-fathead
lib/fathead/UNCLEAN/parse_cplusplus.py
1
1380
from BeautifulSoup import BeautifulSoup import re import os import sys import MySQLdb conn = MySQLdb.connect(user='root') openclosetags = re.compile('''<.*?>|</.*?>''',re.DOTALL) files = [] for file in os.listdir('./docs/cplusplus/'): files.append('./docs/cplusplus/%s'%(file)) #http://www.cplusp...
apache-2.0
812,569,088,512,390,300
34.315789
280
0.586957
false
3.026316
false
false
false
colloquium/spacewalk
client/solaris/smartpm/smart/fetcher.py
1
64875
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
gpl-2.0
4,372,806,924,784,088,000
33.729657
81
0.486489
false
4.709961
false
false
false
5j9/wikitextparser
wikitextparser/_config.py
1
6983
"""Utilities to override default configurations.""" from collections import defaultdict as _defaultdict from typing import Iterable as _Iterable def _plant_trie(strings: _Iterable[str]) -> dict: """Create a Trie out of a list of words and return an atomic regex pattern. The corresponding Regex should match...
gpl-3.0
1,359,604,970,666,795,500
25.25188
95
0.581842
false
3.243381
false
false
false
Diti24/python-ivi
ivi/tektronix/tektronixMDOAFG.py
1
23718
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2016 Alex Forencich 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 righ...
mit
-7,365,917,703,112,875,000
44.699422
138
0.615102
false
3.689221
false
false
false
archtool/archtool
src/gui/styles.py
1
12145
''' Created on Feb 15, 2014 @author: EHWAAL Copyright (C) 2014 Evert van de Waal This program is released under the conditions of the GNU General Public License. ''' # FIXME: Font names containing spaces are not handled properly. # TODO: Allow style export & import. Use that to initialise the database i...
gpl-3.0
5,977,337,993,921,288,000
28.216418
84
0.58452
false
3.516213
false
false
false
rohitsm/spsoldboys
main.py
1
4255
"""`main` is the top level module for your Flask application.""" __author__ = 'rohitsm' __page__ = 'https://github.com/rohitsm/spsoldboys' # Python import urllib2 import json import sys import cgi # Flask from flask import Flask from flask import request, redirect, url_for from flask import render_template # App En...
mit
7,525,898,457,323,794,000
29.611511
102
0.594595
false
3.995305
false
false
false
WayneKoorts/TornChat
Server/RequestHandlers/ChatWebSocketHandler.py
1
4249
import tornado.websocket from Server.Chat.SimpleTypes import Participant from Server.Tools.Response.Json import * class ChatWebSocketManager(tornado.websocket.WebSocketHandler): """ The main chat socket manager, which handles both server commands from the user as well as chat messages themselves. """ ...
apache-2.0
-5,682,361,949,241,802,000
46.211111
153
0.652624
false
4.559013
false
false
false
annapowellsmith/openpresc
openprescribing/api/views_org_codes.py
1
2823
from rest_framework.decorators import api_view from rest_framework.response import Response import view_utils as utils from django.db.models import Q from frontend.models import PCT, Practice @api_view(['GET']) def org_codes(request, format=None): org_codes = utils.param_to_list(request.query_params.get('q', None)...
mit
-4,723,910,944,531,606,000
31.448276
84
0.516826
false
3.329009
false
false
false
PaddlePaddle/models
PaddleCV/image_classification/dali.py
1
9463
# Copyright (c) 2019 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 appli...
apache-2.0
543,264,054,567,123,200
32.676157
98
0.551833
false
3.834279
false
false
false
cmusv-sc/DIWD-Team4-Wei-Lin-Tsai
src/python/data_2015_fall/api/queryExperts.py
1
1307
from django.http import JsonResponse from data_2015_fall.models import * import simplejson from collections import defaultdict from operator import itemgetter # =================================================== # Classes # =================================================== class Expert(object): def __init__(se...
unlicense
791,819,172,248,535,600
33.421053
97
0.544759
false
4.327815
false
false
false
hoelsner/product-database
app/productdb/models.py
1
40333
import hashlib import re from collections import Counter from datetime import timedelta from django.contrib.auth.models import User from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator, MaxVal...
mit
-2,681,151,308,191,026,700
34.133275
132
0.616716
false
4.219816
false
false
false
gautamMalu/rootfs_xen_arndale
usr/lib/python2.7/Cookie.py
1
26311
#### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and that bot...
gpl-2.0
7,431,628,727,126,871,000
33.259115
82
0.553077
false
3.546435
false
false
false
piyueh/SEM-Toolbox
utils/poly/Jacobi.py
1
1612
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2016 Pi-Yueh Chuang <pychuang@gwu.edu> # # Distributed under terms of the MIT license. """Definition of Jacobi polynomial class""" import numpy from utils.poly.Polynomial import Polynomial from utils.poly.jacobi_operations import jacobi_...
mit
-7,490,037,588,734,227,000
26.775862
78
0.589696
false
3.58
false
false
false
theguardian/JIRA-APPy
lib/pkg_resources/__init__.py
2
107034
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
gpl-2.0
-4,876,355,124,782,279,000
33.17433
82
0.595017
false
4.296311
false
false
false
rwl/muntjac
muntjac/data/validators/composite_validator.py
1
6530
# @MUNTJAC_COPYRIGHT@ # @MUNTJAC_LICENSE@ """Allows you to chain (compose) many validators to validate one field.""" from muntjac.data.validators.abstract_validator import AbstractValidator from muntjac.data.validator import InvalidValueException class CompositeValidator(AbstractValidator): """The C{CompositeVa...
apache-2.0
-742,258,890,250,257,300
31.326733
78
0.584686
false
4.766423
false
false
false
tedlaz/pyted
ted17/ted17/dec.py
1
3802
# -*- coding: utf-8 -*- import decimal from collections import OrderedDict import textwrap def isNum(val): # is val number or not ? """Check if val is number or not :param val: value to check :return: Boolean """ try: float(val) except ValueError: return False ...
gpl-3.0
8,128,316,710,620,176,000
23.689189
76
0.539453
false
3.655769
false
false
false
djdduty/mongo
marrow/mongo/core/field.py
1
2849
# encoding: utf-8 from inspect import isroutine from marrow.schema import Attribute from marrow.schema.transform import BaseTransform from marrow.schema.validate import Validator from ..query import Queryable from ..util import adjust_attribute_sequence from ..util.compat import py3 @adjust_attribute_sequence(1000,...
mit
-3,190,017,859,527,153,700
32.916667
119
0.707266
false
3.758575
false
false
false
kcompher/topik
topik/tokenizers.py
1
12129
from __future__ import absolute_import, print_function import logging import itertools import re from textblob import TextBlob import gensim from gensim.parsing.preprocessing import STOPWORDS from topik.utils import collocations, entities # imports used only for doctests from topik.tests import test_data_path from ...
bsd-3-clause
-605,126,569,415,801,200
45.471264
142
0.661885
false
3.606601
true
false
false
restran/api-gateway-dashboard
accounts/backends.py
1
1096
# !/usr/bin/env python # -*- coding: utf-8 -*- # created by restran on 2016/1/2 from __future__ import unicode_literals, absolute_import from .models import SiteUser class EmailAuthBackend(object): """ Email Authentication Backend Allows a user to sign in using an email/password pair rather than ...
mit
7,533,782,022,583,943,000
28.777778
76
0.601679
false
3.97037
false
false
false
MicroMagnum/MicroMagnum
src/magnum/micromagnetics/stephandler/fancy_screen_log.py
1
1782
# Copyright 2012, 2013 by the Micromagnum authors. # # This file is part of MicroMagnum. # # MicroMagnum 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) a...
gpl-3.0
4,913,889,528,069,827,000
35.367347
96
0.599888
false
3.832258
false
false
false
microsoft/ANCE
data/process_fn.py
1
5115
import torch def pad_ids(input_ids, attention_mask, token_type_ids, max_length, pad_token, mask_padding_with_zero, pad_token_segment_id, pad_on_left=False): padding_length = max_length - len(input_ids) if pad_on_left: input_ids = ([pad_token] * padding_length) + input_ids attention_mask...
mit
6,856,415,483,005,661,000
44.081081
167
0.565982
false
3.498632
false
false
false
rohithpr/py-web-search
pws/google.py
1
7518
#coding=utf-8 from bs4 import BeautifulSoup from time import sleep as wait import re import requests try: from html.parser import HTMLParser except ImportError: from HTMLParser import HTMLParser ################################################## # Copied code #################################################...
mit
-1,809,361,133,554,508,300
33.0181
125
0.503458
false
3.719941
false
false
false
chadrosenquist/logging-test-case
examples/assertnologs_example1.py
1
2548
""" MIT License Copyright (c) 2018 Chad Rosenquist Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
mit
-6,112,759,476,243,108,000
35.4
85
0.699372
false
4.501767
true
false
false
mhahn/stacker
stacker/commands/stacker/diff.py
1
1480
""" Diffs the config against the currently running CloudFormation stacks Sometimes small changes can have big impacts. Run "stacker diff" before "stacker build" to detect bad things(tm) from happening in advance! """ from .base import BaseCommand from ...actions import diff class Diff(BaseCommand): name = "dif...
bsd-2-clause
162,111,301,596,136,670
41.285714
79
0.560811
false
4.683544
false
false
false
conan-io/conan
conans/client/remover.py
1
11380
import os from conans.client.cache.remote_registry import Remote from conans.errors import ConanException, PackageNotFoundException, RecipeNotFoundException from conans.errors import NotFoundException from conans.model.ref import ConanFileReference, PackageReference, check_valid_ref from conans.paths import SYSTEM_REQ...
mit
9,217,486,629,263,909,000
44.702811
97
0.574692
false
4.317147
false
false
false
openstack/mistral-dashboard
mistraldashboard/workbooks/views.py
1
4166
# Copyright 2014 - StackStorm, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
7,974,600,795,866,114,000
33.147541
76
0.697072
false
3.915414
false
false
false
hfaran/ubc-timetabler
timetabler/schedule.py
1
4430
import tempfile import os from uuid import uuid4 from prettytable import PrettyTable from timetabler.util import iter_time, DAY_LIST class Schedule(object): def __init__(self, sched): """Schedule e.g. for ``sched``: ((Lab<status='Restricted', section='EECE 381 L2A', term='2', days='[u'T...
mit
1,525,221,262,642,884,600
40.018519
132
0.513318
false
3.783091
false
false
false
gingi99/research_dr
python/MLEM2/discrimination.py
1
12551
# coding: utf-8 # python 3.5 import sys import os sys.path.append('/Users/ooki/git/research_dr/python/MLEM2') sys.path.append(os.path.dirname(os.path.abspath("__file__"))+'/../MLEM2') from sklearn.metrics import accuracy_score import copy import importlib import mlem2 import LERS importlib.reload(mlem2) importlib.rel...
mit
5,037,567,763,820,644,000
36.480645
114
0.608658
false
2.799759
true
false
false
ZhangChuann/awesome-python-webapp
www/models.py
1
1538
#!/usr/bin/env python # coding=utf-8 __author__ = 'ZHang Chuan' ''' Models for user, blog, comment. ''' import time, uuid from transwarp.db import next_id from transwarp.orm import Model, StringField, BooleanField, FloatField, TextField class User(Model): __table__ = 'users' id = StringField(primary_key=T...
gpl-3.0
-5,994,461,699,348,790,000
30.387755
81
0.680104
false
3.350763
false
false
false
neo1691/scorer.py
scorer/app.py
1
1926
import logging from time import sleep import scorer.fetch_scores as fs import scorer.notification as notify from scorer.system import exitApp from scorer.ui import getUserInput logger = logging.getLogger("scorer.app") logger.setLevel(logging.DEBUG) fh = logging.FileHandler("scorer.log") fh.setLevel(logging.DEBUG) ch ...
gpl-2.0
-4,285,069,402,196,174,300
31.644068
77
0.619938
false
4.168831
false
false
false
Trinak/PyHopeEngine
src/pyHopeEngine/graphics/sprite.py
1
1261
''' Created on May 29, 2013 @author: Devon Defines a game sprite ''' import pygame from pyHopeEngine import engineCommon as ECOM class GameSprite(pygame.sprite.Sprite): '''Base game sprite image''' def __init__(self, file): pygame.sprite.Sprite.__init__(self) file = ECOM.engin...
gpl-3.0
-2,729,814,815,384,219,000
23.745098
95
0.612213
false
3.916149
false
false
false
louisdijkstra/gonl-sv
back-up/version4/postprocess_tag_snps.py
1
4919
#!/usr/bin/env python """ Copyright (C) 2015 Louis Dijkstra This file is part of gonl-sv 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 lat...
gpl-3.0
7,022,587,863,934,673,000
32.462585
111
0.651758
false
2.943746
false
false
false
trungnt13/dnntoolkit
tests/benchmark_dataset.py
1
5679
# python -m memory_profiler # dataset used for benchmark: X=(None, 500, 120) # dataset used for benchmark: y=(None, 2) from __future__ import print_function, division import os os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,device=cpu,floatX=float32" import theano from theano import tensor import numpy as np import sci...
apache-2.0
8,811,594,959,474,612,000
38.4375
100
0.454129
false
2.906346
false
false
false