text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Yves Bonjour'
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../common"))
from WerkzeugService import create_status_error_response
from WerkzeugService import create_status_ok_response
from WerkzeugService import WerkzeugService
from werkzeug.routing import Map, Rule
f... | {
"repo_name": "ybonjour/nuus",
"path": "services/newsletter/Service.py",
"copies": "1",
"size": "1883",
"license": "mit",
"hash": 9140321727320308000,
"line_mean": 28.4375,
"line_max": 106,
"alpha_frac": 0.6510886883,
"autogenerated": false,
"ratio": 3.898550724637681,
"config_test": false,
"... |
__author__ = 'Yves Bonjour'
import redis
class Feed(object):
def __init__(self, url, name):
# TODO: how to detect url equality (e.g. case-sensitive)
self.url = url
self.name = name
def get_url(self):
return self.url
def get_name(self):
return self.name
def _... | {
"repo_name": "ybonjour/nuus",
"path": "services/feeds/Feeds.py",
"copies": "1",
"size": "2881",
"license": "mit",
"hash": 6236748241636914000,
"line_mean": 25.2,
"line_max": 92,
"alpha_frac": 0.5848663658,
"autogenerated": false,
"ratio": 3.4014167650531286,
"config_test": false,
"has_no_key... |
__author__ = 'Yves Bonjour'
import requests
from urlparse import urljoin
import json
class IndexProxy(object):
def __init__(self, url):
self.url = url
def index(self, article_id, title, text):
index_url = urljoin(self.url, "index/{article}".format(article=article_id))
payload = {"tit... | {
"repo_name": "ybonjour/nuus",
"path": "common/Proxies.py",
"copies": "1",
"size": "3640",
"license": "mit",
"hash": 2601324919950724600,
"line_mean": 27.8888888889,
"line_max": 102,
"alpha_frac": 0.5906593407,
"autogenerated": false,
"ratio": 3.9013933547695605,
"config_test": false,
"has_no... |
__author__ = 'Yves Bonjour'
import sys
import os
import ConfigParser
from Feeds import Feed
from Feeds import create_feeds
from WerkzeugService import WerkzeugService
from WerkzeugService import create_status_error_response
from WerkzeugService import create_status_ok_response
from WerkzeugService import create_json_r... | {
"repo_name": "ybonjour/nuus",
"path": "services/feeds/Service.py",
"copies": "1",
"size": "2391",
"license": "mit",
"hash": 3436530097710451700,
"line_mean": 32.2222222222,
"line_max": 103,
"alpha_frac": 0.6574654956,
"autogenerated": false,
"ratio": 3.759433962264151,
"config_test": true,
"... |
__author__ = 'Yves Bonjour'
import sys
import os
import uuid
import ConfigParser
from Indexer import create_indexer
from werkzeug.routing import Map, Rule
from WerkzeugService import WerkzeugService
from WerkzeugService import create_status_ok_response
from WerkzeugService import create_status_error_response
from Werk... | {
"repo_name": "ybonjour/nuus",
"path": "services/indexing/Service.py",
"copies": "1",
"size": "3220",
"license": "mit",
"hash": -2558881009575671300,
"line_mean": 35.1797752809,
"line_max": 115,
"alpha_frac": 0.6599378882,
"autogenerated": false,
"ratio": 3.851674641148325,
"config_test": true,... |
__author__ = 'Yves Bonjour'
import unittest
from IndexerMock import IndexerMock
from VectorCalculator import VectorCalculator
import uuid
from math import log10
class VectorCalculatorTest(unittest.TestCase):
def setUp(self):
self.indexer_mock = IndexerMock()
self.calculator = VectorCalculator(sel... | {
"repo_name": "ybonjour/nuus",
"path": "services/clustering/tests/VectorCalculatorTest.py",
"copies": "1",
"size": "5555",
"license": "mit",
"hash": 7113884652379535000,
"line_mean": 29.1902173913,
"line_max": 94,
"alpha_frac": 0.5927992799,
"autogenerated": false,
"ratio": 3.316417910447761,
"... |
__author__ = 'Yves Bonjour'
import unittest
from Feeds import Feed
from Feeds import MemoryFeedStore
from Feeds import RedisFeedStore
from Feeds import Feeds
from FeedStoreMock import FeedStoreMock
import uuid
import redis
class FeedTest(unittest.TestCase):
def test_equals_same_values(self):
# Arrange
... | {
"repo_name": "ybonjour/nuus",
"path": "services/feeds/tests/FeedsTest.py",
"copies": "1",
"size": "7513",
"license": "mit",
"hash": 2021741382842726700,
"line_mean": 24.5544217687,
"line_max": 79,
"alpha_frac": 0.5683481965,
"autogenerated": false,
"ratio": 3.3555158552925413,
"config_test": t... |
__author__ = 'Yves Bonjour'
class Mock(object):
def __init__(self):
self.method_calls = {}
def num_method_calls(self, method):
return len(self.get_calls(method))
def get_calls(self, method):
return self.method_calls.get(method, [])
def get_arguments(self, method, call_nu... | {
"repo_name": "ybonjour/nuus",
"path": "common/Mock.py",
"copies": "1",
"size": "1054",
"license": "mit",
"hash": -5167794697015784000,
"line_mean": 30.9393939394,
"line_max": 94,
"alpha_frac": 0.6157495256,
"autogenerated": false,
"ratio": 3.7777777777777777,
"config_test": false,
"has_no_ke... |
__author__ = 'ywang'
from gevent import monkey
monkey.patch_all()
from flask import Flask, render_template
from flask_socketio import SocketIO, emit
# from flask.ext import assets
app = Flask(__name__)
socketio = SocketIO(app)
# import os
# env = assets.Environment(app)
# env.load_path = [
# os.path.join(os.pat... | {
"repo_name": "gnavvy/JellyFish",
"path": "app.py",
"copies": "1",
"size": "2566",
"license": "mit",
"hash": 8867670535732783000,
"line_mean": 23.9126213592,
"line_max": 69,
"alpha_frac": 0.6130163679,
"autogenerated": false,
"ratio": 2.912599318955732,
"config_test": false,
"has_no_keywords"... |
__author__ = 'ywang'
import numpy as np
from sklearn.neighbors import NearestNeighbors
from nearpy import Engine, hashes, filters
class ApproxCorankingMatrix:
def __init__(self, k=5, qdim=10):
self.n = 0 # number of data points
self.m = 0 # dimension of the vector description of a data point
... | {
"repo_name": "gnavvy/PyNode.vis",
"path": "acrm.py",
"copies": "1",
"size": "2699",
"license": "mit",
"hash": -6651490120297577000,
"line_mean": 35.9726027397,
"line_max": 84,
"alpha_frac": 0.6028158577,
"autogenerated": false,
"ratio": 3.4558258642765685,
"config_test": false,
"has_no_keywo... |
__author__ = 'ywang'
import numpy as np
import pyopencl as cl
from pyopencl.array import vec
from sklearn.neighbors import NearestNeighbors
class Accelerator:
def __init__(self):
self.platform = cl.get_platforms()[0]
self.device = self.platform.get_devices()[0]
self.context = cl.Context([... | {
"repo_name": "gnavvy/PyNode.vis",
"path": "accelerator.py",
"copies": "1",
"size": "2728",
"license": "mit",
"hash": 908276789841493800,
"line_mean": 36.3835616438,
"line_max": 109,
"alpha_frac": 0.5780791789,
"autogenerated": false,
"ratio": 3.4884910485933505,
"config_test": false,
"has_no... |
__author__ = 'ywang'
import numpy as np
np.set_printoptions(precision=4)
np.set_printoptions(threshold=1000)
np.set_printoptions(linewidth=1000)
np.set_printoptions(suppress=True)
import pandas as pd
pd.set_option('display.width', 1000)
pd.set_option('display.max_rows', 50)
from sklearn.neighbors import NearestNeigh... | {
"repo_name": "gnavvy/JellyFish",
"path": "script/reveal/coranking.py",
"copies": "1",
"size": "1533",
"license": "mit",
"hash": -5707568612330671000,
"line_mean": 30.2857142857,
"line_max": 98,
"alpha_frac": 0.6288323549,
"autogenerated": false,
"ratio": 3.103238866396761,
"config_test": false... |
__author__ = 'yyekovenko'
from base_rest_helper import *
class InstanceHelper(BaseRESTHelper):
def __init__(self, utils, auth):
"""
Arguments:
- utils: instance of Utils class
- auth: instance of AuthenticationHelper class
"""
super(InstanceHelper, self).__ini... | {
"repo_name": "sysbot/aurora",
"path": "qa/common/rest/compute_helper.py",
"copies": "2",
"size": "13392",
"license": "apache-2.0",
"hash": -3871602792472412000,
"line_mean": 36.940509915,
"line_max": 117,
"alpha_frac": 0.5381571087,
"autogenerated": false,
"ratio": 4.1981191222570535,
"config_... |
__author__ = 'yyyar'
from .validation import parameters, parameters_presets
from .serializers import json
ident = lambda _:_
class Pyappi:
"""
Pyappi base class
"""
def __init__(self, adapter=ident, serializer=json, formatter=ident, **kw):
"""
Creates new instance of Pyappi
... | {
"repo_name": "yyyar/pyappi",
"path": "pyappi/__init__.py",
"copies": "1",
"size": "1223",
"license": "bsd-3-clause",
"hash": -3900493690715353600,
"line_mean": 19.3833333333,
"line_max": 78,
"alpha_frac": 0.4995911693,
"autogenerated": false,
"ratio": 4.650190114068441,
"config_test": false,
... |
__author__ = 'yyyar'
import datetime
import os
from django.conf.urls.defaults import patterns
from pyappi import Pyappi
from pyappi.helpers import int_convert, date_current, date_convert
from pyappi.helpers.presets import limitable
from pyappi.adapters import django_adapter
from pyappi.formatters import simple_formatt... | {
"repo_name": "yyyar/pyappi",
"path": "examples/dj.py",
"copies": "1",
"size": "1267",
"license": "bsd-3-clause",
"hash": -6126780980426574000,
"line_mean": 24.34,
"line_max": 75,
"alpha_frac": 0.6219415943,
"autogenerated": false,
"ratio": 3.3607427055702916,
"config_test": false,
"has_no_ke... |
__author__ = 'yyyar'
import datetime
from flask import Flask
from pyappi import Pyappi
from pyappi.serializers import json
from pyappi.formatters import simple_formatter
from pyappi.helpers import int_convert, date_current, date_convert
from pyappi.helpers.presets import limitable
from pyappi.adapters import flask_a... | {
"repo_name": "yyyar/pyappi",
"path": "examples/fl.py",
"copies": "1",
"size": "1308",
"license": "bsd-3-clause",
"hash": 6620201920949552000,
"line_mean": 23.2222222222,
"line_max": 75,
"alpha_frac": 0.5993883792,
"autogenerated": false,
"ratio": 3.353846153846154,
"config_test": false,
"has... |
__author__ = 'yyyar'
import types
from functools import wraps
from .exceptions import ParamValidationError
def parameters_presets(*params):
"""
Combines parameters from a several presets
"""
d = {}
for e in params:
d.update(e)
return parameters(d, allow_undeclared=True)
def parame... | {
"repo_name": "yyyar/pyappi",
"path": "pyappi/validation.py",
"copies": "1",
"size": "3438",
"license": "bsd-3-clause",
"hash": -4328636357282646000,
"line_mean": 32.0576923077,
"line_max": 120,
"alpha_frac": 0.5043630017,
"autogenerated": false,
"ratio": 4.722527472527473,
"config_test": false... |
__author__ = 'yyyar'
# package
from functools import wraps
from pyappi.exceptions import ParamValidationError, ApiError
def no_formatter(f):
'''
No format at all
'''
return f
def simple_formatter(f):
'''
Simple formatter with exception handling
'''
@wraps(f)
def inner(requ... | {
"repo_name": "yyyar/pyappi",
"path": "pyappi/formatters.py",
"copies": "1",
"size": "1223",
"license": "bsd-3-clause",
"hash": 4357294802173089000,
"line_mean": 19.7288135593,
"line_max": 60,
"alpha_frac": 0.4979558463,
"autogenerated": false,
"ratio": 3.858044164037855,
"config_test": false,
... |
__author__ = 'y.zhou'
import getpass, os, socket, select
try:
import SocketServer
except ImportError:
import socketserver as SocketServer
import sys
import paramiko
SSH_PORT = 22
DEFAULT_PORT = 4000
g_verbose = True
class ForwardServer (SocketServer.ThreadingTCPServer):
daemon_threads = True
all... | {
"repo_name": "TextMiningToolKitTeam/MiningUtils",
"path": "connection.py",
"copies": "1",
"size": "4030",
"license": "isc",
"hash": -7935397451568814000,
"line_mean": 31.7642276423,
"line_max": 116,
"alpha_frac": 0.5692307692,
"autogenerated": false,
"ratio": 4.021956087824352,
"config_test": ... |
__author__ = "Zachary Estep"
import logging
import os
try:
import simplejson as json
except ImportError:
import json
from flask import Flask, request, make_response, Response
from test.utils.generate_test_data import get_random_hex, get_random_fqdn, get_random_ip
def get_mocked_server(path):
mocked... | {
"repo_name": "carbonblack/cb-threatconnect-connector",
"path": "test/utils/threatconnect_mock_server.py",
"copies": "1",
"size": "6875",
"license": "mit",
"hash": 6323309380595144000,
"line_mean": 39.4411764706,
"line_max": 170,
"alpha_frac": 0.3936,
"autogenerated": false,
"ratio": 4.7610803324... |
__author__ = 'Zachary'
__author__ = 'Zachary'
from negotiator_base import BaseNegotiator
from itertools import permutations
from random import sample
from functools import reduce
class dummy_Negotiator(BaseNegotiator):
# initialize(self : BaseNegotiator, preferences : list(String), iter_limit : Int)
... | {
"repo_name": "zws3mb/CS4710HW3",
"path": "dummyN.py",
"copies": "1",
"size": "7082",
"license": "mit",
"hash": -854002575861407700,
"line_mean": 44.9006622517,
"line_max": 169,
"alpha_frac": 0.5415136967,
"autogenerated": false,
"ratio": 4.079493087557604,
"config_test": false,
"has_no_keywo... |
__author__ = 'Zachary'
from negotiator_base import BaseNegotiator
from itertools import permutations
from random import sample
from functools import reduce
class zws3mb_Negotiator(BaseNegotiator):
# initialize(self : BaseNegotiator, preferences : list(String), iter_limit : Int)
# Performs per-round... | {
"repo_name": "zws3mb/CS4710HW3",
"path": "zws3mb.py",
"copies": "1",
"size": "7905",
"license": "mit",
"hash": 4255379951852627500,
"line_mean": 45.9090909091,
"line_max": 169,
"alpha_frac": 0.5330803289,
"autogenerated": false,
"ratio": 4.162717219589258,
"config_test": false,
"has_no_keywo... |
__author__ = "Zachary Yocum"
__email__ = "zyocum@brandeis.edu"
import corpus, re, shutil
from warnings import warn
home = os.environ['HOME']
base_path = os.path.join(home, 'Dropbox', 'ISO-Space', 'Annotation')
os.chdir(base_path)
corpora_path, corpora, other_files = os.walk(os.getcwd()).next()
with open('Annotators.t... | {
"repo_name": "sethmachine/iaa",
"path": "Corpora/annotation_manager.py",
"copies": "1",
"size": "2652",
"license": "mit",
"hash": 314999889547307260,
"line_mean": 36.8857142857,
"line_max": 122,
"alpha_frac": 0.6150075415,
"autogenerated": false,
"ratio": 3.5502008032128516,
"config_test": fal... |
__author__ = "Zachary Yocum"
__email__ = "zyocum@brandeis.edu"
import os
from warnings import warn
from bs4 import BeautifulSoup as BS, CData
from bs4.element import Tag
dummy_tag = Tag(name='NULL')
# Classes
class Extent(object):
"""A class for loading tagged data from XML doc
with surrounding token and ta... | {
"repo_name": "sethmachine/iaa",
"path": "Corpora/corpus.py",
"copies": "1",
"size": "14949",
"license": "mit",
"hash": 4291134120769947000,
"line_mean": 42.3304347826,
"line_max": 131,
"alpha_frac": 0.5477289451,
"autogenerated": false,
"ratio": 3.88891779396462,
"config_test": false,
"has_n... |
__author__ = 'Zachery Thomas'
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy import API
from haiku import haiku
from config import *
import unicodedata
import threading
import time
import re
global api, MIN_TO_WAIT, tweet_found
MIN_TO_WAIT = 120
SEC_... | {
"repo_name": "ZacheryThomas/HiddenHaiku",
"path": "main.py",
"copies": "1",
"size": "1944",
"license": "apache-2.0",
"hash": -8981663611716158000,
"line_mean": 23.6075949367,
"line_max": 99,
"alpha_frac": 0.6265432099,
"autogenerated": false,
"ratio": 3.613382899628253,
"config_test": false,
... |
"""Author: Zach Hiris"""
import math
from html import escape
from io import StringIO
from paste.request import parse_formvars
from pyiem.util import html_escape
def createCircleAroundWithRadius(lat, lon, radiusMiles):
"""Create circle."""
latArray = []
lonArray = []
for brng in range(0, 360):
... | {
"repo_name": "akrherz/iem",
"path": "cgi-bin/request/grx_rings.py",
"copies": "1",
"size": "2918",
"license": "mit",
"hash": 3634867760899690500,
"line_mean": 29.3958333333,
"line_max": 78,
"alpha_frac": 0.5531185744,
"autogenerated": false,
"ratio": 3.061909758656873,
"config_test": false,
... |
__author__ = 'Zack Gainsforth'
__copyright__ = 'Copyright 2016, Zack Gainsforth'
__email__ = 'zsg@gainsforth.com'
import matplotlib
matplotlib.use('WXagg')#'Qt4Agg')
from matplotlib.pyplot import *
from numpy import *
import PhysicsBasics as pb
def GetAbsorptionCurve(E, WtPct, rho):
"""GetAbsorptionCurve(E, WtPct... | {
"repo_name": "ZGainsforth/StoichiometryFitter",
"path": "AbsorptionCorrection.py",
"copies": "1",
"size": "7564",
"license": "epl-1.0",
"hash": -8083144469989674000,
"line_mean": 40.5604395604,
"line_max": 158,
"alpha_frac": 0.6675039662,
"autogenerated": false,
"ratio": 3.0123456790123457,
"c... |
__author__ = 'Zack Gainsforth'
__copyright__ = 'Copyright 2016, Zack Gainsforth'
__email__ = 'zsg@gainsforth.com'
import StringIO
import numpy as np
import pickle
import itertools
#import PeakTypes
#from DetectorPhysics import *
ElamLoaded = False # We only want to load the Elam database once. Keep track of if that ... | {
"repo_name": "ZGainsforth/StoichiometryFitter",
"path": "CharacteristicEmission.py",
"copies": "1",
"size": "6817",
"license": "epl-1.0",
"hash": 4615136130995963000,
"line_mean": 41.0802469136,
"line_max": 144,
"alpha_frac": 0.6502860496,
"autogenerated": false,
"ratio": 3.6183651804670913,
"... |
__author__ = 'Zack Gainsforth'
__copyright__ = 'Copyright 2016, Zack Gainsforth'
__email__ = 'zsg@gainsforth.com'
import wx
import inspect
import pickle
# From http://code.activestate.com/recipes/410692/
# This class provides the functionality we want. You only need to look at
# this if you want to know how this work... | {
"repo_name": "ZGainsforth/StoichiometryFitter",
"path": "MyPython.py",
"copies": "1",
"size": "4152",
"license": "epl-1.0",
"hash": 6755889748186813000,
"line_mean": 30.4545454545,
"line_max": 141,
"alpha_frac": 0.6365606936,
"autogenerated": false,
"ratio": 3.79871912168344,
"config_test": fa... |
__author__ = 'zackory'
# Check out the pigpio library
# http://abyz.co.uk/rpi/pigpio/download.html
# http://abyz.co.uk/rpi/pigpio/python.html
import time
import pygame
import pigpio
class Button:
A = 0
B = 1
X = 2
Y = 3
LBumper = 4
RBumper = 5
class Axis:
LThumbX = 0
LThumbY = 1
... | {
"repo_name": "Zackory/Robotic-Pi-Arm",
"path": "pigpioLauncher.py",
"copies": "1",
"size": "3586",
"license": "mit",
"hash": -764068751334290000,
"line_mean": 24.2535211268,
"line_max": 102,
"alpha_frac": 0.6319018405,
"autogenerated": false,
"ratio": 2.92734693877551,
"config_test": false,
... |
__author__ = 'zackory'
import lightblue
import RPi.GPIO as gpio
def createPWMs(ports, hz=100):
for i in ports:
gpio.setup(i, gpio.OUT)
# Setup pwm ports using specified Hz
return [gpio.PWM(i, hz) for i in ports]
def angleToPos(angle, hz=100):
# For 50 Hz: Min 2.5 (0 degrees), Max 12.5 (180 de... | {
"repo_name": "Zackory/Robotic-Pi-Arm",
"path": "armLauncher.py",
"copies": "1",
"size": "1670",
"license": "mit",
"hash": -1062766534417258600,
"line_mean": 25.5079365079,
"line_max": 101,
"alpha_frac": 0.6862275449,
"autogenerated": false,
"ratio": 3.0035971223021583,
"config_test": false,
... |
__author__ = 'zackory'
import os
import time
import pygame
def pwm(pin, angle):
# Angle between 0 and 250
# print "servo[" + str(pin) + "][" + str(angle) + "]"
cmd = "echo " + str(pin) + "=" + str(angle) + " > /dev/servoblaster"
os.system(cmd)
class Button:
A = 0
B = 1
X = 2
Y = 3
... | {
"repo_name": "Zackory/Robotic-Pi-Arm",
"path": "servoblasterLauncher.py",
"copies": "1",
"size": "3440",
"license": "mit",
"hash": 3790317521253228500,
"line_mean": 22.0872483221,
"line_max": 102,
"alpha_frac": 0.6084302326,
"autogenerated": false,
"ratio": 2.937660119555935,
"config_test": fa... |
__author__ = 'zackory'
import time
import pygame
import lightblue
# Connect to bluetooth on Raspberry Pi
s = lightblue.socket()
s.connect(('00:0A:3A:84:1F:A6', 5))
# Initialize arm positions
done = False
base = 90
arm = 90
forearm = 90
gripper = 10
pygame.init()
screen = pygame.display.set_mode((1, 1))
while not d... | {
"repo_name": "Zackory/Robotic-Pi-Arm",
"path": "controller.py",
"copies": "1",
"size": "1315",
"license": "mit",
"hash": 177120827395356260,
"line_mean": 20.9166666667,
"line_max": 100,
"alpha_frac": 0.5847908745,
"autogenerated": false,
"ratio": 2.8098290598290596,
"config_test": false,
"ha... |
__author__ = 'zackory'
import time
import pygame
import pigpio
class Button:
A = 0
B = 1
X = 2
Y = 3
LBumper = 4
RBumper = 5
class Axis:
LThumbX = 0
LThumbY = 1
LTrigger = 2
RThumbX = 3
RThumbY = 4
RTrigger = 5
def angleToPos(angle, hz=100):
return 1000 + angle/18... | {
"repo_name": "Zackory/Robotic-Pi-Arm",
"path": "beginnings/pigpioLauncherOld.py",
"copies": "1",
"size": "3745",
"license": "mit",
"hash": 532969074072443140,
"line_mean": 23.9666666667,
"line_max": 102,
"alpha_frac": 0.6360480641,
"autogenerated": false,
"ratio": 2.900852052672347,
"config_te... |
__author__ = 'zackory'
import time
import pygame
import RPi.GPIO as gpio
class Button:
A = 0
B = 1
X = 2
Y = 3
LBumper = 4
RBumper = 5
class Axis:
LThumbX = 0
LThumbY = 1
LTrigger = 2
RThumbX = 3
RThumbY = 4
RTrigger = 5
def createPWMs(ports, hz=100):
for i in por... | {
"repo_name": "Zackory/Robotic-Pi-Arm",
"path": "ArmLauncherWithController.py",
"copies": "1",
"size": "3765",
"license": "mit",
"hash": -172919387588993860,
"line_mean": 23.2903225806,
"line_max": 102,
"alpha_frac": 0.626560425,
"autogenerated": false,
"ratio": 2.9599056603773586,
"config_test... |
__author__ = 'Zander'
from Vector3 import Vector3
class Mesh:
def __init__(self, name, filename, position=Vector3(0,0,0), rotation=Vector3(0,0,0), scale=1):
self.name = name
self.vertices = self.loadOBJ(filename, "vertices")
self.normals = self.loadOBJ(filename, "normals")
self.fac... | {
"repo_name": "blasinzw/Py3D",
"path": "Mesh.py",
"copies": "2",
"size": "1939",
"license": "mit",
"hash": -2634063654545779700,
"line_mean": 35.6037735849,
"line_max": 98,
"alpha_frac": 0.493553378,
"autogenerated": false,
"ratio": 3.7650485436893204,
"config_test": false,
"has_no_keywords":... |
__author__ = 'Zander'
import math
import numpy as np
class Vector3:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
self.length = math.sqrt(x**2 + y**2 + z**2)
def __add__(self, other):
return Vector3(self.x + other.x, self.y + other.y, self.z + other.z)
... | {
"repo_name": "Off-By-1/Py3D",
"path": "Vector3.py",
"copies": "2",
"size": "2213",
"license": "mit",
"hash": 8430500896395608000,
"line_mean": 32.0298507463,
"line_max": 78,
"alpha_frac": 0.5417984636,
"autogenerated": false,
"ratio": 2.974462365591398,
"config_test": false,
"has_no_keywords... |
__author__ = 'Zander'
from pygame import gfxdraw
from Vector2 import Vector2
from Vector4 import Vector4
from Vector3 import Vector3
from Matrix4 import Matrix4
import math, pygame
import numpy as np
class Renderer:
def __init__(self, screen, width, height, scale=1):
self.width = width
self.heig... | {
"repo_name": "blasinzw/Py3D",
"path": "Renderer.py",
"copies": "2",
"size": "9789",
"license": "mit",
"hash": 3304238087269963300,
"line_mean": 36.0833333333,
"line_max": 150,
"alpha_frac": 0.5190519971,
"autogenerated": false,
"ratio": 3.60419734904271,
"config_test": false,
"has_no_keyword... |
__author__ = 'Zander'
import numpy as np
import math
class Matrix4:
def __init__(self):
pass
#all functions take a Vector3 for second parameter
def get_translation_matrix(self, v):
matrix = np.array([[1,0,0,0],
[0,1,0,0],
[0,0,1,0],
... | {
"repo_name": "Off-By-1/Py3D",
"path": "Matrix4.py",
"copies": "2",
"size": "1953",
"license": "mit",
"hash": -1584303355224824000,
"line_mean": 30.0158730159,
"line_max": 83,
"alpha_frac": 0.434203789,
"autogenerated": false,
"ratio": 3.3270868824531514,
"config_test": false,
"has_no_keyword... |
__author__ = 'Zander'
import pygame, sys, time
from Camera import Camera
from Vector2 import Vector2
from Vector3 import Vector3
from Mesh import Mesh
from Renderer import Renderer
from Light import Light
# pygame stuff
SCREEN_SIZE = [800, 600]
pygame.init()
screen = pygame.display.set_mode((SCREEN_SIZE))
#renderer... | {
"repo_name": "blasinzw/Py3D",
"path": "main.py",
"copies": "2",
"size": "2673",
"license": "mit",
"hash": 2393629836165212000,
"line_mean": 25.2058823529,
"line_max": 86,
"alpha_frac": 0.5548073326,
"autogenerated": false,
"ratio": 3.4269230769230767,
"config_test": false,
"has_no_keywords":... |
__author__ = 'Zane Thorn'
class CategoricalTemplate(type):
__allow_multiple__ = False
def __new__(meta, name, bases, dct):
# if not '__allow_multiple__' in dct:
# dct['__allow_multiple__'] = False
print('calling __new__ template %s' % name)
return type.__new__(meta, nam... | {
"repo_name": "zanethorn/d20",
"path": "d20/core/test.py",
"copies": "1",
"size": "3390",
"license": "mit",
"hash": 1711705902110294500,
"line_mean": 27.7288135593,
"line_max": 83,
"alpha_frac": 0.5315634218,
"autogenerated": false,
"ratio": 3.6530172413793105,
"config_test": false,
"has_no_k... |
__author__ = 'Zaxy'
class Item(object):
""" Base class for all items in the game """
def __init__(self, name, description, durability, kind):
self.name = name
self.description = description
self.durability = durability
self.kind = kind
def get_item(self):
item = {"... | {
"repo_name": "zaxy13/rpg_hack",
"path": "Game_libs/Items.py",
"copies": "1",
"size": "2004",
"license": "mit",
"hash": -8070862489877295000,
"line_mean": 28.0434782609,
"line_max": 124,
"alpha_frac": 0.6112774451,
"autogenerated": false,
"ratio": 3.572192513368984,
"config_test": false,
"has... |
__author__ = 'zeek'
import time
import notify2
from splinter import Browser
import html
browser = Browser()
browser.visit('http://www.douyutv.com/zeek')
last_list = 0
last_yuwan = 0
while True:
if last_list % 20 == 10:
browser.reload()
time.sleep(2)
try:
element_list_chat = browser.find_b... | {
"repo_name": "zephyrzoom/douyu",
"path": "test/splinter_t.py",
"copies": "1",
"size": "1248",
"license": "mit",
"hash": -3761125288097220000,
"line_mean": 30,
"line_max": 79,
"alpha_frac": 0.5983870968,
"autogenerated": false,
"ratio": 3.2804232804232805,
"config_test": false,
"has_no_keywor... |
__author__ = 'zehira'
import csv, os, argparse
from collections import defaultdict
parser = argparse.ArgumentParser(prog = "Compare_IMPACT_Results.py", description="Compare results of two different IMPACT runs and create tables showing differences", usage = "%(prog)s [options]")
parser.add_argument('-f1', '--IMPACT-r... | {
"repo_name": "rhshah/Miscellaneous",
"path": "Compare_IMPACT_Results.py",
"copies": "1",
"size": "15217",
"license": "apache-2.0",
"hash": -5091599383941046000,
"line_mean": 43.8879056047,
"line_max": 452,
"alpha_frac": 0.5478083722,
"autogenerated": false,
"ratio": 3.153782383419689,
"config_... |
__author__ = 'zelgadis'
import bpy
import sys
UPDATE = "update"
WIDTH = "width"
HEIGHT = "height"
STEREO_CAMERA = "camera"
AUDIOFILE = "audiofile"
FORMAT = "format"
CYCLES_SAMPLES = "cycles_samples"
PRERENDER_COUNT = "prerender_count"
GPU_DEVICE = "gpu_device"
params = {UPDATE: False,
WIDTH: 480,
... | {
"repo_name": "morevnaproject/RenderChan",
"path": "renderchan/contrib/blender/render.py",
"copies": "1",
"size": "12222",
"license": "bsd-3-clause",
"hash": -2501701331631045000,
"line_mean": 40.2905405405,
"line_max": 188,
"alpha_frac": 0.549255441,
"autogenerated": false,
"ratio": 3.9451258876... |
__author__ = 'zelgadis'
import os
from urllib.error import HTTPError
from urllib.request import urlopen, Request
from html.parser import HTMLParser
from renderchan.metadata import RenderChanMetadata
class MyHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.artist = None
... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/contrib/metadata/freesound.py",
"copies": "1",
"size": "4343",
"license": "bsd-3-clause",
"hash": -2441277589711687000,
"line_mean": 32.9296875,
"line_max": 107,
"alpha_frac": 0.5328114207,
"autogenerated": false,
"ratio": 3.689889549... |
__author__ = 'zephaniahgrunschlag'
'''
According to legend (and p. 8 of "Concrete Math") Josephus and a co-conspirator survived
a 41 member suicide circle in which each person killed not his next in line, but the one
after.
Where did Josephus and his friend stand in order to survive?
'''
import io
from util.zio impo... | {
"repo_name": "tzaffi/concrete_math",
"path": "Chapter1/historic_josephus.py",
"copies": "1",
"size": "1824",
"license": "mit",
"hash": -4066433778094014500,
"line_mean": 28.4193548387,
"line_max": 122,
"alpha_frac": 0.5756578947,
"autogenerated": false,
"ratio": 2.923076923076923,
"config_test... |
__author__ = 'zephaniahgrunschlag'
"""
Chapter 1 of "Concrete Mathematics" has a wonderful treatment of the Josephus
problem in great detail. The problem is generalized to the recurrence relation
f(j) = alpha_j for 1 <= j < d
f(d*n+j) = c*f(n) + beta_j for 0 <= j < d and n >= 1
The most elegant approac... | {
"repo_name": "tzaffi/concrete_math",
"path": "Chapter1/generalized_josephus.py",
"copies": "1",
"size": "3244",
"license": "mit",
"hash": 5665148828965561000,
"line_mean": 38.5731707317,
"line_max": 122,
"alpha_frac": 0.5906288533,
"autogenerated": false,
"ratio": 3.458422174840085,
"config_te... |
__author__ = 'zephaniahgrunschlag'
class Radix:
@staticmethod
def number(x, base=10):
"""
Use Horner's method to convert (x)_base to a number.
:param x: an enumerable containing strings (such as a string)
:type x:
:param base:
:type base:
:return:
... | {
"repo_name": "tzaffi/concrete_math",
"path": "Chapter1/radix.py",
"copies": "1",
"size": "1127",
"license": "mit",
"hash": -4482148933437844500,
"line_mean": 24.0666666667,
"line_max": 100,
"alpha_frac": 0.4880212955,
"autogenerated": false,
"ratio": 3.9823321554770317,
"config_test": false,
... |
__author__ = 'zephyre'
from datetime import datetime
import alfred
from bson import ObjectId
from bson.errors import InvalidId
def process(query_str):
""" Entry point """
query_str = query_str.strip().lower() if query_str else ''
results = []
if query_str == 'gen':
ret = gen_objectid_result... | {
"repo_name": "haizi-zh/alfred-workflow-objectid",
"path": "process.py",
"copies": "2",
"size": "2546",
"license": "apache-2.0",
"hash": -7840985814865100000,
"line_mean": 24.7171717172,
"line_max": 113,
"alpha_frac": 0.6080125687,
"autogenerated": false,
"ratio": 3.4498644986449865,
"config_te... |
__author__ = 'zephyre'
from kombu import Exchange, Queue
CELERY_ACCEPT_CONTENT = ['json']
CELERY_QUEUES = (
Queue('yunkai.createUser.contact', Exchange('yunkai.createUser', type='fanout')),
Queue('yunkai.login.contact', Exchange('yunkai.login', type='fanout')),
# Queue('yunkai.resetPassword.contact', Exc... | {
"repo_name": "haizi-zh/ApiumWorker",
"path": "apiumworker/contact/celery_config.py",
"copies": "1",
"size": "1349",
"license": "mit",
"hash": 3685423591559345000,
"line_mean": 63.2380952381,
"line_max": 107,
"alpha_frac": 0.7309117865,
"autogenerated": false,
"ratio": 3.339108910891089,
"confi... |
__author__ = 'zephyre'
def __init_app():
from celery import Celery
from apiumworker.etcd_conf import get_config, project_conf
runlevel = project_conf['runlevel']
if runlevel == 'production':
apiumworker_name = 'apiumworker'
elif runlevel == 'dev':
apiumworker_name = 'apiumworker-d... | {
"repo_name": "haizi-zh/ApiumWorker",
"path": "apiumworker/sms/app.py",
"copies": "1",
"size": "1129",
"license": "mit",
"hash": 285727541933901660,
"line_mean": 32.2058823529,
"line_max": 115,
"alpha_frac": 0.5783879539,
"autogenerated": false,
"ratio": 3.814189189189189,
"config_test": false,... |
__author__ = 'zeraien'
def name(action_name):
"""custom action name, does not override prefix"""
def decorator(action_function):
"""custom action name, does not override prefix"""
action_function.action_name = action_name
return action_function
return decorator
def prefix(action_p... | {
"repo_name": "zeraien/django-url-framework",
"path": "django_url_framework/decorators/action_options.py",
"copies": "1",
"size": "3222",
"license": "mit",
"hash": 235428497809165120,
"line_mean": 35.202247191,
"line_max": 107,
"alpha_frac": 0.6986343886,
"autogenerated": false,
"ratio": 4.336473... |
__author__ = 'Zero'
import six
class DjangoUnicodeDecodeError(UnicodeDecodeError):
def __init__(self, obj, *args):
self.obj = obj
UnicodeDecodeError.__init__(self, *args)
def __str__(self):
original = UnicodeDecodeError.__str__(self)
return '%s. You passed in %r (%s)' % (orig... | {
"repo_name": "xuweiliang/Codelibrary",
"path": "novaclient/v2/encoding.py",
"copies": "1",
"size": "1308",
"license": "apache-2.0",
"hash": 7370889756385141000,
"line_mean": 30.9024390244,
"line_max": 73,
"alpha_frac": 0.505351682,
"autogenerated": false,
"ratio": 4.126182965299685,
"config_te... |
__author__ = 'zeroonehacker'
from django import forms
from django.contrib.auth.models import User
from .models import UserDetails
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput(attrs={'class':'form-control','pattern':'.{8,}','title':'8 characters minimum','placeholder':'8 ch... | {
"repo_name": "zero1hac/humanityadm",
"path": "register/forms.py",
"copies": "1",
"size": "1441",
"license": "mit",
"hash": 4383989100250346500,
"line_mean": 50.5,
"line_max": 239,
"alpha_frac": 0.7002081888,
"autogenerated": false,
"ratio": 3.9371584699453552,
"config_test": false,
"has_no_k... |
__author__ = 'zeroonehacker'
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch
import datetime
import os.path
data = {'user':'user','gate_status':'gate_status','gate_exam':'gate_exam','dop':'dop','ereceipt':'34','gender':'gender','phys':'phys','mobile':'mobile','full_name':'full_name','mother_na... | {
"repo_name": "zero1hac/humanityadm",
"path": "register/pdf.py",
"copies": "1",
"size": "10454",
"license": "mit",
"hash": -8633665299925542000,
"line_mean": 53.7329842932,
"line_max": 314,
"alpha_frac": 0.6638607232,
"autogenerated": false,
"ratio": 2.85784581738655,
"config_test": false,
"h... |
__author__ = 'Zero'
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from django.utils.translation import pgettext_lazy
from django import template
from openstack_dashboard.dashboards.admin.systemlogs import trans
import logging
LOG = logging.getLogger(__name__)
class Downl... | {
"repo_name": "xuweiliang/Codelibrary",
"path": "openstack_dashboard/dashboards/admin/systemlogs/tables.py",
"copies": "1",
"size": "2304",
"license": "apache-2.0",
"hash": -6746100596297908000,
"line_mean": 34,
"line_max": 107,
"alpha_frac": 0.6154513889,
"autogenerated": false,
"ratio": 3.76470... |
__author__ = 'Zero'
from horizon import tables
from openstack_dashboard.dashboards.admin.systemlogs \
import tables as project_tables
from openstack_dashboard import api
from horizon import exceptions
from django.utils.translation import ugettext_lazy as _
from horizon.utils import functions as utils
impo... | {
"repo_name": "xuweiliang/Codelibrary",
"path": "openstack_dashboard/dashboards/admin/systemlogs/views.py",
"copies": "1",
"size": "5190",
"license": "apache-2.0",
"hash": 7947825155708396000,
"line_mean": 33.306122449,
"line_max": 78,
"alpha_frac": 0.5483622351,
"autogenerated": false,
"ratio": ... |
"""Definitions for shotwell database. Generated by sqlacodegen."""
from sqlalchemy import Column, Float, Integer, Table, Text, text
from sqlalchemy.sql.sqltypes import NullType
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class BackingPhotoTable(Base):... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/db/shotwell/tables.py",
"copies": "1",
"size": "6139",
"license": "mit",
"hash": -1067390757980286700,
"line_mean": 28.9463414634,
"line_max": 68,
"alpha_frac": 0.6895259814,
"autogenerated": false,
"ratio": 3.5858644859813085,
"con... |
from myarchive.db.tag_db.tables.association_tables import (
at_ljcomment_tag, at_ljentry_tag)
from myarchive.db.tag_db.tables.base import Base
from sqlalchemy import (
Column, Integer, String, TIMESTAMP, ForeignKey, UniqueConstraint)
from sqlalchemy.orm import backref, relationship
from sqlalchemy.orm.exc impo... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/db/tag_db/tables/ljtables.py",
"copies": "1",
"size": "6170",
"license": "mit",
"hash": 5505031504578843000,
"line_mean": 28.9514563107,
"line_max": 77,
"alpha_frac": 0.6055105348,
"autogenerated": false,
"ratio": 3.7599024984765386,
... |
"""Generic database module using SQLAlchemy."""
import logging
from sqlalchemy import create_engine, event
from sqlalchemy.engine.url import URL as SQLAlchemyURL
from sqlalchemy.orm import sessionmaker, scoped_session
# Get the module logger.
logger = logging.getLogger(__name__)
class DB(object):
"""Database ... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/db/db.py",
"copies": "1",
"size": "3698",
"license": "mit",
"hash": -8995700709305472000,
"line_mean": 38.7634408602,
"line_max": 90,
"alpha_frac": 0.5935640887,
"autogenerated": false,
"ratio": 4.3,
"config_test": false,
"has_no_... |
"""Handles imports from shotwell databases."""
from multiprocessing import Pool
from collections import defaultdict
from logging import getLogger
from os.path import expanduser
from myarchive.db.tag_db.tables import TrackedFile, Tag
from myarchive.db.tag_db.tables.file import get_md5sum_by_filename
from myarchive.d... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/libs/myarchive/shotwell.py",
"copies": "1",
"size": "3626",
"license": "mit",
"hash": 1352970512388844000,
"line_mean": 34.5490196078,
"line_max": 78,
"alpha_frac": 0.6235521236,
"autogenerated": false,
"ratio": 3.401500938086304,
"... |
import logging
import os
from logging.handlers import RotatingFileHandler
class ColoredFormatter(logging.Formatter):
"""Special custom formatter for colorizing log messages!"""
BLACK = '\033[0;30m'
RED = '\033[0;31m'
GREEN = '\033[0;32m'
BROWN = '\033[0;33m'
BLUE = '\033[0;34m'
PURPLE =... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/util/logger.py",
"copies": "1",
"size": "4321",
"license": "mit",
"hash": -1579620893750814500,
"line_mean": 30.0863309353,
"line_max": 77,
"alpha_frac": 0.6035639898,
"autogenerated": false,
"ratio": 3.212639405204461,
"config_test... |
import logging
from gi.repository import Gtk, GLib, GdkPixbuf
from myarchive.db.tables import TrackedFile, Tag
# Get the module logger.
logger = logging.getLogger(__name__)
class MainWindow(Gtk.Window):
def __init__(self, tag_db):
Gtk.Window.__init__(self, title="myarchive")
# Configure self... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/gui.py",
"copies": "1",
"size": "8250",
"license": "mit",
"hash": -788758263831938000,
"line_mean": 32.4008097166,
"line_max": 77,
"alpha_frac": 0.5922424242,
"autogenerated": false,
"ratio": 3.642384105960265,
"config_test": false,... |
import os
from datetime import datetime
from logging import getLogger
from sqlalchemy.orm.exc import NoResultFound
from myarchive.db.tag_db.tables.file import TrackedFile
from myarchive.db.tag_db.tables.tag import Tag
from myarchive.db.tag_db.tables.yttables import YTPlaylist, YTVideo
from myarchive.libs import pafy... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/libs/myarchive/youtube.py",
"copies": "1",
"size": "3388",
"license": "mit",
"hash": 6543035532147077000,
"line_mean": 36.6444444444,
"line_max": 79,
"alpha_frac": 0.563459268,
"autogenerated": false,
"ratio": 4.151960784313726,
"co... |
"""Main database used by myarchive."""
import logging
import fnmatch
import os
from myarchive.db.db import DB
from myarchive.db.tag_db.tables import Base, TrackedFile, Tweet
# Get the module logger.
LOGGER = logging.getLogger(__name__)
class TagDB(DB):
def __init__(self,
drivername=None, us... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/db/tag_db/tag_db.py",
"copies": "1",
"size": "3030",
"license": "mit",
"hash": 1686239779295960300,
"line_mean": 34.6470588235,
"line_max": 77,
"alpha_frac": 0.5620462046,
"autogenerated": false,
"ratio": 4.002642007926024,
"config_... |
"""
Module containing class definitions for files to be tagged.
"""
import hashlib
import imghdr
import logging
import os
import requests
import shutil
from hashlib import md5
from urllib.parse import urlparse
from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import backref, relationship
from sqlalc... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/db/tag_db/tables/file.py",
"copies": "1",
"size": "9717",
"license": "mit",
"hash": 8361242456850473000,
"line_mean": 35.530075188,
"line_max": 79,
"alpha_frac": 0.5820726562,
"autogenerated": false,
"ratio": 4.134893617021277,
"con... |
"""
Module containing class definitions for files to be tagged.
"""
import logging
import re
from sqlalchemy import (
Boolean, Column, Integer, String, Text, ForeignKey)
from sqlalchemy.orm import backref, relationship
from myarchive.db.tag_db.tables.association_tables import (
at_tweet_tag, at_tweet_file, ... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/db/tag_db/tables/twittertables.py",
"copies": "1",
"size": "5817",
"license": "mit",
"hash": -1124507632342065900,
"line_mean": 32.8197674419,
"line_max": 71,
"alpha_frac": 0.5860409146,
"autogenerated": false,
"ratio": 3.842140026420... |
"""
Module containing class definitions for files to be tagged.
"""
import logging
from myarchive.libs.deviantart.api import DeviantartError
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import backref, relationship
from sqlalchemy.ext.hybrid import hybrid_property
from myarchive.db... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/db/tag_db/tables/datables.py",
"copies": "1",
"size": "3901",
"license": "mit",
"hash": -6394113714643710000,
"line_mean": 28.3308270677,
"line_max": 77,
"alpha_frac": 0.6362471161,
"autogenerated": false,
"ratio": 3.7690821256038647,... |
"""
Module containing class definitions for files to be tagged.
"""
import logging
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
from sqlalchemy.orm import backref, relationship
from myarchive.db.tag_db.tables.association_tables import at_ytvideo_tag
from myarchive.db.tag_db.tables.base impor... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/db/tag_db/tables/yttables.py",
"copies": "1",
"size": "2414",
"license": "mit",
"hash": -5097150660865780000,
"line_mean": 26.4318181818,
"line_max": 79,
"alpha_frac": 0.6507870754,
"autogenerated": false,
"ratio": 3.7955974842767297,... |
"""
Module containing definitions of tag hierarchies.
"""
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.orm import backref, relationship
from sqlalchemy.orm.exc import NoResultFound
from myarchive.db.tag_db.tables.base import Base
RECENT_TAG_CACHE = dict()
class CircularDependencyErr... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/db/tag_db/tables/tag.py",
"copies": "1",
"size": "2151",
"license": "mit",
"hash": 3720155485107644400,
"line_mean": 24.6071428571,
"line_max": 70,
"alpha_frac": 0.6048349605,
"autogenerated": false,
"ratio": 3.7279029462738302,
"co... |
"""
This module contains definitions for association tables used in many-to-many
mappings.
"""
from sqlalchemy import Column, ForeignKey, Integer, Table
from myarchive.db.tag_db.tables.base import Base
at_file_tag = Table(
'at_file_tag', Base.metadata,
Column("file_id", Integer, ForeignKey("files.id"), prim... | {
"repo_name": "zetasyanthis/myarchive",
"path": "src/myarchive/db/tag_db/tables/association_tables.py",
"copies": "1",
"size": "2865",
"license": "mit",
"hash": 5255561903784537000,
"line_mean": 36.6973684211,
"line_max": 80,
"alpha_frac": 0.6732984293,
"autogenerated": false,
"ratio": 3.41477949... |
import os
import sys
import math
import operator
import re
import json
import types
import shutil
# #####################################################
# Globals
# #####################################################
option_triangulate = True
option_textures = True
option_copy_textures = True
option_prefix = True
... | {
"repo_name": "rougier/three.js",
"path": "utils/converters/fbx/convert_to_threejs.py",
"copies": "213",
"size": "77684",
"license": "mit",
"hash": 6364788265983063000,
"line_mean": 34.5212620027,
"line_max": 214,
"alpha_frac": 0.5796431698,
"autogenerated": false,
"ratio": 4.022368352922902,
"... |
import os
import sys
import math
import operator
# #####################################################
# Globals
# #####################################################
option_triangulate = True
option_textures = True
option_prefix = True
option_geometry = False
option_default_camera = False
option_default_light = ... | {
"repo_name": "cheminfo/Visualizer-grunt",
"path": "src/components/three.js/utils/converters/fbx/convert_to_threejs.py",
"copies": "50",
"size": "67563",
"license": "mit",
"hash": 5898790565841595000,
"line_mean": 34.8805098247,
"line_max": 214,
"alpha_frac": 0.5724730992,
"autogenerated": false,
... |
import os
import sys
import math
# #####################################################
# Globals
# #####################################################
option_triangulate = True
option_textures = True
option_prefix = True
option_geometry = False
option_default_camera = False
option_default_light = False
converter... | {
"repo_name": "mika-co/convert-to-threejs",
"path": "convert_to_threejs.py",
"copies": "1",
"size": "52203",
"license": "mit",
"hash": 6452401095550405000,
"line_mean": 34.7554794521,
"line_max": 214,
"alpha_frac": 0.5694308756,
"autogenerated": false,
"ratio": 3.771075633894387,
"config_test":... |
import os
import sys
import math
import operator
import re
import json
import types
import shutil
# #####################################################
# Globals
# #####################################################
option_triangulate = True
option_textures = True
option_copy_textures = True
option_prefix = True
... | {
"repo_name": "vizorvr/patches",
"path": "vendor/three/fbx/convert_to_threejs.py",
"copies": "3",
"size": "79652",
"license": "mit",
"hash": 6140723112074829000,
"line_mean": 34.3537505548,
"line_max": 214,
"alpha_frac": 0.5781901271,
"autogenerated": false,
"ratio": 4.020594619150977,
"config_... |
__author__ = 'zfei'
from time import sleep
import pprint
from api.btc2cnyapi import BTCChina
from settings import *
class Bot:
def __init__(self):
self.trader = BTCChina(API_ACCESS, API_SECRET)
self.portfolio = []
self.profit = 0
def get_lowest_market_ask(self, market_depth):
... | {
"repo_name": "wenqingyu/BTCBot",
"path": "bot.py",
"copies": "1",
"size": "10062",
"license": "mit",
"hash": 7652417835084516000,
"line_mean": 30.5454545455,
"line_max": 116,
"alpha_frac": 0.52653548,
"autogenerated": false,
"ratio": 3.748882265275708,
"config_test": false,
"has_no_keywords"... |
__author__ = 'zfei'
from time import sleep
import pprint
from api.btccapi import BTCChina
from settings import *
class Bot:
def __init__(self):
self.trader = BTCChina(API_ACCESS, API_SECRET)
self.portfolio = []
self.profit = 0
def get_lowest_market_ask(self, market_depth):
r... | {
"repo_name": "zfei/btcchina-bot",
"path": "bot.py",
"copies": "1",
"size": "10059",
"license": "mit",
"hash": -7663729495399766000,
"line_mean": 30.5360501567,
"line_max": 116,
"alpha_frac": 0.5263942738,
"autogenerated": false,
"ratio": 3.751958224543081,
"config_test": false,
"has_no_keywo... |
__author__ = 'Zhanelya'
import json
import web
from libraries.utils import date_utils
from models.company import company
class characters:
"""
Types of characters:
employee_types = {'executives', 'desk', 'road'}
Listens to ajax call which updates characters' state:
location_types = {'office', 'pu... | {
"repo_name": "mapto/sprks",
"path": "controllers/characters.py",
"copies": "1",
"size": "2946",
"license": "mit",
"hash": -1819770137523802000,
"line_mean": 38.2933333333,
"line_max": 142,
"alpha_frac": 0.5668703327,
"autogenerated": false,
"ratio": 3.928,
"config_test": false,
"has_no_keywo... |
__author__ = 'zhanelya'
from localsys.environment import context
from models.score import score_model
import json
import web
from models.simulation import simulation
class score_rest:
def GET(self):
web.header('Content-Type', 'application/json')
return json.dumps(score_model.get_scores(context.us... | {
"repo_name": "mapto/sprks",
"path": "controllers/score.py",
"copies": "1",
"size": "1406",
"license": "mit",
"hash": -2749026351040201000,
"line_mean": 34.15,
"line_max": 82,
"alpha_frac": 0.6287339972,
"autogenerated": false,
"ratio": 3.9830028328611897,
"config_test": false,
"has_no_keywor... |
__author__ = 'Zhanelya'
import json
import web
from localsys.environment import *
from models.users import users_model
from models.policies import policies_model
from libraries.utils import hash_utils
from models.score import score_model
class account:
"""
Handles login, and REST API for login/registration... | {
"repo_name": "mapto/sprks",
"path": "controllers/user.py",
"copies": "1",
"size": "5613",
"license": "mit",
"hash": -4608001443691258000,
"line_mean": 29.3459459459,
"line_max": 107,
"alpha_frac": 0.4722964547,
"autogenerated": false,
"ratio": 4.58578431372549,
"config_test": false,
"has_no_... |
__author__ = 'zhanghengyang'
from flask import Flask
import os
import json
from flask import request
import uuid
import numpy as np
import cv2
import json
import _process_image as pi
#from _process_image import CRect, Cvec4i
import time
import random
import string
#from preprocessing import proc
from licenseRec import ... | {
"repo_name": "bboalimoe/D_Server",
"path": "server.py",
"copies": "1",
"size": "2996",
"license": "mit",
"hash": 2115080984839679700,
"line_mean": 30.8723404255,
"line_max": 129,
"alpha_frac": 0.5851134846,
"autogenerated": false,
"ratio": 3.032388663967611,
"config_test": false,
"has_no_key... |
__author__ = 'zhangkaixuan'
import httplib
from ecs.util.params import PROXY_SERVER_URL, CDMI_VERSION
from ecs.util.tools import md5, encrypt
class ECSClient:
def __init__(self, conn):
self.conn = conn
self.heads = {"X-CDMI-Specification-Version":CDMI_VERSION}
self.body = None
sel... | {
"repo_name": "zhangkaixuan/ExtendedCloudStorage_V2.0",
"path": "ecs/client/httpclient.py",
"copies": "1",
"size": "1455",
"license": "mit",
"hash": -1290840709601047600,
"line_mean": 24.0862068966,
"line_max": 72,
"alpha_frac": 0.6199312715,
"autogenerated": false,
"ratio": 3.548780487804878,
... |
__author__ = 'Zhang Shaojun'
import binascii
import socket
import time
import random
from ryu.lib import hub
import cfg
import msg_proto
import msg_proto_parser
import msg_handler
from ryu.ofproto import ofproto_v1_3
from ryu.ofproto import ofproto_v1_3_parser
def _deactivate(method):
def deactivate(self):
... | {
"repo_name": "halexan/Headquarters",
"path": "test/lc_client/cc_agent.py",
"copies": "1",
"size": "4378",
"license": "mit",
"hash": 5772422220756260000,
"line_mean": 31.1911764706,
"line_max": 118,
"alpha_frac": 0.5360895386,
"autogenerated": false,
"ratio": 3.5914684167350286,
"config_test": ... |
__author__ = 'Zhang Shaojun'
import tflc_event
import msg_proto
import msg_proto_parser
import struct
# Global Event Dispatcher
EVENT_DISPATCHER = tflc_event.EventDispatcher()
# uplink message handling
# not needed
def hello_up_handler(local_ctrl, version, msg_type, msg_len, xid, data):
pass
def dp_connected_h... | {
"repo_name": "halexan/Headquarters",
"path": "test/lc_client/msg_handler.py",
"copies": "1",
"size": "6710",
"license": "mit",
"hash": 5998238073208756000,
"line_mean": 40.4259259259,
"line_max": 114,
"alpha_frac": 0.6500745156,
"autogenerated": false,
"ratio": 2.919930374238468,
"config_test"... |
__author__ = 'Zhang Shaojun'
import struct
# tflc message header
TFLCP_HEADER_PACK_STR = '!BBHI'
TFLCP_HEADER_SIZE = 8
assert struct.calcsize(TFLCP_HEADER_PACK_STR) == TFLCP_HEADER_SIZE
# tflc message type
TFLCT_HELLO_UP = 0
TFLCT_HELLO_DOWN = 1
TFLCT_DATAPATH_CONNECTED = 2
TFLCT_ROLE_ASSIGN = 3
TFLCT_GI... | {
"repo_name": "halexan/RouteManagement",
"path": "lc_client/msg_proto.py",
"copies": "2",
"size": "4741",
"license": "mit",
"hash": -4900541764705584000,
"line_mean": 32.6058394161,
"line_max": 110,
"alpha_frac": 0.6871967939,
"autogenerated": false,
"ratio": 2.4213483146067416,
"config_test": ... |
__author__ = 'Zhang Shaojun'
import wsgi
import json
from webob import Response
from networkx.readwrite import json_graph
class StatsController(wsgi.ControllerBase):
def __init__(self, req, link, data, **config):
super(StatsController, self).__init__(req, link, data, **config)
self.app_man... | {
"repo_name": "halexan/RouteManagement",
"path": "src/RMServer/wsgi_handler.py",
"copies": "2",
"size": "4965",
"license": "mit",
"hash": 5885574110157616000,
"line_mean": 36.7890625,
"line_max": 77,
"alpha_frac": 0.5653575025,
"autogenerated": false,
"ratio": 3.3890784982935154,
"config_test":... |
__author__ = 'Zhang Shaojun'
# message event handlers and app manager
# function 1: message event handler
# function 2: generate sending messages
# function 3: app manager: with an initial central controller
import sys
import time
import hub
import wsgi
import threading
import controller
import cfg
import... | {
"repo_name": "halexan/RouteManagement",
"path": "src/RMServer/app_manager.py",
"copies": "1",
"size": "17815",
"license": "mit",
"hash": -8571568861648357000,
"line_mean": 44.7585301837,
"line_max": 120,
"alpha_frac": 0.5662082515,
"autogenerated": false,
"ratio": 3.5186648232273354,
"config_t... |
__author__ = 'Zhang Shaojun'
# basic event, other events are derived from this class
class EventTFLCPMsgBase(object):
def __init__(self, msg=None):
super(EventTFLCPMsgBase, self).__init__()
self.msg = msg
# Message Event Definition
# only uplink message generate Events
class EventTFLCPHe... | {
"repo_name": "halexan/RouteManagement",
"path": "src/RMServer/tflc_event.py",
"copies": "1",
"size": "4134",
"license": "mit",
"hash": 2443482919664537600,
"line_mean": 32.45,
"line_max": 101,
"alpha_frac": 0.584179971,
"autogenerated": false,
"ratio": 3.824236817761332,
"config_test": false,
... |
__author__ = 'Zhang Shaojun'
import socket
import time
import random
from ryu.lib import hub
import cfg
import msg_proto
import msg_proto_parser
import msg_handler
from ryu.ofproto import ofproto_v1_3
from ryu.ofproto import ofproto_v1_3_parser
def _deactivate(method):
def deactivate(self):
... | {
"repo_name": "halexan/RouteManagement",
"path": "lc_client/cc_agent.py",
"copies": "1",
"size": "4036",
"license": "mit",
"hash": -3596679119335954,
"line_mean": 29.7795275591,
"line_max": 118,
"alpha_frac": 0.5188305253,
"autogenerated": false,
"ratio": 3.8075471698113206,
"config_test": fals... |
__author__ = 'Zhang Shaojun'
import struct
import cfg
import msg_proto
from cfg import LOG
"""
# scapy form of message
# allign to 64 bits
class TFLCPHeader(Packet):
name = "tflc header"
fields_desc = [
XByteField("version", cfg.TFLC_VERSION_1),
ByteEnumField("type", msg_proto.... | {
"repo_name": "halexan/RouteManagement",
"path": "src/RMServer/msg_proto_parser.py",
"copies": "1",
"size": "15743",
"license": "mit",
"hash": 809254939087062100,
"line_mean": 33.1450892857,
"line_max": 117,
"alpha_frac": 0.596328527,
"autogenerated": false,
"ratio": 3.1118798181458787,
"config... |
__author__ = 'Zhang Shaojun'
import struct
import cfg
import msg_proto
# uplink message base class
class MsgUpBase(object):
def __init__(self, cc_agent):
super(MsgUpBase, self).__init__()
self.cc_agent = cc_agent
self.version = None
self.msg_type = None
self.... | {
"repo_name": "halexan/RouteManagement",
"path": "lc_client/msg_proto_parser.py",
"copies": "1",
"size": "12999",
"license": "mit",
"hash": 3897378364710241300,
"line_mean": 36.3451327434,
"line_max": 113,
"alpha_frac": 0.5721209324,
"autogenerated": false,
"ratio": 3.1907216494845363,
"config_... |
__author__ = 'Zhang Shaojun'
"""
modified from ryu~
thanks
"""
import binascii
import contextlib
import hub
from hub import StreamServer
import random
import socket
import cfg
import msg_proto
import msg_proto_parser
import msg_handler
from cfg import LOG
class CentralController(object):
def __in... | {
"repo_name": "halexan/Headquarters",
"path": "src/headquarters/controller.py",
"copies": "1",
"size": "5491",
"license": "mit",
"hash": 6693872547979615000,
"line_mean": 29.5574712644,
"line_max": 113,
"alpha_frac": 0.5357858314,
"autogenerated": false,
"ratio": 3.8105482303955585,
"config_tes... |
__author__ = 'Zhang Shaojun'
"""
modified from ryu~
thanks
"""
import contextlib
import hub
from hub import StreamServer
import random
import socket
import cfg
import msg_proto
import msg_proto_parser
import msg_handler
from cfg import LOG
class CentralController(object):
def __init__(self):
... | {
"repo_name": "halexan/RouteManagement",
"path": "src/RMServer/controller.py",
"copies": "1",
"size": "5380",
"license": "mit",
"hash": 8459015461227546000,
"line_mean": 27.8888888889,
"line_max": 102,
"alpha_frac": 0.5278810409,
"autogenerated": false,
"ratio": 3.831908831908832,
"config_test"... |
__author__ = 'Zhang Shaojun'
import tflc_event
import msg_proto
import msg_proto_parser
import struct
from cfg import LOG
from ryu.ofproto import ofproto_v1_3
from ryu.ofproto import ofproto_v1_3_parser
# Global Event Dispatcher
EVENT_DISPATCHER = tflc_event.EventDispatcher()
# uplink message handling... | {
"repo_name": "halexan/RouteManagement",
"path": "src/RMServer/msg_handler.py",
"copies": "1",
"size": "9884",
"license": "mit",
"hash": 2729103602705406000,
"line_mean": 42.331838565,
"line_max": 128,
"alpha_frac": 0.6191825172,
"autogenerated": false,
"ratio": 3.078168794767985,
"config_test"... |
__author__ = 'Zhang Shaojun'
import tflc_event
import msg_proto
import msg_proto_parser
import struct
# Global Event Dispatcher
EVENT_DISPATCHER = tflc_event.EventDispatcher()
# uplink message handling
# not needed
def hello_up_handler(local_ctrl, version, msg_type, msg_len, xid, data):
pass
de... | {
"repo_name": "halexan/RouteManagement",
"path": "lc_client/msg_handler.py",
"copies": "1",
"size": "6829",
"license": "mit",
"hash": 2784314472760411000,
"line_mean": 40.1666666667,
"line_max": 114,
"alpha_frac": 0.6387465222,
"autogenerated": false,
"ratio": 3.015011037527594,
"config_test": ... |
__author__ = 'zhangxulong'
"""
==================
GMM classification
==================
Demonstration of Gaussian mixture models for classification.
See :ref:`gmm` for more information on the estimator.
Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset... | {
"repo_name": "daleloogn/realiseSID-from-Ratanpara",
"path": "gmm_classification.py",
"copies": "2",
"size": "3785",
"license": "apache-2.0",
"hash": -1834621967388764200,
"line_mean": 41.0555555556,
"line_max": 93,
"alpha_frac": 0.6475561427,
"autogenerated": false,
"ratio": 3.367437722419929,
... |
__author__ = 'zhangzhao'
import time
from xml.etree import ElementTree as et
class EntryElement(object):
def __init__(self, name='None', category='unspecified', status='None', create_time='None'):
self.name = name
self.create_time = create_time
self.status_change_time = 0
self.cate... | {
"repo_name": "zz090923610/OhMyLifeRecorder",
"path": "legacy/EntryElement.py",
"copies": "1",
"size": "3188",
"license": "mit",
"hash": 3369965043989567500,
"line_mean": 42.6712328767,
"line_max": 119,
"alpha_frac": 0.5630489335,
"autogenerated": false,
"ratio": 3.694090382387022,
"config_test... |
__author__ = 'zhangzhao'
import time
from xml.etree import ElementTree as et
class JobHdl:
def __init__(self, name='unspecified', category='unspecified', status=None, create_time=None):
self.name = name
self.create_time = create_time
self.status_change_time = 0
self.category = cate... | {
"repo_name": "zz090923610/OhMyLifeRecorder",
"path": "src/job_hdl.py",
"copies": "1",
"size": "3393",
"license": "mit",
"hash": -2813803836392911400,
"line_mean": 41.4125,
"line_max": 119,
"alpha_frac": 0.5602711465,
"autogenerated": false,
"ratio": 3.6840390879478826,
"config_test": false,
... |
__author__ = 'zhaoyang.szy'
def handleEndPoint(cmd,operation,keyValues):
if not hasNecessaryArgs(keyValues):
print 'RegionId/EndPoint is absence'
return
if cmd is not None:
cmd = cmd.capitalize()
regionId = getRegionId(keyValues)
endPoint = getEndPoint(keyValues)
_handleEndP... | {
"repo_name": "blademainer/aliyun-cli",
"path": "aliyuncli/handleEndPoint.py",
"copies": "3",
"size": "1318",
"license": "apache-2.0",
"hash": 5802728393085128000,
"line_mean": 30.380952381,
"line_max": 91,
"alpha_frac": 0.6798179059,
"autogenerated": false,
"ratio": 3.671309192200557,
"config_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.