id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12,300 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/decoding.py | ccxt.static_dependencies.ethereum.abi.decoding.HeadTailDecoder | class HeadTailDecoder(BaseDecoder):
is_dynamic = True
tail_decoder = None
def validate(self):
super().validate()
if self.tail_decoder is None:
raise ValueError('No `tail_decoder` set')
def decode(self, stream):
start_pos = decode_uint_256(stream)
stream.push... | class HeadTailDecoder(BaseDecoder):
def validate(self):
pass
def decode(self, stream):
pass | 3 | 0 | 7 | 2 | 5 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 2 | 0 | 2 | 27 | 19 | 6 | 13 | 7 | 10 | 0 | 13 | 7 | 10 | 2 | 4 | 1 | 3 |
12,301 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/decoding.py | ccxt.static_dependencies.ethereum.abi.decoding.SignedFixedDecoder | import decimal
from ..utils import big_endian_to_int, to_normalized_address, to_tuple
from .base import BaseCoder, parse_tuple_type_str, parse_type_str
from .utils.numeric import TEN, abi_decimal_context, ceil32
from .exceptions import DecodingError, InsufficientDataBytes, NonEmptyPaddingBytes
class SignedFixedDecoder... |
class SignedFixedDecoder(BaseFixedDecoder):
def decoder_fn(self, data):
pass
def validate_padding_bytes(self, value, padding_bytes):
pass
@parse_type_str('fixed')
def from_type_str(cls, abi_type, registry):
pass | 5 | 0 | 9 | 2 | 8 | 0 | 2 | 0 | 1 | 2 | 1 | 0 | 3 | 0 | 3 | 39 | 32 | 7 | 25 | 12 | 20 | 0 | 20 | 11 | 16 | 3 | 8 | 1 | 6 |
12,302 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/decoding.py | ccxt.static_dependencies.ethereum.abi.decoding.SignedIntegerDecoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
from ..utils import big_endian_to_int, to_normalized_address, to_tuple
from .exceptions import DecodingError, InsufficientDataBytes, NonEmptyPaddingBytes
class SignedIntegerDecoder(Fixed32ByteSizeDecoder):
is_big_endian = True
def decoder_fn(se... |
class SignedIntegerDecoder(Fixed32ByteSizeDecoder):
def decoder_fn(self, data):
pass
def validate_padding_bytes(self, value, padding_bytes):
pass
@parse_type_str('int')
def from_type_str(cls, abi_type, registry):
pass | 5 | 0 | 7 | 1 | 6 | 0 | 2 | 0 | 1 | 1 | 1 | 0 | 3 | 0 | 3 | 38 | 27 | 5 | 22 | 10 | 17 | 0 | 17 | 9 | 13 | 3 | 7 | 1 | 6 |
12,303 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/decoding.py | ccxt.static_dependencies.ethereum.abi.decoding.SingleDecoder | class SingleDecoder(BaseDecoder):
decoder_fn = None
def validate(self):
super().validate()
if self.decoder_fn is None:
raise ValueError('No `decoder_fn` set')
def validate_padding_bytes(self, value, padding_bytes):
raise NotImplementedError('Must be implemented by subcl... | class SingleDecoder(BaseDecoder):
def validate(self):
pass
def validate_padding_bytes(self, value, padding_bytes):
pass
def decode(self, stream):
pass
def read_data_from_stream(self, stream):
pass
def split_data_and_padding(self, raw_data):
pass | 6 | 0 | 4 | 0 | 3 | 0 | 1 | 0 | 1 | 3 | 0 | 2 | 5 | 0 | 5 | 30 | 25 | 7 | 18 | 10 | 12 | 0 | 18 | 10 | 12 | 2 | 4 | 1 | 6 |
12,304 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/decoding.py | ccxt.static_dependencies.ethereum.abi.decoding.SizedArrayDecoder | from ..utils import big_endian_to_int, to_normalized_address, to_tuple
class SizedArrayDecoder(BaseArrayDecoder):
array_size = None
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.is_dynamic = self.item_decoder.is_dynamic
@to_tuple
def decode(self, stream):
for _... |
class SizedArrayDecoder(BaseArrayDecoder):
def __init__(self, **kwargs):
pass
@to_tuple
def decode(self, stream):
pass | 4 | 0 | 4 | 1 | 3 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 2 | 1 | 2 | 30 | 12 | 3 | 9 | 7 | 5 | 0 | 8 | 6 | 5 | 2 | 5 | 1 | 3 |
12,305 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/decoding.py | ccxt.static_dependencies.ethereum.abi.decoding.StringDecoder | from .exceptions import DecodingError, InsufficientDataBytes, NonEmptyPaddingBytes
from .base import BaseCoder, parse_tuple_type_str, parse_type_str
class StringDecoder(ByteStringDecoder):
@parse_type_str('string')
def from_type_str(cls, abi_type, registry):
return cls()
@staticmethod
def dec... |
class StringDecoder(ByteStringDecoder):
@parse_type_str('string')
def from_type_str(cls, abi_type, registry):
pass
@staticmethod
def decoder_fn(data):
pass | 5 | 0 | 9 | 0 | 9 | 0 | 2 | 0 | 1 | 2 | 1 | 0 | 1 | 0 | 2 | 36 | 22 | 1 | 21 | 7 | 16 | 0 | 9 | 4 | 6 | 2 | 6 | 1 | 3 |
12,306 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/decoding.py | ccxt.static_dependencies.ethereum.abi.decoding.TupleDecoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
from ..utils import big_endian_to_int, to_normalized_address, to_tuple
class TupleDecoder(BaseDecoder):
decoders = None
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.decoders = tuple((HeadTailDecoder(tail_decoder... |
class TupleDecoder(BaseDecoder):
def __init__(self, **kwargs):
pass
def validate(self):
pass
@to_tuple
def decode(self, stream):
pass
@parse_tuple_type_str
def from_type_str(cls, abi_type, registry):
pass | 7 | 0 | 6 | 1 | 5 | 0 | 2 | 0 | 1 | 4 | 1 | 0 | 4 | 1 | 4 | 29 | 31 | 8 | 23 | 11 | 16 | 0 | 16 | 9 | 11 | 2 | 4 | 1 | 7 |
12,307 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/decoding.py | ccxt.static_dependencies.ethereum.abi.decoding.UnsignedFixedDecoder | import decimal
from .base import BaseCoder, parse_tuple_type_str, parse_type_str
from .utils.numeric import TEN, abi_decimal_context, ceil32
from ..utils import big_endian_to_int, to_normalized_address, to_tuple
class UnsignedFixedDecoder(BaseFixedDecoder):
def decoder_fn(self, data):
value = big_endian_t... |
class UnsignedFixedDecoder(BaseFixedDecoder):
def decoder_fn(self, data):
pass
@parse_type_str('ufixed')
def from_type_str(cls, abi_type, registry):
pass | 4 | 0 | 6 | 2 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 38 | 14 | 4 | 10 | 7 | 6 | 0 | 9 | 6 | 6 | 1 | 8 | 1 | 2 |
12,308 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/decoding.py | ccxt.static_dependencies.ethereum.abi.decoding.UnsignedIntegerDecoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
from ..utils import big_endian_to_int, to_normalized_address, to_tuple
class UnsignedIntegerDecoder(Fixed32ByteSizeDecoder):
decoder_fn = staticmethod(big_endian_to_int)
is_big_endian = True
@parse_type_str('uint')
def from_type_str(cls... |
class UnsignedIntegerDecoder(Fixed32ByteSizeDecoder):
@parse_type_str('uint')
def from_type_str(cls, abi_type, registry):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 36 | 7 | 1 | 6 | 5 | 3 | 0 | 5 | 4 | 3 | 1 | 7 | 0 | 1 |
12,309 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.AddressEncoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes, is_integer, is_list_like, is_number, is_text, to_canonical_address
class AddressEncoder(Fixed32ByteSizeEncoder):
value_bit_size = 20 * 8
encode_fn = staticmethod(to_canonic... |
class AddressEncoder(Fixed32ByteSizeEncoder):
@classmethod
def validate_value(cls, value):
pass
def validate_value(cls, value):
pass
@parse_type_str('address')
def from_type_str(cls, abi_type, registry):
pass | 6 | 0 | 3 | 0 | 3 | 0 | 2 | 0 | 1 | 2 | 0 | 1 | 2 | 0 | 3 | 33 | 19 | 4 | 15 | 9 | 9 | 0 | 13 | 7 | 9 | 2 | 6 | 1 | 5 |
12,310 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.BaseArrayEncoder | from itertools import accumulate
from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes, is_integer, is_list_like, is_number, is_text, to_canonical_address
from .base import BaseCoder, parse_tuple_type_str, parse_type_str
class BaseArrayEncoder(BaseEncoder):
item_encoder = None
def validate(s... |
class BaseArrayEncoder(BaseEncoder):
def validate(self):
pass
def validate_value(self, value):
pass
def encode_elements(self, value):
pass
@parse_type_str(with_arrlist=True)
def from_type_str(cls, abi_type, registry):
pass | 6 | 0 | 11 | 2 | 9 | 1 | 2 | 0.05 | 1 | 6 | 2 | 3 | 4 | 0 | 4 | 31 | 50 | 10 | 38 | 16 | 32 | 2 | 28 | 15 | 23 | 3 | 4 | 1 | 9 |
12,311 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.BaseEncoder | from .exceptions import EncodingTypeError, IllegalValue, ValueOutOfBounds
from typing import Any, Optional, Type
from .base import BaseCoder, parse_tuple_type_str, parse_type_str
from .utils.string import abbr
import abc
class BaseEncoder(BaseCoder, metaclass=abc.ABCMeta):
"""
Base class for all encoder classe... |
class BaseEncoder(BaseCoder, metaclass=abc.ABCMeta):
'''
Base class for all encoder classes. Subclass this if you want to define a
custom encoder class. Subclasses must also implement
:any:`BaseCoder.from_type_str`.
'''
@abc.abstractmethod
def encode(self, value: Any) -> bytes:
''... | 8 | 4 | 8 | 0 | 5 | 4 | 1 | 0.83 | 2 | 5 | 1 | 5 | 3 | 0 | 4 | 27 | 46 | 4 | 24 | 13 | 11 | 20 | 9 | 5 | 4 | 2 | 3 | 0 | 5 |
12,312 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.BaseFixedEncoder | from .exceptions import EncodingTypeError, IllegalValue, ValueOutOfBounds
import decimal
from .utils.numeric import TEN, abi_decimal_context, ceil32, compute_signed_fixed_bounds, compute_signed_integer_bounds, compute_unsigned_fixed_bounds, compute_unsigned_integer_bounds
from ..utils import int_to_big_endian, is_addre... |
class BaseFixedEncoder(NumberEncoder):
@staticmethod
def type_check_fn(value):
pass
@staticmethod
def illegal_value_fn(value):
pass
def validate_value(self, value):
pass
def validate_value(self, value):
pass | 7 | 0 | 8 | 1 | 6 | 0 | 2 | 0 | 1 | 5 | 1 | 2 | 2 | 0 | 4 | 36 | 38 | 9 | 29 | 9 | 22 | 0 | 20 | 7 | 15 | 3 | 7 | 1 | 8 |
12,313 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.BooleanEncoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes, is_integer, is_list_like, is_number, is_text, to_canonical_address
class BooleanEncoder(Fixed32ByteSizeEncoder):
value_bit_size = 8
is_big_endian = True
@classmethod
... |
class BooleanEncoder(Fixed32ByteSizeEncoder):
@classmethod
def validate_value(cls, value):
pass
@classmethod
def encode_fn(cls, value):
pass
@parse_type_str('bool')
def from_type_str(cls, abi_type, registry):
pass | 7 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 3 | 33 | 21 | 3 | 18 | 9 | 11 | 0 | 13 | 6 | 9 | 3 | 6 | 1 | 6 |
12,314 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.ByteStringEncoder | from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes, is_integer, is_list_like, is_number, is_text, to_canonical_address
from .utils.numeric import TEN, abi_decimal_context, ceil32, compute_signed_fixed_bounds, compute_signed_integer_bounds, compute_unsigned_fixed_bounds, compute_unsigned_integer_bou... |
class ByteStringEncoder(BaseEncoder):
@classmethod
def validate_value(cls, value):
pass
@classmethod
def encode(cls, value):
pass
@parse_type_str('bytes')
def from_type_str(cls, abi_type, registry):
pass | 7 | 0 | 6 | 1 | 5 | 0 | 2 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 3 | 30 | 25 | 6 | 19 | 11 | 12 | 0 | 15 | 8 | 11 | 2 | 4 | 1 | 5 |
12,315 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.BytesEncoder | from .exceptions import EncodingTypeError, IllegalValue, ValueOutOfBounds
from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes, is_integer, is_list_like, is_number, is_text, to_canonical_address
from .base import BaseCoder, parse_tuple_type_str, parse_type_str
class BytesEncoder(Fixed32ByteSizeEncod... |
class BytesEncoder(Fixed32ByteSizeEncoder):
def validate_value(self, value):
pass
@staticmethod
def encode_fn(value):
pass
@parse_type_str('bytes')
def from_type_str(cls, abi_type, registry):
pass | 6 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 1 | 1 | 1 | 1 | 2 | 0 | 3 | 33 | 22 | 4 | 18 | 8 | 12 | 0 | 12 | 6 | 8 | 3 | 6 | 1 | 5 |
12,316 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.FixedSizeEncoder | from .utils.padding import fpad, zpad, zpad_right
class FixedSizeEncoder(BaseEncoder):
value_bit_size = None
data_byte_size = None
encode_fn = None
type_check_fn = None
is_big_endian = None
def validate(self):
super().validate()
if self.value_bit_size is None:
raise... |
class FixedSizeEncoder(BaseEncoder):
def validate(self):
pass
def validate_value(self, value):
pass
def encode(self, value):
pass | 4 | 0 | 11 | 2 | 9 | 0 | 3 | 0 | 1 | 3 | 0 | 1 | 3 | 0 | 3 | 30 | 42 | 8 | 34 | 11 | 30 | 0 | 29 | 11 | 25 | 7 | 4 | 1 | 10 |
12,317 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.NumberEncoder | from .exceptions import EncodingTypeError, IllegalValue, ValueOutOfBounds
class NumberEncoder(Fixed32ByteSizeEncoder):
is_big_endian = True
bounds_fn = None
illegal_value_fn = None
type_check_fn = None
def validate(self):
super().validate()
if self.bounds_fn is None:
ra... |
class NumberEncoder(Fixed32ByteSizeEncoder):
def validate(self):
pass
def validate_value(self, value):
pass | 3 | 0 | 16 | 2 | 14 | 0 | 4 | 0 | 1 | 4 | 2 | 3 | 2 | 0 | 2 | 32 | 38 | 5 | 33 | 9 | 30 | 0 | 20 | 9 | 17 | 4 | 6 | 1 | 7 |
12,318 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.PackedArrayEncoder | from .exceptions import EncodingTypeError, IllegalValue, ValueOutOfBounds
from .base import BaseCoder, parse_tuple_type_str, parse_type_str
class PackedArrayEncoder(BaseArrayEncoder):
array_size = None
def validate_value(self, value):
super().validate_value(value)
if self.array_size is not Non... |
class PackedArrayEncoder(BaseArrayEncoder):
def validate_value(self, value):
pass
def encode(self, value):
pass
@parse_type_str(with_arrlist=True)
def from_type_str(cls, abi_type, registry):
pass | 5 | 0 | 9 | 1 | 8 | 0 | 2 | 0 | 1 | 2 | 1 | 0 | 3 | 0 | 3 | 34 | 33 | 6 | 27 | 9 | 22 | 0 | 15 | 8 | 11 | 2 | 5 | 1 | 5 |
12,319 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.PackedBytesEncoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
class PackedBytesEncoder(BytesEncoder):
@parse_type_str('bytes')
def from_type_str(cls, abi_type, registry):
return cls(value_bit_size=abi_type.sub * 8, data_byte_size=abi_type.sub) |
class PackedBytesEncoder(BytesEncoder):
@parse_type_str('bytes')
def from_type_str(cls, abi_type, registry):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 34 | 7 | 0 | 7 | 3 | 4 | 0 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
12,320 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.PackedSignedFixedEncoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
class PackedSignedFixedEncoder(SignedFixedEncoder):
@parse_type_str('fixed')
def from_type_str(cls, abi_type, registry):
value_bit_size, frac_places = abi_type.sub
return cls(value_bit_size=value_bit_size, data_byte_size=value_b... |
class PackedSignedFixedEncoder(SignedFixedEncoder):
@parse_type_str('fixed')
def from_type_str(cls, abi_type, registry):
pass | 3 | 0 | 8 | 1 | 7 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 10 | 1 | 9 | 4 | 6 | 0 | 4 | 3 | 2 | 1 | 9 | 0 | 1 |
12,321 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.PackedSignedIntegerEncoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
class PackedSignedIntegerEncoder(SignedIntegerEncoder):
@parse_type_str('int')
def from_type_str(cls, abi_type, registry):
return cls(value_bit_size=abi_type.sub, data_byte_size=abi_type.sub // 8) |
class PackedSignedIntegerEncoder(SignedIntegerEncoder):
@parse_type_str('int')
def from_type_str(cls, abi_type, registry):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 36 | 7 | 0 | 7 | 3 | 4 | 0 | 3 | 2 | 1 | 1 | 8 | 0 | 1 |
12,322 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.PackedUnsignedFixedEncoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
class PackedUnsignedFixedEncoder(UnsignedFixedEncoder):
@parse_type_str('ufixed')
def from_type_str(cls, abi_type, registry):
value_bit_size, frac_places = abi_type.sub
return cls(value_bit_size=value_bit_size, data_byte_size=va... |
class PackedUnsignedFixedEncoder(UnsignedFixedEncoder):
@parse_type_str('ufixed')
def from_type_str(cls, abi_type, registry):
pass | 3 | 0 | 8 | 1 | 7 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 10 | 1 | 9 | 4 | 6 | 0 | 4 | 3 | 2 | 1 | 9 | 0 | 1 |
12,323 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.PackedUnsignedIntegerEncoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
class PackedUnsignedIntegerEncoder(UnsignedIntegerEncoder):
@parse_type_str('uint')
def from_type_str(cls, abi_type, registry):
return cls(value_bit_size=abi_type.sub, data_byte_size=abi_type.sub // 8) |
class PackedUnsignedIntegerEncoder(UnsignedIntegerEncoder):
@parse_type_str('uint')
def from_type_str(cls, abi_type, registry):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 34 | 7 | 0 | 7 | 3 | 4 | 0 | 3 | 2 | 1 | 1 | 8 | 0 | 1 |
12,324 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.SignedFixedEncoder | from .utils.numeric import TEN, abi_decimal_context, ceil32, compute_signed_fixed_bounds, compute_signed_integer_bounds, compute_unsigned_fixed_bounds, compute_unsigned_integer_bounds
from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes, is_integer, is_list_like, is_number, is_text, to_canonical_addr... |
class SignedFixedEncoder(BaseFixedEncoder):
def bounds_fn(self, value_bit_size):
pass
def encode_fn(self, value):
pass
def encode_fn(self, value):
pass
@parse_type_str('fixed')
def from_type_str(cls, abi_type, registry):
pass | 6 | 0 | 7 | 1 | 6 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 4 | 0 | 4 | 40 | 32 | 8 | 24 | 12 | 18 | 0 | 19 | 11 | 14 | 2 | 8 | 1 | 5 |
12,325 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.SignedIntegerEncoder | from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes, is_integer, is_list_like, is_number, is_text, to_canonical_address
from .utils.numeric import TEN, abi_decimal_context, ceil32, compute_signed_fixed_bounds, compute_signed_integer_bounds, compute_unsigned_fixed_bounds, compute_unsigned_integer_bou... |
class SignedIntegerEncoder(NumberEncoder):
def encode_fn(self, value):
pass
def encode_fn(self, value):
pass
@parse_type_str('int')
def from_type_str(cls, abi_type, registry):
pass | 5 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 3 | 0 | 3 | 35 | 21 | 5 | 16 | 9 | 11 | 0 | 14 | 8 | 10 | 2 | 7 | 1 | 4 |
12,326 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.SizedArrayEncoder | from .exceptions import EncodingTypeError, IllegalValue, ValueOutOfBounds
class SizedArrayEncoder(BaseArrayEncoder):
array_size = None
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.is_dynamic = self.item_encoder.is_dynamic
def validate(self):
super().validate()
... |
class SizedArrayEncoder(BaseArrayEncoder):
def __init__(self, **kwargs):
pass
def validate(self):
pass
def validate_value(self, value):
pass
def encode(self, value):
pass | 5 | 0 | 6 | 1 | 5 | 0 | 2 | 0 | 1 | 3 | 1 | 0 | 4 | 1 | 4 | 35 | 31 | 8 | 23 | 8 | 18 | 0 | 16 | 8 | 11 | 2 | 5 | 1 | 6 |
12,327 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.TextStringEncoder | import codecs
from .utils.padding import fpad, zpad, zpad_right
from .utils.numeric import TEN, abi_decimal_context, ceil32, compute_signed_fixed_bounds, compute_signed_integer_bounds, compute_unsigned_fixed_bounds, compute_unsigned_integer_bounds
from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes,... |
class TextStringEncoder(BaseEncoder):
@classmethod
def validate_value(cls, value):
pass
@classmethod
def encode(cls, value):
pass
@parse_type_str('string')
def from_type_str(cls, abi_type, registry):
pass | 7 | 0 | 6 | 1 | 5 | 0 | 2 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 3 | 30 | 27 | 7 | 20 | 12 | 13 | 0 | 16 | 9 | 12 | 2 | 4 | 1 | 5 |
12,328 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.TupleEncoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
from itertools import accumulate
from .exceptions import EncodingTypeError, IllegalValue, ValueOutOfBounds
from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes, is_integer, is_list_like, is_number, is_text, to_canonical_address
class ... |
class TupleEncoder(BaseEncoder):
def __init__(self, **kwargs):
pass
def validate(self):
pass
def validate_value(self, value):
pass
def encode(self, values):
pass
@parse_tuple_type_str
def from_type_str(cls, abi_type, registry):
pass | 7 | 0 | 12 | 2 | 10 | 0 | 3 | 0 | 1 | 7 | 1 | 0 | 5 | 1 | 5 | 32 | 68 | 14 | 54 | 18 | 47 | 0 | 37 | 17 | 31 | 5 | 4 | 2 | 14 |
12,329 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.UnsignedFixedEncoder | from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes, is_integer, is_list_like, is_number, is_text, to_canonical_address
import decimal
from .utils.numeric import TEN, abi_decimal_context, ceil32, compute_signed_fixed_bounds, compute_signed_integer_bounds, compute_unsigned_fixed_bounds, compute_unsig... |
class UnsignedFixedEncoder(BaseFixedEncoder):
def bounds_fn(self, value_bit_size):
pass
def encode_fn(self, value):
pass
@parse_type_str('ufixed')
def from_type_str(cls, abi_type, registry):
pass | 5 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 3 | 0 | 3 | 39 | 19 | 4 | 15 | 8 | 10 | 0 | 11 | 7 | 7 | 1 | 8 | 1 | 3 |
12,330 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/encoding.py | ccxt.static_dependencies.ethereum.abi.encoding.UnsignedIntegerEncoder | from .base import BaseCoder, parse_tuple_type_str, parse_type_str
from ..utils import int_to_big_endian, is_address, is_boolean, is_bytes, is_integer, is_list_like, is_number, is_text, to_canonical_address
from .utils.numeric import TEN, abi_decimal_context, ceil32, compute_signed_fixed_bounds, compute_signed_integer_b... |
class UnsignedIntegerEncoder(NumberEncoder):
@parse_type_str('uint')
def from_type_str(cls, abi_type, registry):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 33 | 8 | 1 | 7 | 6 | 4 | 0 | 6 | 5 | 4 | 1 | 7 | 0 | 1 |
12,331 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.ABITypeError | class ABITypeError(ValueError):
"""
Raised when a parsed ABI type has inconsistent properties; for example,
when trying to parse the type string ``'uint7'`` (which has a bit-width
that is not congruent with zero modulo eight).
"""
pass | class ABITypeError(ValueError):
'''
Raised when a parsed ABI type has inconsistent properties; for example,
when trying to parse the type string ``'uint7'`` (which has a bit-width
that is not congruent with zero modulo eight).
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 8 | 1 | 2 | 1 | 1 | 5 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,332 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.DecodingError | class DecodingError(Exception):
"""
Base exception for any error that occurs during decoding.
"""
pass | class DecodingError(Exception):
'''
Base exception for any error that occurs during decoding.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 10 | 6 | 1 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
12,333 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.EncodingError | class EncodingError(Exception):
"""
Base exception for any error that occurs during encoding.
"""
pass | class EncodingError(Exception):
'''
Base exception for any error that occurs during encoding.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 10 | 6 | 1 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
12,334 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.EncodingTypeError | class EncodingTypeError(EncodingError):
"""
Raised when trying to encode a python value whose type is not supported for
the output ABI type.
"""
pass | class EncodingTypeError(EncodingError):
'''
Raised when trying to encode a python value whose type is not supported for
the output ABI type.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 7 | 1 | 2 | 1 | 1 | 4 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,335 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.IllegalValue | class IllegalValue(EncodingError):
"""
Raised when trying to encode a python value with the correct type but with
a value that is not considered legal for the output ABI type.
Example:
.. code-block:: python
fixed128x19_encoder(Decimal('NaN')) # cannot encode NaN
"""
pass | class IllegalValue(EncodingError):
'''
Raised when trying to encode a python value with the correct type but with
a value that is not considered legal for the output ABI type.
Example:
.. code-block:: python
fixed128x19_encoder(Decimal('NaN')) # cannot encode NaN
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3.5 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 10 | 14 | 5 | 2 | 1 | 1 | 7 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,336 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.InsufficientDataBytes | class InsufficientDataBytes(DecodingError):
"""
Raised when there are insufficient data to decode a value for a given ABI
type.
"""
pass | class InsufficientDataBytes(DecodingError):
'''
Raised when there are insufficient data to decode a value for a given ABI
type.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 7 | 1 | 2 | 1 | 1 | 4 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,337 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.MultipleEntriesFound | class MultipleEntriesFound(ValueError, PredicateMappingError):
"""
Raised when multiple registrations are found for a type string in a
registry's internal mapping. This error is non-recoverable and indicates
that a registry was configured incorrectly. Registrations are expected to
cover completely... | class MultipleEntriesFound(ValueError, PredicateMappingError):
'''
Raised when multiple registrations are found for a type string in a
registry's internal mapping. This error is non-recoverable and indicates
that a registry was configured incorrectly. Registrations are expected to
cover completely... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4.5 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 14 | 3 | 2 | 1 | 1 | 9 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,338 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.NoEntriesFound | class NoEntriesFound(ValueError, PredicateMappingError):
"""
Raised when no registration is found for a type string in a registry's
internal mapping.
.. warning::
In a future version of ``eth-abi``, this error class will no longer
inherit from ``ValueError``.
"""
pass | class NoEntriesFound(ValueError, PredicateMappingError):
'''
Raised when no registration is found for a type string in a registry's
internal mapping.
.. warning::
In a future version of ``eth-abi``, this error class will no longer
inherit from ``ValueError``.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3.5 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 12 | 3 | 2 | 1 | 1 | 7 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,339 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.NonEmptyPaddingBytes | class NonEmptyPaddingBytes(DecodingError):
"""
Raised when the padding bytes of an ABI value are malformed.
"""
pass | class NonEmptyPaddingBytes(DecodingError):
'''
Raised when the padding bytes of an ABI value are malformed.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 6 | 1 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,340 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.ParseError | from ...parsimonious import ParseError
class ParseError(ParseError):
"""
Raised when an ABI type string cannot be parsed.
"""
def __str__(self):
return "Parse error at '{}' (column {}) in type string '{}'".format(self.text[self.pos:self.pos + 5], self.column(), self.text) |
class ParseError(ParseError):
'''
Raised when an ABI type string cannot be parsed.
'''
def __str__(self):
pass | 2 | 1 | 6 | 0 | 6 | 0 | 1 | 0.43 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 16 | 11 | 1 | 7 | 2 | 5 | 3 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
12,341 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.PredicateMappingError | class PredicateMappingError(Exception):
"""
Raised when an error occurs in a registry's internal mapping.
"""
pass | class PredicateMappingError(Exception):
'''
Raised when an error occurs in a registry's internal mapping.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 10 | 6 | 1 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
12,342 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/exceptions.py | ccxt.static_dependencies.ethereum.abi.exceptions.ValueOutOfBounds | class ValueOutOfBounds(IllegalValue):
"""
Raised when trying to encode a python value with the correct type but with
a value that appears outside the range of valid values for the output ABI
type.
Example:
.. code-block:: python
ufixed8x1_encoder(Decimal('25.6')) # out of bounds
... | class ValueOutOfBounds(IllegalValue):
'''
Raised when trying to encode a python value with the correct type but with
a value that appears outside the range of valid values for the output ABI
type.
Example:
.. code-block:: python
ufixed8x1_encoder(Decimal('25.6')) # out of bounds
'''... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 15 | 5 | 2 | 1 | 1 | 8 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
12,343 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/grammar.py | ccxt.static_dependencies.ethereum.abi.grammar.ABIType | from .exceptions import ABITypeError, ParseError
class ABIType:
"""
Base class for results of type string parsing operations.
"""
__slots__ = ('arrlist', 'node')
def __init__(self, arrlist=None, node=None):
self.arrlist = arrlist
'\n The list of array dimensions for a parsed... |
class ABIType:
'''
Base class for results of type string parsing operations.
'''
def __init__(self, arrlist=None, node=None):
pass
def __repr__(self):
pass
def __eq__(self, other):
pass
def to_type_str(self):
'''
Returns the string representat... | 15 | 6 | 7 | 0 | 3 | 4 | 1 | 1 | 0 | 3 | 1 | 2 | 10 | 2 | 10 | 10 | 90 | 15 | 39 | 19 | 24 | 39 | 24 | 15 | 13 | 1 | 0 | 0 | 10 |
12,344 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/grammar.py | ccxt.static_dependencies.ethereum.abi.grammar.BasicType | class BasicType(ABIType):
"""
Represents the result of parsing a basic type string e.g. "uint", "address",
"ufixed128x19[][2]".
"""
__slots__ = ('base', 'sub')
def __init__(self, base, sub=None, arrlist=None, *, node=None):
super().__init__(arrlist, node)
self.base = base
... | class BasicType(ABIType):
'''
Represents the result of parsing a basic type string e.g. "uint", "address",
"ufixed128x19[][2]".
'''
def __init__(self, base, sub=None, arrlist=None, *, node=None):
pass
def to_type_str(self):
pass
@property
def item_type(self):
pa... | 8 | 1 | 23 | 4 | 16 | 2 | 6 | 0.19 | 1 | 7 | 0 | 0 | 5 | 2 | 5 | 15 | 128 | 28 | 84 | 14 | 76 | 16 | 56 | 12 | 50 | 19 | 1 | 2 | 30 |
12,345 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/grammar.py | ccxt.static_dependencies.ethereum.abi.grammar.NodeVisitor | from ...parsimonious import expressions, ParseError, NodeVisitor, Grammar
import functools
from .exceptions import ABITypeError, ParseError
class NodeVisitor(NodeVisitor):
"""
Parsimonious node visitor which performs both parsing of type strings and
post-processing of parse trees. Parsing operations are c... |
class NodeVisitor(NodeVisitor):
'''
Parsimonious node visitor which performs both parsing of type strings and
post-processing of parse trees. Parsing operations are cached.
'''
def visit_non_zero_tuple(self, node, visited_children):
pass
def visit_tuple_type(self, node, visited_child... | 14 | 2 | 6 | 1 | 4 | 1 | 1 | 0.39 | 1 | 10 | 5 | 0 | 12 | 0 | 12 | 32 | 87 | 23 | 46 | 22 | 32 | 18 | 43 | 20 | 30 | 4 | 4 | 2 | 17 |
12,346 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/grammar.py | ccxt.static_dependencies.ethereum.abi.grammar.TupleType | class TupleType(ABIType):
"""
Represents the result of parsing a tuple type string e.g. "(int,bool)".
"""
__slots__ = ('components',)
def __init__(self, components, arrlist=None, *, node=None):
super().__init__(arrlist, node)
self.components = components
"\n A tuple o... | class TupleType(ABIType):
'''
Represents the result of parsing a tuple type string e.g. "(int,bool)".
'''
def __init__(self, components, arrlist=None, *, node=None):
pass
def to_type_str(self):
pass
@property
def item_type(self):
pass
def validate(self):
... | 8 | 1 | 8 | 1 | 6 | 1 | 2 | 0.19 | 1 | 5 | 0 | 0 | 5 | 1 | 5 | 15 | 54 | 11 | 36 | 12 | 28 | 7 | 22 | 10 | 16 | 2 | 1 | 1 | 9 |
12,347 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/registry.py | ccxt.static_dependencies.ethereum.abi.registry.ABIRegistry | from .base import BaseCoder
from .exceptions import ABITypeError, MultipleEntriesFound, NoEntriesFound
from ..typing import abi
import functools
import copy
class ABIRegistry(Copyable, BaseRegistry):
def __init__(self):
self._encoders = PredicateMapping('encoder registry')
self._decoders = Predica... |
class ABIRegistry(Copyable, BaseRegistry):
def __init__(self):
pass
def _get_registration(self, mapping, type_str):
pass
@_clear_encoder_cache
def register_encoder(self, lookup: Lookup, encoder: Encoder, label: str=None) -> None:
'''
Registers the given ``encoder`` und... | 19 | 8 | 11 | 1 | 4 | 6 | 1 | 1.45 | 2 | 7 | 4 | 0 | 12 | 2 | 12 | 38 | 144 | 19 | 51 | 29 | 26 | 74 | 39 | 17 | 26 | 2 | 5 | 1 | 14 |
12,348 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/registry.py | ccxt.static_dependencies.ethereum.abi.registry.BaseEquals | from . import decoding, encoding, exceptions, grammar
class BaseEquals(Predicate):
"""
A predicate that matches a basic type string with a base component equal to
`value` and no array component. If `with_sub` is `True`, the type string
must have a sub component to match. If `with_sub` is `False`, the... |
class BaseEquals(Predicate):
'''
A predicate that matches a basic type string with a base component equal to
`value` and no array component. If `with_sub` is `True`, the type string
must have a sub component to match. If `with_sub` is `False`, the type
string must *not* have a sub component to ma... | 4 | 1 | 10 | 1 | 8 | 1 | 4 | 0.33 | 1 | 2 | 2 | 0 | 3 | 2 | 3 | 9 | 44 | 8 | 27 | 8 | 23 | 9 | 22 | 8 | 18 | 7 | 1 | 3 | 11 |
12,349 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/registry.py | ccxt.static_dependencies.ethereum.abi.registry.BaseRegistry | from . import decoding, encoding, exceptions, grammar
class BaseRegistry:
@staticmethod
def _register(mapping, lookup, value, label=None):
if callable(lookup):
mapping.add(lookup, value, label)
return
if isinstance(lookup, str):
mapping.add(Equals(lookup), v... |
class BaseRegistry:
@staticmethod
def _register(mapping, lookup, value, label=None):
pass
@staticmethod
def _unregister(mapping, lookup_or_label):
pass
@staticmethod
def _get_registration(mapping, type_str):
pass | 7 | 0 | 13 | 2 | 11 | 1 | 3 | 0.06 | 0 | 4 | 1 | 2 | 0 | 0 | 3 | 3 | 46 | 8 | 36 | 9 | 29 | 2 | 25 | 5 | 21 | 3 | 0 | 2 | 9 |
12,350 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/registry.py | ccxt.static_dependencies.ethereum.abi.registry.Equals | class Equals(Predicate):
"""
A predicate that matches any input equal to `value`.
"""
__slots__ = ('value',)
def __init__(self, value):
self.value = value
def __call__(self, other):
return self.value == other
def __str__(self):
return '(== {})'.format(repr(self.val... | class Equals(Predicate):
'''
A predicate that matches any input equal to `value`.
'''
def __init__(self, value):
pass
def __call__(self, other):
pass
def __str__(self):
pass | 4 | 1 | 2 | 0 | 2 | 0 | 1 | 0.38 | 1 | 0 | 0 | 0 | 3 | 1 | 3 | 9 | 15 | 4 | 8 | 6 | 4 | 3 | 8 | 6 | 4 | 1 | 1 | 0 | 3 |
12,351 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/registry.py | ccxt.static_dependencies.ethereum.abi.registry.Predicate | class Predicate:
"""
Represents a predicate function to be used for type matching in
``ABIRegistry``.
"""
__slots__ = tuple()
def __call__(self, *args, **kwargs):
raise NotImplementedError('Must implement `__call__`')
def __str__(self):
raise NotImplementedError('Must imple... | class Predicate:
'''
Represents a predicate function to be used for type matching in
``ABIRegistry``.
'''
def __call__(self, *args, **kwargs):
pass
def __str__(self):
pass
def __repr__(self):
pass
def __iter__(self):
pass
def __hash__(self):
... | 7 | 1 | 2 | 0 | 2 | 0 | 1 | 0.4 | 0 | 3 | 0 | 2 | 6 | 0 | 6 | 6 | 26 | 7 | 15 | 9 | 8 | 6 | 15 | 9 | 8 | 2 | 0 | 1 | 7 |
12,352 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/registry.py | ccxt.static_dependencies.ethereum.abi.registry.PredicateMapping | import copy
from .exceptions import ABITypeError, MultipleEntriesFound, NoEntriesFound
class PredicateMapping(Copyable):
"""
Acts as a mapping from predicate functions to values. Values are retrieved
when their corresponding predicate matches a given input. Predicates can
also be labeled to facilitat... |
class PredicateMapping(Copyable):
'''
Acts as a mapping from predicate functions to values. Values are retrieved
when their corresponding predicate matches a given input. Predicates can
also be labeled to facilitate removal from the mapping.
'''
def __init__(self, name):
pass
de... | 9 | 1 | 14 | 2 | 12 | 1 | 3 | 0.09 | 1 | 9 | 2 | 0 | 8 | 3 | 8 | 31 | 127 | 20 | 98 | 19 | 89 | 9 | 55 | 19 | 46 | 4 | 5 | 2 | 20 |
12,353 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/abi/tools/_strategies.py | ccxt.static_dependencies.ethereum.abi.tools._strategies.StrategyRegistry | from ..registry import BaseEquals, BaseRegistry, Lookup, PredicateMapping, has_arrlist, is_base_tuple
from hypothesis import strategies as st
from ..grammar import ABIType, normalize, parse
from ...typing.abi import TypeStr
class StrategyRegistry(BaseRegistry):
def __init__(self):
self._strategies = Predi... |
class StrategyRegistry(BaseRegistry):
def __init__(self):
pass
def register_strategy(self, lookup: Lookup, registration: StrategyRegistration, label: str=None) -> None:
pass
def unregister_strategy(self, lookup_or_label: Lookup) -> None:
pass
def get_strategy(self, type_str:... | 5 | 1 | 8 | 1 | 4 | 3 | 1 | 0.56 | 1 | 2 | 1 | 0 | 4 | 1 | 4 | 7 | 35 | 7 | 18 | 12 | 11 | 10 | 15 | 10 | 10 | 2 | 1 | 1 | 5 |
12,354 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/account/messages.py | ccxt.static_dependencies.ethereum.account.messages.SignableMessage | from typing import Any, Dict, NamedTuple
class SignableMessage(NamedTuple):
"""
A message compatible with EIP-191_ that is ready to be signed.
The properties are components of an EIP-191_ signable message. Other message formats
can be encoded into this format for easy signing. This data structure does... |
class SignableMessage(NamedTuple):
'''
A message compatible with EIP-191_ that is ready to be signed.
The properties are components of an EIP-191_ signable message. Other message formats
can be encoded into this format for easy signing. This data structure doesn't need
to know about the original me... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 5 | 4 | 1 | 3 | 14 | 4 | 1 | 3 | 0 | 1 | 0 | 0 |
12,355 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/hexbytes/main.py | ccxt.static_dependencies.ethereum.hexbytes.main.HexBytes | from ._utils import to_bytes
from typing import TYPE_CHECKING, Type, Union, cast, overload
class HexBytes(bytes):
"""
HexBytes is a *very* thin wrapper around the python built-in :class:`bytes` class.
It has these three changes:
1. Accepts more initializing values, like hex strings, non-negative i... |
class HexBytes(bytes):
'''
HexBytes is a *very* thin wrapper around the python built-in :class:`bytes` class.
It has these three changes:
1. Accepts more initializing values, like hex strings, non-negative integers,
and booleans
2. Returns hex with prefix '0x' from :meth:`HexByte... | 9 | 2 | 4 | 0 | 4 | 1 | 1 | 0.71 | 1 | 5 | 0 | 0 | 6 | 0 | 6 | 63 | 44 | 8 | 24 | 15 | 11 | 17 | 17 | 9 | 10 | 2 | 2 | 1 | 7 |
12,356 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/typing/enums.py | ccxt.static_dependencies.ethereum.typing.enums.ForkName | class ForkName:
Frontier = 'Frontier'
Homestead = 'Homestead'
EIP150 = 'EIP150'
EIP158 = 'EIP158'
Byzantium = 'Byzantium'
Constantinople = 'Constantinople'
Metropolis = 'Metropolis'
ConstantinopleFix = 'ConstantinopleFix'
Istanbul = 'Istanbul'
Berlin = 'Berlin'
London = 'Lond... | class ForkName:
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0 | 17 | 17 | 16 | 0 | 17 | 17 | 16 | 0 | 0 | 0 | 0 |
12,357 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/typing/networks.py | ccxt.static_dependencies.ethereum.typing.networks.ChainId | from enum import IntEnum
class ChainId(IntEnum):
ETH = 1
EXP = 2
ROP = 3
RIN = 4
GOR = 5
KOT = 6
TCH = 7
UBQ = 8
TUBQ = 9
OETH = 10
META = 11
KAL = 12
DSTG = 13
FLR = 14
DIODE = 15
CFLR = 16
TFI = 17
TST = 18
SGB = 19
ESC = 20
ESCT = 2... |
class ChainId(IntEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 1,117 | 0 | 1,117 | 1,117 | 1,116 | 0 | 1,117 | 1,117 | 1,116 | 0 | 3 | 0 | 0 |
12,358 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/utils/currency.py | ccxt.static_dependencies.ethereum.utils.currency.denoms | from .units import units
class denoms:
wei = int(units['wei'])
kwei = int(units['kwei'])
babbage = int(units['babbage'])
femtoether = int(units['femtoether'])
mwei = int(units['mwei'])
lovelace = int(units['lovelace'])
picoether = int(units['picoether'])
gwei = int(units['gwei'])
sh... |
class denoms:
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 0 | 24 | 24 | 23 | 0 | 24 | 24 | 23 | 0 | 0 | 0 | 0 |
12,359 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/utils/decorators.py | ccxt.static_dependencies.ethereum.utils.decorators.combomethod | import functools
from typing import Any, Callable, Dict, Optional, Type, TypeVar
class combomethod:
def __init__(self, method: Callable[..., Any]) -> None:
self.method = method
def __get__(self, obj: Optional[T]=None, objtype: Optional[Type[T]]=None) -> Callable[..., Any]:
@functools.wraps(s... |
class combomethod:
def __init__(self, method: Callable[..., Any]) -> None:
pass
def __get__(self, obj: Optional[T]=None, objtype: Optional[Type[T]]=None) -> Callable[..., Any]:
pass
@functools.wraps(self.method)
def _wrapper(*args: Any, **kwargs: Any) -> Any:
p... | 5 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 15 | 2 | 13 | 8 | 6 | 0 | 9 | 5 | 5 | 2 | 0 | 1 | 4 |
12,360 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/utils/exceptions.py | ccxt.static_dependencies.ethereum.utils.exceptions.ValidationError | class ValidationError(Exception):
"""
Raised when something does not pass a validation check.
""" | class ValidationError(Exception):
'''
Raised when something does not pass a validation check.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 4 | 0 | 1 | 1 | 0 | 3 | 1 | 1 | 0 | 0 | 3 | 0 | 0 |
12,361 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/utils/logging.py | ccxt.static_dependencies.ethereum.utils.logging.ExtendedDebugLogger | from functools import cached_property
import logging
from typing import Any, Dict, Iterator, Tuple, Type, TypeVar, Union, cast
class ExtendedDebugLogger(logging.Logger):
"""
Logging class that can be used for lower level debug logging.
"""
@cached_property
def show_debug2(self) -> bool:
re... |
class ExtendedDebugLogger(logging.Logger):
'''
Logging class that can be used for lower level debug logging.
'''
@cached_property
def show_debug2(self) -> bool:
pass
def debug2(self, message: str, *args: Any, **kwargs: Any) -> None:
pass
def __reduce__(self) -> Tuple[A... | 5 | 1 | 5 | 0 | 3 | 2 | 1 | 0.73 | 1 | 2 | 0 | 0 | 3 | 0 | 3 | 31 | 22 | 3 | 11 | 5 | 6 | 8 | 9 | 4 | 5 | 2 | 3 | 1 | 4 |
12,362 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/utils/logging.py | ccxt.static_dependencies.ethereum.utils.logging.HasExtendedDebugLogger | class HasExtendedDebugLogger(_BaseHasExtendedDebugLogger):
pass | class HasExtendedDebugLogger(_BaseHasExtendedDebugLogger):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 2 | 0 | 0 |
12,363 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/utils/logging.py | ccxt.static_dependencies.ethereum.utils.logging.HasLogger | class HasLogger(_BaseHasLogger):
pass | class HasLogger(_BaseHasLogger):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,364 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/utils/logging.py | ccxt.static_dependencies.ethereum.utils.logging.HasLoggerMeta | import logging
from .toolz import assoc
from typing import Any, Dict, Iterator, Tuple, Type, TypeVar, Union, cast
class HasLoggerMeta(type):
"""
Assigns a logger instance to a class, derived from the import path and name.
This metaclass uses `__qualname__` to identify a unique and meaningful name
to u... |
class HasLoggerMeta(type):
'''
Assigns a logger instance to a class, derived from the import path and name.
This metaclass uses `__qualname__` to identify a unique and meaningful name
to use when creating the associated logger for a given class.
'''
def __new__(mcls: Type[THasLoggerMeta], ... | 6 | 1 | 8 | 1 | 7 | 1 | 2 | 0.28 | 1 | 4 | 0 | 1 | 1 | 0 | 3 | 16 | 39 | 7 | 25 | 17 | 10 | 7 | 14 | 6 | 10 | 3 | 2 | 1 | 5 |
12,365 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/utils/logging.py | ccxt.static_dependencies.ethereum.utils.logging._BaseHasExtendedDebugLogger | class _BaseHasExtendedDebugLogger(metaclass=HasExtendedDebugLoggerMeta):
logger = ExtendedDebugLogger('') | class _BaseHasExtendedDebugLogger(metaclass=HasExtendedDebugLoggerMeta):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2.5 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 | 0 | 2 | 2 | 1 | 5 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
12,366 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/utils/logging.py | ccxt.static_dependencies.ethereum.utils.logging._BaseHasLogger | import logging
class _BaseHasLogger(metaclass=HasLoggerMeta):
logger = logging.Logger('') |
class _BaseHasLogger(metaclass=HasLoggerMeta):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 16 | 5 | 0 | 2 | 2 | 1 | 4 | 2 | 2 | 1 | 0 | 3 | 0 | 0 |
12,367 | ccxt/ccxt | python/ccxt/static_dependencies/ethereum/utils/numeric.py | ccxt.static_dependencies.ethereum.utils.numeric.Comparable | from typing import Any, TypeVar, Union
from abc import ABC, abstractmethod
class Comparable(ABC):
@abstractmethod
def __lt__(self, other: Any) -> bool:
...
@abstractmethod
def __gt__(self, other: Any) -> bool:
... |
class Comparable(ABC):
@abstractmethod
def __lt__(self, other: Any) -> bool:
pass
@abstractmethod
def __gt__(self, other: Any) -> bool:
pass | 5 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 22 | 8 | 1 | 7 | 5 | 2 | 0 | 5 | 3 | 2 | 1 | 4 | 0 | 2 |
12,368 | ccxt/ccxt | python/ccxt/static_dependencies/lark/Lark.py | ccxt.static_dependencies.lark.Lark.Lark | from .utils import Serialize, SerializeMemoizer, FS, logger
import os
import types
from .common import LexerConf, ParserConf, _ParserArgType, _LexerArgType
import getpass
from .exceptions import ConfigurationError, assert_config, UnexpectedInput
import sys
from typing import TypeVar, Type, List, Dict, Iterator, Callabl... |
class Lark(Serialize):
'''Main interface for the library.
It's mostly a thin wrapper for the many different parsers, and for the tree constructor.
Parameters:
grammar: a string or file-object containing the grammar spec (using Lark's ebnf syntax)
options: a dictionary controlling various as... | 21 | 9 | 23 | 3 | 16 | 4 | 4 | 0.28 | 1 | 28 | 16 | 0 | 12 | 6 | 16 | 19 | 411 | 68 | 272 | 67 | 249 | 76 | 228 | 60 | 209 | 46 | 1 | 5 | 71 |
12,369 | ccxt/ccxt | python/ccxt/static_dependencies/lark/Lark.py | ccxt.static_dependencies.lark.Lark.LarkOptions | from .lexer import Lexer, BasicLexer, TerminalDef, LexerThread, Token
from .grammar import Rule
from .common import LexerConf, ParserConf, _ParserArgType, _LexerArgType
from .utils import Serialize, SerializeMemoizer, FS, logger
from typing import TypeVar, Type, List, Dict, Iterator, Callable, Union, Optional, Sequence... |
class LarkOptions(Serialize):
'''Specifies the options for Lark
'''
def __init__(self, options_dict: Dict[str, Any]) -> None:
pass
def __getattr__(self, name: str) -> Any:
pass
def __setattr__(self, name: str, value: str) -> None:
pass
def serialize(self, memo=None) ... | 7 | 1 | 8 | 2 | 6 | 0 | 2 | 0.05 | 1 | 10 | 3 | 0 | 4 | 0 | 5 | 8 | 186 | 26 | 152 | 14 | 145 | 8 | 57 | 12 | 51 | 7 | 1 | 3 | 12 |
12,370 | ccxt/ccxt | python/ccxt/static_dependencies/lark/common.py | ccxt.static_dependencies.lark.common.LexerConf | from types import ModuleType
from .lexer import TerminalDef, Token
from typing import Callable, Collection, Dict, Optional, TYPE_CHECKING, List
from copy import deepcopy
from .utils import Serialize
class LexerConf(Serialize):
__serialize_fields__ = ('terminals', 'ignore', 'g_regex_flags', 'use_bytes', 'lexer_type... |
class LexerConf(Serialize):
def __init__(self, terminals: Collection[TerminalDef], re_module: ModuleType, ignore: Collection[str]=(), postlex:
pass
def _deserialize(self):
pass
def __deepcopy__(self, memo=None):
pass | 4 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 4 | 0 | 0 | 3 | 1 | 3 | 6 | 44 | 4 | 40 | 8 | 35 | 0 | 30 | 7 | 26 | 1 | 1 | 0 | 3 |
12,371 | ccxt/ccxt | python/ccxt/static_dependencies/lark/exceptions.py | ccxt.static_dependencies.lark.exceptions.UnexpectedInput | from typing import Mapping, Iterable, Callable, Union, TypeVar, Tuple, Any, List, Set, Optional, Collection, TYPE_CHECKING
from .utils import logger, NO_VALUE
class UnexpectedInput(LarkError):
"""UnexpectedInput Error.
Used as a base class for the following exceptions:
- ``UnexpectedCharacters``: The lex... |
class UnexpectedInput(LarkError):
'''UnexpectedInput Error.
Used as a base class for the following exceptions:
- ``UnexpectedCharacters``: The lexer encountered an unexpected string
- ``UnexpectedToken``: The parser received an unexpected token
- ``UnexpectedEOF``: The parser expected a token, but ... | 4 | 3 | 29 | 3 | 19 | 7 | 6 | 0.43 | 1 | 7 | 2 | 3 | 3 | 0 | 3 | 13 | 108 | 16 | 65 | 20 | 57 | 28 | 51 | 15 | 47 | 12 | 4 | 7 | 17 |
12,372 | ccxt/ccxt | python/ccxt/static_dependencies/lark/exceptions.py | ccxt.static_dependencies.lark.exceptions.UnexpectedToken | from .utils import logger, NO_VALUE
from typing import Mapping, Iterable, Callable, Union, TypeVar, Tuple, Any, List, Set, Optional, Collection, TYPE_CHECKING
class UnexpectedToken(ParseError, UnexpectedInput):
"""An exception that is raised by the parser, when the token it received
doesn't match any valid ste... |
class UnexpectedToken(ParseError, UnexpectedInput):
'''An exception that is raised by the parser, when the token it received
doesn't match any valid step forward.
Parameters:
token: The mismatched token
expected: The set of expected tokens
considered_rules: Which rules were consider... | 5 | 1 | 9 | 1 | 8 | 1 | 2 | 0.48 | 2 | 2 | 0 | 0 | 3 | 9 | 3 | 16 | 49 | 10 | 27 | 15 | 22 | 13 | 25 | 14 | 21 | 2 | 5 | 1 | 5 |
12,373 | ccxt/ccxt | python/ccxt/static_dependencies/lark/grammar.py | ccxt.static_dependencies.lark.grammar.NonTerminal | from typing import Optional, Tuple, ClassVar, Sequence
class NonTerminal(Symbol):
__serialize_fields__ = ('name',)
is_term: ClassVar[bool] = False |
class NonTerminal(Symbol):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 4 | 1 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 2 | 0 | 0 |
12,374 | ccxt/ccxt | python/ccxt/static_dependencies/lark/grammar.py | ccxt.static_dependencies.lark.grammar.Rule | from typing import Optional, Tuple, ClassVar, Sequence
from .utils import Serialize
class Rule(Serialize):
"""
origin : a symbol
expansion : a list of symbols
order : index of this expansion amongst all rules of the same name
"""
__slots__ = ('origin', 'expansion', 'alias', 'options... |
class Rule(Serialize):
'''
origin : a symbol
expansion : a list of symbols
order : index of this expansion amongst all rules of the same name
'''
def __init__(self, origin: NonTerminal, expansion: Sequence[Symbol], order: int=0, alias: Optional[str]=None, options: Optional[RuleOpti... | 7 | 1 | 3 | 0 | 3 | 0 | 1 | 0.17 | 1 | 6 | 3 | 0 | 6 | 0 | 6 | 9 | 43 | 8 | 30 | 11 | 22 | 5 | 29 | 10 | 22 | 2 | 1 | 1 | 7 |
12,375 | ccxt/ccxt | python/ccxt/static_dependencies/lark/grammar.py | ccxt.static_dependencies.lark.grammar.RuleOptions | from .utils import Serialize
from typing import Optional, Tuple, ClassVar, Sequence
class RuleOptions(Serialize):
__serialize_fields__ = ('keep_all_tokens', 'expand1', 'priority', 'template_source', 'empty_indices')
keep_all_tokens: bool
expand1: bool
priority: Optional[int]
template_source: Option... |
class RuleOptions(Serialize):
def __init__(self, keep_all_tokens: bool=False, expand1: bool=False, priority: Optional[int]=None, template_source: Optional[str]=None, empty_indices: Tuple[bool, ...]=()) -> None:
pass
def __repr__(self):
pass | 3 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 5 | 23 | 3 | 20 | 4 | 17 | 0 | 15 | 4 | 12 | 1 | 1 | 0 | 2 |
12,376 | ccxt/ccxt | python/ccxt/static_dependencies/lark/grammar.py | ccxt.static_dependencies.lark.grammar.Symbol | from .utils import Serialize
from typing import Optional, Tuple, ClassVar, Sequence
class Symbol(Serialize):
__slots__ = ('name',)
name: str
is_term: ClassVar[bool] = NotImplemented
def __init__(self, name: str) -> None:
self.name = name
def __eq__(self, other):
assert isinstance(... |
class Symbol(Serialize):
def __init__(self, name: str) -> None:
pass
def __eq__(self, other):
pass
def __ne__(self, other):
pass
def __hash__(self):
pass
def __repr__(self):
pass
def renamed(self, f):
pass | 7 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 0 | 2 | 6 | 0 | 6 | 9 | 26 | 8 | 18 | 10 | 11 | 0 | 18 | 10 | 11 | 1 | 1 | 0 | 6 |
12,377 | ccxt/ccxt | python/ccxt/static_dependencies/lark/grammar.py | ccxt.static_dependencies.lark.grammar.Terminal | from typing import Optional, Tuple, ClassVar, Sequence
class Terminal(Symbol):
__serialize_fields__ = ('name', 'filter_out')
is_term: ClassVar[bool] = True
def __init__(self, name, filter_out=False):
self.name = name
self.filter_out = filter_out
@property
def fullrepr(self):
... |
class Terminal(Symbol):
def __init__(self, name, filter_out=False):
pass
@property
def fullrepr(self):
pass
def renamed(self, f):
pass | 5 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 3 | 2 | 3 | 12 | 15 | 4 | 11 | 9 | 6 | 0 | 10 | 8 | 6 | 1 | 2 | 0 | 3 |
12,378 | ccxt/ccxt | python/ccxt/static_dependencies/lark/indenter.py | ccxt.static_dependencies.lark.indenter.Indenter | from abc import ABC, abstractmethod
from .lark import PostLex
from typing import List, Iterator
from .lexer import Token
class Indenter(PostLex, ABC):
"""This is a postlexer that "injects" indent/dedent tokens based on indentation.
It keeps track of the current indentation, as well as the current level of par... |
class Indenter(PostLex, ABC):
'''This is a postlexer that "injects" indent/dedent tokens based on indentation.
It keeps track of the current indentation, as well as the current level of parentheses.
Inside parentheses, the indentation is ignored, and no indent/dedent tokens get generated.
Note: This is... | 25 | 7 | 7 | 1 | 5 | 1 | 2 | 0.34 | 2 | 5 | 2 | 1 | 11 | 0 | 11 | 32 | 113 | 23 | 68 | 22 | 43 | 23 | 52 | 15 | 40 | 6 | 5 | 2 | 20 |
12,379 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lark.py | ccxt.static_dependencies.lark.lark.Lark | from .load_grammar import load_grammar, FromPackageLoader, Grammar, verify_used_files, PackageResource, sha256_digest
import sys
from .tree import Tree
from .parse_tree_builder import ParseTreeBuilder
import types
import re
from .common import LexerConf, ParserConf, _ParserArgType, _LexerArgType
from .exceptions import... |
class Lark(Serialize):
'''Main interface for the library.
It's mostly a thin wrapper for the many different parsers, and for the tree constructor.
Parameters:
grammar: a string or file-object containing the grammar spec (using Lark's ebnf syntax)
options: a dictionary controlling various as... | 21 | 9 | 23 | 3 | 16 | 4 | 4 | 0.28 | 1 | 20 | 8 | 0 | 12 | 6 | 16 | 19 | 411 | 68 | 272 | 67 | 249 | 76 | 228 | 60 | 209 | 46 | 1 | 5 | 71 |
12,380 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lark.py | ccxt.static_dependencies.lark.lark.LarkOptions | from .common import LexerConf, ParserConf, _ParserArgType, _LexerArgType
from .utils import Serialize, SerializeMemoizer, FS, logger
from .exceptions import ConfigurationError, assert_config, UnexpectedInput
from .lexer import Lexer, BasicLexer, TerminalDef, LexerThread, Token
from typing import TypeVar, Type, List, Di... |
class LarkOptions(Serialize):
'''Specifies the options for Lark
'''
def __init__(self, options_dict: Dict[str, Any]) -> None:
pass
def __getattr__(self, name: str) -> Any:
pass
def __setattr__(self, name: str, value: str) -> None:
pass
def serialize(self, memo=None) ... | 7 | 1 | 8 | 2 | 6 | 0 | 2 | 0.05 | 1 | 8 | 1 | 0 | 4 | 0 | 5 | 8 | 186 | 26 | 152 | 14 | 145 | 8 | 57 | 12 | 51 | 7 | 1 | 3 | 12 |
12,381 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lark.py | ccxt.static_dependencies.lark.lark.PostLex | from typing import TypeVar, Type, List, Dict, Iterator, Callable, Union, Optional, Sequence, Tuple, Iterable, IO, Any, TYPE_CHECKING, Collection
from abc import ABC, abstractmethod
from .lexer import Lexer, BasicLexer, TerminalDef, LexerThread, Token
class PostLex(ABC):
@abstractmethod
def process(self, strea... |
class PostLex(ABC):
@abstractmethod
def process(self, stream: Iterator[Token]) -> Iterator[Token]:
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 21 | 6 | 1 | 5 | 4 | 2 | 0 | 4 | 3 | 2 | 1 | 4 | 0 | 1 |
12,382 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.AbstractBasicLexer | from abc import abstractmethod, ABC
from contextlib import suppress
from typing import TypeVar, Type, Dict, Iterator, Collection, Callable, Optional, FrozenSet, Any, ClassVar, TYPE_CHECKING, overload
class AbstractBasicLexer(Lexer):
terminals_by_name: Dict[str, TerminalDef]
@abstractmethod
def __init__(se... |
class AbstractBasicLexer(Lexer):
@abstractmethod
def __init__(self, conf: 'LexerConf', comparator=None) -> None:
pass
@abstractmethod
def next_token(self, lex_state: LexerState, parser_state: Any=None) -> Token:
pass
def lex(self, state: LexerState, parser_state: Any) -> Iterator[... | 6 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 5 | 2 | 1 | 3 | 0 | 3 | 25 | 15 | 3 | 12 | 6 | 6 | 0 | 10 | 4 | 6 | 2 | 5 | 2 | 4 |
12,383 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.BasicLexer | from .exceptions import UnexpectedCharacters, LexError, UnexpectedToken
import re
from types import ModuleType
from typing import TypeVar, Type, Dict, Iterator, Collection, Callable, Optional, FrozenSet, Any, ClassVar, TYPE_CHECKING, overload
class BasicLexer(AbstractBasicLexer):
terminals: Collection[TerminalDef]... |
class BasicLexer(AbstractBasicLexer):
def __init__(self, conf: 'LexerConf', comparator=None) -> None:
pass
def _build_scanner(self):
pass
@property
def scanner(self):
pass
def match(self, text, pos):
pass
def next_token(self, lex_state: LexerState, parser_sta... | 7 | 0 | 18 | 3 | 15 | 1 | 5 | 0.05 | 1 | 10 | 5 | 0 | 5 | 5 | 5 | 30 | 105 | 18 | 83 | 23 | 76 | 4 | 78 | 22 | 72 | 9 | 6 | 4 | 24 |
12,384 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.ContextualLexer | from typing import TypeVar, Type, Dict, Iterator, Collection, Callable, Optional, FrozenSet, Any, ClassVar, TYPE_CHECKING, overload
from copy import copy
from .exceptions import UnexpectedCharacters, LexError, UnexpectedToken
class ContextualLexer(Lexer):
lexers: Dict[int, AbstractBasicLexer]
root_lexer: Abstr... |
class ContextualLexer(Lexer):
def __init__(self, conf: 'LexerConf', states: Dict[int, Collection[str]], always_accept: Collection[str]=()) -> None:
pass
def lex(self, lexer_state: LexerState, parser_state: 'ParserState') -> Iterator[Token]:
pass | 3 | 0 | 23 | 2 | 20 | 3 | 5 | 0.12 | 1 | 10 | 3 | 0 | 2 | 0 | 2 | 24 | 52 | 7 | 43 | 17 | 40 | 5 | 42 | 16 | 39 | 5 | 5 | 2 | 9 |
12,385 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.Lexer | from typing import TypeVar, Type, Dict, Iterator, Collection, Callable, Optional, FrozenSet, Any, ClassVar, TYPE_CHECKING, overload
from abc import abstractmethod, ABC
class Lexer(ABC):
"""Lexer interface
Method Signatures:
lex(self, lexer_state, parser_state) -> Iterator[Token]
"""
@abstract... |
class Lexer(ABC):
'''Lexer interface
Method Signatures:
lex(self, lexer_state, parser_state) -> Iterator[Token]
'''
@abstractmethod
def lex(self, lexer_state: LexerState, parser_state: Any) -> Iterator[Token]:
pass
def make_lexer_state(self, text):
'''Deprecated'''
... | 4 | 2 | 3 | 0 | 2 | 1 | 1 | 0.83 | 1 | 3 | 2 | 2 | 2 | 0 | 2 | 22 | 13 | 2 | 6 | 4 | 2 | 5 | 5 | 3 | 2 | 1 | 4 | 0 | 2 |
12,386 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.LexerState | from copy import copy
from typing import TypeVar, Type, Dict, Iterator, Collection, Callable, Optional, FrozenSet, Any, ClassVar, TYPE_CHECKING, overload
class LexerState:
"""Represents the current state of the lexer as it scans the text
(Lexer objects are only instantiated per grammar, not per text)
"""
... |
class LexerState:
'''Represents the current state of the lexer as it scans the text
(Lexer objects are only instantiated per grammar, not per text)
'''
def __init__(self, text: str, line_ctr: Optional[LineCounter]=None, last_token: Optional[Token]=None):
pass
def __eq__(self, other):
... | 4 | 1 | 4 | 0 | 3 | 0 | 2 | 0.2 | 0 | 5 | 2 | 0 | 3 | 0 | 3 | 3 | 24 | 6 | 15 | 5 | 11 | 3 | 15 | 5 | 11 | 2 | 0 | 1 | 5 |
12,387 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.LexerThread | from copy import copy
class LexerThread:
"""A thread that ties a lexer instance and a lexer state, to be used by the parser
"""
def __init__(self, lexer: 'Lexer', lexer_state: LexerState):
self.lexer = lexer
self.state = lexer_state
@classmethod
def from_text(cls, lexer: 'Lexer', ... |
class LexerThread:
'''A thread that ties a lexer instance and a lexer state, to be used by the parser
'''
def __init__(self, lexer: 'Lexer', lexer_state: LexerState):
pass
@classmethod
def from_text(cls, lexer: 'Lexer', text: str) -> 'LexerThread':
pass
def lex(self, parser_st... | 6 | 1 | 2 | 0 | 2 | 0 | 1 | 0.17 | 0 | 3 | 1 | 0 | 3 | 2 | 4 | 4 | 19 | 5 | 12 | 9 | 6 | 2 | 11 | 8 | 6 | 1 | 0 | 0 | 4 |
12,388 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.LineCounter | class LineCounter:
"""A utility class for keeping track of line & column information"""
__slots__ = ('char_pos', 'line', 'column', 'line_start_pos', 'newline_char')
def __init__(self, newline_char):
self.newline_char = newline_char
self.char_pos = 0
self.line = 1
self.column... | class LineCounter:
'''A utility class for keeping track of line & column information'''
def __init__(self, newline_char):
pass
def __eq__(self, other):
pass
def feed(self, token: Token, test_newline=True):
'''Consume a token and calculate the new line & column.
As an o... | 4 | 2 | 8 | 1 | 6 | 1 | 2 | 0.2 | 0 | 1 | 1 | 0 | 3 | 5 | 3 | 3 | 31 | 7 | 20 | 11 | 16 | 4 | 20 | 11 | 16 | 3 | 0 | 2 | 6 |
12,389 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.Pattern | from .utils import classify, get_regexp_width, Serialize, logger
from typing import TypeVar, Type, Dict, Iterator, Collection, Callable, Optional, FrozenSet, Any, ClassVar, TYPE_CHECKING, overload
from abc import abstractmethod, ABC
class Pattern(Serialize, ABC):
"""An abstraction over regular expressions."""
... |
class Pattern(Serialize, ABC):
'''An abstraction over regular expressions.'''
def __init__(self, value: str, flags: Collection[str]=(), raw:
pass
def __repr__(self):
pass
def __hash__(self):
pass
def __eq__(self, other):
pass
@abstractmethod
def to_regexp... | 14 | 1 | 3 | 0 | 3 | 0 | 1 | 0.07 | 2 | 4 | 0 | 2 | 8 | 0 | 8 | 31 | 41 | 9 | 30 | 13 | 16 | 2 | 25 | 10 | 16 | 2 | 4 | 1 | 9 |
12,390 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.PatternRE | from typing import TypeVar, Type, Dict, Iterator, Collection, Callable, Optional, FrozenSet, Any, ClassVar, TYPE_CHECKING, overload
from .utils import classify, get_regexp_width, Serialize, logger
class PatternRE(Pattern):
__serialize_fields__ = ('value', 'flags', 'raw', '_width')
type: ClassVar[str] = 're'
... |
class PatternRE(Pattern):
def to_regexp(self) -> str:
pass
def _get_width(self):
pass
@property
def min_width(self) -> int:
pass
@property
def max_width(self) -> int:
pass | 7 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 4 | 0 | 4 | 35 | 21 | 5 | 16 | 10 | 9 | 0 | 14 | 8 | 9 | 2 | 5 | 1 | 5 |
12,391 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.Scanner | class Scanner:
def __init__(self, terminals, g_regex_flags, re_, use_bytes, match_whole=False):
self.terminals = terminals
self.g_regex_flags = g_regex_flags
self.re_ = re_
self.use_bytes = use_bytes
self.match_whole = match_whole
self.allowed_types = {t.name for t i... | class Scanner:
def __init__(self, terminals, g_regex_flags, re_, use_bytes, match_whole=False):
pass
def _build_mres(self, terminals, max_size):
pass
def match(self, text, pos):
pass | 4 | 0 | 11 | 1 | 9 | 1 | 3 | 0.14 | 0 | 1 | 0 | 0 | 3 | 7 | 3 | 3 | 36 | 5 | 28 | 17 | 24 | 4 | 28 | 17 | 24 | 5 | 0 | 2 | 9 |
12,392 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.TerminalDef | from .utils import classify, get_regexp_width, Serialize, logger
from .grammar import TOKEN_DEFAULT_PRIORITY
class TerminalDef(Serialize):
"""A definition of a terminal"""
__serialize_fields__ = ('name', 'pattern', 'priority')
__serialize_namespace__ = (PatternStr, PatternRE)
name: str
pattern: Pat... |
class TerminalDef(Serialize):
'''A definition of a terminal'''
def __init__(self, name: str, pattern: Pattern, priority: int=TOKEN_DEFAULT_PRIORITY) -> None:
pass
def __repr__(self):
pass
def user_repr(self) -> str:
pass | 4 | 1 | 4 | 0 | 4 | 0 | 1 | 0.11 | 1 | 4 | 1 | 0 | 3 | 0 | 3 | 6 | 23 | 4 | 18 | 6 | 14 | 2 | 17 | 6 | 13 | 2 | 1 | 1 | 4 |
12,393 | ccxt/ccxt | python/ccxt/static_dependencies/lark/lexer.py | ccxt.static_dependencies.lark.lexer.UnlessCallback | class UnlessCallback:
def __init__(self, scanner):
self.scanner = scanner
def __call__(self, t):
res = self.scanner.match(t.value, 0)
if res:
_value, t.type = res
return t | class UnlessCallback:
def __init__(self, scanner):
pass
def __call__(self, t):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 9 | 1 | 8 | 6 | 5 | 0 | 8 | 6 | 5 | 2 | 0 | 1 | 3 |
12,394 | ccxt/ccxt | python/ccxt/static_dependencies/lark/load_grammar.py | ccxt.static_dependencies.lark.load_grammar.ApplyTemplates | from .visitors import Transformer, Visitor, v_args, Transformer_InPlace, Transformer_NonRecursive
from copy import copy, deepcopy
from .grammar import RuleOptions, Rule, Terminal, NonTerminal, Symbol, TOKEN_DEFAULT_PRIORITY
class ApplyTemplates(Transformer_InPlace):
"""Apply the templates, creating new rules that ... |
class ApplyTemplates(Transformer_InPlace):
'''Apply the templates, creating new rules that represent the used templates'''
def __init__(self, rule_defs):
pass
def template_usage(self, c):
pass | 3 | 1 | 9 | 0 | 9 | 0 | 2 | 0.06 | 1 | 5 | 2 | 0 | 2 | 3 | 2 | 37 | 21 | 2 | 18 | 11 | 15 | 1 | 18 | 11 | 15 | 2 | 6 | 1 | 3 |
12,395 | ccxt/ccxt | python/ccxt/static_dependencies/lark/load_grammar.py | ccxt.static_dependencies.lark.load_grammar.EBNF_to_BNF | from .visitors import Transformer, Visitor, v_args, Transformer_InPlace, Transformer_NonRecursive
from .grammar import RuleOptions, Rule, Terminal, NonTerminal, Symbol, TOKEN_DEFAULT_PRIORITY
from .exceptions import GrammarError, UnexpectedCharacters, UnexpectedToken, ParseError, UnexpectedInput
from .lexer import Toke... | @inline_args
class EBNF_to_BNF(Transformer_InPlace):
def __init__(self):
pass
def _name_rule(self, inner: str):
pass
def _add_rule(self, key, name, expansions):
pass
def _add_recurse_rule(self, type_: str, expr: Tree):
pass
def _add_repeat_rule(self, a, b, target... | 11 | 3 | 16 | 2 | 10 | 5 | 2 | 0.48 | 1 | 8 | 3 | 0 | 9 | 5 | 9 | 44 | 153 | 26 | 88 | 38 | 78 | 42 | 77 | 38 | 67 | 7 | 6 | 3 | 22 |
12,396 | ccxt/ccxt | python/ccxt/static_dependencies/lark/load_grammar.py | ccxt.static_dependencies.lark.load_grammar.FindRuleSize | from .grammar import RuleOptions, Rule, Terminal, NonTerminal, Symbol, TOKEN_DEFAULT_PRIORITY
from typing import List, Tuple, Union, Callable, Dict, Optional, Sequence, Generator
from .visitors import Transformer, Visitor, v_args, Transformer_InPlace, Transformer_NonRecursive
class FindRuleSize(Transformer):
def ... |
class FindRuleSize(Transformer):
def __init__(self, keep_all_tokens: bool):
pass
def _will_not_get_removed(self, sym: Symbol) -> bool:
pass
def _args_as_int(self, args: List[Union[int, Symbol]]) -> Generator[int, None, None]:
pass
def expansion(self, args) -> int:
pa... | 6 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 5 | 3 | 0 | 5 | 1 | 5 | 38 | 27 | 4 | 23 | 8 | 17 | 0 | 21 | 8 | 15 | 5 | 5 | 2 | 12 |
12,397 | ccxt/ccxt | python/ccxt/static_dependencies/lark/load_grammar.py | ccxt.static_dependencies.lark.load_grammar.Grammar | from .grammar import RuleOptions, Rule, Terminal, NonTerminal, Symbol, TOKEN_DEFAULT_PRIORITY
from typing import List, Tuple, Union, Callable, Dict, Optional, Sequence, Generator
from .utils import classify, dedup_list
from .tree import Tree, SlottedTree as ST
from .utils import bfs, logger, classify_bool, is_id_contin... |
class Grammar:
def __init__(self, rule_defs: List[Tuple[str, Tuple[str, ...], Tree, RuleOptions]], term_defs: List[Tuple[str, Tuple[Tree, int]]], ignore: List[str]) -> None:
pass
def compile(self, start, terminals_to_keep) -> Tuple[List[TerminalDef], List[Rule], List[str]]:
pass | 3 | 0 | 64 | 11 | 45 | 11 | 12 | 0.24 | 0 | 21 | 15 | 0 | 2 | 0 | 2 | 2 | 135 | 24 | 93 | 33 | 90 | 22 | 85 | 32 | 82 | 22 | 0 | 4 | 23 |
12,398 | ccxt/ccxt | python/ccxt/static_dependencies/lark/load_grammar.py | ccxt.static_dependencies.lark.load_grammar.GrammarBuilder | from .exceptions import GrammarError, UnexpectedCharacters, UnexpectedToken, ParseError, UnexpectedInput
from .utils import bfs, logger, classify_bool, is_id_continue, is_id_start, bfs_all_unique, small_factors, OrderedSet
import sys
from .grammar import RuleOptions, Rule, Terminal, NonTerminal, Symbol, TOKEN_DEFAULT_P... |
class GrammarBuilder:
def __init__(self, global_keep_all_tokens: bool=False, import_paths: Optional[List[Union[str, Callable]]]=None, used_files: Optional[Dict[str, str]]=None) -> None:
pass
def _grammar_error(self, is_term, msg, *names):
pass
def _check_options(self, is_term, options):
... | 15 | 0 | 20 | 2 | 18 | 1 | 6 | 0.07 | 0 | 19 | 6 | 0 | 13 | 0 | 13 | 13 | 302 | 49 | 248 | 67 | 233 | 17 | 223 | 65 | 208 | 15 | 0 | 5 | 83 |
12,399 | ccxt/ccxt | python/ccxt/static_dependencies/lark/load_grammar.py | ccxt.static_dependencies.lark.load_grammar.PrepareAnonTerminals | from .lexer import Token, TerminalDef, PatternStr, PatternRE, Pattern
from .utils import bfs, logger, classify_bool, is_id_continue, is_id_start, bfs_all_unique, small_factors, OrderedSet
from .visitors import Transformer, Visitor, v_args, Transformer_InPlace, Transformer_NonRecursive
from .exceptions import GrammarErr... |
class PrepareAnonTerminals(Transformer_InPlace):
'''Create a unique list of anonymous terminals. Attempt to give meaningful names to them when we add them'''
def __init__(self, terminals):
pass
@inline_args
def pattern(self, p):
pass | 4 | 1 | 24 | 4 | 19 | 2 | 7 | 0.1 | 1 | 2 | 1 | 0 | 2 | 5 | 2 | 37 | 53 | 10 | 40 | 13 | 36 | 4 | 37 | 12 | 34 | 12 | 6 | 4 | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.