text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'wektor'
import os, sys
from servicebus.middleware.demon import MiddlewareDemon
esbpath = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
sys.path.append(esbpath)
from servicebus.conf import load_config_from_file
DATA = {
"admin":
{
"passwd": "pass",
... | {
"repo_name": "AYAtechnologies/Kasaya-esb",
"path": "kasaya/middleware/auth/demon.py",
"copies": "1",
"size": "1111",
"license": "bsd-2-clause",
"hash": 7642515318732924000,
"line_mean": 23.1739130435,
"line_max": 80,
"alpha_frac": 0.5544554455,
"autogenerated": false,
"ratio": 3.607142857142857,... |
__author__ = 'welcome vince'
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from PyQt4 import QtGui, QtCore
class MainWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
# ------------------------------------------------------
#initial window size
... | {
"repo_name": "gnarph/DIRT",
"path": "dirtgui/show_dialogue_window.py",
"copies": "1",
"size": "6048",
"license": "mit",
"hash": -6325041838002618000,
"line_mean": 29.5454545455,
"line_max": 80,
"alpha_frac": 0.5249669312,
"autogenerated": false,
"ratio": 3.8969072164948453,
"config_test": fals... |
__author__ = 'welcome vince'
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import string
from PyQt4 import QtGui, QtCore
class MainWindow(QtGui.QMainWindow):
"""
The main window GUI for DIRT.
Includes some shortcut keys
"""
def __init__(self):
QtGui.QMainWindow.__init__(self)
... | {
"repo_name": "gnarph/DIRT",
"path": "dirtgui/table_click.py",
"copies": "1",
"size": "7204",
"license": "mit",
"hash": 4678611510992895000,
"line_mean": 28.0483870968,
"line_max": 82,
"alpha_frac": 0.5498334259,
"autogenerated": false,
"ratio": 4.1236405266170575,
"config_test": false,
"has_... |
'''author: Wenchang Yang (yang.wenchang@uci.edu)'''
import xarray as xr
from sklearn.cluster import KMeans as KMeans_sklearn
import numpy as np
import matplotlib.pyplot as plt
class KMeans(KMeans_sklearn):
'''Inherit from sklearn.cluster.KMeans that accept xarray.DataArray data
to fit.'''
def __init__(se... | {
"repo_name": "wy2136/xlearn",
"path": "xlearn/cluster.py",
"copies": "1",
"size": "4444",
"license": "bsd-3-clause",
"hash": 2915213730275752400,
"line_mean": 37.9824561404,
"line_max": 103,
"alpha_frac": 0.5852835284,
"autogenerated": false,
"ratio": 3.7950469684030743,
"config_test": false,
... |
__author__ = 'wenju'
import json
from decimal import Decimal
from datetime import datetime
TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
class ArticleMeta:
def __init__(self):
self.oid = -1
self.title = ''
self.subtitle = ''
self.cover = ''
self.author = ''
se... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/cms/cms_model.py",
"copies": "1",
"size": "6483",
"license": "apache-2.0",
"hash": 8056659784152153000,
"line_mean": 20.7473684211,
"line_max": 115,
"alpha_frac": 0.4957581367,
"autogenerated": false,
"ratio": 3.9314736203759852,
"conf... |
__author__ = 'wenju'
import os,sys
import unittest
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
from cms import cms_service
from cms.cms_model import *
from cms import aliyun_oss_handler
cmsService = cms_service.cmsService
class CmsServi... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/test/test_cms_service.py",
"copies": "1",
"size": "7293",
"license": "apache-2.0",
"hash": 770817967976616000,
"line_mean": 27.172,
"line_max": 167,
"alpha_frac": 0.6033182504,
"autogenerated": false,
"ratio": 3.501200192030725,
"confi... |
__author__ = 'wenjusun'
import os
import shutil
from multiprocessing.pool import ThreadPool
from PIL import Image
import time
def get_current_time():
return int(round(time.time()*1000))
class PhotoSelector():
""" copy specified photo to destination"""
def __init__(self,src_folder,dest_folder):
se... | {
"repo_name": "swenker/studio",
"path": "shijing_img/tools/toolbox/photo_handler.py",
"copies": "1",
"size": "3619",
"license": "apache-2.0",
"hash": -6442702619445002000,
"line_mean": 30.1982758621,
"line_max": 83,
"alpha_frac": 0.6214423874,
"autogenerated": false,
"ratio": 3.360259981429898,
... |
__author__ = 'wenjusun'
from Crypto.Cipher import AES
import base64
SECURITY_SALT = 'ThisisAndPadding'
CHARSET_UTF8 = "UTF8"
AES_KEY = b"abcdefghijklmnop"
def encrypt(raw_msg, salt=SECURITY_SALT):
padding = salt
EncodeAES = lambda c, e: c.encrypt(e)
# AES key must be either 16, 24, or 32 bytes long
... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/cms/cms_utils.py",
"copies": "1",
"size": "1321",
"license": "apache-2.0",
"hash": 1354994023156686000,
"line_mean": 21.3898305085,
"line_max": 75,
"alpha_frac": 0.6601059803,
"autogenerated": false,
"ratio": 3.145238095238095,
"config... |
__author__ = 'wenjusun'
from Crypto.Cipher import AES
import base64
import urllib
import binascii
key="Droid eats Apple"
padding = "PKCS5Padding"
CHARSET_UTF8="UTF8"
originalStr = "1424999385611,0,https://sg-otaproxy-qa.blurdev.com:443/com-motorola-cds-otapackages-staging/delta-ota-Blur_Version.22.0.1100-22.0.116... | {
"repo_name": "swenker/studio",
"path": "python/test/msg_encrypt_decrypt.py",
"copies": "1",
"size": "3936",
"license": "apache-2.0",
"hash": 147981631963301060,
"line_mean": 40.8829787234,
"line_max": 733,
"alpha_frac": 0.8208841463,
"autogenerated": false,
"ratio": 2.0792393026941363,
"config... |
__author__ = 'wenjusun'
from Crypto.Cipher import AES
import base64
import urllib
import binascii
"""
reference : https://www.dlitz.net/software/pycrypto/api/current/
"""
padding = "ThisisPadding"
CHARSET_UTF8="UTF8"
key=b"abcdefghijklmnop"
originalUrl = "http://stackoverflow.com/questions/25694006/valueerror-in... | {
"repo_name": "swenker/studio",
"path": "python/test/msg_encrypt_decrypt2.py",
"copies": "1",
"size": "1343",
"license": "apache-2.0",
"hash": 8575305872461819000,
"line_mean": 20.6774193548,
"line_max": 139,
"alpha_frac": 0.7110945644,
"autogenerated": false,
"ratio": 3.1824644549763033,
"conf... |
__author__ = 'wenjusun'
from httplib import HTTPConnection
from httplib import HTTPSConnection
import threading
import time
import sys
def download(host,path):
common_httpreq(HTTPConnection(host),path)
def https_download(host,path):
common_httpreq(HTTPSConnection(host),path)
def common_httpreq(httpcon,p... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/test/test_http_request.py",
"copies": "1",
"size": "1698",
"license": "apache-2.0",
"hash": -6959406791295439000,
"line_mean": 20.4936708861,
"line_max": 83,
"alpha_frac": 0.5918727915,
"autogenerated": false,
"ratio": 3.437246963562753,... |
__author__ = 'wenjusun'
from httplib import HTTPConnection
from httplib import HTTPSConnection
import threading
import time
import sys
def download(host,path,n):
file_name = path.split('/')[-1] +'_' +str(n)
httpcon = HTTPConnection(host)
httpcon.connect()
httpcon.request('GET',path)
resp = htt... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/test/test_http_download.py",
"copies": "1",
"size": "3261",
"license": "apache-2.0",
"hash": -8309724002460940000,
"line_mean": 22.2928571429,
"line_max": 92,
"alpha_frac": 0.5685372585,
"autogenerated": false,
"ratio": 3.147683397683397... |
__author__ = 'wenjusun'
from httplib import *
import time
import json
import threading
def test_http():
httpcon = HTTPSConnection('motocare-sdc200cn.blurdev.com')
request = httpcon.request("GET",'/motocare-portal/web/application/#/home')
response = httpcon.getresponse()
print response.status,":",r... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/test/poc.py",
"copies": "1",
"size": "2155",
"license": "apache-2.0",
"hash": 3140037397568882700,
"line_mean": 20.55,
"line_max": 83,
"alpha_frac": 0.5763341067,
"autogenerated": false,
"ratio": 3.3830455259026686,
"config_test": true... |
__author__ = 'wenjusun'
import os
from PIL import Image,ImageFont,ImageDraw,ImageEnhance
import service_config
config = service_config.config
# def ori_add_watermark_original(in_file, text, out_file='watermark.jpg', angle=23, opacity=0.25):
# img = Image.open(in_file).convert('RGB')
# watermark = Image.new(... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/cms/image_processor.py",
"copies": "1",
"size": "4234",
"license": "apache-2.0",
"hash": -6333588412182575000,
"line_mean": 31.5692307692,
"line_max": 98,
"alpha_frac": 0.6263580538,
"autogenerated": false,
"ratio": 3.0416666666666665,
... |
__author__ = 'wenjusun'
import paramiko
import sys
from datetime import datetime
import time
#hosts=['amp02-p-e-mmi','amp03-p-e-mmi','amp04-p-e-mmi','amp05-p-e-mmi','amp06-p-e-mmi']
hosts=['amp02-p-e-mmi','amp03-p-e-mmi']
# hosts=['amp02-p-e-mmi']
username='wenjusun'
password='Motosunwj'
def yesterday_in_string():
... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/collect_cas_request.py",
"copies": "1",
"size": "5906",
"license": "apache-2.0",
"hash": 3730939710861036000,
"line_mean": 28.8333333333,
"line_max": 140,
"alpha_frac": 0.6239417541,
"autogenerated": false,
"ratio": 3.2220403709765413,
... |
__author__ = 'wenjusun'
import paramiko
import sys
from datetime import datetime
import time
hosts=['amp02-p-e-mmi','amp03-p-e-mmi','amp04-p-e-mmi','amp05-p-e-mmi','amp06-p-e-mmi']
# hosts=['amp02-p-e-mmi']
username='wenjusun'
password='Motosunwj'
def yesterday_in_string():
now_timestamp = int(round(time.time()... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/test/batch_collect_cas_request.py",
"copies": "1",
"size": "5801",
"license": "apache-2.0",
"hash": 2518565451749455400,
"line_mean": 28.9072164948,
"line_max": 140,
"alpha_frac": 0.6233408033,
"autogenerated": false,
"ratio": 3.24622271... |
__author__ = 'wenjusun'
import paramiko
import sys
hosts=['amp02-p-e-mmi','amp03-p-e-mmi','amp04-p-e-mmi','amp05-p-e-mmi','amp06-p-e-mmi']
# hosts=['amp02-p-e-mmi']
username='wenjusun'
password='Motosunwj'
def get_ssh_client(host,PORT):
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.Aut... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/check_cas_request.py",
"copies": "1",
"size": "4005",
"license": "apache-2.0",
"hash": 7885798285346483000,
"line_mean": 28.0217391304,
"line_max": 148,
"alpha_frac": 0.6119850187,
"autogenerated": false,
"ratio": 3.0433130699088147,
"... |
__author__ = 'wenjusun'
import sys
import httplib
#url_pattern = 'http://dspipeline.appspot.com/guide/passport?serialnumber=%s&since=%d'
host = "dspipeline.appspot.com"
url_pattern = "/guide/passport?serialnumber=%s&since=%d"
class GetCheckinData():
def __init__(self):
self.httpconn = httplib.HTTPConnect... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/moto_checkin_parser.py",
"copies": "1",
"size": "1710",
"license": "apache-2.0",
"hash": 2449430851387811000,
"line_mean": 27.5,
"line_max": 394,
"alpha_frac": 0.634502924,
"autogenerated": false,
"ratio": 3.064516129032258,
"config_te... |
__author__ = 'wenjusun'
import web
import sys
db = web.database(dbn='mysql',db='cas_statistics',host='localhost',user='motodbu',passwd='idm1512d')
EVENT_TYPES={'0':'login','1':'signup','2':'verify_email'}
class DataProcessor():
def __init__(self,dtstr):
self.dtstr = dtstr
"1159,159,19"
def parse... | {
"repo_name": "swenker/studio",
"path": "shijing_img/source/test/batch_handle_cas_statistics.py",
"copies": "1",
"size": "3175",
"license": "apache-2.0",
"hash": 5362427096019541000,
"line_mean": 28.9528301887,
"line_max": 123,
"alpha_frac": 0.5467716535,
"autogenerated": false,
"ratio": 3.628571... |
__author__ = 'Wenju Sun'
#logfile = "d:/u_ex140108.log"
#logfile = "d:/u_in140109.log"
"""date format:u_ex140109
hour: 0,1,10
result is csv
"""
DEBUG=True
#http://dl-3m.svc.mcitech.cn/items/58/160/6DEAA08641F8B313A14759F27730E7A4.zip
def loadUrlList():
urlList = []
furl = r'D:\work\allurl-2... | {
"repo_name": "swenker/studio",
"path": "python/cpp-ops/ops/parse_iislog.py",
"copies": "1",
"size": "3519",
"license": "apache-2.0",
"hash": 4345827875368627700,
"line_mean": 29.1592920354,
"line_max": 170,
"alpha_frac": 0.537084399,
"autogenerated": false,
"ratio": 3.270446096654275,
"config_... |
from numpy import *
import numpy as np
import matplotlib.pyplot as plt
def loadDataSet():
f = file('./R15.txt')
xArr = []
for l in f.readlines():
if len(l) < 3:
break
l = l.strip()
l = l.split('\t')
xLineArr = []
for i in [0,1]:
xLineArr.appe... | {
"repo_name": "Instant7/DIVFRP",
"path": "DIVFRP.py",
"copies": "1",
"size": "14853",
"license": "apache-2.0",
"hash": -1105428331307359000,
"line_mean": 32.9109589041,
"line_max": 101,
"alpha_frac": 0.6130074732,
"autogenerated": false,
"ratio": 3.3168825368468067,
"config_test": false,
"has... |
__author__ = 'Wenyu'
import urlparse
import logging
import time
from BaseHTTPServer import BaseHTTPRequestHandler
from fibonacci.utils.config import config
def _query_fib(n):
out = [0, 1]
if n < 2:
return out[:n]
for i in range(2, n):
next = out[-1] + out[-2]
out.append(next)
... | {
"repo_name": "WenyuChang/FibonacciServer",
"path": "fibonacci/handlers/basehttphandler.py",
"copies": "1",
"size": "2723",
"license": "apache-2.0",
"hash": -8761290081393018000,
"line_mean": 36.301369863,
"line_max": 130,
"alpha_frac": 0.5629820051,
"autogenerated": false,
"ratio": 4.06417910447... |
__author__ = 'WeoLee'
import random
size=49#the queens number
seq=[0 for x in range(size)]#the queen sequence
am=[[0 for x in range(size)] for y in range(size)]#queen map
bm=[[0 for x in range(size)] for y in range(size)]#queen conflicts value
def prt(n):#print the array
for x in range(size):
print(n[x])
... | {
"repo_name": "winxos/python",
"path": "nqueen_v1.py",
"copies": "1",
"size": "2153",
"license": "mit",
"hash": 666964063680898700,
"line_mean": 24,
"line_max": 72,
"alpha_frac": 0.5534117647,
"autogenerated": false,
"ratio": 2.810846560846561,
"config_test": false,
"has_no_keywords": false,
... |
__author__ = 'wesbornor'
from datetime import datetime
import hashlib
import tweepy
import simplejson
import creds, persister
def download():
auth = tweepy.OAuthHandler(creds.twitter["consumer_key"], creds.twitter["consumer_secret"])
auth.set_access_token(creds.twitter["access_token"], creds.twi... | {
"repo_name": "wbornor/splaysh-worker",
"path": "twitter.py",
"copies": "1",
"size": "2770",
"license": "apache-2.0",
"hash": -7593980814822041000,
"line_mean": 26.8541666667,
"line_max": 98,
"alpha_frac": 0.5592057762,
"autogenerated": false,
"ratio": 3.5695876288659796,
"config_test": false,
... |
__author__ = 'westonnovelli'
import requests
import json
import csv
"""
This script will grab some data from trello and save it as a csv file.
This script is set up to grab card data from a given board from only the open cards.
You can of course edit the request to get other information. For details visit
trello's ... | {
"repo_name": "westonnovelli/trello_to_csv",
"path": "trello_to_csv.py",
"copies": "1",
"size": "1372",
"license": "mit",
"hash": 879117031970403600,
"line_mean": 31.6666666667,
"line_max": 117,
"alpha_frac": 0.6610787172,
"autogenerated": false,
"ratio": 3.346341463414634,
"config_test": false... |
__author__ = 'wfg2af'
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA256
from Crypto import Random
class userMessages:
#Each user will have the public key of any other user.
UserMap = {}
UserName = ""
def __init__(self, UserName = "", UserMap = {}, key = None):
self.UserMap = UserM... | {
"repo_name": "wfg2af/cs3240-labdemo",
"path": "MessagePassing.py",
"copies": "1",
"size": "2813",
"license": "mit",
"hash": 752608724628881300,
"line_mean": 41.6212121212,
"line_max": 111,
"alpha_frac": 0.598649129,
"autogenerated": false,
"ratio": 3.7657295850066936,
"config_test": false,
"... |
__author__ = 'whited'
import task_model as model
TASK_FILE = '../../scenarios/simple_task.graphml'
PROCESSOR_FILE = '../../scenarios/simple_processors.graphml'
def solve(problem):
tasks = tasks_by_max_size(problem)
processors = processors_by_capacity(problem)
assignment = model.Assignment()
# First step... | {
"repo_name": "ipab-rad/task_alloc",
"path": "src/sim/task_greedy.py",
"copies": "1",
"size": "4677",
"license": "mit",
"hash": -388624856354678400,
"line_mean": 40.7589285714,
"line_max": 149,
"alpha_frac": 0.508659397,
"autogenerated": false,
"ratio": 4.59882005899705,
"config_test": false,
... |
__author__ = 'WhiteHaven'
from sys import argv
# take in dictionary file address
script, dictFileAddress = argv
targetWord = "donaldtrump" # subsitute for input() something
visited_letters = []
# create visitedLetters with as many list components as letters in targetWord
for letters in targetWord:
visited_let... | {
"repo_name": "whitehaven/AnagramBoa",
"path": "Boa.py",
"copies": "1",
"size": "3736",
"license": "mit",
"hash": 5705241363516606000,
"line_mean": 31.2068965517,
"line_max": 98,
"alpha_frac": 0.6528372591,
"autogenerated": false,
"ratio": 3.6484375,
"config_test": false,
"has_no_keywords": f... |
__author__ = 'wikia-gregor'
from subprocess import check_output
import re
def testing_regex():
dev_string = [
'iPhone 5 Mr G. (v7.1.2) (abcdefghijklmnopqrstuvwxyz1234567890123x)',
'iPad (wikia-gregor) (v8.0) (abcdefghijklmnopqrstuvwxyz1234567890123x)',
'Alistra\'s Apple 5S (v8.0) (abcdefg... | {
"repo_name": "wikia-gregor/device-wall",
"path": "dw/devices_manager/instruments.py",
"copies": "1",
"size": "2425",
"license": "mit",
"hash": -8751487912169806000,
"line_mean": 27.5411764706,
"line_max": 80,
"alpha_frac": 0.5525773196,
"autogenerated": false,
"ratio": 3.3727399165507648,
"con... |
__author__ = 'wiktorgworek@google.com (Wiktor Gworek)'
import wsgiref.handlers
import atom
import os
import cgi
import gdata.blogger.service
from oauth import OAuthDanceHandler, OAuthHandler, requiresOAuth
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
class MainHandler(OA... | {
"repo_name": "handspring/bite-project",
"path": "deps/gdata-python-client/samples/blogger/oauth-appengine/main.py",
"copies": "41",
"size": "1765",
"license": "apache-2.0",
"hash": 3369452756514410500,
"line_mean": 28.9152542373,
"line_max": 77,
"alpha_frac": 0.6640226629,
"autogenerated": false,
... |
__author__ = 'William_Chuang'
import sys
from PIL import Image
# define your flip function here
def getpixel(i,x,y):
width,height = i.size
pixel=i.load()
if x<0:
if y<0:
return pixel[0,0]
elif y>=height:
return pixel[0,height-1]
else:
return pixel[... | {
"repo_name": "wchuanghard/CS110-Python_Programming",
"path": "p2_part1/blur.py",
"copies": "1",
"size": "1571",
"license": "mit",
"hash": -4633950150100676000,
"line_mean": 23.9365079365,
"line_max": 65,
"alpha_frac": 0.493316359,
"autogenerated": false,
"ratio": 2.7854609929078014,
"config_te... |
__author__ = 'williamchuang'
import sys
print("Please use something like: $ python3 regression-in.py labdata.tet")
if len(sys.argv) != 2:
print("Incorrect command line arguments, please use something like:")
print("$ python3 regression-in.py labdata.tet")
sys.exit(1)
filename = sys.argv[1] # get the argumen... | {
"repo_name": "wchuanghard/CS110-Python_Programming",
"path": "regression-in.py",
"copies": "1",
"size": "1910",
"license": "mit",
"hash": -6470430324404925000,
"line_mean": 24.1315789474,
"line_max": 107,
"alpha_frac": 0.5837696335,
"autogenerated": false,
"ratio": 2.6713286713286712,
"config_... |
__author__ = 'williamchuang'
import sys
print("Please use something like: $ python3 regression-in.py labdata.txt")
if len(sys.argv) != 2:
print("Incorrect command line arguments, please use something like:")
print("$ python3 regression-in.py labdata.txt")
sys.exit(1)
filename = sys.argv[1] # get the argumen... | {
"repo_name": "wchuanghard/CS110-Python_Programming",
"path": "p2_part1/regression-in.py",
"copies": "1",
"size": "1880",
"license": "mit",
"hash": -61537176000241380,
"line_mean": 25.1111111111,
"line_max": 107,
"alpha_frac": 0.5835106383,
"autogenerated": false,
"ratio": 2.6704545454545454,
"... |
__author__ = 'williamchuang'
import turtle
import re
def setup(col, x, y, w, s, shape):
record.write("DOWN\n")
turtle.up()
turtle.goto(x,y)
turtle.width(w)
turtle.turtlesize(s)
turtle.color(col)
turtle.shape(shape)
turtle.down()
wn.onkey(up, "Up")
wn.onkey(left, "Left")
wn.... | {
"repo_name": "wchuanghard/CS110-Python_Programming",
"path": "lab7/move_turtle.py",
"copies": "1",
"size": "1180",
"license": "mit",
"hash": -1140535833870940400,
"line_mean": 17.4375,
"line_max": 44,
"alpha_frac": 0.5779661017,
"autogenerated": false,
"ratio": 2.554112554112554,
"config_test"... |
__author__ = 'William_Chuang'
from flask import Flask
from flask import request
import conversions
app = Flask(__name__)
app.debug=True
@app.route('/')
@app.route('/', methods=['POST'])
def hello_world():
html = ''
html += '<html>\n'
html += '<title>\n'
html += 'Hi\n'
html += '</title>'
####... | {
"repo_name": "wchuanghard/CS110-Python_Programming",
"path": "Project1/project1.py",
"copies": "1",
"size": "8008",
"license": "mit",
"hash": 4219250093198730000,
"line_mean": 30.8964143426,
"line_max": 166,
"alpha_frac": 0.5168623532,
"autogenerated": false,
"ratio": 3.161927330173776,
"confi... |
__author__ = 'William Coronado'
import xml.etree.ElementTree as ET
import yaml
filename = '../tests/data/Australian_Budget_2015-2016.xml'
tree = ET.parse(filename)
root = tree.getroot()
with open("./config/config.yml", 'r') as ymlfile:
cfg = yaml.load(ymlfile)
for section in cfg:
print(section)
iPath ... | {
"repo_name": "wcorona/changing-painting",
"path": "app/workbook_accessor.py",
"copies": "1",
"size": "1920",
"license": "apache-2.0",
"hash": 4603765775953079000,
"line_mean": 31,
"line_max": 191,
"alpha_frac": 0.703125,
"autogenerated": false,
"ratio": 3.374340949033392,
"config_test": false,... |
__author__= "William Ezekiel & Paul Council"
__date__ = " 22 November 2014"
__version__= "0.1"
#imports
import BEPCPlayer
import Message
def main():
"""
Test BEPCPlayer
"""
player = BEPCPlayer.BEPCPlayer()
match(player)
def match(player):
"""
Replicate a match of 5 rounds of RPS ga... | {
"repo_name": "ezekie97/RPSPlayer",
"path": "TestBEPCPlayer.py",
"copies": "2",
"size": "4343",
"license": "apache-2.0",
"hash": -7808574384986724000,
"line_mean": 25.9751552795,
"line_max": 91,
"alpha_frac": 0.5777112595,
"autogenerated": false,
"ratio": 3.4359177215189876,
"config_test": fals... |
__author__ = 'William Jagels'
__store_id__ = '19073'
__campus_id__ = '17548069'
__term_id__ = '64536529'
__servlet__ = 'http://american.bncollege.com/webapp/wcs/stores/servlet/'
__base_url__ = __servlet__ + 'TBWizardView?catalogId=10001&langId=-1&storeId=' + __store_id__
__api_base__ = __servlet__ + 'TextBookProcessD... | {
"repo_name": "wijagels/Textbooks",
"path": "Main.py",
"copies": "1",
"size": "5813",
"license": "mit",
"hash": -1369662862856719400,
"line_mean": 31.6629213483,
"line_max": 143,
"alpha_frac": 0.5625322553,
"autogenerated": false,
"ratio": 3.3855562026790915,
"config_test": false,
"has_no_key... |
__author__ = 'William'
import csv
import sys
import re
xmloutput = ""
root = ""
element = ""
attributes = []
opentag = '<'
closetag = '>'
def loadFile(filename):
file = open(filename)
try:
reader = csv.reader(file)
extractHeadings(reader)
finally:
file.close()
def extractHeading... | {
"repo_name": "wtarr/CSV_to_XML",
"path": "CSV_to_XML.py",
"copies": "1",
"size": "1384",
"license": "mit",
"hash": -7889918220182009000,
"line_mean": 22.4745762712,
"line_max": 110,
"alpha_frac": 0.598265896,
"autogenerated": false,
"ratio": 3.1743119266055047,
"config_test": false,
"has_no_... |
__author__ = 'William Rusnack github.com/BebeSparkelSparkel linkedin.com/in/williamrusnack williamrusnack@gmail.com'
import math
def to_precision(value, precision, notation='auto', filler='e'):
'''
converts a value to the specified notation and precision
value - any type that can be converted to a float
pred... | {
"repo_name": "Prooffreader/pyprooff",
"path": "pyprooff/to_precision.py",
"copies": "1",
"size": "5513",
"license": "mit",
"hash": -4153042669075600000,
"line_mean": 27.1275510204,
"line_max": 116,
"alpha_frac": 0.6689642663,
"autogenerated": false,
"ratio": 3.3011976047904192,
"config_test": ... |
import math
from Tkinter import *
color = "#555"
def get_c_point(x, y, radius, angle):
return [(math.cos(angle)*radius)+x, (math.sin(angle)*radius)+y]
class Circle:
def __init__(self, x, y, radius, fill):
self.x, self.y, self.radius, self.fill = x, y, radius, fill
self.index=ca.create_oval(self.x-self.radius, s... | {
"repo_name": "cptx032/miniprojects",
"path": "ring_motion.py",
"copies": "1",
"size": "1072",
"license": "unlicense",
"hash": -8310644337199684000,
"line_mean": 25.8,
"line_max": 91,
"alpha_frac": 0.6520522388,
"autogenerated": false,
"ratio": 2.3508771929824563,
"config_test": false,
"has_n... |
from Tkinter import *
import math
import random
'''
F = ma
'''
SCREEN_SIZE = [1360,768]
WINDOW_SIZE = [500,500]
TICKER = 30
CIRCLE = 'circle'
RECTANGLE = 'rectangle'
MODE = RECTANGLE # circle | rectangle
def centralize():
return '%dx%d+%d+%d' % (WINDOW_SIZE[0], WINDOW_SIZE[1],
(SCREEN_SIZE[0]/2)-(WINDOW_SIZE[0]/2... | {
"repo_name": "cptx032/miniprojects",
"path": "particles.py",
"copies": "1",
"size": "5222",
"license": "unlicense",
"hash": -5320415921258388000,
"line_mean": 25.11,
"line_max": 104,
"alpha_frac": 0.6426656453,
"autogenerated": false,
"ratio": 2.5190545103714426,
"config_test": false,
"has_n... |
WIDTH, HEIGHT = 320,240
from Tkinter import *
from random import randint
top = Tk()
top.configure(width=WIDTH, height=HEIGHT)
top.bind("<Escape>", lambda e:top.destroy(), "+")
ca = Canvas(top,bd=0,bg="white",highlightthickness=0,
width=WIDTH, height=HEIGHT)
ca.pack(expand=YES,fill=BOTH)
class Body:
def __init__(self,... | {
"repo_name": "cptx032/miniprojects",
"path": "polygon_game.py",
"copies": "1",
"size": "1735",
"license": "unlicense",
"hash": -4965709319378626000,
"line_mean": 23.4366197183,
"line_max": 96,
"alpha_frac": 0.6247838617,
"autogenerated": false,
"ratio": 2.383241758241758,
"config_test": false,... |
__author__ = 'williewonka'
__version__ = 1.0
from http.server import BaseHTTPRequestHandler, HTTPServer
from os.path import splitext, basename
import mimetypes
class httpRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
allowedtypes = [".html", ".css", ".js", ".json", ".svg", ".eot", ".ttf", ".wo... | {
"repo_name": "williewonka/kolibri-chat",
"path": "httpServer.py",
"copies": "1",
"size": "1857",
"license": "apache-2.0",
"hash": 3759386262366486000,
"line_mean": 31.5964912281,
"line_max": 94,
"alpha_frac": 0.5842757135,
"autogenerated": false,
"ratio": 3.86875,
"config_test": false,
"has_... |
__author__ = 'Williewonka'
__version__ = 1.2
import socket
import time
import sys
import queue
from PySide.QtGui import *
from PySide import QtCore
import LoginGui
import ChatGui
import json
# import ssl
from math import floor
import base64
from cryptography.fernet import Fernet
s = socket.socket(socket.AF_INET, sock... | {
"repo_name": "williewonka/kolibri-chat",
"path": "Client.py",
"copies": "1",
"size": "17175",
"license": "apache-2.0",
"hash": -6396416120804750000,
"line_mean": 37.1688888889,
"line_max": 141,
"alpha_frac": 0.5449781659,
"autogenerated": false,
"ratio": 4.105904852976333,
"config_test": false... |
__author__ = 'williewonka'
__version__ = 1.2
import socketserver
import argparse
import time
import threading
import sys
import hashlib
import uuid
import base64
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
from os.path import splitext, basename
import mimetypes
import re
import socket
# impo... | {
"repo_name": "williewonka/kolibri-chat",
"path": "Server.py",
"copies": "1",
"size": "42952",
"license": "apache-2.0",
"hash": 1691997313581151500,
"line_mean": 46.2010989011,
"line_max": 212,
"alpha_frac": 0.4489430061,
"autogenerated": false,
"ratio": 4.791076408254322,
"config_test": false,... |
__author__ = 'willr'
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# create a file handler
handler = logging.FileHandler('egauge_upgrade.log')
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter... | {
"repo_name": "SoftwareArtisan/smartmeter",
"path": "egauge/egauge_upgrade.py",
"copies": "1",
"size": "2362",
"license": "mit",
"hash": 9214992894105696000,
"line_mean": 31.8055555556,
"line_max": 129,
"alpha_frac": 0.6727349704,
"autogenerated": false,
"ratio": 3.9366666666666665,
"config_tes... |
__author__ = 'wilmer'
# This one corresponds to the AverageOpeningTime.pdf document (first model)
try:
import mkl
have_mkl = True
print("Running with MKL Acceleration")
except ImportError:
have_mkl = False
print("Running with normal backends")
import pickle
import time
import socket
import numpy as... | {
"repo_name": "wilmerhenao/Tomotherapy-Without-Pulse",
"path": "SinogramComparisons.py",
"copies": "1",
"size": "5247",
"license": "mit",
"hash": 943088095290886100,
"line_mean": 38.4586466165,
"line_max": 172,
"alpha_frac": 0.6720030494,
"autogenerated": false,
"ratio": 2.9627329192546585,
"co... |
__author__ = 'Wilson Canda (wilsonmaravilha@gmail.com)'
import os
import getpass
import click
from nexmomessage import NexmoMessage
class SMS(object):
CREDENTIALS = {
'nexmo': {
'api_key': os.environ['NEXMO_API_KEY'],
'api_secret': os.environ['NEXMO_API_SECRET']
}
}
# DEFAULTS {} holds the default value... | {
"repo_name": "wmv/cli-sms",
"path": "sms.py",
"copies": "1",
"size": "2130",
"license": "mit",
"hash": 1704660280620405800,
"line_mean": 25.9620253165,
"line_max": 102,
"alpha_frac": 0.6685446009,
"autogenerated": false,
"ratio": 3.0559540889526544,
"config_test": false,
"has_no_keywords": f... |
__author__ = "Wim Leers (work@wimleers.com)"
__version__ = "$Rev$"
__date__ = "$Date$"
__license__ = "GPL"
# Define exceptions.
class ProcessorError(Exception): pass
class InvalidCallbackError(ProcessorError): pass
class FileIOError(ProcessorError): pass
class RequestToRequeueException(ProcessorError): pass
class Doc... | {
"repo_name": "wimleers/fileconveyor",
"path": "fileconveyor/processors/processor.py",
"copies": "3",
"size": "8581",
"license": "unlicense",
"hash": 7156463003709916000,
"line_mean": 40.2548076923,
"line_max": 235,
"alpha_frac": 0.6253350425,
"autogenerated": false,
"ratio": 4.254338125929598,
... |
__author__ = "Wim Leers (work@wimleers.com)"
__version__ = "$Rev$"
__date__ = "$Date$"
__license__ = "GPL"
from processor import *
import os
import os.path
from cssutils import CSSParser
from cssutils.css import CSSStyleSheet
from cssutils import getUrls
from cssutils import replaceUrls
import logging
import sys
imp... | {
"repo_name": "edx/fileconveyor",
"path": "fileconveyor/processors/link_updater.py",
"copies": "3",
"size": "4994",
"license": "unlicense",
"hash": -2790835333565010400,
"line_mean": 36.2686567164,
"line_max": 146,
"alpha_frac": 0.6297557068,
"autogenerated": false,
"ratio": 4.161666666666667,
... |
__author__ = "Wim Leers (work@wimleers.com)"
__version__ = "$Rev$"
__date__ = "$Date$"
__license__ = "GPL"
from processor import *
import os
import os.path
import shutil
class YUICompressor(Processor):
"""compresses .css and .js files with YUI Compressor"""
valid_extensions = (".css", ".js")
def run... | {
"repo_name": "edx/fileconveyor",
"path": "fileconveyor/processors/yui_compressor.py",
"copies": "3",
"size": "1303",
"license": "unlicense",
"hash": 7406853759407523000,
"line_mean": 29.3023255814,
"line_max": 118,
"alpha_frac": 0.6277820414,
"autogenerated": false,
"ratio": 3.6807909604519775,
... |
__author__ = "Wim Leers (work@wimleers.com)"
__version__ = "$Rev$"
__date__ = "$Date$"
__license__ = "GPL"
from processor import *
import os.path
import shutil
import hashlib
class Base(Processor):
"""replaces one set of strings with another set"""
valid_extensions = () # Any extension is valid.
def... | {
"repo_name": "wimleers/fileconveyor",
"path": "fileconveyor/processors/filename.py",
"copies": "3",
"size": "2595",
"license": "unlicense",
"hash": 3779596612522117600,
"line_mean": 29.8928571429,
"line_max": 154,
"alpha_frac": 0.5402697495,
"autogenerated": false,
"ratio": 4.145367412140575,
... |
__author__ = "Wim Leers (work@wimleers.com)"
__version__ = "$Rev$"
__date__ = "$Date$"
__license__ = "GPL"
from processor import *
import stat
import shutil
import hashlib
class Mtime(Processor):
"""gives the file a unique filename based on its mtime"""
valid_extensions = () # Any extension is valid.
... | {
"repo_name": "wimleers/fileconveyor",
"path": "fileconveyor/processors/unique_filename.py",
"copies": "3",
"size": "2080",
"license": "unlicense",
"hash": 8705306226727415000,
"line_mean": 24.6790123457,
"line_max": 85,
"alpha_frac": 0.5995192308,
"autogenerated": false,
"ratio": 3.7410071942446... |
__author__ = 'winniehell'
import copy
class ActionWrapper:
def __init__(self, executor, action):
self._executor = executor
self._action = action
def execute(self, target):
self._action.execute(executor=self._executor, target=target)
def __repr__(self):
return repr(self._... | {
"repo_name": "winniehell-wasteland/python-rpg",
"path": "rpg/creatures/Creature.py",
"copies": "1",
"size": "1737",
"license": "mit",
"hash": 7717927610041996000,
"line_mean": 26.140625,
"line_max": 98,
"alpha_frac": 0.5002878526,
"autogenerated": false,
"ratio": 4.2995049504950495,
"config_te... |
__author__ = 'Winston'
import Tkinter as tk
'''
This thing is crap right now, but it's pretty fun to mess with. I want to try to turn it into an a* implementation, but at this point
It just draws a grid and fills in random cells with red, which will be the walls at some point.
'''
class Draw(object):
def __ini... | {
"repo_name": "alexwhb/algorithm-practice",
"path": "python/AStar/Draw.py",
"copies": "1",
"size": "1173",
"license": "mit",
"hash": 1356037460074205400,
"line_mean": 27.6341463415,
"line_max": 133,
"alpha_frac": 0.6010230179,
"autogenerated": false,
"ratio": 3.470414201183432,
"config_test": f... |
__author__ = 'wintere'
import abc
from Ity import BaseClass
import string
import csv
import codecs
import os
import pandas as pd
def end_reason(token):
if token[0].isalpha():
return 'c'
elif (token[0] == u'\n') or (token[0] == '\n'):
i = 0
r = ''
while i < (len(token)):
... | {
"repo_name": "uwgraphics/Ubiqu-Ity",
"path": "Ity/Tools/TokenTransform.py",
"copies": "1",
"size": "3132",
"license": "bsd-2-clause",
"hash": -6751158706542434000,
"line_mean": 30.9693877551,
"line_max": 93,
"alpha_frac": 0.5233077905,
"autogenerated": false,
"ratio": 3.5631399317406145,
"conf... |
__author__ = 'wintere'
import sys
import csv
import os
import urllib2
import argparse
import shutil
import re
#modified from ubiq+ity arg parser
parser = argparse.ArgumentParser(description='TCP file distribution')
parser.add_argument('input_path', help='path to corpus to copy relative to the location of this scr... | {
"repo_name": "uwgraphics/Ubiqu-Ity",
"path": "Ubiqu/tcp_file_distribution.py",
"copies": "1",
"size": "2281",
"license": "bsd-2-clause",
"hash": -7947134984689542000,
"line_mean": 31.5857142857,
"line_max": 146,
"alpha_frac": 0.6633055677,
"autogenerated": false,
"ratio": 3.267908309455587,
"c... |
__author__ = 'winxos'
import random
import time
size=100#the queens number
maxstep=100
seq=[0 for x in range(size)]#the queen sequence
seqc=[0 for x in range(size)]
am=[[0 for x in range(size)] for y in range(size)]#queen map
bm=[[0 for x in range(size)] for y in range(size)]#queen conflicts value
def init():
for ... | {
"repo_name": "winxos/python",
"path": "nqueen_v2.py",
"copies": "1",
"size": "1958",
"license": "mit",
"hash": 7036440784083885000,
"line_mean": 23.475,
"line_max": 72,
"alpha_frac": 0.564351379,
"autogenerated": false,
"ratio": 2.7346368715083798,
"config_test": false,
"has_no_keywords": fa... |
__author__ = 'winxos'
import random
import time
size=8#the queens number
maxstep=100
seq=[0 for x in range(size)]#the queen sequence
seqc=[0 for x in range(size)]
am=[[0 for x in range(size)] for y in range(size)]#queen map
bm=[[0 for x in range(size)] for y in range(size)]#queen conflicts value
def init():
for x ... | {
"repo_name": "winxos/python",
"path": "nqueen_v3.py",
"copies": "1",
"size": "2045",
"license": "mit",
"hash": -8763589936749017000,
"line_mean": 23.3452380952,
"line_max": 72,
"alpha_frac": 0.5589242054,
"autogenerated": false,
"ratio": 2.7823129251700682,
"config_test": false,
"has_no_keyw... |
__author__ = 'wittawat'
from abc import ABCMeta, abstractmethod
import math
import matplotlib.pyplot as plt
import numpy as np
import fsic.util as util
import matplotlib.pyplot as plt
import scipy.stats as stats
class PairedData(object):
"""Class representing paired data for independence testing
properties:
... | {
"repo_name": "wittawatj/fsic-test",
"path": "fsic/data.py",
"copies": "1",
"size": "23442",
"license": "mit",
"hash": 7475880964993010000,
"line_mean": 28.7865311309,
"line_max": 111,
"alpha_frac": 0.5493131985,
"autogenerated": false,
"ratio": 3.320396600566572,
"config_test": false,
"has_n... |
__author__ = 'wittawat'
from abc import ABCMeta, abstractmethod
import math
#import matplotlib.pyplot as plt
import numpy as np
import util
import matplotlib.pyplot as plt
import scipy.stats as stats
class PairedData(object):
"""Class representing paired data for independence testing
properties:
X, Y: nu... | {
"repo_name": "Diviyan-Kalainathan/causal-humans",
"path": "Cause-effect/lib/fsic/data.py",
"copies": "2",
"size": "23430",
"license": "mit",
"hash": 8809247436322572000,
"line_mean": 28.7712833545,
"line_max": 111,
"alpha_frac": 0.5491677337,
"autogenerated": false,
"ratio": 3.320578231292517,
... |
__author__ = 'wittr'
import math
def DistMidLatLong(FoLat, FoLong, ToLat, ToLong):
R = 6371000 # metres
rFoLat = math.radians(FoLat)
rToLat = math.radians(ToLat)
dLat = math.radians(ToLat-FoLat)
dLong = math.radians(ToLong-FoLong)
a = math.sin(dLat/2) * math.sin(dLat/2) + math.cos(rFoLat) *... | {
"repo_name": "wittrup/crap",
"path": "python/processfile.py",
"copies": "1",
"size": "2653",
"license": "mit",
"hash": -7405743951759074000,
"line_mean": 26.9263157895,
"line_max": 121,
"alpha_frac": 0.6008292499,
"autogenerated": false,
"ratio": 3.028538812785388,
"config_test": false,
"has... |
__author__ = 'wjm'
import numpy as np
import matplotlib.pyplot as plt
def financial_cartoon(Iterations=10, Multifractal=1, noise_type=False, noise_level=1.0, plot=False):
if Multifractal:
turns = ((0.25, 0.5), (0.75, 0.25))
else:
turns = ((0.4, 0.6), (0.6, 0.4))
first_turn, second_turn = ... | {
"repo_name": "buckie/wtmm-python",
"path": "wtmm/sample_data.py",
"copies": "1",
"size": "1965",
"license": "bsd-2-clause",
"hash": -6887971304450719000,
"line_mean": 30.7096774194,
"line_max": 100,
"alpha_frac": 0.4641221374,
"autogenerated": false,
"ratio": 3.009188361408882,
"config_test": ... |
__author__ = 'wkerr'
import datetime
import logging
from peewee import *
# First run:
# CREATE DATABASE steam_db;
# CREATE USER 'steam_user'@'localhost';
# GRANT ALL ON steam_db.* TO 'steam_user'@'localhost';
db = MySQLDatabase('steam_db', user='steam_user')
class BaseModel(Model):
class Meta:
database... | {
"repo_name": "wesleykerr/scrapy-games",
"path": "scrapy_games/models/models.py",
"copies": "1",
"size": "4045",
"license": "apache-2.0",
"hash": -8009883583570700000,
"line_mean": 30.8582677165,
"line_max": 88,
"alpha_frac": 0.6422744129,
"autogenerated": false,
"ratio": 3.254223652453741,
"co... |
__author__ = 'wlas'
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def change_field_value(self, field_name, text):
wd = self.app.wd
if text is not None:
wd.find_element_by_name(field_name).click()
wd.fi... | {
"repo_name": "wlansk/python_testing",
"path": "fixture/contact.py",
"copies": "1",
"size": "3156",
"license": "apache-2.0",
"hash": -7749552970342005000,
"line_mean": 39.987012987,
"line_max": 96,
"alpha_frac": 0.5934727503,
"autogenerated": false,
"ratio": 3.5183946488294313,
"config_test": f... |
__author__ = 'wlas'
import re
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[0]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0)
assert contact_from_home_page.all_phones_trom_home_page == merge_phones_like_on_home_page(contact_from_edit_pa... | {
"repo_name": "wlansk/python_testing",
"path": "test/test_phones.py",
"copies": "1",
"size": "1243",
"license": "apache-2.0",
"hash": 4628277329734561000,
"line_mean": 39.0967741935,
"line_max": 127,
"alpha_frac": 0.6661303298,
"autogenerated": false,
"ratio": 3.2796833773087073,
"config_test":... |
__author__ = 'wlas'
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_... | {
"repo_name": "wlansk/python_testing",
"path": "fixture/session.py",
"copies": "1",
"size": "1427",
"license": "apache-2.0",
"hash": 3172169963355202600,
"line_mean": 27.54,
"line_max": 73,
"alpha_frac": 0.5627189909,
"autogenerated": false,
"ratio": 3.365566037735849,
"config_test": false,
"... |
__author__ = "wmyers559"
import entity
import error
class Player(entity):
"""Basic player object. Takes initial health as a argument."""
def __init__(self, health):
self.location = "" # Not sure what this should be yet
self.health = health
self.inventory = {}
self.equiptment ... | {
"repo_name": "nealian/TextEngine",
"path": "player.py",
"copies": "1",
"size": "1092",
"license": "mit",
"hash": 6249129476253653000,
"line_mean": 23.8181818182,
"line_max": 91,
"alpha_frac": 0.5906593407,
"autogenerated": false,
"ratio": 4.059479553903346,
"config_test": false,
"has_no_keyw... |
__author__ = 'wnduan'
import string
def subStringMatchExact(target,key):
index = 0
res = ()
while index != -1:
index = string.find(target,key,index)
if index != -1:
res = res + (index,)
index += 1
return res
def constrainedMatchPair(firstMatch,secondMatch,lengt... | {
"repo_name": "wnduan/IntroToComSci",
"path": "ps3d.py",
"copies": "2",
"size": "1980",
"license": "mit",
"hash": -7666491309966701000,
"line_mean": 28.1323529412,
"line_max": 74,
"alpha_frac": 0.6383838384,
"autogenerated": false,
"ratio": 3.467600700525394,
"config_test": false,
"has_no_key... |
__author__ = 'wnduan'
def diop(n):
x,y,z = 6,9,20
res = []
for a in range(0,int(n/x)+1):
for b in range(0,int(n/y)+1):
for c in range(0,int(n/z)+1):
print a,b,c,a*x+b*y+c*z
if a*x+b*y+c*z == n:
res.append((a,b,c))
if len(res) == 0... | {
"repo_name": "StefanDuan/IntroToComSci",
"path": "ps2b.py",
"copies": "2",
"size": "1192",
"license": "mit",
"hash": 8555224327946223000,
"line_mean": 24.3829787234,
"line_max": 90,
"alpha_frac": 0.4446308725,
"autogenerated": false,
"ratio": 2.957816377171216,
"config_test": false,
"has_no_... |
__author__ = 'wnduan'
"""
MIT OPEN COURSEWARE
Lecture 6: Bisection methods, Newton/Raphson, introduction to lists
"""
def squareRootBi(x, epsilon):
"""
Assume x >= 0, and epsilon > 0, Calculates the square root of x
using bisection method
:param x: a number >= 0
:param epsilon: a number > 0, which... | {
"repo_name": "StefanDuan/IntroToComSci",
"path": "lecture_6.py",
"copies": "2",
"size": "2140",
"license": "mit",
"hash": 7428178060376282000,
"line_mean": 30.4852941176,
"line_max": 76,
"alpha_frac": 0.5948598131,
"autogenerated": false,
"ratio": 3.1703703703703705,
"config_test": false,
"h... |
__author__ = 'wnduan'
#
# Problem 1
#
def nestEggFixed(salary, save, growthRate, years):
"""
- salary: the amount of money you make each year.
- save: the percent of your salary to save in the investment account each
year (an integer between 0 and 100).
- growthRate: the annual percent increase ... | {
"repo_name": "wnduan/IntroToComSci",
"path": "ps4a.py",
"copies": "2",
"size": "5050",
"license": "mit",
"hash": 2868324535990529500,
"line_mean": 31.1719745223,
"line_max": 81,
"alpha_frac": 0.6481188119,
"autogenerated": false,
"ratio": 3.3201840894148584,
"config_test": true,
"has_no_keyw... |
__author__ = 'wnduan'
# Problem Set 1-a From: MIT OPEN COURSEWARE
# Write a program computes and prints 1000th prime number.
# 1. Initialize some state variables:
i = 1 # ith prime number, the program started from 2nd prime number 3.(the 1st one is 2)
n = 1 # generates odd integers
maxI = 1000 #
total_steps = 0
# ... | {
"repo_name": "StefanDuan/IntroToComSci",
"path": "ps1a.py",
"copies": "2",
"size": "1051",
"license": "mit",
"hash": -4733791503694964000,
"line_mean": 25.275,
"line_max": 89,
"alpha_frac": 0.595623216,
"autogenerated": false,
"ratio": 3.046376811594203,
"config_test": false,
"has_no_keyword... |
__author__ = 'wnduan'
# Problem Set 1-a From: MIT OPEN COURSEWARE
# Write a program computes and prints 1000th prime number.
import math
# 1. Initialize some state variables:
i = 1 # ith prime number, the program started from 2nd prime number 3.(the 1st one is 2)
n = 1 # generates odd integers
maxI = 1000 #
total_s... | {
"repo_name": "wnduan/IntroToComSci",
"path": "ps1a_2.py",
"copies": "2",
"size": "1081",
"license": "mit",
"hash": 6003330063554294000,
"line_mean": 25.3658536585,
"line_max": 89,
"alpha_frac": 0.5994449584,
"autogenerated": false,
"ratio": 3.0280112044817926,
"config_test": false,
"has_no_k... |
__author__ = 'wnduan'
# Problem Set 1-b From: MIT OPEN COURSEWARE
# Write a program computes and prints sum.
import math
# 1. Initialize some state variables:
i = 1 # ith prime number, the program started from 2nd prime number 3.(the 1st one is 2)
n = 1 # generates odd integers
N = 300 #
total_steps = 0
log_sum = m... | {
"repo_name": "wnduan/IntroToComSci",
"path": "ps1b.py",
"copies": "2",
"size": "1161",
"license": "mit",
"hash": -8857593856145611000,
"line_mean": 24.8,
"line_max": 89,
"alpha_frac": 0.5874246339,
"autogenerated": false,
"ratio": 2.9318181818181817,
"config_test": false,
"has_no_keywords": ... |
__author__ = 'wojciech'
from visualize import *
class Direction(object):
"""
Directions encoding is as follow:
4 fields (up right, down, left) each True or False depending on it's
ability to follow indicated direction.
"""
def __init__(self, up=False, right=False, down=False, left=False):
... | {
"repo_name": "WojciechFocus/MMVD",
"path": "mmvdApp/logic.py",
"copies": "1",
"size": "9032",
"license": "mit",
"hash": 1689953158224387600,
"line_mean": 27.9487179487,
"line_max": 79,
"alpha_frac": 0.5344331267,
"autogenerated": false,
"ratio": 3.698607698607699,
"config_test": false,
"has_... |
__author__ = 'wojciech'
#import math
import time
from Tkinter import *
class RobotVisualization:
"""
Visualization of magazine. Shows view of magazine from above.
"""
def __init__(self, width, height, delay=0.5):
"""
Initializes a visualization with the specified parameters.
... | {
"repo_name": "WojciechFocus/MMVD",
"path": "mmvdApp/visualize.py",
"copies": "1",
"size": "10321",
"license": "mit",
"hash": 8634843477171743000,
"line_mean": 37.0848708487,
"line_max": 78,
"alpha_frac": 0.4760197655,
"autogenerated": false,
"ratio": 3.5936629526462394,
"config_test": false,
... |
__author__ = 'wojtowpj'
from flask.ext.restful import fields, reqparse, abort
class IdUrlField(fields.Url):
def output(self, key, obj):
if obj is None or obj.key() is None:
return None
return super(IdUrlField, self).output(key, {'id': obj.key().id()})
class ReferenceUrlF... | {
"repo_name": "pwojt/beer_app_414",
"path": "db_helper.py",
"copies": "1",
"size": "1457",
"license": "apache-2.0",
"hash": 6191656739838514000,
"line_mean": 29,
"line_max": 97,
"alpha_frac": 0.5895676047,
"autogenerated": false,
"ratio": 3.764857881136951,
"config_test": false,
"has_no_keywo... |
__author__ = 'woong'
from argparse import ArgumentParser
import module_titleToImage
parser = ArgumentParser()
parser.add_argument("-f","--font",dest="fonttype",help="choose title's font type",default='/Library/Fonts/Hei.ttf')
parser.add_argument("-s","--size",dest="fontsize",help="choose title's font size",default=10... | {
"repo_name": "BD823/pcover",
"path": "Work/Work4/module_argparse.py",
"copies": "1",
"size": "1304",
"license": "mit",
"hash": 3553201742909376500,
"line_mean": 64.2,
"line_max": 158,
"alpha_frac": 0.7200920245,
"autogenerated": false,
"ratio": 3.196078431372549,
"config_test": false,
"has_n... |
__author__ = 'worker'
import traceback, os, sys
import url_manager, html_downloader, html_parser, html_outputer
class TumblrDownloader(object):
def __init__(self):
self.urls = url_manager.UrlManager()
self.downloader = html_downloader.HtmlDownloader()
self.parser = html_parser.Htm... | {
"repo_name": "etworker/TumblrDownloader",
"path": "spider_main.py",
"copies": "1",
"size": "2362",
"license": "mit",
"hash": -10914325911160054,
"line_mean": 30.8333333333,
"line_max": 84,
"alpha_frac": 0.5478408129,
"autogenerated": false,
"ratio": 3.75516693163752,
"config_test": false,
"h... |
__author__ = 'Work'
from helper import get_all_text, get_all_text_newline, get_all_text_tab
from parser import parse, parse_element, parse_string
img = {'src':'.//@src', 'alt':'.//@alt', 'title':'.//@title'}
a = {'href':'.//@href', 'target':'.//@target', 'text':'text()', 'all_text':{'.':lambda x: get_all_text(x).stri... | {
"repo_name": "garywu/exparse",
"path": "exparse/tags.py",
"copies": "1",
"size": "2241",
"license": "mit",
"hash": 1898391624411369200,
"line_mean": 26.6790123457,
"line_max": 115,
"alpha_frac": 0.5609103079,
"autogenerated": false,
"ratio": 3.178723404255319,
"config_test": false,
"has_no_k... |
__author__ = 'wperkins'
import os
import sys
import netCDF4 as ncf
import numpy as np
import tables as tb
from spharm import Spharmt, regrid
import pylim.DataTools as DT
import pylim.old.LIMTools as LT
from pylim import LIM
sys.path.append('/home/disk/p/wperkins/Research/LMR/')
def regrid_sphere(nlat,nlon,Nens,X):... | {
"repo_name": "frodre/pyLIM",
"path": "misc/truncation_resample_test.py",
"copies": "1",
"size": "3080",
"license": "mit",
"hash": 6411819231341904000,
"line_mean": 27.785046729,
"line_max": 98,
"alpha_frac": 0.6314935065,
"autogenerated": false,
"ratio": 2.892018779342723,
"config_test": false... |
__author__ = 'wperkins'
import tables as tb
import netCDF4 as nc4
import numpy as np
files = '/home/chaos2/wperkins/data/HadCRUT/HadCRUT.4.3.0.0.anomalies.{:d}.nc'
outfile = '/home/chaos2/wperkins/data/HadCRUT/HadCRUT.4.3.0.0.ens_avg_anom.h5'
num_members = 100
# Load initial data from a single ensemble member
f = n... | {
"repo_name": "frodre/pyLIM",
"path": "misc/HadCRUT_EnsAvg.py",
"copies": "1",
"size": "2416",
"license": "mit",
"hash": 6217013829430265000,
"line_mean": 33.5142857143,
"line_max": 91,
"alpha_frac": 0.5860927152,
"autogenerated": false,
"ratio": 2.910843373493976,
"config_test": false,
"has_... |
__author__ = 'wperkins'
import tables as tb
import numpy as np
import pytest
import os
from pylim import DataTools as Dt
from pylim.DataTools import BaseDataObject as BDO
from pylim.DataTools import Hdf5DataObject as HDO
@pytest.fixture(scope='module')
def tb_file(request):
tbf = tb.open_file('test.h5', 'w',
... | {
"repo_name": "frodre/pyLIM",
"path": "pylim/tests/test_datatools.py",
"copies": "1",
"size": "16024",
"license": "mit",
"hash": -1714029198605577700,
"line_mean": 31.5691056911,
"line_max": 81,
"alpha_frac": 0.593671992,
"autogenerated": false,
"ratio": 2.875807609475951,
"config_test": true,
... |
__author__ = 'wreichardt'
# Get a center latitude,longitude from an array of like geopoints
#
# @param array data 2 dimensional array of latitudes and longitudes
# For Example:
# $data = array
# (
# * 0 = > array(45.849382, 76.322333),
# * 1 = > array(45.843543, 75.324143),
# ... | {
"repo_name": "obiwan314/k9os",
"path": "scripts/center.py",
"copies": "1",
"size": "27202",
"license": "mit",
"hash": 5788849791755853000,
"line_mean": 15.3277310924,
"line_max": 73,
"alpha_frac": 0.3633188736,
"autogenerated": false,
"ratio": 2.6839664528860383,
"config_test": false,
"has_n... |
__author__ = 'wt0vremr'
import platform
import psutil
import subprocess
import os
from datetime import timedelta
import time
class ProcParser:
"""/proc data collector"""
def getcpuinfo(self):
temp = subprocess.check_output("cat /proc/cpuinfo | grep 'model name' -m 1", shell=True).split(': ')[1]
... | {
"repo_name": "wt0vremr/ploadmon",
"path": "engine.py",
"copies": "1",
"size": "5300",
"license": "mit",
"hash": -7699700172764094000,
"line_mean": 29.2857142857,
"line_max": 112,
"alpha_frac": 0.5679245283,
"autogenerated": false,
"ratio": 3.6551724137931036,
"config_test": false,
"has_no_ke... |
__author__ = 'wuxiaoyu'
from maya import OpenMayaUI as omui
import pymel.core as pm
from Qt.QtCore import *
from Qt.QtGui import *
from Qt.QtWidgets import *
try:
from shiboken import wrapInstance
except:
from shiboken2 import wrapInstance
import dynrigbuilderui
import splinerig
import scaffold
map(reload,[... | {
"repo_name": "raina-wu/DynRigBuilder",
"path": "dynrigbuilder/main.py",
"copies": "1",
"size": "7069",
"license": "mit",
"hash": 7597883938283380000,
"line_mean": 34.345,
"line_max": 121,
"alpha_frac": 0.6337530061,
"autogenerated": false,
"ratio": 3.6856100104275287,
"config_test": false,
"... |
__author__ = 'wuxiaoyu'
import pymel.core as pm
import maya.OpenMaya as om
import mayautils
map(reload, [mayautils])
def buildIKSystem(prefix, startPos, endPos, masterCtrlNum, ibtSubCtrlNum,
jointNum, metaCtrl=None, preserveVolume=True,
preserveLength=True, globalScalePlug=None):
... | {
"repo_name": "raina-wu/DynRigBuilder",
"path": "dynrigbuilder/rigutils.py",
"copies": "1",
"size": "50198",
"license": "mit",
"hash": -1449388991424116000,
"line_mean": 46.5819905213,
"line_max": 149,
"alpha_frac": 0.6138292362,
"autogenerated": false,
"ratio": 3.057497868193446,
"config_test"... |
__author__ = 'wuxiaoyu'
import pymel.core as pm
import mayautils
import rigutils
import scaffold
map(reload, [mayautils, scaffold, rigutils])
class SplineRig(object):
scaffoldType = "spline"
scaffoldChain = {"start":[0,15,0], "end":[0,0,0]}
rigAttrs = [
{"ln":"jointNum", "at": "long", "dv":20, "... | {
"repo_name": "raina-wu/DynRigBuilder",
"path": "dynrigbuilder/splinerig.py",
"copies": "1",
"size": "7390",
"license": "mit",
"hash": -2072965822567044600,
"line_mean": 39.8342541436,
"line_max": 122,
"alpha_frac": 0.5815967524,
"autogenerated": false,
"ratio": 3.3273300315173344,
"config_test... |
__author__ = 'wuxiaoyu'
import pymel.core as pm
import mayautils
map(reload, [mayautils])
SCAFFOLD_TOP_TAG = "scaffoldTop"
SCAFFOLD_META_PIV_TAG = "metaPiv"
SCAFFOLD_LOC_COLOR = 13
SCAFFOLD_END_LOC_COLOR = 6
SCAFFOLD_PIV_COLOR = 17
def buildScaffoldChain(prefix, scaffoldChainDict):
"""
Build a basic scaffo... | {
"repo_name": "raina-wu/DynRigBuilder",
"path": "dynrigbuilder/scaffold.py",
"copies": "1",
"size": "6114",
"license": "mit",
"hash": -814018616758718000,
"line_mean": 40.5986394558,
"line_max": 211,
"alpha_frac": 0.6635590448,
"autogenerated": false,
"ratio": 3.049376558603491,
"config_test": ... |
__author__ = 'wuxiaoyu'
import pymel.core as pm
def addAttributes(target, attrList):
"""
Add attributes to target.
:param target: `PyNode` target node
:param attrList: `list` list of dictionaries defining attribute properties
[{ "ln": `string` - name of the attribtue,
... | {
"repo_name": "raina-wu/DynRigBuilder",
"path": "dynrigbuilder/mayautils.py",
"copies": "1",
"size": "10409",
"license": "mit",
"hash": -8369980324543501000,
"line_mean": 39.5019455253,
"line_max": 97,
"alpha_frac": 0.4904409645,
"autogenerated": false,
"ratio": 3.0005765350245026,
"config_test... |
__author__ = 'www.yoelsher.com'
# Grab all data from xml
#import xml.etree.ElementTree as etree
from lxml import etree
import csv,re
inputFileName = 'funk120415.xml'
outputFileName = 'funk120415.txt'
dbFileName = 'funkierb_1C.csv'
brand = 'Funkier Bike'
sellerName = 'Funkier Bike USA'
websiteURL = 'https://www.funkie... | {
"repo_name": "yoelsher/Woo2Feed",
"path": "Woo2Bing.py",
"copies": "1",
"size": "3663",
"license": "mit",
"hash": -7120164629018400000,
"line_mean": 28.5483870968,
"line_max": 88,
"alpha_frac": 0.5782145782,
"autogenerated": false,
"ratio": 3.6962663975782037,
"config_test": false,
"has_no_k... |
import os
import sys
import time
def remove_old_md5sum():
for r, d, f in os.walk(input_path):
for f_ in f:
if f_.endswith('.txt'):
os.remove(os.path.join(r, f_))
def create_new_md5sum():
for r, d, f in os.walk(input_path):
for f_ in f:
val = os.popen('... | {
"repo_name": "wyblzu/Python_GDAL",
"path": "create_md5sum.py",
"copies": "1",
"size": "1036",
"license": "mit",
"hash": -8057166582373775000,
"line_mean": 26.2631578947,
"line_max": 121,
"alpha_frac": 0.5135135135,
"autogenerated": false,
"ratio": 2.9101123595505616,
"config_test": false,
"h... |
__author__ = 'wyb'
# coding:utf-8
import xlrd
import xlwt
import requests
import urllib
import math
import re
pattern_x = re.compile(r'"x":(".+?")')
pattern_y = re.compile(r'"y":(".+?")')
def mercator2wgs84(mercator):
# key1=mercator.keys()[0]
# key2=mercator.keys()[1]
point_x = mercator[0]
point_y... | {
"repo_name": "wyblzu/Python_GDAL",
"path": "get_point_zuobiao.py",
"copies": "1",
"size": "2004",
"license": "mit",
"hash": 3620676580653688300,
"line_mean": 22.5714285714,
"line_max": 70,
"alpha_frac": 0.5393939394,
"autogenerated": false,
"ratio": 2.869565217391304,
"config_test": false,
"... |
__author__ = 'wyb'
# -*- coding:utf-8 -*-
# testing gdal-lib
import gdal
import numpy
import struct
from gdalconst import *
dataset = gdal.Open('/home/wyb/data/SPOT.img', GA_ReadOnly)
if dataset is None:
print 'Nodata'
else:
print 'Driver:', dataset.GetDriver().ShortName, '/', \
dataset.GetDriver().Long... | {
"repo_name": "wyblzu/Python_GDAL",
"path": "Read_xls.py",
"copies": "1",
"size": "2680",
"license": "mit",
"hash": -4655193405972080000,
"line_mean": 33.358974359,
"line_max": 98,
"alpha_frac": 0.6429104478,
"autogenerated": false,
"ratio": 2.8972972972972975,
"config_test": false,
"has_no_k... |
__author__ = 'wyeung'
from django import forms
from django.forms.extras.widgets import SelectDateWidget
from django.core.exceptions import ValidationError
from widgets import SelectTimeWidget
import datetime
from django.contrib.auth.models import User
from django.db.models import Q
from juakstore.models import Booking,... | {
"repo_name": "CSC301H-Fall2013/JuakStore",
"path": "Storefront/juakstore/forms.py",
"copies": "1",
"size": "4061",
"license": "mit",
"hash": 3610373670011807000,
"line_mean": 38.8137254902,
"line_max": 128,
"alpha_frac": 0.6702782566,
"autogenerated": false,
"ratio": 4.097880928355197,
"config... |
__author__ = 'wy'
from prody import *
import os
import csv
from vector_gen import pdb_container,fake_pdb_container
import time
from functools import wraps
import logging
from Config import *
import urllib
from mapping import repair_pdbfile
'''
The main program to extract molecules in .sdf files and compare with ligan... | {
"repo_name": "Reimilia/pdb_sth",
"path": "fileparser.py",
"copies": "1",
"size": "10338",
"license": "mit",
"hash": 2824916318167011000,
"line_mean": 32.1346153846,
"line_max": 123,
"alpha_frac": 0.582704585,
"autogenerated": false,
"ratio": 3.915909090909091,
"config_test": false,
"has_no_k... |
__author__= 'wy'
import prody as pd
import numpy as np
import os,re
import logging
from mapping import *
from native_contact import native_contact
import collections
from Config import result_PREFIX
'''
Core part for generating vectors and split source pdb files with
With the help of prody library.
Need installation ... | {
"repo_name": "Reimilia/pdb_sth",
"path": "vector_gen.py",
"copies": "1",
"size": "37050",
"license": "mit",
"hash": -951692232603034200,
"line_mean": 38.3312101911,
"line_max": 148,
"alpha_frac": 0.5097975709,
"autogenerated": false,
"ratio": 3.800779647107099,
"config_test": false,
"has_no_... |
import xml.etree.ElementTree as etree
import sqlite3
class DatabaseMapper:
# Ingest the Research Domain / Research Target mapping table
# Class enables easy mapping between the identifiers and the free text names
def __init__(self, file_location):
self.file = file_location
self.db = sqlite... | {
"repo_name": "DTL-FAIRData/ODEX4all-UseCases",
"path": "EKP/DatabaseMapper.py",
"copies": "1",
"size": "1633",
"license": "mit",
"hash": 1446315566145401900,
"line_mean": 34.5,
"line_max": 110,
"alpha_frac": 0.6037966932,
"autogenerated": false,
"ratio": 3.7800925925925926,
"config_test": fals... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.