text stringlengths 0 1.05M | meta dict |
|---|---|
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
encryptions = []
class var:
def __init__(self, obj): self.obj = obj;
def get(self): return self.obj
def set(self, obj): self.obj = obj
class reverse:
name = "reverse"
def start(self, encrypt, sentance):
done = False;
if encr... | {
"repo_name": "il8677/ComputationalThinking",
"path": "Encryption.py",
"copies": "1",
"size": "3060",
"license": "mit",
"hash": -8876327648043881000,
"line_mean": 29.0098039216,
"line_max": 82,
"alpha_frac": 0.5310457516,
"autogenerated": false,
"ratio": 4.08,
"config_test": false,
"has_no_ke... |
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
class Rotor():
perms = []
turnover_position = ''
position = 'A'
def __init__(self, perms, turnover_position, ring_setting):
i = alphabet.index(ring_setting)
perms = perms[i:] + perms[:i]
self.perms = [c for c in perms]
self.turnove... | {
"repo_name": "DT9/programming-problems",
"path": "other/engima.py",
"copies": "1",
"size": "4222",
"license": "apache-2.0",
"hash": 9022073693378002000,
"line_mean": 33.3333333333,
"line_max": 137,
"alpha_frac": 0.5438180957,
"autogenerated": false,
"ratio": 3.5658783783783785,
"config_test": ... |
alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
def encrypt(text, shift):
if not (1 < shift < 25):
raise ValueError("Shift key must be between 1 and 25.")
i, enc = 0, ""
text = text.upper()
while i < len(text):
if... | {
"repo_name": "idunnowhy9000/Projects",
"path": "SOURCE/Python/Security/Caesar Cipher.py",
"copies": "1",
"size": "1112",
"license": "mit",
"hash": 4253319265747669500,
"line_mean": 24.2954545455,
"line_max": 141,
"alpha_frac": 0.529676259,
"autogenerated": false,
"ratio": 2.6164705882352943,
"... |
alphabet = "abcdefghijklmnopqrstuvwxyz"
def rule1(password):
for i in range(len(password) - 2):
try:
if password[i:i + 3] in alphabet:
return True
except IndexError:
continue
return False
def rule2(password):
if 'i' in password or 'o' in password or ... | {
"repo_name": "protocol114/AdventOfCode",
"path": "day11/day11.py",
"copies": "1",
"size": "1608",
"license": "mit",
"hash": -1771149653789528600,
"line_mean": 24.125,
"line_max": 97,
"alpha_frac": 0.6231343284,
"autogenerated": false,
"ratio": 3.7746478873239435,
"config_test": false,
"has_n... |
alphabet = 'abcdefghijklmnopqrstuvwxyz'
#VERSION 1
text = input('your input: ')
for c_alphabet in alphabet: #test each character in the alphabet
for c_text in text: # ...comparing it to each character in the text
found_char = False #when we start, we haven't found the current character yet
if c_te... | {
"repo_name": "sgolitsynskiy/sergey.cs.uni.edu",
"path": "www/courses/cs1510/fall2017/sessions/100517_alphabet.py",
"copies": "1",
"size": "1164",
"license": "mit",
"hash": -110182112147892100,
"line_mean": 30.4594594595,
"line_max": 104,
"alpha_frac": 0.6735395189,
"autogenerated": false,
"ratio... |
alphabet=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
print ("\n\n\nQue voulez-vous faire?")
print (" Option 1:crypter un document")
print (" Option 2:decrypter un document")
choix=input("faite un choix (tapez 1 ou 2): ")
cle=input("Clé utilisée ? (en ma... | {
"repo_name": "alexandre-o/XOR-isn-projet-python-",
"path": "cryptage-decryptage final.py",
"copies": "1",
"size": "4464",
"license": "cc0-1.0",
"hash": 4121966733490300000,
"line_mean": 65.7692307692,
"line_max": 163,
"alpha_frac": 0.6356413167,
"autogenerated": false,
"ratio": 2.786211258697027... |
ALPHABET = ["A", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "P", "Q", "R", "S"]
def makeKMerList(k):
if k == 1:
# The k-mer list is the alphabet
return ALPHABET
kMinusOneMerList = makeKMerList(k - 1)
kMerList = []
for kMinusOneMer in kMinusOneMerList:
# Iterate through the list of k-1-... | {
"repo_name": "imk1/IMKTFBindingCode",
"path": "makeSequenceInputsKMerCountsBaseline.py",
"copies": "1",
"size": "3338",
"license": "mit",
"hash": 5476083632124738000,
"line_mean": 39.725,
"line_max": 146,
"alpha_frac": 0.7171959257,
"autogenerated": false,
"ratio": 3.1490566037735848,
"config_... |
"""Alphabet and text normalization for Latin.
- *Principles of Text Cleaning gleaned from*
- http://udallasclassics.org/wp-content/uploads/maurer_files/APPARATUSABBREVIATIONS.pdf
Guidelines:
- [...] Square brackets, or in recent editions wavy brackets ʺ{...}ʺ, enclose words etc. that an editor thinks should be delete... | {
"repo_name": "kylepjohnson/cltk",
"path": "src/cltk/alphabet/lat.py",
"copies": "4",
"size": "16990",
"license": "mit",
"hash": -7182769970856932000,
"line_mean": 34.2962184874,
"line_max": 339,
"alpha_frac": 0.6411523124,
"autogenerated": false,
"ratio": 2.914816099930604,
"config_test": fals... |
ALPHABET = "ATGC"
COMPLEMENT = {"A":"T","T":"A","G":"C","C":"G"}
def rc(dna):
ret = ""
for i in range(len(dna)):
ret = COMPLEMENT[dna[i]] + ret
return ret
def compute_distance(s1,s2):
if len(s2) == 0:
return 0
pos = 0
while pos != -1:
l = len(s1) - pos
if s1... | {
"repo_name": "crf1111/Bio-Informatics-Learning",
"path": "Bio-StrongHold/src/Genome_Assembly_Using_Reads.py",
"copies": "1",
"size": "1882",
"license": "mit",
"hash": 51970870166750700,
"line_mean": 22.835443038,
"line_max": 79,
"alpha_frac": 0.398512221,
"autogenerated": false,
"ratio": 3.58476... |
ALPHABET = [chr(i) for i in range(97, 123)]
ALPHABET_SIZE = len(ALPHABET)
class Mapping(dict):
def __init__(self):
self.inverted = {}
self.length = 0
def to_char(self, number):
index = number / ALPHABET_SIZE
first_char = ALPHABET[ index-1 ] if index else ''
last_ch... | {
"repo_name": "laginha/yard",
"path": "src/yard/resources/base/uglify.py",
"copies": "1",
"size": "1227",
"license": "mit",
"hash": 3426945364969444000,
"line_mean": 24.5625,
"line_max": 58,
"alpha_frac": 0.5297473513,
"autogenerated": false,
"ratio": 3.505714285714286,
"config_test": false,
... |
"""Alphabetic tokenizer"""
import re
from py_stringmatching import utils
from py_stringmatching.tokenizer.definition_tokenizer import DefinitionTokenizer
class AlphabeticTokenizer(DefinitionTokenizer):
"""Alphabetic tokenizer class.
Parameters:
return_set (boolean): flag to indicate whether to retu... | {
"repo_name": "Anson-Doan/py_stringmatching",
"path": "py_stringmatching/tokenizer/alphabetic_tokenizer.py",
"copies": "1",
"size": "1672",
"license": "bsd-3-clause",
"hash": -1362291831278575900,
"line_mean": 29.962962963,
"line_max": 88,
"alpha_frac": 0.5927033493,
"autogenerated": false,
"rati... |
ALPHABET = list("abcdefghijklmnopqrstuvwxyz")
def get_keys(dictionary, value):
result = []
for key in dictionary.keys():
if dictionary[key] == value:
result.append(key)
return result
def parse_line(line_data):
letter_counts = {}
parts = line_data.split("-")
name = ' '.jo... | {
"repo_name": "Shifterovich/AoC",
"path": "2016/4/part1.py",
"copies": "1",
"size": "1212",
"license": "mit",
"hash": -8505388748147935000,
"line_mean": 20.6428571429,
"line_max": 74,
"alpha_frac": 0.603960396,
"autogenerated": false,
"ratio": 3.5232558139534884,
"config_test": false,
"has_no... |
ALPHABET = list("abcdefghijklmnopqrstuvwxyz")
# https://github.com/Shifterovich/Crypto
def rot(string, rotInt, letters=ALPHABET): # To decrypt, use a negative number
length = len(letters)
return ''.join(
map(lambda letter: letter in letters and letters[(letters.index(letter) + rotInt) % length] or l... | {
"repo_name": "Shifterovich/AoC",
"path": "2016/4/part2.py",
"copies": "1",
"size": "2106",
"license": "mit",
"hash": 110855489001069800,
"line_mean": 25.325,
"line_max": 110,
"alpha_frac": 0.6177587844,
"autogenerated": false,
"ratio": 3.551433389544688,
"config_test": false,
"has_no_keyword... |
alphabet = list(map(chr, range(97, 123)))
dataInput = "hxbxwxba"
def increment(a):
a_number = letter_number(a)
if a_number == 25:
return "a"
return alphabet[a_number + 1]
def full_increment(a):
should_increment = True
i = len(a) - 1
while should_increment:
new_letter = incre... | {
"repo_name": "gytdau/advent",
"path": "Day11/part1.py",
"copies": "1",
"size": "1608",
"license": "mit",
"hash": -5578565286086075000,
"line_mean": 22.3188405797,
"line_max": 85,
"alpha_frac": 0.5939054726,
"autogenerated": false,
"ratio": 3.2354124748490944,
"config_test": false,
"has_no_ke... |
alphabet = list(map(chr, range(97, 123)))
dataInput = "hxbxxzaa"
def increment(a):
a_number = letter_number(a)
if a_number == 25:
return "a"
return alphabet[a_number + 1]
def full_increment(a):
should_increment = True
i = len(a) - 1
while should_increment:
new_letter = incre... | {
"repo_name": "gytdau/advent",
"path": "Day11/part2.py",
"copies": "1",
"size": "1608",
"license": "mit",
"hash": -3561071318660239000,
"line_mean": 22.3188405797,
"line_max": 85,
"alpha_frac": 0.5939054726,
"autogenerated": false,
"ratio": 3.2354124748490944,
"config_test": false,
"has_no_ke... |
ALPHABET = {
'0': 'zero',
'1': 'one',
'2': 'two',
'3': 'tree',
'4': 'fower',
'5': 'fife',
'6': 'six',
'7': 'seven',
'8': 'ait',
'9': 'niner',
'-': 'minus',
'.': 'and',
}
def aviation_numbers(number):
output = []
for char in str(number):
output.append(AL... | {
"repo_name": "AstroTech/workshop-python",
"path": "functions/solution/functions_aviation_numbers.py",
"copies": "1",
"size": "1192",
"license": "mit",
"hash": -4713878762042674000,
"line_mean": 19.9122807018,
"line_max": 74,
"alpha_frac": 0.5553691275,
"autogenerated": false,
"ratio": 2.92156862... |
alphabet = {
"A": ("ABCDEFGHIJKLM", "NOPQRSTUVWXYZ"),
"B": ("ABCDEFGHIJKLM", "NOPQRSTUVWXYZ"),
"C": ("ABCDEFGHIJKLM", "ZNOPQRSTUVWXY"),
"D": ("ABCDEFGHIJKLM", "ZNOPQRSTUVWXY"),
"E": ("ABCDEFGHIJKLM", "YZNOPQRSTUVWX"),
"F": ("ABCDEFGHIJKLM", "YZNOPQRSTUVWX"),
"G": ("ABCDEFGHIJKLM", "XYZNOPQRS... | {
"repo_name": "TheAlgorithms/Python",
"path": "ciphers/porta_cipher.py",
"copies": "1",
"size": "3152",
"license": "mit",
"hash": -5530739248368731000,
"line_mean": 29.6019417476,
"line_max": 76,
"alpha_frac": 0.5881979695,
"autogenerated": false,
"ratio": 3.078125,
"config_test": false,
"has... |
alphabets = 'abcdefghijklmnopqrstuvwxyz'
test = '''g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.'''
url = 'map'
def finder(letter):
'''Uses binary search to ... | {
"repo_name": "DayGitH/Python-Challenges",
"path": "PythonChallenge/ch1.py",
"copies": "1",
"size": "1496",
"license": "mit",
"hash": -653520523575267200,
"line_mean": 28.3333333333,
"line_max": 216,
"alpha_frac": 0.5755347594,
"autogenerated": false,
"ratio": 3.4709976798143853,
"config_test":... |
alphabets = [chr(i) for i in range(32, 126)]
gear_one = [i for i in range(len(alphabets))]
gear_two = [i for i in range(len(alphabets))]
gear_three = [i for i in range(len(alphabets))]
reflector = [i for i in reversed(range(len(alphabets)))]
code = []
gear_one_pos = gear_two_pos = gear_three_pos = 0
def rotator():
... | {
"repo_name": "TheAlgorithms/Python",
"path": "hashes/enigma_machine.py",
"copies": "1",
"size": "1705",
"license": "mit",
"hash": -4619744488591786000,
"line_mean": 27.8983050847,
"line_max": 80,
"alpha_frac": 0.5865102639,
"autogenerated": false,
"ratio": 3.105646630236794,
"config_test": fal... |
alphabet = "абвгдеєжзиіїйклмнопрстуфхцчшщьюя_"
rot11 = [
alphabet,
range(1, len(alphabet) + 1),
[5,7,17,23,28,26,20,21,2,19,13,32,12,9,16,11,10,25,24,8,4,27,3,31,15,14,33,18,1,29,22,30,6]
]
rot22 = [
range(1, len(alphabet) + 1),
[20,19,25,22,27,8,13,29,30,12,32,24,1,31,6,7,17,26,2,28,11,4,23,14,... | {
"repo_name": "Fly-Style/metaprog_univ",
"path": "Lab1/LearnPy/test.py",
"copies": "1",
"size": "1942",
"license": "mit",
"hash": -672354941539923800,
"line_mean": 27.223880597,
"line_max": 128,
"alpha_frac": 0.5201058201,
"autogenerated": false,
"ratio": 2.1140939597315436,
"config_test": fals... |
"""Alpha combination models."""
import copy
import numpy as np
from mingle.utilities.simulation_utilities import combine_spectra
def alpha_model(alpha, rv, host, companion, limits, new_x=None):
"""Entangled spectrum model.
inputs:
spectrum_1
spectrum_2
alpha
rv - rv offset of spec2
xran... | {
"repo_name": "jason-neal/companion_simulations",
"path": "obsolete/models/alpha_model.py",
"copies": "1",
"size": "2999",
"license": "mit",
"hash": -3965605230734573000,
"line_mean": 25.7767857143,
"line_max": 85,
"alpha_frac": 0.6692230744,
"autogenerated": false,
"ratio": 3.524089306698002,
... |
"""alpha-Compositing of images.
Implements algorithms developed in
Porter, Thomas & Duff, Tom (1984), "Compositing Digital Images",
SIGGRAPH Comput. Graph.,
doi:10.1145/964965.808606
Smith, Alvy Ray (1995), "Image Compositing Fundamentals",
Microsoft Tech Memo 4,
http://www.cs.princeton.e... | {
"repo_name": "rnikutta/compositing",
"path": "compositing.py",
"copies": "1",
"size": "14533",
"license": "bsd-3-clause",
"hash": -5802967842919820000,
"line_mean": 29.7251585624,
"line_max": 118,
"alpha_frac": 0.6014587491,
"autogenerated": false,
"ratio": 3.9151400862068964,
"config_test": f... |
"""`AlphaIMS`, `AlphaAMS`"""
import numpy as np
from collections import OrderedDict
from .base import ProsthesisSystem
from .electrodes import SquareElectrode, DiskElectrode
from .electrode_arrays import ElectrodeGrid
class AlphaIMS(ProsthesisSystem):
"""Alpha-IMS
This class creates an Alpha-IMS array with ... | {
"repo_name": "mbeyeler/pulse2percept",
"path": "pulse2percept/implants/alpha.py",
"copies": "1",
"size": "10798",
"license": "bsd-3-clause",
"hash": -6343242073722403000,
"line_mean": 40.6911196911,
"line_max": 80,
"alpha_frac": 0.6146508613,
"autogenerated": false,
"ratio": 3.6966792194453952,
... |
alpha=int(raw_input("pick a number and press enter "))
beta=int(raw_input("pick another number and press enter "))
#print alpha, beta #for testing purposes, might be added back later to verify correct numbers
end= max(alpha+1, beta+1) #because the index starts at zero it will end at alpha/beta not one number higher
... | {
"repo_name": "Greh/coconuts",
"path": "LCMandGCD.py",
"copies": "1",
"size": "2050",
"license": "mit",
"hash": -1933517286368731100,
"line_mean": 39.1960784314,
"line_max": 143,
"alpha_frac": 0.68,
"autogenerated": false,
"ratio": 2.7777777777777777,
"config_test": false,
"has_no_keywords": ... |
ALPHANUMERICAL_DIGITS= '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
BIN_DIGITS= ALPHANUMERICAL_DIGITS[0:2]
OCT_DIGITS= ALPHANUMERICAL_DIGITS[0:8]
DECIMAL_DIGITS= ALPHANUMERICAL_DIGITS[0:10]
HEX_DIGITS= ALPHANUMERICAL_DIGITS[0:16]
ALL_LOWER= ALPHANUMERICAL_DIGITS[10:36]
ALL_UPPER= ALPHANUMERICAL_DIGI... | {
"repo_name": "julzhk/codekata",
"path": "BaseConversion.py",
"copies": "1",
"size": "3342",
"license": "mit",
"hash": 922105167746660900,
"line_mean": 39.265060241,
"line_max": 110,
"alpha_frac": 0.6529024536,
"autogenerated": false,
"ratio": 3.3220675944333995,
"config_test": true,
"has_no_... |
"""Alphanumeric tokenizer"""
import re
from py_stringmatching import utils
from py_stringmatching.tokenizer.definition_tokenizer import DefinitionTokenizer
class AlphanumericTokenizer(DefinitionTokenizer):
"""Alphanumeric tokenizer class.
Parameters:
return_set (boolean): flag to indicate whether t... | {
"repo_name": "Anson-Doan/py_stringmatching",
"path": "py_stringmatching/tokenizer/alphanumeric_tokenizer.py",
"copies": "1",
"size": "1746",
"license": "bsd-3-clause",
"hash": -6686849175719878000,
"line_mean": 31.3333333333,
"line_max": 92,
"alpha_frac": 0.5962199313,
"autogenerated": false,
"r... |
# Alpha O. Sall
# 03/24/2014
from flask import Flask, request, Response
import json
import requests
from array import *
from Log import Log
def getCephRestApiUrl(request):
# discover ceph-rest-api URL
return request.url_root.replace("inkscopeCtrl","ceph-rest-api")
class Pools:
"""docstring for pools"""
... | {
"repo_name": "abrefort/inkscope-debian",
"path": "inkscopeCtrl/poolsCtrl.py",
"copies": "1",
"size": "11366",
"license": "apache-2.0",
"hash": -2182509588389155600,
"line_mean": 36.3881578947,
"line_max": 164,
"alpha_frac": 0.5793594932,
"autogenerated": false,
"ratio": 3.5496564647095563,
"co... |
# Alpha O. Sall
# 03/24/2014
from flask import Flask, request, Response, render_template
app = Flask(__name__)#,template_folder='/var/www/inkscope/inkscopeAdm/')
import requests
from array import *
import sys
from urllib2 import HTTPError
import json
from bson.json_util import dumps
import time
import mongoJuiceCore
... | {
"repo_name": "abrefort/inkscope-debian",
"path": "inkscopeCtrl/inkscopeCtrlcore.py",
"copies": "1",
"size": "8553",
"license": "apache-2.0",
"hash": -5762974667787807000,
"line_mean": 29.5464285714,
"line_max": 100,
"alpha_frac": 0.6587162399,
"autogenerated": false,
"ratio": 3.3319049474094276,... |
# Alpha O. Sall
# 03/24/2014
from flask import request, Response
import json
import requests
from array import *
import subprocess
from StringIO import StringIO
from InkscopeError import InkscopeError
import ceph_version
class Pools:
"""docstring for pools"""
def __init__(self):
pass
def newpool_... | {
"repo_name": "inkscope/inkscope",
"path": "inkscopeCtrl/poolsCtrl.py",
"copies": "1",
"size": "15558",
"license": "apache-2.0",
"hash": -9137341098622071000,
"line_mean": 41.0513513514,
"line_max": 154,
"alpha_frac": 0.5357372413,
"autogenerated": false,
"ratio": 3.8471810089020773,
"config_te... |
# Alpha O. Sall
# 07/2014
from flask import Flask, request, Response
import json
import requests
from array import *
import salt.client
local = salt.client.LocalClient()
def getCephRestApiUrl(request):
# discover ceph-rest-api URL
return request.url_root.replace("inkscopeCtrl","ceph-rest-api")
class Pools:
... | {
"repo_name": "abrefort/inkscope-debian",
"path": "inkscopeCtrl/poolsCtrlSalt.py",
"copies": "1",
"size": "7938",
"license": "apache-2.0",
"hash": 8368572895368493000,
"line_mean": 38.301980198,
"line_max": 164,
"alpha_frac": 0.5981355505,
"autogenerated": false,
"ratio": 3.3423157894736844,
"c... |
# Alpha O. Sall
# Alain Dechorgnat
# 03/24/2014
# 2015-12 A. Dechorgnat: add login security (inspired from http://thecircuitnerd.com/flask-login-tokens/)
from flask import Flask, Response, redirect
from flask_login import (LoginManager, login_required, login_user,
current_user, logout_user, ... | {
"repo_name": "inkscope/inkscope",
"path": "inkscopeCtrl/inkscopeCtrlcore.py",
"copies": "1",
"size": "21791",
"license": "apache-2.0",
"hash": -5159411330744859000,
"line_mean": 32.8895800933,
"line_max": 134,
"alpha_frac": 0.664127392,
"autogenerated": false,
"ratio": 3.5129775914879895,
"con... |
"""Alpha probability distribution."""
import numpy
from scipy import special
import chaospy
from ..baseclass import SimpleDistribution, ShiftScaleDistribution
class alpha(SimpleDistribution):
"""Standard Alpha distribution."""
def __init__(self, a=1):
super(alpha, self).__init__(dict(a=a))
def ... | {
"repo_name": "jonathf/chaospy",
"path": "chaospy/distributions/collection/alpha.py",
"copies": "1",
"size": "1953",
"license": "mit",
"hash": -3789500369627800000,
"line_mean": 26.125,
"line_max": 66,
"alpha_frac": 0.5294418843,
"autogenerated": false,
"ratio": 3.344178082191781,
"config_test"... |
# Alpha release.
import re
# Ask user for string to be transliterated to Cyrillic, including soft and hard signs.
latin_string = input("What is the Latin text you want transliterated to Cyrillic? Include hard and soft signs by using apostrophes and quotation marks respectively.\n> ")
latin_string = latin_string.low... | {
"repo_name": "TheHockeyist/russian-untransliterator",
"path": "code.py",
"copies": "1",
"size": "6920",
"license": "mit",
"hash": -6374143347282309000,
"line_mean": 34.8658536585,
"line_max": 264,
"alpha_frac": 0.5414824889,
"autogenerated": false,
"ratio": 2.171280915466962,
"config_test": fa... |
"""alpha URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | {
"repo_name": "abertal/alpha",
"path": "alpha/urls.py",
"copies": "2",
"size": "1290",
"license": "bsd-3-clause",
"hash": -2646009800374124500,
"line_mean": 35.8571428571,
"line_max": 79,
"alpha_frac": 0.6992248062,
"autogenerated": false,
"ratio": 3.505434782608696,
"config_test": false,
"ha... |
""" ALPHA VERSION
As of currently, this version of the calculator does not address expressions such as: "1 + --1" or "1 + -(-1)" properly.
This will be addressed in the next version of the calculator
"""
import operator
SUPPORTED_OPERATORS = ( \
\
{'+': operator.add, \
'-':... | {
"repo_name": "CptDemocracy/Python",
"path": "Misc/infixCalc.py",
"copies": "1",
"size": "4658",
"license": "mit",
"hash": -5174823535974456000,
"line_mean": 29.4444444444,
"line_max": 120,
"alpha_frac": 0.5010734221,
"autogenerated": false,
"ratio": 4.253881278538813,
"config_test": false,
"... |
# Alright, this is how we regression test our little fake processor
# We startup a new (blank slate each time)
# Run a couple of commands, then make sure the output makes sense
def over18Bit(number):
if number > 2**18:
raise RuntimeError("Failure to maintain word size")
from bitUtils import *
def test... | {
"repo_name": "meawoppl/GA144Tools",
"path": "unitTests.py",
"copies": "1",
"size": "2024",
"license": "mit",
"hash": 6251771849126285000,
"line_mean": 34.5087719298,
"line_max": 104,
"alpha_frac": 0.7341897233,
"autogenerated": false,
"ratio": 3.4074074074074074,
"config_test": false,
"has_n... |
# als_data_preprocessor.py
#
# Standalone Python/Spark program to perform data pre-processing..
# Reads Ratings data and meta data to combine where necessary
# and encode labels to a form fit for processing.
#
#
# Usage: spark-submit data_preprocessor.py <inputdatafile>
# Example usage: spark-submit data_preprocessor.p... | {
"repo_name": "shreyas15/Product-Recommender-Engine",
"path": "als_data_preprocessor.py",
"copies": "1",
"size": "2900",
"license": "mit",
"hash": -6342272674900172000,
"line_mean": 29.2083333333,
"line_max": 93,
"alpha_frac": 0.6627586207,
"autogenerated": false,
"ratio": 3.2044198895027622,
"... |
"""A L shape attached with a joint and constrained to not tip over.
"""
__version__ = "$Id:$"
__docformat__ = "reStructuredText"
import random, sys
import pygame
from pygame.locals import *
from pygame.color import *
import pymunk as pm
def to_pygame(p):
"""Small hack to convert pymunk to pygame coordinates""... | {
"repo_name": "sneharavi12/DeepLearningFinals",
"path": "pymunk-pymunk-4.0.0/examples/slide_and_pinjoint.py",
"copies": "5",
"size": "3744",
"license": "mit",
"hash": 1364345080804963600,
"line_mean": 28.7142857143,
"line_max": 106,
"alpha_frac": 0.5360576923,
"autogenerated": false,
"ratio": 3.4... |
"""A L shape attached with a joint and constrained to not tip over.
This example is also used in the Get Started Tutorial.
"""
__docformat__ = "reStructuredText"
import random
import sys
import pygame
import pymunk
import pymunk.pygame_util
random.seed(1)
def add_ball(space):
"""Add a ball to the given spa... | {
"repo_name": "viblo/pymunk",
"path": "examples/slide_and_pinjoint.py",
"copies": "1",
"size": "2895",
"license": "mit",
"hash": 2024984011289739000,
"line_mean": 26.5714285714,
"line_max": 87,
"alpha_frac": 0.6013816926,
"autogenerated": false,
"ratio": 3.1297297297297297,
"config_test": false... |
"""A L shape attached with a joint and constrained to not tip over.
"""
__version__ = "$Id:$"
__docformat__ = "reStructuredText"
import random
import pygame
from pygame.locals import *
from pygame.color import *
import pymunk as pm
def to_pygame(p):
"""Small hack to convert pymunk to pygame coo... | {
"repo_name": "cfobel/python___pymunk",
"path": "examples/slide_and_pinjoint.py",
"copies": "1",
"size": "3865",
"license": "mit",
"hash": -4147716911107770400,
"line_mean": 28.6746031746,
"line_max": 106,
"alpha_frac": 0.5184993532,
"autogenerated": false,
"ratio": 3.5200364298724955,
"config_... |
# Also from the bipartite
import datetime
from tulip import tlp
# start the clock
start_script = datetime.datetime.now()
# The updateVisualization(centerViews = True) function can be called
# during script execution to update the opened views
# The pauseScript() function can be called to pause the script execution.... | {
"repo_name": "spaghetti-open-data/ODFest2017-horizon2020-network",
"path": "H2020_Code_2017/compute_weighted_bar_power.py",
"copies": "1",
"size": "4440",
"license": "mit",
"hash": 1529456325798259200,
"line_mean": 44.306122449,
"line_max": 89,
"alpha_frac": 0.7725225225,
"autogenerated": false,
... |
#also known as the why you don't do inheritance cos it is evil like a bad fantasy villian from princess bride.
class Parent(object):
def implict(self):
print 'parent implict()'
def override(self):
print 'parent crash override'
def altered(self):
print 'parent altered'
class Child(Parent):
def __init__(sel... | {
"repo_name": "vanonselenp/Learning",
"path": "Python/LPTHW/ex44.py",
"copies": "1",
"size": "1208",
"license": "mit",
"hash": -7639811511596243000,
"line_mean": 17.0447761194,
"line_max": 110,
"alpha_frac": 0.7086092715,
"autogenerated": false,
"ratio": 3.073791348600509,
"config_test": false,... |
# also using qt designer to get quick visual preview of how the window should look like. Please install qt designer to open the .ui file. It CAN be converted to python code, but its like a translated-from-c++ version and very inelegant. Trying to define the functions individually for easier debugging/edits.
# WMS's att... | {
"repo_name": "sunjerry019/photonLauncher",
"path": "micron/project_guimicro/_archive/archive.py",
"copies": "1",
"size": "1746",
"license": "apache-2.0",
"hash": 4562587701307450400,
"line_mean": 41.6097560976,
"line_max": 308,
"alpha_frac": 0.7422680412,
"autogenerated": false,
"ratio": 3.60743... |
class SplicingAnnotationData:
def ArrayType(self):
self._array_type = array_type
return self._array_type
def Probeset(self): return self._probeset
def setProbeset(self,probeset): self._probeset = probeset
def ExonID(self): return self._exonid
def setDisplayExonID(self,exonid): self._... | {
"repo_name": "wuxue/altanalyze",
"path": "AltAnalyze.py",
"copies": "1",
"size": "493280",
"license": "apache-2.0",
"hash": -4702367625643405000,
"line_mean": 60.0949962844,
"line_max": 423,
"alpha_frac": 0.6119952157,
"autogenerated": false,
"ratio": 3.733236460509188,
"config_test": false,
... |
#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, distribute, sublicense, and/or sell
#copi... | {
"repo_name": "wuxue/altanalyze",
"path": "ParsePGF.py",
"copies": "1",
"size": "5014",
"license": "apache-2.0",
"hash": 2885942311884667000,
"line_mean": 39.435483871,
"line_max": 134,
"alpha_frac": 0.6414040686,
"autogenerated": false,
"ratio": 3.4843641417651146,
"config_test": false,
"has... |
#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, distribute, sublicense, and/or sell
... | {
"repo_name": "nsalomonis/AltAnalyze",
"path": "build_scripts/ParsePGF.py",
"copies": "1",
"size": "5177",
"license": "apache-2.0",
"hash": 2827505809345064400,
"line_mean": 39.75,
"line_max": 134,
"alpha_frac": 0.6200502221,
"autogenerated": false,
"ratio": 3.5074525745257454,
"config_test": f... |
"""Alter and add many columns in DetachedAwardProcurement and AwardProcurement
Revision ID: d45dde2ba15b
Revises: 001758a1ab82
Create Date: 2018-03-09 14:08:13.058669
"""
# revision identifiers, used by Alembic.
revision = 'd45dde2ba15b'
down_revision = '001758a1ab82'
branch_labels = None
depends_on = None
from ale... | {
"repo_name": "fedspendingtransparency/data-act-broker-backend",
"path": "dataactcore/migrations/versions/d45dde2ba15b_alter_detached_regular_award_procurement.py",
"copies": "1",
"size": "4837",
"license": "cc0-1.0",
"hash": -8356240148092870000,
"line_mean": 59.4625,
"line_max": 127,
"alpha_frac": ... |
"""alter biobank dv table
Revision ID: 534d805d5dcf
Revises: dc971fc16861
Create Date: 2019-03-18 13:23:40.194824
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "534d805d5dcf"
down_revision = "dc971fc16861"
branch_labels = ... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/534d805d5dcf_alter_biobank_dv_table.py",
"copies": "1",
"size": "1944",
"license": "bsd-3-clause",
"hash": -5627673043598841000,
"line_mean": 28.4545454545,
"line_max": 110,
"alpha_frac": 0.6594650206,
"autogenerat... |
"""Alter Constraints
Revision ID: 3a37e844b277
Revises: b237b9f6a2ce
Create Date: 2016-05-30 15:57:56.017519
"""
# revision identifiers, used by Alembic.
revision = '3a37e844b277'
down_revision = 'b237b9f6a2ce'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembi... | {
"repo_name": "levlaz/braindump",
"path": "migrations/versions/3a37e844b277_alter_constraints.py",
"copies": "1",
"size": "1358",
"license": "mit",
"hash": -2444169952049946000,
"line_mean": 32.975,
"line_max": 111,
"alpha_frac": 0.6524300442,
"autogenerated": false,
"ratio": 3.288135593220339,
... |
"""alter database for mysql compatibility
Revision ID: 9be372ec38bc
Revises: 4328f2c08f05
Create Date: 2020-02-16 15:43:35.276655
"""
from alembic import op
import sqlalchemy as sa
from docassemble.webapp.database import dbtableprefix, dbprefix, daconfig
import sys
# revision identifiers, used by Alembic.
revision =... | {
"repo_name": "jhpyle/docassemble",
"path": "docassemble_webapp/docassemble/webapp/alembic/versions/9be372ec38bc_alter_database_for_mysql_compatibility.py",
"copies": "1",
"size": "3895",
"license": "mit",
"hash": 3524080116712008700,
"line_mean": 25.6780821918,
"line_max": 110,
"alpha_frac": 0.54069... |
"""Alter meeting id columns from integer to string
Revision ID: 54b91da358e
Revises: 40d44f5e7b69
Create Date: 2014-09-26 15:02:36.192223
"""
# revision identifiers, used by Alembic.
revision = '54b91da358e'
down_revision = '40d44f5e7b69'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects impor... | {
"repo_name": "teampopong/pokr.kr",
"path": "alembic/versions/54b91da358e_.py",
"copies": "1",
"size": "1331",
"license": "apache-2.0",
"hash": 5222914808648766000,
"line_mean": 28.5777777778,
"line_max": 50,
"alpha_frac": 0.5800150263,
"autogenerated": false,
"ratio": 3.717877094972067,
"confi... |
"""alter metricsRaceCache table and create indexes
Revision ID: bf7f784daca9
Revises: 93d831aa6fb4
Create Date: 2019-01-31 16:53:34.008379
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "bf7f784daca9"
down_revision = "93d83... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/bf7f784daca9_alter_metricsracecache_table_and_create_.py",
"copies": "1",
"size": "5059",
"license": "bsd-3-clause",
"hash": 3000098823851273700,
"line_mean": 44.9909090909,
"line_max": 115,
"alpha_frac": 0.687092310... |
# Alternate formulation using decorators
import types
class multimethod:
def __init__(self, func):
self._methods = {}
self.__name__ = func.__name__
self._default = func
def match(self, *types):
def register(func):
ndefaults = len(func.__defaults__) if func.__defaul... | {
"repo_name": "tuanavu/python-cookbook-3rd",
"path": "src/9/multiple_dispatch_with_function_annotations/example2.py",
"copies": "2",
"size": "1398",
"license": "mit",
"hash": 2615664088114171400,
"line_mean": 23.9642857143,
"line_max": 74,
"alpha_frac": 0.5236051502,
"autogenerated": false,
"rati... |
# Alternate formulation using function attributes directly
from functools import wraps
import logging
def logged(level, name=None, message=None):
'''
Add logging to a function. level is the logging
level, name is the logger name, and message is the
log message. If name and message aren't specified,
... | {
"repo_name": "tuanavu/python-cookbook-3rd",
"path": "src/9/defining_a_decorator_with_user_adjustable_attributes/example2.py",
"copies": "2",
"size": "1298",
"license": "mit",
"hash": 6282091073412531000,
"line_mean": 24.4509803922,
"line_max": 58,
"alpha_frac": 0.6340523883,
"autogenerated": false... |
# ## Alternates ##
# This animation alternates colours on every other pixel and then animates them flipping between the default
# colours White and Off.
#
# ## Usage ###
# Alternates has 3 optional properties
#
# * max_led - int the number of pixels you want used
# * color1 - (int, int, int) the color you want the odd ... | {
"repo_name": "rec/BiblioPixelAnimations",
"path": "BiblioPixelAnimations/strip/Alternates.py",
"copies": "2",
"size": "1448",
"license": "mit",
"hash": 8334293209812063000,
"line_mean": 29.8085106383,
"line_max": 108,
"alpha_frac": 0.604281768,
"autogenerated": false,
"ratio": 3.2834467120181405... |
"""Alternating Direction method of Multipliers (ADMM) method variants."""
from __future__ import division
from builtins import range
from odl.operator import Operator, OpDomainError
__all__ = ('admm_linearized',)
def admm_linearized(x, f, g, L, tau, sigma, niter, **kwargs):
"""Generic linearized ADMM method f... | {
"repo_name": "aringh/odl",
"path": "odl/solvers/nonsmooth/admm.py",
"copies": "1",
"size": "5250",
"license": "mpl-2.0",
"hash": -3276875268114099000,
"line_mean": 31.2085889571,
"line_max": 77,
"alpha_frac": 0.5643809524,
"autogenerated": false,
"ratio": 3.337571519389701,
"config_test": fals... |
""" Alternating Least Squares for Collaborative Filtering
"""
# Author: Vladimir Larin <vladimir@vlarine.ru>
# License: MIT
import numpy as np
import scipy.sparse as sp
import six
GOT_NUMBA = True
try:
from pyrecsys._polara.lib.hosvd import tucker_als
except ImportError:
GOT_NUMBA = False
__all__ = ['ALS', ]... | {
"repo_name": "vlarine/pyrecsys",
"path": "pyrecsys/collaborative_filtering.py",
"copies": "1",
"size": "11093",
"license": "mit",
"hash": -6014215116501120000,
"line_mean": 31.2412790698,
"line_max": 104,
"alpha_frac": 0.5402578667,
"autogenerated": false,
"ratio": 3.677387267904509,
"config_t... |
# Alternative deferred-based API
# TODO: If we use this module do we still need Process?
# TODO: errbacks are not actually used. Isn't that weird?
# TODO: Using this, the operations are scheduled before entering "yield"
# (before process gives up control), whereas with Process runner, the
# operations are scheduled ... | {
"repo_name": "ubolonton/twisted-csp",
"path": "csp/defer.py",
"copies": "1",
"size": "1867",
"license": "epl-1.0",
"hash": -2028937607251300400,
"line_mean": 22.3375,
"line_max": 73,
"alpha_frac": 0.6946973755,
"autogenerated": false,
"ratio": 3.5766283524904217,
"config_test": false,
"has_n... |
"""Alternative implementation of Beancount's Inventory."""
from typing import Any
from typing import Callable
from typing import Dict
from typing import Optional
from typing import Tuple
from beancount.core.amount import Amount
from beancount.core.number import Decimal
from beancount.core.number import ZERO
from beanc... | {
"repo_name": "yagebu/fava",
"path": "src/fava/core/inventory.py",
"copies": "2",
"size": "3325",
"license": "mit",
"hash": 2657367274862171000,
"line_mean": 31.9207920792,
"line_max": 79,
"alpha_frac": 0.6108270677,
"autogenerated": false,
"ratio": 4.182389937106918,
"config_test": false,
"h... |
"""Alternative implementation of Beancount's Inventory."""
from typing import Dict
from typing import Optional
from typing import Tuple
from beancount.core.amount import Amount
from beancount.core.number import Decimal
from beancount.core.number import ZERO
from beancount.core.position import Position
InventoryKey =... | {
"repo_name": "aumayr/beancount-web",
"path": "src/fava/core/inventory.py",
"copies": "1",
"size": "2693",
"license": "mit",
"hash": -4273038728112002000,
"line_mean": 32.2469135802,
"line_max": 79,
"alpha_frac": 0.6167842555,
"autogenerated": false,
"ratio": 4.201248049921997,
"config_test": f... |
"Alternative methods of calculating moving window statistics."
import warnings
import numpy as np
__all__ = [
"move_sum",
"move_mean",
"move_std",
"move_var",
"move_min",
"move_max",
"move_argmin",
"move_argmax",
"move_median",
"move_rank",
]
def move_sum(a, window, min_coun... | {
"repo_name": "kwgoodman/bottleneck",
"path": "bottleneck/slow/move.py",
"copies": "1",
"size": "7756",
"license": "bsd-2-clause",
"hash": -1871236977593894400,
"line_mean": 28.7164750958,
"line_max": 77,
"alpha_frac": 0.5613718412,
"autogenerated": false,
"ratio": 3.223607647547797,
"config_te... |
# Alternative:
# $ inotifywait -e CLOSE_WRITE -m /tmp
# Setting up watches.
# Watches established.
# /tmp/ CLOSE_WRITE,CLOSE ok
# /tmp/ CLOSE_WRITE,CLOSE ok
# /tmp/ CLOSE_WRITE,CLOSE ok
import logging
import argparse
import os
import signal
import sys
import inotify.adapters
def handler(signum, frame):
sys.exit(... | {
"repo_name": "danblick/robocar",
"path": "scripts/inotify_example.py",
"copies": "1",
"size": "1529",
"license": "mit",
"hash": -2761533047885023000,
"line_mean": 23.6612903226,
"line_max": 91,
"alpha_frac": 0.6030085023,
"autogenerated": false,
"ratio": 3.2881720430107526,
"config_test": fals... |
"""Alternative output generators for ELC endpoints."""
def type_bibjson(data):
"""Format BibJSON return from list of standard JSON objects."""
refs_bibjson = list()
for rec in data:
bib = dict()
# Add basic reference info
bib.update(type=rec.get('kind'),
year=... | {
"repo_name": "EarthLifeConsortium/elc_api",
"path": "swagger_server/elc/formatter.py",
"copies": "1",
"size": "3668",
"license": "apache-2.0",
"hash": 7015047831977816000,
"line_mean": 26.7878787879,
"line_max": 70,
"alpha_frac": 0.4923664122,
"autogenerated": false,
"ratio": 3.5508228460793805,... |
"""Alternative "tab node creator thingy" for The Foundry's Nuke
homepage: https://github.com/dbr/tabtabtab-nuke
license: http://unlicense.org/
"""
__version__ = "1.8"
import os
import sys
try:
from PySide2 import QtCore, QtGui, QtWidgets
from PySide2.QtCore import Qt
except ImportError:
try:
fro... | {
"repo_name": "dbr/tabtabtab-nuke",
"path": "tabtabtab.py",
"copies": "1",
"size": "17610",
"license": "unlicense",
"hash": 6407847452067056000,
"line_mean": 29.6260869565,
"line_max": 97,
"alpha_frac": 0.5658716638,
"autogenerated": false,
"ratio": 3.9805605786618443,
"config_test": false,
"... |
"""Alternative to reload().
This works by executing the module in a scratch namespace, and then
patching classes, methods and functions in place. This avoids the
need to patch instances. New objects are copied into the target
namespace.
Some of the many limitiations include:
- Global mutable objects other than cla... | {
"repo_name": "wwezhuimeng/switch",
"path": "switchy/xreload.py",
"copies": "2",
"size": "6369",
"license": "mpl-2.0",
"hash": -1547599373216131300,
"line_mean": 32.5210526316,
"line_max": 79,
"alpha_frac": 0.6575600565,
"autogenerated": false,
"ratio": 3.9314814814814816,
"config_test": false,... |
#alternative tree subsampling algorithm. Define contours eminating out from the root of the reference tree. At each contour, take just one descendant sequence --- ideally, a somewhat average one. Maybe avoids the problem of picking weird taxa because of their long branches.
from ete3 import Tree
from operator import i... | {
"repo_name": "Tancata/phylo",
"path": "subsample_tree_by_contours.py",
"copies": "1",
"size": "2074",
"license": "mit",
"hash": 8570352448152033000,
"line_mean": 34.7586206897,
"line_max": 274,
"alpha_frac": 0.6629701061,
"autogenerated": false,
"ratio": 3.334405144694534,
"config_test": false... |
# Alternativní řešení
#
# Zadání viz. seq_sum.py
#####################################################################
# Pole čísel
nums = list(map(int, input().split()));
# Maximální číslo
length = len(nums);
sum = 0;
count = 0;
best_sum = 0;
best_count= 0;
# Projde pole
for i in range( length ):
# Pokud... | {
"repo_name": "malja/cvut-python",
"path": "cviceni01/seq_sum1.py",
"copies": "1",
"size": "1081",
"license": "mit",
"hash": 991012712567642900,
"line_mean": 21.7555555556,
"line_max": 90,
"alpha_frac": 0.53515625,
"autogenerated": false,
"ratio": 2.4323040380047507,
"config_test": false,
"ha... |
"""Alter OAuth2Token.token_type to Enum
Revision ID: 82184d7d1e88
Revises: 5e2954a2af18
Create Date: 2016-11-10 21:14:33.787194
"""
# revision identifiers, used by Alembic.
revision = '82184d7d1e88'
down_revision = '5e2954a2af18'
from alembic import op
import sqlalchemy as sa
def upgrade():
connection = op.ge... | {
"repo_name": "frol/flask-restplus-server-example",
"path": "migrations/versions/82184d7d1e88_altered-OAuth2Token-token_type-to-Enum.py",
"copies": "1",
"size": "1172",
"license": "mit",
"hash": -2411431640758936000,
"line_mean": 26.9047619048,
"line_max": 77,
"alpha_frac": 0.6527303754,
"autogener... |
"""Alters meal.scheduled_for WITH TIMEZONE, adds NOT NULL constraint to \
users.first_name and users.last_name
Revision ID: 3e4b230c5582
Revises: ddd00fbe2758
Create Date: 2017-07-01 10:47:47.789316
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '3e4b230c5582'
... | {
"repo_name": "Rdbaker/Mealbound",
"path": "migrations/versions/3e4b230c5582_.py",
"copies": "1",
"size": "1449",
"license": "bsd-3-clause",
"hash": 3814632638363907000,
"line_mean": 32.6976744186,
"line_max": 73,
"alpha_frac": 0.6266390614,
"autogenerated": false,
"ratio": 3.6134663341645887,
... |
# Although this approach has a time complexity of O(n),
# it has a space complexity of O(n). And it turns out to be slow.
# See main2.py for a better approach
from collections import defaultdict
from functools import reduce
import heapq
class Solution:
def maximumSwap(self, num: int) -> int:
digits = []
... | {
"repo_name": "y-usuzumi/survive-the-course",
"path": "leetcode/670.Maximum_Swap/python/main.py",
"copies": "1",
"size": "1198",
"license": "bsd-3-clause",
"hash": -2835579132482555000,
"line_mean": 35.303030303,
"line_max": 111,
"alpha_frac": 0.5843071786,
"autogenerated": false,
"ratio": 3.8770... |
"""altiumdb_frontend URL Configuration
The `urlpatterns` submit_part routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name=... | {
"repo_name": "avistel/cyckotron",
"path": "cyckotron/urls.py",
"copies": "1",
"size": "1288",
"license": "bsd-3-clause",
"hash": -7401729041303321000,
"line_mean": 41.9666666667,
"line_max": 84,
"alpha_frac": 0.6436335404,
"autogenerated": false,
"ratio": 3.389473684210526,
"config_test": fals... |
alt_map = {'ins':'0'}
complement = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A'}
def revComplement(seq):
for k,v in alt_map.items():
seq = seq.replace(k,v)
bases = list(seq)
bases = reversed([complement.get(base,base) for base in bases])
bases = ''.join(bases)
for k,v in alt_map.items():
... | {
"repo_name": "sjspence/spenceOTU",
"path": "epicBarcoder/pairedEnds.py",
"copies": "2",
"size": "1858",
"license": "mit",
"hash": 4492282594061974500,
"line_mean": 31.5964912281,
"line_max": 108,
"alpha_frac": 0.5920344456,
"autogenerated": false,
"ratio": 3.3720508166969148,
"config_test": fa... |
""" Altmetric """
import requests
try:
import json
except ImportError:
import simplejson as json
class AltmetricException(Exception):
pass
class AltmetricHTTPException(AltmetricException):
def __init__(self, status_code, msg):
self.status_code = status_code
self.msg = msg
class Pa... | {
"repo_name": "lnielsen/python-altmetric",
"path": "altmetric/altmetric.py",
"copies": "1",
"size": "1752",
"license": "mit",
"hash": 8322537770773581000,
"line_mean": 24.3913043478,
"line_max": 71,
"alpha_frac": 0.5559360731,
"autogenerated": false,
"ratio": 3.945945945945946,
"config_test": f... |
""" altsets.py -- An alternate implementation of Sets.py
Implements set operations using sorted lists as the underlying data structure.
Advantages:
* Space savings -- lists are much more compact than a dictionary
based implementation.
* Flexibility -- elements do not need to be hashable, only __cmp__
is... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/230113_Implementatisets_using_sorted/recipe-230113.py",
"copies": "1",
"size": "5591",
"license": "mit",
"hash": -8175215371355750000,
"line_mean": 27.9689119171,
"line_max": 78,
"alpha_frac": 0.5042031837,
"autogenerated": false,
"ratio":... |
# altsets.py - This is a slightly adjusted version of the altsets module
# that was submitted to the Active State Programmer Network by Raymond
# Hettinger. It has been included in the Plotter package to allow for
# compatibility with Jython (Python 2.1). The sets module that comes along
# with Python 2.3 is only bac... | {
"repo_name": "jecki/MetaInductionSim",
"path": "PyPlotter/sets.py",
"copies": "8",
"size": "6007",
"license": "mit",
"hash": -1001505990466227800,
"line_mean": 28.4460784314,
"line_max": 85,
"alpha_frac": 0.5298818046,
"autogenerated": false,
"ratio": 4.015374331550802,
"config_test": false,
... |
#alt + shift + e runs the code
import math;
#These are the values that should be sent to this file
def CalculateWheelVelocity(targetX, targetY):
#Declare some of the needed variables
RobotHomeX = 0.0;
RobotHomeY = 0.0;
wheelOffset = 1.0; # distance from wheel to wheel drive center
w... | {
"repo_name": "headcrabned/teamcat",
"path": "WheelVelocity/WheelVelocitys.py",
"copies": "1",
"size": "4258",
"license": "mit",
"hash": 2232964043569912300,
"line_mean": 31.8095238095,
"line_max": 120,
"alpha_frac": 0.6326914044,
"autogenerated": false,
"ratio": 3.470252648736756,
"config_test... |
alumnos = ['Pepito', 'Yayita', 'Fulanita', 'Panchito']
asistencia = [
[True, True, True, False, False, False, False],
[True, True, True, False, True, False, True ],
[True, True, True, True, True, True, True ],
[True, True, True, False, True, True, True ]]
#Definimos las funciones
def total_por_alumno(tabla):
... | {
"repo_name": "csaldias/python-usm",
"path": "Ejercicios progra.usm.cl/Parte 2/6- Uso de Estructuras de Datos/asistencia.py",
"copies": "1",
"size": "1312",
"license": "mit",
"hash": -5536841561608797000,
"line_mean": 32.641025641,
"line_max": 74,
"alpha_frac": 0.6364329268,
"autogenerated": false,... |
alunos = []
alunos.append("Maria")
alunos.append("Joao")
alunos.append("Lucas")
alunos.append("Marcos")
alunos.append("Edson")
alunos.append("Carlos")
alunos.append("Thomas")
print(alunos)
# outra forma de utlizar o for
for aluno in alunos:
print(aluno)
# Imprime os valores conforme a regra
for value i... | {
"repo_name": "romeubertho/USP-IntroPython",
"path": "04-Listas_trabalhando_tuplas/alunos.py",
"copies": "1",
"size": "2328",
"license": "mit",
"hash": 8179076900378068000,
"line_mean": 23.3260869565,
"line_max": 82,
"alpha_frac": 0.6890034364,
"autogenerated": false,
"ratio": 2.468716861081654,
... |
#--- ALUNO - WALSAN JADSON ---
#------- IMPORTANDO BIBLIOTECAS -------
import sys
import timeit
#------- DEFININDO FUNCOES -------
#-- 1
def countingSort(lista):
a = lista
print(a)
b = [0]
for i in range(0, len(a)):
b.append(a[i])
k = buscaMaior(a)
print "maior numero da l... | {
"repo_name": "walsanjl/APA",
"path": "Ordenacao03.py",
"copies": "1",
"size": "2950",
"license": "mit",
"hash": -8649276536780192000,
"line_mean": 20.3484848485,
"line_max": 86,
"alpha_frac": 0.5718644068,
"autogenerated": false,
"ratio": 2.290372670807453,
"config_test": false,
"has_no_keyw... |
#--- ALUNO - WALSAN JADSON ---
#------- IMPORTANDO BIBLIOTECAS -------
import sys
import timeit
#------- DEFININDO FUNCOES -------
#-- 1
def mergeSort(lista):
print ("entrou no mergeSort")
if len(lista) > 1:
pontoMedio = len(lista)/2
listaDaEsquerda = lista[:pontoMedio]
... | {
"repo_name": "walsanjl/APA",
"path": "Ordenacao02.py",
"copies": "1",
"size": "3077",
"license": "mit",
"hash": 4114221165569295000,
"line_mean": 24.0762711864,
"line_max": 97,
"alpha_frac": 0.5554111147,
"autogenerated": false,
"ratio": 2.645743766122098,
"config_test": false,
"has_no_keywo... |
#--- ALUNO - WALSAN JADSON ---
#------- IMPORTANDO BIBLIOTECAS -------
import sys
import timeit
#------- DEFININDO FUNCOES -------
#-- 1
def selectionSort(lista):
for i in range(0, len(lista)):
menor = i
for j in range(i+1, len(lista)):
if lista[j] < lista[menor]:
... | {
"repo_name": "walsanjl/APA",
"path": "Ordenacao01.py",
"copies": "1",
"size": "2056",
"license": "mit",
"hash": -1019486157595267500,
"line_mean": 23.0731707317,
"line_max": 88,
"alpha_frac": 0.579766537,
"autogenerated": false,
"ratio": 2.5635910224438905,
"config_test": false,
"has_no_keyw... |
#--- ALUNO - WALSAN JADSON ---
#------- IMPORTANDO BIBLIOTECAS -------
import sys
import timeit
#------- DEFININDO FUNCOES -------
#heap máximo = insereHeapMax + removeHeapMax
def insereHeapMax(lista, indiceFinal):
i = indiceFinal
while (True):
# chegou na raiz
if i == 1:
break
# verifica... | {
"repo_name": "walsanjl/APA",
"path": "Ordenacao04.py",
"copies": "1",
"size": "2310",
"license": "mit",
"hash": -8976834515201937000,
"line_mean": 19.5794392523,
"line_max": 92,
"alpha_frac": 0.6084885232,
"autogenerated": false,
"ratio": 2.297512437810945,
"config_test": false,
"has_no_keyw... |
# Alveyworld-dev calculator
# Period 6
#
# Shrek is love. Shrek is life. Shrek is Alveyworld. All hail Shrek.
#
# Group 1: Team Jacob
# Members:
# * Jared
# * Josh
# * Max
# * Santiago
# * Travis
# Raw imports
import shlex
import math
import random
# Class imports
import team1
import team2
import team3... | {
"repo_name": "alveyworld-dev/calculator",
"path": "main.py",
"copies": "1",
"size": "6889",
"license": "apache-2.0",
"hash": -769532398667633800,
"line_mean": 33.9695431472,
"line_max": 121,
"alpha_frac": 0.4881695457,
"autogenerated": false,
"ratio": 3.972895040369089,
"config_test": false,
... |
#AlwaysOn by Mehdi Karamnejad
#Nov 2013
import dropbox
import glob
import os
import ConfigParser
from xml.dom import minidom
from urllib import urlopen
from datetime import time,datetime
import subprocess
import sys
app_key = ''
app_secret = ''
access_token=''
user_id=''
pix_root_folder_on_cloud='/pix/'
settings_path_... | {
"repo_name": "asemoon/alwaysOn-digital-frame",
"path": "alwayson.py",
"copies": "1",
"size": "5506",
"license": "apache-2.0",
"hash": -7436666992023884000,
"line_mean": 39.4852941176,
"line_max": 111,
"alpha_frac": 0.6946966945,
"autogenerated": false,
"ratio": 2.966594827586207,
"config_test"... |
# Always prefer setuptools over distutils
from os import path
from codecs import open # To use a consistent encoding
from setuptools import setup
from Cython.Build import cythonize
import numpy
# Get the long description from the relevant file
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'REA... | {
"repo_name": "cjrh/misu",
"path": "setup.py",
"copies": "1",
"size": "1517",
"license": "bsd-2-clause",
"hash": 4180061177226667500,
"line_mean": 36,
"line_max": 78,
"alpha_frac": 0.6644693474,
"autogenerated": false,
"ratio": 3.9712041884816753,
"config_test": false,
"has_no_keywords": fals... |
# Always prefer setuptools over distutils
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
setup(
name='reddit_time_machine',
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the projec... | {
"repo_name": "sjhddh/reddit_time_machine",
"path": "setup.py",
"copies": "1",
"size": "2703",
"license": "mit",
"hash": 9111788904872664000,
"line_mean": 33.6538461538,
"line_max": 115,
"alpha_frac": 0.670736219,
"autogenerated": false,
"ratio": 4.070783132530121,
"config_test": false,
"has_... |
# Always prefer setuptools over distutils
from setuptools import find_packages
# To use a consistent encoding
from codecs import open
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
here = path.abspath(path.dirname(__file__))
with open(path.join(he... | {
"repo_name": "dedayoa/arrow-weekday",
"path": "setup.py",
"copies": "1",
"size": "1273",
"license": "mit",
"hash": -78315740037170770,
"line_mean": 26.6739130435,
"line_max": 70,
"alpha_frac": 0.638648861,
"autogenerated": false,
"ratio": 4.041269841269841,
"config_test": false,
"has_no_keyw... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages, Command
# To use a consistent encoding
from codecs import open
import os
base_dir = os.path.abspath(os.path.dirname(__file__))
# Get the 'about' information from relevant file
about = {}
with open(os.path.join(base_dir, "ciscoreputa... | {
"repo_name": "cescobarresi/ciscoreputation",
"path": "setup.py",
"copies": "1",
"size": "5317",
"license": "mit",
"hash": 4590265698271589400,
"line_mean": 34.9256756757,
"line_max": 96,
"alpha_frac": 0.6097423359,
"autogenerated": false,
"ratio": 4.052591463414634,
"config_test": false,
"ha... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
nam... | {
"repo_name": "caizixian/tcpstat",
"path": "setup.py",
"copies": "1",
"size": "3866",
"license": "mit",
"hash": 7036284369763205000,
"line_mean": 37.66,
"line_max": 98,
"alpha_frac": 0.6564924987,
"autogenerated": false,
"ratio": 4.082365364308342,
"config_test": false,
"has_no_keywords": fal... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
setup(
name='yaaHN',
# Versions should comply with PE... | {
"repo_name": "arindampradhan/mockHN",
"path": "vendor/yaaHN/setup.py",
"copies": "1",
"size": "3237",
"license": "mit",
"hash": -6660709375889803000,
"line_mean": 38.962962963,
"line_max": 110,
"alpha_frac": 0.6818041396,
"autogenerated": false,
"ratio": 4.1183206106870225,
"config_test": fals... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from setuptools.command.install import install as _install
# To use a consistent encoding
from codecs import open
from os import path
import sys
import os
here = path.abspath(path.dirname(__file__))
def _post_install(dir):
from... | {
"repo_name": "mjbright/hide_code",
"path": "setup.py",
"copies": "1",
"size": "3829",
"license": "mit",
"hash": -8592669422164753000,
"line_mean": 34.4537037037,
"line_max": 94,
"alpha_frac": 0.6651867328,
"autogenerated": false,
"ratio": 4.043294614572334,
"config_test": false,
"has_no_keyw... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from setuptools.command.install import install
# To use a consistent encoding
from codecs import open
from os import path
import sys
import os
import notebook
import notebook.serverextensions as ns
# Get the long description from the... | {
"repo_name": "kirbs-/hide_code",
"path": "setup.py",
"copies": "1",
"size": "4736",
"license": "mit",
"hash": 7145342909804351000,
"line_mean": 36.5873015873,
"line_max": 133,
"alpha_frac": 0.6587837838,
"autogenerated": false,
"ratio": 3.9565580618212195,
"config_test": false,
"has_no_keywo... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import codecs
import os.path
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()
def get_version(rel_path):
for line... | {
"repo_name": "yuzie007/upho",
"path": "setup.py",
"copies": "1",
"size": "2931",
"license": "mit",
"hash": 9110420570145773000,
"line_mean": 34.313253012,
"line_max": 83,
"alpha_frac": 0.6721255544,
"autogenerated": false,
"ratio": 3.8515111695137976,
"config_test": false,
"has_no_keywords":... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import logging
import os
from openrcv_setup import utils
PACKAGE_NAME = "openrcv"
LONG_DESCRIPTION = """\
OpenRCV
=======
OpenRCV is an open source software project for tallying ranked-choice
voting elections like instant runoff ... | {
"repo_name": "cjerdonek/open-rcv",
"path": "setup.py",
"copies": "1",
"size": "4909",
"license": "mit",
"hash": -8939950275324986000,
"line_mean": 28.3952095808,
"line_max": 95,
"alpha_frac": 0.6545121206,
"autogenerated": false,
"ratio": 3.6854354354354353,
"config_test": true,
"has_no_keyw... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import pathlib
here = pathlib.Path(__file__).parent.resolve()
# Get the long description from the README file
long_description = (here / 'README.md').read_text(encoding='utf-8')
setup(
name='pyvisionproductsearch',
packages... | {
"repo_name": "google/pyvisionproductsearch",
"path": "setup.py",
"copies": "1",
"size": "1431",
"license": "apache-2.0",
"hash": 5018086134828917000,
"line_mean": 36.6578947368,
"line_max": 87,
"alpha_frac": 0.6694619147,
"autogenerated": false,
"ratio": 4.112068965517241,
"config_test": false... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
description = 'Redis wrapper library for using twemproxy sharded Redis'
setup(
name='twemredis',
version='0.1.0',
description=description,
long_description=description,
url='https://github.com/mishan/twemredis-py'... | {
"repo_name": "mishan/twemredis-py",
"path": "setup.py",
"copies": "1",
"size": "1813",
"license": "apache-2.0",
"hash": 2941822488979198500,
"line_mean": 33.2075471698,
"line_max": 77,
"alpha_frac": 0.6282404854,
"autogenerated": false,
"ratio": 4.1298405466970385,
"config_test": false,
"has... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from os import path
here = path.abspath(path.dirname(__file__))
def readme():
try:
with open('README.rst') as f:
return f.read()
except FileNotFoundError:
return ""
setup(
name='chromewhip'... | {
"repo_name": "chuckus/chromewhip",
"path": "setup.py",
"copies": "1",
"size": "2568",
"license": "mit",
"hash": -7688535376089007000,
"line_mean": 29.9397590361,
"line_max": 84,
"alpha_frac": 0.6433021807,
"autogenerated": false,
"ratio": 3.8674698795180724,
"config_test": false,
"has_no_key... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import atrium
setup(
name='Pytrium',
version=atrium.__version__,
description='MX Atrium API Python Wrapper',
url='https://github.com/phantomxc/pytrium',
author='Cameron Wengert ',
author_email='phantomxc... | {
"repo_name": "phantomxc/pytrium",
"path": "setup.py",
"copies": "1",
"size": "1702",
"license": "mit",
"hash": -1032597517360536600,
"line_mean": 29.4107142857,
"line_max": 79,
"alpha_frac": 0.6486486486,
"autogenerated": false,
"ratio": 4.081534772182255,
"config_test": false,
"has_no_keywo... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import os
import shutil
import sys
this_dir = os.getcwd()
root_dir = os.path.dirname(this_dir)
release_dir = os.path.join(root_dir, "releases")
LONG_DESCRIPTION = \
"""With Brython you can write browser programs in Python instead ... | {
"repo_name": "brython-dev/brython",
"path": "setup/setup.py",
"copies": "1",
"size": "4568",
"license": "bsd-3-clause",
"hash": 7392353687316364000,
"line_mean": 26.5180722892,
"line_max": 82,
"alpha_frac": 0.6326619965,
"autogenerated": false,
"ratio": 3.5192604006163326,
"config_test": false... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import os
import shutil
with open('README.rst', encoding='utf-8') as fobj:
LONG_DESCRIPTION = fobj.read()
setup(
name='brython',
version='3.5.0',
description='Brython is an implementation of Python 3 running in th... | {
"repo_name": "Hasimir/brython",
"path": "setup/setup.py",
"copies": "1",
"size": "1562",
"license": "bsd-3-clause",
"hash": -7803201398827978000,
"line_mean": 23.8095238095,
"line_max": 82,
"alpha_frac": 0.6165172855,
"autogenerated": false,
"ratio": 4.198924731182796,
"config_test": false,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.