text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Jwely'
import os
import numpy as np
import matplotlib.pyplot as plt
from py.piv.VecFieldCartesian import VecFieldCartesian
from py.utils import Timer, masked_rms, masked_mean, get_spatial_derivative
from py.config import *
class MeanVecFieldCartesian:
def __init__(self, name_tag=None, v3d_paths=N... | {
"repo_name": "Jwely/pivpr",
"path": "py/piv/MeanVecFieldCartesian.py",
"copies": "1",
"size": "12843",
"license": "mit",
"hash": -7198700448532607000,
"line_mean": 41.9531772575,
"line_max": 116,
"alpha_frac": 0.5371019232,
"autogenerated": false,
"ratio": 3.6968911917098444,
"config_test": fa... |
__author__ = 'Jwely'
import os
import pandas as pd
from py.uncertainty import ArtificialVecField
from py.tex import TeXWriter, csv_to_tex
from py.config import *
def calculate_uncertainty(name, n_measurements=200):
"""
Finds the files in the artificial_images folder of the uncertainty package and calculates
... | {
"repo_name": "Jwely/pivpr",
"path": "py/controler/analyze_piv_uncertainty.py",
"copies": "1",
"size": "7831",
"license": "mit",
"hash": 5843070501075652000,
"line_mean": 40.6542553191,
"line_max": 107,
"alpha_frac": 0.4884433661,
"autogenerated": false,
"ratio": 3.413687881429817,
"config_test... |
__author__ = 'Jwely'
import os
class TeXFigureGenerator():
def __init__(self, main_path, figure_filepath, caption, width):
"""
Creates a list of Tex formatted strings to display the input relative filepath as
a figure. Can call method `get_tex` to retrieve the list of strings, which can... | {
"repo_name": "Jwely/pivpr",
"path": "py/tex/TeXFigureGenerator.py",
"copies": "1",
"size": "3416",
"license": "mit",
"hash": 8138019868561960000,
"line_mean": 38.2643678161,
"line_max": 104,
"alpha_frac": 0.600117096,
"autogenerated": false,
"ratio": 4.4363636363636365,
"config_test": false,
... |
__author__ = ["jwely"]
import os
class text_data():
"""
a text data object is a very simple template structure for passing
text type data (usually lists of obsgrid or climate data entries)
between other functions in dnppy
"""
def __init__(self, headers=None, row_data=None, text_filepath=None... | {
"repo_name": "dgketchum/MT_Rsense",
"path": "metric/textio/text_data.py",
"copies": "1",
"size": "2881",
"license": "apache-2.0",
"hash": -7829686376935076000,
"line_mean": 29.0104166667,
"line_max": 84,
"alpha_frac": 0.5421728566,
"autogenerated": false,
"ratio": 4.046348314606742,
"config_te... |
__author__ = 'Jwely'
import pandas as pd
import os
from py.piv.Experiment import Experiment
from py.config import *
from construct_axial_vortex import construct_axial_vortex
def construct_experiments(experiment_table_path, experiment_directory_path, ids=None,
min_points=20, include_dynamic=... | {
"repo_name": "Jwely/pivpr",
"path": "py/piv/construct_experiments.py",
"copies": "1",
"size": "3486",
"license": "mit",
"hash": 8817762162065285000,
"line_mean": 45.48,
"line_max": 118,
"alpha_frac": 0.5361445783,
"autogenerated": false,
"ratio": 4.492268041237113,
"config_test": false,
"has... |
__author__ = 'Jwely'
import pandas as pd
import os
def csv_to_tex(csv_path, caption, justification=None, horizontal_line_rows=None):
"""
Quick custom function to write Tex format tables from csv's, with just the most
critical customization inputs.
:param csv_path: filepath to csv to convert
:par... | {
"repo_name": "Jwely/pivpr",
"path": "py/tex/csv_to_tex.py",
"copies": "1",
"size": "2652",
"license": "mit",
"hash": 3118536282985284000,
"line_mean": 34.8378378378,
"line_max": 102,
"alpha_frac": 0.5773001508,
"autogenerated": false,
"ratio": 3.9464285714285716,
"config_test": false,
"has_n... |
__author__ = 'Jwely'
def _character_to_symbol(character):
""" converts a single character to the mathematic symbol, does not apply all tex formatting """
if character == "T":
return r"v_{\theta}"
elif character == "W":
return r"v_{z}"
elif character == "R":
return r"v_{r}"
... | {
"repo_name": "Jwely/pivpr",
"path": "py/piv/shorthand_to_tex.py",
"copies": "1",
"size": "3187",
"license": "mit",
"hash": -8614574467115286000,
"line_mean": 30.87,
"line_max": 108,
"alpha_frac": 0.5669909005,
"autogenerated": false,
"ratio": 3.7538280329799765,
"config_test": false,
"has_no... |
__author__ = 'jwjiang'
import cookielib
import urllib, urllib2
import sys
import re
class WebLogin(object):
dmca_pattern = '<h1 style="text-align:center">(This download is no longer available)</h1>'
def __init__(self, username, password, list=None):
# login credentials
self.username = userna... | {
"repo_name": "jwjiang/radiosu",
"path": "python/login.py",
"copies": "1",
"size": "2722",
"license": "mit",
"hash": -6649622442529972000,
"line_mean": 27.0618556701,
"line_max": 94,
"alpha_frac": 0.5789860397,
"autogenerated": false,
"ratio": 3.950653120464441,
"config_test": false,
"has_no_... |
__author__ = 'jwjiang'
import login
import updates
import info
import sys
import os
import glob
import shutil
def main():
base_url = "https://osu.ppy.sh/d/"
link_list = updates.getupdates()
if count is None:
meta_list = info.getinfo(link_list)
else:
meta_list = info.getinfo(link_list... | {
"repo_name": "jwjiang/radiosu",
"path": "python/controller.py",
"copies": "1",
"size": "3306",
"license": "mit",
"hash": 2448100004537927700,
"line_mean": 30.4952380952,
"line_max": 96,
"alpha_frac": 0.5825771325,
"autogenerated": false,
"ratio": 3.306,
"config_test": false,
"has_no_keywords... |
__author__ = 'jwjiang'
import urllib2
import re
import HTMLParser
import eyed3
import eyed3.mp3
import eyed3.id3
import threading
from multiprocessing import Lock
import time
import Queue
import sys
from bs4 import BeautifulSoup
import requests
import grequests
start_time = 0
global_counter = 0
total_dl_time = 0
bas... | {
"repo_name": "jwjiang/radiosu",
"path": "python/info.py",
"copies": "1",
"size": "6831",
"license": "mit",
"hash": 8431360007074790000,
"line_mean": 31.3791469194,
"line_max": 117,
"alpha_frac": 0.6186502708,
"autogenerated": false,
"ratio": 3.4657534246575343,
"config_test": false,
"has_no_... |
__author__ = 'jwjiang'
import urllib2
import re
def getupdates():
lastfile = open("last", "w+")
last = lastfile.read()
if last == "":
return open("list").readlines()
return firstrun(lastfile)
def firstrun(lastfile):
page_num = 1
baseurl = "https://osu.ppy.sh/p/beatmaplist&s=4&r=0... | {
"repo_name": "jwjiang/radiosu",
"path": "python/updates.py",
"copies": "1",
"size": "1300",
"license": "mit",
"hash": -4010605403475293700,
"line_mean": 23.5471698113,
"line_max": 67,
"alpha_frac": 0.5676923077,
"autogenerated": false,
"ratio": 3.4120734908136483,
"config_test": false,
"has_... |
__author__ = 'jyothi'
from gevent import monkey
monkey.patch_all()
import os, sys, time
from gevent.pool import Pool
sys.path.append(os.path.abspath('../pylib/src'))
from gorpc import RpcService
import hotel_tag_pb2 as pb_test
import cProfile, pstats, StringIO
profile = cProfile.Profile()
# Server details
hostname... | {
"repo_name": "cookingkode/gorpc",
"path": "test/parellel_client.py",
"copies": "1",
"size": "1113",
"license": "apache-2.0",
"hash": 3780330602980021000,
"line_mean": 19.2363636364,
"line_max": 59,
"alpha_frac": 0.6100628931,
"autogenerated": false,
"ratio": 3.1619318181818183,
"config_test": ... |
__author__ = 'jyoung'
import multiprocessing as mp
import numpy
import time
def sum_range_serial(start, end):
return numpy.sum(numpy.arange(start, end+1))
def sum_range_par(start, end, output):
output.put(numpy.sum(numpy.arange(start, end+1)))
sumLimit = int(input('Enter a number to sum to: '))
print('\nSe... | {
"repo_name": "jon-young/ParallelTest",
"path": "parallel_test.py",
"copies": "1",
"size": "1107",
"license": "mit",
"hash": -8302060518122570000,
"line_mean": 28.9459459459,
"line_max": 72,
"alpha_frac": 0.6738934056,
"autogenerated": false,
"ratio": 3.324324324324324,
"config_test": false,
... |
__author__ = 'jyoung'
"""
Determine how many primes are less than a given natural number (in parallel)
"""
import math
import multiprocessing as mp
import numpy
import time
def is_prime(vec, output):
"""determine how many primes in vector"""
numPrime = 0
for n in vec:
isPrime = True
for ... | {
"repo_name": "jon-young/ParallelTest",
"path": "parallel_prime_test.py",
"copies": "1",
"size": "1616",
"license": "mit",
"hash": -6479661468176934000,
"line_mean": 28.4,
"line_max": 80,
"alpha_frac": 0.5983910891,
"autogenerated": false,
"ratio": 3.5054229934924077,
"config_test": false,
"h... |
__author__ = 'kaihami'
# encoding: utf-8
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import os
import cv2
import urllib
import time
from collections import OrderedDict
#set dir
os.chdir("/home/kaihami/Desktop/Python/Capt... | {
"repo_name": "kaihami/DataMiningLattes",
"path": "Open_Lattes.py",
"copies": "1",
"size": "7219",
"license": "mit",
"hash": 55301983950021410,
"line_mean": 29.5677966102,
"line_max": 132,
"alpha_frac": 0.4966033551,
"autogenerated": false,
"ratio": 3.380037488284911,
"config_test": false,
"h... |
__author__ = 'Kailash Joshi'
import sys
def _dec_to_binary(ip_address):
return map(lambda x: bin(x)[2:].zfill(8), ip_address)
def _negation_mask(net_mask):
wild = list()
for i in net_mask:
wild.append(255 - int(i))
return wild
class IPCalculator(object):
def __init__(self, ip_address, c... | {
"repo_name": "kailashjoshi/Ipcalculator",
"path": "ip_calculator.py",
"copies": "2",
"size": "2548",
"license": "apache-2.0",
"hash": -366343980506647500,
"line_mean": 32.0909090909,
"line_max": 99,
"alpha_frac": 0.5396389325,
"autogenerated": false,
"ratio": 3.2750642673521853,
"config_test":... |
__author__ = 'kai'
import pygal
from pygal.style import LightSolarizedStyle
# import numpy as np
# from fact import time
def create_box_whisker(data_frame):
try:
#prepare and clean data. drop missings as well
data_frame.drop(["_id"], axis=1, inplace='true')
data_frame.set_index("Time", inp... | {
"repo_name": "mackaiver/slowREST",
"path": "plot/aux.py",
"copies": "1",
"size": "1910",
"license": "mit",
"hash": -4585784881178775600,
"line_mean": 31.3728813559,
"line_max": 109,
"alpha_frac": 0.6146596859,
"autogenerated": false,
"ratio": 3.1414473684210527,
"config_test": false,
"has_no... |
__author__ = 'kai'
import matplotlib.pyplot as plt
# plt.style.use('ggplot')
import numpy as np
from examples.exampledata import blobel_example, double_gauss
from deconv.blobel import BlobelUnfold
import scipy.interpolate as si
def main():
mc_feature, mc_target = double_gauss(1000000)
measured_data_y, _... | {
"repo_name": "MaxNoe/pydeconv",
"path": "examples/unfolding_2.py",
"copies": "1",
"size": "2472",
"license": "mit",
"hash": 2367418227737496000,
"line_mean": 31.96,
"line_max": 131,
"alpha_frac": 0.6395631068,
"autogenerated": false,
"ratio": 2.9185360094451003,
"config_test": false,
"has_no... |
__author__ = 'kai'
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import numpy as np
import scipy.interpolate as si
from scipy.optimize import minimize
from scipy.integrate import quad
class BlobelUnfold():
def __init__(self, n_bins_observed, n_bins_target, range_observed, range_target, n_knots):
... | {
"repo_name": "MaxNoe/pydeconv",
"path": "deconv/blobel.py",
"copies": "1",
"size": "3486",
"license": "mit",
"hash": -1782873098122491400,
"line_mean": 36.0957446809,
"line_max": 134,
"alpha_frac": 0.6061388411,
"autogenerated": false,
"ratio": 3.2980132450331126,
"config_test": false,
"has_... |
__author__ = 'KainokiKaede'
"""
1. Go to https://dev.moves-app.com/apps and register a new app.
client_id and client_secret will be given, so paste it to the variables below.
2. `$ python fetch.py --requesturl` will open the web browser.
Follow the instructions and authenticate the app.
You will be redirected... | {
"repo_name": "iwharris/moves-transponder",
"path": "moves/fetch.py",
"copies": "1",
"size": "3842",
"license": "mit",
"hash": -7712661996733517000,
"line_mean": 32.4173913043,
"line_max": 81,
"alpha_frac": 0.6395106715,
"autogenerated": false,
"ratio": 3.583955223880597,
"config_test": false,
... |
__author__ = 'KainokiKaede'
"""
This is a simple code to convert Moves JSON file to gpx files.
Each day in JSON file will be converted into different gpx file,
one file for a single day.
If you think this behavior annoying, please feel free to rewrite the code:D
Usage: 1. Get JSON file. You can use my `fetch.py`.
... | {
"repo_name": "iwharris/moves-transponder",
"path": "moves/json2gpx.py",
"copies": "1",
"size": "5036",
"license": "mit",
"hash": -8741875884428099000,
"line_mean": 41.686440678,
"line_max": 175,
"alpha_frac": 0.6219221604,
"autogenerated": false,
"ratio": 3.780780780780781,
"config_test": fals... |
__author__ = 'Kaiqun'
import networkx as nx
TheList = [3,5,7,2,6,8,1,9]
G=nx.Graph()
def recur1(InputList):
global G
if len(InputList) == 0:
return InputList
else:
tmpMarker = []
G.add_node(InputList[0])
tmpMarker.append(0)
for i in range(len(InputList))[1:]:
... | {
"repo_name": "gitFuKaiqun/WordCloud",
"path": "Experiment1.py",
"copies": "1",
"size": "1138",
"license": "mit",
"hash": -8131343550877112000,
"line_mean": 26.119047619,
"line_max": 78,
"alpha_frac": 0.5500878735,
"autogenerated": false,
"ratio": 3.1876750700280114,
"config_test": false,
"ha... |
import json
from httplib2 import Http
import BaseHTTPServer
from BaseHTTPServer import *
class BackendHTTPRequestHandler(BaseHTTPRequestHandler):
# API lists known Hive node API servers. These will be used to propagate events to the users.
API = ["http://localhost:1235/api/abcde12345", "http://localhost:2235/... | {
"repo_name": "brainly/hive",
"path": "examples/distributed-chat/backend/backend.py",
"copies": "1",
"size": "6930",
"license": "mit",
"hash": 2969029083643108400,
"line_mean": 42.5849056604,
"line_max": 109,
"alpha_frac": 0.4686868687,
"autogenerated": false,
"ratio": 4.635451505016722,
"confi... |
import json
from httplib2 import Http
import BaseHTTPServer
from BaseHTTPServer import *
class BackendHTTPRequestHandler(BaseHTTPRequestHandler):
# The Hive API endpoint.
API = "http://localhost:1235/api/abcde12345"
# Users will be used for a very basic authorization:
# Whenever a user authorizes, we... | {
"repo_name": "brainly/hive",
"path": "examples/simple-chat/backend/backend.py",
"copies": "1",
"size": "6581",
"license": "mit",
"hash": -3100071284104839000,
"line_mean": 42.8733333333,
"line_max": 109,
"alpha_frac": 0.4698374107,
"autogenerated": false,
"ratio": 4.570138888888889,
"config_te... |
# AUTHOR: Kale Miller LAST EDITED: 05/12/16
# EMAIL: 21518338@student.uwa.edu.au
# DESCRIPTION: We don't have a description yet.
# 416c7761797320636f646520617320696620746865206775792077686f20656e6473207570206d61696e7461696e696e6720796f757220636f
# 64652077696c6c20626520612076696f6c656e742070737963686f70617468207768... | {
"repo_name": "kmiller96/Shipping-Containers-Software",
"path": "RunProgram.py",
"copies": "1",
"size": "4587",
"license": "mit",
"hash": -2609813917890560000,
"line_mean": 38.2051282051,
"line_max": 119,
"alpha_frac": 0.488118596,
"autogenerated": false,
"ratio": 4.331444759206799,
"config_tes... |
# AUTHOR: Kale Miller
# DESCRIPTION: Front end execution of the chess engine.
# 416c7761797320636f646520617320696620746865206775792077686f20656e6473207570206d
# 61696e7461696e696e6720796f757220636f64652077696c6c20626520612076696f6c656e7420
# 70737963686f706174682077686f206b6e6f777320776865726520796f75206c6976652e
# D... | {
"repo_name": "kmiller96/Quark-ChessEngine",
"path": "QuarkPlay.py",
"copies": "2",
"size": "12874",
"license": "mit",
"hash": 7604778022076835000,
"line_mean": 34.3681318681,
"line_max": 88,
"alpha_frac": 0.6102998291,
"autogenerated": false,
"ratio": 3.935799449709569,
"config_test": false,
... |
# AUTHOR: Kale Miller
# DESCRIPTION: Contains the core classes for the program.
# 50726f6772616d6d696e6720697320627265616b696e67206f66206f6e652062696720696d706f737369626c65207461736b20696e746f20736576
# 6572616c207665727920736d616c6c20706f737369626c65207461736b732e
# DEVELOPMENT LOG:
# 05/12/16: Initialized... | {
"repo_name": "kmiller96/Shipping-Containers-Software",
"path": "lib/containers.py",
"copies": "1",
"size": "14805",
"license": "mit",
"hash": 313356574844203650,
"line_mean": 39.940509915,
"line_max": 120,
"alpha_frac": 0.5953394124,
"autogenerated": false,
"ratio": 4.277665414620052,
"config_... |
__author__ = 'Kamal.S'
from django.db.models import Q, CharField
from tastypie.resources import ModelResource, ALL, fields
from haystack.query import SearchQuerySet, EmptySearchQuerySet
from django.conf.urls.defaults import *
from tastypie.paginator import Paginator
from .models import Sample
class SampleResource(Mo... | {
"repo_name": "srkama/haysolr",
"path": "dataview/testapi/api.py",
"copies": "1",
"size": "3336",
"license": "apache-2.0",
"hash": 1603627472657821400,
"line_mean": 34.5,
"line_max": 74,
"alpha_frac": 0.5605515588,
"autogenerated": false,
"ratio": 4.149253731343284,
"config_test": false,
"has... |
__author__ = 'kaneg'
from flask import json
import requests
import unixsocket
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
API_URL_CONTAINERS = '%(version)s/containers'
API_URL_CONTAINER = '%(version)s/containers/%(container... | {
"repo_name": "kaneg/lxdui",
"path": "lxd_mgr.py",
"copies": "1",
"size": "7416",
"license": "apache-2.0",
"hash": -5601227741019482000,
"line_mean": 34.4832535885,
"line_max": 116,
"alpha_frac": 0.5676914779,
"autogenerated": false,
"ratio": 3.6676557863501484,
"config_test": false,
"has_no_... |
__author__ = 'kaneg'
import json
from flask import Flask, render_template, request, session, redirect, make_response
import settings
from lxd_mgr import LXDMgr
import os
import status_codes
app = Flask(__name__)
app.debug = settings.debug
app.secret_key = 'oruwdj2394jd9u3oquraurhcnmclkpcx;a439077&(&$(#YH,nz,cnuw93ej... | {
"repo_name": "kaneg/lxdui",
"path": "main.py",
"copies": "1",
"size": "4878",
"license": "apache-2.0",
"hash": 572361110114136300,
"line_mean": 24.8095238095,
"line_max": 112,
"alpha_frac": 0.6297662977,
"autogenerated": false,
"ratio": 3.3502747252747254,
"config_test": false,
"has_no_keywo... |
__author__ = 'kanhua'
import unittest
from pypvcell.photocurrent import conv_abs_to_qe, calc_jsc, gen_step_qe, calc_jsc_from_eg,lambert_abs
from pypvcell.illumination import Illumination
from pypvcell.spectrum import Spectrum
import numpy as np
import matplotlib.pyplot as plt
class MyTestCase(unittest.TestCase):
... | {
"repo_name": "kanhua/pypvcell",
"path": "tests/test_photocurrent.py",
"copies": "1",
"size": "2139",
"license": "apache-2.0",
"hash": 6520806938498803000,
"line_mean": 25.0853658537,
"line_max": 101,
"alpha_frac": 0.5769050958,
"autogenerated": false,
"ratio": 2.657142857142857,
"config_test":... |
__author__ = 'kanhua'
import unittest
from pypvcell.spectrum import Spectrum
from pypvcell.photocurrent import gen_step_qe
from pypvcell.ivsolver import calculate_j01_from_qe, \
calculate_j01, calculate_bed,gen_rec_iv,\
gen_rec_iv_by_rad_eta,one_diode_v_from_i
import numpy as np
import matplotlib.pyplot as plt... | {
"repo_name": "kanhua/pypvcell",
"path": "tests/test_rec_iv.py",
"copies": "1",
"size": "3361",
"license": "apache-2.0",
"hash": -1985771297591426800,
"line_mean": 25.4645669291,
"line_max": 108,
"alpha_frac": 0.5894079143,
"autogenerated": false,
"ratio": 2.661124307205067,
"config_test": true... |
import csv
from collections import OrderedDict
from itertools import islice
import operator
class SolverDetails:
nprocs = []
times = []
base_proc = 1
base_time = 0.1
nprocs_per_solver = {}
solvernames= ['cg/jacobi','cg/bjacobi','cg/asm',
'gmres/bjacobi','gmres/asm', 'gmres/jacobi',
'fgmres/bjacobi', 'fgmres... | {
"repo_name": "LighthouseHPC/lighthouse",
"path": "sandbox/petsc/solvers/scripts/EfficiencyComputation.py",
"copies": "1",
"size": "1631",
"license": "mit",
"hash": 943337638291226800,
"line_mean": 28.6545454545,
"line_max": 125,
"alpha_frac": 0.6725935009,
"autogenerated": false,
"ratio": 2.9281... |
import csv
from collections import OrderedDict
import operator
#dictionary for solver count
solverCount = {}
#154 solvers fo PETSc
solvers = [89565283,8793455,90197667,49598909,91036839,45869639,45869638,45869637,47942867,89269802,
89269803,89269801,89269804,59072883,59072882,59072881,7285381,7285384,59072884,49598911... | {
"repo_name": "LighthouseHPC/lighthouse",
"path": "sandbox/scripts/top10goodSolvers.py",
"copies": "1",
"size": "2822",
"license": "mit",
"hash": -5956194952240406000,
"line_mean": 42.4307692308,
"line_max": 151,
"alpha_frac": 0.805102764,
"autogenerated": false,
"ratio": 2.434857635893011,
"co... |
# default timings available for 256 matrices (default solver: gmres + ilu , solver id: 32168839)
#input file: '/Users/kanikas/Desktop/petsc_anamod_35.csv' (File has all features + solver + class)
#output file: '/Users/kanikas/Desktop/solver_pc.csv' (File has all features + solver + solver_name + pc_name + class ) manu... | {
"repo_name": "LighthouseHPC/lighthouse",
"path": "sandbox/petsc/NoiseFiltering/defaultTimes3classRS2388.py",
"copies": "2",
"size": "3662",
"license": "mit",
"hash": 2795326709022575000,
"line_mean": 42.6071428571,
"line_max": 165,
"alpha_frac": 0.7080830147,
"autogenerated": false,
"ratio": 3.1... |
# default timings available for 775 matrices (default solver: gmres + ilu , solver id: 32168839)
#input file: '/Users/kanikas/Desktop/petsc_anamod_35.csv' (File has all features + solver + class)
#output file: '/Users/kanikas/Desktop/solver_pc.csv' (File has all features + solver + solver_name + pc_name + class ) manu... | {
"repo_name": "LighthouseHPC/lighthouse",
"path": "sandbox/petsc/Feb22_MisPredictionAnalysis/TimeComparison/AllDataPoints/comparisonWithDefaultForAll.py",
"copies": "1",
"size": "2425",
"license": "mit",
"hash": 3855506876903651300,
"line_mean": 38.7704918033,
"line_max": 165,
"alpha_frac": 0.6993814... |
#input file: '/Users/kanikas/Desktop/petsc_anamod_35.csv' (File has all features + solver + class)
#output file: '/Users/kanikas/Desktop/solver_pc.csv' (File has all features + solver + solver_name + pc_name + class ) manually removing solver from the list for now
import csv
from collections import OrderedDict
from it... | {
"repo_name": "LighthouseHPC/lighthouse",
"path": "sandbox/ml/PETScDecoupled_Experiments/solver_pc_separate.py",
"copies": "1",
"size": "4507",
"license": "mit",
"hash": 4497916252750572000,
"line_mean": 55.35,
"line_max": 165,
"alpha_frac": 0.6942533836,
"autogenerated": false,
"ratio": 2.651176... |
import csv
from collections import OrderedDict
from itertools import islice
import operator
class SolverDetails:
nprocs = []
times = []
base_proc = 1
base_time = 0.1
nprocs_per_solver = {}
def write_files_per_problem():
solvers = ['gmres','fgmres','bicg','bcgs','tfqmr','cg', 'ibcgs'] # 7 solvers
pcs = {
... | {
"repo_name": "LighthouseHPC/lighthouse",
"path": "sandbox/petsc/solvers/scripts/ScalabilityEfficiency.py",
"copies": "1",
"size": "5350",
"license": "mit",
"hash": 301673780982019140,
"line_mean": 40.796875,
"line_max": 138,
"alpha_frac": 0.6669158879,
"autogenerated": false,
"ratio": 2.68709191... |
import glob
import gzip
import re
import string
import math
import sys
from math import log
from collections import defaultdict
if len(sys.argv)<2:
print "Usage: python comp.py <input-folder-path> <queryfile>"
exit()
results = sys.argv[1]
queryfile = sys.argv[2]
path = results+"/*"
files=glob.glob(p... | {
"repo_name": "semantic-group1/twitter-lda",
"path": "Python Scripts/vectorize.py",
"copies": "1",
"size": "1201",
"license": "apache-2.0",
"hash": -2869616435035569700,
"line_mean": 21.6603773585,
"line_max": 82,
"alpha_frac": 0.6361365529,
"autogenerated": false,
"ratio": 2.668888888888889,
"... |
__author__ = 'KaranG'
import smtplib
from email.mime import multipart
from email.mime import text
from email.mime import application
import getpass
import time
import argparse
import csv
import os
import sys
SENDER_LIST = {'Name': [], 'Email': [], 'Company': []}
OLD_LIST = []
LIMIT = 90
def get_details():
parse... | {
"repo_name": "karangurnani/LinkedInMailing",
"path": "mail.py",
"copies": "1",
"size": "4538",
"license": "mit",
"hash": 1300898213398622000,
"line_mean": 41.0277777778,
"line_max": 120,
"alpha_frac": 0.5572939621,
"autogenerated": false,
"ratio": 4.170955882352941,
"config_test": false,
"ha... |
__author__ = 'karissamckelvey'
import urlparse
from BeautifulSoup import BeautifulSoup
from papertalk import utils
from papertalk.utils import scholar
from papertalk.utils.mendeley import mendeley_client as mc
import re
class Site(object):
"""
Scrapes the site and returns an article
"""
@classmethod
... | {
"repo_name": "karissa/papertalk",
"path": "papertalk/models/sites.py",
"copies": "1",
"size": "5617",
"license": "mit",
"hash": -4952392041372980000,
"line_mean": 27.9536082474,
"line_max": 172,
"alpha_frac": 0.5545664946,
"autogenerated": false,
"ratio": 3.7927076299797435,
"config_test": fal... |
#Adapted From:
#https://stackoverflow.com/questions/12902540/read-from-a-gzip-file-in-python
#https://stackoverflow.com/questions/2872381/how-to-read-a-file-byte-by-byte-in-python-and-how-to-print-a-bytelist-as-a-binar
import gzip
import PIL.Image as pil
import numpy as np
cnt = 0
##Method to read ima... | {
"repo_name": "karlesleith/MNIST---Problem---Sheet",
"path": "MNIST-Test.py",
"copies": "1",
"size": "1822",
"license": "apache-2.0",
"hash": -1854898938065929500,
"line_mean": 18.021978022,
"line_max": 125,
"alpha_frac": 0.5993413831,
"autogenerated": false,
"ratio": 2.632947976878613,
"config... |
import time
import sys
# This part of code is to calculate how long a code will take to run
def measure(method):
def run(*args, **kwargs):
if sys.platform == 'win32':
# time.clock() resolution is very good on Windows, but very bad on Unix.
'''
***** For n... | {
"repo_name": "Karlheinzniebuhr/pythonbenchmark",
"path": "pythonbenchmark/pythonbenchmark.py",
"copies": "1",
"size": "3397",
"license": "mit",
"hash": -1774752967223822300,
"line_mean": 36.3406593407,
"line_max": 155,
"alpha_frac": 0.5722696497,
"autogenerated": false,
"ratio": 3.81257014590347... |
__author__ = 'karlo'
from gensim.models import Word2Vec
from gensim import matutils
from numpy import dot, array
from WWO import calc_ic
def sentence_vec(words, use_ic=False):
vec = None
for w in words:
try:
v = w2v_model[w]
if vec is None:
if use_ic:
... | {
"repo_name": "kbiscanic/apt_project",
"path": "apt/features/karlo/word2vec.py",
"copies": "1",
"size": "1584",
"license": "apache-2.0",
"hash": 7470100023246371000,
"line_mean": 24.9672131148,
"line_max": 117,
"alpha_frac": 0.5473484848,
"autogenerated": false,
"ratio": 3.1119842829076623,
"co... |
__author__ = 'karlo'
def norm(X, Y):
if len(X) != len(Y):
return
a1 = 0.0
a2 = 0.0
a3 = 0.0
b1 = 0.0
b2 = 0.0
b3 = 0.0
for i in range(len(X)):
a1 += X[i] * Y[i]
a2 += -X[i] * X[i]
a3 += -X[i]
b1 += Y[i]
b2 += -X[i]
b3 += -1
... | {
"repo_name": "kbiscanic/apt_project",
"path": "apt/Norm.py",
"copies": "1",
"size": "1117",
"license": "apache-2.0",
"hash": 6251358815368845000,
"line_mean": 21.8163265306,
"line_max": 104,
"alpha_frac": 0.5049239033,
"autogenerated": false,
"ratio": 2.351578947368421,
"config_test": true,
... |
import argparse
import dynet as dy
import numpy as np
import os
import pickle
import random
import sys
import time
from collections import Counter
from copy import deepcopy
########################### useful generic operations ##########################
def get_boundaries(bio):
"""
Extracts an ordered list of... | {
"repo_name": "karlstratos/mention2vec",
"path": "mention2vec.py",
"copies": "1",
"size": "23923",
"license": "apache-2.0",
"hash": -5228055604845241000,
"line_mean": 37.2768,
"line_max": 80,
"alpha_frac": 0.5140241608,
"autogenerated": false,
"ratio": 3.3207940033314824,
"config_test": false,
... |
"""
This module is used to display similar words (in consine similarity).
"""
import argparse
from numpy import array
from numpy import dot
from numpy import linalg
def read_embeddings(embedding_path):
"""Reads word embeddings from various file formats."""
embedding = {}
dim = 0
with open(embedding_pa... | {
"repo_name": "karlstratos/mention2vec",
"path": "display_nearest_neighbors.py",
"copies": "1",
"size": "2657",
"license": "apache-2.0",
"hash": -8630057940372496000,
"line_mean": 35.397260274,
"line_max": 77,
"alpha_frac": 0.5483628152,
"autogenerated": false,
"ratio": 4.465546218487395,
"conf... |
__author__ = 'Karol'
import urllib2
import datetime
import threading
import time
import logging
import json
from bs4 import BeautifulSoup
class Schedule(object):
def __init__(self):
self.url_path_to_schedule = "http://www.sci.edu.pl/plan/plany/o12.html"
self.hours = self.downloadHoursFromWeb()
... | {
"repo_name": "r3tard/BartusBot",
"path": "schedule.py",
"copies": "1",
"size": "5812",
"license": "apache-2.0",
"hash": -9006581180668419000,
"line_mean": 36.25,
"line_max": 122,
"alpha_frac": 0.5509466437,
"autogenerated": false,
"ratio": 3.1152815013404824,
"config_test": false,
"has_no_ke... |
__author__ = "Kartik Kannapur"
# #Import Python Libraries
from pymongo import MongoClient
import json
from collections import Counter
# #Import Property Files
# import properties as prop
json_properties_file = open("properties.json")
json_properties = json.loads(json_properties_file.read())
# #Connect to the Mongo D... | {
"repo_name": "KartikKannapur/MongoDB_M101P",
"path": "Week_5/01_homework_5_1.py",
"copies": "1",
"size": "1242",
"license": "mit",
"hash": -3861851259073834500,
"line_mean": 28.5952380952,
"line_max": 92,
"alpha_frac": 0.690821256,
"autogenerated": false,
"ratio": 3.338709677419355,
"config_te... |
__author__ = "Kartik Kannapur"
# #Import Python Libraries
from pymongo import MongoClient
import json
import bottle
from bottle import route, run, template
# #Import Property Files
# import properties as prop
json_properties_file = open("properties.json")
json_properties = json.loads(json_properties_file.read())
# ... | {
"repo_name": "KartikKannapur/MongoDB_M101P",
"path": "Week_1/05_web_app_bottle_url_handlers.py",
"copies": "1",
"size": "1029",
"license": "mit",
"hash": -2175010267395129300,
"line_mean": 25.3846153846,
"line_max": 85,
"alpha_frac": 0.6967930029,
"autogenerated": false,
"ratio": 3.2358490566037... |
__author__ = "Kartik Kannapur"
# #Import Python Libraries
from pymongo import MongoClient
import json
# #Import Property Files
# import properties as prop
json_properties_file = open("properties.json")
json_properties = json.loads(json_properties_file.read())
# #Connect to the Mongo Database
client = MongoClient(jso... | {
"repo_name": "KartikKannapur/MongoDB_M101P",
"path": "Week_2/03_homework_2_2.py",
"copies": "1",
"size": "1391",
"license": "mit",
"hash": -2513637879438129000,
"line_mean": 25.75,
"line_max": 93,
"alpha_frac": 0.6736161035,
"autogenerated": false,
"ratio": 3.175799086757991,
"config_test": fa... |
__author__ = 'kartikkumar'
'''
Copyright (c) 2013, GoUrbanGrow.
All rights reserved.
See ... for license details.
This script can be used to read out sensor data from an Arduino board.
'''
###################################################################################################
# Set up input deck
########... | {
"repo_name": "GoUrbanGrow/SoilGuru",
"path": "arduinoReader.py",
"copies": "1",
"size": "2844",
"license": "bsd-3-clause",
"hash": 5272845345379971000,
"line_mean": 29.2553191489,
"line_max": 99,
"alpha_frac": 0.3315752461,
"autogenerated": false,
"ratio": 5.888198757763975,
"config_test": fal... |
__author__ = 'karunab'
import os
import urllib2
class Downloadable:
def __init__(self, path_on_disk, url):
self.path_on_disk = path_on_disk
self.url = url
@staticmethod
def from_wallpaper(base_path, wallpaper):
file_name = os.path.basename(wallpaper.url)
path_on_disk = '%... | {
"repo_name": "JAnderton/desktoppr-downloader",
"path": "download.py",
"copies": "1",
"size": "1227",
"license": "apache-2.0",
"hash": -3015557894308162000,
"line_mean": 29.7,
"line_max": 80,
"alpha_frac": 0.6405867971,
"autogenerated": false,
"ratio": 3.417827298050139,
"config_test": false,
... |
__author__ = 'Kasper H Steenstrup'
import rhinoscriptsyntax as rs
import Rhino.Geometry.Point3f as Point3f
def extend(s, mm_len):
"""
Extend a ruled surface such that all the ruling are 400mm long
:param s: A ruled surface
:param mm_len: Desired Length of each ruling
:return: Ruled surface with r... | {
"repo_name": "steenstrup/rhinoscripts",
"path": "extend-ruling-to-equal-length.py",
"copies": "1",
"size": "1410",
"license": "mit",
"hash": -2682423192446761500,
"line_mean": 22.9152542373,
"line_max": 66,
"alpha_frac": 0.5595744681,
"autogenerated": false,
"ratio": 2.8484848484848486,
"confi... |
__author__ = 'Kasper H Steenstrup'
import rhinoscriptsyntax as rs
import Rhino.Geometry.Vector3d as Vector3d
import math
def alingBlock(block_a, block_b, model_inside):
"""
Scale box to the correct dimentions
Align box a and what is inside to box b
The dimention of the box is expected to be equal len... | {
"repo_name": "steenstrup/rhinoscripts",
"path": "aling-box.py",
"copies": "1",
"size": "2282",
"license": "mit",
"hash": 1356686354022148000,
"line_mean": 27.1728395062,
"line_max": 73,
"alpha_frac": 0.5920245399,
"autogenerated": false,
"ratio": 2.7427884615384617,
"config_test": false,
"ha... |
__author__ = 'Kate Kuehl'
__email__ = 'katekuehl@gmail.com'
__license__ = 'MIT'
__version__ = '1.0.0'
import cv2
import submit
from PIL import Image, ImageTk
import os
import re
#My image directory
dir = "C:\Users\Kate\Videos\PizzaRolls2"
def processrawpics(dir_image):
# https://www.isimonbrown.co.uk/vlc-export... | {
"repo_name": "katekuehl/ArtCam",
"path": "__init__.py",
"copies": "1",
"size": "3214",
"license": "mit",
"hash": -1123717646957212500,
"line_mean": 27.7053571429,
"line_max": 106,
"alpha_frac": 0.6132545115,
"autogenerated": false,
"ratio": 3.198009950248756,
"config_test": false,
"has_no_ke... |
__author__ = 'katharine'
from gevent import monkey; monkey.patch_all()
import PyV8 as v8
import requests
import requests.exceptions
import exceptions
import events
progress_event = v8.JSExtension("runtime/events/progress", """
ProgressEvent = function(computable, loaded, total) {
Event.call(this);
computable ... | {
"repo_name": "youtux/pypkjs",
"path": "javascript/xhr.py",
"copies": "1",
"size": "6719",
"license": "mit",
"hash": -8774452280627510000,
"line_mean": 35.3189189189,
"line_max": 147,
"alpha_frac": 0.6006846257,
"autogenerated": false,
"ratio": 4.14497223935842,
"config_test": false,
"has_no_... |
__author__ = 'katharine'
from peewee import *
import json
import logging
import uuid
import dateutil.parser
from dateutil.tz import tzlocal, tzutc
import datetime
import calendar
import struct
from attributes import TimelineAttributeSet
logger = logging.getLogger("pypkjs.timeline.model")
db = SqliteDatabase(None)
... | {
"repo_name": "youtux/pypkjs",
"path": "timeline/model.py",
"copies": "1",
"size": "13608",
"license": "mit",
"hash": 4033299303212080000,
"line_mean": 41.7924528302,
"line_max": 148,
"alpha_frac": 0.5843621399,
"autogenerated": false,
"ratio": 4.34066985645933,
"config_test": false,
"has_no_... |
__author__ = 'katharine'
from setuptools import setup, find_packages
from pkg_resources import resource_string
requirements_str = resource_string(__name__, 'requirements.txt')
requirements = [line.strip() for line in requirements_str.splitlines()]
__version__= None # Overwritten by executing version.py.
with open('... | {
"repo_name": "pebble/pypkjs",
"path": "setup.py",
"copies": "1",
"size": "1258",
"license": "mit",
"hash": -4959408369029192000,
"line_mean": 34.9428571429,
"line_max": 106,
"alpha_frac": 0.6160572337,
"autogenerated": false,
"ratio": 3.328042328042328,
"config_test": false,
"has_no_keywords... |
__author__ = 'katharine'
from six import with_metaclass
import argparse
import logging
import os
import time
from libpebble2.communication import PebbleConnection
from libpebble2.communication.transports.qemu import QemuTransport
from libpebble2.communication.transports.websocket import WebsocketTransport
from libpe... | {
"repo_name": "gregoiresage/pebble-tool",
"path": "pebble_tool/commands/base.py",
"copies": "1",
"size": "9672",
"license": "mit",
"hash": -4805267330932767000,
"line_mean": 43.3669724771,
"line_max": 124,
"alpha_frac": 0.593879239,
"autogenerated": false,
"ratio": 4.172562553925798,
"config_te... |
__author__ = 'katharine'
import calendar
import dateutil.parser
import logging
import struct
import urlparse
from colours import PEBBLE_COLOURS
logger = logging.getLogger('pypkjs.timeline.attributes')
class TimelineAttributeSet(object):
def __init__(self, attributes, fw_mapping):
self.attributes = attri... | {
"repo_name": "youtux/pypkjs",
"path": "timeline/attributes.py",
"copies": "1",
"size": "3927",
"license": "mit",
"hash": -8613861676696774000,
"line_mean": 37.8811881188,
"line_max": 137,
"alpha_frac": 0.550802139,
"autogenerated": false,
"ratio": 3.8349609375,
"config_test": false,
"has_no_... |
__author__ = 'katharine'
import collections
import gevent
import gevent.queue
import logging
import random
import struct
import time
import uuid
class BlobDB(object):
DB_TEST = 0
DB_PIN = 1
DB_APP = 2
DB_REMINDER = 3
DB_NOTIFICATION = 4
_PendingItem = collections.namedtuple('_PendingItem', (... | {
"repo_name": "youtux/pypkjs",
"path": "timeline/blobdb.py",
"copies": "1",
"size": "4113",
"license": "mit",
"hash": -8548418430827902000,
"line_mean": 33.5630252101,
"line_max": 91,
"alpha_frac": 0.5917821541,
"autogenerated": false,
"ratio": 3.728921124206709,
"config_test": false,
"has_no... |
__author__ = 'katharine'
import collections
import json
import logging
import os.path
import platform
import uuid
import requests
import PblAccount
import PblProject
from . import get_sdk_version
class PebbleAnalytics(object):
TD_SERVER = "https://td.getpebble.com/td.pebble.sdk_events"
def __init__(self):... | {
"repo_name": "pebble/libpebble",
"path": "pebble/analytics.py",
"copies": "1",
"size": "4590",
"license": "mit",
"hash": 8111350456796836000,
"line_mean": 29.6,
"line_max": 95,
"alpha_frac": 0.559912854,
"autogenerated": false,
"ratio": 3.9671564390665512,
"config_test": false,
"has_no_keywo... |
__author__ = 'katharine'
import collections
import logging
import requests
import struct
import traceback
import itertools
from uuid import UUID
import urllib
import PyV8 as v8
from pebblecomm.pebble import AppMessage, Notification, Attribute, PebbleHardware
import events
from exceptions import JSRuntimeException
l... | {
"repo_name": "youtux/pypkjs",
"path": "javascript/pebble.py",
"copies": "1",
"size": "12725",
"license": "mit",
"hash": -442843012449584700,
"line_mean": 40.3149350649,
"line_max": 122,
"alpha_frac": 0.5503339882,
"autogenerated": false,
"ratio": 4.1503587736464445,
"config_test": false,
"ha... |
__author__ = 'katharine'
import collections
import zipfile
from uuid import UUID
import gevent
import json
import logging
import urlparse
import urllib
import javascript
import javascript.runtime
from pebble_manager import PebbleManager
from timeline import PebbleTimeline
import timeline.urls
class Runner(object):
... | {
"repo_name": "youtux/pypkjs",
"path": "runner/__init__.py",
"copies": "1",
"size": "3742",
"license": "mit",
"hash": -505623375223214500,
"line_mean": 31.2586206897,
"line_max": 118,
"alpha_frac": 0.6060929984,
"autogenerated": false,
"ratio": 3.7382617382617385,
"config_test": true,
"has_no... |
__author__ = 'katharine'
import csv
import struct
import time
import datetime
def generate_files(source_dir, target_dir):
stops_txt = [x for x in csv.DictReader(open("%s/stops.txt" % source_dir, 'rb')) if x['location_type'] == '0']
print "%d stops" % len(stops_txt)
name_replacements = (
('Caltra... | {
"repo_name": "Katharine/pebble-caltrain",
"path": "scripts/generate.py",
"copies": "2",
"size": "5379",
"license": "mit",
"hash": 444028098434161200,
"line_mean": 35.3445945946,
"line_max": 138,
"alpha_frac": 0.5121769846,
"autogenerated": false,
"ratio": 3.2190305206463194,
"config_test": fal... |
__author__ = 'katharine'
import csv
import struct
import time
def generate_files(source_dir, target_dir):
stops_txt = [x for x in csv.DictReader(open("%s/stops.txt" % source_dir, 'rb')) if x['location_type'] == '0']
print "%d stops" % len(stops_txt)
stop_parent_map = {}
stop_map = {}
stops = []
... | {
"repo_name": "ashneo76/pebble-caltrain",
"path": "scripts/generate.py",
"copies": "3",
"size": "5148",
"license": "mit",
"hash": -8036525557716552000,
"line_mean": 35.7785714286,
"line_max": 144,
"alpha_frac": 0.507964258,
"autogenerated": false,
"ratio": 3.1719038817005547,
"config_test": fal... |
__author__ = 'katharine'
import gevent
import gevent.pool
import os
import tempfile
import settings
import shutil
import socket
import subprocess
import itertools
_used_displays = set()
def _find_display():
for i in itertools.count():
if i not in _used_displays:
_used_displays.add(i)
... | {
"repo_name": "pebble/cloudpebble-qemu-controller",
"path": "emulator.py",
"copies": "1",
"size": "7129",
"license": "mit",
"hash": -6862177714663034000,
"line_mean": 32.9476190476,
"line_max": 119,
"alpha_frac": 0.5042782999,
"autogenerated": false,
"ratio": 3.851431658562939,
"config_test": f... |
__author__ = 'katharine'
import gevent
import json
import logging
import requests
import struct
import uuid
from blobdb import BlobDB
from model import TimelineItem, TimelineActionSet
from attributes import TimelineAttributeSet
class ActionHandler(object):
def __init__(self, timeline, pebble):
self.time... | {
"repo_name": "youtux/pypkjs",
"path": "timeline/actions.py",
"copies": "1",
"size": "5141",
"license": "mit",
"hash": -6806627643842703000,
"line_mean": 41.1393442623,
"line_max": 125,
"alpha_frac": 0.5924917331,
"autogenerated": false,
"ratio": 4.048031496062992,
"config_test": false,
"has_... |
__author__ = 'katharine'
import gevent_ssl_hack
import datetime
from dateutil.tz import tzlocal, tzutc
import dateutil.parser
import gevent
import json
import logging
import requests
import traceback
from actions import ActionHandler
from blobdb import BlobDB
import model
from model import TimelineItem, TimelineStat... | {
"repo_name": "youtux/pypkjs",
"path": "timeline/__init__.py",
"copies": "1",
"size": "11192",
"license": "mit",
"hash": 8929348455600652000,
"line_mean": 40.2988929889,
"line_max": 132,
"alpha_frac": 0.5818441744,
"autogenerated": false,
"ratio": 4.131413805832411,
"config_test": false,
"has... |
__author__ = 'katharine'
import json
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseNotFound
from django.shortcuts import redirect, render
from django.views.decorators.http import require_POST
from ide.api import json_response, json_failur... | {
"repo_name": "math-foo/cloudpebble",
"path": "ide/api/qemu.py",
"copies": "1",
"size": "4074",
"license": "mit",
"hash": 608525858796025700,
"line_mean": 35.7027027027,
"line_max": 108,
"alpha_frac": 0.5800196367,
"autogenerated": false,
"ratio": 4.061814556331007,
"config_test": false,
"has... |
__author__ = 'katharine'
import json
import os
import os.path
import uuid
SDK_VERSION = "3"
from pebble_tool.exceptions import (InvalidProjectException, InvalidJSONException, OutdatedProjectException,
PebbleProjectException)
from pebble_tool.sdk import sdk_version
from . import pe... | {
"repo_name": "gregoiresage/pebble-tool",
"path": "pebble_tool/sdk/project.py",
"copies": "1",
"size": "8525",
"license": "mit",
"hash": -5433165319094670000,
"line_mean": 42.0555555556,
"line_max": 121,
"alpha_frac": 0.6144281525,
"autogenerated": false,
"ratio": 4.011764705882353,
"config_tes... |
__author__ = 'katharine'
import json
import os
import os.path
import uuid
SDK_VERSION = "3"
class PebbleProjectException(Exception):
pass
class InvalidProjectException(PebbleProjectException):
pass
class OutdatedProjectException(PebbleProjectException):
pass
class PebbleProject(object):
def __... | {
"repo_name": "pebble/libpebble",
"path": "pebble/PblProject.py",
"copies": "1",
"size": "2866",
"license": "mit",
"hash": -2021656713784425000,
"line_mean": 33.9512195122,
"line_max": 121,
"alpha_frac": 0.6458478716,
"autogenerated": false,
"ratio": 3.791005291005291,
"config_test": false,
"... |
__author__ = 'katharine'
import json
import requests
import random
import urlparse
import string
import logging
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django.views.decorators.http import require_POST
from django.utils.transla... | {
"repo_name": "thunsaker/cloudpebble",
"path": "ide/api/qemu.py",
"copies": "2",
"size": "4178",
"license": "mit",
"hash": 3229201731230569000,
"line_mean": 34.7094017094,
"line_max": 102,
"alpha_frac": 0.5840114888,
"autogenerated": false,
"ratio": 3.9193245778611634,
"config_test": false,
"... |
__author__ = 'katharine'
import logging
import requests
from model import TimelineItem, TimelineState, db as database
logger = logging.getLogger('pypkjs.timeline.websync')
class TimelineWebSync(object):
def __init__(self, urls, oauth):
self.urls = urls
self.oauth = oauth
def _make_request(s... | {
"repo_name": "youtux/pypkjs",
"path": "timeline/websync.py",
"copies": "2",
"size": "1541",
"license": "mit",
"hash": 8712750213221224000,
"line_mean": 29.2156862745,
"line_max": 87,
"alpha_frac": 0.5593770279,
"autogenerated": false,
"ratio": 4.013020833333333,
"config_test": false,
"has_no... |
__author__ = 'katharine'
import logging
import struct
from uuid import UUID
from pebblecomm import Pebble
from timeline.blobdb import BlobDB
logger = logging.getLogger("pypkjs.pebble_manager")
class PebbleManager(object):
def __init__(self, qemu):
self.qemu = qemu
self.pebble = Pebble()
... | {
"repo_name": "youtux/pypkjs",
"path": "pebble_manager.py",
"copies": "1",
"size": "2452",
"license": "mit",
"hash": 5734552000096493000,
"line_mean": 35.5970149254,
"line_max": 157,
"alpha_frac": 0.6203099511,
"autogenerated": false,
"ratio": 3.391424619640387,
"config_test": false,
"has_no_... |
__author__ = 'katharine'
import os.path
import errno
class FileSync(object):
def __init__(self, root_dir):
assert isinstance(root_dir, basestring)
self.root_dir = root_dir
def apply_patches(self, patch_sequence):
# TODO: optimisations, if we care.
# We can keep the files in m... | {
"repo_name": "pebble/cloudpebble-ycmd-proxy",
"path": "filesync.py",
"copies": "1",
"size": "2665",
"license": "mit",
"hash": 1771266982584291300,
"line_mean": 34.5333333333,
"line_max": 97,
"alpha_frac": 0.5347091932,
"autogenerated": false,
"ratio": 3.9423076923076925,
"config_test": false,
... |
__author__ = 'katharine'
import PyV8 as v8
import gevent
import gevent.pool
import gevent.queue
import gevent.hub
import logging
from javascript import PebbleKitJS
from javascript.exceptions import JSRuntimeException
logger = logging.getLogger('pypkjs.javascript.pebble')
make_proxy_extension = v8.JSExtension("runti... | {
"repo_name": "youtux/pypkjs",
"path": "javascript/runtime.py",
"copies": "1",
"size": "3406",
"license": "mit",
"hash": -472380406593436400,
"line_mean": 30.247706422,
"line_max": 110,
"alpha_frac": 0.5619495009,
"autogenerated": false,
"ratio": 4.026004728132388,
"config_test": false,
"has_... |
__author__ = 'katharine'
import PyV8 as v8
from javascript.exceptions import JSRuntimeException
event = v8.JSExtension("runtime/event", """
Event = function(event_type, event_init_dict) {
var self = this;
this.stopPropagation = function() {};
this.stopImmediatePropagation = function() { s... | {
"repo_name": "youtux/pypkjs",
"path": "javascript/events.py",
"copies": "2",
"size": "3156",
"license": "mit",
"hash": 973403488095930600,
"line_mean": 34.0666666667,
"line_max": 86,
"alpha_frac": 0.5484790875,
"autogenerated": false,
"ratio": 4.185676392572944,
"config_test": false,
"has_no... |
__author__ = 'katharine'
import PyV8 as v8
_storage_cache = {}
class LocalStorage(object):
def __init__(self, runtime):
self.storage = _storage_cache.setdefault(runtime.manifest['uuid'], {})
self.extension = v8.JSExtension(runtime.ext_name("localstorage"), """
(function() {
na... | {
"repo_name": "youtux/pypkjs",
"path": "javascript/localstorage.py",
"copies": "1",
"size": "1919",
"license": "mit",
"hash": -2004581736083497500,
"line_mean": 29.4603174603,
"line_max": 111,
"alpha_frac": 0.5700885878,
"autogenerated": false,
"ratio": 3.711798839458414,
"config_test": false,
... |
__author__ = 'katharine'
import signal
import webbrowser
import BaseHTTPServer
import gevent
import socket
from runner import Runner
class TerminalRunner(Runner):
def __init__(self, *args, **kwargs):
self.port = None
super(TerminalRunner, self).__init__(*args, **kwargs)
signal.signal(sig... | {
"repo_name": "youtux/pypkjs",
"path": "runner/terminal.py",
"copies": "1",
"size": "1740",
"license": "mit",
"hash": 817935148435085700,
"line_mean": 28,
"line_max": 93,
"alpha_frac": 0.5591954023,
"autogenerated": false,
"ratio": 4.10377358490566,
"config_test": false,
"has_no_keywords": fa... |
__author__ = 'katharine'
import sys
from setuptools import setup, find_packages
requires = [
'libpebble2==0.0.20',
'httplib2==0.9.1',
'oauth2client==1.4.12',
'progressbar2==2.7.3',
'pyasn1==0.1.8',
'pyasn1-modules==0.0.6',
'pypng==0.0.17',
'pyqrcode==1.1',
'requests==2.7.0',
'r... | {
"repo_name": "gregoiresage/pebble-tool",
"path": "setup.py",
"copies": "1",
"size": "1278",
"license": "mit",
"hash": 262670723952988400,
"line_mean": 25.625,
"line_max": 61,
"alpha_frac": 0.5719874804,
"autogenerated": false,
"ratio": 2.8783783783783785,
"config_test": false,
"has_no_keywor... |
__author__ = 'katharine'
import sys
from setuptools import setup, find_packages
requires = [
'libpebble2==0.0.26',
'httplib2==0.9.1',
'oauth2client==1.4.12',
'progressbar2==2.7.3',
'pyasn1==0.1.8',
'pyasn1-modules==0.0.6',
'pypng==0.0.17',
'pyqrcode==1.1',
'requests==2.7.0',
'r... | {
"repo_name": "pebble/pebble-tool",
"path": "setup.py",
"copies": "1",
"size": "1301",
"license": "mit",
"hash": -7154312794988467000,
"line_mean": 25.5510204082,
"line_max": 61,
"alpha_frac": 0.5710991545,
"autogenerated": false,
"ratio": 2.8783185840707963,
"config_test": false,
"has_no_key... |
__author__ = 'katharine'
class PebbleHardware(object):
UNKNOWN = 0
TINTIN_EV1 = 1
TINTIN_EV2 = 2
TINTIN_EV2_3 = 3
TINTIN_EV2_4 = 4
TINTIN_V1_5 = 5
BIANCA = 6
SNOWY_EVT2 = 7
SNOWY_DVT = 8
SPALDING_EVT = 9
BOBBY_SMILES = 10
SPALDING = 11
SILK_EVT = 12
ROBERT_EVT =... | {
"repo_name": "pebble/libpebble2",
"path": "libpebble2/util/hardware.py",
"copies": "1",
"size": "1370",
"license": "mit",
"hash": -2030868331364496600,
"line_mean": 21.8333333333,
"line_max": 53,
"alpha_frac": 0.5291970803,
"autogenerated": false,
"ratio": 2.459605026929982,
"config_test": fal... |
__author__ = 'Katherine'
import tkinter as tk
import copy
class Chess_Game:
pieces = {"Q": ["white queen", 8, [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]], [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]],
"R": ["white rook", 8, [[0, 1], [1, 0], [0, -1],... | {
"repo_name": "kashoemaker/Activity-9-Menus",
"path": "ChessBoard.py",
"copies": "1",
"size": "12333",
"license": "cc0-1.0",
"hash": -6381086904503832000,
"line_mean": 44.6814814815,
"line_max": 824,
"alpha_frac": 0.4371199222,
"autogenerated": false,
"ratio": 3.1238601823708207,
"config_test":... |
import fileinput
import sys
def to_csv(filename):
BOFmarker = '<tr class="rowHeader">'
EOFmarker = '</tbody>'
try:
faux_xls = open(filename + '.xls', 'r', encoding = 'UTF-8', errors = 'ignore')
except IOError:
print('Unable to open ' + filename + '.xls. Please check the file and try again.')
return
try:... | {
"repo_name": "kbrimm/html.xls_to_csv",
"path": "to_csv.py",
"copies": "1",
"size": "4625",
"license": "mit",
"hash": -6966283134169518000,
"line_mean": 33.2148148148,
"line_max": 140,
"alpha_frac": 0.5178610089,
"autogenerated": false,
"ratio": 2.7691846522781773,
"config_test": false,
"has_... |
from PIL import Image
i = Image.open("input.jpg")
#pixel data is stored in pixels in form of two dimensional array
pixels = i.load()
width, height = i.size
k=Image.new(i.mode,i.size)
filtersize=input('Enter the filtersize: ')
filterOffset=(filtersize-1)/2
filterheight=filtersize
filterwidth=filtersize
offsety=filter... | {
"repo_name": "BhargavGamit/ImageManipulationAlgorithms",
"path": "Mean Filter.py",
"copies": "1",
"size": "1964",
"license": "mit",
"hash": 9161780786077028000,
"line_mean": 31.1967213115,
"line_max": 77,
"alpha_frac": 0.566191446,
"autogenerated": false,
"ratio": 3.0929133858267717,
"config_t... |
from PIL import Image
i = Image.open("input.jpg")
#pixel data is stored in pixels in form of two dimensional array
pixels = i.load()
width, height = i.size
j=Image.new(i.mode,i.size)
print '1 Red filter'
print '2 Blue filter'
print '3 Green filter'
print '4 Red Invert filter'
print '5 Blue Invert filter'
print '6 G... | {
"repo_name": "BhargavGamit/ImageManipulationAlgorithms",
"path": "Single Colour Conversion-Inversion.py",
"copies": "1",
"size": "1203",
"license": "mit",
"hash": 4388350146779336000,
"line_mean": 26.976744186,
"line_max": 81,
"alpha_frac": 0.6359102244,
"autogenerated": false,
"ratio": 3.350974... |
__author__ = 'kbiscanic'
import math
def _len_compress(l):
return math.log(1. + l)
def _is_upper(x):
try:
return x.decode('utf8').isupper()
except UnicodeEncodeError:
return False
def _is_stock(x):
try:
return len(x) > 1 and x[0] == u'.' and x[1:].decode('utf8').isupper()
... | {
"repo_name": "kbiscanic/apt_project",
"path": "apt/features/kbiscanic/shallow_nerc.py",
"copies": "1",
"size": "1698",
"license": "apache-2.0",
"hash": -4585927778664656400,
"line_mean": 24.3432835821,
"line_max": 92,
"alpha_frac": 0.5482921084,
"autogenerated": false,
"ratio": 2.83,
"config_t... |
__author__ = 'kbohlen'
from crypto.algorithms.algorithminterface import AlgorithmInterface
from Crypto.Cipher import AES
from Crypto import Random
from Crypto.Hash import SHA256
from tools.argparcer import ArgParcer
'''
Description of AESCipher
BLOCK_SIZE:
The block size for the cipher object; must be 16 bytes pe... | {
"repo_name": "bensoer/pychat",
"path": "crypto/algorithms/aescipher.py",
"copies": "1",
"size": "3632",
"license": "mit",
"hash": -711080885302405900,
"line_mean": 38.4782608696,
"line_max": 105,
"alpha_frac": 0.7026431718,
"autogenerated": false,
"ratio": 4.053571428571429,
"config_test": fal... |
__author__ = 'kbohlen'
from crypto.algorithms.algorithminterface import AlgorithmInterface
from Crypto.Cipher import DES3
from Crypto import Random
from Crypto.Hash import SHA256
from tools.argparcer import ArgParcer
'''
Description of DES3Cipher
BLOCK_SIZE:
The block size for the cipher object; must be 8 bytes. ... | {
"repo_name": "bensoer/pychat",
"path": "crypto/algorithms/des3cipher.py",
"copies": "1",
"size": "3940",
"license": "mit",
"hash": 940290790814253000,
"line_mean": 35.1376146789,
"line_max": 118,
"alpha_frac": 0.69357705,
"autogenerated": false,
"ratio": 3.688202247191011,
"config_test": false... |
__author__ = 'kbohlen'
from crypto.algorithms.algorithminterface import AlgorithmInterface
from Crypto.PublicKey import RSA
'''
Description of RSAPublicKey
RSA is a public key cryptosystem, also called asymmetric ctyptography. It uses
a pair of keys, one public and one private for encryption. The benefit of this
i... | {
"repo_name": "bensoer/pychat",
"path": "crypto/algorithms/rsapublickey.py",
"copies": "1",
"size": "2161",
"license": "mit",
"hash": 7549781774086603000,
"line_mean": 36.2586206897,
"line_max": 79,
"alpha_frac": 0.6982878297,
"autogenerated": false,
"ratio": 4.304780876494024,
"config_test": f... |
__author__ = 'kbohlen'
from crypto.algorithms.algorithminterface import AlgorithmInterface
import os
import math
from tools.argparcer import ArgParcer
'''
Description of PureAESCipher
BLOCK_SIZE:
The block size for the cipher object; must be 16 bytes per FIPS-197 aka the
Federal Information Processing Standards P... | {
"repo_name": "bensoer/pychat",
"path": "crypto/algorithms/pureaescipher.py",
"copies": "1",
"size": "30105",
"license": "mit",
"hash": -1165139806103188000,
"line_mean": 39.7926829268,
"line_max": 104,
"alpha_frac": 0.541305431,
"autogenerated": false,
"ratio": 3.1901027869026173,
"config_test... |
__author__ = 'kbroughton'
class PluginLoader(object):
def __init__(self, group, auto_fn=None):
self.group = group
self.impls = {}
self.auto_fn = auto_fn
def load(self, name):
if name in self.impls:
return self.impls[name]()
if self.auto_fn:
load... | {
"repo_name": "darKoram/torpedo",
"path": "torpedo/util/__init__.py",
"copies": "1",
"size": "1059",
"license": "mit",
"hash": 8561374951031458000,
"line_mean": 28.4444444444,
"line_max": 56,
"alpha_frac": 0.5306893296,
"autogenerated": false,
"ratio": 3.922222222222222,
"config_test": false,
... |
__author__ = 'kbroughton'
from sqlalchemy import Column, Table, MetaData, create_engine
from sqlalchemy.ext.declarative import declarative_base
from enum import Enum
from sqlalchemy.engine.reflection import Inspector
from functools import lru_cache
from datetime import datetime
engine = create_engine("postgresql://... | {
"repo_name": "darKoram/torpedo",
"path": "torpedo/core/topo.py",
"copies": "1",
"size": "7329",
"license": "mit",
"hash": -8669242407918146000,
"line_mean": 33.2476635514,
"line_max": 98,
"alpha_frac": 0.5995360895,
"autogenerated": false,
"ratio": 4.31371394938199,
"config_test": false,
"ha... |
__author__ = 'kcho'
# ------------------------------------------------------- #
# CXL Concept Maps query creator #
# ------------------------------------------------------- #
# usage: python queries.py -f file.cxl ------------------ #
# ------------------------------------------------------- ... | {
"repo_name": "kcholoren/Python",
"path": "queries.py",
"copies": "1",
"size": "10743",
"license": "apache-2.0",
"hash": 6105834634854956000,
"line_mean": 35.6655290102,
"line_max": 125,
"alpha_frac": 0.4852462068,
"autogenerated": false,
"ratio": 3.607454667562122,
"config_test": false,
"has... |
__author__ = 'kdq'
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
port = {
'S':1,
'C':2,
'Q':3
}
ids = []
diff_title = {}
diff_age = {}
title = {
'Mr':1,
'Mrs':2,
'Miss':3,
'Master':4
}
femal... | {
"repo_name": "kdqzzxxcc/TitanicPredict",
"path": "feature_importance.py",
"copies": "1",
"size": "4711",
"license": "apache-2.0",
"hash": 7329846609959494000,
"line_mean": 37.6229508197,
"line_max": 142,
"alpha_frac": 0.6177032477,
"autogenerated": false,
"ratio": 2.9517543859649122,
"config_t... |
__author__ = 'kdsouza'
from functools import reduce
import pandas as pd
from MPL_pyqt_mergewidget import *
from MPL_style_formatting import *
from VEdit import *
from MPL_dicts import *
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.figure import Figure as MPLFigure
from canopy_data_import.c... | {
"repo_name": "kdz/test",
"path": "Spec.py",
"copies": "1",
"size": "6467",
"license": "mit",
"hash": -3235227412992758300,
"line_mean": 29.3615023474,
"line_max": 102,
"alpha_frac": 0.6039894851,
"autogenerated": false,
"ratio": 3.7424768518518516,
"config_test": false,
"has_no_keywords": fa... |
__author__ = 'kdsouza'
from MPL_pyqt_mergewidget import *
from Plot_class import *
from traitsui.api import Group, Item, CheckListEditor, InstanceEditor, HSplit
# instances for testing
df = pd.DataFrame([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]],
columns=['first', 'secon... | {
"repo_name": "kdz/test",
"path": "Plot_test.py",
"copies": "1",
"size": "1223",
"license": "mit",
"hash": 5613676357720987000,
"line_mean": 33.9714285714,
"line_max": 102,
"alpha_frac": 0.5936222404,
"autogenerated": false,
"ratio": 3.706060606060606,
"config_test": false,
"has_no_keywords":... |
__author__ = 'kdsouza'
from Spec import *
from collections import namedtuple
#=========== mock Receiver =============
## This opens a UI, which we do not need to do
# receiver = load_data(filename='/Users/kdsouza/Desktop/Projects/pandas_play/weather_year.csv')
weather_data = pd.read_csv("/Users/kdsouza/Desktop/Pro... | {
"repo_name": "kdz/test",
"path": "SpecNode_demo.py",
"copies": "1",
"size": "1835",
"license": "mit",
"hash": 3270599869642062000,
"line_mean": 26,
"line_max": 95,
"alpha_frac": 0.5847411444,
"autogenerated": false,
"ratio": 3.404452690166976,
"config_test": false,
"has_no_keywords": false,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.