Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
_exceptions.pyi55 linesDownload Raw Back to _core
1from collections.abc import Iterable
2from typing import Any, Final, TypeVar, overload
3
4import numpy as np
5from numpy import _CastingKind
6
7###
8
9_T = TypeVar("_T")
10_TupleT = TypeVar("_TupleT", bound=tuple[()] | tuple[Any, Any, *tuple[Any, ...]])
11_ExceptionT = TypeVar("_ExceptionT", bound=Exception)
12
13###
14
15class UFuncTypeError(TypeError):
16    ufunc: Final[np.ufunc]
17    def __init__(self, /, ufunc: np.ufunc) -> None: ...
18
19class _UFuncNoLoopError(UFuncTypeError):
20    dtypes: tuple[np.dtype, ...]
21    def __init__(self, /, ufunc: np.ufunc, dtypes: Iterable[np.dtype]) -> None: ...
22
23class _UFuncBinaryResolutionError(_UFuncNoLoopError):
24    dtypes: tuple[np.dtype, np.dtype]
25    def __init__(self, /, ufunc: np.ufunc, dtypes: Iterable[np.dtype]) -> None: ...
26
27class _UFuncCastingError(UFuncTypeError):
28    casting: Final[_CastingKind]
29    from_: Final[np.dtype]
30    to: Final[np.dtype]
31    def __init__(self, /, ufunc: np.ufunc, casting: _CastingKind, from_: np.dtype, to: np.dtype) -> None: ...
32
33class _UFuncInputCastingError(_UFuncCastingError):
34    in_i: Final[int]
35    def __init__(self, /, ufunc: np.ufunc, casting: _CastingKind, from_: np.dtype, to: np.dtype, i: int) -> None: ...
36
37class _UFuncOutputCastingError(_UFuncCastingError):
38    out_i: Final[int]
39    def __init__(self, /, ufunc: np.ufunc, casting: _CastingKind, from_: np.dtype, to: np.dtype, i: int) -> None: ...
40
41class _ArrayMemoryError(MemoryError):
42    shape: tuple[int, ...]
43    dtype: np.dtype
44    def __init__(self, /, shape: tuple[int, ...], dtype: np.dtype) -> None: ...
45    @property
46    def _total_size(self) -> int: ...
47    @staticmethod
48    def _size_to_string(num_bytes: int) -> str: ...
49
50@overload
51def _unpack_tuple(tup: tuple[_T]) -> _T: ...
52@overload
53def _unpack_tuple(tup: _TupleT) -> _TupleT: ...
54def _display_as_base(cls: type[_ExceptionT]) -> type[_ExceptionT]: ...
55 
codekingpro/portable-devtools · Team Ai