text stringlengths 0 1.05M | meta dict |
|---|---|
import numpy as np
from ..utils import _check_option
# TODO: Add more localization accuracy functions. For example, distance between
# true dipole position (in simulated stc) and the centroid of the
# estimated activity.
def _check_stc(stc1, stc2):
"""Check that stcs are compatible."""
if stc1.... | {
"repo_name": "mne-tools/mne-python",
"path": "mne/simulation/metrics.py",
"copies": "8",
"size": "1972",
"license": "bsd-3-clause",
"hash": -9192677128349642000,
"line_mean": 29.8125,
"line_max": 79,
"alpha_frac": 0.6480730223,
"autogenerated": false,
"ratio": 3.8143133462282397,
"config_test"... |
__author__ = 'syso'
from bitarray import bitarray
from itertools import combinations
import random
import os
def All_var(F):
all_vars = [];
for i in range(len(F)):
all_vars = all_vars + F[i];
l = set(all_vars);
return list(l);
def BFSAT(F):
all_vars = All_var(F);
res = [[],[]];
for... | {
"repo_name": "crocs-muni/data-generation",
"path": "data_generation.py",
"copies": "1",
"size": "1887",
"license": "mit",
"hash": 5931160037889639000,
"line_mean": 20.6896551724,
"line_max": 79,
"alpha_frac": 0.4970853206,
"autogenerated": false,
"ratio": 3.063311688311688,
"config_test": fals... |
__author__ = 'sz372'
import cv2
import itertools
import numpy as np
def intersects(rect1, rect2):
def _intersects(a, b, dim):
if dim == 'y':
p = 1
s = 3
elif dim == 'x':
p = 0
s = 2
else:
raise ValueError("either x or y for dim")... | {
"repo_name": "szakrewsky/text-search",
"path": "utils.py",
"copies": "1",
"size": "2901",
"license": "mit",
"hash": 6632944396027060000,
"line_mean": 26.6380952381,
"line_max": 94,
"alpha_frac": 0.5305067218,
"autogenerated": false,
"ratio": 3.3460207612456747,
"config_test": false,
"has_no_... |
__author__ = 'sz372'
import cv2
import numpy as np
import os
import progressbar
def load_raw(n=0):
rootdir = '../coupon-db/English/Fnt'
files = [os.path.join(subdir, file) for subdir, dirs, files in os.walk(rootdir) for file in files]
if n > 0:
files = np.random.choice(files, n)
images = np.e... | {
"repo_name": "szakrewsky/text-search",
"path": "trainingdata.py",
"copies": "1",
"size": "1315",
"license": "mit",
"hash": -6128942060669165000,
"line_mean": 28.2222222222,
"line_max": 125,
"alpha_frac": 0.5885931559,
"autogenerated": false,
"ratio": 2.9484304932735426,
"config_test": false,
... |
__author__ = 'sz372'
import cv2
import numpy as np
SZ=24
bin_n = 16 # Number of bins
affine_flags = cv2.WARP_INVERSE_MAP|cv2.INTER_LINEAR
def deskew(img):
m = cv2.moments(img)
if abs(m['mu02']) < 1e-2:
return img.copy()
skew = m['mu11']/m['mu02']
M = np.float32([[1, skew, -0.5*SZ*skew], [0, ... | {
"repo_name": "szakrewsky/text-search",
"path": "features.py",
"copies": "1",
"size": "2177",
"license": "mit",
"hash": -6138422192579506000,
"line_mean": 33.5714285714,
"line_max": 105,
"alpha_frac": 0.6109324759,
"autogenerated": false,
"ratio": 2.358613217768147,
"config_test": false,
"has... |
__author__ = 'sz372'
import nltk
import searchcriteria
class Match(object):
def __init__(self, window):
self.window = window
def __cmp__(self, other):
return cmp(self.window,other.window)
def __repr__(self):
return "%s(%s)" % (self.__class__, self.window)
def __hash__(self)... | {
"repo_name": "szakrewsky/text-search",
"path": "templates.py",
"copies": "1",
"size": "2864",
"license": "mit",
"hash": -1482452949706960100,
"line_mean": 25.7663551402,
"line_max": 77,
"alpha_frac": 0.5548184358,
"autogenerated": false,
"ratio": 3.5055079559363524,
"config_test": false,
"ha... |
__author__ = 'sz372'
import templates
def test_window():
t = templates.Template('foobar', 0)
assert 'foobar' == t._window('foobar', 0, e=1)
t = templates.Template('foobar', 1)
assert 'foobar' == t._window('foobar', 1, e=1)
assert 'oobar' == t._window('foobar', 2, e=1)
t = templates.Template('... | {
"repo_name": "szakrewsky/text-search",
"path": "tests/test_templates.py",
"copies": "1",
"size": "1051",
"license": "mit",
"hash": 6015041979236004000,
"line_mean": 32.9032258065,
"line_max": 80,
"alpha_frac": 0.5946717412,
"autogenerated": false,
"ratio": 3.2042682926829267,
"config_test": fa... |
__author__ = 'sz372'
import cv2
import numpy as np
from rectutils import filter_duplicates, combine_inside
def get_features(img_grey):
mser = cv2.MSER_create()
regions = mser.detectRegions(img_grey, None)
rects = map(cv2.boundingRect, regions)
return filter_duplicates(rects)
def get_inverse_featur... | {
"repo_name": "szakrewsky/text-search",
"path": "mserfeatures.py",
"copies": "1",
"size": "3177",
"license": "mit",
"hash": -1938991241220142800,
"line_mean": 33.9120879121,
"line_max": 146,
"alpha_frac": 0.6235442241,
"autogenerated": false,
"ratio": 2.576642335766423,
"config_test": false,
... |
__author__ = 'sz372'
import cv2
import numpy as np
import utils
def on_same_line(r1, r2):
x1, y1, w1, h1 = r1
x2, y2, w2, h2 = r2
if abs(y1 - y2) > min(h1,h2)/float(4):
return False
return True
def next_on_same_line(r1, r2):
x1, y1, w1, h1 = r1
x2, y2, w2, h2 = r2
if not on_sam... | {
"repo_name": "szakrewsky/text-search",
"path": "rectutils.py",
"copies": "1",
"size": "3142",
"license": "mit",
"hash": -4584901393313968000,
"line_mean": 27.3063063063,
"line_max": 123,
"alpha_frac": 0.5044557607,
"autogenerated": false,
"ratio": 2.5690923957481604,
"config_test": false,
"h... |
__author__ = 'sz372'
_NUMBERS =[chr(i) for i in range(48,58)]
_UPPER = [chr(i) for i in range(65,91)]
_LOWER = [chr(i) for i in range(97,123)]
_SAMPLES = _NUMBERS + _UPPER + _LOWER
_LABELS = {_SAMPLES[i]: i + 1 for i in range(0, len(_SAMPLES))}
def get_label_value(i):
if(i == 0):
return '\I'
return ... | {
"repo_name": "szakrewsky/text-search",
"path": "searchcriteria.py",
"copies": "1",
"size": "1146",
"license": "mit",
"hash": -7414389302586888000,
"line_mean": 23.4042553191,
"line_max": 80,
"alpha_frac": 0.5357766143,
"autogenerated": false,
"ratio": 3.1922005571030643,
"config_test": false,
... |
__author__ = 'szednik'
from rdflib import Literal, BNode, Namespace, URIRef, Graph, Dataset, RDF, RDFS, XSD
import rdflib.resource
"""
@newfield iri: IRI
"""
PROV = Namespace("http://www.w3.org/ns/prov#")
ds = Dataset(default_union=True)
ds.bind("prov", PROV)
default_graph = ds
#print type(default_graph)
config =... | {
"repo_name": "dahuo2013/test",
"path": "prov.py",
"copies": "1",
"size": "55140",
"license": "apache-2.0",
"hash": -4486716665689949700,
"line_mean": 34.8750813273,
"line_max": 119,
"alpha_frac": 0.6374138556,
"autogenerated": false,
"ratio": 3.7487252702427085,
"config_test": false,
"has_no... |
__author__ = 'szeitlin'
from api import app
import api
import unittest
from flask import Flask, jsonify
from flask.ext.testing import TestCase
from flask_restful import Api, Resource
#this just tests if the test suite is finding the flask app file
try:
print(api.IndexAPI.put.__doc__)
except Exception as e:
... | {
"repo_name": "jupyter/nbindex",
"path": "flask_api_files/app_tests.py",
"copies": "1",
"size": "2435",
"license": "bsd-2-clause",
"hash": -5758098483962392000,
"line_mean": 29.8227848101,
"line_max": 71,
"alpha_frac": 0.6390143737,
"autogenerated": false,
"ratio": 3.8528481012658227,
"config_t... |
__author__ = 'szeitlin'
from collections import Counter
import pandas as pd
from ggplot import *
class Probabinerator:
"""
Create and apply categorical labels using probability binning.
"""
def __init__(self, df: pd.DataFrame, colname:str) -> None:
"""
Initialize required inputs.
... | {
"repo_name": "szeitlin/probability_binning",
"path": "probabinerator.py",
"copies": "1",
"size": "6514",
"license": "mit",
"hash": -7467528762580325000,
"line_mean": 34.7967032967,
"line_max": 107,
"alpha_frac": 0.5693890083,
"autogenerated": false,
"ratio": 3.886634844868735,
"config_test": f... |
__author__ = 'szhang'
import bisect
import random
from _collections import defaultdict
def grade(score, breakpoints,grades):
i =bisect.bisect(breakpoints,score) #list, and compara_element
if i==len(grades):
print "weird:",grades
return grades[-1]
return grades[i]
print 'Welcome to the grad... | {
"repo_name": "dramaticlly/Python4Interview",
"path": "binaryinsert.py",
"copies": "1",
"size": "1384",
"license": "mit",
"hash": 1423449498706986500,
"line_mean": 24.1636363636,
"line_max": 79,
"alpha_frac": 0.6849710983,
"autogenerated": false,
"ratio": 2.9446808510638296,
"config_test": fals... |
__author__ = 'szhang'
# Word as referee for the tictactoe
# decide if it's winning for x or o or draw
# possibly 8 winning condition
# X for x, O for o, . for empty slot
# para: list of strings(3)
"""Others elegant solution
win_pos=[ game_result[0], game_result[1], game_result[2],\ #all 3 rows
''.join([ col... | {
"repo_name": "dramaticlly/Python4Interview",
"path": "TicTacToe.py",
"copies": "1",
"size": "2786",
"license": "mit",
"hash": -2334939030422576000,
"line_mean": 32.9756097561,
"line_max": 323,
"alpha_frac": 0.5330222541,
"autogenerated": false,
"ratio": 2.929547844374343,
"config_test": false,... |
__author__ = 't800'
def distance(ai, aj, bi, bj):
return abs(ai - bi) + abs(aj - bj)
def next_move(posr, posc, board):
"""
:param posr:
:param posc:
:param board:
:return: nearest trash location
"""
if board[posr][posc] == 'd':
print 'CLEAN'
return
min_distance = f... | {
"repo_name": "minhtriet/hacker_rank",
"path": "botclean.py",
"copies": "1",
"size": "1143",
"license": "apache-2.0",
"hash": 419900644663935040,
"line_mean": 24.9772727273,
"line_max": 112,
"alpha_frac": 0.5048118985,
"autogenerated": false,
"ratio": 3.0891891891891894,
"config_test": false,
... |
__author__ = 't800'
def distance(ai, aj, bi, bj):
return abs(ai - bi) + abs(aj - bj)
def next_move(posr, posc, dimh, dimw, board):
"""
:param posr:
:param posc:
:param board:
:return: nearest trash location
"""
if board[posr][posc] == 'd':
print 'CLEAN'
return
min_... | {
"repo_name": "minhtriet/hacker_rank",
"path": "botclean_large.py",
"copies": "1",
"size": "1216",
"license": "apache-2.0",
"hash": -7957288791128702000,
"line_mean": 26.0444444444,
"line_max": 112,
"alpha_frac": 0.5082236842,
"autogenerated": false,
"ratio": 3.04,
"config_test": false,
"has_... |
__author__ = "Taeber Rapczak <taeber@ufl.edu>"
__copyright__ = "Copyright 2014, University of Florida"
__license__ = "BSD 3-Clause"
class Form(object):
def __init__(self, data):
try:
data.xpath('.')
except Exception as data_exception:
print data_exception
raise... | {
"repo_name": "indera/redi",
"path": "redi/form.py",
"copies": "1",
"size": "2322",
"license": "bsd-3-clause",
"hash": 2563863668578084400,
"line_mean": 25.0898876404,
"line_max": 79,
"alpha_frac": 0.5521102498,
"autogenerated": false,
"ratio": 4.095238095238095,
"config_test": false,
"has_no... |
__author__ = 'tahsmith'
from operator import add
import os
from cmake.context import Context
from functools import reduce
class VariableReference(object):
def __init__(self, tokens):
self.name = tokens[0]
def evaluate(self, ctx):
"""
Perform any nested interpolations and give the va... | {
"repo_name": "tahsmith/pycmake",
"path": "cmake/arguments/argument.py",
"copies": "1",
"size": "1893",
"license": "mit",
"hash": 4358481068837691400,
"line_mean": 25.2916666667,
"line_max": 104,
"alpha_frac": 0.6138404649,
"autogenerated": false,
"ratio": 4.3517241379310345,
"config_test": fal... |
__author__ = 'tahsmith'
import sys
import argparse
import pyparsing
from cmake.parser import Parser
from cmake.context import Context
from cmake.functions.message import message
from cmake.functions.set import set
argparser = argparse.ArgumentParser()
group = argparser.add_mutually_exclusive_group()
group.add_argume... | {
"repo_name": "tahsmith/pycmake",
"path": "cmake.py",
"copies": "1",
"size": "1555",
"license": "mit",
"hash": -5035103110964046000,
"line_mean": 27.2727272727,
"line_max": 94,
"alpha_frac": 0.6308681672,
"autogenerated": false,
"ratio": 3.976982097186701,
"config_test": false,
"has_no_keywor... |
__author__ = 'Taikor'
from spam_killer import converter
from spam_killer import spam_filter
from spam_killer import easy
""" Test Converter functionality (xlsx to txt)
file_path = "C:\workspace\Github_MasterRepository\spam_killer_github\spam_killer\Debug\汽车3.xlsx"
excel_to_txt_con = converter(file_path, "Excel", "Tx... | {
"repo_name": "furaoing/spam_killer_github",
"path": "spam_killer/Debug/test_module.py",
"copies": "1",
"size": "1278",
"license": "bsd-3-clause",
"hash": -238693362473171000,
"line_mean": 32.2368421053,
"line_max": 118,
"alpha_frac": 0.7591125198,
"autogenerated": false,
"ratio": 2.7139784946236... |
__author__ = 'Taio'
import os
from utils.noflib import Noflib
import logging
logger = logging.getLogger('install-modules')
logging.basicConfig(filename='/var/log/get-dns/install-modules.log', level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
run = Noflib()
def get_modules():
... | {
"repo_name": "jiasir/get-dns",
"path": "install-modules.py",
"copies": "1",
"size": "1037",
"license": "mit",
"hash": 6588657609913649000,
"line_mean": 23.7142857143,
"line_max": 152,
"alpha_frac": 0.6403085824,
"autogenerated": false,
"ratio": 3.355987055016181,
"config_test": false,
"has_n... |
__author__ = 'taisuke'
import cv2
import numpy as np
from form import Ui_Form
from PyQt5.QtCore import QRect
from PyQt5.QtGui import QPixmap, QImage
from PyQt5.QtWidgets import QApplication, QWidget, QGraphicsScene, QFileDialog, QGraphicsPixmapItem
class Visualizer(QWidget, Ui_Form):
def __init__(self, parent=No... | {
"repo_name": "ProgrammingLab/PolkaDots",
"path": "visualizer/visualizer.py",
"copies": "1",
"size": "1827",
"license": "mit",
"hash": -3786182693450767000,
"line_mean": 29.1833333333,
"line_max": 99,
"alpha_frac": 0.6195472115,
"autogenerated": false,
"ratio": 3.4364326375711576,
"config_test"... |
import kivy
kivy.require('1.0.6')
### Python Libs
import glob
import os
import time
from random import randint
from pprint import pprint
### Main
from kivy.app import App
from kivy.lang import Builder
from kivy.logger import Logger
from kivy.uix.widget import Widget
### Widgets
from kivy.uix.button import Button
f... | {
"repo_name": "tadachi/miniview",
"path": "main.py",
"copies": "1",
"size": "12407",
"license": "mit",
"hash": -5156825309342318000,
"line_mean": 42.5333333333,
"line_max": 186,
"alpha_frac": 0.6274683646,
"autogenerated": false,
"ratio": 3.6794187425860025,
"config_test": false,
"has_no_keyw... |
__author__ = 'Tala'
from pykinect2 import PyKinectV2
from pykinect2.PyKinectV2 import *
from pykinect2 import PyKinectRuntime
import ctypes
import time
import _ctypes
from Kinect_Gestures import *
#!/usr/bin/env python
import sys
try:
import readline
except ImportError:
import pyreadline as readline
import o... | {
"repo_name": "Tala/bybop",
"path": "src/interactive_Kinect.py",
"copies": "1",
"size": "3440",
"license": "bsd-3-clause",
"hash": 788181463879193700,
"line_mean": 26.7419354839,
"line_max": 158,
"alpha_frac": 0.6220930233,
"autogenerated": false,
"ratio": 3.3333333333333335,
"config_test": fal... |
__author__ = 'Tala'
from pykinect2 import PyKinectV2
from pykinect2.PyKinectV2 import *
from pykinect2 import PyKinectRuntime
class KinectGestures(object):
def __init__(self):
# TODO
return
class SpinGesture(KinectGestures):
# def __init__(self):
# TODO
@staticmethod
def ... | {
"repo_name": "Tala/bybop",
"path": "src/Kinect_Gestures.py",
"copies": "1",
"size": "1931",
"license": "bsd-3-clause",
"hash": -4878654422572993000,
"line_mean": 24.76,
"line_max": 133,
"alpha_frac": 0.6333505955,
"autogenerated": false,
"ratio": 3.3065068493150687,
"config_test": false,
"ha... |
__author__ = 'tal'
#!/usr/bin/env python
import os, sys
sys.path.insert(0, os.path.abspath(".."))
import argparse
import BannerGrabbing.BannerGrabbing
import NetworkMapping.NetworkMapping
import Scanner.Scanner
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-ip', metavar="", help='ip ta... | {
"repo_name": "talp101/Scanning-tool",
"path": "Menu/menu.py",
"copies": "1",
"size": "1848",
"license": "mit",
"hash": -5558986935224907000,
"line_mean": 35.98,
"line_max": 108,
"alpha_frac": 0.6125541126,
"autogenerated": false,
"ratio": 3.225130890052356,
"config_test": false,
"has_no_keyw... |
__author__ = "Tamas Gal"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credits__ = []
__license__ = "MIT"
__maintainer__ = "Tamas Gal"
__email__ = "tgal@km3net.de"
__status__ = "Development"
class UI(object):
"""Represents the settings for the UI."""
fg = "light gray"
bg = "... | {
"repo_name": "tamasgal/km3pipe",
"path": "pipeinspector/settings.py",
"copies": "1",
"size": "1136",
"license": "mit",
"hash": -2627446856376689700,
"line_mean": 26.7073170732,
"line_max": 73,
"alpha_frac": 0.4357394366,
"autogenerated": false,
"ratio": 3.2,
"config_test": false,
"has_no_key... |
__author__ = 'Tamir'
import httplib
import webbrowser
import wx
import os
import random
import struct
from Crypto.Cipher import AES
def ask(message=""):
dlg = wx.TextEntryDialog(None, message, "")
dlg.ShowModal()
result = dlg.GetValue()
dlg.Destroy()
return result
def gui_get_email(text):
# ... | {
"repo_name": "crennui/Cloud-On-Key",
"path": "key_connection.py",
"copies": "1",
"size": "3535",
"license": "mit",
"hash": -3389922344232389600,
"line_mean": 29.2222222222,
"line_max": 76,
"alpha_frac": 0.6036775106,
"autogenerated": false,
"ratio": 3.648090815273478,
"config_test": false,
"... |
__author__ = 'Tamir'
import os
import random
import zipfile
import shutil
import struct
from Crypto.Cipher import AES
def zipdir(path, ziph):
# ziph is zipfile handle
print "hiiiiiii"
for root, dirs, files in os.walk(path):
print files + " " + root + " " + dirs
for file in files:
... | {
"repo_name": "crennui/Cloud-On-Key",
"path": "test_files_key.py",
"copies": "1",
"size": "2548",
"license": "mit",
"hash": -26238314435041670,
"line_mean": 25.2783505155,
"line_max": 73,
"alpha_frac": 0.5745682889,
"autogenerated": false,
"ratio": 3.5487465181058497,
"config_test": false,
"h... |
__author__ = 'tanchao@github'
def sample(A):
north, east, south, west = 0, 0, 0, 0
x, y = 0, 0 # init position
res = 0
for i, v in enumerate(A):
direction = i % 4
if direction == 0: # move north
if x == 0 and y == 0: # initial
y += v
else:
... | {
"repo_name": "tanchao/algo",
"path": "codility/tt3.py",
"copies": "1",
"size": "1418",
"license": "mit",
"hash": 3694570671852244500,
"line_mean": 29.170212766,
"line_max": 82,
"alpha_frac": 0.341325811,
"autogenerated": false,
"ratio": 4.074712643678161,
"config_test": false,
"has_no_keywor... |
__author__ = 'tanchao@github'
def solution(A):
len_a = len(A)
if len_a <= 1: # special case
return 0
A.sort()
cur_count, result = 1, 1
count_list = []
cur = A[0]
for i in xrange(1, len_a):
if cur == A[i]:
cur_count += 1
else:
count_list.appen... | {
"repo_name": "tanchao/algo",
"path": "codility/02.py",
"copies": "1",
"size": "1149",
"license": "mit",
"hash": 2357663108056016400,
"line_mean": 31.8285714286,
"line_max": 87,
"alpha_frac": 0.5239338555,
"autogenerated": false,
"ratio": 3.182825484764543,
"config_test": false,
"has_no_keywo... |
__author__ = 'tanel'
'''
Created on Sep 9, 2013
@author: tanel
'''
import sys
class Arc:
def __init__(self, id, start, end, word_id, score1, score2, phone_ids):
self.id = id
self.start = start
self.end = end
self.word_id = word_id
self.score1 = score1
self.score2 =... | {
"repo_name": "alumae/kaldi-nnet-dur-model",
"path": "dur-model/python/lat-model/lattice.py",
"copies": "1",
"size": "3550",
"license": "bsd-3-clause",
"hash": -4879121983096278000,
"line_mean": 30.6964285714,
"line_max": 147,
"alpha_frac": 0.5064788732,
"autogenerated": false,
"ratio": 3.4299516... |
__author__ = 'tanel'
import argparse
from ws4py.client.threadedclient import WebSocketClient
import time
import threading
import sys
import urllib
import Queue
import json
import time
import os
def rate_limited(maxPerSecond):
minInterval = 1.0 / float(maxPerSecond)
def decorate(func):
lastTimeCalled =... | {
"repo_name": "yifan/kaldi-gstreamer-server",
"path": "kaldigstserver/client.py",
"copies": "1",
"size": "5878",
"license": "bsd-2-clause",
"hash": -6058129413942112000,
"line_mean": 42.8656716418,
"line_max": 238,
"alpha_frac": 0.6073494386,
"autogenerated": false,
"ratio": 3.789813023855577,
... |
__author__ = 'tanel'
import logging
import logging.config
import time
import thread
import argparse
from subprocess import Popen, PIPE
from gi.repository import GObject
import yaml
import json
import sys
import locale
import codecs
import zlib
import base64
import time
from ws4py.client.threadedclient import WebSock... | {
"repo_name": "hoehnp/sirius",
"path": "lucida/speechrecognition/kaldi_gstreamer_asr/kaldigstserver/worker.py",
"copies": "3",
"size": "14976",
"license": "bsd-3-clause",
"hash": -3493251428867793000,
"line_mean": 34.9136690647,
"line_max": 136,
"alpha_frac": 0.6780181624,
"autogenerated": false,
... |
__author__ = 'tanel'
import logging
import logging.config
import time
import thread
import threading
import os
import argparse
from subprocess import Popen, PIPE
from gi.repository import GObject
import yaml
import json
import sys
import locale
import codecs
import zlib
import base64
import time
import tornado.gen
i... | {
"repo_name": "alumae/kaldi-gstreamer-server",
"path": "kaldigstserver/worker.py",
"copies": "1",
"size": "18956",
"license": "bsd-2-clause",
"hash": -934985316444015400,
"line_mean": 43.4976525822,
"line_max": 149,
"alpha_frac": 0.5750158261,
"autogenerated": false,
"ratio": 4.152464403066813,
... |
__author__ = 'tangyh'
def split(basepath, srcfile, trgfile, trainport, validport):
source = open(basepath+srcfile, 'rb').readlines()
target = open(basepath+trgfile, 'rb').readlines()
assert len(source)==len(target), 'sentence should be equal size'
totalsents=len(source)
trainsrc=open(basepath+'tra... | {
"repo_name": "tangyaohua/dl4mt",
"path": "session2/splitdata.py",
"copies": "1",
"size": "1346",
"license": "bsd-3-clause",
"hash": 3400454243869708000,
"line_mean": 30.3255813953,
"line_max": 87,
"alpha_frac": 0.6537890045,
"autogenerated": false,
"ratio": 3.059090909090909,
"config_test": tr... |
__author__ = 'tangy'
import numpy as np
import pickle as pkl
from copy import deepcopy
import re
from py_bing_search import PyBingSearch
import urllib
def get_improved_term(query):
bing = PyBingSearch('') # Add your bing-api key here
result_list, next_url = bing.search("%s wikipedia" % query, limit=3, format=... | {
"repo_name": "saatvikshah1994/hline",
"path": "Subtask1-Revised/helpers.py",
"copies": "1",
"size": "4895",
"license": "mit",
"hash": -7791684748786764000,
"line_mean": 39.131147541,
"line_max": 310,
"alpha_frac": 0.5548518897,
"autogenerated": false,
"ratio": 3.2098360655737705,
"config_test"... |
__author__ = 'tangy'
# -*- coding: utf-8 -*-
import re
from pandas import DataFrame as df
import string
TOY_FLAG = False
#NUM_UTTERANCES = 2908
TOY_UTTERANCES = 20
def clean(utterance, utterance_labels):
cleaned_x=[]
cleaned_y=[]
num_utter=len(utterance)
for id in xrange(num_utter):
ut... | {
"repo_name": "saatvikshah1994/hline",
"path": "Subtask1-Revised/batchio.py",
"copies": "1",
"size": "3781",
"license": "mit",
"hash": -1364767547779456300,
"line_mean": 33.3818181818,
"line_max": 286,
"alpha_frac": 0.5768315261,
"autogenerated": false,
"ratio": 3.2316239316239317,
"config_test... |
__author__ = 'tangy'
from batchio import get_data
"""
Module for running tests to verify the authenticity of generated annotation files
"""
ALLOWED_LABELS_WITH_NERSUB = ["en","hi","bn","ta","gu","mr","kn","te","ml","O","NE_P","NE_L","NE_O","X","MIX"]
ALLOWED_LABELS_WITHOUT_NERSUB = ["en","hi","bn","ta","gu","mr","kn... | {
"repo_name": "saatvikshah1994/hline",
"path": "Subtask1-Revised/tests.py",
"copies": "1",
"size": "2210",
"license": "mit",
"hash": -787743696306446200,
"line_mean": 47.0434782609,
"line_max": 223,
"alpha_frac": 0.6248868778,
"autogenerated": false,
"ratio": 3.2357247437774523,
"config_test": ... |
__author__ = 'tangy'
"""
P/R : http://research.ijcaonline.org/volume61/number1/pxc3884445.pdf
"""
def keyword_prf(y_true,y_pred):
total_precision = 0.0
total_recall = 0.0
for keywords_true,keywords_pred in zip(y_true,y_pred):
keywords_true_set = set(keywords_true)
keywords_pred_set = set(... | {
"repo_name": "saatvikshah1994/SmartMM",
"path": "KeywordExtraction/keyword_metrics.py",
"copies": "1",
"size": "3878",
"license": "mit",
"hash": 6666660260230961000,
"line_mean": 52.1232876712,
"line_max": 101,
"alpha_frac": 0.6877256318,
"autogenerated": false,
"ratio": 3.9774358974358974,
"c... |
__author__ = 'TanJay'
#This will search for the tv series in todays view
from tkFont import BOLD
from operator import contains
import os
from Tkinter import *
import ttk
from splinter import Browser
from bs4 import BeautifulSoup
import requests
import time
from time import gmtime, strftime
#import libtorrent as lt
#Li... | {
"repo_name": "TanJay/eztv_it",
"path": "ez_tv.py",
"copies": "1",
"size": "3392",
"license": "mit",
"hash": 6949105476593076000,
"line_mean": 27.9914529915,
"line_max": 93,
"alpha_frac": 0.555129717,
"autogenerated": false,
"ratio": 3.5444096133751306,
"config_test": false,
"has_no_keywords"... |
__author__ = 'tan'
from juliabox.jbox_tasks import JBPluginTask
from juliabox.interactive import SessContainer
from juliabox.srvr_jboxd import jboxd_method
from user_cluster import UserCluster
class ParallelHousekeep(JBPluginTask):
provides = [JBPluginTask.JBP_CLUSTER]
@staticmethod
def terminate_or_del... | {
"repo_name": "shashi/JuliaBox",
"path": "engine/src/juliabox/plugins/parallel/parallel_housekeep.py",
"copies": "5",
"size": "1174",
"license": "mit",
"hash": 4589883961041494500,
"line_mean": 38.1666666667,
"line_max": 120,
"alpha_frac": 0.6618398637,
"autogenerated": false,
"ratio": 3.76282051... |
__author__ = 'tan'
import datetime
import json
import os
import base64
import httplib2
import tornado
import tornado.web
import tornado.gen
import tornado.httpclient
from tornado.auth import GoogleOAuth2Mixin
from oauth2client import GOOGLE_REVOKE_URI, GOOGLE_TOKEN_URI
from oauth2client.client import OAuth2Credentials... | {
"repo_name": "shashi/JuliaBox",
"path": "engine/src/juliabox/plugins/auth_google/google_auth.py",
"copies": "5",
"size": "5513",
"license": "mit",
"hash": -4419146059167670300,
"line_mean": 40.4586466165,
"line_max": 108,
"alpha_frac": 0.5953201524,
"autogenerated": false,
"ratio": 3.92105263157... |
__author__ = 'tan'
import datetime
import pytz
from decimal import Decimal
from boto.dynamodb2.fields import HashKey, RangeKey
from boto.dynamodb2.types import STRING
from juliabox.db import JBPluginDB, JBoxDBItemNotFound
class JBoxCourseHomework(JBPluginDB):
provides = [JBPluginDB.JBP_TABLE_DYNAMODB, JBPluginD... | {
"repo_name": "shashi/JuliaBox",
"path": "engine/src/juliabox/plugins/course_homework/course_homework_tbl.py",
"copies": "1",
"size": "8802",
"license": "mit",
"hash": -7817982794544891000,
"line_mean": 39.0136363636,
"line_max": 120,
"alpha_frac": 0.5506703022,
"autogenerated": false,
"ratio": 4... |
__author__ = 'tan'
import datetime
import pytz
import json
import traceback
from juliabox.cloud import Compute
from juliabox.jbox_util import JBoxCfg
from juliabox.handlers import JBPluginHandler
from juliabox.interactive import SessContainer
from juliabox.db import JBoxUserV2, JBoxDynConfig
from course_homework_tbl i... | {
"repo_name": "JuliaLang/JuliaBox",
"path": "engine/src/juliabox/plugins/course_homework/course_homework.py",
"copies": "4",
"size": "10943",
"license": "mit",
"hash": -5616596665432185000,
"line_mean": 37.667844523,
"line_max": 137,
"alpha_frac": 0.581193457,
"autogenerated": false,
"ratio": 4.0... |
__author__ = 'tan'
import datetime
import pytz
import json
from juliabox.cloud import Compute
from juliabox.jbox_util import JBoxCfg
from juliabox.handlers import JBPluginHandler
from juliabox.interactive import SessContainer
from juliabox.db import JBoxUserV2, JBoxDynConfig
from course_homework_tbl import JBoxCourseH... | {
"repo_name": "EricForgy/JuliaBox",
"path": "engine/src/juliabox/plugins/course_homework/course_homework.py",
"copies": "3",
"size": "10813",
"license": "mit",
"hash": 2435498477771340000,
"line_mean": 38.1775362319,
"line_max": 137,
"alpha_frac": 0.583649311,
"autogenerated": false,
"ratio": 3.9... |
__author__ = 'tan'
import datetime
import pytz
from boto.dynamodb2.fields import HashKey, RangeKey, GlobalKeysOnlyIndex
from boto.dynamodb2.types import STRING
from juliabox.db import JBoxDB, JBoxDBItemNotFound
class JBoxAPISpec(JBoxDB):
NAME = 'jbox_apispec'
SCHEMA = [
HashKey('api_name', data_typ... | {
"repo_name": "gsd-ufal/Juliabox",
"path": "engine/src/juliabox/db/api_spec.py",
"copies": "1",
"size": "5037",
"license": "mit",
"hash": -3125148146172247000,
"line_mean": 33.2653061224,
"line_max": 111,
"alpha_frac": 0.5648203296,
"autogenerated": false,
"ratio": 3.695524578136464,
"config_te... |
__author__ = 'tan'
import json
import datetime
import pytz
from boto.dynamodb2.fields import HashKey, GlobalKeysOnlyIndex
from boto.dynamodb2.types import NUMBER, STRING
from juliabox.db import JBPluginDB, JBoxDBItemNotFound
class JBoxDiskState(JBPluginDB):
provides = [JBPluginDB.JBP_TABLE_DYNAMODB]
NAME =... | {
"repo_name": "mdpradeep/JuliaBox",
"path": "engine/src/juliabox/plugins/vol_ebs/disk_state_tbl.py",
"copies": "8",
"size": "4675",
"license": "mit",
"hash": 1224874089336761300,
"line_mean": 31.9225352113,
"line_max": 100,
"alpha_frac": 0.5818181818,
"autogenerated": false,
"ratio": 3.6494925839... |
__author__ = 'tan'
import multiprocessing
import psutil
from jbox_util import LoggerMixin, parse_iso_time
from juliabox.db import JBPluginDB
class BaseContainer(LoggerMixin):
DCKR = None
LAST_CPU_PCT = None
INITIAL_DISK_USED_PCT = None
# JuliaBox service daemon container names are suffixed so that t... | {
"repo_name": "JuliaLang/JuliaBox",
"path": "engine/src/juliabox/jbox_container.py",
"copies": "8",
"size": "7087",
"license": "mit",
"hash": 7961004482843963000,
"line_mean": 32.5924170616,
"line_max": 122,
"alpha_frac": 0.5948920559,
"autogenerated": false,
"ratio": 3.716308337703199,
"config... |
__author__ = 'tan'
import os
from juliabox.handlers import JBPluginHandler, JBPluginUI
from juliabox.interactive import SessContainer
from juliabox.db import JBoxUserV2
from juliabox.vol import VolMgr, JBoxVol
from user_cluster import UserCluster
class ParallelUIModule(JBPluginUI):
provides = [JBPluginUI.JBP_UI_... | {
"repo_name": "gsd-ufal/Juliabox",
"path": "engine/src/juliabox/plugins/parallel/parallel_handler.py",
"copies": "8",
"size": "6340",
"license": "mit",
"hash": 2555972879287638500,
"line_mean": 37.8957055215,
"line_max": 116,
"alpha_frac": 0.5742902208,
"autogenerated": false,
"ratio": 3.74483165... |
__author__ = 'tan'
import os
from juliabox.handlers import JBPluginHandler, JBPluginUI
from juliabox.jbox_tasks import JBPluginTask, JBoxAsyncJob
from juliabox.interactive import SessContainer
from juliabox.db import JBoxUserV2
from juliabox.vol import JBoxVol
from juliabox.plugins.compute_ec2 import CompEC2
from ebs ... | {
"repo_name": "JuliaLang/JuliaBox",
"path": "engine/src/juliabox/plugins/vol_ebs/ebs_handler.py",
"copies": "8",
"size": "5802",
"license": "mit",
"hash": 5094554552325624000,
"line_mean": 35.9617834395,
"line_max": 116,
"alpha_frac": 0.5961737332,
"autogenerated": false,
"ratio": 3.5313451004260... |
__author__ = 'tan'
import os
from juliabox.handlers import JBPluginHandler, JBPluginUI
from juliabox.jbox_util import JBoxCfg
from juliabox.db import JBoxUserV2, JBoxAPISpec, JBoxDBItemNotFound
class APIAdminUIModule(JBPluginUI):
provides = [JBPluginUI.JBP_UI_CONFIG_SECTION]
TEMPLATE_PATH = os.path.dirname(_... | {
"repo_name": "tanmaykm/JuliaBox",
"path": "engine/src/juliabox/plugins/api_admin/api.py",
"copies": "8",
"size": "6105",
"license": "mit",
"hash": -6546364685952526000,
"line_mean": 33.6931818182,
"line_max": 105,
"alpha_frac": 0.5755937756,
"autogenerated": false,
"ratio": 3.7135036496350367,
... |
__author__ = 'tan'
import os
from juliabox.handlers import JBPluginHandler, JBPluginUI
from juliabox.jbox_util import JBoxCfg
from juliabox.db import JBoxUserV2, JBoxDBItemNotFound
class UserAdminUIModule(JBPluginUI):
provides = [JBPluginUI.JBP_UI_CONFIG_SECTION]
TEMPLATE_PATH = os.path.dirname(__file__)
... | {
"repo_name": "shashi/JuliaBox",
"path": "engine/src/juliabox/plugins/user_admin/user_admin.py",
"copies": "8",
"size": "5440",
"license": "mit",
"hash": 3969167018243362300,
"line_mean": 32.5864197531,
"line_max": 105,
"alpha_frac": 0.5698529412,
"autogenerated": false,
"ratio": 3.66083445491251... |
__author__ = 'tan'
import os
import tornado
import tornado.web
import tornado.gen
import tornado.httpclient
from juliabox.jbox_util import unquote, JBoxCfg
from juliabox.handlers import JBPluginHandler, JBPluginUI
class ZeroAuthUIHandler(JBPluginUI):
provides = [JBPluginUI.JBP_UI_AUTH_BTN]
TEMPLATE_PATH = o... | {
"repo_name": "mr-justin/JuliaBox",
"path": "engine/src/juliabox/plugins/auth_zero/zero_auth.py",
"copies": "8",
"size": "1702",
"license": "mit",
"hash": 498453135302066560,
"line_mean": 31.1132075472,
"line_max": 100,
"alpha_frac": 0.6639247944,
"autogenerated": false,
"ratio": 3.66810344827586... |
__author__ = 'tan'
import pytz
import os
import datetime
from juliabox.jbox_tasks import JBPluginTask
from juliabox.db import JBoxSessionProps
from juliabox.plugins.compute_ec2 import EBSVol
from juliabox.jbox_util import unique_sessname
from juliabox.srvr_jboxd import jboxd_method
from juliabox.interactive import Ses... | {
"repo_name": "mr-justin/JuliaBox",
"path": "engine/src/juliabox/plugins/vol_ebs/ebs_housekeep.py",
"copies": "5",
"size": "3461",
"license": "mit",
"hash": -1324759076812713700,
"line_mean": 42.8101265823,
"line_max": 109,
"alpha_frac": 0.6186073389,
"autogenerated": false,
"ratio": 3.5754132231... |
__author__ = 'tan'
import time
import sys
import hashlib
import datetime
import pytz
import docker.utils
from docker.utils import Ulimit
from juliabox.jbox_container import BaseContainer
from juliabox.jbox_util import JBoxCfg
from juliabox.jbox_tasks import JBoxAsyncJob
from juliabox.cloud import Compute
from api_que... | {
"repo_name": "gsd-ufal/Juliabox",
"path": "engine/src/juliabox/api/api_container.py",
"copies": "1",
"size": "11649",
"license": "mit",
"hash": 8386146637461872000,
"line_mean": 39.0343642612,
"line_max": 119,
"alpha_frac": 0.6017683921,
"autogenerated": false,
"ratio": 3.924865229110512,
"con... |
__author__ = 'tan'
import time
import sys
import hashlib
import datetime
import pytz
import docker.utils
from juliabox.jbox_container import BaseContainer
from juliabox.jbox_util import JBoxCfg
from juliabox.jbox_tasks import JBoxAsyncJob
from juliabox.cloud import Compute
from api_queue import APIQueue
from api_conn... | {
"repo_name": "shashi/JuliaBox",
"path": "engine/src/juliabox/api/api_container.py",
"copies": "3",
"size": "11395",
"license": "mit",
"hash": 1567796589531087400,
"line_mean": 39.4113475177,
"line_max": 119,
"alpha_frac": 0.601228609,
"autogenerated": false,
"ratio": 3.937456807187284,
"config... |
__author__ = 'tan'
import time
import zmq
from datetime import timedelta
from zmq.devices.basedevice import ThreadDevice
from juliabox.db import JBoxAPISpec
from juliabox.jbox_util import LoggerMixin
from juliabox.cloud import Compute
class APIQueue(LoggerMixin):
BUFFER_SZ = 20
QUEUES = dict()
QLEN_WT = ... | {
"repo_name": "gsd-ufal/Juliabox",
"path": "engine/src/juliabox/api/api_queue.py",
"copies": "8",
"size": "4073",
"license": "mit",
"hash": -3865936100939484000,
"line_mean": 32.1138211382,
"line_max": 120,
"alpha_frac": 0.5926835257,
"autogenerated": false,
"ratio": 3.451694915254237,
"config_... |
__author__ = 'tan'
import tornado.web
import tornado.httputil
import json
import struct
from handler_base import JBoxHandler
from juliabox.api import APIContainer, APIConnector
from urlparse import urlparse
class APIHandler(JBoxHandler):
def get(self):
self.log_debug("API server handler got GET request")... | {
"repo_name": "mdpradeep/JuliaBox",
"path": "engine/src/juliabox/handlers/api_handler.py",
"copies": "1",
"size": "3244",
"license": "mit",
"hash": 562256034633736800,
"line_mean": 33.8817204301,
"line_max": 113,
"alpha_frac": 0.5662762022,
"autogenerated": false,
"ratio": 3.6738391845979614,
"... |
__author__ = 'tan'
import tornado.web
import tornado.httputil
import json
import struct
from handler_base import JBoxHandler
from juliabox.api import APIContainer, APIConnector
class APIHandler(JBoxHandler):
def get(self):
self.log_debug("API server handler got GET request")
return self.post()
... | {
"repo_name": "shashi/JuliaBox",
"path": "engine/src/juliabox/handlers/api_handler.py",
"copies": "7",
"size": "2601",
"license": "mit",
"hash": -6874027356466150000,
"line_mean": 32.358974359,
"line_max": 113,
"alpha_frac": 0.5705497885,
"autogenerated": false,
"ratio": 3.721030042918455,
"con... |
__author__ = 'TA'
import urllib2
from bs4 import BeautifulSoup
from db_to_file_helpers.jsonDicts_to_file import db_to_file, file_to_db
from db_format_helpers.ship_fields import get_all_ship_fields, list_all_field_values
import unicodecsv
import json
def dnv_registry_listing_soup(alphabetLetter, output_file_base):
... | {
"repo_name": "ThorsteinnAdal/webcrawls_in_singapore_shippinglane",
"path": "dnv_exchange/dnv_registry_soup.py",
"copies": "1",
"size": "5048",
"license": "apache-2.0",
"hash": 1564012802185147600,
"line_mean": 35.5869565217,
"line_max": 136,
"alpha_frac": 0.6442155309,
"autogenerated": false,
"r... |
__author__ = 'tan'
import zmq
import json
from zmq.eventloop import ioloop, zmqstream
from juliabox.jbox_util import LoggerMixin
from api_queue import APIQueue
class APIConnector(LoggerMixin):
CONNS = dict()
MAX_CONNS = 100
CMD_TERMINATE = ":terminate"
def __init__(self, api_name):
self.queu... | {
"repo_name": "mdpradeep/JuliaBox",
"path": "engine/src/juliabox/api/api_connector.py",
"copies": "1",
"size": "4158",
"license": "mit",
"hash": 6390559359842254000,
"line_mean": 35.1565217391,
"line_max": 119,
"alpha_frac": 0.6002886003,
"autogenerated": false,
"ratio": 3.54778156996587,
"conf... |
__author__ = 'tan'
from handler_base import JBoxHandler
from juliabox.jbox_util import JBoxCfg
from juliabox.jbox_crypto import signstr
from juliabox.api import APIContainer
class APIInfoHandler(JBoxHandler):
def get(self):
self.log_debug("APIInfo handler got GET request")
key = self.get_argument... | {
"repo_name": "EricForgy/JuliaBox",
"path": "engine/src/juliabox/handlers/api_info.py",
"copies": "5",
"size": "1509",
"license": "mit",
"hash": 2417569447357190000,
"line_mean": 34.0930232558,
"line_max": 93,
"alpha_frac": 0.6083499006,
"autogenerated": false,
"ratio": 3.735148514851485,
"conf... |
__author__ = 'tan'
import boto
import boto.route53
from juliabox.cloud import JBPluginCloud
from juliabox.jbox_util import JBoxCfg
class JBoxRoute53(JBPluginCloud):
provides = [JBPluginCloud.JBP_DNS, JBPluginCloud.JBP_DNS_ROUTE53]
DOMAIN = None
REGION = None
CONN = None
BUCKETS = dict()
@s... | {
"repo_name": "mdpradeep/JuliaBox",
"path": "engine/src/juliabox/plugins/dns_route53/impl_route53.py",
"copies": "8",
"size": "1366",
"license": "mit",
"hash": -5696599603937585000,
"line_mean": 26.8775510204,
"line_max": 81,
"alpha_frac": 0.6486090776,
"autogenerated": false,
"ratio": 3.52061855... |
__author__ = 'tan'
import boto
import boto.ses
from juliabox.cloud import JBPluginCloud
from juliabox.jbox_util import JBoxCfg
class JBoxSES(JBPluginCloud):
provides = [JBPluginCloud.JBP_SENDMAIL, JBPluginCloud.JBP_SENDMAIL_SES]
REGION = None
CONN = None
@staticmethod
def configure():
... | {
"repo_name": "tanmaykm/JuliaBox",
"path": "engine/src/juliabox/plugins/sendmail_ses/impl_ses.py",
"copies": "8",
"size": "1169",
"license": "mit",
"hash": -3416384967995790000,
"line_mean": 28.9743589744,
"line_max": 100,
"alpha_frac": 0.6578272027,
"autogenerated": false,
"ratio": 3.21153846153... |
__author__ = 'tan'
import datetime
import sys
import pytz
import boto
import boto.utils
import boto.ec2
import boto.ec2.cloudwatch
import boto.ec2.autoscale
from juliabox.cloud import JBPluginCloud
from juliabox.jbox_util import JBoxCfg, parse_iso_time, retry
class CompEC2(JBPluginCloud):
provides = [JBPluginCl... | {
"repo_name": "gsd-ufal/Juliabox",
"path": "engine/src/juliabox/plugins/compute_ec2/impl_ec2.py",
"copies": "1",
"size": "18276",
"license": "mit",
"hash": 3359497212711973000,
"line_mean": 36.9170124481,
"line_max": 119,
"alpha_frac": 0.5935653316,
"autogenerated": false,
"ratio": 3.805121798875... |
__author__ = 'tan'
import os
import boto
from boto.s3.key import Key
from juliabox.cloud import JBPluginCloud
class JBoxS3(JBPluginCloud):
provides = [JBPluginCloud.JBP_BUCKETSTORE, JBPluginCloud.JBP_BUCKETSTORE_S3]
CONN = None
BUCKETS = dict()
@staticmethod
def connect():
if JBoxS3.CON... | {
"repo_name": "shashi/JuliaBox",
"path": "engine/src/juliabox/plugins/bucket_s3/impl_s3.py",
"copies": "8",
"size": "2198",
"license": "mit",
"hash": -3878351469887900000,
"line_mean": 29.5416666667,
"line_max": 80,
"alpha_frac": 0.6210191083,
"autogenerated": false,
"ratio": 3.305263157894737,
... |
__author__ = 'tan'
import socket
import fcntl
import struct
from juliabox.jbox_util import LoggerMixin, JBoxPluginType, JBoxCfg
import random
class JBPluginCloud(LoggerMixin):
""" Interfaces with cloud service providers or provides similar services locally.
- `JBPluginCloud.JBP_BUCKETSTORE`, `JBPluginCloud.... | {
"repo_name": "JuliaLang/JuliaBox",
"path": "engine/src/juliabox/cloud/compute.py",
"copies": "3",
"size": "9182",
"license": "mit",
"hash": -2663579639643060000,
"line_mean": 40.9269406393,
"line_max": 148,
"alpha_frac": 0.6789370508,
"autogenerated": false,
"ratio": 3.744698205546493,
"config... |
__author__ = 'tan'
import socket
import fcntl
import struct
from juliabox.jbox_util import LoggerMixin, JBoxPluginType
class JBPluginCloud(LoggerMixin):
""" Interfaces with cloud service providers or provides similar services locally.
- `JBPluginCloud.JBP_BUCKETSTORE`, `JBPluginCloud.JBP_BUCKETSTORE_S3`:
... | {
"repo_name": "shashi/JuliaBox",
"path": "engine/src/juliabox/cloud/compute.py",
"copies": "4",
"size": "7372",
"license": "mit",
"hash": 5185572782915095000,
"line_mean": 41.3735632184,
"line_max": 148,
"alpha_frac": 0.6886869235,
"autogenerated": false,
"ratio": 3.732658227848101,
"config_tes... |
__author__ = 'tan'
import socket
import signal
import tornado.web
import tornado.auth
from zmq.eventloop import ioloop
from cloud import Compute
import db
from db import is_cluster_leader
from jbox_tasks import JBoxAsyncJob
from jbox_util import LoggerMixin, JBoxCfg
from api import APIContainer
from handlers import ... | {
"repo_name": "gsd-ufal/Juliabox",
"path": "engine/src/juliabox/srvr_jbapi.py",
"copies": "8",
"size": "3064",
"license": "mit",
"hash": -4926005855509328000,
"line_mean": 31.9569892473,
"line_max": 100,
"alpha_frac": 0.6272845953,
"autogenerated": false,
"ratio": 4.020997375328084,
"config_tes... |
__author__ = 'tan'
import socket
from juliabox.cloud import JBPluginCloud
from juliabox.jbox_util import JBoxCfg
from juliabox.db import JBoxInstanceProps
class CompSingleNode(JBPluginCloud):
provides = [JBPluginCloud.JBP_COMPUTE, JBPluginCloud.JBP_COMPUTE_SINGLENODE]
INSTALL_ID = 'JuliaBox'
PUBLIC_HO... | {
"repo_name": "tanmaykm/JuliaBox",
"path": "engine/src/juliabox/plugins/compute_singlenode/impl_singlenode.py",
"copies": "3",
"size": "4856",
"license": "mit",
"hash": -8682908347446098000,
"line_mean": 33.1971830986,
"line_max": 117,
"alpha_frac": 0.663509061,
"autogenerated": false,
"ratio": 3... |
__author__ = 'tan'
import socket
from juliabox.cloud import JBPluginCloud
from juliabox.jbox_util import JBoxCfg
class CompSingleNode(JBPluginCloud):
provides = [JBPluginCloud.JBP_COMPUTE, JBPluginCloud.JBP_COMPUTE_SINGLENODE]
INSTALL_ID = 'JuliaBox'
PUBLIC_HOSTNAME = None
LOCAL_HOSTNAME = None
... | {
"repo_name": "gsd-ufal/Juliabox",
"path": "engine/src/juliabox/plugins/compute_singlenode/impl_singlenode.py",
"copies": "1",
"size": "4540",
"license": "mit",
"hash": -3326788388442787000,
"line_mean": 33.3939393939,
"line_max": 117,
"alpha_frac": 0.6607929515,
"autogenerated": false,
"ratio": ... |
__author__ = 'tan'
import threading
import sqlite3
import decimal
from juliabox.db import JBPluginDB, JBoxDBItemNotFound
from juliabox.jbox_util import JBoxCfg, LoggerMixin
class JBoxSQLiteTable(LoggerMixin):
OP = {
'eq': (' = ?', lambda x: x),
'ne': (' != ?', lambda x: x),
'lte': (' <= ... | {
"repo_name": "mr-justin/JuliaBox",
"path": "engine/src/juliabox/plugins/db_sqlite3/impl_sqlite3.py",
"copies": "8",
"size": "6738",
"license": "mit",
"hash": 6486703026530392000,
"line_mean": 28.4279475983,
"line_max": 94,
"alpha_frac": 0.53650935,
"autogenerated": false,
"ratio": 3.724709784411... |
__author__ = 'tan'
import time
import os
from juliabox.jbox_util import retry, create_host_mnt_command
from impl_ec2 import CompEC2
from juliabox.jbox_util import LoggerMixin
class EBSVol(LoggerMixin):
SH_MOUNT = None
SH_UMOUNT = None
SH_LIST_DIR = None
# @staticmethod
# def _get_block_device_m... | {
"repo_name": "JuliaLang/JuliaBox",
"path": "engine/src/juliabox/plugins/compute_ec2/awsebsvol.py",
"copies": "8",
"size": "9427",
"license": "mit",
"hash": 4258976091547432400,
"line_mean": 37.0161290323,
"line_max": 117,
"alpha_frac": 0.582051554,
"autogenerated": false,
"ratio": 3.464535097390... |
__author__ = 'Tara Crittenden'
# Displays the state of the game in a simple text format.
import Observer
from Message import *
class Display(Observer.Observer):
#Determine which method to display
def notify(self, msg):
if msg.msgtype == 1:
#start of a tournament
self.display_... | {
"repo_name": "ezekie97/RPSPlayer",
"path": "Display.py",
"copies": "2",
"size": "4511",
"license": "apache-2.0",
"hash": -8552964997745363000,
"line_mean": 26.6748466258,
"line_max": 85,
"alpha_frac": 0.5154067834,
"autogenerated": false,
"ratio": 3.8424190800681433,
"config_test": false,
"h... |
__author__ = 'Tara Crittenden'
# Displays the state of the game in a simple text format.
import Observer
from Message import *
class Display(Observer.Observer):
#Determine which method to display
def notify(self, msg):
if msg.is_tournament_start_message():
#start of a tournament
... | {
"repo_name": "PaulieC/sprint1_Council_a",
"path": "Display.py",
"copies": "3",
"size": "4556",
"license": "apache-2.0",
"hash": -4913839773391993000,
"line_mean": 27.3043478261,
"line_max": 85,
"alpha_frac": 0.5256804214,
"autogenerated": false,
"ratio": 3.825356842989085,
"config_test": false... |
__author__ = 'tarciso'
import subprocess
import os
import time
from LinuxUtils import LinuxUtils
class HadoopUtils():
@staticmethod
def runHDFSCommand(args):
command = ["/opt/hadoop/bin/hdfs", "dfs"]
command += args.split()
print command
proc = subprocess.Popen(command,stdout... | {
"repo_name": "mari-linhares/hadoop-job-time-prediction",
"path": "utils/experiment/HadoopUtils.py",
"copies": "1",
"size": "4405",
"license": "apache-2.0",
"hash": -6349980952757827000,
"line_mean": 33.1472868217,
"line_max": 141,
"alpha_frac": 0.636322361,
"autogenerated": false,
"ratio": 3.813... |
__author__ = 'tarciso'
import subprocess
class LinuxUtils():
@staticmethod
def runLinuxCommand(command):
print command
proc = subprocess.Popen(command,stdout=subprocess.PIPE,shell=True)
return (proc.communicate(),proc.returncode)
@staticmethod
def checkPathExists(path):
... | {
"repo_name": "mari-linhares/hadoop-job-time-prediction",
"path": "utils/experiment/LinuxUtils.py",
"copies": "1",
"size": "1328",
"license": "apache-2.0",
"hash": -4945913246184349000,
"line_mean": 26.6666666667,
"line_max": 74,
"alpha_frac": 0.6219879518,
"autogenerated": false,
"ratio": 4.0120... |
from gvolib.links import Links
class Post:
def __init__(self, feed_item):
self.data = feed_item
self.links_object = Links(self.data)
def __str__(self):
return '\nTitle: {title}' \
'\nAuthor: {author}' \
'\nTags: {tags}' \
'\nLink: {link}' ... | {
"repo_name": "gr33ndata/gvolib",
"path": "gvolib/post.py",
"copies": "1",
"size": "1967",
"license": "mit",
"hash": 7513345550670701000,
"line_mean": 24.2179487179,
"line_max": 55,
"alpha_frac": 0.5221148958,
"autogenerated": false,
"ratio": 4.106471816283925,
"config_test": false,
"has_no_k... |
class Dist:
def __init__(self, feed):
self.feed = feed
def _to_attr_items(self, post, attr):
attr_items = ''
if isinstance(getattr(post, attr), str):
attr_items = [getattr(post, attr)]
if isinstance(getattr(post, attr), unicode):
attr_items = [getattr(p... | {
"repo_name": "gr33ndata/gvolib",
"path": "gvolib/dist.py",
"copies": "1",
"size": "1614",
"license": "mit",
"hash": -482360344164347400,
"line_mean": 37.4523809524,
"line_max": 110,
"alpha_frac": 0.58488228,
"autogenerated": false,
"ratio": 3.6933638443935926,
"config_test": false,
"has_no_k... |
class Progress:
def __init__(self, n, percent=10, silent=False):
''' Initializes progress class
n: number of items to be progressed
percent: print at which percentage steps
'''
self.silent = silent
self.count = 0
self.n = n
self.percent = pe... | {
"repo_name": "gr33ndata/gvolib",
"path": "gvolib/progress.py",
"copies": "1",
"size": "1029",
"license": "mit",
"hash": 1834610844582217000,
"line_mean": 28.4285714286,
"line_max": 83,
"alpha_frac": 0.5208940719,
"autogenerated": false,
"ratio": 4.397435897435898,
"config_test": false,
"has_... |
import feedparser
from gvolib import feed_links
from gvolib.post import Post
from gvolib.progress import Progress
class Feed:
def __init__(self, url=''):
''' Initialize Feed
url can be name like 'en', 'es', etc.
or real url
'''
self.posts = []
self.url =... | {
"repo_name": "gr33ndata/gvolib",
"path": "gvolib/feed.py",
"copies": "1",
"size": "1686",
"license": "mit",
"hash": -445194976503860100,
"line_mean": 29.1071428571,
"line_max": 84,
"alpha_frac": 0.5539739027,
"autogenerated": false,
"ratio": 3.805869074492099,
"config_test": false,
"has_no_k... |
__author__ = 'TA'
import csv
import urllib2
import re
from bs4 import BeautifulSoup
def collectFromDNV(imoNumber, subview, itemsToFind):
opener = urllib2.build_opener()
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
url = 'https://exchange.dnv.com/exchange/main.aspx?extool=vessel&subview=%s... | {
"repo_name": "ThorsteinnAdal/webcrawls_in_singapore_shippinglane",
"path": "dnv_exchange/dnv_exchange_soup_imo.py",
"copies": "1",
"size": "8573",
"license": "apache-2.0",
"hash": -6456783352740694000,
"line_mean": 56.7191780822,
"line_max": 142,
"alpha_frac": 0.6030561064,
"autogenerated": false,... |
__author__ = 'TA'
import re
listOfShips = [9086801, 9238806, 9384198, 8914568, 8914556, 9086796, 9323089, 2332197, 9641314]
def makeNewFile(F,A):
"""
creates a file from a list that is provided
:param file: a file in the folder
:param list: a python list of integers i.e. [1,2,3,5]
"""
... | {
"repo_name": "ThorsteinnAdal/webcrawls_in_singapore_shippinglane",
"path": "IMOrobbery/imosFileManagement.py",
"copies": "1",
"size": "2553",
"license": "apache-2.0",
"hash": -5059972577027430000,
"line_mean": 27.7093023256,
"line_max": 95,
"alpha_frac": 0.598511555,
"autogenerated": false,
"rat... |
__author__ = 'tarzan'
from pyramid.config import Configurator
from unittest import TestCase
from . import Api, ApiRequest, BaseObject
import requests
import logging
import colander
import limone
from formencode import Schema, validators
class FBColanderSchema(colander.MappingSchema):
id = colander.SchemaNode(cola... | {
"repo_name": "tarzanjw/restful_client",
"path": "restful_client/test_.py",
"copies": "1",
"size": "3000",
"license": "mpl-2.0",
"hash": 84224500126137710,
"line_mean": 29.3131313131,
"line_max": 82,
"alpha_frac": 0.6363333333,
"autogenerated": false,
"ratio": 3.7037037037037037,
"config_test":... |
__author__ = 'tarzan'
from pyramid.httpexceptions import HTTPFound
from pyramid.security import remember, forget
from pyramid.authentication import AuthTktAuthenticationPolicy
from urllib import quote_plus
import requests
import json
import models
def vgid_velruse_callback_view(context, request):
token = request.... | {
"repo_name": "tarzanjw/vgid_velruse_client",
"path": "__init__.py",
"copies": "1",
"size": "3237",
"license": "mpl-2.0",
"hash": -3219484040635707400,
"line_mean": 42.7432432432,
"line_max": 96,
"alpha_frac": 0.6348470806,
"autogenerated": false,
"ratio": 3.5728476821192054,
"config_test": tru... |
__author__ = 'tarzan'
import importlib
import re
import sys
from datetime import datetime
from sqlalchemy import Table, Column, types
from pyramid.security import Everyone, Authenticated
__all__ = ['import_settings', 'User', 'get_user_groups', 'get_user']
DBSession = None
Base = None
User = None
class _Base_User(ob... | {
"repo_name": "tarzanjw/vgid_velruse_client",
"path": "models.py",
"copies": "1",
"size": "2498",
"license": "mpl-2.0",
"hash": -9104458398735978000,
"line_mean": 28.75,
"line_max": 81,
"alpha_frac": 0.6064851882,
"autogenerated": false,
"ratio": 3.706231454005935,
"config_test": false,
"has_... |
__author__ = 'tarzan'
import inspect
from .backend_manager import create_backend_manager
_registered_models = [
]
def get_model_url(request, model, action=None):
model = get_registered_model(model)
traverse = [model.__backend_manager__.slug,]
if action:
traverse.append(action)
return request... | {
"repo_name": "tarzanjw/pyramid_backend",
"path": "pyramid_backend/model.py",
"copies": "1",
"size": "1042",
"license": "mpl-2.0",
"hash": 7784252360589190000,
"line_mean": 25.7435897436,
"line_max": 83,
"alpha_frac": 0.6554702495,
"autogenerated": false,
"ratio": 3.946969696969697,
"config_tes... |
__author__ = 'tarzan'
import itertools
import inspect
import requests
import urlparse
from urllib import urlencode
import re
import json
import logging
logger = logging.getLogger(__name__)
class RestFulError(ValueError):
def __init__(self, response, message, **kwargs):
self.response = response
s... | {
"repo_name": "tarzanjw/restful_client",
"path": "restful_client/__init__.py",
"copies": "1",
"size": "10996",
"license": "mpl-2.0",
"hash": 1959436216112958500,
"line_mean": 32.626911315,
"line_max": 93,
"alpha_frac": 0.5609312477,
"autogenerated": false,
"ratio": 4.06206132249723,
"config_tes... |
__author__ = 'tarzan'
import six
if six.PY2:
from urllib import urlencode
else:
from urllib.parse import urlencode
import inspect
import deform
from pyramid_backend.helpers.paginate import Page
from pyramid.httpexceptions import HTTPFound
from pyramid.view import view_config
from . import cell_datatype
from ..... | {
"repo_name": "tarzanjw/pyramid_backend",
"path": "pyramid_backend/views/model_view.py",
"copies": "1",
"size": "8530",
"license": "mpl-2.0",
"hash": 32736943365525710,
"line_mean": 34.3941908714,
"line_max": 99,
"alpha_frac": 0.5377491208,
"autogenerated": false,
"ratio": 3.974836905871389,
"c... |
__author__ = 'tashigaofei'
from scrapy.spider import Spider
from scrapy.selector import Selector
from tutorial.blogItem import BlogItem
from scrapy.http import Request ,Response
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.contrib.spiders import Rule, CrawlSpider
import urlparse
class... | {
"repo_name": "tashigaofei/BlogSpider",
"path": "tutorial/spiders/blogSpider.py",
"copies": "1",
"size": "1345",
"license": "mit",
"hash": -4362147300673533400,
"line_mean": 34.4210526316,
"line_max": 74,
"alpha_frac": 0.6141263941,
"autogenerated": false,
"ratio": 3.6058981233243967,
"config_t... |
__author__ = 'tashigaofei'
import json
import os
from scrapy.item import Item, Field
from scrapy.contrib.pipeline.files import FilesPipeline
from scrapy import log
from scrapy.exceptions import DropItem
from scrapy.http.request import Request
from scrapy.utils.project import get_project_settings
class DongwuItem... | {
"repo_name": "tashigaofei/BlogSpider",
"path": "tutorial/DongwuItem.py",
"copies": "1",
"size": "1742",
"license": "mit",
"hash": 6229935912722691000,
"line_mean": 31.8867924528,
"line_max": 103,
"alpha_frac": 0.6280137773,
"autogenerated": false,
"ratio": 3.519191919191919,
"config_test": fal... |
__author__ = 'tauren'
__author__ = 'tauren'
from flask import Flask, jsonify, send_file
import requests
import xmltodict
def create_app():
app = Flask(__name__)
# app.config.from_object('config')
@app.route('/')
def index():
return send_file('static/index.html')
@app.route('/tsunamis')... | {
"repo_name": "taurenk/World-Emergencies-Map",
"path": "app/__init__.py",
"copies": "1",
"size": "1310",
"license": "mit",
"hash": -5116702816208868000,
"line_mean": 28.7727272727,
"line_max": 84,
"alpha_frac": 0.5435114504,
"autogenerated": false,
"ratio": 3.569482288828338,
"config_test": fal... |
__author__ = 'Tauren'
from app.models import AddressResult
from Levenshtein import distance
def rank_city_candidates(addr_city, addr_state, addr_zip, city_candidates):
for candidate in city_candidates:
if addr_city and addr_city.title() == candidate.city:
candidate.score += 2
if addr_... | {
"repo_name": "taurenk/PinPoint-Geocoder-Python",
"path": "app/geocoder/ranking.py",
"copies": "1",
"size": "1123",
"license": "mit",
"hash": -698966937919661200,
"line_mean": 30.1944444444,
"line_max": 91,
"alpha_frac": 0.6544968833,
"autogenerated": false,
"ratio": 4.054151624548736,
"config_... |
__author__ = 'tauren'
from flask import abort
from flask_restful import Resource
from flask.ext.restful import fields, marshal, reqparse
from flask_login import current_user
from models import Task, db
task_fields = {
'title': fields.String,
'user_id': fields.Integer,
'uri': fields.Url('task')... | {
"repo_name": "taurenk/Flask-Angular-TaskList",
"path": "backend/app/task_api.py",
"copies": "1",
"size": "1261",
"license": "mit",
"hash": -7925072355954517000,
"line_mean": 27.0222222222,
"line_max": 75,
"alpha_frac": 0.5908009516,
"autogenerated": false,
"ratio": 3.7867867867867866,
"config_... |
__author__ = 'tauren'
from flask import abort
from flask_restful import Resource
from flask.ext.restful import fields, marshal, reqparse
from flask_login import current_user
from models import User, db
user_fields = {
'username': fields.String,
'id': fields.Integer,
'uri': fields.Url('user')
}... | {
"repo_name": "taurenk/Flask-Angular-TaskList",
"path": "backend/app/user_api.py",
"copies": "1",
"size": "1159",
"license": "mit",
"hash": -4835978368832591000,
"line_mean": 30.3243243243,
"line_max": 80,
"alpha_frac": 0.5987920621,
"autogenerated": false,
"ratio": 3.942176870748299,
"config_t... |
__author__ = 'tauren'
from flask import Blueprint, json, jsonify, request, abort
from models import User, db
from flask_login import LoginManager, login_user
from itsdangerous import URLSafeTimedSerializer
auth_api = Blueprint('auth_api', __name__)
login_manager = LoginManager()
login_serializer = URLSafeTimedSerial... | {
"repo_name": "taurenk/Flask-Angular-TaskList",
"path": "backend/app/auth.py",
"copies": "1",
"size": "1522",
"license": "mit",
"hash": -4511253912764412000,
"line_mean": 26.6727272727,
"line_max": 81,
"alpha_frac": 0.6754270696,
"autogenerated": false,
"ratio": 3.7121951219512197,
"config_test... |
__author__ = 'Tauren'
from flask import Flask
from flask.ext.restful import Api
from flask.ext.sqlalchemy import SQLAlchemy
import logging
db = SQLAlchemy()
app = Flask(__name__)
def attach_logger(app):
logger = logging.getLogger('app')
logger.setLevel(logging.DEBUG)
# create a file handler
handle... | {
"repo_name": "taurenk/PinPoint-Geocoder-Python",
"path": "app/__init__.py",
"copies": "1",
"size": "1138",
"license": "mit",
"hash": 4016627511644329000,
"line_mean": 23.2340425532,
"line_max": 89,
"alpha_frac": 0.6915641476,
"autogenerated": false,
"ratio": 3.5123456790123457,
"config_test": ... |
__author__ = 'tauren'
from flask import Flask
from flask_restful import Api
from flask_login import login_required
def create_app(config_file):
application = Flask(__name__)
application.config.from_pyfile(config_file)
from models import db, Task, User
from auth import auth_api, login_manager
fr... | {
"repo_name": "taurenk/Flask-Angular-TaskList",
"path": "backend/app/__init__.py",
"copies": "1",
"size": "1166",
"license": "mit",
"hash": 6177964758235801000,
"line_mean": 31.4166666667,
"line_max": 90,
"alpha_frac": 0.7066895369,
"autogenerated": false,
"ratio": 3.761290322580645,
"config_te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.