text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Erik Telepovsky'
import json
from django.core.exceptions import ObjectDoesNotExist
from django.core.validators import EMPTY_VALUES
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponse
from django.utils.cache import add_never_cache_headers
from django.views.gene... | {
"repo_name": "DylanLukes/django-clever-selects",
"path": "clever_selects/views.py",
"copies": "1",
"size": "1805",
"license": "mit",
"hash": 1850634479203751200,
"line_mean": 33.0566037736,
"line_max": 90,
"alpha_frac": 0.6398891967,
"autogenerated": false,
"ratio": 4.149425287356322,
"config_... |
__author__ = 'Erik Telepovsky'
import json
from django import forms
from django.core.exceptions import ObjectDoesNotExist
from django.core.validators import EMPTY_VALUES
from django.db import models
from form_fields import ChainedChoiceField, ChainedModelChoiceField
from testclient import TestClient
class ChainedC... | {
"repo_name": "DylanLukes/django-clever-selects",
"path": "clever_selects/forms.py",
"copies": "1",
"size": "8740",
"license": "mit",
"hash": 2367332493210893300,
"line_mean": 40.8181818182,
"line_max": 155,
"alpha_frac": 0.6010297483,
"autogenerated": false,
"ratio": 4.15992384578772,
"config_... |
__author__ = 'Erik Wannerberg'
from collections import namedtuple
PrioQDataPt = namedtuple('PrioQDataPt', 'value index id nearest_neighbour_index nearest_neighbour_id')
def append_file_to_input_and_prune(input_mat, filename, keep_size, max_matrix_size,
timelag_steps=100, timelag_sc... | {
"repo_name": "EWannerberg/AutomaticHeuristicGeneration",
"path": "DiffusionMaps&ClosedObs/ParamSearchPreproc/prune_output_matrices.py",
"copies": "2",
"size": "11679",
"license": "mit",
"hash": 2453002980811001300,
"line_mean": 40.1232394366,
"line_max": 122,
"alpha_frac": 0.6070725233,
"autogener... |
__author__ = 'Erik Wannerberg'
def get_inputs_from_file(filename=""):
"""
Get the specified JSON input file's contents as a dict
:param filename: name of the JSON input file
:return: json/python dictionary
:rtype: dict
"""
import json
with open(filename) as input_text:
json_o... | {
"repo_name": "EWannerberg/AutomaticHeuristicGeneration",
"path": "ModelPredictiveControl/get_inputs.py",
"copies": "1",
"size": "11864",
"license": "mit",
"hash": 7133361885889312000,
"line_mean": 32.7045454545,
"line_max": 111,
"alpha_frac": 0.6331759946,
"autogenerated": false,
"ratio": 3.4935... |
__author__ = 'Erilyth'
import pygame
import math
import os
from onBoard import OnBoard
'''
This class defines all our fireballs.
A fireball inherits from the OnBoard class since we will use it as an inanimate object on our board.
Each fireball can check for collisions in order to decide when to turn and when they hit ... | {
"repo_name": "erilyth/PyGame-Learning-Environment",
"path": "ple/games/donkeykong/fireball.py",
"copies": "1",
"size": "5418",
"license": "mit",
"hash": -6165148305716492000,
"line_mean": 43.4098360656,
"line_max": 154,
"alpha_frac": 0.5980066445,
"autogenerated": false,
"ratio": 4.0493273542600... |
__author__ = 'Erilyth'
import pygame
import math
import os
from .onBoard import OnBoard
'''
This class defines all our fireballs.
A fireball inherits from the OnBoard class since we will use it as an inanimate object on our board.
Each fireball can check for collisions in order to decide when to turn and when they hit... | {
"repo_name": "ntasfi/PyGame-Learning-Environment",
"path": "ple/games/monsterkong/fireball.py",
"copies": "1",
"size": "5580",
"license": "mit",
"hash": 569894593215882750,
"line_mean": 40.6417910448,
"line_max": 154,
"alpha_frac": 0.5806451613,
"autogenerated": false,
"ratio": 4.124168514412417... |
__author__ = 'Erilyth'
import pygame
import os
from person import Person
'''
This class defines all the Donkey Kongs present in our game.
Each donkey kong can only move on the top floor and cannot move vertically.
'''
class DonkeyKongPerson(Person):
def __init__(self, raw_image, position, rng, dir):
supe... | {
"repo_name": "erilyth/PyGame-Learning-Environment",
"path": "ple/games/donkeykong/donkeyKongPerson.py",
"copies": "1",
"size": "5649",
"license": "mit",
"hash": 659350450619910300,
"line_mean": 46.8728813559,
"line_max": 126,
"alpha_frac": 0.5505399186,
"autogenerated": false,
"ratio": 3.6398195... |
__author__ = 'Erilyth'
import pygame
import os
from .person import Person
'''
This class defines all the Monsters present in our game.
Each Monster can only move on the top floor and cannot move vertically.
'''
class MonsterPerson(Person):
def __init__(self, raw_image, position, rng, dir, width=15, height=15):
... | {
"repo_name": "ntasfi/PyGame-Learning-Environment",
"path": "ple/games/monsterkong/monsterPerson.py",
"copies": "1",
"size": "6131",
"license": "mit",
"hash": -2980887558768034000,
"line_mean": 43.7518248175,
"line_max": 126,
"alpha_frac": 0.5281357038,
"autogenerated": false,
"ratio": 3.89022842... |
__author__ = 'ernado'
import logging
from config import LOG_FILE, LOG_LEVEL
def get_logger():
logger = logging.getLogger("cyvk")
logger.setLevel(LOG_LEVEL)
h = logging.FileHandler(LOG_FILE)
try:
# noinspection PyUnresolvedReferences
import colorlog
f = colorlog.ColoredFormat... | {
"repo_name": "cydev/cyvk",
"path": "log.py",
"copies": "1",
"size": "1320",
"license": "mit",
"hash": 1165731182817548500,
"line_mean": 27.1063829787,
"line_max": 120,
"alpha_frac": 0.5704545455,
"autogenerated": false,
"ratio": 3.707865168539326,
"config_test": false,
"has_no_keywords": fal... |
__author__ = 'ernesto'
from json import loads as json_load
import sys
import os
import concurrent.futures
import urllib.request
import urllib.parse
import re
import queue
import argparse
PACKAGE_PARENT = '..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.p... | {
"repo_name": "bossiernesto/ArchiveOrgDownloader",
"path": "ArchiveOrgDownloader/downloader.py",
"copies": "1",
"size": "11238",
"license": "bsd-3-clause",
"hash": 2542499445369727000,
"line_mean": 36.3388704319,
"line_max": 123,
"alpha_frac": 0.5957465741,
"autogenerated": false,
"ratio": 3.8671... |
__author__ = 'ernesto'
from melta.utils.python_syncronizer import PythonSyncronizer, PythonSyncronizerException, get_ancestors
from melta.core.basicmodel import MeltaBaseObject
def is_class_ancestor_present(klass, ancestor_class):
return ancestor_class in get_ancestors(klass)
class MeltaSyncronizer(PythonSyncr... | {
"repo_name": "bossiernesto/melta",
"path": "melta/core/melta_syncronizer.py",
"copies": "1",
"size": "1599",
"license": "bsd-3-clause",
"hash": 2167913506280320300,
"line_mean": 33.7826086957,
"line_max": 103,
"alpha_frac": 0.6916823014,
"autogenerated": false,
"ratio": 3.4387096774193546,
"co... |
__author__ = 'ernesto'
def is_ancestor_present(instance, ancestor_class):
return ancestor_class in get_ancestors(instance.__class__)
def is_subclass(a_class, another_class):
return issubclass(a_class, another_class) and a_class != another_class
def get_ancestors(clazz):
return (clazz.__bases__ + (claz... | {
"repo_name": "bossiernesto/melta",
"path": "melta/utils/python_syncronizer.py",
"copies": "1",
"size": "2393",
"license": "bsd-3-clause",
"hash": 7920663314185448000,
"line_mean": 38.8833333333,
"line_max": 111,
"alpha_frac": 0.649394066,
"autogenerated": false,
"ratio": 3.922950819672131,
"co... |
__author__ = 'ershadmoi'
import re
import sys
# Small utility method to copy between two streams
def copyfilestreams(inputfile, outputfile):
for line in inputfile:
print(line, file=outputfile)
# Main method that will do code generation magic
def main(argv):
# lets read the file first
f = open(arg... | {
"repo_name": "ershadmoi/python-projects",
"path": "utilities/code-generator.py",
"copies": "1",
"size": "1465",
"license": "apache-2.0",
"hash": 6024188841424319000,
"line_mean": 27.7254901961,
"line_max": 75,
"alpha_frac": 0.5754266212,
"autogenerated": false,
"ratio": 4.15014164305949,
"conf... |
__author__ = 'erwin'
#coding=utf-8
import codecs
import os
class Dict:
def __init__(self, base_dir='/Users/erwin/work/comment_labeled/dict', lazy_load=True):
self.base_dir = base_dir
self.lazy_load = lazy_load
self.user_dict_path = os.path.join(self.base_dir, 'userdict.txt')
self.l... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "mass_dict/__init__.py",
"copies": "1",
"size": "1725",
"license": "mit",
"hash": -6181996969951379000,
"line_mean": 29.8214285714,
"line_max": 90,
"alpha_frac": 0.5339130435,
"autogenerated": false,
"ratio": 3.409090909090909,
"config_test... |
__author__ = 'erwin'
#coding=utf-8
from gensim.models import word2vec
import codecs
class EmotionDict:
def __init__(self):
self.dict_path = '/Users/erwin/tmp/emotion.dict'
self.word2vec_bin = '/Users/erwin/svn/word2vec/all_tmall_comments.bin'
self.model = word2vec.Word2Vec.load_word2vec_fo... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "bow/EmotionDict.py",
"copies": "1",
"size": "1786",
"license": "mit",
"hash": 1354937358202732000,
"line_mean": 33.8431372549,
"line_max": 91,
"alpha_frac": 0.5332207207,
"autogenerated": false,
"ratio": 3.0940766550522647,
"config_test": ... |
__author__ = 'erwin'
#coding=utf-8
from gensim.models import word2vec
import os
import codecs
import pickle
import sys
sys.path.append('..')
import mass_dict
mass_dict = mass_dict.Dict(lazy_load=False)
class LabelClusters:
'''
把标签通过词相似形自动聚类起来
'''
def __init__(self):
# self.model = word2vec.... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "bow/labels_cluster.py",
"copies": "1",
"size": "8211",
"license": "mit",
"hash": 5233821544792584000,
"line_mean": 36.6543778802,
"line_max": 113,
"alpha_frac": 0.4684861094,
"autogenerated": false,
"ratio": 3.6542933810375673,
"config_tes... |
__author__ = 'erwin'
#coding=utf-8
from numpy import *
from numpy.linalg import *
from scipy import *
import matplotlib.pyplot as plt
from scipy import optimize
from scipy import stats
def foo(x, y):
return 10 * x + y
def hello_numpy_base():
a = arange(15).reshape(3, 5)
print(a, a.shape, a.ndim, a.dtype... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "my_sklearn/hello_numpy_scipy.py",
"copies": "1",
"size": "3794",
"license": "mit",
"hash": -8632388400278274000,
"line_mean": 23.8933333333,
"line_max": 80,
"alpha_frac": 0.5281199786,
"autogenerated": false,
"ratio": 2.536684782608696,
"c... |
__author__ = 'erwin'
#coding=utf-8
import codecs
import jieba
import jieba.posseg as pseg
import sys
sys.path.append('..')
import mass_dict
mass_dict = mass_dict.Dict(lazy_load=False)
class FlagObj:
def __init__(self, flag):
self.flag = flag
self.lines = []
def put(self, line):
self... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "bow/extract_keyword.py",
"copies": "1",
"size": "6834",
"license": "mit",
"hash": -3948919107138818600,
"line_mean": 27.3609958506,
"line_max": 113,
"alpha_frac": 0.4808311384,
"autogenerated": false,
"ratio": 3.1464088397790055,
"config_t... |
__author__ = 'erwin'
#coding=utf-8
import codecs
import math
import sys
import pickle
import jieba
import jieba.posseg as pseg
import numpy as np
sys.path.append('..')
import mass_dict
mass_dict = mass_dict.Dict(lazy_load=False)
# Ontology
class WordSupport:
def __init__(self, train_set='', test_set=''):
... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "bow/word_support.py",
"copies": "1",
"size": "9866",
"license": "mit",
"hash": -4222671058082159000,
"line_mean": 31.966442953,
"line_max": 113,
"alpha_frac": 0.4618281759,
"autogenerated": false,
"ratio": 3.4146680570038233,
"config_test"... |
__author__ = 'erwin'
#coding=utf-8
import codecs
import urllib2
import re
import threading
import time
import os
import jieba
query_done_set = {}
def cut_line(line):
seg_list = jieba.cut(line, cut_all=False)
return " ".join(seg_list)
def cut_words(src, dst):
fin = codecs.open(src, 'r', 'utf-8')
f... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "bow/comment_download_cut.py",
"copies": "1",
"size": "10195",
"license": "mit",
"hash": 2744139364015461400,
"line_mean": 38.26,
"line_max": 955,
"alpha_frac": 0.5551706572,
"autogenerated": false,
"ratio": 2.715076071922545,
"config_test"... |
__author__ = 'erwin'
#coding=utf-8
import gensim
import codecs
import jieba
import logging
import sys
sys.path.append('..')
import mass_dict
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
mass_dict = mass_dict.Dict(lazy_load=False)
def load_word_attr(path_name):
fin =... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "hello/hallo_lda.py",
"copies": "1",
"size": "3073",
"license": "mit",
"hash": -7449550141488851000,
"line_mean": 28.2330097087,
"line_max": 98,
"alpha_frac": 0.605778811,
"autogenerated": false,
"ratio": 2.840566037735849,
"config_test": f... |
__author__ = 'erwin'
#coding=utf-8
import jieba
from gensim.models import word2vec
import numpy
import codecs
import os
def test_load_model():
model = word2vec.Word2Vec.load_word2vec_format('/Users/erwin/svn/word2vec/vectors_text8.bin', binary=True)
# find similar relation ship
x = model.most_similar(['s... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "bow/comment_word2vec.py",
"copies": "1",
"size": "7942",
"license": "mit",
"hash": -7563506270023900000,
"line_mean": 32.0173160173,
"line_max": 115,
"alpha_frac": 0.5170469447,
"autogenerated": false,
"ratio": 3.0638810767376454,
"config_... |
__author__ = 'erwin'
#coding=utf-8
import math
'''
@Name: Bag of Word
@Brief: determine emotions.
@Reference: http://blog.csdn.net/lingerlanlan/article/details/38418277
'''
class Dict:
def __init__(self, path):
self.word2index = {}
self.word2count = {}
self.index2word = []
self.lo... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "bow/bow.py",
"copies": "1",
"size": "6277",
"license": "mit",
"hash": -6147259992957310000,
"line_mean": 32.9836065574,
"line_max": 94,
"alpha_frac": 0.5340086831,
"autogenerated": false,
"ratio": 3.089418777943368,
"config_test": false,
... |
__author__ = 'erwin'
#coding=utf-8
import numpy
def my_markou():
'''
马氏链
sum( init_status ) == 1
'''
transfer_matrix = numpy.matrix([[0.65, 0.28, 0.07],
[0.15, 0.67, 0.18],
[0.12, 0.36, 0.52]
... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "hello/markou.py",
"copies": "1",
"size": "1060",
"license": "mit",
"hash": 6796415336307800000,
"line_mean": 27.4864864865,
"line_max": 60,
"alpha_frac": 0.4933586338,
"autogenerated": false,
"ratio": 3.223241590214067,
"config_test": fals... |
__author__ = 'erwin'
#coding=utf-8
import sklearn
from sklearn import datasets
from sklearn.externals.six import StringIO
from sklearn import tree
from sklearn.naive_bayes import GaussianNB
import pydot
def test_bayes():
'''
贝叶斯
'''
iris = datasets.load_iris()
gnb = GaussianNB()
y_pred = gnb.f... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "my_sklearn/hello_sklearn.py",
"copies": "1",
"size": "5144",
"license": "mit",
"hash": 5230083816867436000,
"line_mean": 29.1588235294,
"line_max": 80,
"alpha_frac": 0.6137339056,
"autogenerated": false,
"ratio": 2.863687150837989,
"config... |
__author__ = 'erwin'
#coding=utf-8
import threading
import time
import codecs
class Foo(threading.Thread):
def __init__(self, x):
threading.Thread.__init__(self)
self.x = x
self.setName("thread-%d" % x)
def run(self):
time.sleep(self.x)
print("%s %d" %(self.getName(),... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "bow/hello.py",
"copies": "1",
"size": "1778",
"license": "mit",
"hash": 5117582173614821000,
"line_mean": 24.4,
"line_max": 102,
"alpha_frac": 0.5303712036,
"autogenerated": false,
"ratio": 2.9983136593591904,
"config_test": false,
"has_... |
__author__ = 'erwin'
#encoding=UTF-8
# @desciption: 这个是将json格式的评论单独取出来,只保留最主要的评语
#
import json
import codecs
import os
import chardet
import jieba
import sys
def cut_line(line):
seg_list = jieba.cut(line, cut_all=True)
return " ".join(seg_list)
def get_short_sentences(sentence,
spl... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "bow/comment_parse.py",
"copies": "1",
"size": "7649",
"license": "mit",
"hash": -8784882985328465000,
"line_mean": 32.59375,
"line_max": 117,
"alpha_frac": 0.5083056478,
"autogenerated": false,
"ratio": 3.49025974025974,
"config_test": fal... |
__author__ = 'erwin'
#encoding=utf-8
import os
import weibo
from RedisMiddle import *
APP_KEY = '83693197'
APP_SECRET = 'cb7ce4af015d602aa8e1d2851c597f5c'
CALL_BACK = r'http://www.163.com'
class MyAPIClient(weibo.APIClient):
def __init__(self, app_key, app_secret, redirect_uri=None, response_type='code',
... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "Fetcher.py",
"copies": "1",
"size": "5161",
"license": "mit",
"hash": -3972373974734669300,
"line_mean": 29.1812865497,
"line_max": 96,
"alpha_frac": 0.5650067816,
"autogenerated": false,
"ratio": 3.3382923673997413,
"config_test": false,
... |
__author__ = 'erwin'
#encoding=utf-8
import urllib2
import codecs
import os
import weibo
from comment_label_worm.Commons import *
from RedisMiddle import *
APP_KEY = '83693197'
APP_SECRET = 'cb7ce4af015d602aa8e1d2851c597f5c'
CALL_BACK = r'http://www.163.com'
class Worm:
def __init__(self, redis_middle, weibo... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "crawler.py",
"copies": "1",
"size": "11802",
"license": "mit",
"hash": 8161513680839968000,
"line_mean": 31.8100558659,
"line_max": 143,
"alpha_frac": 0.528435212,
"autogenerated": false,
"ratio": 3.380143884892086,
"config_test": false,
... |
__author__ = 'erwin'
#coding=utf-8
import numpy as np
from scipy.linalg import svd
import matplotlib.pyplot as plt
titles =[
"The Neatest Little Guide to Stock Market Investing",
"Investing For Dummies, 4th Edition",
"The Little Book of Common Sense Investing: The Only Way to Guarantee Your Fair Share of... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "hello/hello_lsi.py",
"copies": "1",
"size": "3016",
"license": "mit",
"hash": -2367546992188072400,
"line_mean": 31.085106383,
"line_max": 120,
"alpha_frac": 0.5736074271,
"autogenerated": false,
"ratio": 3.3325966850828728,
"config_test":... |
__author__ = 'erwin'
import BaseHTTPServer
from comment_label_worm.RedisMiddle import *
redis_saver = RedisMiddle()
class RedisCountHandler(BaseHTTPServer.BaseHTTPRequestHandler):
server_version = "SimpleHTTP/0.6.1"
def do_GET(self):
"""Serve a GET request."""
print("Get: " + self.path)
... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "OnCallServer.py",
"copies": "1",
"size": "1801",
"license": "mit",
"hash": -8295957799592487000,
"line_mean": 27.15625,
"line_max": 88,
"alpha_frac": 0.5952248751,
"autogenerated": false,
"ratio": 3.631048387096774,
"config_test": false,
... |
__author__ = 'erwin'
import graphlab
#sf = graphlab.SFrame(data='http://graphlab.com/files/datasets/freebase_performances.csv')
def pagerank():
sf = graphlab.load_sframe('/users/erwin/work/ml_datasets/freebase_performances.csv')
print sf
g = graphlab.SGraph()
g = g.add_edges(sf, 'actor_name', 'film_n... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "hello/using_graphlab_create.py",
"copies": "1",
"size": "2127",
"license": "mit",
"hash": 871081724129372700,
"line_mean": 31.7230769231,
"line_max": 113,
"alpha_frac": 0.6732487071,
"autogenerated": false,
"ratio": 3.0560344827586206,
"co... |
__author__ = 'erwin'
import os
import jieba
from RedisMiddle import RedisMiddle
from comment_label_worm.Commons import *
class RedisDumper:
'''
dump all rated tweets to files.
'''
def __init__(self):
self.redis_middle = RedisMiddle()
def cut_tweet(self, tweet):
seg_list = jieba... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "RedisDumper.py",
"copies": "1",
"size": "3282",
"license": "mit",
"hash": -5092352584531343000,
"line_mean": 34.6739130435,
"line_max": 100,
"alpha_frac": 0.4853747715,
"autogenerated": false,
"ratio": 3.856639247943596,
"config_test": fal... |
__author__ = 'erwin'
import sys
import os
import Image
def check_like(l, r):
x = int(l) ^ int(r)
c = 0
while x > 0:
c += 1
x = x & (x-1)
if c < 3:
return True
else:
return False
def avhash(im):
if not isinstance(im, Image.Image):
im = Image.open(im)
... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "finger_cluster.py",
"copies": "1",
"size": "1736",
"license": "mit",
"hash": -6907651312849402000,
"line_mean": 23.4507042254,
"line_max": 83,
"alpha_frac": 0.4688940092,
"autogenerated": false,
"ratio": 3.2267657992565058,
"config_test": ... |
__author__ = 'erwin'
import glob
import os
import sys
import Image
EXTS = 'jpg', 'jpeg', 'JPG', 'JPEG', 'gif', 'GIF', 'png', 'PNG'
def avhash(im):
if not isinstance(im, Image.Image):
im = Image.open(im)
im = im.resize((8, 8), Image.ANTIALIAS).convert('L')
avg = reduce(lambda x, y: x + y, im.get... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "imgHash.py",
"copies": "1",
"size": "1581",
"license": "mit",
"hash": 5772668241522264000,
"line_mean": 27.25,
"line_max": 78,
"alpha_frac": 0.4604680582,
"autogenerated": false,
"ratio": 3.075875486381323,
"config_test": false,
"has_no_... |
__author__ = 'erwin'
import math
import numpy
import scipy
from matplotlib import pyplot as plt
import pylab
import os
class MatrixBuilder:
def __init__(self, path, stopword_path):
self.path = path
self.stopword_path = stopword_path
self.stopwords = {}
self.loadStopword()
... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "MyLSA.py",
"copies": "1",
"size": "7363",
"license": "mit",
"hash": -12070460030739392,
"line_mean": 29.9411764706,
"line_max": 114,
"alpha_frac": 0.493413011,
"autogenerated": false,
"ratio": 3.388403129314312,
"config_test": false,
"ha... |
__author__ = 'erwin'
import redis
import time
import datetime
def SorterByTime(pair):
return pair[0]
class RedisMiddle():
def __init__(self, host="localhost", port=6379, db=0):
self.host = host
self.port = port
self.r = redis.Redis(self.host, self.port, db=db)
if self.r is No... | {
"repo_name": "erwin00776/comment_label_worm",
"path": "RedisMiddle.py",
"copies": "1",
"size": "2466",
"license": "mit",
"hash": -1908852044357998800,
"line_mean": 28.3571428571,
"line_max": 93,
"alpha_frac": 0.5145985401,
"autogenerated": false,
"ratio": 3.642540620384047,
"config_test": fals... |
__author__ = 'escherba'
import unittest
import numpy as np
from lsh_hdc.fent import minmaxr
from lsh_hdc.utils import sort_by_length
from lsh_hdc import create_sig_selectors
class TestUtils(unittest.TestCase):
def test_minmaxr_1(self):
arr = [2, 3, 4]
amin, amax = minmaxr(arr)
self.asser... | {
"repo_name": "pombredanne/lsh-hdc",
"path": "tests/test_utils.py",
"copies": "2",
"size": "2052",
"license": "bsd-3-clause",
"hash": 3744247624639944700,
"line_mean": 31.5714285714,
"line_max": 77,
"alpha_frac": 0.5326510721,
"autogenerated": false,
"ratio": 3.6,
"config_test": true,
"has_no... |
__author__ = 'escherba'
"""
Various bitwise operations
"""
import ctypes
import struct
from itertools import izip
from functools import partial
PyLong_AsByteArray = ctypes.pythonapi._PyLong_AsByteArray
PyLong_AsByteArray.argtypes = [ctypes.py_object,
ctypes.c_char_p,
... | {
"repo_name": "Livefyre/pymaptools",
"path": "pymaptools/bitwise.py",
"copies": "1",
"size": "3532",
"license": "mit",
"hash": -4924654799226641000,
"line_mean": 22.7046979866,
"line_max": 64,
"alpha_frac": 0.5719139298,
"autogenerated": false,
"ratio": 3.386385426653883,
"config_test": false,
... |
__author__ = 'eschwarz'
'''
Creates an .xml file containing information for an equalization curve capable of isolating a user defined frequency and its
harmonics. The output file can be imported to Audacity with the "Save/Manage Curves" option under Effect/Equalization in the Audacity toolbar.
'''
import xml.etree.Elem... | {
"repo_name": "eschwarz301/Audacity-Harmonic-Equalizer",
"path": "harmonic_processor.py",
"copies": "1",
"size": "2509",
"license": "mit",
"hash": -8550878108798547000,
"line_mean": 43.8214285714,
"line_max": 142,
"alpha_frac": 0.6042247908,
"autogenerated": false,
"ratio": 3.376850605652759,
"... |
__author__ = 'eschwarz'
'''
Iterates through a unicode file, extracts the Size Drawings necessary to fulfill the Customer Order into a nested list "outputList" while ignoring headers and duplicate drawings.
'''
import codecs
import re
class File_Reader(object):
def __init__(self):
self.line_data = [] # H... | {
"repo_name": "eschwarz301/Order-Form-Data-Extractor",
"path": "JobDrawingConverter.py",
"copies": "1",
"size": "2344",
"license": "mit",
"hash": -9191663322988804000,
"line_mean": 45.88,
"line_max": 225,
"alpha_frac": 0.6322525597,
"autogenerated": false,
"ratio": 3.8426229508196723,
"config_t... |
__author__ = 'Eshin Kunishima'
__license__ = 'MIT'
from abc import *
import random
from neighbor import Neighbor
class Cell(metaclass=ABCMeta):
@abstractmethod
def __str__(self) -> str:
pass
@abstractmethod
def get_next_generation(self, neighbor: Neighbor):
pass
class Wood(Cell):
... | {
"repo_name": "mikoim/funstuff",
"path": "system simulation/2015/cell automaton/forest/cell.py",
"copies": "1",
"size": "1975",
"license": "mit",
"hash": 89661801041988130,
"line_mean": 22.7951807229,
"line_max": 119,
"alpha_frac": 0.5716455696,
"autogenerated": false,
"ratio": 3.5974499089253187... |
__author__ = 'Eshin Kunishima'
__license__ = 'MIT'
from enum import Enum
from copy import deepcopy
from random import randint, random
from field import Field
from neighbor import Neighbor
def clamp(num, min_num, max_num):
return max(min(max_num, num), min_num)
class Season(Enum):
spring = 0
summer = 1... | {
"repo_name": "mikoim/funstuff",
"path": "system simulation/2015/cell automaton/island/island.py",
"copies": "1",
"size": "6412",
"license": "mit",
"hash": -7238368198030552000,
"line_mean": 24.8548387097,
"line_max": 133,
"alpha_frac": 0.5229257642,
"autogenerated": false,
"ratio": 3.27142857142... |
__author__ = 'Eshin Kunishima'
__license__ = 'MIT'
from PIL import Image
from forest import Forest
wood = Image.open('tile/wood.png')
bamboo = Image.open('tile/bamboo.png')
fire = Image.open('tile/fire.png')
soil = Image.open('tile/soil.png')
pool = Image.open('tile/pool.png')
road = Image.open('tile/road.png')
moun... | {
"repo_name": "mikoim/funstuff",
"path": "system simulation/2015/cell automaton/forest/bmp.py",
"copies": "2",
"size": "1356",
"license": "mit",
"hash": -6752423153681245000,
"line_mean": 27.25,
"line_max": 75,
"alpha_frac": 0.5095870206,
"autogenerated": false,
"ratio": 2.960698689956332,
"con... |
__author__ = 'Eshin Kunishima'
__license__ = 'MIT'
import re
import urllib.request
import urllib.parse
import math
import sys
import argparse
import importlib
from bs4 import BeautifulSoup
base_url = 'http://www.photo-ac.com'
regex = re.compile('/main/detail_pop/\?p_id=(\d+)&f=(.+?)&.+')
def get_best_parser():
... | {
"repo_name": "mikoim/photoac-dl",
"path": "photoac-dl.py",
"copies": "1",
"size": "1768",
"license": "mit",
"hash": 5545689338332247000,
"line_mean": 27.0634920635,
"line_max": 116,
"alpha_frac": 0.5950226244,
"autogenerated": false,
"ratio": 3.268022181146026,
"config_test": false,
"has_no_... |
__author__ = 'Eshin Kunishima'
__license__ = 'MIT'
import sys
from field import Field
from cell import *
class Forest:
def __init__(self, x=0, y=0):
self.x = 0
self.y = 0
self.__field = None
self.__convert_table = None
self.reset(x, y)
def reset(self, x: int, y: in... | {
"repo_name": "mikoim/funstuff",
"path": "system simulation/2015/cell automaton/forest/forest.py",
"copies": "1",
"size": "1821",
"license": "mit",
"hash": -4027588127646931000,
"line_mean": 23.9452054795,
"line_max": 103,
"alpha_frac": 0.4678747941,
"autogenerated": false,
"ratio": 3.44234404536... |
__author__ = 'Eshin Kunishima'
__license__ = 'MIT'
import unittest
import random
from field import Field
from neighbor import Neighbor
class FieldTests(unittest.TestCase):
def setUp(self):
self.__x = random.randint(2, 128)
self.__y = random.randint(2, 128)
self.__field = Field(self.__y, ... | {
"repo_name": "mikoim/funstuff",
"path": "system simulation/2015/cell automaton/forest/tests.py",
"copies": "1",
"size": "2607",
"license": "mit",
"hash": -4711444299634706000,
"line_mean": 29.6705882353,
"line_max": 65,
"alpha_frac": 0.5891829689,
"autogenerated": false,
"ratio": 3.3337595907928... |
''' author@esilgard '''
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | {
"repo_name": "esilgard/BreastMR",
"path": "nlp_engine.py",
"copies": "3",
"size": "6574",
"license": "apache-2.0",
"hash": -5813246831951573000,
"line_mean": 42.5364238411,
"line_max": 117,
"alpha_frac": 0.6717371463,
"autogenerated": false,
"ratio": 3.5728260869565216,
"config_test": false,
... |
'''author@esilgard'''
#
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
from fhcrc_pathology.OneFieldPerSpecimen import OneFieldPerSpecimen
import global_strings as gb
class MalignantFinding(OneFieldPerSp... | {
"repo_name": "esilgard/BreastMR",
"path": "fhcrc_pathology/breast/MalignantFinding.py",
"copies": "1",
"size": "1177",
"license": "apache-2.0",
"hash": 8954813886525287000,
"line_mean": 41.0714285714,
"line_max": 92,
"alpha_frac": 0.6796941376,
"autogenerated": false,
"ratio": 3.5029761904761907... |
'''author@esilgard'''
#
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
from ..OneFieldPerReport import OneFieldPerReport
import global_strings as gb
class CellularityPercent(OneFieldPerReport):
''' e... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_pathology/heme/CellularityPercent.py",
"copies": "2",
"size": "1100",
"license": "apache-2.0",
"hash": -2717158707081569000,
"line_mean": 38.2857142857,
"line_max": 170,
"alpha_frac": 0.6127272727,
"autogenerated": false,
"ratio": 3.0898876404494... |
'''author@esilgard'''
#
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
from .OneFieldPerReportML import OneFieldPerReportML
from . import global_strings as gb
from sklearn.externals import joblib
import o... | {
"repo_name": "esilgard/BreastMR",
"path": "fhcrc_pathology/Her2FISH.py",
"copies": "1",
"size": "1574",
"license": "apache-2.0",
"hash": 6256486669525210000,
"line_mean": 46.696969697,
"line_max": 127,
"alpha_frac": 0.5902160102,
"autogenerated": false,
"ratio": 3.123015873015873,
"config_test... |
'''author@esilgard'''
#
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
from OneFieldPerSpecimen import OneFieldPerSpecimen
import global_strings as gb
class OtherFinding(OneFieldPerSpecimen):
''' ext... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_pathology/OtherFinding.py",
"copies": "2",
"size": "1054",
"license": "apache-2.0",
"hash": -4030688877124878300,
"line_mean": 39.5384615385,
"line_max": 92,
"alpha_frac": 0.6859582543,
"autogenerated": false,
"ratio": 3.36741214057508,
"config... |
'''author@esilgard'''
#
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
from SecondaryField import SecondaryField
class PathGrade(SecondaryField):
''' extract the pathological grade based on a specifi... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_pathology/PathGrade.py",
"copies": "2",
"size": "1900",
"license": "apache-2.0",
"hash": -6742831016844475000,
"line_mean": 53.2857142857,
"line_max": 111,
"alpha_frac": 0.4836842105,
"autogenerated": false,
"ratio": 3.4111310592459607,
"config... |
'''author@esilgard'''
#
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
import re
import global_strings as gb
import numpy as np
from scipy.sparse import dok_matrix
class OneFieldPerReportML(object):
... | {
"repo_name": "esilgard/BreastMR",
"path": "fhcrc_pathology/OneFieldPerReportML.py",
"copies": "3",
"size": "4822",
"license": "apache-2.0",
"hash": 3950437972465756700,
"line_mean": 44.9238095238,
"line_max": 109,
"alpha_frac": 0.5008295313,
"autogenerated": false,
"ratio": 4.1785095320623915,
... |
''' author@esilgard'''
#
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
import re, os
import global_strings as gb
PATH = os.path.dirname(os.path.realpath(__file__)) + os.path.sep
class OneFieldPerSpecime... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_pathology/OneFieldPerSpecimen.py",
"copies": "2",
"size": "12006",
"license": "apache-2.0",
"hash": -3260488331051261000,
"line_mean": 55.6320754717,
"line_max": 112,
"alpha_frac": 0.5614692654,
"autogenerated": false,
"ratio": 4.042424242424242,... |
'''author@esilgard'''
#
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
__version__ = 'output_results1.0'
import json, sys
def main(output_file_name, output):
'''
output warnings and results in js... | {
"repo_name": "esilgard/BreastMR",
"path": "output_results.py",
"copies": "3",
"size": "1105",
"license": "apache-2.0",
"hash": -55677986227339630,
"line_mean": 39.9259259259,
"line_max": 95,
"alpha_frac": 0.6325791855,
"autogenerated": false,
"ratio": 3.611111111111111,
"config_test": false,
... |
'''author@esilgard'''
#
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_pathology/final_logic.py",
"copies": "2",
"size": "2144",
"license": "apache-2.0",
"hash": 2645446376912342000,
"line_mean": 41.88,
"line_max": 97,
"alpha_frac": 0.6632462687,
"autogenerated": false,
"ratio": 4.22879684418146,
"config_test": fa... |
''' author @ esilgard '''
#
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | {
"repo_name": "esilgard/BreastMR",
"path": "fhcrc_pathology/parser.py",
"copies": "1",
"size": "8438",
"license": "apache-2.0",
"hash": 2483757984981635000,
"line_mean": 58.4225352113,
"line_max": 136,
"alpha_frac": 0.4700165916,
"autogenerated": false,
"ratio": 4.084220716360116,
"config_test"... |
'''author@esilgard'''
#
# Copyright (c) 2013-2017 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
from fhcrc_pathology.SecondaryField import SecondaryField
class PathGrade(SecondaryField):
''' extract the pathological grade ba... | {
"repo_name": "esilgard/BreastMR",
"path": "fhcrc_pathology/PathGrade.py",
"copies": "1",
"size": "1917",
"license": "apache-2.0",
"hash": -1710721369732395000,
"line_mean": 53.7714285714,
"line_max": 111,
"alpha_frac": 0.487219614,
"autogenerated": false,
"ratio": 3.4049733570159857,
"config_t... |
'''author@esilgard'''
#
# Copyright (c) 2013-2017 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
from OneFieldPerSpecimen import OneFieldPerSpecimen
import global_strings as gb
class PathFindingSide(OneFieldPerSpecimen):
''' ... | {
"repo_name": "esilgard/BreastMR",
"path": "fhcrc_pathology/PathFindingSide.py",
"copies": "1",
"size": "1381",
"license": "apache-2.0",
"hash": -4692803458403216000,
"line_mean": 39.6176470588,
"line_max": 92,
"alpha_frac": 0.6618392469,
"autogenerated": false,
"ratio": 3.55012853470437,
"conf... |
''' author@esilgard'''
#
# Copyright (c) 2013-2017 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
import re, os
import global_strings as gb
PATH = os.path.dirname(os.path.realpath(__file__)) + os.path.sep
class OneFieldPerSpecime... | {
"repo_name": "esilgard/BreastMR",
"path": "fhcrc_pathology/OneFieldPerSpecimen.py",
"copies": "1",
"size": "8080",
"license": "apache-2.0",
"hash": -1083104466485269900,
"line_mean": 50.4649681529,
"line_max": 112,
"alpha_frac": 0.5683168317,
"autogenerated": false,
"ratio": 4.058262179809141,
... |
'''author@esilgard'''
#
# Copyright (c) 2013-2017 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | {
"repo_name": "esilgard/BreastMR",
"path": "fhcrc_pathology/final_logic.py",
"copies": "1",
"size": "3088",
"license": "apache-2.0",
"hash": -4165527448705190400,
"line_mean": 42.4929577465,
"line_max": 122,
"alpha_frac": 0.5974740933,
"autogenerated": false,
"ratio": 3.908860759493671,
"config... |
''' author @ esilgard '''
#
# Copyright (c) 2014-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_pathology/make_datetime.py",
"copies": "3",
"size": "1401",
"license": "apache-2.0",
"hash": 2013924417498127000,
"line_mean": 34.9230769231,
"line_max": 87,
"alpha_frac": 0.6423982869,
"autogenerated": false,
"ratio": 3.736,
"config_test": fal... |
'''author@esilgard'''
#
# Copyright (c) 2014-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | {
"repo_name": "esilgard/BreastMR",
"path": "fhcrc_pathology/process.py",
"copies": "1",
"size": "9137",
"license": "apache-2.0",
"hash": 287803466916871460,
"line_mean": 54.0421686747,
"line_max": 146,
"alpha_frac": 0.5665973514,
"autogenerated": false,
"ratio": 3.8294216261525564,
"config_test... |
'''author@esilgard'''
#
# Copyright (c) 2015-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
import re
import global_strings as gb
__version__ = 'iscn_string_cleaner1.0'
def get(original_text, karyo_offset):
'''
clean... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_cytogenetics/iscn_string_cleaner.py",
"copies": "2",
"size": "3184",
"license": "apache-2.0",
"hash": -6028124887630370000,
"line_mean": 42.6164383562,
"line_max": 112,
"alpha_frac": 0.6293969849,
"autogenerated": false,
"ratio": 3.40170940170940... |
'''author@esilgard'''
#
# Copyright (c) 2015-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
from OneFieldPerReport import OneFieldPerReport
import global_strings as gb
class PathQuality(OneFieldPerReport):
''' determine ... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_pathology/PathQuality.py",
"copies": "2",
"size": "1140",
"license": "apache-2.0",
"hash": 8714116528613921000,
"line_mean": 44.6,
"line_max": 98,
"alpha_frac": 0.6605263158,
"autogenerated": false,
"ratio": 3.6893203883495147,
"config_test": f... |
'''author@esilgard'''
#
# Copyright (c) 2015-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
import global_strings as gb
import aml_swog_classification
import eln_classification
import dri_classification
import re
__version__... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_cytogenetics/heme/parse_mutations.py",
"copies": "1",
"size": "14761",
"license": "apache-2.0",
"hash": -2721720468042809300,
"line_mean": 61.8127659574,
"line_max": 170,
"alpha_frac": 0.4359460741,
"autogenerated": false,
"ratio": 4.744776599164... |
'''author@esilgard'''
#
# Copyright (c) 2015-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
import re, os
import global_strings as gb
PATH = os.path.dirname(os.path.realpath(__file__)) + os.path.sep
class SecondaryField(obje... | {
"repo_name": "LabKey/argos_nlp",
"path": "fhcrc_pathology/SecondaryField.py",
"copies": "2",
"size": "3282",
"license": "apache-2.0",
"hash": 457100981656886600,
"line_mean": 44.5833333333,
"line_max": 98,
"alpha_frac": 0.5499695308,
"autogenerated": false,
"ratio": 4.393574297188755,
"config_... |
'''author@esilgard'''
#
# Copyright (c) 2015-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_cytogenetics/process.py",
"copies": "2",
"size": "10770",
"license": "apache-2.0",
"hash": 3425069008134630000,
"line_mean": 50.7788461538,
"line_max": 117,
"alpha_frac": 0.5508820799,
"autogenerated": false,
"ratio": 4.064150943396227,
"config... |
'''author@esilgard'''
#
# Copyright (c) 2015-2017 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
import re
import global_strings as gb
__version__ = 'iscn_parser1.0'
def get(karyotype_string, karyo_offset):
'''
parse ISCN ... | {
"repo_name": "esilgard/argos_nlp",
"path": "fhcrc_cytogenetics/iscn_parser.py",
"copies": "1",
"size": "7158",
"license": "apache-2.0",
"hash": -6478474925722642000,
"line_mean": 53.641221374,
"line_max": 142,
"alpha_frac": 0.5044705225,
"autogenerated": false,
"ratio": 3.8135322322855623,
"co... |
'''author@esilgard'''
#
# Copyright (c) 2015-2017 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
import re, os
import global_strings as gb
PATH = os.path.dirname(os.path.realpath(__file__)) + os.path.sep
class SecondaryField(obje... | {
"repo_name": "esilgard/BreastMR",
"path": "fhcrc_pathology/SecondaryField.py",
"copies": "1",
"size": "3287",
"license": "apache-2.0",
"hash": 4391367172696571000,
"line_mean": 44.6527777778,
"line_max": 98,
"alpha_frac": 0.5500456343,
"autogenerated": false,
"ratio": 4.3885180240320425,
"conf... |
__author__ = 'eso'
from tools.petscan import PetScan
watch_themes = ['Allgemeines, Informations-, Buch- und Bibliothekswesen',
'Archäologie',
'Astronomie',
'Bauwesen',
'Bergbau',
'Biologie',
'Chemie',
'Geog... | {
"repo_name": "the-it/WS_THEbotIT",
"path": "archive/offline/watchlist_crawler/watchlist_crawler.py",
"copies": "1",
"size": "4033",
"license": "mit",
"hash": 997206092336310000,
"line_mean": 46.4352941176,
"line_max": 408,
"alpha_frac": 0.6111111111,
"autogenerated": false,
"ratio": 2.9430656934... |
__author__ = 'espin'
#######################################################################################
### Dependences
### Reference:
### http://fa.bianp.net/blog/2013/different-ways-to-get-memory-consumption-or-lessons-learned-from-memory_profiler/
###############################################################... | {
"repo_name": "lisette-espin/mrqap",
"path": "libs/profiling.py",
"copies": "1",
"size": "4473",
"license": "cc0-1.0",
"hash": -8297463509606056000,
"line_mean": 38.2368421053,
"line_max": 115,
"alpha_frac": 0.5510842835,
"autogenerated": false,
"ratio": 3.7462311557788945,
"config_test": false... |
__author__ = 'espin'
#######################################################################
# Dependencies
#######################################################################
import sys
import collections
import numpy as np
import pandas
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from... | {
"repo_name": "lisette-espin/mrqap",
"path": "libs/mrqap.py",
"copies": "1",
"size": "11208",
"license": "cc0-1.0",
"hash": -841634498972020200,
"line_mean": 36.8648648649,
"line_max": 223,
"alpha_frac": 0.4953604568,
"autogenerated": false,
"ratio": 3.8768592182635766,
"config_test": true,
"... |
import arcpy
import math
import os
# Input features
in_features = arcpy.GetParameterAsText(0)
# Output features
out_features = arcpy.GetParameterAsText(1)
# Optional input group strategy
group_option = arcpy.GetParameterAsText(2)
# Fields used by group strategy
group_fields = arcpy.GetParameterAsText(3)
# Fishnet... | {
"repo_name": "jfrygeo/solutions-geoprocessing-toolbox",
"path": "capability/toolboxes/scripts/MinimumBoundingFishnet.py",
"copies": "2",
"size": "4858",
"license": "apache-2.0",
"hash": 5378984681125937000,
"line_mean": 44.4018691589,
"line_max": 187,
"alpha_frac": 0.6846438864,
"autogenerated": f... |
__author__ = 'Esteban'
import os
"""
Influx db
"""
INFLUX_DB_SERVER = os.getenv("DOMUS_INFLUX_DB_SERVER", "localhost").rstrip()
INFLUX_DB_PORT = os.getenv("DOMUS_INFLUX_DB_PORT", 8086)
INFLUX_DB_USER = os.getenv("DOMUS_INFLUX_DB_USER", "user").rstrip()
INFLUX_DB_PASSWORD = os.getenv("DOMUS_INFLUX_DB_PASSWORD", ... | {
"repo_name": "Esiravegna/domus",
"path": "domus/utils/config.py",
"copies": "1",
"size": "1172",
"license": "apache-2.0",
"hash": 6286644956598176000,
"line_mean": 33.5757575758,
"line_max": 86,
"alpha_frac": 0.6783276451,
"autogenerated": false,
"ratio": 2.4989339019189765,
"config_test": fal... |
__author__ = 'esteele'
import os
from unipath import Path
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
""" Get the environment variable or return exception """
try:
return os.environ[var_name]
except KeyError:
error_msg = "Set the %s env variable... | {
"repo_name": "edwinsteele/sensorsproject",
"path": "sensorsproject/settings/base.py",
"copies": "1",
"size": "2892",
"license": "cc0-1.0",
"hash": -5713746768708740000,
"line_mean": 24.147826087,
"line_max": 87,
"alpha_frac": 0.6289764869,
"autogenerated": false,
"ratio": 3.637735849056604,
"c... |
__author__ = 'esteele'
import socket
import conf
from phue import Bridge, PhueRegistrationException, PhueRequestTimeout
from pushover import Client
GREEN = 20389
RED = 65535
LIGHT_SET_OK = 1
LIGHT_SET_FAILED_BRIDGE_COMMS = 2
LIGHT_SET_FAILED_NOT_REGISTERED = 3
def send_pushover_notification(message, title):
cli... | {
"repo_name": "edwinsteele/notifications",
"path": "notifier.py",
"copies": "1",
"size": "1158",
"license": "cc0-1.0",
"hash": -8749334670648653000,
"line_mean": 29.5,
"line_max": 74,
"alpha_frac": 0.6986183074,
"autogenerated": false,
"ratio": 2.992248062015504,
"config_test": false,
"has_no... |
__author__ = 'esteele'
import transxchange_constants
MULTI_TRIP_LINE_ID = -1
MULTI_TRIP_TRIP_ID = -1
INTERCHANGE_TRIP_LINE_ID = -2
INTERCHANGE_TRIP_TRIP_ID = -2
class AbstractTrip(object):
"""
Need to make this an old-skool abstract class/mixin as it seems one can't
mix abc Abstract classes with Django ... | {
"repo_name": "edwinsteele/visual-commute",
"path": "vcapp/trip_helpers.py",
"copies": "1",
"size": "3198",
"license": "cc0-1.0",
"hash": -4501820891191980000,
"line_mean": 30.0485436893,
"line_max": 79,
"alpha_frac": 0.6203877423,
"autogenerated": false,
"ratio": 3.7712264150943398,
"config_te... |
__author__ = 'esteele'
class SingleForecast(object):
DAILY_FORECAST_TYPE = "D"
HOURLY_FORECAST_TYPE = "H"
def __init__(self, source, forecast_type, start_datetime, end_datetime,
issue_datetime, temperature_min, temperature_max):
self.source = source
if forecast_type in (s... | {
"repo_name": "edwinsteele/weather-analyser",
"path": "models.py",
"copies": "1",
"size": "1488",
"license": "cc0-1.0",
"hash": 5517654486053453000,
"line_mean": 36.225,
"line_max": 78,
"alpha_frac": 0.6135752688,
"autogenerated": false,
"ratio": 3.9574468085106385,
"config_test": false,
"has... |
__author__ = 'e_tak_000'
# The work is based over Niklas Rosenstein's myo-python
import myo as libmyo; libmyo.init()
import time
import os
import sys
import math
class Listener(libmyo.DeviceListener):
def on_connect(self, myo, timestamp):
print("Hello, Myo!")
myo.vibrate('short')
myo.vib... | {
"repo_name": "wearhacks/courses",
"path": "projects/asl-to-speech/src/MyoToWords.py",
"copies": "1",
"size": "9382",
"license": "mit",
"hash": -1244541702372225800,
"line_mean": 31.1335616438,
"line_max": 150,
"alpha_frac": 0.6230014922,
"autogenerated": false,
"ratio": 3.7363600159299084,
"co... |
import sys, os
def main():
if len(sys.argv) != 4:
print "Incorrect usage:\nTLP.py [trace file] [app name] [is background idle?]"
exit()
if not os.path.exists(sys.argv[1]):
print "Invalid file specified: "+sys.argv[1]
exit()
slices = readTimeSlices(sys.arg... | {
"repo_name": "benjaminy/ThreadMeasurement",
"path": "TLP_iOS.py",
"copies": "1",
"size": "4791",
"license": "mit",
"hash": -1938273759904930800,
"line_mean": 26.3771428571,
"line_max": 97,
"alpha_frac": 0.5431016489,
"autogenerated": false,
"ratio": 3.722610722610723,
"config_test": false,
"... |
__author__ = 'Ethan Busbee'
# CharNeuron is intended to take in a character,
# mutate it by connecting with other CharNeurons,
# and then output a new character.
# Mutations can currently only involve translations forward or backward in the alphabet.
from Letter import Letter
class CharNeuron:
def __init__(sel... | {
"repo_name": "Marfle-Bark/n2",
"path": "CharNeuron.py",
"copies": "1",
"size": "1952",
"license": "mit",
"hash": 4079380978722536000,
"line_mean": 21.9764705882,
"line_max": 108,
"alpha_frac": 0.5911885246,
"autogenerated": false,
"ratio": 3.6417910447761193,
"config_test": false,
"has_no_ke... |
__author__ = 'Ethan Busbee'
class Currency(object):
def __init__(self, amount=None):
self._uDollars = 0 # Number of micro-USD (for precision)
if type(amount) is type(self):
self._uDollars = amount.getExactAmount()
elif amount is not None:
self._uDollars = int(round(a... | {
"repo_name": "Marfle-Bark/marfle-bucks",
"path": "Currency.py",
"copies": "1",
"size": "3592",
"license": "mit",
"hash": -7195281168892915000,
"line_mean": 39.3707865169,
"line_max": 115,
"alpha_frac": 0.6135857461,
"autogenerated": false,
"ratio": 3.247739602169982,
"config_test": false,
"h... |
__author__ = 'Ethan Busbee'
from CharNeuron import CharNeuron
import random
class CNLayer:
def __init__(self, input = None):
self._neurons = []
if input is None:
input = ""
self._input = input
self._output = ""
if self._input is not "":
self.setup... | {
"repo_name": "Marfle-Bark/n2",
"path": "CNLayer.py",
"copies": "1",
"size": "1918",
"license": "mit",
"hash": 345714252577214500,
"line_mean": 23.6025641026,
"line_max": 80,
"alpha_frac": 0.5333680918,
"autogenerated": false,
"ratio": 3.667304015296367,
"config_test": false,
"has_no_keywords... |
__author__ = 'Ethan Busbee'
# Letter is intended to represent a single char in the alpha_output and to facilitate integer-based translations through
# the alpha_output. It is only going to deal with all-lower or all-upper letters: it'll internally use uppercase letters.
alpha_output = {0:'A',1:'B',2:'C',3:'D',4:'E',5... | {
"repo_name": "Marfle-Bark/n2",
"path": "Letter.py",
"copies": "1",
"size": "2190",
"license": "mit",
"hash": -7348697072084939000,
"line_mean": 30.2857142857,
"line_max": 121,
"alpha_frac": 0.4858447489,
"autogenerated": false,
"ratio": 2.6417370325693605,
"config_test": false,
"has_no_keywo... |
__author__ = 'Ethan D. Hann'
import math
print("Is your number a perfect square?! Find out now!")
print("Or you can square a number!")
#Setting up while loop with loop-controlled variable
x = 1
while x > 0:
#Get input from user
op = input("q -> quit program \n" \
"c -> checks a number \n"... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578931_Perfect_Square_Checker/recipe-578931.py",
"copies": "1",
"size": "1595",
"license": "mit",
"hash": 4735453636982780000,
"line_mean": 36.880952381,
"line_max": 122,
"alpha_frac": 0.4833438089,
"autogenerated": false,
"ratio": 3.87104... |
__author__ = 'ethan'
import re
import os.path
import cStringIO
import cProfile
import glob
def iter_file_lines(fp):
assert os.path.isfile(fp)
with open(fp, 'r') as fd:
for line in fd:
yield line
def iter_str_lines(s1):
assert isinstance(s1, str)
for line in s1.splitlines():
... | {
"repo_name": "iJunkie22/Ardis-Builder",
"path": "ardisBuilder/fileutils.py",
"copies": "1",
"size": "5555",
"license": "artistic-2.0",
"hash": -1180077059725710600,
"line_mean": 30.5625,
"line_max": 119,
"alpha_frac": 0.5501350135,
"autogenerated": false,
"ratio": 3.370752427184466,
"config_te... |
_author_ = "Ethan Richards"
# CIS 125
#piggetty
# piggetty.py
#Converts words from a file to pig latin and puts them into a new file.
vowels = "aeiouAEIOU"
#create a function that pigifies each word.
def pigify(word):
n = 0
endWord =""
for letter in word:
if letter in vowels:
if n == 0:
... | {
"repo_name": "ethan-richards/Week-Four-Assignment",
"path": "piggetty.py",
"copies": "1",
"size": "1458",
"license": "mit",
"hash": 1967421276977816600,
"line_mean": 17.012345679,
"line_max": 72,
"alpha_frac": 0.6076817558,
"autogenerated": false,
"ratio": 3.0311850311850312,
"config_test": fa... |
from matgen import *
import random
import numpy
def test_symmetricPositiveDefinite():
for i in range(10):
print(".", end="", flush=True)
size = random.randint(400, 500)
maxVal = random.randint(0, 1000)
M = symmetricPositiveDefinite(size, maxVal)
if not (isSymmetric(M) and i... | {
"repo_name": "ethiery/heat-solver",
"path": "trunk/test_matgen.py",
"copies": "1",
"size": "1289",
"license": "mit",
"hash": -8630651532162648000,
"line_mean": 30.4390243902,
"line_max": 97,
"alpha_frac": 0.6229635376,
"autogenerated": false,
"ratio": 3.630985915492958,
"config_test": true,
... |
__author__ = 'etosch'
import json
import unittest
import re
import surveyman.jsonValidator as validator
import surveyman.examples.SimpleSurvey as simple
import surveyman.examples.example_survey as example
import surveyman.examples.subblock_example as sub
import surveyman.survey.questions as questions
import surveyman.... | {
"repo_name": "SurveyMan/SMPy",
"path": "surveyman/test/SurveyTests.py",
"copies": "1",
"size": "8513",
"license": "apache-2.0",
"hash": -3605677717905287700,
"line_mean": 43.5759162304,
"line_max": 123,
"alpha_frac": 0.6642781628,
"autogenerated": false,
"ratio": 3.413392141138733,
"config_tes... |
__author__ = 'Eugene'
from model.contact import Contact
from random import randrange
def test_delete_contact(app):
contact = Contact(first_name="Eugene", last_name="Kuznetsov", nickname="eugene_smith",
title="LLC", company_name="Lazada", address="Moscow, Presnenskaya, 10",
... | {
"repo_name": "eugene1smith/python_training",
"path": "test/test_del_contact.py",
"copies": "1",
"size": "1229",
"license": "apache-2.0",
"hash": -8761067786996120000,
"line_mean": 52.4347826087,
"line_max": 126,
"alpha_frac": 0.5874694874,
"autogenerated": false,
"ratio": 3.7018072289156625,
"... |
__author__ = 'Eugene'
from model.contact import Contact
class ContactHelper:
def __init__(self, app):
self.contact = app
def init_contact_creation(self):
wd = self.contact.wd
wd.find_element_by_link_text("add new").click()
def submit_contact_creation(self):
wd = self.con... | {
"repo_name": "eugene1smith/python_training",
"path": "fixture/contact.py",
"copies": "1",
"size": "11266",
"license": "apache-2.0",
"hash": 4097672979163545000,
"line_mean": 46.5358649789,
"line_max": 104,
"alpha_frac": 0.6072252796,
"autogenerated": false,
"ratio": 3.338074074074074,
"config_... |
__author__ = 'Eugene'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link... | {
"repo_name": "eugene1smith/python_training",
"path": "fixture/group.py",
"copies": "1",
"size": "3143",
"license": "apache-2.0",
"hash": -2947701231430572000,
"line_mean": 31.4020618557,
"line_max": 100,
"alpha_frac": 0.5908367801,
"autogenerated": false,
"ratio": 3.461453744493392,
"config_te... |
__author__ = 'Eugene'
from sys import maxsize
class Contact:
def __init__(self, first_name=None, last_name=None, nickname=None, title=None, company_name=None, address=None, home=None, mobile=None,
work=None, fax=None, first=None, second=None, third=None, homepage=None, birth_year=None, an_year=No... | {
"repo_name": "eugene1smith/python_training",
"path": "model/contact.py",
"copies": "1",
"size": "1409",
"license": "apache-2.0",
"hash": -3825136841553440000,
"line_mean": 33.3902439024,
"line_max": 181,
"alpha_frac": 0.5997161107,
"autogenerated": false,
"ratio": 3.5852417302798982,
"config_t... |
__author__ = 'Eugene'
class ContactHelper:
def __init__(self, app):
self.contact = app
def init_contact_creation(self):
wd = self.contact.wd
wd.find_element_by_link_text("add new").click()
def submit_contact_creation(self):
wd = self.contact.wd
wd.find_element_by... | {
"repo_name": "eugene1smith/homeworks",
"path": "fixture/contact.py",
"copies": "1",
"size": "10020",
"license": "apache-2.0",
"hash": -7388128560587826000,
"line_mean": 46.4881516588,
"line_max": 104,
"alpha_frac": 0.6066866267,
"autogenerated": false,
"ratio": 3.3058396568789177,
"config_test... |
__author__ = 'Eugene'
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("groups").click()
d... | {
"repo_name": "eugene1smith/homeworks",
"path": "fixture/group.py",
"copies": "1",
"size": "2209",
"license": "apache-2.0",
"hash": -5798964578526360000,
"line_mean": 29.2602739726,
"line_max": 100,
"alpha_frac": 0.5894069715,
"autogenerated": false,
"ratio": 3.4248062015503877,
"config_test": ... |
__author__ = 'Eugene'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_b... | {
"repo_name": "eugene1smith/homeworks",
"path": "fixture/session.py",
"copies": "2",
"size": "1342",
"license": "apache-2.0",
"hash": 2997819130561228300,
"line_mean": 26.387755102,
"line_max": 87,
"alpha_frac": 0.5588673621,
"autogenerated": false,
"ratio": 3.380352644836272,
"config_test": fa... |
__author__ = 'Eugene'
from model.contact import Contact
from random import randrange
def test_mod_contact(app):
if app.contact.count() == 0:
app.contact.create_contact(Contact(first_name="Eugene", last_name="Kuznetsov", nickname="eugene_smith",
title="LLC", company_nam... | {
"repo_name": "eugene1smith/python_training",
"path": "test/test_mod_contact.py",
"copies": "1",
"size": "2017",
"license": "apache-2.0",
"hash": 5764427674570422000,
"line_mean": 66.2333333333,
"line_max": 126,
"alpha_frac": 0.5686663361,
"autogenerated": false,
"ratio": 3.7771535580524342,
"c... |
__author__ = 'Eugene'
from model.contact import Contact
def test_mod_contact(app):
if app.contact.count() == 0:
app.contact.create_contact(Contact(first_name="Eugene", last_name="Kuznetsov", nickname="eugene_smith",
title="LLC", company_name="Lazada", address="Moscow,... | {
"repo_name": "eugene1smith/homeworks",
"path": "test/test_mod_contact.py",
"copies": "1",
"size": "1581",
"license": "apache-2.0",
"hash": 8682436059014416000,
"line_mean": 70.9090909091,
"line_max": 126,
"alpha_frac": 0.5306767868,
"autogenerated": false,
"ratio": 3.923076923076923,
"config_t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.