text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'rico'
from copy import deepcopy
import cv2
import os.path
import cPickle as pickle
import matplotlib.pyplot as plt
import numpy as np
def visualize_color_image(img, title=''):
plt.figure()
plt.title(title)
plt.imshow(cv2.cvtColor(img, cv2.COLOR_HSV2RGB))
def basic_image_check(img, title):... | {
"repo_name": "start-jsk/jsk_apc",
"path": "jsk_apc2016_common/python/jsk_apc2016_common/rbo_segmentation/utils.py",
"copies": "1",
"size": "10069",
"license": "bsd-3-clause",
"hash": -1991036265912441900,
"line_mean": 32.9023569024,
"line_max": 201,
"alpha_frac": 0.598172609,
"autogenerated": fals... |
__author__ = 'rico, Yusuke Niitani'
from copy import deepcopy
import cv2
import os.path
import cPickle as pickle
import matplotlib.pyplot as plt
import numpy as np
import utils
from utils import Utils
class APCSample(object):
def __init__(self, image_filename=None, apc_sample=None, labeled=True,
... | {
"repo_name": "start-jsk/jsk_apc",
"path": "jsk_apc2016_common/python/jsk_apc2016_common/rbo_segmentation/apc_data.py",
"copies": "1",
"size": "14169",
"license": "bsd-3-clause",
"hash": -5209214367162691000,
"line_mean": 37.8191780822,
"line_max": 200,
"alpha_frac": 0.5816924271,
"autogenerated": ... |
__author__ = 'riegel'
from django.core.management.base import BaseCommand, CommandError
from app.models import *
from app.remote.stocks import StockStorageClient
from pprint import pprint
class Command(BaseCommand):
def handle(self, *args, **options):
client = StockStorageClient()
stocks = Stock.... | {
"repo_name": "mrcrgl/stockstore",
"path": "app/management/commands/fetch_remote.py",
"copies": "1",
"size": "3547",
"license": "mit",
"hash": -2357079625601340000,
"line_mean": 37.1505376344,
"line_max": 111,
"alpha_frac": 0.5015506061,
"autogenerated": false,
"ratio": 4.7803234501347704,
"con... |
__author__ = "rik@electronicArtifacts.com"
__version__ = "0.1"
import json
import argparse
import unittest
def loadParams(paramf):
ps = open(paramf)
fldMap = {}
modelName = ''
pk = None
for il,line in enumerate(ps.readlines()):
line = line[:-1] # strip \n
if il==0:
# NB... | {
"repo_name": "rbelew/rikHak",
"path": "json2djfix/json2djfix/json2djfix.py",
"copies": "1",
"size": "2812",
"license": "apache-2.0",
"hash": -3951335889066979000,
"line_mean": 29.5652173913,
"line_max": 89,
"alpha_frac": 0.5736130868,
"autogenerated": false,
"ratio": 3.4334554334554332,
"confi... |
__author__ = 'rikkt0r'
from app import db
from app.models.adapters.graph import Graph
from app.models.adapters.helpers.node import Node
from app.models.adapters.helpers.edge import Edge
class ExampleModel:
def __init__(self):
pass
@staticmethod
def get_some_graph():
nodes_tmp = db.cyph... | {
"repo_name": "mobile2015/neoPyth",
"path": "app/models/example.py",
"copies": "1",
"size": "1790",
"license": "bsd-2-clause",
"hash": 1051392569846451000,
"line_mean": 34.8,
"line_max": 139,
"alpha_frac": 0.5826815642,
"autogenerated": false,
"ratio": 3.168141592920354,
"config_test": false,
... |
__author__ = 'riko'
import math
import calculations as calc
import ranking_systems as rs
import tennis_model as tm
from tennis_model import overrides
import numpy as np
class DoubleEloModel(tm.TennisRankingModel):
'''
This is double Elo model.
'''
def __init__(self, **kwargs):
'''
... | {
"repo_name": "erix5son/Tennis-Modelling",
"path": "models/double_elo_model.py",
"copies": "1",
"size": "6993",
"license": "mit",
"hash": 6125394861300239000,
"line_mean": 30.9360730594,
"line_max": 144,
"alpha_frac": 0.4996424996,
"autogenerated": false,
"ratio": 3.3913676042677015,
"config_te... |
__author__ = 'riko'
import math
import calculations as calc
import ranking_systems as rs
import tennis_model as tm
from tennis_model import overrides
class DoubleGlicko2Model(tm.TennisRankingModel):
'''
This is double Glicko2 model.
'''
def __init__(self, **kwargs):
'''
Constructor.... | {
"repo_name": "erix5son/Tennis-Modelling",
"path": "models/double_glicko2_model.py",
"copies": "1",
"size": "3321",
"license": "mit",
"hash": 7159245804260807000,
"line_mean": 28.1315789474,
"line_max": 121,
"alpha_frac": 0.5001505571,
"autogenerated": false,
"ratio": 3.445020746887967,
"config... |
__author__ = 'riko'
import math
import numpy as np
import scipy as sp
import scipy.stats
import calculations as calc
import ranking_systems as rs
import tennis_model as tm
from tennis_model import overrides
ALPHA = 0.01
CONF = [0,0,0,0]+[sp.stats.t.ppf((1+ALPHA)/2., 100*n2-1) for n2 in xrange(5, 2000)]
class Surfa... | {
"repo_name": "erix5son/Tennis-Modelling",
"path": "models/double_elo_surface_model.py",
"copies": "1",
"size": "6075",
"license": "mit",
"hash": -8162068843375939000,
"line_mean": 24.5294117647,
"line_max": 134,
"alpha_frac": 0.4872427984,
"autogenerated": false,
"ratio": 3.3251231527093594,
"... |
__author__ = 'riko'
import math
import calculations as calc
import tennis_model as tm
from tennis_model import overrides
class Player(object):
'''
Wraper for stats we need to store for each player in Barnett model.
'''
def __init__(self):
'''
Constructor.
:return: void
... | {
"repo_name": "erix5son/Tennis-Modelling",
"path": "models/barnett_model.py",
"copies": "1",
"size": "2670",
"license": "mit",
"hash": 5666689198229714000,
"line_mean": 22.0172413793,
"line_max": 127,
"alpha_frac": 0.4838951311,
"autogenerated": false,
"ratio": 3.5039370078740157,
"config_test"... |
__author__ = 'riko'
import math
import numpy as np
import calculations as calc
import ranking_systems as rs
import tennis_model as tm
from tennis_model import overrides
class Player(object):
'''
Class containing all data about the tennis player including specific
ratings used in this model.
'''
... | {
"repo_name": "erix5son/Tennis-Modelling",
"path": "models/double_modified_glicko_model.py",
"copies": "1",
"size": "12187",
"license": "mit",
"hash": -4576483819406859300,
"line_mean": 29.9314720812,
"line_max": 93,
"alpha_frac": 0.5437761549,
"autogenerated": false,
"ratio": 3.703129747797022,
... |
__author__ = 'riko'
import matplotlib.pyplot as plt
import data_tools as dt
import models
import numpy as np
import scipy as sp
import scipy.stats
glicko = models.DoubleModifiedGlickoModel()
data = dt.get_main_matches_data()
df = glicko.test(data)
y = np.append(np.array(df["WSP1"]), np.array(df["WSP2"]))
x = np.... | {
"repo_name": "erix5son/Tennis-Modelling",
"path": "demos/double_glicko_results.py",
"copies": "1",
"size": "1057",
"license": "mit",
"hash": -8169440997005812000,
"line_mean": 20.5714285714,
"line_max": 62,
"alpha_frac": 0.6736045412,
"autogenerated": false,
"ratio": 2.522673031026253,
"config... |
__author__ = 'riko'
import tennis_model as tm
from tennis_model import overrides
import modified_glicko as mg
class ModifiedGlickoModel(tm.TennisRankingModel):
'''
This is Modified Glicko model. Idea is to continuously compare players and
update their rankings accordingly.
Parameters of the model:
... | {
"repo_name": "erix5son/Tennis-Modelling",
"path": "models/modified_glicko_model.py",
"copies": "1",
"size": "2830",
"license": "mit",
"hash": -4426833376486662700,
"line_mean": 27.0297029703,
"line_max": 93,
"alpha_frac": 0.5293286219,
"autogenerated": false,
"ratio": 3.7935656836461127,
"conf... |
__author__ = 'rischan'
import constants
from datetime import datetime
import time
from util import setup_api
import tweepy
from tweepy import Cursor, TweepError
import sys
# constants
consumer_key = constants.consumer_key
consumer_secret = constants.consumer_secret
access_key = constants.access_key
access_secret = co... | {
"repo_name": "rischanlab/research_tw_politic",
"path": "tw_rischan_py/unfollow_nonfollowers2.py",
"copies": "1",
"size": "1664",
"license": "bsd-3-clause",
"hash": 1259805026605039600,
"line_mean": 28.2105263158,
"line_max": 82,
"alpha_frac": 0.6460336538,
"autogenerated": false,
"ratio": 3.7142... |
__author__ = 'rischan'
import constants
from db_conn import DBConn
from random import randint
from datetime import datetime
import time
from util import setup_api
# constants
consumer_key = constants.consumer_key
consumer_secret = constants.consumer_secret
access_key = constants.access_key
access_secret = constants.a... | {
"repo_name": "rischanlab/research_tw_politic",
"path": "tw_rischan_py/autotweet.py",
"copies": "1",
"size": "1222",
"license": "bsd-3-clause",
"hash": -1439201512742704400,
"line_mean": 27.4186046512,
"line_max": 77,
"alpha_frac": 0.6587561375,
"autogenerated": false,
"ratio": 3.3027027027027027... |
__author__ = 'rischan'
import tweepy
import constants
import time
from datetime import datetime
from tweepy import Cursor, TweepError
from util import is_up2date, is_good_account, setup_api
# constants
consumer_key = constants.consumer_key
consumer_secret = constants.consumer_secret
access_key = constants.access_key... | {
"repo_name": "rischanlab/research_tw_politic",
"path": "tw_rischan_py/getallfollowers.py",
"copies": "1",
"size": "1087",
"license": "bsd-3-clause",
"hash": 8053671798969207000,
"line_mean": 23.7045454545,
"line_max": 81,
"alpha_frac": 0.6550137994,
"autogenerated": false,
"ratio": 3.58745874587... |
from astropy.time import TimeDelta
import astropy.units as u
from sunpy.time import TimeRange
from sunpy.util.scraper import Scraper
from ..client import GenericClient
__all__ = ['EVEClient']
BASEURL = ('http://lasp.colorado.edu/eve/data_access/evewebdata/quicklook/'
'L0CS/SpWx/%Y/%Y%m%d_EVE_L0CS_DIODE... | {
"repo_name": "dpshelio/sunpy",
"path": "sunpy/net/dataretriever/sources/eve.py",
"copies": "2",
"size": "3531",
"license": "bsd-2-clause",
"hash": 5512430896227194000,
"line_mean": 30.2477876106,
"line_max": 86,
"alpha_frac": 0.5562163693,
"autogenerated": false,
"ratio": 3.7724358974358974,
"... |
import socket
import posixpath
from datetime import datetime
from urllib.error import URLError
from urllib.request import urlopen, urlretrieve
from dateutil.rrule import rrule, MONTHLY
import astropy.units as u
from sunpy.time import TimeRange, parse_time
from sunpy.instr import rhessi
from ..client import GenericC... | {
"repo_name": "dpshelio/sunpy",
"path": "sunpy/net/dataretriever/sources/rhessi.py",
"copies": "2",
"size": "6206",
"license": "bsd-2-clause",
"hash": 2759563048058542600,
"line_mean": 34.6666666667,
"line_max": 130,
"alpha_frac": 0.6048984853,
"autogenerated": false,
"ratio": 3.8285009253547195,... |
import tarfile
import pathlib
from collections import OrderedDict
from parfive import Downloader
import astropy.units as u
from astropy.time import Time, TimeDelta
from ..client import GenericClient
__all__ = ['NOAAIndicesClient', 'NOAAPredictClient', 'SRSClient']
class NOAAIndicesClient(GenericClient):
@stat... | {
"repo_name": "dpshelio/sunpy",
"path": "sunpy/net/dataretriever/sources/noaa.py",
"copies": "2",
"size": "6816",
"license": "bsd-2-clause",
"hash": 5048862062409750000,
"line_mean": 29.1592920354,
"line_max": 97,
"alpha_frac": 0.5435739437,
"autogenerated": false,
"ratio": 4.138433515482696,
"... |
from urllib.parse import urljoin
from ..client import GenericClient
__all__ = ['LYRAClient']
class LYRAClient(GenericClient):
def _get_url_for_timerange(self, timerange, **kwargs):
"""
Returns list of URLS corresponding to value of input timerange.
Parameters
----------
... | {
"repo_name": "dpshelio/sunpy",
"path": "sunpy/net/dataretriever/sources/lyra.py",
"copies": "2",
"size": "2346",
"license": "bsd-2-clause",
"hash": 972596108971842600,
"line_mean": 27.6097560976,
"line_max": 82,
"alpha_frac": 0.5481670929,
"autogenerated": false,
"ratio": 4.037865748709122,
"c... |
import os
from urllib.parse import urlsplit
from astropy.time import TimeDelta
from astropy.time import Time
import astropy.units as u
from datetime import timedelta
from sunpy.time import parse_time, TimeRange
from ..client import GenericClient
from sunpy import config
TIME_FORMAT = config.get("general", "time_fo... | {
"repo_name": "dpshelio/sunpy",
"path": "sunpy/net/dataretriever/sources/goes.py",
"copies": "2",
"size": "5495",
"license": "bsd-2-clause",
"hash": -2776204320480981500,
"line_mean": 35.3907284768,
"line_max": 91,
"alpha_frac": 0.5648771611,
"autogenerated": false,
"ratio": 3.800138312586445,
... |
from astropy.time import TimeDelta
import astropy.units as u
from sunpy.time import TimeRange
from sunpy.util.scraper import Scraper
from sunpy.net import attrs as a
from ..client import GenericClient
__all__ = ['NoRHClient']
BASEURL = 'ftp://solar-pub.nao.ac.jp/pub/nsro/norh/data/tcx/%Y/%m/{freq}%y%m%d'
class ... | {
"repo_name": "dpshelio/sunpy",
"path": "sunpy/net/dataretriever/sources/norh.py",
"copies": "2",
"size": "4255",
"license": "bsd-2-clause",
"hash": -5265681579546195000,
"line_mean": 33.8770491803,
"line_max": 100,
"alpha_frac": 0.5898942421,
"autogenerated": false,
"ratio": 3.8402527075812274,
... |
__author__ = 'rishabn'
from foctor_core import *
def read_rule_file(filename, start, stop):
f = open(filename)
rules = list()
for line in f:
line = line.split(",")
if (int(line[0]) < int(start)) or (int(line[0]) > int(stop)):
continue
if line[2].strip() == "no-matching... | {
"repo_name": "iclab/centinel",
"path": "centinel/primitives/foctor_core/foctor_search.py",
"copies": "3",
"size": "4355",
"license": "mit",
"hash": -5059264270631826000,
"line_mean": 36.2222222222,
"line_max": 128,
"alpha_frac": 0.5836969001,
"autogenerated": false,
"ratio": 3.4784345047923324,
... |
__author__ = 'rishabn'
import os
import time
def copy_file(source, destination):
command = "sudo cp " + source + " " + destination
os.system(command)
def kill_list_of_programs(programs):
for i in programs:
command = "sudo pkill --signal 9 " + i
os.system(command)
def start_program(pat... | {
"repo_name": "lianke123321/centinel",
"path": "centinel/primitives/foctor_core/foctor_misc.py",
"copies": "3",
"size": "1713",
"license": "mit",
"hash": 8557045556319912000,
"line_mean": 20.6835443038,
"line_max": 57,
"alpha_frac": 0.5720957385,
"autogenerated": false,
"ratio": 3.042628774422735... |
__author__ = 'rishabn'
import signal
import errno
import sys
import logging
from foctor_misc import *
from foctor_search import *
from foctor_authentication import *
from selenium import webdriver
from selenium.common.exceptions import NoAlertPresentException
from selenium.webdriver.firefox.firefox_binary import Fir... | {
"repo_name": "lianke123321/centinel",
"path": "centinel/primitives/foctor_core/foctor_core.py",
"copies": "3",
"size": "23772",
"license": "mit",
"hash": 4326039522464412000,
"line_mean": 43.8528301887,
"line_max": 126,
"alpha_frac": 0.5907790678,
"autogenerated": false,
"ratio": 3.7986577181208... |
__author__ = 'rishabn'
import time
import signal
import errno
import os
from functools import wraps
from selenium.common.exceptions import StaleElementReferenceException, ElementNotSelectableException, \
NoSuchElementException, ElementNotVisibleException, TimeoutException
from selenium.webdriver.common.keys impor... | {
"repo_name": "iclab/centinel",
"path": "centinel/primitives/foctor_core/foctor_authentication.py",
"copies": "3",
"size": "16818",
"license": "mit",
"hash": 9196336764999807000,
"line_mean": 39.7215496368,
"line_max": 120,
"alpha_frac": 0.5328814366,
"autogenerated": false,
"ratio": 4.2235057759... |
__author__ = 'rishabn'
def fp_crawler_mode_error():
str_err = "Please specify a crawl mode: standard, tor, search_log, or login_log \n"
str_err += "python front-page-crawler.py <crawl-mode>"
print str_err
raise SystemExit
def fp_crawler_standard_mode_error():
str_err = "Usage for standard crawl:... | {
"repo_name": "rpanah/centinel",
"path": "centinel/primitives/foctor_core/foctor_args_error.py",
"copies": "3",
"size": "3834",
"license": "mit",
"hash": -3257258080661451000,
"line_mean": 36.2233009709,
"line_max": 114,
"alpha_frac": 0.6737089202,
"autogenerated": false,
"ratio": 3.2464013547840... |
__author__ = 'ritesh'
class Node(object):
"""
Node for the linked list
"""
def __init__(self, value):
"""
param: value for the node
"""
self.value = value
self.next = None
class LinkedList:
"""
Linked List
"""
def __init__(self):
... | {
"repo_name": "RiteshAgrawal/Data_Struct_Algo",
"path": "linked_list.py",
"copies": "1",
"size": "1637",
"license": "mit",
"hash": 6710858151962649000,
"line_mean": 22.4,
"line_max": 65,
"alpha_frac": 0.5033598045,
"autogenerated": false,
"ratio": 4.240932642487047,
"config_test": false,
"has... |
__author__ = 'RiteshReddy'
import json
from flaskappbase import app
class BhajanModel():
FILLER_SLIDE = {
"id": -1,
"name": "",
"bhajan": "",
"meaning": ""
}
@staticmethod
def __read_bhajans_file(filename=app.config['BHAJAN_SOURCE_FILE']):
"""
Structur... | {
"repo_name": "riteshreddyr/bhajanpresentationmaker",
"path": "models/BhajanModel.py",
"copies": "1",
"size": "4864",
"license": "mit",
"hash": 8220851354503886000,
"line_mean": 31.2185430464,
"line_max": 90,
"alpha_frac": 0.4954769737,
"autogenerated": false,
"ratio": 3.4917444364680548,
"conf... |
__author__ = 'RiteshReddy'
import os
import random
from pptx import Presentation
from pptx.util import Inches
from pptx.enum.text import PP_PARAGRAPH_ALIGNMENT as PP_ALIGN
from pptx.dml.color import RGBColor
from pptx.util import Pt
from pptx.enum.text import MSO_AUTO_SIZE
from ttfquery import describe, glyphquery
fr... | {
"repo_name": "riteshreddyr/bhajanpresentationmaker",
"path": "ppt/Presentation.py",
"copies": "1",
"size": "13971",
"license": "mit",
"hash": -5391432954716965000,
"line_mean": 51.7245283019,
"line_max": 843,
"alpha_frac": 0.5789134636,
"autogenerated": false,
"ratio": 3.364884393063584,
"conf... |
__author__ = 'RiteshReddy'
import os
from flask import render_template, request, redirect, send_from_directory, flash, jsonify
from flaskappbase import app
from models.BhajanModel import BhajanModel
@app.route("/bhajanmanager", methods=["GET"])
def list_all_bhajans():
bhajans = BhajanModel.get_all_bhajans()
... | {
"repo_name": "riteshreddyr/bhajanpresentationmaker",
"path": "controllers/BhajanManager.py",
"copies": "1",
"size": "4616",
"license": "mit",
"hash": -6278815780739488000,
"line_mean": 39.5,
"line_max": 132,
"alpha_frac": 0.6405979203,
"autogenerated": false,
"ratio": 3.325648414985591,
"confi... |
__author__ = 'rj'
'''
This file creates
'''
import numpy as np
import cv2
from data_utils import resize
import data_utils
import os
def convert_image_to_display(img):
'''
:param img:
:return:
'''
return 255 * normalize_image(img)
def calculate_warp_matrix(img1, img2, img_id):
i... | {
"repo_name": "jiangxu87/dstl_unet",
"path": "utils/align_images.py",
"copies": "1",
"size": "5369",
"license": "mit",
"hash": 3519448004712986000,
"line_mean": 35.2837837838,
"line_max": 134,
"alpha_frac": 0.587073943,
"autogenerated": false,
"ratio": 2.9844357976653697,
"config_test": false,
... |
__author__ = 'rjs'
from collections import namedtuple
CommentNode = namedtuple('CommentNode', ['comment'])
ColorModelNode = namedtuple('ColorModelNode', ['model', 'interpolation'])
TripletNode = namedtuple('TripletNode', ['first', 'second', 'third'])
CMYKColorNode = namedtuple('CMYKColorNode', ['cyan', 'magenta', 'ye... | {
"repo_name": "rob-smallshire/pycpt",
"path": "pycpt/ast.py",
"copies": "1",
"size": "1106",
"license": "mit",
"hash": -7952415071253196000,
"line_mean": 41.5384615385,
"line_max": 81,
"alpha_frac": 0.6817359855,
"autogenerated": false,
"ratio": 3.7364864864864864,
"config_test": false,
"has_... |
__author__ = 'rknight'
import os
import csv
import logging
import datetime
from requests_futures.sessions import FuturesSession
def dl(reports, dlkeys):
# Primary call
# Send requests
allreports = dlrequest(reports=reports, dlkeys=dlkeys)
# Write results
for outreport in allreports.keys():
... | {
"repo_name": "upeducationnetwork/deanslist-python",
"path": "deanslist/deanslist.py",
"copies": "1",
"size": "9507",
"license": "mit",
"hash": 4064295224572971000,
"line_mean": 30.4801324503,
"line_max": 141,
"alpha_frac": 0.5719995793,
"autogenerated": false,
"ratio": 4.013085690164626,
"conf... |
__author__ = 'rmorlok'
import os
import tempfile
import shutil
import subprocess
class ConfigurationException(Exception):
pass
class ArgumentException(Exception):
pass
class DummyLogger(object):
def debug(self, *args, **kwargs):
pass
def info(self, *args, **kwargs):
pass
def ... | {
"repo_name": "Docalytics/shell-wrapper",
"path": "shellwrapper/__init__.py",
"copies": "1",
"size": "3938",
"license": "mit",
"hash": -5189330851833406000,
"line_mean": 28.6090225564,
"line_max": 134,
"alpha_frac": 0.6130015236,
"autogenerated": false,
"ratio": 4.093555093555094,
"config_test"... |
__author__ = 'Robbert Harms'
__date__ = "2015-04-23"
__maintainer__ = "Robbert Harms"
__email__ = "robbert.harms@maastrichtuniversity.nl"
class DVS(object):
def __init__(self, comments, dvs_tables):
"""Create a new DVS object
Args:
comments (str): The list with comments on top of the... | {
"repo_name": "robbert-harms/mri-tools",
"path": "mri_tools/dvs/base.py",
"copies": "1",
"size": "3085",
"license": "bsd-3-clause",
"hash": -6683964602562047000,
"line_mean": 38.0632911392,
"line_max": 104,
"alpha_frac": 0.5928687196,
"autogenerated": false,
"ratio": 3.945012787723785,
"config_... |
__author__ = 'Robbie Barrat'
# I need the datetime module for telling the current date when I compare todays stock values to 5 days ago and such.
import datetime
# Yahoo Finance V. 1.1.4
from yahoo_finance import Share
# Arrow -- replaced the old date module
import arrow
# Checks to see if it is currently the weekend... | {
"repo_name": "robbiebarrat/Stock_advisor",
"path": "Stocks.py",
"copies": "1",
"size": "9620",
"license": "mit",
"hash": 2703586199950430700,
"line_mean": 45.9268292683,
"line_max": 159,
"alpha_frac": 0.6637214137,
"autogenerated": false,
"ratio": 3.8557114228456912,
"config_test": false,
"h... |
author__ = 'Robbie Barrat'
# I'd like to give github user 'timster' credit for optimizing a lot of rough bits in the code, he's helped a lot.
# This was a quick project. Inspired by a story I heard of on the news where a guy did something almost exactly the same
# and won a bunch of stuff. I couldn't find the code t... | {
"repo_name": "janusnic/twitter-contest-enterer",
"path": "twitterbot.py",
"copies": "1",
"size": "3064",
"license": "mit",
"hash": 7873782276021935000,
"line_mean": 37.7848101266,
"line_max": 127,
"alpha_frac": 0.6044386423,
"autogenerated": false,
"ratio": 3.583625730994152,
"config_test": fa... |
__author__ = 'robdobsn'
from HttpHandler import HttpHandler
import ICalParser
from threading import Thread, Lock
import time
from datetime import datetime
from datetime import timedelta
class CalendarUpdateThread(Thread):
def __init__(self, parent, cal_feeds, cal_update_period_secs):
Thread.__init__(self... | {
"repo_name": "robdobsn/RdHomeServer",
"path": "pyFlaskServer/CalendarManager.py",
"copies": "1",
"size": "5394",
"license": "mit",
"hash": 8322795425603801000,
"line_mean": 42.8536585366,
"line_max": 136,
"alpha_frac": 0.4892473118,
"autogenerated": false,
"ratio": 4.155624036979969,
"config_t... |
__author__ = 'Rob Edwards'
def ed_neighborsof(i,j, scorematrix):
neighbors = []
if i - 1 >= 0 and j - 1 >= 0:
neighbors.append(scorematrix[i-1][j-1])
neighbors.append(scorematrix[i-1][j])
neighbors.append(scorematrix[i][j-1])
elif i - 1 >= 0:
neighbors.append(scorematrix[i-... | {
"repo_name": "linsalrob/EdwardsLab",
"path": "roblib/alignments.py",
"copies": "1",
"size": "1127",
"license": "mit",
"hash": 5147648689209576000,
"line_mean": 27.175,
"line_max": 103,
"alpha_frac": 0.5403726708,
"autogenerated": false,
"ratio": 3.0214477211796247,
"config_test": false,
"has... |
__author__ = 'Rob Edwards'
import sys
from matrices import blosum62
def score(a, b):
blosum = blosum62()
if a in blosum and b in blosum[a]:
return blosum[a][b]
elif b in blosum and a in blosum[b]:
return blosum[b][a]
else:
sys.stderr.write("Can not score amino acids " + a + " a... | {
"repo_name": "linsalrob/EdwardsLab",
"path": "perl/alignment/gapped_alignment2.py",
"copies": "2",
"size": "5460",
"license": "mit",
"hash": 7170422211863110000,
"line_mean": 37.7234042553,
"line_max": 128,
"alpha_frac": 0.5758241758,
"autogenerated": false,
"ratio": 2.8275504919730707,
"confi... |
__author__ = 'Rob Edwards'
import sys
from matrices import blosum62
def score(a, b):
"""score dna as match/mismatch"""
if a == b:
return 1
return -1
def dna_score_alignment(seq1, seq2, gap_open=11, gap_extend=1):
"""
Generate a score for an alignment between two sequences. This does not ... | {
"repo_name": "linsalrob/bioinformatics",
"path": "Modules/alignment/dna_alignment.py",
"copies": "2",
"size": "5284",
"license": "mit",
"hash": -6664370140683078000,
"line_mean": 37.5693430657,
"line_max": 128,
"alpha_frac": 0.5766464799,
"autogenerated": false,
"ratio": 2.8241582041688935,
"c... |
import sys, pyautogui, time, drawings
class Main():
def __init__(self):
if len(sys.argv) == 2: # Check that the user passed exactly 1 command line argument.
time.sleep(5) # Allow the user 5 seconds to position their mouse.
self.draw(sy... | {
"repo_name": "zeropointo/autodraw",
"path": "autodraw.py",
"copies": "1",
"size": "1218",
"license": "apache-2.0",
"hash": -3861303453184475000,
"line_mean": 38.6,
"line_max": 117,
"alpha_frac": 0.5591133005,
"autogenerated": false,
"ratio": 3.625,
"config_test": false,
"has_no_keywords": fa... |
__author__ = 'robertb'
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from notifications.utils import get_mailchimp_api
from notifications.models import Recipient
import mailchimp
class Command(BaseCommand):
help = 'executes a batch update to mailchimp with all c... | {
"repo_name": "nathangeffen/tbonline-2",
"path": "tbonlineproject/notifications/management/commands/mailchimp_batch_update.py",
"copies": "1",
"size": "1114",
"license": "mit",
"hash": -9217542813758797000,
"line_mean": 29.1351351351,
"line_max": 122,
"alpha_frac": 0.6454219031,
"autogenerated": fa... |
__author__ = 'Robert Eviston'
'''
Date: 04/02/2017
Python program for converting a csv file containing pokemon into
a more refined version. In this version we will group pokemon by generation.
This will help refine the seach for searches on generation.
'''
from pymongo import MongoClient
def mongo_function(option):
... | {
"repo_name": "RobertEviston/CollegeWork",
"path": "Database Administration/ConversionScript.py",
"copies": "1",
"size": "4515",
"license": "mit",
"hash": 4271986569036410000,
"line_mean": 46.03125,
"line_max": 148,
"alpha_frac": 0.5012181617,
"autogenerated": false,
"ratio": 4.082278481012659,
... |
__author__ = 'Robert Eviston'
def caesar(s, k, decrypt=False):
if decrypt: k = 26 - k
r = ""
for i in s:
if (ord(i) >= 65 and ord(i) <= 90):
r += chr((ord(i) - 65 + k) % 26 +65)
elif (ord(i) >= 97 and ord(i) <= 122):
r += chr((ord(i) - 97 + k) % 26 + 97)
el... | {
"repo_name": "RobertEviston/CollegeWork",
"path": "4th Year Security Labs/Lab 2/Lab2Question1.py",
"copies": "1",
"size": "1203",
"license": "mit",
"hash": 7725357385408906000,
"line_mean": 29.8461538462,
"line_max": 430,
"alpha_frac": 0.5868661679,
"autogenerated": false,
"ratio": 3.06106870229... |
import torch
import torch.autograd as autograd # torch中自动计算梯度模块
import torch.nn as nn # 神经网络模块
import torch.nn.functional as F # 神经网络模块中的常用功能
import torch.optim as optim # 模型优化器模块
import numpy as np
training_data=[]
file=open('/Users/zoe/Documents/event_extraction/CRF++-0.58/example/seque... | {
"repo_name": "zoeyangyy/event-extraction",
"path": "POSargu.py",
"copies": "1",
"size": "5341",
"license": "mit",
"hash": 5881811890705071000,
"line_mean": 40.9304347826,
"line_max": 648,
"alpha_frac": 0.6139355884,
"autogenerated": false,
"ratio": 2.4344181459566077,
"config_test": false,
"... |
__author__ = 'Robert Hayek and Keith Neyman'
file = open( "/dev/input/mice", "rb" );
speed=150
debug = 0 #Print raw values when debugging
def getMouseEvent():
buf = file.read(3)
button = ord( buf[0] )
bLeft = button & 0x1
bMiddle = ( button & 0x4 ) > 0
bRight = ( button & 0x2 ) > 0
x,y = struct.un... | {
"repo_name": "hayekr/GoPiGoButler",
"path": "mouse_control_buttons.py",
"copies": "1",
"size": "1049",
"license": "apache-2.0",
"hash": 5988137978559165000,
"line_mean": 23.6341463415,
"line_max": 78,
"alpha_frac": 0.6167778837,
"autogenerated": false,
"ratio": 2.5095693779904304,
"config_test... |
# ipmort Extreme OS Class
import os
# VLAN Class
class Vlan:
# Number of VLANs checked
checkedVLANs = 0
# Number of VLANs which exist (ID)
existingIDs = 0
# Number of VLANs which exist (name)
existingNames = 0
# Number of VLANs where ID and Name do not exist
creatableVLANs = 0
# Number of VLANs with matchin... | {
"repo_name": "extremenetworks/xkit",
"path": "EXOS/Python/vlan_existencecheck/vlan_existencecheck.py",
"copies": "2",
"size": "4100",
"license": "bsd-2-clause",
"hash": 481657490624507500,
"line_mean": 28.2928571429,
"line_max": 161,
"alpha_frac": 0.6668292683,
"autogenerated": false,
"ratio": 2... |
__author__ = 'RobertIan'
__version__= '2.0.1'
'''
///////////////////////////////////////////////////////////
// Permission is hereby granted, free of charge,
// to any person obtaining a copy of
// this software and associated documentation files
// (the "Software"), to deal in the Software without
// restrictio... | {
"repo_name": "RobertIan/LearningFearandMatechoice",
"path": "processData_new.py",
"copies": "1",
"size": "31346",
"license": "mit",
"hash": -880358451655216600,
"line_mean": 62.7113821138,
"line_max": 125,
"alpha_frac": 0.3938301538,
"autogenerated": false,
"ratio": 5.232181605741946,
"config_... |
__author__ = 'RobertIan'
__version__ = '4.0.1'
'''
///////////////////////////////////////////////////////////
// Permission is hereby granted, free of charge,
// to any person obtaining a copy of
// this software and associated documentation files
// (the "Software"), to deal in the Software without
// restrictio... | {
"repo_name": "RobertIan/ethoStim",
"path": "pooky.py",
"copies": "1",
"size": "13396",
"license": "mit",
"hash": 7887881682334095000,
"line_mean": 42.4935064935,
"line_max": 113,
"alpha_frac": 0.5194087787,
"autogenerated": false,
"ratio": 3.487633428794585,
"config_test": false,
"has_no_key... |
# Enthought library imports.
from traits.api import Instance
from tvtk.api import tvtk
# Local imports
from mayavi.filters.filter_base import FilterBase
from mayavi.core.pipeline_info import PipelineInfo
######################################################################
# `TriangleFilter` class.
###############... | {
"repo_name": "alexandreleroux/mayavi",
"path": "mayavi/filters/triangle_filter.py",
"copies": "5",
"size": "1310",
"license": "bsd-3-clause",
"hash": -1201765540340505300,
"line_mean": 34.4054054054,
"line_max": 82,
"alpha_frac": 0.5610687023,
"autogenerated": false,
"ratio": 4.851851851851852,
... |
__author__ = 'robertkohl125@gmail.com (Robert Kohl)'
import httplib
import endpoints
from protorpc import messages
from google.appengine.ext import ndb
from google.appengine.ext.ndb import msgprop
# Define the Profile Kind
class Profile(ndb.Model):
"""Profile -- User profile object"""
user_id = n... | {
"repo_name": "robertkohl125/MathQuizer",
"path": "models.py",
"copies": "1",
"size": "1399",
"license": "apache-2.0",
"hash": 307061661489285570,
"line_mean": 30.1111111111,
"line_max": 63,
"alpha_frac": 0.6790564689,
"autogenerated": false,
"ratio": 4.213855421686747,
"config_test": false,
... |
from sklearn.base import BaseEstimator
from scipy.sparse.csr import csr_matrix
from sklearn.neighbors import NearestCentroid, nearest_centroid
from sklearn.metrics.pairwise import pairwise_distances
import numpy as np
from scipy import sparse as sp
from cProfile import label
class RocchioClassifier(NearestCentroid):... | {
"repo_name": "quadflor/Quadflor",
"path": "Code/lucid_ml/classifying/rocchioclassifier.py",
"copies": "1",
"size": "5727",
"license": "bsd-3-clause",
"hash": -7439860882440766000,
"line_mean": 38.4965517241,
"line_max": 108,
"alpha_frac": 0.6067749258,
"autogenerated": false,
"ratio": 4.15602322... |
import pickle
import multiprocessing
import signal
import numpy as np
import sys
# from . import AGD_decomposer
from .gp import GaussianDecomposer
from tqdm import tqdm
from concurrent.futures import ProcessPoolExecutor, as_completed
# BUG FIXED: UnboundLocalError: local variable 'result' referenced before assignm... | {
"repo_name": "gausspy/gausspy",
"path": "gausspy/batch_decomposition.py",
"copies": "1",
"size": "4715",
"license": "mit",
"hash": 73266383317887970,
"line_mean": 32.9208633094,
"line_max": 106,
"alpha_frac": 0.6205726405,
"autogenerated": false,
"ratio": 3.5692657077971233,
"config_test": fal... |
__author__ = 'Robert Meyer'
from brian import *
def run_network():
clear(True, True)
monitor_dict={}
defaultclock.dt= 0.01*ms
C=281*pF
gL=30*nS
EL=-70.6*mV
VT=-50.4*mV
DeltaT=2*mV
tauw=40*ms
a=4*nS
b=0.08*nA
I=8*nA
Vcut=DeltaT# practical threshold condition
N... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/unittests/briantests/run_a_brian_network.py",
"copies": "1",
"size": "2219",
"license": "bsd-3-clause",
"hash": 3909736479707986400,
"line_mean": 28.2105263158,
"line_max": 82,
"alpha_frac": 0.6854438936,
"autogenerated": false,
"ratio": 2.84852... |
__author__ = 'Robert Meyer'
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np
import os # For path names working under Windows ans Linux
from pypet import Environment, cartesian_product
from pypet import pypetconstants
def multiply(traj):
"""Sophisticated simulation of m... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_10_get_items_from_all_runs.py",
"copies": "2",
"size": "2216",
"license": "bsd-3-clause",
"hash": -914692065299804000,
"line_mean": 31.115942029,
"line_max": 79,
"alpha_frac": 0.7075812274,
"autogenerated": false,
"ratio": 3.174785100286533... |
__author__ = 'Robert Meyer'
from pypet import Trajectory, pypetexceptions, PickleResult
from pypet.tests.testutils.data import TrajectoryComparator
from pypet.tests.testutils.ioutils import make_temp_dir, run_suite, parse_args
import pypet.pypetexceptions as pex
class LinkTrajectoryTests(TrajectoryComparator):
... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/unittests/link_test.py",
"copies": "2",
"size": "10166",
"license": "bsd-3-clause",
"hash": -4577016284142131000,
"line_mean": 29.3492537313,
"line_max": 95,
"alpha_frac": 0.6129254377,
"autogenerated": false,
"ratio": 3.0301043219076007,
"con... |
__author__ = 'Robert Meyer'
from pypet import Trajectory, Result, Parameter
traj = Trajectory()
# There are more ways to add data,
# 1st the standard way:
traj.f_add_parameter('x', 1, comment='I am the first dimension!')
# 2nd by providing a new parameter/result instance, be aware that the data is added where
# you... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "examples/example_15_more_ways_to_add_data.py",
"copies": "2",
"size": "1166",
"license": "bsd-3-clause",
"hash": -5856433488461548000,
"line_mean": 36.6129032258,
"line_max": 89,
"alpha_frac": 0.7281303602,
"autogenerated": false,
"ratio": 3.42941... |
__author__ = 'Robert Meyer'
import logging
import os # For path names being viable under Windows and Linux
from pypet.environment import Environment
from pypet.brian2.parameter import Brian2Parameter, Brian2MonitorResult
from pypet.utils.explore import cartesian_product
# Don't do this at home:
from brian2 import pF,... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "examples/example_23_brian2_network.py",
"copies": "2",
"size": "3756",
"license": "bsd-3-clause",
"hash": -5235815136557854000,
"line_mean": 31.9473684211,
"line_max": 99,
"alpha_frac": 0.6592119276,
"autogenerated": false,
"ratio": 3.132610508757... |
__author__ = 'Robert Meyer'
import logging
import os # For path names being viable under Windows and Linux
from pypet.environment import Environment
from pypet.brian.parameter import BrianParameter,BrianMonitorResult
from pypet.utils.explore import cartesian_product
# Don't do this at home:
from brian import *
# We ... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_07_brian_network.py",
"copies": "1",
"size": "3935",
"license": "bsd-3-clause",
"hash": -7279669685448351000,
"line_mean": 29.2692307692,
"line_max": 99,
"alpha_frac": 0.6480304956,
"autogenerated": false,
"ratio": 3.153044871794872,
"con... |
__author__ = 'Robert Meyer'
import logging
import os
import random
import sys
import unittest
import configparser as cp
import shutil
import getopt
import tempfile
import time
try:
import zmq
except ImportError:
zmq = None
import pypet.pypetconstants as pypetconstants
from pypet import HasLogger
from pypet.py... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "pypet/tests/testutils/ioutils.py",
"copies": "1",
"size": "10825",
"license": "bsd-3-clause",
"hash": 460216993872158800,
"line_mean": 30.5626822157,
"line_max": 106,
"alpha_frac": 0.6080369515,
"autogenerated": false,
"ratio": 3.9944649446494465,... |
__author__ = 'Robert Meyer'
import multiprocessing as mp
import numpy as np
import os # For path names working under Windows and Linux
from pypet import Environment, cartesian_product
def multiply(traj, result_list):
"""Example of a sophisticated simulation that involves multiplying two values.
This time w... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "examples/example_12_sharing_data_between_processes.py",
"copies": "2",
"size": "2182",
"license": "bsd-3-clause",
"hash": -783124527978156900,
"line_mean": 31.1029411765,
"line_max": 98,
"alpha_frac": 0.6347387718,
"autogenerated": false,
"ratio":... |
__author__ = 'Robert Meyer'
import numpy as np
import inspect
import getopt
import sys
from pypet import Environment, Parameter, ArrayParameter, Trajectory
def euler_scheme(traj, diff_func):
"""Simulation function for Euler integration.
:param traj:
Container for parameters and results
:param... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "examples/example_22_saga_python/the_task.py",
"copies": "1",
"size": "5479",
"license": "bsd-3-clause",
"hash": -3228112521931734000,
"line_mean": 34.5779220779,
"line_max": 102,
"alpha_frac": 0.6398977916,
"autogenerated": false,
"ratio": 3.68707... |
__author__ = 'Robert Meyer'
import numpy as np
import inspect
import os # For path names being viable under Windows and Linux
from pypet import Environment, Parameter, ArrayParameter, Trajectory
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Here we will see how we can write our own custo... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "examples/example_05_custom_parameter.py",
"copies": "2",
"size": "10056",
"license": "bsd-3-clause",
"hash": -4568353429156449300,
"line_mean": 39.0637450199,
"line_max": 105,
"alpha_frac": 0.6673627685,
"autogenerated": false,
"ratio": 3.85730724... |
__author__ = 'Robert Meyer'
import numpy as np
import itertools as itools
import hashlib
from collections import deque
class Universe(object):
"""Contains everything"""
def __contains__(self, item):
return True
class IteratorChain(object):
"""Helper class that chains arbitrary generators and it... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "pypet/utils/helpful_classes.py",
"copies": "1",
"size": "3765",
"license": "bsd-3-clause",
"hash": 6153775520649245000,
"line_mean": 26.6838235294,
"line_max": 81,
"alpha_frac": 0.585126162,
"autogenerated": false,
"ratio": 4.602689486552567,
"c... |
__author__ = 'Robert Meyer'
import numpy as np
import itertools as itools
import hashlib
import pypet.compat as compat
from collections import deque
class Universe(object):
"""Contains everything"""
def __contains__(self, item):
return True
class IteratorChain(object):
"""Helper class that chai... | {
"repo_name": "nigroup/pypet",
"path": "pypet/utils/helpful_classes.py",
"copies": "1",
"size": "3629",
"license": "bsd-3-clause",
"hash": 9157843022073544000,
"line_mean": 26.4924242424,
"line_max": 81,
"alpha_frac": 0.5946541747,
"autogenerated": false,
"ratio": 4.508074534161491,
"config_tes... |
__author__ = 'Robert Meyer'
import numpy as np
import matplotlib.pyplot as plt
def euler_neuron(V_init, I, tau_V, tau_ref, dt, duration):
""" Simulation of a leaky integrate and fire neuron.
Simulates the equation
dV/dT = -1/tau_V * V + I
with a simple Euler scheme.
This is a unitless syst... | {
"repo_name": "SmokinCaterpillar/NIGroupTalkDemo",
"path": "lifmodel/lifneuron.py",
"copies": "1",
"size": "2109",
"license": "bsd-3-clause",
"hash": 8131177030630483000,
"line_mean": 26.4025974026,
"line_max": 86,
"alpha_frac": 0.600284495,
"autogenerated": false,
"ratio": 3.4630541871921183,
... |
__author__ = 'Robert Meyer'
import numpy as np
import os # For path names being viable under Windows and Linux
from pypet.trajectory import Trajectory
from pypet import pypetconstants
# Here I show how to store and load results in parts if they are quite large.
# I will skip using an environment and only work with a... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_09_large_results.py",
"copies": "2",
"size": "4076",
"license": "bsd-3-clause",
"hash": -5111809161268564000,
"line_mean": 43.3152173913,
"line_max": 100,
"alpha_frac": 0.7237487733,
"autogenerated": false,
"ratio": 3.332788225674571,
"co... |
__author__ = 'Robert Meyer'
import numpy as np
import os # For path names being viable under Windows and Linux
# Let's reuse the stuff from the previous example
from example_05_custom_parameter import euler_scheme, FunctionParameter, diff_lorenz
from pypet import Environment, ArrayParameter
import matplotlib.pyplot ... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_06_parameter_presetting.py",
"copies": "2",
"size": "6750",
"license": "bsd-3-clause",
"hash": 1924215104469486300,
"line_mean": 39.6626506024,
"line_max": 105,
"alpha_frac": 0.6542222222,
"autogenerated": false,
"ratio": 3.636853448275862,... |
__author__ = 'Robert Meyer'
import numpy as np
import sys
if (sys.version_info < (2, 7, 0)):
import unittest2 as unittest
else:
import unittest
from pypet.parameter import Parameter, PickleParameter, ArrayParameter,\
SparseParameter, ObjectTable, Result, SparseResult, PickleResult, BaseParameter
from pype... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/unittests/parameter_test.py",
"copies": "1",
"size": "35609",
"license": "bsd-3-clause",
"hash": 7824672092460014000,
"line_mean": 32.3115060804,
"line_max": 114,
"alpha_frac": 0.5536802494,
"autogenerated": false,
"ratio": 3.6332006938067543,
... |
__author__ = 'Robert Meyer'
import numpy as np
import sys
import unittest
from pypet.parameter import Parameter, PickleParameter, ArrayParameter,\
SparseParameter, ObjectTable, Result, SparseResult, PickleResult, BaseParameter
from pypet.trajectory import Trajectory
import pickle
import scipy.sparse as spsp
impor... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "pypet/tests/unittests/parameter_test.py",
"copies": "1",
"size": "35022",
"license": "bsd-3-clause",
"hash": 6543906277076770000,
"line_mean": 32.2908745247,
"line_max": 114,
"alpha_frac": 0.553880418,
"autogenerated": false,
"ratio": 3.6462259239... |
__author__ = 'Robert Meyer'
import os # For path names being viable under Windows and Linux
import logging
from pypet import Environment, cartesian_product
from pypet import pypetconstants
# Let's reuse the simple multiplication example
def multiply(traj):
"""Sophisticated simulation of multiplication"""
z=... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "examples/example_04_multiprocessing.py",
"copies": "2",
"size": "2663",
"license": "bsd-3-clause",
"hash": -7770205722456648000,
"line_mean": 38.1764705882,
"line_max": 91,
"alpha_frac": 0.6241081487,
"autogenerated": false,
"ratio": 4.26762820512... |
__author__ = 'Robert Meyer'
import os # For path names being viable under Windows and Linux
from pypet import Environment, cartesian_product
from pypet import pypetconstants
def multiply(traj):
"""Sophisticated simulation of multiplication"""
z=traj.x*traj.y
traj.f_add_result('z',z, comment='I am the pr... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_08_f_find_idx.py",
"copies": "2",
"size": "2145",
"license": "bsd-3-clause",
"hash": 8221092025856673000,
"line_mean": 34.1803278689,
"line_max": 97,
"alpha_frac": 0.7053613054,
"autogenerated": false,
"ratio": 3.3726415094339623,
"config... |
__author__ = 'Robert Meyer'
import os # For using pathnames under Windows and Linux
from pypet import Environment, cartesian_product
# Let's reuse the simple multiplication example
def multiply(traj):
"""Sophisticated simulation of multiplication"""
z=traj.x*traj.y
traj.f_add_result('z',z=z, comment='I ... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_03_trajectory_merging.py",
"copies": "2",
"size": "3759",
"license": "bsd-3-clause",
"hash": 3139641354591429000,
"line_mean": 39.8695652174,
"line_max": 96,
"alpha_frac": 0.6916733174,
"autogenerated": false,
"ratio": 3.4517906336088156,
... |
__author__ = 'Robert Meyer'
import os
from pypet.trajectory import load_trajectory
def merge_all_in_folder(folder, ext='.hdf5',
dynamic_imports=None,
storage_service=None,
force=False,
ignore_data=(),
... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "pypet/utils/trajectory_utils.py",
"copies": "2",
"size": "2782",
"license": "bsd-3-clause",
"hash": -3474999195695406000,
"line_mean": 35.1298701299,
"line_max": 87,
"alpha_frac": 0.5693745507,
"autogenerated": false,
"ratio": 4.401898734177215,
... |
__author__ = 'Robert Meyer'
import os
import logging
import platform
from pypet.tests.testutils.ioutils import unittest
from pypet.trajectory import Trajectory
from pypet.environment import Environment
from pypet.parameter import Parameter
from pypet.tests.testutils.ioutils import run_suite, make_temp_dir, \
get... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "pypet/tests/integration/pipeline_test.py",
"copies": "2",
"size": "10281",
"license": "bsd-3-clause",
"hash": -3902704749492992000,
"line_mean": 28.6311239193,
"line_max": 102,
"alpha_frac": 0.5530590409,
"autogenerated": false,
"ratio": 3.0726240... |
__author__ = 'Robert Meyer'
import os
import multiprocessing as mp
import logging
from pypet import Trajectory, MultiprocContext
def manipulate_multiproc_safe(traj):
""" Target function that manipulates the trajectory.
Stores the current name of the process into the trajectory and
**overwrites** previo... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_16_multiproc_context.py",
"copies": "2",
"size": "2244",
"license": "bsd-3-clause",
"hash": 4766812282606680000,
"line_mean": 34.6349206349,
"line_max": 93,
"alpha_frac": 0.6938502674,
"autogenerated": false,
"ratio": 4.210131332082551,
"... |
__author__ = 'Robert Meyer'
import os
import numpy as np
import pandas as pd
import logging
from pypet import Parameter, cartesian_product, Environment
from lifneuron import euler_neuron
def pypet_neuron(traj):
""" Wraps the `euler_neuron` function
:param traj: Trajectory container with all parameters
... | {
"repo_name": "SmokinCaterpillar/NIGroupTalkDemo",
"path": "lifmodel/pypetwrapper.py",
"copies": "1",
"size": "5094",
"license": "bsd-3-clause",
"hash": 8440779764479733000,
"line_mean": 32.9666666667,
"line_max": 94,
"alpha_frac": 0.6291715744,
"autogenerated": false,
"ratio": 3.8796648895658796... |
__author__ = 'Robert Meyer'
import os
from pypet import Trajectory
import matplotlib.pyplot as plt
def main():
# This time we don't need an environment since we just going to look
# at data in the trajectory
traj = Trajectory('FiringRate', add_time=False)
# Let's load the trajectory from the file
... | {
"repo_name": "SmokinCaterpillar/NIGroupTalkDemo",
"path": "lifmodel/analysis.py",
"copies": "1",
"size": "2357",
"license": "bsd-3-clause",
"hash": -2210220011060193300,
"line_mean": 29.6233766234,
"line_max": 87,
"alpha_frac": 0.6537971998,
"autogenerated": false,
"ratio": 3.367142857142857,
... |
__author__ = 'Robert Meyer'
import os
import numpy as np
import tables
import dill
import logging
import shutil
from pypet.trajectory import Trajectory
from pypet.utils.explore import cartesian_product
import pypet.compat as compat
from pypet.environment import Environment
from pypet import pypetconstants
from pypet... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/integration/removal_and_continue_test.py",
"copies": "1",
"size": "18980",
"license": "bsd-3-clause",
"hash": 7740097280057582000,
"line_mean": 35.3620689655,
"line_max": 123,
"alpha_frac": 0.5507376185,
"autogenerated": false,
"ratio": 3.702692... |
__author__ = 'Robert Meyer'
import os # To allow file paths working under Windows and Linux
from pypet import Environment
from pypet.utils.explore import cartesian_product
def multiply(traj):
"""Example of a sophisticated simulation that involves multiplying two values.
:param traj:
Trajectory cont... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_01_first_steps.py",
"copies": "2",
"size": "3038",
"license": "bsd-3-clause",
"hash": -4107644474942694000,
"line_mean": 36.0487804878,
"line_max": 95,
"alpha_frac": 0.7044107966,
"autogenerated": false,
"ratio": 3.821383647798742,
"confi... |
__author__ = 'Robert Meyer'
import os # To allow file paths working under Windows and Linux
from pypet import Environment, Result, Parameter
def multiply(traj):
"""Example of a sophisticated simulation that involves multiplying two values.
:param traj:
Trajectory containing
the parameters i... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_14_links.py",
"copies": "2",
"size": "1880",
"license": "bsd-3-clause",
"hash": -8984277391897443000,
"line_mean": 31.9824561404,
"line_max": 83,
"alpha_frac": 0.6946808511,
"autogenerated": false,
"ratio": 3.671875,
"config_test": false,... |
__author__ = 'Robert Meyer'
import os # To allow pathnames under Windows and Linux
from pypet import Trajectory, NotUniqueNodeError
# We first generate a new Trajectory
filename = os.path.join('hdf5', 'example_02.hdf5')
traj = Trajectory('Example', filename=filename,
overwrite_file=True,
... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "examples/example_02_trajectory_access_and_storage.py",
"copies": "2",
"size": "3567",
"license": "bsd-3-clause",
"hash": 4469558550946265000,
"line_mean": 36.1666666667,
"line_max": 97,
"alpha_frac": 0.7235772358,
"autogenerated": false,
"ratio": ... |
__author__ = 'Robert Meyer'
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
install_requires=[
'tables >= 2.3.1',
'pandas >= 0.14.1',
'numpy >= 1.6.1',
'scipy >= 0.9.0']
# check if importlib exists, if not (aka pytho... | {
"repo_name": "nigroup/pypet",
"path": "setup.py",
"copies": "1",
"size": "2573",
"license": "bsd-3-clause",
"hash": 5537854129714160000,
"line_mean": 32,
"line_max": 114,
"alpha_frac": 0.600855033,
"autogenerated": false,
"ratio": 3.544077134986226,
"config_test": true,
"has_no_keywords": fa... |
__author__ = 'Robert Meyer'
import sys
import getopt
import tables as pt
import shutil
import os
class FileUpdater(object):
def __init__(self, filename, backup):
self.filename = filename
if filename is None:
raise RuntimeError('Please specifiy a filename with `--filename=`.'
... | {
"repo_name": "nigroup/pypet",
"path": "pypet/utils/to_new_tree.py",
"copies": "1",
"size": "4118",
"license": "bsd-3-clause",
"hash": -5007106690445673000,
"line_mean": 29.0656934307,
"line_max": 92,
"alpha_frac": 0.5157843613,
"autogenerated": false,
"ratio": 4.113886113886114,
"config_test":... |
__author__ = 'Robert Meyer'
import sys
import os
import datetime
import numpy as np
import inspect
import logging
import socket
try:
import zmq
except ImportError:
zmq = None
def is_debug():
"""Checks if user is currently debugging.
Debugging is checked via ``'pydevd' in sys.modules``.
:return:... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "pypet/utils/helpful_functions.py",
"copies": "1",
"size": "13318",
"license": "bsd-3-clause",
"hash": 7656112814072277000,
"line_mean": 34.1398416887,
"line_max": 96,
"alpha_frac": 0.5914551734,
"autogenerated": false,
"ratio": 4.1723057644110275,... |
__author__ = 'Robert Meyer'
import sys
import os
import numpy as np
from pypet.trajectory import Trajectory
from pypet.tests.testutils.ioutils import make_temp_dir, remove_data, run_suite, parse_args
from pypet.utils import comparisons as comp
try:
import cPickle as pickle # will fail under python 3
except Imp... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/unittests/annotations_test.py",
"copies": "1",
"size": "7503",
"license": "bsd-3-clause",
"hash": 2640783561612158500,
"line_mean": 32.0572687225,
"line_max": 100,
"alpha_frac": 0.5697720912,
"autogenerated": false,
"ratio": 3.7217261904761907,
... |
__author__ = 'Robert Meyer'
import time
import sys
import pickle
from collections import Set, Sequence, Mapping
import pandas as pd
import numpy as np
import random
import copy as cp
from pypet.tests.testutils.ioutils import run_suite, make_temp_dir, remove_data, \
get_root_logger, parse_args
from pypet.trajecto... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/unittests/utils_test.py",
"copies": "1",
"size": "16542",
"license": "bsd-3-clause",
"hash": 951101163571851600,
"line_mean": 27.1805792164,
"line_max": 96,
"alpha_frac": 0.5708499577,
"autogenerated": false,
"ratio": 3.3621951219512196,
"conf... |
__author__ = 'Robert Meyer'
from pypet.tests.integration.logging_test import LoggingTest
from pypet.tests.testutils.ioutils import run_suite, parse_args
class MultiprocNoPoolQueueLoggingTest(LoggingTest):
tags = 'integration', 'environment', 'logging', 'multiproc', 'nopool', 'queue'
def set_mode(self):
... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "pypet/tests/integration/logging_multiproc_test.py",
"copies": "2",
"size": "2373",
"license": "bsd-3-clause",
"hash": 2004362598055041500,
"line_mean": 30.6533333333,
"line_max": 97,
"alpha_frac": 0.6451748841,
"autogenerated": false,
"ratio": 3.4... |
__author__ = 'Robert Meyer'
import sys
if (sys.version_info < (2, 7, 0)):
import unittest2 as unittest
else:
import unittest
import pypet
from pypet import *
del test # To not run all tests if this file is executed with nosetests
from pypet.tests.testutils.ioutils import get_root_logger, run_suite, parse_ar... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/unittests/module_test.py",
"copies": "1",
"size": "1323",
"license": "bsd-3-clause",
"hash": 6672745840143045000,
"line_mean": 26.5833333333,
"line_max": 91,
"alpha_frac": 0.6061980348,
"autogenerated": false,
"ratio": 3.5853658536585367,
"con... |
__author__ = 'robert'
import os
from sc2reader.utils import JSONDateEncoder
import json
import uuid
import zipfile
import logging
import traceback
import shutil
import requests
def save_temp_file(folder, originalFileName, ms, prefix=None):
if prefix is None:
for i in range(100):
fileName = os.... | {
"repo_name": "RobertTheNerd/sc2geeks",
"path": "parser/sc2lib/utils.py",
"copies": "1",
"size": "4920",
"license": "mit",
"hash": 6378396888034999000,
"line_mean": 30.1455696203,
"line_max": 158,
"alpha_frac": 0.6243902439,
"autogenerated": false,
"ratio": 3.9203187250996017,
"config_test": fa... |
__author__ = 'robert'
def fence(p, k):
fence = [[None] * len(p) for n in range(k)]
rails = range(k - 1) and range(k - 1, 0, -1)
for n, x in enumerate(p):
fence[rails[n % len(rails)]][n] = x
return [c for rail in fence for c in rail if c is not None]
def encrypt(p, k):
return ''.join(fenc... | {
"repo_name": "RobertEviston/CollegeWork",
"path": "4th Year Security Labs/Lab 1/Lab1Question2.py",
"copies": "1",
"size": "1048",
"license": "mit",
"hash": -845417420096123800,
"line_mean": 22.8181818182,
"line_max": 63,
"alpha_frac": 0.5982824427,
"autogenerated": false,
"ratio": 2.895027624309... |
__author__ = 'robert'
from Crypto.Cipher import DES
import base64
key = "12345678"
def add_padding(str1, key):
modulo = len(str1) % len(key)
print("length before: " + str(len(str1)))
i = 0
while i < (modulo-2):
str1 += "\x00"
i += 1
str1 += ("0" + str(modulo))
print("length... | {
"repo_name": "RobertEviston/CollegeWork",
"path": "4th Year Security Labs/Lab 3/Lab3Question3.py",
"copies": "1",
"size": "1215",
"license": "mit",
"hash": 5658477744415330000,
"line_mean": 25.4347826087,
"line_max": 167,
"alpha_frac": 0.6296296296,
"autogenerated": false,
"ratio": 3.07594936708... |
__author__ = 'robert'
from itertools import starmap, cycle
def encrypt(message, key):
# convert to uppercase.
# strip out non-alpha characters.
message = filter(str.isalpha, message.upper())
# single letter encrpytion.
def enc(c,k): return chr(((ord(k) + ord(c) - 2*ord('A')) % 26) + ord('A'))
... | {
"repo_name": "RobertEviston/CollegeWork",
"path": "4th Year Security Labs/Lab 2/Lab2Question3.py",
"copies": "1",
"size": "1025",
"license": "mit",
"hash": 6213224224389941000,
"line_mean": 28.3142857143,
"line_max": 188,
"alpha_frac": 0.6136585366,
"autogenerated": false,
"ratio": 3.18322981366... |
__author__ = 'robert'
from pypet.tests.testutils.ioutils import make_temp_dir
import tables as pt
import tables.parameters
import os
import time
def create_children_dfs(hdf5_file, group_node, current_children):
if len(current_children) == 0:
return 1
nchildren = current_children[0]
child_count = 0... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/profiling/speed_analysis/pytables_testing_many_children.py",
"copies": "2",
"size": "1225",
"license": "bsd-3-clause",
"hash": -3357541460666486000,
"line_mean": 30.4358974359,
"line_max": 92,
"alpha_frac": 0.653877551,
"autogenerated": false,
"... |
__author__ = 'robert'
from pypet.tests.testutils.ioutils import make_temp_dir
import tables as pt
import tables.parameters
import time
import os
import matplotlib.pyplot as plt
def iterrowtime(table):
start = time.time()
startit = min(int(len(table) / 2) ,0)
row_iterator = table.iterrows(startit, starti... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "pypet/tests/profiling/speed_analysis/pytables_testing_iterrow.py",
"copies": "2",
"size": "1664",
"license": "bsd-3-clause",
"hash": 6438738735270310000,
"line_mean": 23.4705882353,
"line_max": 91,
"alpha_frac": 0.6262019231,
"autogenerated": false,... |
__author__ = 'robert'
import copy as cp
import sys
#sys.path.append('/media/data/PYTHON_WORKSPACE/pypet-project')
try:
import scoop
import random
except ImportError:
scoop = None
import pypet.compat as compat
def identity(x):
return x
def check_mock():
if scoop.IS_RUNNING:
print('SCOO... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/integration/environment_scoop_test.py",
"copies": "1",
"size": "8559",
"license": "bsd-3-clause",
"hash": -7974206054084912000,
"line_mean": 29.4590747331,
"line_max": 107,
"alpha_frac": 0.631615843,
"autogenerated": false,
"ratio": 3.4512096774... |
__author__ = 'robert'
import logging
import os # For path names working under Windows and Linux
from main import add_parameters, add_exploration, run_neuron, neuron_postproc
from pypet import Environment
def mypipeline(traj):
"""A pipeline function that defines the entire experiment
:param traj:
C... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "examples/example_13_post_processing/pipeline.py",
"copies": "2",
"size": "1547",
"license": "bsd-3-clause",
"hash": 1511189614715411500,
"line_mean": 31.2291666667,
"line_max": 90,
"alpha_frac": 0.5992243051,
"autogenerated": false,
"ratio": 4.576... |
__author__ = 'robert'
import nltk
nltk.data.path.append("./nltk_data")
#load the giant dictionary of words
database = nltk.corpus.cmudict.dict()
def finish_word(prefix):
if prefix in database:
return prefix
#assumptions
#words only contain letters, and they are lowercase
def does_word_exist(word):
... | {
"repo_name": "joeltg/twaiku",
"path": "syllables.py",
"copies": "1",
"size": "2335",
"license": "mit",
"hash": -9014984943244312000,
"line_mean": 23.5894736842,
"line_max": 98,
"alpha_frac": 0.5974304069,
"autogenerated": false,
"ratio": 3.564885496183206,
"config_test": false,
"has_no_keywo... |
__author__ = 'robert'
import numpy as np
import pandas as pd
import logging
import os # For path names working under Linux and Windows
from pypet import Environment, cartesian_product
def run_neuron(traj):
"""Runs a simulation of a model neuron.
:param traj:
Container with all parameters.
:re... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_13_post_processing/main.py",
"copies": "2",
"size": "6575",
"license": "bsd-3-clause",
"hash": -7210898230766773000,
"line_mean": 34.5405405405,
"line_max": 93,
"alpha_frac": 0.6063878327,
"autogenerated": false,
"ratio": 3.96562123039807,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.