text stringlengths 0 1.05M | meta dict |
|---|---|
from etc.furrypoll2016 import models
responses = models.Response.objects
results = []
n = 0
n_with_species = 0
# Loop through all of the data we have, one response at a time.
while True:
# Get a single result from the dataset.
try:
response = responses.next()
except:
break
# Keep tr... | {
"repo_name": "adjspecies/furrypoll-munger",
"path": "bin/other/genderful-species-2016.py",
"copies": "2",
"size": "7929",
"license": "mit",
"hash": -5117123380603515000,
"line_mean": 36.9377990431,
"line_max": 79,
"alpha_frac": 0.6287047547,
"autogenerated": false,
"ratio": 3.316185696361355,
... |
from etc.furrypoll2016 import models
results = {}
responses = models.Response.objects
n = 0
while True:
try:
response = responses.next()
except:
break
touchpoints = map(lambda tp: tp.touchpoint_type, response.metadata.touchpoints)
if -3 in touchpoints:
n += 1
if response.se... | {
"repo_name": "makyo/furrypoll-munger",
"path": "bin/other/sex-bits-2016.py",
"copies": "2",
"size": "1116",
"license": "mit",
"hash": -5435865820876334000,
"line_mean": 31.8235294118,
"line_max": 98,
"alpha_frac": 0.6218637993,
"autogenerated": false,
"ratio": 4.043478260869565,
"config_test":... |
from etc.user import create_salt_cookie
from datetime import datetime, timedelta
from django.contrib.auth import authenticate
from etc.constants import ACCOUNT_COOKIE_SALT, ACCOUNT_COOKIE
from lib.facebook import GraphAPI
import logging
from users.models import User
def attempt_login(request, email_or_username, passwo... | {
"repo_name": "jumoconnect/openjumo",
"path": "jumodjango/etc/auth.py",
"copies": "1",
"size": "1801",
"license": "mit",
"hash": -6825412176165571000,
"line_mean": 35.7551020408,
"line_max": 131,
"alpha_frac": 0.6985008329,
"autogenerated": false,
"ratio": 3.8814655172413794,
"config_test": fal... |
from ete2 import Tree, faces, AttrFace, TreeStyle, NodeStyle, CircleFace
import sys
inputTreeFile = sys.argv[1]
t = Tree(inputTreeFile,format=2)
#~ print t
#~ t.write(format=1, outfile="new_tree.nw")
#~ t.show()
def layout(node):
if node.is_leaf():
##############################################... | {
"repo_name": "minesh1291/Phylogeny-Utilities",
"path": "DrawTree.py",
"copies": "1",
"size": "2942",
"license": "apache-2.0",
"hash": 3365922034701930500,
"line_mean": 30.2978723404,
"line_max": 85,
"alpha_frac": 0.5231135282,
"autogenerated": false,
"ratio": 3.4490035169988276,
"config_test":... |
from ete2 import Tree
import networkx as nx
def build_edges(G, t, node):
children_list = []
if node.is_root():
children_list = node.get_children()
## create edges between root and children
elif node.is_leaf():
print "%s is leaf." % node
else:
path_list = []
children_list = n... | {
"repo_name": "lcoghill/sandbox",
"path": "newick-to-graph.py",
"copies": "1",
"size": "1297",
"license": "bsd-3-clause",
"hash": 6077736131999989000,
"line_mean": 23.4716981132,
"line_max": 49,
"alpha_frac": 0.6206630686,
"autogenerated": false,
"ratio": 3.2506265664160403,
"config_test": fals... |
from ete2 import Tree
## params
tree_file = 'examples/centarchidae.tre'
## read the original tree into a ete2 tree object
handle = open(tree_file, 'r')
for line in handle :
tree_string = line.strip("\n")
tree_string = tree_string.replace("''", "") + ";" # used to parse out escaped quotes present in some ot tree... | {
"repo_name": "lcoghill/blot",
"path": "build-raxml-constraints.py",
"copies": "1",
"size": "1340",
"license": "bsd-3-clause",
"hash": 2188355294712641500,
"line_mean": 25.2941176471,
"line_max": 109,
"alpha_frac": 0.6537313433,
"autogenerated": false,
"ratio": 3.1678486997635935,
"config_test"... |
from ete3 import NCBITaxa
import ftplib
import os
import socket
import json
import requests
STRAIN_SYNONYMS_1 = [
'strain',
'strain info.',
'strain or line',
'strainorline',
'strain name',
'parent strain',
'strain/genotype',
'substrain',
'strain i... | {
"repo_name": "KarrLab/kinetic_datanator",
"path": "datanator/data_source/array_express_tools/ensembl_tools.py",
"copies": "1",
"size": "9157",
"license": "mit",
"hash": 1529493075481107000,
"line_mean": 32.1775362319,
"line_max": 112,
"alpha_frac": 0.5512722507,
"autogenerated": false,
"ratio": ... |
from ete3 import *
import xml.etree.ElementTree as ET
class RSTNode:
def __init__(self):
self.id = None
self.label = None
def __str__(self):
return self.label
class RSTRelation:
def __init__(self):
self.start = None
self.end = None
self.label = None
tree =... | {
"repo_name": "gcvalderrama/Jarvis",
"path": "graphview/Main.py",
"copies": "1",
"size": "1687",
"license": "apache-2.0",
"hash": -1552953871771601700,
"line_mean": 22.1232876712,
"line_max": 68,
"alpha_frac": 0.6176644932,
"autogenerated": false,
"ratio": 3.177024482109228,
"config_test": fals... |
from ete3 import PhyloTree
from ete3 import Tree
import dendropy
from dendropy.calculate import treemeasure
import sys
import itertools
import os
class SangerTreeParsing(object):
def __init__(self):
self.monoFinal = []
self.monoPairs = []
self.Clusters = []
self.dictClusters = {}
... | {
"repo_name": "vmon588/Intra-Clust",
"path": "scripts/ete.ConsensusSequencingClusterID.py",
"copies": "1",
"size": "13195",
"license": "mit",
"hash": -7659844946363344000,
"line_mean": 45.9572953737,
"line_max": 130,
"alpha_frac": 0.4850322092,
"autogenerated": false,
"ratio": 4.09528243327126,
... |
from ete3 import Tree
import sys, re
# find how often the mitosporidium clade is not basal in a sample of trees from David's SB-Micro paper
#Arguments: treefile target_sequence_tag
#check tree string for sanity first
inh = open(sys.argv[1])
treestring = inh.readline()
treestr = treestring.replace(';','')
treestr = t... | {
"repo_name": "Tancata/phylo",
"path": "test_monophyly_microsporidia.py",
"copies": "1",
"size": "3968",
"license": "mit",
"hash": 2526959988149667000,
"line_mean": 41.6666666667,
"line_max": 174,
"alpha_frac": 0.6343245968,
"autogenerated": false,
"ratio": 3.462478184991274,
"config_test": fal... |
from ete3 import Tree
import sys, re
#read in mapping of IDs to domain (Bacteria or Archaea)
id_to_domain = {}
f = open("outputfileABlist")
for line in f:
if line.startswith("Species"):
continue
else:
fields = re.split(",", line.rstrip())
id_to_domain[fields[1]] = fields[2]
f.close()
tree = Tree(sys.argv[1])
... | {
"repo_name": "Tancata/phylo",
"path": "reroot_between_AB.py",
"copies": "1",
"size": "1321",
"license": "mit",
"hash": 9022058964386651000,
"line_mean": 28.3555555556,
"line_max": 78,
"alpha_frac": 0.7259651779,
"autogenerated": false,
"ratio": 2.834763948497854,
"config_test": false,
"has_n... |
from ete3 import Tree
import sys, re
#read in the bootstrapped consensus tree from one of Cedric's families. Ask whether the candidate LGT has phylogenetic support at some bootstrap threshold by checking various tree-based criteria for LGTs
#Arguments: treefile target_sequence_tag
#check tree string for sanity first... | {
"repo_name": "Tancata/phylo",
"path": "test_for_lgt.py",
"copies": "1",
"size": "4069",
"license": "mit",
"hash": -2365655194199853600,
"line_mean": 42.752688172,
"line_max": 203,
"alpha_frac": 0.6404521996,
"autogenerated": false,
"ratio": 3.5017211703958693,
"config_test": false,
"has_no_k... |
from ete3 import Tree, NodeStyle, TreeStyle, TextFace, CircleFace, ImgFace, RectFace, faces
import sys, copy
from collections import defaultdict
from operator import itemgetter
class MyTextFace(TextFace):
def __init__(self, *args, **kwargs):
TextFace.__init__(self, *args, **kwargs)
... | {
"repo_name": "zibraproject/zika-pipeline",
"path": "scripts/generate_tree_figure.py",
"copies": "1",
"size": "8858",
"license": "mit",
"hash": 6484219281835208000,
"line_mean": 49.908045977,
"line_max": 531,
"alpha_frac": 0.6737412508,
"autogenerated": false,
"ratio": 2.4840157038698822,
"conf... |
from ete3 import Tree, TreeStyle, Tree, TextFace, NodeStyle, add_face_to_node
import sys
from collections import OrderedDict
import os
# build list of filenames
filenames = []
for d in os.listdir('out/'):
filenames.append('out/' + d + '/')
# roman numeral thing just incase things get crowded...
def write_roman(nu... | {
"repo_name": "Brightgalrs/con-lang-gen",
"path": "maketree.py",
"copies": "1",
"size": "2237",
"license": "mit",
"hash": -1453977796919661600,
"line_mean": 28.8266666667,
"line_max": 95,
"alpha_frac": 0.5243629861,
"autogenerated": false,
"ratio": 3.0476839237057223,
"config_test": false,
"h... |
from ete3.treeview.faces import StaticItemFace
from PyQt4.QtGui import (QGraphicsRectItem, QGraphicsLineItem,
QGraphicsPolygonItem, QGraphicsEllipseItem,
QPen, QColor, QBrush, QPolygonF, QFont,
QPixmap, QFontMetrics, QPainter,
... | {
"repo_name": "zibraproject/zika-pipeline",
"path": "scripts/rulerface.py",
"copies": "1",
"size": "11027",
"license": "mit",
"hash": 2511304062584155000,
"line_mean": 43.6437246964,
"line_max": 161,
"alpha_frac": 0.5368640609,
"autogenerated": false,
"ratio": 3.570919689119171,
"config_test": ... |
from eth_abi.abi import (
decode_single,
encode_single,
)
from eth_abi.decoding import (
BaseDecoder,
)
from eth_abi.encoding import (
BaseEncoder,
)
from eth_abi.exceptions import (
DecodingError,
EncodingError,
)
from eth_abi.registry import (
registry,
)
NULL_ENCODING = b'\x00' * 32
de... | {
"repo_name": "pipermerriam/ethereum-abi-utils",
"path": "tests/test_integration/test_custom_registrations.py",
"copies": "1",
"size": "2497",
"license": "mit",
"hash": 8185530273291052000,
"line_mean": 23.7227722772,
"line_max": 74,
"alpha_frac": 0.6239487385,
"autogenerated": false,
"ratio": 3.... |
from ethel.error import EthelError
from contextlib import contextmanager
from schroot import schroot
from debian import deb822
import subprocess
import tempfile
import shutil
import shlex
import sys
import os
try:
import configparser
except ImportError:
import ConfigParser as configparser
def upgrade(chroot... | {
"repo_name": "paultag/ethel",
"path": "ethel/utils.py",
"copies": "1",
"size": "3211",
"license": "mit",
"hash": 2806583755571109400,
"line_mean": 22.1007194245,
"line_max": 74,
"alpha_frac": 0.5696044846,
"autogenerated": false,
"ratio": 3.6323529411764706,
"config_test": false,
"has_no_key... |
from ethel.utils import EthelSubprocessError
from ethel.wrappers.piuparts import parse_piuparts
from firehose.model import Issue, Message, File, Location
from schroot.chroot import SchrootCommandError
from schroot import schroot
try:
import configparser
except ImportError:
import ConfigParser as configparser
... | {
"repo_name": "paultag/ethel",
"path": "ethel/runners/piuparts.py",
"copies": "1",
"size": "1845",
"license": "mit",
"hash": 8903688227165559000,
"line_mean": 27.3846153846,
"line_max": 77,
"alpha_frac": 0.579403794,
"autogenerated": false,
"ratio": 3.7653061224489797,
"config_test": false,
"... |
from ethel.utils import safe_run, run_command, tdir
from firehose.model import Issue, Message, File, Location, Stats, DebianBinary
import firehose.parsers.gcc as fgcc
from contextlib import contextmanager
from datetime import timedelta
from io import StringIO
import sys
import re
import os
STATS = re.compile("Build... | {
"repo_name": "paultag/ethel",
"path": "ethel/runners/sbuild.py",
"copies": "1",
"size": "2558",
"license": "mit",
"hash": 2237731276113355300,
"line_mean": 26.2127659574,
"line_max": 79,
"alpha_frac": 0.5574667709,
"autogenerated": false,
"ratio": 3.6805755395683453,
"config_test": false,
"h... |
from ethel.utils import tdir, cd, dget, upload, run_command
from ethel.config import load
from contextlib import contextmanager
import xmlrpclib
import time
import glob
import os
def get_proxy():
info = load()
proxy = xmlrpclib.ServerProxy(
"http://{user}:{password}@{host}:{port}/".format(
... | {
"repo_name": "paultag/ethel",
"path": "ethel/client.py",
"copies": "1",
"size": "1256",
"license": "mit",
"hash": -8450269099755352000,
"line_mean": 25.1666666667,
"line_max": 70,
"alpha_frac": 0.5621019108,
"autogenerated": false,
"ratio": 3.840978593272171,
"config_test": false,
"has_no_ke... |
from ethel.wrappers.cppcheck import parse_cppcheck
DATA = b"""<?xml version="1.0" encoding="UTF-8"?>
<results>
<error file="src/tmperamental.c" line="91" id="unusedFunction"
severity="style" msg="The function 'creat' is never used."/>
<error file="src/tmperamental.c" line="97" id="unusedFunction"
... | {
"repo_name": "paultag/ethel",
"path": "tests/wrappers/test_cppcheck.py",
"copies": "1",
"size": "1254",
"license": "mit",
"hash": 1739608360818125000,
"line_mean": 38.1875,
"line_max": 95,
"alpha_frac": 0.6459330144,
"autogenerated": false,
"ratio": 3.5027932960893855,
"config_test": false,
... |
from etherealpost.db.access_log import AccessLog
from etherealpost.db.cache import Cache
from etherealpost.db.db import Db
from etherealpost.db.helpers import set_cookie
from pyramid.httpexceptions import HTTPNotFound
from pyramid.view import view_config
_template_path = '../templates/'
class RealmViews(object):
... | {
"repo_name": "etherealpost/etherealpost.com",
"path": "etherealpost/views/realm.py",
"copies": "1",
"size": "1455",
"license": "mit",
"hash": -4132428646363452400,
"line_mean": 32.0681818182,
"line_max": 76,
"alpha_frac": 0.6254295533,
"autogenerated": false,
"ratio": 3.54014598540146,
"config... |
from etherealpost.db.access_log import AccessLog
from etherealpost.db.cache import Cache
from etherealpost.db.helpers import set_cookie
from pyramid.renderers import render_to_response
from etherealpost.db.db import Db
from pyramid.httpexceptions import HTTPNotFound
from pyramid.view import view_config
_template_path... | {
"repo_name": "etherealpost/etherealpost.com",
"path": "etherealpost/views/item.py",
"copies": "1",
"size": "2944",
"license": "mit",
"hash": 2097842511316379600,
"line_mean": 37.2337662338,
"line_max": 76,
"alpha_frac": 0.5614809783,
"autogenerated": false,
"ratio": 3.828348504551365,
"config_... |
from etherealpost.db.db import Db
from etherealpost.db import helpers
from etherealpost.db.helpers import set_cookie
from pyramid.renderers import render_to_response
from pyramid.view import view_config
_template_path = '../templates/'
class GeneralViews(object):
def __init__(self, request):
self.reques... | {
"repo_name": "etherealpost/etherealpost.com",
"path": "etherealpost/views/general.py",
"copies": "1",
"size": "1810",
"license": "mit",
"hash": -1721569742680727600,
"line_mean": 34.4901960784,
"line_max": 83,
"alpha_frac": 0.6005524862,
"autogenerated": false,
"ratio": 3.649193548387097,
"con... |
from etherealpost.db.MongoObject import MongoObject
class Item(MongoObject):
def __set__id(self, value):
self.___id = value
def __get__id(self):
return self.___id
def __get_id(self):
return self._id
def __set_id(self, value):
self._id = value
def __set_name(sel... | {
"repo_name": "etherealpost/etherealpost.com",
"path": "etherealpost/db/item.py",
"copies": "1",
"size": "1213",
"license": "mit",
"hash": -2916774040911753700,
"line_mean": 23.26,
"line_max": 68,
"alpha_frac": 0.5754328112,
"autogenerated": false,
"ratio": 3.4362606232294617,
"config_test": fa... |
from ethereum.block import BlockHeader
from ethereum.utils import decode_hex, int256, big_endian_to_int
def is_dao_challenge(config, number, amount, skip):
return number == config['DAO_FORK_BLKNUM'] and amount == 1 and skip == 0
def build_dao_header(config):
return BlockHeader(
prevhash=decode_hex('... | {
"repo_name": "changwu-tw/pyethapp",
"path": "pyethapp/dao.py",
"copies": "3",
"size": "1929",
"license": "mit",
"hash": -2165800173200236800,
"line_mean": 67.8928571429,
"line_max": 539,
"alpha_frac": 0.8040435459,
"autogenerated": false,
"ratio": 3.3201376936316693,
"config_test": false,
"h... |
from ethereum import abi
from google.appengine.ext import db, ndb
import logging
import urllib
import urllib2
import webapp2
from web3 import Web3, RPCProvider
import models
NUM_CONFIRMATIONS = 5
web3 = Web3(RPCProvider(host='10.3.3.21'))
def sendRequest(url, body, contentType):
request = urllib2.Request(url... | {
"repo_name": "EthereumWebhooks/blockhooks",
"path": "events.py",
"copies": "1",
"size": "2337",
"license": "apache-2.0",
"hash": -4268370360324041700,
"line_mean": 27.5,
"line_max": 101,
"alpha_frac": 0.621309371,
"autogenerated": false,
"ratio": 3.62888198757764,
"config_test": false,
"has_... |
from ethereum import abi
from google.appengine.ext import db, ndb
def computeEventId(hook):
assert hook.abi['type'] == 'event'
return hex(abi.event_id(hook.abi['name'], [x['type'] for x in hook.abi['inputs']]))[:-1]
class Hook(ndb.Model):
address = ndb.StringProperty(indexed=True, required=True, defaul... | {
"repo_name": "EthereumWebhooks/blockhooks",
"path": "models.py",
"copies": "1",
"size": "1060",
"license": "apache-2.0",
"hash": -7419533196762693000,
"line_mean": 35.5517241379,
"line_max": 117,
"alpha_frac": 0.6716981132,
"autogenerated": false,
"ratio": 3.8267148014440435,
"config_test": fa... |
from ethereum import abi
import time
import os
import json
from ethereum.utils import encode_hex, str_to_bytes
FILL = 1
VERIFY = 2
TIME = 3
fixture_path = os.path.join(os.path.dirname(__file__), '../..', 'fixtures')
def fill_abi_test(params): return run_abi_test(params, FILL)
def check_abi_test(params): return ru... | {
"repo_name": "karlfloersch/pyethereum",
"path": "ethereum/tools/testutils.py",
"copies": "1",
"size": "2703",
"license": "mit",
"hash": 1929403578909020400,
"line_mean": 28.7032967033,
"line_max": 79,
"alpha_frac": 0.5538290788,
"autogenerated": false,
"ratio": 3.6775510204081634,
"config_test... |
from ethereum import blocks
from ethereum import processblock
from ethereum import transactions
from ethereum import utils
import rlp
from ethereum import trie
def mk_transaction_spv_proof(block, tx):
trie.proof.push(trie.RECORDING)
processblock.apply_transaction(block, tx)
o = trie.proof.get_nodelist()
... | {
"repo_name": "pipermerriam/pyethereum",
"path": "ethereum/spv.py",
"copies": "12",
"size": "2666",
"license": "mit",
"hash": -9179511342002402000,
"line_mean": 35.5205479452,
"line_max": 99,
"alpha_frac": 0.6477869467,
"autogenerated": false,
"ratio": 3.136470588235294,
"config_test": false,
... |
from ethereum import channel
from models import ChannelState, HashedTimelockContract
def check_channel(micropayments_channel):
if _check_channel_state(micropayments_channel) or _check_htlcs(micropayments_channel):
push_update_channel(micropayments_channel)
push_htlcs(micropayments_channel)
def ... | {
"repo_name": "maciekf/etherchannels",
"path": "etherblinks/node/monitor.py",
"copies": "1",
"size": "4017",
"license": "mit",
"hash": 8537574773629990000,
"line_mean": 39.5858585859,
"line_max": 118,
"alpha_frac": 0.6465023649,
"autogenerated": false,
"ratio": 3.743709226467847,
"config_test":... |
from ethereum import ethash, ethash_utils, utils
import time
import sys
import sha3
from collections import OrderedDict
from ethereum.slogging import get_logger
log = get_logger('eth.pow')
if sys.version_info.major == 2:
from repoze.lru import lru_cache
else:
from functools import lru_cache
try:
import p... | {
"repo_name": "inzem77/pyethereum",
"path": "ethereum/ethpow.py",
"copies": "4",
"size": "4120",
"license": "mit",
"hash": 8683728899792157000,
"line_mean": 32.7704918033,
"line_max": 89,
"alpha_frac": 0.6410194175,
"autogenerated": false,
"ratio": 3.3495934959349594,
"config_test": false,
"h... |
from ethereum import ethash, ethash_utils, utils
import time
import sys
import sha3
import warnings
from collections import OrderedDict
from ethereum.slogging import get_logger
log = get_logger('eth.pow')
if sys.version_info.major == 2:
from repoze.lru import lru_cache
else:
from functools import lru_cache
t... | {
"repo_name": "EthereumWebhooks/blockhooks",
"path": "lib/ethereum/ethpow.py",
"copies": "2",
"size": "4121",
"license": "apache-2.0",
"hash": -4080338532933112300,
"line_mean": 32.7786885246,
"line_max": 91,
"alpha_frac": 0.6432904635,
"autogenerated": false,
"ratio": 3.3314470493128536,
"conf... |
from ethereum import genesis_helpers, db
from ethereum.block import Block, BlockHeader
from ethereum.config import Env
import ethereum.messages as messages
import ethereum.common as common
from pyethapp.leveldb_service import LevelDB
from ethereum.pow import chain
import rlp
import json
import os
import sys
import time... | {
"repo_name": "karlfloersch/pyethereum",
"path": "ethereum/todo_tests/tst_frontier.py",
"copies": "1",
"size": "5564",
"license": "mit",
"hash": 8960013428711125000,
"line_mean": 32.3173652695,
"line_max": 126,
"alpha_frac": 0.6491732566,
"autogenerated": false,
"ratio": 2.9643047416089505,
"co... |
from ethereum import tester as t
from ethereum import utils
import os
def test():
t.gas_price = 0
s = t.state()
c = s.abi_contract('gamble.se')
rseed = os.urandom(32)
seed1 = utils.sha3(rseed)
c.set_curseed(seed1)
s.block.set_balance(c.address, 27000)
totbal = sum([s.block.get_balance(x... | {
"repo_name": "LianaHus/dapp-bin",
"path": "serpent_gamble/test.py",
"copies": "3",
"size": "1982",
"license": "mit",
"hash": 7806433107232726000,
"line_mean": 37.862745098,
"line_max": 89,
"alpha_frac": 0.6276488396,
"autogenerated": false,
"ratio": 2.8976608187134505,
"config_test": false,
... |
from ethereum import tester as t
from ethereum import utils
import sys
def test():
# Test the arbiter mechanism
t.gas_price = 0
t.gas_limit = 100000000
s = t.state()
c = s.abi_contract('arbitration.se')
o = []
s.block.log_listeners.append(lambda x: o.append(c._translator.listen(x)))
x =... | {
"repo_name": "ethereum/dapp-bin",
"path": "arbitration/test.py",
"copies": "1",
"size": "4148",
"license": "mit",
"hash": 6506570433234827000,
"line_mean": 48.9759036145,
"line_max": 99,
"alpha_frac": 0.6101735776,
"autogenerated": false,
"ratio": 2.367579908675799,
"config_test": true,
"has... |
from ethereum import tester as t
from ethereum import utils
import sys
def test():
t.gas_price = 0
t.gas_limit = 100000000
s = t.state()
c = s.abi_contract('arbitration.se')
o = []
s.block.log_listeners.append(lambda x: o.append(c._translator.listen(x)))
x = c.mk_contract(t.a1, t.a2, [t.a3,... | {
"repo_name": "vaporry/dapp-bin",
"path": "arbitration/test.py",
"copies": "1",
"size": "1124",
"license": "mit",
"hash": -4065564440809745400,
"line_mean": 40.6296296296,
"line_max": 125,
"alpha_frac": 0.5951957295,
"autogenerated": false,
"ratio": 2.376321353065539,
"config_test": false,
"h... |
from ethereum import tester as t
from ethereum import utils
def test():
s = t.state()
test_company = s.abi_contract('company.se', ADMIN_ACCOUNT=utils.decode_int(t.a0))
order_book = s.abi_contract('orders.se')
test_currency = s.abi_contract('currency.se', sender=t.k0)
assert test_company.getAdmin() ... | {
"repo_name": "ethereum/dapp-bin",
"path": "private_market/test.py",
"copies": "3",
"size": "4485",
"license": "mit",
"hash": 3757735399611002400,
"line_mean": 50.5517241379,
"line_max": 85,
"alpha_frac": 0.6985507246,
"autogenerated": false,
"ratio": 3.240606936416185,
"config_test": true,
"... |
from ethereum import tester as t
from ethereum.slogging import set_level
import time
serpent_code = """
def sqrt(n):
i = 0
while i * i < n:
i += 1
return i
def mul(a:arr, b:arr):
c = array(len(a))
sz = self.sqrt(len(a))
i = 0
while i < sz:
j = 0
while j < sz:
... | {
"repo_name": "pipermerriam/pyethereum",
"path": "ethereum/tests/stress_test.py",
"copies": "4",
"size": "1289",
"license": "mit",
"hash": -1627976411168071000,
"line_mean": 23.320754717,
"line_max": 81,
"alpha_frac": 0.4608223429,
"autogenerated": false,
"ratio": 2.5626242544731612,
"config_te... |
from ethereum import tester, blocks
import ethereum.utils as utils
import rlp
import ethereum.testutils as testutils
from ethereum.testutils import fixture_to_bytes
import ethereum.config as config
import sys
import os
import json
from ethereum.slogging import get_logger
logger = get_logger()
# customize VM log output... | {
"repo_name": "EthereumWebhooks/blockhooks",
"path": "lib/ethereum/tests/test_difficulty.py",
"copies": "2",
"size": "2721",
"license": "apache-2.0",
"hash": 4158425164379437600,
"line_mean": 33.8846153846,
"line_max": 115,
"alpha_frac": 0.6765894892,
"autogenerated": false,
"ratio": 3.7172131147... |
from ethereum import tester
from datetime import datetime, date
import math
import pytest
slow = pytest.mark.slow
class TestBtcSpecialTx(object):
CONTRACT = 'btcSpecialTx.py'
CONTRACT_GAS = 55000
ETHER = 10 ** 18
def setup_class(cls):
tester.gas_limit = 2 * 10**6
cls.s = tester.stat... | {
"repo_name": "ethers/dapp-bin",
"path": "btcrelay/test/test_btcSpecialTx.py",
"copies": "1",
"size": "1699",
"license": "mit",
"hash": -4184733810990498300,
"line_mean": 41.475,
"line_max": 532,
"alpha_frac": 0.7675103002,
"autogenerated": false,
"ratio": 2.551051051051051,
"config_test": true... |
from ethereum import tester
from datetime import datetime, date
import math
import pytest
slow = pytest.mark.slow
from utilRelay import dblSha256Flip, disablePyethLogging
disablePyethLogging()
class TestBtcChain(object):
CONTRACT_DEBUG = 'test/btcChain_debug.se'
ETHER = 10 ** 18
ANC_DEPTHS = [1, 4, 1... | {
"repo_name": "ethers/btcrelay",
"path": "test/test_btcChain.py",
"copies": "1",
"size": "7281",
"license": "mit",
"hash": 5728871877781414000,
"line_mean": 26.8965517241,
"line_max": 97,
"alpha_frac": 0.590166186,
"autogenerated": false,
"ratio": 3.16015625,
"config_test": true,
"has_no_keyw... |
from ethereum import tester
from eth_rpc_client import Client
import re
CLIENT_HOST = "127.0.0.1"
CLIENT_PORT = "8545"
def is_valid_filter_id(filt_id):
"""
"""
check = re.compile("0x[\da-fA-F]+")
m = check.match(filt_id)
if m:
return(True)
else:
return(False)
def test_new_fil... | {
"repo_name": "pipermerriam/ethereum-rpc-client",
"path": "tests/rpc_client/test_eth_filter.py",
"copies": "1",
"size": "1077",
"license": "mit",
"hash": -7832414558094692000,
"line_mean": 19.320754717,
"line_max": 72,
"alpha_frac": 0.6072423398,
"autogenerated": false,
"ratio": 3.149122807017543... |
from ethereum import tester
import hydrachain.native_contracts as nc
from fungible_contract import Fungible, Transfer, Approval
import ethereum.slogging as slogging
log = slogging.get_logger('test.fungible')
def test_fungible_instance():
state = tester.state()
creator_address = tester.a0
creator_key = tes... | {
"repo_name": "HydraChain/hydrachain",
"path": "hydrachain/examples/native/fungible/test_fungible_contract.py",
"copies": "2",
"size": "4890",
"license": "mit",
"hash": -5130162393587765000,
"line_mean": 38.435483871,
"line_max": 95,
"alpha_frac": 0.708997955,
"autogenerated": false,
"ratio": 3.5... |
from ethereum import tester
from bitcoin import *
import datetime
import struct
import pytest
slow = pytest.mark.slow
from utilRelay import disablePyethLogging
disablePyethLogging()
class TestBtcEth(object):
CONTRACT = 'example-btc-eth/btc-eth.se'
CONTRACT_GAS = 55000
ETHER = 10 ** 18
# tx is ... | {
"repo_name": "ethers/btcrelay",
"path": "example-btc-eth/test/test_btc-eth.py",
"copies": "2",
"size": "3879",
"license": "mit",
"hash": -1318623175685465000,
"line_mean": 37.4059405941,
"line_max": 533,
"alpha_frac": 0.7097189997,
"autogenerated": false,
"ratio": 2.8712065136935605,
"config_t... |
from ethereum import tester
from eth_rpc_client import Client
def test_send_a_transaction(rpc_server, eth_coinbase):
client = Client('127.0.0.1', '8545')
to_addr = tester.encode_hex(tester.accounts[1])
txn_hash = client.send_transaction(
_from=eth_coinbase,
to=to_addr,
value=123... | {
"repo_name": "jpentland/ethereum-rpc-client",
"path": "tests/rpc_client/test_send_transaction.py",
"copies": "2",
"size": "1303",
"license": "mit",
"hash": -5031634715919029000,
"line_mean": 24.5490196078,
"line_max": 76,
"alpha_frac": 0.6792018419,
"autogenerated": false,
"ratio": 3.29873417721... |
from ethereum import tester
import datetime
import struct
import pytest
slow = pytest.mark.slow
from utilRelay import getHeaderBytes, dblSha256Flip, disablePyethLogging
disablePyethLogging()
class TestDifficulty(object):
# very specialized test
CONTRACT_DEBUG = 'test/btcrelay_difficulty.se'
ETHER = 1... | {
"repo_name": "ethers/btcrelay",
"path": "test/test_difficulty.py",
"copies": "1",
"size": "10895",
"license": "mit",
"hash": -5654161044505293000,
"line_mean": 41.55859375,
"line_max": 144,
"alpha_frac": 0.6815970629,
"autogenerated": false,
"ratio": 3.3919676214196763,
"config_test": true,
... |
from ethereum import transactions, utils
import serpent
import rlp
from ethereum.slogging import LogRecorder, configure_logging, set_level
config_string = ':info,eth.vm.log:trace,eth.vm.op:trace,eth.vm.stack:trace,eth.vm.exit:trace,eth.pb.msg:trace,eth.pb.tx:debug'
rlp_decoder = serpent.compile('rlp_decoder.se.py')
d... | {
"repo_name": "NedYork/viper",
"path": "scripts/fixed_address_creator.py",
"copies": "1",
"size": "3564",
"license": "mit",
"hash": 6860304349566233000,
"line_mean": 55.5714285714,
"line_max": 660,
"alpha_frac": 0.6705948373,
"autogenerated": false,
"ratio": 2.1113744075829386,
"config_test": f... |
from ethereum import utils
from ethereum.abi import is_numeric
import copy
from ethereum import opcodes
import time
from ethereum.slogging import get_logger
from rlp.utils import encode_hex, ascii_chr
from ethereum.utils import to_string, safe_ord
log_log = get_logger('eth.vm.log')
log_vm_exit = get_logger('eth.vm.exi... | {
"repo_name": "ethermarket/pyethereum",
"path": "ethereum/vm.py",
"copies": "1",
"size": "24090",
"license": "mit",
"hash": -500365396187122300,
"line_mean": 40.678200692,
"line_max": 100,
"alpha_frac": 0.4875882109,
"autogenerated": false,
"ratio": 3.5019624945486263,
"config_test": false,
"... |
from ethereum import utils
from ethereum.db import BaseDB
default_config = dict(
# Genesis block difficulty
GENESIS_DIFFICULTY=131072,
# Genesis block gas limit
GENESIS_GAS_LIMIT=3141592,
# Genesis block prevhash, coinbase, nonce
GENESIS_PREVHASH=b'\x00' * 32,
GENESIS_COINBASE=b'\x00' * 20,... | {
"repo_name": "vaporry/pyethereum",
"path": "ethereum/config.py",
"copies": "3",
"size": "1729",
"license": "mit",
"hash": 7883399133491010000,
"line_mean": 30.4363636364,
"line_max": 72,
"alpha_frac": 0.6587622903,
"autogenerated": false,
"ratio": 2.915682967959528,
"config_test": true,
"has... |
from ethereum import utils
from ethereum.slogging import get_logger
from rlp.utils import str_to_bytes
import sys
if sys.version_info.major == 2:
from repoze.lru import lru_cache
else:
from functools import lru_cache
log = get_logger('db')
databases = {}
class BaseDB(object):
pass
class _EphemDB(Base... | {
"repo_name": "karlfloersch/pyethereum",
"path": "ethereum/db.py",
"copies": "1",
"size": "4190",
"license": "mit",
"hash": 404570224203903170,
"line_mean": 21.5268817204,
"line_max": 76,
"alpha_frac": 0.5553699284,
"autogenerated": false,
"ratio": 3.360064153969527,
"config_test": false,
"ha... |
from ethereum import utils
from ethereum.slogging import get_logger
from rlp.utils import str_to_bytes
log = get_logger('db')
databases = {}
class BaseDB(object):
pass
class _EphemDB(BaseDB):
def __init__(self):
self.db = {}
self.kv = self.db
def get(self, key):
return self.d... | {
"repo_name": "vaporry/pyethereum",
"path": "ethereum/db.py",
"copies": "7",
"size": "3267",
"license": "mit",
"hash": -8183024085478688000,
"line_mean": 19.9423076923,
"line_max": 72,
"alpha_frac": 0.5684113866,
"autogenerated": false,
"ratio": 3.5704918032786885,
"config_test": false,
"has_... |
from ethereum import utils
from ethereum.slogging import get_logger
from rlp.utils import str_to_bytes
log = get_logger('db')
databases = {}
class _EphemDB(object):
def __init__(self):
self.db = {}
self.kv = self.db
def get(self, key):
return self.db[key]
def put(self, key, va... | {
"repo_name": "harlantwood/pyethereum",
"path": "ethereum/db.py",
"copies": "2",
"size": "3233",
"license": "mit",
"hash": -7409722532724111000,
"line_mean": 20.4105960265,
"line_max": 72,
"alpha_frac": 0.5678935973,
"autogenerated": false,
"ratio": 3.584257206208426,
"config_test": false,
"h... |
from ethereum import utils
from ethereum.utils import safe_ord
from ethereum.abi import is_numeric
"""
Blooms are the 3-point, 2048-bit (11-bits/point) Bloom filter of each
component (except data) of each log entry of each transaction.
We set the bits of a 2048-bit value whose indices are given by
the low order 11-bit... | {
"repo_name": "karlfloersch/pyethereum",
"path": "ethereum/bloom.py",
"copies": "1",
"size": "1656",
"license": "mit",
"hash": 5163367810605507000,
"line_mean": 24.4769230769,
"line_max": 88,
"alpha_frac": 0.6678743961,
"autogenerated": false,
"ratio": 2.6327503974562796,
"config_test": false,
... |
from ethereum import utils
import random, rlp, sys
try:
from urllib.request import build_opener
except:
from urllib2 import build_opener
# Makes a request to a given URL (first arg) and optional params (second arg)
def make_request(*args):
opener = build_opener()
opener.addheaders = [('User-agent',
... | {
"repo_name": "RomanZacharia/pyethapp",
"path": "pyethapp/sentry.py",
"copies": "6",
"size": "1091",
"license": "mit",
"hash": -257410863595454080,
"line_mean": 29.3055555556,
"line_max": 77,
"alpha_frac": 0.5609532539,
"autogenerated": false,
"ratio": 3.7620689655172415,
"config_test": false,
... |
from ethereum import utils
def mk_forwarder(address):
code = b'\x36\x60\x00\x60\x00\x37' # CALLDATACOPY 0 0 (CALLDATASIZE)
code += b'\x61\x10\x00\x60\x00\x36\x60\x00' # 4096 0 CALLDATASIZE 0
code += b'\x73' + utils.normalize_address(address) + b'\x5a' # address gas
code += b'\xf4' # delegatecall
co... | {
"repo_name": "NedYork/viper",
"path": "scripts/forwarder.py",
"copies": "1",
"size": "1435",
"license": "mit",
"hash": -5992256540224226000,
"line_mean": 33.1666666667,
"line_max": 86,
"alpha_frac": 0.6390243902,
"autogenerated": false,
"ratio": 2.7437858508604207,
"config_test": true,
"has_... |
from ethereum import utils
class SecureTrie(object):
def __init__(self, t):
self.trie = t
self.db = t.db
def update(self, k, v):
h = utils.sha3(k)
self.db.put(h, k)
self.trie.update(h, v)
def get(self, k):
return self.trie.get(utils.sha3(k))
def dele... | {
"repo_name": "harlantwood/pyethereum",
"path": "ethereum/securetrie.py",
"copies": "9",
"size": "1138",
"license": "mit",
"hash": 1122813752971925000,
"line_mean": 21.3137254902,
"line_max": 54,
"alpha_frac": 0.5483304042,
"autogenerated": false,
"ratio": 3.117808219178082,
"config_test": fals... |
from ethereum.opcodes import opcodes
from ethereum import utils
from ethereum.utils import safe_ord
import serpent
import rlp
from rlp.utils import decode_hex, encode_hex, ascii_chr
import copy
code_cache = {}
OUT_OF_GAS = -1
GDEFAULT = 1
GMEMORY = 1
GSTORAGE = 100
GTXDATA = 5
GTXCOST = 500
TT255 = 2 ** 255
TT256 = 2... | {
"repo_name": "ethermarket/pyethereum",
"path": "ethereum/fastvm.py",
"copies": "1",
"size": "26590",
"license": "mit",
"hash": 5078127975105416000,
"line_mean": 30.8824940048,
"line_max": 114,
"alpha_frac": 0.518916886,
"autogenerated": false,
"ratio": 3.141169521559362,
"config_test": false,
... |
from ethereum.pow import ethash
from ethereum import utils
import time
import sys
import warnings
from collections import OrderedDict
from ethereum import utils
from ethereum.slogging import get_logger
import rlp
log = get_logger('eth.pow')
if sys.version_info.major == 2:
from repoze.lru import lru_cache
else:
... | {
"repo_name": "karlfloersch/pyethereum",
"path": "ethereum/pow/ethpow.py",
"copies": "1",
"size": "4263",
"license": "mit",
"hash": -3526854738959897000,
"line_mean": 31.2954545455,
"line_max": 78,
"alpha_frac": 0.6338259442,
"autogenerated": false,
"ratio": 3.37797147385103,
"config_test": fal... |
from ethereum.slogging import get_logger
log = get_logger('eth.block_creation')
from ethereum.block import Block, BlockHeader
from ethereum.common import mk_block_from_prevstate, validate_header, \
verify_execution_results, validate_transaction_tree, \
set_execution_results, add_transactions, post_finalize, \
... | {
"repo_name": "karlfloersch/pyethereum",
"path": "ethereum/meta.py",
"copies": "1",
"size": "3162",
"license": "mit",
"hash": 7691173991246929000,
"line_mean": 38.037037037,
"line_max": 71,
"alpha_frac": 0.6666666667,
"autogenerated": false,
"ratio": 4.00253164556962,
"config_test": false,
"h... |
from ethereum.tools import tester
from ethereum.utils import encode_hex, privtoaddr
from ethereum.hybrid_casper import casper_utils
from ethereum.hybrid_casper.config import casper_config
import re
ALLOC = {a: {'balance': 500*10**24} for a in tester.accounts[:10]}
class Validator(object):
def __init__(self, withd... | {
"repo_name": "karlfloersch/pyethereum",
"path": "ethereum/tests/hybrid_casper/testing_lang.py",
"copies": "1",
"size": "7660",
"license": "mit",
"hash": -4613926877059710000,
"line_mean": 51.4657534247,
"line_max": 151,
"alpha_frac": 0.6403394256,
"autogenerated": false,
"ratio": 3.4929320565435... |
from ethereum.utils import sha3, privtoaddr, int_to_addr, to_string, big_endian_to_int, checksum_encode, int_to_big_endian, encode_hex, normalize_address
from ethereum.genesis_helpers import mk_basic_state
from ethereum.transactions import Transaction
from ethereum.consensus_strategy import get_consensus_strategy
from ... | {
"repo_name": "karlfloersch/pyethereum",
"path": "ethereum/tools/tester.py",
"copies": "1",
"size": "12499",
"license": "mit",
"hash": -9039066106556759000,
"line_mean": 35.4402332362,
"line_max": 153,
"alpha_frac": 0.6042083367,
"autogenerated": false,
"ratio": 3.514904386951631,
"config_test"... |
from ethereum.utils import zpad
import gevent.event
import ethereum.slogging as slogging
from ethereum import transactions
from pyethapp.rpc_client import ABIContract
from hydrachain import native_contracts as nc
log = slogging.get_logger('nc.utils')
STATUS = 'uint16'
FORBIDDEN = 403
NOTFOUND = 404
OK = 200
ERROR = 50... | {
"repo_name": "wangkangda/hydrachain",
"path": "hydrachain/nc_utils.py",
"copies": "2",
"size": "5112",
"license": "mit",
"hash": 8497220390985862000,
"line_mean": 32.8543046358,
"line_max": 92,
"alpha_frac": 0.6408450704,
"autogenerated": false,
"ratio": 3.447066756574511,
"config_test": false... |
from eth_hash.auto import keccak
from eth_typing import HexStr
from eth_utils import (
encode_hex,
is_0x_prefixed,
is_checksum_address,
remove_0x_prefix,
to_canonical_address,
)
from raiden.exceptions import InvalidChecksummedAddress
from raiden.utils.typing import (
Address,
AddressHex,
... | {
"repo_name": "raiden-network/raiden",
"path": "raiden/utils/formatting.py",
"copies": "1",
"size": "2461",
"license": "mit",
"hash": -2499640555837594000,
"line_mean": 26.3444444444,
"line_max": 95,
"alpha_frac": 0.6741162129,
"autogenerated": false,
"ratio": 3.5157142857142856,
"config_test":... |
from ethjsonrpc import EthJsonRpc
methods = [
'web3_clientVersion',
'net_version',
'net_peerCount',
'net_listening',
'eth_protocolVersion',
'eth_syncing',
'eth_coinbase',
'eth_mining',
'eth_hashrate',
'eth_gasPrice',
'eth_accounts',
'eth_blockNumber',
'eth_getCompile... | {
"repo_name": "ConsenSys/ethjsonrpc",
"path": "test.py",
"copies": "1",
"size": "4280",
"license": "unlicense",
"hash": -9110614877892820000,
"line_mean": 29.5714285714,
"line_max": 85,
"alpha_frac": 0.6193925234,
"autogenerated": false,
"ratio": 2.698612862547289,
"config_test": true,
"has_n... |
from ethronsoft.gcspypi.exceptions import RepositoryError, NotFound
from ethronsoft.gcspypi.repository.object_metadata import ObjectMetadata
import hashlib
import datetime
def _make_metadata(content, content_type):
return ObjectMetadata(content_type, hashlib.md5(content).hexdigest(), datetime.datetime.now())
clas... | {
"repo_name": "ethronsoft/gcspypi",
"path": "test/mocks/mock_repository.py",
"copies": "1",
"size": "1757",
"license": "bsd-2-clause",
"hash": -5556140339711034000,
"line_mean": 32.1509433962,
"line_max": 98,
"alpha_frac": 0.6397268071,
"autogenerated": false,
"ratio": 4.029816513761468,
"confi... |
from ethronsoft.gcspypi.package.package_manager import PackageManager
from ethronsoft.gcspypi.utilities.console import Console
from ethronsoft.gcspypi.parsers.commons import init_repository
def handle_(config, data):
with Console(verbose=config.get("verbose", False), exit_on_error=True) as c:
repo = init_r... | {
"repo_name": "ethronsoft/gcspypi",
"path": "ethronsoft/gcspypi/parsers/download.py",
"copies": "1",
"size": "1098",
"license": "bsd-2-clause",
"hash": 6277096452510088000,
"line_mean": 46.7826086957,
"line_max": 97,
"alpha_frac": 0.6520947177,
"autogenerated": false,
"ratio": 4.143396226415095,
... |
from ethronsoft.gcspypi.package.package_manager import PackageManager
from ethronsoft.gcspypi.utilities.console import Console
from ethronsoft.gcspypi.parsers.commons import init_repository
def print_syntax(console):
console.info("""
Syntax:
((?:\w|-)*)(==|<=?|>=?)?((?:\d*\.?){0,3})?,?(==|<=?|>=?)?((?:\d*\.?){... | {
"repo_name": "ethronsoft/gcspypi",
"path": "ethronsoft/gcspypi/parsers/syntax.py",
"copies": "1",
"size": "1517",
"license": "bsd-2-clause",
"hash": 6786654024440946000,
"line_mean": 32.7333333333,
"line_max": 107,
"alpha_frac": 0.6110744891,
"autogenerated": false,
"ratio": 3.4243792325056432,
... |
from ethronsoft.gcspypi.package.package_manager import PackageManager, PackageBuilder
from ethronsoft.gcspypi.utilities.console import Console
from ethronsoft.gcspypi.parsers.commons import init_repository
import os
def handle_(config, data):
with Console(verbose=config.get("verbose", False), exit_on_error=True) a... | {
"repo_name": "ethronsoft/gcspypi",
"path": "ethronsoft/gcspypi/parsers/upload.py",
"copies": "1",
"size": "1344",
"license": "bsd-2-clause",
"hash": 8888503578696192000,
"line_mean": 50.7307692308,
"line_max": 126,
"alpha_frac": 0.6577380952,
"autogenerated": false,
"ratio": 3.9881305637982196,
... |
from ethronsoft.gcspypi.utilities.console import Console
from ethronsoft.gcspypi.exceptions import *
import sys
import six
import pytest
if six.PY2:
from StringIO import StringIO # pylint: disable=E0401
else:
from io import StringIO
#NOTE: console writes to stderr any messages with the exception
# of `output`... | {
"repo_name": "ethronsoft/gcspypi",
"path": "test/console_test.py",
"copies": "1",
"size": "5652",
"license": "bsd-2-clause",
"hash": -3892937940782150000,
"line_mean": 26.1778846154,
"line_max": 87,
"alpha_frac": 0.5343241331,
"autogenerated": false,
"ratio": 3.906012439530062,
"config_test": ... |
from ethronsoft.gcspypi.utilities.queries import get_package_type
from ethronsoft.gcspypi.package.package import Package
from ethronsoft.gcspypi.exceptions import InvalidState
import json
import os
import shutil
import tarfile
import tempfile
import zipfile
class PackageBuilder(object):
def __init__(self, raw_... | {
"repo_name": "ethronsoft/gcspypi",
"path": "ethronsoft/gcspypi/package/package_builder.py",
"copies": "1",
"size": "3547",
"license": "bsd-2-clause",
"hash": -5650486665520185000,
"line_mean": 33.4368932039,
"line_max": 74,
"alpha_frac": 0.5018325345,
"autogenerated": false,
"ratio": 4.309842041... |
from ethronsoft.gcspypi.utilities.version import complete_version
from ethronsoft.gcspypi.exceptions import InvalidState, InvalidParameter
# from functools import total_ordering
import os
# @total_ordering
# class Version(object):
# """Packages support the following versioning scheme:
# <major>.<minor>.<pat... | {
"repo_name": "ethronsoft/gcspypi",
"path": "ethronsoft/gcspypi/package/package.py",
"copies": "1",
"size": "3739",
"license": "bsd-2-clause",
"hash": -8707271545041021000,
"line_mean": 30.1583333333,
"line_max": 104,
"alpha_frac": 0.5410537577,
"autogenerated": false,
"ratio": 3.8309426229508197... |
from eth_rpc_client import Client
def test_get_code(rpc_server, eth_coinbase):
client = Client('127.0.0.1', '8545')
data = "0x606060405260f8806100126000396000f30060606040526000357c01000000000000000000000000000000000000000000000000000000009004806316216f3914604b578063a5f3c23b14606a578063dcf537b1146095576049565... | {
"repo_name": "jpentland/ethereum-rpc-client",
"path": "tests/rpc_client/test_get_code.py",
"copies": "3",
"size": "1091",
"license": "mit",
"hash": 7697941946042555000,
"line_mean": 56.4210526316,
"line_max": 547,
"alpha_frac": 0.8240146654,
"autogenerated": false,
"ratio": 2.8118556701030926,
... |
from eth_tester_client.utils import (
force_bytes,
)
CONTRACT_BIN = b'0x6060604052610114806100126000396000f360606040526000357c01000000000000000000000000000000000000000000000000000000009004806316216f391461004f578063a5f3c23b14610072578063dcf537b1146100a75761004d565b005b61005c60048050506100d3565b60405180828152602001... | {
"repo_name": "pipermerriam/ethereum-tester-client",
"path": "tests/client/test_get_code.py",
"copies": "1",
"size": "2522",
"license": "mit",
"hash": -3964557323012595700,
"line_mean": 39.6774193548,
"line_max": 608,
"alpha_frac": 0.7965900079,
"autogenerated": false,
"ratio": 2.8922018348623855... |
from eth_tester_client.utils import (
normalize_address,
encode_32bytes,
strip_0x,
)
def test_personal_importRawKey_as_bytes(web3_empty, account_private_key,
account_password, account_public_key):
web3 = web3_empty
address = web3.personal.importRawKey(accou... | {
"repo_name": "shravan-shandilya/web3.py",
"path": "tests/personal-module/test_personal_importRawKey.py",
"copies": "1",
"size": "1606",
"license": "mit",
"hash": 3334952413471027700,
"line_mean": 35.5,
"line_max": 105,
"alpha_frac": 0.6251556663,
"autogenerated": false,
"ratio": 4.20418848167539... |
from eth_tools import Contract, address
from nose.tools import assert_equal
from pyethereum import tester as t
INITIALIZE = 0
SET_CONFIGURATION = 1
BUY_TICKET = 2
GET_TICKET_OWNER = 3
GET_TICKET_NUMBERS = 4
TRANSFER_TICKET = 5
CHECK_WINNERS = 6
CLAIM_WINNINGS = 7
GET_BALANCE = 8
SET_PAYOUTS = 9
WITHDRAW = 10
START_LOT... | {
"repo_name": "jeffanthony/ethereum-powerball",
"path": "tests/lotto_test.py",
"copies": "3",
"size": "6793",
"license": "mit",
"hash": -5585610586106520000,
"line_mean": 38.2658959538,
"line_max": 93,
"alpha_frac": 0.6229942588,
"autogenerated": false,
"ratio": 2.8808312128922817,
"config_test... |
from eth_utils import decode_hex, encode_hex
from web3 import Web3
from raiden.constants import UINT256_MAX
from raiden.utils.signing import pack_data
from raiden.utils.typing import Address, ChannelID
from raiden_contracts.constants import MessageTypeId
class BalanceProof:
""" A Balance Proof
If transferre... | {
"repo_name": "hackaugusto/raiden",
"path": "raiden/tests/integration/network/proxies/__init__.py",
"copies": "1",
"size": "3149",
"license": "mit",
"hash": 8283040921193750000,
"line_mean": 35.1954022989,
"line_max": 99,
"alpha_frac": 0.6189266434,
"autogenerated": false,
"ratio": 4.047557840616... |
from eth_utils import decode_hex, encode_hex
from raiden.constants import LOCKSROOT_OF_NO_LOCKS, UINT256_MAX
from raiden.transfer.utils import hash_balance_data
from raiden.utils.typing import (
BalanceHash,
ChannelID,
LockedAmount,
Locksroot,
TokenAmount,
TokenNetworkAddress,
)
from raiden_con... | {
"repo_name": "raiden-network/raiden",
"path": "raiden/tests/integration/network/proxies/__init__.py",
"copies": "1",
"size": "3288",
"license": "mit",
"hash": -5290811203384684000,
"line_mean": 34.7391304348,
"line_max": 93,
"alpha_frac": 0.6475060827,
"autogenerated": false,
"ratio": 3.90963139... |
from eth_utils import encode_hex
from eth_utils.currency import denoms
from raiden.tests.utils.genesis import GENESIS_STUB
from raiden.utils import privatekey_to_address, sha3
CLUSTER_NAME = b"raiden"
ETHER = denoms.ether # pylint: disable=no-member
def generate_accounts(seeds):
"""Create private keys and addr... | {
"repo_name": "hackaugusto/raiden",
"path": "tools/genesis_builder.py",
"copies": "1",
"size": "1198",
"license": "mit",
"hash": 2873160729655259000,
"line_mean": 32.2777777778,
"line_max": 99,
"alpha_frac": 0.6853088481,
"autogenerated": false,
"ratio": 3.4825581395348837,
"config_test": false... |
from eth_utils import keccak
from raiden.constants import EMPTY_SIGNATURE
from raiden.messages.synchronization import Processed
from raiden.tests.utils import factories
from raiden.transfer.events import (
EventPaymentReceivedSuccess,
EventPaymentSentFailed,
EventPaymentSentSuccess,
)
from raiden.transfer.... | {
"repo_name": "raiden-network/raiden",
"path": "raiden/tests/unit/test_operators.py",
"copies": "1",
"size": "2626",
"license": "mit",
"hash": -7221722719905802000,
"line_mean": 29.5348837209,
"line_max": 88,
"alpha_frac": 0.6618431074,
"autogenerated": false,
"ratio": 3.3114754098360657,
"conf... |
from eth_utils import (
apply_to_return_value,
add_0x_prefix,
from_wei,
is_address,
is_checksum_address,
keccak,
remove_0x_prefix,
to_checksum_address,
to_wei,
)
from ens import ENS
from web3.admin import Admin
from web3.eth import Eth
from web3.iban import Iban
from web3.miner imp... | {
"repo_name": "pipermerriam/web3.py",
"path": "web3/main.py",
"copies": "1",
"size": "4645",
"license": "mit",
"hash": -3994388033301861000,
"line_mean": 24.2445652174,
"line_max": 94,
"alpha_frac": 0.6159311087,
"autogenerated": false,
"ratio": 3.6661404893449094,
"config_test": true,
"has_n... |
from eth_utils import (
int_to_big_endian,
big_endian_to_int,
)
from rlp.exceptions import DeserializationError, SerializationError
class BigEndianInt(object):
"""A sedes for big endian integers.
:param l: the size of the serialized representation in bytes or `None` to
use the shortest... | {
"repo_name": "ethereum/pyrlp",
"path": "rlp/sedes/big_endian_int.py",
"copies": "1",
"size": "1615",
"license": "mit",
"hash": 1437193498841292300,
"line_mean": 31.3,
"line_max": 79,
"alpha_frac": 0.560371517,
"autogenerated": false,
"ratio": 4.119897959183674,
"config_test": false,
"has_no_... |
from eth_utils import (
is_checksum_address,
is_list_like,
is_same_address,
)
PRIVATE_KEY_HEX = '0x56ebb41875ceedd42e395f730e03b5c44989393c9f0484ee6bc05f933673458f'
PASSWORD = 'web3-testing'
ADDRESS = '0x844B417c0C58B02c2224306047B9fb0D3264fE8c'
PRIVATE_KEY_FOR_UNLOCK = '0x392f63a79b1ff8774845f3fa69de4a... | {
"repo_name": "pipermerriam/web3.py",
"path": "web3/utils/module_testing/personal_module.py",
"copies": "1",
"size": "3260",
"license": "mit",
"hash": -1397175008553434000,
"line_mean": 39.2469135802,
"line_max": 93,
"alpha_frac": 0.5874233129,
"autogenerated": false,
"ratio": 3.8579881656804735,... |
from eth_utils import (
is_hex,
is_string,
is_integer,
remove_0x_prefix,
force_text,
)
def is_predefined_block_number(value):
if not is_string(value):
return False
return force_text(value) in {"latest", "pending", "earliest"}
def is_hex_encoded_block_hash(value):
if not is_st... | {
"repo_name": "pipermerriam/web3.py",
"path": "web3/utils/blocks.py",
"copies": "1",
"size": "1270",
"license": "mit",
"hash": 2881715614555778000,
"line_mean": 25.4583333333,
"line_max": 92,
"alpha_frac": 0.6307086614,
"autogenerated": false,
"ratio": 3.518005540166205,
"config_test": false,
... |
from eth_utils import to_bytes, to_canonical_address, to_checksum_address
from raiden import constants
from raiden.utils import pex
from raiden.utils.typing import (
Address,
Any,
ChainID,
ChannelID,
Dict,
T_Address,
T_ChainID,
T_ChannelID,
TokenNetworkAddress,
TokenNetworkID,
... | {
"repo_name": "hackaugusto/raiden",
"path": "raiden/transfer/identifiers.py",
"copies": "1",
"size": "4134",
"license": "mit",
"hash": -2392717667586167300,
"line_mean": 32.8852459016,
"line_max": 90,
"alpha_frac": 0.6211901306,
"autogenerated": false,
"ratio": 4.288381742738589,
"config_test":... |
from eth_utils import to_canonical_address
from raiden.constants import BLOCK_ID_LATEST
from raiden.network.proxies.token import Token
from raiden.network.rpc.client import JSONRPCClient
from raiden.tests.utils.smartcontracts import is_tx_hash_bytes
from raiden.utils.keys import privatekey_to_address
def test_token(... | {
"repo_name": "raiden-network/raiden",
"path": "raiden/tests/integration/network/proxies/test_token.py",
"copies": "1",
"size": "1444",
"license": "mit",
"hash": 5254427232275677000,
"line_mean": 40.2571428571,
"line_max": 81,
"alpha_frac": 0.7444598338,
"autogenerated": false,
"ratio": 3.5566502... |
from eth_utils import to_canonical_address, to_checksum_address
from raiden.network.proxies.token import Token
from raiden.network.rpc.client import JSONRPCClient
from raiden.utils import privatekey_to_address
def test_token(deploy_client, token_proxy, private_keys, web3, contract_manager):
privkey = private_key... | {
"repo_name": "hackaugusto/raiden",
"path": "raiden/tests/integration/network/proxies/test_token.py",
"copies": "1",
"size": "1232",
"license": "mit",
"hash": -1802546895727334700,
"line_mean": 41.4827586207,
"line_max": 81,
"alpha_frac": 0.7418831169,
"autogenerated": false,
"ratio": 3.612903225... |
from eth_utils import to_hex
from raiden.exceptions import RaidenUnrecoverableError
from raiden.storage.sqlite import (
EventRecord,
FilteredDBQuery,
Operator,
SerializedSQLiteStorage,
StateChangeID,
StateChangeRecord,
)
from raiden.storage.wal import restore_state
from raiden.transfer import n... | {
"repo_name": "raiden-network/raiden",
"path": "raiden/storage/restore.py",
"copies": "1",
"size": "8104",
"license": "mit",
"hash": 200159829661824670,
"line_mean": 34.7004405286,
"line_max": 96,
"alpha_frac": 0.695952616,
"autogenerated": false,
"ratio": 3.945472249269718,
"config_test": true... |
from etifile import ETIFile
from astrodata.adutils import logutils
log = logutils.get_logger(__name__)
class PyrafETIFile(ETIFile):
"""This class coordinates the ETI files as it pertains to Pyraf
tasks in general.
"""
rc = None
filedict = None
def __init__(self, rc=None):
"""
:... | {
"repo_name": "pyrrho314/recipesystem",
"path": "trunk/astrodata/eti/pyrafetifile.py",
"copies": "1",
"size": "1055",
"license": "mpl-2.0",
"hash": -6614773908354172000,
"line_mean": 26.0512820513,
"line_max": 72,
"alpha_frac": 0.6,
"autogenerated": false,
"ratio": 3.7544483985765122,
"config_t... |
from etk.dependencies.date_extractor_resources.constants import singleton_regex, units
class DateRegexGenerator:
"""
get the final_regex and symbol_list for date_extractor if single regex updates
d = DateRegexGenerator(singleton_regex, units)
final_regex = d.final_regex
symbol_list = d.single_list... | {
"repo_name": "usc-isi-i2/etk",
"path": "etk/dependencies/date_extractor_resources/date_regex_generator.py",
"copies": "1",
"size": "4605",
"license": "mit",
"hash": -2319975080432698400,
"line_mean": 46.96875,
"line_max": 118,
"alpha_frac": 0.4262757872,
"autogenerated": false,
"ratio": 3.371156... |
from etk.etk import ETK
from etk.knowledge_graph import KGSchema
from etk.extractors.glossary_extractor import GlossaryExtractor
from etk.etk_module import ETKModule
from etk.wikidata import *
class ExampleETKModule(ETKModule):
"""
Abstract class for extraction module
"""
def __init__(self, etk):
... | {
"repo_name": "usc-isi-i2/etk",
"path": "examples/knowledge_graph/create_wiki_property.py",
"copies": "1",
"size": "1771",
"license": "mit",
"hash": 4394822490804021000,
"line_mean": 33.7058823529,
"line_max": 122,
"alpha_frac": 0.6084745763,
"autogenerated": false,
"ratio": 3.3586337760910814,
... |
from etk.etk import ETK
from etk.knowledge_graph import KGSchema, URI, BNode, Literal, LiteralType, Subject, Reification
from etk.extractors.glossary_extractor import GlossaryExtractor
from etk.etk_module import ETKModule
class ExampleETKModule(ETKModule):
"""
Abstract class for extraction module
"""
... | {
"repo_name": "usc-isi-i2/etk",
"path": "examples/knowledge_graph/create_kg_with_reification.py",
"copies": "1",
"size": "3696",
"license": "mit",
"hash": 5635372262536468000,
"line_mean": 38.7419354839,
"line_max": 116,
"alpha_frac": 0.5933441558,
"autogenerated": false,
"ratio": 3.5813953488372... |
from etk.etk import ETK
from etk.knowledge_graph import KGSchema, URI, BNode, Literal, Subject
from etk.extractors.glossary_extractor import GlossaryExtractor
from etk.etk_module import ETKModule
class ExampleETKModule(ETKModule):
"""
Abstract class for extraction module
"""
def __init__(self, etk):
... | {
"repo_name": "usc-isi-i2/etk",
"path": "examples/knowledge_graph/create_kg_with_ontology.py",
"copies": "1",
"size": "3461",
"license": "mit",
"hash": -1759959900667063300,
"line_mean": 36.2150537634,
"line_max": 116,
"alpha_frac": 0.5689107194,
"autogenerated": false,
"ratio": 3.662433862433862... |
from etk.etk_module import ETKModule
from etk.document import Document
from etk.extractors.date_extractor import DateExtractor
import datetime
class ETKModuleDate(ETKModule):
def __init__(self, etk):
ETKModule.__init__(self, etk)
self.date_extractor = DateExtractor(self.etk, 'test_date_parser')
... | {
"repo_name": "usc-isi-i2/etk",
"path": "examples/ranking_pipeline/extraction_modules/em_date.py",
"copies": "1",
"size": "2359",
"license": "mit",
"hash": 5488212295998531000,
"line_mean": 34.7575757576,
"line_max": 116,
"alpha_frac": 0.5722763883,
"autogenerated": false,
"ratio": 4.067241379310... |
from etk.etk_module import ETKModule
from etk.document import Document
from etk.extractors.glossary_extractor import GlossaryExtractor
class ETKModuleGlossary(ETKModule):
def __init__(self, etk):
ETKModule.__init__(self, etk)
self.name_extractor = GlossaryExtractor(self.etk.load_glossary("./extrac... | {
"repo_name": "usc-isi-i2/etk",
"path": "examples/pipeline/extraction_modules/em_glossary.py",
"copies": "1",
"size": "1714",
"license": "mit",
"hash": -5108537833810153000,
"line_mean": 44.1052631579,
"line_max": 120,
"alpha_frac": 0.532672112,
"autogenerated": false,
"ratio": 4.4751958224543085... |
from etk.extraction import Extractable, Extraction
from typing import List, Dict
from etk.etk_exceptions import StoreExtractionError
from etk.storage_provenance_record import StorageProvenanceRecord
from numbers import Number
class Segment(Extractable):
"""
An individual segment in a document.
For now, it... | {
"repo_name": "usc-isi-i2/etk",
"path": "etk/segment.py",
"copies": "1",
"size": "6841",
"license": "mit",
"hash": -4015367306110136300,
"line_mean": 46.5069444444,
"line_max": 119,
"alpha_frac": 0.5943575501,
"autogenerated": false,
"ratio": 4.43644617380026,
"config_test": false,
"has_no_ke... |
from etk.extraction import Extractable
from typing import List, Dict
from etk.origin_record import OriginRecord
class StorageProvenanceRecord(Extractable):
"""
An individual storage provenance record of a storage of set of a set of extraction results from a document.
"""
def __init__(self, id, json_p... | {
"repo_name": "usc-isi-i2/etk",
"path": "etk/storage_provenance_record.py",
"copies": "1",
"size": "1436",
"license": "mit",
"hash": -4216936438006544400,
"line_mean": 30.2173913043,
"line_max": 111,
"alpha_frac": 0.6218662953,
"autogenerated": false,
"ratio": 4.364741641337386,
"config_test": ... |
from etk.extraction import Extractable
from typing import List, Dict
from etk.origin_record import OriginRecord
class ExtractionProvenanceRecord(Extractable):
"""
A Provenance Record containing details of Extraction Results history.
"""
def __init__(self, id: int, json_path: str, method: str, start_... | {
"repo_name": "usc-isi-i2/etk",
"path": "etk/extraction_provenance_record.py",
"copies": "1",
"size": "1290",
"license": "mit",
"hash": -8117440883461292000,
"line_mean": 33.8648648649,
"line_max": 115,
"alpha_frac": 0.6511627907,
"autogenerated": false,
"ratio": 4.095238095238095,
"config_test... |
from etk.extractor import Extractor, InputType
from etk.extraction import Extraction
from spacy.matcher import Matcher
from spacy.attrs import LIKE_EMAIL
from typing import List
import copy
FILTER_PROVIDER = ["noon", "no"]
class EmailExtractor(Extractor):
"""
**Description**
This class uses spaCy Ma... | {
"repo_name": "usc-isi-i2/etk",
"path": "etk/extractors/email_extractor.py",
"copies": "1",
"size": "3775",
"license": "mit",
"hash": -4950740167574024000,
"line_mean": 28.9603174603,
"line_max": 111,
"alpha_frac": 0.538807947,
"autogenerated": false,
"ratio": 4.227323628219485,
"config_test": ... |
from etk.extractor import Extractor, InputType
from etk.extraction import Extraction
from typing import List
from email.utils import parsedate_to_datetime
from bs4 import BeautifulSoup
import re
import json
import datetime
class MailmanExtractor(Extractor):
def __init__(self, email_url: str, mailing_list_name: str... | {
"repo_name": "usc-isi-i2/etk",
"path": "etk/extractors/mailman_extractor.py",
"copies": "1",
"size": "5190",
"license": "mit",
"hash": 874002754599329000,
"line_mean": 34.0675675676,
"line_max": 97,
"alpha_frac": 0.4967244701,
"autogenerated": false,
"ratio": 3.9110776186887715,
"config_test":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.