text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'johnny'
import numpy as np
import cv, cv2
from itertools import *
from random import *
import datetime
import time
from VisualDecisionForest import *
import time
dragging = False # true if mouse is pressed
mode = True # if True, draw rectangle. Press 'm' to toggle to curve
ix,iy = -1,-1
curr_training_r... | {
"repo_name": "jcl5m1/CVToolsPython",
"path": "VisualDecisionForest/VisualDecisionForestTest.py",
"copies": "1",
"size": "3510",
"license": "apache-2.0",
"hash": 1970320998754668500,
"line_mean": 28.5042016807,
"line_max": 128,
"alpha_frac": 0.6578347578,
"autogenerated": false,
"ratio": 2.982158... |
__author__ = 'johnny'
import numpy as np
import cv, cv2
import datetime
import time
import glob
import os
import subprocess
import sys
print sys.path
from TrainingRegion import *
from ImageUtilities import *
dragging = False # true if mouse is pressed
mode = True # if True, draw rectangle. Press 'm' to toggle to cu... | {
"repo_name": "jcl5m1/CVToolsPython",
"path": "VisualDecisionForest/TemplateMatching.py",
"copies": "1",
"size": "6023",
"license": "apache-2.0",
"hash": -3471173715247494700,
"line_mean": 32.0989010989,
"line_max": 124,
"alpha_frac": 0.6252697991,
"autogenerated": false,
"ratio": 3.1468129571577... |
import queue
import threading
import time
# class for processing multiple objects at a limit
# speed of calls is determined by calls per time in seconds.
# need to somehow return result of function call
class task_processing(threading.Thread):
def __init__(self, q_size, calls, time_seconds, lock_timeout = 10):
t... | {
"repo_name": "johnnyczhong/junglr",
"path": "junglr/rate_limiter.py",
"copies": "1",
"size": "2497",
"license": "mit",
"hash": -2519152358618648600,
"line_mean": 31.0128205128,
"line_max": 109,
"alpha_frac": 0.6892270725,
"autogenerated": false,
"ratio": 3.2344559585492227,
"config_test": fals... |
__author__ = 'johnphilmurray'
from csv import reader
from json import dumps
json_file_name = 'src/app/marketcaps.json'
csv_file_name = 'constituents-financials.csv'
# opens the csv file and reads it in as a 2 dimensional list
csv_file = open(csv_file_name)
csv_file_reader = list(reader(csv_file, delimiter=','))
#ass... | {
"repo_name": "cborst/finance-dashboard",
"path": "market_cap_to_JSON.py",
"copies": "2",
"size": "1506",
"license": "mit",
"hash": -6285769547519556000,
"line_mean": 33.2272727273,
"line_max": 80,
"alpha_frac": 0.6845949535,
"autogenerated": false,
"ratio": 3.399548532731377,
"config_test": fa... |
from paramiko import SSHClient, AutoAddPolicy, RSAKey
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--file", help="Text file containing one filename per line.")
parser.add_argument("-n", "--name", help="The name of a single file to block.")
args = parser.parse_args()
fileLi... | {
"repo_name": "jzadeh/Aktaion",
"path": "python/AktaionActiveDefenseScript.py",
"copies": "1",
"size": "2099",
"license": "apache-2.0",
"hash": 5231625956644723000,
"line_mean": 32.8548387097,
"line_max": 119,
"alpha_frac": 0.670795617,
"autogenerated": false,
"ratio": 3.5277310924369747,
"conf... |
__author__ = 'John Sabath'
import arrow
import requests
ALL_PLAYER_STAT_NAMES = ["matchesPlayed", "kills", "deaths", "assists", "minionKills", "doubleKills", "tripleKills", "quadraKills", "pentaKills", "killOrAssistBonus"]
ALL_TEAM_STAT_NAMES = ["matchesPlayed", "firstBlood", "towerKills", "baronKills", "dragonKills"... | {
"repo_name": "MarkFranciscus/DevMIDbot",
"path": ".idea/fantasylcs.py",
"copies": "1",
"size": "6794",
"license": "mit",
"hash": -1003908313742729200,
"line_mean": 27.4267782427,
"line_max": 166,
"alpha_frac": 0.5922873123,
"autogenerated": false,
"ratio": 3.3567193675889326,
"config_test": fa... |
import operator
import re
import types
import urlparse
from sqlalchemy import and_
from sqlalchemy import asc
from sqlalchemy import desc
from sqlalchemy import not_
from sqlalchemy import or_
from sqlalchemy.orm import aliased
import ceilometer
from ceilometer.storage.sqlalchemy import models
META_TYPE_MAP = {boo... | {
"repo_name": "srsakhamuri/ceilometer-tools",
"path": "tmp/utils.py",
"copies": "1",
"size": "6566",
"license": "apache-2.0",
"hash": 2449107772824931000,
"line_mean": 33.1979166667,
"line_max": 79,
"alpha_frac": 0.5875723424,
"autogenerated": false,
"ratio": 3.922341696535245,
"config_test": f... |
import operator
import types
from sqlalchemy import and_
from sqlalchemy import asc
from sqlalchemy import desc
from sqlalchemy import not_
from sqlalchemy import or_
from sqlalchemy.orm import aliased
import ceilometer
from ceilometer.storage.sqlalchemy import models
META_TYPE_MAP = {bool: models.MetaBool,
... | {
"repo_name": "froyobin/ceilometer",
"path": "ceilometer/storage/sqlalchemy/utils.py",
"copies": "6",
"size": "5055",
"license": "apache-2.0",
"hash": 4424235699879789000,
"line_mean": 35.1071428571,
"line_max": 79,
"alpha_frac": 0.5861523244,
"autogenerated": false,
"ratio": 4.018282988871224,
... |
import time
import pyupm_mic as upmMicrophone
# Attach microphone to analog port A0
myMic = upmMicrophone.Microphone(0)
threshContext = upmMicrophone.thresholdContext()
threshContext.averageReading = 0
threshContext.runningAverage = 0
threshContext.averagedOver = 2
# Infinite loop, ends when script is cancelled
# R... | {
"repo_name": "rafaneri/upm",
"path": "examples/python/mic.py",
"copies": "18",
"size": "1937",
"license": "mit",
"hash": -8732049627620084000,
"line_mean": 40.2127659574,
"line_max": 72,
"alpha_frac": 0.7630356221,
"autogenerated": false,
"ratio": 3.9611451942740286,
"config_test": false,
"h... |
import time
import pyupm_servo as servo
num_steps = 20
candyPin = 5
leftPin = 3
rightPin = 6
middlePin = 9
cServo = None
left = None
right = None
middle = None
def init_candy():
global cServo
cServo = servo.ES08A(candyPin)
cServo.setAngle(180)
def init_spider():
global left
global right
g... | {
"repo_name": "intelmakers/candy_machine",
"path": "Python/moveServo.py",
"copies": "1",
"size": "3127",
"license": "cc0-1.0",
"hash": -6737551338414990000,
"line_mean": 25.2773109244,
"line_max": 72,
"alpha_frac": 0.6770067157,
"autogenerated": false,
"ratio": 3.2038934426229506,
"config_test"... |
__author__ = 'Jonas Eberle <jonas.eberle@eberle-mail.de>'
from pyEOM.sources import *
class GEE(GEESource):
dataset = None
start = '1900-01-01'
end = '2100-01-01'
epsg = 'EPSG:4326'
scale = 30
def __init__(self, task):
self.task = task
if 'dataset' not in task:
rais... | {
"repo_name": "jonas-eberle/pyEOM",
"path": "pyEOM/datasets/Landsat.py",
"copies": "1",
"size": "1358",
"license": "mit",
"hash": 8887988146127715000,
"line_mean": 29.8863636364,
"line_max": 116,
"alpha_frac": 0.5412371134,
"autogenerated": false,
"ratio": 3.710382513661202,
"config_test": fals... |
__author__ = 'Jonas Eberle <jonas.eberle@eberle-mail.de>'
import pyEOM.gee_init as gee
try:
import ee
from ee import oauth
except:
pass
import sys
import ogr
def TestGEESource():
source = GEESource()
source.connect()
geometry = source.getEEPoint(11, 51)
scenes = source.listScenes("LANDSAT... | {
"repo_name": "jonas-eberle/pyEOM",
"path": "pyEOM/sources.py",
"copies": "1",
"size": "9006",
"license": "mit",
"hash": 7614055452347013000,
"line_mean": 30.3797909408,
"line_max": 139,
"alpha_frac": 0.6024872307,
"autogenerated": false,
"ratio": 3.88860103626943,
"config_test": false,
"has_... |
__author__ = 'Jonas Eberle <jonas.eberle@eberle-mail.de>'
import subprocess
import os
import osr
import ogr
import numpy as np
from osgeo import gdal, gdalconst, gdalnumeric, gdal_array
import shutil
from pyEOM import log
LOGGER = log.LOGGER
def TestMODISHDFProcessor():
geom = 'POLYGON((7.807615733070551 26.259... | {
"repo_name": "jonas-eberle/pyEOM",
"path": "pyEOM/processing.py",
"copies": "1",
"size": "15654",
"license": "mit",
"hash": -3246256774962876000,
"line_mean": 38.0399002494,
"line_max": 207,
"alpha_frac": 0.5840040884,
"autogenerated": false,
"ratio": 3.8556650246305417,
"config_test": false,
... |
__author__ = 'Jonas Eberle <jonas.eberle@eberle-mail.de>'
from pyspatialite import dbapi2 as db
import os
import sys
from osgeo import gdal
import ogr
from datetime import datetime
class Raster(object):
file = None
xsize = None
ysize = None
bbox = None
def __init__(self, file):
self.file... | {
"repo_name": "jonas-eberle/pyEOM",
"path": "pyEOM/outputs/raster.py",
"copies": "1",
"size": "2987",
"license": "mit",
"hash": -7093140596010059000,
"line_mean": 25.4336283186,
"line_max": 169,
"alpha_frac": 0.5985939069,
"autogenerated": false,
"ratio": 3.814814814814815,
"config_test": false... |
__author__ = 'Jonas Eberle <jonas.eberle@eberle-mail.de>'
__version__ = '0.1'
import logging
from pyEOM.sources import *
from pyEOM import processing
from datetime import datetime
import os, re, sys
import subprocess
import sqlite3
from pyspatialite import dbapi2 as db
from datetime import datetime
import shutil
from... | {
"repo_name": "jonas-eberle/pyEOM",
"path": "pyEOM/datasets/MODIS.py",
"copies": "1",
"size": "10611",
"license": "mit",
"hash": -4385972573176032000,
"line_mean": 35.7162629758,
"line_max": 218,
"alpha_frac": 0.5958910565,
"autogenerated": false,
"ratio": 3.8459586806814063,
"config_test": fal... |
__author__ = 'jonasfelber'
from bs4 import BeautifulSoup
import re
from builder import techID_to_string
# TODO add constants
def parse_buildings(soup, planet,counter_start):
if not planet.__contains__('levels'):
planet['levels'] = dict()
counter = counter_start
building_nodes = soup.find_all('li... | {
"repo_name": "erstis-go-botting/sexy-bot",
"path": "core/parser.py",
"copies": "1",
"size": "3618",
"license": "mit",
"hash": -8358006776198781000,
"line_mean": 36.6875,
"line_max": 126,
"alpha_frac": 0.6066887783,
"autogenerated": false,
"ratio": 3.328426862925483,
"config_test": false,
"ha... |
__author__ = "Jonas Geduldig"
__date__ = "February 7, 2013"
__license__ = "MIT"
import os
class TwitterOAuth:
"""Optional class for retrieving Twitter credentials stored in a text file.
:param consumer_key: Twitter application consumer key
:param consumer_secret: Twitter application consumer secret
... | {
"repo_name": "Innova4D/twitter-stream-expression",
"path": "TwitterAPI/TwitterOAuth.py",
"copies": "1",
"size": "1879",
"license": "mit",
"hash": -8492386649021637000,
"line_mean": 31.3965517241,
"line_max": 89,
"alpha_frac": 0.5763704098,
"autogenerated": false,
"ratio": 4.410798122065728,
"c... |
__author__ = "Jonas Geduldig"
__date__ = "February 7, 2013"
__license__ = "MIT"
import os
class TwitterOAuth:
"""Optional class for retrieving Twitter credentials stored in a text file.
:param consumer_key: Twitter application consumer key
:param consumer_secret: Twitter application consumer secret
... | {
"repo_name": "CityPulse/CP_Resourcemanagement",
"path": "wrapper_dev/twitter_stream/TwitterAPI/TwitterOAuth.py",
"copies": "1",
"size": "2304",
"license": "mit",
"hash": 6985650645662107000,
"line_mean": 31,
"line_max": 89,
"alpha_frac": 0.5611979167,
"autogenerated": false,
"ratio": 4.439306358... |
__author__ = "Jonas Geduldig"
__date__ = "June 7, 2013"
__license__ = "MIT"
from .constants import *
import json
from requests_oauthlib import OAuth1
from .BearerAuth import BearerAuth as OAuth2
from datetime import datetime
import requests
class TwitterAPI(object):
"""Access REST API or Streaming API resources... | {
"repo_name": "Innova4D/twitter-stream-expression",
"path": "TwitterAPI/TwitterAPI.py",
"copies": "1",
"size": "7022",
"license": "mit",
"hash": 583490354071820700,
"line_mean": 34.4646464646,
"line_max": 101,
"alpha_frac": 0.5818855027,
"autogenerated": false,
"ratio": 4.562703053931124,
"conf... |
__author__ = "Jonas Geduldig"
__date__ = "June 7, 2013"
__license__ = "MIT"
from .BearerAuth import BearerAuth as OAuth2
from .constants import *
from datetime import datetime
from requests.exceptions import ConnectionError, ReadTimeout, SSLError
from requests.packages.urllib3.exceptions import ReadTimeoutError, Prot... | {
"repo_name": "rosudrag/Freemium-winner",
"path": "VirtualEnvironment/Lib/site-packages/TwitterAPI/TwitterAPI.py",
"copies": "2",
"size": "10521",
"license": "mit",
"hash": -893703166801622300,
"line_mean": 34.7857142857,
"line_max": 95,
"alpha_frac": 0.5595475715,
"autogenerated": false,
"ratio"... |
__author__ = "Jonas Geduldig"
__date__ = "June 8, 2013"
__license__ = "MIT"
import time
class TwitterRestPager(object):
"""Continuous (stream-like) pagination of response from Twitter REST API resource.
:param api: An authenticated TwitterAPI object
:param resource: String with the resource path (ex. s... | {
"repo_name": "Innova4D/twitter-stream-expression",
"path": "TwitterAPI/TwitterRestPager.py",
"copies": "1",
"size": "2189",
"license": "mit",
"hash": -7792515987077816000,
"line_mean": 34.3064516129,
"line_max": 94,
"alpha_frac": 0.5696665144,
"autogenerated": false,
"ratio": 4.598739495798319,
... |
__author__ = "Jonas Geduldig"
__date__ = "June 8, 2013"
__license__ = "MIT"
from requests.exceptions import ConnectionError, ReadTimeout, SSLError
from requests.packages.urllib3.exceptions import ReadTimeoutError, ProtocolError
from .TwitterError import *
import requests
import time
class TwitterRestPager(object):
... | {
"repo_name": "rosudrag/Freemium-winner",
"path": "VirtualEnvironment/Lib/site-packages/TwitterAPI/TwitterRestPager.py",
"copies": "1",
"size": "3605",
"license": "mit",
"hash": -4427753994874594300,
"line_mean": 35.7857142857,
"line_max": 88,
"alpha_frac": 0.5226074896,
"autogenerated": false,
"... |
class Cpp2d:
def __init__(self, lattice):
self.lattice = lattice
def collide_boundaries(self):
return {
'var': ['fin', 'nx', 'ny', 'c', 't', 'q', 'wall', 'force', 'omega'],
'code': """
blitz::Array<double,1> feq(q);
bool useObstacles = wall.numElements() ... | {
"repo_name": "Dwii/Master-Thesis",
"path": "implementation/Python/lbm_2d_3d_example/pylb/cpp.py",
"copies": "1",
"size": "17251",
"license": "mit",
"hash": 2650167217324554000,
"line_mean": 35.3945147679,
"line_max": 89,
"alpha_frac": 0.3658918324,
"autogenerated": false,
"ratio": 3.008020924149... |
import multiprocessing as mp
import lattice as mod_lattice
import block
import messages
import config as conf
import operator
from itertools import product
import numpy
def initialize(block, vel):
block.inipopulations(vel)
block.resetwall(vel)
block.collide_and_stream()
block.inipopulations(vel)
class... | {
"repo_name": "Dwii/Master-Thesis",
"path": "implementation/Python/lbm_2d_3d_example/pylb/multi.py",
"copies": "1",
"size": "9441",
"license": "mit",
"hash": -6388716234299121000,
"line_mean": 37.2226720648,
"line_max": 79,
"alpha_frac": 0.5629700244,
"autogenerated": false,
"ratio": 3.6494008504... |
import multiprocessing as mp
import numpy as np
import zmq
class QueueAsPipe:
def __init__(self):
self.queue = mp.Queue()
def send(self, data):
# Make a copy to guarantee data is not modified before it is sent.
self.queue.put(data.copy())
def recv(self, data):
data[:] = s... | {
"repo_name": "Dwii/Master-Thesis",
"path": "implementation/Python/lbm_2d_3d_example/pylb/messages.py",
"copies": "1",
"size": "3595",
"license": "mit",
"hash": 1912708107926273800,
"line_mean": 27.0859375,
"line_max": 79,
"alpha_frac": 0.5860917942,
"autogenerated": false,
"ratio": 3.62764883955... |
import numpy as np
from scipy import weave
import cpp
class Block:
def __init__(self, lattice, dim, omega, backend=None):
self.lattice = lattice
self.d = lattice.d
self.dim = dim
self.nx, self.ny, self.nz = dim if self.d == 3 else dim + (0,)
self.omega = omega
self.... | {
"repo_name": "Dwii/Master-Thesis",
"path": "implementation/Python/lbm_2d_3d_example/pylb/block.py",
"copies": "1",
"size": "6434",
"license": "mit",
"hash": -6602313985812964000,
"line_mean": 39.9808917197,
"line_max": 80,
"alpha_frac": 0.5854833696,
"autogenerated": false,
"ratio": 3.3934599156... |
'''
This module defines the structure of the most commonly used
2D and 3D lattices.
'''
import numpy as np
import collections
from itertools import product
Lattice = collections.namedtuple('Lattice', ('d', 'q', 'c', 't'))
def _lattice2d(q, weights):
'''Generates a 2D lattice.
The weights must be provided ... | {
"repo_name": "Dwii/Master-Thesis",
"path": "implementation/Python/lbm_2d_3d_example/pylb/lattice.py",
"copies": "1",
"size": "1873",
"license": "mit",
"hash": -7134355547553869000,
"line_mean": 31.8596491228,
"line_max": 77,
"alpha_frac": 0.5152162306,
"autogenerated": false,
"ratio": 3.13210702... |
import lbio
import messages
import config
import inspect
remote_recv = messages.RemoteRecv(host=config.recv_host, port=config.recv_port)
class LocalIO(object):
def iniplot(self, data):
self.plot = lbio.Plot(data)
def draw(self, data):
self.plot.draw(data)
def savefig(self, data):
... | {
"repo_name": "Dwii/Master-Thesis",
"path": "implementation/Python/lbm_2d_3d_example/pylb/client.py",
"copies": "1",
"size": "1192",
"license": "mit",
"hash": 462007608816135900,
"line_mean": 26.7209302326,
"line_max": 80,
"alpha_frac": 0.6627516779,
"autogenerated": false,
"ratio": 3.36723163841... |
__author__ = 'jonas'
import threading
import time
import subprocess
import socket
import os
import csv
import re
import traceback
import sys
_underscorer1 = re.compile(r'(.)([A-Z][a-z]+)')
_underscorer2 = re.compile('([a-z0-9])([A-Z])')
def camelToSnake(s):
"""
Convert camel-case to snake-case in python.
... | {
"repo_name": "jonbo372/sipstack",
"path": "performance/performance.py",
"copies": "2",
"size": "10069",
"license": "mit",
"hash": 7629849980332756000,
"line_mean": 32.1217105263,
"line_max": 270,
"alpha_frac": 0.5271625782,
"autogenerated": false,
"ratio": 3.76411214953271,
"config_test": fals... |
__author__ = 'Jonathan Brodie'
from hzclient.clientmessage import ClientMessage
from hzclient.codec import eventconstant
from util import util
class SetMessageType:
SET_SIZE=0x0601
SET_CONTAINS=0x0602
SET_CONTAINSALL=0x0603
SET_ADD=0x0604
SET_REMOVE=0x0605
SET_ADDALL=0x0606
SET_COMPAREANDRE... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/codec/setcodec.py",
"copies": "2",
"size": "25476",
"license": "apache-2.0",
"hash": 56495702514807864,
"line_mean": 31.5780051151,
"line_max": 81,
"alpha_frac": 0.6316140681,
"autogenerated": false,
"ratio": 4.7707865... |
__author__ = 'jonathanbrodie'
from hzclient.codec.addresscodec import AddressCodec
class MemberCodec:
@classmethod
def decode(cls,clientMessage):
address=AddressCodec.decode(clientMessage)
uuid=clientMessage.extractStringFromPayload()
attributeSize=clientMessage.extractIntFromPayload()
... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/codec/membercodec.py",
"copies": "2",
"size": "1283",
"license": "apache-2.0",
"hash": 3288977167380477400,
"line_mean": 32.7631578947,
"line_max": 59,
"alpha_frac": 0.6858924396,
"autogenerated": false,
"ratio": 4.19281045751634,
... |
__author__ = 'jonathanbrodie'
from hzclient.codec import cachecodec
from hzclient.codec import proxycodec
from hzclient.clientmessage import ClientMessage
from util import encode
class CacheProxy(object):
def __init__(self,title,connfamily):
self.title=title
self.connection=connfamily
firstp... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/proxy/cacheproxy.py",
"copies": "2",
"size": "15275",
"license": "apache-2.0",
"hash": 6056290292503336000,
"line_mean": 61.8641975309,
"line_max": 215,
"alpha_frac": 0.768314239,
"autogenerated": false,
"ratio": 4.231... |
__author__ = 'jonathanbrodie'
from hzclient.codec import mapcodec
from hzclient.codec import proxycodec
from hzclient.clientmessage import ClientMessage
from util import encode
class MapProxy(object):
def __init__(self,title,connfamily):
self.title=title
self.connection=connfamily
firstpack=... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/proxy/mapproxy.py",
"copies": "2",
"size": "33643",
"license": "apache-2.0",
"hash": 1637911536142678000,
"line_mean": 60.2823315118,
"line_max": 175,
"alpha_frac": 0.7607526083,
"autogenerated": false,
"ratio": 4.0968095470043835,... |
__author__ = 'jonathanbrodie'
from hzclient.codec import proxycodec
from hzclient.codec import queuecodec
from hzclient.clientmessage import ClientMessage
from util import encode
class QueueProxy(object):
def __init__(self,title,connfamily):
self.title=title
self.connection=connfamily
first... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/proxy/queueproxy.py",
"copies": "2",
"size": "11143",
"license": "apache-2.0",
"hash": 369372000921701950,
"line_mean": 56.1435897436,
"line_max": 132,
"alpha_frac": 0.7587723234,
"autogenerated": false,
"ratio": 4.2080815709969785... |
__author__ = 'jonathanbrodie'
from hzclient.codec import proxycodec
from hzclient.codec import topiccodec
from hzclient.clientmessage import ClientMessage
from util import encode
import datetime
class TopicProxy(object):
def __init__(self,title,connfamily):
self.title=title
self.connection=connfam... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/proxy/topicproxy.py",
"copies": "2",
"size": "2630",
"license": "apache-2.0",
"hash": 7842212106680769000,
"line_mean": 45.9821428571,
"line_max": 137,
"alpha_frac": 0.7596958175,
"autogenerated": false,
"ratio": 4.276422764227642,... |
__author__ = 'jonathanbrodie'
from hzclient.codec import setcodec,proxycodec
from hzclient.clientmessage import ClientMessage
from util import encode
class SetProxy(object):
def __init__(self,title,connfamily):
self.title=title
self.connection=connfamily
firstpack=proxycodec.createProxy(se... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/proxy/setproxy.py",
"copies": "2",
"size": "8021",
"license": "apache-2.0",
"hash": -4565635590957390300,
"line_mean": 49.1375,
"line_max": 128,
"alpha_frac": 0.7365665129,
"autogenerated": false,
"ratio": 4.197278911564626,
"con... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
class SemaphoreAcquireCodec:
REQUEST_TYPE = SemaphoreMessageType.SEMAPHORE_ACQUIRE
RESPONSE_TYPE = 100
RETRYABLE = False
'''************************ REQUEST *************************'''
... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/codec/semaphorecodec.py",
"copies": "2",
"size": "12870",
"license": "apache-2.0",
"hash": 7961919161838349000,
"line_mean": 32,
"line_max": 84,
"alpha_frac": 0.649028749,
"autogenerated": false,
"ratio": 4.676598837209302,
"conf... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
import eventconstant
class MapMessageType:
MAP_PUT=0x0101
MAP_GET=0x0102
MAP_REMOVE=0x0103
MAP_REPLACE=0x0104
MAP_REPLACEIFSAME=0x0105
MAP_PUTASYNC=0x0106
MAP_GETASYNC=0x0107
... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/codec/mapcodec.py",
"copies": "2",
"size": "140242",
"license": "apache-2.0",
"hash": -2766858601610014000,
"line_mean": 31.6526193248,
"line_max": 114,
"alpha_frac": 0.630695512,
"autogenerated": false,
"ratio": 4.675... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
import eventconstant
class TopicMessageType:
TOPIC_PUBLISH=0x0401
TOPIC_ADDMESSAGELISTENER=0x0402
TOPIC_REMOVEMESSAGELISTENER=0x0403
id=None
def ___init__(self, messageType):
... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/codec/topiccodec.py",
"copies": "2",
"size": "6711",
"license": "apache-2.0",
"hash": -1176462246167725000,
"line_mean": 30.6556603774,
"line_max": 85,
"alpha_frac": 0.6428252123,
"autogenerated": false,
"ratio": 4.949... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
'''
AWAIT
'''
def awaitEncode():
msg=ClientMessage()
msg.optype=0x0801
util.raiseNotDefined()
def awaitDecode(bytesobject):
servermsg=ClientMessage.decodeMessage(bytesobject)
util.rais... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/codec/conditioncodec.py",
"copies": "2",
"size": "1025",
"license": "apache-2.0",
"hash": 2279950444596285400,
"line_mean": 20.3541666667,
"line_max": 54,
"alpha_frac": 0.7443902439,
"autogenerated": false,
"ratio": 3.4982935153583... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
class LockForceUnlockCodec:
REQUEST_TYPE = LockMessageType.LOCK_FORCEUNLOCK
RESPONSE_TYPE = 100
RETRYABLE = False
'''************************ REQUEST *************************'''
cl... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/codec/lockcodec.py",
"copies": "2",
"size": "14472",
"license": "apache-2.0",
"hash": 6670225484495212000,
"line_mean": 31.3035714286,
"line_max": 86,
"alpha_frac": 0.6418601437,
"autogenerated": false,
"ratio": 4.723237597911227,
... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
'''
CONTAINSKEY
'''
def containskeyEncode():
msg=ClientMessage()
msg.optype=0x1001
util.raiseNotDefined()
def containskeyDecode(bytesobject):
servermsg=ClientMessage.decodeMessage(bytesobj... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/codec/transactionalmapcodec.py",
"copies": "2",
"size": "4028",
"license": "apache-2.0",
"hash": -8846341500212079000,
"line_mean": 20.0890052356,
"line_max": 54,
"alpha_frac": 0.7413108242,
"autogenerated": false,
"ratio": 3.47540... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
'''
AWAIT
'''
def awaitEncode():
msg=ClientMessage()
msg.optype=0x0c01
util.raiseNotDefined()
def awaitDecode(bytesobject):
servermsg=ClientMessage.decodeMessage(bytesobject)
util.rai... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/codec/countdownlatchcodec.py",
"copies": "2",
"size": "1032",
"license": "apache-2.0",
"hash": 26583196784051824,
"line_mean": 20.0612244898,
"line_max": 54,
"alpha_frac": 0.7451550388,
"autogenerated": false,
"ratio": 3.4172185430... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
'''
PUT
'''
def putEncode():
msg=ClientMessage()
msg.optype=0x0201
util.raiseNotDefined()
def putDecode(bytesobject):
servermsg=ClientMessage.decodeMessage(bytesobject)
util.raiseNotD... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/codec/multimapcodec.py",
"copies": "2",
"size": "5193",
"license": "apache-2.0",
"hash": 205729798304652030,
"line_mean": 20.024291498,
"line_max": 54,
"alpha_frac": 0.7413826305,
"autogenerated": false,
"ratio": 3.487... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
'''
PUT
'''
def putEncode():
msg=ClientMessage()
msg.optype=0x0e01
util.raiseNotDefined()
def putDecode(bytesobject):
servermsg=ClientMessage.decodeMessage(bytesobject)
util.raiseNotD... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/codec/replicatedmap.py",
"copies": "2",
"size": "4176",
"license": "apache-2.0",
"hash": 3218835720668582000,
"line_mean": 20.75,
"line_max": 58,
"alpha_frac": 0.7502394636,
"autogenerated": false,
"ratio": 3.4089795918367347,
"c... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
'''
OFFER
'''
def offerEncode():
msg=ClientMessage()
msg.optype=0x1401
util.raiseNotDefined()
def offerDecode(bytesobject):
servermsg=ClientMessage.decodeMessage(bytesobject)
util.rais... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/codec/transactionalqueuecodec.py",
"copies": "2",
"size": "1199",
"license": "apache-2.0",
"hash": -2410513067472135000,
"line_mean": 19.3220338983,
"line_max": 54,
"alpha_frac": 0.7314428691,
"autogenerated": false,
"ratio": 3.435... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
'''
PUT
'''
def putEncode():
msg=ClientMessage()
msg.optype=0x1101
util.raiseNotDefined()
def putDecode(bytesobject):
servermsg=ClientMessage.decodeMessage(bytesobject)
util.raiseNotDe... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/codec/transactionalmultimapcodec.py",
"copies": "2",
"size": "1449",
"license": "apache-2.0",
"hash": 1686359263416668400,
"line_mean": 20.0144927536,
"line_max": 54,
"alpha_frac": 0.7377501725,
"autogenerated": false,
"ratio": 3.5... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
'''
SHUTDOWN
'''
def shutdownEncode():
msg=ClientMessage()
msg.optype=0x0901
util.raiseNotDefined()
def shutdownDecode(bytesobject):
servermsg=ClientMessage.decodeMessage(bytesobject)
... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/codec/executorcodec.py",
"copies": "2",
"size": "1586",
"license": "apache-2.0",
"hash": -4708040690965073000,
"line_mean": 21.6571428571,
"line_max": 54,
"alpha_frac": 0.7591424968,
"autogenerated": false,
"ratio": 3.5720720720720... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
import eventconstant
class QueueMessageType:
QUEUE_OFFER=0x0301
QUEUE_PUT=0x0302
QUEUE_SIZE=0x0303
QUEUE_REMOVE=0x0304
QUEUE_POLL=0x0305
QUEUE_TAKE=0x0306
QUEUE_PEEK=0x0307
QUEUE_ITERATOR=0x0308... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/codec/queuecodec.py",
"copies": "2",
"size": "40081",
"license": "apache-2.0",
"hash": 4471447925342138400,
"line_mean": 31.5597075548,
"line_max": 83,
"alpha_frac": 0.6328185425,
"autogenerated": false,
"ratio": 4.767... |
__author__ = 'jonathanbrodie'
import eventconstant,ctypes
from hzclient.clientmessage import ClientMessage
from hzclient.codec.addresscodec import AddressCodec
from hzclient.codec.membercodec import MemberCodec
from hzclient.codec.membercodec import MemberAttributeChangeCodec
class ClientMessageType:
CLIENT_AUTHEN... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/codec/clientcodec.py",
"copies": "2",
"size": "13464",
"license": "apache-2.0",
"hash": 4458981407703971300,
"line_mean": 34.3385826772,
"line_max": 89,
"alpha_frac": 0.6382947118,
"autogenerated": false,
"ratio": 4.83... |
__author__ = 'Jonathan Brodie'
from hzclient.codec import alongcodec
from hzclient.codec import proxycodec
class ALongProxy(object):
def __init__(self,title,conn):
self.title=title
self.connection=conn
firstpack=proxycodec.createProxy(self.title,"hz:impl:atomicLongService")
self.... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/proxy/proxy.py",
"copies": "2",
"size": "3032",
"license": "apache-2.0",
"hash": 1662370442736883200,
"line_mean": 37.8846153846,
"line_max": 88,
"alpha_frac": 0.7180079156,
"autogenerated": false,
"ratio": 4.170563961... |
__author__ = 'jonathanbrodie'
from hzclient.codec import listcodec
from hzclient.codec import proxycodec
from hzclient.clientmessage import ClientMessage
from util import encode
class ListProxy(object):
def __init__(self,title,connfamily):
self.title=title
self.connection=connfamily
firstpa... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/proxy/listproxy.py",
"copies": "2",
"size": "12645",
"license": "apache-2.0",
"hash": 2847261221597374500,
"line_mean": 53.0427350427,
"line_max": 132,
"alpha_frac": 0.7508896797,
"autogenerated": false,
"ratio": 4.101... |
__author__ = 'Jonathan Brodie'
from hzclient.proxy.topicproxy import TopicProxy
from hzclient.proxy.alongproxy import AtomicLongProxy
from hzclient.proxy.mapproxy import MapProxy
from hzclient.proxy.setproxy import SetProxy
from hzclient.proxy.listproxy import ListProxy
from hzclient.proxy.arefproxy import AtomicRefer... | {
"repo_name": "hazelcast-incubator/pyhzclient",
"path": "hzclient/hazelclient.py",
"copies": "2",
"size": "1488",
"license": "apache-2.0",
"hash": 7692530393534329000,
"line_mean": 32.0666666667,
"line_max": 60,
"alpha_frac": 0.7459677419,
"autogenerated": false,
"ratio": 3.7766497461928936,
"c... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
import eventconstant
class AtomicLongAddAndGetCodec:
REQUEST_TYPE = AtomicLongMessageType.ATOMICLONG_ADDANDGET
RESPONSE_TYPE = 103
RETRYABLE = False
'''************************ REQUEST ... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/codec/alongcodec.py",
"copies": "2",
"size": "24791",
"license": "apache-2.0",
"hash": -6179142515091016000,
"line_mean": 32.2765100671,
"line_max": 84,
"alpha_frac": 0.6501956355,
"autogenerated": false,
"ratio": 4.70... |
__author__ = 'Jonathan Brodie'
import ctypes,struct
import encode
import murmurhash
def raiseNotDefined():
raise NotImplementedError("This method has not been defined.")
def hzstringbytes(str):
length=len(str)
constant=bytearray([0xff,0xff,0xff,0xf5])
first=struct.pack("!h",length)
second=struct.... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "util/util.py",
"copies": "2",
"size": "1038",
"license": "apache-2.0",
"hash": -6861226229476861000,
"line_mean": 24.3170731707,
"line_max": 80,
"alpha_frac": 0.6984585742,
"autogenerated": false,
"ratio": 3.471571906354515,
... |
__author__ = 'Jonathan Brodie'
'''
Created on 6/24/15
ClientMessage Class, this is meant to duplicate the ClientMessage Java class as best
as I can to best ensure the protocol is followed
'''
import sys,struct,ctypes,uuid
class ClientMessage(object):
def __init__(self):
#initialize everything
VER... | {
"repo_name": "hazelcast-incubator/hazelcast-python-client",
"path": "hzclient/clientmessage.py",
"copies": "2",
"size": "8290",
"license": "apache-2.0",
"hash": 728515973575194400,
"line_mean": 34.7370689655,
"line_max": 177,
"alpha_frac": 0.6556091677,
"autogenerated": false,
"ratio": 3.8308687... |
from __future__ import division,absolute_import,print_function,unicode_literals #for Python 2.7
#from pylab import *
from scipy.special import wofz,jn,ive
from scipy.optimize import fsolve,root,newton
from numpy import amin,matrix,tile,linspace,repeat,empty,log10,sqrt,exp,pi
from numpy.linalg import det,eig
... | {
"repo_name": "dtold/HYDROS",
"path": "src/dispersion.py",
"copies": "1",
"size": "12296",
"license": "mit",
"hash": 5230682885834224000,
"line_mean": 39.6813559322,
"line_max": 266,
"alpha_frac": 0.6177618738,
"autogenerated": false,
"ratio": 2.5957356976989656,
"config_test": false,
"has_no... |
__author__ = 'jonathan'
import procedural_city_generation
import os, sys
import numpy as np
path=os.path.dirname(procedural_city_generation.__file__)
class Wavefront(object):
def __init__(self, textures, polygon3ds, outpath="/outputs/"):
self.textures=textures
self.polygon3ds=polygon3ds
sel... | {
"repo_name": "josauder/procedural_city_generation",
"path": "procedural_city_generation/additional_stuff/Wavefront.py",
"copies": "2",
"size": "2379",
"license": "mpl-2.0",
"hash": -1671527963265522000,
"line_mean": 42.2727272727,
"line_max": 174,
"alpha_frac": 0.5712484237,
"autogenerated": false... |
__author__ = 'jonathan'
import test.nova._fixtures as models
from lib.rome.core.orm.query import Query
from lib.rome.core.orm.query import Query as RomeQuery
from lib.rome.core.session.session import Session as RomeSession
# from oslo.utils import timeutils
from lib.rome.core.utils import timeutils
import logging
imp... | {
"repo_name": "BeyondTheClouds/rome",
"path": "test/nova/features/test_convert_datetime.py",
"copies": "1",
"size": "3794",
"license": "mit",
"hash": -6052342237352772000,
"line_mean": 32.2807017544,
"line_max": 80,
"alpha_frac": 0.6507643648,
"autogenerated": false,
"ratio": 3.6167778836987607,
... |
__author__ = 'jonathan'
class ModelsObjectComparatorMixin(object):
def _dict_from_object(self, obj, ignored_keys):
if ignored_keys is None:
ignored_keys = []
return dict([(k, v) for k, v in obj.iteritems()
if k not in ignored_keys])
def _assertEqualO... | {
"repo_name": "BeyondTheClouds/rome",
"path": "test/nova/tests/misc.py",
"copies": "1",
"size": "1725",
"license": "mit",
"hash": -7203541167974622000,
"line_mean": 41.0731707317,
"line_max": 79,
"alpha_frac": 0.5965217391,
"autogenerated": false,
"ratio": 3.6469344608879495,
"config_test": fal... |
__author__ = 'jonathan'
from lib.rome.core.expression.expression import *
class Selection:
def __init__(self, model, attributes, is_function=False, function=None, is_hidden=False):
self._model = model
self._attributes = attributes
self._function = function
self._is_function = is_fu... | {
"repo_name": "BeyondTheClouds/rome",
"path": "lib/rome/core/terms/terms.py",
"copies": "1",
"size": "2313",
"license": "mit",
"hash": 4137545341598776300,
"line_mean": 29.038961039,
"line_max": 114,
"alpha_frac": 0.5469087765,
"autogenerated": false,
"ratio": 4.036649214659686,
"config_test": ... |
__author__ = 'jonathan'
import datetime
import pytz
from lib.rome.core.dataformat import get_decoder
import re
import uuid
from sqlalchemy.sql.expression import BinaryExpression
from lib.rome.core.rows.rows import get_attribute, has_attribute
from lib.rome.core.utils import DATE_FORMAT, datetime_to_int
def uncapital... | {
"repo_name": "BeyondTheClouds/rome",
"path": "lib/rome/core/expression/expression.py",
"copies": "1",
"size": "15467",
"license": "mit",
"hash": 6101530661296925000,
"line_mean": 43.5763688761,
"line_max": 143,
"alpha_frac": 0.5274455292,
"autogenerated": false,
"ratio": 4.480590961761298,
"co... |
__author__ = 'jonathan'
import _fixtures as models
from lib.rome.core.orm.query import Query
import collections
import logging
import time
current_milli_time = lambda: int(round(time.time() * 1000))
def compute_ip(network_id, fixed_ip_id):
digits = [fixed_ip_id / 255, fixed_ip_id % 255]
return "172.%d.%d.%d... | {
"repo_name": "BeyondTheClouds/rome",
"path": "test/nova/bench.py",
"copies": "1",
"size": "1051",
"license": "mit",
"hash": -8302488762987745000,
"line_mean": 24.6585365854,
"line_max": 62,
"alpha_frac": 0.5870599429,
"autogenerated": false,
"ratio": 3.1945288753799392,
"config_test": false,
... |
__author__ = 'jonathan'
import logging
import time
import uuid
import traceback
from sqlalchemy.sql.expression import BinaryExpression
from sqlalchemy.util._collections import KeyedTuple
from lib.rome.core.dataformat import get_decoder
from lib.rome.core.lazy import LazyValue
from lib.rome.core.utils import get_obje... | {
"repo_name": "BeyondTheClouds/rome",
"path": "lib/rome/core/rows/rows.py",
"copies": "1",
"size": "10149",
"license": "mit",
"hash": 1286638079870201900,
"line_mean": 34.8657243816,
"line_max": 218,
"alpha_frac": 0.622228791,
"autogenerated": false,
"ratio": 3.932196822936846,
"config_test": f... |
__author__ = 'jonathan'
import logging
import uuid
from lib.rome.core.utils import merge_dicts
from lib.rome.core.utils import current_milli_time
from lib.rome.driver.redis.lock import ClusterLock
# from oslo.db.exception import DBDeadlock
from lib.rome.core.utils import DBDeadlock
from lib.rome.core.lazy import Lazy... | {
"repo_name": "BeyondTheClouds/rome",
"path": "lib/rome/core/session/session.py",
"copies": "1",
"size": "7673",
"license": "mit",
"hash": 4644400284734940000,
"line_mean": 35.1981132075,
"line_max": 114,
"alpha_frac": 0.5703114818,
"autogenerated": false,
"ratio": 4.017277486910995,
"config_te... |
__author__ = 'jonathan'
import logging
from sqlalchemy.orm import contains_eager
from sqlalchemy.orm import joinedload
# import test.nova._fixtures as models
import nova.db.discovery.models as models
from lib.rome.core.orm.query import Query as RomeQuery
from lib.rome.core.session.session import Session as RomeSess... | {
"repo_name": "BeyondTheClouds/rome",
"path": "test/nova/methods/test_aggregate_metadata_get_by_metadata_key.py",
"copies": "1",
"size": "2474",
"license": "mit",
"hash": 7205676411169338000,
"line_mean": 30.3291139241,
"line_max": 78,
"alpha_frac": 0.6568310428,
"autogenerated": false,
"ratio": ... |
__author__ = 'jonathan'
import logging
import test.nova._fixtures as models
from lib.rome.core.orm.query import Query
from lib.rome.core.session.session import Session as Session
def test_relationships_single_str(save_instance=True, save_info_cache=True, use_update=False, use_session=False):
print("Ensure that ... | {
"repo_name": "BeyondTheClouds/rome",
"path": "test/nova/features/test_relationships.py",
"copies": "1",
"size": "7901",
"license": "mit",
"hash": 3091501750508745700,
"line_mean": 36.8038277512,
"line_max": 248,
"alpha_frac": 0.6467535755,
"autogenerated": false,
"ratio": 3.741003787878788,
"c... |
__author__ = 'jonathan'
import nltk
from nltk.corpus import stopwords
from nltk import FreqDist
class TextAnalyzer:
_instance = None
stopwords = []
cleaned = []
def __new__(cls, *args, **kwargs):
if not cls._instance:
cls._instance = super(TextAnalyzer, cls).__new__(
... | {
"repo_name": "jclaros/pytextminer-mod5",
"path": "project/TextAnalyzer.py",
"copies": "1",
"size": "1422",
"license": "mit",
"hash": -8196779914885690000,
"line_mean": 25.8301886792,
"line_max": 88,
"alpha_frac": 0.6040787623,
"autogenerated": false,
"ratio": 3.8852459016393444,
"config_test":... |
__author__ = 'jonathan'
import test.nova._fixtures as models
from lib.rome.core.orm.query import Query
from lib.rome.core.orm.query import Query as RomeQuery
from lib.rome.core.session.session import Session as RomeSession
import six
# from oslo.utils import timeutils
from lib.rome.core.utils import timeutils
from te... | {
"repo_name": "BeyondTheClouds/rome",
"path": "test/nova/methods/test_flavor_get_by_flavor_id.py",
"copies": "1",
"size": "3386",
"license": "mit",
"hash": 2948967885143493000,
"line_mean": 34.6421052632,
"line_max": 116,
"alpha_frac": 0.6396928529,
"autogenerated": false,
"ratio": 3.700546448087... |
__author__ = 'jonathan'
import threading
import Queue
class MemoizationDecorator(object):
conditions_objects_dict = {}
memory = {}
insertion_lock = threading.Lock()
def __init__(self, decorated):
self.decorated = decorated
def __getattr__(self, attribute_name):
decorated_attribu... | {
"repo_name": "BeyondTheClouds/rome",
"path": "lib/rome/utils/MemoizationDecorator.py",
"copies": "1",
"size": "4785",
"license": "mit",
"hash": 5063944206208676000,
"line_mean": 35.25,
"line_max": 155,
"alpha_frac": 0.5431556949,
"autogenerated": false,
"ratio": 4.659201557935735,
"config_test... |
__author__ = 'jonathan'
import unittest
import logging
import time
import functools
from lib.rome.core.orm.query import Query
from test._fixtures import *
BASE = declarative_base()
from lib.rome.core.models import Entity
from lib.rome.core.models import global_scope
# from lib.rome.core.session.session import OldSe... | {
"repo_name": "BeyondTheClouds/rome",
"path": "test/nova/features/test_session.py",
"copies": "1",
"size": "4272",
"license": "mit",
"hash": 4890863333366457000,
"line_mean": 29.7338129496,
"line_max": 97,
"alpha_frac": 0.5507958801,
"autogenerated": false,
"ratio": 4.045454545454546,
"config_t... |
__author__ = 'jonathan'
class Animal:
_nombre = None
_altura = 0
_peso = 0
_sonido = 0
def __init__(self, nombre, altura, peso, sonido):
self._nombre = nombre
self._altura = altura
self._peso = peso
self._sonido = sonido
def get_nombre(self):
return se... | {
"repo_name": "jclaros/pythonII2015",
"path": "code/day_1/pycharmproject/src/poo.py",
"copies": "1",
"size": "1695",
"license": "mit",
"hash": -6479682533779373000,
"line_mean": 18.9294117647,
"line_max": 95,
"alpha_frac": 0.572609209,
"autogenerated": false,
"ratio": 3.068840579710145,
"config... |
__author__ = 'jonathan'
SECONDARY_INDEXES = {}
class SecondaryIndexDecorator(object):
def __init__(self, attribute):
self.attribute = attribute
def __call__(self, model_class):
# <old implementation>
current_secondary_indexes = getattr(model_class, "_secondary_indexes", [])
s... | {
"repo_name": "BeyondTheClouds/rome",
"path": "lib/rome/utils/SecondaryIndexDecorator.py",
"copies": "1",
"size": "1120",
"license": "mit",
"hash": -7915772413521213000,
"line_mean": 36.3666666667,
"line_max": 108,
"alpha_frac": 0.6616071429,
"autogenerated": false,
"ratio": 4.102564102564102,
... |
__author__ = 'Jonathan Spitz'
import numpy as np
import copy
# ############################ PARETO PICKER CLASS ############################ #
# A Pareto picker object selects the best genomes from a population based on
# multiple fitness values. The genomes are divided into Pareto fronts and the
# first N genomes t... | {
"repo_name": "lothas/vrep-python-ai",
"path": "Picker/ParetoPicker.py",
"copies": "1",
"size": "3866",
"license": "mit",
"hash": -885645261885633500,
"line_mean": 32.3362068966,
"line_max": 96,
"alpha_frac": 0.4800827729,
"autogenerated": false,
"ratio": 3.8277227722772276,
"config_test": fals... |
__author__ = 'Jonathan Spitz'
import numpy as np
import matplotlib.pyplot as plt
import copy
from matplotlib.pyplot import plot, draw, show
# def make_plot():
# plot([1,2,3])
# show(block=False)
# print 'continue computation'
#
# print('Do something before plotting.')
# # Now display plot in a window
# ma... | {
"repo_name": "lothas/vrep-python-ai",
"path": "Sandbox.py",
"copies": "1",
"size": "3723",
"license": "mit",
"hash": 4575300826111262700,
"line_mean": 26.5851851852,
"line_max": 104,
"alpha_frac": 0.5047005103,
"autogenerated": false,
"ratio": 3.026829268292683,
"config_test": false,
"has_no... |
__author__ = 'Jonathan Spitz'
import numpy as np
# ##################################### BUILDER CLASS ##################################### #
# A Builder object creates a new population using a given population by applying
# reproduction operators like crossover and mutation.
# To create an object you'll need to pr... | {
"repo_name": "lothas/vrep-python-ai",
"path": "Builder/Builder.py",
"copies": "1",
"size": "4343",
"license": "mit",
"hash": -5917910863844563000,
"line_mean": 39.9811320755,
"line_max": 93,
"alpha_frac": 0.5316601428,
"autogenerated": false,
"ratio": 3.721508140531277,
"config_test": false,
... |
__author__ = 'Jonathan Spitz'
import numpy as np
# ############################ SINGLE PICKER CLASS ############################ #
# A Single picker object selects the best genomes from a population based on
# a single fitness value. The genomes are sorted by decreasing fitness and the
# first N genomes are returned... | {
"repo_name": "lothas/vrep-python-ai",
"path": "Picker/SinglePicker.py",
"copies": "1",
"size": "1311",
"license": "mit",
"hash": -5163272301428812000,
"line_mean": 35.4166666667,
"line_max": 81,
"alpha_frac": 0.5705568268,
"autogenerated": false,
"ratio": 3.581967213114754,
"config_test": fals... |
__author__ = 'Jonathan Spitz'
import sys
import os
# Get parent directory by joining this file's path [os.path.dirname(os.path.abspath(__file__))] with '..' [os.pardir]
parentDir = os.path.abspath(os.path.dirname(os.path.abspath(__file__))+'\\'+os.pardir)
sys.path.insert(0, parentDir) # Add the parent directory where... | {
"repo_name": "lothas/vrep-python-ai",
"path": "Tester/LineFolTester.py",
"copies": "1",
"size": "7795",
"license": "mit",
"hash": 7616912353688580000,
"line_mean": 42.0718232044,
"line_max": 118,
"alpha_frac": 0.5349583066,
"autogenerated": false,
"ratio": 3.489256938227395,
"config_test": tru... |
__author__ = 'Jonathan Sumrall'
import xml.etree.ElementTree as ET
from xml.dom import minidom
class Log():
""" An XES log class for adding traces to.
"""
def __init__(self):
self.CREATOR = "Python XES v1.2"
self.log = ET.Element("log")
self.log.set("xes.version", "1.0")
sel... | {
"repo_name": "maxsumrall/xes",
"path": "xes/xes.py",
"copies": "2",
"size": "7143",
"license": "apache-2.0",
"hash": -549711999645377400,
"line_mean": 29.2669491525,
"line_max": 116,
"alpha_frac": 0.552848943,
"autogenerated": false,
"ratio": 4.093409742120344,
"config_test": false,
"has_no_... |
__author__ = 'Jonathan Sumrall'
import xml.etree.ElementTree as ET
from xml.dom import minidom
class Log():
""" An XES log class for adding traces to.
"""
def __init__(self, version="1.0"):
self.CREATOR = "Python XES v1.2"
self.version = version
self.attributes = []
self.tr... | {
"repo_name": "msurkovsky/xes",
"path": "xes/xes.py",
"copies": "1",
"size": "6184",
"license": "apache-2.0",
"hash": -7339872078125703000,
"line_mean": 27.8971962617,
"line_max": 116,
"alpha_frac": 0.5708279431,
"autogenerated": false,
"ratio": 3.9489144316730522,
"config_test": false,
"has_... |
__author__ = 'jon-bassi'
import sys
import math
import Caesar
def chi_squared(text):
"""
determines chi-squared statistic of a given string of text
:param text:
:return chiSquared:
"""
alphabet = 'abcdefghijklmnopqrstuvwxyz'
# expected occurrence of every standard english letter
expec... | {
"repo_name": "jon-bassi/crypto-tools",
"path": "tools/ChiSquaredStatistic.py",
"copies": "2",
"size": "1585",
"license": "mit",
"hash": -7939230987668726000,
"line_mean": 30.7,
"line_max": 115,
"alpha_frac": 0.6214511041,
"autogenerated": false,
"ratio": 3.1139489194499017,
"config_test": fals... |
__author__ = 'jon-bassi'
import sys
import math
import Vignere
# load files into memory - increase load time, decrease runtime
mono = 'english_monograms'
bi = 'english_bigrams'
tri = 'english_trigrams'
quad = 'english_quadgrams'
monograms = {}
mN = 0.0
for line in file(mono):
key, score = line.split(' ')
mon... | {
"repo_name": "jon-bassi/crypto-tools",
"path": "hw/hw1/NGramScore.py",
"copies": "1",
"size": "3589",
"license": "mit",
"hash": 6016064768634015000,
"line_mean": 24.4539007092,
"line_max": 102,
"alpha_frac": 0.5695179716,
"autogenerated": false,
"ratio": 3.4018957345971566,
"config_test": fals... |
__author__ = 'jon-bassi'
import sys
import math
import Vignere
# load files into memory - increase load time, decrease runtime
mono = 'ngram_data/english_monograms'
bi = 'ngram_data/english_bigrams'
tri = 'ngram_data/english_trigrams'
quad = 'ngram_data/english_quadgrams'
monograms = {}
mN = 0.0
for line in file(mon... | {
"repo_name": "jon-bassi/crypto-tools",
"path": "tools/NGramScore.py",
"copies": "1",
"size": "3633",
"license": "mit",
"hash": 8190716236565223000,
"line_mean": 24.7659574468,
"line_max": 102,
"alpha_frac": 0.5725295899,
"autogenerated": false,
"ratio": 3.3795348837209302,
"config_test": false... |
__author__ = 'jon-bassi'
import sys
def encrypt(text, key):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted = ''
for letter in text:
if letter in alphabet:
num = alphabet.find(letter)
num += key
if num >= len(alphabet):
num -= len(alphabet)
... | {
"repo_name": "jon-bassi/crypto-tools",
"path": "tools/Caesar.py",
"copies": "2",
"size": "1834",
"license": "mit",
"hash": -6695702688716285000,
"line_mean": 23.7837837838,
"line_max": 100,
"alpha_frac": 0.5207197383,
"autogenerated": false,
"ratio": 4.255220417633411,
"config_test": false,
... |
__author__ = 'jon-bassi'
import sys
def index_coincidence(text):
"""
finds the index of coincidence for a given string
:param text:
:return ic:
"""
alphabet = 'abcdefghijklmnopqrstuvwxyz'
ic = 0.0
n = len(text)
if n == 0 or n == 1:
return 0
for letter in alphabet:
... | {
"repo_name": "jon-bassi/crypto-tools",
"path": "tools/IndexOfCoincidence.py",
"copies": "2",
"size": "1188",
"license": "mit",
"hash": 1961757704904876300,
"line_mean": 22.76,
"line_max": 97,
"alpha_frac": 0.5303030303,
"autogenerated": false,
"ratio": 3.365439093484419,
"config_test": false,
... |
__author__ = 'jon-bassi'
import sys
# Vignere Cipher encrypt and decrypt tools
def encrypt(text, key):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
# alphabet is first letter in vignere alphabet
# difference between letter and alphabet is the new letter
encrypted = ''
for letter in range(len(text)):
... | {
"repo_name": "jon-bassi/crypto-tools",
"path": "hw/hw1/Vignere.py",
"copies": "2",
"size": "1212",
"license": "mit",
"hash": 4266562549050202600,
"line_mean": 29.3,
"line_max": 104,
"alpha_frac": 0.6229372937,
"autogenerated": false,
"ratio": 3.62874251497006,
"config_test": false,
"has_no_k... |
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2012, Jonathan P Dawson"
__version__ = "0.1"
class Allocator:
"""Maintain a pool of registers, variables and arrays. Keep track of what they are used for."""
def __init__(self, reuse):
self.registers = []
self.all_registers = {}
... | {
"repo_name": "amerc/TCP3",
"path": "chips2/chips/compiler/allocator.py",
"copies": "3",
"size": "1644",
"license": "mit",
"hash": 7388081817702219000,
"line_mean": 33.25,
"line_max": 99,
"alpha_frac": 0.5638686131,
"autogenerated": false,
"ratio": 3.895734597156398,
"config_test": false,
"ha... |
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2012, Jonathan P Dawson"
__version__ = "0.1"
def cleanup_functions(instructions):
"""Remove functions that are not called"""
#This is an iterative processr. Once a function is removed,
#there may be more unused functions
while 1:
#fin... | {
"repo_name": "freecores/tcp_socket",
"path": "chips2/chips/compiler/optimizer.py",
"copies": "3",
"size": "7281",
"license": "mit",
"hash": -7674281173872998000,
"line_mean": 35.0445544554,
"line_max": 140,
"alpha_frac": 0.580552122,
"autogenerated": false,
"ratio": 4.640535372848948,
"config_... |
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2012, Jonathan P Dawson"
__version__ = "0.1"
from register_map import *
def push(trace, instructions, reg):
"""Push the content of *reg(* onto the stack"""
instructions.append({"trace": trace, "op": "push", "reg": reg})
return instructions
def po... | {
"repo_name": "dawsonjon/Chips-2.0",
"path": "chips/compiler/instruction_utils.py",
"copies": "1",
"size": "7030",
"license": "mit",
"hash": 2365107741670380500,
"line_mean": 28.5378151261,
"line_max": 78,
"alpha_frac": 0.4294452347,
"autogenerated": false,
"ratio": 4.466327827191868,
"config_t... |
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2012, Jonathan P Dawson"
__version__ = "0.1"
import os
class C2CHIPError(Exception):
def __init__(self, message, filename=None, lineno=None):
self.message = message
if filename is not None:
self.filename = os.path.abspath(filen... | {
"repo_name": "dawsonjon/Chips-2.0",
"path": "chips/compiler/exceptions.py",
"copies": "1",
"size": "1441",
"license": "mit",
"hash": -5025703627599996000,
"line_mean": 18.2133333333,
"line_max": 68,
"alpha_frac": 0.5746009715,
"autogenerated": false,
"ratio": 4.0821529745042495,
"config_test":... |
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2012, Jonathan P Dawson"
__version__ = "0.1"
import os.path
import StringIO
from chips.compiler.exceptions import C2CHIPError
from chips.compiler.builtins import builtins
from chips.compiler.library import libs
operators = [
"!", "~", "+", "-", "*", "/", "//... | {
"repo_name": "freecores/tcp_socket",
"path": "chips2/chips/compiler/tokens.py",
"copies": "3",
"size": "5939",
"license": "mit",
"hash": 2718215933428063000,
"line_mean": 31.1027027027,
"line_max": 86,
"alpha_frac": 0.4396363024,
"autogenerated": false,
"ratio": 4.880032867707477,
"config_test... |
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2012, Jonathan P Dawson"
__version__ = "0.1"
import struct
from copy import copy, deepcopy
from textwrap import dedent
from parse_tree import *
from tokens import Tokens
from allocator import Allocator
from types import *
types = [
"double",
"float",
... | {
"repo_name": "dawsonjon/Chips-2.0",
"path": "chips/compiler/parser.py",
"copies": "1",
"size": "64601",
"license": "mit",
"hash": -6337354443069040000,
"line_mean": 35.3744369369,
"line_max": 113,
"alpha_frac": 0.5291404158,
"autogenerated": false,
"ratio": 4.603506021520701,
"config_test": fa... |
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2012, Jonathan P Dawson"
__version__ = "0.1"
import struct
from copy import copy
from parse_tree import *
from tokens import Tokens
from allocator import Allocator
types = ["float", "signed", "unsigned", "short", "long", "char", "int", "void"]
numeric_types = ... | {
"repo_name": "amerc/phimii",
"path": "chips2/chips/compiler/parser.py",
"copies": "3",
"size": "35311",
"license": "mit",
"hash": 3705126908456317400,
"line_mean": 34.8487309645,
"line_max": 104,
"alpha_frac": 0.512899663,
"autogenerated": false,
"ratio": 4.639469189331231,
"config_test": fals... |
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2012, Jonathan P Dawson"
__version__ = "0.1"
import struct
from register_map import *
from instruction_utils import *
from instruction_utils import _return
from exceptions import C2CHIPError, NotConstant
from chips_c import bits_to_double, bits_to_float
from typ... | {
"repo_name": "dawsonjon/Chips-2.0",
"path": "chips/compiler/parse_tree.py",
"copies": "1",
"size": "70130",
"license": "mit",
"hash": -5548293350301659000,
"line_mean": 26.9848363927,
"line_max": 79,
"alpha_frac": 0.4960929702,
"autogenerated": false,
"ratio": 4.553304765614855,
"config_test":... |
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2012, Jonathan P Dawson"
__version__ = "0.1"
import struct
class NotConstant(Exception):
pass
def constant_fold(expression):
"""Replace an expression with a constant if possible"""
try:
return Constant(expression.value(), expression.type... | {
"repo_name": "amerc/TCP3",
"path": "chips2/chips/compiler/parse_tree.py",
"copies": "3",
"size": "31836",
"license": "mit",
"hash": 8300868117354572000,
"line_mean": 26.4922279793,
"line_max": 103,
"alpha_frac": 0.545357457,
"autogenerated": false,
"ratio": 4.394809497515185,
"config_test": fa... |
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2012, Jonathan P Dawson"
__version__ = "0.1"
def cleanup_functions(instructions):
"""Remove functions that are not called"""
# This is an iterative processor. Once a function is removed,
# there may be more unused functions
while True:
... | {
"repo_name": "dawsonjon/Chips-2.0",
"path": "chips/compiler/optimizer.py",
"copies": "1",
"size": "1239",
"license": "mit",
"hash": 4012295393456590300,
"line_mean": 34.4,
"line_max": 65,
"alpha_frac": 0.5690072639,
"autogenerated": false,
"ratio": 5.016194331983805,
"config_test": false,
"h... |
__author__ = 'jond'
import csv
import datetime
import json
import urllib2
import decimal
from rdflib import URIRef, Literal, Namespace, RDF
from rdflib.namespace import XSD
from gmdspconverters import utils
# Source conversion notes:
# Some clean up of weird characters needed to happen on the source data
PLANNING_... | {
"repo_name": "GMDSP-Linked-Data/RDF-work-in-progress",
"path": "salford/gmdspconverters/planning.py",
"copies": "1",
"size": "4934",
"license": "mit",
"hash": -3067453545800352300,
"line_mean": 41.5344827586,
"line_max": 136,
"alpha_frac": 0.6137008512,
"autogenerated": false,
"ratio": 3.5935906... |
__author__ = 'jond'
import csv
import re
from rdflib import URIRef, Literal, Namespace, RDF
from gmdspconverters import utils
STREETLIGHT = Namespace('http://data.gmdsp.org.uk/id/salford/streetlighting/')
STREETLIGHT_ONT = Namespace('http://data.gmdsp.org.uk/def/council/streetlighting/')
def convert(graph, input_... | {
"repo_name": "GMDSP-Linked-Data/RDF-work-in-progress",
"path": "salford/gmdspconverters/streetlighting.py",
"copies": "1",
"size": "2324",
"license": "mit",
"hash": -5283794251459596000,
"line_mean": 42.037037037,
"line_max": 115,
"alpha_frac": 0.59767642,
"autogenerated": false,
"ratio": 3.4378... |
__author__ = 'jond'
import csv
from rdflib import URIRef, Literal, Namespace, RDF
from gmdspconverters import utils
PARKING = Namespace('http://data.gmdsp.org.uk/id/salford/parking/')
PARKING_ONT = Namespace('http://data.gmdsp.org.uk/def/council/parking/')
PARKING_TYPE_ONT = Namespace('http://data.gmdsp.org.uk/def/... | {
"repo_name": "GMDSP-Linked-Data/RDF-work-in-progress",
"path": "salford/gmdspconverters/parking.py",
"copies": "1",
"size": "2027",
"license": "mit",
"hash": 6115637643317440000,
"line_mean": 48.4390243902,
"line_max": 135,
"alpha_frac": 0.6517020227,
"autogenerated": false,
"ratio": 3.048120300... |
__author__ = 'jond'
import csv
from rdflib import URIRef, Literal, Namespace, RDF
from gmdspconverters import utils
RECYCLING = Namespace('http://data.gmdsp.org.uk/id/salford/recycling/')
RECYCLING_ONT = Namespace('http://data.gmdsp.org.uk/def/council/recycling/')
RECYCLING_TYPE_ONT = Namespace('http://data.gmdsp.o... | {
"repo_name": "GMDSP-Linked-Data/RDF-work-in-progress",
"path": "salford/gmdspconverters/recycling.py",
"copies": "1",
"size": "2393",
"license": "mit",
"hash": 8851967305847699000,
"line_mean": 41.7321428571,
"line_max": 107,
"alpha_frac": 0.6122022566,
"autogenerated": false,
"ratio": 3.2557823... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.