text stringlengths 0 1.05M | meta dict |
|---|---|
import copy
from sympycore.arithmetic.numbers import div
from .linalg import get_rc_maps
from .algebra import Matrix
class LPError(Exception):
"""Generic Python-exception-derived object raised by sympycore.linalg LP related functions.
"""
pass
def MATRIX_DICT_LP_solve(self, method='crisscross', overwrite... | {
"repo_name": "pearu/sympycore",
"path": "sympycore/matrices/linalg_lp.py",
"copies": "1",
"size": "4721",
"license": "bsd-3-clause",
"hash": -772223877853022800,
"line_mean": 29.4580645161,
"line_max": 99,
"alpha_frac": 0.5452234696,
"autogenerated": false,
"ratio": 3.740887480190174,
"config_... |
import sys
from ..utils import MATRIX, MATRIX_DICT, MATRIX_DICT_T
from ..arithmetic.numbers import div
from .algebra import MatrixDict, Matrix
from ..core import init_module
init_module.import_lowlevel_operations()
def MATRIX_DICT_get_gauss_jordan_elimination_operations(self, overwrite=False, leading_cols = None, t... | {
"repo_name": "pearu/sympycore",
"path": "sympycore/matrices/linalg.py",
"copies": "1",
"size": "30367",
"license": "bsd-3-clause",
"hash": 3731667300674773000,
"line_mean": 29.4889558233,
"line_max": 126,
"alpha_frac": 0.4740343136,
"autogenerated": false,
"ratio": 3.554190074906367,
"config_t... |
__author__ = 'Pedro'
from app import app, db
from passlib.apps import custom_app_context as pwd_context
from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer, BadSignature, SignatureExpired)
from datetime import date
class User(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincre... | {
"repo_name": "processos-2015-1/api",
"path": "app/models/UserModel.py",
"copies": "1",
"size": "2381",
"license": "mit",
"hash": -2312866597904820700,
"line_mean": 31.1756756757,
"line_max": 104,
"alpha_frac": 0.6539269215,
"autogenerated": false,
"ratio": 3.6462480857580397,
"config_test": fa... |
__author__ = 'Pedro'
import my_serial
import time
class SmoothieSerial(my_serial.MySerial):
x_endstop = None
y_endstop = None
z_endstop = None
tower_a_angle_corr = None
tower_b_angle_corr = None
tower_c_angle_corr = None
tower_a_radius_corr = None
tower_b_radius_corr = None
tower... | {
"repo_name": "payala/ga-delta-tuner",
"path": "smoothie_serial.py",
"copies": "1",
"size": "4122",
"license": "mit",
"hash": 3250090363130082300,
"line_mean": 30.9612403101,
"line_max": 84,
"alpha_frac": 0.4575448811,
"autogenerated": false,
"ratio": 3.378688524590164,
"config_test": false,
... |
__author__ = 'Pedro'
import serial
import datetime
import time
class MySerial(serial.Serial):
encoding = 'utf-8'
pc_to_3dr = None
def __init__(self, port=None, baudrate=250000, timeout=60, logfile=None):
if logfile is None:
logfile='./logs/serial_{}.log'.format(datetime.datetime.now()... | {
"repo_name": "payala/ga-delta-tuner",
"path": "my_serial.py",
"copies": "1",
"size": "2979",
"license": "mit",
"hash": -8495121965546629000,
"line_mean": 31.0322580645,
"line_max": 113,
"alpha_frac": 0.5350788855,
"autogenerated": false,
"ratio": 3.728410513141427,
"config_test": false,
"has... |
__author__ = 'Pedro'
import smoothie_serial
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib as mp
from matplotlib.colors import Normalize
from ga_optimizer import GaOptimizable
import time
from mpl_toolkits.mplot3d import Axes3D
class DeltaTuner(smoothie_serial.Smoothi... | {
"repo_name": "payala/ga-delta-tuner",
"path": "delta_tuner.py",
"copies": "1",
"size": "17204",
"license": "mit",
"hash": 4315683700409292000,
"line_mean": 34.0366598778,
"line_max": 140,
"alpha_frac": 0.5607161542,
"autogenerated": false,
"ratio": 3.170475488389237,
"config_test": false,
"h... |
__author__ = 'Pedro Sernadela sernadela@ua.pt'
import requests
import json
class Scaleus:
def __init__(self, host):
self.host = host
def get_datasets(self):
content = requests.get(self.host + 'dataset/')
return json.loads(content.text)
def add_dataset(self, name):
content... | {
"repo_name": "bioinformatics-ua/scaleus-python",
"path": "scaleus/Scaleus.py",
"copies": "1",
"size": "2191",
"license": "mit",
"hash": -3062868185665173000,
"line_mean": 36.1355932203,
"line_max": 93,
"alpha_frac": 0.6188954815,
"autogenerated": false,
"ratio": 3.6947723440134905,
"config_tes... |
__author__ = 'Pedro Sernadela sernadela@ua.pt'
'''
Convert abstracts into annotations from the XML articles
'''
from os.path import isdir
from os import listdir
import xml.etree.ElementTree as ET
import requests
from os.path import exists
from os import makedirs
import re
from multiprocessing import Pool
INPUT_... | {
"repo_name": "sernadela/pubs_manager",
"path": "get_ann.py",
"copies": "1",
"size": "1711",
"license": "mit",
"hash": 2028021118860087300,
"line_mean": 23.4428571429,
"line_max": 71,
"alpha_frac": 0.6440677966,
"autogenerated": false,
"ratio": 3.341796875,
"config_test": false,
"has_no_keywo... |
__author__ = 'Pedro Sernadela sernadela@ua.pt'
'''
Convert radiology text reports into annotations from MIMIC2 DB
'''
import requests
from os.path import exists
from os import makedirs
from multiprocessing import Pool
import psycopg2
import psycopg2.extras
import uuid
DB = "host='localhost' dbname='MIMIC2' user... | {
"repo_name": "sernadela/pubs_manager",
"path": "mimic2ann.py",
"copies": "1",
"size": "1582",
"license": "mit",
"hash": 2595112195242502700,
"line_mean": 24.5161290323,
"line_max": 142,
"alpha_frac": 0.6498103666,
"autogenerated": false,
"ratio": 3.446623093681917,
"config_test": false,
"has... |
__author__ = 'Pedro Sernadela sernadela@ua.pt'
'''
Download xml articles from pubmed given an CSV PMID list
'''
import csv
import requests
from os.path import exists
from os import makedirs
from xml.sax.saxutils import unescape
INPUT_FILE = 'cardiology.csv'
OUTPUT_DIR = 'publications/'
def get_pub(pub_id):
... | {
"repo_name": "sernadela/pubs_manager",
"path": "get_pubs.py",
"copies": "1",
"size": "1116",
"license": "mit",
"hash": -1764081166340910600,
"line_mean": 23.8222222222,
"line_max": 90,
"alpha_frac": 0.6496415771,
"autogenerated": false,
"ratio": 3.152542372881356,
"config_test": false,
"has_... |
import socket
import threading
from requestanalyzer import requestanalyzer
#Demo for adding listeners to target port and send response data to client
class portserver(threading.Thread):
__line__=""
def __init__(self,line):
threading.Thread.__init__(self)
self.__line__=line;
def ... | {
"repo_name": "buaawp/pums",
"path": "_deprecated/demo_2/portserver.py",
"copies": "1",
"size": "1141",
"license": "mit",
"hash": -4376469115810385400,
"line_mean": 31.6285714286,
"line_max": 74,
"alpha_frac": 0.5582822086,
"autogenerated": false,
"ratio": 4.089605734767025,
"config_test": fals... |
__author__ = 'penny'
import sys
import numpy as np
from scipy import stats
from mayavi import mlab
import pyfits
from vispy import app, scene
fitsfile = pyfits.open('cloud_catalog_july14_2015.fits')
n = len(fitsfile[1].data['x_gal'])
P = np.zeros((n,3), dtype=np.float32)
X, Y, Z = P[:,0],P[:,1],P[:,2]
X[...] = fitsf... | {
"repo_name": "PennyQ/vispy_scripts",
"path": "vispy_examples/isosurface_scatter.py",
"copies": "1",
"size": "3541",
"license": "bsd-2-clause",
"hash": -5650801018057908000,
"line_mean": 33.0576923077,
"line_max": 117,
"alpha_frac": 0.6517932787,
"autogenerated": false,
"ratio": 2.851046698872785... |
__author__ = 'penny'
'''
Use gaussian density kernel estimation to smooth catalogue points into
a continuous function, and apply it as the input for isosurface.
'''
import sys
import numpy as np
from scipy import stats
from mayavi import mlab
import pyfits
from vispy import app, scene
fitsfile = pyfits.open('cloud_ca... | {
"repo_name": "PennyQ/vispy_scripts",
"path": "advanced_isosurface_vispy/gaussian_kde_scatter.py",
"copies": "1",
"size": "3588",
"license": "bsd-2-clause",
"hash": 2048262118968867300,
"line_mean": 31.9266055046,
"line_max": 117,
"alpha_frac": 0.6569119287,
"autogenerated": false,
"ratio": 2.907... |
__author__ = 'Penny Qian'
"""
This script is to test creating IsoSurface based on Gaussian Density Estimation for scatter points
Some displacement exists between the scatter points and the produced IsoSurface
"""
import numpy as np
from vispy import app, scene, io
from vispy.color import Color
from scipy import stats
... | {
"repo_name": "PennyQ/vispy_scripts",
"path": "3dselection_vispy/points_iso.py",
"copies": "1",
"size": "3674",
"license": "bsd-2-clause",
"hash": 7394842086364972000,
"line_mean": 38.085106383,
"line_max": 118,
"alpha_frac": 0.6415351116,
"autogenerated": false,
"ratio": 3.1455479452054793,
"c... |
__author__ = 'Per'
# decrypts a (binary/Ascii) number with XOR-operator and given cypher
plaintext = "001100" # STRING!!! will become input later
plainKey = "0110"
def checkIfBinaryIsUsed(key, plaintext): # checks if text and key is in binary code (made of only 1's and 0's)
textNumbersAreCorrect = None ... | {
"repo_name": "Per-Starke/BinaryXorCode",
"path": "src/encryptWith_And_Or_Xor.py",
"copies": "1",
"size": "5349",
"license": "apache-2.0",
"hash": -7902869204953542000,
"line_mean": 31.4181818182,
"line_max": 138,
"alpha_frac": 0.6042250888,
"autogenerated": false,
"ratio": 3.9129480614484273,
... |
__author__ = 'Per'
from Match_class import Match
from Player_class import Player
import random
numberOfPlayers = input("how many players? ")
def defineListOfPlayers(): # returs a list of Objects of Player_class, name = input
listOfPlayers = []
for i in range (0, numberOfPlayers):
playerName = r... | {
"repo_name": "Per-Starke/MatchGame",
"path": "src/assignLengthAndVictory.py",
"copies": "1",
"size": "2737",
"license": "apache-2.0",
"hash": 1302924172720339000,
"line_mean": 29.4222222222,
"line_max": 159,
"alpha_frac": 0.7055169894,
"autogenerated": false,
"ratio": 3.495530012771392,
"confi... |
__author__ = 'pershik'
from preparation.resources.Resource import resource_by_trunk
from hb_res.storage import get_storage
import difflib
import argparse
def diff(trunk=None, modifiers=None):
assert isinstance(trunk, str)
resource = resource_by_trunk(trunk)()
if modifiers is None:
modifiers = ... | {
"repo_name": "hatbot-team/hatbot_resources",
"path": "preparation/tools/diff.py",
"copies": "1",
"size": "1494",
"license": "mit",
"hash": -6554421142661524000,
"line_mean": 26.6666666667,
"line_max": 107,
"alpha_frac": 0.6218206158,
"autogenerated": false,
"ratio": 4.161559888579387,
"config_... |
__author__ = 'person_l'
class AssertionFactory:
default_assertion = 'is'
registry = {}
@classmethod
def register(cls, assertion_cls, assertion_type):
cls.registry[assertion_type] = assertion_cls
@classmethod
def make(cls, assertion_name, value):
assertion_type = cls.default_... | {
"repo_name": "kureuil/airbag",
"path": "airbag/assertions.py",
"copies": "1",
"size": "1675",
"license": "mit",
"hash": 1953741580129476400,
"line_mean": 22.5915492958,
"line_max": 67,
"alpha_frac": 0.6650746269,
"autogenerated": false,
"ratio": 3.9227166276346606,
"config_test": false,
"has... |
__author__ = 'Petar Ojdrovic'
import numpy
import scipy.stats
import time
#Options Pricing
"""
S: initial stock price
k: strike price
T: expiration time
sigma: volatility
r: risk-free rate
"""
##What is d1, d2, and pricer? d1 is the first differential of the underlying pr
def d1(S0, K, r, siga, T):
return (... | {
"repo_name": "pojdrovic/Miscellaneous_Files",
"path": "Options_Pricing.py",
"copies": "1",
"size": "1180",
"license": "apache-2.0",
"hash": -41863449312616160,
"line_mean": 23.6041666667,
"line_max": 137,
"alpha_frac": 0.613559322,
"autogenerated": false,
"ratio": 2.42798353909465,
"config_tes... |
__author__ = 'Pete Cable'
NEWLINE = '\n'
INVALID_SAMPLE = "This is an invalid sample; it had better cause an exception." + NEWLINE
LILY_VALID_SAMPLE_01 = "LILY,2013/06/24 23:36:02,-235.500, 25.930,194.30, 26.04,11.96,N9655" + NEWLINE
LILY_VALID_SAMPLE_02 = "LILY,2013/06/24 23:36:04,-235.349, 26.082,194.26, 26.04,11... | {
"repo_name": "danmergens/mi-instrument",
"path": "mi/instrument/noaa/botpt/ooicore/test/test_samples.py",
"copies": "5",
"size": "14815",
"license": "bsd-2-clause",
"hash": -706652271546863700,
"line_mean": 61.7754237288,
"line_max": 119,
"alpha_frac": 0.6072224097,
"autogenerated": false,
"rati... |
__author__ = 'Peter_000'
from random import randint
import random
import json
class Tile(object):
def __init__(self, value=0, position=(0, 0), an_id=0):
"""
:type an_id: int
"""
self.value = value
self.row = position[0]
self.col = position[1]
self.id = an_id... | {
"repo_name": "PeterSulcs/threes-clone",
"path": "Threes.py",
"copies": "1",
"size": "13293",
"license": "mit",
"hash": 4774365606307783000,
"line_mean": 36.2352941176,
"line_max": 510,
"alpha_frac": 0.5010907997,
"autogenerated": false,
"ratio": 3.823123382226057,
"config_test": false,
"has_... |
__author__ = 'Peter_000'
from Threes import Board, create_board_from_json
from flask import Flask, request, jsonify
from flask import render_template
import json
app = Flask(__name__, static_folder='web/static', static_url_path='')
app.template_folder = 'web'
@app.route('/')
def index():
return render_template('in... | {
"repo_name": "PeterSulcs/threes-clone",
"path": "ThreesFlask.py",
"copies": "1",
"size": "1437",
"license": "mit",
"hash": -1628191857086341400,
"line_mean": 24.6785714286,
"line_max": 69,
"alpha_frac": 0.6513569937,
"autogenerated": false,
"ratio": 3.2364864864864864,
"config_test": false,
... |
import numpy as np
import scipy.io
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from pyprobml_utils import save_fig
import os
def draw_ell(ax, cov, xy, color):
u, v = np.linalg.eigh(cov)
angle = np.arctan2(v[0][1], v[0][0])
angle = (180 * angle / np.pi)
# here we time u2 wi... | {
"repo_name": "probml/pyprobml",
"path": "scripts/height_weight_whiten_plot.py",
"copies": "1",
"size": "2339",
"license": "mit",
"hash": -5637101574266767000,
"line_mean": 28.2375,
"line_max": 83,
"alpha_frac": 0.6212056434,
"autogenerated": false,
"ratio": 2.3413413413413413,
"config_test": f... |
__author__ = 'Peter Forgacs'
f = open('gc.txt', 'r') # Megnyitja a filet
l = f.read() #Beolvassa
l = l.split('>') # Szetvagja listre
l.pop(0) #Kiszedi a splittel keletkezo ures elemet a 0 helyrol
#Kiszedi a \n-t es stringkent visszakuldi
def lose_slashn_list(x):
removed = x.replace("\n", "")
return removed
... | {
"repo_name": "amidoimidazol/bio_info",
"path": "Rosalind.info Problems/GC2.py",
"copies": "1",
"size": "1509",
"license": "mit",
"hash": 1633307224778087000,
"line_mean": 19.6712328767,
"line_max": 117,
"alpha_frac": 0.549370444,
"autogenerated": false,
"ratio": 2.3838862559241707,
"config_tes... |
# ESP8266 has connected to the broker.
BROKER_OK = 0
# ESP8266 is about to connect to the broker.
BROKER_CHECK = 1
# ESP8266 is about to connect to the default network.
DEFNET = 2
# ESP8266 is about to connect to LAN specified in INIT.
SPECNET = 3
# ESP8266 has completed a publication.
PUBOK = 4
# ESP8266 initialisati... | {
"repo_name": "peterhinch/micropython-mqtt",
"path": "bridge/host/status_values.py",
"copies": "2",
"size": "1197",
"license": "mit",
"hash": 7028888792363065000,
"line_mean": 24.4680851064,
"line_max": 77,
"alpha_frac": 0.730994152,
"autogenerated": false,
"ratio": 3.0151133501259446,
"config_... |
__author__ = 'Peter Liang'
import socket
import struct
from datetime import datetime
message = 'very important data'
multicast_group = ('224.3.29.71', 9999)
# Create the datagram socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
# Set a timeout so the socket does not block indefinit... | {
"repo_name": "Peter-Liang/SocketMulticast",
"path": "Sender.py",
"copies": "1",
"size": "1195",
"license": "mit",
"hash": -3138656741391877600,
"line_mean": 27.4761904762,
"line_max": 84,
"alpha_frac": 0.6426778243,
"autogenerated": false,
"ratio": 3.610271903323263,
"config_test": false,
"h... |
__author__ = "Peter Molnar"
__copyright__ = "Copyright 2017-2019, Peter Molnar"
__license__ = "apache-2.0"
__maintainer__ = "Peter Molnar"
__email__ = "mail@petermolnar.net"
import os
import re
import argparse
import logging
from tempfile import gettempdir
class nameddict(dict):
__getattr__ = dict.get
__seta... | {
"repo_name": "petermolnar/nasg",
"path": "settings.py",
"copies": "1",
"size": "8571",
"license": "apache-2.0",
"hash": -79475724563621550,
"line_mean": 28.0406779661,
"line_max": 135,
"alpha_frac": 0.5065950741,
"autogenerated": false,
"ratio": 3.225527108433735,
"config_test": false,
"has_... |
__author__ = "Peter Molnar"
__copyright__ = "Copyright 2017-2019, Peter Molnar"
__license__ = "apache-2.0"
__maintainer__ = "Peter Molnar"
__email__ = "mail@petermolnar.net"
import re
import json
import os
import logging
import requests
import arrow
from time import sleep
import settings
logger = logging.getLogger("w... | {
"repo_name": "petermolnar/nasg",
"path": "wayback.py",
"copies": "1",
"size": "4210",
"license": "apache-2.0",
"hash": -1703927197184681200,
"line_mean": 32.4126984127,
"line_max": 85,
"alpha_frac": 0.4819477435,
"autogenerated": false,
"ratio": 4.059787849566056,
"config_test": false,
"has_... |
__author__ = "Peter Molnar"
__copyright__ = "Copyright 2017-2019, Peter Molnar"
__license__ = "apache-2.0"
__maintainer__ = "Peter Molnar"
__email__ = "mail@petermolnar.net"
import re
import subprocess
import json
import os
import logging
from tempfile import gettempdir
TMPSUBDIR = "nasg"
SHM = "/dev/shm"
if os.path... | {
"repo_name": "petermolnar/nasg",
"path": "meta.py",
"copies": "1",
"size": "4606",
"license": "apache-2.0",
"hash": -5129342375580366000,
"line_mean": 26.7469879518,
"line_max": 86,
"alpha_frac": 0.5069474598,
"autogenerated": false,
"ratio": 3.6239181746656177,
"config_test": false,
"has_no... |
__author__ = "Peter Molnar"
__copyright__ = "Copyright 2017-2019, Peter Molnar"
__license__ = "apache-2.0"
__maintainer__ = "Peter Molnar"
__email__ = "mail@petermolnar.net"
import subprocess
import logging
import hashlib
import os
import settings
class Pandoc(str):
in_format = "html"
in_options = []
out... | {
"repo_name": "petermolnar/nasg",
"path": "pandoc.py",
"copies": "1",
"size": "4287",
"license": "apache-2.0",
"hash": -4206142877641996000,
"line_mean": 24.8253012048,
"line_max": 83,
"alpha_frac": 0.5346396081,
"autogenerated": false,
"ratio": 3.551781275890638,
"config_test": false,
"has_n... |
__author__ = 'Peter'
def isitcool(x , y):
if x == "A" and y == "T":
return True
elif x=="G" and y == "C":
return True
elif x=="C" and y == "G":
return True
elif x=="T" and y == "A":
return True
else:
return False
# File beolvasasa es megnyitasa
f = open('reve... | {
"repo_name": "amidoimidazol/bio_info",
"path": "Rosalind.info Problems/Finding restriction sites.py",
"copies": "1",
"size": "2285",
"license": "mit",
"hash": 1154138745044514600,
"line_mean": 29.8918918919,
"line_max": 137,
"alpha_frac": 0.436761488,
"autogenerated": false,
"ratio": 2.653890824... |
__author__ = 'peter'
from langtools.classify.tagger import TaggerFactory
from collections import Counter
import numpy
class EagleTagAnalysis(object):
def __init__(self, words):
self.words = words
# Get tagger
self.tagger = TaggerFactory.factory("cess")
# Tag words
self.tagg... | {
"repo_name": "peterFran/LanguageListCreator",
"path": "langtools/statistics/EagleTagAnalysis.py",
"copies": "1",
"size": "1943",
"license": "mit",
"hash": 3306294709281456600,
"line_mean": 25.6301369863,
"line_max": 91,
"alpha_frac": 0.5589294905,
"autogenerated": false,
"ratio": 3.5716911764705... |
__author__ = 'peter'
def tokenize(inputstring):
result = []
if inputstring is None or inputstring == "":
return result
buffer = ""
comment = False
quotedstring = False
for i in range(0, len(inputstring)):
if inputstring[i] == '"':
... | {
"repo_name": "PeterDowdy/py-paradox-convert",
"path": "tokenizer.py",
"copies": "1",
"size": "1239",
"license": "mit",
"hash": -340456872730637440,
"line_mean": 37.75,
"line_max": 109,
"alpha_frac": 0.4374495561,
"autogenerated": false,
"ratio": 4.440860215053763,
"config_test": false,
"has_... |
__author__ = 'Peter'
'''
This is a simulator for Conway's game of life (google to find the rules:
v4 with additional functionality over v3:
- load or save boards to/from files: OK
- random fill (with variable density): OK
- improved layout and added menu bar: OK
- warp yes/no: OK
- show / hide grid... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578928_Game_of_Life__Python_34__tkinter/recipe-578928.py",
"copies": "1",
"size": "10321",
"license": "mit",
"hash": -102781111807937550,
"line_mean": 35.8607142857,
"line_max": 120,
"alpha_frac": 0.5923844589,
"autogenerated": false,
"rat... |
__author__ = 'Peter'
s = "TGATGAGTTACAATGCAACTTGAATAGACCCTGTACAGACGCCCGGGATTTTGTAGGAAAGCTCAACGTGCTAAACTTGCGGCGTCGACCCACAGTCAATACTTCTATCAAGTGGGCTAATCAGCGATGCATTTAGTTATGTCAGGAGACTTACGCTATATAAACCACATTCTCCTTCGGAGGCGTCCGGTATTGCGTAAGATGTACCGCGTTAGACGAAAGAGACTCATCTTGAGAGTAGGCCCGCACCCAGGATCCCTATATCATAGCGACGTGGAATCGCTCATTTGAATC... | {
"repo_name": "amidoimidazol/bio_info",
"path": "Rosalind.info Problems/Rosalind Starter Problems/01 Counting DNA Nucleotides/01Counting DNA Nucleotides.py",
"copies": "1",
"size": "1272",
"license": "mit",
"hash": -5931608173439180000,
"line_mean": 42.8620689655,
"line_max": 935,
"alpha_frac": 0.810... |
import xml.etree.ElementTree as et
import logging
class Feedback():
"""Feeback used by Alfred Script Filter
Usage:
fb = Feedback()
fb.add_item('Hello', 'World')
fb.add_item('Foo', 'Bar')
print fb
"""
def __init__(self):
self.feedback = et.Element('items')
... | {
"repo_name": "maxrothman/ubuntu-ec2-ami-finder-alfred-workflow",
"path": "feedback.py",
"copies": "2",
"size": "2473",
"license": "mit",
"hash": 4661537955563711000,
"line_mean": 29.5432098765,
"line_max": 122,
"alpha_frac": 0.5701577032,
"autogenerated": false,
"ratio": 4.300869565217392,
"co... |
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import metrics
from sklearn.cluster import KMeans, MiniBatchKMeans
import logging
from optparse import OptionParser
import sys
from time import time
import numpy as np
# Display progress logs o... | {
"repo_name": "clemsos/mitras",
"path": "tests/examples/kmeans.py",
"copies": "1",
"size": "2846",
"license": "mit",
"hash": 7850009515021034000,
"line_mean": 28.3505154639,
"line_max": 84,
"alpha_frac": 0.6472241743,
"autogenerated": false,
"ratio": 3.4289156626506023,
"config_test": false,
... |
"""Implementation of Stochastic Gradient Descent (SGD) with dense data."""
import numpy as np
from ..externals.joblib import Parallel, delayed
from .base import BaseSGDClassifier, BaseSGDRegressor
from .sgd_fast import plain_sgd
class SGDClassifier(BaseSGDClassifier):
"""Linear model fitted by minimizing a regu... | {
"repo_name": "joshbohde/scikit-learn",
"path": "sklearn/linear_model/stochastic_gradient.py",
"copies": "2",
"size": "12903",
"license": "bsd-3-clause",
"hash": -9117834564489210000,
"line_mean": 37.7477477477,
"line_max": 79,
"alpha_frac": 0.552972177,
"autogenerated": false,
"ratio": 4.3591216... |
"""Implementation of Stochastic Gradient Descent (SGD) with sparse data."""
import numpy as np
import scipy.sparse as sp
from ...externals.joblib import Parallel, delayed
from ..base import BaseSGDClassifier, BaseSGDRegressor
from ..sgd_fast_sparse import plain_sgd
## TODO add flag for intercept learning rate heuris... | {
"repo_name": "joshbohde/scikit-learn",
"path": "sklearn/linear_model/sparse/stochastic_gradient.py",
"copies": "2",
"size": "15801",
"license": "bsd-3-clause",
"hash": -8343896349550561000,
"line_mean": 37.6332518337,
"line_max": 79,
"alpha_frac": 0.5495221821,
"autogenerated": false,
"ratio": 4... |
# License: BSD 3 clause
from __future__ import print_function
from sklearn.datasets import fetch_20newsgroups
from sklearn.decomposition import TruncatedSVD
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.feature_extraction.text i... | {
"repo_name": "gtrdp/twitter-clustering",
"path": "old/clustering-sklearn.py",
"copies": "1",
"size": "6455",
"license": "mit",
"hash": -7249416349161450000,
"line_mean": 31.601010101,
"line_max": 102,
"alpha_frac": 0.6994577847,
"autogenerated": false,
"ratio": 3.265048052604957,
"config_test"... |
from __future__ import print_function
import logging
import numpy as np
from optparse import OptionParser
import sys
from time import time
import matplotlib.pyplot as plt
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn... | {
"repo_name": "tpsatish95/Youtube-Comedy-Comparison",
"path": "OLD/Master Classifier/TextClassifierFNF.py",
"copies": "1",
"size": "9318",
"license": "apache-2.0",
"hash": -8283304730996284000,
"line_mean": 30.5804195804,
"line_max": 102,
"alpha_frac": 0.5964799313,
"autogenerated": false,
"ratio... |
__author__ = 'Peter Shipley <peter.shipley@gmail.com>'
__copyright__ = "Copyright (C) 2013 Peter Shipley"
__license__ = "BSD"
__all__ = ['IsyError', 'IsyNodeError',
'IsyResponseError', 'IsyPropertyError', 'IsyValueError',
'IsyInvalidCmdError',
'IsySoapError', 'IsyTypeError',
... | {
"repo_name": "fxstein/ISYlib-python",
"path": "ISY/IsyExceptionClass.py",
"copies": "1",
"size": "3958",
"license": "bsd-2-clause",
"hash": -924086791738773800,
"line_mean": 22.011627907,
"line_max": 75,
"alpha_frac": 0.6404749874,
"autogenerated": false,
"ratio": 3.9226957383548067,
"config_t... |
__author__ = 'Peter Shipley <peter.shipley@gmail.com>'
__copyright__ = "Copyright (C) 2013 Peter Shipley"
__license__ = "BSD"
# from xml.dom.minidom import parse, parseString
#from StringIO import StringIO
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import iselement
from ISY.IsyExceptionClass import ... | {
"repo_name": "fxstein/ISYlib-python",
"path": "ISY/IsyUtilClass.py",
"copies": "1",
"size": "16594",
"license": "bsd-2-clause",
"hash": 9060475932205998000,
"line_mean": 30.4876660342,
"line_max": 138,
"alpha_frac": 0.5041581294,
"autogenerated": false,
"ratio": 3.633457411867747,
"config_test... |
__author__ = 'Peter Zhu'
#!/usr/bin/env python
import subprocess, sys, os, re, json, codecs
import shutil
import xml.dom.minidom as dom
from chameleon_gen import *
from optparse import OptionParser
import json
def makeCfg(channelcfgroot, channel):
icfg = dict([])
jcfg = json.loads('{"projectName":"sanguofire... | {
"repo_name": "uclouddotcn/chameleon",
"path": "client/tools/buildtool/chameleon_tool/compileAll.py",
"copies": "3",
"size": "2276",
"license": "mit",
"hash": 9094523777104973000,
"line_mean": 41.9433962264,
"line_max": 380,
"alpha_frac": 0.6410369069,
"autogenerated": false,
"ratio": 3.528682170... |
__author__ = 'pezy'
def insertion_sort(lst):
for j in range(1, len(lst)):
key = lst[j]
i = j - 1
while i >= 0 and lst[i] > key:
lst[i + 1] = lst[i]
i -= 1
lst[i + 1] = key
return lst
def insertion_sort_non_increasing(lst):
for j in range(1, len(lst... | {
"repo_name": "pezy/AlgorithmNotes",
"path": "Foundations/overview/insertion_sort.py",
"copies": "1",
"size": "1141",
"license": "mit",
"hash": 62224539777376100,
"line_mean": 21.82,
"line_max": 54,
"alpha_frac": 0.4645048203,
"autogenerated": false,
"ratio": 2.8813131313131315,
"config_test": ... |
__author__ = 'pg1712'
# The MIT License (MIT)
#
# Copyright (c) 2016 Panagiotis Garefalakis
#
# 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 limitatio... | {
"repo_name": "pgaref/memcached_bench",
"path": "Python_plots/plots/cdf/memcached/memcached_latency_cdf.py",
"copies": "1",
"size": "7517",
"license": "mit",
"hash": -4238366376253626400,
"line_mean": 36.585,
"line_max": 86,
"alpha_frac": 0.5579353465,
"autogenerated": false,
"ratio": 3.410617059... |
__author__ = 'phageghost'
import argparse
import array
import datetime
import math
import os
from pgtools import toolbox
def strarr(arr):
"""
Pretty-prints char arrays as strings
:param arr:
:return:
"""
return ''.join([c for c in arr])
def write_fasta_dict(fasta_seqs, output_fname, num_col... | {
"repo_name": "phageghost/pg_tools",
"path": "quarantine/apply_snps.py",
"copies": "1",
"size": "16910",
"license": "mit",
"hash": 7472869704811276000,
"line_mean": 49.3273809524,
"line_max": 171,
"alpha_frac": 0.4803075103,
"autogenerated": false,
"ratio": 4.494949494949495,
"config_test": fal... |
__author__ = 'Pharylon'
import time
import RPi.GPIO as GPIO
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-w", "--wait", type=float, default=0.001, help="Time to wait (in seconds) between steps. Default time is 0.001")
parser.add_argument("-s", "--steps", type=int, default=500, help="Number... | {
"repo_name": "Pharylon/28byj-48-Driver-For-Raspberry-Pi",
"path": "28byj-48-driver.py",
"copies": "1",
"size": "2777",
"license": "bsd-3-clause",
"hash": -7782430269837219000,
"line_mean": 28.5425531915,
"line_max": 142,
"alpha_frac": 0.70435722,
"autogenerated": false,
"ratio": 3.10279329608938... |
__author__ = "Phil Hendren aka dizzythinks"
__credits__ = ["Phil Hendren"]
__version__ = "1.0"
from flask import current_app
import boto.ec2
import boto.ec2.autoscale
import boto.ec2.elb
import boto.ec2.cloudwatch
import boto.elasticache
import boto.rds
import boto.dynamodb
import boto.sqs
import boto.sns
impor... | {
"repo_name": "PercussiveRepair/elastatus",
"path": "app/aws.py",
"copies": "1",
"size": "4265",
"license": "mit",
"hash": 5005967456540586000,
"line_mean": 37.4234234234,
"line_max": 117,
"alpha_frac": 0.6007033998,
"autogenerated": false,
"ratio": 3.4787928221859707,
"config_test": false,
"... |
__author__ = "Phil Hendren"
__copyright__ = "Copyright 2014, Mind Candy"
__credits__ = ["Phil Hendren"]
__license__ = "MIT"
__version__ = "1.0"
from app import db
import json
import cPickle
from app.models.schema import Dashboard, Graph, Users
def get_all_dashboards():
return Dashboard.query.all()
de... | {
"repo_name": "mindcandy/graphite-boards",
"path": "app/modules/gendash.py",
"copies": "1",
"size": "1888",
"license": "mit",
"hash": 7761000296778933000,
"line_mean": 20.4545454545,
"line_max": 78,
"alpha_frac": 0.6525423729,
"autogenerated": false,
"ratio": 3.194585448392555,
"config_test": f... |
__author__ = "Phil Hendren"
__copyright__ = "Copyright 2014, Mind Candy"
__credits__ = ["Phil Hendren"]
__license__ = "MIT"
__version__ = "1.0"
import hashlib
import json
import cPickle
import sys
from flask import Blueprint, request, render_template, redirect, url_for, current_app, flash, abort
from flask_lo... | {
"repo_name": "mindcandy/graphite-boards",
"path": "app/views/main.py",
"copies": "1",
"size": "4322",
"license": "mit",
"hash": -5603997155740198000,
"line_mean": 29.4366197183,
"line_max": 99,
"alpha_frac": 0.6790837575,
"autogenerated": false,
"ratio": 3.531045751633987,
"config_test": false... |
__author__ = "Phil Hendren"
__copyright__ = "Copyright 2014, Mind Candy"
__credits__ = ["Phil Hendren"]
__license__ = "MIT"
__version__ = "1.0"
import os
import ldap
import hashlib
from flask import Flask, request, redirect, url_for, render_template, flash
from flask_login import LoginManager
from flask.ext.s... | {
"repo_name": "mindcandy/graphite-boards",
"path": "app/__init__.py",
"copies": "1",
"size": "2644",
"license": "mit",
"hash": 2665909221806446600,
"line_mean": 27.1382978723,
"line_max": 93,
"alpha_frac": 0.5854765507,
"autogenerated": false,
"ratio": 3.7397454031117396,
"config_test": false,
... |
__author__ = 'Philip'
import requests
import xmltodict
def getVertrektijden(station = 'ut'):
auth_details = ('philip.vanexel@student.hu.nl', 'u6H5dlZpHsjHbIBac4aMHJNPfLtliEZ7cQJJDYjd-ijeBWF4-Zawbw')
response = requests.get('http://webservices.ns.nl/ns-api-avt?station='+station, auth=auth_details)
final = ... | {
"repo_name": "Flipje666/Actuele_vertrektijden",
"path": "final.py",
"copies": "1",
"size": "4251",
"license": "mit",
"hash": -4126464395840336400,
"line_mean": 35.0338983051,
"line_max": 237,
"alpha_frac": 0.580334039,
"autogenerated": false,
"ratio": 2.9810659186535764,
"config_test": false,
... |
from xml.dom import minidom
import sys
id_map = {}
minlat=float("+inf")
maxlat=float("-inf")
minlon=float("+inf")
maxlon=float("-inf")
dom = minidom.parse(sys.stdin)
document = dom.documentElement
def lat2str(lat):
return "{:.7f}".format(lat)
def lon2str(lon):
return "{:.7f}".format(lon)
def process_elem... | {
"repo_name": "philippelatulippe/osm-file-anonymizer",
"path": "anonymize_osm.py",
"copies": "1",
"size": "2891",
"license": "bsd-2-clause",
"hash": 7447374181821303000,
"line_mean": 31.8522727273,
"line_max": 88,
"alpha_frac": 0.6305776548,
"autogenerated": false,
"ratio": 3.5691358024691358,
... |
from flask import Flask
from flask import request
from flask import Response
from pymongo.read_preferences import ReadPreference
from pymongo import Connection
from pymongo import MongoClient
from pymongo import MongoReplicaSetClient
from bson.dbref import DBRef
from bson.json_util import dumps
from bson import Object... | {
"repo_name": "inkscope/inkscope",
"path": "inkscopeMonitor/lib/libmongojuice.py",
"copies": "1",
"size": "6852",
"license": "apache-2.0",
"hash": -6453796478794818000,
"line_mean": 23.5627240143,
"line_max": 135,
"alpha_frac": 0.6205487449,
"autogenerated": false,
"ratio": 3.4106520657043307,
... |
from flask import Flask, request,Response
from pymongo import MongoClient, MongoReplicaSetClient
from pymongo.read_preferences import ReadPreference
import json
from bson.dbref import DBRef
from bson.json_util import dumps
from bson import ObjectId
import time
from bson.dbref import DBRef
from bson.json_util import du... | {
"repo_name": "abrefort/inkscope-debian",
"path": "inkscopeMonitor/nrpe/libexec/libmongojuice.py",
"copies": "1",
"size": "4802",
"license": "apache-2.0",
"hash": -8118648692170902000,
"line_mean": 23.7525773196,
"line_max": 135,
"alpha_frac": 0.6426488963,
"autogenerated": false,
"ratio": 3.3960... |
from flask import Flask, request,Response
from pymongo import MongoClient, MongoReplicaSetClient
from pymongo.read_preferences import ReadPreference
import json
from bson.dbref import DBRef
from bson.json_util import dumps
from bson import ObjectId
import time
configfile = "/opt/inkscope/etc/inkscope.conf"
def ... | {
"repo_name": "inkscope/inkscope",
"path": "inkscopeCtrl/mongoJuiceCore.py",
"copies": "1",
"size": "10652",
"license": "apache-2.0",
"hash": 9191496370979973000,
"line_mean": 34.3887043189,
"line_max": 166,
"alpha_frac": 0.5520090124,
"autogenerated": false,
"ratio": 3.870639534883721,
"config... |
from setuptools import setup, find_packages
import os
dirname = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(dirname, 'README.md')) as f:
long_description = f.read()
# To update pip package run:
# python setup.py sdist && python setup.py bdist_wheel && twine upload dist/*
# check if tensor... | {
"repo_name": "PhilJd/tf-quaternion",
"path": "setup.py",
"copies": "1",
"size": "2077",
"license": "apache-2.0",
"hash": 5949551024053626000,
"line_mean": 30.9538461538,
"line_max": 77,
"alpha_frac": 0.6567164179,
"autogenerated": false,
"ratio": 4.033009708737864,
"config_test": false,
"has... |
__author__ = 'philipp'
import sys,os
sys.path.append(os.path.join(os.path.abspath('..'),'service'))
from sqs import SQS
from mailer import mailer
import leancloud
from leancloud import Object
from leancloud import Query
leancloud.init('73b6c6p6lgs8s07m6yaq5jeu7e19j3i3x7fdt234ufxw9ity', 'h5lu7ils6mutvirgrxeodo6xfuqcgxh4... | {
"repo_name": "iforgotid/webmail",
"path": "demo/consumerDemo.py",
"copies": "1",
"size": "1083",
"license": "apache-2.0",
"hash": -3629406710192090000,
"line_mean": 29.0833333333,
"line_max": 118,
"alpha_frac": 0.648199446,
"autogenerated": false,
"ratio": 3.103151862464183,
"config_test": fal... |
__author__ = 'philipp'
import time
import datetime
import leancloud
import os
from leancloud import Query,Object
from sqs import SQS
from mailer import mailer
os.environ['TZ'] = 'Asia/Shanghai'
time.tzset()
leancloud.init('73b6c6p6lgs8s07m6yaq5jeu7e19j3i3x7fdt234ufxw9ity', 'h5lu7ils6mutvirgrxeodo6xfuqcgxh4ny0bdar3utl... | {
"repo_name": "iforgotid/webmail",
"path": "service/webmail_timer.py",
"copies": "1",
"size": "1973",
"license": "apache-2.0",
"hash": 7133617337641589000,
"line_mean": 31.3442622951,
"line_max": 118,
"alpha_frac": 0.554485555,
"autogenerated": false,
"ratio": 3.8015414258188827,
"config_test":... |
__author__ = 'philipp'
import webapp2,leancloud,json,os,time,datetime,mimetypes
from webapp2_extras import jinja2
from leancloud import Object
from service.mailer import mailer
os.environ['TZ'] = 'Asia/Shanghai'
time.tzset()
leancloud.init('73b6c6p6lgs8s07m6yaq5jeu7e19j3i3x7fdt234ufxw9ity', 'h5lu7ils6mutvirgrxeodo6xfu... | {
"repo_name": "iforgotid/webmail",
"path": "web.py",
"copies": "1",
"size": "3321",
"license": "apache-2.0",
"hash": 7311808382231686000,
"line_mean": 35.9,
"line_max": 118,
"alpha_frac": 0.6106594399,
"autogenerated": false,
"ratio": 3.6255458515283845,
"config_test": false,
"has_no_keywords... |
__author__ = 'phil'
from flask import Flask, request, render_template, redirect
from osiam import connector
from requests.auth import HTTPBasicAuth
import argparse
import ast
import json
import logging
import requests
import urllib
import copy
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name... | {
"repo_name": "osiam/connector4python",
"path": "example-client/client-server.py",
"copies": "1",
"size": "13902",
"license": "mit",
"hash": -7689535202256155000,
"line_mean": 28.8967741935,
"line_max": 103,
"alpha_frac": 0.6376060998,
"autogenerated": false,
"ratio": 3.5913200723327305,
"confi... |
__author__ = 'phoetrymaster'
import accuracy_assessment
import numpy as np
import os
from osgeo import gdal
from osgeo.gdalconst import *
import sys
searchdir = "/Users/phoetrymaster/Documents/School/Geography/Thesis/Data/MODIS_KANSAS_2007-2012/reprojected/Classified/test1_envicurves/fullpxonly/clip1refs/KansasNDVI_2... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/test6.py",
"copies": "1",
"size": "2395",
"license": "mit",
"hash": 8129171186776158000,
"line_mean": 35.303030303,
"line_max": 186,
"alpha_frac": 0.6221294363,
"autogenerated": false,
"ratio": 3.6232980332829046,
"config_test": fals... |
__author__ = 'phoetrymaster'
from osgeo import gdal
from osgeo.gdalconst import *
import os
import numpy
from datetime import datetime as dt
gdal.UseExceptions()
imagepath = "/Users/phoetrymaster/Documents/School/Geography/Thesis/Data/ARC_Testing/ClipTesting/ENVI_1/test_clip_envi_3.dat"
rootdir = "/Users/phoetrymast... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/create_rule_image_lineread.py",
"copies": "1",
"size": "7190",
"license": "mit",
"hash": 566412109637989950,
"line_mean": 32.6028037383,
"line_max": 125,
"alpha_frac": 0.607232267,
"autogenerated": false,
"ratio": 3.05307855626327,
"... |
__author__ = 'phoetrymaster'
from osgeo import gdal
from osgeo.gdalconst import *
import os
import numpy
from numpy import sum
from scipy import interpolate
from scipy import optimize
from datetime import datetime as dt
gdal.UseExceptions()
imagepath = "/Users/phoetrymaster/Documents/School/Geography/Thesis/Data/ARC... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/create_rule_image.py",
"copies": "1",
"size": "7047",
"license": "mit",
"hash": -682628671043191700,
"line_mean": 32.4028436019,
"line_max": 125,
"alpha_frac": 0.6104725415,
"autogenerated": false,
"ratio": 3.046692607003891,
"config... |
__author__ = 'phoetrymaster'
from osgeo import gdal
from osgeo.gdalconst import *
import os
import numpy
from numpy import sum
from scipy import interpolate
from scipy import optimize
import multiprocessing
from datetime import datetime as dt
gdal.UseExceptions()
imagepath = "/Users/phoetrymaster/Documents/School/Ge... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/create_rule_image_optTEST2.py",
"copies": "1",
"size": "7988",
"license": "mit",
"hash": -2532393580221582300,
"line_mean": 32.7088607595,
"line_max": 155,
"alpha_frac": 0.611792689,
"autogenerated": false,
"ratio": 3.1648177496038037,... |
__author__ = 'phoetrymaster'
from osgeo import gdal
from osgeo.gdalconst import *
import os
import numpy
from scipy import interpolate
from scipy import optimize
import multiprocessing
from datetime import datetime as dt
import sys
gdal.UseExceptions()
########## METHODS ##########
def read_reference_file(filepat... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/create_rule_image_multiprocessed_bypx.py",
"copies": "1",
"size": "11276",
"license": "mit",
"hash": 9153957827237589000,
"line_mean": 34.3510971787,
"line_max": 248,
"alpha_frac": 0.5997694218,
"autogenerated": false,
"ratio": 3.47702... |
__author__ = 'phoetrymaster'
from osgeo import gdal
from osgeo.gdalconst import *
import os
import sys
import subprocess
gdal.UseExceptions()
def find_files(searchdir, ext):
foundfiles = []
for root, dirs, files in os.walk(searchdir):
for f in files:
if f.upper().endswith(ext.upper()):
... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/clip_raster_to_extent.py",
"copies": "1",
"size": "3935",
"license": "mit",
"hash": 4344588894107642400,
"line_mean": 30.7419354839,
"line_max": 172,
"alpha_frac": 0.640660737,
"autogenerated": false,
"ratio": 3.329103214890017,
"con... |
__author__ = 'phoetrymaster'
from osgeo import gdal
from osgeo.gdalconst import *
import sys
import os
import numpy
from math import floor
from get_px_coords_from_point import get_px_coords_from_points
def get_crop_pixel_values(imagepath, locations):
gdal.AllRegister()
img = gdal.Open(imagepath, GA_ReadOnly... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/get_ref_values_v2.py",
"copies": "1",
"size": "3850",
"license": "mit",
"hash": -7795652466484795000,
"line_mean": 32.4782608696,
"line_max": 123,
"alpha_frac": 0.5906493506,
"autogenerated": false,
"ratio": 3.506375227686703,
"confi... |
__author__ = 'phoetrymaster'
from osgeo import gdal
from osgeo.gdalconst import *
import sys
def get_reference_values(imagepath, refstoget):
from math import floor
gdal.AllRegister()
img = gdal.Open(imagepath, GA_ReadOnly)
if img is None:
raise Exception("Could not open " + imagepath)
ba... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/get_ref_values.py",
"copies": "1",
"size": "3434",
"license": "mit",
"hash": -7234790988857891000,
"line_mean": 31.7047619048,
"line_max": 122,
"alpha_frac": 0.5955154339,
"autogenerated": false,
"ratio": 3.4582074521651562,
"config_... |
__author__ = 'phoetrymaster'
from osgeo import gdal
from osgeo.gdalconst import *
imagepath = "/Users/phoetrymaster/Documents/School/Geography/Thesis/Data/ARC_Testing/test1.dat"
startDOY = 1
thresh = 0
bestguess = 0
fitmthd = 'SLSQP'
soylocs = [(6002, 2143), (5944, 2102), (5746, 2183), (5998, 2171)]
cornlocs = [(599... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/create_rule_image_test.py",
"copies": "1",
"size": "4240",
"license": "mit",
"hash": 5577659895530486000,
"line_mean": 36.8660714286,
"line_max": 120,
"alpha_frac": 0.583490566,
"autogenerated": false,
"ratio": 2.612446087492298,
"co... |
__author__ = 'phoetrymaster'
import create_rule_image_multiprocessed_bypx
import matplotlib.pyplot as plt
import matplotlib.legend as legend
from matplotlib.backends.backend_pdf import PdfPages
import sys
import os
def main():
outpath = r"/Users/phoetrymaster/Documents/School/Geography/Thesis/GIS In Action/Images... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/example_graphic_fitmethod_1.py",
"copies": "1",
"size": "2453",
"license": "mit",
"hash": -8346764953047149000,
"line_mean": 39.2295081967,
"line_max": 156,
"alpha_frac": 0.6962902568,
"autogenerated": false,
"ratio": 2.987819732034105... |
__author__ = 'phoetrymaster'
import numpy
from scipy import optimize
from scipy import interpolate
bestguess = 10
#Measured values pseudo-Argentina
valsf = {-175: -0.2, -159: -0.23, -143: -0.24, -127: -0.25, -111: -0.23, -95: -0.26, -79: -0.28, -63: -0.22,
-47: -0.24, -31: -0.12, -15: 0.14, 1: 0.35, 17: 0.4... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/algorithim.py",
"copies": "1",
"size": "3312",
"license": "mit",
"hash": -3650998176279479300,
"line_mean": 42.5789473684,
"line_max": 119,
"alpha_frac": 0.4803743961,
"autogenerated": false,
"ratio": 1.7505285412262157,
"config_test... |
__author__ = 'phoetrymaster'
import numpy
from scipy import optimize
from scipy import interpolate
bestguess = -50
#Measured values, pseudo-Argentina
valsf = {-175: -0.2, -159: -0.23, -143: -0.24, -127: -0.25, -111: -0.23, -95: -0.26, -79: -0.28, -63: -0.22,
-47: -0.24, -31: -0.12, -15: 0.14, 1: 0.35, 17: 0... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/algorithim2.py",
"copies": "1",
"size": "4379",
"license": "mit",
"hash": -6401193088387806000,
"line_mean": 46.597826087,
"line_max": 120,
"alpha_frac": 0.5135875771,
"autogenerated": false,
"ratio": 1.9384683488269145,
"config_test... |
__author__ = 'phoetrymaster'
import subprocess
import os
from datetime import datetime as dt
import multiprocessing
def find_files(searchdir, ext):
foundfiles = []
for root, dirs, files in os.walk(searchdir):
for f in files:
if f.upper().endswith(ext.upper()):
foundfile = ... | {
"repo_name": "jkeifer/pyHytemporal",
"path": "old_TO_MIGRATE/extract_reproject_vi.py",
"copies": "1",
"size": "1879",
"license": "mit",
"hash": -7845745873103069000,
"line_mean": 31.9824561404,
"line_max": 154,
"alpha_frac": 0.6524747206,
"autogenerated": false,
"ratio": 3.3855855855855856,
"c... |
__author__ = "phylu"
from defusedxml import ElementTree as ET
from dojo.models import Finding
import re
class CrashtestSecurityXmlParser(object):
"""
The objective of this class is to parse an xml file generated by the crashtest security suite.
@param xml_output A proper xml generated by the crashtest s... | {
"repo_name": "rackerlabs/django-DefectDojo",
"path": "dojo/tools/crashtest_security/parser.py",
"copies": "2",
"size": "2209",
"license": "bsd-3-clause",
"hash": 1181470556102639900,
"line_mean": 28.4533333333,
"line_max": 98,
"alpha_frac": 0.4911724762,
"autogenerated": false,
"ratio": 4.760775... |
__author__ = 'pierleonia'
def index():
content_body = DIV()
content_body.append(H2("DB Index"))
content_body.append(UL(LI(A("rebuild index (long process)", _href= URL(r= request, f = 'rebuild_index')))))
content_body.append(H2("Load Test Data"))
content_body.append(UL(LI(A("load whole uniprot (lon... | {
"repo_name": "apierleoni/MyBioDb",
"path": "controllers/manage.py",
"copies": "1",
"size": "1896",
"license": "bsd-3-clause",
"hash": -446760258049146500,
"line_mean": 34.1296296296,
"line_max": 120,
"alpha_frac": 0.5975738397,
"autogenerated": false,
"ratio": 3.3557522123893806,
"config_test"... |
__author__ = 'pierleonia'
# biopython
from Bio import Alphabet
from Bio.SeqUtils.CheckSum import crc64
from Bio import Entrez
from Bio.Seq import Seq, UnknownSeq
from Bio.SeqRecord import SeqRecord, _RestrictedDict
from Bio import SeqFeature
class BaseBioSQLAlter():
'''Base class for to handlers for BioSQL dat... | {
"repo_name": "apierleoni/MyBioDb",
"path": "models/2_biosql_alter.py",
"copies": "1",
"size": "29915",
"license": "bsd-3-clause",
"hash": 6670113094504982000,
"line_mean": 47.0964630225,
"line_max": 183,
"alpha_frac": 0.5823834197,
"autogenerated": false,
"ratio": 4.077279542047158,
"config_te... |
__author__ = 'pierleonia'
def index():
def parse_query_from_form(vars):
d = dict()
for key in vars:
if key.startswith('query[query]'):
Lkey = key.split('[')
ID = Lkey[2].split(']')[0]
try:
ID = int(ID)
... | {
"repo_name": "apierleoni/MyBioDb",
"path": "controllers/search.py",
"copies": "1",
"size": "13390",
"license": "bsd-3-clause",
"hash": -827752445696410500,
"line_mean": 40.2030769231,
"line_max": 204,
"alpha_frac": 0.5433159074,
"autogenerated": false,
"ratio": 3.9255350337144534,
"config_test... |
__author__ = 'pierre.pichot'
class Table:
DEFAULT_HEADER_TOP_LEFT = "┍"
DEFAULT_HEADER_TOP_SEPARATOR = "┯"
DEFAULT_HEADER_TOP_RIGHT = "┑"
DEFAULT_HEADER_TOP_LINE_ITEM = "━"
DEFAULT_HEADER_BOTTOM_LEFT = "┝"
DEFAULT_HEADER_BOTTOM_SEPARATOR = "┿"
DEFAULT_HEADER_BOTTOM_RIGHT = "┥"
DEFAULT_... | {
"repo_name": "Reiep/pTable",
"path": "ptable.py",
"copies": "1",
"size": "19063",
"license": "mit",
"hash": 8362240757643218000,
"line_mean": 37.6727642276,
"line_max": 120,
"alpha_frac": 0.5675618857,
"autogenerated": false,
"ratio": 4.242363433667782,
"config_test": false,
"has_no_keywords... |
__author__ = 'Pierre'
__all__ = ["get_build_suffix_list", "build_exes", "add_package_to_params", "SetupParams", "pyqt4_hook","subpath_hook"]
'''
Parsing and launching setup_* parts
'''
from subprocess import Popen
import os, fnmatch
import sys
import glob
def get_build_suffix_list(directory=None):
... | {
"repo_name": "PierreBizouard/pizco-utils",
"path": "pizcoutils/helpers/BuildExeUtils.py",
"copies": "1",
"size": "7639",
"license": "bsd-3-clause",
"hash": 9030268170755414000,
"line_mean": 33.5395348837,
"line_max": 118,
"alpha_frac": 0.6050530174,
"autogenerated": false,
"ratio": 3.57129499766... |
import sys
from pygsl import roots
import unittest
#import unittestgui
import pygsl._numobj as Numeric
import pygsl
sys.stdout = sys.stderr
_eps = 1e-3
def quadratic(x, params):
#sys.stderr.write(str(params))
a = params[0]
b = params[1]
c = params[2]
tmp = a * x ** 2 + b * x + c
#sys.stderr.... | {
"repo_name": "juhnowski/FishingRod",
"path": "production/pygsl-0.9.5/tests/roots_test.py",
"copies": "1",
"size": "4022",
"license": "mit",
"hash": -5949987863137357000,
"line_mean": 28.1449275362,
"line_max": 108,
"alpha_frac": 0.5293386375,
"autogenerated": false,
"ratio": 3.0104790419161676,
... |
import sys
import pygsl._numobj as numx
import pygsl
from pygsl import odeiv, Float
sys.stdout = sys.stderr
mu = 10.0
def func(t, y, mu):
#print "--> func", t, y
f = numx.zeros((2,), Float) * 1.0
f[0] = y[1]
f[1] = -y[0] - mu * y[1] * (y[0] ** 2 -1);
#print f
return f
def jac(t, y, mu):
#... | {
"repo_name": "juhnowski/FishingRod",
"path": "production/pygsl-0.9.5/tests/odeiv_test.py",
"copies": "1",
"size": "3429",
"license": "mit",
"hash": 5973154207692904000,
"line_mean": 24.7819548872,
"line_max": 59,
"alpha_frac": 0.4969378828,
"autogenerated": false,
"ratio": 2.499271137026239,
"... |
"""
The matrix module.
This module provides mappings to some functions of gsl vectors as descirbed
in Chapter 8. of the gsl reference document. All functions accept one
dimensional Numeric arrays instead of gsl vectors, or return Numeric arrays.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!... | {
"repo_name": "juhnowski/FishingRod",
"path": "production/pygsl-0.9.5/pygsl/matrix_pierre.py",
"copies": "1",
"size": "3871",
"license": "mit",
"hash": 7073675535656964000,
"line_mean": 27.6740740741,
"line_max": 79,
"alpha_frac": 0.6016533196,
"autogenerated": false,
"ratio": 3.761904761904762,
... |
"""
The python equivalent of the C example found in the GSL Reference document.
It prints the calculational ouput to stdout. The first column is t, the
second y[0] and the thrid y[1]. Plot it with your favourite programm to see
the output.
"""
import sys
import time
import pygsl._numobj as numx
from pygsl import odei... | {
"repo_name": "juhnowski/FishingRod",
"path": "production/pygsl-0.9.5/examples/odeiv.py",
"copies": "1",
"size": "2561",
"license": "mit",
"hash": -8548448083523289000,
"line_mean": 27.7752808989,
"line_max": 83,
"alpha_frac": 0.5657946115,
"autogenerated": false,
"ratio": 2.5921052631578947,
"... |
"""
The python equivalent of the C example found in the GSL Reference document.
The function run_fsolver shows how to use the fsolvers (e.g. brent) and the
function run_fdfsolver explains the usage of the fdfsolvers (e.g. newton).
"""
from pygsl import roots, errno
import pygsl._numobj as numx
def quadratic(x, param... | {
"repo_name": "juhnowski/FishingRod",
"path": "production/pygsl-0.9.5/examples/roots.py",
"copies": "1",
"size": "2845",
"license": "mit",
"hash": 1128845735011793800,
"line_mean": 28.6354166667,
"line_max": 79,
"alpha_frac": 0.5173989455,
"autogenerated": false,
"ratio": 3.072354211663067,
"co... |
"""
The python equivalent of the C example found in the GSL Reference document.
The function run_fsolver shows how to use the fsolvers (e.g. dnewton) and the
function run_fdfsolver explains the usage of the fdfsolvers (e.g. gnewton).
"""
import pygsl
import pygsl._numobj as numx
from pygsl.testing import multiroot
im... | {
"repo_name": "juhnowski/FishingRod",
"path": "production/pygsl-0.9.5/testing/examples/multiroot.py",
"copies": "1",
"size": "2745",
"license": "mit",
"hash": 3127960510490944000,
"line_mean": 29.5,
"line_max": 79,
"alpha_frac": 0.5551912568,
"autogenerated": false,
"ratio": 2.753259779338014,
... |
"""
Wrapper over the functions as described in Chaper 6 of the
reference manual.
There are routines for finding real and complex roots of quadratic and cubic
equations using analytic methods. An iterative polynomial solver is also
available for finding the roots of general polynomials with real coefficients
(of ... | {
"repo_name": "juhnowski/FishingRod",
"path": "production/pygsl-0.9.5/pygsl/poly.py",
"copies": "1",
"size": "6884",
"license": "mit",
"hash": 689894518460915600,
"line_mean": 31.3192488263,
"line_max": 80,
"alpha_frac": 0.6231841952,
"autogenerated": false,
"ratio": 3.7865786578657867,
"config... |
import random
from matplotlib import mpl, pyplot
def generateComplexNumber():
random.seed()
real = random.randint(-100, 100)
compl = random.randint(-100, 100)
c = complex(real, compl)
return c
def isMandelbrot(c):
z = 0
for i in range(100):
z = pow(z, 2) + c
absZ = abs(z... | {
"repo_name": "pieteradejong/joie-de-code",
"path": "mandelbrot/mandelbrot.py",
"copies": "1",
"size": "1980",
"license": "mit",
"hash": -2794347741583825400,
"line_mean": 20.5217391304,
"line_max": 67,
"alpha_frac": 0.5712121212,
"autogenerated": false,
"ratio": 3.1181102362204722,
"config_tes... |
import sys
from .structure_processor import NUM_EXTRA_RESIDUES
def get_CDR_simple(sequence ,allow=set(["H", "K", "L"]),scheme='chothia',seqname='' \
,cdr1_scheme={'H':range(26-NUM_EXTRA_RESIDUES,33+NUM_EXTRA_RESIDUES),'L':range(24-NUM_EXTRA_RESIDUES,35+NUM_EXTRA_RESIDUES)} \
,cdr... | {
"repo_name": "eliberis/parapred",
"path": "parapred/full_seq_processor.py",
"copies": "1",
"size": "7698",
"license": "mit",
"hash": 1526527537529473800,
"line_mean": 46.5185185185,
"line_max": 186,
"alpha_frac": 0.5808002078,
"autogenerated": false,
"ratio": 3.234453781512605,
"config_test": ... |
"""Tools for spectral analysis of unequally sampled signals."""
import numpy as np
#pythran export _lombscargle(float64[], float64[], float64[])
def _lombscargle(x, y, freqs):
"""
_lombscargle(x, y, freqs)
Computes the Lomb-Scargle periodogram.
Parameters
----------
x : array_like
S... | {
"repo_name": "grlee77/scipy",
"path": "scipy/signal/_spectral.py",
"copies": "12",
"size": "1945",
"license": "bsd-3-clause",
"hash": -6922736369021176000,
"line_mean": 22.4337349398,
"line_max": 68,
"alpha_frac": 0.4915167095,
"autogenerated": false,
"ratio": 3.0678233438485805,
"config_test"... |
"""Tools for spectral analysis of unequally sampled signals."""
import numpy as np
#pythran export _lombscargle(float64[], float64[], float64[])
##runas import numpy; x = numpy.arange(2., 12.); y = numpy.arange(1., 11.); z = numpy.arange(3., 13.); _lombscargle(x, y, z)
def _lombscargle(x, y, freqs):
"""
_lo... | {
"repo_name": "serge-sans-paille/pythran",
"path": "pythran/tests/scipy/_spectral.py",
"copies": "1",
"size": "2071",
"license": "bsd-3-clause",
"hash": 1917580144511126500,
"line_mean": 23.3647058824,
"line_max": 124,
"alpha_frac": 0.4978271366,
"autogenerated": false,
"ratio": 3.010174418604651... |
"""Tools for spectral analysis of unequally sampled signals."""
import numpy as np
#pythran export lombscargle(float64[], float64[], float64[])
#runas import numpy; x = numpy.arange(2., 12.); y = numpy.arange(1., 11.); z = numpy.arange(3., 13.); lombscargle(x, y, z)
def lombscargle(x, y, freqs):
"""
_lombsca... | {
"repo_name": "serge-sans-paille/pythran",
"path": "pythran/tests/scipy/spectral.py",
"copies": "1",
"size": "1693",
"license": "bsd-3-clause",
"hash": 3658730167403249700,
"line_mean": 23.8970588235,
"line_max": 122,
"alpha_frac": 0.542232723,
"autogenerated": false,
"ratio": 2.9039451114922814,... |
__author__ = "Piotr Gawlowicz"
__copyright__ = "Copyright (c) 2015, Technische Universitat Berlin"
__version__ = "0.1.0"
__email__ = "gawlowicz@tkn.tu-berlin.de"
class FunctionBase(object):
# Nothing yet
pass
class ParameterBase(object):
""" base class for all data object parameters """
# Nothing yet... | {
"repo_name": "uniflex/uniflex",
"path": "uniflex/core/events.py",
"copies": "1",
"size": "2425",
"license": "mit",
"hash": -6770609770114337000,
"line_mean": 20.0869565217,
"line_max": 78,
"alpha_frac": 0.572371134,
"autogenerated": false,
"ratio": 3.742283950617284,
"config_test": false,
"h... |
__author__ = 'Piotr Moczurad and Michal Ciolczyk'
import os
import sys
import re
import codecs
re_flags = re.MULTILINE | re.U
author_pattern = re.compile(r'<META NAME="AUTOR" CONTENT="(.+)">', re_flags)
dept_pattern = re.compile(r'<META NAME="DZIAL" CONTENT="(.+)">', re_flags)
key_pattern = re.compile(r'<META NAME="... | {
"repo_name": "salceson/kompilatory",
"path": "lab1/zad1.py",
"copies": "1",
"size": "4434",
"license": "mit",
"hash": -8817545450034686000,
"line_mean": 31.8518518519,
"line_max": 120,
"alpha_frac": 0.5663058187,
"autogenerated": false,
"ratio": 2.6872727272727275,
"config_test": false,
"has... |
__author__ = 'piotr'
import numpy as np
from app.pairwise_distance import dist_matrix_with_nan, pairwise_not_nan_counts, similarity_count_matrix
def test_pairwise_distance_with_nan():
arr = np.array([[1, 2, 3, 4, 1],
[1, 3, 1, 4, 1],
[1, 2, 3, 4, 1],
[2... | {
"repo_name": "CampyDB/campy-server",
"path": "tests/test_distance_matrix.py",
"copies": "1",
"size": "2605",
"license": "mpl-2.0",
"hash": -3332652684946275000,
"line_mean": 38.4696969697,
"line_max": 104,
"alpha_frac": 0.416890595,
"autogenerated": false,
"ratio": 3.264411027568922,
"config_t... |
# @AUTHOR: Piplopp <https://github.com/Piplopp>
# @DATE: 05/2017
#
# @DESC This script generates a blank template for translation of the fire emblem
# heroes unit names, weapons, assit, special and passive skills for the
# feh-inheritance-tool <https://github.com/arghblargh/feh-inheritance-tool>.
#
# It will parse the ... | {
"repo_name": "arghblargh/feh-inheritance-tool",
"path": "src/gen_translation_template.py",
"copies": "1",
"size": "5980",
"license": "mit",
"hash": 1285078002714488800,
"line_mean": 30.140625,
"line_max": 127,
"alpha_frac": 0.5865529353,
"autogenerated": false,
"ratio": 3.552584670231729,
"con... |
__author__ = 'piratos'
from django import forms
from challenges.models import *
from django.forms import widgets
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
password_confirmation = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User... | {
"repo_name": "piratos/ctfbulletin",
"path": "challenges/forms.py",
"copies": "1",
"size": "1483",
"license": "mit",
"hash": -2079973753116531700,
"line_mean": 33.488372093,
"line_max": 95,
"alpha_frac": 0.6453135536,
"autogenerated": false,
"ratio": 4.040871934604905,
"config_test": false,
"... |
__author__ = 'pivstone'
class RegistryException(Exception):
code = "UNKNOWN"
message = "unknown"
status = 400
detail = {}
def __init__(self, detail=None):
self.detail = detail or {}
def errors(self):
return {"errors": [{"code": self.code, "message": self.message, "detail": se... | {
"repo_name": "pivstone/andromeda",
"path": "registry/exceptions.py",
"copies": "1",
"size": "1877",
"license": "mit",
"hash": -3704262263165019000,
"line_mean": 23.6973684211,
"line_max": 96,
"alpha_frac": 0.7202983484,
"autogenerated": false,
"ratio": 4.208520179372197,
"config_test": false,
... |
__author__ = 'pja'
from numpy import *
from numpy.linalg import *
from numpy.polynomial import *
from math import isinf
from operator import mod
def characteristic( A , v ):
return det(v*eye(A.shape[0]) - A)
def companion( coefs ):
N = len(coefs) - 1
A = matrix(zeros((N,N)))
for i in range(0,N):
A[i,N... | {
"repo_name": "lessthanoptimal/pypete",
"path": "polyroot.py",
"copies": "1",
"size": "6690",
"license": "apache-2.0",
"hash": -2390488559822515000,
"line_mean": 27.1092436975,
"line_max": 175,
"alpha_frac": 0.5923766816,
"autogenerated": false,
"ratio": 3.1736242884250476,
"config_test": false... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.