repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
davecan/easychain
test_blockchain.py
1
1829
from blockchain import Message, Block, Blockchain, InvalidBlockchain import unittest import hashlib class TestBlockchain(unittest.TestCase): def get_block(self, msg): B = Block() B.add_message(Message(msg)) return B def get_blocks(self, *args): L = [] for arg in args: ...
mit
-5,358,562,415,286,402,000
32.888889
85
0.611263
false
3.709939
true
false
false
yosshy/bergenholm
bergenholm/database/templates.py
1
1096
# -*- encoding:utf-8 -*- import logging import jinja2 from flask import abort from flask import json mongo = None jinja_env = jinja2.Environment() def get_templates(): templates = mongo.db.templates.find({}, {'_id': 1}) return dict(templates=[t["_id"] for t in templates]) def get_template(name): templ...
apache-2.0
-9,145,295,597,778,366,000
22.319149
66
0.607664
false
3.479365
false
false
false
arichnad/getflix
getdirector.py
1
1968
#!/usr/bin/python ########################################################## #This script has been created by #Copyright 2006 Devanshu Mehta # of http://www.scienceaddiction.com #It is released under the GNU General Public License v2 # This program is free software; you can redistribute it and/or modify # it un...
gpl-2.0
-3,840,031,877,946,883,000
26.333333
79
0.70122
false
3.138756
false
false
false
flennerhag/mlens
mlens/metrics/utils.py
1
9021
"""ML-ENSEMBLE :author: Sebastian Flennerhag :copyright: 2017-2018 :licence: MIT Utility functions for constructing metrics """ from __future__ import division import warnings import numpy as np from ..utils.exceptions import MetricWarning try: from collections import OrderedDict as _dict except ImportError: ...
mit
460,713,126,903,937,660
30
79
0.523445
false
3.680539
false
false
false
alexei-matveev/ccp1gui
objects/numeric.py
1
2817
_Numeric=None _numpy=None try: import Numeric as _Numeric except ImportError: try: import numpy as _numpy except ImportError: pass # Test numpy #_Numeric=None #import numpy as _numpy def usingNumeric(): """Return True if we are using Numeric""" global _Numeric if _Numeric: retu...
gpl-2.0
-8,732,465,134,643,657,000
27.744898
95
0.598864
false
3.503731
false
false
false
wenqiuhua/mkdocs
mkdocs/toc.py
3
2536
# coding: utf-8 """ Deals with generating the per-page table of contents. For the sake of simplicity we use an existing markdown extension to generate an HTML table of contents, and then parse that into the underlying data. The steps we take to generate a table of contents are: * Pre-process the markdown, injecting...
bsd-2-clause
6,529,806,748,297,370,000
28.149425
77
0.600158
false
3.974922
false
false
false
franblas/pyAPI
src/pyapi/wikipedia.py
1
4445
# -*- coding: utf-8 -*- """ Created on Tue Jun 09 10:54:39 2015 @author: Paco """ from api import API class Wikipedia(API): _class_name = 'Wikipedia' _category = 'Data' _help_url = 'http://en.wikipedia.org/w/api.php?action=help&modules=query' _api_url = 'http://en.wikipedia.org/w/api.php?action=quer...
mit
-5,120,044,170,646,171,000
38.6875
128
0.583802
false
3.403522
true
false
false
bogdanbabych/morphosyntax
src/s020evaldictinput/md010extractinputwdV02.py
1
11137
''' Created on 28 Mar 2017 @author: bogdan ''' import os, sys, re, codecs # import md060graphonoLev from macpath import join class clExtractInputWd(object): ''' extracting input words from a dictionary file in glossary format refernce dictionary file has mappings for the evaluation set, but does not have the tags...
apache-2.0
-5,307,623,337,904,379
39.372263
176
0.686737
false
3.011435
false
false
false
robertchase/rhc
rhc/task.py
1
9374
''' The MIT License (MIT) Copyright (c) 2013-2017 Robert H Chase 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,...
mit
-523,049,076,953,525,900
31.10274
92
0.576808
false
4.339815
false
false
false
faratro/django-oscar
sites/demo/apps/checkout/forms.py
33
2401
from django import forms from oscar.apps.payment import forms as payment_forms from oscar.apps.order.models import BillingAddress class BillingAddressForm(payment_forms.BillingAddressForm): """ Extended version of the core billing address form that adds a field so customers can choose to re-use their shi...
bsd-3-clause
7,598,267,666,983,002,000
40.396552
80
0.640983
false
4.021776
false
false
false
Pluto-tv/chromium-crosswalk
tools/telemetry/third_party/gsutilz/third_party/protorpc/protorpc/protobuf_test.py
26
10491
#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-3-clause
-724,236,808,323,153,300
34.086957
80
0.68268
false
3.978385
true
false
false
MaxTyutyunnikov/lino
obsolete/src/lino/webman/xdocutils.py
1
6442
import os,sys import traceback from os.path import abspath, basename, dirname, normpath, join, exists # from docutils import core #import publish_string, publish_file from docutils import core, io from docutils.writers import html4css1 #import em from StringIO import StringIO from textwrap import dedent from docutil...
gpl-3.0
-7,160,707,338,872,915,000
28.686636
70
0.669513
false
3.048746
false
false
false
zerothi/sisl
sisl/io/siesta/binaries.py
1
67887
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. from numbers import Integral from itertools import product, groupby from collections import deque import numpy as np fro...
lgpl-3.0
2,117,025,637,927,004,700
38.515134
164
0.537319
false
3.526781
false
false
false
yangchengjian/otp
lib/asn1/test/asn1_SUITE_data/XSeq.py
97
1093
XSeq DEFINITIONS ::= BEGIN -- F.2.10.2 -- Use a sequence type to model a collection of variables whose -- types are the same, -- whose number is known and modest, and whose order is significant, -- provided that the -- makeup of the collection is unlikely to change from one version -- of the protocol to the next...
apache-2.0
7,470,751,405,835,331,000
25.02381
78
0.73376
false
3.383901
false
false
false
jrmendozat/mtvm
Articulo/migrations/0006_auto_20150408_0949.py
1
1098
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('Articulo', '0005_articulo_proveedor_proveedor'), ] operations = [ migrations.AlterField( model_name='articulo_cl...
gpl-2.0
3,612,079,159,789,816,300
27.894737
64
0.562842
false
4.097015
false
false
false
bally12345/enigma2
lib/python/Screens/SkinSelector.py
1
3687
# -*- coding: iso-8859-1 -*- # (c) 2006 Stephan Reichholf # This Software is Free, use it where you want, when you want for whatever you want and modify it if you want but don't remove my copyright! from Screens.Screen import Screen from Screens.Standby import TryQuitMainloop from Screens.MessageBox import MessageBox f...
gpl-2.0
4,673,810,711,601,793,000
29.221311
195
0.699213
false
3.140545
true
false
false
luosch/leetcode
python/Find Median from Data Stream.py
1
1034
import heapq class MedianFinder: def __init__(self): self.small = [] self.large = [] def addNum(self, num): num = float(num) if len(self.small) == 0: heapq.heappush(self.small, -num) return if num < -self.small[0]: he...
mit
7,690,119,258,774,977,000
28.542857
89
0.54352
false
3.241379
false
false
false
rsnakamura/oldape
apetools/connections/adbconnection.py
1
9298
# python standard library import re from StringIO import StringIO # apetools Libraries from localconnection import LocalNixConnection from localconnection import OutputError from localconnection import EOF from apetools.commons import errors from apetools.commons import readoutput from apetools.commons import enume...
apache-2.0
620,523,441,008,638,100
29.485246
122
0.617445
false
4.160179
false
false
false
JamesLinus/OMMPS
gui.py
1
1318
import tkinter as tk = "hello world\n(click me)" self.hi.there["command"] = self.say_hi self.hi_thereclass Application(tk.Frame): def __init__ (self, master-none); super().__init__(master) self.pack() self.create_widgets() def create_widgets(self); self.hi_there = tk.Button(self) self.h...
lgpl-3.0
8,073,765,696,358,767,000
24.346154
59
0.609256
false
3.072261
false
false
false
EmreAtes/spack
var/spack/repos/builtin/packages/hic-pro/package.py
1
3434
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-537,054,734,618,021,440
41.925
78
0.615026
false
3.668803
true
false
false
GrahamDumpleton/ispyd
ispyd/plugins/profiler.py
1
3695
import atexit import Queue import StringIO import sys import threading import time import traceback _profiler = None class Profiler(threading.Thread): def __init__(self, duration, interval, filename): super(Profiler, self).__init__() self._duration = duration self._interval = interval ...
apache-2.0
-805,647,387,273,683,300
24.839161
76
0.498512
false
4.457177
false
false
false
PaloAltoNetworks/minemeld-core
tests/test_ft_taxii.py
1
21780
# -*- coding: utf-8 -*- # Copyright 2016 Palo Alto Networks, 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 ...
apache-2.0
-2,549,572,284,268,494,000
31.301187
138
0.540076
false
3.660837
true
false
false
gnarph/DIRT
DIRT.py
1
7104
#!/usr/bin/env python """ Main entrance point for DIRT """ import argparse import os import itertools import importlib from multiprocessing import Pool import time from models.document import Document import preprocessing.preprocessor as preprocessor import processing.processor as processor from utilities import path...
mit
-3,461,439,667,955,638,300
32.990431
100
0.537303
false
4.536398
false
false
false
anseljh/casebot-beepboop
bot/event_handler.py
1
6650
import json import logging import re import requests from string import Template logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) # TODO: Actually do authentication with CL # Stuff brought in from original casebot CL_URL_TEMPLATE = Template("https://www.courtlistener.com/c/$reporter/$volume/$page/...
mit
-5,213,683,317,538,506,000
37.439306
118
0.583008
false
3.694444
false
false
false
BlackHole/enigma2-obh10
lib/python/Screens/ButtonSetup.py
1
26304
from GlobalActions import globalActionMap from Components.ActionMap import ActionMap, HelpableActionMap from Components.Button import Button from Components.ChoiceList import ChoiceList, ChoiceEntryComponent from Components.SystemInfo import SystemInfo from Components.config import config, ConfigSubsection, ConfigText,...
gpl-2.0
7,407,642,903,577,461,000
44.905759
266
0.693697
false
3.283895
true
false
false
dvdt/rpi-thermostat
temp_logger.py
1
1064
#!/usr/bin/python try: import Adafruit_DHT except ImportError, e: class Adafruit_DHTMOCK(): def read_retry(self): return 25, 50 Adafruit_DHT = Adafruit_DHTMOCK() import requests import logging from apscheduler.schedulers.background import BlockingScheduler THERMOSTAT_URI = 'http://192....
mit
3,120,118,378,927,795,000
33.322581
93
0.68891
false
3.273846
false
false
false
SuperDARNCanada/placeholderOS
experiments/testing_archive/test_lag_table_bad.py
2
2059
#!/usr/bin/python # write an experiment that raises an exception import sys import os import itertools BOREALISPATH = os.environ['BOREALISPATH'] sys.path.append(BOREALISPATH) import experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype class TestExper...
gpl-3.0
5,829,602,201,352,557,000
34.5
81
0.583293
false
3.212168
false
false
false
chungjjang80/FRETBursts
fretbursts/phtools/phrates_numba.py
2
5001
""" Numba-optimized version of functions to compute KDE-based photon rates. """ from __future__ import division import numpy as np import numba from math import exp, fabs @numba.jit def kde_laplace_numba(timestamps, tau, time_axis=None): """Computes exponential KDE for `timestamps` evaluated at `time_axis`. ...
gpl-2.0
-5,802,954,573,636,648,000
30.853503
77
0.610078
false
3.444215
false
false
false
DShaience/zapPrice
database/dbFiles/dbFilesOperations.py
1
2672
import warnings import numpy as np import pandas as pd def readAndConvertCSVToDbFormatDf(filePath: str, nrows: int = None) -> pd.DataFrame: """ :param filePath: filename with product data :param nrows: limit the number of rows to read (usually used for debug) :return: this is an adaptor between the w...
gpl-3.0
-5,428,207,015,885,456,000
40.107692
163
0.64521
false
3.650273
false
false
false
sunyihuan326/DeltaLab
daily_learning/transfer_learning/tt.py
1
2031
# coding:utf-8 ''' created on 2018/8/31 @author:sunyihuan ''' import os from tensorflow.python import pywrap_tensorflow import tensorflow as tf import numpy as np # hair_length_graph = tf.Graph() # # # model_path = "/Users/sunyihuan/Desktop/parameters/hair_length/second/complex75.03_simple78.63/model.ckpt-23" # che...
mit
-9,110,520,138,812,644,000
28.75
122
0.701928
false
2.81363
false
false
false
mmasdeu/darmonpoints
darmonpoints/integrals.py
1
9942
###################### ## ## ## INTEGRATION ## ## ## ###################### from sage.rings.all import RealField,ComplexField,RR,QuadraticField,PolynomialRing,LaurentSeriesRing,PowerSeriesRing, Infinity,Zmod from sage.all import prod from sage.parallel.decorate import fork,paralle...
gpl-2.0
7,358,493,258,528,513,000
36.235955
136
0.53621
false
3.043159
false
false
false
R-daneel-olivaw/mutation-tolerance-voting
PrefMutationRandom.py
1
4655
''' Created on Mar 18, 2015 @author: PengPeng ''' from code.prefreaders import SushiPref from code.prefUtil import SushiPrefUtil from Crypto.Random.random import sample import random # 'ebi', 'anago', 'maguro', 'ika', 'uni', 'sake', 'tamago', 'toro', 'tekka-maki', 'kappa-maki' class MutationRandom(object): ''' ...
lgpl-3.0
2,551,288,586,847,176,000
41.706422
132
0.572718
false
3.575269
false
false
false
Urlandi/bgptablehole
ipv4seq.py
1
6165
# -*- coding: utf-8 -*- """ Utilities for manipulating IP (v4) """ ADDR_LEN = 32 # IPv4 max mask ASN_MAX = 18446744073709551616L # ASN 32bit max number def ipaddrcount(masklen): """Return address count by mask length""" return 1 << (ADDR_LEN - masklen) def ipmask...
mit
-6,386,601,330,949,451,000
20.833333
115
0.516626
false
3.137405
false
false
false
jhu-lcsr-forks/ogre
Tools/Blender2.6Export/ogre_mesh_exporter/mesh_impl.py
16
16080
# ##### BEGIN MIT LICENSE BLOCK ##### # Copyright (C) 2011 by Lih-Hern Pang # 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 ...
mit
1,976,643,602,277,208,600
41.204724
157
0.721891
false
3.266965
false
false
false
ruslankl9/python_training
bdd/contact_steps.py
1
3553
from pytest_bdd import given, when, then from model.contact import Contact import random @given('a contact list') def contact_list(db): return db.get_contact_list() @given('a contact with <first_name>, <last_name> and <address>') def new_contact(first_name, last_name, address): return Contact(first_name=fir...
apache-2.0
1,513,993,472,987,405,600
38.054945
101
0.646214
false
3.419634
false
false
false
KohlsTechnology/ansible
lib/ansible/modules/network/aci/aci_contract_subject_to_filter.py
12
9130
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
2,922,775,296,852,481,500
28.934426
146
0.607119
false
3.969565
true
false
false
dbmi-pitt/DIKB-Micropublication
scripts/mp-scripts/Bio/Blast/Applications.py
1
5910
"""Definitions for interacting with Blast related applications. """ from Bio import Application from Bio.Application import _Option class FastacmdCommandline(Application.AbstractCommandline): """Create a commandline for the fasta program from NCBI. """ def __init__(self, fastacmd = "fastacmd"): A...
apache-2.0
-6,651,510,568,992,314,000
47.442623
77
0.476311
false
4.112735
false
false
false
gkc1000/pyscf
pyscf/nao/test/nao/na2/test_na2.py
1
1729
# Copyright 2014-2018 The PySCF Developers. 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 appl...
apache-2.0
3,224,419,813,628,457,000
31.622642
83
0.718913
false
3.344294
false
false
false
TheBigBear/python-o365
O365/cal.py
1
3618
import requests import base64 import json import logging import time from O365.event import Event logging.basicConfig(filename='o365.log',level=logging.DEBUG) log = logging.getLogger(__name__) class Calendar( object ): ''' Calendar manages lists of events on an associated calendar on office365. Methods: getN...
apache-2.0
-3,655,629,581,435,199,500
30.736842
118
0.705362
false
3.40678
false
false
false
prds21/repository-barrialTV
lib/lib/utils/scrapingUtils.py
2
7056
# -*- coding: latin-1 -*- import regexUtils import re import urllib import urlparse def findJS(data): idName = '(?:f*id|ch)' jsName = '([^\"\']+?\.js[^\"\']*?)' regex = "(?:java)?scr(?:'\+')?ipt.*?" + idName + "\s*=\s*[\"']([^\"']+)[\"'][^<]*</scr(?:'\+')?ipt\s*>[^<]*<scr(?:'\+')?ipt[^<]*src=[\"']" + js...
gpl-2.0
976,519,082,216,761,200
31.072727
215
0.44161
false
3.503476
false
false
false
GaloisInc/hacrypto
src/C++/Mozilla/old_snapshots/manager/ssl/tests/unit/test_cert_version/generate.py
1
3360
#!/usr/bin/python # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- # vim: set filetype=python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2...
bsd-3-clause
5,472,392,672,683,007,000
42.636364
82
0.663095
false
2.679426
false
false
false
matrix-org/synapse
synapse/storage/databases/main/user_erasure_store.py
1
3536
# Copyright 2018 New Vector Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
7,605,121,877,914,381,000
32.67619
84
0.604355
false
3.881449
false
false
false
USC-ICT/gift-integration-demo
GiftDemo/Assets/StreamingAssets/SB/locomotion-ChrBrad-init.py
1
4404
print "locomotionInitSkeleton = " + locomotionInitSkeleton #locomotion smooth cycle smoothMotion = scene.getMotion("ChrBrad_ChrMarine@RunCircleRt01") smoothMotion.smoothCycle("ChrBrad_ChrMarine@RunCircleRt01_smooth",0.1); smoothMotion = scene.getMotion("ChrBrad_ChrMarine@WalkCircleRt01") smoothMotion.smoothCyc...
bsd-3-clause
4,720,898,787,848,917,000
53.746835
92
0.828338
false
2.59364
false
false
false
dbmi-pitt/DIKB-Micropublication
scripts/mp-scripts/Bio/LogisticRegression.py
1
4336
""" This module provides code for doing logistic regressions. Classes: LogisticRegression Holds information for a LogisticRegression classifier. Functions: train Train a new classifier. calculate Calculate the probabilities of each class, given an observation. classify Classify an observation int...
apache-2.0
5,607,639,300,238,205,000
30.194245
101
0.617159
false
3.699659
false
false
false
Eksmo/calibre
src/calibre/gui2/convert/txt_output_ui.py
1
5427
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/gugu/w/calibre/src/calibre/gui2/convert/txt_output.ui' # # Created: Thu Jul 19 23:32:30 2012 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _...
gpl-3.0
8,035,240,253,747,844,000
52.732673
114
0.682329
false
3.526316
false
false
false
FuegoFro/KeepTalkingBot
src/modules/morse_code_solution.py
1
5695
from enum import Enum from typing import ( List, Optional, ) _Signals = Enum("Signals", ["DOT", "DASH"]) _Pauses = Enum("Pauses", ["SIGNAL", "LETTER", "WORD"]) _ON_TIMINGS = { 0.25: _Signals.DOT, 0.75: _Signals.DASH, } _OFF_TIMINGS = { 0.25: _Pauses.SIGNAL, 1.25: _Pauses.LETTER, 2.50: _P...
mit
-9,062,401,739,373,426,000
33.101796
116
0.561721
false
3.643634
false
false
false
marklescroart/bvp
bvp/BlendScripts/blendermada_download.py
1
1737
# Download all materials from blendermada online material library (www.blendermada.com) # First install blendermada plugin (v 0.9.8-b, downloaded 2016/10/04) # Before calling: Open a blank .blend file import os import bpy import bvp scn = bpy.context.scene if bpy.app.version < (2, 80, 0): vl = context.view_laye...
bsd-2-clause
-2,297,418,442,597,044,500
28.965517
97
0.682211
false
2.899833
false
false
false
MarcoVogt/basil
examples/lx9/host/lx9.py
1
5704
# # ------------------------------------------------------------ # Copyright (c) All rights reserved # SiLab, Institute of Physics, University of Bonn # ------------------------------------------------------------ # import yaml import time import numpy as np from bitarray import bitarray from basil.dut import Dut ...
bsd-3-clause
-7,351,077,881,951,031,000
32.162791
127
0.588534
false
3.331776
false
false
false
combusbvba/trash
plugins/veurne_trash/models.py
1
1851
# -*- coding: utf-8 -*- # Copyright 2017 Mobicage NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
-9,151,640,832,475,444,000
32.654545
100
0.6953
false
3.650888
false
false
false
yanheven/keystone
keystone/assignment/role_backends/ldap.py
9
4055
# 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 t...
apache-2.0
-7,173,758,972,176,994,000
31.44
76
0.639457
false
3.821866
false
false
false
dhermes/huk-a-buk
deck.py
1
5631
import random CARD_VALUES = { 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14, } CARD_SUITS = { 'H': u'\u2665', 'S': u'\u2660', 'C': u'\u2663', 'D': u'\u2666', } CARD_SERIALIZE = { # Tuples of (from_orig...
apache-2.0
2,052,106,489,696,769,500
26.468293
79
0.463683
false
2.620289
false
false
false
rpedroso/swftools
spec/transpstack.py
10
1481
#!/usr/bin/python import sys sys.path += ["../scripts/"] import pdf # a test for transparency groups: # form xobjects used for doing transparency groups can do savestate (q) # without ever needing to do a corresponding restorestate (Q) because # their content stream is self-contained. # # Test that this doesn't confus...
gpl-2.0
3,801,060,936,001,166,000
24.534483
108
0.638758
false
2.557858
false
false
false
currentsea/bitcoinelasticsearch
src/python/bitfinex/bitfinex_trading.py
2
5257
# Copyright (c) 2016 currentsea, Joseph Bull # 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, publ...
mit
1,392,404,210,559,619,800
30.297619
199
0.684801
false
3.237069
false
false
false
tongpo/Holle-World
py/easyGUI/demoprograms/chapter11/canvasdemo1.py
1
1178
""" File: canvasdemo1.py uthor: Kenneth A. Lambert """ from breezypythongui import EasyFrame import random class CanvasDemo(EasyFrame): """Draws filled ovals on a canvas.""" def __init__(self): """Sets up the window and widgets.""" EasyFrame.__init__(self, title = "Canvas Demo 1") sel...
gpl-2.0
408,554,052,247,756,600
30.837838
73
0.511885
false
4.020478
false
false
false
astynax/ranger
ranger/container/tags.py
1
4742
# This file is part of ranger, the console file manager. # License: GNU GPL version 3, see the file "AUTHORS" for details. # TODO: add a __getitem__ method to get the tag of a file from __future__ import (absolute_import, division, print_function) from os.path import exists, abspath, realpath, expanduser, sep import...
gpl-3.0
-598,888,579,103,745,000
25.943182
79
0.518768
false
4.123478
false
false
false
maas/maas
src/maasserver/websockets/base.py
1
26073
# Copyright 2015-2018 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """The base class that all handlers must extend.""" __all__ = [ "HandlerError", "HandlerPKError", "HandlerValidationError", "Handler", ] from functools impor...
agpl-3.0
-2,074,345,313,551,764,000
36.623377
79
0.579872
false
4.450836
false
false
false
stxnext/intranet-open
src/intranet3/intranet3/views/cron/bugs.py
1
2906
# -*- coding: utf-8 -*- from pyramid.view import view_config from pyramid.response import Response from pyramid.renderers import render from intranet3 import config from intranet3.lib.bugs import Bugs from intranet3.log import INFO_LOG, DEBUG_LOG, EXCEPTION_LOG from intranet3.models import User, Project from intranet3...
mit
556,967,443,122,150,300
35.708861
107
0.554828
false
4.067321
false
false
false
IndiciumSRL/wirecurly
tests/test_directory/test_user.py
1
1250
''' Test the creation of a user on the directory ''' import unittest import pytest from wirecurly import directory class testUserCreation(unittest.TestCase): """Test user creation""" def setUp(self): ''' Create our fixtures for these tests ''' self.user = directory.User('1000', 'this is a test') def tes...
mpl-2.0
2,922,798,544,849,021,000
24
55
0.6896
false
3.263708
true
false
false
LLNL/spack
var/spack/repos/builtin/packages/parsplice/package.py
5
1281
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Parsplice(CMakePackage): """ParSplice code implements the Parallel Trajectory Splicing al...
lgpl-2.1
-3,349,856,711,162,556,400
31.846154
105
0.668228
false
3.116788
false
false
false
ejucovy/django-opendebates
opendebates/forms.py
1
7952
from urlparse import urlparse from django import forms from django.contrib.auth import get_user_model from django.contrib.auth.forms import AuthenticationForm from django.core.urlresolvers import resolve, Resolver404 from django.utils.html import mark_safe from django.utils.translation import ugettext_lazy as _ from l...
apache-2.0
3,309,220,891,422,073,300
41.524064
100
0.612047
false
4.191882
false
false
false
gray-stanton/tensorflow-char-rnn
tf_parser.py
1
3362
import tensorflow as tf import io import os.path from gensim.utils import deaccent import re import string import numpy as np def regularize_charset(fname): """Reduce the set of characters in the file to the minimum to encapsulate its semantics. Replaces non-ascii chars with their ascii equivalent. Replac...
mit
-4,398,743,433,412,249,600
27.491525
79
0.640095
false
3.739711
false
false
false
MaxStrange/ArtieInfant
legacy/artie/apps/octopod/priv/pyctopod/pyctopod.py
1
5119
""" This is the python module that handles all the Elixir-Python interfacing. Client python modules should never need to reference erlport at all and should instead, handle all the publisher/subscriber interactions through this module. """ import queue import string import threading import time from erlport.erlang impo...
mit
241,415,941,119,834,980
31.398734
125
0.649346
false
3.955951
false
false
false
tbenthompson/taskloaf
examples/gpu_server.py
1
1873
import numpy as np import tectosaur.util.gpu as gpu import taskloaf as tsk arg = 1.0 def load_module(): import os D = os.path.dirname(os.path.realpath(__file__)) return gpu.load_gpu('kernels.cl', tmpl_dir = D, tmpl_args = dict(arg = arg)) async def gpu_run(): # gd = tsk.get_service('gpu_data') # i...
mit
8,305,155,169,846,455,000
25.013889
80
0.563267
false
2.754412
false
false
false
edx/edx-user-state-client
setup.py
1
1315
from setuptools import setup def load_requirements(*requirements_paths): """ Load all requirements from the specified requirements files. Returns a list of requirement strings. """ requirements = set() for path in requirements_paths: with open(path) as reqs: requirements.up...
agpl-3.0
5,545,524,485,339,057,000
29.581395
93
0.610646
false
4.283388
false
false
false
APMonitor/arduino
7_MHE_and_MPC/Python_GEKKO_MIMO/MHE_and_MPC.py
1
10048
import tclab import numpy as np import time import matplotlib.pyplot as plt from gekko import GEKKO # Connect to Arduino a = tclab.TCLab() # Get Version print(a.version) # Turn LED on print('LED On') a.LED(100) # Run time in minutes run_time = 15.0 # Number of cycles with 3 second intervals loo...
apache-2.0
-8,878,655,876,875,346,000
27.552941
78
0.529857
false
2.674474
false
false
false
ajragusa/OpenFlow-Flight-Recorder
www/webservices/fr.py
1
7552
#!/usr/bin/python import os import sys import re import struct import pymongo from flight_recorder.mongo import FlightRecorderFetcher from bottle import hook, route, run, template, request, response method_list = {} def main(): #create a new flight recorder instance fr = FlightRecorderFetcher() @hook('a...
apache-2.0
-8,743,963,651,425,706,000
37.927835
130
0.529264
false
4.797967
false
false
false
mantidproject/mantid
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IqtFitMultiple.py
3
14331
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + from...
gpl-3.0
4,073,173,575,260,572,700
46.29703
117
0.636452
false
4.105127
false
false
false
freevoid/django-datafilters
datafilters/views.py
1
1823
from django.views.generic.list import MultipleObjectMixin __all__ = ('FilterFormMixin',) class FilterFormMixin(MultipleObjectMixin): """ Mixin that adds filtering behaviour for Class Based Views. """ filter_form_cls = None use_filter_chaining = False context_filterform_name = 'filterform' ...
mit
2,275,489,432,341,574,700
32.759259
81
0.61492
false
4.490148
false
false
false
arruda/pyfuzzy
fuzzy/norm/HamacherSum.py
1
1242
# -*- coding: iso-8859-1 -*- # # Copyright (C) 2009 Rene Liebscher # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 3 of the License, or (at your option) any # later ver...
lgpl-3.0
6,025,396,698,692,897,000
35.558824
99
0.665056
false
3.488764
false
false
false
mganeva/mantid
scripts/SANS/sans/gui_logic/presenter/run_tab_presenter.py
1
57627
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + """ The run tab presenter. This presenter is...
gpl-3.0
6,618,090,460,761,512,000
43.602941
159
0.598417
false
3.948678
false
false
false
pytorch/fairseq
tests/test_iterators.py
1
5433
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest from fairseq.data import iterators class TestIterators(unittest.TestCase): def test_counting_iterator_index(self, ref=N...
mit
3,728,939,549,714,096,600
38.656934
87
0.617891
false
3.341328
true
false
false
newmediamedicine/indivo_server_1_0
indivo/views/reports/healthactionplan.py
1
1903
""" Indivo Views -- HealthActionPlan Message """ from django.http import HttpResponseBadRequest, HttpResponse from indivo.lib.view_decorators import marsloader, DEFAULT_ORDERBY from indivo.lib.query import FactQuery, DATE, STRING, NUMBER from indivo.models import HealthActionPlan HEALTHACTIONPLAN_FILTERS = { 'name'...
gpl-3.0
4,931,510,306,626,359,000
36.313725
71
0.676826
false
3.374113
false
false
false
texastribune/the-dp
tx_highered/thecb_importer/load_admissions.py
1
5753
#! /usr/bin/env python # # DEPRECATED in favor of just using the IPEDS data to avoid having to deal with # scraping PDFs. We can't automate this, and it's costing us too much time to # wrangle with this data source. # # The admissions data is loaded from PDF reports on the THECB website. # # Use pdftohtml to preprocess...
apache-2.0
-5,821,048,449,118,489,000
32.063218
93
0.585781
false
4.062853
false
false
false
jmargraf/agrippa
inputgen/inputgen.py
1
2548
#!/usr/bin/env python from __future__ import print_function import sys, getopt import mol_io as io import react def main(argv): # Initial Input FileName = " " pro1Name = " " pro2Name = " " GeoType = "mol" Template = "template.txt" Code = "orca" Reaction = False xyz = [] atom...
gpl-3.0
-3,495,754,512,695,815,700
27
98
0.506672
false
3.758112
false
false
false
troopa81/Qats
resources/generateBindings/generateBindings.py
1
18794
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################ ## ## Copyright (C) 2015 Cabieces Julien ## Contact: https://github.com/troopa81/Qats ## ## This file is part of Qats. ## ## Qats is free software: you can redistribute it and/or modify ## it under th...
lgpl-3.0
7,611,667,928,726,940,000
38.817797
176
0.543791
false
3.989387
false
false
false
ncullen93/pyBN
pyBN/classes/clustergraph.py
1
5833
""" ****************** ClusterGraph Class ****************** This is a class for creating/manipulating Cluster Graphs, and performing inference over them - currently the only supported algorithm is Loopy Belief Propagation. Still, the class structure is in place for easy addition of any algorithms relying on ...
mit
-6,601,447,194,951,848,000
32.720238
84
0.548946
false
3.873174
false
false
false
lfairchild/PmagPy
programs/qqunf.py
2
1916
#!/usr/bin/env python from __future__ import print_function from builtins import input import sys import pmagpy.pmagplotlib as pmagplotlib import pmagpy.pmag as pmag def main(): """ NAME qqunf.py DESCRIPTION makes qq plot from input data against uniform distribution SYNTAX qqun...
bsd-3-clause
-5,633,176,725,005,005,000
25.985915
74
0.566806
false
3.421429
false
false
false
kellerberrin/OSM-QSAR
OSMBase.py
1
6127
# MIT License # # Copyright (c) 2017 # # 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, di...
mit
7,722,974,059,027,454,000
35.470238
111
0.579729
false
4.66997
false
false
false
wolfiex/DSMACC-testing
dsmacc/run/mpiout.py
1
7574
from uf90 import readfun from mpi4py import MPI import os,sys,time,re import numpy as np comm = MPI.COMM_WORLD rank = comm.rank # The process ID (integer 0-3 for 4-process run) #universe_size=comm.Get_attr(MPI.UNIVERSE_SIZE) try: soft=int(MPI.INFO_ENV.get("soft")) except: print('cant find MPI soft, using 2...
gpl-3.0
-392,247,076,921,217,150
26.146953
153
0.460523
false
3.673133
false
false
false
biggles-plot/biggles
biggles/libplot/tex2libplot.py
2
11761
# # $Id: tex2libplot.py,v 1.5 2002/08/18 22:04:07 mrnolta Exp $ # # Copyright (C) 2000 Mike Nolta <mike@nolta.net> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the Lic...
gpl-2.0
-7,160,043,684,407,754,000
26.287703
74
0.357453
false
3.170936
false
false
false
uq-eresearch/uqam
location/models.py
1
8060
from django.db import models from django.contrib.contenttypes.models import ContentType from django.template.defaultfilters import slugify from exceptions import IllegalMove, SameLevelMove, WrongLevelMove slug_length = 50 class LocationBase(models.Model): name = models.CharField(max_length=255) slug = model...
bsd-3-clause
-4,995,136,529,847,650,000
31.764228
104
0.617122
false
3.992075
false
false
false
phobson/bokeh
examples/models/data_tables_server.py
1
6342
from __future__ import print_function from bokeh.client import push_session from bokeh.document import Document from bokeh.models import ( ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid, Circle, HoverTool, BoxSelectTool ) from bokeh.models.widgets import ( Select, DataTable, TableColumn, StringForma...
bsd-3-clause
-2,652,749,595,042,619,000
43.978723
158
0.611479
false
3.743802
false
false
false
adamfisk/littleshoot-client
server/appengine/littleshoot/amazonDevPay.py
1
9629
from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from django.utils.decorators import decorator_from_middleware from facebook.djangofb import FacebookMiddleware import facebook.djangofb as facebook from django.http import HttpResponse from django.http import Http...
gpl-2.0
3,223,197,400,000,495,000
41.8
214
0.652404
false
4.210319
false
false
false
kennethlyn/elbe
elbepack/commands/setcdrom.py
2
1471
#!/usr/bin/env python # # ELBE - Debian Based Embedded Rootfilesystem Builder # Copyright (C) 2013 Linutronix GmbH # # This file is part of ELBE. # # ELBE 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, eithe...
gpl-3.0
-3,333,298,611,405,832,000
25.745455
76
0.67777
false
3.650124
false
false
false
fbarreir/panda-server
pandaserver/test/datasetCallbackListener.py
2
7517
import os import re import sys import ssl import time import signal import socket import commands import optparse import datetime import cPickle as pickle import stomp from dq2.common import log as logging from config import panda_config from brokerage.SiteMapper import SiteMapper from dataservice import DataServiceUt...
apache-2.0
-3,565,029,283,701,124,600
35.31401
120
0.572303
false
3.880743
true
false
false
anibali/pyshowoff
pyshowoff/__init__.py
1
8149
import requests from requests.auth import HTTPBasicAuth import json from requests_futures.sessions import FuturesSession from .promise import Promise class Client: def __init__(self, base_url, api_key_id=None, api_key_secret=None, disable_async=False): self.base_url = base_url if api_key_id is n...
apache-2.0
-9,011,978,454,624,519,000
29.867424
92
0.454412
false
3.957746
false
false
false
DXCanas/kolibri
kolibri/core/deviceadmin/tests/test_dbrestore.py
1
8164
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import os import random import tempfile import pytest from django.conf import settings from django.core.management import call_command from django.test.utils import override_settings from mock import p...
mit
-4,469,586,616,310,145,000
32.459016
96
0.657031
false
3.874703
true
false
false
doctaphred/projecteuler
projecteuler/__main__.py
1
1036
# -*- coding: utf-8 -*- import sys from .problem import Problem def main(): problems = list(Problem.discover()) if not problems: print('Did not find any problems!') sys.exit(1) num_problems = len(problems) if num_problems == 1: print('1 problem attempted') else: ...
gpl-3.0
-5,461,986,150,749,626,000
23.093023
77
0.586873
false
3.969349
false
false
false
ESS-LLP/erpnext
erpnext/stock/reorder_item.py
8
7231
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import frappe import erpnext from frappe.utils import flt, nowdate, add_days, cint from frappe import _ def reorder_item(): """ Reorder item if stock reaches reorder level""" # if initial s...
gpl-3.0
2,448,168,449,020,155,400
33.108491
124
0.698105
false
3.238245
false
false
false
SymbiFlow/symbiflow-arch-defs
utils/print_place_delay_matrix.py
1
1063
""" Print override delta delay placement model in human readable format. """ import argparse import capnp import os.path # Remove magic import hook. capnp.remove_import_hook() def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( '--schema_path', help='Path t...
isc
-641,335,990,025,011,500
24.309524
76
0.624647
false
3.462541
false
false
false
Eigenlabs/EigenD
plg_language/database.py
1
3196
# # Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com # # This file is part of EigenD. # # EigenD 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
3,107,174,016,394,879,500
34.511111
99
0.62766
false
3.970186
false
false
false
akhilraj95/xpense
xpense2/flock/action.py
1
6240
import secret from models import User,Currency,Expense,Bill import urllib2,json import urllib2 import urllib from docx import Document import time from docx.shared import Inches import os from datetime import timedelta from django.core.files import File #FlockOS from pyflock import FlockClient, verify_event_token fro...
mit
6,812,528,329,307,556,000
32.913043
166
0.620833
false
3.476323
false
false
false
chromium/chromium
tools/android/dependency_analysis/print_package_dependencies.py
7
4391
#!/usr/bin/env python3 # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Command-line tool for printing package-level dependencies.""" import argparse import graph import print_dependencies_helper import...
bsd-3-clause
2,967,168,041,341,277,000
41.221154
80
0.670462
false
3.948741
false
false
false
glibersat/brewpi-service
brewblox_service/scheduler.py
2
5233
""" Background task scheduling. """ import asyncio from contextlib import suppress from typing import Any, Coroutine, Set from aiohttp import web from brewblox_service import features CLEANUP_INTERVAL_S = 300 def setup(app: web.Application): features.add(app, TaskScheduler(app)) def get_scheduler(app: web.A...
gpl-3.0
-7,514,386,439,900,776,000
28.072222
100
0.604624
false
4.453617
false
false
false
boto/botoflow
botoflow/flow_types/workflow_type.py
1
7947
# Copyright 2016 Darjus Loktevic # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
6,293,975,457,061,321,000
40.176166
98
0.594564
false
4.337882
false
false
false
Xeratec/py-general
fractal_qt4_mpl.py
1
12284
#!/usr/bin/python ''' @file fractal_qt4_mpl.py @author Philip Wiese @date 12 Okt 2016 @brief Displays Mandelbrot Set with PyQt4 and Matplotlip ''' from PyQt4.QtCore import * from PyQt4.QtGui import * from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.pyplot import * from m...
mit
8,328,964,092,956,857,000
32.84022
119
0.572289
false
3.51373
false
false
false
michelesr/coding-events
web/processors/user.py
1
1859
from django.contrib.auth.models import User from django_countries import countries def get_user(user_id): user = User.objects.get(id=user_id) return user def get_user_profile(user_id): user = User.objects.get(id=user_id) return user.profile def get_ambassadors(country_code=None): ambassadors =...
mit
5,778,873,849,347,322,000
32.196429
117
0.693921
false
3.392336
false
false
false
rxncon/rxncon
rxncon/input/quick/quick.py
1
2873
"""Module containing the class Quick, a text-based format to read a rxncon system.""" import re from typing import List, Optional from rxncon.input.shared.contingency_list import contingencies_from_contingency_list_entries, \ contingency_list_entry_from_strs, ContingencyListEntry from rxncon.core.reaction import ...
lgpl-3.0
188,836,107,975,411,780
43.90625
105
0.655064
false
3.664541
false
false
false
kaiocesar/easy-bank
bank/models.py
1
1098
# -*- coding: utf-8 -*- from django.db import models from django.contrib.auth.models import User class Account(models.Model): account_number = models.CharField(max_length=30) agency_number = models.CharField(max_length=30) created_at = models.DateTimeField(auto_now=True) status = models.BooleanField(de...
mit
-607,595,879,829,265,300
27.153846
73
0.645719
false
3.69697
false
false
false
diN0bot/ProcrasDonate
lib/ssl_middleware.py
1
1526
__license__ = "Python" __copyright__ = "Copyright (C) 2007, Stephen Zabel" __author__ = "Stephen Zabel - sjzabel@gmail.com" __contributors__ = "Jay Parlar - parlar@gmail.com" """ From django snippets: http://www.djangosnippets.org/snippets/85/ """ from django.conf import settings from django.http import HttpRespo...
agpl-3.0
-841,247,359,315,681,800
32.173913
87
0.63827
false
3.912821
false
false
false