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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16,200 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_tfidf_vectorizer.py | onnx.reference.ops.op_tfidf_vectorizer.NgramPart | class NgramPart:
def __init__(self, nid: int):
self.id_ = nid
self._leafs_ = None
def init(self):
self._leafs_ = IntMap()
def __repr__(self):
if self.empty():
return f'NgramPart({self.id_})'
return f'NgramPart({self.id_}, {self.leafs_!r})'
def empt... | class NgramPart:
def __init__(self, nid: int):
pass
def init(self):
pass
def __repr__(self):
pass
def empty(self):
pass
def has_leaves(self):
pass
@property
def leafs_(self):
pass
def find(self, key):
pass
def emplace(sel... | 11 | 0 | 3 | 0 | 3 | 0 | 1 | 0.14 | 0 | 3 | 1 | 0 | 9 | 2 | 9 | 9 | 37 | 8 | 29 | 13 | 18 | 4 | 28 | 12 | 18 | 3 | 0 | 1 | 13 |
16,201 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_tfidf_vectorizer.py | onnx.reference.ops.op_tfidf_vectorizer.TfIdfVectorizer | from onnx.reference.op_run import OpRun
import numpy as np
class TfIdfVectorizer(OpRun):
def __init__(self, onnx_node, run_params):
OpRun.__init__(self, onnx_node, run_params)
mode = self.mode
if mode == 'TF':
self.weighting_criteria_ = WeightingCriteria.TF
elif mode ==... |
class TfIdfVectorizer(OpRun):
def __init__(self, onnx_node, run_params):
pass
def increment_count(self, ngram_id: int, row_num: int, frequencies: list[int]) -> None:
pass
def output_result(self, B: int, frequencies: list[int]) -> np.ndarray:
pass
def compute_impl(self, X: np... | 7 | 0 | 45 | 3 | 39 | 7 | 8 | 0.18 | 1 | 9 | 2 | 0 | 5 | 11 | 5 | 44 | 256 | 24 | 217 | 87 | 181 | 38 | 137 | 58 | 130 | 16 | 5 | 4 | 45 |
16,202 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_tfidf_vectorizer.py | onnx.reference.ops.op_tfidf_vectorizer.WeightingCriteria | from enum import IntEnum
class WeightingCriteria(IntEnum):
NONE = 0
TF = 1
IDF = 2
TFIDF = 3 |
class WeightingCriteria(IntEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 5 | 0 | 5 | 5 | 4 | 0 | 5 | 5 | 4 | 0 | 3 | 0 | 0 |
16,203 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_thresholded_relu.py | onnx.reference.ops.op_thresholded_relu.ThresholdedRelu | import numpy as np
from onnx.reference.ops._op import OpRunUnaryNum
class ThresholdedRelu(OpRunUnaryNum):
def _run(self, x, alpha=None):
alpha = alpha or self.alpha
return (np.where(x > alpha, x, 0).astype(x.dtype),) |
class ThresholdedRelu(OpRunUnaryNum):
def _run(self, x, alpha=None):
pass | 2 | 0 | 3 | 0 | 3 | 3 | 1 | 0.75 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 4 | 0 | 4 | 2 | 2 | 3 | 4 | 2 | 2 | 1 | 7 | 0 | 1 |
16,204 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_tile.py | onnx.reference.ops.op_tile.Tile | import numpy as np
from onnx.reference.op_run import OpRun
class Tile(OpRun):
def _run(self, x, repeats):
return (np.tile(x, repeats),) |
class Tile(OpRun):
def _run(self, x, repeats):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,205 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_topk.py | onnx.reference.ops.op_topk.TopK_1 | class TopK_1(_CommonTopK):
def _run(self, data, k=None, axis=None):
"""Runtime for operator *TopK*.
The implementation is not the most efficient
as it sorts everything then extracts the top *k*
values.
.. warning::
ONNX specifications may be imprecise in case of... | class TopK_1(_CommonTopK):
def _run(self, data, k=None, axis=None):
'''Runtime for operator *TopK*.
The implementation is not the most efficient
as it sorts everything then extracts the top *k*
values.
.. warning::
ONNX specifications may be imprecise in case of ... | 2 | 1 | 13 | 1 | 2 | 12 | 1 | 4 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 14 | 1 | 3 | 2 | 1 | 12 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
16,206 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_topk.py | onnx.reference.ops.op_topk.TopK_10 | class TopK_10(_CommonTopK):
def _run(self, data, ink, axis=None):
"""Runtime for operator *TopK*.
The implementation is not the most efficient
as it sorts everything then extracts the top *k*
values.
.. warning::
ONNX specifications may be imprecise in case of n... | class TopK_10(_CommonTopK):
def _run(self, data, ink, axis=None):
'''Runtime for operator *TopK*.
The implementation is not the most efficient
as it sorts everything then extracts the top *k*
values.
.. warning::
ONNX specifications may be imprecise in case of ne... | 2 | 1 | 13 | 1 | 2 | 11 | 1 | 3.67 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 14 | 1 | 3 | 2 | 1 | 11 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
16,207 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_topk.py | onnx.reference.ops.op_topk.TopK_11 | class TopK_11(_CommonTopK):
def _run(self, data, ink, axis=None, largest=None, sorted=None):
"""Runtime for operator *TopK*.
The implementation is not the most efficient
as it sorts everything then extracts the top *k*
values.
.. warning::
ONNX specifications m... | class TopK_11(_CommonTopK):
def _run(self, data, ink, axis=None, largest=None, sorted=None):
'''Runtime for operator *TopK*.
The implementation is not the most efficient
as it sorts everything then extracts the top *k*
values.
.. warning::
ONNX specifications may... | 2 | 1 | 23 | 2 | 11 | 12 | 2 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 41 | 24 | 2 | 12 | 9 | 3 | 12 | 5 | 2 | 3 | 2 | 6 | 1 | 2 |
16,208 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_topk.py | onnx.reference.ops.op_topk._CommonTopK | import numpy as np
from onnx.reference.op_run import OpRun
class _CommonTopK(OpRun):
def _common_run(self, data, ink, axis, largest=1):
"""Runtime for operator *TopK*.
The implementation is not the most efficient
as it sorts everything then extracts the top *k*
values.
.. ... |
class _CommonTopK(OpRun):
def _common_run(self, data, ink, axis, largest=1):
'''Runtime for operator *TopK*.
The implementation is not the most efficient
as it sorts everything then extracts the top *k*
values.
.. warning::
ONNX specifications may be imprecise i... | 2 | 1 | 16 | 1 | 5 | 12 | 2 | 2 | 1 | 0 | 0 | 3 | 1 | 0 | 1 | 40 | 17 | 1 | 6 | 4 | 4 | 12 | 6 | 4 | 4 | 2 | 5 | 0 | 2 |
16,209 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_transpose.py | onnx.reference.ops.op_transpose.Transpose | import numpy as np
from onnx.reference.op_run import OpRun
class Transpose(OpRun):
def _run(self, data, perm=None):
perm_ = None if perm is None or len(perm) == 0 else perm
if perm_ is None:
return (np.transpose(data),)
if len(perm_) != len(data.shape):
raise Runtim... |
class Transpose(OpRun):
def _run(self, data, perm=None):
pass | 2 | 0 | 9 | 0 | 9 | 1 | 4 | 0.1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 10 | 0 | 10 | 3 | 8 | 1 | 8 | 3 | 6 | 4 | 5 | 1 | 4 |
16,210 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_trilu.py | onnx.reference.ops.op_trilu.Trilu | from onnx.reference.op_run import OpRun
import numpy as np
class Trilu(OpRun):
def _run(self, x, k=None, upper=None):
k = 0 if k is None else k.item()
if upper:
return (np.triu(x, k),)
return (np.tril(x, k).astype(x.dtype),) |
class Trilu(OpRun):
def _run(self, x, k=None, upper=None):
pass | 2 | 0 | 5 | 0 | 5 | 2 | 3 | 0.33 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 6 | 0 | 6 | 2 | 4 | 2 | 6 | 2 | 4 | 3 | 5 | 1 | 3 |
16,211 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_unique.py | onnx.reference.ops.op_unique.Unique | import numpy as np
from onnx.reference.op_run import OpRun
class Unique(OpRun):
def _run(self, x, axis=None, sorted=None):
if axis is None or np.isnan(axis):
y, indices, inverse_indices, counts = np.unique(x, True, True, True)
else:
y, indices, inverse_indices, counts = np.... |
class Unique(OpRun):
def _run(self, x, axis=None, sorted=None):
pass | 2 | 0 | 32 | 2 | 29 | 2 | 6 | 0.07 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 40 | 33 | 2 | 30 | 5 | 28 | 2 | 21 | 5 | 19 | 6 | 5 | 1 | 6 |
16,212 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_unsqueeze.py | onnx.reference.ops.op_unsqueeze.Unsqueeze_1 | import numpy as np
from onnx.reference.op_run import OpRun
class Unsqueeze_1(OpRun):
def _run(self, data, axes=None):
if isinstance(axes, np.ndarray):
axes = tuple(axes)
elif axes in ([], ()):
axes = None
elif isinstance(axes, list):
axes = tuple(axes)
... |
class Unsqueeze_1(OpRun):
def _run(self, data, axes=None):
pass | 2 | 0 | 16 | 0 | 16 | 2 | 6 | 0.12 | 1 | 3 | 0 | 1 | 1 | 0 | 1 | 40 | 17 | 0 | 17 | 4 | 15 | 2 | 12 | 4 | 10 | 6 | 5 | 2 | 6 |
16,213 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_unsqueeze.py | onnx.reference.ops.op_unsqueeze.Unsqueeze_11 | class Unsqueeze_11(Unsqueeze_1):
pass | class Unsqueeze_11(Unsqueeze_1):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 40 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 6 | 0 | 0 |
16,214 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_unsqueeze.py | onnx.reference.ops.op_unsqueeze.Unsqueeze_13 | import numpy as np
from onnx.reference.op_run import OpRun
class Unsqueeze_13(OpRun):
def _run(self, data, axes=None):
if axes is not None:
if hasattr(axes, '__iter__') and len(axes.shape) > 0:
try:
sq = np.expand_dims(data, axis=tuple(axes))
... |
class Unsqueeze_13(OpRun):
def _run(self, data, axes=None):
pass | 2 | 0 | 20 | 0 | 19 | 2 | 6 | 0.1 | 1 | 4 | 0 | 0 | 1 | 0 | 1 | 40 | 21 | 0 | 20 | 4 | 18 | 2 | 15 | 4 | 13 | 6 | 5 | 5 | 6 |
16,215 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_upsample.py | onnx.reference.ops.op_upsample.Upsample | from onnx.reference.op_run import OpRun
import numpy as np
class Upsample(OpRun):
def _run(self, x, scale, mode=None):
if mode == 'nearest' and scale.astype(np.int64).tolist() == scale.tolist():
r = x
for axis, s in enumerate(scale):
if s == 1:
c... |
class Upsample(OpRun):
def _run(self, x, scale, mode=None):
pass | 2 | 0 | 9 | 0 | 9 | 1 | 4 | 0.1 | 1 | 3 | 0 | 0 | 1 | 0 | 1 | 40 | 10 | 0 | 10 | 4 | 8 | 1 | 10 | 4 | 8 | 4 | 5 | 3 | 4 |
16,216 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_where.py | onnx.reference.ops.op_where.Where | from onnx.reference.op_run import OpRun
import numpy as np
class Where(OpRun):
def _run(self, condition, x, y):
if x.dtype != y.dtype and x.dtype not in (object,) and (x.dtype.type is not np.str_) and (y.dtype.type is not np.str_):
raise RuntimeError(f'x and y should share the same dtype {x.dt... |
class Where(OpRun):
def _run(self, condition, x, y):
pass | 2 | 0 | 11 | 0 | 11 | 1 | 2 | 0.08 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 12 | 0 | 12 | 2 | 10 | 1 | 5 | 2 | 3 | 2 | 5 | 1 | 2 |
16,217 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_xor.py | onnx.reference.ops.op_xor.Xor | import numpy as np
from onnx.reference.ops._op import OpRunBinary
class Xor(OpRunBinary):
def _run(self, x, y):
return (np.logical_xor(x, y),) |
class Xor(OpRunBinary):
def _run(self, x, y):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
16,218 | onnx/onnx | onnx_onnx/onnx/reference/ops_optimized/op_conv_optimized.py | onnx.reference.ops_optimized.op_conv_optimized.Conv | from onnx.reference.op_run import OpRun
class Conv(OpRun):
def _run(self, X, W, B=None, auto_pad=None, dilations=None, group=None, kernel_shape=None, pads=None, strides=None):
if len(X.shape) < 3:
raise ValueError(f'X must have at least 3 dimensions but its shape is {X.shape}.')
return... |
class Conv(OpRun):
def _run(self, X, W, B=None, auto_pad=None, dilations=None, group=None, kernel_shape=None, pads=None, strides=None):
pass | 2 | 0 | 22 | 0 | 21 | 3 | 2 | 0.14 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 23 | 0 | 22 | 13 | 9 | 3 | 5 | 2 | 3 | 2 | 5 | 1 | 2 |
16,219 | onnx/onnx | onnx_onnx/onnx/reference/reference_evaluator.py | onnx.reference.reference_evaluator.ReferenceEvaluator | import numpy as np
from onnx.onnx_pb import FunctionProto, GraphProto, ModelProto, NodeProto, TensorProto, TypeProto
import onnx
from onnx.reference.ops_optimized import optimized_operators
from typing import Any
from io import BytesIO
from onnx.reference import op_run
import onnx.model_container
class ReferenceEvalua... |
class ReferenceEvaluator:
'''Computes the outputs of an ONNX proto (`ModelProto`, `FunctionProto`, `GraphProto`, `NodeProto`).
This is a pure python implementation of ONNX specifications.
Mismatches may remain between the official specifications and the implementation here.
In the case of such a mismat... | 23 | 11 | 26 | 1 | 22 | 4 | 6 | 0.58 | 0 | 24 | 6 | 1 | 15 | 17 | 15 | 15 | 575 | 75 | 335 | 94 | 292 | 193 | 224 | 70 | 203 | 30 | 0 | 4 | 89 |
16,220 | onnx/onnx | onnx_onnx/onnx/serialization.py | onnx.serialization.ProtoSerializer | from typing import Any, Protocol, TypeVar
class ProtoSerializer(Protocol):
"""A serializer-deserializer to and from in-memory Protocol Buffers representations."""
supported_format: str
file_extensions: Collection[str]
def serialize_proto(self, proto: _Proto) -> Any:
"""Serialize a in-memory pr... |
class ProtoSerializer(Protocol):
'''A serializer-deserializer to and from in-memory Protocol Buffers representations.'''
def serialize_proto(self, proto: _Proto) -> Any:
'''Serialize a in-memory proto to a serialized data type.'''
pass
def deserialize_proto(self, serialized: Any, proto: _... | 3 | 3 | 2 | 0 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 5 | 2 | 0 | 2 | 26 | 19 | 4 | 5 | 3 | 2 | 10 | 5 | 3 | 2 | 1 | 5 | 0 | 2 |
16,221 | onnx/onnx | onnx_onnx/onnx/serialization.py | onnx.serialization._JsonSerializer | import google.protobuf.json_format
import google.protobuf.message
import google.protobuf.text_format
class _JsonSerializer(ProtoSerializer):
"""Serialize and deserialize JSON."""
supported_format = 'json'
file_extensions = frozenset({'.json', '.onnxjson'})
def serialize_proto(self, proto: _Proto) -> b... |
class _JsonSerializer(ProtoSerializer):
'''Serialize and deserialize JSON.'''
def serialize_proto(self, proto: _Proto) -> bytes:
pass
def deserialize_proto(self, serialized: bytes | str, proto: _Proto) -> _Proto:
pass | 3 | 1 | 7 | 0 | 7 | 0 | 2 | 0.06 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 28 | 21 | 3 | 17 | 6 | 14 | 1 | 13 | 6 | 10 | 3 | 6 | 1 | 4 |
16,222 | onnx/onnx | onnx_onnx/onnx/serialization.py | onnx.serialization._ProtobufSerializer | import google.protobuf.json_format
import onnx
import google.protobuf.message
import google.protobuf.text_format
import typing
class _ProtobufSerializer(ProtoSerializer):
"""Serialize and deserialize protobuf message."""
supported_format = 'protobuf'
file_extensions = frozenset({'.onnx', '.pb'})
def s... |
class _ProtobufSerializer(ProtoSerializer):
'''Serialize and deserialize protobuf message.'''
def serialize_proto(self, proto: _Proto) -> bytes:
pass
def deserialize_proto(self, serialized: bytes, proto: _Proto) -> _Proto:
pass | 3 | 1 | 13 | 0 | 13 | 1 | 4 | 0.07 | 1 | 4 | 0 | 0 | 2 | 0 | 2 | 28 | 33 | 3 | 29 | 8 | 26 | 2 | 20 | 7 | 17 | 4 | 6 | 3 | 7 |
16,223 | onnx/onnx | onnx_onnx/onnx/serialization.py | onnx.serialization._Registry | class _Registry:
def __init__(self) -> None:
self._serializers: dict[str, ProtoSerializer] = {}
self._extension_to_format: dict[str, str] = {}
def register(self, serializer: ProtoSerializer) -> None:
self._serializers[serializer.supported_format] = serializer
self._extension_to... | class _Registry:
def __init__(self) -> None:
pass
def register(self, serializer: ProtoSerializer) -> None:
pass
def get(self, fmt: str) -> ProtoSerializer:
'''Get a serializer for a format.
Args:
fmt: The format to get a serializer for.
Returns:
... | 5 | 2 | 9 | 1 | 4 | 4 | 1 | 0.83 | 0 | 5 | 1 | 0 | 4 | 2 | 4 | 4 | 41 | 8 | 18 | 7 | 13 | 15 | 14 | 7 | 9 | 2 | 0 | 1 | 5 |
16,224 | onnx/onnx | onnx_onnx/onnx/serialization.py | onnx.serialization._TextProtoSerializer | import google.protobuf.message
import google.protobuf.json_format
import google.protobuf.text_format
class _TextProtoSerializer(ProtoSerializer):
"""Serialize and deserialize text proto."""
supported_format = 'textproto'
file_extensions = frozenset({'.txtpb', '.textproto', '.prototxt', '.pbtxt'})
def ... |
class _TextProtoSerializer(ProtoSerializer):
'''Serialize and deserialize text proto.'''
def serialize_proto(self, proto: _Proto) -> bytes:
pass
def deserialize_proto(self, serialized: bytes | str, proto: _Proto) -> _Proto:
pass | 3 | 1 | 6 | 0 | 6 | 0 | 2 | 0.07 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 28 | 19 | 3 | 15 | 6 | 12 | 1 | 13 | 6 | 10 | 3 | 6 | 1 | 4 |
16,225 | onnx/onnx | onnx_onnx/onnx/serialization.py | onnx.serialization._TextualSerializer | import warnings
import onnx
class _TextualSerializer(ProtoSerializer):
"""Serialize and deserialize the ONNX textual representation."""
supported_format = 'onnxtxt'
file_extensions = frozenset({'.onnxtxt', '.onnxtext'})
def serialize_proto(self, proto: _Proto) -> bytes:
text = onnx.printer.to_... |
class _TextualSerializer(ProtoSerializer):
'''Serialize and deserialize the ONNX textual representation.'''
def serialize_proto(self, proto: _Proto) -> bytes:
pass
def deserialize_proto(self, serialized: bytes | str, proto: _Proto) -> _Proto:
pass | 3 | 1 | 13 | 0 | 13 | 3 | 4 | 0.21 | 1 | 4 | 0 | 0 | 2 | 0 | 2 | 28 | 32 | 3 | 28 | 7 | 25 | 6 | 22 | 7 | 19 | 7 | 6 | 1 | 8 |
16,226 | onnx/onnx | onnx_onnx/onnx/utils.py | onnx.utils.Extractor | import onnx.checker
import onnx.shape_inference
import onnx.helper
from collections import deque
class Extractor:
def __init__(self, model: ModelProto) -> None:
self.model = model
self.graph = self.model.graph
self.initializers: dict[str, TensorProto] = self._build_name2obj_dict(self.graph... |
class Extractor:
def __init__(self, model: ModelProto) -> None:
pass
@staticmethod
def _build_name2obj_dict(objs) -> dict:
pass
@staticmethod
def _build_output_dict(graph) -> dict[str, int]:
pass
def _collect_new_io(self, io_names_to_extract: list[str]) -> list[ValueIn... | 13 | 1 | 13 | 0 | 11 | 2 | 2 | 0.13 | 0 | 8 | 0 | 0 | 10 | 5 | 12 | 12 | 166 | 12 | 138 | 83 | 92 | 18 | 87 | 50 | 74 | 5 | 0 | 3 | 28 |
16,227 | onnx/onnx | onnx_onnx/setup.py | setup.BuildExt | import setuptools
import glob
import setuptools.command.develop
import os
import setuptools.command.build_ext
import setuptools.command.build_py
class BuildExt(setuptools.command.build_ext.build_ext):
def run(self):
self.run_command('cmake_build')
return super().run()
def build_extensions(sel... |
class BuildExt(setuptools.command.build_ext.build_ext):
def run(self):
pass
def build_extensions(self):
pass | 3 | 0 | 21 | 2 | 17 | 3 | 4 | 0.15 | 0 | 1 | 0 | 0 | 2 | 0 | 2 | 2 | 44 | 5 | 34 | 16 | 31 | 5 | 32 | 16 | 29 | 7 | 0 | 3 | 8 |
16,228 | onnx/onnx | onnx_onnx/setup.py | setup.BuildPy | import setuptools.command.develop
import setuptools.command.build_ext
import setuptools
import setuptools.command.build_py
class BuildPy(setuptools.command.build_py.build_py):
def run(self):
if self.editable_mode:
dst_dir = TOP_DIR
else:
dst_dir = self.build_lib
cre... |
class BuildPy(setuptools.command.build_py.build_py):
def run(self):
pass | 2 | 0 | 7 | 0 | 7 | 0 | 2 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 71 | 8 | 0 | 8 | 3 | 6 | 0 | 7 | 3 | 5 | 2 | 3 | 1 | 2 |
16,229 | onnx/onnx | onnx_onnx/setup.py | setup.CmakeBuild | import setuptools.command.build_py
import os
import subprocess
import setuptools
from typing import ClassVar
import multiprocessing
import platform
import logging
import setuptools.command.develop
import setuptools.command.build_ext
import shlex
class CmakeBuild(setuptools.Command):
"""Compiles everything when `py... |
class CmakeBuild(setuptools.Command):
'''Compiles everything when `python setup.py build` is run using cmake.
Custom args can be passed to cmake by specifying the `CMAKE_ARGS`
environment variable.
The number of CPUs used by `make` can be specified by passing `-j<ncpus>`
to `setup.py build`. By de... | 4 | 1 | 27 | 1 | 25 | 2 | 7 | 0.14 | 1 | 1 | 0 | 0 | 3 | 0 | 3 | 42 | 99 | 9 | 80 | 10 | 76 | 11 | 56 | 10 | 52 | 16 | 2 | 4 | 20 |
16,230 | onnx/onnx | onnx_onnx/setup.py | setup.Develop | import setuptools.command.build_py
import setuptools
import setuptools.command.build_ext
import setuptools.command.develop
class Develop(setuptools.command.develop.develop):
def run(self):
create_version(TOP_DIR)
return super().run() |
class Develop(setuptools.command.develop.develop):
def run(self):
pass | 2 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 68 | 4 | 0 | 4 | 2 | 2 | 0 | 4 | 2 | 2 | 1 | 3 | 0 | 1 |
16,231 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/Ticker.py | yfinance.Ticker.Ticker | import warnings
from .base import TickerBase
from .const import _BASE_URL_, _SENTINEL_
from collections import namedtuple as _namedtuple
from .scrapers.funds import FundsData
import pandas as _pd
class Ticker(TickerBase):
def __init__(self, ticker, session=None, proxy=_SENTINEL_):
if proxy is not _SENTINE... |
class Ticker(TickerBase):
def __init__(self, ticker, session=None, proxy=_SENTINEL_):
pass
def __repr__(self):
pass
def _download_options(self, date=None):
pass
def _options2df(self, opt, tz=None):
pass
def option_chain(self, date=None, tz=None):
pass
... | 112 | 1 | 3 | 0 | 3 | 0 | 1 | 0.02 | 1 | 7 | 1 | 0 | 53 | 2 | 53 | 99 | 272 | 60 | 208 | 110 | 106 | 4 | 135 | 62 | 81 | 5 | 1 | 2 | 63 |
16,232 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/base.py | yfinance.base.TickerBase | from curl_cffi import requests
import numpy as np
from .exceptions import YFEarningsDateMissing, YFRateLimitError
import json as _json
from typing import Optional, Union
from .scrapers.funds import FundsData
from .scrapers.fundamentals import Fundamentals
from .scrapers.history import PriceHistory
from urllib.parse imp... |
class TickerBase:
def __init__(self, ticker, session=None, proxy=_SENTINEL_):
'''
Initialize a Yahoo Finance Ticker object.
Args:
ticker (str | tuple[str, str]):
Yahoo Finance symbol (e.g. "AAPL")
or a tuple of (symbol, MIC) e.g. ('OR','XPAR')
... | 54 | 13 | 13 | 1 | 9 | 3 | 3 | 0.32 | 0 | 24 | 10 | 2 | 46 | 18 | 46 | 46 | 646 | 101 | 415 | 140 | 363 | 133 | 391 | 131 | 344 | 14 | 0 | 4 | 122 |
16,233 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache.ISODateTimeField | import datetime as _dt
import peewee as _peewee
class ISODateTimeField(_peewee.DateTimeField):
def db_value(self, value):
if value and isinstance(value, _dt.datetime):
return value.isoformat()
return super().db_value(value)
def python_value(self, value):
if value and isins... |
class ISODateTimeField(_peewee.DateTimeField):
def db_value(self, value):
pass
def python_value(self, value):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 2 | 0.33 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 2 | 12 | 0 | 9 | 3 | 6 | 3 | 9 | 3 | 6 | 2 | 1 | 1 | 4 |
16,234 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache._CookieCache | from .utils import get_yf_logger
import datetime as _dt
import peewee as _peewee
import pickle as _pkl
class _CookieCache:
def __init__(self):
self.initialised = -1
self.db = None
self.dummy = False
def get_db(self):
if self.db is not None:
return self.db
t... |
class _CookieCache:
def __init__(self):
pass
def get_db(self):
pass
def initialise(self):
pass
def lookup(self, strategy):
pass
def store(self, strategy, cookie):
pass | 6 | 0 | 15 | 2 | 13 | 1 | 4 | 0.06 | 0 | 5 | 3 | 0 | 5 | 3 | 5 | 5 | 81 | 13 | 68 | 17 | 62 | 4 | 65 | 15 | 59 | 7 | 0 | 2 | 21 |
16,235 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache._CookieCacheDummy | class _CookieCacheDummy:
"""Dummy cache to use if Cookie cache is disabled"""
def lookup(self, tkr):
return None
def store(self, tkr, Cookie):
pass
@property
def Cookie_db(self):
return None | class _CookieCacheDummy:
'''Dummy cache to use if Cookie cache is disabled'''
def lookup(self, tkr):
pass
def store(self, tkr, Cookie):
pass
@property
def Cookie_db(self):
pass | 5 | 1 | 2 | 0 | 2 | 0 | 1 | 0.13 | 0 | 0 | 0 | 0 | 3 | 0 | 3 | 3 | 12 | 3 | 8 | 5 | 3 | 1 | 7 | 4 | 3 | 1 | 0 | 0 | 3 |
16,236 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache._CookieCacheException | class _CookieCacheException(Exception):
pass | class _CookieCacheException(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
16,237 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache._CookieCacheManager | class _CookieCacheManager:
_Cookie_cache = None
@classmethod
def get_cookie_cache(cls):
if cls._Cookie_cache is None:
with _cache_init_lock:
cls._initialise()
return cls._Cookie_cache
@classmethod
def _initialise(cls, cache_dir=None):
cls._Cookie... | class _CookieCacheManager:
@classmethod
def get_cookie_cache(cls):
pass
@classmethod
def _initialise(cls, cache_dir=None):
pass | 5 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 2 | 2 | 13 | 2 | 11 | 6 | 6 | 0 | 9 | 4 | 6 | 2 | 0 | 2 | 3 |
16,238 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache._CookieDBManager | import os as _os
import peewee as _peewee
import platformdirs as _ad
class _CookieDBManager:
_db = None
_cache_dir = _os.path.join(_ad.user_cache_dir(), 'py-yfinance')
@classmethod
def get_database(cls):
if cls._db is None:
cls._initialise()
return cls._db
@classmethod... |
class _CookieDBManager:
@classmethod
def get_database(cls):
pass
@classmethod
def close_db(cls):
pass
@classmethod
def _initialise(cls, cache_dir=None):
pass
@classmethod
def set_location(cls, new_cache_dir):
pass
@classmethod
def get_location(cl... | 11 | 0 | 7 | 0 | 6 | 0 | 3 | 0.03 | 0 | 3 | 1 | 0 | 0 | 0 | 5 | 5 | 48 | 8 | 39 | 14 | 28 | 1 | 30 | 8 | 24 | 5 | 0 | 2 | 13 |
16,239 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache._TzCache | from .utils import get_yf_logger
import peewee as _peewee
class _TzCache:
def __init__(self):
self.initialised = -1
self.db = None
self.dummy = False
def get_db(self):
if self.db is not None:
return self.db
try:
self.db = _TzDBManager.get_databa... |
class _TzCache:
def __init__(self):
pass
def get_db(self):
pass
def initialise(self):
pass
def lookup(self, key):
pass
def store(self, key, value):
pass | 6 | 0 | 16 | 2 | 14 | 1 | 4 | 0.07 | 0 | 4 | 3 | 0 | 5 | 3 | 5 | 5 | 84 | 13 | 70 | 15 | 64 | 5 | 67 | 13 | 61 | 8 | 0 | 3 | 22 |
16,240 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache._TzCacheDummy | class _TzCacheDummy:
"""Dummy cache to use if tz cache is disabled"""
def lookup(self, tkr):
return None
def store(self, tkr, tz):
pass
@property
def tz_db(self):
return None | class _TzCacheDummy:
'''Dummy cache to use if tz cache is disabled'''
def lookup(self, tkr):
pass
def store(self, tkr, tz):
pass
@property
def tz_db(self):
pass | 5 | 1 | 2 | 0 | 2 | 0 | 1 | 0.13 | 0 | 0 | 0 | 0 | 3 | 0 | 3 | 3 | 12 | 3 | 8 | 5 | 3 | 1 | 7 | 4 | 3 | 1 | 0 | 0 | 3 |
16,241 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache._TzCacheException | class _TzCacheException(Exception):
pass | class _TzCacheException(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
16,242 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache._TzCacheManager | class _TzCacheManager:
_tz_cache = None
@classmethod
def get_tz_cache(cls):
if cls._tz_cache is None:
with _cache_init_lock:
cls._initialise()
return cls._tz_cache
@classmethod
def _initialise(cls, cache_dir=None):
cls._tz_cache = _TzCache() | class _TzCacheManager:
@classmethod
def get_tz_cache(cls):
pass
@classmethod
def _initialise(cls, cache_dir=None):
pass | 5 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 2 | 2 | 13 | 2 | 11 | 6 | 6 | 0 | 9 | 4 | 6 | 2 | 0 | 2 | 3 |
16,243 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/cache.py | yfinance.cache._TzDBManager | import peewee as _peewee
import os as _os
import platformdirs as _ad
class _TzDBManager:
_db = None
_cache_dir = _os.path.join(_ad.user_cache_dir(), 'py-yfinance')
@classmethod
def get_database(cls):
if cls._db is None:
cls._initialise()
return cls._db
@classmethod
... |
class _TzDBManager:
@classmethod
def get_database(cls):
pass
@classmethod
def close_db(cls):
pass
@classmethod
def _initialise(cls, cache_dir=None):
pass
@classmethod
def set_location(cls, new_cache_dir):
pass
@classmethod
def get_location(cls):
... | 11 | 0 | 8 | 1 | 7 | 0 | 3 | 0.02 | 0 | 3 | 1 | 0 | 0 | 0 | 5 | 5 | 52 | 9 | 42 | 15 | 31 | 1 | 33 | 9 | 27 | 6 | 0 | 2 | 14 |
16,244 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/data.py | yfinance.data.SingletonMeta | import threading
class SingletonMeta(type):
"""
Metaclass that creates a Singleton instance.
"""
_instances = {}
_lock = threading.Lock()
def __call__(cls, *args, **kwargs):
with cls._lock:
if cls not in cls._instances:
instance = super().__call__(*args, **k... |
class SingletonMeta(type):
'''
Metaclass that creates a Singleton instance.
'''
def __call__(cls, *args, **kwargs):
pass | 2 | 1 | 8 | 0 | 8 | 0 | 2 | 0.27 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 14 | 15 | 1 | 11 | 5 | 9 | 3 | 10 | 5 | 8 | 2 | 2 | 2 | 2 |
16,245 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/data.py | yfinance.data.YfData | from curl_cffi import requests
from functools import lru_cache
import datetime
from .exceptions import YFRateLimitError, YFDataException
from . import utils, cache
import threading
from bs4 import BeautifulSoup
from urllib.parse import urlsplit, urljoin
class YfData(metaclass=SingletonMeta):
"""
Have one place... |
class YfData(metaclass=SingletonMeta):
'''
Have one place to retrieve data from Yahoo API in order to ease caching and speed up operations.
Singleton means one session one cookie shared by all threads.
'''
def __init__(self, session=None, proxy=None):
pass
def _set_session(self, sessi... | 33 | 3 | 17 | 2 | 15 | 1 | 3 | 0.09 | 1 | 8 | 1 | 0 | 19 | 7 | 19 | 33 | 363 | 50 | 287 | 65 | 258 | 26 | 230 | 58 | 209 | 11 | 3 | 3 | 64 |
16,246 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/domain/domain.py | yfinance.domain.domain.Domain | from ..ticker import Ticker
from ..const import _QUERY1_URL_, _SENTINEL_
from abc import ABC, abstractmethod
from ..data import YfData
import warnings
import pandas as _pd
from typing import Dict, List, Optional
class Domain(ABC):
"""
Abstract base class representing a domain entity in financial data, with key... |
class Domain(ABC):
'''
Abstract base class representing a domain entity in financial data, with key attributes
and methods for fetching and parsing data. Derived classes must implement the `_fetch_and_parse()` method.
'''
def __init__(self, key: str, session=None, proxy=_SENTINEL_):
'... | 23 | 15 | 12 | 1 | 5 | 6 | 1 | 1.12 | 1 | 4 | 2 | 2 | 14 | 9 | 14 | 34 | 188 | 33 | 73 | 36 | 50 | 82 | 54 | 28 | 39 | 2 | 4 | 1 | 16 |
16,247 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/domain/industry.py | yfinance.domain.industry.Industry | import pandas as _pd
from typing import Dict, Optional
from .domain import Domain, _QUERY_URL_
from ..const import _SENTINEL_
from ..data import YfData
import warnings
from .. import utils
class Industry(Domain):
"""
Represents an industry within a sector.
"""
def __init__(self, key, session=None, pro... |
class Industry(Domain):
'''
Represents an industry within a sector.
'''
def __init__(self, key, session=None, proxy=_SENTINEL_):
'''
Args:
key (str): The key identifier for the industry.
session (optional): The session to use for requests.
'''
pa... | 14 | 10 | 14 | 2 | 6 | 5 | 1 | 0.81 | 1 | 3 | 0 | 0 | 9 | 5 | 9 | 43 | 140 | 26 | 63 | 27 | 49 | 51 | 52 | 22 | 42 | 2 | 5 | 1 | 12 |
16,248 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/domain/market.py | yfinance.domain.market.Market | from ..const import _QUERY1_URL_, _SENTINEL_
import json as _json
import datetime as dt
from ..data import utils, YfData
import warnings
class Market:
def __init__(self, market: 'str', session=None, proxy=_SENTINEL_, timeout=30):
self.market = market
self.session = session
self.timeout = t... |
class Market:
def __init__(self, market: 'str', session=None, proxy=_SENTINEL_, timeout=30):
pass
def _fetch_json(self, url, params):
pass
def _parse_data(self):
pass
@property
def status(self):
pass
@property
def summary(self):
pass | 8 | 0 | 16 | 2 | 14 | 1 | 2 | 0.06 | 0 | 7 | 1 | 0 | 5 | 8 | 5 | 5 | 93 | 18 | 72 | 23 | 64 | 4 | 54 | 20 | 48 | 5 | 0 | 2 | 11 |
16,249 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/domain/sector.py | yfinance.domain.sector.Sector | from .domain import Domain, _QUERY_URL_
from ..const import SECTOR_INDUSTY_MAPPING_LC, _SENTINEL_
import warnings
from ..utils import dynamic_docstring, generate_list_table_from_dict, get_yf_logger
import pandas as _pd
from ..data import YfData
from typing import Dict, Optional
class Sector(Domain):
"""
Repres... |
class Sector(Domain):
'''
Represents a financial market sector and allows retrieval of sector-related data
such as top ETFs, top mutual funds, and industry data.
'''
def __init__(self, key, session=None, proxy=_SENTINEL_):
'''
Args:
key (str): The key representing the ... | 14 | 10 | 14 | 2 | 5 | 7 | 1 | 1.26 | 1 | 3 | 0 | 0 | 9 | 4 | 9 | 43 | 140 | 27 | 50 | 23 | 36 | 63 | 42 | 19 | 32 | 2 | 5 | 1 | 10 |
16,250 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/exceptions.py | yfinance.exceptions.YFDataException | class YFDataException(YFException):
pass | class YFDataException(YFException):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
16,251 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/exceptions.py | yfinance.exceptions.YFEarningsDateMissing | class YFEarningsDateMissing(YFTickerMissingError):
def __init__(self, ticker):
super().__init__(ticker, 'no earnings dates found') | class YFEarningsDateMissing(YFTickerMissingError):
def __init__(self, ticker):
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0.33 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 13 | 4 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,252 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/exceptions.py | yfinance.exceptions.YFException | class YFException(Exception):
def __init__(self, description=''):
super().__init__(description) | class YFException(Exception):
def __init__(self, description=''):
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 4 | 1 | 0 | 1 | 11 | 3 | 0 | 3 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
16,253 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/exceptions.py | yfinance.exceptions.YFInvalidPeriodError | class YFInvalidPeriodError(YFException):
def __init__(self, ticker, invalid_period, valid_ranges):
self.ticker = ticker
self.invalid_period = invalid_period
self.valid_ranges = valid_ranges
super().__init__(f"{self.ticker}: Period '{invalid_period}' is invalid, must be one of: {vali... | class YFInvalidPeriodError(YFException):
def __init__(self, ticker, invalid_period, valid_ranges):
pass | 2 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 3 | 1 | 12 | 7 | 0 | 7 | 5 | 5 | 0 | 6 | 5 | 4 | 1 | 4 | 0 | 1 |
16,254 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/exceptions.py | yfinance.exceptions.YFNotImplementedError | class YFNotImplementedError(NotImplementedError):
def __init__(self, method_name):
super().__init__(f"Have not implemented fetching '{method_name}' from Yahoo API") | class YFNotImplementedError(NotImplementedError):
def __init__(self, method_name):
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 13 | 3 | 0 | 3 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,255 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/exceptions.py | yfinance.exceptions.YFPricesMissingError | class YFPricesMissingError(YFTickerMissingError):
def __init__(self, ticker, debug_info):
self.debug_info = debug_info
if debug_info != '':
super().__init__(ticker, f'no price data found {debug_info}')
else:
super().__init__(ticker, 'no price data found') | class YFPricesMissingError(YFTickerMissingError):
def __init__(self, ticker, debug_info):
pass | 2 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 13 | 7 | 0 | 7 | 3 | 5 | 0 | 6 | 3 | 4 | 2 | 5 | 1 | 2 |
16,256 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/exceptions.py | yfinance.exceptions.YFRateLimitError | class YFRateLimitError(YFException):
def __init__(self):
super().__init__('Too Many Requests. Rate limited. Try after a while.') | class YFRateLimitError(YFException):
def __init__(self):
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 12 | 3 | 0 | 3 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
16,257 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/exceptions.py | yfinance.exceptions.YFTickerMissingError | class YFTickerMissingError(YFException):
def __init__(self, ticker, rationale):
super().__init__(f'${ticker}: possibly delisted; {rationale}')
self.rationale = rationale
self.ticker = ticker | class YFTickerMissingError(YFException):
def __init__(self, ticker, rationale):
pass | 2 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 3 | 1 | 2 | 1 | 12 | 5 | 0 | 5 | 4 | 3 | 0 | 5 | 4 | 3 | 1 | 4 | 0 | 1 |
16,258 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/exceptions.py | yfinance.exceptions.YFTzMissingError | class YFTzMissingError(YFTickerMissingError):
def __init__(self, ticker):
super().__init__(ticker, 'no timezone found') | class YFTzMissingError(YFTickerMissingError):
def __init__(self, ticker):
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 13 | 3 | 0 | 3 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,259 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/scrapers/analysis.py | yfinance.scrapers.analysis.Analysis | from yfinance.scrapers.quote import _QUOTE_SUMMARY_URL_
import pandas as pd
from yfinance.data import YfData
from yfinance import utils
import warnings
from yfinance.const import quote_summary_valid_modules, _SENTINEL_
from yfinance.exceptions import YFException
import curl_cffi
class Analysis:
def __init__(self,... |
class Analysis:
def __init__(self, data: YfData, symbol: str, proxy=_SENTINEL_):
pass
def _get_periodic_df(self, key) -> pd.DataFrame:
pass
@property
def earnings_estimate(self) -> pd.DataFrame:
pass
@property
def revenue_estimate(self) -> pd.DataFrame:
pass
... | 19 | 0 | 14 | 1 | 13 | 0 | 4 | 0.03 | 0 | 7 | 2 | 0 | 11 | 11 | 11 | 11 | 179 | 27 | 148 | 56 | 129 | 4 | 139 | 48 | 127 | 10 | 0 | 4 | 46 |
16,260 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/scrapers/fundamentals.py | yfinance.scrapers.fundamentals.Financials | import warnings
from yfinance.data import YfData
import pandas as pd
import datetime
from yfinance.exceptions import YFException, YFNotImplementedError
from yfinance import utils, const
import json
class Financials:
def __init__(self, data: YfData, symbol: str):
self._data = data
self._symbol = sy... |
class Financials:
def __init__(self, data: YfData, symbol: str):
pass
def get_income_time_series(self, freq='yearly', proxy=const._SENTINEL_) -> pd.DataFrame:
pass
def get_balance_sheet_time_series(self, freq='yearly', proxy=const._SENTINEL_) -> pd.DataFrame:
pass
def get_ca... | 9 | 0 | 14 | 2 | 11 | 2 | 3 | 0.14 | 0 | 9 | 2 | 0 | 7 | 5 | 7 | 7 | 106 | 18 | 77 | 37 | 68 | 11 | 75 | 35 | 67 | 7 | 0 | 3 | 22 |
16,261 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/scrapers/fundamentals.py | yfinance.scrapers.fundamentals.Fundamentals | from yfinance import utils, const
from yfinance.data import YfData
from yfinance.exceptions import YFException, YFNotImplementedError
import warnings
import pandas as pd
class Fundamentals:
def __init__(self, data: YfData, symbol: str, proxy=const._SENTINEL_):
if proxy is not const._SENTINEL_:
... |
class Fundamentals:
def __init__(self, data: YfData, symbol: str, proxy=const._SENTINEL_):
pass
@property
def financials(self) -> 'Financials':
pass
@property
def earnings(self) -> dict:
pass
@property
def shares(self) -> pd.DataFrame:
pass | 8 | 0 | 6 | 1 | 5 | 0 | 1 | 0 | 0 | 6 | 3 | 0 | 4 | 9 | 4 | 4 | 30 | 6 | 24 | 17 | 16 | 0 | 21 | 14 | 16 | 2 | 0 | 1 | 5 |
16,262 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/scrapers/funds.py | yfinance.scrapers.funds.FundsData | from yfinance.data import YfData
from typing import Dict, Optional
from yfinance.exceptions import YFDataException
from yfinance.const import _BASE_URL_, _SENTINEL_
import pandas as pd
from yfinance import utils
import warnings
class FundsData:
"""
ETF and Mutual Funds Data
Queried Modules: quoteType, summ... |
class FundsData:
'''
ETF and Mutual Funds Data
Queried Modules: quoteType, summaryProfile, fundProfile, topHoldings
Notes:
- fundPerformance module is not implemented as better data is queryable using history
'''
def __init__(self, data: YfData, symbol: str, proxy=_SENTINEL_):
'''... | 28 | 18 | 17 | 2 | 9 | 6 | 2 | 0.63 | 0 | 7 | 2 | 0 | 16 | 13 | 17 | 17 | 326 | 49 | 170 | 55 | 142 | 107 | 103 | 44 | 85 | 3 | 0 | 1 | 31 |
16,263 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/scrapers/history.py | yfinance.scrapers.history.PriceHistory | import bisect
import pandas as pd
from yfinance.const import _BASE_URL_, _PRICE_COLNAMES_, _SENTINEL_
from math import isclose
import numpy as np
from curl_cffi import requests
from yfinance import shared, utils
import logging
import warnings
import dateutil as _dateutil
from yfinance.exceptions import YFInvalidPeriodE... |
class PriceHistory:
def __init__(self, data, ticker, tz, session=None, proxy=_SENTINEL_):
pass
@utils.log_indent_decorator
def history(self, period=None, interval='1d', start=None, end=None, prepost=False, actions=True, auto_adjust=True, back_adjust=False, repair=False, keepna=False, proxy=_SENTIN... | 31 | 1 | 149 | 13 | 115 | 22 | 30 | 0.2 | 0 | 21 | 4 | 0 | 17 | 9 | 17 | 17 | 2,806 | 266 | 2,145 | 496 | 2,111 | 419 | 1,954 | 482 | 1,933 | 173 | 0 | 10 | 575 |
16,264 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/scrapers/holders.py | yfinance.scrapers.holders.Holders | from yfinance.data import YfData
import warnings
from yfinance import utils
from yfinance.exceptions import YFDataException
from yfinance.const import _BASE_URL_, _SENTINEL_
import curl_cffi
import pandas as pd
class Holders:
_SCRAPE_URL_ = 'https://finance.yahoo.com/quote'
def __init__(self, data: YfData, sy... |
class Holders:
def __init__(self, data: YfData, symbol: str, proxy=_SENTINEL_):
pass
@property
def major(self) -> pd.DataFrame:
pass
@property
def institutional(self) -> pd.DataFrame:
pass
@property
def mutualfund(self) -> pd.DataFrame:
pass
@property
... | 25 | 0 | 12 | 0 | 11 | 1 | 3 | 0.05 | 0 | 6 | 2 | 0 | 16 | 10 | 17 | 17 | 231 | 25 | 198 | 64 | 173 | 10 | 140 | 56 | 122 | 4 | 0 | 2 | 43 |
16,265 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/scrapers/quote.py | yfinance.scrapers.quote.FastInfo | import datetime
import numpy as _np
from yfinance.const import quote_summary_valid_modules, _BASE_URL_, _QUERY1_URL_, _SENTINEL_
import pandas as pd
import warnings
from yfinance import utils
import json
class FastInfo:
def __init__(self, tickerBaseObject, proxy=_SENTINEL_):
self._tkr = tickerBaseObject
... |
class FastInfo:
def __init__(self, tickerBaseObject, proxy=_SENTINEL_):
pass
def keys(self):
pass
def items(self):
pass
def values(self):
pass
def get(self, key, default=None):
pass
def __getitem__(self, k):
pass
def __contains__(self, ... | 57 | 0 | 11 | 1 | 9 | 1 | 3 | 0.1 | 0 | 7 | 0 | 0 | 36 | 33 | 36 | 36 | 458 | 74 | 350 | 135 | 293 | 36 | 316 | 114 | 279 | 7 | 0 | 3 | 103 |
16,266 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/scrapers/quote.py | yfinance.scrapers.quote.Quote | import pandas as pd
from yfinance import utils
from yfinance.exceptions import YFDataException, YFException
import warnings
from yfinance.data import YfData
import json
import curl_cffi
import datetime
from yfinance.const import quote_summary_valid_modules, _BASE_URL_, _QUERY1_URL_, _SENTINEL_
class Quote:
def __... |
class Quote:
def __init__(self, data: YfData, symbol: str, proxy=_SENTINEL_):
pass
@property
def info(self) -> dict:
pass
@property
def sustainability(self) -> pd.DataFrame:
pass
@property
def recommendations(self) -> pd.DataFrame:
pass
@property
def... | 23 | 0 | 18 | 1 | 14 | 3 | 4 | 0.24 | 0 | 11 | 3 | 0 | 12 | 13 | 13 | 13 | 267 | 28 | 193 | 68 | 171 | 46 | 169 | 58 | 154 | 8 | 0 | 4 | 56 |
16,267 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/screener/query.py | yfinance.screener.query.EquityQuery | from ..utils import dynamic_docstring, generate_list_table_from_dict_universal
from yfinance.const import EQUITY_SCREENER_EQ_MAP, EQUITY_SCREENER_FIELDS
from typing import List, Union, Dict, TypeVar, Tuple
class EquityQuery(QueryBase):
"""
The `EquityQuery` class constructs filters for stocks based on specific... |
class EquityQuery(QueryBase):
'''
The `EquityQuery` class constructs filters for stocks based on specific criteria such as region, sector, exchange, and peer group.
Start with value operations: `EQ` (equals), `IS-IN` (is in), `BTWN` (between), `GT` (greater than), `LT` (less than), `GTE` (greater or equal)... | 7 | 3 | 6 | 0 | 2 | 4 | 1 | 2.33 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 33 | 38 | 8 | 9 | 5 | 2 | 21 | 5 | 3 | 2 | 1 | 5 | 0 | 2 |
16,268 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/screener/query.py | yfinance.screener.query.FundQuery | from typing import List, Union, Dict, TypeVar, Tuple
from ..utils import dynamic_docstring, generate_list_table_from_dict_universal
from yfinance.const import FUND_SCREENER_EQ_MAP, FUND_SCREENER_FIELDS
class FundQuery(QueryBase):
"""
The `FundQuery` class constructs filters for mutual funds based on specific c... |
class FundQuery(QueryBase):
'''
The `FundQuery` class constructs filters for mutual funds based on specific criteria such as region, sector, exchange, and peer group.
Start with value operations: `EQ` (equals), `IS-IN` (is in), `BTWN` (between), `GT` (greater than), `LT` (less than), `GTE` (greater or equa... | 7 | 3 | 6 | 0 | 2 | 4 | 1 | 2.67 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 33 | 40 | 7 | 9 | 5 | 2 | 24 | 5 | 3 | 2 | 1 | 5 | 0 | 2 |
16,269 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/screener/query.py | yfinance.screener.query.QueryBase | import numbers
from yfinance.exceptions import YFNotImplementedError
from typing import List, Union, Dict, TypeVar, Tuple
from abc import ABC, abstractmethod
class QueryBase(ABC):
def __init__(self, operator: str, operand: Union[List['QueryBase'], Tuple[str, Tuple[Union[str, numbers.Real], ...]]]):
operat... |
class QueryBase(ABC):
def __init__(self, operator: str, operand: Union[List['QueryBase'], Tuple[str, Tuple[Union[str, numbers.Real], ...]]]):
pass
@property
@abstractmethod
def valid_fields(self) -> List:
pass
@property
@abstractmethod
def valid_values(self) -> Dict:
... | 16 | 0 | 10 | 1 | 9 | 1 | 4 | 0.09 | 1 | 9 | 1 | 2 | 11 | 2 | 11 | 31 | 124 | 16 | 99 | 24 | 83 | 9 | 82 | 22 | 70 | 8 | 4 | 3 | 43 |
16,270 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/search.py | yfinance.search.Search | from . import utils
import warnings
from .data import YfData
from .const import _BASE_URL_, _SENTINEL_
import json as _json
class Search:
def __init__(self, query, max_results=8, news_count=8, lists_count=8, include_cb=True, include_nav_links=False, include_research=False, include_cultural_assets=False, enable_fu... |
class Search:
def __init__(self, query, max_results=8, news_count=8, lists_count=8, include_cb=True, include_nav_links=False, include_research=False, include_cultural_assets=False, enable_fuzzy_query=False, recommended=8, session=None, proxy=_SENTINEL_, timeout=30, raise_errors=True):
'''
Fetches ... | 17 | 9 | 13 | 1 | 9 | 3 | 1 | 0.32 | 0 | 5 | 1 | 0 | 9 | 23 | 9 | 9 | 130 | 18 | 85 | 45 | 66 | 27 | 60 | 36 | 50 | 3 | 0 | 1 | 11 |
16,271 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/ticker.py | yfinance.ticker.Ticker | from collections import namedtuple as _namedtuple
from .base import TickerBase
import warnings
import pandas as _pd
from .const import _BASE_URL_, _SENTINEL_
from .scrapers.funds import FundsData
class Ticker(TickerBase):
def __init__(self, ticker, session=None, proxy=_SENTINEL_):
if proxy is not _SENTINE... |
class Ticker(TickerBase):
def __init__(self, ticker, session=None, proxy=_SENTINEL_):
pass
def __repr__(self):
pass
def _download_options(self, date=None):
pass
def _options2df(self, opt, tz=None):
pass
def option_chain(self, date=None, tz=None):
pass
... | 112 | 1 | 3 | 0 | 3 | 0 | 1 | 0.02 | 1 | 7 | 1 | 0 | 53 | 2 | 53 | 99 | 272 | 60 | 208 | 110 | 106 | 4 | 135 | 62 | 81 | 5 | 1 | 2 | 63 |
16,272 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/tickers.py | yfinance.tickers.Tickers | from .data import YfData
import warnings
from .live import WebSocket
from .const import _SENTINEL_
from . import Ticker, multi
class Tickers:
def __repr__(self):
return f"yfinance.Tickers object <{','.join(self.symbols)}>"
def __init__(self, tickers, session=None):
tickers = tickers if isinst... |
class Tickers:
def __repr__(self):
pass
def __init__(self, tickers, session=None):
pass
def history(self, period='1mo', interval='1d', start=None, end=None, prepost=False, actions=True, auto_adjust=True, repair=False, proxy=_SENTINEL_, threads=True, group_by='column', progress=True, time... | 7 | 0 | 11 | 1 | 10 | 0 | 2 | 0.06 | 0 | 1 | 0 | 0 | 5 | 2 | 5 | 5 | 63 | 11 | 49 | 20 | 33 | 3 | 19 | 10 | 13 | 3 | 0 | 1 | 8 |
16,273 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/utils.py | yfinance.utils.IndentLoggerAdapter | import logging
class IndentLoggerAdapter(logging.LoggerAdapter):
def process(self, msg, kwargs):
if get_yf_logger().isEnabledFor(logging.DEBUG):
i = ' ' * self.extra['indent']
if not isinstance(msg, str):
msg = str(msg)
msg = '\n'.join([i + m for m in ms... |
class IndentLoggerAdapter(logging.LoggerAdapter):
def process(self, msg, kwargs):
pass | 2 | 0 | 7 | 0 | 7 | 0 | 3 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 20 | 8 | 0 | 8 | 3 | 6 | 0 | 8 | 3 | 6 | 3 | 2 | 2 | 3 |
16,274 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/utils.py | yfinance.utils.IndentationContext | class IndentationContext:
def __init__(self, increment=1):
self.increment = increment
def __enter__(self):
_indentation_level.indent = getattr(_indentation_level, 'indent', 0) + self.increment
def __exit__(self, exc_type, exc_val, exc_tb):
_indentation_level.indent -= self.increme... | class IndentationContext:
def __init__(self, increment=1):
pass
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, exc_tb):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 3 | 3 | 9 | 2 | 7 | 5 | 3 | 0 | 7 | 5 | 3 | 1 | 0 | 0 | 3 |
16,275 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/utils.py | yfinance.utils.MultiLineFormatter | import re as _re
import logging
class MultiLineFormatter(logging.Formatter):
def __init__(self, fmt):
super().__init__(fmt)
match = _re.search('%\\(levelname\\)-(\\d+)s', fmt)
self.level_length = int(match.group(1)) if match else 0
def format(self, record):
original = super().... |
class MultiLineFormatter(logging.Formatter):
def __init__(self, fmt):
pass
def format(self, record):
pass | 3 | 0 | 11 | 0 | 10 | 2 | 3 | 0.3 | 1 | 2 | 0 | 0 | 2 | 1 | 2 | 9 | 26 | 1 | 20 | 10 | 17 | 6 | 18 | 10 | 15 | 3 | 2 | 2 | 5 |
16,276 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/utils.py | yfinance.utils.ProgressBar | import sys as _sys
class ProgressBar:
def __init__(self, iterations, text='completed'):
self.text = text
self.iterations = iterations
self.prog_bar = '[]'
self.fill_char = '*'
self.width = 50
self.__update_amount(0)
self.elapsed = 1
def completed(self):... |
class ProgressBar:
def __init__(self, iterations, text='completed'):
pass
def completed(self):
pass
def animate(self, iteration=None):
pass
def update_iteration(self, val=None):
pass
def __update_amount(self, new_amount):
pass
def __str__(self):
... | 7 | 0 | 7 | 0 | 6 | 0 | 2 | 0 | 0 | 3 | 0 | 0 | 6 | 6 | 6 | 6 | 45 | 6 | 39 | 18 | 32 | 0 | 38 | 18 | 31 | 2 | 0 | 1 | 9 |
16,277 | ranaroussi/fix-yahoo-finance | ranaroussi_fix-yahoo-finance/yfinance/utils.py | yfinance.utils.YFLogFormatter | import logging
class YFLogFormatter(logging.Filter):
def filter(self, record):
msg = record.msg
if hasattr(record, 'yf_cat'):
msg = f'{record.yf_cat}: {msg}'
if hasattr(record, 'yf_interval'):
msg = f'{record.yf_interval}: {msg}'
if hasattr(record, 'yf_symbo... |
class YFLogFormatter(logging.Filter):
def filter(self, record):
pass | 2 | 0 | 10 | 0 | 10 | 0 | 4 | 0.09 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 3 | 12 | 0 | 11 | 3 | 9 | 1 | 11 | 3 | 9 | 4 | 2 | 1 | 4 |
16,278 | quantopian/zipline | quantopian_zipline/setup.py | setup.LazyBuildExtCommandClass | class LazyBuildExtCommandClass(dict):
"""
Lazy command class that defers operations requiring Cython and numpy until
they've actually been downloaded and installed by setup_requires.
"""
def __contains__(self, key):
return key == 'build_ext' or super(LazyBuildExtCommandClass, self).__contai... | class LazyBuildExtCommandClass(dict):
'''
Lazy command class that defers operations requiring Cython and numpy until
they've actually been downloaded and installed by setup_requires.
'''
def __contains__(self, key):
pass
def __setitem__(self, key, value):
pass
def __getite... | 6 | 3 | 12 | 2 | 7 | 4 | 2 | 0.68 | 1 | 3 | 1 | 0 | 3 | 0 | 3 | 30 | 43 | 6 | 22 | 10 | 14 | 15 | 19 | 10 | 11 | 2 | 2 | 1 | 7 |
16,279 | quantopian/zipline | quantopian_zipline/zipline/algorithm.py | zipline.algorithm.NoBenchmark | class NoBenchmark(ValueError):
def __init__(self):
super(NoBenchmark, self).__init__('Must specify either benchmark_sid or benchmark_returns.') | class NoBenchmark(ValueError):
def __init__(self):
pass | 2 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 12 | 5 | 0 | 5 | 2 | 3 | 0 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
16,280 | quantopian/zipline | quantopian_zipline/zipline/algorithm.py | zipline.algorithm.TradingAlgorithm | from zipline.utils.events import EventManager, make_eventrule, date_rules, time_rules, calendars, AfterOpen, BeforeClose
from datetime import tzinfo, time
from zipline.pipeline.engine import ExplodingPipelineEngine, SimplePipelineEngine
from zipline.sources.requests_csv import PandasRequestsCSV
from zipline.utils.panda... | null | 147 | 59 | 25 | 3 | 12 | 11 | 2 | 0.93 | 1 | 61 | 51 | 12 | 75 | 36 | 80 | 80 | 2,267 | 315 | 1,013 | 323 | 768 | 939 | 506 | 187 | 424 | 16 | 1 | 2 | 183 |
16,281 | quantopian/zipline | quantopian_zipline/zipline/assets/asset_writer.py | zipline.assets.asset_writer.AssetDBWriter | from zipline.utils.compat import ExitStack
from zipline.utils.preprocess import preprocess
import pandas as pd
from toolz import first
from zipline.assets.asset_db_schema import ASSET_DB_VERSION, asset_db_table_names, asset_router, equities as equities_table, equity_symbol_mappings, equity_supplementary_mappings as equ... |
class AssetDBWriter(object):
'''Class used to write data to an assets db.
Parameters
----------
engine : Engine or str
An SQLAlchemy engine or path to a SQL database.
'''
@preprocess(engine=coerce_string_to_eng(require_exists=False))
def __init__(self, engine):
pass
def... | 14 | 6 | 46 | 5 | 25 | 17 | 4 | 0.69 | 1 | 2 | 0 | 0 | 12 | 1 | 12 | 12 | 573 | 68 | 299 | 68 | 255 | 206 | 108 | 35 | 95 | 8 | 1 | 2 | 47 |
16,282 | quantopian/zipline | quantopian_zipline/zipline/assets/asset_writer.py | zipline.assets.asset_writer._empty | class _empty(object):
columns = () | class _empty(object):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
16,283 | quantopian/zipline | quantopian_zipline/zipline/assets/assets.py | zipline.assets.assets.AssetConvertible | from abc import ABCMeta
from six import with_metaclass, string_types, viewkeys, iteritems
class AssetConvertible(with_metaclass(ABCMeta)):
"""
ABC for types that are convertible to integer-representations of
Assets.
Includes Asset, six.string_types, and Integral
"""
pass |
class AssetConvertible(with_metaclass(ABCMeta)):
'''
ABC for types that are convertible to integer-representations of
Assets.
Includes Asset, six.string_types, and Integral
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 1 | 2 | 1 | 1 | 5 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
16,284 | quantopian/zipline | quantopian_zipline/zipline/assets/assets.py | zipline.assets.assets.AssetFinder | from . import Asset, Equity, Future
from .continuous_futures import ADJUSTMENT_STYLES, CHAIN_PREDICATES, ContinuousFuture, OrderedContracts
from zipline.utils.preprocess import preprocess
from .exchange_info import ExchangeInfo
from zipline.utils.sqlite_utils import group_into_chunks, coerce_string_to_eng
from zipline.... |
class AssetFinder(object):
'''
An AssetFinder is an interface to a database of Asset metadata written by
an ``AssetDBWriter``.
This class provides methods for looking up assets by unique integer id or
by symbol. For historical reasons, we refer to these unique ids as 'sids'.
Parameters
---... | 59 | 19 | 25 | 3 | 13 | 9 | 3 | 0.69 | 1 | 31 | 14 | 0 | 40 | 9 | 43 | 43 | 1,241 | 185 | 625 | 198 | 539 | 433 | 400 | 157 | 353 | 15 | 1 | 3 | 139 |
16,285 | quantopian/zipline | quantopian_zipline/zipline/assets/assets.py | zipline.assets.assets.NotAssetConvertible | class NotAssetConvertible(ValueError):
pass | class NotAssetConvertible(ValueError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
16,286 | quantopian/zipline | quantopian_zipline/zipline/assets/assets.py | zipline.assets.assets.PricingDataAssociable | from six import with_metaclass, string_types, viewkeys, iteritems
from abc import ABCMeta
class PricingDataAssociable(with_metaclass(ABCMeta)):
"""
ABC for types that can be associated with pricing data.
Includes Asset, Future, ContinuousFuture
"""
pass |
class PricingDataAssociable(with_metaclass(ABCMeta)):
'''
ABC for types that can be associated with pricing data.
Includes Asset, Future, ContinuousFuture
'''
pass | 1 | 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 |
16,287 | quantopian/zipline | quantopian_zipline/zipline/assets/exchange_info.py | zipline.assets.exchange_info.ExchangeInfo | from zipline.utils.calendars import get_calendar
class ExchangeInfo(object):
"""An exchange where assets are traded.
Parameters
----------
name : str or None
The full name of the exchange, for example 'NEW YORK STOCK EXCHANGE' or
'NASDAQ GLOBAL MARKET'.
canonical_name : str
... |
class ExchangeInfo(object):
'''An exchange where assets are traded.
Parameters
----------
name : str or None
The full name of the exchange, for example 'NEW YORK STOCK EXCHANGE' or
'NASDAQ GLOBAL MARKET'.
canonical_name : str
The canonical name of the exchange, for example '... | 7 | 2 | 6 | 1 | 5 | 0 | 2 | 0.9 | 1 | 1 | 0 | 0 | 5 | 3 | 5 | 5 | 64 | 9 | 29 | 11 | 22 | 26 | 20 | 10 | 14 | 2 | 1 | 1 | 8 |
16,288 | quantopian/zipline | quantopian_zipline/zipline/assets/roll_finder.py | zipline.assets.roll_finder.CalendarRollFinder | class CalendarRollFinder(RollFinder):
"""
The CalendarRollFinder calculates contract rolls based purely on the
contract's auto close date.
"""
def __init__(self, trading_calendar, asset_finder):
self.trading_calendar = trading_calendar
self.asset_finder = asset_finder
def _acti... | class CalendarRollFinder(RollFinder):
'''
The CalendarRollFinder calculates contract rolls based purely on the
contract's auto close date.
'''
def __init__(self, trading_calendar, asset_finder):
pass
def _active_contract(self, oc, front, back, dt):
pass | 3 | 1 | 4 | 0 | 4 | 0 | 2 | 0.44 | 1 | 0 | 0 | 0 | 2 | 2 | 2 | 6 | 15 | 2 | 9 | 8 | 6 | 4 | 9 | 8 | 6 | 2 | 2 | 0 | 3 |
16,289 | quantopian/zipline | quantopian_zipline/zipline/assets/roll_finder.py | zipline.assets.roll_finder.RollFinder | from abc import ABCMeta, abstractmethod
from six import with_metaclass
class RollFinder(with_metaclass(ABCMeta, object)):
"""
Abstract base class for calculating when futures contracts are the active
contract.
"""
@abstractmethod
def _active_contract(self, oc, front, back, dt):
raise N... |
class RollFinder(with_metaclass(ABCMeta, object)):
'''
Abstract base class for calculating when futures contracts are the active
contract.
'''
@abstractmethod
def _active_contract(self, oc, front, back, dt):
pass
def _get_active_contract_at_offset(self, root_symbol, dt, offset):
... | 6 | 4 | 26 | 1 | 13 | 13 | 3 | 1.04 | 1 | 1 | 0 | 2 | 4 | 0 | 4 | 4 | 114 | 8 | 52 | 25 | 46 | 54 | 48 | 24 | 43 | 9 | 1 | 4 | 13 |
16,290 | quantopian/zipline | quantopian_zipline/zipline/assets/roll_finder.py | zipline.assets.roll_finder.VolumeRollFinder | class VolumeRollFinder(RollFinder):
"""
The VolumeRollFinder calculates contract rolls based on when
volume activity transfers from one contract to another.
"""
GRACE_DAYS = 7
def __init__(self, trading_calendar, asset_finder, session_reader):
self.trading_calendar = trading_calendar
... | class VolumeRollFinder(RollFinder):
'''
The VolumeRollFinder calculates contract rolls based on when
volume activity transfers from one contract to another.
'''
def __init__(self, trading_calendar, asset_finder, session_reader):
pass
def _active_contract(self, oc, front, back, dt):
... | 4 | 3 | 37 | 3 | 17 | 17 | 4 | 1.02 | 1 | 0 | 0 | 0 | 3 | 3 | 3 | 7 | 119 | 12 | 53 | 24 | 49 | 54 | 39 | 24 | 35 | 9 | 2 | 2 | 11 |
16,291 | quantopian/zipline | quantopian_zipline/zipline/country.py | zipline.country.CountryCode | class CountryCode(object):
"""A simple namespace of iso3166 alpha2 country codes.
"""
ARGENTINA = code('ARGENTINA')
AUSTRALIA = code('AUSTRALIA')
AUSTRIA = code('AUSTRIA')
BELGIUM = code('BELGIUM')
BRAZIL = code('BRAZIL')
CANADA = code('CANADA')
CHILE = code('CHILE')
CHINA = code... | class CountryCode(object):
'''A simple namespace of iso3166 alpha2 country codes.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 50 | 0 | 48 | 46 | 47 | 2 | 46 | 46 | 45 | 0 | 1 | 0 | 0 |
16,292 | quantopian/zipline | quantopian_zipline/zipline/currency.py | zipline.currency.Currency | from functools import total_ordering
from iso4217 import Currency as ISO4217Currency
@total_ordering
class Currency(object):
"""A currency identifier, as defined by ISO-4217.
Parameters
----------
code : str
ISO-4217 code for the currency.
Attributes
----------
code : str
... | @total_ordering
class Currency(object):
'''A currency identifier, as defined by ISO-4217.
Parameters
----------
code : str
ISO-4217 code for the currency.
Attributes
----------
code : str
ISO-4217 currency code for the currency, e.g., 'USD'.
name : str
Plain engli... | 11 | 3 | 7 | 0 | 5 | 1 | 2 | 0.59 | 1 | 4 | 0 | 0 | 7 | 0 | 7 | 7 | 70 | 11 | 37 | 12 | 27 | 22 | 29 | 10 | 21 | 4 | 1 | 3 | 11 |
16,293 | quantopian/zipline | quantopian_zipline/zipline/data/adjustments.py | zipline.data.adjustments.SQLiteAdjustmentReader | from zipline.utils.numpy_utils import datetime64ns_dtype, float64_dtype, int64_dtype, uint32_dtype, uint64_dtype
from pandas import Timestamp
import pandas as pd
from zipline.utils.input_validation import preprocess
from zipline.utils.pandas_utils import empty_dataframe
from ._adjustments import load_adjustments_from_s... |
class SQLiteAdjustmentReader(object):
'''
Loads adjustments based on corporate actions from a SQLite database.
Expects data written in the format output by `SQLiteAdjustmentWriter`.
Parameters
----------
conn : str or sqlite3.Connection
Connection from which to load data.
See Also
... | 14 | 4 | 16 | 2 | 11 | 4 | 2 | 0.38 | 1 | 6 | 0 | 1 | 12 | 1 | 12 | 12 | 249 | 36 | 156 | 56 | 136 | 59 | 76 | 47 | 63 | 4 | 1 | 2 | 24 |
16,294 | quantopian/zipline | quantopian_zipline/zipline/data/adjustments.py | zipline.data.adjustments.SQLiteAdjustmentWriter | import numpy as np
from zipline.utils.numpy_utils import datetime64ns_dtype, float64_dtype, int64_dtype, uint32_dtype, uint64_dtype
import pandas as pd
import six
import sqlite3
from errno import ENOENT
from os import remove
class SQLiteAdjustmentWriter(object):
"""
Writer for data to be read by SQLiteAdjustme... |
class SQLiteAdjustmentWriter(object):
'''
Writer for data to be read by SQLiteAdjustmentReader
Parameters
----------
conn_or_path : str or sqlite3.Connection
A handle to the target sqlite database.
equity_daily_bar_reader : SessionBarReader
Daily bar reader to use for dividend w... | 14 | 5 | 26 | 1 | 17 | 7 | 2 | 0.47 | 1 | 7 | 0 | 0 | 13 | 3 | 13 | 13 | 366 | 33 | 226 | 43 | 208 | 107 | 104 | 38 | 90 | 6 | 1 | 4 | 29 |
16,295 | quantopian/zipline | quantopian_zipline/zipline/data/bar_reader.py | zipline.data.bar_reader.BarReader | from six import with_metaclass
from abc import ABCMeta, abstractmethod, abstractproperty
class BarReader(with_metaclass(ABCMeta, object)):
@abstractproperty
def data_frequency(self):
pass
@abstractmethod
def load_raw_arrays(self, columns, start_date, end_date, assets):
"""
Par... |
class BarReader(with_metaclass(ABCMeta, object)):
@abstractproperty
def data_frequency(self):
pass
@abstractmethod
def load_raw_arrays(self, columns, start_date, end_date, assets):
'''
Parameters
----------
columns : list of str
'open', 'high', 'low',... | 15 | 6 | 13 | 1 | 2 | 10 | 1 | 3.23 | 1 | 0 | 0 | 2 | 7 | 0 | 7 | 7 | 106 | 13 | 22 | 15 | 7 | 71 | 15 | 8 | 7 | 1 | 1 | 0 | 7 |
16,296 | quantopian/zipline | quantopian_zipline/zipline/data/bar_reader.py | zipline.data.bar_reader.NoDataAfterDate | class NoDataAfterDate(NoDataOnDate):
pass | class NoDataAfterDate(NoDataOnDate):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
16,297 | quantopian/zipline | quantopian_zipline/zipline/data/bar_reader.py | zipline.data.bar_reader.NoDataBeforeDate | class NoDataBeforeDate(NoDataOnDate):
pass | class NoDataBeforeDate(NoDataOnDate):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
16,298 | quantopian/zipline | quantopian_zipline/zipline/data/bar_reader.py | zipline.data.bar_reader.NoDataForSid | class NoDataForSid(Exception):
"""
Raised when the requested sid is missing from the pricing data.
"""
pass | class NoDataForSid(Exception):
'''
Raised when the requested sid is missing from the pricing data.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 5 | 0 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
16,299 | quantopian/zipline | quantopian_zipline/zipline/data/bar_reader.py | zipline.data.bar_reader.NoDataOnDate | class NoDataOnDate(Exception):
"""
Raised when a spot price cannot be found for the sid and date.
"""
pass | class NoDataOnDate(Exception):
'''
Raised when a spot price cannot be found for the sid and date.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 10 | 5 | 0 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.