text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'stamylew'
import matplotlib.pyplot as plt
import numpy as np
from python_functions.handle_h5.handle_h5 import read_h5, save_h5
# plt.plot([2,4,6,8], label='a')
# plt.plot([1,2,3,4], label='b')
# plt.legend()
# plt.show()
def get_nodes_data(dense_gt_path):
filename1 = dense_gt_path.split("/")[-1]
... | {
"repo_name": "simonsgit/bachelor_stuff",
"path": "handle_data/nodes_in_seg.py",
"copies": "1",
"size": "2599",
"license": "mit",
"hash": -7746111004544081000,
"line_mean": 35.1111111111,
"line_max": 94,
"alpha_frac": 0.6294728742,
"autogenerated": false,
"ratio": 2.7707889125799574,
"config_te... |
__author__ = 'stamylew'
import numpy as np
import skneuro.learning._learning as skl
from src.watershed.wsdt import wsDtSegmentation
from python_functions.handle_h5.handle_h5 import read_h5, save_h5
from python_functions.quality.quality import adjust_predict
from vigra import analysis, filters
def make_superpixels(pr... | {
"repo_name": "simonsgit/bachelor_stuff",
"path": "handle_data/limit_labels/watershed.py",
"copies": "1",
"size": "1811",
"license": "mit",
"hash": -4917738422664017000,
"line_mean": 45.4358974359,
"line_max": 128,
"alpha_frac": 0.7233572612,
"autogenerated": false,
"ratio": 2.856466876971609,
... |
__author__ = 'stamylew'
import numpy as np
####old function:
nol = np.amax(data) #number of labels
print nol
tol = np.unique(data) #number of labels
print tol
check = len(tol) - 1
assert(check == nol)
label = [] #list of labels
rol = []
for i in range(1, len(tol)): #creates list of label data
label.append(dat... | {
"repo_name": "simonsgit/bachelor_stuff",
"path": "handle_data/old_random_labels.py",
"copies": "1",
"size": "1786",
"license": "mit",
"hash": 6754634858564008000,
"line_mean": 18,
"line_max": 103,
"alpha_frac": 0.7032474804,
"autogenerated": false,
"ratio": 2.834920634920635,
"config_test": fa... |
__author__ = 'stamylew'
from subprocess import call
from python_functions.handle_data.random_labels import filter_all_labels, get_number_of_labels, limit_label
from python_functions.handle_h5.handle_h5 import read_h5, save_h5
import numpy as np
from autocontext.core.ilp import ILP
import socket
def create_copy(ilp):
... | {
"repo_name": "simonsgit/bachelor_stuff",
"path": "handle_data/modify_labels.py",
"copies": "1",
"size": "6500",
"license": "mit",
"hash": 2603591882000208000,
"line_mean": 31.6683417085,
"line_max": 107,
"alpha_frac": 0.6609230769,
"autogenerated": false,
"ratio": 3.084954912197437,
"config_te... |
__author__ = 'stamylew'
from subprocess import call
from python_functions.handle_data.random_labels import get_number_of_labels, get_number_of_unique_labels, limit_label
from python_functions.handle_h5.handle_h5 import read_h5
import numpy as np
from autocontext.core.ilp import ILP
def create_copy(ilp_path):
"""... | {
"repo_name": "simonsgit/bachelor_stuff",
"path": "handle_data/new_modify_labels.py",
"copies": "1",
"size": "5858",
"license": "mit",
"hash": -5950217079696180000,
"line_mean": 34.2891566265,
"line_max": 118,
"alpha_frac": 0.6766814612,
"autogenerated": false,
"ratio": 3.2836322869955157,
"con... |
__author__ = 'stamylew'
import argparse
import subprocess
import os
import sys
import glob
import shutil
from autocontext import train, batch_predict
import colorama as col
from python_functions.handle_data.modify_labels import reduce_labels_in_ilp
def test(ilastik_path, ilp_path, runs, labels, weights, repeats):
... | {
"repo_name": "simonsgit/bachelor_stuff",
"path": "other/test.py",
"copies": "1",
"size": "1609",
"license": "mit",
"hash": 5159718223474222000,
"line_mean": 31.8571428571,
"line_max": 124,
"alpha_frac": 0.6532007458,
"autogenerated": false,
"ratio": 3.6903669724770642,
"config_test": false,
... |
__author__ = 'stamylew'
import os
import numpy as np
import vigra.graphs as vg
import vigra.filters as vf
from python_functions.handle_h5.handle_h5 import read_h5, save_h5
import matplotlib.pyplot as plt
import skneuro.learning._learning as skl
from src.watershed.wsdt import wsDtSegmentation
from sklearn.metrics impor... | {
"repo_name": "simonsgit/bachelor_stuff",
"path": "quality/quality_vigra_ac.py",
"copies": "1",
"size": "23134",
"license": "mit",
"hash": 3067042310871773700,
"line_mean": 43.1507633588,
"line_max": 166,
"alpha_frac": 0.6237572404,
"autogenerated": false,
"ratio": 3.3527536231884056,
"config_t... |
class Movie():
""" A class property providing information about a movie.
Attributes:
title: [String], the title of the movie.
ating: [String], the rating of the movie.
year: [Integer], the year the movie was released.
info: [String], a short description of the movie.
poster_image_url: [String], the url for the po... | {
"repo_name": "DuCalixte/the_movie_trailer_website",
"path": "movie.py",
"copies": "1",
"size": "1374",
"license": "mit",
"hash": 6707229680334340000,
"line_mean": 33.35,
"line_max": 76,
"alpha_frac": 0.6120815138,
"autogenerated": false,
"ratio": 4.267080745341615,
"config_test": false,
"has... |
__author__ = 'stanley'
from google.appengine.api import search
from google.appengine.api.search import QueryError
import webapp2
import json
from init import *
from domain.user import User
class AutocompleteHandler(webapp2.RequestHandler):
def get(self):
try:
param = str(self.request.get('term'... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/auto_complete.py",
"copies": "1",
"size": "1450",
"license": "apache-2.0",
"hash": -1154540395068200400,
"line_mean": 30.5434782609,
"line_max": 80,
"alpha_frac": 0.5627586207,
"autogenerated": false,
"ratio": 4.1076487252124645,
"config_test... |
__author__ = 'stanley'
from google.appengine.ext import ndb
from education import Education
from work import Work
from reference import Reference
from location import Location
from term import Term
from project import Project
from honor import Honor
from image import Image
from language import Language
from google.appe... | {
"repo_name": "nimadini/Teammate",
"path": "domain/user.py",
"copies": "1",
"size": "4689",
"license": "apache-2.0",
"hash": 6928112083581794000,
"line_mean": 31.7972027972,
"line_max": 105,
"alpha_frac": 0.6095116229,
"autogenerated": false,
"ratio": 3.760224538893344,
"config_test": false,
... |
__author__ = 'stanley'
from google.appengine.ext import ndb
from entity import Entity
class Statistics(ndb.Model):
id = ndb.StringProperty()
BS = ndb.StructuredProperty(Entity)
BA = ndb.StructuredProperty(Entity)
MS = ndb.StructuredProperty(Entity)
MA = ndb.StructuredProperty(Entity)
PhD = ndb.... | {
"repo_name": "nimadini/Teammate",
"path": "domain/statistics/statistics.py",
"copies": "1",
"size": "3531",
"license": "apache-2.0",
"hash": 5497753040677610000,
"line_mean": 31.4036697248,
"line_max": 95,
"alpha_frac": 0.6043613707,
"autogenerated": false,
"ratio": 4.125,
"config_test": false... |
__author__ = 'stanley'
from google.appengine.ext import ndb
class Education(ndb.Model):
id = ndb.IntegerProperty()
school = ndb.StringProperty()
gpa = ndb.StringProperty()
major = ndb.StringProperty()
degree = ndb.StringProperty()
date = ndb.DateTimeProperty(auto_now_add=True)
def __gt__(... | {
"repo_name": "nimadini/Teammate",
"path": "domain/education.py",
"copies": "1",
"size": "1135",
"license": "apache-2.0",
"hash": 303842007759046900,
"line_mean": 23.6956521739,
"line_max": 85,
"alpha_frac": 0.5603524229,
"autogenerated": false,
"ratio": 3.8344594594594597,
"config_test": false... |
__author__ = 'stanley'
from google.appengine.ext.webapp import blobstore_handlers
from domain.user import *
from google.appengine.api import users
from domain.image import Image
from domain.doc import Doc
import json
class UploadHandler(blobstore_handlers.BlobstoreUploadHandler):
def post(self):
req = sel... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/home/upload.py",
"copies": "1",
"size": "1318",
"license": "apache-2.0",
"hash": 3949520587871805000,
"line_mean": 27.0638297872,
"line_max": 80,
"alpha_frac": 0.5743550835,
"autogenerated": false,
"ratio": 3.9109792284866467,
"config_test": ... |
__author__ = 'stanley'
import json
import webapp2
from google.appengine.api import users
from init import *
from domain.user import *
from util.sanity_check import*
from domain.doc_index import *
from domain.statistics.statistics import *
class TermsHandler(webapp2.RequestHandler):
def get(self):
template... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/home/terms.py",
"copies": "1",
"size": "2048",
"license": "apache-2.0",
"hash": -2736394444477679600,
"line_mean": 35.5892857143,
"line_max": 100,
"alpha_frac": 0.6049804688,
"autogenerated": false,
"ratio": 3.900952380952381,
"config_test": ... |
__author__ = 'stanley'
import webapp2
import jinja2
import json
import os
INDEX_NAME = 'user_basic'
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)
class MainHandler(webapp2.RequestHandler):
def ... | {
"repo_name": "nimadini/frontend",
"path": "main.py",
"copies": "1",
"size": "1613",
"license": "bsd-3-clause",
"hash": 5121075986033493000,
"line_mean": 31.9387755102,
"line_max": 75,
"alpha_frac": 0.6348419095,
"autogenerated": false,
"ratio": 3.8496420047732696,
"config_test": false,
"has_... |
__author__ = 'stanley'
from domain.user import *
from google.appengine.api import users, mail
import webapp2
import json
from util.sanity_check import *
class MessageHandler(webapp2.RequestHandler):
def post(self):
usr = user_key(users.get_current_user().email()).get()
if not user_is_logged_in(us... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/message.py",
"copies": "1",
"size": "1438",
"license": "apache-2.0",
"hash": 6810594477309494000,
"line_mean": 25.6481481481,
"line_max": 88,
"alpha_frac": 0.5883171071,
"autogenerated": false,
"ratio": 3.640506329113924,
"config_test": false... |
__author__ = 'stanley'
from google.appengine.api.search import QueryError
from datetime import datetime
from google.appengine.api import search
from init import *
def create_doc(email, gender, degree, availability, price, given_name, surname, rank):
given_name = ','.join(tokenize_autocomplete(given_name.lower()))... | {
"repo_name": "nimadini/Teammate",
"path": "domain/doc_index.py",
"copies": "1",
"size": "3278",
"license": "apache-2.0",
"hash": -2635466587339703000,
"line_mean": 31.1470588235,
"line_max": 86,
"alpha_frac": 0.6244661379,
"autogenerated": false,
"ratio": 3.7462857142857144,
"config_test": fal... |
__author__ = 'stanley'
import json
import re
import webapp2
from google.appengine.api import users
from google.appengine.ext import blobstore
from domain.user import *
from util.sanity_check import*
from domain.doc_index import *
from domain.statistics.statistics import *
class HomeHandler(webapp2.RequestHandler):
... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/home/home.py",
"copies": "1",
"size": "6392",
"license": "apache-2.0",
"hash": 4490489936042553300,
"line_mean": 30.4876847291,
"line_max": 93,
"alpha_frac": 0.5619524406,
"autogenerated": false,
"ratio": 3.709808473592571,
"config_test": fal... |
__author__ = 'stanley'
import json
import webapp2
from google.appengine.api import users
from domain.user import *
from util.sanity_check import*
from domain.doc_index import *
class FollowHandler(webapp2.RequestHandler):
def post(self):
usr = user_key(users.get_current_user().email()).get()
if no... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/follow.py",
"copies": "1",
"size": "1114",
"license": "apache-2.0",
"hash": -336349796130146000,
"line_mean": 24.9302325581,
"line_max": 66,
"alpha_frac": 0.6041292639,
"autogenerated": false,
"ratio": 3.9785714285714286,
"config_test": false... |
__author__ = 'stanley'
import json
import webapp2
from google.appengine.api import users
from domain.user import *
from util.sanity_check import*
from domain.doc_index import *
class UnfollowHandler(webapp2.RequestHandler):
def post(self):
usr = user_key(users.get_current_user().email()).get()
if ... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/unfollow.py",
"copies": "1",
"size": "1132",
"license": "apache-2.0",
"hash": -4657401131935573000,
"line_mean": 25.3488372093,
"line_max": 66,
"alpha_frac": 0.6068904594,
"autogenerated": false,
"ratio": 3.958041958041958,
"config_test": fal... |
__author__ = 'stanley'
import json
import webapp2
from google.appengine.api import users
from init import *
from domain.user import *
from util.sanity_check import*
class WorkExperience(webapp2.RequestHandler):
def get(self):
template = JINJA_ENVIRONMENT.get_template('templates/snippets/workexperience.ht... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/home/work_experience.py",
"copies": "1",
"size": "3566",
"license": "apache-2.0",
"hash": -6804462317683410000,
"line_mean": 26.6511627907,
"line_max": 91,
"alpha_frac": 0.5468311834,
"autogenerated": false,
"ratio": 3.8017057569296377,
"conf... |
__author__ = 'stanley'
import json
import webapp2
from google.appengine.api import users
from init import *
from domain.user import *
from domain.doc_index import *
from util.sanity_check import *
class Registration(webapp2.RequestHandler):
def get(self):
usr = user_key(users.get_current_user().email())... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/registration/registration.py",
"copies": "1",
"size": "2184",
"license": "apache-2.0",
"hash": -5132571188132504000,
"line_mean": 35.4166666667,
"line_max": 118,
"alpha_frac": 0.6011904762,
"autogenerated": false,
"ratio": 3.676767676767677,
... |
__author__ = 'stanley'
import json
import webapp2
from google.appengine.api import users
from init import *
from domain.user import *
from domain.project import Project
from util.sanity_check import*
class SampleProject(webapp2.RequestHandler):
def get(self):
template = JINJA_ENVIRONMENT.get_template('... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/home/sample_project.py",
"copies": "1",
"size": "3952",
"license": "apache-2.0",
"hash": 9087841598672186000,
"line_mean": 25.5302013423,
"line_max": 84,
"alpha_frac": 0.5460526316,
"autogenerated": false,
"ratio": 3.9401794616151546,
"config... |
__author__ = 'stanley'
import json
import webapp2
from google.appengine.api import users
from init import *
from domain.user import *
from util.sanity_check import*
class HonorsAndAwards(webapp2.RequestHandler):
def get(self):
template = JINJA_ENVIRONMENT.get_template('templates/snippets/honor.html')
... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/home/honors_and_awards.py",
"copies": "1",
"size": "3750",
"license": "apache-2.0",
"hash": 3374098091253276700,
"line_mean": 24.5170068027,
"line_max": 82,
"alpha_frac": 0.5317333333,
"autogenerated": false,
"ratio": 3.8109756097560976,
"con... |
__author__ = 'stanley'
import json
import webapp2
from google.appengine.api import users
from init import *
from domain.user import *
from util.sanity_check import*
class LanguageHandler(webapp2.RequestHandler):
def get(self):
template = JINJA_ENVIRONMENT.get_template('templates/snippets/languages.html... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/home/language.py",
"copies": "1",
"size": "3522",
"license": "apache-2.0",
"hash": 3923380163577417700,
"line_mean": 26.5234375,
"line_max": 90,
"alpha_frac": 0.5545144804,
"autogenerated": false,
"ratio": 3.8788546255506606,
"config_test": f... |
__author__ = 'stanley'
import webapp2
from domain.statistics.statistics import *
from domain.statistics.entity import Entity
import json
from domain.doc_index import *
class StatHandler(webapp2.RequestHandler):
def get(self):
qry = Statistics.query(Statistics.id == 'Teammate_Statistics')
#delete()... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/stat.py",
"copies": "1",
"size": "1093",
"license": "apache-2.0",
"hash": 1233424831934577000,
"line_mean": 35.4666666667,
"line_max": 70,
"alpha_frac": 0.6413540714,
"autogenerated": false,
"ratio": 3.795138888888889,
"config_test": false,
... |
__author__ = 'stanley'
import webapp2
from google.appengine.api import users, search
from google.appengine.api.search import QueryError, SortExpression
from init import *
from domain.user import *
from domain.statistics.statistics import *
class DashboardHandler(webapp2.RequestHandler):
def get(self):
usr... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/dashboard/dashboard.py",
"copies": "1",
"size": "3810",
"license": "apache-2.0",
"hash": 6127729616247478000,
"line_mean": 29.9837398374,
"line_max": 126,
"alpha_frac": 0.6057742782,
"autogenerated": false,
"ratio": 4.092373791621912,
"config... |
__author__ = 'stanley'
import webapp2
import json
from google.appengine.api import users
from domain.user import *
class ReferenceHandler(webapp2.RequestHandler):
def post(self):
feature = self.request.get('feature')
if feature == '':
return # TODO
usr = user_key(users.get_c... | {
"repo_name": "nimadini/Teammate",
"path": "handlers/home/reference.py",
"copies": "1",
"size": "1270",
"license": "apache-2.0",
"hash": -4772729772985921000,
"line_mean": 24.9387755102,
"line_max": 66,
"alpha_frac": 0.5385826772,
"autogenerated": false,
"ratio": 4.096774193548387,
"config_test... |
__author__ = 'starlord'
from entity import AbstractEntity
from vectors import Vector2D
from locatePacman import *
import pygame
UP = Vector2D(0,-1)
DOWN = Vector2D(0,1)
LEFT = Vector2D(-1,0)
RIGHT = Vector2D(1,0)
class Ghost(AbstractEntity):
def __init__(self, speed, node, color, dim, pos=(0,0)):
Abstract... | {
"repo_name": "mojoboss/pacman",
"path": "ghost.py",
"copies": "1",
"size": "3249",
"license": "mit",
"hash": 6331553488583976000,
"line_mean": 32.5051546392,
"line_max": 114,
"alpha_frac": 0.5469375192,
"autogenerated": false,
"ratio": 4.123096446700508,
"config_test": false,
"has_no_keyword... |
__author__ = 'starlord'
from vectors import Vector2D
from random import random
import math
class Environment:
def __init__(self, pacman, ghosts, nodes, coins):
self.pacman = pacman
self.ghosts = ghosts
self.nodes = nodes
self.coins = coins
self.qdictionary = {}
#-------------... | {
"repo_name": "mojoboss/pacman",
"path": "maze_env.py",
"copies": "1",
"size": "5507",
"license": "mit",
"hash": -5459990369857912000,
"line_mean": 38.6258992806,
"line_max": 123,
"alpha_frac": 0.4861085891,
"autogenerated": false,
"ratio": 3.8403068340306836,
"config_test": false,
"has_no_ke... |
__author__ = 'starlord'
import math
class Vector2D(object):
def __init__(self, x=0.0, y=0.0):
if isinstance(x, tuple) or isinstance(x, list):
self.x = x[0]
self.y = x[1]
else:
self.x = x
self.y = y
def __str__(self):
return "(%s, %s)"%(se... | {
"repo_name": "mojoboss/pacman",
"path": "vectors.py",
"copies": "1",
"size": "3674",
"license": "mit",
"hash": 201410180976506980,
"line_mean": 27.9291338583,
"line_max": 69,
"alpha_frac": 0.5457267284,
"autogenerated": false,
"ratio": 3.4465290806754223,
"config_test": false,
"has_no_keywor... |
__author__ = 'starlord'
import numpy
from nodes import Node
class NodeGroup(object):
def __init__(self, width, height):
self.nodelist = []
self.width = width
self.height = height
def createNodeList(self, filename):
'''Create the list of nodes from a text file'''
layout =... | {
"repo_name": "mojoboss/pacman",
"path": "nodegroup.py",
"copies": "1",
"size": "3576",
"license": "mit",
"hash": -7883009735880882000,
"line_mean": 35.5,
"line_max": 98,
"alpha_frac": 0.3691275168,
"autogenerated": false,
"ratio": 5.220437956204379,
"config_test": false,
"has_no_keywords": f... |
__author__ = 'starlord'
import Queue
#this method runs bfs on nodes graph and returns a python map of the form
#'map[child] = parent'
def search_pacnode(ghostnode, pacnode):
q = Queue.Queue()
q.put(ghostnode)
map = {}
explored = []
while not q.empty():
node = q.get()
explored.append(... | {
"repo_name": "mojoboss/pacman",
"path": "locatePacman.py",
"copies": "1",
"size": "1122",
"license": "mit",
"hash": -8594381863400284000,
"line_mean": 26.3658536585,
"line_max": 73,
"alpha_frac": 0.5213903743,
"autogenerated": false,
"ratio": 3.462962962962963,
"config_test": false,
"has_no_... |
__author__ = 'starlord'
import pygame
from pygame.locals import *
import numpy
import argparse
from nodegroup import NodeGroup
from pacman import Pacman
from tilegroup import Tilegroup
from ghostgroup import Ghostgroup
from coingroup import Coingroup
from maze_env import Environment
#Method to get command line agrume... | {
"repo_name": "mojoboss/pacman",
"path": "nodemap.py",
"copies": "1",
"size": "19284",
"license": "mit",
"hash": -7014545954900658000,
"line_mean": 37.4930139721,
"line_max": 115,
"alpha_frac": 0.5151939432,
"autogenerated": false,
"ratio": 3.891041162227603,
"config_test": false,
"has_no_key... |
__author__ = 'Statistics Canada'
__copyright__ = 'Crown Copyright, Canada 2014'
import urllib2
import simplejson as json
# Add or update a data set. For this example, we will use the NAICS 2012 dataset from Statistics Canada
# Step 1. Validate the existence of the data set.
query_data = urllib2.quote(json.dumps({'i... | {
"repo_name": "thriuin/ckan_client_demo",
"path": "update_open_data.py",
"copies": "1",
"size": "1663",
"license": "mit",
"hash": 4067066174905394000,
"line_mean": 28.1754385965,
"line_max": 103,
"alpha_frac": 0.6464221287,
"autogenerated": false,
"ratio": 3.6955555555555555,
"config_test": fal... |
from Tkinter import Text, END
import re
class AnsiColorText(Text):
"""
class to convert text with ansi color codes to
text with tkinter color tags
for now we ignore all but the simplest color directives
see http://www.termsys.demon.co.uk/vtansi.htm for a list of
other directives
it has not been th... | {
"repo_name": "stuliveshere/pure-python-mud-client",
"path": "ansicolortext.py",
"copies": "1",
"size": "4727",
"license": "mit",
"hash": 5959877144686868000,
"line_mean": 32.7714285714,
"line_max": 89,
"alpha_frac": 0.49206685,
"autogenerated": false,
"ratio": 4.078515962036239,
"config_test":... |
from java.util import Arrays, Date
from java.io import IOException
from java.lang import Enum
from javax.faces.application import FacesMessage
from org.gluu.jsf2.message import FacesMessages
from org.gluu.oxauth.security import Identity
from org.gluu.oxauth.service import AuthenticationService, UserService
from org.... | {
"repo_name": "GluuFederation/community-edition-setup",
"path": "static/casa/scripts/casa-external_smpp.py",
"copies": "1",
"size": "15354",
"license": "mit",
"hash": -767177643787891200,
"line_mean": 36.6323529412,
"line_max": 167,
"alpha_frac": 0.5771785854,
"autogenerated": false,
"ratio": 4.5... |
__author__ = 'stefanie'
from hmm_trainer import *
import re
def calculate_counts(input):
counts = defaultdict(int)
iterator = simple_conll_corpus_iterator(input)
for word, tag in iterator:
counts[word] += 1
return counts
def get_rare_class(word):
if re.match('.*\d+.*', word):
retu... | {
"repo_name": "anphoenix/demo_nlp",
"path": "hmm/data_cleaner.py",
"copies": "1",
"size": "2254",
"license": "apache-2.0",
"hash": -1807553623282170600,
"line_mean": 26.487804878,
"line_max": 64,
"alpha_frac": 0.5319432121,
"autogenerated": false,
"ratio": 3.3843843843843846,
"config_test": fal... |
__author__ = 'stefan'
from flask import Flask, request, send_from_directory, session
from common.constants import WEBAPP_USER, WEBAPP_PWD
from string import ascii_letters, digits
from random import SystemRandom
class WebApp(Flask):
def __init__(self, import_name):
super().__init__(import_name)
sel... | {
"repo_name": "ScJa/twitter-analyzer",
"path": "web/__init__.py",
"copies": "1",
"size": "1699",
"license": "mit",
"hash": 4215673973703110700,
"line_mean": 31.0566037736,
"line_max": 97,
"alpha_frac": 0.5938787522,
"autogenerated": false,
"ratio": 4.154034229828851,
"config_test": false,
"ha... |
__author__ = 'stefan'
class Colors:
def __init__(self):
self = self
def test(self):
print "Regular"
print self.Black + "Black" + self.Color_Off
print self.Red + "Red" + self.Color_Off
print self.Green + "Green" + self.Color_Off
print self.Yellow + "Yellow" + se... | {
"repo_name": "mhkyg/OrangePIStuff",
"path": "requirement/pyA20/pyA20/utilities/color.py",
"copies": "1",
"size": "5659",
"license": "mit",
"hash": -9183583136611875000,
"line_mean": 35.2820512821,
"line_max": 61,
"alpha_frac": 0.5624668669,
"autogenerated": false,
"ratio": 2.731177606177606,
"... |
__author__ = 'stefano'
import logging
from optparse import make_option
from bilanci import utils
from django.conf import settings
from django.core.management import BaseCommand
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from bilanci.models import Voce
class Command(BaseCommand):
... | {
"repo_name": "DeppSRL/open_bilanci",
"path": "bilanci_project/bilanci/management/commands/voce_update_prestiti.py",
"copies": "1",
"size": "1431",
"license": "mit",
"hash": -2384794563755496000,
"line_mean": 30.1086956522,
"line_max": 123,
"alpha_frac": 0.6275331936,
"autogenerated": false,
"rat... |
__author__ = 'stefano'
#!/usr/local/bin/python
# coding: utf-8
import sys
import json
import gspread
import logging
import argparse
from pprint import pprint
import requests
import utils
import csv
import settings_local
def write_csv(result_set, output_filename, translation_type, tipo_bilancio):
csv_file = ope... | {
"repo_name": "DeppSRL/open_bilanci",
"path": "couchdb_scripts/merge_keys.py",
"copies": "1",
"size": "8795",
"license": "mit",
"hash": -6119937032205452000,
"line_mean": 35.4937759336,
"line_max": 155,
"alpha_frac": 0.5970437749,
"autogenerated": false,
"ratio": 3.6783772480133834,
"config_tes... |
__author__ = 'steffenfb'
import re
from bs4 import BeautifulSoup
import json
def cookieToOneLine():
file = open('cookie.txt','r')
content = file.read()
clean = content.replace('\n','')
clean = content.replace('\"','\'')
file = open('cookie.txt','w')
file.write(clean)
file.close()
tes... | {
"repo_name": "Steffb/facelogger",
"path": "misc.py",
"copies": "1",
"size": "1151",
"license": "mit",
"hash": -4174070980130080000,
"line_mean": 19.5535714286,
"line_max": 60,
"alpha_frac": 0.6298870547,
"autogenerated": false,
"ratio": 3.307471264367816,
"config_test": false,
"has_no_keywor... |
__author__ = 'steffenfb'
import os
import re
import pickle
import datetime
import time
import hashlib
import operator
def localtest(userList, fromhour):
#os.chdir('/Users/steffenfb/Documents/facelogs')
logpath= 'facelogs'
files = os.listdir(logpath)
files.pop(0)
mydict={}
#Adding user... | {
"repo_name": "Steffb/facelogger",
"path": "analyzer.py",
"copies": "1",
"size": "4152",
"license": "mit",
"hash": 6883602299316317000,
"line_mean": 27.2517006803,
"line_max": 117,
"alpha_frac": 0.5411849711,
"autogenerated": false,
"ratio": 4.042843232716651,
"config_test": false,
"has_no_ke... |
import os.path as op
import warnings
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
from scipy.signal import hann
from nose.tools import assert_raises, assert_true, assert_equal
import mne
from mne import read_source_estimate
from mne.datasets import testing
from mne.stats.regress... | {
"repo_name": "nicproulx/mne-python",
"path": "mne/stats/tests/test_regression.py",
"copies": "2",
"size": "5074",
"license": "bsd-3-clause",
"hash": 774274102827712100,
"line_mean": 36.0364963504,
"line_max": 75,
"alpha_frac": 0.6283011431,
"autogenerated": false,
"ratio": 3.256739409499358,
"... |
import os.path as op
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose, assert_equal
import pytest
from scipy.signal import hann
import mne
from mne import read_source_estimate
from mne.datasets import testing
from mne.stats.regression import linear_regression, linear_regression_raw
f... | {
"repo_name": "wmvanvliet/mne-python",
"path": "mne/stats/tests/test_regression.py",
"copies": "10",
"size": "5761",
"license": "bsd-3-clause",
"hash": 3370613205052995600,
"line_mean": 35.9294871795,
"line_max": 79,
"alpha_frac": 0.6398194758,
"autogenerated": false,
"ratio": 3.310919540229885,
... |
import os.path as op
import inspect
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
import pytest
from scipy import io
import numpy as np
from mne import pick_types
from mne.datasets import testing
from mne.externals.six import iterbytes
from mne.ut... | {
"repo_name": "teonlamont/mne-python",
"path": "mne/io/edf/tests/test_edf.py",
"copies": "2",
"size": "11207",
"license": "bsd-3-clause",
"hash": -5360911060073296000,
"line_mean": 36.6073825503,
"line_max": 79,
"alpha_frac": 0.6046221112,
"autogenerated": false,
"ratio": 2.9813780260707636,
"c... |
import os.path as op
import warnings
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import assert_raises, assert_true, assert_equal
import mne
from mne import read_source_estimate
from mne.datasets import sample
from mne.stats.regression import linear_regression
data_path = sample.... | {
"repo_name": "jaeilepp/eggie",
"path": "mne/stats/tests/test_regression.py",
"copies": "2",
"size": "2368",
"license": "bsd-2-clause",
"hash": -6384267153790607000,
"line_mean": 34.3432835821,
"line_max": 79,
"alpha_frac": 0.6558277027,
"autogenerated": false,
"ratio": 3.071335927367056,
"conf... |
__author__ = 'stephanie'
import sys
import os
import matplotlib.pyplot as plt
from matplotlib import dates
#this will be removed when we can installthe api
this_file = os.path.realpath(__file__)
directory = os.path.dirname(os.path.dirname(this_file))
print directory
sys.path.insert(0, directory)
from src.api.ODMco... | {
"repo_name": "Castronova/ODM2PythonAPI",
"path": "src/Examples/Sample.py",
"copies": "1",
"size": "6011",
"license": "bsd-3-clause",
"hash": -1367820264794476500,
"line_mean": 39.8911564626,
"line_max": 171,
"alpha_frac": 0.6867409749,
"autogenerated": false,
"ratio": 3.7852644836272042,
"conf... |
import sys
import pygame
import math
import random
window = ""
width = 800
height = 600
resolution = 2000 # precision of line segments
points = 10000 # of points
def graph():
x = y = ex = ey = 0
dp = (math.pi/2)/resolution
# draw a quarter-circle
for i in range(0,resolution):
x = ex
y = ey
... | {
"repo_name": "entangledloops/monte_carlo_pi",
"path": "pi.py",
"copies": "1",
"size": "1581",
"license": "mit",
"hash": 2946045332187177500,
"line_mean": 22.5970149254,
"line_max": 99,
"alpha_frac": 0.5888678052,
"autogenerated": false,
"ratio": 2.9277777777777776,
"config_test": false,
"has... |
__author__ = 'stephenlenzi'
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from . import create_masks
class ComCorrector(object):
def __init__(self, mask_generator, raw_image, image_2=None, image_3=None):
"""
:param mask_generator: uses mask_generator instance to plot graph... | {
"repo_name": "samuroi/SamuROI",
"path": "samuroi/util/mask_generator/manual_correction.py",
"copies": "1",
"size": "6028",
"license": "mit",
"hash": 2869921952320978400,
"line_mean": 44.3233082707,
"line_max": 122,
"alpha_frac": 0.5497677505,
"autogenerated": false,
"ratio": 3.6622114216281894,
... |
__author__ = 'stephenlenzi'
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import create_masks
class ComCorrector(object):
def __init__(self, mask_generator, raw_image, image_2=None, image_3=None):
"""
:param mask_generator: uses mask_generator instance to plot graphs and a... | {
"repo_name": "aolsux/SamuROI",
"path": "samuroi/util/mask_generator/manual_correction.py",
"copies": "1",
"size": "6017",
"license": "mit",
"hash": 6248847141243210000,
"line_mean": 44.2406015038,
"line_max": 122,
"alpha_frac": 0.5501080273,
"autogenerated": false,
"ratio": 3.6778728606356967,
... |
__author__ = 'stephenlenzi'
import os
import h5py
import numpy as np
import tempfile
import subprocess
"""These are for running ilastik in headless mode within Python"""
def ilastik_segment(data, ilastik_path, ilastik_project_path):
"""
Convert image data into a segmentation using ilastik. It requires that... | {
"repo_name": "samuroi/SamuROI",
"path": "samuroi/util/mask_generator/ilastik_functions.py",
"copies": "2",
"size": "2642",
"license": "mit",
"hash": 4079389536574204400,
"line_mean": 36.7428571429,
"line_max": 114,
"alpha_frac": 0.678652536,
"autogenerated": false,
"ratio": 3.7475177304964538,
... |
__author__ = 'stephenlenzi'
import sys
import numpy as np
from scipy import ndimage
from skimage import segmentation
class MaskGenerator(object):
"""
Parent class for generating mask lists and manually correcting them
"""
def __init__(self, blob_image, raw_image, centers_of_mass=None):
self.... | {
"repo_name": "aolsux/SamuROI",
"path": "samuroi/util/mask_generator/create_masks.py",
"copies": "2",
"size": "8652",
"license": "mit",
"hash": 704700596467972000,
"line_mean": 40.7971014493,
"line_max": 150,
"alpha_frac": 0.6753351826,
"autogenerated": false,
"ratio": 3.374414976599064,
"confi... |
__author__ = 'stephen'
import numpy as np
import mdtraj as md
import os, sys
def get_subindices(assignments=None, state=None, samples=10):
'''Get Subsamples assignments from same state'''
assignments = np.array(assignments)
if state is not None:
indices = np.where(np.array(assignments) == state)[0... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/utils/utils.py",
"copies": "1",
"size": "1695",
"license": "apache-2.0",
"hash": -7469778001303013000,
"line_mean": 36.6666666667,
"line_max": 117,
"alpha_frac": 0.6643067847,
"autogenerated": false,
"ratio": 3.9055299539170507,
... |
__author__ = 'stephen'
import numpy as np
import mdtraj as md
import sklearn.metrics.pairwise as sp
def pairwise_distances(X, Y=None, index=None, metric="euclidean"):
'''
Compute the distance matrix from a vector array X and optional Y.
This method takes either a vector array or a distance matrix,
and r... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/metrics/pairwise.py",
"copies": "1",
"size": "1785",
"license": "apache-2.0",
"hash": -5981076592867662000,
"line_mean": 44.7692307692,
"line_max": 100,
"alpha_frac": 0.6521008403,
"autogenerated": false,
"ratio": 3.872017353579175... |
__author__ = 'stephen'
import numpy as np
import scipy.io
import scipy.sparse
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.pylab as pylab
from .utils import get_subindices
import matplotlib.ticker as mtick
from collections import Counter
from s... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/utils/plot_ (stephen-desktop-linux's conflicted copy 2019-08-24).py",
"copies": "1",
"size": "23284",
"license": "apache-2.0",
"hash": -5017632360561124000,
"line_mean": 37.6135986733,
"line_max": 209,
"alpha_frac": 0.5745576361,
"au... |
__author__ = 'stephen'
import os,sys
import numpy as np
HK_DataMiner_Path = os.path.relpath(os.pardir)
#HK_DataMiner_Path = os.path.abspath("/home/stephen/Dropbox/projects/work-2015.5/HK_DataMiner/")
sys.path.append(HK_DataMiner_Path)
from lumping import PCCA, PCCA_Standard, SpectralClustering, Ward, PCCA3, PCCA_Plus
f... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/scripts/doLumping.py",
"copies": "1",
"size": "5531",
"license": "apache-2.0",
"hash": -1170561037978442200,
"line_mean": 48.3839285714,
"line_max": 119,
"alpha_frac": 0.6702223829,
"autogenerated": false,
"ratio": 2.88523735002608... |
__author__ = 'stephen'
import os,sys
import numpy as np
import scipy.io
HK_DataMiner_Path = os.path.relpath(os.pardir)
#HK_DataMiner_Path = os.path.abspath("/home/stephen/Dropbox/projects/work-2015.5/HK_DataMiner/")
sys.path.append(HK_DataMiner_Path)
#from utils import plot_matrix, plot_block_matrix
#from msm import Ma... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/scripts/plotMatrix.py",
"copies": "1",
"size": "1959",
"license": "apache-2.0",
"hash": -4649594825353527000,
"line_mean": 32.2033898305,
"line_max": 125,
"alpha_frac": 0.7320061256,
"autogenerated": false,
"ratio": 2.9547511312217... |
__author__ = 'stephen'
import os,sys
import numpy as np
import scipy.io
#import matplotlib.pyplot as plt
from collections import Counter
HK_DataMiner_Path = os.path.relpath(os.pardir)
#HK_DataMiner_Path = os.path.abspath("/home/stephen/Dropbox/projects/work-2015.5/HK_DataMiner/")
sys.path.append(HK_DataMiner_Path)
impo... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/scripts/plotPopulation.py",
"copies": "1",
"size": "1488",
"license": "apache-2.0",
"hash": -4191817433715881500,
"line_mean": 27.6153846154,
"line_max": 96,
"alpha_frac": 0.7103494624,
"autogenerated": false,
"ratio": 2.9939637826... |
__author__ = 'stephen'
import scipy.io
import scipy.sparse
import numpy as np
from msm import MarkovStateModel
from utils import plot_matrix
def get_MacroAssignments(assignments=None, microstate_mapping=None, outlier=-1):
'''
:param assignments: The micro-states assignments
:param microstate_mapping: The r... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/lumping/lumper_.py",
"copies": "1",
"size": "3769",
"license": "apache-2.0",
"hash": 591859926320419600,
"line_mean": 41.3483146067,
"line_max": 148,
"alpha_frac": 0.6763067127,
"autogenerated": false,
"ratio": 3.413949275362319,
... |
__author__ = 'stephen'
###############################################################################
# Filename: lumper.py
# Created: 2015-04-24 16:48
# Author: Tiago Lobato Gimenes (tlgimenes@gmail.com)
###############################################################################
#####... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/lumping/pcca3_.py",
"copies": "1",
"size": "6319",
"license": "apache-2.0",
"hash": 628963262686673500,
"line_mean": 34.1111111111,
"line_max": 85,
"alpha_frac": 0.500712138,
"autogenerated": false,
"ratio": 3.6653132250580045,
"... |
__author__ = 'stephen'
from dataset_factory.vdbc import VDBC
from lib.utils.bbox import bbox_overlaps
class Evaluator(object):
"""class for evaluating tracker."""
def __init__(self, vdbc, etype='OTE'):
"""Get the VDBC instance.
Default evaluation method is OTE(one-pass evaluation).
""... | {
"repo_name": "StephenChusang/py-faster-rcnn-tracker",
"path": "lib/utils/evaluate.py",
"copies": "1",
"size": "3286",
"license": "mit",
"hash": -5923252987948399000,
"line_mean": 33.2291666667,
"line_max": 97,
"alpha_frac": 0.5693852708,
"autogenerated": false,
"ratio": 4.017114914425428,
"con... |
__author__ = 'stephen'
# ===============================================================================
# GLOBAL IMPORTS:
import os,sys
import numpy as np
import argparse
import mdtraj as md
# ===============================================================================
# LOCAL IMPORTS:
HK_DataMiner_Path = os.path.r... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/scripts/test_kcenters_assign.py",
"copies": "1",
"size": "5118",
"license": "apache-2.0",
"hash": -3350299321794126300,
"line_mean": 46.8317757009,
"line_max": 146,
"alpha_frac": 0.5965220789,
"autogenerated": false,
"ratio": 3.566... |
__author__ = 'stephen'
# ===============================================================================
# GLOBAL IMPORTS:
import os,sys
import numpy as np
import argparse
import time
# ===============================================================================
# LOCAL IMPORTS:
HK_DataMiner_Path = os.path.relpath(o... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/scripts/test_kcenter_tica.py",
"copies": "1",
"size": "5371",
"license": "apache-2.0",
"hash": -1451715695569861400,
"line_mean": 39.0820895522,
"line_max": 109,
"alpha_frac": 0.6229752374,
"autogenerated": false,
"ratio": 3.017415... |
__author__ = 'stephen'
# ===============================================================================
# GLOBAL IMPORTS:
import os,sys
import numpy as np
import argparse
# ===============================================================================
# LOCAL IMPORTS:
HK_DataMiner_Path = os.path.relpath(os.pardir)
#... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/scripts/test_dbscan.py",
"copies": "1",
"size": "3593",
"license": "apache-2.0",
"hash": -1299759250471911700,
"line_mean": 43.3580246914,
"line_max": 102,
"alpha_frac": 0.6036738102,
"autogenerated": false,
"ratio": 3.329935125115... |
__author__ = 'stephen'
#===============================================================================
# GLOBAL IMPORTS:
import os, sys
import numpy as np
import time
import mdtraj as md
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.utils import check_array, check_random_state
#====================... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/cluster/kcenters_.py",
"copies": "1",
"size": "8585",
"license": "apache-2.0",
"hash": -1600580310421230600,
"line_mean": 42.3585858586,
"line_max": 145,
"alpha_frac": 0.6287711124,
"autogenerated": false,
"ratio": 3.90582347588717... |
__author__ = 'stephen'
#===============================================================================
# GLOBAL IMPORTS:
import os, sys
import numpy as np
import time
import random
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.metrics.pairwise import pairwise_distances_argmin
from sklearn.utils.val... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/cluster/density_peaks_.py",
"copies": "1",
"size": "10888",
"license": "apache-2.0",
"hash": 2104376987942273000,
"line_mean": 40.4030418251,
"line_max": 127,
"alpha_frac": 0.6475936811,
"autogenerated": false,
"ratio": 4.073325851... |
__author__ = 'stephen'
# ===============================================================================
# GLOBAL IMPORTS:
import os, sys
import time
from sklearn import cluster
from sklearn.neighbors import kneighbors_graph
# ===============================================================================
# LOCAL IMPOR... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/lumping/ward_.py",
"copies": "1",
"size": "2475",
"license": "apache-2.0",
"hash": 5368824406061486000,
"line_mean": 42.4385964912,
"line_max": 121,
"alpha_frac": 0.5765656566,
"autogenerated": false,
"ratio": 3.861154446177847,
... |
__author__ = 'stephen'
# ===============================================================================
# GLOBAL IMPORTS:
import os, sys
import time
from sklearn import cluster
# ===============================================================================
# LOCAL IMPORTS:
HK_DataMiner_Path = os.path.relpath(os.pard... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/lumping/spectral_.py",
"copies": "1",
"size": "2404",
"license": "apache-2.0",
"hash": 4411065028119107600,
"line_mean": 47.1,
"line_max": 160,
"alpha_frac": 0.5890183028,
"autogenerated": false,
"ratio": 3.9025974025974026,
"con... |
__author__ = 'stephen'
# ===============================================================================
# GLOBAL IMPORTS:
import os, sys
import time
import scipy.sparse.linalg
import numpy as np
# ===============================================================================
# LOCAL IMPORTS:
HK_DataMiner_Path = os.pa... | {
"repo_name": "stephenliu1989/HK_DataMiner",
"path": "hkdataminer/lumping/apm_.py",
"copies": "1",
"size": "5736",
"license": "apache-2.0",
"hash": -3534895213427242000,
"line_mean": 36.4901960784,
"line_max": 159,
"alpha_frac": 0.5503835425,
"autogenerated": false,
"ratio": 3.681643132220796,
... |
__author__ = 'stephen'
import numpy as np
import math
def bbox_overlaps(gt_boxes, query_boxes, gt_fix=True):
"""
Calculate the overlaps between ground-truth boxes and query boxes.
boxes are in the form of (x, y, w, h).
:return list of corresponding overlaps
"""
overlaps = []
if gt_fix... | {
"repo_name": "StephenChusang/py-faster-rcnn-tracker",
"path": "lib/utils/bbox.py",
"copies": "1",
"size": "5377",
"license": "mit",
"hash": -6892128601839818000,
"line_mean": 29.3785310734,
"line_max": 94,
"alpha_frac": 0.4532267063,
"autogenerated": false,
"ratio": 3.0039106145251395,
"config... |
import serial
import rospy
import std_msgs
def DVLformatPD5(DVLserialPacket):
#
# This function takes as an argument a list of bytes called DVLserialPacket
# DVLserialPacket should contain 88 bytes of valid data as read from the Doppler Velocity Log
#
DVLdataPD5[0]=DVLserialPacket[0] ... | {
"repo_name": "RoboticsClubatUCF/RoboSub-BBB",
"path": "ucf_sub/src/sub_drivers/DVL_interactions/src/DVL_interaction2.py",
"copies": "1",
"size": "16876",
"license": "mit",
"hash": -5867894960971251000,
"line_mean": 60.5912408759,
"line_max": 225,
"alpha_frac": 0.6538871771,
"autogenerated": false,... |
__author__ = 'Stephen Theodore'
from collections import namedtuple
import pprint
import sys
import re
import traceback
import logging
# constants
ESC = '\033'
BELL = '\x07'
# one-off code
code = lambda c: "%s[%im" % (ESC, c)
# 3-part semicolon separated code for (eg) color
multicode = lambda n, i, d: "{}[{};{};{};m"... | {
"repo_name": "theodox/conemu",
"path": "conemu.py",
"copies": "1",
"size": "8312",
"license": "mit",
"hash": 2624790935258286600,
"line_mean": 28.6892857143,
"line_max": 121,
"alpha_frac": 0.6121270452,
"autogenerated": false,
"ratio": 3.5750537634408603,
"config_test": false,
"has_no_keywor... |
__author__ = 'Stephen Thompson <stephen@chomadoma.net>'
from flask.ext.login import make_secure_token
import pytz
from database import db
utc_tz = pytz.timezone('UTC')
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(24), unique=True)
display_name = db.Column... | {
"repo_name": "apostrophest/ingroup",
"path": "models.py",
"copies": "1",
"size": "3457",
"license": "mit",
"hash": 4872214733239925000,
"line_mean": 30.7155963303,
"line_max": 107,
"alpha_frac": 0.6178767718,
"autogenerated": false,
"ratio": 3.2955195424213537,
"config_test": false,
"has_no_... |
__author__ = 'Stephen Zakrewsky'
import ijson.backends.yajl2_cffi as ijson
import numpy as np
n_samples = 3305
n_features = 42022
tsz = np.empty((n_samples,))
y = np.empty((n_samples,))
data = np.empty((n_samples, n_features))
print 'Loading dataset...'
with open('../workspace/ds_deep.json') as inh:
ds = ijson.i... | {
"repo_name": "szakrewsky/ICPR16",
"path": "prepare_dataset.py",
"copies": "1",
"size": "1200",
"license": "mit",
"hash": -8169340458074099000,
"line_mean": 31.4594594595,
"line_max": 54,
"alpha_frac": 0.5341666667,
"autogenerated": false,
"ratio": 2.4742268041237114,
"config_test": false,
"h... |
__author__ = 'Stephen Zakrewsky'
import matplotlib.pyplot as plt
import numpy as np
from scipy import interp
from sklearn.cross_validation import StratifiedKFold
from sklearn.linear_model import LogisticRegression, Ridge
from sklearn.metrics import auc, f1_score, mean_absolute_error, mean_squared_error, precision_scor... | {
"repo_name": "szakrewsky/ICPR16",
"path": "experiment.py",
"copies": "1",
"size": "3221",
"license": "mit",
"hash": 2099935379044148200,
"line_mean": 34.4065934066,
"line_max": 131,
"alpha_frac": 0.6625271655,
"autogenerated": false,
"ratio": 2.681931723563697,
"config_test": true,
"has_no_k... |
#NOTE: relies on "run_busco_DBName" naming system for busco directories
import os, glob, fnmatch, re, argparse
# use fadapa to parse FastQC metrics
from fadapa import Fadapa
import pandas as pd
import json
import time
from tasks_v2 import Supervisor
def cegma_parser(cegmaDir, filename):
''' ... | {
"repo_name": "bluegenes/MakeMyTranscriptome",
"path": "scripts/parse_qual_metrics.py",
"copies": "1",
"size": "9505",
"license": "bsd-3-clause",
"hash": 2920888510952503300,
"line_mean": 40.6233183857,
"line_max": 139,
"alpha_frac": 0.562756444,
"autogenerated": false,
"ratio": 3.202493261455525... |
__author__ = 'stevan'
from math import ceil, sqrt
from collections import Counter
def is_not_prime(n):
for i in range(2, int(ceil(sqrt(n))) + 1):
if n % i == 0 and n != i:
return True
return False
def get_next_prime(n):
n = n + 1
while is_not_prime(n):
n = n + 1
retu... | {
"repo_name": "stevanradanovic/my_euler",
"path": "problem_0005/prob_0005.py",
"copies": "1",
"size": "1139",
"license": "mit",
"hash": -7259660806619871000,
"line_mean": 20.1111111111,
"line_max": 68,
"alpha_frac": 0.5118525022,
"autogenerated": false,
"ratio": 3.3206997084548107,
"config_test... |
__author__ = 'stevan'
import sys
LONG_NUMBER = '7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843' \
'8586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557' \
'66896648950445244523161731856403... | {
"repo_name": "stevanradanovic/my_euler",
"path": "problem_0008/prob_0008.py",
"copies": "1",
"size": "1715",
"license": "mit",
"hash": -6743471832391439000,
"line_mean": 46.6388888889,
"line_max": 118,
"alpha_frac": 0.7580174927,
"autogenerated": false,
"ratio": 2.7931596091205213,
"config_tes... |
__author__ = 'Steve Cassidy'
from bottle import Bottle, template, static_file, request, response, HTTPError
import interface
import os
import users
from database import COMP249Db
application = Bottle()
@application.route('/')
def index():
db = COMP249Db()
cont = interface.post_list(db,None,50) # grab the po... | {
"repo_name": "stevecassidy/pyunitgrading",
"path": "tests/bad/single/43684882/comp249-psst-starter-master/main.py",
"copies": "1",
"size": "2255",
"license": "bsd-3-clause",
"hash": -5228143743143611000,
"line_mean": 34.25,
"line_max": 119,
"alpha_frac": 0.6682926829,
"autogenerated": false,
"ra... |
__author__ = 'Steve Cassidy'
from bottle import Bottle, template, static_file, request, response, HTTPError
import interface
import users
from database import COMP249Db
db = COMP249Db()
application = Bottle(catchall=False)
@application.route('/')
def index():
posts = interface.post_list(db)
return template(... | {
"repo_name": "stevecassidy/pyunitgrading",
"path": "tests/bad/single/43555195/assignment2/main.py",
"copies": "1",
"size": "1051",
"license": "bsd-3-clause",
"hash": 6866492909250623000,
"line_mean": 26.6842105263,
"line_max": 90,
"alpha_frac": 0.7126546147,
"autogenerated": false,
"ratio": 3.56... |
import pygame
import random
# global variable that represents the display screen
screen = None
# global variable that has all the button objects
buttonLayer = []
# size of the screen
size = 480, 200
# screen background color
white = 255, 255, 255
backgroundColor = white
# size of the font in the game
FontSize = 2... | {
"repo_name": "stevehuang/Python-Exercises",
"path": "paperRockScissorGUI_template.py",
"copies": "1",
"size": "8094",
"license": "unlicense",
"hash": -726775182521220100,
"line_mean": 29.0892193309,
"line_max": 100,
"alpha_frac": 0.6569063504,
"autogenerated": false,
"ratio": 3.637752808988764,
... |
__author__ = 'Steve Lechner’
# This program will visit every accessible site in a domain and search for a
# given string. It will do this by counting the string's occurrence on the
# domain's home page, then collecting all the urls available in that page, and
# then recursively repeating this activity on each yet unvi... | {
"repo_name": "stephenlechner/site_string_count",
"path": "main.py",
"copies": "1",
"size": "5219",
"license": "mit",
"hash": 3885276135564270600,
"line_mean": 39.1307692308,
"line_max": 90,
"alpha_frac": 0.5278895917,
"autogenerated": false,
"ratio": 4.063084112149533,
"config_test": false,
... |
__author__ = 'Steve'
import maya.cmds as cmds
from mGui.core import Control
class ModelEditor(Control):
CMD = cmds.modelEditor
_ATTRIBS = ["activeComponentsXray", "activeOnly", "activeView", "addObjects", "addSelected", "allObjects",
"backfaceCulling", "bufferMode", "bumpResolution", "camera... | {
"repo_name": "theodox/mGui",
"path": "mGui/core/editors.py",
"copies": "1",
"size": "5098",
"license": "mit",
"hash": 6766992782900188000,
"line_mean": 62.725,
"line_max": 120,
"alpha_frac": 0.6545704198,
"autogenerated": false,
"ratio": 3.9921691464369617,
"config_test": false,
"has_no_keyw... |
__author__ = 'steve'
import sys
if len(sys.argv) < 3:
print "error: the input and output files are missing"
exit(0)
in_block = False
remember_block = False
block = []
prev_block = []
out_file = open(sys.argv[2], 'w')
for line in open(sys.argv[1]):
# print line
line_parts = line.rstrip().split()
if... | {
"repo_name": "mathtexts/RussianDependencyParser",
"path": "correctDictionary.py",
"copies": "2",
"size": "1129",
"license": "epl-1.0",
"hash": -2332414522641500700,
"line_mean": 27.9487179487,
"line_max": 88,
"alpha_frac": 0.5332152347,
"autogenerated": false,
"ratio": 3.5727848101265822,
"con... |
from moduleexception import ModuleException
from ast import literal_eval
"""Command-line parsing library
This module is an optparse-inspired command-line parsing library that:
- handles both optional and positional arguments
- produces highly informative usage messages
- supports parsers that dispatch t... | {
"repo_name": "JeyZeta/Dangerous",
"path": "Dangerous/Weevely/core/argparse.py",
"copies": "1",
"size": "88259",
"license": "mit",
"hash": 3384981060458531300,
"line_mean": 36.146043771,
"line_max": 124,
"alpha_frac": 0.5593197294,
"autogenerated": false,
"ratio": 4.60906574755862,
"config_test... |
"""Command-line parsing library
This module is an optparse-inspired command-line parsing library that:
- handles both optional and positional arguments
- produces highly informative usage messages
- supports parsers that dispatch to sub-parsers
The following is a simple usage example that sums integers ... | {
"repo_name": "ArcherCraftStore/ArcherVMPeridot",
"path": "Python/Lib/argparse.py",
"copies": "11",
"size": "89594",
"license": "apache-2.0",
"hash": 8809491844271867000,
"line_mean": 36.7237894737,
"line_max": 83,
"alpha_frac": 0.5598142733,
"autogenerated": false,
"ratio": 4.614441697569015,
... |
import codecs
import inspect
import os
import shutil
import stat
import sys
import textwrap
import tempfile
import unittest
import argparse
from io import StringIO
from test import support
from unittest import mock
class StdIOBuffer(StringIO):
pass
class TestCase(unittest.TestCase):
def assertEqual(self, o... | {
"repo_name": "paweljasinski/ironpython3",
"path": "Src/StdLib/Lib/test/test_argparse.py",
"copies": "5",
"size": "163628",
"license": "apache-2.0",
"hash": 2189684585336325400,
"line_mean": 31.923138833,
"line_max": 112,
"alpha_frac": 0.5349145623,
"autogenerated": false,
"ratio": 3.813461359187... |
import codecs
import inspect
import os
import shutil
import stat
import sys
import textwrap
import tempfile
import unittest
import argparse
from StringIO import StringIO
class StdIOBuffer(StringIO):
pass
from test import test_support
class TestCase(unittest.TestCase):
def assertEqual(self, obj1, obj2):
... | {
"repo_name": "efortuna/AndroidSDKClone",
"path": "ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/test/test_argparse.py",
"copies": "45",
"size": "156272",
"license": "apache-2.0",
"hash": -8339452245617986000,
"line_mean": 31.809573798,
"line_max": 112,
"alpha_frac": 0.5347151121,
"autogener... |
import codecs
import inspect
import os
import shutil
import sys
import textwrap
import tempfile
import unittest
import argparse
assert getattr(argparse, '__external_lib__', False) # fail early if we test the wrong lib
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
class StdI... | {
"repo_name": "mollstam/UnrealPy",
"path": "UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/argparse-1.3.0/test/test_argparse.py",
"copies": "7",
"size": "143783",
"license": "mit",
"hash": -6104439058791725000,
"line_mean": 31.4639873561,
"line_max": 112,
"al... |
import codecs
import inspect
import os
import shutil
import sys
import textwrap
import tempfile
import unittest
import argparse
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
class StdIOBuffer(StringIO):
pass
try:
set
except NameError:
# for python < 2.4 compatib... | {
"repo_name": "gauribhoite/personfinder",
"path": "env/google_appengine/lib/argparse/test/test_argparse.py",
"copies": "42",
"size": "142046",
"license": "apache-2.0",
"hash": -6719828187424632000,
"line_mean": 31.4305936073,
"line_max": 112,
"alpha_frac": 0.5298283655,
"autogenerated": false,
"r... |
"""Command-line parsing library
This module is an optparse-inspired command-line parsing library that:
- handles both optional and positional arguments
- produces highly informative usage messages
- supports parsers that dispatch to sub-parsers
The following is a simple usage example that sums ... | {
"repo_name": "hipnusleo/laserjet",
"path": "resource/pypi/argparse-1.4.0/argparse.py",
"copies": "1",
"size": "91606",
"license": "apache-2.0",
"hash": -7186528210837390000,
"line_mean": 36.2968227425,
"line_max": 80,
"alpha_frac": 0.5439272537,
"autogenerated": false,
"ratio": 4.724150379041823... |
__author__ = 'Steven LI'
import time
class Num_Base:
def __init__(self, base=0):
self.data = base
def add(self, *args):
ret_val = self.data
for val in args:
ret_val += val
return ret_val
def multiple(self, *args):
ret_val = self.data
for val in ... | {
"repo_name": "steven004/pytest_oot",
"path": "example/my_calculate.py",
"copies": "1",
"size": "3273",
"license": "mit",
"hash": 4862560288852993000,
"line_mean": 23.4253731343,
"line_max": 75,
"alpha_frac": 0.5334555454,
"autogenerated": false,
"ratio": 3.62860310421286,
"config_test": false,... |
author__ = 'Steven LI'
from test_steps import *
import logging, time
def my_add(*args):
ret = 0
for i in args:
ret += i
return ret
def my_mul(*args):
ret = 1
for i in args:
ret *= i
return ret
def test_logger_setup():
''' Add file-logging into test_logger
This is ... | {
"repo_name": "steven004/TestSteps",
"path": "test_examples/test_lesson2_check.py",
"copies": "1",
"size": "5058",
"license": "mit",
"hash": 6155071915591294000,
"line_mean": 45.8333333333,
"line_max": 123,
"alpha_frac": 0.5834321866,
"autogenerated": false,
"ratio": 3,
"config_test": true,
"... |
__author__ = 'Steven LI'
from test_steps import *
import logging, time
def my_add(*args):
ret = 0
for i in args:
ret += i
return ret
def my_mul(*args):
ret = 1
for i in args:
ret *= i
return ret
def test_logger_setup():
''' Add file-logging into test_logger
This ... | {
"repo_name": "steven004/TestSteps",
"path": "test_examples/test_lesson1_autolog.py",
"copies": "1",
"size": "2860",
"license": "mit",
"hash": -1242768165901111600,
"line_mean": 37.6621621622,
"line_max": 123,
"alpha_frac": 0.5636363636,
"autogenerated": false,
"ratio": 2.933333333333333,
"conf... |
__author__ = 'Steven LI'
from test_steps import *
def my_add(*args):
ret = 0
for i in args:
ret += i
return ret
#############################################################################
## Please notice sleep in my_mul function
def my_mul(*args):
import time, random
time.sleep(random.... | {
"repo_name": "steven004/TestSteps",
"path": "test_examples/test_lesson4_checks.py",
"copies": "1",
"size": "9727",
"license": "mit",
"hash": 8056398340775121000,
"line_mean": 56.5562130178,
"line_max": 144,
"alpha_frac": 0.5733525239,
"autogenerated": false,
"ratio": 2.9673581452104942,
"confi... |
__author__ = 'steve'
"""
Find some other interesting information not written to the logs, and add these to the entry.
Copyright information can be found here: http://www.apnic.net/db/dbcopyright.html, and states:
" Users will not be able to download the full contents of the database unless the intended use
is for ... | {
"repo_name": "Steven-Eardley/ssh_attacks",
"path": "portality/find_log_metadata.py",
"copies": "1",
"size": "3117",
"license": "mit",
"hash": 7085849975384705000,
"line_mean": 35.6705882353,
"line_max": 103,
"alpha_frac": 0.6833493744,
"autogenerated": false,
"ratio": 3.6413551401869158,
"conf... |
__author__ = 'steve'
import json
from flask import Blueprint, render_template
from portality import models
""" preview the data in the index """
blueprint = Blueprint('data', __name__)
@blueprint.route('/')
def index():
data_aggs =\
{
"size" : 0,
"aggregations" :
{
"name_coun... | {
"repo_name": "Steven-Eardley/ssh_attacks",
"path": "portality/view/data.py",
"copies": "1",
"size": "1236",
"license": "mit",
"hash": 8282879110879544000,
"line_mean": 26.4666666667,
"line_max": 138,
"alpha_frac": 0.5291262136,
"autogenerated": false,
"ratio": 3.8266253869969042,
"config_test"... |
__author__ = 'Steve'
import time
from mGui.core.controls import TextField
from mGui.events import Event
from mGui.scriptJobs import Idle
from mGui.qt._compat import as_qt_object, QtCore
from mGui.qt._properties import QtSignalProperty
class InputBuffer(object):
'''
accumulate inputs until a certain amount ... | {
"repo_name": "theodox/mGui",
"path": "mGui/qt/QTextField.py",
"copies": "1",
"size": "2934",
"license": "mit",
"hash": -7385080324112308000,
"line_mean": 28.34,
"line_max": 87,
"alpha_frac": 0.5685071575,
"autogenerated": false,
"ratio": 4.0357634112792296,
"config_test": false,
"has_no_keyw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.