text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Joe Padula'
from mi.core.log import get_logger
log = get_logger()
from mi.idk.config import Config
import unittest
import os
from mi.dataset.driver.optaa_dj.cspp.optaa_dj_cspp_recovered_driver import parse
from mi.dataset.dataset_driver import ParticleDataHandler
class SampleTest(unittest.TestCase):... | {
"repo_name": "JeffRoy/mi-dataset",
"path": "mi/dataset/driver/optaa_dj/cspp/test/test_optaa_dj_cspp_recovered_driver.py",
"copies": "1",
"size": "1072",
"license": "bsd-2-clause",
"hash": 1919063542592438500,
"line_mean": 25.1707317073,
"line_max": 99,
"alpha_frac": 0.6259328358,
"autogenerated": ... |
__author__ = 'joerg'
# http://practicalcryptography.com/miscellaneous/machine-learning/guide-mel-frequency-cepstral-coefficients-mfccs/
import numpy as np
from scikits.audiolab import Sndfile
import python_speech_features as sf
def get_features(filename, numcep, numfilt, winlen, winstep, grad):
f = Sndfile(fi... | {
"repo_name": "matthijsvk/multimodalSR",
"path": "code/audioSR/Experiments/phoneme_recognition/preprocess_TIMIT/features.py",
"copies": "2",
"size": "1304",
"license": "mit",
"hash": 8551513166958335000,
"line_mean": 25.08,
"line_max": 114,
"alpha_frac": 0.6464723926,
"autogenerated": false,
"rat... |
__author__ = 'joerg'
import numpy as np
def get_timit_dict(dic_location):
#read file with all phonemes (silences are all in line 61)
file_obj = open(dic_location, 'r')
phonem_assigment = file_obj.readlines()
file_obj.close()
phonemlist_length = phonem_assigment.__len__()
max_phonem_length = ... | {
"repo_name": "joergfranke/phoneme_recognition",
"path": "preprocess_TIMIT/targets.py",
"copies": "1",
"size": "1794",
"license": "mit",
"hash": 4300327777450305000,
"line_mean": 27.4761904762,
"line_max": 79,
"alpha_frac": 0.5953177258,
"autogenerated": false,
"ratio": 3.2324324324324323,
"con... |
__author__ = 'Joeri Nicolaes'
__author_email__ = 'joerinicolaes@gmail.com'
from datetime import datetime, timedelta
import json
from pytz import timezone
with open('./config.json', 'r') as file:
conf = json.loads(file.read())
TIMEZONE = str(conf['timezone'])
class notifyOwnerToSetSchedule():
"""
Class th... | {
"repo_name": "gourie/ParkingPlaza",
"path": "notifyOwner.py",
"copies": "1",
"size": "6008",
"license": "bsd-3-clause",
"hash": -3164782145035738000,
"line_mean": 53.1261261261,
"line_max": 394,
"alpha_frac": 0.6877496671,
"autogenerated": false,
"ratio": 4.132049518569463,
"config_test": fals... |
__author__ = 'Joeri Nicolaes'
__author_email__ = 'joerinicolaes@gmail.com'
import smtplib
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.parser import Parser
from email.mime.text import MIMEText
class smtpclient:
''... | {
"repo_name": "gourie/ParkingPlaza",
"path": "smtpclient.py",
"copies": "1",
"size": "3632",
"license": "bsd-3-clause",
"hash": -95249545615251150,
"line_mean": 31.1415929204,
"line_max": 103,
"alpha_frac": 0.5729625551,
"autogenerated": false,
"ratio": 4.31353919239905,
"config_test": false,
... |
__author__ = 'Joeri Nicolaes'
__author_email__ = 'joerinicolaes@gmail.com'
__version__ = 'alpha'
#!/usr/bin/python
import io
class adaptEmailTemplate:
def __init__(self, contentfolder):
self.contenturl = contentfolder
def adaptAddUnitEmailTemplate(self, useremail, username, unitname, poiname, eventr... | {
"repo_name": "gourie/ParkingPlaza",
"path": "adaptEmailTemplate.py",
"copies": "1",
"size": "9000",
"license": "bsd-3-clause",
"hash": 1050897660267643600,
"line_mean": 39.1830357143,
"line_max": 129,
"alpha_frac": 0.5933333333,
"autogenerated": false,
"ratio": 4.484304932735426,
"config_test"... |
import numpy as np
import chainer
from chainer import cuda, Function, gradient_check, report, training, utils, Variable
from chainer import datasets, iterators, optimizers, serializers
from chainer import Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
from chainer.training import extens... | {
"repo_name": "gourie/training_RL",
"path": "chainerMNISTtutorial.py",
"copies": "1",
"size": "3024",
"license": "bsd-3-clause",
"hash": 389690841217280400,
"line_mean": 39.8648648649,
"line_max": 215,
"alpha_frac": 0.6923585842,
"autogenerated": false,
"ratio": 3.527421236872812,
"config_test"... |
__author__ = 'joesacher'
import datetime as dt
class AlienTag(object):
def __init__(self, taglist_entry):
self.disc = 0
self.last = 0
self.last_last = 0
self.id = 0
self.ant = 0
self.count = 0
self.proto = 0
self.rssi = 0
self.freq = 0
# ... | {
"repo_name": "sacherjj/python-AlienRFID",
"path": "alien_tag.py",
"copies": "1",
"size": "2467",
"license": "mit",
"hash": 3185345476501898000,
"line_mean": 31.038961039,
"line_max": 165,
"alpha_frac": 0.5500608026,
"autogenerated": false,
"ratio": 3.3519021739130435,
"config_test": false,
"... |
__author__ = 'Joe Sacher'
try:
import serial
except ImportError as err:
import sys
sys.exit("ImportError: {}.\nIs pySerial package installed?".format(err))
from array_devices import array3710
import time
# Note: Only new introduced functionality has comments.
# Look at simple_example.py first if you have... | {
"repo_name": "sacherjj/array_devices",
"path": "programming_example.py",
"copies": "1",
"size": "2982",
"license": "mit",
"hash": -4799242445197718000,
"line_mean": 32.8863636364,
"line_max": 112,
"alpha_frac": 0.7384305835,
"autogenerated": false,
"ratio": 3.408,
"config_test": false,
"has_... |
__author__ = 'Joe Sacher'
try:
import serial
except ImportError as err:
import sys
sys.exit("ImportError: {}.\nIs pySerial package installed?".format(err))
from array_devices import array3710
import time
# See pySerial Documentation for Creating Connection
# http://pyserial.sourceforge.net/
# Use COM? ... | {
"repo_name": "sacherjj/array_devices",
"path": "simple_example.py",
"copies": "1",
"size": "2999",
"license": "mit",
"hash": -5900286154066149000,
"line_mean": 28.6930693069,
"line_max": 76,
"alpha_frac": 0.7409136379,
"autogenerated": false,
"ratio": 3.4670520231213873,
"config_test": false,
... |
__author__ = 'joe.snyder'
import argparse
import os
import zipfile
import shutil
import re
import subprocess
import sys
OTJ_SURVEY_EXPRESSIONS = (("Do not [Re]*distribute",[]),
("Copyright [0-9\-]*",[]),
("(Released|Licensed) ",[]),
("All rights reserved",[]),
("Deriv[atived]+",[])
)
OTJ_FILE_... | {
"repo_name": "midasplatform/journal",
"path": "otjSurvey.py",
"copies": "1",
"size": "3903",
"license": "apache-2.0",
"hash": 1367442871834312400,
"line_mean": 35.8932038835,
"line_max": 116,
"alpha_frac": 0.5480399693,
"autogenerated": false,
"ratio": 3.6172381835032437,
"config_test": false,... |
__author__ = 'joh12041'
import json
from shapely.wkt import loads
from shapely.geometry import shape
import csv
POINTS_FN = '../sample_dataset/users.home-locations.geo-median.tsv'
OUTPUT_FN = '../sample_dataset/users.home-locations.geo-median.counties.tsv'
EXPECTED_HEADER = ['uid', 'lat', 'lon']
OUTPUT_HEADER = ['uid... | {
"repo_name": "ConnorMcMahon/geoinference",
"path": "python/src/geolocate/geolocation/point_to_county.py",
"copies": "1",
"size": "2503",
"license": "bsd-3-clause",
"hash": 2063954068707310300,
"line_mean": 38.125,
"line_max": 123,
"alpha_frac": 0.5153815421,
"autogenerated": false,
"ratio": 3.83... |
__author__ = 'joh12041'
"""
Gender code largely taken from https://github.com/tapilab/twcounty/blob/master/twcounty/Demographics.ipynb.
A major thanks to Aron Culotta for posting his code and doing a fine job with it in the first place!
"""
# Classify users as male or female based on first names based on Census name ... | {
"repo_name": "ConnorMcMahon/geoinference",
"path": "python/src/geolocate/utils/generate_user_gender_urban_mappings.py",
"copies": "1",
"size": "7165",
"license": "bsd-3-clause",
"hash": -4423838330769964000,
"line_mean": 37.7351351351,
"line_max": 131,
"alpha_frac": 0.587718074,
"autogenerated": f... |
import re, sys
import struct
from base64 import b64encode
from hashlib import sha1
if sys.version_info[0] < 3 :
from SocketServer import ThreadingMixIn, TCPServer, StreamRequestHandler
else:
from socketserver import ThreadingMixIn, TCPServer, StreamRequestHandler
'''
+-+-+-+-+-------+-+-------------+-----------... | {
"repo_name": "darvelo/ether-website",
"path": "websocketserver.py",
"copies": "1",
"size": "8098",
"license": "mit",
"hash": -2385940911648125400,
"line_mean": 25.5508196721,
"line_max": 102,
"alpha_frac": 0.6211410225,
"autogenerated": false,
"ratio": 3.1194144838212634,
"config_test": false,... |
import re
import sys
import struct
from base64 import b64encode
from hashlib import sha1
import logging
if sys.version_info[0] < 3:
from SocketServer import ThreadingMixIn, TCPServer, StreamRequestHandler
else:
from socketserver import ThreadingMixIn, TCPServer, StreamRequestHandler
logger = logging.getLogge... | {
"repo_name": "kenw2/kenw2server",
"path": "websocket_server.py",
"copies": "2",
"size": "10935",
"license": "mit",
"hash": 4854407170477456000,
"line_mean": 30.6040462428,
"line_max": 120,
"alpha_frac": 0.5448559671,
"autogenerated": false,
"ratio": 3.9705882352941178,
"config_test": false,
... |
import re, sys
import struct
from base64 import b64encode
from hashlib import sha1
if sys.version_info[0] < 3 :
from SocketServer import ThreadingMixIn, TCPServer, StreamRequestHandler
else:
from socketserver import ThreadingMixIn, TCPServer, StreamRequestHandler
'''
+-+-+-+-+-------+-+-------------+-----------... | {
"repo_name": "zhulangen/python-websocket-shell",
"path": "websocket_server/websocket_server.py",
"copies": "1",
"size": "9021",
"license": "mit",
"hash": 350649293848197950,
"line_mean": 26.0089820359,
"line_max": 102,
"alpha_frac": 0.6187784059,
"autogenerated": false,
"ratio": 3.10533562822719... |
import re, sys
import struct
from base64 import b64encode
from hashlib import sha1
import logging
if sys.version_info[0] < 3:
from SocketServer import ThreadingMixIn, TCPServer, StreamRequestHandler
else:
from socketserver import ThreadingMixIn, TCPServer, StreamRequestHandler
'''
+-+-+-+-+-----... | {
"repo_name": "ijonglin/WsJsPy",
"path": "Py/Ws/websocket_server/websocket_server.py",
"copies": "1",
"size": "9851",
"license": "mit",
"hash": 2946353574178341400,
"line_mean": 30.0879478827,
"line_max": 120,
"alpha_frac": 0.5204547762,
"autogenerated": false,
"ratio": 4.007729861676159,
"conf... |
__author__ = 'Johan Hoiness'
import sys
import os
import general
import revar
from time import strftime
import time
import config
import commands
def get_ftime():
if config.verbose:
print 'automatics.get_ftime() started.'
while True:
general.ftime = '[' + strftime('%H:%M:%S') + ']'
time.sleep(1)
def autopi... | {
"repo_name": "JohnHiness/alison",
"path": "automatics.py",
"copies": "1",
"size": "1610",
"license": "mit",
"hash": -4960651784303405000,
"line_mean": 23.0447761194,
"line_max": 115,
"alpha_frac": 0.6751552795,
"autogenerated": false,
"ratio": 2.824561403508772,
"config_test": false,
"has_no... |
__author__ = 'Johan Hoiness'
import sys
import os
import random
import time
import string
import connection
from time import strftime
import ceq
import json, urllib2
import thread
args = sys.argv
req_files = ['filegen.py', 'connection.py', 'commands.py', 'general.py', 'automatics.py']
for filename in req_files:
if ... | {
"repo_name": "JohnHiness/alison",
"path": "alison.py",
"copies": "1",
"size": "7596",
"license": "mit",
"hash": -2821533660134327000,
"line_mean": 28.2192307692,
"line_max": 157,
"alpha_frac": 0.6446814113,
"autogenerated": false,
"ratio": 2.666198666198666,
"config_test": true,
"has_no_keyw... |
__author__ = 'Johan Hoiness'
import uuid
import sys
def random_string(string_length=10):
randomz = str(uuid.uuid4())
randomz = randomz.upper()
randomz = randomz.replace("-", "")
return randomz[0:string_length]
def gen_config():
c_server = raw_input('Server you want to connect to: ')
while c_server == '':
c... | {
"repo_name": "JohnHiness/alison",
"path": "filegen.py",
"copies": "1",
"size": "5556",
"license": "mit",
"hash": -7724050579582175000,
"line_mean": 39.268115942,
"line_max": 173,
"alpha_frac": 0.6285097192,
"autogenerated": false,
"ratio": 2.769690927218345,
"config_test": true,
"has_no_keyw... |
__author__ = 'Johannes Gehrs (jgehrs@gmail.com)'
from flask import Flask, render_template, redirect, url_for, request, flash
from wtforms import Form, validators
from wtformsparsleyjs import IntegerField, BooleanField, SelectField, TextField
app = Flask(__name__)
@app.route('/parsley_testform', methods=['GET', 'POS... | {
"repo_name": "curiosity/wtforms-parsleyjs",
"path": "wtformsparsleyjs/sample/sample.py",
"copies": "1",
"size": "2705",
"license": "mit",
"hash": 6913489653430660000,
"line_mean": 44.1,
"line_max": 87,
"alpha_frac": 0.6096118299,
"autogenerated": false,
"ratio": 3.9546783625730995,
"config_tes... |
__author__ = 'Johannes Gehrs (jgehrs@gmail.com)'
from flask import Flask, render_template, request
from wtforms import Form, validators
from wtformsparsleyjs import IntegerField, BooleanField, SelectField, StringField
app = Flask(__name__)
@app.route('/parsley_testform', methods=['GET', 'POST'])
def parsley_testfor... | {
"repo_name": "johannes-gehrs/wtforms-parsleyjs",
"path": "wtformsparsleyjs/sample/sample.py",
"copies": "1",
"size": "2664",
"license": "mit",
"hash": -6526974973098970000,
"line_mean": 43.4,
"line_max": 87,
"alpha_frac": 0.6238738739,
"autogenerated": false,
"ratio": 3.976119402985075,
"confi... |
__author__ = 'Johannes Gehrs (jgehrs@gmail.com)'
from flask import Flask, render_template, request
from wtforms import Form, validators
import wtformsparsleyjs
import datetime
app = Flask(__name__)
@app.route('/parsley_testform', methods=['GET', 'POST'])
def parsley_testform():
form = ParsleyTestForm(request.fo... | {
"repo_name": "wassname/wtforms-parsleyjs",
"path": "wtformsparsleyjs/sample/sample.py",
"copies": "2",
"size": "9678",
"license": "mit",
"hash": 8845309934916217000,
"line_mean": 26.8103448276,
"line_max": 89,
"alpha_frac": 0.4961768961,
"autogenerated": false,
"ratio": 4.316681534344335,
"con... |
__author__ = 'Johannes Gehrs (jgehrs@gmail.com)'
import re
import copy
import json
from wtforms.validators import Length, NumberRange, Email, EqualTo, IPAddress, \
Regexp, URL, AnyOf, Optional, InputRequired, MacAddress, UUID, NoneOf
try:
from wtforms.validators import DataRequired
except ImportError:
# w... | {
"repo_name": "wassname/wtforms-parsleyjs",
"path": "wtformsparsleyjs/core.py",
"copies": "2",
"size": "12428",
"license": "mit",
"hash": -412532645920108100,
"line_mean": 28.0373831776,
"line_max": 102,
"alpha_frac": 0.6559382041,
"autogenerated": false,
"ratio": 3.5296790684464643,
"config_te... |
__author__ = 'Johannes Gehrs (jgehrs@gmail.com)'
import re
import copy
import json
from wtforms.validators import Length, NumberRange, Email, EqualTo, IPAddress, \
Regexp, URL, AnyOf, Optional, InputRequired, MacAddress, UUID, NoneOf
try:
from wtforms.validators import DataRequired
except ImportError:
# ... | {
"repo_name": "SmileyJames/wtforms-parsleyjs",
"path": "wtformsparsleyjs/core.py",
"copies": "1",
"size": "10105",
"license": "mit",
"hash": 945078662288021400,
"line_mean": 33.4880546075,
"line_max": 102,
"alpha_frac": 0.6531420089,
"autogenerated": false,
"ratio": 3.4701236263736264,
"config_... |
__author__ = 'Johannes Gehrs (jgehrs@gmail.com)'
import re
import copy
from wtforms.validators import Length, NumberRange, Email, EqualTo, IPAddress, \
InputRequired, Regexp, URL, AnyOf
from wtforms import StringField
from wtforms.widgets import TextInput as _TextInput, PasswordInput as _PasswordInput, \
Chec... | {
"repo_name": "johannes-gehrs/wtforms-parsleyjs",
"path": "wtformsparsleyjs/core.py",
"copies": "1",
"size": "6582",
"license": "mit",
"hash": 9200459778100384000,
"line_mean": 32.2424242424,
"line_max": 91,
"alpha_frac": 0.6505621392,
"autogenerated": false,
"ratio": 3.4917771883289124,
"confi... |
__author__ = 'Johannes Gehrs (jgehrs@gmail.com)'
import re
import copy
from wtforms.validators import Length, NumberRange, Email, EqualTo, IPAddress, \
Required, Regexp, URL, AnyOf
from wtforms import TextField
from wtforms.widgets import TextInput as _TextInput, PasswordInput as _PasswordInput, \
CheckboxInp... | {
"repo_name": "curiosity/wtforms-parsleyjs",
"path": "wtformsparsleyjs/core.py",
"copies": "1",
"size": "6499",
"license": "mit",
"hash": 6975271763394922000,
"line_mean": 31.8232323232,
"line_max": 89,
"alpha_frac": 0.6464071396,
"autogenerated": false,
"ratio": 3.482851018220793,
"config_test... |
__author__ = "Johannes Köster"
__contributors__ = ["Per Unneberg"]
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import os
import json
import re
import inspect
import textwrap
from itertools import chain
from collections import Mapping
from snakemake.io ... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/utils.py",
"copies": "1",
"size": "8270",
"license": "mit",
"hash": -8452948451194422000,
"line_mean": 32.8852459016,
"line_max": 206,
"alpha_frac": 0.6145379777,
"autogenerated": false,
"ratio": 4.331063383970665,
"config_test": true... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
from collections import defaultdict
from snakemake.io import _IOFile
class Node:
__slots__ = ["rules", "children"]
def __init__(self):
self.rules = set()
... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/output_index.py",
"copies": "1",
"size": "1504",
"license": "mit",
"hash": -627580198849284700,
"line_mean": 27.3396226415,
"line_max": 83,
"alpha_frac": 0.5326231691,
"autogenerated": false,
"ratio": 4.070460704607046,
"config_test":... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import _io
import sys
import os
import subprocess as sp
from snakemake.utils import format
from snakemake.logging import logger
__author__ = "Johannes Köster"
STDOUT = sys.std... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/shell.py",
"copies": "1",
"size": "2138",
"license": "mit",
"hash": 5695308441600029000,
"line_mean": 26.3717948718,
"line_max": 79,
"alpha_frac": 0.5733021077,
"autogenerated": false,
"ratio": 3.881818181818182,
"config_test": false,... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import json
import os
import threading
from flask import Flask, render_template, request
from snakemake.version import __version__
LOCK = threading.Lock()
app = Flask("snakem... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/gui.py",
"copies": "1",
"size": "4991",
"license": "mit",
"hash": -8939186567346780000,
"line_mean": 28.1754385965,
"line_max": 79,
"alpha_frac": 0.5407897374,
"autogenerated": false,
"ratio": 4.033144704931285,
"config_test": false,
... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import logging as _logging
import platform
import time
import sys
import os
import json
from multiprocessing import Lock
import tempfile
class ColorizingStreamHandler(_logging.... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/logging.py",
"copies": "1",
"size": "8600",
"license": "mit",
"hash": -8792768562504420000,
"line_mean": 31.5681818182,
"line_max": 104,
"alpha_frac": 0.5546638753,
"autogenerated": false,
"ratio": 4.104057279236277,
"config_test": fa... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import os
import mimetypes
import base64
import textwrap
import datetime
import io
from docutils.parsers.rst.directives.images import Image, Figure
from docutils.parsers.rst imp... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/report.py",
"copies": "1",
"size": "3806",
"license": "mit",
"hash": 618641445782915800,
"line_mean": 27.3880597015,
"line_max": 117,
"alpha_frac": 0.6014721346,
"autogenerated": false,
"ratio": 3.9916054564533052,
"config_test": fals... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import os
import re
import sys
import inspect
import sre_constants
from collections import defaultdict
from snakemake.io import IOFile, _IOFile, protected, temp, dynamic, Namedl... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/rules.py",
"copies": "1",
"size": "18937",
"license": "mit",
"hash": 3811739450639154000,
"line_mean": 35.4134615385,
"line_max": 102,
"alpha_frac": 0.5199894375,
"autogenerated": false,
"ratio": 4.685721356099975,
"config_test": fals... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import os
import shutil
import signal
import marshal
import pickle
from base64 import urlsafe_b64encode
from functools import lru_cache, partial
from itertools import filterfalse... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/persistence.py",
"copies": "1",
"size": "10765",
"license": "mit",
"hash": -8053314851183099000,
"line_mean": 34.6390728477,
"line_max": 108,
"alpha_frac": 0.5676855895,
"autogenerated": false,
"ratio": 3.744954766875435,
"config_test... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import os
import sys
import base64
import json
from collections import defaultdict
from itertools import chain
from functools import partial
from operator import attrgetter
fro... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/jobs.py",
"copies": "1",
"size": "13091",
"license": "mit",
"hash": -1192212223167584500,
"line_mean": 35.561452514,
"line_max": 79,
"alpha_frac": 0.5432042173,
"autogenerated": false,
"ratio": 4.485606579849212,
"config_test": false,... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import os
import traceback
from tokenize import TokenError
from snakemake.logging import logger
def format_error(ex, lineno,
linemaps=None,
s... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/exceptions.py",
"copies": "1",
"size": "10433",
"license": "mit",
"hash": -6233753328015944000,
"line_mean": 33.6544850498,
"line_max": 127,
"alpha_frac": 0.5491323938,
"autogenerated": false,
"ratio": 4.331810631229236,
"config_test"... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import re
import os
import sys
import signal
import json
import urllib
from collections import OrderedDict
from itertools import filterfalse, chain
from functools import partial
... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/workflow.py",
"copies": "1",
"size": "25592",
"license": "mit",
"hash": -1127226078097484500,
"line_mean": 33.863760218,
"line_max": 111,
"alpha_frac": 0.5437280188,
"autogenerated": false,
"ratio": 4.66970802919708,
"config_test": tr... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import sys
import os
import multiprocessing
import concurrent.futures
from concurrent.futures.process import _ResultItem, _process_worker
def _graceful_process_worker(call_queu... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/futures.py",
"copies": "1",
"size": "1252",
"license": "mit",
"hash": 772269420750852500,
"line_mean": 33.7222222222,
"line_max": 91,
"alpha_frac": 0.6632,
"autogenerated": false,
"ratio": 4.019292604501608,
"config_test": false,
"h... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import textwrap
import time
from collections import defaultdict, Counter
from itertools import chain, combinations, filterfalse, product, groupby
from functools import partial, l... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/dag.py",
"copies": "1",
"size": "34464",
"license": "mit",
"hash": 6697939285734145000,
"line_mean": 36.2159827214,
"line_max": 104,
"alpha_frac": 0.5338343683,
"autogenerated": false,
"ratio": 4.455908973364365,
"config_test": false,... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import time
import csv
import json
from collections import defaultdict
import snakemake.jobs
fmt_time = time.ctime
class Stats:
def __init__(self):
self.starttime... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/stats.py",
"copies": "1",
"size": "2298",
"license": "mit",
"hash": -5941180655497126000,
"line_mean": 28.4358974359,
"line_max": 79,
"alpha_frac": 0.5278745645,
"autogenerated": false,
"ratio": 3.8783783783783785,
"config_test": fals... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import tokenize
import textwrap
import os
from urllib.error import HTTPError, URLError, ContentTooShortError
import urllib.request
from io import TextIOWrapper
from snakemake.ex... | {
"repo_name": "vangalamaheshh/snakemake",
"path": "snakemake/parser.py",
"copies": "1",
"size": "18784",
"license": "mit",
"hash": -1314296488202907100,
"line_mean": 27.4145234493,
"line_max": 84,
"alpha_frac": 0.5355659674,
"autogenerated": false,
"ratio": 4.301878149335776,
"config_test": fal... |
__author__ = "Johannes Köster"
from collections import defaultdict
class Node:
__slots__ = ["rules", "children"]
def __init__(self):
self.rules = set()
self.children = defaultdict(Node)
class OutputIndex:
def __init__(self, rules):
self.root = Node()
for rule in rules:... | {
"repo_name": "pascal-git/snakemake",
"path": "snakemake/output_index.py",
"copies": "1",
"size": "1128",
"license": "mit",
"hash": -7367450933042941000,
"line_mean": 24.6136363636,
"line_max": 70,
"alpha_frac": 0.5102040816,
"autogenerated": false,
"ratio": 4.2209737827715355,
"config_test": f... |
__author__ = 'johannes'
from flask import render_template, jsonify, url_for
from devviz import data_handler, app
from devviz.utils import sse_route
from devviz.views import View, Variable
import json
import time
@app.route('/variables/stream')
@sse_route
def variables_stream():
while True:
vars = [{"name"... | {
"repo_name": "hildensia/devviz",
"path": "devviz/views/variables.py",
"copies": "1",
"size": "1539",
"license": "bsd-2-clause",
"hash": -8007271215480357000,
"line_mean": 29.1764705882,
"line_max": 78,
"alpha_frac": 0.599740091,
"autogenerated": false,
"ratio": 3.7813267813267815,
"config_test... |
__author__ = 'Johannes'
#Import Libraries
##################
#Tell python we need the library "os" for executing system commands directly
import os
#Tell python we need the library "time" so we can use the "sleep" command
import time
##################
#Define Variables
##################
#Define commands to be e... | {
"repo_name": "swank-rats/roboter-software",
"path": "PythonTests/KnightRider.py",
"copies": "1",
"size": "3723",
"license": "mit",
"hash": -9003639015399928000,
"line_mean": 28.09375,
"line_max": 117,
"alpha_frac": 0.5423045931,
"autogenerated": false,
"ratio": 3.254370629370629,
"config_test"... |
__author__ = 'johannes'
from devviz import app
from devviz.views import View
from flask import render_template
class ChartView(View):
url = 'chart'
name = 'Charts and Plots'
script = """
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<script src... | {
"repo_name": "hildensia/devviz",
"path": "devviz/views/chart.py",
"copies": "1",
"size": "1135",
"license": "bsd-2-clause",
"hash": 3963029633152457700,
"line_mean": 33.3939393939,
"line_max": 126,
"alpha_frac": 0.6502202643,
"autogenerated": false,
"ratio": 3.170391061452514,
"config_test": f... |
__author__ = 'johannes'
import pickle
from datetime import timedelta
from uuid import uuid4
from redis import Redis
from werkzeug.datastructures import CallbackDict
from flask.sessions import SessionInterface, SessionMixin
class RedisSession(CallbackDict, SessionMixin):
def __init__(self, initial=None, sid=None... | {
"repo_name": "hildensia/devviz",
"path": "devviz/session_handler.py",
"copies": "1",
"size": "2281",
"license": "bsd-2-clause",
"hash": -5841836507696053000,
"line_mean": 33.5757575758,
"line_max": 65,
"alpha_frac": 0.6102586585,
"autogenerated": false,
"ratio": 4.154826958105646,
"config_test... |
__author__ = 'Johannes'
import proto.Block_pb2
import proto.Map_pb2
import proto.Material_pb2
import proto.Plant_pb2
import proto.Tile_pb2
import zlib
import sys
def b2i(byteInput):
return int.from_bytes(byteInput, byteorder='little')
def getMsgLength(byteInput):
rtn = 0
for i in range(len(byteInput)):
... | {
"repo_name": "gaetjen/Blendorf",
"path": "code/obsolete/mapimport_script.py",
"copies": "1",
"size": "3459",
"license": "mit",
"hash": -1790329137567161300,
"line_mean": 32.9117647059,
"line_max": 327,
"alpha_frac": 0.6068227812,
"autogenerated": false,
"ratio": 2.832923832923833,
"config_test... |
__author__ = 'Johannes'
import time
import threading
import DMCC
import RobotConfig
class Robot:
def __init__(self):
rm = RobotConfig.Config.getfloat('robot', 'rightMax')
lm = RobotConfig.Config.getfloat('robot', 'leftMax')
self.rightMax = rm / 100.0
self.leftMax = lm / 100.0
... | {
"repo_name": "swank-rats/roboter-software",
"path": "SwankRatsRoboterSoftware/Robot.py",
"copies": "1",
"size": "2191",
"license": "mit",
"hash": 1506559155358838800,
"line_mean": 25.3975903614,
"line_max": 111,
"alpha_frac": 0.5490643542,
"autogenerated": false,
"ratio": 3.4558359621451102,
"... |
__author__ = 'johannes'
class RequestParser:
"""
Diese Klasse ist dafür verantwortlich, Anfragen vom Client (Webbrowser) zu empfangen und diese zu parsen.
Gibt ein Dictionary mit den extrahierten/geparsten Informationen zurück.
"""
def __init__(self):
self.host = ''
def start(self, c... | {
"repo_name": "wlanbuchse/Anonymizer",
"path": "anonymiser/request_parser.py",
"copies": "1",
"size": "3189",
"license": "mit",
"hash": 1049783050929122300,
"line_mean": 32.8191489362,
"line_max": 115,
"alpha_frac": 0.5284680717,
"autogenerated": false,
"ratio": 3.592090395480226,
"config_test"... |
__author__ = 'Johannes'
class State:
def __init__(self):
pass
def press(self, key):
return Stop()
def release(self, key):
return Stop()
def getLeft(self):
return 0
def getRight(self):
return 0
class Stop(State):
def press(self, key):
if key... | {
"repo_name": "swank-rats/roboter-software",
"path": "SwankRatsRoboterSoftware/StateClasses.py",
"copies": "1",
"size": "3042",
"license": "mit",
"hash": 8850756926126765000,
"line_mean": 16.0898876404,
"line_max": 30,
"alpha_frac": 0.4750164366,
"autogenerated": false,
"ratio": 4.11637347767253,... |
__author__ = 'Johannes Theodoridis'
import pygame
import numpy as np
from .game_objects import Sheep, Wolf, Fireplace
class Card(pygame.Surface):
# Some colors
black = (0,0,0)
white = (255,255,255)
white2 = (244,244,244)
grey = (130,130,130)
grey2 = (230,230,230)
dark = (51,51,51)... | {
"repo_name": "JohannesTheo/SurvivalBox",
"path": "survivalbox/card.py",
"copies": "1",
"size": "17529",
"license": "mit",
"hash": -1047001194732830600,
"line_mean": 39.2965517241,
"line_max": 171,
"alpha_frac": 0.5628387244,
"autogenerated": false,
"ratio": 3.374205967276227,
"config_test": fa... |
__author__ = 'Johannes Theodoridis'
# standard imports
import os
import copy
# third party imports
import numpy as np
import pygame
from pygame import K_UP, K_DOWN, K_LEFT, K_RIGHT, K_COMMA, K_PERIOD, K_F15
# local imports
from . import map
from . import utils
MANUAL=False
#RANDOM=False
RANDOM_NPC=False
# orientat... | {
"repo_name": "JohannesTheo/SurvivalBox",
"path": "survivalbox/game_objects.py",
"copies": "1",
"size": "38286",
"license": "mit",
"hash": 8747700464554897000,
"line_mean": 39.0910994764,
"line_max": 147,
"alpha_frac": 0.5196938829,
"autogenerated": false,
"ratio": 3.684889316650626,
"config_te... |
__author__ = 'Johannes Theodoridis'
# standard imports
import os
# third party imports
import numpy as np
import pygame
# local imports
from .utils import ValueNoise2D
from .game_objects import Survivor, Sheep
# constans representing the different ressources
PLAYER = -1
# TILE TYPES
EOW = 0
WATER = 1
DIRT = 2
G... | {
"repo_name": "JohannesTheo/SurvivalBox",
"path": "survivalbox/map.py",
"copies": "1",
"size": "8816",
"license": "mit",
"hash": 1724327732772816600,
"line_mean": 35.4297520661,
"line_max": 141,
"alpha_frac": 0.5575090744,
"autogenerated": false,
"ratio": 3.636963696369637,
"config_test": false... |
__author__ = 'Johannes Theodoridis'
# standard imports
# third party imports
import numpy as np
import pygame
import pickle
# local imports
from . import map
from . import utils
from .game_objects import Survivor, ViewPort, Fireplace, Sheep, Wolf, create_marker_rect
from .card import Card, AgentCard, StatisticsCard
... | {
"repo_name": "JohannesTheo/SurvivalBox",
"path": "survivalbox/environment.py",
"copies": "1",
"size": "24973",
"license": "mit",
"hash": 4743842767090938000,
"line_mean": 37.8382581649,
"line_max": 169,
"alpha_frac": 0.5563608697,
"autogenerated": false,
"ratio": 3.9259550385159567,
"config_te... |
__author__ = 'Johannes Theodoridis'
# standard imports
# third party imports
import numpy as np
import scipy as sci
# local imports
from .game_objects import UP, DOWN, LEFT, RIGHT
from . import map
def grid_from_position(pos, size_x, size_y):
'''
Return all points of a grid, given a point and a size.
''... | {
"repo_name": "JohannesTheo/SurvivalBox",
"path": "survivalbox/utils.py",
"copies": "1",
"size": "7136",
"license": "mit",
"hash": -7799546310827310000,
"line_mean": 40.7368421053,
"line_max": 153,
"alpha_frac": 0.5284473094,
"autogenerated": false,
"ratio": 4.2150029533372715,
"config_test": f... |
__author__ = "johannes valbjorn"
__license__ = "MIT"
__VERSION__ = "0.0.1"
import time
from contextlib import contextmanager
default_format = "[{taken_min:>02.0f}:{taken_sec:>02.0f} < {left_min:>02.0f}:{left_sec:>02.0f}]"
class Creta():
def __init__(self, n, average_len=10, format=default_format, strict=False):
... | {
"repo_name": "sloev/creta",
"path": "creta.py",
"copies": "1",
"size": "2848",
"license": "mit",
"hash": -2319546414144337400,
"line_mean": 28.0612244898,
"line_max": 96,
"alpha_frac": 0.53125,
"autogenerated": false,
"ratio": 3.6987012987012986,
"config_test": false,
"has_no_keywords": fals... |
_author__ = 'JohnAdams'
import itertools
import os
import re
import unicodedata
import codecs
import collections
import csv
import shutil
import cgi
import os
class KnowledgeBaseArticles(object):
def __init__(self):
self.kbaKeys = []
self.matched = []
self.sigLineList = []
self.... | {
"repo_name": "Johnisgeek/KnowledgeBasic",
"path": "testing.py",
"copies": "1",
"size": "4868",
"license": "apache-2.0",
"hash": -3242289116357847600,
"line_mean": 30.0063694268,
"line_max": 103,
"alpha_frac": 0.5589564503,
"autogenerated": false,
"ratio": 3.881977671451356,
"config_test": fals... |
_author__ = 'JohnAdams'
import nltk
import os
import re
import unicodedata
import codecs
import collections
import csv
from nltk.compat import raw_input
import shutil
import cgi
class KnowledgeBaseArticles(object):
def __init__(self):
self.sigLineList = []
self.significantLines = {'kb0': ['xlice... | {
"repo_name": "Johnisgeek/KnowledgeBasic",
"path": "trial.py",
"copies": "1",
"size": "5874",
"license": "apache-2.0",
"hash": 8627518206084403000,
"line_mean": 32.375,
"line_max": 117,
"alpha_frac": 0.5834184542,
"autogenerated": false,
"ratio": 4.0371134020618555,
"config_test": false,
"has... |
author = "John Doe"
title = "Sigal test gallery ☺"
source = "pictures"
thumb_suffix = ".tn"
keep_orig = True
thumb_video_delay = 5
# img_format = 'jpeg'
links = [
("Example link", "http://example.org"),
("Another link", "http://example.org"),
]
files_to_copy = (("../watermark.png", "watermark.png"),)
plugins... | {
"repo_name": "saimn/sigal",
"path": "tests/sample/sigal.conf.py",
"copies": "1",
"size": "1090",
"license": "mit",
"hash": 128815479600407340,
"line_mean": 22.6304347826,
"line_max": 75,
"alpha_frac": 0.6264949402,
"autogenerated": false,
"ratio": 2.6773399014778323,
"config_test": false,
"h... |
from collections import Counter
from gmusicapi import Mobileclient
from gmusicapi.exceptions import CallFailure
from preferences import *
import time
import sys
import os
import codecs
# the api to use for accessing google music
api = None
# the logfile for keeping track of things
logfile = None
# provide a shortcu... | {
"repo_name": "mgillespie/gmusic-playlist",
"path": "common.py",
"copies": "1",
"size": "6261",
"license": "mit",
"hash": -8220343854117068000,
"line_mean": 29.3932038835,
"line_max": 92,
"alpha_frac": 0.6497364638,
"autogenerated": false,
"ratio": 3.7113218731475994,
"config_test": false,
"h... |
from collections import Counter
from gmusicapi import Mobileclient
from preferences import *
import time
import getpass
import sys
import os
import codecs
# the api to use for accessing google music
api = None
# the logfile for keeping track of things
logfile = None
# provide a shortcut for track_info_separator
tse... | {
"repo_name": "eriksf/gmusic-playlist",
"path": "common.py",
"copies": "2",
"size": "5833",
"license": "mit",
"hash": -6946224029573972000,
"line_mean": 29.7,
"line_max": 92,
"alpha_frac": 0.6519801131,
"autogenerated": false,
"ratio": 3.6616446955430004,
"config_test": false,
"has_no_keyword... |
from common import *
from os.path import expanduser,join
import xmltodict
if len(sys.argv) < 2:
log('ERROR output directory is required')
time.sleep(3)
exit()
# setup the output directory, create it if needed
output_dir = sys.argv[1]
if not os.path.exists(output_dir):
os.makedirs(output_dir)
# log i... | {
"repo_name": "mgillespie/gmusic-playlist",
"path": "ExportLists.py",
"copies": "1",
"size": "4835",
"license": "mit",
"hash": 351707265376195200,
"line_mean": 31.6689189189,
"line_max": 132,
"alpha_frac": 0.6138572906,
"autogenerated": false,
"ratio": 3.6824067022086826,
"config_test": false,
... |
from common import *
if len(sys.argv) < 2:
log('ERROR output directory is required')
time.sleep(3)
exit()
# setup the output directory, create it if needed
output_dir = sys.argv[1]
if not os.path.exists(output_dir):
os.makedirs(output_dir)
# log in and load personal library
api = open_api()
library ... | {
"repo_name": "eriksf/gmusic-playlist",
"path": "ExportLists.py",
"copies": "2",
"size": "3839",
"license": "mit",
"hash": 7605404370780865000,
"line_mean": 29.712,
"line_max": 83,
"alpha_frac": 0.6189111748,
"autogenerated": false,
"ratio": 3.8351648351648353,
"config_test": false,
"has_no_k... |
import re
import datetime
import math
import time
from common import *
# the file for outputing the information google has one each song
csvfile = None
# cleans up any open resources
def cleanup():
if csvfile:
csvfile.close()
close_log()
close_api()
# compares two strings based only on their cha... | {
"repo_name": "soulfx/gmusic-playlist",
"path": "ImportList.py",
"copies": "2",
"size": "11486",
"license": "mit",
"hash": 8572052808757075000,
"line_mean": 32.0057471264,
"line_max": 83,
"alpha_frac": 0.61962389,
"autogenerated": false,
"ratio": 3.6451920025388764,
"config_test": false,
"has... |
__version__ = '0.160530'
__required_gmusicapi_version__ = '10.0.0'
from collections import Counter
from gmusicapi import __version__ as gmusicapi_version
from gmusicapi import Mobileclient
from gmusicapi.exceptions import CallFailure
from preferences import *
import re
import time
import getpass
import sys
import os... | {
"repo_name": "soulfx/gmusic-playlist",
"path": "common.py",
"copies": "1",
"size": "7009",
"license": "mit",
"hash": 39284529738970160,
"line_mean": 28.952991453,
"line_max": 92,
"alpha_frac": 0.6495933799,
"autogenerated": false,
"ratio": 3.6908899420747763,
"config_test": false,
"has_no_ke... |
__author__ = 'joh'
from numpy import *
from collections import Counter
from scipy.io import loadmat
import split as s
def classify(train_data, train_targets, test_data, k):
resultlist = []
c = 0
for data in test_data.T:
c +=1
data = data.reshape((shape(data)[0]), 1)
diff = abs(train... | {
"repo_name": "archonren/project",
"path": "algorithms/Knn.py",
"copies": "1",
"size": "2490",
"license": "mit",
"hash": -2875764818053294000,
"line_mean": 35.6176470588,
"line_max": 204,
"alpha_frac": 0.5939759036,
"autogenerated": false,
"ratio": 3.16793893129771,
"config_test": true,
"has_... |
import pywapi
from basemodule import BaseModule, BaseCommandContext
from alternatives import _
class WeatherContext(BaseCommandContext):
def cmd_keros(self, argument):
"""Gives The Temperature and Weather of Nafpaktos """
# Get the weather for Nafpaktos
nafpaktos = pywapi.get_we... | {
"repo_name": "nickraptis/fidibot",
"path": "src/modules/weather.py",
"copies": "1",
"size": "1236",
"license": "bsd-2-clause",
"hash": 7541642850616023000,
"line_mean": 30.6923076923,
"line_max": 77,
"alpha_frac": 0.6302588997,
"autogenerated": false,
"ratio": 3.646017699115044,
"config_test":... |
import random
from basemodule import BaseModule, BaseCommandContext
from alternatives import _
class dndContext(BaseCommandContext):
def cmd_roll(self, argument):
"""
Rolling D&D style
Usage: roll attack|save modifiers difficulty
"""
# Analyze Ar... | {
"repo_name": "nickraptis/fidibot",
"path": "src/modules/dnd.py",
"copies": "1",
"size": "1819",
"license": "bsd-2-clause",
"hash": 216164312222216580,
"line_mean": 26.9846153846,
"line_max": 66,
"alpha_frac": 0.5178669599,
"autogenerated": false,
"ratio": 4.28,
"config_test": false,
"has_no_... |
__author__ = 'John Hampton <pacopablo@pacopablo.com>'
from distutils.core import setup
import py2exe
import sys
__VERSION__ = '0.10'
class Target:
def __init__(self, **kw):
self.__dict__.update(kw)
# for the versioninfo resources
self.version = __VERSION__
self.compan... | {
"repo_name": "pacopablo/anagogic-backup-swift",
"path": "setup.py",
"copies": "1",
"size": "1408",
"license": "mit",
"hash": 4393265083322905600,
"line_mean": 29.2888888889,
"line_max": 86,
"alpha_frac": 0.5369318182,
"autogenerated": false,
"ratio": 3.8365122615803813,
"config_test": false,
... |
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Dec 08, 2016 14:20:52 GMT-0500$"
import collections
import itertools
import numbers
def index_to_slice(index):
"""
Convert an index to a slice.
Note:
A single index behaves differently from a length 1 ``slice``. Wh... | {
"repo_name": "jakirkham/kenjutsu",
"path": "kenjutsu/format.py",
"copies": "1",
"size": "11350",
"license": "bsd-3-clause",
"hash": -7907341874086900000,
"line_mean": 30.4404432133,
"line_max": 79,
"alpha_frac": 0.5197356828,
"autogenerated": false,
"ratio": 4.06664278036546,
"config_test": fa... |
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Jul 28, 2014 11:50:37 EDT$"
import nanshe.util.xglob
from builtins import range as irange
class TestXGlob(object):
num_files = 10
def setup(self):
import tempfile
self.temp_dir = tempfile.mkdtemp()
self.temp_fi... | {
"repo_name": "nanshe-org/nanshe",
"path": "tests/test_nanshe/test_util/test_xglob.py",
"copies": "3",
"size": "1374",
"license": "bsd-3-clause",
"hash": 6307391899910209000,
"line_mean": 25.4230769231,
"line_max": 92,
"alpha_frac": 0.6084425036,
"autogenerated": false,
"ratio": 3.487309644670051... |
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Jul 28, 2014 11:50:37 EDT$"
import os
import shutil
import tempfile
import nose
import numpy
import h5py
import nanshe.io.hdf5.serializers
class TestSerializers(object):
def setup(self):
self.temp_dir = tempfile.mkdtemp()
s... | {
"repo_name": "nanshe-org/nanshe",
"path": "tests/test_nanshe/test_io/test_hdf5/test_serializers.py",
"copies": "3",
"size": "18132",
"license": "bsd-3-clause",
"hash": 756274751393655200,
"line_mean": 31.2060390764,
"line_max": 128,
"alpha_frac": 0.5664570924,
"autogenerated": false,
"ratio": 3.... |
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Jul 31, 2015 18:00:05 EDT$"
import argparse
import hashlib
import itertools
import os
import re
import shutil
import subprocess
import sys
import time
import threading
import webbrowser
if sys.version_info.major == 2:
from httplib import BadSt... | {
"repo_name": "DudLab/docker_nanshe_workflow",
"path": "startup_nanshe_workflow.py",
"copies": "2",
"size": "19704",
"license": "apache-2.0",
"hash": 4171039812456818700,
"line_mean": 27.72303207,
"line_max": 79,
"alpha_frac": 0.5206049533,
"autogenerated": false,
"ratio": 4.04018864055772,
"co... |
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Mar 30, 2015 08:25:33 EDT$"
import collections
import json
import os
import os.path
import shutil
import tempfile
import numpy
import h5py
import vigra
import vigra.impex
import nanshe.util.iters
import nanshe.util.xnumpy
import nanshe.io.xtiff
... | {
"repo_name": "nanshe-org/nanshe",
"path": "tests/test_nanshe/test_converter.py",
"copies": "3",
"size": "2908",
"license": "bsd-3-clause",
"hash": 7915764899605438000,
"line_mean": 30.2688172043,
"line_max": 117,
"alpha_frac": 0.4969050894,
"autogenerated": false,
"ratio": 3.644110275689223,
"... |
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Nov 05, 2015 13:54$"
import collections
from contextlib import contextmanager
import errno
import itertools
import glob
import numbers
import os
import shutil
import tempfile
import uuid
import zipfile
import scandir
import h5py
import numpy
impor... | {
"repo_name": "nanshe-org/nanshe_workflow",
"path": "nanshe_workflow/data.py",
"copies": "2",
"size": "24568",
"license": "apache-2.0",
"hash": 6253075070195762000,
"line_mean": 28.9975579976,
"line_max": 85,
"alpha_frac": 0.5341908173,
"autogenerated": false,
"ratio": 4.183211305976503,
"confi... |
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Nov 09, 2015 12:47$"
from contextlib import contextmanager
import collections
import copy
import gc
import itertools
import math
import numbers
import os
from time import sleep
from psutil import cpu_count
import numpy
import zarr
import dask
imp... | {
"repo_name": "DudLab/nanshe_workflow",
"path": "nanshe_workflow/par.py",
"copies": "2",
"size": "26583",
"license": "apache-2.0",
"hash": -2625648660772951000,
"line_mean": 32.9501915709,
"line_max": 116,
"alpha_frac": 0.5223262988,
"autogenerated": false,
"ratio": 4.464729593550555,
"config_t... |
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Nov 10, 2015 16:28$"
import itertools
import numpy
import zarr
import dask
from builtins import range as irange
from nanshe.imp.segment import get_empty_neuron, \
merge_neuron_sets, \
... | {
"repo_name": "DudLab/nanshe_workflow",
"path": "nanshe_workflow/imp.py",
"copies": "2",
"size": "5389",
"license": "apache-2.0",
"hash": -1071189256340328300,
"line_mean": 30.7,
"line_max": 79,
"alpha_frac": 0.5798849508,
"autogenerated": false,
"ratio": 3.9712601326455417,
"config_test": fals... |
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Nov 10, 2015 19:44$"
import base64
import io
import os
import textwrap
import webcolors
import numpy
import scipy
import scipy.ndimage
from matplotlib.colors import ColorConverter
from matplotlib.cm import gist_rainbow
import bokeh
import bokeh... | {
"repo_name": "nanshe-org/nanshe_workflow",
"path": "nanshe_workflow/vis.py",
"copies": "2",
"size": "6446",
"license": "apache-2.0",
"hash": 1638558148450839800,
"line_mean": 27.0260869565,
"line_max": 139,
"alpha_frac": 0.5415761713,
"autogenerated": false,
"ratio": 3.512806539509537,
"config... |
__author__ = 'John Kusner'
import datetime
_1_jan_1000 = datetime.datetime(1000, 1, 1)
class CACBarcode:
"""
Generic barcode class, constructing this will do nothing
"""
def __init__(self):
pass
def read(self, data, count):
return data[:count], data[count:]
def readnum(self, ... | {
"repo_name": "jkusner/CACBarcode",
"path": "cacbarcode.py",
"copies": "2",
"size": "13883",
"license": "mit",
"hash": -1740765169988798500,
"line_mean": 42.6572327044,
"line_max": 196,
"alpha_frac": 0.6038320248,
"autogenerated": false,
"ratio": 3.605974025974026,
"config_test": false,
"has_... |
__author__ = 'johnlockwood'
ABBREVIATION_REVERSE = {
'RD': 'Road',
'ST': 'Street',
'AVE': 'Avenue',
'BLVD': 'Boulevard',
'DR': 'Drive'
}
ABBREVIATION_LOOKUP = {'ALLEE': 'ALY',
'ALLEY': 'ALY',
'ALLY': 'ALY',
'ALY': 'ALY',
'ANEX': 'ANX',
'ANNEX': 'ANX',
'ANX': 'ANX',
'APARTMENT': 'APT',
'AR... | {
"repo_name": "johnwlockwood/txt2vote",
"path": "txttovote/standardize_address/__init__.py",
"copies": "1",
"size": "10917",
"license": "apache-2.0",
"hash": -4780158606219551000,
"line_mean": 16.8382352941,
"line_max": 74,
"alpha_frac": 0.4948245855,
"autogenerated": false,
"ratio": 1.9852700490... |
"""
Functions to aid writing python scripts that process the pandoc
AST serialized as JSON.
"""
import codecs
import hashlib
import io
import json
import os
import sys
from functools import reduce
# some utility-functions: make it easier to create your own filters
def get_filename4code(module, content, ext=None):... | {
"repo_name": "AugustH/pandocfilters",
"path": "pandocfilters.py",
"copies": "1",
"size": "6658",
"license": "bsd-3-clause",
"hash": 3984215776717590000,
"line_mean": 28.4601769912,
"line_max": 107,
"alpha_frac": 0.597026134,
"autogenerated": false,
"ratio": 3.6886426592797785,
"config_test": f... |
"""
Functions to aid writing python scripts that process the pandoc
AST serialized as JSON.
"""
import codecs
import hashlib
import io
import json
import os
import sys
import atexit
import shutil
import tempfile
# some utility-functions: make it easier to create your own filters
def get_filename4code(module, cont... | {
"repo_name": "jgm/pandocfilters",
"path": "pandocfilters.py",
"copies": "1",
"size": "9065",
"license": "bsd-3-clause",
"hash": -8266643714496429000,
"line_mean": 28.7213114754,
"line_max": 81,
"alpha_frac": 0.6166574738,
"autogenerated": false,
"ratio": 3.812026913372582,
"config_test": false... |
"""
Functions to aid writing python scripts that process the pandoc
AST serialized as JSON.
"""
import codecs
import hashlib
import io
import json
import os
import sys
# some utility-functions: make it easier to create your own filters
def get_filename4code(module, content, ext=None):
"""Generate filename bas... | {
"repo_name": "lancezlin/ml_template_py",
"path": "lib/python2.7/site-packages/pandocfilters.py",
"copies": "8",
"size": "8261",
"license": "mit",
"hash": 4844521753734547000,
"line_mean": 27.6840277778,
"line_max": 81,
"alpha_frac": 0.6056167534,
"autogenerated": false,
"ratio": 3.77214611872146... |
"""
Functions to aid writing python scripts that process the pandoc
AST serialized as JSON.
"""
import sys
import json
import io
def walk(x, action, format, meta):
"""Walk a tree, applying an action to every object.
Returns a modified tree.
"""
if isinstance(x, list):
array = []
for ... | {
"repo_name": "alycosta/pandocfilters",
"path": "pandocfilters.py",
"copies": "3",
"size": "4668",
"license": "bsd-3-clause",
"hash": 7539326028890167000,
"line_mean": 29.5098039216,
"line_max": 78,
"alpha_frac": 0.5861182519,
"autogenerated": false,
"ratio": 3.6270396270396272,
"config_test": ... |
"""
Functions to aid writing python scripts that process the pandoc
AST serialized as JSON.
"""
import sys
import json
def walk(x, action, format, meta):
"""Walk a tree, applying an action to every object.
Returns a modified tree.
"""
if isinstance(x, list):
array = []
for item in x:... | {
"repo_name": "alexin-ivan/zfs-doc",
"path": "filters/pandocfilters.py",
"copies": "1",
"size": "4583",
"license": "mit",
"hash": 2192949299899692000,
"line_mean": 29.3509933775,
"line_max": 78,
"alpha_frac": 0.5832424176,
"autogenerated": false,
"ratio": 3.631537242472266,
"config_test": false... |
__author__ = 'John'
#from mall_count_dataset import dict as data
import re
import numpy as np
from sklearn import decomposition
from numpy import linalg as LA
def get_category_matrix(data):
#get the category count matrix from the joe jean dataset.
#This dataset is clean
#constants
category_size = 0
... | {
"repo_name": "rlowrance/find_best_mall",
"path": "recomendation system/nmf_analysis.py",
"copies": "3",
"size": "2993",
"license": "mit",
"hash": -6112275440392281000,
"line_mean": 37.3717948718,
"line_max": 128,
"alpha_frac": 0.6582024724,
"autogenerated": false,
"ratio": 3.456120092378753,
"... |
__author__ = 'John'
import numpy as np
from sklearn.decomposition import ProjectedGradientNMF
import recsys
import cf
import evaluate
import similarity
from sklearn import decomposition
from numpy.linalg import inv
from nmf_analysis import mall_latent_helper as nmf_helper
from sklearn.metrics.pairwise import pairwise_d... | {
"repo_name": "johnwu93/find_best_mall",
"path": "recomendation system/cf_item.py",
"copies": "3",
"size": "4762",
"license": "mit",
"hash": -6679991268204611000,
"line_mean": 34.0220588235,
"line_max": 184,
"alpha_frac": 0.6049979,
"autogenerated": false,
"ratio": 3.2088948787061993,
"config_t... |
__author__ = 'John'
import numpy as np
from sklearn.decomposition import ProjectedGradientNMF
import recsys
import evaluate
import similarity
from nmf_analysis import mall_latent_helper as nmf_helper
from sklearn import decomposition
from numpy.linalg import inv
from sklearn.metrics.pairwise import pairwise_distances
... | {
"repo_name": "lily-zhangying/find_best_mall",
"path": "recomendation system/cf.py",
"copies": "3",
"size": "6237",
"license": "mit",
"hash": -155030254188363360,
"line_mean": 41.4353741497,
"line_max": 153,
"alpha_frac": 0.6219336219,
"autogenerated": false,
"ratio": 3.331730769230769,
"config... |
__author__ = 'John'
import one_class
import cf
import nmf_analysis
import evaluate
import numpy as np
import pandas as pd
import similarity
import wlas
import pop_rec
import content
from nmf_analysis import mall_latent_helper as nmf_helper
import filter_demo_data
np.random.seed(9001)
result_directory = "Cross Validati... | {
"repo_name": "lily-zhangying/find_best_mall",
"path": "recomendation system/parameter_tuning.py",
"copies": "3",
"size": "6102",
"license": "mit",
"hash": -2957984457642189300,
"line_mean": 37.6202531646,
"line_max": 171,
"alpha_frac": 0.7115699771,
"autogenerated": false,
"ratio": 3.13083632632... |
__author__ = 'John'
#modify csv files.
#lowercase every column.
#remove stop words
#remove states
#os.getcwd()
#os.chdir("/tmp/")
#os.getcwd()
import csv
import sys
import operator
import re
import os
def write_nice_csv(file_name):
reader = csv.reader(open("csv/%s" % file_name), delimiter=",")
#omit head... | {
"repo_name": "johnwu93/find_best_mall",
"path": "filter_demo_data/Mall Feature filtering/filter_files.py",
"copies": "3",
"size": "7725",
"license": "mit",
"hash": -6275787384740880000,
"line_mean": 26.3936170213,
"line_max": 142,
"alpha_frac": 0.6141100324,
"autogenerated": false,
"ratio": 3.19... |
__author__ = 'john'
import csv
from operator import itemgetter
import uuid
from pattern.metrics import similarity, levenshtein, LEVENSHTEIN, DICE
from fuzzywuzzy import fuzz
import nltk
import string
london = '<insert TARGET file>'
entities = '<insert PRIME file>'
def getPublicCompanies():
pc = []
with open... | {
"repo_name": "johnconnelly75/matchr",
"path": "matchr.py",
"copies": "1",
"size": "6704",
"license": "mit",
"hash": -4187934107900748300,
"line_mean": 30.0416666667,
"line_max": 121,
"alpha_frac": 0.5657816229,
"autogenerated": false,
"ratio": 3.7918552036199094,
"config_test": false,
"has_n... |
__author__ = 'john'
import fhir.client.primitive
import fhir.client.complex
import fhir.client.resource
class Identifier():
def __init__(self):
self.__use = fhir.client.primitive.Code('')
self.label = ''
self.__system = fhir.client.primitive.Uri('')
self.value = ''
self.__... | {
"repo_name": "Johnnetto/FHIRSnake",
"path": "fhir/client/identifier.py",
"copies": "1",
"size": "1492",
"license": "mit",
"hash": 7361529680381588000,
"line_mean": 25.6607142857,
"line_max": 67,
"alpha_frac": 0.6065683646,
"autogenerated": false,
"ratio": 4.144444444444445,
"config_test": fals... |
__author__ = 'John'
import pandas as pd
import numpy as np
import re
import cf
import similarity
import filter_demo_data
cosine = similarity.cosine()
similarity_helper = cosine
import sys
def read_input(filename, top_N=10): #just reads in X and category matrix so loading it will not take time
shop_mall = pd.read_... | {
"repo_name": "lily-zhangying/find_best_mall",
"path": "recomendation system/command_line.py",
"copies": "3",
"size": "2942",
"license": "mit",
"hash": -7711151194959464000,
"line_mean": 48.8813559322,
"line_max": 251,
"alpha_frac": 0.6998640381,
"autogenerated": false,
"ratio": 3.208287895310796... |
__author__ = 'john'
import struct
from PrimeFinder import PrimeFinder
from Log import Log
class PrimeFileReader(PrimeFinder):
"""
Reads 4-byte unsigned integer binary primes in native byte order from the file given at construction time.
This is as opposed to computing them, so it should go faster. Note t... | {
"repo_name": "JohnL4/PythonPrimes",
"path": "PrimeFileReader.py",
"copies": "1",
"size": "1459",
"license": "mit",
"hash": 7840523166417563000,
"line_mean": 28.18,
"line_max": 111,
"alpha_frac": 0.5305003427,
"autogenerated": false,
"ratio": 4.075418994413408,
"config_test": false,
"has_no_k... |
__author__ = 'johnnylee'
import geometery as geo
import random
import matplotlib
matplotlib.use('Qt4Agg')
import matplotlib.pyplot as plt
import numpy as np
import math
import transformations as xforms
import sys
points = np.zeros((4, 2))
fig = plt.figure()
ax = fig.add_subplot(111, aspect='equal', xlim=(0, 1), ylim... | {
"repo_name": "jcl5m1/CVToolsPython",
"path": "common/geometery_test.py",
"copies": "1",
"size": "2017",
"license": "apache-2.0",
"hash": -6086270604670844000,
"line_mean": 23.9135802469,
"line_max": 85,
"alpha_frac": 0.6365889936,
"autogenerated": false,
"ratio": 2.7554644808743167,
"config_te... |
__author__ = 'johnnylee'
import math
from scipy.spatial import Delaunay
import numpy as np
def triangleArea(a, b, c):
return 0.5*math.fabs(a[0]*(b[1] - c[1])+b[0]*(c[1]-a[1])+c[0]*(a[1]-b[1]))
def CrossProductZ(a, b):
return a[0] * b[1] - a[1] * b[0];
def TriangleOrientation(a, b, c):
v = CrossProductZ(... | {
"repo_name": "jcl5m1/CVToolsPython",
"path": "common/geometery.py",
"copies": "1",
"size": "3720",
"license": "apache-2.0",
"hash": 4258921337949813000,
"line_mean": 29,
"line_max": 78,
"alpha_frac": 0.5577956989,
"autogenerated": false,
"ratio": 2.9712460063897765,
"config_test": false,
"ha... |
__author__ = 'johnnylee'
import theano
import theano.tensor as T
import numpy
import pylab
from PIL import Image
print "Theano test"
from theano.tensor.nnet import conv
rng = numpy.random.RandomState(23455)
# instantiate 4D tensor for input
input = T.tensor4(name='input')
# initialize shared variable for weights... | {
"repo_name": "jcl5m1/CVToolsPython",
"path": "TeanoTest/theanotest.py",
"copies": "1",
"size": "3530",
"license": "apache-2.0",
"hash": -5197349088008903000,
"line_mean": 38.6741573034,
"line_max": 107,
"alpha_frac": 0.68101983,
"autogenerated": false,
"ratio": 3.154602323503128,
"config_test"... |
__author__ = 'johnnylee'
import numpy as np
import cv2
pause = False
width = 640
height = 480
img = np.zeros((width,height,1), np.uint8)
frame = np.zeros((width,height,3), np.uint8)
start_x = 0
start_y = 0
def draw_line(event,x,y,flags,param):
global pause, img, frame, start_x, start_y
if event == cv2.EVE... | {
"repo_name": "jcl5m1/CVToolsPython",
"path": "AngleMeasurement/anglemeasure.py",
"copies": "1",
"size": "1319",
"license": "apache-2.0",
"hash": -7782329552229251000,
"line_mean": 22.1578947368,
"line_max": 117,
"alpha_frac": 0.626990144,
"autogenerated": false,
"ratio": 2.6918367346938776,
"c... |
__author__ = 'johnny'
import numpy as np
import cv2
from itertools import *
from random import *
from math import *
import collections
from TrainingRegion import *
class PixelSampleTest:
x,y,v = 0, 0, 0
def __init__(self):
self.x = 0
self.y = 0
self.v = 0
def randomize(self, im... | {
"repo_name": "jcl5m1/CVToolsPython",
"path": "VisualDecisionForest/VisualDecisionForest.py",
"copies": "1",
"size": "2750",
"license": "apache-2.0",
"hash": 8916964091893670000,
"line_mean": 28.902173913,
"line_max": 86,
"alpha_frac": 0.5432727273,
"autogenerated": false,
"ratio": 3.459119496855... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.