text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'chris'
from zope.interface.verify import verifyObject
from txrudp.rudp import ConnectionMultiplexer
from txrudp.connection import HandlerFactory, Handler, State
from txrudp.crypto_connection import CryptoConnectionFactory
from twisted.internet.task import LoopingCall
from twisted.internet import task, rea... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "net/wireprotocol.py",
"copies": "1",
"size": "5703",
"license": "mit",
"hash": -9067928369747142000,
"line_mean": 41.2444444444,
"line_max": 110,
"alpha_frac": 0.6189724706,
"autogenerated": false,
"ratio": 4.346798780487805,
"config_test": fal... |
__author__ = 'chris'
from zope.interface.verify import verifyObject
from txrudp.rudp import ConnectionMultiplexer
from txrudp.connection import HandlerFactory, Handler
from txrudp.crypto_connection import CryptoConnectionFactory
from interfaces import MessageProcessor
from protos.message import Message
from log impor... | {
"repo_name": "jorik041/Network",
"path": "wireprotocol.py",
"copies": "1",
"size": "3131",
"license": "mit",
"hash": 8265029074001010000,
"line_mean": 37.1951219512,
"line_max": 126,
"alpha_frac": 0.6288725647,
"autogenerated": false,
"ratio": 4.518037518037518,
"config_test": false,
"has_no... |
__author__ = 'chris'
import argparse
import codecs
import requests
import xml.etree.ElementTree as ET
import csv
from xml.sax.saxutils import escape
# Example of reading a UTF-8 csv file and importing it into LocDirect
# CSV fields should all be within double quotes like:
# "Strings/","str_1","Press Start"
# if conten... | {
"repo_name": "locdirect/http-api-examples",
"path": "ld_http_import.py",
"copies": "1",
"size": "4252",
"license": "mit",
"hash": -1145478440279634800,
"line_mean": 33.8606557377,
"line_max": 148,
"alpha_frac": 0.6333490122,
"autogenerated": false,
"ratio": 3.759504862953139,
"config_test": fa... |
__author__ = 'chris'
import argparse
import os
import sys
from django.core.management.base import BaseCommand, CommandError
from django.core.files import File
from ...backend.utils import add_wooey_script, default_storage, get_storage
from ... import settings as wooey_settings
class Command(BaseCommand):
help = ... | {
"repo_name": "wooey/Wooey",
"path": "wooey/management/commands/addscript.py",
"copies": "1",
"size": "3058",
"license": "bsd-3-clause",
"hash": -5623689245226082000,
"line_mean": 42.0704225352,
"line_max": 131,
"alpha_frac": 0.5631131458,
"autogenerated": false,
"ratio": 4.171896316507503,
"co... |
__author__ = 'chris'
import bitcoin
import nacl.signing
import nacl.encoding
from db.datastore import KeyStore
from keyutils.guid import GUID
from nacl.public import PrivateKey
class KeyChain(object):
def __init__(self):
self.db = KeyStore()
guid_keys = self.db.get_key("guid")
if guid_keys... | {
"repo_name": "bankonme/OpenBazaar-Server",
"path": "keyutils/keys.py",
"copies": "4",
"size": "1674",
"license": "mit",
"hash": 4772613520031477000,
"line_mean": 39.8292682927,
"line_max": 97,
"alpha_frac": 0.6541218638,
"autogenerated": false,
"ratio": 3.4875,
"config_test": false,
"has_no_... |
__author__ = 'chris'
import bitcoin
import nacl.signing
import nacl.encoding
from keyutils.guid import GUID
from nacl.public import PrivateKey
class KeyChain(object):
def __init__(self, database):
self.db = database.KeyStore()
guid_keys = self.db.get_key("guid")
if guid_keys is None:
... | {
"repo_name": "JimmyMow/OpenBazaar-Server",
"path": "keyutils/keys.py",
"copies": "3",
"size": "1659",
"license": "mit",
"hash": 782470814152704500,
"line_mean": 40.475,
"line_max": 97,
"alpha_frac": 0.6522001206,
"autogenerated": false,
"ratio": 3.485294117647059,
"config_test": false,
"has_... |
__author__ = 'chris'
import bitcointools
import nacl.signing
import nacl.encoding
import threading
from keys.guid import GUID
class KeyChain(object):
def __init__(self, database, callback=None, heartbeat_server=None):
self.db = database
guid_keys = self.db.keys.get_key("guid")
if guid_key... | {
"repo_name": "OpenBazaar/OpenBazaar-Server",
"path": "keys/keychain.py",
"copies": "6",
"size": "2191",
"license": "mit",
"hash": 2547109085127205400,
"line_mean": 41.9607843137,
"line_max": 115,
"alpha_frac": 0.6371519854,
"autogenerated": false,
"ratio": 3.758147512864494,
"config_test": fal... |
__author__ = 'chris'
import gnupg
from db.datastore import ProfileStore
from protos import objects
from keyutils.keys import KeyChain
class Profile(object):
"""
This is a class which handles creating an updating the user profile.
Data added to a protobuf object and stored in the database. The database
... | {
"repo_name": "bankonme/OpenBazaar-Server",
"path": "market/profile.py",
"copies": "2",
"size": "3207",
"license": "mit",
"hash": 1187532156559505700,
"line_mean": 35.8620689655,
"line_max": 80,
"alpha_frac": 0.6280012473,
"autogenerated": false,
"ratio": 4.1703511053316,
"config_test": false,
... |
__author__ = 'chris'
import gnupg
from db.datastore import ProfileStore
from protos import objects
class Profile(object):
"""
This is a class which handles creating an updating the user profile.
Data added to a protobuf object and stored in the database. The database
will update automatically when chan... | {
"repo_name": "hoffmabc/OpenBazaar-Server",
"path": "market/profile.py",
"copies": "2",
"size": "2847",
"license": "mit",
"hash": 4112070733113801700,
"line_mean": 35.5,
"line_max": 80,
"alpha_frac": 0.6227608008,
"autogenerated": false,
"ratio": 4.156204379562044,
"config_test": false,
"has_... |
__author__ = 'chris'
import gnupg
from protos import objects
class Profile(object):
"""
This is a class which handles creating an updating the user profile.
Data added to a protobuf object and stored in the database. The database
will update automatically when changes are made to the profile. When we
... | {
"repo_name": "JimmyMow/OpenBazaar-Server",
"path": "market/profile.py",
"copies": "3",
"size": "2820",
"license": "mit",
"hash": -1500793675124971000,
"line_mean": 35.6233766234,
"line_max": 80,
"alpha_frac": 0.6195035461,
"autogenerated": false,
"ratio": 4.147058823529412,
"config_test": fals... |
__author__ = 'chris'
import gnupg
from protos import objects
class Profile(object):
"""
This is a class which handles creating an updating the user profile.
Data added to a protobuf object and stored in the database. The database
will update automatically when changes are made to the profile. When we
... | {
"repo_name": "tyler-smith/OpenBazaar-Server",
"path": "market/profile.py",
"copies": "6",
"size": "3165",
"license": "mit",
"hash": -8791032331803363000,
"line_mean": 34.1666666667,
"line_max": 80,
"alpha_frac": 0.6107424961,
"autogenerated": false,
"ratio": 4.153543307086614,
"config_test": f... |
__author__ = 'chris'
import json
import os
from txrestapi.resource import APIResource
from txrestapi.methods import GET, POST, DELETE
from twisted.web import server
from twisted.web.resource import NoResource
from twisted.web import http
from twisted.internet import defer
from binascii import unhexlify
from constants i... | {
"repo_name": "the9ull/OpenBazaar-Server",
"path": "restapi.py",
"copies": "1",
"size": "17809",
"license": "mit",
"hash": -3690080829891478500,
"line_mean": 43.0816831683,
"line_max": 116,
"alpha_frac": 0.5298444607,
"autogenerated": false,
"ratio": 4.340482573726542,
"config_test": false,
"... |
__author__ = 'chris'
import json
import random
from twisted.internet import reactor
from autobahn.twisted.websocket import WebSocketClientFactory, \
WebSocketClientProtocol, \
connectWS
from dht.utils import digest
class BroadcastClientProtocol(WebSocketClientProtocol):
"""
Use for testing websocket a... | {
"repo_name": "the9ull/OpenBazaar-Server",
"path": "wsclient.py",
"copies": "1",
"size": "1286",
"license": "mit",
"hash": -6657294416645705000,
"line_mean": 27.5777777778,
"line_max": 99,
"alpha_frac": 0.5917573872,
"autogenerated": false,
"ratio": 3.7823529411764705,
"config_test": false,
"... |
__author__ = 'chris'
import json
import time
from interfaces import MessageListener, NotificationListener
from zope.interface import implements
from db.datastore import MessageStore, NotificationStore, FollowData
from protos.objects import Plaintext_Message, Following
class MessageListenerImpl(object):
implements(... | {
"repo_name": "the9ull/OpenBazaar-Server",
"path": "market/listeners.py",
"copies": "2",
"size": "2721",
"license": "mit",
"hash": -7435755596714566000,
"line_mean": 39.0147058824,
"line_max": 113,
"alpha_frac": 0.6034546123,
"autogenerated": false,
"ratio": 4.596283783783784,
"config_test": fa... |
__author__ = 'chris'
import json
import time
from interfaces import MessageListener, NotificationListener
from zope.interface import implements
from protos.objects import Plaintext_Message, Following
class MessageListenerImpl(object):
implements(MessageListener)
def __init__(self, web_socket_factory, database... | {
"repo_name": "melpomene/OpenBazaar-Server",
"path": "market/listeners.py",
"copies": "3",
"size": "2724",
"license": "mit",
"hash": -1609079314942202400,
"line_mean": 39.0588235294,
"line_max": 113,
"alpha_frac": 0.5991189427,
"autogenerated": false,
"ratio": 4.555183946488294,
"config_test": ... |
__author__ = 'chris'
import json
import time
import bitcoin
import nacl.signing
import nacl.encoding
from keyutils.guid import GUID
from nacl.public import PrivateKey
from txrestapi.resource import APIResource
from txrestapi.methods import GET
from twisted.web import server
from twisted.internet.defer import Deferred
f... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "keyutils/keys.py",
"copies": "1",
"size": "2986",
"license": "mit",
"hash": 4596344358661504500,
"line_mean": 36.325,
"line_max": 99,
"alpha_frac": 0.6500334896,
"autogenerated": false,
"ratio": 3.7654476670870114,
"config_test": false,
"has_... |
__author__ = 'chris'
import json
import time
import os
import pickle
from binascii import unhexlify
from collections import OrderedDict
from txrestapi.resource import APIResource
from txrestapi.methods import GET, POST, DELETE
from twisted.web import server
from twisted.web.resource import NoResource
from twisted.web ... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "api/restapi.py",
"copies": "1",
"size": "43099",
"license": "mit",
"hash": 6029408886130872000,
"line_mean": 44.947761194,
"line_max": 115,
"alpha_frac": 0.5220306736,
"autogenerated": false,
"ratio": 4.266382894476341,
"config_test": false,
... |
__author__ = 'chris'
import json
import time
import random
from interfaces import MessageListener, BroadcastListener, NotificationListener
from zope.interface import implements
from protos.objects import Plaintext_Message, Following
from dht.utils import digest
class MessageListenerImpl(object):
implements(Messag... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "market/listeners.py",
"copies": "1",
"size": "3945",
"license": "mit",
"hash": 3976415085491807000,
"line_mean": 38.0594059406,
"line_max": 113,
"alpha_frac": 0.573130545,
"autogenerated": false,
"ratio": 4.452595936794582,
"config_test": false... |
__author__ = 'chris'
import miniupnpc
class PortMapper(object):
"""
UPnP Port Mapping tool, so we don't need to manually forward ports on a
router.
Ideally we'd use a random port within a range of about 1000 possible ports.
Ideally we'd delete the mapping when we shutdown OpenBazaar but that might... | {
"repo_name": "saltduck/OpenBazaar-Server",
"path": "net/upnp.py",
"copies": "7",
"size": "7193",
"license": "mit",
"hash": -5233532053144581000,
"line_mean": 31.8447488584,
"line_max": 87,
"alpha_frac": 0.5249548172,
"autogenerated": false,
"ratio": 4.317527010804322,
"config_test": false,
"... |
__author__ = 'chris'
import mock
import time
import nacl.signing, nacl.encoding, nacl.hash
from binascii import unhexlify
from txrudp import connection, rudp, packet, constants
from twisted.trial import unittest
from twisted.internet import task, reactor, address, udp
from dht.protocol import KademliaProtocol
from... | {
"repo_name": "jorik041/Network",
"path": "dht/tests/test_protocol.py",
"copies": "1",
"size": "21942",
"license": "mit",
"hash": -8378470247242293000,
"line_mean": 42.0254901961,
"line_max": 142,
"alpha_frac": 0.6540880503,
"autogenerated": false,
"ratio": 3.6400132714001328,
"config_test": tr... |
__author__ = 'chris'
import nacl.signing
import nacl.hash
import guidc
from binascii import hexlify, unhexlify
class GUID:
def __init__(self, use_C_lib=False):
if use_C_lib:
self.privkey = unhexlify(guidc.generate())
self.signing_key = nacl.signing.SigningKey(self.privkey)
... | {
"repo_name": "jorik041/Network",
"path": "guidutils/guid.py",
"copies": "1",
"size": "1348",
"license": "mit",
"hash": 3212262410237796000,
"line_mean": 33.5641025641,
"line_max": 132,
"alpha_frac": 0.5853115727,
"autogenerated": false,
"ratio": 3.5104166666666665,
"config_test": false,
"has... |
__author__ = 'chris'
import os
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
def get(key, default):
return getattr(settings, key, default)
WOOEY_FILE_DIR = get('WOOEY_FILE_DIR', 'wooey_files')
WOOEY_SCRIPT_DIR = get('WOOEY_SCRIPT_DIR', 'wooey_scripts')
WOOEY_CELERY = ge... | {
"repo_name": "hottwaj/Wooey",
"path": "wooey/settings.py",
"copies": "1",
"size": "1030",
"license": "bsd-3-clause",
"hash": 8060846727601915000,
"line_mean": 41.9166666667,
"line_max": 76,
"alpha_frac": 0.7252427184,
"autogenerated": false,
"ratio": 2.581453634085213,
"config_test": false,
... |
__author__ = 'chris'
import os
import sys
from django.core.management.base import BaseCommand, CommandError
from django.core.files import File
from django.conf import settings
from ...backend.utils import add_wooey_script, get_storage, default_storage
from ... import settings as wooey_settings
class Command(BaseComm... | {
"repo_name": "waytai/Wooey",
"path": "wooey/management/commands/addscript.py",
"copies": "3",
"size": "2288",
"license": "bsd-3-clause",
"hash": 8519321934231547000,
"line_mean": 45.693877551,
"line_max": 131,
"alpha_frac": 0.5992132867,
"autogenerated": false,
"ratio": 4.028169014084507,
"con... |
__author__ = 'chris'
import os
import sys
from django.core.management.base import BaseCommand, CommandError
from django.core.files import File
from django.core.files.storage import default_storage
from django.conf import settings
from ...backend.utils import add_wooey_script
from ... import settings as wooey_settings
... | {
"repo_name": "wooey/django-djangui",
"path": "wooey/management/commands/addscript.py",
"copies": "1",
"size": "2007",
"license": "bsd-3-clause",
"hash": 4168658650180711000,
"line_mean": 42.6304347826,
"line_max": 131,
"alpha_frac": 0.6123567514,
"autogenerated": false,
"ratio": 4.03822937625754... |
__author__ = "chris"
import os
import unittest
import numpy as np
import pickle
from .utils import timer
from .mixins import FileMixins, GaussianMixin
from pyquant import peaks
from pyquant import PEAK_FINDING_DERIVATIVE, PEAK_FINDING_REL_MAX, PEAK_FIT_MODE_FAST
def get_gauss_value(x, amp, mu, std):
return amp ... | {
"repo_name": "Chris7/pyquant",
"path": "tests/test_peaks.py",
"copies": "1",
"size": "6867",
"license": "mit",
"hash": -493664865586904640,
"line_mean": 34.765625,
"line_max": 104,
"alpha_frac": 0.5586136595,
"autogenerated": false,
"ratio": 3.530591259640103,
"config_test": true,
"has_no_ke... |
__author__ = 'chris'
import os
import unittest
import numpy as np
import six
import six.moves.cPickle as pickle
from pyquant.tests.utils import timer
from pyquant.tests.mixins import FileMixins, GaussianMixin
from pyquant import peaks
from pyquant import PEAK_FINDING_DERIVATIVE, PEAK_FINDING_REL_MAX, PEAK_FIT_MODE_FA... | {
"repo_name": "pandeylab/pyquant",
"path": "pyquant/tests/test_peaks.py",
"copies": "1",
"size": "6061",
"license": "mit",
"hash": -2244795943386304500,
"line_mean": 47.1031746032,
"line_max": 174,
"alpha_frac": 0.6563273387,
"autogenerated": false,
"ratio": 3.1584158415841586,
"config_test": t... |
__author__ = 'chris'
import pickle
import os
import unittest
import numpy as np
import pandas as pd
import six
from pyquant import utils
from pyquant.tests.mixins import GaussianMixin
class UtilsTests(GaussianMixin, unittest.TestCase):
def setUp(self):
super(UtilsTests, self).setUp()
self.base_di... | {
"repo_name": "pandeylab/pyquant",
"path": "pyquant/tests/test_utils.py",
"copies": "1",
"size": "9211",
"license": "mit",
"hash": 8637839358337481000,
"line_mean": 47.7354497354,
"line_max": 171,
"alpha_frac": 0.5697535555,
"autogenerated": false,
"ratio": 2.791212121212121,
"config_test": tru... |
__author__ = "chris"
import pkg_resources # part of setuptools
import argparse
from pythomics.proteomics import config
version = pkg_resources.require("pyquant")[0].version
description = """
This will quantify labeled peaks (such as SILAC) in ms1 spectra. It relies solely on the distance between peaks,
which can co... | {
"repo_name": "Chris7/pyquant",
"path": "pyquant/__init__.py",
"copies": "1",
"size": "16230",
"license": "mit",
"hash": 4728967796479011000,
"line_mean": 32.1901840491,
"line_max": 197,
"alpha_frac": 0.6970425139,
"autogenerated": false,
"ratio": 3.4254959898691433,
"config_test": false,
"ha... |
__author__ = 'chris'
import pkg_resources # part of setuptools
import argparse
from pythomics.proteomics import config
version = pkg_resources.require('pyquant-ms')[0].version
description = """
This will quantify labeled peaks (such as SILAC) in ms1 spectra. It relies solely on the distance between peaks,
which can... | {
"repo_name": "pandeylab/pyquant",
"path": "pyquant/__init__.py",
"copies": "1",
"size": "14839",
"license": "mit",
"hash": 2856051937511392000,
"line_mean": 98.5906040268,
"line_max": 298,
"alpha_frac": 0.7553743514,
"autogenerated": false,
"ratio": 3.527216543855479,
"config_test": false,
"... |
__author__ = 'chris'
import sqlite3 as lite
import os
from constants import DATA_FOLDER
from protos.objects import Listings, Followers, Following
from dht.node import Node
from binascii import unhexlify
from collections import Counter
class Database(object):
# pylint: disable=W0601
DATABASE = None
def _... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "db/datastore.py",
"copies": "1",
"size": "28186",
"license": "mit",
"hash": -5354942035978958000,
"line_mean": 41.1315396114,
"line_max": 116,
"alpha_frac": 0.556340027,
"autogenerated": false,
"ratio": 4.37263419174682,
"config_test": false,
... |
__author__ = 'chris'
import sqlite3 as lite
import os
from constants import DATA_FOLDER
from protos.objects import Listings, Followers, Following
from dht.node import Node
class Database(object):
# pylint: disable=W0601
DATABASE = None
def __init__(self, testnet=False, filepath=None):
global DATA... | {
"repo_name": "Joaz/OpenBazaar-Server",
"path": "db/datastore.py",
"copies": "3",
"size": "20943",
"license": "mit",
"hash": -4037693305700211000,
"line_mean": 39.6660194175,
"line_max": 116,
"alpha_frac": 0.5461490713,
"autogenerated": false,
"ratio": 4.457854406130268,
"config_test": false,
... |
__author__ = 'chris'
import sqlite3 as lite
from constants import DATABASE
from protos.objects import Listings, Followers, Following
from dht.node import Node
def create_database(filepath=None):
if filepath == None:
db = lite.connect(DATABASE)
else:
db = lite.connect(filepath)
cursor = db.... | {
"repo_name": "the9ull/OpenBazaar-Server",
"path": "db/datastore.py",
"copies": "1",
"size": "12810",
"license": "mit",
"hash": 5390940786583150000,
"line_mean": 35.7048710602,
"line_max": 115,
"alpha_frac": 0.5954722873,
"autogenerated": false,
"ratio": 4.164499349804942,
"config_test": false,... |
__author__ = 'chris'
import sqlite3 as lite
from constants import DATABASE
from protos.objects import Listings, Followers, Following
def create_database(filepath=None):
if filepath == None:
db = lite.connect(DATABASE)
else:
db = lite.connect(filepath)
cursor = db.cursor()
cursor.execut... | {
"repo_name": "eXcomm/OpenBazaar-Server",
"path": "db/datastore.py",
"copies": "2",
"size": "11621",
"license": "mit",
"hash": -673905914379458700,
"line_mean": 35.5440251572,
"line_max": 112,
"alpha_frac": 0.5945271491,
"autogenerated": false,
"ratio": 4.2319737800437,
"config_test": false,
... |
__author__ = 'chris'
import stun
import os
import sys
import dht.constants
from db.datastore import create_database
from twisted.internet import reactor
from twisted.python import log, logfile
from twisted.web.server import Site
from twisted.web.static import File
from keyutils.keys import KeyChain
from dht.network imp... | {
"repo_name": "hoffmabc/OpenBazaar-Server",
"path": "openbazaard.py",
"copies": "1",
"size": "2949",
"license": "mit",
"hash": -6808049444128088000,
"line_mean": 31.7666666667,
"line_max": 105,
"alpha_frac": 0.7653441845,
"autogenerated": false,
"ratio": 3.2513781697905184,
"config_test": false... |
__author__ = 'chris'
import sys
import argparse
import json
import time
from twisted.internet import reactor
from txjsonrpc.netstring.jsonrpc import Proxy
from binascii import hexlify, unhexlify
from dht.utils import digest
from txjsonrpc.netstring import jsonrpc
from market.profile import Profile
from protos import ob... | {
"repo_name": "the9ull/OpenBazaar-Server",
"path": "networkcli.py",
"copies": "1",
"size": "27857",
"license": "mit",
"hash": -3815123287889230000,
"line_mean": 37.5297372061,
"line_max": 116,
"alpha_frac": 0.5947876656,
"autogenerated": false,
"ratio": 4.201025486351983,
"config_test": false,
... |
__author__ = 'chris'
import sys
import argparse
import json
from twisted.internet import reactor
from txjsonrpc.netstring.jsonrpc import Proxy
def do_continue(value):
pass
def print_value(value):
print json.dumps(value, indent=4)
reactor.stop()
def print_error(error):
print 'error', error
rea... | {
"repo_name": "jorik041/Network",
"path": "network-cli.py",
"copies": "1",
"size": "5804",
"license": "mit",
"hash": 249355696187111900,
"line_mean": 35.974522293,
"line_max": 113,
"alpha_frac": 0.6088904204,
"autogenerated": false,
"ratio": 4.139800285306705,
"config_test": false,
"has_no_ke... |
__author__ = 'chris'
import sys
import os
import pickle
import json
import random
from twisted.application import service, internet
from twisted.python.log import ILogObserver
from twisted.internet import task
from twisted.web import resource, server
from binascii import hexlify
from random import shuffle
import stun
... | {
"repo_name": "jorik041/Network",
"path": "seed/httpseed.py",
"copies": "1",
"size": "7421",
"license": "mit",
"hash": -1683405836667646500,
"line_mean": 38.0631578947,
"line_max": 93,
"alpha_frac": 0.5721600862,
"autogenerated": false,
"ratio": 4.08870523415978,
"config_test": false,
"has_no... |
__author__ = 'chris'
import sys
import pickle
import json
import random
from binascii import hexlify
from random import shuffle
import os
from twisted.application import service, internet
from twisted.python.log import ILogObserver
from twisted.internet import task
from twisted.web import resource, server
import stun
... | {
"repo_name": "eXcomm/OpenBazaar-Server",
"path": "seed/httpseed.py",
"copies": "4",
"size": "7575",
"license": "mit",
"hash": 7731996488541962000,
"line_mean": 38.0463917526,
"line_max": 92,
"alpha_frac": 0.5838943894,
"autogenerated": false,
"ratio": 4.066022544283414,
"config_test": false,
... |
__author__ = 'chris'
import sys
import pickle
import json
import random
import argparse
import platform
from binascii import hexlify
from random import shuffle
import os
from twisted.internet import task, reactor
from twisted.web import resource, server
import stun
import nacl.signing
import nacl.hash
import nacl.enco... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "seed/httpseed.py",
"copies": "1",
"size": "11098",
"license": "mit",
"hash": -8422687940657860000,
"line_mean": 39.8014705882,
"line_max": 111,
"alpha_frac": 0.5486574158,
"autogenerated": false,
"ratio": 4.33515625,
"config_test": true,
"has... |
__author__ = 'chris'
import sys, os, atexit
from signal import SIGTERM
class Daemon(object):
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
"""
# pylint: disable=file-builtin
def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr=... | {
"repo_name": "OpenBazaar/Network",
"path": "daemon.py",
"copies": "6",
"size": "3630",
"license": "mit",
"hash": -6061110490768473000,
"line_mean": 27.359375,
"line_max": 110,
"alpha_frac": 0.5077134986,
"autogenerated": false,
"ratio": 3.9933993399339935,
"config_test": false,
"has_no_keywo... |
__author__ = 'chris'
import sys, os
import gzip
from cStringIO import StringIO
from OpenSSL import SSL
from twisted.application import service, internet
from twisted.python.log import ILogObserver
from twisted.internet import ssl, task, reactor
from twisted.web import resource, server
from subspace.network import S... | {
"repo_name": "cpacia/Subspace",
"path": "servers/seedserver/seedserver.py",
"copies": "1",
"size": "4594",
"license": "mit",
"hash": -633733203088176600,
"line_mean": 33.5413533835,
"line_max": 104,
"alpha_frac": 0.6460600784,
"autogenerated": false,
"ratio": 3.9671848013816926,
"config_test":... |
__author__ = 'chris'
import sys, os, time, atexit
from signal import SIGTERM
class Daemon(object):
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
"""
# pylint: disable=file-builtin
def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', st... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "daemon.py",
"copies": "4",
"size": "3692",
"license": "mit",
"hash": -2168159017127064800,
"line_mean": 27.6201550388,
"line_max": 110,
"alpha_frac": 0.5048754063,
"autogenerated": false,
"ratio": 3.9956709956709955,
"config_test": false,
"ha... |
__author__ = 'chris'
import time
import pickle
import sys
import argparse
import platform
from twisted.internet import reactor, task
from twisted.python import log, logfile
from twisted.web.server import Site
from twisted.web.static import File
import stun
import requests
import threading
from autobahn.twisted.websoc... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "openbazaard.py",
"copies": "1",
"size": "11432",
"license": "mit",
"hash": 1310892587505464000,
"line_mean": 39.1122807018,
"line_max": 116,
"alpha_frac": 0.5900979706,
"autogenerated": false,
"ratio": 3.8093968677107632,
"config_test": true,
... |
__author__ = 'chris'
import time
import random
from binascii import unhexlify
import os
import mock
import nacl.signing
import nacl.encoding
import nacl.hash
from txrudp import connection, rudp, packet, constants
from twisted.trial import unittest
from twisted.internet import task, reactor, address, udp, defer
from dh... | {
"repo_name": "melpomene/OpenBazaar-Server",
"path": "dht/tests/test_protocol.py",
"copies": "3",
"size": "23132",
"license": "mit",
"hash": -1043259563948300300,
"line_mean": 41.6789667897,
"line_max": 111,
"alpha_frac": 0.6487117413,
"autogenerated": false,
"ratio": 3.6764144945963126,
"confi... |
__author__ = 'chris'
import time
import sys
from daemon import Daemon
from twisted.internet import reactor
from txjsonrpc.netstring.jsonrpc import Proxy
def run_echoserver():
def getNew():
time.sleep(1)
d = proxy.callRemote('getnew')
d.addCallbacks(echo, printError)
def echo(messages)... | {
"repo_name": "cpacia/Subspace",
"path": "servers/echoserver/echoserver.py",
"copies": "1",
"size": "1483",
"license": "mit",
"hash": -4493611053167628300,
"line_mean": 26.9811320755,
"line_max": 68,
"alpha_frac": 0.4976399191,
"autogenerated": false,
"ratio": 4.1194444444444445,
"config_test":... |
__author__ = 'chris'
import time
from twisted.trial import unittest
from dht.utils import digest
from dht.storage import ForgetfulStorage, PersistentStorage, TTLDict
from protos.objects import Value
class ForgetFulStorageTest(unittest.TestCase):
def setUp(self):
self.keyword1 = digest("shoes")
... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "dht/tests/test_storage.py",
"copies": "1",
"size": "7596",
"license": "mit",
"hash": -8088301562851039000,
"line_mean": 34.661971831,
"line_max": 81,
"alpha_frac": 0.5922854134,
"autogenerated": false,
"ratio": 3.3184796854521625,
"config_test"... |
__author__ = 'chris'
import unittest
from random import randint, random
import numpy as np
from six.moves import xrange
from sympy import symbols, diff, exp, Piecewise
from pyquant.tests.mixins import GaussianMixin
from pyquant import peaks
from pyquant import cpeaks
def get_gauss_value(x, amp, mu, std):
return ... | {
"repo_name": "pandeylab/pyquant",
"path": "pyquant/tests/test_math.py",
"copies": "1",
"size": "5301",
"license": "mit",
"hash": -7542228579142530000,
"line_mean": 53.0918367347,
"line_max": 184,
"alpha_frac": 0.5155631013,
"autogenerated": false,
"ratio": 2.9631078814980434,
"config_test": tr... |
__author__ = 'chris'
class HD44780:
def __init__(self, pin_rs=4, pin_e=17, pins_db=[18, 22, 23, 24]):
# Initialise GPIO
self.pin_rs=pin_rs
self.pin_e=pin_e
self.pins_db=pins_db
GPIO.setmode(GPIO.BCM)
GPIO.setup(self.pin_e, GPIO.OUT)
GPIO.setup(self.pin_rs, G... | {
"repo_name": "siliconchris1973/PyLCDWriter",
"path": "hd44780_class.py",
"copies": "1",
"size": "1666",
"license": "apache-2.0",
"hash": -4638867005212340000,
"line_mean": 26.3114754098,
"line_max": 69,
"alpha_frac": 0.5108043217,
"autogenerated": false,
"ratio": 3.0681399631675874,
"config_te... |
__author__ = 'chris'
"""
Copyright (c) 2015 Chris Pacia
"""
import enum
import bitcoin
import traceback
from twisted.internet.protocol import Protocol, ClientFactory
from twisted.internet import reactor, task
from bitcoin.messages import *
from bitcoin.core import b2lx
from bitcoin.net import CInv
from bitcoin.wallet ... | {
"repo_name": "cpacia/pybitcoin",
"path": "pybitcoin/protocol.py",
"copies": "1",
"size": "16097",
"license": "mit",
"hash": 4268630953773050400,
"line_mean": 49.460815047,
"line_max": 186,
"alpha_frac": 0.5471827049,
"autogenerated": false,
"ratio": 4.676641487507263,
"config_test": false,
"... |
__author__ = 'chris'
"""
Copyright (c) 2015 Chris Pacia
"""
import random
import struct
import bitcoin
import math
from bitcoin.core import CBlockHeader, b2x
from bitcoin.messages import msg_version, MsgSerializable
from bitcoin.core.serialize import VarStringSerializer, VarIntSerializer, ser_read
from bitcoin.bloom im... | {
"repo_name": "cpacia/pybitcoin",
"path": "pybitcoin/extensions.py",
"copies": "1",
"size": "10303",
"license": "mit",
"hash": -9081419640173929000,
"line_mean": 34.2842465753,
"line_max": 168,
"alpha_frac": 0.5954576337,
"autogenerated": false,
"ratio": 3.6380649717514126,
"config_test": false... |
__author__ = 'chris'
from bitcoin import *
from subspace.pyelliptic import *
from subspace import payload
from subspace.utils import digest
from pyelliptic.hash import hmac_sha256
class MessageEncoder(object):
def __init__(self, recipient_pub, sender_priv, message, range):
"""
Args:
... | {
"repo_name": "cpacia/Subspace",
"path": "subspace/message.py",
"copies": "1",
"size": "7120",
"license": "mit",
"hash": 2535972756236579000,
"line_mean": 40.8882352941,
"line_max": 100,
"alpha_frac": 0.5755617978,
"autogenerated": false,
"ratio": 4.115606936416185,
"config_test": false,
"has... |
__author__ = 'chris'
from log import Logger
from protos.message import Command, FOLLOW, UNFOLLOW
from twisted.internet import reactor, task
RECONNECTIONS = 100
MALFORMATED = 110
SCORES = {
FOLLOW: 0,
UNFOLLOW: 0
}
class BanScore(object):
def __init__(self, multiplexer, ban_time=86400):
self.mu... | {
"repo_name": "saltduck/OpenBazaar-Server",
"path": "net/dos.py",
"copies": "4",
"size": "1888",
"license": "mit",
"hash": -4127605292399395000,
"line_mean": 30.4666666667,
"line_max": 81,
"alpha_frac": 0.5561440678,
"autogenerated": false,
"ratio": 3.666019417475728,
"config_test": false,
"h... |
__author__ = 'chris'
from log import Logger
from protos.message import Command, PING, STUN, STORE, INV, VALUES, GET_LISTINGS, FOLLOW, UNFOLLOW
from twisted.internet import reactor, task
RECONNECTIONS = 100
MALFORMATED = 110
SCORES = {
FOLLOW: 0,
UNFOLLOW: 0
}
class BanScore(object):
def __init__(self,... | {
"repo_name": "tyler-smith/OpenBazaar-Server",
"path": "net/dos.py",
"copies": "1",
"size": "1934",
"license": "mit",
"hash": -5408150130231017000,
"line_mean": 31.2333333333,
"line_max": 98,
"alpha_frac": 0.5599793175,
"autogenerated": false,
"ratio": 3.6217228464419478,
"config_test": false,
... |
__author__ = 'chris'
from zope.interface import Interface, Attribute
class Multiplexer(Interface):
"""
This interface defines the structure of the protocol class that handles creating new network connections
and sending and receiving messages. At present this is only used by the OpenBazaarProtocol class ... | {
"repo_name": "OpenBazaar/Network",
"path": "interfaces.py",
"copies": "6",
"size": "6090",
"license": "mit",
"hash": 7559034254325670000,
"line_mean": 34.6198830409,
"line_max": 117,
"alpha_frac": 0.6466338259,
"autogenerated": false,
"ratio": 4.899436846339501,
"config_test": false,
"has_no... |
__author__ = 'chris'
import argparse
import json
import os.path
import platform
import socket
import stun
import sys
import time
from api.ws import WSFactory, AuthenticatedWebSocketProtocol, AuthenticatedWebSocketFactory
from api.restapi import RestAPI
from config import DATA_FOLDER, KSIZE, ALPHA, LIBBITCOIN_SERVERS,\... | {
"repo_name": "cpacia/OpenBazaar-Server",
"path": "openbazaard.py",
"copies": "1",
"size": "13086",
"license": "mit",
"hash": 4007209120806503000,
"line_mean": 40.4113924051,
"line_max": 116,
"alpha_frac": 0.587421672,
"autogenerated": false,
"ratio": 3.938007824255191,
"config_test": true,
"... |
__author__ = 'chris'
import argparse
import string
import pickle
import json
from twisted.internet import reactor
from txjsonrpc.netstring.jsonrpc import Proxy
from os.path import expanduser
from bitcoin import *
datafolder = expanduser("~") + "/.subspace/"
if os.path.isfile(datafolder + 'keys.pickle'):
privkey ... | {
"repo_name": "cpacia/Subspace",
"path": "subspace-cli.py",
"copies": "1",
"size": "5318",
"license": "mit",
"hash": 121175146858364980,
"line_mean": 35.4246575342,
"line_max": 137,
"alpha_frac": 0.6032342986,
"autogenerated": false,
"ratio": 4.240829346092504,
"config_test": false,
"has_no_k... |
__author__ = 'chris'
import ast
import json
import os
import time
from binascii import unhexlify
from random import shuffle
import nacl.encoding
import nacl.signing
from twisted.internet.protocol import Protocol, Factory, connectionDone
from txws import WebSocketProtocol, WebSocketFactory
from api.utils import smart... | {
"repo_name": "tomgalloway/OpenBazaar-Server",
"path": "api/ws.py",
"copies": "3",
"size": "17244",
"license": "mit",
"hash": 8093849418332083000,
"line_mean": 45.4797843666,
"line_max": 112,
"alpha_frac": 0.4838204593,
"autogenerated": false,
"ratio": 4.689692684253467,
"config_test": false,
... |
__author__ = 'chris'
import ast
import json
import os
import time
from constants import DATA_FOLDER, SEED
from market.profile import Profile
from keyutils.keys import KeyChain
from random import shuffle
from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol
from protos.countries import ... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "api/ws.py",
"copies": "1",
"size": "13268",
"license": "mit",
"hash": -941675774249212800,
"line_mean": 44.2832764505,
"line_max": 115,
"alpha_frac": 0.4884684956,
"autogenerated": false,
"ratio": 4.71499644633973,
"config_test": false,
"has_... |
__author__ = 'chris'
import base64
import bitcointools
import gnupg
import httplib
import json
import nacl.signing
import nacl.hash
import nacl.encoding
import nacl.utils
import obelisk
import os.path
import pickle
import time
from binascii import unhexlify
from collections import OrderedDict
from config import DATA_F... | {
"repo_name": "tomgalloway/OpenBazaar-Server",
"path": "market/network.py",
"copies": "1",
"size": "64061",
"license": "mit",
"hash": 4884986703020986000,
"line_mean": 49.7212984956,
"line_max": 114,
"alpha_frac": 0.5388145674,
"autogenerated": false,
"ratio": 4.3448860553445465,
"config_test":... |
__author__ = 'chris'
import base64
import bitcointools
import json
import nacl.encoding
import nacl.signing
import os
import random
import re
import time
from binascii import unhexlify
from bitcoin import SelectParams
from bitcoin.core.script import CScript, OP_2, OP_3, OP_CHECKMULTISIG
from bitcoin.wallet import P2SH... | {
"repo_name": "tyler-smith/OpenBazaar-Server",
"path": "market/contracts.py",
"copies": "1",
"size": "81381",
"license": "mit",
"hash": 617496222747076400,
"line_mean": 54.2860054348,
"line_max": 116,
"alpha_frac": 0.5600078642,
"autogenerated": false,
"ratio": 4.3051896524361215,
"config_test"... |
__author__ = 'chris'
import json
from binascii import unhexlify, hexlify
from collections import OrderedDict
import re
import os
from protos.objects import Listings
from protos.countries import CountryCode
from dht.utils import digest
from constants import DATA_FOLDER
from db.datastore import HashMap, ListingsStore
f... | {
"repo_name": "bankonme/OpenBazaar-Server",
"path": "market/contracts.py",
"copies": "2",
"size": "20799",
"license": "mit",
"hash": 2402427947767430700,
"line_mean": 49.3607748184,
"line_max": 100,
"alpha_frac": 0.5393047743,
"autogenerated": false,
"ratio": 4.5853174603174605,
"config_test": ... |
__author__ = 'chris'
import json
from binascii import unhexlify, hexlify
from collections import OrderedDict
import re
import os
import nacl.encoding
from protos.objects import Listings
from protos.countries import CountryCode
from dht.utils import digest
from constants import DATA_FOLDER
from db.datastore import Has... | {
"repo_name": "hoffmabc/OpenBazaar-Server",
"path": "market/contracts.py",
"copies": "2",
"size": "21201",
"license": "mit",
"hash": 4553071492925365000,
"line_mean": 49.1205673759,
"line_max": 100,
"alpha_frac": 0.5409650488,
"autogenerated": false,
"ratio": 4.569181034482758,
"config_test": f... |
__author__ = 'chris'
import json
from collections import OrderedDict
import nacl.signing
import nacl.utils
import nacl.encoding
import nacl.hash
from nacl.public import PrivateKey, PublicKey, Box
from zope.interface import implements
from zope.interface.verify import verifyObject
from zope.interface.exceptions import... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "market/protocol.py",
"copies": "1",
"size": "17434",
"license": "mit",
"hash": 7387128829603439000,
"line_mean": 43.1367088608,
"line_max": 114,
"alpha_frac": 0.6135711827,
"autogenerated": false,
"ratio": 4.084817244611059,
"config_test": true... |
__author__ = 'chris'
import json
from twisted.internet.protocol import Protocol, Factory, connectionDone
from twisted.internet.task import LoopingCall
# pylint: disable=W0232
class HeartbeatProtocol(Protocol):
"""
Handles new incoming requests coming from a websocket.
"""
def connectionLost(self, re... | {
"repo_name": "saltduck/OpenBazaar-Server",
"path": "net/heartbeat.py",
"copies": "6",
"size": "1889",
"license": "mit",
"hash": -1577614746074175200,
"line_mean": 27.1940298507,
"line_max": 95,
"alpha_frac": 0.6103758602,
"autogenerated": false,
"ratio": 3.9518828451882846,
"config_test": fals... |
__author__ = 'chris'
import json
import nacl.signing
import nacl.utils
import nacl.encoding
import nacl.hash
from nacl.public import PrivateKey, PublicKey, Box
from zope.interface import implements
from rpcudp import RPCProtocol
from interfaces import MessageProcessor
from log import Logger
from protos.message import ... | {
"repo_name": "JimmyMow/OpenBazaar-Server",
"path": "market/protocol.py",
"copies": "3",
"size": "14933",
"license": "mit",
"hash": 7929839632642005000,
"line_mean": 42.0345821326,
"line_max": 109,
"alpha_frac": 0.616219112,
"autogenerated": false,
"ratio": 4.043595992418088,
"config_test": fal... |
__author__ = 'chris'
import json
import os
import obelisk
import nacl.encoding
from binascii import unhexlify
from collections import OrderedDict
from functools import wraps
from txrestapi.resource import APIResource
from txrestapi.methods import GET, POST, DELETE
from twisted.web import server
from twisted.web.resour... | {
"repo_name": "tomgalloway/OpenBazaar-Server",
"path": "api/restapi.py",
"copies": "1",
"size": "68298",
"license": "mit",
"hash": -6782258488951879000,
"line_mean": 45.907967033,
"line_max": 116,
"alpha_frac": 0.525520513,
"autogenerated": false,
"ratio": 4.257980049875312,
"config_test": true... |
__author__ = 'chris'
import json
import os
import obelisk
import nacl.encoding
import time
from binascii import unhexlify
from collections import OrderedDict
from functools import wraps
from txrestapi.resource import APIResource
from txrestapi.methods import GET, POST, DELETE
from twisted.web import server
from twiste... | {
"repo_name": "OpenBazaar/OpenBazaar-Server",
"path": "api/restapi.py",
"copies": "2",
"size": "70335",
"license": "mit",
"hash": -1198608660548764400,
"line_mean": 45.6721964167,
"line_max": 116,
"alpha_frac": 0.5250159949,
"autogenerated": false,
"ratio": 4.260145366444579,
"config_test": fal... |
__author__ = 'chris'
import json
import os
import time
from constants import DATA_FOLDER
from db.datastore import VendorStore, MessageStore
from random import shuffle
from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol
from protos.countries import CountryCode
from protos.objects impo... | {
"repo_name": "hoffmabc/OpenBazaar-Server",
"path": "ws.py",
"copies": "1",
"size": "10032",
"license": "mit",
"hash": -8211336571965899000,
"line_mean": 42.2413793103,
"line_max": 114,
"alpha_frac": 0.5028907496,
"autogenerated": false,
"ratio": 4.659544821179749,
"config_test": false,
"has_... |
__author__ = 'chris'
import json
import os
import time
from constants import DATA_FOLDER
from market.profile import Profile
from keyutils.keys import KeyChain
from random import shuffle
from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol
from protos.countries import CountryCode
from ... | {
"repo_name": "JimmyMow/OpenBazaar-Server",
"path": "api/ws.py",
"copies": "3",
"size": "13034",
"license": "mit",
"hash": -7454445136068461000,
"line_mean": 44.1003460208,
"line_max": 107,
"alpha_frac": 0.4881847476,
"autogenerated": false,
"ratio": 4.76563071297989,
"config_test": false,
"h... |
__author__ = 'chris'
import json
import random
import time
import nacl.signing
import bitcoin
from hashlib import sha256
from binascii import unhexlify, hexlify
from collections import OrderedDict
from urllib2 import Request, urlopen, URLError
import re
import os
import nacl.encoding
from twisted.internet import reac... | {
"repo_name": "melpomene/OpenBazaar-Server",
"path": "market/contracts.py",
"copies": "3",
"size": "35443",
"license": "mit",
"hash": -1721840956126011400,
"line_mean": 48.4323570432,
"line_max": 109,
"alpha_frac": 0.5394012922,
"autogenerated": false,
"ratio": 4.499555668401676,
"config_test":... |
__author__ = 'chris'
import json
import random
import time
import pickle
import nacl.signing
import bitcoin
from hashlib import sha256
from binascii import unhexlify, hexlify
from collections import OrderedDict
from urllib2 import Request, urlopen, URLError
from market.utils import deserialize
import re
import os
imp... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "market/contracts.py",
"copies": "1",
"size": "59414",
"license": "mit",
"hash": -2857226429407291400,
"line_mean": 53.3586459286,
"line_max": 116,
"alpha_frac": 0.5310532871,
"autogenerated": false,
"ratio": 4.561185321664364,
"config_test": fa... |
__author__ = 'chris'
import json
import time
import random
from log import Logger
from api.utils import sanitize_html
from interfaces import MessageListener, BroadcastListener, NotificationListener
from zope.interface import implements
from protos.objects import PlaintextMessage, Following
from dht.utils import digest... | {
"repo_name": "tomgalloway/OpenBazaar-Server",
"path": "market/listeners.py",
"copies": "1",
"size": "4648",
"license": "mit",
"hash": 2275380410536130600,
"line_mean": 39.4173913043,
"line_max": 114,
"alpha_frac": 0.5432444062,
"autogenerated": false,
"ratio": 4.56581532416503,
"config_test": ... |
__author__ = 'chris'
import math
import numpy as np
import mathutils
def calculate_feature_vector_sequence(traj, args, delayed_strokes=None):
"""
Calculates all features named in args for each point in trajectory traj. Valid features are "dir", "curv",
"penup", "hat", "vic_aspect", "vic_curl", "vic_line... | {
"repo_name": "cwiep/online-handwriting-tools",
"path": "traj/trajfeat.py",
"copies": "1",
"size": "6475",
"license": "apache-2.0",
"hash": -5738362040503241000,
"line_mean": 36.6453488372,
"line_max": 127,
"alpha_frac": 0.593976834,
"autogenerated": false,
"ratio": 3.01022780102278,
"config_te... |
__author__ = 'chris'
import nacl.signing
import nacl.utils
import nacl.encoding
import nacl.hash
from nacl.public import PrivateKey, PublicKey, Box
from zope.interface import implements
from rpcudp import RPCProtocol
from interfaces import MessageProcessor
from log import Logger
from protos.message import GET_CONTRACT... | {
"repo_name": "hoffmabc/OpenBazaar-Server",
"path": "market/protocol.py",
"copies": "2",
"size": "12165",
"license": "mit",
"hash": -8328205290075180000,
"line_mean": 40.097972973,
"line_max": 109,
"alpha_frac": 0.6143033292,
"autogenerated": false,
"ratio": 4.0428713858424725,
"config_test": f... |
__author__ = 'chris'
import numpy as np
import os
import matplotlib.image as mimg
import mathutils
class SpatialPyramid():
def __init__(self, levels, num_centroids):
"""
Creates Spatial Pyramid object for given parameters.
:param levels: list of bin configurations. examples: [ [2, 1] ] fo... | {
"repo_name": "cwiep/online-handwriting-tools",
"path": "traj/spatialpyramid.py",
"copies": "1",
"size": "5735",
"license": "apache-2.0",
"hash": -750732515675584600,
"line_mean": 47.1932773109,
"line_max": 124,
"alpha_frac": 0.6074978204,
"autogenerated": false,
"ratio": 3.906675749318801,
"co... |
__author__ = 'chris'
import numpy as np
class BoofGenerator():
def __init__(self, spatial_pyramid):
self.spatial_pyramid = spatial_pyramid
def build_feature_vectors_matrix(self, keypoints, labels):
print("Building trajectory feature matrix...")
num_features = self.spatial_pyramid.des... | {
"repo_name": "cwiep/online-handwriting-tools",
"path": "traj/boof.py",
"copies": "1",
"size": "1068",
"license": "apache-2.0",
"hash": 5795927993510548000,
"line_mean": 35.8275862069,
"line_max": 111,
"alpha_frac": 0.611423221,
"autogenerated": false,
"ratio": 3.548172757475083,
"config_test":... |
__author__ = 'chris'
import numpy as np
def read_trajectory_from_file(file):
"""
Reads points of an online trajectory from a textfile where
each line is formatted as "x y penup". All entries have to be integers.
penup is 0/1 depending on the state of the pen. An optional annotation of
the present... | {
"repo_name": "cwiep/online-handwriting-tools",
"path": "traj/trajimport.py",
"copies": "1",
"size": "1674",
"license": "apache-2.0",
"hash": -3616066552995283000,
"line_mean": 30.6037735849,
"line_max": 77,
"alpha_frac": 0.6254480287,
"autogenerated": false,
"ratio": 3.8306636155606406,
"confi... |
__author__ = 'chris'
import os
import sqlite3 as lite
from api.utils import sanitize_html
from collections import Counter
from config import DATA_FOLDER
from dht.node import Node
from dht.utils import digest
from protos import objects
from protos.objects import Listings, Followers, Following
from os.path import join
f... | {
"repo_name": "tomgalloway/OpenBazaar-Server",
"path": "db/datastore.py",
"copies": "1",
"size": "49283",
"license": "mit",
"hash": 9141307854253927000,
"line_mean": 35.9161048689,
"line_max": 116,
"alpha_frac": 0.5699531279,
"autogenerated": false,
"ratio": 4.3348579470489925,
"config_test": f... |
__author__ = 'chris'
import os
import sqlite3 as lite
import time
from api.utils import sanitize_html
from collections import Counter
from config import DATA_FOLDER
from dht.node import Node
from dht.utils import digest
from protos import objects
from protos.objects import Listings, Followers, Following
from os.path i... | {
"repo_name": "OpenBazaar/OpenBazaar-Server",
"path": "db/datastore.py",
"copies": "4",
"size": "53001",
"license": "mit",
"hash": -4290268272370639000,
"line_mean": 36.1155462185,
"line_max": 116,
"alpha_frac": 0.5718382672,
"autogenerated": false,
"ratio": 4.331208629566071,
"config_test": fa... |
__author__ = 'chris'
import socket
import nacl.signing
import nacl.hash
import time
from config import SEEDS
from dht.node import Node
from dht.utils import digest
from interfaces import MessageProcessor, Multiplexer, ConnectionHandler
from log import Logger
from net.dos import BanScore
from protos.message import Mess... | {
"repo_name": "saltduck/OpenBazaar-Server",
"path": "net/wireprotocol.py",
"copies": "5",
"size": "10124",
"license": "mit",
"hash": -4295640857107002400,
"line_mean": 42.8268398268,
"line_max": 114,
"alpha_frac": 0.5776372975,
"autogenerated": false,
"ratio": 4.337617823479006,
"config_test": ... |
__author__ = 'chris'
import time
import json
import os.path
import nacl.signing
import nacl.hash
import nacl.encoding
import nacl.utils
from nacl.public import PrivateKey, PublicKey, Box
from dht import node
from twisted.internet import defer, reactor, task
from market.protocol import MarketProtocol
from dht.utils imp... | {
"repo_name": "eXcomm/OpenBazaar-Server",
"path": "market/network.py",
"copies": "2",
"size": "20020",
"license": "mit",
"hash": 8622630961626333000,
"line_mean": 40.5352697095,
"line_max": 113,
"alpha_frac": 0.5605894106,
"autogenerated": false,
"ratio": 4.367364746945899,
"config_test": false... |
__author__ = 'chris'
import time
import json
import os.path
import nacl.signing
import nacl.hash
import nacl.encoding
import nacl.utils
import gnupg
from nacl.public import PrivateKey, PublicKey, Box
from dht import node
from twisted.internet import defer, reactor, task
from market.protocol import MarketProtocol
from ... | {
"repo_name": "the9ull/OpenBazaar-Server",
"path": "market/network.py",
"copies": "2",
"size": "20366",
"license": "mit",
"hash": 2315440727360444000,
"line_mean": 40.6482617587,
"line_max": 113,
"alpha_frac": 0.5586762251,
"autogenerated": false,
"ratio": 4.351709401709401,
"config_test": fals... |
__author__ = 'chris'
import time
import json
import os.path
import nacl.signing
import nacl.hash
import nacl.encoding
import nacl.utils
import gnupg
import bitcoin
from dht.node import Node
from nacl.public import PrivateKey, PublicKey, Box
from twisted.internet import defer, reactor, task
from market.protocol import ... | {
"repo_name": "Joaz/OpenBazaar-Server",
"path": "market/network.py",
"copies": "3",
"size": "24799",
"license": "mit",
"hash": 1297824455299638000,
"line_mean": 43.4426523297,
"line_max": 111,
"alpha_frac": 0.5562724303,
"autogenerated": false,
"ratio": 4.34156162464986,
"config_test": false,
... |
__author__ = 'chris'
import time
import json
import os.path
import nacl.signing
import nacl.hash
import nacl.encoding
import nacl.utils
import gnupg
import bitcoin
import httplib
from dht.node import Node
from nacl.public import PrivateKey, PublicKey, Box
from twisted.internet import defer, reactor, task
from market.p... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "market/network.py",
"copies": "1",
"size": "34484",
"license": "mit",
"hash": -6173321182968483000,
"line_mean": 46.1737346101,
"line_max": 114,
"alpha_frac": 0.5539960561,
"autogenerated": false,
"ratio": 4.336519114688128,
"config_test": fals... |
__author__ = 'Chris'
import wx
from gooey.gui.util import wx_util
class CalendarDlg(wx.Dialog):
def __init__(self, parent):
wx.Dialog.__init__(self, parent)
self.SetBackgroundColour('#ffffff')
self.ok_button = wx.Button(self, label='Ok')
self.datepicker = wx.DatePickerCtrl(self, style=wx.DP_DROP... | {
"repo_name": "lrq3000/pyFileFixity",
"path": "pyFileFixity/lib/gooey/gui/widgets/calender_dialog.py",
"copies": "1",
"size": "1246",
"license": "mit",
"hash": -2305105028090844200,
"line_mean": 26.6888888889,
"line_max": 94,
"alpha_frac": 0.6869983949,
"autogenerated": false,
"ratio": 3.13853904... |
__author__ = 'chris'
"""
Just using this class for testing the DHT for now.
We will fit the actual implementation in where appropriate.
"""
import pickle
import stun
from twisted.internet import reactor
from twisted.python import log
from os.path import expanduser
from bitcoin import *
from txjsonrpc.netstring import j... | {
"repo_name": "jorik041/Network",
"path": "openbazaard.py",
"copies": "1",
"size": "4004",
"license": "mit",
"hash": 3096695091277227000,
"line_mean": 31.2983870968,
"line_max": 132,
"alpha_frac": 0.6760739261,
"autogenerated": false,
"ratio": 3.584601611459266,
"config_test": false,
"has_no_... |
__author__ = 'chris'
"""
Just using this class for testing the DHT for now.
We will fit the actual implementation in where appropriate.
"""
import stun
import os
import sys
import dht.constants
from db.datastore import create_database
from twisted.internet import reactor
from twisted.python import log, logfile
from tw... | {
"repo_name": "the9ull/OpenBazaar-Server",
"path": "openbazaard.py",
"copies": "1",
"size": "3263",
"license": "mit",
"hash": 3674450258859289000,
"line_mean": 31.63,
"line_max": 105,
"alpha_frac": 0.7670855041,
"autogenerated": false,
"ratio": 3.272818455366098,
"config_test": false,
"has_no... |
__author__ = 'chris'
class DataException(Exception):
pass
class DataField(object):
DEFAULT_FORMAT = "{name}{index}: {value}{unit}"
def __init__(self, name, index=None, friendly_name=None, unit=None, default_value=None):
self.name = name
self.index = index
self.friendly_name = fr... | {
"repo_name": "ravngr/jtfadump2",
"path": "data.py",
"copies": "1",
"size": "1999",
"license": "mit",
"hash": -4623626147815155000,
"line_mean": 27.5571428571,
"line_max": 109,
"alpha_frac": 0.5987993997,
"autogenerated": false,
"ratio": 3.866537717601547,
"config_test": false,
"has_no_keywor... |
__author__ = 'Chris'
"""
Preps the extracted Python code so that it can be evaled by the
monkey_parser
"""
from itertools import *
source = '''
import sys
import os
import doctest
import cProfile
import pstats
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
from gooey import Gooe... | {
"repo_name": "lrq3000/pyFileFixity",
"path": "pyFileFixity/lib/gooey/python_bindings/code_prep.py",
"copies": "1",
"size": "2310",
"license": "mit",
"hash": -268749260685091400,
"line_mean": 36.868852459,
"line_max": 196,
"alpha_frac": 0.7125541126,
"autogenerated": false,
"ratio": 3.75609756097... |
__author__ = 'chris'
# pylint: disable=import-error
#import guidc
from binascii import hexlify, unhexlify
import nacl.signing
import nacl.hash
import nacl.encoding
def _testpow(pow_hash):
return True if int(pow_hash, 16) < 50 else False
class GUID(object):
"""
Class for generating the guid. It can be ge... | {
"repo_name": "tomgalloway/OpenBazaar-Server",
"path": "keys/guid.py",
"copies": "6",
"size": "2128",
"license": "mit",
"hash": -9212765513834398000,
"line_mean": 34.4666666667,
"line_max": 88,
"alpha_frac": 0.5968045113,
"autogenerated": false,
"ratio": 3.5585284280936453,
"config_test": false... |
__author__ = 'chris'
# pylint: disable=import-error
#import guidc
from binascii import hexlify, unhexlify
import nacl.signing
import nacl.hash
def _testpow(pow_hash):
return True if int(pow_hash, 16) < 50 else False
class GUID(object):
"""
Class for generating the guid. It can be generated using C code ... | {
"repo_name": "Joaz/OpenBazaar-Server",
"path": "keyutils/guid.py",
"copies": "4",
"size": "2226",
"license": "mit",
"hash": 3231197225558858000,
"line_mean": 34.9032258065,
"line_max": 83,
"alpha_frac": 0.5893980234,
"autogenerated": false,
"ratio": 3.5787781350482315,
"config_test": false,
... |
__author__ = 'chris'
# pylint: disable=import-error
import guidc
from binascii import hexlify, unhexlify
import nacl.signing
import nacl.hash
def _testpow(pow_hash):
return True if int(pow_hash, 16) < 50 else False
class GUID(object):
# pylint: disable=W0633
def __init__(self, keys=None, use_C_lib=False... | {
"repo_name": "hoffmabc/OpenBazaar-Server",
"path": "keyutils/guid.py",
"copies": "4",
"size": "1986",
"license": "mit",
"hash": -459232462140063740,
"line_mean": 34.4642857143,
"line_max": 83,
"alpha_frac": 0.5835850957,
"autogenerated": false,
"ratio": 3.4903339191564147,
"config_test": false... |
__author__ = 'chris'
"""Swagger to WADL utility"""
import sys, urllib3, json, re
import xml.etree.ElementTree as tree
from argparse import ArgumentParser
def camel_case(value):
words = value.split("_")
return ''.join([words[0]] + list(word.title() for word in words[1:]))
def add_request(parent, parameters):... | {
"repo_name": "SensibleWood/swagger2wadl",
"path": "swagger2wadl.py",
"copies": "1",
"size": "4672",
"license": "mit",
"hash": -7446931661059921000,
"line_mean": 38.9316239316,
"line_max": 124,
"alpha_frac": 0.5948202055,
"autogenerated": false,
"ratio": 3.8803986710963456,
"config_test": false... |
__author__ = 'chris'
"""
This protocol class handles all direct (non-kademlia) messages between nodes.
All of the messages between a buyer and a vendor's store can be found here.
"""
import json
from zope.interface import implements
from rpcudp import RPCProtocol
from interfaces import MessageProcessor
from log impor... | {
"repo_name": "jorik041/Network",
"path": "market/protocol.py",
"copies": "1",
"size": "2057",
"license": "mit",
"hash": 2905390888201828400,
"line_mean": 33.8644067797,
"line_max": 144,
"alpha_frac": 0.652892562,
"autogenerated": false,
"ratio": 3.9106463878326996,
"config_test": false,
"has... |
__author__ = 'chrispaulson'
import math as m
import os
import pickle
import numpy as np
import pyKriging
class samplingplan():
def __init__(self, k=2):
self.samplingplan = []
self.k = k
self.path = os.path.dirname(pyKriging.__file__)
self.path = self.path + '/sampling_plans/'
... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/pyKriging-master/pyKriging/samplingplan.py",
"copies": "1",
"size": "11886",
"license": "mit",
"hash": -6818585781957699000,
"line_mean": 32.3876404494,
"line_max": 144,
"alpha_frac": 0.5237253912,
"autogenerated": false,
"ratio": 3.61... |
__author__ = 'chrispaulson'
import numpy as np
import math as m
import os
import pickle
import pyKriging
class samplingplan():
def __init__(self,k=2):
self.samplingplan = []
self.k = k
self.path = os.path.dirname(pyKriging.__file__)
self.path = self.path+'/sampling_plans/'
de... | {
"repo_name": "capaulson/pyKriging",
"path": "pyKriging/samplingplan.py",
"copies": "1",
"size": "11545",
"license": "mit",
"hash": 6596410530401962000,
"line_mean": 31.9857142857,
"line_max": 148,
"alpha_frac": 0.5255088783,
"autogenerated": false,
"ratio": 3.6191222570532915,
"config_test": f... |
__author__ = 'Chris'
import wx
from gooey.gui import styling
class CalendarDlg(wx.Dialog):
def __init__(self, parent):
wx.Dialog.__init__(self, parent)
self.SetBackgroundColour('#ffffff')
self.ok_button = wx.Button(self, label='Ok')
self.datepicker = wx.DatePickerCtrl(self, style=wx.... | {
"repo_name": "jonathanlurie/timelapseComposer",
"path": "lib/python/gooey/gui/widgets/calender_dialog.py",
"copies": "2",
"size": "1284",
"license": "mit",
"hash": -4004475343679557000,
"line_mean": 27.1818181818,
"line_max": 94,
"alpha_frac": 0.6651090343,
"autogenerated": false,
"ratio": 3.267... |
__author__ = 'Chris'
import wx
from gooey.gui import styling
from gooey.gui.widgets.calender_dialog import CalendarDlg
class AbstractChooser(object):
def __init__(self, data):
self.data = data
# parent
self.panel = None
self.button_text = 'Browse'
# Widgets
self.title ... | {
"repo_name": "jonathanlurie/timelapseComposer",
"path": "lib/python/gooey/gui/widgets/choosers.py",
"copies": "2",
"size": "3529",
"license": "mit",
"hash": -8044580885041872000,
"line_mean": 23.0283687943,
"line_max": 86,
"alpha_frac": 0.6370076509,
"autogenerated": false,
"ratio": 3.4395711500... |
__author__ = 'Chris'
import wx
from gooey.gui.util import wx_util
class CalendarDlg(wx.Dialog):
def __init__(self, parent):
wx.Dialog.__init__(self, parent)
self.SetBackgroundColour('#ffffff')
self.ok_button = wx.Button(self, label='Ok')
self.datepicker = wx.DatePickerCtrl(self, st... | {
"repo_name": "tmr232/Gooey",
"path": "gooey/gui/widgets/calender_dialog.py",
"copies": "5",
"size": "1291",
"license": "mit",
"hash": 5492876429048084000,
"line_mean": 26.6888888889,
"line_max": 94,
"alpha_frac": 0.6630518978,
"autogenerated": false,
"ratio": 3.251889168765743,
"config_test": ... |
__author__ = 'Chris'
"""
Preps the extracted Python code so that it can be evaled by the
monkey_parser
"""
from itertools import *
source = '''
import sys
import os
import doctest
import cProfile
import pstats
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
from ... | {
"repo_name": "intfrr/Gooey",
"path": "gooey/python_bindings/code_prep.py",
"copies": "10",
"size": "2371",
"license": "mit",
"hash": -2130466036749207800,
"line_mean": 36.868852459,
"line_max": 196,
"alpha_frac": 0.6942218473,
"autogenerated": false,
"ratio": 3.7163009404388716,
"config_test":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.