text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'zhenbangxiao'
'''
imdb is a command line interface program for searching movies, actors, directors in the Internet Movie Database.
'''
from urllib.request import Request, urlopen
from urllib.error import URLError, HTTPError
from bs4 import BeautifulSoup
import sys
version = '0.0.0.1'
urlPrefix = 'http:... | {
"repo_name": "starkshaw/imdb",
"path": "imdb.py",
"copies": "1",
"size": "2888",
"license": "mit",
"hash": 3175274284247979500,
"line_mean": 42.1044776119,
"line_max": 149,
"alpha_frac": 0.5730609418,
"autogenerated": false,
"ratio": 3.530562347188264,
"config_test": false,
"has_no_keywords"... |
__author__ = 'zheng_000'
from user_account_library import *
from machine_library import *
from db_calls import *
def main():
install()
def install():
user_input = False
has_account = False
while(not user_input):
has_account_input = raw_input("Do you have an account? y/n: ").lower()
if(... | {
"repo_name": "mrahman1122/Team4CS3240",
"path": "Client/install.py",
"copies": "1",
"size": "1538",
"license": "apache-2.0",
"hash": 7550052610002091000,
"line_mean": 26.9818181818,
"line_max": 80,
"alpha_frac": 0.5962288687,
"autogenerated": false,
"ratio": 3.8740554156171285,
"config_test": ... |
__author__ = 'zheng_000'
import getpass
from db_calls import *
def create_account():
username = set_username()
password = set_password()
hashed_password = hash_password(password)
if(store_new_account(username, hashed_password)):
print "Succeeded in creating new user: " + username
else:
... | {
"repo_name": "mrahman1122/Team4CS3240",
"path": "Client/user_account_library.py",
"copies": "1",
"size": "2268",
"license": "apache-2.0",
"hash": -9105130244348988000,
"line_mean": 26.6707317073,
"line_max": 59,
"alpha_frac": 0.6366843034,
"autogenerated": false,
"ratio": 4.176795580110498,
"c... |
__author__ = 'zheng_000'
import MySQLdb
from db_settings import *
import sys
#SECTION: TABLE CREATION AND DELETION----------------------------------------------------------------
def setup_tables():
db = MySQLdb.connect(db_server, db_username, db_password, db_database)
c = db.cursor()
print "CREATING USER... | {
"repo_name": "mrahman1122/Team4CS3240",
"path": "Client/db_calls.py",
"copies": "1",
"size": "10234",
"license": "apache-2.0",
"hash": -7411197772256890000,
"line_mean": 37.9163498099,
"line_max": 199,
"alpha_frac": 0.5783662302,
"autogenerated": false,
"ratio": 3.71875,
"config_test": false,
... |
__author__ = 'zheng_000'
import MySQLdb
from db_settings import *
def get_users():
users = []
db = MySQLdb.connect(db_server, db_username, db_password, db_database)
c = db.cursor()
numEntries = c.execute('SELECT username FROM ' + db_usertable)
for i in range(numEntries):
row = c.fetchone()... | {
"repo_name": "mrahman1122/Team4CS3240",
"path": "Server/admin.py",
"copies": "1",
"size": "2310",
"license": "apache-2.0",
"hash": -8250975277466577000,
"line_mean": 29.8,
"line_max": 148,
"alpha_frac": 0.6380952381,
"autogenerated": false,
"ratio": 3.3047210300429186,
"config_test": false,
... |
import re
import sys
from twilio.base.exceptions import TwilioRestException
from twilio.rest import Client
class SMS(object):
def __init__(self, accountSID, authToken):
self.accountSID = accountSID
self.authToken = authToken
self.twilioCli = Client(accountSID, authToken)
# EFFECTS: S... | {
"repo_name": "tzhenghao/SMSBot",
"path": "SMS.py",
"copies": "1",
"size": "1446",
"license": "mit",
"hash": -3596124597829128700,
"line_mean": 31.8636363636,
"line_max": 107,
"alpha_frac": 0.6403872752,
"autogenerated": false,
"ratio": 3.615,
"config_test": false,
"has_no_keywords": false,
... |
__author__ = 'zheng'
# coding: UTF-8
from bs4 import BeautifulSoup
import urllib2
import sys
# Obtain keyword from shell command
def obtain_keyword():
try:
return sys.argv[1]
except:
print 'ERROR: yd(youdao) takes one parameter.'
sys.exit()
# Obtain option from shell command
def ob... | {
"repo_name": "jeffzhengye/pylearn",
"path": "network/youdao.py",
"copies": "1",
"size": "3133",
"license": "unlicense",
"hash": 4245701561947975700,
"line_mean": 24.072,
"line_max": 82,
"alpha_frac": 0.5394190871,
"autogenerated": false,
"ratio": 3.8679012345679014,
"config_test": false,
"ha... |
import json
import faerie
import time
# Given a path in json, return value if path, full path denoted by . (example address.name) exists, otherwise return ''
def get_value_json(path, doc, separator='.'):
paths = path.strip().split(separator)
for field in paths:
if field in doc:
doc = doc[f... | {
"repo_name": "usc-isi-i2/dig-geonames",
"path": "python/geoname_extractor.py",
"copies": "1",
"size": "5214",
"license": "mit",
"hash": 1544237012869046800,
"line_mean": 43.9482758621,
"line_max": 131,
"alpha_frac": 0.55331799,
"autogenerated": false,
"ratio": 3.7296137339055795,
"config_test"... |
__author__ = 'zheng'
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.pipeline import Pipeline
from sklearn.svm import LinearSVC
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.multiclass import OneVsRestClassifier
X_train = np.array(["new york is a... | {
"repo_name": "jeffzhengye/pylearn",
"path": "ML/sklearn_test.py",
"copies": "1",
"size": "1614",
"license": "unlicense",
"hash": -8916552215254287000,
"line_mean": 41.5,
"line_max": 78,
"alpha_frac": 0.573110285,
"autogenerated": false,
"ratio": 3.824644549763033,
"config_test": false,
"has_... |
__author__ = 'zhengwang'
import cv2
import numpy as np
import glob
import sys
import time
import os
from sklearn.model_selection import train_test_split
def load_data(input_size, path):
print("Loading training data...")
start = time.time()
# load training data
X = np.empty((0, input_size))
y = n... | {
"repo_name": "hamuchiwa/AutoRCCar",
"path": "computer/model.py",
"copies": "1",
"size": "2583",
"license": "bsd-2-clause",
"hash": 6506584336186354000,
"line_mean": 26.1894736842,
"line_max": 74,
"alpha_frac": 0.5807200929,
"autogenerated": false,
"ratio": 3.4031620553359683,
"config_test": fa... |
__author__ = 'zhengwang'
import cv2
import numpy as np
import glob
print 'Loading training data...'
e0 = cv2.getTickCount()
# load training data
image_array = np.zeros((1, 38400))
label_array = np.zeros((1, 4), 'float')
training_data = glob.glob('training_data/*.npz')
# image_array, label_array = np.load('training_d... | {
"repo_name": "yumikohey/WaiterCar",
"path": "self-driving-car-ai/mlp_training.py",
"copies": "1",
"size": "2314",
"license": "mit",
"hash": -5296735685558058000,
"line_mean": 28.6794871795,
"line_max": 77,
"alpha_frac": 0.6227312014,
"autogenerated": false,
"ratio": 3.2454417952314167,
"config... |
__author__ = 'zhengwang'
import cv2
import sys
import threading
import socketserver
import numpy as np
from model import NeuralNetwork
from rc_driver_helper import *
# distance data measured by ultrasonic sensor
sensor_data = None
class SensorDataHandler(socketserver.BaseRequestHandler):
data = " "
def ... | {
"repo_name": "hamuchiwa/AutoRCCar",
"path": "computer/rc_driver.py",
"copies": "1",
"size": "6800",
"license": "bsd-2-clause",
"hash": 7607256598804205000,
"line_mean": 34.9788359788,
"line_max": 118,
"alpha_frac": 0.5101470588,
"autogenerated": false,
"ratio": 4.148871262965223,
"config_test"... |
__author__ = 'zhengwang'
import numpy as np
import cv2
import serial
import pygame
from pygame.locals import *
import socket
import time
import os
class CollectTrainingData(object):
def __init__(self, host, port, serial_port, input_size):
self.server_socket = socket.socket()
self.server_soc... | {
"repo_name": "hamuchiwa/AutoRCCar",
"path": "computer/collect_training_data.py",
"copies": "1",
"size": "6533",
"license": "bsd-2-clause",
"hash": -1552695882491645400,
"line_mean": 35.2944444444,
"line_max": 98,
"alpha_frac": 0.4250727078,
"autogenerated": false,
"ratio": 4.5368055555555555,
... |
__author__ = 'zhengwang'
import numpy as np
import cv2
import serial
import pygame
from pygame.locals import *
import socket
class CollectTrainingData(object):
def __init__(self):
self.server_socket = socket.socket()
self.server_socket.bind(('192.168.1.100', 8000))
self.server_socke... | {
"repo_name": "aish9r/AutoRCCar",
"path": "computer/collect_training_data.py",
"copies": "4",
"size": "6641",
"license": "bsd-2-clause",
"hash": -5258836324718331000,
"line_mean": 39.7484662577,
"line_max": 105,
"alpha_frac": 0.4283993374,
"autogenerated": false,
"ratio": 4.75035765379113,
"con... |
__author__ = 'zhengwang'
import numpy as np
import cv2
import socket
class VideoStreamingTest(object):
def __init__(self, host, port):
self.server_socket = socket.socket()
self.server_socket.bind((host, port))
self.server_socket.listen(0)
self.connection, self.client_address = se... | {
"repo_name": "hamuchiwa/AutoRCCar",
"path": "test/stream_server_test.py",
"copies": "1",
"size": "1619",
"license": "bsd-2-clause",
"hash": -6518552798356073000,
"line_mean": 31.38,
"line_max": 94,
"alpha_frac": 0.5305744287,
"autogenerated": false,
"ratio": 3.8274231678487,
"config_test": fal... |
__author__ = 'zhengwang'
import numpy as np
import cv2
import socket
class VideoStreamingTest(object):
def __init__(self):
self.server_socket = socket.socket()
self.server_socket.bind(('192.168.1.100', 8000))
self.server_socket.listen(0)
self.connection, self.client_address = sel... | {
"repo_name": "romansavrulin/AutoRCCar",
"path": "test/stream_server_test.py",
"copies": "2",
"size": "1474",
"license": "bsd-2-clause",
"hash": -5690516461700439000,
"line_mean": 32.5,
"line_max": 106,
"alpha_frac": 0.5352781547,
"autogenerated": false,
"ratio": 3.8891820580474934,
"config_tes... |
__author__ = 'zhengwang'
import serial
import cv2
import math
class RCControl(object):
def __init__(self, serial_port):
self.serial_port = serial.Serial(serial_port, 115200, timeout=1)
def steer(self, prediction):
if prediction == 2:
self.serial_port.write(chr(1).encode())
... | {
"repo_name": "hamuchiwa/AutoRCCar",
"path": "computer/rc_driver_helper.py",
"copies": "1",
"size": "3762",
"license": "bsd-2-clause",
"hash": 9063448112709500000,
"line_mean": 35.1730769231,
"line_max": 125,
"alpha_frac": 0.5050505051,
"autogenerated": false,
"ratio": 3.4106980961015414,
"conf... |
__author__ = 'zhengwang'
import serial
import pygame
from pygame.locals import *
class RCTest(object):
def __init__(self):
pygame.init()
pygame.display.set_mode((250, 250))
self.ser = serial.Serial("/dev/tty.usbmodem1421", 115200, timeout=1) # mac
# self.ser = serial.Serial("/... | {
"repo_name": "hamuchiwa/AutoRCCar",
"path": "test/rc_control_test.py",
"copies": "1",
"size": "2469",
"license": "bsd-2-clause",
"hash": -1645071787406179600,
"line_mean": 33.2916666667,
"line_max": 87,
"alpha_frac": 0.4439044147,
"autogenerated": false,
"ratio": 4.339191564147628,
"config_tes... |
__author__ = 'zhengwang'
import serial
import pygame
from pygame.locals import *
class RCTest(object):
def __init__(self):
pygame.init()
self.ser = serial.Serial('/dev/tty.usbmodem1421', 115200, timeout=1)
self.send_inst = True
self.steer()
def steer(self):
while se... | {
"repo_name": "romansavrulin/AutoRCCar",
"path": "test/rc_control_test.py",
"copies": "2",
"size": "2236",
"license": "bsd-2-clause",
"hash": -745994070231787400,
"line_mean": 31.4057971014,
"line_max": 80,
"alpha_frac": 0.4288908766,
"autogenerated": false,
"ratio": 4.4189723320158105,
"config... |
__author__ = 'zhengwang'
import socket
import time
class SensorStreamingTest(object):
def __init__(self, host, port):
self.server_socket = socket.socket()
self.server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.server_socket.bind((host, port))
self.server_so... | {
"repo_name": "hamuchiwa/AutoRCCar",
"path": "test/ultrasonic_server_test.py",
"copies": "1",
"size": "1179",
"license": "bsd-2-clause",
"hash": 5895946216222083000,
"line_mean": 28.475,
"line_max": 80,
"alpha_frac": 0.5640373198,
"autogenerated": false,
"ratio": 3.803225806451613,
"config_test... |
__author__ = 'zhengwang'
import sys
import numpy as np
import cv2
import curses
import socket
pi_ip=sys.argv[1]
#pi_ip = "127.0.0.1"
class CollectTrainingData(object):
def __init__(self):
# Server to recieve data
self.server_socket = socket.socket()
self.server_socket.bind(("", 8001))
... | {
"repo_name": "Quadrifrons/AutoRCCar",
"path": "nithin/train.py",
"copies": "1",
"size": "8115",
"license": "bsd-2-clause",
"hash": 8831715232777910000,
"line_mean": 39.1732673267,
"line_max": 105,
"alpha_frac": 0.4506469501,
"autogenerated": false,
"ratio": 4.543673012318029,
"config_test": fa... |
__author__ = 'zhengwang'
import threading
import SocketServer
import serial
import cv2
import numpy as np
import math
# distance data measured by ultrasonic sensor
sensor_data = " "
class NeuralNetwork(object):
def __init__(self):
self.model = cv2.ANN_MLP()
def create(self):
layer_size = n... | {
"repo_name": "romansavrulin/AutoRCCar",
"path": "computer/rc_driver.py",
"copies": "1",
"size": "10397",
"license": "bsd-2-clause",
"hash": -2527050890570491000,
"line_mean": 34.125,
"line_max": 125,
"alpha_frac": 0.4974511878,
"autogenerated": false,
"ratio": 3.894007490636704,
"config_test":... |
__author__ = 'zhengwang'
import threading
#Threading in python is used to run multiple threads (tasks, function calls) at the same time. Note that this does not mean that they
# are executed on different CPUs. Python threads are used in cases where the execution of a task involves some waiting.
# One example would be ... | {
"repo_name": "Quadrifrons/AutoRCCar",
"path": "computer/rc_driver.py",
"copies": "1",
"size": "14346",
"license": "bsd-2-clause",
"hash": 3472517165859251000,
"line_mean": 43.5527950311,
"line_max": 144,
"alpha_frac": 0.539523212,
"autogenerated": false,
"ratio": 4.219411764705883,
"config_tes... |
__author__ = "Zhenzhou Wu"
__copyright__ = "Copyright 2012, Zhenzhou Wu"
__credits__ = ["Zhenzhou Wu"]
__license__ = "3-clause BSD"
__email__ = "hyciswu@gmail.com"
__maintainer__ = "Zhenzhou Wu"
"""
Adapted from pylearn2 reference http://deeplearning.net/software/pylearn2/
Iterators providing indices for different ki... | {
"repo_name": "hycis/Pynet",
"path": "pynet/datasets/iterator.py",
"copies": "1",
"size": "5771",
"license": "apache-2.0",
"hash": 6731348087315195000,
"line_mean": 33.5568862275,
"line_max": 80,
"alpha_frac": 0.5879396985,
"autogenerated": false,
"ratio": 4.3325825825825826,
"config_test": fal... |
__author__ = "Zhenzhou Wu"
__copyright__ = "Copyright 2012, Zhenzhou Wu"
__credits__ = ["Zhenzhou Wu"]
__license__ = "3-clause BSD"
__email__ = "hyciswu@gmail.com"
__maintainer__ = "Zhenzhou Wu"
import numpy as np
import theano
floatX = theano.config.floatX
class WeightInitialization(object):
def __init__(sel... | {
"repo_name": "hycis/Pynet",
"path": "pynet/weight_initialization.py",
"copies": "1",
"size": "1357",
"license": "apache-2.0",
"hash": -5103086072667451000,
"line_mean": 29.1555555556,
"line_max": 85,
"alpha_frac": 0.5482682388,
"autogenerated": false,
"ratio": 3.5246753246753246,
"config_test"... |
__author__ = "Zhenzhou Wu"
__copyright__ = "Copyright 2012, Zhenzhou Wu"
__credits__ = ["Zhenzhou Wu"]
__license__ = "3-clause BSD"
__email__ = "hyciswu@gmail.com"
__maintainer__ = "Zhenzhou Wu"
"""
Functionality : Define the noise that is to be added to the dataset
"""
import numpy as np
class Noise(object):
"... | {
"repo_name": "hycis/Pynet",
"path": "pynet/datasets/dataset_noise.py",
"copies": "1",
"size": "2228",
"license": "apache-2.0",
"hash": 3140995396682474000,
"line_mean": 23.2173913043,
"line_max": 90,
"alpha_frac": 0.5749551167,
"autogenerated": false,
"ratio": 3.8883071553228623,
"config_test"... |
# This file generates figures of Total Jobs vs. Preempted Jobs on different grid resources.
# Input: @ARGV[1]: The csv file that contains preempted information such as days.csv(It uses day01, days02,... to separate different days' data.
# @ARGV[2]: The csv file that contains total jobs info on different resourc... | {
"repo_name": "zzxuanyuan/osgparse",
"path": "osgparse/ml_engine/read.py",
"copies": "1",
"size": "2139",
"license": "bsd-3-clause",
"hash": -6321074999330457000,
"line_mean": 44.5106382979,
"line_max": 569,
"alpha_frac": 0.7227676484,
"autogenerated": false,
"ratio": 3.0776978417266188,
"confi... |
# This file is to collect job info from each snapshot and interpret the life cycles for each job.
# This file loads Parser.py to generate life cycles for jobs.
# This file also classify jobs into five categories: Succeeded, CleanUp, Retired, Killed, LightPreempted, HeavyPreempted.(Further analysis needs to be done inc... | {
"repo_name": "zzxuanyuan/osgparse",
"path": "osgparse/lifecycle.py",
"copies": "1",
"size": "8538",
"license": "bsd-3-clause",
"hash": -6254448059542432000,
"line_mean": 43.7015706806,
"line_max": 742,
"alpha_frac": 0.7130475521,
"autogenerated": false,
"ratio": 2.9410954185325524,
"config_tes... |
# This file is to parse job snapshots from OSG to Job object that contains meta info for a job at this particular snapshot.
# This file is imported to JobLifeCycle.py to generate life cycles for jobs.
#!/usr/bin/python
import sys
import osgparse.constants
def print_dict(dictionary):
result = ""
cnt = 0
for key, ... | {
"repo_name": "zzxuanyuan/osgparse",
"path": "osgparse/parser.py",
"copies": "1",
"size": "23016",
"license": "bsd-3-clause",
"hash": -72340173415360940,
"line_mean": 32.7973568282,
"line_max": 176,
"alpha_frac": 0.6651459854,
"autogenerated": false,
"ratio": 2.8816827344434706,
"config_test": ... |
__author__ = 'Zhi Deng'
from math import sqrt
import numpy as np
SURF = {'100':{'coords':np.array([[0.0, 0.0, 0.0],
[0.5, 0.5, 0.0],
[0.5, 0.0, 0.5],
[0.0, 0.5, 0.5]]),
'a':1.0, 'c':1.0, 'area':1.0},
... | {
"repo_name": "adengz/nano266",
"path": "pyqe/qe_surfio.py",
"copies": "1",
"size": "2694",
"license": "bsd-3-clause",
"hash": -62607841563340700,
"line_mean": 36.9577464789,
"line_max": 73,
"alpha_frac": 0.5337787676,
"autogenerated": false,
"ratio": 3.068337129840547,
"config_test": false,
... |
__author__ = 'Zhi Deng'
import os
import glob
import shutil
from monty.os import cd
from pymatgen.core.composition import Composition
def _write_input_from_temp(template, jobname, params):
'''
Private method as the writer of QE input file.
'''
with open('%s.pw.in' % jobname, 'w') as f:
f.write... | {
"repo_name": "adengz/nano266",
"path": "pyqe/qe_input.py",
"copies": "1",
"size": "2124",
"license": "bsd-3-clause",
"hash": -6736487187618403000,
"line_mean": 33.2580645161,
"line_max": 79,
"alpha_frac": 0.6177024482,
"autogenerated": false,
"ratio": 3.557788944723618,
"config_test": false,
... |
__author__ = 'Zhi Deng'
import pandas as pd
import numpy as np
from pymatgen.util.plotting_utils import get_publication_quality_plot
class BasicAnalyzer(object):
'''
Class for further processing the output data from a csv file.
The basic function is converting the total energy from Ry to
meV, and the ... | {
"repo_name": "adengz/nano266",
"path": "pyqe/qe_output.py",
"copies": "1",
"size": "4729",
"license": "bsd-3-clause",
"hash": 1083659873226984800,
"line_mean": 33.0215827338,
"line_max": 75,
"alpha_frac": 0.5887079721,
"autogenerated": false,
"ratio": 3.4417758369723437,
"config_test": true,
... |
__author__ = 'zhonghong'
from zapi.core.utils import decorate_list
class Z_Model(object):
def __getattr__(self, in_field):
dynamic_properties = ["find_by_", "delete_by_"]
query = None
for idx, prop in enumerate(dynamic_properties):
if in_field.startswith(prop):
... | {
"repo_name": "linzhonghong/zapi",
"path": "zapi/core/model.py",
"copies": "1",
"size": "2669",
"license": "mit",
"hash": 6270396012841060000,
"line_mean": 32.3625,
"line_max": 97,
"alpha_frac": 0.5567628325,
"autogenerated": false,
"ratio": 3.68646408839779,
"config_test": false,
"has_no_key... |
__author__ = 'zhonghong'
import cgi
from cgi import escape
from urlparse import parse_qs
import traceback
traceback.format_exc()
def is_post_request(environ):
if environ['REQUEST_METHOD'].upper() != 'POST':
return False
content_type = environ.get('CONTENT_TYPE', 'application/x-www-form-urlencoded')
... | {
"repo_name": "linzhonghong/zapi",
"path": "zapi/core/input.py",
"copies": "1",
"size": "2641",
"license": "mit",
"hash": -8034961010221039000,
"line_mean": 28.3444444444,
"line_max": 83,
"alpha_frac": 0.6240060583,
"autogenerated": false,
"ratio": 3.9654654654654653,
"config_test": false,
"h... |
__author__ = 'zhonghong'
import os
import re
import imp
import string
import logging
from functools import wraps
from UserList import UserList
log = logging.getLogger(__name__)
class FlyweightMixin(object):
_instances = dict()
def __init__(self, *args, **kwargs):
raise NotImplementedError
def ... | {
"repo_name": "linzhonghong/zapi",
"path": "zapi/core/utils.py",
"copies": "1",
"size": "3624",
"license": "mit",
"hash": 7607798018449810000,
"line_mean": 26.0447761194,
"line_max": 103,
"alpha_frac": 0.5229028698,
"autogenerated": false,
"ratio": 4.017738359201774,
"config_test": false,
"ha... |
__author__ = 'zhonghong'
import os
import re
import logging
import traceback
from zapi.core.utils import load_module, capitalize_name
from zapi.core.input import Input
from zapi.core.load import Loader
log = logging.getLogger(__name__)
class Router(object):
@classmethod
def route(cls, app_path, environ):... | {
"repo_name": "linzhonghong/zapi",
"path": "zapi/core/route.py",
"copies": "1",
"size": "2275",
"license": "mit",
"hash": 3569168636956961000,
"line_mean": 34.0153846154,
"line_max": 108,
"alpha_frac": 0.5432967033,
"autogenerated": false,
"ratio": 4.005281690140845,
"config_test": false,
"ha... |
class Solution(object):
def isHappy(self, n):
"""
:type n: int
:rtype: bool
"""
if n <= 0:
return False
x = self.cal(n)
# loop_numbers = self.all_loop_numbers()
loop_numbers = [2, 3, 4, 5, 6, 8, 9,
11, 12, 14, 15, ... | {
"repo_name": "danielsunzhongyuan/my_leetcode_in_python",
"path": "happy_number_202.py",
"copies": "1",
"size": "1602",
"license": "apache-2.0",
"hash": 4083695735058695000,
"line_mean": 31.693877551,
"line_max": 79,
"alpha_frac": 0.3945068664,
"autogenerated": false,
"ratio": 3.520879120879121,
... |
__author__ = 'zhouguangfu, chenxiayu'
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import numpy as np
from scipy.ndimage import morphology
from froi.algorithm.meshtool import binary_expand
class... | {
"repo_name": "BNUCNL/FreeROI",
"path": "froi/widgets/binarydilationdialog.py",
"copies": "2",
"size": "5248",
"license": "bsd-3-clause",
"hash": 9162010196325634000,
"line_mean": 34.2214765101,
"line_max": 100,
"alpha_frac": 0.5823170732,
"autogenerated": false,
"ratio": 3.8960653303637716,
"c... |
__author__ = 'zhouguangfu'
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import numpy as np
from scipy.ndimage import morphology
from froi.algorithm import imtool
class BinarydilationDialog(QDial... | {
"repo_name": "zhouguangfu/FreeROI",
"path": "froi/gui/component/binarydilationdialog.py",
"copies": "3",
"size": "3835",
"license": "bsd-3-clause",
"hash": -1559182932478149400,
"line_mean": 34.1834862385,
"line_max": 80,
"alpha_frac": 0.5893089961,
"autogenerated": false,
"ratio": 3.82352941176... |
__author__ = 'zhouguangfu'
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from froi.algorithm import imtool
class BinarizationDialog(QDialog):
"""
A dialog for action of binaryzation.
... | {
"repo_name": "liuzhaoguo/FreeROI",
"path": "froi/gui/component/binarizationdialog.py",
"copies": "1",
"size": "3303",
"license": "bsd-3-clause",
"hash": 4324717622728079000,
"line_mean": 31.3823529412,
"line_max": 113,
"alpha_frac": 0.5927944293,
"autogenerated": false,
"ratio": 3.90425531914893... |
__author__ = 'zhouguangfu'
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplo... | {
"repo_name": "liuzhaoguo/FreeROI",
"path": "froi/gui/component/unused/volumedintensitydialog.py",
"copies": "6",
"size": "2368",
"license": "bsd-3-clause",
"hash": 623188336538985700,
"line_mean": 31,
"line_max": 100,
"alpha_frac": 0.6114864865,
"autogenerated": false,
"ratio": 3.831715210355987... |
__author__ = 'zhouxiwen'
__email__ = 'utoronto'
__copyright__ = '2014 xw'
#!/usr/bin/env python3
""" Assignment 1, Exercise 1, INF1340, Fall, 2014. Grade to gpa conversion
This module contains one function grade_to_gpa. It can be passed a parameter
that is an integer (0-100) or a letter grade (A+, A, A-, B+, B, B-, ... | {
"repo_name": "Xwzhou/1340A1",
"path": "exercise1.py",
"copies": "1",
"size": "2430",
"license": "mit",
"hash": 1844886351117402400,
"line_mean": 26.6136363636,
"line_max": 92,
"alpha_frac": 0.5666666667,
"autogenerated": false,
"ratio": 3.476394849785408,
"config_test": false,
"has_no_keywor... |
__author__ = 'zhyq'
from tornado.util import ObjectDict
class A(object):
__slots__ = ['_data', '_dirty']
def __init__(self):
self._dirty = False
self._data = ObjectDict({'a':10})
def __getitem__(self, name):
return self._data.get(name, None)
def __setitem__(self, name, value... | {
"repo_name": "zhyq0826/test-lab",
"path": "test_dict.py",
"copies": "1",
"size": "1432",
"license": "mit",
"hash": 8046081807238868000,
"line_mean": 22.1129032258,
"line_max": 51,
"alpha_frac": 0.5027932961,
"autogenerated": false,
"ratio": 3.74869109947644,
"config_test": false,
"has_no_key... |
__author__ = 'zhyq'
import multiprocessing
import time
def hello():
import time
time.sleep(1)
print('hello world')
def main1():
t = multiprocessing.Process(target=hello)
t.daemon
t.start()
#t.join()
print 'asdf'
class ActivePool(object):
def __init__(self):
self.mgr = mu... | {
"repo_name": "zhyq0826/test-lab",
"path": "test_process.py",
"copies": "1",
"size": "1774",
"license": "mit",
"hash": -6117386262846310000,
"line_mean": 22.3421052632,
"line_max": 100,
"alpha_frac": 0.6014656144,
"autogenerated": false,
"ratio": 3.665289256198347,
"config_test": false,
"has_... |
__author__ = 'zhyq'
import time
import threading
import os
import thread
def loop0():
print 'start loop0 ', time.ctime()
time.sleep(4)
print 'end loop ', time.ctime()
def loop1():
print 'start loop1 ', time.ctime()
time.sleep(2)
print 'end loop1 ', time.ctime()
def main():
print 'main st... | {
"repo_name": "zhyq0826/test-lab",
"path": "test_thread.py",
"copies": "1",
"size": "1433",
"license": "mit",
"hash": -6475455705796825000,
"line_mean": 19.1971830986,
"line_max": 62,
"alpha_frac": 0.5722260991,
"autogenerated": false,
"ratio": 3.242081447963801,
"config_test": false,
"has_no... |
__author__ = 'zieghailo'
import matplotlib.pyplot as plt
# plt.ion()
def show():
plt.show()
plt.get_current_fig_manager().full_screen_toggle()
def plot_graph(graph):
# plt.ion()
x = [p.x for p in graph.points]
y = [p.y for p in graph.points]
plt.plot(x, y, 'b*')
plt.draw()
def plot_ar... | {
"repo_name": "MihailoIsakov/SMUVI",
"path": "plotter.py",
"copies": "1",
"size": "1880",
"license": "mit",
"hash": -8190305577453362000,
"line_mean": 21.6626506024,
"line_max": 79,
"alpha_frac": 0.5569148936,
"autogenerated": false,
"ratio": 3.022508038585209,
"config_test": false,
"has_no_k... |
__author__ = 'zieghailo'
import numpy as np
from point import Point
from scipy.spatial import KDTree
class BetaSkeleton():
def __init__(self, points=[], beta=1):
self.points = points
self.beta = beta
self.tree = None
@property
def point_val(self):
val = [point.p for point... | {
"repo_name": "MihailoIsakov/SMUVI",
"path": "beta_skeleton.py",
"copies": "1",
"size": "1783",
"license": "mit",
"hash": 2931592119434012700,
"line_mean": 25.6268656716,
"line_max": 97,
"alpha_frac": 0.5182277061,
"autogenerated": false,
"ratio": 3.448742746615087,
"config_test": false,
"has... |
__author__ = 'zieghailo'
import sys
import numpy as np
from scipy.spatial import KDTree
from point import Point
sys.setrecursionlimit(100000)
class SoIGraph():
def __init__(self, points):
self.points = points
self._build_tree()
def _build_tree(self):
data = [tuple(p.p) for p in sel... | {
"repo_name": "MihailoIsakov/SMUVI",
"path": "sphereofinfluence.py",
"copies": "1",
"size": "2070",
"license": "mit",
"hash": 4932328617276099000,
"line_mean": 27.7638888889,
"line_max": 78,
"alpha_frac": 0.554589372,
"autogenerated": false,
"ratio": 3.4102141680395386,
"config_test": false,
... |
__author__ = 'zirony'
import json
JSEND_STATUS_SUCCESS = 'success'
JSEND_STATUS_FAIL = 'fail'
JSEND_STATUS_ERROR = 'error'
JSEND_STATUSES = (JSEND_STATUS_SUCCESS, JSEND_STATUS_FAIL, JSEND_STATUS_ERROR)
class JSENDObject(object):
def __init__(self, status=None, data={}, code=0, message=''):
self.status ... | {
"repo_name": "sangwonl/py-jsend",
"path": "jsend/jsend.py",
"copies": "1",
"size": "2425",
"license": "mit",
"hash": 7196085185570180000,
"line_mean": 27.5294117647,
"line_max": 88,
"alpha_frac": 0.6490721649,
"autogenerated": false,
"ratio": 3.663141993957704,
"config_test": false,
"has_no_... |
__author__ = 'zirony'
import json
# Support Python 2/3 unicode
try:
strtype = unicode
except:
strtype = bytes
class DictEx(dict):
def stringify(self):
return json.dumps(self)
def success(data={}):
if not isinstance(data, dict):
raise ValueError('data must be the dict type')
retu... | {
"repo_name": "onceaweeq/py-jsend",
"path": "jsend/jsend.py",
"copies": "1",
"size": "1736",
"license": "mit",
"hash": 1995099489249998800,
"line_mean": 23.4507042254,
"line_max": 77,
"alpha_frac": 0.616359447,
"autogenerated": false,
"ratio": 3.7094017094017095,
"config_test": false,
"has_no... |
__author__ = 'zklinger'
import maya.cmds as cmds
class AOShader(object):
def __init__(self, imageName, dirName):
self._imageName = imageName
self._dirName = dirName
self._layerNum = imageName[11:14]
self._surfaceShader = cmds.shadingNode('surfaceShader',
... | {
"repo_name": "zklinger2000/maya-python-imageCard",
"path": "scripts/AOShader.py",
"copies": "1",
"size": "5438",
"license": "mit",
"hash": -4427393883716936000,
"line_mean": 47.1238938053,
"line_max": 95,
"alpha_frac": 0.513424053,
"autogenerated": false,
"ratio": 4.24512099921936,
"config_tes... |
__author__ = 'zklinger'
import maya.cmds as cmds
class ImageCard(object):
def __init__(self, imageName, w=19.2, h=10.8):
self._imageName = imageName
self._shotNum = imageName[2:5]
self._layerNum = imageName[11:14]
self._imageFile = cmds.image(image='self._imageName')
self._... | {
"repo_name": "zklinger2000/maya-python-imageCard",
"path": "scripts/imageCard.py",
"copies": "1",
"size": "2235",
"license": "mit",
"hash": 6801138061067184000,
"line_mean": 36.2666666667,
"line_max": 104,
"alpha_frac": 0.5293064877,
"autogenerated": false,
"ratio": 3.768971332209106,
"config_... |
__author__ = 'zklinger'
import maya.cmds as cmds
class positionShader(object):
def __init__(self, imageName, dirName):
self._imageName = imageName
self._dirName = dirName
self._layerNum = imageName[11:14]
self._surfaceShader = cmds.shadingNode('surfaceShader',
... | {
"repo_name": "zklinger2000/maya-python-imageCard",
"path": "scripts/positionShader.py",
"copies": "1",
"size": "5739",
"license": "mit",
"hash": -679064112919015400,
"line_mean": 48.0512820513,
"line_max": 95,
"alpha_frac": 0.519951211,
"autogenerated": false,
"ratio": 4.3642585551330795,
"con... |
__author__ = 'zklinger'
import maya.cmds as cmds
class XPassShader(object):
def __init__(self, imageName, dirName):
self._imageName = imageName
self._dirName = dirName
self._layerNum = imageName[11:14]
self._shader = cmds.shadingNode('mia_material_x_passes',
... | {
"repo_name": "zklinger2000/maya-python-imageCard",
"path": "scripts/xPassShader.py",
"copies": "1",
"size": "3343",
"license": "mit",
"hash": -1603334979996596000,
"line_mean": 43.5733333333,
"line_max": 104,
"alpha_frac": 0.5148070595,
"autogenerated": false,
"ratio": 4.205031446540881,
"conf... |
__author__ = 'zklinger'
import maya.cmds as cmds
class ZDepthShader(object):
def __init__(self, imageName, dirName, oldMinX, oldMaxX):
self._imageName = imageName
self._dirName = dirName
self._layerNum = imageName[11:14]
self._surfaceShader = cmds.shadingNode('surfaceShader',
... | {
"repo_name": "zklinger2000/maya-python-imageCard",
"path": "scripts/zDepthShader.py",
"copies": "1",
"size": "10084",
"license": "mit",
"hash": 9151536969375212000,
"line_mean": 50.7179487179,
"line_max": 104,
"alpha_frac": 0.5490876636,
"autogenerated": false,
"ratio": 4.019131127939418,
"con... |
__author__ = 'zklinger'
import maya.cmds as cmds
import sys
sys.path.append(r'C:\Users\zklinger\Documents\maya\scripts\maya-python-imageCard\scripts')
import gravModTools as gMT
from PIL import Image
imageFolder = 'C:\Users\zklinger\Documents\maya\scripts\maya-python-imageCard\example\layers\\'
imageFileList = cmds.... | {
"repo_name": "zklinger2000/maya-python-imageCard",
"path": "scripts/imageCardsImport.py",
"copies": "1",
"size": "3284",
"license": "mit",
"hash": -2001533874301305900,
"line_mean": 40.5696202532,
"line_max": 95,
"alpha_frac": 0.6434226553,
"autogenerated": false,
"ratio": 3.818604651162791,
"... |
__author__ = 'zklinger'
import maya.cmds as cmds
import sys
sys.path.append(r'C:\Users\zklinger\Google Drive\Docs\PROJECTS\CODE\PYTHON\gravModTools')
import gravModTools as gMT
import image as image
from PIL import Image
# When you first import a file you must give it the full path
gMT.psource( r'C:\Users\zklinger\G... | {
"repo_name": "zklinger2000/maya-python-imageCard",
"path": "scripts/createSurfaceShader.py",
"copies": "1",
"size": "2710",
"license": "mit",
"hash": -8361248408230557000,
"line_mean": 35.6216216216,
"line_max": 103,
"alpha_frac": 0.6715867159,
"autogenerated": false,
"ratio": 3.3875,
"config_... |
__author__ = 'zklinger'
import maya.cmds as cmds
import sys
sys.path.append(r'C:\Users\zklinger\Documents\maya\scripts\maya-python-imageCard\scripts\gravModTools')
import os
import imageCard as ImageCard
import xPassShader as XPassShader
import zDepthShader as ZDepthShader
import AOShader as AOShader
import positionS... | {
"repo_name": "zklinger2000/maya-python-imageCard",
"path": "scripts/gravModTools.py",
"copies": "1",
"size": "1384",
"license": "mit",
"hash": 4924624893437988000,
"line_mean": 30.4545454545,
"line_max": 113,
"alpha_frac": 0.6842485549,
"autogenerated": false,
"ratio": 3.730458221024259,
"conf... |
import sys; IMP_PATH = r'C:\\Users\\rslqulab\\Desktop\\zkm\\pyHFSS\\';
if ~(IMP_PATH in sys.path): sys.path.insert(0,IMP_PATH);
import pandas as pd, matplotlib.pyplot as plt, numpy as np;
import hfss, bbq, bbqNumericalDiagonalization
from hfss import CalcObject, ureg, load_HFSS_project
from bbq import eBBQ_Pmj_to_H_... | {
"repo_name": "alec-eickbusch/pyHFSS",
"path": "Scripts/ZKM/DiTransmon/main _1q.py",
"copies": "1",
"size": "9607",
"license": "mit",
"hash": 3186815122074295300,
"line_mean": 46.3251231527,
"line_max": 186,
"alpha_frac": 0.5393983554,
"autogenerated": false,
"ratio": 2.507045929018789,
"config... |
__author__ = 'zoorobmj'
import re
import csv
import urllib2
import os
from time import sleep
##### Note: Requires Geonames username (need to register) to use the API accessed by this script
# this program geolocates interviews (retrieves nearest named place given lat/long coordinates)
# (optional) update me to confi... | {
"repo_name": "mzoorob/LAPOP-Projects",
"path": "Geolocate/findInterview.py",
"copies": "1",
"size": "5845",
"license": "cc0-1.0",
"hash": 5431231706073542000,
"line_mean": 34.4242424242,
"line_max": 130,
"alpha_frac": 0.5878528657,
"autogenerated": false,
"ratio": 3.4895522388059703,
"config_t... |
__author__ = 'zoorobmj'
import csv
## reads in a survey file csv with columns and rows.
## output: returns a spreadsheet with unique responses for each question.
def read_file(filename):
with open(filename) as csvfile:
reader = csv.DictReader(csvfile)
return reader
if __name__ == '__main__... | {
"repo_name": "mzoorob/LAPOP-Projects",
"path": "Misc/getUniqueResps.py",
"copies": "1",
"size": "1146",
"license": "cc0-1.0",
"hash": 4860591736478562000,
"line_mean": 26.65,
"line_max": 73,
"alpha_frac": 0.5855148342,
"autogenerated": false,
"ratio": 3.638095238095238,
"config_test": false,
... |
__author__ = 'zoorobmj'
import re
import csv
import os
from gibberishclassifier import classify
# from collections import OrderedDict
# import pandas as pd
def clean_list(q_list):
for bad in ["TV.", "NR.", "UD.", "MUCHO.", "PAIS.", "INAP.", "IDNUM.", "PROV.", "ESTRATOSEC.", "MUNICIPIO.", "CLUSTER.",... | {
"repo_name": "mzoorob/LAPOP-Projects",
"path": "QMatrix/find_qCodes_Wordings.py",
"copies": "1",
"size": "3678",
"license": "cc0-1.0",
"hash": -3623193671799435000,
"line_mean": 35.5306122449,
"line_max": 146,
"alpha_frac": 0.4649265905,
"autogenerated": false,
"ratio": 3.355839416058394,
"con... |
__author__ = 'zoorobmj'
import csv
import os
# Python 2.7
# Merges Questionnaires
def read_csv(f):
data = []
with open(f, 'rb') as f:
reader = csv.reader(f)
for row in reader:
data.append(row)
return data
def clean_countries(file_list):
countries = set(... | {
"repo_name": "mzoorob/LAPOP-Projects",
"path": "QMatrix/OneMergedFile.py",
"copies": "1",
"size": "2328",
"license": "cc0-1.0",
"hash": 2968953974331896000,
"line_mean": 29.04,
"line_max": 81,
"alpha_frac": 0.464347079,
"autogenerated": false,
"ratio": 3.847933884297521,
"config_test": false,
... |
__author__ = 'zoorobmj'
import csv
import os
import re
def read_csv(filename):
data = []
with open(filename, 'rb') as f:
reader = csv.reader(f)
for row in reader:
data.append(row)
return data
# content is list of lists
def save_csv(content, f="output.csv"):
... | {
"repo_name": "mzoorob/LAPOP-Projects",
"path": "QMatrix/Ctry_Specific.py",
"copies": "1",
"size": "1217",
"license": "cc0-1.0",
"hash": -575153414700670100,
"line_mean": 26.3488372093,
"line_max": 81,
"alpha_frac": 0.5562859491,
"autogenerated": false,
"ratio": 3.2981029810298104,
"config_test... |
__author__ = 'zoorobmj'
import math
from sklearn import metrics
import numpy as np
import pandas as pd
from random import randint
def clustering(array):
pairs = []
for list in array:
print list
for distance in list:
current = None
if distance == 0:
... | {
"repo_name": "mzoorob/LAPOP-Projects",
"path": "LASSO_Help/clustering_pairwise.py",
"copies": "1",
"size": "4284",
"license": "cc0-1.0",
"hash": -1441443582527196200,
"line_mean": 29.9701492537,
"line_max": 76,
"alpha_frac": 0.4526143791,
"autogenerated": false,
"ratio": 3.652173913043478,
"co... |
__author__ = 'ZSGX'
from model.group import Group
import random
#def test_delete_first_group(app):
# if app.group.count() == 0 :
# app.group.create(Group(name = "test"))
# old_groups = app.group.get_group_list()
# app.group.delete_first_group()
# assert len(old_groups) - 1 == app.group.count()
# old_... | {
"repo_name": "tatyankaZSGX/addressbook",
"path": "tests/test_del_group.py",
"copies": "1",
"size": "1078",
"license": "apache-2.0",
"hash": -4887341181803350000,
"line_mean": 37.5357142857,
"line_max": 123,
"alpha_frac": 0.5853432282,
"autogenerated": false,
"ratio": 3.0977011494252875,
"confi... |
__author__ = 'ZSGX'
from model.group import Group
import random
#def test_edit_first_group(app, data_group):
# group = data_group
# if app.group.count() == 0:
# app.group.create(Group(name = "test"))
# old_groups = app.group.get_group_list()
# group.id = old_groups[0].id
# app.group.edit_first_gr... | {
"repo_name": "tatyankaZSGX/addressbook",
"path": "tests/test_edit_group.py",
"copies": "1",
"size": "1362",
"license": "apache-2.0",
"hash": -7666500542935645000,
"line_mean": 39.0882352941,
"line_max": 96,
"alpha_frac": 0.6336270191,
"autogenerated": false,
"ratio": 2.8375,
"config_test": fal... |
__author__ = 'ZSGX'
from sys import maxsize
class Contact:
def __init__(self, firstname=None, middlename=None, lastname=None, nickname=None, title=None, company=None,
address=None, homephone=None, mobilephone=None, workphone=None, fax=None, email=None, email2=None,
email3=None, h... | {
"repo_name": "tatyankaZSGX/addressbook",
"path": "model/contact.py",
"copies": "1",
"size": "1849",
"license": "apache-2.0",
"hash": -950265068460966700,
"line_mean": 36,
"line_max": 118,
"alpha_frac": 0.5916711736,
"autogenerated": false,
"ratio": 3.6686507936507935,
"config_test": false,
"... |
__author__ = 'ZSGX'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by_n... | {
"repo_name": "tatyankaZSGX/addressbook",
"path": "fixture/Session.py",
"copies": "1",
"size": "1374",
"license": "apache-2.0",
"hash": -1851228221366656500,
"line_mean": 29.5555555556,
"line_max": 73,
"alpha_frac": 0.5691411936,
"autogenerated": false,
"ratio": 3.3676470588235294,
"config_test... |
__author__ = 'ZSGX'
from model.contact import Contact
import random
#def test_edit_first_contact_from_homepage(app):
# if app.contact.count() == 0:
# app.contact.create(Contact(firstname="test"))
# contact = Contact(firstname="first", middlename="Jasd", lastname="homepage", nickname="Madsti",
# ... | {
"repo_name": "tatyankaZSGX/addressbook",
"path": "tests/test_edit_contact.py",
"copies": "1",
"size": "3465",
"license": "apache-2.0",
"hash": 4316803667294667300,
"line_mean": 46.4657534247,
"line_max": 102,
"alpha_frac": 0.6626262626,
"autogenerated": false,
"ratio": 3.118811881188119,
"conf... |
__author__ = 'ZSGX'
from model.contact import Contact
import re
def test_match_db_contact_with_homepage(app, db):
contacts_from_homepage = app.contact.get_contact_list()
contacts_from_db = [app.contact.clean(el) for el in db.get_contact_list()]
for contact in contacts_from_db:
contact.tel = merge_... | {
"repo_name": "tatyankaZSGX/addressbook",
"path": "tests/test_match_contact_prop.py",
"copies": "1",
"size": "1039",
"license": "apache-2.0",
"hash": -167867214688298080,
"line_mean": 42.3333333333,
"line_max": 138,
"alpha_frac": 0.6419634264,
"autogenerated": false,
"ratio": 3.395424836601307,
... |
__author__ = 'ZSGX'
from model.contact import Contact
class ContactHelper:
def __init__(self, app):
self.app = app
def fill_contact_form(self, Contact):
wd = self.app.wd
self.app.edit_field(field_name="firstname", text=Contact.firstname)
self.app.edit_field(field_name="middle... | {
"repo_name": "tatyankaZSGX/addressbook",
"path": "fixture/contact.py",
"copies": "1",
"size": "10250",
"license": "apache-2.0",
"hash": 4866496001320181000,
"line_mean": 46.0229357798,
"line_max": 117,
"alpha_frac": 0.6056585366,
"autogenerated": false,
"ratio": 3.410981697171381,
"config_test... |
__author__ = 'ZSGX'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not wd.current_url.endswith("/group.php")and len(wd.find_elements_by_name("new"))== 0:
wd.find_element_by_link_text... | {
"repo_name": "tatyankaZSGX/addressbook",
"path": "fixture/group.py",
"copies": "1",
"size": "3571",
"license": "apache-2.0",
"hash": 5379405351274963000,
"line_mean": 31.1711711712,
"line_max": 97,
"alpha_frac": 0.5844301316,
"autogenerated": false,
"ratio": 3.37204910292729,
"config_test": fa... |
__author__ = 'ZSGX'
import jsonpickle
import getopt
import sys
import os.path
import string
from model.contact import Contact
import random
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["groups_count","file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 1
f = "data\contact.j... | {
"repo_name": "tatyankaZSGX/addressbook",
"path": "generator/contact.py",
"copies": "1",
"size": "1642",
"license": "apache-2.0",
"hash": 1541777433329749800,
"line_mean": 36.3409090909,
"line_max": 117,
"alpha_frac": 0.6059683313,
"autogenerated": false,
"ratio": 3.435146443514644,
"config_tes... |
__author__ = 'ZSGX'
import mysql.connector
from model.group import Group
from model.contact import Contact
import re
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection... | {
"repo_name": "tatyankaZSGX/addressbook",
"path": "fixture/db.py",
"copies": "1",
"size": "1791",
"license": "apache-2.0",
"hash": -3320419998409600500,
"line_mean": 37.1063829787,
"line_max": 115,
"alpha_frac": 0.5745393635,
"autogenerated": false,
"ratio": 4.1362586605080836,
"config_test": f... |
__author__ = 'zthomae'
from BeautifulSoup import BeautifulStoneSoup
def read_text(annotated_text):
"""Turns a string representation of an XML tree into a list of tags with their LATs
"""
tags = []
text_tree = BeautifulStoneSoup(annotated_text)
for a in text_tree('a'):
tags.append({
... | {
"repo_name": "starsplatter/Ubiqu-Ity",
"path": "Ity/Tools/CompareDocuscope.py",
"copies": "2",
"size": "1968",
"license": "bsd-2-clause",
"hash": 6054701921094529000,
"line_mean": 26.7323943662,
"line_max": 93,
"alpha_frac": 0.5787601626,
"autogenerated": false,
"ratio": 3.307563025210084,
"co... |
__author__ = 'zthomae'
import argparse
from BeautifulSoup import BeautifulStoneSoup
import CompareDocuscope
import copy
from Ity.Tokenizers import RegexTokenizer
from Ity.Taggers import DocuscopeTagger
from Ity.Formatters import LATFormatter
import os.path
import pprint
import sys
def make_parser():
"""Construct... | {
"repo_name": "uwgraphics/Ubiqu-Ity",
"path": "Ity/Tools/TestResults.py",
"copies": "2",
"size": "6319",
"license": "bsd-2-clause",
"hash": 2401770362324978700,
"line_mean": 39.2484076433,
"line_max": 118,
"alpha_frac": 0.6539009337,
"autogenerated": false,
"ratio": 3.979219143576826,
"config_t... |
__author__ = 'zthomae'
import os
from Ity.Tokenizers import Tokenizer
from Ity.Formatters import Formatter
from jinja2 import Environment, FileSystemLoader
class LATFormatter(Formatter):
def __init__(
self,
debug=None,
template="text.html",
template_root=None
... | {
"repo_name": "uwgraphics/Ubiqu-Ity",
"path": "Ity/Formatters/LATFormatter/LATFormatter.py",
"copies": "2",
"size": "2448",
"license": "bsd-2-clause",
"hash": -2946583183993017300,
"line_mean": 37.265625,
"line_max": 107,
"alpha_frac": 0.6086601307,
"autogenerated": false,
"ratio": 4.184615384615... |
__author__ = 'zuojing'
import sys
import os
import shutil
'''
delete dirty dirs in path
make source code clean
'''
if __name__ == "__main__":
def findInPath(basePath, includeDir):
# list dir
dirs = os.listdir(basePath)
for dir in dirs:
path = os.path.join(basePath, dir)
... | {
"repo_name": "lichengwu/python_tools",
"path": "utils/cn/lichengwu/utils/utils/tool/SouceCodeClean.py",
"copies": "1",
"size": "1053",
"license": "apache-2.0",
"hash": -5696502552929075000,
"line_mean": 22.9318181818,
"line_max": 73,
"alpha_frac": 0.5052231719,
"autogenerated": false,
"ratio": 3... |
import cStringIO
import inspect
import itertools
import logging
import logging.config
import logging.handlers
import os
import stat
import sys
import traceback
from weibo.common import cfg
from weibo.common import local
from weibo.common import jsonutils
from weibo.common.gettextutils import _
CONF = cfg.CONF
# ou... | {
"repo_name": "windskyer/weibo",
"path": "weibo/common/log.py",
"copies": "1",
"size": "11339",
"license": "apache-2.0",
"hash": 4010549376338170000,
"line_mean": 32.1549707602,
"line_max": 78,
"alpha_frac": 0.5958197372,
"autogenerated": false,
"ratio": 4.0266335227272725,
"config_test": true,... |
__author__ = 'zwei'
import os, sys, time
# setup path
whoosh_path = os.path.join(os.path.dirname(__file__), 'whoosh/src')
sys.path.append(whoosh_path)
from whoosh.matching.mcore import ListMatcher
from whoosh.matching.binary import UnionMatcher
from whoosh.matching.wrappers import InverseMatcher
from whoosh.matching... | {
"repo_name": "wdv4758h/ZipPy",
"path": "edu.uci.python.benchmark/src/benchmarks/whoosh-bench.py",
"copies": "1",
"size": "1971",
"license": "bsd-3-clause",
"hash": -5668479191943803000,
"line_mean": 26.7605633803,
"line_max": 67,
"alpha_frac": 0.6189751395,
"autogenerated": false,
"ratio": 2.741... |
__author__ = 'zwei'
import sys, os, time
# setup path
path = os.path.join(os.path.dirname(__file__), 'pymaging')
sys.path.append(path)
from pymaging.shapes import Line
from pymaging.webcolors import Black, White, Yellow, SlateBlue
from pymaging.test_utils import image_factory
def create_canvas():
column = [Blac... | {
"repo_name": "wdv4758h/ZipPy",
"path": "edu.uci.python.benchmark/src/benchmarks/pymaging-bench.py",
"copies": "1",
"size": "1808",
"license": "bsd-3-clause",
"hash": -4796732544581029000,
"line_mean": 22.1923076923,
"line_max": 62,
"alpha_frac": 0.6272123894,
"autogenerated": false,
"ratio": 2.7... |
__author__ = 'zwei'
import sys, os, time
# setup path
path = os.path.join(os.path.dirname(__file__), 'sympy')
sys.path.append(path)
from sympy.unify.core import Compound, Variable, CondVariable, allcombinations
from sympy.unify import core
a, b, c = 'abc'
w, x, y, z = map(Variable, 'wxyz')
C = Compound
def is_ass... | {
"repo_name": "wdv4758h/ZipPy",
"path": "edu.uci.python.benchmark/src/benchmarks/sympy-bench.py",
"copies": "1",
"size": "1875",
"license": "bsd-3-clause",
"hash": -4436461253357451000,
"line_mean": 22.7341772152,
"line_max": 79,
"alpha_frac": 0.5114666667,
"autogenerated": false,
"ratio": 2.6041... |
__author__ = 'zwei'
import sys, os, time
# setup paths
python_graph_path = os.path.join(os.path.dirname(__file__), 'python-graph')
python_graph_core_path = os.path.join(python_graph_path, 'core')
sys.path.append(python_graph_path)
sys.path.append(python_graph_core_path)
import pygraph
from pygraph.algorithms.accessi... | {
"repo_name": "wdv4758h/ZipPy",
"path": "edu.uci.python.benchmark/src/benchmarks/python-graph-bench.py",
"copies": "1",
"size": "1292",
"license": "bsd-3-clause",
"hash": -2460230099138906000,
"line_mean": 23.8461538462,
"line_max": 75,
"alpha_frac": 0.6609907121,
"autogenerated": false,
"ratio":... |
__author__ = 'zz'
from email.feedparser import BufferedSubFile
import re
from itertools import zip_longest
sep = re.compile(r'(\r\n|\r|\n)')
def py3_splitlines(s):
split_group = sep.split(s)
return [g1 + g2 for g1, g2 in zip_longest(split_group[::2], split_group[1::2], fillvalue='')]
# monkey patch the pu... | {
"repo_name": "littlezz/fix-headers-parse",
"path": "fix_headers_parse/fix_splitlines.py",
"copies": "1",
"size": "1437",
"license": "mit",
"hash": 9157414366668209000,
"line_mean": 30.2391304348,
"line_max": 97,
"alpha_frac": 0.6437021573,
"autogenerated": false,
"ratio": 3.5925,
"config_test"... |
__author__ = 'zz'
from datetime import datetime
import getpass
from requests import get as _requests_get
from requests import post as _requests_post
from . import urls
import pickle
import os
from io import StringIO
from . import setting
from csv import reader
import re
import threading
from collections import deque
f... | {
"repo_name": "littlezz/pixiv_download",
"path": "old_version/Lib/models.py",
"copies": "1",
"size": "14993",
"license": "mit",
"hash": 732718909266167000,
"line_mean": 27.9882121807,
"line_max": 112,
"alpha_frac": 0.5758048119,
"autogenerated": false,
"ratio": 3.636923835346315,
"config_test":... |
__author__ = 'zz'
from functools import wraps
from requests import Timeout
import socket
from datetime import datetime
import logging
timeouts = (Timeout, socket.timeout)
def prefix_print(value):
def decorator(cls):
orig_method = cls.__getattribute__
def new_method(self, name):
if ... | {
"repo_name": "littlezz/HacfunSaiko",
"path": "lib/decorators.py",
"copies": "1",
"size": "2757",
"license": "mit",
"hash": -6914885898268795000,
"line_mean": 24.0727272727,
"line_max": 90,
"alpha_frac": 0.5063474791,
"autogenerated": false,
"ratio": 4.579734219269103,
"config_test": false,
"... |
__author__ = 'zz'
from threading import Lock
from random import choice as random_choice
from functools import wraps, partial
from shutil import get_terminal_size
import types
TERMINAL_WIDTH, _ = get_terminal_size()
def clear_output(func):
@wraps(func)
def wrapper(*args, **kwargs):
print(' ' * TERMI... | {
"repo_name": "littlezz/HacfunSaiko",
"path": "lib/prompt.py",
"copies": "1",
"size": "2911",
"license": "mit",
"hash": 7083396701988091000,
"line_mean": 21.375,
"line_max": 115,
"alpha_frac": 0.5545623836,
"autogenerated": false,
"ratio": 3,
"config_test": false,
"has_no_keywords": false,
... |
__author__ = 'zz'
from threading import Lock
from .setting import connect_fail_prompt_bound
from random import choice
from functools import wraps
from .decorators import threading_lock, prefix_print
from shutil import get_terminal_size
from contextlib import contextmanager
error_lock = Lock()
prompt_lock = Lock()
pro... | {
"repo_name": "littlezz/pixiv_download",
"path": "old_version/Lib/prompt.py",
"copies": "1",
"size": "6521",
"license": "mit",
"hash": -4168042197462950400,
"line_mean": 23.8181818182,
"line_max": 115,
"alpha_frac": 0.5638634471,
"autogenerated": false,
"ratio": 3.084232152028762,
"config_test"... |
__author__ = 'zz'
import json
from .. import widgets
from core import proxy
from tkinter import ttk
class LabelEntry(ttk.Frame):
_entry_class = widgets.Entry
def __init__(self, master, *args, **kwargs):
label_text = kwargs.pop('label_text')
super().__init__(master)
self.label = ttk.La... | {
"repo_name": "littlezz/IslandCollection",
"path": "gui/proxy/proxy_view.py",
"copies": "1",
"size": "1979",
"license": "mit",
"hash": -8897229015236794000,
"line_mean": 21.7471264368,
"line_max": 105,
"alpha_frac": 0.5654370894,
"autogenerated": false,
"ratio": 3.490299823633157,
"config_test"... |
__author__ = 'zz'
from bs4 import BeautifulSoup
from requests import get as _get
import re
from lib.decorators import retry_connect, sema_lock
import threading
from queue import Queue
from lib.prompt import Prompt
import logging
logging.basicConfig(level=logging.WARNING, format= ' %(message)s')
#####################... | {
"repo_name": "littlezz/HacfunSaiko",
"path": "old_version10-3/saiko.py",
"copies": "1",
"size": "3818",
"license": "mit",
"hash": -9095011231963707000,
"line_mean": 25.1958041958,
"line_max": 103,
"alpha_frac": 0.6073144688,
"autogenerated": false,
"ratio": 3.2802101576182134,
"config_test": f... |
__author__ = 'zz'
#win_version disable color output
from threading import Lock
from .setting import connect_fail_prompt_bound
from random import choice
from functools import wraps
from .decorators import threading_lock, prefix_print
from shutil import get_terminal_size
from contextlib import contextmanager
error_lo... | {
"repo_name": "littlezz/pixiv_download",
"path": "old_version/Lib/prompt_for_win.py",
"copies": "1",
"size": "6536",
"license": "mit",
"hash": 6563557287544069000,
"line_mean": 23.2931726908,
"line_max": 115,
"alpha_frac": 0.5681216931,
"autogenerated": false,
"ratio": 3.1223541559112027,
"conf... |
__authour__ = 'Clive Cox'
import sys
import zlib
import boto
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import glob
from shutil import copyfile
import os
import math
from filechunkio import FileChunkIO
import logging
import smart_open
logger = logging.getLogger(__name__)
class FileUtil:
... | {
"repo_name": "smrjan/seldon-server",
"path": "python/seldon/fileutil.py",
"copies": "3",
"size": "8716",
"license": "apache-2.0",
"hash": -2216148991194431700,
"line_mean": 31.7669172932,
"line_max": 101,
"alpha_frac": 0.5416475447,
"autogenerated": false,
"ratio": 3.8583444001770695,
"config_... |
"""Auth pipline functions for email authentication"""
import ulid
from social_core.backends.email import EmailAuth
from social_core.backends.saml import SAMLAuth
from social_core.exceptions import AuthException
from social_core.pipeline.partial import partial
from django.conf import settings
from django.db import trans... | {
"repo_name": "mitodl/open-discussions",
"path": "authentication/pipeline/user.py",
"copies": "1",
"size": "9871",
"license": "bsd-3-clause",
"hash": -4291879500842003500,
"line_mean": 32.8047945205,
"line_max": 103,
"alpha_frac": 0.6852395907,
"autogenerated": false,
"ratio": 4.191507430997877,
... |
"""Auth pipline functions for user authentication"""
import json
import logging
import requests
from social_core.backends.email import EmailAuth
from social_core.exceptions import AuthException
from social_core.pipeline.partial import partial
from django.conf import settings
from django.db import IntegrityError
from d... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "authentication/pipeline/user.py",
"copies": "1",
"size": "9606",
"license": "bsd-3-clause",
"hash": -5884796567600653000,
"line_mean": 32.9434628975,
"line_max": 106,
"alpha_frac": 0.678638351,
"autogenerated": false,
"ratio": 4.167462039045553,... |
"""Auth plugin using usernames & passwords in the DB, with HTTP basic auth.
Includes API calls for managing users.
"""
from haas import api, model, auth
from haas.model import db
from haas.auth import get_auth_backend
from haas.rest import rest_call, local, ContextLogger
from haas.errors import *
from passlib.hash imp... | {
"repo_name": "meng-sun/hil",
"path": "haas/ext/auth/database.py",
"copies": "4",
"size": "5295",
"license": "apache-2.0",
"hash": 5637365565148764000,
"line_mean": 31.4846625767,
"line_max": 79,
"alpha_frac": 0.6468366383,
"autogenerated": false,
"ratio": 3.930957683741648,
"config_test": fals... |
"""Auth plugin using usernames & passwords in the DB, with HTTP basic auth.
Includes API calls for managing users.
"""
from hil import api, model, auth, errors
from hil.model import db
from hil.auth import get_auth_backend
from hil.rest import rest_call, local, ContextLogger
from passlib.hash import sha512_crypt
from ... | {
"repo_name": "SahilTikale/haas",
"path": "hil/ext/auth/database.py",
"copies": "4",
"size": "6501",
"license": "apache-2.0",
"hash": -2820118454529366500,
"line_mean": 31.505,
"line_max": 79,
"alpha_frac": 0.6492847254,
"autogenerated": false,
"ratio": 3.8286219081272086,
"config_test": false,... |
"""Auth providers for Home Assistant."""
from __future__ import annotations
import importlib
import logging
import types
from typing import Any, Dict, List, Optional
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant import data_entry_flow, requirements
from homeassistant.cons... | {
"repo_name": "turbokongen/home-assistant",
"path": "homeassistant/auth/providers/__init__.py",
"copies": "2",
"size": "9638",
"license": "apache-2.0",
"hash": -4780199185166091000,
"line_mean": 32.2344827586,
"line_max": 88,
"alpha_frac": 0.618904337,
"autogenerated": false,
"ratio": 4.147160068... |
"""Auth providers for Home Assistant."""
import importlib
import logging
import types
from typing import Any, Dict, List, Optional
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant import data_entry_flow, requirements
from homeassistant.const import CONF_ID, CONF_NAME, CONF_TY... | {
"repo_name": "robbiet480/home-assistant",
"path": "homeassistant/auth/providers/__init__.py",
"copies": "6",
"size": "9138",
"license": "apache-2.0",
"hash": 7814341665901913000,
"line_mean": 32.3503649635,
"line_max": 88,
"alpha_frac": 0.6175311884,
"autogenerated": false,
"ratio": 4.1143628995... |
"""Auth provider that validates credentials via an external command."""
from __future__ import annotations
import asyncio.subprocess
import collections
from collections.abc import Mapping
import logging
import os
from typing import Any, cast
import voluptuous as vol
from homeassistant.const import CONF_COMMAND
from ... | {
"repo_name": "home-assistant/home-assistant",
"path": "homeassistant/auth/providers/command_line.py",
"copies": "2",
"size": "5355",
"license": "apache-2.0",
"hash": 4682374382963956000,
"line_mean": 33.5483870968,
"line_max": 99,
"alpha_frac": 0.5971988796,
"autogenerated": false,
"ratio": 4.48... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.