text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'keyz'
from tornado import gen, web, ioloop
from tornado.web import asynchronous
from tornado.httpserver import HTTPServer
from tornado.concurrent import Future, return_future
import tasks
from utils import try_fetch_tile
from config import DEBUG
class TileHandler(web.RequestHandler):
'''
Checks... | {
"repo_name": "keyz182/Pyler",
"path": "pyler.py",
"copies": "1",
"size": "1922",
"license": "mit",
"hash": -8289111405431028000,
"line_mean": 26.4571428571,
"line_max": 89,
"alpha_frac": 0.570239334,
"autogenerated": false,
"ratio": 3.599250936329588,
"config_test": false,
"has_no_keywords":... |
_author__ = 'keyz'
import sys
import psycopg2
import ppygis
import simplejson
from datetime import datetime
import time
from twython import TwythonStreamer
def StreamForever(stream,**kwargs):
if kwargs is None:
return
while True:
try:
stream.statuses.filter(**kwargs)
except ... | {
"repo_name": "keyz182/Postwycker",
"path": "src/Streamer.py",
"copies": "1",
"size": "5707",
"license": "apache-2.0",
"hash": -4450223888914039300,
"line_mean": 38.0890410959,
"line_max": 126,
"alpha_frac": 0.5880497634,
"autogenerated": false,
"ratio": 4.004912280701754,
"config_test": false,... |
__author__ = 'kgeorge'
from PIL import Image
import numpy as np
import os
import fnmatch
import re
import cv2, cv
import math
import time
import random
import hogc
import time
import sklearn.svm as skl
almostEqual = lambda a, b: round(a -b, 1) == 0
def normalizeImage(img):
convertedImg = cv2.cvtColor(img, cv2... | {
"repo_name": "kgeorge/kgeorge-cv",
"path": "samples/hog/run.py",
"copies": "1",
"size": "7159",
"license": "bsd-3-clause",
"hash": -4192087984802237000,
"line_mean": 34.795,
"line_max": 167,
"alpha_frac": 0.5696326303,
"autogenerated": false,
"ratio": 3.204565801253357,
"config_test": false,
... |
__author__ = 'kgeorge'
import re
import cStringIO
import io
from PIL import Image
import urlparse
from io import BytesIO
from cgi import parse_header, parse_multipart
import base64
import os
import json
import cv2
import colorsys
#import yaml
#import simplejson as json
import numpy as np
from optparse import OptionPar... | {
"repo_name": "kgeorge/kgeorge-cv",
"path": "samples/skindetect/learning/learn.py",
"copies": "1",
"size": "16827",
"license": "bsd-3-clause",
"hash": 6827136239371152000,
"line_mean": 38.6863207547,
"line_max": 158,
"alpha_frac": 0.5731859511,
"autogenerated": false,
"ratio": 2.949517966695881,
... |
__author__ = 'kgeorge'
import sys
import re
import cStringIO
import io
from PIL import Image
import urlparse
from io import BytesIO
from cgi import parse_header, parse_multipart
import base64
import os
import json
import cv2
import colorsys
try:
import kg.statsSampler
except:
print 'usage: PYTHONPATH=./python ... | {
"repo_name": "kgeorge/kgeorge-cv",
"path": "samples/skindetect/learning/classify.py",
"copies": "1",
"size": "13237",
"license": "bsd-3-clause",
"hash": 2947490679109993500,
"line_mean": 33.028277635,
"line_max": 214,
"alpha_frac": 0.5564704994,
"autogenerated": false,
"ratio": 3.208191953465826... |
__author__ = 'kgori'
from collections import defaultdict
import numpy as np
import random
import scipy.stats
def entropies(partition_1, partition_2):
""" parameters: partition_1 (list / array) - a partitioning of a dataset
according to some clustering method. Cluster labels are arbitrary.
partition_2 (lis... | {
"repo_name": "kgori/treeCl",
"path": "treeCl/partition.py",
"copies": "1",
"size": "7175",
"license": "mit",
"hash": -969816726247883300,
"line_mean": 34.5198019802,
"line_max": 109,
"alpha_frac": 0.6058536585,
"autogenerated": false,
"ratio": 3.9444749862561848,
"config_test": false,
"has_n... |
__author__ = 'kgulliks'
"""
The purpose of this is to generate a telluric correction for a file, given
best-fit models to A0 standards before and after it. It takes the following
steps:
1: Reads in the model parameters from before and after
2: Finds the time-weighted mean of the atmospheric parameters
3: Adjust... | {
"repo_name": "kgullikson88/IGRINS_Scripts",
"path": "CreateTelluricCorrection.py",
"copies": "1",
"size": "8174",
"license": "mit",
"hash": -2063291851032813800,
"line_mean": 37.0186046512,
"line_max": 116,
"alpha_frac": 0.6121849768,
"autogenerated": false,
"ratio": 3.6952983725135624,
"confi... |
__author__ = 'kguryanov'
import pkgutil
import unittest
import argparse
parser = argparse.ArgumentParser(description='Test modules executor.')
parser.add_argument('--package', metavar='T', type=str, nargs='*', default=['test'],
help="Optional. List of locations for test modules search. Default val... | {
"repo_name": "thenin/AssignmentPython",
"path": "runner.py",
"copies": "1",
"size": "1112",
"license": "mit",
"hash": -4464809005429991400,
"line_mean": 29.8888888889,
"line_max": 104,
"alpha_frac": 0.631294964,
"autogenerated": false,
"ratio": 4.326848249027237,
"config_test": true,
"has_no... |
__author__ = 'khatch'
import quizlib
import pango
import gtk
import random
quiz = quizlib.StartQuiz()
quiz.randomquestion()
#print "answer: " + quiz.answer + " - " + quiz.answers[quiz.answer]
class QuizilerGUI:
builder = gtk.Builder()
def set_answer(self):
#random.shuffle(quiz.answers)
f... | {
"repo_name": "kerryhatcher/quiziler",
"path": "quiziler.py",
"copies": "1",
"size": "2170",
"license": "mit",
"hash": 6375490066850700000,
"line_mean": 25.7901234568,
"line_max": 96,
"alpha_frac": 0.6239631336,
"autogenerated": false,
"ratio": 3.4444444444444446,
"config_test": false,
"has_n... |
__author__ = 'khiem'
import os
import dicom
import numpy as np
import csv
import SimpleITK as sitk
class FileProcess:
def __init__(self):
print 'FileProcess'
#load dicom image
@classmethod
def load_dicom_image(self,path):
if not os.path.exists(path):
raise ... | {
"repo_name": "itcthienkhiem/LungCancerTheor",
"path": "LungCancerDetect/FileProcess.py",
"copies": "1",
"size": "2048",
"license": "apache-2.0",
"hash": 6527683630971692000,
"line_mean": 30,
"line_max": 107,
"alpha_frac": 0.5903320312,
"autogenerated": false,
"ratio": 3.6506238859180034,
"conf... |
__author__ = "Khosrow Ebrahimpour <khosrow.ebrahimpour@gmail.com>"
__version__ = "$Rev: 3 $"
__date__ = "$Date: 2010-10-31 19:05:46 +0400 (Sun, 31 Oct 2010) $"
__copyright__ = "Copyright 2010 Khosorw Ebrahimpour"
import httplib
import mimetypes
import flickr
from xml.dom import minidom
def upload(self,filename, *... | {
"repo_name": "eokeeffe/Image_dataset_grabbers",
"path": "Flickr/flickrUpload.py",
"copies": "2",
"size": "3279",
"license": "mit",
"hash": 2573001745750835000,
"line_mean": 30.8349514563,
"line_max": 104,
"alpha_frac": 0.6538578835,
"autogenerated": false,
"ratio": 3.2659362549800797,
"config_... |
__author__ = 'kian'
import os
import time
from subprocess import Popen
# This file is needed to loop over the different keys and produce their .wav file
# NB This uses the bash command 'sed' !
letters = ['A', 'Ab', 'Ad', 'B', 'C', 'Cd', 'D', 'Dd', 'E', 'F', 'Fd', 'G']
nums = ['2', '3', '4', '5']
moduleNext = None
par =... | {
"repo_name": "madarivi/PianoSimulation",
"path": "renamer.py",
"copies": "1",
"size": "1961",
"license": "mit",
"hash": -552618460042135800,
"line_mean": 37.4705882353,
"line_max": 116,
"alpha_frac": 0.5757266701,
"autogenerated": false,
"ratio": 3.546112115732369,
"config_test": false,
"has... |
__author__ = 'Kiki Rizki Arpiandi'
import numpy as np
import random
import matplotlib.pyplot as plt
class model:
def __init__(self, y):
self.y = y
self.x = np.arange(0, len(self.y), 1)
self.theta0 = random.randrange(-5, 5, 1)
self.theta1 = random.randrange(-5, 5, 1)
def h(self... | {
"repo_name": "kikirizki/linearregression-gradientdescent",
"path": "linearregression-gd.py",
"copies": "1",
"size": "1208",
"license": "mit",
"hash": 7719654392861357000,
"line_mean": 26.4545454545,
"line_max": 67,
"alpha_frac": 0.5554635762,
"autogenerated": false,
"ratio": 2.9038461538461537,
... |
__author__ = "Kilian Brandt and Michael Caraccio"
import pygame
from models.city import City
from models.point import Point
from models.problem import Problem
from models.solution import Solution
from pygame.locals import KEYDOWN, QUIT, MOUSEBUTTONDOWN, K_RETURN, K_ESCAPE
def initScreen():
pygame.init()
win... | {
"repo_name": "PocketTrout/IA_TravellingSalesman",
"path": "models/GUI.py",
"copies": "1",
"size": "2409",
"license": "mit",
"hash": -2237349543465333200,
"line_mean": 26.8837209302,
"line_max": 79,
"alpha_frac": 0.6257822278,
"autogenerated": false,
"ratio": 3.27012278308322,
"config_test": fa... |
__author__ = "Kilian Brandt and Michael Caraccio"
import random
import copy
class Population:
def __init__(self, listSolutions):
self._listSolutions = listSolutions
self._distancesSum = self.calculateDistance()
def calculateDistance(self):
if len(self._listSolutions) > 0:
... | {
"repo_name": "PocketTrout/IA_TravellingSalesman",
"path": "models/population.py",
"copies": "1",
"size": "2681",
"license": "mit",
"hash": 2657333098053118000,
"line_mean": 35.2297297297,
"line_max": 118,
"alpha_frac": 0.6305970149,
"autogenerated": false,
"ratio": 3.964497041420118,
"config_t... |
__author__ = "Kilian Brandt and Michael Caraccio"
import random
import math
class Solution:
def __init__(self, problem, path = list()):
self._problem = problem
if len(path) == 0:
self._path = problem.getCities()
random.shuffle(self._path)
else:
self._pa... | {
"repo_name": "PocketTrout/IA_TravellingSalesman",
"path": "models/solution.py",
"copies": "1",
"size": "3443",
"license": "mit",
"hash": 8650748982470090000,
"line_mean": 36.8131868132,
"line_max": 166,
"alpha_frac": 0.5953488372,
"autogenerated": false,
"ratio": 3.8914027149321266,
"config_te... |
__author__ = 'Kinggerm'
# change the output of function read_annotation_of_gb(): CDS first, then intron, then tRNA, then rRNA, neglect gene.
# add column region type
# add statistics
# implement excel output
import time
import xlwt
def write_excel(this_matrixes, sheet_names, this_dir):
f = xlwt.Workbook()
... | {
"repo_name": "Kinggerm/PersonalUtilities",
"path": "map_gb_to_misa_SSR_Python3.py",
"copies": "1",
"size": "14638",
"license": "apache-2.0",
"hash": -5334709529021633000,
"line_mean": 49.6505190311,
"line_max": 302,
"alpha_frac": 0.5191966116,
"autogenerated": false,
"ratio": 3.4794390301877822,... |
__author__ = 'Kinggerm'
import time
import os
import platform
this_dir_split = '/'
if 'Win' in platform.architecture()[1]:
this_dir_split = '\\'
def get_parentheses_pairs(tree_string, sign=('(', ')')):
tree_line = list(tree_string)
left_sign = []
count_ls = 0
left_level = []
right_sign = []
... | {
"repo_name": "Kinggerm/PersonalUtilities",
"path": "read_gb_to_vista_input_format_Python3.py",
"copies": "1",
"size": "12829",
"license": "apache-2.0",
"hash": 7534724872131118000,
"line_mean": 47.0524344569,
"line_max": 302,
"alpha_frac": 0.5151609634,
"autogenerated": false,
"ratio": 3.4256341... |
__author__ = 'Kinggerm'
# python2
import dendropy
import os
import sys
# import numpy as np
# from Tkinter import *
import matplotlib.pyplot as plt
# from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
# from matplotlib.figure import Figure
# def drawCurve_interactively():
def draw_curves(x_dots, y_dots, ... | {
"repo_name": "Kinggerm/PersonalUtilities",
"path": "diversification_rate_sliding_window.middle.py",
"copies": "1",
"size": "2948",
"license": "apache-2.0",
"hash": 4798239842628297000,
"line_mean": 36.3164556962,
"line_max": 209,
"alpha_frac": 0.6166892809,
"autogenerated": false,
"ratio": 2.986... |
__author__ = 'Kinggerm'
# python2
import dendropy
import os
def main():
tree_f = raw_input('Input mcc nexus tree:').strip()
threshold = float(raw_input('Input threshold to cut:'))
if not (0 < threshold < 1):
print 'Error: threshold has to be set in (0, 1)!'
os._exit(0)
tree = dendropy.... | {
"repo_name": "Kinggerm/PersonalUtilities",
"path": "get_genus_stem_ages.py",
"copies": "1",
"size": "1089",
"license": "apache-2.0",
"hash": 7353528294655178000,
"line_mean": 26.9230769231,
"line_max": 97,
"alpha_frac": 0.5849403122,
"autogenerated": false,
"ratio": 2.951219512195122,
"config_... |
__author__ = 'kinpa200296'
from qsort import qsort
from mergesort import merge_sort
import wordcounter
import argparse
import fibonacci
def create_parser():
p = argparse.ArgumentParser()
p.add_argument("task", help="""choose one of the following tasks:
qsort - sort array wi... | {
"repo_name": "kinpa200296/python_labs",
"path": "lab1/lab1.py",
"copies": "1",
"size": "2738",
"license": "mit",
"hash": 6653795342827598000,
"line_mean": 26.38,
"line_max": 108,
"alpha_frac": 0.5514974434,
"autogenerated": false,
"ratio": 3.621693121693122,
"config_test": false,
"has_no_key... |
__author__ = "Kiran Vemuri"
__email__ = "kkvemuri@uh.edu"
__status__ = "Development"
__maintainer__ = "Kiran Vemuri"
from cassandra.cluster import Cluster
from cassandra.query import dict_factory
class Cassandra:
"""
Class to facilitate requests to the cassandra cluster
"""
def __init__(self, seed_no... | {
"repo_name": "DreamForgeContrive/tinyblox",
"path": "tinyblox/cassandrax.py",
"copies": "1",
"size": "1626",
"license": "mit",
"hash": 5458415195634023000,
"line_mean": 32.875,
"line_max": 104,
"alpha_frac": 0.63099631,
"autogenerated": false,
"ratio": 4.024752475247524,
"config_test": false,
... |
__author__ = "Kiran Vemuri"
__email__ = "kkvemuri@uh.edu"
__status__ = "Development"
__maintainer__ = "Kiran Vemuri"
from remotex import Connection
class Ovs:
"""
Class to facilitate interactions with ovs running on a remote server
"""
def __init__(self, host, username, password):
self.host =... | {
"repo_name": "DreamForgeContrive/tinyblox",
"path": "tinyblox/ovsx.py",
"copies": "1",
"size": "8702",
"license": "mit",
"hash": -3698023309540974600,
"line_mean": 34.8106995885,
"line_max": 118,
"alpha_frac": 0.591932889,
"autogenerated": false,
"ratio": 3.9268953068592056,
"config_test": fal... |
__author__ = "Kiran Vemuri"
__email__ = "kkvemuri@uh.edu"
__status__ = "Development"
__maintainer__ = "Kiran Vemuri"
from StringIO import StringIO
import paramiko
# Work around for py.test paramiko hanging issue. Refer https://github.com/paramiko/paramiko/issues/735
from paramiko import py3compat
py3compat.u("dirty h... | {
"repo_name": "DreamForgeContrive/tinyblox",
"path": "tinyblox/remotex.py",
"copies": "1",
"size": "3357",
"license": "mit",
"hash": 3892817410674185000,
"line_mean": 36.3,
"line_max": 111,
"alpha_frac": 0.6196008341,
"autogenerated": false,
"ratio": 4.0641646489104115,
"config_test": false,
... |
__author__ = "Kiran Vemuri"
__email__ = "kkvemuri@uh.edu"
__status__ = "Development"
__maintainer__ = "Kiran Vemuri"
import random
from netaddr import IPNetwork
import string
def random_ip(ip_class='A'):
"""
Generate random IP address with the specified class
:param ip_class: <str> class of IP that is to... | {
"repo_name": "DreamForgeContrive/tinyblox",
"path": "tinyblox/toolx.py",
"copies": "1",
"size": "2043",
"license": "mit",
"hash": -4753375091826423000,
"line_mean": 33.6271186441,
"line_max": 102,
"alpha_frac": 0.6324033284,
"autogenerated": false,
"ratio": 3.354679802955665,
"config_test": fa... |
__author__ = "Kiran Vemuri"
__email__ = "kkvemuri@uh.edu"
__status__ = "Development"
__maintainer__ = "Kiran Vemuri"
import requests
import json
class OSSession(object):
"""
OpenStack session
"""
def __init__(self, openstack_ip, username, password):
"""
:param openstack_ip: <str> IP... | {
"repo_name": "DreamForgeContrive/tinyblox",
"path": "tinyblox/openstackx.py",
"copies": "1",
"size": "66459",
"license": "mit",
"hash": -2420610244984495000,
"line_mean": 36.7393526405,
"line_max": 120,
"alpha_frac": 0.5462164643,
"autogenerated": false,
"ratio": 4.675601519628535,
"config_tes... |
__author__ = 'kirillov'
import random
import time
from urllib.request import urlopen
import logging
from daemonize import Daemonize
from optparse import OptionParser
import dht11
PID = "/var/run/tempi.pid"
BASE_HOST = "tin-bronze2.appspot.com"
_LOGGER = None
parser = OptionParser()
parser.add_option("-d", "--daem... | {
"repo_name": "sigizmund/tempi",
"path": "client/old_tempi.py",
"copies": "1",
"size": "2289",
"license": "mit",
"hash": -6131362247411860000,
"line_mean": 25.6279069767,
"line_max": 88,
"alpha_frac": 0.623853211,
"autogenerated": false,
"ratio": 3.680064308681672,
"config_test": false,
"has_... |
__author__ = 'kiro'
import matplotlib.pyplot as plt
def plot_avgerage_threshold_accuracy():
"""
Plot the threshold and average accuracy for all observations for that threshold value.
"""
data = [
# [threshold, accuracy]
[-0.1, 0.6316],
[-0.2, 0.6161],
[-0.3, 0.6059],
... | {
"repo_name": "magnuskiro/master",
"path": "code/graph_plots.py",
"copies": "1",
"size": "1444",
"license": "mit",
"hash": 460299351142855360,
"line_mean": 19.0694444444,
"line_max": 90,
"alpha_frac": 0.4328254848,
"autogenerated": false,
"ratio": 2.6495412844036696,
"config_test": false,
"ha... |
__author__ = 'Kishan'
from FlaskApp.scripts.config import config
from FlaskApp.scripts.data_retrieval import url_requests
from FlaskApp.scripts.data_retrieval.static_data import static_io
# Get champion info: id, name, key. Write to JSON
def get_champion_by_id(region='euw'):
url = 'https://global.api.pvp.net/api... | {
"repo_name": "KLachhani/RiotAPIChallenge2.0",
"path": "FlaskApp/scripts/data_retrieval/static_data/get_champion_data.py",
"copies": "1",
"size": "1169",
"license": "mit",
"hash": -3551532612366917600,
"line_mean": 30.5945945946,
"line_max": 92,
"alpha_frac": 0.6484174508,
"autogenerated": false,
... |
__author__ = 'Kishan'
from FlaskApp.scripts.data_retrieval import url_requests
from FlaskApp.scripts.config import config
from FlaskApp.scripts.data_retrieval.static_data import static_io
# Get minion info: id, name. Write to JSON
def get_minions_by_id(region='euw'):
minions_by_id = {}
url = 'https://global.... | {
"repo_name": "KLachhani/RiotAPIChallenge2.0",
"path": "FlaskApp/scripts/data_retrieval/static_data/get_bw_minion_data.py",
"copies": "1",
"size": "1411",
"license": "mit",
"hash": -3914943715701856000,
"line_mean": 31.8139534884,
"line_max": 70,
"alpha_frac": 0.6321757619,
"autogenerated": false,
... |
__author__ = 'Kishan'
from FlaskApp.scripts.data_retrieval.match_data import get_match_data
from FlaskApp.scripts.data_retrieval import static_data
from FlaskApp.scripts.data_retrieval.static_data import static_io as static_io
from FlaskApp.scripts.data_analytics.data_query import query_io as query_io
# Run query to... | {
"repo_name": "KLachhani/RiotAPIChallenge2.0",
"path": "FlaskApp/scripts/data_analytics/data_query/minions.py",
"copies": "1",
"size": "4333",
"license": "mit",
"hash": 6280277247017338000,
"line_mean": 44.6105263158,
"line_max": 128,
"alpha_frac": 0.6233556427,
"autogenerated": false,
"ratio": 3... |
__author__ = 'Kishan'
import json
import os
import sys
from FlaskApp.scripts.data_retrieval import static_data
from FlaskApp.scripts.data_retrieval.static_data import static_io
from FlaskApp.scripts.data_analytics import data_filter
from FlaskApp.scripts.config import config
regions = static_data.regions
# Champion... | {
"repo_name": "KLachhani/RiotAPIChallenge2.0",
"path": "FlaskApp/scripts/data_analytics/data_filter/champions.py",
"copies": "1",
"size": "3630",
"license": "mit",
"hash": -2252939217056594200,
"line_mean": 34.9405940594,
"line_max": 84,
"alpha_frac": 0.5385674931,
"autogenerated": false,
"ratio"... |
__author__ = 'Kishan'
import json
import os
import sys
from FlaskApp.scripts.data_retrieval.match_data import get_match_data
from FlaskApp.scripts.data_retrieval import static_data
from FlaskApp.scripts.data_retrieval.static_data import static_io
from FlaskApp.scripts.data_analytics import data_filter
from FlaskApp.s... | {
"repo_name": "KLachhani/RiotAPIChallenge2.0",
"path": "FlaskApp/scripts/data_analytics/data_filter/minions.py",
"copies": "1",
"size": "4185",
"license": "mit",
"hash": -3387644127504410000,
"line_mean": 40.0294117647,
"line_max": 98,
"alpha_frac": 0.5323775388,
"autogenerated": false,
"ratio": ... |
__author__ = 'Kishan'
import os
import json
import sys
from FlaskApp.scripts.config import config
from FlaskApp.scripts.data_retrieval.match_data import get_match_data
match_data_directory = config.match_data_directory
regions = get_match_data.get_match_regions()
# Print progress to console
def progress_countdown(... | {
"repo_name": "KLachhani/RiotAPIChallenge2.0",
"path": "FlaskApp/scripts/data_retrieval/match_data/check_match_data.py",
"copies": "1",
"size": "1181",
"license": "mit",
"hash": 150854870427897860,
"line_mean": 30.9189189189,
"line_max": 85,
"alpha_frac": 0.6342082981,
"autogenerated": false,
"ra... |
__author__ = 'Kishan'
import sys
import requests
from FlaskApp.scripts import data_retrieval
max_attempts = data_retrieval.max_attempts
# get json from url
def request(url, region='', progress_counter=-1):
statuscode_not_ok = True
attempts = 0
# loop until http status code is ok or until max attempts i... | {
"repo_name": "KLachhani/RiotAPIChallenge2.0",
"path": "FlaskApp/scripts/data_retrieval/url_requests.py",
"copies": "1",
"size": "1774",
"license": "mit",
"hash": 6613695985003846000,
"line_mean": 35.2040816327,
"line_max": 85,
"alpha_frac": 0.5591882751,
"autogenerated": false,
"ratio": 4.358722... |
__author__ = 'kjoseph'
import cPickle as pickle
from datetime import datetime
from multiprocessing import Pool
import os, sys, itertools
from gensim import corpora, matutils
from scipy.spatial.distance import pdist
from casostwitter import general_utils
def get_tweet_cosine_sim(args):
user_id, directory= args
... | {
"repo_name": "kennyjoseph/icwsm_lizardo",
"path": "python/get_tweet_cosine_sim.py",
"copies": "1",
"size": "1996",
"license": "mit",
"hash": 7516315439388313000,
"line_mean": 33.4310344828,
"line_max": 126,
"alpha_frac": 0.6538076152,
"autogenerated": false,
"ratio": 3.3773265651438242,
"confi... |
__author__ = 'kjoseph'
import itertools
import Queue
from collections import defaultdict
from dependency_parse_object import DependencyParseObject, is_noun, is_verb
def get_parse(dp_objs):
term_map = {}
map_to_head = defaultdict(list)
for parse_object in dp_objs:
if parse_object.head > 0:
... | {
"repo_name": "kennyjoseph/identity_extraction_pub",
"path": "python/utility_code/dependency_parse_handlers.py",
"copies": "1",
"size": "6421",
"license": "mit",
"hash": 299393199318496100,
"line_mean": 33.1542553191,
"line_max": 97,
"alpha_frac": 0.5723407569,
"autogenerated": false,
"ratio": 3.... |
__author__ = 'kjoseph'
import sys
from twitter_dm.TwitterUser import TwitterUser
import os
import glob
from datetime import datetime
import random
from vaderSentiment.vaderSentiment import sentiment
from langid import langid
import cPickle as pickle
from functools import partial
import multiprocessing
"""
Input format... | {
"repo_name": "kennyjoseph/identity_extraction_pub",
"path": "python/1_collect_tweets_to_label.py",
"copies": "1",
"size": "4056",
"license": "mit",
"hash": -1926160391217637400,
"line_mean": 33.3728813559,
"line_max": 100,
"alpha_frac": 0.6097140039,
"autogenerated": false,
"ratio": 3.1564202334... |
__author__ = 'kjoseph'
import codecs
import sys
import re
import string
from utility_code.util import *
# read in dependency parsed data
dep_parses_map = {int(g[0]): g[1:] for g in read_grouped_by_newline_file('processed_data/dep_parse_w_ids.txt')}
# read in matched labels (including empty)
match_dat = read_grouped... | {
"repo_name": "kennyjoseph/identity_extraction_pub",
"path": "python/5_merge_in_annotation_fixes.py",
"copies": "1",
"size": "3183",
"license": "mit",
"hash": 1104505728192867800,
"line_mean": 33.2258064516,
"line_max": 111,
"alpha_frac": 0.5878102419,
"autogenerated": false,
"ratio": 3.264615384... |
__author__ = 'kjoseph'
import cPickle as pickle
from utility_code.util import *
import sys
import os
import itertools
from math import ceil
import random
import codecs
import shutil
from glob import glob
import zipfile
sys.argv = ['',
'output/',
'../annotation_data/',
'13',
... | {
"repo_name": "kennyjoseph/identity_extraction_pub",
"path": "python/2_gen_folders_for_brat_annotation.py",
"copies": "1",
"size": "2633",
"license": "mit",
"hash": -5657992390490741000,
"line_mean": 26.4270833333,
"line_max": 106,
"alpha_frac": 0.6388150399,
"autogenerated": false,
"ratio": 3.00... |
__author__ = 'kjoseph'
import itertools, codecs, sys, glob, string
from multiprocessing import Pool
from casostwitter.general_utils import tab_stringify_newline
from casostwitter.Tokenize import extract_tokens
from casostwitter.DictionaryLookUp import DictionaryLookUp
from casostwitter.data_tweet_utils import run_text... | {
"repo_name": "kennyjoseph/minerva_relig_paper",
"path": "python/casos_get_news_term_nets.py",
"copies": "1",
"size": "2836",
"license": "mit",
"hash": -9084526709235993000,
"line_mean": 34.45,
"line_max": 107,
"alpha_frac": 0.6227080395,
"autogenerated": false,
"ratio": 3.376190476190476,
"con... |
__author__ = 'kjoseph'
import itertools, codecs, sys
from multiprocessing import Pool
from casostwitter.general_utils import tab_stringify_newline
from casostwitter.DictionaryLookUp import DictionaryLookUp
from casostwitter.data_tweet_utils import run_tweet_through_dictionaries
from casostwitter.Tweet import Tweet
fro... | {
"repo_name": "kennyjoseph/minerva_relig_paper",
"path": "python/casos_get_twitter_term_nets.py",
"copies": "1",
"size": "5600",
"license": "mit",
"hash": 7575119637437865000,
"line_mean": 39.2877697842,
"line_max": 108,
"alpha_frac": 0.5908928571,
"autogenerated": false,
"ratio": 3.5043804755944... |
__author__ = 'kjoseph'
import itertools, codecs, sys
from multiprocessing import Pool
from casostwitter.general_utils import tab_stringify_newline
from casostwitter.Tweet import Tweet
from collections import defaultdict, Counter
import ujson as json
from datetime import datetime
top_dir = "/usr3/kjoseph/final_minerva... | {
"repo_name": "kennyjoseph/minerva_relig_paper",
"path": "python/casos_total_n_users.py",
"copies": "1",
"size": "2040",
"license": "mit",
"hash": -8112373074355644000,
"line_mean": 29,
"line_max": 106,
"alpha_frac": 0.5941176471,
"autogenerated": false,
"ratio": 3.4056761268781304,
"config_tes... |
__author__ = 'kjoseph'
import requests
from utility_code.util import *
import codecs
from collections import Counter
from twitter_dm.nlp.tweeboparser import replace_tweet_newlines
import sys
import shutil
reload(sys) # Reload does the trick!
sys.setdefaultencoding('UTF8')
import os
# download annotations from the s... | {
"repo_name": "kennyjoseph/identity_extraction_pub",
"path": "python/4_collect_annotated_data_from_brat_merge_eval.py",
"copies": "1",
"size": "9990",
"license": "mit",
"hash": 4079992935954374700,
"line_mean": 39.2822580645,
"line_max": 119,
"alpha_frac": 0.5881881882,
"autogenerated": false,
"r... |
__author__ = 'kkennedy'
import datetime
from dateutil.relativedelta import relativedelta
import labtronyx
from . import PluginController
class ScriptController(PluginController):
def __init__(self, c_manager, model):
super(ScriptController, self).__init__(c_manager, model)
self._attributes = se... | {
"repo_name": "protonyx/labtronyx",
"path": "labtronyx/gui/controllers/c_script.py",
"copies": "1",
"size": "1950",
"license": "mit",
"hash": -5825825994897110000,
"line_mean": 26.4788732394,
"line_max": 100,
"alpha_frac": 0.6128205128,
"autogenerated": false,
"ratio": 4.045643153526971,
"confi... |
__author__ = 'kkennedy'
import labtronyx
from . import BaseController, InterfaceController, ResourceController, ScriptController
rpc_controllers = {
'resource': ResourceController,
'script': ScriptController
}
class ManagerController(BaseController):
"""
Wraps RemoteManager
"""
def __init__... | {
"repo_name": "protonyx/labtronyx",
"path": "labtronyx/gui/controllers/c_manager.py",
"copies": "1",
"size": "6466",
"license": "mit",
"hash": 8321372878316119000,
"line_mean": 30.0913461538,
"line_max": 101,
"alpha_frac": 0.5985153109,
"autogenerated": false,
"ratio": 4.267986798679868,
"confi... |
__author__ = 'kkennedy'
import socket
import labtronyx
from . import BaseController, ManagerController
class MainApplicationController(BaseController):
def __init__(self):
BaseController.__init__(self)
self.event_sub = labtronyx.EventSubscriber()
self.event_sub.registerCallback('', sel... | {
"repo_name": "protonyx/labtronyx",
"path": "labtronyx/gui/controllers/c_main.py",
"copies": "1",
"size": "3497",
"license": "mit",
"hash": 1040690052007801100,
"line_mean": 25.3007518797,
"line_max": 121,
"alpha_frac": 0.5673434372,
"autogenerated": false,
"ratio": 4.420986093552465,
"config_t... |
__author__ = 'kkennedy'
import wx
import wx.lib.sized_controls
import labtronyx
from ..controllers import ResourceController
from . import FrameViewBase, PanelViewBase, DialogViewBase
class ResourceInfoPanel(PanelViewBase):
def __init__(self, parent, controller):
assert(isinstance(controller, ResourceC... | {
"repo_name": "protonyx/labtronyx",
"path": "labtronyx/gui/wx_views/wx_resources.py",
"copies": "1",
"size": "7901",
"license": "mit",
"hash": -4594179753570275300,
"line_mean": 34.4349775785,
"line_max": 120,
"alpha_frac": 0.6201746614,
"autogenerated": false,
"ratio": 3.627640036730946,
"conf... |
__author__ = 'kkennedy'
import wx
import labtronyx
from ..controllers import InterfaceController
from . import FrameViewBase, PanelViewBase, DialogViewBase
class InterfaceInfoPanel(PanelViewBase):
def __init__(self, parent, controller):
assert(isinstance(controller, InterfaceController))
super(... | {
"repo_name": "protonyx/labtronyx",
"path": "labtronyx/gui/wx_views/wx_interfaces.py",
"copies": "1",
"size": "2140",
"license": "mit",
"hash": 6606596799291023000,
"line_mean": 29.5857142857,
"line_max": 82,
"alpha_frac": 0.6411214953,
"autogenerated": false,
"ratio": 3.4910277324632952,
"conf... |
__author__ = 'kkennedy'
# System Imports
import sys
import os
import logging
import traceback
import wx
import wx.aui
import wx.lib
import wx.lib.mixins.inspection
from wx.lib.agw import genericmessagedialog
# Labtronyx
import labtronyx
# Package Relative Imports
from ..controllers import MainApplicationController
... | {
"repo_name": "protonyx/labtronyx",
"path": "labtronyx/gui/wx_views/wx_main.py",
"copies": "1",
"size": "14871",
"license": "mit",
"hash": -3559369893792073000,
"line_mean": 35.1849148418,
"line_max": 121,
"alpha_frac": 0.6242350884,
"autogenerated": false,
"ratio": 3.605090909090909,
"config_t... |
__author__ = 'Kliment Andreev'
__version__ = '20201227 15:48'
# Imports
import random
import time
import pygame
import sys
from pygame.locals import *
# Constants and dictionaries
# Frames per second
FPS = 25
# Delay ms for a shape to go down
DELAY = 1000
# The top left column where the falling shape is positioned in... | {
"repo_name": "klimenta/KAtrix",
"path": "KAtrix.py",
"copies": "1",
"size": "22050",
"license": "bsd-2-clause",
"hash": 1502374597454867200,
"line_mean": 37.4146341463,
"line_max": 125,
"alpha_frac": 0.4911111111,
"autogenerated": false,
"ratio": 3.6374133949191685,
"config_test": false,
"ha... |
__author__ = 'kmadac'
import requests
class public():
def __init__(self, proxydict=None):
self.proxydict = proxydict
def ticker(self):
"""
Return dictionary
"""
r = requests.get("https://www.bitstamp.net/api/ticker/", proxies=self.proxydict)
if r.status_code =... | {
"repo_name": "erasmospunk/pychohistory",
"path": "modules/bitstamp/client.py",
"copies": "1",
"size": "7178",
"license": "mit",
"hash": 649863833831128700,
"line_mean": 32.3860465116,
"line_max": 119,
"alpha_frac": 0.5338534411,
"autogenerated": false,
"ratio": 3.9095860566448803,
"config_test... |
__author__ = 'kmadac'
# set to True to write debug log with each API call to /tmp/xwrap_requests
MONITOR = False
import requests
import datetime
import time
from email.utils import formatdate
import hmac
import hashlib
import sys
# some code to monitor traffic a bit...
if MONITOR:
_org_get = requests.get
def... | {
"repo_name": "nederhoed/bitstamp-python-client",
"path": "bitstamp/client.py",
"copies": "1",
"size": "12456",
"license": "mit",
"hash": -7682574267444095000,
"line_mean": 31.2694300518,
"line_max": 78,
"alpha_frac": 0.5574020552,
"autogenerated": false,
"ratio": 3.9567979669631512,
"config_te... |
__author__ = 'k.muehlbauer'
# -*- coding: utf-8 -*-
"""
Radar (Radolan) Viewer 0.1
First implementation of radar viewer based on openGL (vispy-package)
# Author: Kai Muehlbauer
"""
import glob
import datetime as dt
import warnings
from PyQt4.QtCore import Qt, QSize, QTimer
from PyQt4.QtGui import QApplication, QW... | {
"repo_name": "kmuehlbauer/RADOLAN-Viewer",
"path": "examples/radolan_example_01.py",
"copies": "1",
"size": "12309",
"license": "mit",
"hash": -6957494529585198000,
"line_mean": 34.3735632184,
"line_max": 116,
"alpha_frac": 0.6337639126,
"autogenerated": false,
"ratio": 3.569895591647332,
"con... |
__author__ = 'kmu'
"""
TODO:
- check if last downloaded file is the same as the new one.
- if not add a new file else disregard
- make a db with webcam names and links to go through each run
Use imagemagick to make an animated gif than can be put on a website:
convert -set delay 3 -loop 0 -scale 50% *.jpg animation.... | {
"repo_name": "kmunve/TSanalysis",
"path": "get_webcamimg.py",
"copies": "1",
"size": "1239",
"license": "mit",
"hash": 3123451355493527000,
"line_mean": 25.9347826087,
"line_max": 80,
"alpha_frac": 0.6416464891,
"autogenerated": false,
"ratio": 2.901639344262295,
"config_test": false,
"has_n... |
__author__ = 'kmunve'
import numpy as np
import pandas as pd
import requests
import json
import matplotlib.pyplot as plt
url = 'http://api01.nve.no/hydrology/forecast/avalanche/v2.0.1/api/AvalancheWarningByRegion/Detail/11/1/2014-02-13/2014-03-17'
resp = requests.get(url)
data = json.loads(resp.text)
try:
print l... | {
"repo_name": "kmunve/TSanalysis",
"path": "TSio/test_df.py",
"copies": "1",
"size": "1732",
"license": "mit",
"hash": -6951182390563417000,
"line_mean": 29.9285714286,
"line_max": 159,
"alpha_frac": 0.6760969977,
"autogenerated": false,
"ratio": 2.9708404802744424,
"config_test": false,
"has... |
__author__ = 'kmwenja'
import sqlalchemy
import grammar
from pyparsing import ParseException
from random import randint
from sys import maxsize
from base64 import b64decode, b64encode
SIAFU_SQL = """
CREATE TABLE IF NOT EXISTS siafu_databases (
ID integer not null primary key,
NAME varchar(100) not null,
... | {
"repo_name": "caninemwenja/siafu",
"path": "siafu.py",
"copies": "2",
"size": "18160",
"license": "mit",
"hash": 2653236378513081000,
"line_mean": 30.637630662,
"line_max": 110,
"alpha_frac": 0.4824889868,
"autogenerated": false,
"ratio": 4.172794117647059,
"config_test": false,
"has_no_keyw... |
__author__ = 'knelson'
import numpy as np
import matplotlib.pyplot as plt
def half_cosine(window, total_segments, hop_size):
win_length = window.shape
total_length = win_length + hop_size*(total_segments-1)
result = np.zeros(total_length)
for i in xrange(total_segments):
current_loc = i*hop_... | {
"repo_name": "KevinNJ/Projects",
"path": "Short Time Fourier Transform/archive/half_cosine.py",
"copies": "1",
"size": "1241",
"license": "mit",
"hash": 5321592945013063000,
"line_mean": 24.3265306122,
"line_max": 77,
"alpha_frac": 0.6188557615,
"autogenerated": false,
"ratio": 3.345013477088948... |
__author__ = 'knelson'
transitions = {
'L': ['U', 'D', 'L'],
'R': ['U', 'D', 'R'],
'U': ['L', 'R', 'U'],
'D': ['L', 'R', 'D'],
None: ['L', 'R', 'U', 'D']
}
class Node(object):
def __init__(self):
self.children = []
self.decision = None
def make_tree(node, state):
for d,... | {
"repo_name": "KevinNJ/Projects",
"path": "Decision Trees on Infinite Grid/trees.py",
"copies": "1",
"size": "2206",
"license": "mit",
"hash": -3710103781696063000,
"line_mean": 24.367816092,
"line_max": 74,
"alpha_frac": 0.5077062557,
"autogenerated": false,
"ratio": 2.993215739484396,
"config... |
__author__ = 'k'
"""
http://www.binarytides.com/python-socket-programming-tutorial/
http://carlo-hamalainen.net/blog/2013/1/24/python-ssl-socket-echo-test-with-self-signed-certificate
https://docs.python.org/2/library/ssl.html
http://www.laurentluce.com/posts/python-and-cryptography-with-pycrypto/
"""
import binascii
... | {
"repo_name": "zeevmoney/MySSL",
"path": "client.py",
"copies": "2",
"size": "4327",
"license": "mit",
"hash": 8921594742187931000,
"line_mean": 37.981981982,
"line_max": 109,
"alpha_frac": 0.5863184654,
"autogenerated": false,
"ratio": 3.8530721282279607,
"config_test": false,
"has_no_keywor... |
__author__ = 'k'
import hashlib
import socket
import ssl
import sys # for exit
import json
import binascii # ascii to binary
from Crypto.Cipher import AES
HOST = '' # Symbolic name meaning all available interfaces
PORT = 1337 # Arbitrary non-privileged port
#TODO: add threads to server.
#TODO: give better names... | {
"repo_name": "IYism/MySSL",
"path": "server.py",
"copies": "2",
"size": "4450",
"license": "mit",
"hash": -4514769979070377500,
"line_mean": 35.7851239669,
"line_max": 110,
"alpha_frac": 0.5274157303,
"autogenerated": false,
"ratio": 4.041780199818347,
"config_test": false,
"has_no_keywords"... |
__author__ = 'kobi'
import requests
import json
################## END_POINTS #################################:
NAME = 'name_en'
PARENT = 'parent'
###############################################################
def get_data_as_dict(url):
"""
Get data from a URL as a python dictionary
:param url: the ... | {
"repo_name": "kobiluria/TaxMap",
"path": "tools/tools.py",
"copies": "1",
"size": "1297",
"license": "mit",
"hash": -190140948973693060,
"line_mean": 26.0208333333,
"line_max": 92,
"alpha_frac": 0.601387818,
"autogenerated": false,
"ratio": 3.9663608562691133,
"config_test": false,
"has_no_k... |
__author__ = 'kobi'
import tools
################## END_POINTS #################################:
PARENT = 'parent'
DIVISION = 'division'
URL = 'url'
NAME_EN = 'name_en'
DISTRICT_ID = 2
#################################################################
class entity:
"""
A class which represents an entity an... | {
"repo_name": "kobiluria/TaxMap",
"path": "tools/objects.py",
"copies": "1",
"size": "2723",
"license": "mit",
"hash": -465389453216589060,
"line_mean": 35.3066666667,
"line_max": 116,
"alpha_frac": 0.5706940874,
"autogenerated": false,
"ratio": 3.986822840409956,
"config_test": false,
"has_n... |
__author__ = 'kobyn'
"""
Docker provisioner tasks.
"""
import time
import random
from cloudify.decorators import operation
from cloudify.utils import get_local_ip
import docker
import socket
get_ip = get_local_ip
container_cmds = ['/bin/sh -c "while true; do echo hello world; sleep 1; done"', '/usr... | {
"repo_name": "emptybay/cosmo-docker-plugin",
"path": "docker_host_provisioner/docker_host_provisioner.py",
"copies": "1",
"size": "3014",
"license": "apache-2.0",
"hash": -8673368779854863000,
"line_mean": 30.4086021505,
"line_max": 124,
"alpha_frac": 0.598871931,
"autogenerated": false,
"ratio"... |
__author__ = 'kocsenc'
from flask import Flask, g, render_template, request, url_for, Response
import flask
import sqlite3
DATABASE = './db.sqlite3'
app = Flask(__name__)
@app.route('/student/<hashed_sid>')
def student_validate(hashed_sid):
student = get_student(hashed_sid)
if student:
return flask... | {
"repo_name": "kocsenc/rit-id-secure-backend",
"path": "app.py",
"copies": "1",
"size": "3863",
"license": "mit",
"hash": -888565972884502300,
"line_mean": 26.5928571429,
"line_max": 139,
"alpha_frac": 0.5736474243,
"autogenerated": false,
"ratio": 3.7359767891682787,
"config_test": false,
"h... |
__author__ = 'kocsenc'
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import os.path
USER_CONFIG_FILE_NAME = "../user.config"
class MyCourses:
def __init__(self):
"""
Instantiate Selenium driver. All scripts should inherit from this.
:return:
... | {
"repo_name": "kocsenc/mycourses-scripts",
"path": "scripts/common/MyCourses.py",
"copies": "1",
"size": "1538",
"license": "mit",
"hash": 7558236224168333000,
"line_mean": 29.1568627451,
"line_max": 119,
"alpha_frac": 0.5741222367,
"autogenerated": false,
"ratio": 3.769607843137255,
"config_te... |
__author__ = 'kocsen'
import logging
from os.path import basename
from Commands.Command import Command
class AccountManagerUseCommand(Command):
"""
Command that will check if app uses account manager
"""
def __init__(self, app):
self.app = app
def execute(self):
logging.info("R... | {
"repo_name": "kocsenc/android-scraper",
"path": "src/Commands/AccountManagerUseCommand.py",
"copies": "2",
"size": "1229",
"license": "bsd-2-clause",
"hash": -8591428372084132000,
"line_mean": 30.5384615385,
"line_max": 105,
"alpha_frac": 0.5402766477,
"autogenerated": false,
"ratio": 4.80078125... |
__author__ = 'kocsen'
import logging
from os.path import basename
from Commands.Command import Command
class SharingCenterUseCommand(Command):
"""
Command that will check if app is using sharing!
"""
def __init__(self, app):
self.app = app
def execute(self):
logging.info("Runni... | {
"repo_name": "dan7800/MPermission",
"path": "android-scraper/src/Commands/SharingCenterUseCommand.py",
"copies": "2",
"size": "1235",
"license": "bsd-2-clause",
"hash": 8881173741780132000,
"line_mean": 29.1463414634,
"line_max": 97,
"alpha_frac": 0.5271255061,
"autogenerated": false,
"ratio": 4... |
__author__ = 'kocsen'
import logging
from os.path import basename
from Commands.Command import Command
class SSLUseCommand(Command):
"""
Command that will check if app is using SSL!
PRECONDITION, must have checked if app uses internet
using the InternetUseCommand
"""
def __init__(self, app)... | {
"repo_name": "kocsenc/android-scraper",
"path": "src/Commands/SSLUseCommand.py",
"copies": "2",
"size": "1331",
"license": "bsd-2-clause",
"hash": 3124093625840957400,
"line_mean": 29.976744186,
"line_max": 99,
"alpha_frac": 0.5409466566,
"autogenerated": false,
"ratio": 4.736654804270462,
"co... |
__author__ = 'kocsen'
import logging
import time
import json
import mysql.connector
from mysql.connector import errorcode
from mysql.connector.errors import IntegrityError
"""
Used to write app feature data to a DB.
NOTE: This script is VERY specifically tied to the way data is modeled
in the existing Database App... | {
"repo_name": "kocsenc/android-scraper",
"path": "src/db/DBConnect.py",
"copies": "2",
"size": "3911",
"license": "bsd-2-clause",
"hash": -6832916730477520000,
"line_mean": 27.9703703704,
"line_max": 111,
"alpha_frac": 0.623114293,
"autogenerated": false,
"ratio": 3.7714561234329795,
"config_te... |
__author__ = 'kohlmannj'
import multiprocessing
import re
import socket
import subprocess
import datetime
from uptime import uptime
from sys import platform as _platform
def get_stats():
# Use top to get load averages and CPU usage
if _platform == "linux" or _platform == "linux2":
command = ['top', '-... | {
"repo_name": "kohlmannj/uptime",
"path": "stats.py",
"copies": "1",
"size": "1960",
"license": "bsd-3-clause",
"hash": -3277915425628228600,
"line_mean": 36.6923076923,
"line_max": 164,
"alpha_frac": 0.5795918367,
"autogenerated": false,
"ratio": 3.310810810810811,
"config_test": false,
"has... |
__author__ = 'koitaroh'
# convert_tweet_to_grid.py
# Last Update: 2015-12-19
# Author: Satoshi Miyazawa
# koitaroh@gmail.com
# Convert tweets to population density array p[t, x, y]
import csv
import configparser
import numpy
import pickle
import os
import datetime
import sqlalchemy
import settings as s... | {
"repo_name": "koitaroh/twitter-spatial-analysis",
"path": "src/convert_points_to_grid.py",
"copies": "1",
"size": "7562",
"license": "mit",
"hash": 4768590174853482000,
"line_mean": 35.81,
"line_max": 162,
"alpha_frac": 0.5774927268,
"autogenerated": false,
"ratio": 3.0727346607070296,
"config... |
__author__ = 'Kojayboy'
class RetrievabilityMeasure(object):
doc_list = {}
b = 0.0
c = 100
def __init__(self, b, c):
self.b = b
self.c = c
self.doc_list = {} ## lolwut. without this, all instances share the same dictionary :/
def __str__(self):
if self.b > 0.0:
return "Gravity Measure. Beta = %f Cu... | {
"repo_name": "leifos/ifind",
"path": "ifind/common/retrievability_ruler.py",
"copies": "1",
"size": "2088",
"license": "mit",
"hash": 6261283684398441000,
"line_mean": 21.2127659574,
"line_max": 88,
"alpha_frac": 0.6436781609,
"autogenerated": false,
"ratio": 2.7473684210526317,
"config_test":... |
__author__ = 'kollad'
from abc import ABCMeta, abstractmethod
import json
from engine.factory import Factory
def connect_social_interface(settings, *args, **kwargs):
platform = settings['social']['platform']
if platform == 'fb':
return SocialInterfaceFactory.FacebookSocialInterface(settings, *args, *... | {
"repo_name": "kollad/turbo-ninja",
"path": "social/interface.py",
"copies": "1",
"size": "2536",
"license": "mit",
"hash": -5216116516227992000,
"line_mean": 26.5760869565,
"line_max": 112,
"alpha_frac": 0.6470820189,
"autogenerated": false,
"ratio": 4.488495575221239,
"config_test": false,
... |
__author__ = 'kollad'
class FactoryException(Exception):
pass
class Factory(object):
def __init__(self):
super(Factory, self).__init__()
self.classes = {}
def register(self, classname, cls=None, module=None):
if cls is None and module is None:
raise ValueError('No cl... | {
"repo_name": "kollad/turbo-ninja",
"path": "factory.py",
"copies": "1",
"size": "1485",
"license": "mit",
"hash": -7675173671218297000,
"line_mean": 27.5769230769,
"line_max": 85,
"alpha_frac": 0.5144781145,
"autogenerated": false,
"ratio": 4.611801242236025,
"config_test": false,
"has_no_ke... |
__author__ = 'koller'
from scipy.io import loadmat
from blocks.bricks.conv import Convolutional, MaxPooling
from blocks.initialization import Constant
from blocks.bricks import Rectifier, Softmax
import numpy as np
import theano
from theano import tensor
from blocks.bricks.interfaces import Feedforward
from blocks.br... | {
"repo_name": "Copper-Head/cogsys-deep-learning",
"path": "contrib/imagenet.py",
"copies": "1",
"size": "7171",
"license": "mit",
"hash": 7380268645671743000,
"line_mean": 34.3251231527,
"line_max": 95,
"alpha_frac": 0.548877423,
"autogenerated": false,
"ratio": 4.037725225225225,
"config_test"... |
__author__ = 'kolya'
import csv
from generate_tables import types_array
names = [str(type(types_array[j]))[8:-2] for j in range(len(types_array))]
description = {name:{} for name in names}
type_IDS ={
'NoneType': 0,
'bool' : 1,
'int' : 2,
'float' : 3,
'str' : 4,
'list' : 5,
'dict' : 6,
... | {
"repo_name": "kolya95/static_analyzer",
"path": "parse_csv.py",
"copies": "1",
"size": "1095",
"license": "apache-2.0",
"hash": 8519362190850165000,
"line_mean": 24.488372093,
"line_max": 111,
"alpha_frac": 0.5159817352,
"autogenerated": false,
"ratio": 3.1107954545454546,
"config_test": false... |
__author__ = 'kolya'
from inspect import getmembers as gm
import csv, os
types_array = [1, 1.0, "1", [1], (1,), {1}, {1: 1}, True, bytes(1)]
if __name__ == '__main__':
print_table = {str(type(types_array[j]))[8:-2]:{} for j in range(len(types_array))}
no_arg_pt = {str(type(types_array[j]))[8:-2]:{} for j in ... | {
"repo_name": "kolya95/static_analyzer",
"path": "generate_tables.py",
"copies": "1",
"size": "1854",
"license": "apache-2.0",
"hash": -312449160093262800,
"line_mean": 32.7272727273,
"line_max": 193,
"alpha_frac": 0.5064724919,
"autogenerated": false,
"ratio": 3.1370558375634516,
"config_test"... |
# Copyright (c) 2014
from django.db import models
# Local module
import chatServerConstants
class Receipient(models.Model):
name = models.CharField(max_length=chatServerConstants.MAX_NAME_LENGTH)
alias = models.CharField(max_length=chatServerConstants.MAX_ALIAS_LENGTH, blank=True)
dateCreated = models.... | {
"repo_name": "odeke-em/restAssured",
"path": "chatServer/models.py",
"copies": "1",
"size": "2058",
"license": "mit",
"hash": -882424390194367200,
"line_mean": 42.7872340426,
"line_max": 102,
"alpha_frac": 0.7487852284,
"autogenerated": false,
"ratio": 3.636042402826855,
"config_test": false,
... |
"""Author: Konrad Zemek
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'
Brings up a riak cluster.
"""
from __future__ import print_function
import re
import requests
import sys
from timeouts import *
from . import common, docker, dns as dns_mod
def riak_ho... | {
"repo_name": "kliput/onezone-gui",
"path": "bamboos/docker/environment/riak.py",
"copies": "2",
"size": "4238",
"license": "mit",
"hash": 3379975319638117400,
"line_mean": 29.4892086331,
"line_max": 80,
"alpha_frac": 0.6212836244,
"autogenerated": false,
"ratio": 3.434359805510535,
"config_tes... |
__author__ = 'Konstantin Dmitriev'
from gettext import gettext as _
from argparse import ArgumentParser
from argparse import Action
from argparse import SUPPRESS
import os
import sys
from renderchan.core import RenderChan, __version__
class FormatsAction(Action):
def __init__(self,
option_string... | {
"repo_name": "morevnaproject/RenderChan",
"path": "renderchan/cli.py",
"copies": "1",
"size": "8091",
"license": "bsd-3-clause",
"hash": -4770715907513015000,
"line_mean": 36.6325581395,
"line_max": 134,
"alpha_frac": 0.5778024966,
"autogenerated": false,
"ratio": 4.345327604726101,
"config_te... |
__author__ = 'Konstantin Dmitriev'
from gettext import gettext as _
from optparse import OptionParser
import os
from renderchan.core import RenderChan
from renderchan.file import RenderChanFile
import sys
def process_args():
parser = OptionParser(
usage=_("""
%prog [options] [FILE] """)... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/joblauncher.py",
"copies": "1",
"size": "3976",
"license": "bsd-3-clause",
"hash": 2741879081789688300,
"line_mean": 37.6019417476,
"line_max": 135,
"alpha_frac": 0.6199698189,
"autogenerated": false,
"ratio": 4.0696008188331625,
"c... |
__author__ = 'Konstantin Dmitriev'
from gettext import gettext as _
from optparse import OptionParser
import os.path
from renderchan.core import RenderChan
from renderchan.core import Attribution
from renderchan.file import RenderChanFile
from renderchan.project import RenderChanProject
def process_args():
pars... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/manager.py",
"copies": "2",
"size": "2587",
"license": "bsd-3-clause",
"hash": 2940121402275852300,
"line_mean": 35.4507042254,
"line_max": 114,
"alpha_frac": 0.6432160804,
"autogenerated": false,
"ratio": 4.23404255319149,
"config_... |
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
from renderchan.utils import is_true_string
import subprocess
import gzip
import os, sys
import errno
import re
from xml.etree import ElementTree
class RenderChanListModule(RenderChanModule):
def __init__(self):
RenderChanMo... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/contrib/list.py",
"copies": "1",
"size": "2034",
"license": "bsd-3-clause",
"hash": -7473657654726751000,
"line_mean": 29.3582089552,
"line_max": 119,
"alpha_frac": 0.5211406096,
"autogenerated": false,
"ratio": 4.402597402597403,
"... |
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
from renderchan.utils import is_true_string
import subprocess
import gzip
import os, sys
import errno
import re
import locale
from xml.etree import ElementTree
class RenderChanSynfigModule(RenderChanModule):
def __init__(self):
... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/contrib/synfig.py",
"copies": "1",
"size": "7481",
"license": "bsd-3-clause",
"hash": 2961505094594879000,
"line_mean": 38.7925531915,
"line_max": 135,
"alpha_frac": 0.5500601524,
"autogenerated": false,
"ratio": 4.207536557930259,
... |
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
import subprocess
import os, sys
import re
import random
import tempfile
class RenderChanBlenderModule(RenderChanModule):
def __init__(self):
RenderChanModule.__init__(self)
if os.name == 'nt':
self.conf... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/contrib/blender.py",
"copies": "1",
"size": "7492",
"license": "bsd-3-clause",
"hash": -6025339704534136000,
"line_mean": 38.2251308901,
"line_max": 129,
"alpha_frac": 0.5352375868,
"autogenerated": false,
"ratio": 4.235161107970605,
... |
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
import subprocess
import random
import os
import tempfile
from zipfile import ZipFile
from xml.etree import ElementTree
from renderchan.utils import which
from renderchan.utils import mkdirs
class RenderChanKritaModule(RenderChanModule)... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/contrib/krita.py",
"copies": "1",
"size": "3719",
"license": "bsd-3-clause",
"hash": 2901394629724254000,
"line_mean": 37.7395833333,
"line_max": 133,
"alpha_frac": 0.584834633,
"autogenerated": false,
"ratio": 4.159955257270694,
"c... |
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
import subprocess
import sys
import os
import tempfile
import shutil
import locale
from zipfile import ZipFile
from xml.etree import ElementTree
from renderchan.utils import which
class RenderChanKritaModule(RenderChanModule):
def _... | {
"repo_name": "morevnaproject/RenderChan",
"path": "renderchan/contrib/krita.py",
"copies": "1",
"size": "6472",
"license": "bsd-3-clause",
"hash": 1235604360498209300,
"line_mean": 36.1954022989,
"line_max": 182,
"alpha_frac": 0.5520704574,
"autogenerated": false,
"ratio": 4.423786739576213,
"... |
__author__ = 'Konstantin Dmitriev'
import os.path
import configparser
from renderchan.module import RenderChanModule
from renderchan.utils import float_trunc, ini_wrapper, is_true_string
from renderchan.metadata import RenderChanMetadata
class RenderChanFile():
def __init__(self, path, modules, projects):
... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/file.py",
"copies": "1",
"size": "15666",
"license": "bsd-3-clause",
"hash": -6032835570895543000,
"line_mean": 37.6814814815,
"line_max": 157,
"alpha_frac": 0.5507468403,
"autogenerated": false,
"ratio": 4.319272125723739,
"config_... |
__author__ = 'Konstantin Dmitriev'
import os.path
import time
import configparser
import shutil
import sys
from renderchan.utils import mkdirs, sync, file_is_older_than, ini_wrapper, LockThread, copytree
from renderchan.cache import RenderChanCache
class RenderChanProjectManager():
def __init__(self):
se... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/project.py",
"copies": "1",
"size": "18624",
"license": "bsd-3-clause",
"hash": -6429125107474775000,
"line_mean": 34.4068441065,
"line_max": 130,
"alpha_frac": 0.533612543,
"autogenerated": false,
"ratio": 4.402836879432624,
"confi... |
__author__ = 'Konstantin Dmitriev'
import os, shutil, errno
import random
import time
import threading
import io
import shutil
if os.name == 'nt':
import ctypes
kdll = ctypes.windll.LoadLibrary("kernel32.dll")
def which(program):
def is_exe(fpath):
if os.name=='nt':
return os.path.isf... | {
"repo_name": "morevnaproject/RenderChan",
"path": "renderchan/utils.py",
"copies": "2",
"size": "6018",
"license": "bsd-3-clause",
"hash": -1662961448257730300,
"line_mean": 31.0106382979,
"line_max": 104,
"alpha_frac": 0.5274177468,
"autogenerated": false,
"ratio": 4.1247429746401645,
"config... |
__author__ = 'Konstantin Dmitriev'
import os, sys
import sqlite3
import random
import shutil
from renderchan.utils import mkdirs
class RenderChanCache():
def __init__(self, path, readonly=False):
self.connection=None
self.closed = True
self.readonly=readonly
if not os.path.exists... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/cache.py",
"copies": "1",
"size": "4725",
"license": "bsd-3-clause",
"hash": -404219103149898100,
"line_mean": 32.9928057554,
"line_max": 170,
"alpha_frac": 0.5411640212,
"autogenerated": false,
"ratio": 4.30327868852459,
"config_te... |
__author__ = 'Konstantin Dmitriev'
import os, sys
import sqlite3
import random
import shutil
import tempfile
from renderchan.utils import mkdirs
class RenderChanCache():
def __init__(self, path, readonly=False):
self.connection=None
self.closed = True
self.readonly=readonly
if no... | {
"repo_name": "morevnaproject/RenderChan",
"path": "renderchan/cache.py",
"copies": "1",
"size": "4797",
"license": "bsd-3-clause",
"hash": 4290435825571470000,
"line_mean": 33.7608695652,
"line_max": 170,
"alpha_frac": 0.5411715656,
"autogenerated": false,
"ratio": 4.349048050770626,
"config_t... |
__author__ = 'Konstantin Dmitriev'
__version__ = '0.9'
import sys
from renderchan.file import RenderChanFile
from renderchan.project import RenderChanProjectManager
from renderchan.module import RenderChanModuleManager, RenderChanModule
from renderchan.utils import mkdirs
from renderchan.utils import float_trunc
from ... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/core.py",
"copies": "1",
"size": "54487",
"license": "bsd-3-clause",
"hash": 8727640066434094000,
"line_mean": 41.56796875,
"line_max": 241,
"alpha_frac": 0.5294657441,
"autogenerated": false,
"ratio": 4.449371223256573,
"config_tes... |
__author__ = "Konstantin Klementiev"
__date__ = "1 Mar 2012"
import sys
sys.path.append(r"c:\Ray-tracing")
#sys.path.append(r"/media/sf_Ray-tracing")
import numpy as np
#import matplotlib as mpl
#mpl.use('agg')
import matplotlib.pyplot as plt
import xrt.plotter as xrtp
import xrt.runner as xrtr
import xrt.backends.du... | {
"repo_name": "kklmn/xrt",
"path": "examples/withDummy/logo_xrt.py",
"copies": "1",
"size": "3308",
"license": "mit",
"hash": 5668843378104335000,
"line_mean": 34.5698924731,
"line_max": 79,
"alpha_frac": 0.6067110036,
"autogenerated": false,
"ratio": 2.7728415758591787,
"config_test": false,
... |
__author__ = "Konstantin Osipov <kostja.osipov@gmail.com>"
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | {
"repo_name": "nvoron23/tarantool",
"path": "test/lib/box_connection.py",
"copies": "1",
"size": "3219",
"license": "bsd-2-clause",
"hash": 5971460362469947000,
"line_mean": 35.1685393258,
"line_max": 112,
"alpha_frac": 0.6974215595,
"autogenerated": false,
"ratio": 4.185955786736021,
"config_t... |
__author__ = 'korantin'
from bs4 import BeautifulSoup as bs
class transcriberExtracteur:
"""
A long terme,cette classe va dépouiller un fichier trs.
Elle prendra en compte toutes les étiquettes.
(racine)
Trans [scribe, audio_filename, version, version_date]
Topics []
... | {
"repo_name": "Krolov18/Languages",
"path": "soxCutting/transcriberExtracteur.py",
"copies": "1",
"size": "1306",
"license": "apache-2.0",
"hash": -4497691475758959600,
"line_mean": 36.2285714286,
"line_max": 112,
"alpha_frac": 0.574500768,
"autogenerated": false,
"ratio": 3.6066481994459836,
"... |
__author__ = 'korantin'
from codecs import open
import transcriberExtracteur
import DecoupeurFichier
import argparse
import sqlite3
import yaml
import DecoupeurRecursif
def soxCutting():
parser = argparse.ArgumentParser(
prog="splitter",
description="",
usage="%(prog)s [options] input out... | {
"repo_name": "Krolov18/Languages",
"path": "soxCutting/soxCutting 2.py",
"copies": "1",
"size": "3491",
"license": "apache-2.0",
"hash": -5246463678591831000,
"line_mean": 30.6181818182,
"line_max": 90,
"alpha_frac": 0.5549166187,
"autogenerated": false,
"ratio": 3.5238095238095237,
"config_te... |
__author__ = 'korantin'
from DecoupeurRecursif import DecoupeurRecursif
import re, sys
from yaml import load, dump
from codecs import open
import pickle
with open("../RESSOURCES/lefff-2.1.txt",'r','latin-1') as lexique:
lexicon = []
for ligne in lexique:
if not ligne.startswith('#'):
lexi... | {
"repo_name": "Krolov18/Languages",
"path": "lefffExtractor/LefffExtractor.py",
"copies": "1",
"size": "4919",
"license": "apache-2.0",
"hash": -2637057298580641000,
"line_mean": 36.6076923077,
"line_max": 123,
"alpha_frac": 0.5840834697,
"autogenerated": false,
"ratio": 3.3094109681787405,
"co... |
__author__ = 'korantin'
from nltk.util import everygrams
from difflib import *
from traitementKalaba import FormeurTXT
from itertools import combinations,groupby
from codecs import open
class KalabaResolver:
"""
Classe qui prend un corpus aligné en input. soit des couple (langue1,langue2) avec aucune anno... | {
"repo_name": "Krolov18/Languages",
"path": "Kalaba_resolution/KalabaResolver.py",
"copies": "1",
"size": "3985",
"license": "apache-2.0",
"hash": -1698060854800681500,
"line_mean": 40.40625,
"line_max": 120,
"alpha_frac": 0.6542526422,
"autogenerated": false,
"ratio": 3.3283082077051924,
"conf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.