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,500 | ccxt/ccxt | python/ccxt/static_dependencies/marshmallow/validate.py | ccxt.static_dependencies.marshmallow.validate.URL | import re
import typing
from . import types
from .exceptions import ValidationError
class URL(Validator):
"""Validate a URL.
:param relative: Whether to allow relative URLs.
:param absolute: Whether to allow absolute URLs.
:param error: Error message to raise in case of a validation error.
Can... |
class URL(Validator):
'''Validate a URL.
:param relative: Whether to allow relative URLs.
:param absolute: Whether to allow absolute URLs.
:param error: Error message to raise in case of a validation error.
Can be interpolated with `{input}`.
:param schemes: Valid schemes. By default, ``htt... | 9 | 1 | 15 | 1 | 12 | 2 | 2 | 0.26 | 1 | 4 | 1 | 0 | 4 | 5 | 4 | 27 | 128 | 18 | 88 | 38 | 67 | 23 | 48 | 26 | 39 | 5 | 5 | 2 | 16 |
12,501 | ccxt/ccxt | python/ccxt/static_dependencies/marshmallow/warnings.py | ccxt.static_dependencies.marshmallow.warnings.RemovedInMarshmallow4Warning | class RemovedInMarshmallow4Warning(DeprecationWarning):
pass | class RemovedInMarshmallow4Warning(DeprecationWarning):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
12,502 | ccxt/ccxt | python/ccxt/static_dependencies/marshmallow_dataclass/__init__.py | ccxt.static_dependencies.marshmallow_dataclass._LocalStack | from typing import Any, Callable, Dict, FrozenSet, Generic, List, Mapping, NewType as typing_NewType, Optional, Sequence, Set, Tuple, Type, TypeVar, Union, cast, get_type_hints, overload
import threading
class _LocalStack(threading.local, Generic[_U]):
def __init__(self) -> None:
self.stack: List[_U] = []... |
class _LocalStack(threading.local, Generic[_U]):
def __init__(self) -> None:
pass
def push(self, value: _U) -> None:
pass
def pop(self) -> None:
pass
@property
def top(self) -> _U:
pass | 6 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 2 | 0 | 0 | 0 | 4 | 1 | 4 | 8 | 13 | 3 | 10 | 7 | 4 | 0 | 9 | 6 | 4 | 1 | 1 | 0 | 4 |
12,503 | ccxt/ccxt | python/ccxt/static_dependencies/marshmallow_dataclass/__init__.py | ccxt.static_dependencies.marshmallow_dataclass._SchemaContext | from typing import Any, Callable, Dict, FrozenSet, Generic, List, Mapping, NewType as typing_NewType, Optional, Sequence, Set, Tuple, Type, TypeVar, Union, cast, get_type_hints, overload
import types
class _SchemaContext:
"""Global context for an invocation of class_schema."""
def __init__(self, globalns: Opt... |
class _SchemaContext:
'''Global context for an invocation of class_schema.'''
def __init__(self, globalns: Optional[Dict[str, Any]]=None, localns: Optional[Dict[str, Any]]=None):
pass
def __enter__(self) -> '_SchemaContext':
pass
def __exit__(self, _typ: Optional[Type[BaseException]]... | 4 | 1 | 6 | 0 | 6 | 0 | 1 | 0.05 | 0 | 3 | 0 | 0 | 3 | 3 | 3 | 3 | 23 | 3 | 19 | 16 | 6 | 1 | 10 | 7 | 6 | 1 | 0 | 0 | 3 |
12,504 | ccxt/ccxt | python/ccxt/static_dependencies/marshmallow_dataclass/collection_field.py | ccxt.static_dependencies.marshmallow_dataclass.collection_field.Sequence | import typing
import marshmallow
class Sequence(marshmallow.fields.List):
"""
A sequence field, basically an immutable version of the list field.
"""
def _deserialize(self, value: typing.Any, attr: typing.Any, data: typing.Any, **kwargs: typing.Any) -> typing.Optional[typing.Sequence[typing.Any]]:
... |
class Sequence(marshmallow.fields.List):
'''
A sequence field, basically an immutable version of the list field.
'''
def _deserialize(self, value: typing.Any, attr: typing.Any, data: typing.Any, **kwargs: typing.Any) -> typing.Optional[typing.Sequence[typing.Any]]:
pass | 2 | 1 | 9 | 0 | 9 | 1 | 2 | 0.4 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 48 | 14 | 1 | 10 | 9 | 2 | 4 | 4 | 3 | 2 | 2 | 7 | 0 | 2 |
12,505 | ccxt/ccxt | python/ccxt/static_dependencies/marshmallow_dataclass/collection_field.py | ccxt.static_dependencies.marshmallow_dataclass.collection_field.Set | import marshmallow
import typing
class Set(marshmallow.fields.List):
"""
A set field. A set is an unordered/mutable collection of unique elements, same for frozenset
except it's immutable.
Notes:
Beware the a Set guarantees uniqueness in the resulting list but in return the item's order
... |
class Set(marshmallow.fields.List):
'''
A set field. A set is an unordered/mutable collection of unique elements, same for frozenset
except it's immutable.
Notes:
Beware the a Set guarantees uniqueness in the resulting list but in return the item's order
will be random. So if the order ... | 3 | 1 | 10 | 0 | 10 | 1 | 2 | 0.4 | 1 | 4 | 0 | 0 | 2 | 1 | 2 | 49 | 30 | 3 | 20 | 16 | 6 | 8 | 7 | 5 | 4 | 2 | 7 | 0 | 4 |
12,506 | ccxt/ccxt | python/ccxt/static_dependencies/marshmallow_dataclass/lazy_class_attribute.py | ccxt.static_dependencies.marshmallow_dataclass.lazy_class_attribute.LazyClassAttribute | from typing import Any, Callable, Optional
class LazyClassAttribute:
"""Descriptor decorator implementing a class-level, read-only
property, which caches its results on the class(es) on which it
operates.
"""
__slots__ = ('func', 'name', 'called', 'forward_value')
def __init__(self, func: Call... |
class LazyClassAttribute:
'''Descriptor decorator implementing a class-level, read-only
property, which caches its results on the class(es) on which it
operates.
'''
def __init__(self, func: Callable[..., Any], name: Optional[str]=None, forward_value: Any=None):
pass
def __get__(self,... | 4 | 1 | 9 | 1 | 7 | 1 | 2 | 0.27 | 0 | 2 | 0 | 0 | 3 | 4 | 3 | 3 | 36 | 8 | 22 | 14 | 13 | 6 | 17 | 9 | 13 | 3 | 0 | 1 | 5 |
12,507 | ccxt/ccxt | python/ccxt/static_dependencies/marshmallow_dataclass/mypy.py | ccxt.static_dependencies.marshmallow_dataclass.mypy.MarshmallowDataclassPlugin | from mypy.plugin import DynamicClassDefContext, Plugin
from typing import Callable, Optional, Type
from mypy.plugins import dataclasses
class MarshmallowDataclassPlugin(Plugin):
def get_dynamic_class_hook(self, fullname: str) -> Optional[Callable[[DynamicClassDefContext], None]]:
if fullname == 'marshmall... |
class MarshmallowDataclassPlugin(Plugin):
def get_dynamic_class_hook(self, fullname: str) -> Optional[Callable[[DynamicClassDefContext], None]]:
pass
def get_class_decorator_hook(self, fullname: str):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 2 | 12 | 1 | 11 | 5 | 6 | 0 | 9 | 3 | 6 | 2 | 1 | 1 | 4 |
12,508 | ccxt/ccxt | python/ccxt/static_dependencies/marshmallow_dataclass/union_field.py | ccxt.static_dependencies.marshmallow_dataclass.union_field.Union | from marshmallow import fields, Schema, ValidationError
import copy
from typing import List, Tuple, Any, Optional
class Union(fields.Field):
"""A union field, composed other `Field` classes or instances.
This field serializes elements based on their type, with one of its child fields.
Example: ::
... |
class Union(fields.Field):
'''A union field, composed other `Field` classes or instances.
This field serializes elements based on their type, with one of its child fields.
Example: ::
number_or_string = UnionField([
(float, fields.Float()),
(str, fields.Str()... | 5 | 1 | 10 | 1 | 9 | 0 | 3 | 0.27 | 1 | 4 | 1 | 0 | 4 | 1 | 4 | 47 | 56 | 9 | 37 | 15 | 32 | 10 | 33 | 13 | 28 | 4 | 6 | 2 | 10 |
12,509 | ccxt/ccxt | python/ccxt/static_dependencies/marshmallow_oneofschema/one_of_schema.py | ccxt.static_dependencies.marshmallow_oneofschema.one_of_schema.OneOfSchema | import typing
from ..marshmallow import Schema, ValidationError
class OneOfSchema(Schema):
"""
This is a special kind of schema that actually multiplexes other schemas
based on object type. When serializing values, it uses get_obj_type() method
to get object type name. Then it uses `type_schemas` name-... |
class OneOfSchema(Schema):
'''
This is a special kind of schema that actually multiplexes other schemas
based on object type. When serializing values, it uses get_obj_type() method
to get object type name. Then it uses `type_schemas` name-to-Schema mapping
to get schema for that particular object t... | 8 | 3 | 18 | 2 | 15 | 1 | 4 | 0.44 | 1 | 5 | 1 | 4 | 7 | 0 | 7 | 7 | 188 | 33 | 108 | 35 | 100 | 47 | 93 | 31 | 85 | 8 | 1 | 3 | 30 |
12,510 | ccxt/ccxt | python/ccxt/static_dependencies/msgpack/ext.py | ccxt.static_dependencies.msgpack.ext.Timestamp | import struct
import datetime
class Timestamp:
"""Timestamp represents the Timestamp extension type in msgpack.
When built with Cython, msgpack uses C methods to pack and unpack `Timestamp`.
When using pure-Python msgpack, :func:`to_bytes` and :func:`from_bytes` are used to pack and
unpack `Timestamp`... |
class Timestamp:
'''Timestamp represents the Timestamp extension type in msgpack.
When built with Cython, msgpack uses C methods to pack and unpack `Timestamp`.
When using pure-Python msgpack, :func:`to_bytes` and :func:`from_bytes` are used to pack and
unpack `Timestamp`.
This class is immutable: ... | 18 | 13 | 9 | 1 | 5 | 4 | 2 | 0.86 | 0 | 7 | 0 | 0 | 9 | 2 | 13 | 13 | 150 | 30 | 65 | 29 | 47 | 56 | 54 | 25 | 40 | 4 | 0 | 2 | 22 |
12,511 | ccxt/ccxt | python/ccxt/static_dependencies/msgpack/fallback.py | ccxt.static_dependencies.msgpack.fallback.Packer | import struct
from datetime import datetime as _DateTime
from .ext import ExtType, Timestamp
class Packer:
"""
MessagePack Packer
Usage::
packer = Packer()
astream.write(packer.pack(a))
astream.write(packer.pack(b))
Packer's constructor has some keyword arguments:
:param... |
class Packer:
'''
MessagePack Packer
Usage::
packer = Packer()
astream.write(packer.pack(a))
astream.write(packer.pack(b))
Packer's constructor has some keyword arguments:
:param default:
When specified, it should be callable.
Convert user type to builtin typ... | 16 | 4 | 17 | 0 | 17 | 0 | 6 | 0.23 | 0 | 18 | 3 | 0 | 15 | 8 | 15 | 15 | 345 | 35 | 253 | 52 | 222 | 58 | 213 | 37 | 197 | 42 | 0 | 3 | 92 |
12,512 | ccxt/ccxt | python/ccxt/static_dependencies/msgpack/fallback.py | ccxt.static_dependencies.msgpack.fallback.Unpacker | import struct
from .ext import ExtType, Timestamp
from .exceptions import BufferFull, OutOfData, ExtraData, FormatError, StackError
import sys
class Unpacker:
"""Streaming unpacker.
Arguments:
:param file_like:
File-like object having `.read(n)` method.
If specified, unpacker reads serial... |
class Unpacker:
'''Streaming unpacker.
Arguments:
:param file_like:
File-like object having `.read(n)` method.
If specified, unpacker reads serialized data from it and `.feed()` is not usable.
:param int read_size:
Used as `file_like.read(read_size)`. (default: `min(16*1024, max... | 18 | 2 | 21 | 1 | 19 | 1 | 6 | 0.29 | 0 | 16 | 6 | 0 | 17 | 22 | 17 | 17 | 470 | 54 | 324 | 82 | 287 | 94 | 278 | 62 | 260 | 28 | 0 | 4 | 99 |
12,513 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/exceptions.py | ccxt.static_dependencies.parsimonious.exceptions.BadGrammar | from .utils import StrAndRepr
class BadGrammar(StrAndRepr, Exception):
"""Something was wrong with the definition of a grammar.
Note that a ParseError might be raised instead if the error is in the
grammar definition syntax.
""" |
class BadGrammar(StrAndRepr, Exception):
'''Something was wrong with the definition of a grammar.
Note that a ParseError might be raised instead if the error is in the
grammar definition syntax.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 0 | 1 | 0 | 0 | 0 | 11 | 7 | 2 | 1 | 1 | 0 | 4 | 1 | 1 | 0 | 0 | 3 | 0 | 0 |
12,514 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/exceptions.py | ccxt.static_dependencies.parsimonious.exceptions.IncompleteParseError | class IncompleteParseError(ParseError):
"""A call to ``parse()`` matched a whole Expression but did not consume the
entire text."""
def __str__(self):
return u"Rule '%s' matched in its entirety, but it didn't consume all the text. The non-matching portion of the text begins with '%s' (line %s, colu... | class IncompleteParseError(ParseError):
'''A call to ``parse()`` matched a whole Expression but did not consume the
entire text.'''
def __str__(self):
pass | 2 | 1 | 6 | 0 | 6 | 0 | 1 | 0.29 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 16 | 10 | 1 | 7 | 2 | 5 | 2 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
12,515 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/exceptions.py | ccxt.static_dependencies.parsimonious.exceptions.ParseError | from .utils import StrAndRepr
class ParseError(StrAndRepr, Exception):
"""A call to ``Expression.parse()`` or ``match()`` didn't match."""
def __init__(self, text, pos=-1, expr=None):
self.text = text
self.pos = pos
self.expr = expr
def __str__(self):
rule_name = u"'%s'" %... |
class ParseError(StrAndRepr, Exception):
'''A call to ``Expression.parse()`` or ``match()`` didn't match.'''
def __init__(self, text, pos=-1, expr=None):
pass
def __str__(self):
pass
def line(self):
'''Return the 1-based line number where the expression ceased to
matc... | 5 | 3 | 7 | 0 | 5 | 2 | 2 | 0.6 | 2 | 2 | 0 | 2 | 4 | 3 | 4 | 15 | 37 | 5 | 20 | 9 | 15 | 12 | 15 | 9 | 10 | 2 | 3 | 1 | 6 |
12,516 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/exceptions.py | ccxt.static_dependencies.parsimonious.exceptions.UndefinedLabel | class UndefinedLabel(BadGrammar):
"""A rule referenced in a grammar was never defined.
Circular references and forward references are okay, but you have to define
stuff at some point.
"""
def __init__(self, label):
self.label = label
def __str__(self):
return u'The label "%s"... | class UndefinedLabel(BadGrammar):
'''A rule referenced in a grammar was never defined.
Circular references and forward references are okay, but you have to define
stuff at some point.
'''
def __init__(self, label):
pass
def __str__(self):
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.8 | 1 | 0 | 0 | 0 | 2 | 1 | 2 | 13 | 12 | 3 | 5 | 4 | 2 | 4 | 5 | 4 | 2 | 1 | 4 | 0 | 2 |
12,517 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/exceptions.py | ccxt.static_dependencies.parsimonious.exceptions.VisitationError | class VisitationError(Exception):
"""Something went wrong while traversing a parse tree.
This exception exists to augment an underlying exception with information
about where in the parse tree the error occurred. Otherwise, it could be
tiresome to figure out what went wrong; you'd have to play back the... | class VisitationError(Exception):
'''Something went wrong while traversing a parse tree.
This exception exists to augment an underlying exception with information
about where in the parse tree the error occurred. Otherwise, it could be
tiresome to figure out what went wrong; you'd have to play back the ... | 2 | 2 | 15 | 2 | 9 | 4 | 1 | 1.3 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 11 | 27 | 4 | 10 | 3 | 8 | 13 | 4 | 3 | 2 | 1 | 3 | 0 | 1 |
12,518 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.Compound | class Compound(Expression):
"""An abstract expression which contains other expressions"""
__slots__ = ['members']
def __init__(self, *members, **kwargs):
"""``members`` is a sequence of expressions."""
super(Compound, self).__init__(kwargs.get('name', ''))
self.members = members
... | class Compound(Expression):
'''An abstract expression which contains other expressions'''
def __init__(self, *members, **kwargs):
'''``members`` is a sequence of expressions.'''
pass
def __hash__(self):
pass
def __eq__(self, other):
pass | 4 | 2 | 5 | 0 | 3 | 1 | 1 | 0.42 | 1 | 1 | 0 | 7 | 3 | 1 | 3 | 15 | 21 | 4 | 12 | 6 | 8 | 5 | 9 | 6 | 5 | 1 | 3 | 0 | 3 |
12,519 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.Expression | from .exceptions import ParseError, IncompleteParseError
from .utils import StrAndRepr
class Expression(StrAndRepr):
"""A thing that can be matched against a piece of text"""
__slots__ = ['name', 'identity_tuple']
def __init__(self, name=''):
self.name = name
self.identity_tuple = (self.na... |
class Expression(StrAndRepr):
'''A thing that can be matched against a piece of text'''
def __init__(self, name=''):
pass
def __hash__(self):
pass
def __eq__(self, other):
pass
def __ne__(self, other):
pass
def parse(self, text, pos=0):
'''Return a p... | 12 | 7 | 10 | 2 | 4 | 5 | 2 | 1.15 | 1 | 3 | 2 | 3 | 11 | 2 | 11 | 12 | 132 | 30 | 48 | 21 | 36 | 55 | 42 | 21 | 30 | 3 | 2 | 1 | 17 |
12,520 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.Literal | from .nodes import Node, RegexNode
class Literal(Expression):
"""A string literal
Use these if you can; they're the fastest.
"""
__slots__ = ['literal']
def __init__(self, literal, name=''):
super(Literal, self).__init__(name)
self.literal = literal
self.identity_tuple = ... |
class Literal(Expression):
'''A string literal
Use these if you can; they're the fastest.
'''
def __init__(self, literal, name=''):
pass
def _uncached_match(self, text, pos, cache, error):
pass
def _as_rhs(self):
pass | 4 | 1 | 3 | 0 | 3 | 0 | 1 | 0.27 | 1 | 2 | 1 | 1 | 3 | 2 | 3 | 15 | 19 | 5 | 11 | 7 | 7 | 3 | 11 | 7 | 7 | 2 | 3 | 1 | 4 |
12,521 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.Lookahead | from .nodes import Node, RegexNode
class Lookahead(Compound):
"""An expression which consumes nothing, even if its contained expression
succeeds"""
def _uncached_match(self, text, pos, cache, error):
node = self.members[0].match_core(text, pos, cache, error)
if node is not None:
... |
class Lookahead(Compound):
'''An expression which consumes nothing, even if its contained expression
succeeds'''
def _uncached_match(self, text, pos, cache, error):
pass
def _as_rhs(self):
pass | 3 | 1 | 3 | 0 | 3 | 0 | 2 | 0.71 | 1 | 1 | 1 | 0 | 2 | 0 | 2 | 17 | 15 | 3 | 7 | 4 | 4 | 5 | 7 | 4 | 4 | 2 | 4 | 1 | 3 |
12,522 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.Not | from .nodes import Node, RegexNode
class Not(Compound):
"""An expression that succeeds only if the expression within it doesn't
In any case, it never consumes any characters; it's a negative lookahead.
"""
def _uncached_match(self, text, pos, cache, error):
node = self.members[0].match_core(... |
class Not(Compound):
'''An expression that succeeds only if the expression within it doesn't
In any case, it never consumes any characters; it's a negative lookahead.
'''
def _uncached_match(self, text, pos, cache, error):
pass
def _as_rhs(self):
pass | 3 | 1 | 5 | 0 | 3 | 2 | 2 | 1 | 1 | 1 | 1 | 0 | 2 | 0 | 2 | 17 | 17 | 3 | 7 | 4 | 4 | 7 | 7 | 4 | 4 | 2 | 4 | 1 | 3 |
12,523 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.OneOf | from .nodes import Node, RegexNode
class OneOf(Compound):
"""A series of expressions, one of which must match
Expressions are tested in order from first to last. The first to succeed
wins.
"""
def _uncached_match(self, text, pos, cache, error):
for m in self.members:
node = m... |
class OneOf(Compound):
'''A series of expressions, one of which must match
Expressions are tested in order from first to last. The first to succeed
wins.
'''
def _uncached_match(self, text, pos, cache, error):
pass
def _as_rhs(self):
pass | 3 | 1 | 4 | 0 | 4 | 1 | 2 | 0.63 | 1 | 1 | 1 | 0 | 2 | 0 | 2 | 17 | 16 | 3 | 8 | 5 | 5 | 5 | 8 | 5 | 5 | 3 | 4 | 2 | 4 |
12,524 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.OneOrMore | from .nodes import Node, RegexNode
class OneOrMore(Compound):
"""An expression wrapper like the + quantifier in regexes.
You can also pass in an alternate minimum to make this behave like "2 or
more", "3 or more", etc.
"""
__slots__ = ['min']
def __init__(self, member, name='', min=1):
... |
class OneOrMore(Compound):
'''An expression wrapper like the + quantifier in regexes.
You can also pass in an alternate minimum to make this behave like "2 or
more", "3 or more", etc.
'''
def __init__(self, member, name='', min=1):
pass
def _uncached_match(self, text, pos, cache, erro... | 4 | 1 | 6 | 0 | 6 | 0 | 2 | 0.33 | 1 | 2 | 1 | 0 | 3 | 1 | 3 | 18 | 33 | 6 | 21 | 10 | 17 | 7 | 21 | 10 | 17 | 5 | 4 | 2 | 7 |
12,525 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.Optional | from .nodes import Node, RegexNode
class Optional(Compound):
"""An expression that succeeds whether or not the contained one does
If the contained expression succeeds, it goes ahead and consumes what it
consumes. Otherwise, it consumes nothing.
"""
def _uncached_match(self, text, pos, cache, err... |
class Optional(Compound):
'''An expression that succeeds whether or not the contained one does
If the contained expression succeeds, it goes ahead and consumes what it
consumes. Otherwise, it consumes nothing.
'''
def _uncached_match(self, text, pos, cache, error):
pass
def _as_rhs(se... | 3 | 1 | 3 | 0 | 3 | 0 | 2 | 0.57 | 1 | 1 | 1 | 0 | 2 | 0 | 2 | 17 | 14 | 3 | 7 | 4 | 4 | 4 | 6 | 4 | 3 | 2 | 4 | 0 | 3 |
12,526 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.Regex | import re
from .nodes import Node, RegexNode
class Regex(Expression):
"""An expression that matches what a regex does.
Use these as much as you can and jam as much into each one as you can;
they're fast.
"""
__slots__ = ['re']
def __init__(self, pattern, name='', ignore_case=False, locale=Fa... |
class Regex(Expression):
'''An expression that matches what a regex does.
Use these as much as you can and jam as much into each one as you can;
they're fast.
'''
def __init__(self, pattern, name='', ignore_case=False, locale=False, multiline=False, dot_all=False, unicode=False, verbose=False, asc... | 5 | 3 | 7 | 0 | 6 | 1 | 2 | 0.27 | 1 | 3 | 1 | 0 | 4 | 2 | 4 | 16 | 38 | 6 | 26 | 13 | 20 | 7 | 18 | 12 | 13 | 2 | 3 | 1 | 6 |
12,527 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.Sequence | from .nodes import Node, RegexNode
class Sequence(Compound):
"""A series of expressions that must match contiguous, ordered pieces of
the text
In other words, it's a concatenation operator: each piece has to match, one
after another.
"""
def _uncached_match(self, text, pos, cache, error):
... |
class Sequence(Compound):
'''A series of expressions that must match contiguous, ordered pieces of
the text
In other words, it's a concatenation operator: each piece has to match, one
after another.
'''
def _uncached_match(self, text, pos, cache, error):
pass
def _as_rhs(self):
... | 3 | 1 | 8 | 0 | 8 | 1 | 2 | 0.38 | 1 | 1 | 1 | 0 | 2 | 0 | 2 | 17 | 25 | 3 | 16 | 9 | 13 | 6 | 16 | 9 | 13 | 3 | 4 | 2 | 4 |
12,528 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.TokenMatcher | from .nodes import Node, RegexNode
class TokenMatcher(Literal):
"""An expression matching a single token of a given type
This is for use only with TokenGrammars.
"""
def _uncached_match(self, token_list, pos, cache, error):
if token_list[pos].type == self.literal:
return Node(sel... |
class TokenMatcher(Literal):
'''An expression matching a single token of a given type
This is for use only with TokenGrammars.
'''
def _uncached_match(self, token_list, pos, cache, error):
pass | 2 | 1 | 3 | 0 | 3 | 0 | 2 | 0.75 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 16 | 9 | 2 | 4 | 2 | 2 | 3 | 4 | 2 | 2 | 2 | 4 | 1 | 2 |
12,529 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/expressions.py | ccxt.static_dependencies.parsimonious.expressions.ZeroOrMore | from .nodes import Node, RegexNode
class ZeroOrMore(Compound):
"""An expression wrapper like the * quantifier in regexes."""
def _uncached_match(self, text, pos, cache, error):
new_pos = pos
children = []
while True:
node = self.members[0].match_core(text, new_pos, cache, e... |
class ZeroOrMore(Compound):
'''An expression wrapper like the * quantifier in regexes.'''
def _uncached_match(self, text, pos, cache, error):
pass
def _as_rhs(self):
pass | 3 | 1 | 6 | 0 | 6 | 1 | 2 | 0.17 | 1 | 1 | 1 | 0 | 2 | 0 | 2 | 17 | 16 | 2 | 12 | 6 | 9 | 2 | 12 | 6 | 9 | 3 | 4 | 2 | 4 |
12,530 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/grammar.py | ccxt.static_dependencies.parsimonious.grammar.BootstrappingGrammar | from .expressions import Literal, Regex, Sequence, OneOf, Lookahead, Optional, ZeroOrMore, OneOrMore, Not, TokenMatcher, expression, is_callable
class BootstrappingGrammar(Grammar):
"""The grammar used to recognize the textual rules that describe other
grammars
This grammar gets its start from some hard-c... |
class BootstrappingGrammar(Grammar):
'''The grammar used to recognize the textual rules that describe other
grammars
This grammar gets its start from some hard-coded Expressions and claws its
way from there to an expression tree that describes how to parse the
grammar description syntax.
'''
... | 2 | 2 | 50 | 7 | 31 | 13 | 1 | 0.59 | 1 | 8 | 8 | 0 | 1 | 0 | 1 | 60 | 59 | 9 | 32 | 23 | 30 | 19 | 25 | 23 | 23 | 1 | 4 | 0 | 1 |
12,531 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/grammar.py | ccxt.static_dependencies.parsimonious.grammar.Grammar | from collections import OrderedDict
from .expressions import Literal, Regex, Sequence, OneOf, Lookahead, Optional, ZeroOrMore, OneOrMore, Not, TokenMatcher, expression, is_callable
class Grammar(OrderedDict):
"""A collection of rules that describe a language
You can start parsing from the default rule by call... |
class Grammar(OrderedDict):
'''A collection of rules that describe a language
You can start parsing from the default rule by calling ``parse()``
directly on the ``Grammar`` object::
g = Grammar('''
polite_greeting = greeting ", my good " title
greeting ... | 10 | 10 | 10 | 1 | 4 | 4 | 1 | 1.55 | 1 | 4 | 1 | 2 | 9 | 1 | 9 | 59 | 124 | 28 | 38 | 17 | 28 | 59 | 33 | 17 | 23 | 2 | 3 | 1 | 12 |
12,532 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/grammar.py | ccxt.static_dependencies.parsimonious.grammar.LazyReference | class LazyReference(str):
"""A lazy reference to a rule, which we resolve after grokking all the
rules"""
name = u''
def _as_rhs(self):
return u'<LazyReference to %s>' % self | class LazyReference(str):
'''A lazy reference to a rule, which we resolve after grokking all the
rules'''
def _as_rhs(self):
pass | 2 | 1 | 2 | 0 | 2 | 0 | 1 | 0.75 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 67 | 9 | 2 | 4 | 3 | 2 | 3 | 4 | 3 | 2 | 1 | 2 | 0 | 1 |
12,533 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/grammar.py | ccxt.static_dependencies.parsimonious.grammar.RuleVisitor | from .exceptions import BadGrammar, UndefinedLabel
from .utils import evaluate_string
from .expressions import Literal, Regex, Sequence, OneOf, Lookahead, Optional, ZeroOrMore, OneOrMore, Not, TokenMatcher, expression, is_callable
from collections import OrderedDict
from .nodes import NodeVisitor
class RuleVisitor(Nod... |
class RuleVisitor(NodeVisitor):
'''Turns a parse tree of a grammar definition into a map of ``Expression``
objects
This is the magic piece that breathes life into a parsed bunch of parse
rules, allowing them to go forth and parse other things.
'''
def __init__(self, custom_rules=None):
... | 19 | 15 | 9 | 1 | 4 | 4 | 1 | 0.86 | 1 | 14 | 8 | 1 | 18 | 1 | 18 | 38 | 187 | 41 | 80 | 41 | 61 | 69 | 70 | 41 | 51 | 4 | 4 | 2 | 22 |
12,534 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/grammar.py | ccxt.static_dependencies.parsimonious.grammar.TokenGrammar | class TokenGrammar(Grammar):
"""A Grammar which takes a list of pre-lexed tokens instead of text
This is useful if you want to do the lexing yourself, as a separate pass:
for example, to implement indentation-based languages.
"""
def _expressions_from_rules(self, rules, custom_rules):
tre... | class TokenGrammar(Grammar):
'''A Grammar which takes a list of pre-lexed tokens instead of text
This is useful if you want to do the lexing yourself, as a separate pass:
for example, to implement indentation-based languages.
'''
def _expressions_from_rules(self, rules, custom_rules):
pass | 2 | 1 | 3 | 0 | 3 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 60 | 10 | 2 | 4 | 3 | 2 | 4 | 4 | 3 | 2 | 1 | 4 | 0 | 1 |
12,535 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/grammar.py | ccxt.static_dependencies.parsimonious.grammar.TokenRuleVisitor | from .utils import evaluate_string
from .expressions import Literal, Regex, Sequence, OneOf, Lookahead, Optional, ZeroOrMore, OneOrMore, Not, TokenMatcher, expression, is_callable
from .exceptions import BadGrammar, UndefinedLabel
class TokenRuleVisitor(RuleVisitor):
"""A visitor which builds expression trees mean... |
class TokenRuleVisitor(RuleVisitor):
'''A visitor which builds expression trees meant to work on sequences of
pre-lexed tokens rather than strings'''
def visit_spaceless_literal(self, spaceless_literal, visited_children):
'''Turn a string literal into a ``TokenMatcher`` that matches
``Toke... | 3 | 2 | 5 | 0 | 4 | 1 | 1 | 0.5 | 1 | 2 | 2 | 0 | 2 | 0 | 2 | 40 | 14 | 2 | 8 | 4 | 5 | 4 | 6 | 4 | 3 | 1 | 5 | 0 | 2 |
12,536 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/nodes.py | ccxt.static_dependencies.parsimonious.nodes.Node | class Node(object):
"""A parse tree node
Consider these immutable once constructed. As a side effect of a
memory-saving strategy in the cache, multiple references to a single
``Node`` might be returned in a single parse tree. So, if you start
messing with one, you'll see surprising parallel changes... | class Node(object):
'''A parse tree node
Consider these immutable once constructed. As a side effect of a
memory-saving strategy in the cache, multiple references to a single
``Node`` might be returned in a single parse tree. So, if you start
messing with one, you'll see surprising parallel changes ... | 13 | 7 | 7 | 1 | 5 | 2 | 2 | 0.7 | 1 | 0 | 0 | 1 | 9 | 5 | 9 | 9 | 105 | 18 | 54 | 22 | 41 | 38 | 33 | 20 | 22 | 4 | 1 | 1 | 16 |
12,537 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/nodes.py | ccxt.static_dependencies.parsimonious.nodes.NodeVisitor | from .exceptions import VisitationError, UndefinedLabel
class NodeVisitor(object, metaclass=RuleDecoratorMeta):
"""A shell for writing things that turn parse trees into something useful
Performs a depth-first traversal of an AST. Subclass this, add methods for
each expr you care about, instantiate, and ca... |
class NodeVisitor(object, metaclass=RuleDecoratorMeta):
'''A shell for writing things that turn parse trees into something useful
Performs a depth-first traversal of an AST. Subclass this, add methods for
each expr you care about, instantiate, and call
``visit(top_node_of_parse_tree)``. It'll return th... | 7 | 7 | 14 | 2 | 5 | 7 | 2 | 2.06 | 2 | 5 | 2 | 2 | 6 | 0 | 6 | 20 | 131 | 30 | 33 | 13 | 26 | 68 | 27 | 12 | 20 | 4 | 3 | 2 | 10 |
12,538 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/nodes.py | ccxt.static_dependencies.parsimonious.nodes.RegexNode | class RegexNode(Node):
"""Node returned from a ``Regex`` expression
Grants access to the ``re.Match`` object, in case you want to access
capturing groups, etc.
"""
__slots__ = ['match'] | class RegexNode(Node):
'''Node returned from a ``Regex`` expression
Grants access to the ``re.Match`` object, in case you want to access
capturing groups, etc.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 8 | 2 | 2 | 2 | 1 | 4 | 2 | 2 | 1 | 0 | 2 | 0 | 0 |
12,539 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/nodes.py | ccxt.static_dependencies.parsimonious.nodes.RuleDecoratorMeta | from sys import version_info, exc_info
from inspect import isfunction
class RuleDecoratorMeta(type):
def __new__(metaclass, name, bases, namespace):
def unvisit(name):
"""Remove any leading "visit_" from a method name."""
return name[6:] if name.startswith('visit_') else name
... |
class RuleDecoratorMeta(type):
def __new__(metaclass, name, bases, namespace):
pass
def unvisit(name):
'''Remove any leading "visit_" from a method name.'''
pass | 3 | 1 | 13 | 1 | 9 | 3 | 3 | 0.29 | 1 | 2 | 1 | 1 | 1 | 0 | 1 | 14 | 23 | 2 | 17 | 5 | 13 | 5 | 10 | 5 | 6 | 3 | 2 | 1 | 5 |
12,540 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/utils.py | ccxt.static_dependencies.parsimonious.utils.StrAndRepr | class StrAndRepr(object):
"""Mix-in which gives the class the same __repr__ and __str__."""
def __repr__(self):
return self.__str__() | class StrAndRepr(object):
'''Mix-in which gives the class the same __repr__ and __str__.'''
def __repr__(self):
pass | 2 | 1 | 2 | 0 | 2 | 0 | 1 | 0.33 | 1 | 0 | 0 | 4 | 1 | 0 | 1 | 1 | 5 | 1 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
12,541 | ccxt/ccxt | python/ccxt/static_dependencies/parsimonious/utils.py | ccxt.static_dependencies.parsimonious.utils.Token | class Token(StrAndRepr):
"""A class to represent tokens, for use with TokenGrammars
You will likely want to subclass this to hold additional information, like
the characters that you lexed to create this token. Alternately, feel free
to create your own class from scratch. The only contract is that toke... | class Token(StrAndRepr):
'''A class to represent tokens, for use with TokenGrammars
You will likely want to subclass this to hold additional information, like
the characters that you lexed to create this token. Alternately, feel free
to create your own class from scratch. The only contract is that token... | 4 | 1 | 2 | 0 | 2 | 0 | 1 | 0.75 | 1 | 0 | 0 | 0 | 3 | 1 | 3 | 4 | 19 | 5 | 8 | 6 | 4 | 6 | 8 | 6 | 4 | 1 | 2 | 0 | 3 |
12,542 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.ArrayType | from dataclasses import dataclass
@dataclass
class ArrayType(CairoType):
"""
Type representation of Cairo arrays.
"""
inner_type: CairoType | @dataclass
class ArrayType(CairoType):
'''
Type representation of Cairo arrays.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 6 | 1 | 2 | 1 | 1 | 4 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
12,543 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.BoolType | from dataclasses import dataclass
@dataclass
class BoolType(CairoType):
"""
Type representation of Cairo boolean.
""" | @dataclass
class BoolType(CairoType):
'''
Type representation of Cairo boolean.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 4 | 0 | 1 | 1 | 0 | 3 | 1 | 1 | 0 | 0 | 5 | 0 | 0 |
12,544 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.CairoType | from abc import ABC
class CairoType(ABC):
"""
Base type for all Cairo type representations. All types extend it.
""" |
class CairoType(ABC):
'''
Base type for all Cairo type representations. All types extend it.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 0 | 0 | 12 | 0 | 0 | 0 | 20 | 4 | 0 | 1 | 1 | 0 | 3 | 1 | 1 | 0 | 0 | 4 | 0 | 0 |
12,545 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.EnumType | from dataclasses import dataclass
from collections import OrderedDict
@dataclass
class EnumType(CairoType):
"""
Type representation of Cairo enums.
"""
name: str
variants: OrderedDict[str, CairoType] | @dataclass
class EnumType(CairoType):
'''
Type representation of Cairo enums.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 7 | 1 | 3 | 1 | 2 | 3 | 3 | 1 | 2 | 0 | 5 | 0 | 0 |
12,546 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.EventType | from collections import OrderedDict
from dataclasses import dataclass
@dataclass
class EventType(CairoType):
"""
Type representation of Cairo Event.
"""
name: str
types: OrderedDict[str, CairoType] | @dataclass
class EventType(CairoType):
'''
Type representation of Cairo Event.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 7 | 1 | 3 | 1 | 2 | 3 | 3 | 1 | 2 | 0 | 5 | 0 | 0 |
12,547 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.FeltType | from dataclasses import dataclass
@dataclass
class FeltType(CairoType):
"""
Type representation of Cairo field element.
""" | @dataclass
class FeltType(CairoType):
'''
Type representation of Cairo field element.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 4 | 0 | 1 | 1 | 0 | 3 | 1 | 1 | 0 | 0 | 5 | 0 | 0 |
12,548 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.NamedTupleType | from dataclasses import dataclass
from collections import OrderedDict
@dataclass
class NamedTupleType(CairoType):
"""
Type representation of Cairo tuples with named fields.
"""
types: OrderedDict[str, CairoType] | @dataclass
class NamedTupleType(CairoType):
'''
Type representation of Cairo tuples with named fields.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 6 | 1 | 2 | 1 | 1 | 4 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
12,549 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.OptionType | from dataclasses import dataclass
@dataclass
class OptionType(CairoType):
"""
Type representation of Cairo options.
"""
type: CairoType | @dataclass
class OptionType(CairoType):
'''
Type representation of Cairo options.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 6 | 1 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
12,550 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.StructType | from dataclasses import dataclass
from collections import OrderedDict
@dataclass
class StructType(CairoType):
"""
Type representation of Cairo structures.
"""
name: str
types: OrderedDict[str, CairoType] | @dataclass
class StructType(CairoType):
'''
Type representation of Cairo structures.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 8 | 1 | 3 | 1 | 2 | 6 | 3 | 1 | 2 | 0 | 5 | 0 | 0 |
12,551 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.TupleType | from dataclasses import dataclass
from typing import List
@dataclass
class TupleType(CairoType):
"""
Type representation of Cairo tuples without named fields.
"""
types: List[CairoType] | @dataclass
class TupleType(CairoType):
'''
Type representation of Cairo tuples without named fields.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 6 | 1 | 2 | 1 | 1 | 4 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
12,552 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.TypeIdentifier | from dataclasses import dataclass
@dataclass
class TypeIdentifier(CairoType):
"""
Type representation of Cairo identifiers.
"""
name: str | @dataclass
class TypeIdentifier(CairoType):
'''
Type representation of Cairo identifiers.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 6 | 1 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
12,553 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.UintType | from dataclasses import dataclass
@dataclass
class UintType(CairoType):
"""
Type representation of Cairo unsigned integers.
"""
bits: int
def check_range(self, value: int):
"""
Utility method checking if the `value` is in range.
""" | @dataclass
class UintType(CairoType):
'''
Type representation of Cairo unsigned integers.
'''
def check_range(self, value: int):
'''
Utility method checking if the `value` is in range.
'''
pass | 3 | 2 | 4 | 0 | 1 | 3 | 1 | 2 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 21 | 11 | 2 | 3 | 2 | 1 | 6 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
12,554 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/data_types.py | ccxt.static_dependencies.starknet.cairo.data_types.UnitType | from dataclasses import dataclass
@dataclass
class UnitType(CairoType):
"""
Type representation of Cairo unit `()`.
""" | @dataclass
class UnitType(CairoType):
'''
Type representation of Cairo unit `()`.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 4 | 0 | 1 | 1 | 0 | 3 | 1 | 1 | 0 | 0 | 5 | 0 | 0 |
12,555 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.cairo_types.CairoType | class CairoType:
"""
Base class for cairo types.
""" | class CairoType:
'''
Base class for cairo types.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 9 | 0 | 0 | 0 | 0 | 4 | 0 | 1 | 1 | 0 | 3 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
12,556 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.cairo_types.ExprIdentifier | import dataclasses
@dataclasses.dataclass
class ExprIdentifier(CairoType):
name: str | @dataclasses.dataclass
class ExprIdentifier(CairoType):
pass | 2 | 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 | 1 | 0 | 0 |
12,557 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.cairo_types.TypeCodeoffset | import dataclasses
@dataclasses.dataclass
class TypeCodeoffset(CairoType):
pass | @dataclasses.dataclass
class TypeCodeoffset(CairoType):
pass | 2 | 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 | 1 | 0 | 0 |
12,558 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.cairo_types.TypeFelt | import dataclasses
@dataclasses.dataclass
class TypeFelt(CairoType):
pass | @dataclasses.dataclass
class TypeFelt(CairoType):
pass | 2 | 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 | 1 | 0 | 0 |
12,559 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.cairo_types.TypeFunction | import dataclasses
@dataclasses.dataclass
class TypeFunction(CairoType):
"""
Represents a type of a function.
"""
scope: str | @dataclasses.dataclass
class TypeFunction(CairoType):
'''
Represents a type of a function.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 1 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
12,560 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.cairo_types.TypeIdentifier | import dataclasses
@dataclasses.dataclass
class TypeIdentifier(CairoType):
"""
Represents a name of an unresolved type.
This type can be resolved to TypeStruct or TypeDefinition.
"""
name: str | @dataclasses.dataclass
class TypeIdentifier(CairoType):
'''
Represents a name of an unresolved type.
This type can be resolved to TypeStruct or TypeDefinition.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 1 | 2 | 1 | 1 | 4 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
12,561 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.cairo_types.TypePointer | import dataclasses
@dataclasses.dataclass
class TypePointer(CairoType):
pointee: CairoType | @dataclasses.dataclass
class TypePointer(CairoType):
pass | 2 | 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 | 1 | 0 | 0 |
12,562 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.cairo_types.TypeStruct | import dataclasses
@dataclasses.dataclass
class TypeStruct(CairoType):
scope: str | @dataclasses.dataclass
class TypeStruct(CairoType):
pass | 2 | 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 | 1 | 0 | 0 |
12,563 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.cairo_types.TypeTuple | import dataclasses
from typing import List, Optional
@dataclasses.dataclass
class TypeTuple(CairoType):
"""
Represents a type of a named or unnamed tuple.
For example, "(felt, felt*)" or "(a: felt, b: felt*)".
"""
@dataclasses.dataclass
class Item(CairoType):
"""
Represents a p... | @dataclasses.dataclass
class TypeTuple(CairoType):
'''
Represents a type of a named or unnamed tuple.
For example, "(felt, felt*)" or "(a: felt, b: felt*)".
'''
@dataclasses.dataclass
class Item(CairoType):
'''
Represents a possibly named type item of a TypeTuple.
For exa... | 6 | 2 | 2 | 0 | 2 | 0 | 1 | 0.8 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 22 | 4 | 10 | 6 | 5 | 8 | 8 | 4 | 5 | 1 | 1 | 0 | 1 |
12,564 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.parser_transformer.CommaSeparated | import dataclasses
@dataclasses.dataclass
class CommaSeparated:
"""
Represents a list of comma separated values, such as expressions or types.
"""
args: list
has_trailing_comma: bool | @dataclasses.dataclass
class CommaSeparated:
'''
Represents a list of comma separated values, such as expressions or types.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 1 | 3 | 1 | 2 | 3 | 3 | 1 | 2 | 0 | 0 | 0 | 0 |
12,565 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.parser_transformer.ParserContext | import dataclasses
@dataclasses.dataclass
class ParserContext:
"""
Represents information that affects the parsing process.
"""
resolved_types: bool = False | @dataclasses.dataclass
class ParserContext:
'''
Represents information that affects the parsing process.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 1 | 2 | 2 | 1 | 4 | 2 | 2 | 1 | 0 | 0 | 0 | 0 |
12,566 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.parser_transformer.ParserError | class ParserError(Exception):
"""
Base exception for parsing process.
""" | class ParserError(Exception):
'''
Base exception for parsing process.
'''
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,567 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py | ccxt.static_dependencies.starknet.cairo.deprecated_parse.parser_transformer.ParserTransformer | from ....lark import Token, Transformer, v_args
from typing import Optional, Tuple
from .cairo_types import CairoType, ExprIdentifier, TypeCodeoffset, TypeFelt, TypeIdentifier, TypePointer, TypeStruct, TypeTuple
class ParserTransformer(Transformer):
"""
Transforms the lark tree into an AST based on the classes... |
class ParserTransformer(Transformer):
'''
Transforms the lark tree into an AST based on the classes defined in cairo_types.py.
'''
def __init__(self):
pass
def __default__(self, data: str, children, meta):
pass
def comma_separated(self, value) -> CommaSeparated:
p... | 21 | 1 | 6 | 0 | 5 | 0 | 2 | 0.13 | 1 | 18 | 13 | 0 | 12 | 1 | 12 | 45 | 95 | 19 | 67 | 28 | 46 | 9 | 56 | 20 | 43 | 6 | 5 | 3 | 22 |
12,568 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/type_parser.py | ccxt.static_dependencies.starknet.cairo.type_parser.TypeParser | from .deprecated_parse import cairo_types as cairo_lang_types
from .deprecated_parse.parser import parse
from collections import OrderedDict
from typing import Dict, cast
from .data_types import ArrayType, CairoType, FeltType, NamedTupleType, StructType, TupleType
class TypeParser:
"""
Low level utility class ... |
class TypeParser:
'''
Low level utility class for parsing Cairo types that can be used in external methods.
'''
def __init__(self, defined_types: Dict[str, StructType]):
'''
TypeParser constructor.
:param defined_types: dictionary containing all defined types. For now, they... | 5 | 4 | 21 | 3 | 12 | 6 | 3 | 0.56 | 0 | 17 | 13 | 0 | 4 | 0 | 4 | 4 | 92 | 16 | 50 | 9 | 43 | 28 | 29 | 7 | 24 | 7 | 0 | 2 | 13 |
12,569 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/type_parser.py | ccxt.static_dependencies.starknet.cairo.type_parser.UnknownCairoTypeError | class UnknownCairoTypeError(ValueError):
"""
Error thrown when TypeParser finds type that was not declared prior to parsing.
"""
type_name: str
def __init__(self, type_name: str):
super().__init__(f"Type '{type_name}' is not defined")
self.type_name = type_name | class UnknownCairoTypeError(ValueError):
'''
Error thrown when TypeParser finds type that was not declared prior to parsing.
'''
def __init__(self, type_name: str):
pass | 2 | 1 | 3 | 0 | 3 | 0 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 12 | 10 | 2 | 5 | 2 | 3 | 3 | 5 | 2 | 3 | 1 | 4 | 0 | 1 |
12,570 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/v1/type_parser.py | ccxt.static_dependencies.starknet.cairo.v1.type_parser.TypeParser | from ...abi.v1.parser_transformer import parse
from ..data_types import CairoType, EnumType, StructType, TypeIdentifier
from typing import Dict, Union
class TypeParser:
"""
Low level utility class for parsing Cairo types that can be used in external methods.
"""
defined_types: Dict[str, Union[StructTyp... |
class TypeParser:
'''
Low level utility class for parsing Cairo types that can be used in external methods.
'''
def __init__(self, defined_types: Dict[str, Union[StructType, EnumType]]):
'''
TypeParser constructor.
:param defined_types: dictionary containing all defined typ... | 3 | 3 | 14 | 2 | 8 | 5 | 4 | 0.76 | 0 | 7 | 5 | 0 | 2 | 0 | 2 | 2 | 36 | 6 | 17 | 6 | 14 | 13 | 15 | 6 | 12 | 4 | 0 | 3 | 7 |
12,571 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/v2/type_parser.py | ccxt.static_dependencies.starknet.cairo.v2.type_parser.TypeParser | from typing import Dict, Union
from ...abi.v2.parser_transformer import parse
from ..data_types import CairoType, EnumType, EventType, StructType, TypeIdentifier
class TypeParser:
"""
Low level utility class for parsing Cairo types that can be used in external methods.
"""
defined_types: Dict[str, Unio... |
class TypeParser:
'''
Low level utility class for parsing Cairo types that can be used in external methods.
'''
def __init__(self, defined_types: Dict[str, Union[StructType, EnumType, EventType]]):
'''
TypeParser constructor.
:param defined_types: dictionary containing all ... | 5 | 3 | 10 | 1 | 6 | 3 | 2 | 0.48 | 0 | 8 | 6 | 0 | 4 | 0 | 4 | 4 | 48 | 8 | 27 | 14 | 16 | 13 | 19 | 8 | 14 | 4 | 0 | 3 | 9 |
12,572 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/cairo/v2/type_parser.py | ccxt.static_dependencies.starknet.cairo.v2.type_parser.UnknownCairoTypeError | class UnknownCairoTypeError(ValueError):
"""
Error thrown when TypeParser finds type that was not declared prior to parsing.
"""
type_name: str
def __init__(self, type_name: str):
super().__init__(f"Type '{type_name}' is not defined. Please report this issue at https://github.com/software-m... | class UnknownCairoTypeError(ValueError):
'''
Error thrown when TypeParser finds type that was not declared prior to parsing.
'''
def __init__(self, type_name: str):
pass | 2 | 1 | 6 | 0 | 5 | 1 | 1 | 0.57 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 12 | 13 | 2 | 7 | 2 | 5 | 4 | 5 | 2 | 3 | 1 | 4 | 0 | 1 |
12,573 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py | ccxt.static_dependencies.starknet.hash.compiled_class_hash_objects.BytecodeLeaf | import dataclasses
from typing import Any, List, Union
from poseidon_py.poseidon_hash import poseidon_hash_many
@dataclasses.dataclass
class BytecodeLeaf(BytecodeSegmentStructure):
"""
Represents a leaf in the bytecode segment tree.
"""
data: List[int]
def hash(self) -> int:
return poseido... | @dataclasses.dataclass
class BytecodeLeaf(BytecodeSegmentStructure):
'''
Represents a leaf in the bytecode segment tree.
'''
def hash(self) -> int:
pass
def add_bytecode_with_skipped_segments(self, data: List[int]):
pass | 4 | 1 | 2 | 0 | 2 | 0 | 1 | 0.5 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 25 | 12 | 3 | 6 | 3 | 3 | 3 | 6 | 3 | 3 | 1 | 5 | 0 | 2 |
12,574 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py | ccxt.static_dependencies.starknet.hash.compiled_class_hash_objects.BytecodeSegment | import dataclasses
@dataclasses.dataclass
class BytecodeSegment:
"""
Represents a child of BytecodeSegmentedNode.
"""
segment_length: int
is_used: bool
inner_structure: BytecodeSegmentStructure
def __post_init__(self):
assert self.segment_length > 0, f'Invalid segment length: {self... | @dataclasses.dataclass
class BytecodeSegment:
'''
Represents a child of BytecodeSegmentedNode.
'''
def __post_init__(self):
pass | 3 | 1 | 4 | 0 | 4 | 0 | 1 | 1.25 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 20 | 2 | 8 | 2 | 6 | 10 | 6 | 2 | 4 | 1 | 0 | 0 | 1 |
12,575 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py | ccxt.static_dependencies.starknet.hash.compiled_class_hash_objects.BytecodeSegmentStructure | from abc import ABC, abstractmethod
from typing import Any, List, Union
class BytecodeSegmentStructure(ABC):
"""
Represents the structure of the bytecode to allow loading it partially into the OS memory.
See the documentation of the OS function `bytecode_hash_node` in `compiled_class.cairo`
for more de... |
class BytecodeSegmentStructure(ABC):
'''
Represents the structure of the bytecode to allow loading it partially into the OS memory.
See the documentation of the OS function `bytecode_hash_node` in `compiled_class.cairo`
for more details.
'''
@abstractmethod
def hash(self) -> int:
''... | 6 | 4 | 5 | 0 | 2 | 3 | 1 | 1.67 | 1 | 1 | 0 | 2 | 3 | 0 | 3 | 23 | 27 | 3 | 9 | 7 | 3 | 15 | 7 | 5 | 3 | 1 | 4 | 0 | 3 |
12,576 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py | ccxt.static_dependencies.starknet.hash.compiled_class_hash_objects.BytecodeSegmentedNode | import dataclasses
from typing import Any, List, Union
from poseidon_py.poseidon_hash import poseidon_hash_many
import itertools
@dataclasses.dataclass
class BytecodeSegmentedNode(BytecodeSegmentStructure):
"""
Represents an internal node in the bytecode segment tree.
Each child can be loaded into memory o... | @dataclasses.dataclass
class BytecodeSegmentedNode(BytecodeSegmentStructure):
'''
Represents an internal node in the bytecode segment tree.
Each child can be loaded into memory or skipped.
'''
def hash(self) -> int:
pass
def add_bytecode_with_skipped_segments(self, data: List[int]):
... | 4 | 1 | 10 | 0 | 10 | 1 | 2 | 0.24 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 25 | 28 | 3 | 21 | 5 | 18 | 5 | 10 | 4 | 7 | 3 | 5 | 2 | 4 |
12,577 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/models/typed_data.py | ccxt.static_dependencies.starknet.models.typed_data.ParameterDict | from typing import Any, Dict, List, Optional, TypedDict
class ParameterDict(TypedDict):
"""
TypedDict representing a Parameter object
"""
name: str
type: str |
class ParameterDict(TypedDict):
'''
TypedDict representing a Parameter object
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 1 | 3 | 1 | 2 | 3 | 3 | 1 | 2 | 0 | 1 | 0 | 0 |
12,578 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/models/typed_data.py | ccxt.static_dependencies.starknet.models.typed_data.Revision | from enum import Enum
class Revision(Enum):
"""
Enum representing the revision of the specification to be used.
"""
V0 = 0
V1 = 1 |
class Revision(Enum):
'''
Enum representing the revision of the specification to be used.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 7 | 1 | 3 | 3 | 2 | 3 | 3 | 3 | 2 | 0 | 4 | 0 | 0 |
12,579 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/models/typed_data.py | ccxt.static_dependencies.starknet.models.typed_data.StarkNetDomainDict | from typing import Any, Dict, List, Optional, TypedDict
class StarkNetDomainDict(TypedDict):
"""
TypedDict representing a domain object (both StarkNetDomain, StarknetDomain).
"""
name: str
version: str
chainId: str
revision: Optional[Revision] |
class StarkNetDomainDict(TypedDict):
'''
TypedDict representing a domain object (both StarkNetDomain, StarknetDomain).
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 1 | 5 | 1 | 4 | 3 | 5 | 1 | 4 | 0 | 1 | 0 | 0 |
12,580 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/models/typed_data.py | ccxt.static_dependencies.starknet.models.typed_data.TypedDataDict | from typing import Any, Dict, List, Optional, TypedDict
class TypedDataDict(TypedDict):
"""
TypedDict representing a TypedData object
"""
types: Dict[str, List[ParameterDict]]
primaryType: str
domain: StarkNetDomainDict
message: Dict[str, Any] |
class TypedDataDict(TypedDict):
'''
TypedDict representing a TypedData object
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 1 | 5 | 1 | 4 | 3 | 5 | 1 | 4 | 0 | 1 | 0 | 0 |
12,581 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/_calldata_reader.py | ccxt.static_dependencies.starknet.serialization._calldata_reader.CalldataReader | from typing import List
from ..cairo.felt import CairoData
class CalldataReader:
_data: List[int]
_position: int
def __init__(self, data: List[int]):
self._data = data
self._position = 0
@property
def remaining_len(self) -> int:
return len(self._data) - self._position
... |
class CalldataReader:
def __init__(self, data: List[int]):
pass
@property
def remaining_len(self) -> int:
pass
def read(self, size: int) -> CairoData:
pass | 5 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 0 | 3 | 1 | 0 | 3 | 0 | 3 | 3 | 25 | 4 | 21 | 6 | 16 | 0 | 16 | 5 | 12 | 3 | 0 | 1 | 5 |
12,582 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/_calldata_reader.py | ccxt.static_dependencies.starknet.serialization._calldata_reader.OutOfBoundsError | class OutOfBoundsError(Exception):
def __init__(self, position: int, requested_size: int, remaining_size: int):
super().__init__(f'Requested {requested_size} elements, {remaining_size} available.')
self.position = position
self.requested_size = requested_size
self.remaining_len = re... | class OutOfBoundsError(Exception):
def __init__(self, position: int, requested_size: int, remaining_size: int):
pass | 2 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 11 | 8 | 0 | 8 | 5 | 6 | 0 | 6 | 5 | 4 | 1 | 3 | 0 | 1 |
12,583 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/_context.py | ccxt.static_dependencies.starknet.serialization._context.Context | from typing import Any, Generator, Iterator, List
from ._calldata_reader import CairoData, CalldataReader, OutOfBoundsError
from contextlib import contextmanager
from .errors import InvalidTypeException, InvalidValueException
from abc import ABC
class Context(ABC):
"""
Holds information about context when (de)... |
class Context(ABC):
'''
Holds information about context when (de)serializing data. This is needed to inform what and where went
wrong during processing. Every separate (de)serialization should have its own context.
'''
def __init__(self):
pass
@property
def current_entity(self):
... | 12 | 3 | 8 | 1 | 6 | 2 | 2 | 0.37 | 1 | 8 | 3 | 2 | 7 | 0 | 7 | 27 | 75 | 12 | 46 | 14 | 34 | 17 | 32 | 9 | 24 | 6 | 4 | 1 | 15 |
12,584 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/_context.py | ccxt.static_dependencies.starknet.serialization._context.DeserializationContext | from ._calldata_reader import CairoData, CalldataReader, OutOfBoundsError
from typing import Any, Generator, Iterator, List
from .errors import InvalidTypeException, InvalidValueException
from contextlib import contextmanager
class DeserializationContext(Context):
"""
Context used during deserialization.
"... |
class DeserializationContext(Context):
'''
Context used during deserialization.
'''
def __init__(self, calldata: CairoData):
'''
Don't use default constructor. Use DeserializationContext.create context manager.
'''
pass
@classmethod
@contextmanager
def creat... | 6 | 2 | 8 | 0 | 7 | 1 | 2 | 0.29 | 1 | 4 | 2 | 0 | 2 | 1 | 3 | 30 | 36 | 5 | 24 | 12 | 18 | 7 | 19 | 11 | 15 | 3 | 5 | 1 | 5 |
12,585 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/_context.py | ccxt.static_dependencies.starknet.serialization._context.SerializationContext | from contextlib import contextmanager
from typing import Any, Generator, Iterator, List
class SerializationContext(Context):
"""
Context used during serialization.
"""
@classmethod
@contextmanager
def create(cls) -> Iterator[SerializationContext]:
context = cls()
with context._... |
class SerializationContext(Context):
'''
Context used during serialization.
'''
@classmethod
@contextmanager
def create(cls) -> Iterator[SerializationContext]:
pass | 4 | 1 | 4 | 0 | 4 | 0 | 1 | 0.71 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 28 | 13 | 1 | 7 | 4 | 3 | 5 | 5 | 3 | 3 | 1 | 5 | 1 | 1 |
12,586 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/array_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.array_serializer.ArraySerializer | from dataclasses import dataclass
from .._context import DeserializationContext, SerializationContext
from ..data_serializers.cairo_data_serializer import CairoDataSerializer
from typing import Generator, Iterable, List
from ..data_serializers._common import deserialize_to_list, serialize_from_list
@dataclass
class Ar... | @dataclass
class ArraySerializer(CairoDataSerializer[Iterable, List]):
'''
Serializer for arrays. In abi they are represented as a pointer to a type.
Can serialize any iterable and prepends its length to resulting list.
Deserializes data to a list.
Examples:
[1,2,3] => [3,1,2,3]
[] => [0]
... | 4 | 1 | 6 | 1 | 6 | 0 | 1 | 0.62 | 1 | 3 | 2 | 0 | 2 | 0 | 2 | 29 | 26 | 5 | 13 | 5 | 8 | 8 | 9 | 3 | 6 | 1 | 5 | 1 | 2 |
12,587 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/bool_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.bool_serializer.BoolSerializer | from dataclasses import dataclass
from typing import Generator
from .cairo_data_serializer import CairoDataSerializer
from .._context import Context, DeserializationContext, SerializationContext
@dataclass
class BoolSerializer(CairoDataSerializer[bool, int]):
"""
Serializer for boolean.
"""
def deseri... | @dataclass
class BoolSerializer(CairoDataSerializer[bool, int]):
'''
Serializer for boolean.
'''
def deserialize_with_context(self, context: DeserializationContext) -> bool:
pass
def serialize_with_context(self, context: SerializationContext, value: bool) -> Generator[int, None, None]:
... | 6 | 1 | 5 | 0 | 5 | 0 | 1 | 0.18 | 1 | 5 | 3 | 0 | 2 | 0 | 3 | 30 | 23 | 3 | 17 | 7 | 10 | 3 | 11 | 4 | 7 | 1 | 5 | 0 | 3 |
12,588 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/byte_array_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.byte_array_serializer.ByteArraySerializer | from .felt_serializer import FeltSerializer
from dataclasses import dataclass
from .cairo_data_serializer import CairoDataSerializer
from ...cairo.felt import decode_shortstring, encode_shortstring
from typing import Generator
from .._context import DeserializationContext, SerializationContext
from ._common import dese... | @dataclass
class ByteArraySerializer(CairoDataSerializer[str, str]):
'''
Serializer for ByteArrays. Serializes to and deserializes from str values.
Examples:
"" => [0,0,0]
"hello" => [0,448378203247,5]
'''
def deserialize_with_context(self, context: DeserializationContext) -> str:
p... | 4 | 1 | 18 | 3 | 15 | 0 | 2 | 0.2 | 1 | 7 | 3 | 0 | 2 | 0 | 2 | 29 | 45 | 9 | 30 | 9 | 25 | 6 | 21 | 7 | 18 | 2 | 5 | 1 | 3 |
12,589 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/cairo_data_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.cairo_data_serializer.CairoDataSerializer | from abc import ABC, abstractmethod
from typing import Generator, Generic, List, TypeVar
from .._calldata_reader import CairoData
from .._context import DeserializationContext, SerializationContext
class CairoDataSerializer(ABC, Generic[SerializationType, DeserializationType]):
"""
Base class for serializing/d... |
class CairoDataSerializer(ABC, Generic[SerializationType, DeserializationType]):
'''
Base class for serializing/deserializing data to/from calldata.
'''
def deserialize(self, data: List[int]) -> DeserializationType:
'''
Transform calldata into python value.
:param data: cal... | 9 | 5 | 8 | 1 | 3 | 4 | 1 | 1.26 | 2 | 4 | 2 | 14 | 4 | 0 | 5 | 27 | 53 | 10 | 19 | 16 | 6 | 24 | 12 | 7 | 6 | 1 | 4 | 1 | 5 |
12,590 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/enum_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.enum_serializer.EnumSerializer | from .._context import DeserializationContext, SerializationContext
from .cairo_data_serializer import CairoDataSerializer
from typing import Dict, Generator, OrderedDict, Tuple, Union
from dataclasses import dataclass
from ..tuple_dataclass import TupleDataclass
@dataclass
class EnumSerializer(CairoDataSerializer[Uni... | @dataclass
class EnumSerializer(CairoDataSerializer[Union[Dict, TupleDataclass], TupleDataclass]):
'''
Serializer of enums.
Can serialize a dictionary and TupleDataclass.
Deserializes data to a TupleDataclass.
Example:
enum MyEnum {
a: u128,
b: u128
}
{"a"... | 6 | 1 | 9 | 1 | 8 | 0 | 2 | 0.39 | 1 | 7 | 3 | 0 | 4 | 0 | 4 | 31 | 57 | 11 | 33 | 13 | 24 | 13 | 21 | 9 | 16 | 3 | 5 | 2 | 6 |
12,591 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/felt_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.felt_serializer.FeltSerializer | from typing import Generator
from .cairo_data_serializer import CairoDataSerializer
from ...constants import FIELD_PRIME
from ...cairo.felt import encode_shortstring, is_in_felt_range
from dataclasses import dataclass
from .._context import Context, DeserializationContext, SerializationContext
import warnings
@datacla... | @dataclass
class FeltSerializer(CairoDataSerializer[int, int]):
'''
Serializer for field element. At the time of writing it is the only existing numeric type.
'''
def deserialize_with_context(self, context: DeserializationContext) -> int:
pass
def serialize_with_context(self, context: Seri... | 6 | 1 | 8 | 0 | 8 | 0 | 1 | 0.12 | 1 | 6 | 3 | 0 | 2 | 0 | 3 | 30 | 33 | 4 | 26 | 7 | 19 | 3 | 16 | 4 | 12 | 2 | 5 | 1 | 4 |
12,592 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/named_tuple_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.named_tuple_serializer.NamedTupleSerializer | from ._common import deserialize_to_dict, serialize_from_dict
from ..tuple_dataclass import TupleDataclass
from dataclasses import dataclass
from .cairo_data_serializer import CairoDataSerializer
from .._context import DeserializationContext, SerializationContext
from typing import Dict, Generator, NamedTuple, OrderedD... | @dataclass
class NamedTupleSerializer(CairoDataSerializer[Union[Dict, NamedTuple, TupleDataclass], TupleDataclass]):
'''
Serializer for tuples with named fields.
Can serialize a dictionary, a named tuple and TupleDataclass.
Deserializes data to a TupleDataclass.
Example:
{"a": 1, "b": 2} => [1,2... | 6 | 1 | 8 | 1 | 6 | 1 | 1 | 0.38 | 1 | 7 | 3 | 0 | 2 | 0 | 3 | 30 | 40 | 7 | 24 | 15 | 11 | 9 | 11 | 6 | 7 | 2 | 5 | 0 | 4 |
12,593 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/option_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.option_serializer.OptionSerializer | from dataclasses import dataclass
from typing import Any, Generator, Optional
from .cairo_data_serializer import CairoDataSerializer
from .._context import DeserializationContext, SerializationContext
@dataclass
class OptionSerializer(CairoDataSerializer[Optional[Any], Optional[Any]]):
"""
Serializer for Optio... | @dataclass
class OptionSerializer(CairoDataSerializer[Optional[Any], Optional[Any]]):
'''
Serializer for Option type.
Can serialize None and common CairoTypes.
Deserializes data to None or CairoType.
Example:
None => [1]
{"option1": 123, "option2": None} => [0, 123, 1]
'''
d... | 4 | 1 | 8 | 1 | 8 | 0 | 2 | 0.47 | 1 | 4 | 2 | 0 | 2 | 0 | 2 | 29 | 30 | 5 | 17 | 8 | 10 | 8 | 12 | 4 | 9 | 2 | 5 | 1 | 4 |
12,594 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/output_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.output_serializer.OutputSerializer | from .._context import DeserializationContext, SerializationContext
from .cairo_data_serializer import CairoDataSerializer
from dataclasses import dataclass, field
from typing import Dict, Generator, List, Tuple
@dataclass
class OutputSerializer(CairoDataSerializer[List, Tuple]):
"""
Serializer for function ou... | @dataclass
class OutputSerializer(CairoDataSerializer[List, Tuple]):
'''
Serializer for function output.
Can't serialize anything.
Deserializes data to a Tuple.
Example:
[1, 1, 1] => (340282366920938463463374607431768211457)
'''
def deserialize_with_context(self, context: Deserializ... | 4 | 1 | 7 | 1 | 6 | 0 | 2 | 0.5 | 1 | 7 | 2 | 0 | 2 | 0 | 2 | 29 | 27 | 6 | 14 | 8 | 9 | 7 | 10 | 6 | 7 | 2 | 5 | 2 | 3 |
12,595 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/payload_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.payload_serializer.PayloadSerializer | from collections import OrderedDict as _OrderedDict
from .felt_serializer import FeltSerializer
from dataclasses import InitVar, dataclass, field
from .array_serializer import ArraySerializer
from .cairo_data_serializer import CairoDataSerializer
from ..tuple_dataclass import TupleDataclass
from typing import Dict, Gen... | @dataclass
class PayloadSerializer(CairoDataSerializer[Dict, TupleDataclass]):
'''
Serializer for payloads like function arguments/function outputs/events.
Can serialize a dictionary.
Deserializes data to a TupleDataclass.
Example:
{"a": 1, "b": 2} => [1,2]
'''
def __post_init__(self, i... | 7 | 2 | 7 | 0 | 6 | 1 | 1 | 0.52 | 1 | 8 | 5 | 0 | 3 | 0 | 4 | 31 | 48 | 7 | 27 | 12 | 17 | 14 | 12 | 7 | 7 | 1 | 5 | 0 | 4 |
12,596 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/struct_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.struct_serializer.StructSerializer | from typing import Dict, Generator, OrderedDict
from dataclasses import dataclass
from .._context import DeserializationContext, SerializationContext
from ._common import deserialize_to_dict, serialize_from_dict
from .cairo_data_serializer import CairoDataSerializer
@dataclass
class StructSerializer(CairoDataSerialize... | @dataclass
class StructSerializer(CairoDataSerializer[Dict, Dict]):
'''
Serializer of custom structures.
Can serialize a dictionary.
Deserializes data to a dictionary.
Example:
{"a": 1, "b": 2} => [1,2]
'''
def deserialize_with_context(self, context: DeserializationContext) -> Dict:
... | 4 | 1 | 3 | 0 | 3 | 0 | 1 | 0.88 | 1 | 3 | 2 | 0 | 2 | 0 | 2 | 29 | 19 | 4 | 8 | 5 | 3 | 7 | 6 | 3 | 3 | 1 | 5 | 0 | 2 |
12,597 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/tuple_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.tuple_serializer.TupleSerializer | from .._context import DeserializationContext, SerializationContext
from dataclasses import dataclass
from .cairo_data_serializer import CairoDataSerializer
from ._common import deserialize_to_list, serialize_from_list
from typing import Generator, Iterable, List, Tuple
@dataclass
class TupleSerializer(CairoDataSerial... | @dataclass
class TupleSerializer(CairoDataSerializer[Iterable, Tuple]):
'''
Serializer for tuples without named fields.
Can serialize any iterable.
Deserializes data to a python tuple.
Example:
(1,2,(3,4)) => [1,2,3,4]
'''
def deserialize_with_context(self, context: DeserializationConte... | 4 | 1 | 3 | 0 | 3 | 0 | 1 | 0.88 | 1 | 4 | 2 | 0 | 2 | 0 | 2 | 29 | 19 | 4 | 8 | 5 | 3 | 7 | 6 | 3 | 3 | 1 | 5 | 0 | 2 |
12,598 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/uint256_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.uint256_serializer.Uint256Serializer | from dataclasses import dataclass
from typing import Generator, TypedDict, Union
from ...cairo.felt import uint256_range_check
from .._context import Context, DeserializationContext, SerializationContext
from .cairo_data_serializer import CairoDataSerializer
@dataclass
class Uint256Serializer(CairoDataSerializer[Union... | @dataclass
class Uint256Serializer(CairoDataSerializer[Union[int, Uint256Dict], int]):
'''
Serializer of Uint256. In Cairo it is represented by structure {low: Uint128, high: Uint128}.
Can serialize an int.
Deserializes data to an int.
Examples:
0 => [0,0]
1 => [1,0]
2**128 => [0,1]
... | 9 | 1 | 7 | 0 | 6 | 0 | 1 | 0.31 | 1 | 6 | 4 | 0 | 3 | 0 | 5 | 32 | 54 | 8 | 35 | 13 | 23 | 11 | 26 | 7 | 20 | 2 | 5 | 1 | 6 |
12,599 | ccxt/ccxt | python/ccxt/static_dependencies/starknet/serialization/data_serializers/uint_serializer.py | ccxt.static_dependencies.starknet.serialization.data_serializers.uint_serializer.Uint256Dict | from typing import Generator, TypedDict, Union
class Uint256Dict(TypedDict):
low: int
high: int |
class Uint256Dict(TypedDict):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 3 | 1 | 2 | 0 | 3 | 1 | 2 | 0 | 1 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.