content stringlengths 1 103k ⌀ | path stringlengths 8 216 | filename stringlengths 2 179 | language stringclasses 15
values | size_bytes int64 2 189k | quality_score float64 0.5 0.95 | complexity float64 0 1 | documentation_ratio float64 0 1 | repository stringclasses 5
values | stars int64 0 1k | created_date stringdate 2023-07-10 19:21:08 2025-07-09 19:11:45 | license stringclasses 4
values | is_test bool 2
classes | file_hash stringlengths 32 32 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
!<arch>\n/ -1 0 174 `\n | .venv\Lib\site-packages\pandas\_libs\interval.cp313-win_amd64.lib | interval.cp313-win_amd64.lib | Other | 2,032 | 0.8 | 0 | 0 | awesome-app | 665 | 2024-08-24T01:05:24.440414 | BSD-3-Clause | false | d4ec88eac75b1ec150288de177f83c70 |
from typing import (\n Any,\n Generic,\n TypeVar,\n overload,\n)\n\nimport numpy as np\nimport numpy.typing as npt\n\nfrom pandas._typing import (\n IntervalClosedType,\n Timedelta,\n Timestamp,\n)\n\nVALID_CLOSED: frozenset[str]\n\n_OrderableScalarT = TypeVar("_OrderableScalarT", int, float)\n_OrderableTimesT = TypeVar("_OrderableTimesT", Timestamp, Timedelta)\n_OrderableT = TypeVar("_OrderableT", int, float, Timestamp, Timedelta)\n\nclass _LengthDescriptor:\n @overload\n def __get__(\n self, instance: Interval[_OrderableScalarT], owner: Any\n ) -> _OrderableScalarT: ...\n @overload\n def __get__(\n self, instance: Interval[_OrderableTimesT], owner: Any\n ) -> Timedelta: ...\n\nclass _MidDescriptor:\n @overload\n def __get__(self, instance: Interval[_OrderableScalarT], owner: Any) -> float: ...\n @overload\n def __get__(\n self, instance: Interval[_OrderableTimesT], owner: Any\n ) -> _OrderableTimesT: ...\n\nclass IntervalMixin:\n @property\n def closed_left(self) -> bool: ...\n @property\n def closed_right(self) -> bool: ...\n @property\n def open_left(self) -> bool: ...\n @property\n def open_right(self) -> bool: ...\n @property\n def is_empty(self) -> bool: ...\n def _check_closed_matches(self, other: IntervalMixin, name: str = ...) -> None: ...\n\nclass Interval(IntervalMixin, Generic[_OrderableT]):\n @property\n def left(self: Interval[_OrderableT]) -> _OrderableT: ...\n @property\n def right(self: Interval[_OrderableT]) -> _OrderableT: ...\n @property\n def closed(self) -> IntervalClosedType: ...\n mid: _MidDescriptor\n length: _LengthDescriptor\n def __init__(\n self,\n left: _OrderableT,\n right: _OrderableT,\n closed: IntervalClosedType = ...,\n ) -> None: ...\n def __hash__(self) -> int: ...\n @overload\n def __contains__(\n self: Interval[Timedelta], key: Timedelta | Interval[Timedelta]\n ) -> bool: ...\n @overload\n def __contains__(\n self: Interval[Timestamp], key: Timestamp | Interval[Timestamp]\n ) -> bool: ...\n @overload\n def __contains__(\n self: Interval[_OrderableScalarT],\n key: _OrderableScalarT | Interval[_OrderableScalarT],\n ) -> bool: ...\n @overload\n def __add__(\n self: Interval[_OrderableTimesT], y: Timedelta\n ) -> Interval[_OrderableTimesT]: ...\n @overload\n def __add__(\n self: Interval[int], y: _OrderableScalarT\n ) -> Interval[_OrderableScalarT]: ...\n @overload\n def __add__(self: Interval[float], y: float) -> Interval[float]: ...\n @overload\n def __radd__(\n self: Interval[_OrderableTimesT], y: Timedelta\n ) -> Interval[_OrderableTimesT]: ...\n @overload\n def __radd__(\n self: Interval[int], y: _OrderableScalarT\n ) -> Interval[_OrderableScalarT]: ...\n @overload\n def __radd__(self: Interval[float], y: float) -> Interval[float]: ...\n @overload\n def __sub__(\n self: Interval[_OrderableTimesT], y: Timedelta\n ) -> Interval[_OrderableTimesT]: ...\n @overload\n def __sub__(\n self: Interval[int], y: _OrderableScalarT\n ) -> Interval[_OrderableScalarT]: ...\n @overload\n def __sub__(self: Interval[float], y: float) -> Interval[float]: ...\n @overload\n def __rsub__(\n self: Interval[_OrderableTimesT], y: Timedelta\n ) -> Interval[_OrderableTimesT]: ...\n @overload\n def __rsub__(\n self: Interval[int], y: _OrderableScalarT\n ) -> Interval[_OrderableScalarT]: ...\n @overload\n def __rsub__(self: Interval[float], y: float) -> Interval[float]: ...\n @overload\n def __mul__(\n self: Interval[int], y: _OrderableScalarT\n ) -> Interval[_OrderableScalarT]: ...\n @overload\n def __mul__(self: Interval[float], y: float) -> Interval[float]: ...\n @overload\n def __rmul__(\n self: Interval[int], y: _OrderableScalarT\n ) -> Interval[_OrderableScalarT]: ...\n @overload\n def __rmul__(self: Interval[float], y: float) -> Interval[float]: ...\n @overload\n def __truediv__(\n self: Interval[int], y: _OrderableScalarT\n ) -> Interval[_OrderableScalarT]: ...\n @overload\n def __truediv__(self: Interval[float], y: float) -> Interval[float]: ...\n @overload\n def __floordiv__(\n self: Interval[int], y: _OrderableScalarT\n ) -> Interval[_OrderableScalarT]: ...\n @overload\n def __floordiv__(self: Interval[float], y: float) -> Interval[float]: ...\n def overlaps(self: Interval[_OrderableT], other: Interval[_OrderableT]) -> bool: ...\n\ndef intervals_to_interval_bounds(\n intervals: np.ndarray, validate_closed: bool = ...\n) -> tuple[np.ndarray, np.ndarray, IntervalClosedType]: ...\n\nclass IntervalTree(IntervalMixin):\n def __init__(\n self,\n left: np.ndarray,\n right: np.ndarray,\n closed: IntervalClosedType = ...,\n leaf_size: int = ...,\n ) -> None: ...\n @property\n def mid(self) -> np.ndarray: ...\n @property\n def length(self) -> np.ndarray: ...\n def get_indexer(self, target) -> npt.NDArray[np.intp]: ...\n def get_indexer_non_unique(\n self, target\n ) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...\n _na_count: int\n @property\n def is_overlapping(self) -> bool: ...\n @property\n def is_monotonic_increasing(self) -> bool: ...\n def clear_mapping(self) -> None: ...\n | .venv\Lib\site-packages\pandas\_libs\interval.pyi | interval.pyi | Other | 5,378 | 0.85 | 0.304598 | 0 | react-lib | 452 | 2025-06-21T23:36:33.503317 | BSD-3-Clause | false | 6454d8c7fad582ac99630153e168188a |
!<arch>\n/ -1 0 158 `\n | .venv\Lib\site-packages\pandas\_libs\join.cp313-win_amd64.lib | join.cp313-win_amd64.lib | Other | 1,960 | 0.8 | 0 | 0 | react-lib | 133 | 2025-03-10T20:05:25.655130 | MIT | false | 9dc43d95b6fe3e8e3adba01e7ca7742b |
import numpy as np\n\nfrom pandas._typing import npt\n\ndef inner_join(\n left: np.ndarray, # const intp_t[:]\n right: np.ndarray, # const intp_t[:]\n max_groups: int,\n sort: bool = ...,\n) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...\ndef left_outer_join(\n left: np.ndarray, # const intp_t[:]\n right: np.ndarray, # const intp_t[:]\n max_groups: int,\n sort: bool = ...,\n) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...\ndef full_outer_join(\n left: np.ndarray, # const intp_t[:]\n right: np.ndarray, # const intp_t[:]\n max_groups: int,\n) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...\ndef ffill_indexer(\n indexer: np.ndarray, # const intp_t[:]\n) -> npt.NDArray[np.intp]: ...\ndef left_join_indexer_unique(\n left: np.ndarray, # ndarray[join_t]\n right: np.ndarray, # ndarray[join_t]\n) -> npt.NDArray[np.intp]: ...\ndef left_join_indexer(\n left: np.ndarray, # ndarray[join_t]\n right: np.ndarray, # ndarray[join_t]\n) -> tuple[\n np.ndarray, # np.ndarray[join_t]\n npt.NDArray[np.intp],\n npt.NDArray[np.intp],\n]: ...\ndef inner_join_indexer(\n left: np.ndarray, # ndarray[join_t]\n right: np.ndarray, # ndarray[join_t]\n) -> tuple[\n np.ndarray, # np.ndarray[join_t]\n npt.NDArray[np.intp],\n npt.NDArray[np.intp],\n]: ...\ndef outer_join_indexer(\n left: np.ndarray, # ndarray[join_t]\n right: np.ndarray, # ndarray[join_t]\n) -> tuple[\n np.ndarray, # np.ndarray[join_t]\n npt.NDArray[np.intp],\n npt.NDArray[np.intp],\n]: ...\ndef asof_join_backward_on_X_by_Y(\n left_values: np.ndarray, # ndarray[numeric_t]\n right_values: np.ndarray, # ndarray[numeric_t]\n left_by_values: np.ndarray, # const int64_t[:]\n right_by_values: np.ndarray, # const int64_t[:]\n allow_exact_matches: bool = ...,\n tolerance: np.number | float | None = ...,\n use_hashtable: bool = ...,\n) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...\ndef asof_join_forward_on_X_by_Y(\n left_values: np.ndarray, # ndarray[numeric_t]\n right_values: np.ndarray, # ndarray[numeric_t]\n left_by_values: np.ndarray, # const int64_t[:]\n right_by_values: np.ndarray, # const int64_t[:]\n allow_exact_matches: bool = ...,\n tolerance: np.number | float | None = ...,\n use_hashtable: bool = ...,\n) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...\ndef asof_join_nearest_on_X_by_Y(\n left_values: np.ndarray, # ndarray[numeric_t]\n right_values: np.ndarray, # ndarray[numeric_t]\n left_by_values: np.ndarray, # const int64_t[:]\n right_by_values: np.ndarray, # const int64_t[:]\n allow_exact_matches: bool = ...,\n tolerance: np.number | float | None = ...,\n use_hashtable: bool = ...,\n) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...\n | .venv\Lib\site-packages\pandas\_libs\join.pyi | join.pyi | Other | 2,780 | 0.95 | 0.139241 | 0 | vue-tools | 526 | 2024-09-09T22:25:21.148655 | Apache-2.0 | false | 13b6b6d69d23f64140fa2c433f0ad780 |
!<arch>\n/ -1 0 286 `\n | .venv\Lib\site-packages\pandas\_libs\json.cp313-win_amd64.lib | json.cp313-win_amd64.lib | Other | 2,576 | 0.8 | 0 | 0 | vue-tools | 670 | 2024-09-24T00:23:13.806470 | MIT | false | 625f7508e01f78ab0af7108f3b9c1b63 |
MZ | .venv\Lib\site-packages\pandas\_libs\json.cp313-win_amd64.pyd | json.cp313-win_amd64.pyd | Other | 52,224 | 0.95 | 0.01039 | 0.003546 | react-lib | 200 | 2024-09-04T19:59:14.933418 | MIT | false | 5f018caadebd06424ef71532ce50ef0f |
from typing import (\n Any,\n Callable,\n)\n\ndef ujson_dumps(\n obj: Any,\n ensure_ascii: bool = ...,\n double_precision: int = ...,\n indent: int = ...,\n orient: str = ...,\n date_unit: str = ...,\n iso_dates: bool = ...,\n default_handler: None\n | Callable[[Any], str | float | bool | list | dict | None] = ...,\n) -> str: ...\ndef ujson_loads(\n s: str,\n precise_float: bool = ...,\n numpy: bool = ...,\n dtype: None = ...,\n labelled: bool = ...,\n) -> Any: ...\n | .venv\Lib\site-packages\pandas\_libs\json.pyi | json.pyi | Other | 496 | 0.85 | 0.086957 | 0 | react-lib | 598 | 2024-05-26T06:22:15.516829 | BSD-3-Clause | false | 366eaba35f66ffa302aabcb949ee7de4 |
!<arch>\n/ -1 0 154 `\n | .venv\Lib\site-packages\pandas\_libs\lib.cp313-win_amd64.lib | lib.cp313-win_amd64.lib | Other | 1,940 | 0.8 | 0 | 0 | python-kit | 959 | 2025-04-14T10:56:54.204836 | BSD-3-Clause | false | 19ab540339646312b3436e953123780a |
# TODO(npdtypes): Many types specified here can be made more specific/accurate;\n# the more specific versions are specified in comments\nfrom decimal import Decimal\nfrom typing import (\n Any,\n Callable,\n Final,\n Generator,\n Hashable,\n Literal,\n TypeAlias,\n overload,\n)\n\nimport numpy as np\n\nfrom pandas._libs.interval import Interval\nfrom pandas._libs.tslibs import Period\nfrom pandas._typing import (\n ArrayLike,\n DtypeObj,\n TypeGuard,\n npt,\n)\n\n# placeholder until we can specify np.ndarray[object, ndim=2]\nndarray_obj_2d = np.ndarray\n\nfrom enum import Enum\n\nclass _NoDefault(Enum):\n no_default = ...\n\nno_default: Final = _NoDefault.no_default\nNoDefault: TypeAlias = Literal[_NoDefault.no_default]\n\ni8max: int\nu8max: int\n\ndef is_np_dtype(dtype: object, kinds: str | None = ...) -> TypeGuard[np.dtype]: ...\ndef item_from_zerodim(val: object) -> object: ...\ndef infer_dtype(value: object, skipna: bool = ...) -> str: ...\ndef is_iterator(obj: object) -> bool: ...\ndef is_scalar(val: object) -> bool: ...\ndef is_list_like(obj: object, allow_sets: bool = ...) -> bool: ...\ndef is_pyarrow_array(obj: object) -> bool: ...\ndef is_period(val: object) -> TypeGuard[Period]: ...\ndef is_interval(obj: object) -> TypeGuard[Interval]: ...\ndef is_decimal(obj: object) -> TypeGuard[Decimal]: ...\ndef is_complex(obj: object) -> TypeGuard[complex]: ...\ndef is_bool(obj: object) -> TypeGuard[bool | np.bool_]: ...\ndef is_integer(obj: object) -> TypeGuard[int | np.integer]: ...\ndef is_int_or_none(obj) -> bool: ...\ndef is_float(obj: object) -> TypeGuard[float]: ...\ndef is_interval_array(values: np.ndarray) -> bool: ...\ndef is_datetime64_array(values: np.ndarray, skipna: bool = True) -> bool: ...\ndef is_timedelta_or_timedelta64_array(\n values: np.ndarray, skipna: bool = True\n) -> bool: ...\ndef is_datetime_with_singletz_array(values: np.ndarray) -> bool: ...\ndef is_time_array(values: np.ndarray, skipna: bool = ...): ...\ndef is_date_array(values: np.ndarray, skipna: bool = ...): ...\ndef is_datetime_array(values: np.ndarray, skipna: bool = ...): ...\ndef is_string_array(values: np.ndarray, skipna: bool = ...): ...\ndef is_float_array(values: np.ndarray): ...\ndef is_integer_array(values: np.ndarray, skipna: bool = ...): ...\ndef is_bool_array(values: np.ndarray, skipna: bool = ...): ...\ndef fast_multiget(\n mapping: dict,\n keys: np.ndarray, # object[:]\n default=...,\n) -> np.ndarray: ...\ndef fast_unique_multiple_list_gen(gen: Generator, sort: bool = ...) -> list: ...\ndef fast_unique_multiple_list(lists: list, sort: bool | None = ...) -> list: ...\ndef map_infer(\n arr: np.ndarray,\n f: Callable[[Any], Any],\n convert: bool = ...,\n ignore_na: bool = ...,\n) -> np.ndarray: ...\n@overload\ndef maybe_convert_objects(\n objects: npt.NDArray[np.object_],\n *,\n try_float: bool = ...,\n safe: bool = ...,\n convert_numeric: bool = ...,\n convert_non_numeric: Literal[False] = ...,\n convert_string: Literal[False] = ...,\n convert_to_nullable_dtype: Literal[False] = ...,\n dtype_if_all_nat: DtypeObj | None = ...,\n) -> npt.NDArray[np.object_ | np.number]: ...\n@overload\ndef maybe_convert_objects(\n objects: npt.NDArray[np.object_],\n *,\n try_float: bool = ...,\n safe: bool = ...,\n convert_numeric: bool = ...,\n convert_non_numeric: bool = ...,\n convert_string: bool = ...,\n convert_to_nullable_dtype: Literal[True] = ...,\n dtype_if_all_nat: DtypeObj | None = ...,\n) -> ArrayLike: ...\n@overload\ndef maybe_convert_objects(\n objects: npt.NDArray[np.object_],\n *,\n try_float: bool = ...,\n safe: bool = ...,\n convert_numeric: bool = ...,\n convert_non_numeric: bool = ...,\n convert_string: bool = ...,\n convert_to_nullable_dtype: bool = ...,\n dtype_if_all_nat: DtypeObj | None = ...,\n) -> ArrayLike: ...\n@overload\ndef maybe_convert_numeric(\n values: npt.NDArray[np.object_],\n na_values: set,\n convert_empty: bool = ...,\n coerce_numeric: bool = ...,\n convert_to_masked_nullable: Literal[False] = ...,\n) -> tuple[np.ndarray, None]: ...\n@overload\ndef maybe_convert_numeric(\n values: npt.NDArray[np.object_],\n na_values: set,\n convert_empty: bool = ...,\n coerce_numeric: bool = ...,\n *,\n convert_to_masked_nullable: Literal[True],\n) -> tuple[np.ndarray, np.ndarray]: ...\n\n# TODO: restrict `arr`?\ndef ensure_string_array(\n arr,\n na_value: object = ...,\n convert_na_value: bool = ...,\n copy: bool = ...,\n skipna: bool = ...,\n) -> npt.NDArray[np.object_]: ...\ndef convert_nans_to_NA(\n arr: npt.NDArray[np.object_],\n) -> npt.NDArray[np.object_]: ...\ndef fast_zip(ndarrays: list) -> npt.NDArray[np.object_]: ...\n\n# TODO: can we be more specific about rows?\ndef to_object_array_tuples(rows: object) -> ndarray_obj_2d: ...\ndef tuples_to_object_array(\n tuples: npt.NDArray[np.object_],\n) -> ndarray_obj_2d: ...\n\n# TODO: can we be more specific about rows?\ndef to_object_array(rows: object, min_width: int = ...) -> ndarray_obj_2d: ...\ndef dicts_to_array(dicts: list, columns: list) -> ndarray_obj_2d: ...\ndef maybe_booleans_to_slice(\n mask: npt.NDArray[np.uint8],\n) -> slice | npt.NDArray[np.uint8]: ...\ndef maybe_indices_to_slice(\n indices: npt.NDArray[np.intp],\n max_len: int,\n) -> slice | npt.NDArray[np.intp]: ...\ndef is_all_arraylike(obj: list) -> bool: ...\n\n# -----------------------------------------------------------------\n# Functions which in reality take memoryviews\n\ndef memory_usage_of_objects(arr: np.ndarray) -> int: ... # object[:] # np.int64\ndef map_infer_mask(\n arr: np.ndarray,\n f: Callable[[Any], Any],\n mask: np.ndarray, # const uint8_t[:]\n convert: bool = ...,\n na_value: Any = ...,\n dtype: np.dtype = ...,\n) -> np.ndarray: ...\ndef indices_fast(\n index: npt.NDArray[np.intp],\n labels: np.ndarray, # const int64_t[:]\n keys: list,\n sorted_labels: list[npt.NDArray[np.int64]],\n) -> dict[Hashable, npt.NDArray[np.intp]]: ...\ndef generate_slices(\n labels: np.ndarray, ngroups: int # const intp_t[:]\n) -> tuple[npt.NDArray[np.int64], npt.NDArray[np.int64]]: ...\ndef count_level_2d(\n mask: np.ndarray, # ndarray[uint8_t, ndim=2, cast=True],\n labels: np.ndarray, # const intp_t[:]\n max_bin: int,\n) -> np.ndarray: ... # np.ndarray[np.int64, ndim=2]\ndef get_level_sorter(\n codes: np.ndarray, # const int64_t[:]\n starts: np.ndarray, # const intp_t[:]\n) -> np.ndarray: ... # np.ndarray[np.intp, ndim=1]\ndef generate_bins_dt64(\n values: npt.NDArray[np.int64],\n binner: np.ndarray, # const int64_t[:]\n closed: object = ...,\n hasnans: bool = ...,\n) -> np.ndarray: ... # np.ndarray[np.int64, ndim=1]\ndef array_equivalent_object(\n left: npt.NDArray[np.object_],\n right: npt.NDArray[np.object_],\n) -> bool: ...\ndef has_infs(arr: np.ndarray) -> bool: ... # const floating[:]\ndef has_only_ints_or_nan(arr: np.ndarray) -> bool: ... # const floating[:]\ndef get_reverse_indexer(\n indexer: np.ndarray, # const intp_t[:]\n length: int,\n) -> npt.NDArray[np.intp]: ...\ndef is_bool_list(obj: list) -> bool: ...\ndef dtypes_all_equal(types: list[DtypeObj]) -> bool: ...\ndef is_range_indexer(\n left: np.ndarray, n: int # np.ndarray[np.int64, ndim=1]\n) -> bool: ...\n | .venv\Lib\site-packages\pandas\_libs\lib.pyi | lib.pyi | Other | 7,209 | 0.95 | 0.277778 | 0.059113 | python-kit | 419 | 2024-09-11T06:05:02.404612 | Apache-2.0 | false | 5970378e13eb142682004c492f642ad4 |
!<arch>\n/ -1 0 170 `\n | .venv\Lib\site-packages\pandas\_libs\missing.cp313-win_amd64.lib | missing.cp313-win_amd64.lib | Other | 2,012 | 0.8 | 0 | 0 | react-lib | 349 | 2023-10-09T21:47:30.519020 | Apache-2.0 | false | 7dce99aade8d76561737ce9ec09aae63 |
import numpy as np\nfrom numpy import typing as npt\n\nclass NAType:\n def __new__(cls, *args, **kwargs): ...\n\nNA: NAType\n\ndef is_matching_na(\n left: object, right: object, nan_matches_none: bool = ...\n) -> bool: ...\ndef isposinf_scalar(val: object) -> bool: ...\ndef isneginf_scalar(val: object) -> bool: ...\ndef checknull(val: object, inf_as_na: bool = ...) -> bool: ...\ndef isnaobj(arr: np.ndarray, inf_as_na: bool = ...) -> npt.NDArray[np.bool_]: ...\ndef is_numeric_na(values: np.ndarray) -> npt.NDArray[np.bool_]: ...\n | .venv\Lib\site-packages\pandas\_libs\missing.pyi | missing.pyi | Other | 524 | 0.85 | 0.5 | 0 | vue-tools | 599 | 2023-12-11T02:18:57.443277 | Apache-2.0 | false | 6e685dbb7b05bcb8ff4a11bb1ba9acb7 |
!<arch>\n/ -1 0 154 `\n | .venv\Lib\site-packages\pandas\_libs\ops.cp313-win_amd64.lib | ops.cp313-win_amd64.lib | Other | 1,940 | 0.8 | 0 | 0 | node-utils | 633 | 2023-09-16T18:31:40.094639 | MIT | false | 43af1bff01015d857da2f802bc8049b5 |
from typing import (\n Any,\n Callable,\n Iterable,\n Literal,\n TypeAlias,\n overload,\n)\n\nimport numpy as np\n\nfrom pandas._typing import npt\n\n_BinOp: TypeAlias = Callable[[Any, Any], Any]\n_BoolOp: TypeAlias = Callable[[Any, Any], bool]\n\ndef scalar_compare(\n values: np.ndarray, # object[:]\n val: object,\n op: _BoolOp, # {operator.eq, operator.ne, ...}\n) -> npt.NDArray[np.bool_]: ...\ndef vec_compare(\n left: npt.NDArray[np.object_],\n right: npt.NDArray[np.object_],\n op: _BoolOp, # {operator.eq, operator.ne, ...}\n) -> npt.NDArray[np.bool_]: ...\ndef scalar_binop(\n values: np.ndarray, # object[:]\n val: object,\n op: _BinOp, # binary operator\n) -> np.ndarray: ...\ndef vec_binop(\n left: np.ndarray, # object[:]\n right: np.ndarray, # object[:]\n op: _BinOp, # binary operator\n) -> np.ndarray: ...\n@overload\ndef maybe_convert_bool(\n arr: npt.NDArray[np.object_],\n true_values: Iterable | None = None,\n false_values: Iterable | None = None,\n convert_to_masked_nullable: Literal[False] = ...,\n) -> tuple[np.ndarray, None]: ...\n@overload\ndef maybe_convert_bool(\n arr: npt.NDArray[np.object_],\n true_values: Iterable = ...,\n false_values: Iterable = ...,\n *,\n convert_to_masked_nullable: Literal[True],\n) -> tuple[np.ndarray, np.ndarray]: ...\n | .venv\Lib\site-packages\pandas\_libs\ops.pyi | ops.pyi | Other | 1,318 | 0.95 | 0.117647 | 0.021277 | vue-tools | 201 | 2024-10-30T09:00:39.194187 | GPL-3.0 | false | d04fcf98078be675f8513883685d6871 |
!<arch>\n/ -1 0 190 `\n | .venv\Lib\site-packages\pandas\_libs\ops_dispatch.cp313-win_amd64.lib | ops_dispatch.cp313-win_amd64.lib | Other | 2,104 | 0.8 | 0 | 0 | vue-tools | 643 | 2025-01-29T07:16:28.716123 | BSD-3-Clause | false | 09a76160ff92617e87d7945b2c40bfe6 |
MZ | .venv\Lib\site-packages\pandas\_libs\ops_dispatch.cp313-win_amd64.pyd | ops_dispatch.cp313-win_amd64.pyd | Other | 45,056 | 0.95 | 0.031056 | 0.009375 | react-lib | 407 | 2024-08-09T05:41:22.860036 | GPL-3.0 | false | 2199efb92a5452787eb1200fe6c562f7 |
import numpy as np\n\ndef maybe_dispatch_ufunc_to_dunder_op(\n self, ufunc: np.ufunc, method: str, *inputs, **kwargs\n): ...\n | .venv\Lib\site-packages\pandas\_libs\ops_dispatch.pyi | ops_dispatch.pyi | Other | 124 | 0.85 | 0.2 | 0 | react-lib | 385 | 2023-10-30T03:43:20.240854 | BSD-3-Clause | false | 05b56e6925670c9d9f0cdb078a2b2202 |
!<arch>\n/ -1 0 202 `\n | .venv\Lib\site-packages\pandas\_libs\pandas_datetime.cp313-win_amd64.lib | pandas_datetime.cp313-win_amd64.lib | Other | 2,156 | 0.8 | 0 | 0 | awesome-app | 483 | 2025-04-18T07:05:08.061103 | MIT | false | cdde100972e982fd9c49dea46dfed981 |
MZ | .venv\Lib\site-packages\pandas\_libs\pandas_datetime.cp313-win_amd64.pyd | pandas_datetime.cp313-win_amd64.pyd | Other | 32,256 | 0.95 | 0.017647 | 0.005882 | vue-tools | 774 | 2023-12-16T20:35:09.599492 | MIT | false | 6e30e78377bc3aa6be761b2afdd1fe93 |
!<arch>\n/ -1 0 194 `\n | .venv\Lib\site-packages\pandas\_libs\pandas_parser.cp313-win_amd64.lib | pandas_parser.cp313-win_amd64.lib | Other | 2,120 | 0.8 | 0 | 0 | node-utils | 93 | 2024-09-13T08:27:00.382262 | GPL-3.0 | false | 6be88b0a943cdf43da76b1cd7c12b76f |
MZ | .venv\Lib\site-packages\pandas\_libs\pandas_parser.cp313-win_amd64.pyd | pandas_parser.cp313-win_amd64.pyd | Other | 30,208 | 0.95 | 0.005 | 0.005051 | vue-tools | 431 | 2025-04-06T20:47:20.125215 | BSD-3-Clause | false | f418bc6754b1e10e8960d653ec428d02 |
!<arch>\n/ -1 0 170 `\n | .venv\Lib\site-packages\pandas\_libs\parsers.cp313-win_amd64.lib | parsers.cp313-win_amd64.lib | Other | 2,012 | 0.8 | 0 | 0 | vue-tools | 43 | 2024-08-05T04:57:57.114553 | Apache-2.0 | false | 1a1db0405184b24075130bb09deb22f8 |
from typing import (\n Hashable,\n Literal,\n)\n\nimport numpy as np\n\nfrom pandas._typing import (\n ArrayLike,\n Dtype,\n npt,\n)\n\nSTR_NA_VALUES: set[str]\nDEFAULT_BUFFER_HEURISTIC: int\n\ndef sanitize_objects(\n values: npt.NDArray[np.object_],\n na_values: set,\n) -> int: ...\n\nclass TextReader:\n unnamed_cols: set[str]\n table_width: int # int64_t\n leading_cols: int # int64_t\n header: list[list[int]] # non-negative integers\n def __init__(\n self,\n source,\n delimiter: bytes | str = ..., # single-character only\n header=...,\n header_start: int = ..., # int64_t\n header_end: int = ..., # uint64_t\n index_col=...,\n names=...,\n tokenize_chunksize: int = ..., # int64_t\n delim_whitespace: bool = ...,\n converters=...,\n skipinitialspace: bool = ...,\n escapechar: bytes | str | None = ..., # single-character only\n doublequote: bool = ...,\n quotechar: str | bytes | None = ..., # at most 1 character\n quoting: int = ...,\n lineterminator: bytes | str | None = ..., # at most 1 character\n comment=...,\n decimal: bytes | str = ..., # single-character only\n thousands: bytes | str | None = ..., # single-character only\n dtype: Dtype | dict[Hashable, Dtype] = ...,\n usecols=...,\n error_bad_lines: bool = ...,\n warn_bad_lines: bool = ...,\n na_filter: bool = ...,\n na_values=...,\n na_fvalues=...,\n keep_default_na: bool = ...,\n true_values=...,\n false_values=...,\n allow_leading_cols: bool = ...,\n skiprows=...,\n skipfooter: int = ..., # int64_t\n verbose: bool = ...,\n float_precision: Literal["round_trip", "legacy", "high"] | None = ...,\n skip_blank_lines: bool = ...,\n encoding_errors: bytes | str = ...,\n ) -> None: ...\n def set_noconvert(self, i: int) -> None: ...\n def remove_noconvert(self, i: int) -> None: ...\n def close(self) -> None: ...\n def read(self, rows: int | None = ...) -> dict[int, ArrayLike]: ...\n def read_low_memory(self, rows: int | None) -> list[dict[int, ArrayLike]]: ...\n\n# _maybe_upcast, na_values are only exposed for testing\nna_values: dict\n\ndef _maybe_upcast(\n arr, use_dtype_backend: bool = ..., dtype_backend: str = ...\n) -> np.ndarray: ...\n | .venv\Lib\site-packages\pandas\_libs\parsers.pyi | parsers.pyi | Other | 2,378 | 0.95 | 0.12987 | 0.014286 | react-lib | 621 | 2024-11-07T14:11:54.827995 | GPL-3.0 | false | c27c1fe71b602e089273b311b0089fe5 |
!<arch>\n/ -1 0 182 `\n | .venv\Lib\site-packages\pandas\_libs\properties.cp313-win_amd64.lib | properties.cp313-win_amd64.lib | Other | 2,068 | 0.8 | 0 | 0 | awesome-app | 281 | 2024-01-15T20:56:46.532907 | GPL-3.0 | false | 688024ae362f99149c5d21471bf83381 |
MZ | .venv\Lib\site-packages\pandas\_libs\properties.cp313-win_amd64.pyd | properties.cp313-win_amd64.pyd | Other | 62,976 | 0.95 | 0.026005 | 0.00716 | react-lib | 956 | 2023-11-22T07:25:45.568180 | MIT | false | ae4cf0614c167327be7dd8bc75d55fb2 |
from typing import (\n Sequence,\n overload,\n)\n\nfrom pandas._typing import (\n AnyArrayLike,\n DataFrame,\n Index,\n Series,\n)\n\n# note: this is a lie to make type checkers happy (they special\n# case property). cache_readonly uses attribute names similar to\n# property (fget) but it does not provide fset and fdel.\ncache_readonly = property\n\nclass AxisProperty:\n axis: int\n def __init__(self, axis: int = ..., doc: str = ...) -> None: ...\n @overload\n def __get__(self, obj: DataFrame | Series, type) -> Index: ...\n @overload\n def __get__(self, obj: None, type) -> AxisProperty: ...\n def __set__(\n self, obj: DataFrame | Series, value: AnyArrayLike | Sequence\n ) -> None: ...\n | .venv\Lib\site-packages\pandas\_libs\properties.pyi | properties.pyi | Other | 717 | 0.95 | 0.185185 | 0.125 | node-utils | 991 | 2024-05-06T16:25:59.854303 | BSD-3-Clause | false | c452d18c38f918ddbe8974e16d92186d |
!<arch>\n/ -1 0 170 `\n | .venv\Lib\site-packages\pandas\_libs\reshape.cp313-win_amd64.lib | reshape.cp313-win_amd64.lib | Other | 2,012 | 0.8 | 0 | 0 | vue-tools | 567 | 2024-02-09T22:14:59.935923 | GPL-3.0 | false | 94fc1178f1fc84cac78aed2299606ef3 |
import numpy as np\n\nfrom pandas._typing import npt\n\ndef unstack(\n values: np.ndarray, # reshape_t[:, :]\n mask: np.ndarray, # const uint8_t[:]\n stride: int,\n length: int,\n width: int,\n new_values: np.ndarray, # reshape_t[:, :]\n new_mask: np.ndarray, # uint8_t[:, :]\n) -> None: ...\ndef explode(\n values: npt.NDArray[np.object_],\n) -> tuple[npt.NDArray[np.object_], npt.NDArray[np.int64]]: ...\n | .venv\Lib\site-packages\pandas\_libs\reshape.pyi | reshape.pyi | Other | 419 | 0.95 | 0.125 | 0 | node-utils | 560 | 2024-02-17T12:52:19.669003 | GPL-3.0 | false | 707af319fa9f443c22700733ac99de52 |
!<arch>\n/ -1 0 154 `\n | .venv\Lib\site-packages\pandas\_libs\sas.cp313-win_amd64.lib | sas.cp313-win_amd64.lib | Other | 1,940 | 0.8 | 0 | 0 | python-kit | 777 | 2024-02-19T16:35:29.441656 | MIT | false | 5dcac0b7c87457294c3960ad7f662e27 |
from pandas.io.sas.sas7bdat import SAS7BDATReader\n\nclass Parser:\n def __init__(self, parser: SAS7BDATReader) -> None: ...\n def read(self, nrows: int) -> None: ...\n\ndef get_subheader_index(signature: bytes) -> int: ...\n | .venv\Lib\site-packages\pandas\_libs\sas.pyi | sas.pyi | Other | 224 | 0.85 | 0.571429 | 0 | python-kit | 624 | 2023-09-06T16:54:27.353795 | Apache-2.0 | false | 9f97106bdb3d40fdcac6ae77402e0eb1 |
!<arch>\n/ -1 0 166 `\n | .venv\Lib\site-packages\pandas\_libs\sparse.cp313-win_amd64.lib | sparse.cp313-win_amd64.lib | Other | 1,996 | 0.8 | 0 | 0 | vue-tools | 864 | 2025-04-09T11:10:21.482041 | GPL-3.0 | false | d31c6fc77f7bd67686cdb9e12ec8ac74 |
from typing import Sequence\n\nimport numpy as np\n\nfrom pandas._typing import (\n Self,\n npt,\n)\n\nclass SparseIndex:\n length: int\n npoints: int\n def __init__(self) -> None: ...\n @property\n def ngaps(self) -> int: ...\n @property\n def nbytes(self) -> int: ...\n @property\n def indices(self) -> npt.NDArray[np.int32]: ...\n def equals(self, other) -> bool: ...\n def lookup(self, index: int) -> np.int32: ...\n def lookup_array(self, indexer: npt.NDArray[np.int32]) -> npt.NDArray[np.int32]: ...\n def to_int_index(self) -> IntIndex: ...\n def to_block_index(self) -> BlockIndex: ...\n def intersect(self, y_: SparseIndex) -> Self: ...\n def make_union(self, y_: SparseIndex) -> Self: ...\n\nclass IntIndex(SparseIndex):\n indices: npt.NDArray[np.int32]\n def __init__(\n self, length: int, indices: Sequence[int], check_integrity: bool = ...\n ) -> None: ...\n\nclass BlockIndex(SparseIndex):\n nblocks: int\n blocs: np.ndarray\n blengths: np.ndarray\n def __init__(\n self, length: int, blocs: np.ndarray, blengths: np.ndarray\n ) -> None: ...\n\n # Override to have correct parameters\n def intersect(self, other: SparseIndex) -> Self: ...\n def make_union(self, y: SparseIndex) -> Self: ...\n\ndef make_mask_object_ndarray(\n arr: npt.NDArray[np.object_], fill_value\n) -> npt.NDArray[np.bool_]: ...\ndef get_blocks(\n indices: npt.NDArray[np.int32],\n) -> tuple[npt.NDArray[np.int32], npt.NDArray[np.int32]]: ...\n | .venv\Lib\site-packages\pandas\_libs\sparse.pyi | sparse.pyi | Other | 1,485 | 0.95 | 0.392157 | 0.022727 | python-kit | 789 | 2025-03-28T19:43:11.037503 | BSD-3-Clause | false | e3844b615bf4674ae14bceca6679e576 |
!<arch>\n/ -1 0 170 `\n | .venv\Lib\site-packages\pandas\_libs\testing.cp313-win_amd64.lib | testing.cp313-win_amd64.lib | Other | 2,012 | 0.8 | 0 | 0 | python-kit | 5 | 2024-03-28T11:01:04.005321 | Apache-2.0 | true | f8d76dc7eca61f47a1cbd4bec7367104 |
MZ | .venv\Lib\site-packages\pandas\_libs\testing.cp313-win_amd64.pyd | testing.cp313-win_amd64.pyd | Other | 80,384 | 0.75 | 0.022989 | 0.006633 | python-kit | 472 | 2023-08-07T11:16:16.266387 | GPL-3.0 | true | 9adc75443a7979d53cb7699077ba2e19 |
def assert_dict_equal(a, b, compare_keys: bool = ...): ...\ndef assert_almost_equal(\n a,\n b,\n rtol: float = ...,\n atol: float = ...,\n check_dtype: bool = ...,\n obj=...,\n lobj=...,\n robj=...,\n index_values=...,\n): ...\n | .venv\Lib\site-packages\pandas\_libs\testing.pyi | testing.pyi | Other | 243 | 0.85 | 0.166667 | 0 | react-lib | 466 | 2024-01-21T10:55:29.155043 | BSD-3-Clause | true | 1df78ef3bdf46fb0a39261cee7687350 |
!<arch>\n/ -1 0 162 `\n | .venv\Lib\site-packages\pandas\_libs\tslib.cp313-win_amd64.lib | tslib.cp313-win_amd64.lib | Other | 1,976 | 0.8 | 0 | 0 | awesome-app | 261 | 2024-10-10T06:36:30.132594 | GPL-3.0 | false | 7dc00d8949e6d40c61e1700658d55c66 |
from datetime import tzinfo\n\nimport numpy as np\n\nfrom pandas._typing import npt\n\ndef format_array_from_datetime(\n values: npt.NDArray[np.int64],\n tz: tzinfo | None = ...,\n format: str | None = ...,\n na_rep: str | float = ...,\n reso: int = ..., # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.object_]: ...\ndef array_with_unit_to_datetime(\n values: npt.NDArray[np.object_],\n unit: str,\n errors: str = ...,\n) -> tuple[np.ndarray, tzinfo | None]: ...\ndef first_non_null(values: np.ndarray) -> int: ...\ndef array_to_datetime(\n values: npt.NDArray[np.object_],\n errors: str = ...,\n dayfirst: bool = ...,\n yearfirst: bool = ...,\n utc: bool = ...,\n creso: int = ...,\n) -> tuple[np.ndarray, tzinfo | None]: ...\n\n# returned ndarray may be object dtype or datetime64[ns]\n\ndef array_to_datetime_with_tz(\n values: npt.NDArray[np.object_],\n tz: tzinfo,\n dayfirst: bool,\n yearfirst: bool,\n creso: int,\n) -> npt.NDArray[np.int64]: ...\n | .venv\Lib\site-packages\pandas\_libs\tslib.pyi | tslib.pyi | Other | 969 | 0.95 | 0.135135 | 0.03125 | python-kit | 387 | 2024-01-08T15:49:53.090256 | BSD-3-Clause | false | 5dd352713fd11fc7d8481a540e7d4fd9 |
!<arch>\n/ -1 0 170 `\n | .venv\Lib\site-packages\pandas\_libs\writers.cp313-win_amd64.lib | writers.cp313-win_amd64.lib | Other | 2,012 | 0.8 | 0 | 0 | node-utils | 335 | 2024-01-06T01:29:54.732965 | GPL-3.0 | false | b6b8b15e949b1b6c495b1e19746022b9 |
import numpy as np\n\nfrom pandas._typing import ArrayLike\n\ndef write_csv_rows(\n data: list[ArrayLike],\n data_index: np.ndarray,\n nlevels: int,\n cols: np.ndarray,\n writer: object, # _csv.writer\n) -> None: ...\ndef convert_json_to_lines(arr: str) -> str: ...\ndef max_len_string_array(\n arr: np.ndarray, # pandas_string[:]\n) -> int: ...\ndef word_len(val: object) -> int: ...\ndef string_array_replace_from_nan_rep(\n arr: np.ndarray, # np.ndarray[object, ndim=1]\n nan_rep: object,\n) -> None: ...\n | .venv\Lib\site-packages\pandas\_libs\writers.pyi | writers.pyi | Other | 516 | 0.95 | 0.25 | 0 | awesome-app | 774 | 2025-02-02T12:58:39.834050 | Apache-2.0 | false | 307f342e55a5452eb208c9b297143a90 |
__all__ = [\n "NaT",\n "NaTType",\n "OutOfBoundsDatetime",\n "Period",\n "Timedelta",\n "Timestamp",\n "iNaT",\n "Interval",\n]\n\n\n# Below imports needs to happen first to ensure pandas top level\n# module gets monkeypatched with the pandas_datetime_CAPI\n# see pandas_datetime_exec in pd_datetime.c\nimport pandas._libs.pandas_parser # isort: skip # type: ignore[reportUnusedImport]\nimport pandas._libs.pandas_datetime # noqa: F401 # isort: skip # type: ignore[reportUnusedImport]\nfrom pandas._libs.interval import Interval\nfrom pandas._libs.tslibs import (\n NaT,\n NaTType,\n OutOfBoundsDatetime,\n Period,\n Timedelta,\n Timestamp,\n iNaT,\n)\n | .venv\Lib\site-packages\pandas\_libs\__init__.py | __init__.py | Python | 673 | 0.95 | 0 | 0.12 | node-utils | 471 | 2025-02-01T14:18:18.655443 | BSD-3-Clause | false | 980fb347c0d4dccb4756c46f2b755091 |
!<arch>\n/ -1 0 158 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\base.cp313-win_amd64.lib | base.cp313-win_amd64.lib | Other | 1,960 | 0.8 | 0 | 0 | react-lib | 365 | 2024-06-28T02:34:51.965319 | Apache-2.0 | false | f2b41778d55171a2d9b212eb4fd07b55 |
MZ | .venv\Lib\site-packages\pandas\_libs\tslibs\base.cp313-win_amd64.pyd | base.cp313-win_amd64.pyd | Other | 44,544 | 0.95 | 0.037543 | 0.027586 | python-kit | 242 | 2023-12-30T10:24:05.890899 | GPL-3.0 | false | 037f8287d62aec22a356f3d36d37eade |
!<arch>\n/ -1 0 178 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\ccalendar.cp313-win_amd64.lib | ccalendar.cp313-win_amd64.lib | Other | 2,048 | 0.8 | 0 | 0 | vue-tools | 351 | 2024-04-28T17:21:19.779797 | GPL-3.0 | false | cfe703601d9acb37c6df449b0daf7a45 |
MZ | .venv\Lib\site-packages\pandas\_libs\tslibs\ccalendar.cp313-win_amd64.pyd | ccalendar.cp313-win_amd64.pyd | Other | 60,928 | 0.95 | 0.023346 | 0.006036 | vue-tools | 588 | 2024-08-17T07:57:03.508344 | GPL-3.0 | false | 03cb89ebfc4de85de012ca627c44fdcd |
DAYS: list[str]\nMONTH_ALIASES: dict[int, str]\nMONTH_NUMBERS: dict[str, int]\nMONTHS: list[str]\nint_to_weekday: dict[int, str]\n\ndef get_firstbday(year: int, month: int) -> int: ...\ndef get_lastbday(year: int, month: int) -> int: ...\ndef get_day_of_year(year: int, month: int, day: int) -> int: ...\ndef get_iso_calendar(year: int, month: int, day: int) -> tuple[int, int, int]: ...\ndef get_week_of_year(year: int, month: int, day: int) -> int: ...\ndef get_days_in_month(year: int, month: int) -> int: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\ccalendar.pyi | ccalendar.pyi | Other | 502 | 0.85 | 0.5 | 0 | node-utils | 75 | 2025-03-19T19:24:36.888880 | MIT | false | 32284a5f0b2c30b1cddc0d5f105c69db |
!<arch>\n/ -1 0 182 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\conversion.cp313-win_amd64.lib | conversion.cp313-win_amd64.lib | Other | 2,068 | 0.8 | 0 | 0 | awesome-app | 677 | 2023-07-18T02:24:09.579628 | BSD-3-Clause | false | f3c3d0b318ec94c8007a4f7f8d3dd9b2 |
from datetime import (\n datetime,\n tzinfo,\n)\n\nimport numpy as np\n\nDT64NS_DTYPE: np.dtype\nTD64NS_DTYPE: np.dtype\n\ndef localize_pydatetime(dt: datetime, tz: tzinfo | None) -> datetime: ...\ndef cast_from_unit_vectorized(\n values: np.ndarray, unit: str, out_unit: str = ...\n) -> np.ndarray: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\conversion.pyi | conversion.pyi | Other | 300 | 0.85 | 0.142857 | 0 | node-utils | 331 | 2025-04-09T16:48:09.102757 | BSD-3-Clause | false | c0c62fab7ec21c47ad9537a7281dcfbc |
!<arch>\n/ -1 0 166 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\dtypes.cp313-win_amd64.lib | dtypes.cp313-win_amd64.lib | Other | 1,996 | 0.8 | 0 | 0 | react-lib | 956 | 2023-12-13T17:47:22.382520 | BSD-3-Clause | false | 666857d2e557749d4930fdef2fdad3de |
from enum import Enum\n\nOFFSET_TO_PERIOD_FREQSTR: dict[str, str]\n\ndef periods_per_day(reso: int = ...) -> int: ...\ndef periods_per_second(reso: int) -> int: ...\ndef abbrev_to_npy_unit(abbrev: str | None) -> int: ...\ndef freq_to_period_freqstr(freq_n: int, freq_name: str) -> str: ...\n\nclass PeriodDtypeBase:\n _dtype_code: int # PeriodDtypeCode\n _n: int\n\n # actually __cinit__\n def __new__(cls, code: int, n: int): ...\n @property\n def _freq_group_code(self) -> int: ...\n @property\n def _resolution_obj(self) -> Resolution: ...\n def _get_to_timestamp_base(self) -> int: ...\n @property\n def _freqstr(self) -> str: ...\n def __hash__(self) -> int: ...\n def _is_tick_like(self) -> bool: ...\n @property\n def _creso(self) -> int: ...\n @property\n def _td64_unit(self) -> str: ...\n\nclass FreqGroup(Enum):\n FR_ANN: int\n FR_QTR: int\n FR_MTH: int\n FR_WK: int\n FR_BUS: int\n FR_DAY: int\n FR_HR: int\n FR_MIN: int\n FR_SEC: int\n FR_MS: int\n FR_US: int\n FR_NS: int\n FR_UND: int\n @staticmethod\n def from_period_dtype_code(code: int) -> FreqGroup: ...\n\nclass Resolution(Enum):\n RESO_NS: int\n RESO_US: int\n RESO_MS: int\n RESO_SEC: int\n RESO_MIN: int\n RESO_HR: int\n RESO_DAY: int\n RESO_MTH: int\n RESO_QTR: int\n RESO_YR: int\n def __lt__(self, other: Resolution) -> bool: ...\n def __ge__(self, other: Resolution) -> bool: ...\n @property\n def attrname(self) -> str: ...\n @classmethod\n def from_attrname(cls, attrname: str) -> Resolution: ...\n @classmethod\n def get_reso_from_freqstr(cls, freq: str) -> Resolution: ...\n @property\n def attr_abbrev(self) -> str: ...\n\nclass NpyDatetimeUnit(Enum):\n NPY_FR_Y: int\n NPY_FR_M: int\n NPY_FR_W: int\n NPY_FR_D: int\n NPY_FR_h: int\n NPY_FR_m: int\n NPY_FR_s: int\n NPY_FR_ms: int\n NPY_FR_us: int\n NPY_FR_ns: int\n NPY_FR_ps: int\n NPY_FR_fs: int\n NPY_FR_as: int\n NPY_FR_GENERIC: int\n | .venv\Lib\site-packages\pandas\_libs\tslibs\dtypes.pyi | dtypes.pyi | Other | 1,988 | 0.95 | 0.289157 | 0.013158 | vue-tools | 380 | 2025-03-14T14:31:06.306862 | GPL-3.0 | false | 3203716c695f631da799408402f0c91e |
!<arch>\n/ -1 0 166 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\fields.cp313-win_amd64.lib | fields.cp313-win_amd64.lib | Other | 1,996 | 0.8 | 0 | 0 | python-kit | 751 | 2023-11-24T17:58:17.091118 | BSD-3-Clause | false | 05146191da20ff33ba183eb53e7af569 |
import numpy as np\n\nfrom pandas._typing import npt\n\ndef build_field_sarray(\n dtindex: npt.NDArray[np.int64], # const int64_t[:]\n reso: int, # NPY_DATETIMEUNIT\n) -> np.ndarray: ...\ndef month_position_check(fields, weekdays) -> str | None: ...\ndef get_date_name_field(\n dtindex: npt.NDArray[np.int64], # const int64_t[:]\n field: str,\n locale: str | None = ...,\n reso: int = ..., # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.object_]: ...\ndef get_start_end_field(\n dtindex: npt.NDArray[np.int64],\n field: str,\n freqstr: str | None = ...,\n month_kw: int = ...,\n reso: int = ..., # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.bool_]: ...\ndef get_date_field(\n dtindex: npt.NDArray[np.int64], # const int64_t[:]\n field: str,\n reso: int = ..., # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.int32]: ...\ndef get_timedelta_field(\n tdindex: npt.NDArray[np.int64], # const int64_t[:]\n field: str,\n reso: int = ..., # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.int32]: ...\ndef get_timedelta_days(\n tdindex: npt.NDArray[np.int64], # const int64_t[:]\n reso: int = ..., # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.int64]: ...\ndef isleapyear_arr(\n years: np.ndarray,\n) -> npt.NDArray[np.bool_]: ...\ndef build_isocalendar_sarray(\n dtindex: npt.NDArray[np.int64], # const int64_t[:]\n reso: int, # NPY_DATETIMEUNIT\n) -> np.ndarray: ...\ndef _get_locale_names(name_type: str, locale: str | None = ...): ...\n\nclass RoundTo:\n @property\n def MINUS_INFTY(self) -> int: ...\n @property\n def PLUS_INFTY(self) -> int: ...\n @property\n def NEAREST_HALF_EVEN(self) -> int: ...\n @property\n def NEAREST_HALF_PLUS_INFTY(self) -> int: ...\n @property\n def NEAREST_HALF_MINUS_INFTY(self) -> int: ...\n\ndef round_nsint64(\n values: npt.NDArray[np.int64],\n mode: RoundTo,\n nanos: int,\n) -> npt.NDArray[np.int64]: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\fields.pyi | fields.pyi | Other | 1,860 | 0.95 | 0.274194 | 0 | vue-tools | 257 | 2023-07-29T12:55:35.633123 | MIT | false | 61a83dec2ea007e6c3c939cb81794b54 |
!<arch>\n/ -1 0 170 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\nattype.cp313-win_amd64.lib | nattype.cp313-win_amd64.lib | Other | 2,012 | 0.8 | 0 | 0 | python-kit | 703 | 2024-08-19T19:36:03.057940 | Apache-2.0 | false | cc9f5c2e8c0355a937119db17634b854 |
from datetime import (\n datetime,\n timedelta,\n tzinfo as _tzinfo,\n)\nimport typing\n\nimport numpy as np\n\nfrom pandas._libs.tslibs.period import Period\nfrom pandas._typing import Self\n\nNaT: NaTType\niNaT: int\nnat_strings: set[str]\n\n_NaTComparisonTypes: typing.TypeAlias = (\n datetime | timedelta | Period | np.datetime64 | np.timedelta64\n)\n\nclass _NatComparison:\n def __call__(self, other: _NaTComparisonTypes) -> bool: ...\n\nclass NaTType:\n _value: np.int64\n @property\n def value(self) -> int: ...\n @property\n def asm8(self) -> np.datetime64: ...\n def to_datetime64(self) -> np.datetime64: ...\n def to_numpy(\n self, dtype: np.dtype | str | None = ..., copy: bool = ...\n ) -> np.datetime64 | np.timedelta64: ...\n @property\n def is_leap_year(self) -> bool: ...\n @property\n def is_month_start(self) -> bool: ...\n @property\n def is_quarter_start(self) -> bool: ...\n @property\n def is_year_start(self) -> bool: ...\n @property\n def is_month_end(self) -> bool: ...\n @property\n def is_quarter_end(self) -> bool: ...\n @property\n def is_year_end(self) -> bool: ...\n @property\n def day_of_year(self) -> float: ...\n @property\n def dayofyear(self) -> float: ...\n @property\n def days_in_month(self) -> float: ...\n @property\n def daysinmonth(self) -> float: ...\n @property\n def day_of_week(self) -> float: ...\n @property\n def dayofweek(self) -> float: ...\n @property\n def week(self) -> float: ...\n @property\n def weekofyear(self) -> float: ...\n def day_name(self) -> float: ...\n def month_name(self) -> float: ...\n def weekday(self) -> float: ...\n def isoweekday(self) -> float: ...\n def total_seconds(self) -> float: ...\n def today(self, *args, **kwargs) -> NaTType: ...\n def now(self, *args, **kwargs) -> NaTType: ...\n def to_pydatetime(self) -> NaTType: ...\n def date(self) -> NaTType: ...\n def round(self) -> NaTType: ...\n def floor(self) -> NaTType: ...\n def ceil(self) -> NaTType: ...\n @property\n def tzinfo(self) -> None: ...\n @property\n def tz(self) -> None: ...\n def tz_convert(self, tz: _tzinfo | str | None) -> NaTType: ...\n def tz_localize(\n self,\n tz: _tzinfo | str | None,\n ambiguous: str = ...,\n nonexistent: str = ...,\n ) -> NaTType: ...\n def replace(\n self,\n year: int | None = ...,\n month: int | None = ...,\n day: int | None = ...,\n hour: int | None = ...,\n minute: int | None = ...,\n second: int | None = ...,\n microsecond: int | None = ...,\n nanosecond: int | None = ...,\n tzinfo: _tzinfo | None = ...,\n fold: int | None = ...,\n ) -> NaTType: ...\n @property\n def year(self) -> float: ...\n @property\n def quarter(self) -> float: ...\n @property\n def month(self) -> float: ...\n @property\n def day(self) -> float: ...\n @property\n def hour(self) -> float: ...\n @property\n def minute(self) -> float: ...\n @property\n def second(self) -> float: ...\n @property\n def millisecond(self) -> float: ...\n @property\n def microsecond(self) -> float: ...\n @property\n def nanosecond(self) -> float: ...\n # inject Timedelta properties\n @property\n def days(self) -> float: ...\n @property\n def microseconds(self) -> float: ...\n @property\n def nanoseconds(self) -> float: ...\n # inject Period properties\n @property\n def qyear(self) -> float: ...\n def __eq__(self, other: object) -> bool: ...\n def __ne__(self, other: object) -> bool: ...\n __lt__: _NatComparison\n __le__: _NatComparison\n __gt__: _NatComparison\n __ge__: _NatComparison\n def __sub__(self, other: Self | timedelta | datetime) -> Self: ...\n def __rsub__(self, other: Self | timedelta | datetime) -> Self: ...\n def __add__(self, other: Self | timedelta | datetime) -> Self: ...\n def __radd__(self, other: Self | timedelta | datetime) -> Self: ...\n def __hash__(self) -> int: ...\n def as_unit(self, unit: str, round_ok: bool = ...) -> NaTType: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\nattype.pyi | nattype.pyi | Other | 4,116 | 0.95 | 0.432624 | 0.014815 | vue-tools | 35 | 2024-04-03T10:06:01.544319 | BSD-3-Clause | false | a32264d9989ba0c9140e76e004252036 |
!<arch>\n/ -1 0 186 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\np_datetime.cp313-win_amd64.lib | np_datetime.cp313-win_amd64.lib | Other | 2,084 | 0.8 | 0 | 0 | react-lib | 994 | 2024-08-18T23:32:44.513222 | MIT | false | 09b6755d4da2cbf2b6dc6388f55e913b |
MZ | .venv\Lib\site-packages\pandas\_libs\tslibs\np_datetime.cp313-win_amd64.pyd | np_datetime.cp313-win_amd64.pyd | Other | 105,984 | 0.75 | 0.022164 | 0.003958 | python-kit | 731 | 2025-06-26T23:24:31.904300 | GPL-3.0 | false | 546e6f5a85b07e7328ba3a5b9849ad4c |
import numpy as np\n\nfrom pandas._typing import npt\n\nclass OutOfBoundsDatetime(ValueError): ...\nclass OutOfBoundsTimedelta(ValueError): ...\n\n# only exposed for testing\ndef py_get_unit_from_dtype(dtype: np.dtype): ...\ndef py_td64_to_tdstruct(td64: int, unit: int) -> dict: ...\ndef astype_overflowsafe(\n values: np.ndarray,\n dtype: np.dtype,\n copy: bool = ...,\n round_ok: bool = ...,\n is_coerce: bool = ...,\n) -> np.ndarray: ...\ndef is_unitless(dtype: np.dtype) -> bool: ...\ndef compare_mismatched_resolutions(\n left: np.ndarray, right: np.ndarray, op\n) -> npt.NDArray[np.bool_]: ...\ndef add_overflowsafe(\n left: npt.NDArray[np.int64],\n right: npt.NDArray[np.int64],\n) -> npt.NDArray[np.int64]: ...\ndef get_supported_dtype(dtype: np.dtype) -> np.dtype: ...\ndef is_supported_dtype(dtype: np.dtype) -> bool: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\np_datetime.pyi | np_datetime.pyi | Other | 831 | 0.95 | 0.407407 | 0.041667 | node-utils | 630 | 2024-06-07T16:53:36.196924 | BSD-3-Clause | false | c1f39ae5dcb69d930d3763d397de684f |
!<arch>\n/ -1 0 170 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\offsets.cp313-win_amd64.lib | offsets.cp313-win_amd64.lib | Other | 2,012 | 0.8 | 0 | 0 | python-kit | 631 | 2024-05-10T05:05:16.461704 | BSD-3-Clause | false | d5f1a3bceffb8f8e11c65100159523d1 |
from datetime import (\n datetime,\n time,\n timedelta,\n)\nfrom typing import (\n Any,\n Collection,\n Literal,\n TypeVar,\n overload,\n)\n\nimport numpy as np\n\nfrom pandas._libs.tslibs.nattype import NaTType\nfrom pandas._typing import (\n OffsetCalendar,\n Self,\n npt,\n)\n\nfrom .timedeltas import Timedelta\n\n_BaseOffsetT = TypeVar("_BaseOffsetT", bound=BaseOffset)\n_DatetimeT = TypeVar("_DatetimeT", bound=datetime)\n_TimedeltaT = TypeVar("_TimedeltaT", bound=timedelta)\n\n_relativedelta_kwds: set[str]\nprefix_mapping: dict[str, type]\n\nclass ApplyTypeError(TypeError): ...\n\nclass BaseOffset:\n n: int\n normalize: bool\n def __init__(self, n: int = ..., normalize: bool = ...) -> None: ...\n def __eq__(self, other) -> bool: ...\n def __ne__(self, other) -> bool: ...\n def __hash__(self) -> int: ...\n @property\n def kwds(self) -> dict: ...\n @property\n def base(self) -> BaseOffset: ...\n @overload\n def __add__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...\n @overload\n def __add__(self, other: BaseOffset) -> Self: ...\n @overload\n def __add__(self, other: _DatetimeT) -> _DatetimeT: ...\n @overload\n def __add__(self, other: _TimedeltaT) -> _TimedeltaT: ...\n @overload\n def __radd__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...\n @overload\n def __radd__(self, other: BaseOffset) -> Self: ...\n @overload\n def __radd__(self, other: _DatetimeT) -> _DatetimeT: ...\n @overload\n def __radd__(self, other: _TimedeltaT) -> _TimedeltaT: ...\n @overload\n def __radd__(self, other: NaTType) -> NaTType: ...\n def __sub__(self, other: BaseOffset) -> Self: ...\n @overload\n def __rsub__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...\n @overload\n def __rsub__(self, other: BaseOffset): ...\n @overload\n def __rsub__(self, other: _DatetimeT) -> _DatetimeT: ...\n @overload\n def __rsub__(self, other: _TimedeltaT) -> _TimedeltaT: ...\n @overload\n def __mul__(self, other: np.ndarray) -> np.ndarray: ...\n @overload\n def __mul__(self, other: int): ...\n @overload\n def __rmul__(self, other: np.ndarray) -> np.ndarray: ...\n @overload\n def __rmul__(self, other: int) -> Self: ...\n def __neg__(self) -> Self: ...\n def copy(self) -> Self: ...\n @property\n def name(self) -> str: ...\n @property\n def rule_code(self) -> str: ...\n @property\n def freqstr(self) -> str: ...\n def _apply(self, other): ...\n def _apply_array(self, dtarr: np.ndarray) -> np.ndarray: ...\n def rollback(self, dt: datetime) -> datetime: ...\n def rollforward(self, dt: datetime) -> datetime: ...\n def is_on_offset(self, dt: datetime) -> bool: ...\n def __setstate__(self, state) -> None: ...\n def __getstate__(self): ...\n @property\n def nanos(self) -> int: ...\n def is_anchored(self) -> bool: ...\n\ndef _get_offset(name: str) -> BaseOffset: ...\n\nclass SingleConstructorOffset(BaseOffset):\n @classmethod\n def _from_name(cls, suffix: None = ...): ...\n def __reduce__(self): ...\n\n@overload\ndef to_offset(freq: None, is_period: bool = ...) -> None: ...\n@overload\ndef to_offset(freq: _BaseOffsetT, is_period: bool = ...) -> _BaseOffsetT: ...\n@overload\ndef to_offset(freq: timedelta | str, is_period: bool = ...) -> BaseOffset: ...\n\nclass Tick(SingleConstructorOffset):\n _creso: int\n _prefix: str\n def __init__(self, n: int = ..., normalize: bool = ...) -> None: ...\n @property\n def delta(self) -> Timedelta: ...\n @property\n def nanos(self) -> int: ...\n\ndef delta_to_tick(delta: timedelta) -> Tick: ...\n\nclass Day(Tick): ...\nclass Hour(Tick): ...\nclass Minute(Tick): ...\nclass Second(Tick): ...\nclass Milli(Tick): ...\nclass Micro(Tick): ...\nclass Nano(Tick): ...\n\nclass RelativeDeltaOffset(BaseOffset):\n def __init__(self, n: int = ..., normalize: bool = ..., **kwds: Any) -> None: ...\n\nclass BusinessMixin(SingleConstructorOffset):\n def __init__(\n self, n: int = ..., normalize: bool = ..., offset: timedelta = ...\n ) -> None: ...\n\nclass BusinessDay(BusinessMixin): ...\n\nclass BusinessHour(BusinessMixin):\n def __init__(\n self,\n n: int = ...,\n normalize: bool = ...,\n start: str | time | Collection[str | time] = ...,\n end: str | time | Collection[str | time] = ...,\n offset: timedelta = ...,\n ) -> None: ...\n\nclass WeekOfMonthMixin(SingleConstructorOffset):\n def __init__(\n self, n: int = ..., normalize: bool = ..., weekday: int = ...\n ) -> None: ...\n\nclass YearOffset(SingleConstructorOffset):\n def __init__(\n self, n: int = ..., normalize: bool = ..., month: int | None = ...\n ) -> None: ...\n\nclass BYearEnd(YearOffset): ...\nclass BYearBegin(YearOffset): ...\nclass YearEnd(YearOffset): ...\nclass YearBegin(YearOffset): ...\n\nclass QuarterOffset(SingleConstructorOffset):\n def __init__(\n self, n: int = ..., normalize: bool = ..., startingMonth: int | None = ...\n ) -> None: ...\n\nclass BQuarterEnd(QuarterOffset): ...\nclass BQuarterBegin(QuarterOffset): ...\nclass QuarterEnd(QuarterOffset): ...\nclass QuarterBegin(QuarterOffset): ...\nclass MonthOffset(SingleConstructorOffset): ...\nclass MonthEnd(MonthOffset): ...\nclass MonthBegin(MonthOffset): ...\nclass BusinessMonthEnd(MonthOffset): ...\nclass BusinessMonthBegin(MonthOffset): ...\n\nclass SemiMonthOffset(SingleConstructorOffset):\n def __init__(\n self, n: int = ..., normalize: bool = ..., day_of_month: int | None = ...\n ) -> None: ...\n\nclass SemiMonthEnd(SemiMonthOffset): ...\nclass SemiMonthBegin(SemiMonthOffset): ...\n\nclass Week(SingleConstructorOffset):\n def __init__(\n self, n: int = ..., normalize: bool = ..., weekday: int | None = ...\n ) -> None: ...\n\nclass WeekOfMonth(WeekOfMonthMixin):\n def __init__(\n self, n: int = ..., normalize: bool = ..., week: int = ..., weekday: int = ...\n ) -> None: ...\n\nclass LastWeekOfMonth(WeekOfMonthMixin): ...\n\nclass FY5253Mixin(SingleConstructorOffset):\n def __init__(\n self,\n n: int = ...,\n normalize: bool = ...,\n weekday: int = ...,\n startingMonth: int = ...,\n variation: Literal["nearest", "last"] = ...,\n ) -> None: ...\n\nclass FY5253(FY5253Mixin): ...\n\nclass FY5253Quarter(FY5253Mixin):\n def __init__(\n self,\n n: int = ...,\n normalize: bool = ...,\n weekday: int = ...,\n startingMonth: int = ...,\n qtr_with_extra_week: int = ...,\n variation: Literal["nearest", "last"] = ...,\n ) -> None: ...\n\nclass Easter(SingleConstructorOffset): ...\n\nclass _CustomBusinessMonth(BusinessMixin):\n def __init__(\n self,\n n: int = ...,\n normalize: bool = ...,\n weekmask: str = ...,\n holidays: list | None = ...,\n calendar: OffsetCalendar | None = ...,\n offset: timedelta = ...,\n ) -> None: ...\n\nclass CustomBusinessDay(BusinessDay):\n def __init__(\n self,\n n: int = ...,\n normalize: bool = ...,\n weekmask: str = ...,\n holidays: list | None = ...,\n calendar: OffsetCalendar | None = ...,\n offset: timedelta = ...,\n ) -> None: ...\n\nclass CustomBusinessHour(BusinessHour):\n def __init__(\n self,\n n: int = ...,\n normalize: bool = ...,\n weekmask: str = ...,\n holidays: list | None = ...,\n calendar: OffsetCalendar | None = ...,\n start: str | time | Collection[str | time] = ...,\n end: str | time | Collection[str | time] = ...,\n offset: timedelta = ...,\n ) -> None: ...\n\nclass CustomBusinessMonthEnd(_CustomBusinessMonth): ...\nclass CustomBusinessMonthBegin(_CustomBusinessMonth): ...\nclass OffsetMeta(type): ...\nclass DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): ...\n\nBDay = BusinessDay\nBMonthEnd = BusinessMonthEnd\nBMonthBegin = BusinessMonthBegin\nCBMonthEnd = CustomBusinessMonthEnd\nCBMonthBegin = CustomBusinessMonthBegin\nCDay = CustomBusinessDay\n\ndef roll_qtrday(\n other: datetime, n: int, month: int, day_opt: str, modby: int\n) -> int: ...\n\nINVALID_FREQ_ERR_MSG: Literal["Invalid frequency: {0}"]\n\ndef shift_months(\n dtindex: npt.NDArray[np.int64],\n months: int,\n day_opt: str | None = ...,\n reso: int = ...,\n) -> npt.NDArray[np.int64]: ...\n\n_offset_map: dict[str, BaseOffset]\n | .venv\Lib\site-packages\pandas\_libs\tslibs\offsets.pyi | offsets.pyi | Other | 8,345 | 0.85 | 0.390244 | 0 | react-lib | 256 | 2024-03-16T03:17:15.373097 | GPL-3.0 | false | 92ebb025e0677f9a1b8a364931ab5e1a |
!<arch>\n/ -1 0 170 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\parsing.cp313-win_amd64.lib | parsing.cp313-win_amd64.lib | Other | 2,012 | 0.8 | 0 | 0 | awesome-app | 479 | 2025-03-03T18:07:58.494534 | Apache-2.0 | false | e2388a98875ea5eda7f71f1ada5af98f |
from datetime import datetime\n\nimport numpy as np\n\nfrom pandas._typing import npt\n\nclass DateParseError(ValueError): ...\n\ndef py_parse_datetime_string(\n date_string: str,\n dayfirst: bool = ...,\n yearfirst: bool = ...,\n) -> datetime: ...\ndef parse_datetime_string_with_reso(\n date_string: str,\n freq: str | None = ...,\n dayfirst: bool | None = ...,\n yearfirst: bool | None = ...,\n) -> tuple[datetime, str]: ...\ndef _does_string_look_like_datetime(py_string: str) -> bool: ...\ndef quarter_to_myear(year: int, quarter: int, freq: str) -> tuple[int, int]: ...\ndef try_parse_dates(\n values: npt.NDArray[np.object_], # object[:]\n parser,\n) -> npt.NDArray[np.object_]: ...\ndef guess_datetime_format(\n dt_str: str,\n dayfirst: bool | None = ...,\n) -> str | None: ...\ndef concat_date_cols(\n date_cols: tuple,\n) -> npt.NDArray[np.object_]: ...\ndef get_rule_month(source: str) -> str: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\parsing.pyi | parsing.pyi | Other | 914 | 0.95 | 0.272727 | 0 | node-utils | 112 | 2025-04-24T09:53:56.348255 | GPL-3.0 | false | bfc8db056d345f82b9c96df4922f49a1 |
!<arch>\n/ -1 0 166 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\period.cp313-win_amd64.lib | period.cp313-win_amd64.lib | Other | 1,996 | 0.8 | 0 | 0 | react-lib | 703 | 2024-10-21T18:43:12.771900 | BSD-3-Clause | false | b563aa11915d5eb9140e0f2b7b65c3e9 |
from datetime import timedelta\nfrom typing import Literal\n\nimport numpy as np\n\nfrom pandas._libs.tslibs.dtypes import PeriodDtypeBase\nfrom pandas._libs.tslibs.nattype import NaTType\nfrom pandas._libs.tslibs.offsets import BaseOffset\nfrom pandas._libs.tslibs.timestamps import Timestamp\nfrom pandas._typing import (\n Frequency,\n npt,\n)\n\nINVALID_FREQ_ERR_MSG: str\nDIFFERENT_FREQ: str\n\nclass IncompatibleFrequency(ValueError): ...\n\ndef periodarr_to_dt64arr(\n periodarr: npt.NDArray[np.int64], # const int64_t[:]\n freq: int,\n) -> npt.NDArray[np.int64]: ...\ndef period_asfreq_arr(\n arr: npt.NDArray[np.int64],\n freq1: int,\n freq2: int,\n end: bool,\n) -> npt.NDArray[np.int64]: ...\ndef get_period_field_arr(\n field: str,\n arr: npt.NDArray[np.int64], # const int64_t[:]\n freq: int,\n) -> npt.NDArray[np.int64]: ...\ndef from_ordinals(\n values: npt.NDArray[np.int64], # const int64_t[:]\n freq: timedelta | BaseOffset | str,\n) -> npt.NDArray[np.int64]: ...\ndef extract_ordinals(\n values: npt.NDArray[np.object_],\n freq: Frequency | int,\n) -> npt.NDArray[np.int64]: ...\ndef extract_freq(\n values: npt.NDArray[np.object_],\n) -> BaseOffset: ...\ndef period_array_strftime(\n values: npt.NDArray[np.int64],\n dtype_code: int,\n na_rep,\n date_format: str | None,\n) -> npt.NDArray[np.object_]: ...\n\n# exposed for tests\ndef period_asfreq(ordinal: int, freq1: int, freq2: int, end: bool) -> int: ...\ndef period_ordinal(\n y: int, m: int, d: int, h: int, min: int, s: int, us: int, ps: int, freq: int\n) -> int: ...\ndef freq_to_dtype_code(freq: BaseOffset) -> int: ...\ndef validate_end_alias(how: str) -> Literal["E", "S"]: ...\n\nclass PeriodMixin:\n @property\n def end_time(self) -> Timestamp: ...\n @property\n def start_time(self) -> Timestamp: ...\n def _require_matching_freq(self, other: BaseOffset, base: bool = ...) -> None: ...\n\nclass Period(PeriodMixin):\n ordinal: int # int64_t\n freq: BaseOffset\n _dtype: PeriodDtypeBase\n\n # error: "__new__" must return a class instance (got "Union[Period, NaTType]")\n def __new__( # type: ignore[misc]\n cls,\n value=...,\n freq: int | str | BaseOffset | None = ...,\n ordinal: int | None = ...,\n year: int | None = ...,\n month: int | None = ...,\n quarter: int | None = ...,\n day: int | None = ...,\n hour: int | None = ...,\n minute: int | None = ...,\n second: int | None = ...,\n ) -> Period | NaTType: ...\n @classmethod\n def _maybe_convert_freq(cls, freq) -> BaseOffset: ...\n @classmethod\n def _from_ordinal(cls, ordinal: int, freq: BaseOffset) -> Period: ...\n @classmethod\n def now(cls, freq: Frequency) -> Period: ...\n def strftime(self, fmt: str | None) -> str: ...\n def to_timestamp(\n self,\n freq: str | BaseOffset | None = ...,\n how: str = ...,\n ) -> Timestamp: ...\n def asfreq(self, freq: str | BaseOffset, how: str = ...) -> Period: ...\n @property\n def freqstr(self) -> str: ...\n @property\n def is_leap_year(self) -> bool: ...\n @property\n def daysinmonth(self) -> int: ...\n @property\n def days_in_month(self) -> int: ...\n @property\n def qyear(self) -> int: ...\n @property\n def quarter(self) -> int: ...\n @property\n def day_of_year(self) -> int: ...\n @property\n def weekday(self) -> int: ...\n @property\n def day_of_week(self) -> int: ...\n @property\n def week(self) -> int: ...\n @property\n def weekofyear(self) -> int: ...\n @property\n def second(self) -> int: ...\n @property\n def minute(self) -> int: ...\n @property\n def hour(self) -> int: ...\n @property\n def day(self) -> int: ...\n @property\n def month(self) -> int: ...\n @property\n def year(self) -> int: ...\n def __sub__(self, other) -> Period | BaseOffset: ...\n def __add__(self, other) -> Period: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\period.pyi | period.pyi | Other | 3,908 | 0.95 | 0.333333 | 0.015873 | awesome-app | 668 | 2024-02-09T22:38:33.109559 | BSD-3-Clause | false | e8ca27abcc4ac655f46ad2a90c0fe048 |
!<arch>\n/ -1 0 174 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\strptime.cp313-win_amd64.lib | strptime.cp313-win_amd64.lib | Other | 2,032 | 0.8 | 0 | 0 | react-lib | 315 | 2025-02-08T16:34:04.566698 | MIT | false | d0e43dfe69ba9c14fe3cd40386f45c43 |
import numpy as np\n\nfrom pandas._typing import npt\n\ndef array_strptime(\n values: npt.NDArray[np.object_],\n fmt: str | None,\n exact: bool = ...,\n errors: str = ...,\n utc: bool = ...,\n creso: int = ..., # NPY_DATETIMEUNIT\n) -> tuple[np.ndarray, np.ndarray]: ...\n\n# first ndarray is M8[ns], second is object ndarray of tzinfo | None\n | .venv\Lib\site-packages\pandas\_libs\tslibs\strptime.pyi | strptime.pyi | Other | 349 | 0.95 | 0.071429 | 0.090909 | awesome-app | 12 | 2025-07-02T13:14:46.344426 | GPL-3.0 | false | c2415dbaad7e409e43582486411fc303 |
!<arch>\n/ -1 0 182 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\timedeltas.cp313-win_amd64.lib | timedeltas.cp313-win_amd64.lib | Other | 2,068 | 0.8 | 0 | 0 | node-utils | 5 | 2024-10-10T17:15:55.934934 | Apache-2.0 | false | fadc67994d300fbffed28b3a630e2c67 |
from datetime import timedelta\nfrom typing import (\n ClassVar,\n Literal,\n TypeAlias,\n TypeVar,\n overload,\n)\n\nimport numpy as np\n\nfrom pandas._libs.tslibs import (\n NaTType,\n Tick,\n)\nfrom pandas._typing import (\n Frequency,\n Self,\n npt,\n)\n\n# This should be kept consistent with the keys in the dict timedelta_abbrevs\n# in pandas/_libs/tslibs/timedeltas.pyx\nUnitChoices: TypeAlias = Literal[\n "Y",\n "y",\n "M",\n "W",\n "w",\n "D",\n "d",\n "days",\n "day",\n "hours",\n "hour",\n "hr",\n "h",\n "m",\n "minute",\n "min",\n "minutes",\n "T",\n "t",\n "s",\n "seconds",\n "sec",\n "second",\n "ms",\n "milliseconds",\n "millisecond",\n "milli",\n "millis",\n "L",\n "l",\n "us",\n "microseconds",\n "microsecond",\n "µs",\n "micro",\n "micros",\n "u",\n "ns",\n "nanoseconds",\n "nano",\n "nanos",\n "nanosecond",\n "n",\n]\n_S = TypeVar("_S", bound=timedelta)\n\ndef get_unit_for_round(freq, creso: int) -> int: ...\ndef disallow_ambiguous_unit(unit: str | None) -> None: ...\ndef ints_to_pytimedelta(\n m8values: npt.NDArray[np.timedelta64],\n box: bool = ...,\n) -> npt.NDArray[np.object_]: ...\ndef array_to_timedelta64(\n values: npt.NDArray[np.object_],\n unit: str | None = ...,\n errors: str = ...,\n) -> np.ndarray: ... # np.ndarray[m8ns]\ndef parse_timedelta_unit(unit: str | None) -> UnitChoices: ...\ndef delta_to_nanoseconds(\n delta: np.timedelta64 | timedelta | Tick,\n reso: int = ..., # NPY_DATETIMEUNIT\n round_ok: bool = ...,\n) -> int: ...\ndef floordiv_object_array(\n left: np.ndarray, right: npt.NDArray[np.object_]\n) -> np.ndarray: ...\ndef truediv_object_array(\n left: np.ndarray, right: npt.NDArray[np.object_]\n) -> np.ndarray: ...\n\nclass Timedelta(timedelta):\n _creso: int\n min: ClassVar[Timedelta]\n max: ClassVar[Timedelta]\n resolution: ClassVar[Timedelta]\n value: int # np.int64\n _value: int # np.int64\n # error: "__new__" must return a class instance (got "Union[Timestamp, NaTType]")\n def __new__( # type: ignore[misc]\n cls: type[_S],\n value=...,\n unit: str | None = ...,\n **kwargs: float | np.integer | np.floating,\n ) -> _S | NaTType: ...\n @classmethod\n def _from_value_and_reso(cls, value: np.int64, reso: int) -> Timedelta: ...\n @property\n def days(self) -> int: ...\n @property\n def seconds(self) -> int: ...\n @property\n def microseconds(self) -> int: ...\n def total_seconds(self) -> float: ...\n def to_pytimedelta(self) -> timedelta: ...\n def to_timedelta64(self) -> np.timedelta64: ...\n @property\n def asm8(self) -> np.timedelta64: ...\n # TODO: round/floor/ceil could return NaT?\n def round(self, freq: Frequency) -> Self: ...\n def floor(self, freq: Frequency) -> Self: ...\n def ceil(self, freq: Frequency) -> Self: ...\n @property\n def resolution_string(self) -> str: ...\n def __add__(self, other: timedelta) -> Timedelta: ...\n def __radd__(self, other: timedelta) -> Timedelta: ...\n def __sub__(self, other: timedelta) -> Timedelta: ...\n def __rsub__(self, other: timedelta) -> Timedelta: ...\n def __neg__(self) -> Timedelta: ...\n def __pos__(self) -> Timedelta: ...\n def __abs__(self) -> Timedelta: ...\n def __mul__(self, other: float) -> Timedelta: ...\n def __rmul__(self, other: float) -> Timedelta: ...\n # error: Signature of "__floordiv__" incompatible with supertype "timedelta"\n @overload # type: ignore[override]\n def __floordiv__(self, other: timedelta) -> int: ...\n @overload\n def __floordiv__(self, other: float) -> Timedelta: ...\n @overload\n def __floordiv__(\n self, other: npt.NDArray[np.timedelta64]\n ) -> npt.NDArray[np.intp]: ...\n @overload\n def __floordiv__(\n self, other: npt.NDArray[np.number]\n ) -> npt.NDArray[np.timedelta64] | Timedelta: ...\n @overload\n def __rfloordiv__(self, other: timedelta | str) -> int: ...\n @overload\n def __rfloordiv__(self, other: None | NaTType) -> NaTType: ...\n @overload\n def __rfloordiv__(self, other: np.ndarray) -> npt.NDArray[np.timedelta64]: ...\n @overload\n def __truediv__(self, other: timedelta) -> float: ...\n @overload\n def __truediv__(self, other: float) -> Timedelta: ...\n def __mod__(self, other: timedelta) -> Timedelta: ...\n def __divmod__(self, other: timedelta) -> tuple[int, Timedelta]: ...\n def __le__(self, other: timedelta) -> bool: ...\n def __lt__(self, other: timedelta) -> bool: ...\n def __ge__(self, other: timedelta) -> bool: ...\n def __gt__(self, other: timedelta) -> bool: ...\n def __hash__(self) -> int: ...\n def isoformat(self) -> str: ...\n def to_numpy(\n self, dtype: npt.DTypeLike = ..., copy: bool = False\n ) -> np.timedelta64: ...\n def view(self, dtype: npt.DTypeLike) -> object: ...\n @property\n def unit(self) -> str: ...\n def as_unit(self, unit: str, round_ok: bool = ...) -> Timedelta: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\timedeltas.pyi | timedeltas.pyi | Other | 5,009 | 0.95 | 0.304598 | 0.035503 | awesome-app | 862 | 2025-06-06T11:16:54.883739 | GPL-3.0 | false | e7d0599b45afd4f799c55da9ff6c580d |
!<arch>\n/ -1 0 182 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\timestamps.cp313-win_amd64.lib | timestamps.cp313-win_amd64.lib | Other | 2,068 | 0.8 | 0 | 0 | python-kit | 51 | 2023-08-25T15:52:15.382654 | MIT | false | fd3cf956382fa4beb810c78eebb3b0cf |
from datetime import (\n date as _date,\n datetime,\n time as _time,\n timedelta,\n tzinfo as _tzinfo,\n)\nfrom time import struct_time\nfrom typing import (\n ClassVar,\n Literal,\n TypeAlias,\n overload,\n)\n\nimport numpy as np\n\nfrom pandas._libs.tslibs import (\n BaseOffset,\n NaTType,\n Period,\n Tick,\n Timedelta,\n)\nfrom pandas._typing import (\n Self,\n TimestampNonexistent,\n)\n\n_TimeZones: TypeAlias = str | _tzinfo | None | int\n\ndef integer_op_not_supported(obj: object) -> TypeError: ...\n\nclass Timestamp(datetime):\n _creso: int\n min: ClassVar[Timestamp]\n max: ClassVar[Timestamp]\n\n resolution: ClassVar[Timedelta]\n _value: int # np.int64\n # error: "__new__" must return a class instance (got "Union[Timestamp, NaTType]")\n def __new__( # type: ignore[misc]\n cls: type[Self],\n ts_input: np.integer | float | str | _date | datetime | np.datetime64 = ...,\n year: int | None = ...,\n month: int | None = ...,\n day: int | None = ...,\n hour: int | None = ...,\n minute: int | None = ...,\n second: int | None = ...,\n microsecond: int | None = ...,\n tzinfo: _tzinfo | None = ...,\n *,\n nanosecond: int | None = ...,\n tz: _TimeZones = ...,\n unit: str | int | None = ...,\n fold: int | None = ...,\n ) -> Self | NaTType: ...\n @classmethod\n def _from_value_and_reso(\n cls, value: int, reso: int, tz: _TimeZones\n ) -> Timestamp: ...\n @property\n def value(self) -> int: ... # np.int64\n @property\n def year(self) -> int: ...\n @property\n def month(self) -> int: ...\n @property\n def day(self) -> int: ...\n @property\n def hour(self) -> int: ...\n @property\n def minute(self) -> int: ...\n @property\n def second(self) -> int: ...\n @property\n def microsecond(self) -> int: ...\n @property\n def nanosecond(self) -> int: ...\n @property\n def tzinfo(self) -> _tzinfo | None: ...\n @property\n def tz(self) -> _tzinfo | None: ...\n @property\n def fold(self) -> int: ...\n @classmethod\n def fromtimestamp(cls, ts: float, tz: _TimeZones = ...) -> Self: ...\n @classmethod\n def utcfromtimestamp(cls, ts: float) -> Self: ...\n @classmethod\n def today(cls, tz: _TimeZones = ...) -> Self: ...\n @classmethod\n def fromordinal(\n cls,\n ordinal: int,\n tz: _TimeZones = ...,\n ) -> Self: ...\n @classmethod\n def now(cls, tz: _TimeZones = ...) -> Self: ...\n @classmethod\n def utcnow(cls) -> Self: ...\n # error: Signature of "combine" incompatible with supertype "datetime"\n @classmethod\n def combine( # type: ignore[override]\n cls, date: _date, time: _time\n ) -> datetime: ...\n @classmethod\n def fromisoformat(cls, date_string: str) -> Self: ...\n def strftime(self, format: str) -> str: ...\n def __format__(self, fmt: str) -> str: ...\n def toordinal(self) -> int: ...\n def timetuple(self) -> struct_time: ...\n def timestamp(self) -> float: ...\n def utctimetuple(self) -> struct_time: ...\n def date(self) -> _date: ...\n def time(self) -> _time: ...\n def timetz(self) -> _time: ...\n # LSP violation: nanosecond is not present in datetime.datetime.replace\n # and has positional args following it\n def replace( # type: ignore[override]\n self,\n year: int | None = ...,\n month: int | None = ...,\n day: int | None = ...,\n hour: int | None = ...,\n minute: int | None = ...,\n second: int | None = ...,\n microsecond: int | None = ...,\n nanosecond: int | None = ...,\n tzinfo: _tzinfo | type[object] | None = ...,\n fold: int | None = ...,\n ) -> Self: ...\n # LSP violation: datetime.datetime.astimezone has a default value for tz\n def astimezone(self, tz: _TimeZones) -> Self: ... # type: ignore[override]\n def ctime(self) -> str: ...\n def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...\n @classmethod\n def strptime(\n # Note: strptime is actually disabled and raises NotImplementedError\n cls,\n date_string: str,\n format: str,\n ) -> Self: ...\n def utcoffset(self) -> timedelta | None: ...\n def tzname(self) -> str | None: ...\n def dst(self) -> timedelta | None: ...\n def __le__(self, other: datetime) -> bool: ... # type: ignore[override]\n def __lt__(self, other: datetime) -> bool: ... # type: ignore[override]\n def __ge__(self, other: datetime) -> bool: ... # type: ignore[override]\n def __gt__(self, other: datetime) -> bool: ... # type: ignore[override]\n # error: Signature of "__add__" incompatible with supertype "date"/"datetime"\n @overload # type: ignore[override]\n def __add__(self, other: np.ndarray) -> np.ndarray: ...\n @overload\n def __add__(self, other: timedelta | np.timedelta64 | Tick) -> Self: ...\n def __radd__(self, other: timedelta) -> Self: ...\n @overload # type: ignore[override]\n def __sub__(self, other: datetime) -> Timedelta: ...\n @overload\n def __sub__(self, other: timedelta | np.timedelta64 | Tick) -> Self: ...\n def __hash__(self) -> int: ...\n def weekday(self) -> int: ...\n def isoweekday(self) -> int: ...\n # Return type "Tuple[int, int, int]" of "isocalendar" incompatible with return\n # type "_IsoCalendarDate" in supertype "date"\n def isocalendar(self) -> tuple[int, int, int]: ... # type: ignore[override]\n @property\n def is_leap_year(self) -> bool: ...\n @property\n def is_month_start(self) -> bool: ...\n @property\n def is_quarter_start(self) -> bool: ...\n @property\n def is_year_start(self) -> bool: ...\n @property\n def is_month_end(self) -> bool: ...\n @property\n def is_quarter_end(self) -> bool: ...\n @property\n def is_year_end(self) -> bool: ...\n def to_pydatetime(self, warn: bool = ...) -> datetime: ...\n def to_datetime64(self) -> np.datetime64: ...\n def to_period(self, freq: BaseOffset | str | None = None) -> Period: ...\n def to_julian_date(self) -> np.float64: ...\n @property\n def asm8(self) -> np.datetime64: ...\n def tz_convert(self, tz: _TimeZones) -> Self: ...\n # TODO: could return NaT?\n def tz_localize(\n self,\n tz: _TimeZones,\n ambiguous: bool | Literal["raise", "NaT"] = ...,\n nonexistent: TimestampNonexistent = ...,\n ) -> Self: ...\n def normalize(self) -> Self: ...\n # TODO: round/floor/ceil could return NaT?\n def round(\n self,\n freq: str,\n ambiguous: bool | Literal["raise", "NaT"] = ...,\n nonexistent: TimestampNonexistent = ...,\n ) -> Self: ...\n def floor(\n self,\n freq: str,\n ambiguous: bool | Literal["raise", "NaT"] = ...,\n nonexistent: TimestampNonexistent = ...,\n ) -> Self: ...\n def ceil(\n self,\n freq: str,\n ambiguous: bool | Literal["raise", "NaT"] = ...,\n nonexistent: TimestampNonexistent = ...,\n ) -> Self: ...\n def day_name(self, locale: str | None = ...) -> str: ...\n def month_name(self, locale: str | None = ...) -> str: ...\n @property\n def day_of_week(self) -> int: ...\n @property\n def dayofweek(self) -> int: ...\n @property\n def day_of_year(self) -> int: ...\n @property\n def dayofyear(self) -> int: ...\n @property\n def quarter(self) -> int: ...\n @property\n def week(self) -> int: ...\n def to_numpy(\n self, dtype: np.dtype | None = ..., copy: bool = ...\n ) -> np.datetime64: ...\n @property\n def _date_repr(self) -> str: ...\n @property\n def days_in_month(self) -> int: ...\n @property\n def daysinmonth(self) -> int: ...\n @property\n def unit(self) -> str: ...\n def as_unit(self, unit: str, round_ok: bool = ...) -> Timestamp: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\timestamps.pyi | timestamps.pyi | Other | 7,831 | 0.95 | 0.365145 | 0.051064 | vue-tools | 533 | 2024-02-03T16:07:18.447019 | MIT | false | f871ca6a8f5b2229a2ad82dcf3563b45 |
!<arch>\n/ -1 0 178 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\timezones.cp313-win_amd64.lib | timezones.cp313-win_amd64.lib | Other | 2,048 | 0.8 | 0 | 0 | react-lib | 56 | 2024-11-09T20:20:09.242451 | MIT | false | 826a9e5c3f2c5aea68c59bb841793210 |
from datetime import (\n datetime,\n tzinfo,\n)\nfrom typing import Callable\n\nimport numpy as np\n\n# imported from dateutil.tz\ndateutil_gettz: Callable[[str], tzinfo]\n\ndef tz_standardize(tz: tzinfo) -> tzinfo: ...\ndef tz_compare(start: tzinfo | None, end: tzinfo | None) -> bool: ...\ndef infer_tzinfo(\n start: datetime | None,\n end: datetime | None,\n) -> tzinfo | None: ...\ndef maybe_get_tz(tz: str | int | np.int64 | tzinfo | None) -> tzinfo | None: ...\ndef get_timezone(tz: tzinfo) -> tzinfo | str: ...\ndef is_utc(tz: tzinfo | None) -> bool: ...\ndef is_fixed_offset(tz: tzinfo) -> bool: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\timezones.pyi | timezones.pyi | Other | 600 | 0.95 | 0.333333 | 0.055556 | python-kit | 779 | 2023-09-02T02:12:01.113395 | BSD-3-Clause | false | 28b2cf3f7ba2a2543b3bafe31f072898 |
!<arch>\n/ -1 0 190 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\tzconversion.cp313-win_amd64.lib | tzconversion.cp313-win_amd64.lib | Other | 2,104 | 0.8 | 0 | 0 | node-utils | 472 | 2023-08-20T12:37:13.695015 | GPL-3.0 | false | 575fae4d28dc4d3bc0c88d8f784f067c |
from datetime import (\n timedelta,\n tzinfo,\n)\nfrom typing import Iterable\n\nimport numpy as np\n\nfrom pandas._typing import npt\n\n# tz_convert_from_utc_single exposed for testing\ndef tz_convert_from_utc_single(\n utc_val: np.int64, tz: tzinfo, creso: int = ...\n) -> np.int64: ...\ndef tz_localize_to_utc(\n vals: npt.NDArray[np.int64],\n tz: tzinfo | None,\n ambiguous: str | bool | Iterable[bool] | None = ...,\n nonexistent: str | timedelta | np.timedelta64 | None = ...,\n creso: int = ..., # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.int64]: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\tzconversion.pyi | tzconversion.pyi | Other | 560 | 0.95 | 0.142857 | 0.055556 | vue-tools | 244 | 2024-07-07T01:09:35.378939 | GPL-3.0 | false | 5e5be2152a01f28e84e43f3af89f6fd4 |
!<arch>\n/ -1 0 182 `\n | .venv\Lib\site-packages\pandas\_libs\tslibs\vectorized.cp313-win_amd64.lib | vectorized.cp313-win_amd64.lib | Other | 2,068 | 0.8 | 0 | 0 | node-utils | 276 | 2023-07-26T00:55:43.522765 | GPL-3.0 | false | 23810a4b9160a9d9ae0ca344d8560d14 |
"""\nFor cython types that cannot be represented precisely, closest-available\npython equivalents are used, and the precise types kept as adjacent comments.\n"""\nfrom datetime import tzinfo\n\nimport numpy as np\n\nfrom pandas._libs.tslibs.dtypes import Resolution\nfrom pandas._typing import npt\n\ndef dt64arr_to_periodarr(\n stamps: npt.NDArray[np.int64],\n freq: int,\n tz: tzinfo | None,\n reso: int = ..., # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.int64]: ...\ndef is_date_array_normalized(\n stamps: npt.NDArray[np.int64],\n tz: tzinfo | None,\n reso: int, # NPY_DATETIMEUNIT\n) -> bool: ...\ndef normalize_i8_timestamps(\n stamps: npt.NDArray[np.int64],\n tz: tzinfo | None,\n reso: int, # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.int64]: ...\ndef get_resolution(\n stamps: npt.NDArray[np.int64],\n tz: tzinfo | None = ...,\n reso: int = ..., # NPY_DATETIMEUNIT\n) -> Resolution: ...\ndef ints_to_pydatetime(\n stamps: npt.NDArray[np.int64],\n tz: tzinfo | None = ...,\n box: str = ...,\n reso: int = ..., # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.object_]: ...\ndef tz_convert_from_utc(\n stamps: npt.NDArray[np.int64],\n tz: tzinfo | None,\n reso: int = ..., # NPY_DATETIMEUNIT\n) -> npt.NDArray[np.int64]: ...\n | .venv\Lib\site-packages\pandas\_libs\tslibs\vectorized.pyi | vectorized.pyi | Other | 1,239 | 0.95 | 0.139535 | 0 | vue-tools | 470 | 2024-09-23T05:13:01.086544 | GPL-3.0 | false | 475b32ad0756109cce456e95dde7ecdf |
__all__ = [\n "dtypes",\n "localize_pydatetime",\n "NaT",\n "NaTType",\n "iNaT",\n "nat_strings",\n "OutOfBoundsDatetime",\n "OutOfBoundsTimedelta",\n "IncompatibleFrequency",\n "Period",\n "Resolution",\n "Timedelta",\n "normalize_i8_timestamps",\n "is_date_array_normalized",\n "dt64arr_to_periodarr",\n "delta_to_nanoseconds",\n "ints_to_pydatetime",\n "ints_to_pytimedelta",\n "get_resolution",\n "Timestamp",\n "tz_convert_from_utc_single",\n "tz_convert_from_utc",\n "to_offset",\n "Tick",\n "BaseOffset",\n "tz_compare",\n "is_unitless",\n "astype_overflowsafe",\n "get_unit_from_dtype",\n "periods_per_day",\n "periods_per_second",\n "guess_datetime_format",\n "add_overflowsafe",\n "get_supported_dtype",\n "is_supported_dtype",\n]\n\nfrom pandas._libs.tslibs import dtypes # pylint: disable=import-self\nfrom pandas._libs.tslibs.conversion import localize_pydatetime\nfrom pandas._libs.tslibs.dtypes import (\n Resolution,\n periods_per_day,\n periods_per_second,\n)\nfrom pandas._libs.tslibs.nattype import (\n NaT,\n NaTType,\n iNaT,\n nat_strings,\n)\nfrom pandas._libs.tslibs.np_datetime import (\n OutOfBoundsDatetime,\n OutOfBoundsTimedelta,\n add_overflowsafe,\n astype_overflowsafe,\n get_supported_dtype,\n is_supported_dtype,\n is_unitless,\n py_get_unit_from_dtype as get_unit_from_dtype,\n)\nfrom pandas._libs.tslibs.offsets import (\n BaseOffset,\n Tick,\n to_offset,\n)\nfrom pandas._libs.tslibs.parsing import guess_datetime_format\nfrom pandas._libs.tslibs.period import (\n IncompatibleFrequency,\n Period,\n)\nfrom pandas._libs.tslibs.timedeltas import (\n Timedelta,\n delta_to_nanoseconds,\n ints_to_pytimedelta,\n)\nfrom pandas._libs.tslibs.timestamps import Timestamp\nfrom pandas._libs.tslibs.timezones import tz_compare\nfrom pandas._libs.tslibs.tzconversion import tz_convert_from_utc_single\nfrom pandas._libs.tslibs.vectorized import (\n dt64arr_to_periodarr,\n get_resolution,\n ints_to_pydatetime,\n is_date_array_normalized,\n normalize_i8_timestamps,\n tz_convert_from_utc,\n)\n | .venv\Lib\site-packages\pandas\_libs\tslibs\__init__.py | __init__.py | Python | 2,125 | 0.95 | 0 | 0 | python-kit | 235 | 2023-12-31T14:52:09.018345 | MIT | false | d24d17b8ad8206a7d6eca459ead1afa9 |
\n\n | .venv\Lib\site-packages\pandas\_libs\tslibs\__pycache__\__init__.cpython-313.pyc | __init__.cpython-313.pyc | Other | 1,942 | 0.8 | 0 | 0 | vue-tools | 196 | 2023-09-01T02:49:54.154616 | MIT | false | baea440540e1568f1ee8da532afdecf9 |
!<arch>\n/ -1 0 190 `\n | .venv\Lib\site-packages\pandas\_libs\window\aggregations.cp313-win_amd64.lib | aggregations.cp313-win_amd64.lib | Other | 2,104 | 0.8 | 0 | 0 | vue-tools | 973 | 2024-03-05T10:25:05.919314 | MIT | false | dbd8640369291dbfa8efd46620d559e6 |
from typing import (\n Any,\n Callable,\n Literal,\n)\n\nimport numpy as np\n\nfrom pandas._typing import (\n WindowingRankType,\n npt,\n)\n\ndef roll_sum(\n values: np.ndarray, # const float64_t[:]\n start: np.ndarray, # np.ndarray[np.int64]\n end: np.ndarray, # np.ndarray[np.int64]\n minp: int, # int64_t\n) -> np.ndarray: ... # np.ndarray[float]\ndef roll_mean(\n values: np.ndarray, # const float64_t[:]\n start: np.ndarray, # np.ndarray[np.int64]\n end: np.ndarray, # np.ndarray[np.int64]\n minp: int, # int64_t\n) -> np.ndarray: ... # np.ndarray[float]\ndef roll_var(\n values: np.ndarray, # const float64_t[:]\n start: np.ndarray, # np.ndarray[np.int64]\n end: np.ndarray, # np.ndarray[np.int64]\n minp: int, # int64_t\n ddof: int = ...,\n) -> np.ndarray: ... # np.ndarray[float]\ndef roll_skew(\n values: np.ndarray, # np.ndarray[np.float64]\n start: np.ndarray, # np.ndarray[np.int64]\n end: np.ndarray, # np.ndarray[np.int64]\n minp: int, # int64_t\n) -> np.ndarray: ... # np.ndarray[float]\ndef roll_kurt(\n values: np.ndarray, # np.ndarray[np.float64]\n start: np.ndarray, # np.ndarray[np.int64]\n end: np.ndarray, # np.ndarray[np.int64]\n minp: int, # int64_t\n) -> np.ndarray: ... # np.ndarray[float]\ndef roll_median_c(\n values: np.ndarray, # np.ndarray[np.float64]\n start: np.ndarray, # np.ndarray[np.int64]\n end: np.ndarray, # np.ndarray[np.int64]\n minp: int, # int64_t\n) -> np.ndarray: ... # np.ndarray[float]\ndef roll_max(\n values: np.ndarray, # np.ndarray[np.float64]\n start: np.ndarray, # np.ndarray[np.int64]\n end: np.ndarray, # np.ndarray[np.int64]\n minp: int, # int64_t\n) -> np.ndarray: ... # np.ndarray[float]\ndef roll_min(\n values: np.ndarray, # np.ndarray[np.float64]\n start: np.ndarray, # np.ndarray[np.int64]\n end: np.ndarray, # np.ndarray[np.int64]\n minp: int, # int64_t\n) -> np.ndarray: ... # np.ndarray[float]\ndef roll_quantile(\n values: np.ndarray, # const float64_t[:]\n start: np.ndarray, # np.ndarray[np.int64]\n end: np.ndarray, # np.ndarray[np.int64]\n minp: int, # int64_t\n quantile: float, # float64_t\n interpolation: Literal["linear", "lower", "higher", "nearest", "midpoint"],\n) -> np.ndarray: ... # np.ndarray[float]\ndef roll_rank(\n values: np.ndarray,\n start: np.ndarray,\n end: np.ndarray,\n minp: int,\n percentile: bool,\n method: WindowingRankType,\n ascending: bool,\n) -> np.ndarray: ... # np.ndarray[float]\ndef roll_apply(\n obj: object,\n start: np.ndarray, # np.ndarray[np.int64]\n end: np.ndarray, # np.ndarray[np.int64]\n minp: int, # int64_t\n function: Callable[..., Any],\n raw: bool,\n args: tuple[Any, ...],\n kwargs: dict[str, Any],\n) -> npt.NDArray[np.float64]: ...\ndef roll_weighted_sum(\n values: np.ndarray, # const float64_t[:]\n weights: np.ndarray, # const float64_t[:]\n minp: int,\n) -> np.ndarray: ... # np.ndarray[np.float64]\ndef roll_weighted_mean(\n values: np.ndarray, # const float64_t[:]\n weights: np.ndarray, # const float64_t[:]\n minp: int,\n) -> np.ndarray: ... # np.ndarray[np.float64]\ndef roll_weighted_var(\n values: np.ndarray, # const float64_t[:]\n weights: np.ndarray, # const float64_t[:]\n minp: int, # int64_t\n ddof: int, # unsigned int\n) -> np.ndarray: ... # np.ndarray[np.float64]\ndef ewm(\n vals: np.ndarray, # const float64_t[:]\n start: np.ndarray, # const int64_t[:]\n end: np.ndarray, # const int64_t[:]\n minp: int,\n com: float, # float64_t\n adjust: bool,\n ignore_na: bool,\n deltas: np.ndarray | None = None, # const float64_t[:]\n normalize: bool = True,\n) -> np.ndarray: ... # np.ndarray[np.float64]\ndef ewmcov(\n input_x: np.ndarray, # const float64_t[:]\n start: np.ndarray, # const int64_t[:]\n end: np.ndarray, # const int64_t[:]\n minp: int,\n input_y: np.ndarray, # const float64_t[:]\n com: float, # float64_t\n adjust: bool,\n ignore_na: bool,\n bias: bool,\n) -> np.ndarray: ... # np.ndarray[np.float64]\n | .venv\Lib\site-packages\pandas\_libs\window\aggregations.pyi | aggregations.pyi | Other | 4,063 | 0.95 | 0.133858 | 0 | node-utils | 904 | 2024-02-09T06:43:31.025006 | Apache-2.0 | false | b8b5857c675ebdddacea9eae11fc2d22 |
!<arch>\n/ -1 0 174 `\n | .venv\Lib\site-packages\pandas\_libs\window\indexers.cp313-win_amd64.lib | indexers.cp313-win_amd64.lib | Other | 2,032 | 0.8 | 0 | 0 | node-utils | 901 | 2023-08-23T00:44:35.766081 | GPL-3.0 | false | 7bee943900f6ef8bca5bdb919d969b0e |
import numpy as np\n\nfrom pandas._typing import npt\n\ndef calculate_variable_window_bounds(\n num_values: int, # int64_t\n window_size: int, # int64_t\n min_periods,\n center: bool,\n closed: str | None,\n index: np.ndarray, # const int64_t[:]\n) -> tuple[npt.NDArray[np.int64], npt.NDArray[np.int64]]: ...\n | .venv\Lib\site-packages\pandas\_libs\window\indexers.pyi | indexers.pyi | Other | 319 | 0.95 | 0.083333 | 0 | awesome-app | 333 | 2024-08-23T22:28:41.940582 | MIT | false | 3d6ab430bb618897ffb3831731584842 |
\n\n | .venv\Lib\site-packages\pandas\_libs\window\__pycache__\__init__.cpython-313.pyc | __init__.cpython-313.pyc | Other | 194 | 0.7 | 0 | 0 | awesome-app | 560 | 2024-08-05T21:01:50.878267 | BSD-3-Clause | false | a3ce995428942dd5988f2b834ac58065 |
\n\n | .venv\Lib\site-packages\pandas\_libs\__pycache__\__init__.cpython-313.pyc | __init__.cpython-313.pyc | Other | 580 | 0.8 | 0 | 0 | react-lib | 2 | 2024-04-27T11:48:30.862452 | GPL-3.0 | false | 22398bd5f80884557b2b714efb0bd3f9 |
from __future__ import annotations\n\nimport operator\nfrom typing import (\n TYPE_CHECKING,\n Literal,\n NoReturn,\n cast,\n)\n\nimport numpy as np\n\nfrom pandas._libs import lib\nfrom pandas._libs.missing import is_matching_na\nfrom pandas._libs.sparse import SparseIndex\nimport pandas._libs.testing as _testing\nfrom pandas._libs.tslibs.np_datetime import compare_mismatched_resolutions\n\nfrom pandas.core.dtypes.common import (\n is_bool,\n is_float_dtype,\n is_integer_dtype,\n is_number,\n is_numeric_dtype,\n needs_i8_conversion,\n)\nfrom pandas.core.dtypes.dtypes import (\n CategoricalDtype,\n DatetimeTZDtype,\n ExtensionDtype,\n NumpyEADtype,\n)\nfrom pandas.core.dtypes.missing import array_equivalent\n\nimport pandas as pd\nfrom pandas import (\n Categorical,\n DataFrame,\n DatetimeIndex,\n Index,\n IntervalDtype,\n IntervalIndex,\n MultiIndex,\n PeriodIndex,\n RangeIndex,\n Series,\n TimedeltaIndex,\n)\nfrom pandas.core.arrays import (\n DatetimeArray,\n ExtensionArray,\n IntervalArray,\n PeriodArray,\n TimedeltaArray,\n)\nfrom pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin\nfrom pandas.core.arrays.string_ import StringDtype\nfrom pandas.core.indexes.api import safe_sort_index\n\nfrom pandas.io.formats.printing import pprint_thing\n\nif TYPE_CHECKING:\n from pandas._typing import DtypeObj\n\n\ndef assert_almost_equal(\n left,\n right,\n check_dtype: bool | Literal["equiv"] = "equiv",\n rtol: float = 1.0e-5,\n atol: float = 1.0e-8,\n **kwargs,\n) -> None:\n """\n Check that the left and right objects are approximately equal.\n\n By approximately equal, we refer to objects that are numbers or that\n contain numbers which may be equivalent to specific levels of precision.\n\n Parameters\n ----------\n left : object\n right : object\n check_dtype : bool or {'equiv'}, default 'equiv'\n Check dtype if both a and b are the same type. If 'equiv' is passed in,\n then `RangeIndex` and `Index` with int64 dtype are also considered\n equivalent when doing type checking.\n rtol : float, default 1e-5\n Relative tolerance.\n atol : float, default 1e-8\n Absolute tolerance.\n """\n if isinstance(left, Index):\n assert_index_equal(\n left,\n right,\n check_exact=False,\n exact=check_dtype,\n rtol=rtol,\n atol=atol,\n **kwargs,\n )\n\n elif isinstance(left, Series):\n assert_series_equal(\n left,\n right,\n check_exact=False,\n check_dtype=check_dtype,\n rtol=rtol,\n atol=atol,\n **kwargs,\n )\n\n elif isinstance(left, DataFrame):\n assert_frame_equal(\n left,\n right,\n check_exact=False,\n check_dtype=check_dtype,\n rtol=rtol,\n atol=atol,\n **kwargs,\n )\n\n else:\n # Other sequences.\n if check_dtype:\n if is_number(left) and is_number(right):\n # Do not compare numeric classes, like np.float64 and float.\n pass\n elif is_bool(left) and is_bool(right):\n # Do not compare bool classes, like np.bool_ and bool.\n pass\n else:\n if isinstance(left, np.ndarray) or isinstance(right, np.ndarray):\n obj = "numpy array"\n else:\n obj = "Input"\n assert_class_equal(left, right, obj=obj)\n\n # if we have "equiv", this becomes True\n _testing.assert_almost_equal(\n left, right, check_dtype=bool(check_dtype), rtol=rtol, atol=atol, **kwargs\n )\n\n\ndef _check_isinstance(left, right, cls) -> None:\n """\n Helper method for our assert_* methods that ensures that\n the two objects being compared have the right type before\n proceeding with the comparison.\n\n Parameters\n ----------\n left : The first object being compared.\n right : The second object being compared.\n cls : The class type to check against.\n\n Raises\n ------\n AssertionError : Either `left` or `right` is not an instance of `cls`.\n """\n cls_name = cls.__name__\n\n if not isinstance(left, cls):\n raise AssertionError(\n f"{cls_name} Expected type {cls}, found {type(left)} instead"\n )\n if not isinstance(right, cls):\n raise AssertionError(\n f"{cls_name} Expected type {cls}, found {type(right)} instead"\n )\n\n\ndef assert_dict_equal(left, right, compare_keys: bool = True) -> None:\n _check_isinstance(left, right, dict)\n _testing.assert_dict_equal(left, right, compare_keys=compare_keys)\n\n\ndef assert_index_equal(\n left: Index,\n right: Index,\n exact: bool | str = "equiv",\n check_names: bool = True,\n check_exact: bool = True,\n check_categorical: bool = True,\n check_order: bool = True,\n rtol: float = 1.0e-5,\n atol: float = 1.0e-8,\n obj: str = "Index",\n) -> None:\n """\n Check that left and right Index are equal.\n\n Parameters\n ----------\n left : Index\n right : Index\n exact : bool or {'equiv'}, default 'equiv'\n Whether to check the Index class, dtype and inferred_type\n are identical. If 'equiv', then RangeIndex can be substituted for\n Index with an int64 dtype as well.\n check_names : bool, default True\n Whether to check the names attribute.\n check_exact : bool, default True\n Whether to compare number exactly.\n check_categorical : bool, default True\n Whether to compare internal Categorical exactly.\n check_order : bool, default True\n Whether to compare the order of index entries as well as their values.\n If True, both indexes must contain the same elements, in the same order.\n If False, both indexes must contain the same elements, but in any order.\n rtol : float, default 1e-5\n Relative tolerance. Only used when check_exact is False.\n atol : float, default 1e-8\n Absolute tolerance. Only used when check_exact is False.\n obj : str, default 'Index'\n Specify object name being compared, internally used to show appropriate\n assertion message.\n\n Examples\n --------\n >>> from pandas import testing as tm\n >>> a = pd.Index([1, 2, 3])\n >>> b = pd.Index([1, 2, 3])\n >>> tm.assert_index_equal(a, b)\n """\n __tracebackhide__ = True\n\n def _check_types(left, right, obj: str = "Index") -> None:\n if not exact:\n return\n\n assert_class_equal(left, right, exact=exact, obj=obj)\n assert_attr_equal("inferred_type", left, right, obj=obj)\n\n # Skip exact dtype checking when `check_categorical` is False\n if isinstance(left.dtype, CategoricalDtype) and isinstance(\n right.dtype, CategoricalDtype\n ):\n if check_categorical:\n assert_attr_equal("dtype", left, right, obj=obj)\n assert_index_equal(left.categories, right.categories, exact=exact)\n return\n\n assert_attr_equal("dtype", left, right, obj=obj)\n\n # instance validation\n _check_isinstance(left, right, Index)\n\n # class / dtype comparison\n _check_types(left, right, obj=obj)\n\n # level comparison\n if left.nlevels != right.nlevels:\n msg1 = f"{obj} levels are different"\n msg2 = f"{left.nlevels}, {left}"\n msg3 = f"{right.nlevels}, {right}"\n raise_assert_detail(obj, msg1, msg2, msg3)\n\n # length comparison\n if len(left) != len(right):\n msg1 = f"{obj} length are different"\n msg2 = f"{len(left)}, {left}"\n msg3 = f"{len(right)}, {right}"\n raise_assert_detail(obj, msg1, msg2, msg3)\n\n # If order doesn't matter then sort the index entries\n if not check_order:\n left = safe_sort_index(left)\n right = safe_sort_index(right)\n\n # MultiIndex special comparison for little-friendly error messages\n if isinstance(left, MultiIndex):\n right = cast(MultiIndex, right)\n\n for level in range(left.nlevels):\n lobj = f"MultiIndex level [{level}]"\n try:\n # try comparison on levels/codes to avoid densifying MultiIndex\n assert_index_equal(\n left.levels[level],\n right.levels[level],\n exact=exact,\n check_names=check_names,\n check_exact=check_exact,\n check_categorical=check_categorical,\n rtol=rtol,\n atol=atol,\n obj=lobj,\n )\n assert_numpy_array_equal(left.codes[level], right.codes[level])\n except AssertionError:\n llevel = left.get_level_values(level)\n rlevel = right.get_level_values(level)\n\n assert_index_equal(\n llevel,\n rlevel,\n exact=exact,\n check_names=check_names,\n check_exact=check_exact,\n check_categorical=check_categorical,\n rtol=rtol,\n atol=atol,\n obj=lobj,\n )\n # get_level_values may change dtype\n _check_types(left.levels[level], right.levels[level], obj=obj)\n\n # skip exact index checking when `check_categorical` is False\n elif check_exact and check_categorical:\n if not left.equals(right):\n mismatch = left._values != right._values\n\n if not isinstance(mismatch, np.ndarray):\n mismatch = cast("ExtensionArray", mismatch).fillna(True)\n\n diff = np.sum(mismatch.astype(int)) * 100.0 / len(left)\n msg = f"{obj} values are different ({np.round(diff, 5)} %)"\n raise_assert_detail(obj, msg, left, right)\n else:\n # if we have "equiv", this becomes True\n exact_bool = bool(exact)\n _testing.assert_almost_equal(\n left.values,\n right.values,\n rtol=rtol,\n atol=atol,\n check_dtype=exact_bool,\n obj=obj,\n lobj=left,\n robj=right,\n )\n\n # metadata comparison\n if check_names:\n assert_attr_equal("names", left, right, obj=obj)\n if isinstance(left, PeriodIndex) or isinstance(right, PeriodIndex):\n assert_attr_equal("dtype", left, right, obj=obj)\n if isinstance(left, IntervalIndex) or isinstance(right, IntervalIndex):\n assert_interval_array_equal(left._values, right._values)\n\n if check_categorical:\n if isinstance(left.dtype, CategoricalDtype) or isinstance(\n right.dtype, CategoricalDtype\n ):\n assert_categorical_equal(left._values, right._values, obj=f"{obj} category")\n\n\ndef assert_class_equal(\n left, right, exact: bool | str = True, obj: str = "Input"\n) -> None:\n """\n Checks classes are equal.\n """\n __tracebackhide__ = True\n\n def repr_class(x):\n if isinstance(x, Index):\n # return Index as it is to include values in the error message\n return x\n\n return type(x).__name__\n\n def is_class_equiv(idx: Index) -> bool:\n """Classes that are a RangeIndex (sub-)instance or exactly an `Index` .\n\n This only checks class equivalence. There is a separate check that the\n dtype is int64.\n """\n return type(idx) is Index or isinstance(idx, RangeIndex)\n\n if type(left) == type(right):\n return\n\n if exact == "equiv":\n if is_class_equiv(left) and is_class_equiv(right):\n return\n\n msg = f"{obj} classes are different"\n raise_assert_detail(obj, msg, repr_class(left), repr_class(right))\n\n\ndef assert_attr_equal(attr: str, left, right, obj: str = "Attributes") -> None:\n """\n Check attributes are equal. Both objects must have attribute.\n\n Parameters\n ----------\n attr : str\n Attribute name being compared.\n left : object\n right : object\n obj : str, default 'Attributes'\n Specify object name being compared, internally used to show appropriate\n assertion message\n """\n __tracebackhide__ = True\n\n left_attr = getattr(left, attr)\n right_attr = getattr(right, attr)\n\n if left_attr is right_attr or is_matching_na(left_attr, right_attr):\n # e.g. both np.nan, both NaT, both pd.NA, ...\n return None\n\n try:\n result = left_attr == right_attr\n except TypeError:\n # datetimetz on rhs may raise TypeError\n result = False\n if (left_attr is pd.NA) ^ (right_attr is pd.NA):\n result = False\n elif not isinstance(result, bool):\n result = result.all()\n\n if not result:\n msg = f'Attribute "{attr}" are different'\n raise_assert_detail(obj, msg, left_attr, right_attr)\n return None\n\n\ndef assert_is_valid_plot_return_object(objs) -> None:\n from matplotlib.artist import Artist\n from matplotlib.axes import Axes\n\n if isinstance(objs, (Series, np.ndarray)):\n if isinstance(objs, Series):\n objs = objs._values\n for el in objs.ravel():\n msg = (\n "one of 'objs' is not a matplotlib Axes instance, "\n f"type encountered {repr(type(el).__name__)}"\n )\n assert isinstance(el, (Axes, dict)), msg\n else:\n msg = (\n "objs is neither an ndarray of Artist instances nor a single "\n "ArtistArtist instance, tuple, or dict, 'objs' is a "\n f"{repr(type(objs).__name__)}"\n )\n assert isinstance(objs, (Artist, tuple, dict)), msg\n\n\ndef assert_is_sorted(seq) -> None:\n """Assert that the sequence is sorted."""\n if isinstance(seq, (Index, Series)):\n seq = seq.values\n # sorting does not change precisions\n if isinstance(seq, np.ndarray):\n assert_numpy_array_equal(seq, np.sort(np.array(seq)))\n else:\n assert_extension_array_equal(seq, seq[seq.argsort()])\n\n\ndef assert_categorical_equal(\n left,\n right,\n check_dtype: bool = True,\n check_category_order: bool = True,\n obj: str = "Categorical",\n) -> None:\n """\n Test that Categoricals are equivalent.\n\n Parameters\n ----------\n left : Categorical\n right : Categorical\n check_dtype : bool, default True\n Check that integer dtype of the codes are the same.\n check_category_order : bool, default True\n Whether the order of the categories should be compared, which\n implies identical integer codes. If False, only the resulting\n values are compared. The ordered attribute is\n checked regardless.\n obj : str, default 'Categorical'\n Specify object name being compared, internally used to show appropriate\n assertion message.\n """\n _check_isinstance(left, right, Categorical)\n\n exact: bool | str\n if isinstance(left.categories, RangeIndex) or isinstance(\n right.categories, RangeIndex\n ):\n exact = "equiv"\n else:\n # We still want to require exact matches for Index\n exact = True\n\n if check_category_order:\n assert_index_equal(\n left.categories, right.categories, obj=f"{obj}.categories", exact=exact\n )\n assert_numpy_array_equal(\n left.codes, right.codes, check_dtype=check_dtype, obj=f"{obj}.codes"\n )\n else:\n try:\n lc = left.categories.sort_values()\n rc = right.categories.sort_values()\n except TypeError:\n # e.g. '<' not supported between instances of 'int' and 'str'\n lc, rc = left.categories, right.categories\n assert_index_equal(lc, rc, obj=f"{obj}.categories", exact=exact)\n assert_index_equal(\n left.categories.take(left.codes),\n right.categories.take(right.codes),\n obj=f"{obj}.values",\n exact=exact,\n )\n\n assert_attr_equal("ordered", left, right, obj=obj)\n\n\ndef assert_interval_array_equal(\n left, right, exact: bool | Literal["equiv"] = "equiv", obj: str = "IntervalArray"\n) -> None:\n """\n Test that two IntervalArrays are equivalent.\n\n Parameters\n ----------\n left, right : IntervalArray\n The IntervalArrays to compare.\n exact : bool or {'equiv'}, default 'equiv'\n Whether to check the Index class, dtype and inferred_type\n are identical. If 'equiv', then RangeIndex can be substituted for\n Index with an int64 dtype as well.\n obj : str, default 'IntervalArray'\n Specify object name being compared, internally used to show appropriate\n assertion message\n """\n _check_isinstance(left, right, IntervalArray)\n\n kwargs = {}\n if left._left.dtype.kind in "mM":\n # We have a DatetimeArray or TimedeltaArray\n kwargs["check_freq"] = False\n\n assert_equal(left._left, right._left, obj=f"{obj}.left", **kwargs)\n assert_equal(left._right, right._right, obj=f"{obj}.left", **kwargs)\n\n assert_attr_equal("closed", left, right, obj=obj)\n\n\ndef assert_period_array_equal(left, right, obj: str = "PeriodArray") -> None:\n _check_isinstance(left, right, PeriodArray)\n\n assert_numpy_array_equal(left._ndarray, right._ndarray, obj=f"{obj}._ndarray")\n assert_attr_equal("dtype", left, right, obj=obj)\n\n\ndef assert_datetime_array_equal(\n left, right, obj: str = "DatetimeArray", check_freq: bool = True\n) -> None:\n __tracebackhide__ = True\n _check_isinstance(left, right, DatetimeArray)\n\n assert_numpy_array_equal(left._ndarray, right._ndarray, obj=f"{obj}._ndarray")\n if check_freq:\n assert_attr_equal("freq", left, right, obj=obj)\n assert_attr_equal("tz", left, right, obj=obj)\n\n\ndef assert_timedelta_array_equal(\n left, right, obj: str = "TimedeltaArray", check_freq: bool = True\n) -> None:\n __tracebackhide__ = True\n _check_isinstance(left, right, TimedeltaArray)\n assert_numpy_array_equal(left._ndarray, right._ndarray, obj=f"{obj}._ndarray")\n if check_freq:\n assert_attr_equal("freq", left, right, obj=obj)\n\n\ndef raise_assert_detail(\n obj, message, left, right, diff=None, first_diff=None, index_values=None\n) -> NoReturn:\n __tracebackhide__ = True\n\n msg = f"""{obj} are different\n\n{message}"""\n\n if isinstance(index_values, Index):\n index_values = np.asarray(index_values)\n\n if isinstance(index_values, np.ndarray):\n msg += f"\n[index]: {pprint_thing(index_values)}"\n\n if isinstance(left, np.ndarray):\n left = pprint_thing(left)\n elif isinstance(left, (CategoricalDtype, NumpyEADtype)):\n left = repr(left)\n elif isinstance(left, StringDtype):\n # TODO(infer_string) this special case could be avoided if we have\n # a more informative repr https://github.com/pandas-dev/pandas/issues/59342\n left = f"StringDtype(storage={left.storage}, na_value={left.na_value})"\n\n if isinstance(right, np.ndarray):\n right = pprint_thing(right)\n elif isinstance(right, (CategoricalDtype, NumpyEADtype)):\n right = repr(right)\n elif isinstance(right, StringDtype):\n right = f"StringDtype(storage={right.storage}, na_value={right.na_value})"\n\n msg += f"""\n[left]: {left}\n[right]: {right}"""\n\n if diff is not None:\n msg += f"\n[diff]: {diff}"\n\n if first_diff is not None:\n msg += f"\n{first_diff}"\n\n raise AssertionError(msg)\n\n\ndef assert_numpy_array_equal(\n left,\n right,\n strict_nan: bool = False,\n check_dtype: bool | Literal["equiv"] = True,\n err_msg=None,\n check_same=None,\n obj: str = "numpy array",\n index_values=None,\n) -> None:\n """\n Check that 'np.ndarray' is equivalent.\n\n Parameters\n ----------\n left, right : numpy.ndarray or iterable\n The two arrays to be compared.\n strict_nan : bool, default False\n If True, consider NaN and None to be different.\n check_dtype : bool, default True\n Check dtype if both a and b are np.ndarray.\n err_msg : str, default None\n If provided, used as assertion message.\n check_same : None|'copy'|'same', default None\n Ensure left and right refer/do not refer to the same memory area.\n obj : str, default 'numpy array'\n Specify object name being compared, internally used to show appropriate\n assertion message.\n index_values : Index | numpy.ndarray, default None\n optional index (shared by both left and right), used in output.\n """\n __tracebackhide__ = True\n\n # instance validation\n # Show a detailed error message when classes are different\n assert_class_equal(left, right, obj=obj)\n # both classes must be an np.ndarray\n _check_isinstance(left, right, np.ndarray)\n\n def _get_base(obj):\n return obj.base if getattr(obj, "base", None) is not None else obj\n\n left_base = _get_base(left)\n right_base = _get_base(right)\n\n if check_same == "same":\n if left_base is not right_base:\n raise AssertionError(f"{repr(left_base)} is not {repr(right_base)}")\n elif check_same == "copy":\n if left_base is right_base:\n raise AssertionError(f"{repr(left_base)} is {repr(right_base)}")\n\n def _raise(left, right, err_msg) -> NoReturn:\n if err_msg is None:\n if left.shape != right.shape:\n raise_assert_detail(\n obj, f"{obj} shapes are different", left.shape, right.shape\n )\n\n diff = 0\n for left_arr, right_arr in zip(left, right):\n # count up differences\n if not array_equivalent(left_arr, right_arr, strict_nan=strict_nan):\n diff += 1\n\n diff = diff * 100.0 / left.size\n msg = f"{obj} values are different ({np.round(diff, 5)} %)"\n raise_assert_detail(obj, msg, left, right, index_values=index_values)\n\n raise AssertionError(err_msg)\n\n # compare shape and values\n if not array_equivalent(left, right, strict_nan=strict_nan):\n _raise(left, right, err_msg)\n\n if check_dtype:\n if isinstance(left, np.ndarray) and isinstance(right, np.ndarray):\n assert_attr_equal("dtype", left, right, obj=obj)\n\n\ndef assert_extension_array_equal(\n left,\n right,\n check_dtype: bool | Literal["equiv"] = True,\n index_values=None,\n check_exact: bool | lib.NoDefault = lib.no_default,\n rtol: float | lib.NoDefault = lib.no_default,\n atol: float | lib.NoDefault = lib.no_default,\n obj: str = "ExtensionArray",\n) -> None:\n """\n Check that left and right ExtensionArrays are equal.\n\n Parameters\n ----------\n left, right : ExtensionArray\n The two arrays to compare.\n check_dtype : bool, default True\n Whether to check if the ExtensionArray dtypes are identical.\n index_values : Index | numpy.ndarray, default None\n Optional index (shared by both left and right), used in output.\n check_exact : bool, default False\n Whether to compare number exactly.\n\n .. versionchanged:: 2.2.0\n\n Defaults to True for integer dtypes if none of\n ``check_exact``, ``rtol`` and ``atol`` are specified.\n rtol : float, default 1e-5\n Relative tolerance. Only used when check_exact is False.\n atol : float, default 1e-8\n Absolute tolerance. Only used when check_exact is False.\n obj : str, default 'ExtensionArray'\n Specify object name being compared, internally used to show appropriate\n assertion message.\n\n .. versionadded:: 2.0.0\n\n Notes\n -----\n Missing values are checked separately from valid values.\n A mask of missing values is computed for each and checked to match.\n The remaining all-valid values are cast to object dtype and checked.\n\n Examples\n --------\n >>> from pandas import testing as tm\n >>> a = pd.Series([1, 2, 3, 4])\n >>> b, c = a.array, a.array\n >>> tm.assert_extension_array_equal(b, c)\n """\n if (\n check_exact is lib.no_default\n and rtol is lib.no_default\n and atol is lib.no_default\n ):\n check_exact = (\n is_numeric_dtype(left.dtype)\n and not is_float_dtype(left.dtype)\n or is_numeric_dtype(right.dtype)\n and not is_float_dtype(right.dtype)\n )\n elif check_exact is lib.no_default:\n check_exact = False\n\n rtol = rtol if rtol is not lib.no_default else 1.0e-5\n atol = atol if atol is not lib.no_default else 1.0e-8\n\n assert isinstance(left, ExtensionArray), "left is not an ExtensionArray"\n assert isinstance(right, ExtensionArray), "right is not an ExtensionArray"\n if check_dtype:\n assert_attr_equal("dtype", left, right, obj=f"Attributes of {obj}")\n\n if (\n isinstance(left, DatetimeLikeArrayMixin)\n and isinstance(right, DatetimeLikeArrayMixin)\n and type(right) == type(left)\n ):\n # GH 52449\n if not check_dtype and left.dtype.kind in "mM":\n if not isinstance(left.dtype, np.dtype):\n l_unit = cast(DatetimeTZDtype, left.dtype).unit\n else:\n l_unit = np.datetime_data(left.dtype)[0]\n if not isinstance(right.dtype, np.dtype):\n r_unit = cast(DatetimeTZDtype, right.dtype).unit\n else:\n r_unit = np.datetime_data(right.dtype)[0]\n if (\n l_unit != r_unit\n and compare_mismatched_resolutions(\n left._ndarray, right._ndarray, operator.eq\n ).all()\n ):\n return\n # Avoid slow object-dtype comparisons\n # np.asarray for case where we have a np.MaskedArray\n assert_numpy_array_equal(\n np.asarray(left.asi8),\n np.asarray(right.asi8),\n index_values=index_values,\n obj=obj,\n )\n return\n\n left_na = np.asarray(left.isna())\n right_na = np.asarray(right.isna())\n assert_numpy_array_equal(\n left_na, right_na, obj=f"{obj} NA mask", index_values=index_values\n )\n\n # Specifically for StringArrayNumpySemantics, validate here we have a valid array\n if (\n isinstance(left.dtype, StringDtype)\n and left.dtype.storage == "python"\n and left.dtype.na_value is np.nan\n ):\n assert np.all(\n [np.isnan(val) for val in left._ndarray[left_na]] # type: ignore[attr-defined]\n ), "wrong missing value sentinels"\n if (\n isinstance(right.dtype, StringDtype)\n and right.dtype.storage == "python"\n and right.dtype.na_value is np.nan\n ):\n assert np.all(\n [np.isnan(val) for val in right._ndarray[right_na]] # type: ignore[attr-defined]\n ), "wrong missing value sentinels"\n\n left_valid = left[~left_na].to_numpy(dtype=object)\n right_valid = right[~right_na].to_numpy(dtype=object)\n if check_exact:\n assert_numpy_array_equal(\n left_valid, right_valid, obj=obj, index_values=index_values\n )\n else:\n _testing.assert_almost_equal(\n left_valid,\n right_valid,\n check_dtype=bool(check_dtype),\n rtol=rtol,\n atol=atol,\n obj=obj,\n index_values=index_values,\n )\n\n\n# This could be refactored to use the NDFrame.equals method\ndef assert_series_equal(\n left,\n right,\n check_dtype: bool | Literal["equiv"] = True,\n check_index_type: bool | Literal["equiv"] = "equiv",\n check_series_type: bool = True,\n check_names: bool = True,\n check_exact: bool | lib.NoDefault = lib.no_default,\n check_datetimelike_compat: bool = False,\n check_categorical: bool = True,\n check_category_order: bool = True,\n check_freq: bool = True,\n check_flags: bool = True,\n rtol: float | lib.NoDefault = lib.no_default,\n atol: float | lib.NoDefault = lib.no_default,\n obj: str = "Series",\n *,\n check_index: bool = True,\n check_like: bool = False,\n) -> None:\n """\n Check that left and right Series are equal.\n\n Parameters\n ----------\n left : Series\n right : Series\n check_dtype : bool, default True\n Whether to check the Series dtype is identical.\n check_index_type : bool or {'equiv'}, default 'equiv'\n Whether to check the Index class, dtype and inferred_type\n are identical.\n check_series_type : bool, default True\n Whether to check the Series class is identical.\n check_names : bool, default True\n Whether to check the Series and Index names attribute.\n check_exact : bool, default False\n Whether to compare number exactly.\n\n .. versionchanged:: 2.2.0\n\n Defaults to True for integer dtypes if none of\n ``check_exact``, ``rtol`` and ``atol`` are specified.\n check_datetimelike_compat : bool, default False\n Compare datetime-like which is comparable ignoring dtype.\n check_categorical : bool, default True\n Whether to compare internal Categorical exactly.\n check_category_order : bool, default True\n Whether to compare category order of internal Categoricals.\n check_freq : bool, default True\n Whether to check the `freq` attribute on a DatetimeIndex or TimedeltaIndex.\n check_flags : bool, default True\n Whether to check the `flags` attribute.\n rtol : float, default 1e-5\n Relative tolerance. Only used when check_exact is False.\n atol : float, default 1e-8\n Absolute tolerance. Only used when check_exact is False.\n obj : str, default 'Series'\n Specify object name being compared, internally used to show appropriate\n assertion message.\n check_index : bool, default True\n Whether to check index equivalence. If False, then compare only values.\n\n .. versionadded:: 1.3.0\n check_like : bool, default False\n If True, ignore the order of the index. Must be False if check_index is False.\n Note: same labels must be with the same data.\n\n .. versionadded:: 1.5.0\n\n Examples\n --------\n >>> from pandas import testing as tm\n >>> a = pd.Series([1, 2, 3, 4])\n >>> b = pd.Series([1, 2, 3, 4])\n >>> tm.assert_series_equal(a, b)\n """\n __tracebackhide__ = True\n check_exact_index = False if check_exact is lib.no_default else check_exact\n if (\n check_exact is lib.no_default\n and rtol is lib.no_default\n and atol is lib.no_default\n ):\n check_exact = (\n is_numeric_dtype(left.dtype)\n and not is_float_dtype(left.dtype)\n or is_numeric_dtype(right.dtype)\n and not is_float_dtype(right.dtype)\n )\n elif check_exact is lib.no_default:\n check_exact = False\n\n rtol = rtol if rtol is not lib.no_default else 1.0e-5\n atol = atol if atol is not lib.no_default else 1.0e-8\n\n if not check_index and check_like:\n raise ValueError("check_like must be False if check_index is False")\n\n # instance validation\n _check_isinstance(left, right, Series)\n\n if check_series_type:\n assert_class_equal(left, right, obj=obj)\n\n # length comparison\n if len(left) != len(right):\n msg1 = f"{len(left)}, {left.index}"\n msg2 = f"{len(right)}, {right.index}"\n raise_assert_detail(obj, "Series length are different", msg1, msg2)\n\n if check_flags:\n assert left.flags == right.flags, f"{repr(left.flags)} != {repr(right.flags)}"\n\n if check_index:\n # GH #38183\n assert_index_equal(\n left.index,\n right.index,\n exact=check_index_type,\n check_names=check_names,\n check_exact=check_exact_index,\n check_categorical=check_categorical,\n check_order=not check_like,\n rtol=rtol,\n atol=atol,\n obj=f"{obj}.index",\n )\n\n if check_like:\n left = left.reindex_like(right)\n\n if check_freq and isinstance(left.index, (DatetimeIndex, TimedeltaIndex)):\n lidx = left.index\n ridx = right.index\n assert lidx.freq == ridx.freq, (lidx.freq, ridx.freq)\n\n if check_dtype:\n # We want to skip exact dtype checking when `check_categorical`\n # is False. We'll still raise if only one is a `Categorical`,\n # regardless of `check_categorical`\n if (\n isinstance(left.dtype, CategoricalDtype)\n and isinstance(right.dtype, CategoricalDtype)\n and not check_categorical\n ):\n pass\n else:\n assert_attr_equal("dtype", left, right, obj=f"Attributes of {obj}")\n if check_exact:\n left_values = left._values\n right_values = right._values\n # Only check exact if dtype is numeric\n if isinstance(left_values, ExtensionArray) and isinstance(\n right_values, ExtensionArray\n ):\n assert_extension_array_equal(\n left_values,\n right_values,\n check_dtype=check_dtype,\n index_values=left.index,\n obj=str(obj),\n )\n else:\n # convert both to NumPy if not, check_dtype would raise earlier\n lv, rv = left_values, right_values\n if isinstance(left_values, ExtensionArray):\n lv = left_values.to_numpy()\n if isinstance(right_values, ExtensionArray):\n rv = right_values.to_numpy()\n assert_numpy_array_equal(\n lv,\n rv,\n check_dtype=check_dtype,\n obj=str(obj),\n index_values=left.index,\n )\n elif check_datetimelike_compat and (\n needs_i8_conversion(left.dtype) or needs_i8_conversion(right.dtype)\n ):\n # we want to check only if we have compat dtypes\n # e.g. integer and M|m are NOT compat, but we can simply check\n # the values in that case\n\n # datetimelike may have different objects (e.g. datetime.datetime\n # vs Timestamp) but will compare equal\n if not Index(left._values).equals(Index(right._values)):\n msg = (\n f"[datetimelike_compat=True] {left._values} "\n f"is not equal to {right._values}."\n )\n raise AssertionError(msg)\n elif isinstance(left.dtype, IntervalDtype) and isinstance(\n right.dtype, IntervalDtype\n ):\n assert_interval_array_equal(left.array, right.array)\n elif isinstance(left.dtype, CategoricalDtype) or isinstance(\n right.dtype, CategoricalDtype\n ):\n _testing.assert_almost_equal(\n left._values,\n right._values,\n rtol=rtol,\n atol=atol,\n check_dtype=bool(check_dtype),\n obj=str(obj),\n index_values=left.index,\n )\n elif isinstance(left.dtype, ExtensionDtype) and isinstance(\n right.dtype, ExtensionDtype\n ):\n assert_extension_array_equal(\n left._values,\n right._values,\n rtol=rtol,\n atol=atol,\n check_dtype=check_dtype,\n index_values=left.index,\n obj=str(obj),\n )\n elif is_extension_array_dtype_and_needs_i8_conversion(\n left.dtype, right.dtype\n ) or is_extension_array_dtype_and_needs_i8_conversion(right.dtype, left.dtype):\n assert_extension_array_equal(\n left._values,\n right._values,\n check_dtype=check_dtype,\n index_values=left.index,\n obj=str(obj),\n )\n elif needs_i8_conversion(left.dtype) and needs_i8_conversion(right.dtype):\n # DatetimeArray or TimedeltaArray\n assert_extension_array_equal(\n left._values,\n right._values,\n check_dtype=check_dtype,\n index_values=left.index,\n obj=str(obj),\n )\n else:\n _testing.assert_almost_equal(\n left._values,\n right._values,\n rtol=rtol,\n atol=atol,\n check_dtype=bool(check_dtype),\n obj=str(obj),\n index_values=left.index,\n )\n\n # metadata comparison\n if check_names:\n assert_attr_equal("name", left, right, obj=obj)\n\n if check_categorical:\n if isinstance(left.dtype, CategoricalDtype) or isinstance(\n right.dtype, CategoricalDtype\n ):\n assert_categorical_equal(\n left._values,\n right._values,\n obj=f"{obj} category",\n check_category_order=check_category_order,\n )\n\n\n# This could be refactored to use the NDFrame.equals method\ndef assert_frame_equal(\n left,\n right,\n check_dtype: bool | Literal["equiv"] = True,\n check_index_type: bool | Literal["equiv"] = "equiv",\n check_column_type: bool | Literal["equiv"] = "equiv",\n check_frame_type: bool = True,\n check_names: bool = True,\n by_blocks: bool = False,\n check_exact: bool | lib.NoDefault = lib.no_default,\n check_datetimelike_compat: bool = False,\n check_categorical: bool = True,\n check_like: bool = False,\n check_freq: bool = True,\n check_flags: bool = True,\n rtol: float | lib.NoDefault = lib.no_default,\n atol: float | lib.NoDefault = lib.no_default,\n obj: str = "DataFrame",\n) -> None:\n """\n Check that left and right DataFrame are equal.\n\n This function is intended to compare two DataFrames and output any\n differences. It is mostly intended for use in unit tests.\n Additional parameters allow varying the strictness of the\n equality checks performed.\n\n Parameters\n ----------\n left : DataFrame\n First DataFrame to compare.\n right : DataFrame\n Second DataFrame to compare.\n check_dtype : bool, default True\n Whether to check the DataFrame dtype is identical.\n check_index_type : bool or {'equiv'}, default 'equiv'\n Whether to check the Index class, dtype and inferred_type\n are identical.\n check_column_type : bool or {'equiv'}, default 'equiv'\n Whether to check the columns class, dtype and inferred_type\n are identical. Is passed as the ``exact`` argument of\n :func:`assert_index_equal`.\n check_frame_type : bool, default True\n Whether to check the DataFrame class is identical.\n check_names : bool, default True\n Whether to check that the `names` attribute for both the `index`\n and `column` attributes of the DataFrame is identical.\n by_blocks : bool, default False\n Specify how to compare internal data. If False, compare by columns.\n If True, compare by blocks.\n check_exact : bool, default False\n Whether to compare number exactly.\n\n .. versionchanged:: 2.2.0\n\n Defaults to True for integer dtypes if none of\n ``check_exact``, ``rtol`` and ``atol`` are specified.\n check_datetimelike_compat : bool, default False\n Compare datetime-like which is comparable ignoring dtype.\n check_categorical : bool, default True\n Whether to compare internal Categorical exactly.\n check_like : bool, default False\n If True, ignore the order of index & columns.\n Note: index labels must match their respective rows\n (same as in columns) - same labels must be with the same data.\n check_freq : bool, default True\n Whether to check the `freq` attribute on a DatetimeIndex or TimedeltaIndex.\n check_flags : bool, default True\n Whether to check the `flags` attribute.\n rtol : float, default 1e-5\n Relative tolerance. Only used when check_exact is False.\n atol : float, default 1e-8\n Absolute tolerance. Only used when check_exact is False.\n obj : str, default 'DataFrame'\n Specify object name being compared, internally used to show appropriate\n assertion message.\n\n See Also\n --------\n assert_series_equal : Equivalent method for asserting Series equality.\n DataFrame.equals : Check DataFrame equality.\n\n Examples\n --------\n This example shows comparing two DataFrames that are equal\n but with columns of differing dtypes.\n\n >>> from pandas.testing import assert_frame_equal\n >>> df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})\n >>> df2 = pd.DataFrame({'a': [1, 2], 'b': [3.0, 4.0]})\n\n df1 equals itself.\n\n >>> assert_frame_equal(df1, df1)\n\n df1 differs from df2 as column 'b' is of a different type.\n\n >>> assert_frame_equal(df1, df2)\n Traceback (most recent call last):\n ...\n AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="b") are different\n\n Attribute "dtype" are different\n [left]: int64\n [right]: float64\n\n Ignore differing dtypes in columns with check_dtype.\n\n >>> assert_frame_equal(df1, df2, check_dtype=False)\n """\n __tracebackhide__ = True\n _rtol = rtol if rtol is not lib.no_default else 1.0e-5\n _atol = atol if atol is not lib.no_default else 1.0e-8\n _check_exact = check_exact if check_exact is not lib.no_default else False\n\n # instance validation\n _check_isinstance(left, right, DataFrame)\n\n if check_frame_type:\n assert isinstance(left, type(right))\n # assert_class_equal(left, right, obj=obj)\n\n # shape comparison\n if left.shape != right.shape:\n raise_assert_detail(\n obj, f"{obj} shape mismatch", f"{repr(left.shape)}", f"{repr(right.shape)}"\n )\n\n if check_flags:\n assert left.flags == right.flags, f"{repr(left.flags)} != {repr(right.flags)}"\n\n # index comparison\n assert_index_equal(\n left.index,\n right.index,\n exact=check_index_type,\n check_names=check_names,\n check_exact=_check_exact,\n check_categorical=check_categorical,\n check_order=not check_like,\n rtol=_rtol,\n atol=_atol,\n obj=f"{obj}.index",\n )\n\n # column comparison\n assert_index_equal(\n left.columns,\n right.columns,\n exact=check_column_type,\n check_names=check_names,\n check_exact=_check_exact,\n check_categorical=check_categorical,\n check_order=not check_like,\n rtol=_rtol,\n atol=_atol,\n obj=f"{obj}.columns",\n )\n\n if check_like:\n left = left.reindex_like(right)\n\n # compare by blocks\n if by_blocks:\n rblocks = right._to_dict_of_blocks()\n lblocks = left._to_dict_of_blocks()\n for dtype in list(set(list(lblocks.keys()) + list(rblocks.keys()))):\n assert dtype in lblocks\n assert dtype in rblocks\n assert_frame_equal(\n lblocks[dtype], rblocks[dtype], check_dtype=check_dtype, obj=obj\n )\n\n # compare by columns\n else:\n for i, col in enumerate(left.columns):\n # We have already checked that columns match, so we can do\n # fast location-based lookups\n lcol = left._ixs(i, axis=1)\n rcol = right._ixs(i, axis=1)\n\n # GH #38183\n # use check_index=False, because we do not want to run\n # assert_index_equal for each column,\n # as we already checked it for the whole dataframe before.\n assert_series_equal(\n lcol,\n rcol,\n check_dtype=check_dtype,\n check_index_type=check_index_type,\n check_exact=check_exact,\n check_names=check_names,\n check_datetimelike_compat=check_datetimelike_compat,\n check_categorical=check_categorical,\n check_freq=check_freq,\n obj=f'{obj}.iloc[:, {i}] (column name="{col}")',\n rtol=rtol,\n atol=atol,\n check_index=False,\n check_flags=False,\n )\n\n\ndef assert_equal(left, right, **kwargs) -> None:\n """\n Wrapper for tm.assert_*_equal to dispatch to the appropriate test function.\n\n Parameters\n ----------\n left, right : Index, Series, DataFrame, ExtensionArray, or np.ndarray\n The two items to be compared.\n **kwargs\n All keyword arguments are passed through to the underlying assert method.\n """\n __tracebackhide__ = True\n\n if isinstance(left, Index):\n assert_index_equal(left, right, **kwargs)\n if isinstance(left, (DatetimeIndex, TimedeltaIndex)):\n assert left.freq == right.freq, (left.freq, right.freq)\n elif isinstance(left, Series):\n assert_series_equal(left, right, **kwargs)\n elif isinstance(left, DataFrame):\n assert_frame_equal(left, right, **kwargs)\n elif isinstance(left, IntervalArray):\n assert_interval_array_equal(left, right, **kwargs)\n elif isinstance(left, PeriodArray):\n assert_period_array_equal(left, right, **kwargs)\n elif isinstance(left, DatetimeArray):\n assert_datetime_array_equal(left, right, **kwargs)\n elif isinstance(left, TimedeltaArray):\n assert_timedelta_array_equal(left, right, **kwargs)\n elif isinstance(left, ExtensionArray):\n assert_extension_array_equal(left, right, **kwargs)\n elif isinstance(left, np.ndarray):\n assert_numpy_array_equal(left, right, **kwargs)\n elif isinstance(left, str):\n assert kwargs == {}\n assert left == right\n else:\n assert kwargs == {}\n assert_almost_equal(left, right)\n\n\ndef assert_sp_array_equal(left, right) -> None:\n """\n Check that the left and right SparseArray are equal.\n\n Parameters\n ----------\n left : SparseArray\n right : SparseArray\n """\n _check_isinstance(left, right, pd.arrays.SparseArray)\n\n assert_numpy_array_equal(left.sp_values, right.sp_values)\n\n # SparseIndex comparison\n assert isinstance(left.sp_index, SparseIndex)\n assert isinstance(right.sp_index, SparseIndex)\n\n left_index = left.sp_index\n right_index = right.sp_index\n\n if not left_index.equals(right_index):\n raise_assert_detail(\n "SparseArray.index", "index are not equal", left_index, right_index\n )\n else:\n # Just ensure a\n pass\n\n assert_attr_equal("fill_value", left, right)\n assert_attr_equal("dtype", left, right)\n assert_numpy_array_equal(left.to_dense(), right.to_dense())\n\n\ndef assert_contains_all(iterable, dic) -> None:\n for k in iterable:\n assert k in dic, f"Did not contain item: {repr(k)}"\n\n\ndef assert_copy(iter1, iter2, **eql_kwargs) -> None:\n """\n iter1, iter2: iterables that produce elements\n comparable with assert_almost_equal\n\n Checks that the elements are equal, but not\n the same object. (Does not check that items\n in sequences are also not the same object)\n """\n for elem1, elem2 in zip(iter1, iter2):\n assert_almost_equal(elem1, elem2, **eql_kwargs)\n msg = (\n f"Expected object {repr(type(elem1))} and object {repr(type(elem2))} to be "\n "different objects, but they were the same object."\n )\n assert elem1 is not elem2, msg\n\n\ndef is_extension_array_dtype_and_needs_i8_conversion(\n left_dtype: DtypeObj, right_dtype: DtypeObj\n) -> bool:\n """\n Checks that we have the combination of an ExtensionArraydtype and\n a dtype that should be converted to int64\n\n Returns\n -------\n bool\n\n Related to issue #37609\n """\n return isinstance(left_dtype, ExtensionDtype) and needs_i8_conversion(right_dtype)\n\n\ndef assert_indexing_slices_equivalent(ser: Series, l_slc: slice, i_slc: slice) -> None:\n """\n Check that ser.iloc[i_slc] matches ser.loc[l_slc] and, if applicable,\n ser[l_slc].\n """\n expected = ser.iloc[i_slc]\n\n assert_series_equal(ser.loc[l_slc], expected)\n\n if not is_integer_dtype(ser.index):\n # For integer indices, .loc and plain getitem are position-based.\n assert_series_equal(ser[l_slc], expected)\n\n\ndef assert_metadata_equivalent(\n left: DataFrame | Series, right: DataFrame | Series | None = None\n) -> None:\n """\n Check that ._metadata attributes are equivalent.\n """\n for attr in left._metadata:\n val = getattr(left, attr, None)\n if right is None:\n assert val is None\n else:\n assert val == getattr(right, attr, None)\n | .venv\Lib\site-packages\pandas\_testing\asserters.py | asserters.py | Python | 48,276 | 0.95 | 0.128855 | 0.057845 | react-lib | 173 | 2023-09-14T07:10:17.554893 | MIT | true | 34e93de119637d96e7ab5bf3a4d990cd |
"""\nHelpers for sharing tests between DataFrame/Series\n"""\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom pandas import DataFrame\n\nif TYPE_CHECKING:\n from pandas._typing import DtypeObj\n\n\ndef get_dtype(obj) -> DtypeObj:\n if isinstance(obj, DataFrame):\n # Note: we are assuming only one column\n return obj.dtypes.iat[0]\n else:\n return obj.dtype\n\n\ndef get_obj(df: DataFrame, klass):\n """\n For sharing tests using frame_or_series, either return the DataFrame\n unchanged or return it's first column as a Series.\n """\n if klass is DataFrame:\n return df\n return df._ixs(0, axis=1)\n | .venv\Lib\site-packages\pandas\_testing\compat.py | compat.py | Python | 658 | 0.95 | 0.206897 | 0.045455 | vue-tools | 294 | 2025-04-17T21:13:58.305049 | BSD-3-Clause | true | 7871c0654027c7ad72e363da93c2b463 |
from __future__ import annotations\n\nfrom contextlib import contextmanager\nimport os\nfrom pathlib import Path\nimport tempfile\nfrom typing import (\n IO,\n TYPE_CHECKING,\n Any,\n)\nimport uuid\n\nfrom pandas._config import using_copy_on_write\n\nfrom pandas.compat import PYPY\nfrom pandas.errors import ChainedAssignmentError\n\nfrom pandas import set_option\n\nfrom pandas.io.common import get_handle\n\nif TYPE_CHECKING:\n from collections.abc import Generator\n\n from pandas._typing import (\n BaseBuffer,\n CompressionOptions,\n FilePath,\n )\n\n\n@contextmanager\ndef decompress_file(\n path: FilePath | BaseBuffer, compression: CompressionOptions\n) -> Generator[IO[bytes], None, None]:\n """\n Open a compressed file and return a file object.\n\n Parameters\n ----------\n path : str\n The path where the file is read from.\n\n compression : {'gzip', 'bz2', 'zip', 'xz', 'zstd', None}\n Name of the decompression to use\n\n Returns\n -------\n file object\n """\n with get_handle(path, "rb", compression=compression, is_text=False) as handle:\n yield handle.handle\n\n\n@contextmanager\ndef set_timezone(tz: str) -> Generator[None, None, None]:\n """\n Context manager for temporarily setting a timezone.\n\n Parameters\n ----------\n tz : str\n A string representing a valid timezone.\n\n Examples\n --------\n >>> from datetime import datetime\n >>> from dateutil.tz import tzlocal\n >>> tzlocal().tzname(datetime(2021, 1, 1)) # doctest: +SKIP\n 'IST'\n\n >>> with set_timezone('US/Eastern'):\n ... tzlocal().tzname(datetime(2021, 1, 1))\n ...\n 'EST'\n """\n import time\n\n def setTZ(tz) -> None:\n if hasattr(time, "tzset"):\n if tz is None:\n try:\n del os.environ["TZ"]\n except KeyError:\n pass\n else:\n os.environ["TZ"] = tz\n time.tzset()\n\n orig_tz = os.environ.get("TZ")\n setTZ(tz)\n try:\n yield\n finally:\n setTZ(orig_tz)\n\n\n@contextmanager\ndef ensure_clean(\n filename=None, return_filelike: bool = False, **kwargs: Any\n) -> Generator[Any, None, None]:\n """\n Gets a temporary path and agrees to remove on close.\n\n This implementation does not use tempfile.mkstemp to avoid having a file handle.\n If the code using the returned path wants to delete the file itself, windows\n requires that no program has a file handle to it.\n\n Parameters\n ----------\n filename : str (optional)\n suffix of the created file.\n return_filelike : bool (default False)\n if True, returns a file-like which is *always* cleaned. Necessary for\n savefig and other functions which want to append extensions.\n **kwargs\n Additional keywords are passed to open().\n\n """\n folder = Path(tempfile.gettempdir())\n\n if filename is None:\n filename = ""\n filename = str(uuid.uuid4()) + filename\n path = folder / filename\n\n path.touch()\n\n handle_or_str: str | IO = str(path)\n encoding = kwargs.pop("encoding", None)\n if return_filelike:\n kwargs.setdefault("mode", "w+b")\n if encoding is None and "b" not in kwargs["mode"]:\n encoding = "utf-8"\n handle_or_str = open(path, encoding=encoding, **kwargs)\n\n try:\n yield handle_or_str\n finally:\n if not isinstance(handle_or_str, str):\n handle_or_str.close()\n if path.is_file():\n path.unlink()\n\n\n@contextmanager\ndef with_csv_dialect(name: str, **kwargs) -> Generator[None, None, None]:\n """\n Context manager to temporarily register a CSV dialect for parsing CSV.\n\n Parameters\n ----------\n name : str\n The name of the dialect.\n kwargs : mapping\n The parameters for the dialect.\n\n Raises\n ------\n ValueError : the name of the dialect conflicts with a builtin one.\n\n See Also\n --------\n csv : Python's CSV library.\n """\n import csv\n\n _BUILTIN_DIALECTS = {"excel", "excel-tab", "unix"}\n\n if name in _BUILTIN_DIALECTS:\n raise ValueError("Cannot override builtin dialect.")\n\n csv.register_dialect(name, **kwargs)\n try:\n yield\n finally:\n csv.unregister_dialect(name)\n\n\n@contextmanager\ndef use_numexpr(use, min_elements=None) -> Generator[None, None, None]:\n from pandas.core.computation import expressions as expr\n\n if min_elements is None:\n min_elements = expr._MIN_ELEMENTS\n\n olduse = expr.USE_NUMEXPR\n oldmin = expr._MIN_ELEMENTS\n set_option("compute.use_numexpr", use)\n expr._MIN_ELEMENTS = min_elements\n try:\n yield\n finally:\n expr._MIN_ELEMENTS = oldmin\n set_option("compute.use_numexpr", olduse)\n\n\ndef raises_chained_assignment_error(warn=True, extra_warnings=(), extra_match=()):\n from pandas._testing import assert_produces_warning\n\n if not warn:\n from contextlib import nullcontext\n\n return nullcontext()\n\n if PYPY and not extra_warnings:\n from contextlib import nullcontext\n\n return nullcontext()\n elif PYPY and extra_warnings:\n return assert_produces_warning(\n extra_warnings,\n match="|".join(extra_match),\n )\n else:\n if using_copy_on_write():\n warning = ChainedAssignmentError\n match = (\n "A value is trying to be set on a copy of a DataFrame or Series "\n "through chained assignment"\n )\n else:\n warning = FutureWarning # type: ignore[assignment]\n # TODO update match\n match = "ChainedAssignmentError"\n if extra_warnings:\n warning = (warning, *extra_warnings) # type: ignore[assignment]\n return assert_produces_warning(\n warning,\n match="|".join((match, *extra_match)),\n )\n\n\ndef assert_cow_warning(warn=True, match=None, **kwargs):\n """\n Assert that a warning is raised in the CoW warning mode.\n\n Parameters\n ----------\n warn : bool, default True\n By default, check that a warning is raised. Can be turned off by passing False.\n match : str\n The warning message to match against, if different from the default.\n kwargs\n Passed through to assert_produces_warning\n """\n from pandas._testing import assert_produces_warning\n\n if not warn:\n from contextlib import nullcontext\n\n return nullcontext()\n\n if not match:\n match = "Setting a value on a view"\n\n return assert_produces_warning(FutureWarning, match=match, **kwargs)\n | .venv\Lib\site-packages\pandas\_testing\contexts.py | contexts.py | Python | 6,618 | 0.95 | 0.135659 | 0.009756 | react-lib | 125 | 2024-10-30T04:19:27.060407 | MIT | true | 2cb099a53743f50c1467f3b1c42941dd |
"""\nHypothesis data generator helpers.\n"""\nfrom datetime import datetime\n\nfrom hypothesis import strategies as st\nfrom hypothesis.extra.dateutil import timezones as dateutil_timezones\nfrom hypothesis.extra.pytz import timezones as pytz_timezones\n\nfrom pandas.compat import is_platform_windows\n\nimport pandas as pd\n\nfrom pandas.tseries.offsets import (\n BMonthBegin,\n BMonthEnd,\n BQuarterBegin,\n BQuarterEnd,\n BYearBegin,\n BYearEnd,\n MonthBegin,\n MonthEnd,\n QuarterBegin,\n QuarterEnd,\n YearBegin,\n YearEnd,\n)\n\nOPTIONAL_INTS = st.lists(st.one_of(st.integers(), st.none()), max_size=10, min_size=3)\n\nOPTIONAL_FLOATS = st.lists(st.one_of(st.floats(), st.none()), max_size=10, min_size=3)\n\nOPTIONAL_TEXT = st.lists(st.one_of(st.none(), st.text()), max_size=10, min_size=3)\n\nOPTIONAL_DICTS = st.lists(\n st.one_of(st.none(), st.dictionaries(st.text(), st.integers())),\n max_size=10,\n min_size=3,\n)\n\nOPTIONAL_LISTS = st.lists(\n st.one_of(st.none(), st.lists(st.text(), max_size=10, min_size=3)),\n max_size=10,\n min_size=3,\n)\n\nOPTIONAL_ONE_OF_ALL = st.one_of(\n OPTIONAL_DICTS, OPTIONAL_FLOATS, OPTIONAL_INTS, OPTIONAL_LISTS, OPTIONAL_TEXT\n)\n\nif is_platform_windows():\n DATETIME_NO_TZ = st.datetimes(min_value=datetime(1900, 1, 1))\nelse:\n DATETIME_NO_TZ = st.datetimes()\n\nDATETIME_JAN_1_1900_OPTIONAL_TZ = st.datetimes(\n min_value=pd.Timestamp(\n 1900, 1, 1\n ).to_pydatetime(), # pyright: ignore[reportGeneralTypeIssues]\n max_value=pd.Timestamp(\n 1900, 1, 1\n ).to_pydatetime(), # pyright: ignore[reportGeneralTypeIssues]\n timezones=st.one_of(st.none(), dateutil_timezones(), pytz_timezones()),\n)\n\nDATETIME_IN_PD_TIMESTAMP_RANGE_NO_TZ = st.datetimes(\n min_value=pd.Timestamp.min.to_pydatetime(warn=False),\n max_value=pd.Timestamp.max.to_pydatetime(warn=False),\n)\n\nINT_NEG_999_TO_POS_999 = st.integers(-999, 999)\n\n# The strategy for each type is registered in conftest.py, as they don't carry\n# enough runtime information (e.g. type hints) to infer how to build them.\nYQM_OFFSET = st.one_of(\n *map(\n st.from_type,\n [\n MonthBegin,\n MonthEnd,\n BMonthBegin,\n BMonthEnd,\n QuarterBegin,\n QuarterEnd,\n BQuarterBegin,\n BQuarterEnd,\n YearBegin,\n YearEnd,\n BYearBegin,\n BYearEnd,\n ],\n )\n)\n | .venv\Lib\site-packages\pandas\_testing\_hypothesis.py | _hypothesis.py | Python | 2,426 | 0.95 | 0.021505 | 0.038462 | vue-tools | 886 | 2023-08-27T23:31:48.473684 | BSD-3-Clause | true | d9b0d66ee3f24917440b54830a494703 |
from __future__ import annotations\n\nimport gzip\nimport io\nimport pathlib\nimport tarfile\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n)\nimport uuid\nimport zipfile\n\nfrom pandas.compat import (\n get_bz2_file,\n get_lzma_file,\n)\nfrom pandas.compat._optional import import_optional_dependency\n\nimport pandas as pd\nfrom pandas._testing.contexts import ensure_clean\n\nif TYPE_CHECKING:\n from pandas._typing import (\n FilePath,\n ReadPickleBuffer,\n )\n\n from pandas import (\n DataFrame,\n Series,\n )\n\n# ------------------------------------------------------------------\n# File-IO\n\n\ndef round_trip_pickle(\n obj: Any, path: FilePath | ReadPickleBuffer | None = None\n) -> DataFrame | Series:\n """\n Pickle an object and then read it again.\n\n Parameters\n ----------\n obj : any object\n The object to pickle and then re-read.\n path : str, path object or file-like object, default None\n The path where the pickled object is written and then read.\n\n Returns\n -------\n pandas object\n The original object that was pickled and then re-read.\n """\n _path = path\n if _path is None:\n _path = f"__{uuid.uuid4()}__.pickle"\n with ensure_clean(_path) as temp_path:\n pd.to_pickle(obj, temp_path)\n return pd.read_pickle(temp_path)\n\n\ndef round_trip_pathlib(writer, reader, path: str | None = None):\n """\n Write an object to file specified by a pathlib.Path and read it back\n\n Parameters\n ----------\n writer : callable bound to pandas object\n IO writing function (e.g. DataFrame.to_csv )\n reader : callable\n IO reading function (e.g. pd.read_csv )\n path : str, default None\n The path where the object is written and then read.\n\n Returns\n -------\n pandas object\n The original object that was serialized and then re-read.\n """\n Path = pathlib.Path\n if path is None:\n path = "___pathlib___"\n with ensure_clean(path) as path:\n writer(Path(path)) # type: ignore[arg-type]\n obj = reader(Path(path)) # type: ignore[arg-type]\n return obj\n\n\ndef round_trip_localpath(writer, reader, path: str | None = None):\n """\n Write an object to file specified by a py.path LocalPath and read it back.\n\n Parameters\n ----------\n writer : callable bound to pandas object\n IO writing function (e.g. DataFrame.to_csv )\n reader : callable\n IO reading function (e.g. pd.read_csv )\n path : str, default None\n The path where the object is written and then read.\n\n Returns\n -------\n pandas object\n The original object that was serialized and then re-read.\n """\n import pytest\n\n LocalPath = pytest.importorskip("py.path").local\n if path is None:\n path = "___localpath___"\n with ensure_clean(path) as path:\n writer(LocalPath(path))\n obj = reader(LocalPath(path))\n return obj\n\n\ndef write_to_compressed(compression, path, data, dest: str = "test") -> None:\n """\n Write data to a compressed file.\n\n Parameters\n ----------\n compression : {'gzip', 'bz2', 'zip', 'xz', 'zstd'}\n The compression type to use.\n path : str\n The file path to write the data.\n data : str\n The data to write.\n dest : str, default "test"\n The destination file (for ZIP only)\n\n Raises\n ------\n ValueError : An invalid compression value was passed in.\n """\n args: tuple[Any, ...] = (data,)\n mode = "wb"\n method = "write"\n compress_method: Callable\n\n if compression == "zip":\n compress_method = zipfile.ZipFile\n mode = "w"\n args = (dest, data)\n method = "writestr"\n elif compression == "tar":\n compress_method = tarfile.TarFile\n mode = "w"\n file = tarfile.TarInfo(name=dest)\n bytes = io.BytesIO(data)\n file.size = len(data)\n args = (file, bytes)\n method = "addfile"\n elif compression == "gzip":\n compress_method = gzip.GzipFile\n elif compression == "bz2":\n compress_method = get_bz2_file()\n elif compression == "zstd":\n compress_method = import_optional_dependency("zstandard").open\n elif compression == "xz":\n compress_method = get_lzma_file()\n else:\n raise ValueError(f"Unrecognized compression type: {compression}")\n\n with compress_method(path, mode=mode) as f:\n getattr(f, method)(*args)\n | .venv\Lib\site-packages\pandas\_testing\_io.py | _io.py | Python | 4,448 | 0.95 | 0.082353 | 0.013793 | vue-tools | 662 | 2023-11-09T18:06:35.656823 | GPL-3.0 | true | 5f820cbec8e997990c75038103428902 |
from __future__ import annotations\n\nfrom contextlib import (\n contextmanager,\n nullcontext,\n)\nimport inspect\nimport re\nimport sys\nfrom typing import (\n TYPE_CHECKING,\n Literal,\n cast,\n)\nimport warnings\n\nfrom pandas.compat import PY311\n\nif TYPE_CHECKING:\n from collections.abc import (\n Generator,\n Sequence,\n )\n\n\n@contextmanager\ndef assert_produces_warning(\n expected_warning: type[Warning] | bool | tuple[type[Warning], ...] | None = Warning,\n filter_level: Literal[\n "error", "ignore", "always", "default", "module", "once"\n ] = "always",\n check_stacklevel: bool = True,\n raise_on_extra_warnings: bool = True,\n match: str | None = None,\n) -> Generator[list[warnings.WarningMessage], None, None]:\n """\n Context manager for running code expected to either raise a specific warning,\n multiple specific warnings, or not raise any warnings. Verifies that the code\n raises the expected warning(s), and that it does not raise any other unexpected\n warnings. It is basically a wrapper around ``warnings.catch_warnings``.\n\n Parameters\n ----------\n expected_warning : {Warning, False, tuple[Warning, ...], None}, default Warning\n The type of Exception raised. ``exception.Warning`` is the base\n class for all warnings. To raise multiple types of exceptions,\n pass them as a tuple. To check that no warning is returned,\n specify ``False`` or ``None``.\n filter_level : str or None, default "always"\n Specifies whether warnings are ignored, displayed, or turned\n into errors.\n Valid values are:\n\n * "error" - turns matching warnings into exceptions\n * "ignore" - discard the warning\n * "always" - always emit a warning\n * "default" - print the warning the first time it is generated\n from each location\n * "module" - print the warning the first time it is generated\n from each module\n * "once" - print the warning the first time it is generated\n\n check_stacklevel : bool, default True\n If True, displays the line that called the function containing\n the warning to show were the function is called. Otherwise, the\n line that implements the function is displayed.\n raise_on_extra_warnings : bool, default True\n Whether extra warnings not of the type `expected_warning` should\n cause the test to fail.\n match : str, optional\n Match warning message.\n\n Examples\n --------\n >>> import warnings\n >>> with assert_produces_warning():\n ... warnings.warn(UserWarning())\n ...\n >>> with assert_produces_warning(False):\n ... warnings.warn(RuntimeWarning())\n ...\n Traceback (most recent call last):\n ...\n AssertionError: Caused unexpected warning(s): ['RuntimeWarning'].\n >>> with assert_produces_warning(UserWarning):\n ... warnings.warn(RuntimeWarning())\n Traceback (most recent call last):\n ...\n AssertionError: Did not see expected warning of class 'UserWarning'.\n\n ..warn:: This is *not* thread-safe.\n """\n __tracebackhide__ = True\n\n with warnings.catch_warnings(record=True) as w:\n warnings.simplefilter(filter_level)\n try:\n yield w\n finally:\n if expected_warning:\n expected_warning = cast(type[Warning], expected_warning)\n _assert_caught_expected_warning(\n caught_warnings=w,\n expected_warning=expected_warning,\n match=match,\n check_stacklevel=check_stacklevel,\n )\n if raise_on_extra_warnings:\n _assert_caught_no_extra_warnings(\n caught_warnings=w,\n expected_warning=expected_warning,\n )\n\n\ndef maybe_produces_warning(warning: type[Warning], condition: bool, **kwargs):\n """\n Return a context manager that possibly checks a warning based on the condition\n """\n if condition:\n return assert_produces_warning(warning, **kwargs)\n else:\n return nullcontext()\n\n\ndef _assert_caught_expected_warning(\n *,\n caught_warnings: Sequence[warnings.WarningMessage],\n expected_warning: type[Warning],\n match: str | None,\n check_stacklevel: bool,\n) -> None:\n """Assert that there was the expected warning among the caught warnings."""\n saw_warning = False\n matched_message = False\n unmatched_messages = []\n\n for actual_warning in caught_warnings:\n if issubclass(actual_warning.category, expected_warning):\n saw_warning = True\n\n if check_stacklevel:\n _assert_raised_with_correct_stacklevel(actual_warning)\n\n if match is not None:\n if re.search(match, str(actual_warning.message)):\n matched_message = True\n else:\n unmatched_messages.append(actual_warning.message)\n\n if not saw_warning:\n raise AssertionError(\n f"Did not see expected warning of class "\n f"{repr(expected_warning.__name__)}"\n )\n\n if match and not matched_message:\n raise AssertionError(\n f"Did not see warning {repr(expected_warning.__name__)} "\n f"matching '{match}'. The emitted warning messages are "\n f"{unmatched_messages}"\n )\n\n\ndef _assert_caught_no_extra_warnings(\n *,\n caught_warnings: Sequence[warnings.WarningMessage],\n expected_warning: type[Warning] | bool | tuple[type[Warning], ...] | None,\n) -> None:\n """Assert that no extra warnings apart from the expected ones are caught."""\n extra_warnings = []\n\n for actual_warning in caught_warnings:\n if _is_unexpected_warning(actual_warning, expected_warning):\n # GH#38630 pytest.filterwarnings does not suppress these.\n if actual_warning.category == ResourceWarning:\n # GH 44732: Don't make the CI flaky by filtering SSL-related\n # ResourceWarning from dependencies\n if "unclosed <ssl.SSLSocket" in str(actual_warning.message):\n continue\n # GH 44844: Matplotlib leaves font files open during the entire process\n # upon import. Don't make CI flaky if ResourceWarning raised\n # due to these open files.\n if any("matplotlib" in mod for mod in sys.modules):\n continue\n if PY311 and actual_warning.category == EncodingWarning:\n # EncodingWarnings are checked in the CI\n # pyproject.toml errors on EncodingWarnings in pandas\n # Ignore EncodingWarnings from other libraries\n continue\n extra_warnings.append(\n (\n actual_warning.category.__name__,\n actual_warning.message,\n actual_warning.filename,\n actual_warning.lineno,\n )\n )\n\n if extra_warnings:\n raise AssertionError(f"Caused unexpected warning(s): {repr(extra_warnings)}")\n\n\ndef _is_unexpected_warning(\n actual_warning: warnings.WarningMessage,\n expected_warning: type[Warning] | bool | tuple[type[Warning], ...] | None,\n) -> bool:\n """Check if the actual warning issued is unexpected."""\n if actual_warning and not expected_warning:\n return True\n expected_warning = cast(type[Warning], expected_warning)\n return bool(not issubclass(actual_warning.category, expected_warning))\n\n\ndef _assert_raised_with_correct_stacklevel(\n actual_warning: warnings.WarningMessage,\n) -> None:\n # https://stackoverflow.com/questions/17407119/python-inspect-stack-is-slow\n frame = inspect.currentframe()\n for _ in range(4):\n frame = frame.f_back # type: ignore[union-attr]\n try:\n caller_filename = inspect.getfile(frame) # type: ignore[arg-type]\n finally:\n # See note in\n # https://docs.python.org/3/library/inspect.html#inspect.Traceback\n del frame\n msg = (\n "Warning not set with correct stacklevel. "\n f"File where warning is raised: {actual_warning.filename} != "\n f"{caller_filename}. Warning message: {actual_warning.message}"\n )\n assert actual_warning.filename == caller_filename, msg\n | .venv\Lib\site-packages\pandas\_testing\_warnings.py | _warnings.py | Python | 8,357 | 0.95 | 0.168103 | 0.098039 | react-lib | 966 | 2024-02-15T18:35:53.584180 | MIT | true | 7fb753fbeba46f86377cccc3d75172f9 |
from __future__ import annotations\n\nfrom decimal import Decimal\nimport operator\nimport os\nfrom sys import byteorder\nfrom typing import (\n TYPE_CHECKING,\n Callable,\n ContextManager,\n)\nimport warnings\n\nimport numpy as np\n\nfrom pandas._config import using_string_dtype\nfrom pandas._config.localization import (\n can_set_locale,\n get_locales,\n set_locale,\n)\n\nfrom pandas.compat import pa_version_under10p1\n\nimport pandas as pd\nfrom pandas import (\n ArrowDtype,\n DataFrame,\n Index,\n MultiIndex,\n RangeIndex,\n Series,\n)\nfrom pandas._testing._io import (\n round_trip_localpath,\n round_trip_pathlib,\n round_trip_pickle,\n write_to_compressed,\n)\nfrom pandas._testing._warnings import (\n assert_produces_warning,\n maybe_produces_warning,\n)\nfrom pandas._testing.asserters import (\n assert_almost_equal,\n assert_attr_equal,\n assert_categorical_equal,\n assert_class_equal,\n assert_contains_all,\n assert_copy,\n assert_datetime_array_equal,\n assert_dict_equal,\n assert_equal,\n assert_extension_array_equal,\n assert_frame_equal,\n assert_index_equal,\n assert_indexing_slices_equivalent,\n assert_interval_array_equal,\n assert_is_sorted,\n assert_is_valid_plot_return_object,\n assert_metadata_equivalent,\n assert_numpy_array_equal,\n assert_period_array_equal,\n assert_series_equal,\n assert_sp_array_equal,\n assert_timedelta_array_equal,\n raise_assert_detail,\n)\nfrom pandas._testing.compat import (\n get_dtype,\n get_obj,\n)\nfrom pandas._testing.contexts import (\n assert_cow_warning,\n decompress_file,\n ensure_clean,\n raises_chained_assignment_error,\n set_timezone,\n use_numexpr,\n with_csv_dialect,\n)\nfrom pandas.core.arrays import (\n ArrowExtensionArray,\n BaseMaskedArray,\n NumpyExtensionArray,\n)\nfrom pandas.core.arrays._mixins import NDArrayBackedExtensionArray\nfrom pandas.core.construction import extract_array\n\nif TYPE_CHECKING:\n from pandas._typing import (\n Dtype,\n NpDtype,\n )\n\n\nUNSIGNED_INT_NUMPY_DTYPES: list[NpDtype] = ["uint8", "uint16", "uint32", "uint64"]\nUNSIGNED_INT_EA_DTYPES: list[Dtype] = ["UInt8", "UInt16", "UInt32", "UInt64"]\nSIGNED_INT_NUMPY_DTYPES: list[NpDtype] = [int, "int8", "int16", "int32", "int64"]\nSIGNED_INT_EA_DTYPES: list[Dtype] = ["Int8", "Int16", "Int32", "Int64"]\nALL_INT_NUMPY_DTYPES = UNSIGNED_INT_NUMPY_DTYPES + SIGNED_INT_NUMPY_DTYPES\nALL_INT_EA_DTYPES = UNSIGNED_INT_EA_DTYPES + SIGNED_INT_EA_DTYPES\nALL_INT_DTYPES: list[Dtype] = [*ALL_INT_NUMPY_DTYPES, *ALL_INT_EA_DTYPES]\n\nFLOAT_NUMPY_DTYPES: list[NpDtype] = [float, "float32", "float64"]\nFLOAT_EA_DTYPES: list[Dtype] = ["Float32", "Float64"]\nALL_FLOAT_DTYPES: list[Dtype] = [*FLOAT_NUMPY_DTYPES, *FLOAT_EA_DTYPES]\n\nCOMPLEX_DTYPES: list[Dtype] = [complex, "complex64", "complex128"]\nif using_string_dtype():\n STRING_DTYPES: list[Dtype] = ["U"]\nelse:\n STRING_DTYPES: list[Dtype] = [str, "str", "U"] # type: ignore[no-redef]\nCOMPLEX_FLOAT_DTYPES: list[Dtype] = [*COMPLEX_DTYPES, *FLOAT_NUMPY_DTYPES]\n\nDATETIME64_DTYPES: list[Dtype] = ["datetime64[ns]", "M8[ns]"]\nTIMEDELTA64_DTYPES: list[Dtype] = ["timedelta64[ns]", "m8[ns]"]\n\nBOOL_DTYPES: list[Dtype] = [bool, "bool"]\nBYTES_DTYPES: list[Dtype] = [bytes, "bytes"]\nOBJECT_DTYPES: list[Dtype] = [object, "object"]\n\nALL_REAL_NUMPY_DTYPES = FLOAT_NUMPY_DTYPES + ALL_INT_NUMPY_DTYPES\nALL_REAL_EXTENSION_DTYPES = FLOAT_EA_DTYPES + ALL_INT_EA_DTYPES\nALL_REAL_DTYPES: list[Dtype] = [*ALL_REAL_NUMPY_DTYPES, *ALL_REAL_EXTENSION_DTYPES]\nALL_NUMERIC_DTYPES: list[Dtype] = [*ALL_REAL_DTYPES, *COMPLEX_DTYPES]\n\nALL_NUMPY_DTYPES = (\n ALL_REAL_NUMPY_DTYPES\n + COMPLEX_DTYPES\n + STRING_DTYPES\n + DATETIME64_DTYPES\n + TIMEDELTA64_DTYPES\n + BOOL_DTYPES\n + OBJECT_DTYPES\n + BYTES_DTYPES\n)\n\nNARROW_NP_DTYPES = [\n np.float16,\n np.float32,\n np.int8,\n np.int16,\n np.int32,\n np.uint8,\n np.uint16,\n np.uint32,\n]\n\nPYTHON_DATA_TYPES = [\n str,\n int,\n float,\n complex,\n list,\n tuple,\n range,\n dict,\n set,\n frozenset,\n bool,\n bytes,\n bytearray,\n memoryview,\n]\n\nENDIAN = {"little": "<", "big": ">"}[byteorder]\n\nNULL_OBJECTS = [None, np.nan, pd.NaT, float("nan"), pd.NA, Decimal("NaN")]\nNP_NAT_OBJECTS = [\n cls("NaT", unit)\n for cls in [np.datetime64, np.timedelta64]\n for unit in [\n "Y",\n "M",\n "W",\n "D",\n "h",\n "m",\n "s",\n "ms",\n "us",\n "ns",\n "ps",\n "fs",\n "as",\n ]\n]\n\nif not pa_version_under10p1:\n import pyarrow as pa\n\n UNSIGNED_INT_PYARROW_DTYPES = [pa.uint8(), pa.uint16(), pa.uint32(), pa.uint64()]\n SIGNED_INT_PYARROW_DTYPES = [pa.int8(), pa.int16(), pa.int32(), pa.int64()]\n ALL_INT_PYARROW_DTYPES = UNSIGNED_INT_PYARROW_DTYPES + SIGNED_INT_PYARROW_DTYPES\n ALL_INT_PYARROW_DTYPES_STR_REPR = [\n str(ArrowDtype(typ)) for typ in ALL_INT_PYARROW_DTYPES\n ]\n\n # pa.float16 doesn't seem supported\n # https://github.com/apache/arrow/blob/master/python/pyarrow/src/arrow/python/helpers.cc#L86\n FLOAT_PYARROW_DTYPES = [pa.float32(), pa.float64()]\n FLOAT_PYARROW_DTYPES_STR_REPR = [\n str(ArrowDtype(typ)) for typ in FLOAT_PYARROW_DTYPES\n ]\n DECIMAL_PYARROW_DTYPES = [pa.decimal128(7, 3)]\n STRING_PYARROW_DTYPES = [pa.string()]\n BINARY_PYARROW_DTYPES = [pa.binary()]\n\n TIME_PYARROW_DTYPES = [\n pa.time32("s"),\n pa.time32("ms"),\n pa.time64("us"),\n pa.time64("ns"),\n ]\n DATE_PYARROW_DTYPES = [pa.date32(), pa.date64()]\n DATETIME_PYARROW_DTYPES = [\n pa.timestamp(unit=unit, tz=tz)\n for unit in ["s", "ms", "us", "ns"]\n for tz in [None, "UTC", "US/Pacific", "US/Eastern"]\n ]\n TIMEDELTA_PYARROW_DTYPES = [pa.duration(unit) for unit in ["s", "ms", "us", "ns"]]\n\n BOOL_PYARROW_DTYPES = [pa.bool_()]\n\n # TODO: Add container like pyarrow types:\n # https://arrow.apache.org/docs/python/api/datatypes.html#factory-functions\n ALL_PYARROW_DTYPES = (\n ALL_INT_PYARROW_DTYPES\n + FLOAT_PYARROW_DTYPES\n + DECIMAL_PYARROW_DTYPES\n + STRING_PYARROW_DTYPES\n + BINARY_PYARROW_DTYPES\n + TIME_PYARROW_DTYPES\n + DATE_PYARROW_DTYPES\n + DATETIME_PYARROW_DTYPES\n + TIMEDELTA_PYARROW_DTYPES\n + BOOL_PYARROW_DTYPES\n )\n ALL_REAL_PYARROW_DTYPES_STR_REPR = (\n ALL_INT_PYARROW_DTYPES_STR_REPR + FLOAT_PYARROW_DTYPES_STR_REPR\n )\nelse:\n FLOAT_PYARROW_DTYPES_STR_REPR = []\n ALL_INT_PYARROW_DTYPES_STR_REPR = []\n ALL_PYARROW_DTYPES = []\n ALL_REAL_PYARROW_DTYPES_STR_REPR = []\n\nALL_REAL_NULLABLE_DTYPES = (\n FLOAT_NUMPY_DTYPES + ALL_REAL_EXTENSION_DTYPES + ALL_REAL_PYARROW_DTYPES_STR_REPR\n)\n\narithmetic_dunder_methods = [\n "__add__",\n "__radd__",\n "__sub__",\n "__rsub__",\n "__mul__",\n "__rmul__",\n "__floordiv__",\n "__rfloordiv__",\n "__truediv__",\n "__rtruediv__",\n "__pow__",\n "__rpow__",\n "__mod__",\n "__rmod__",\n]\n\ncomparison_dunder_methods = ["__eq__", "__ne__", "__le__", "__lt__", "__ge__", "__gt__"]\n\n\n# -----------------------------------------------------------------------------\n# Comparators\n\n\ndef box_expected(expected, box_cls, transpose: bool = True):\n """\n Helper function to wrap the expected output of a test in a given box_class.\n\n Parameters\n ----------\n expected : np.ndarray, Index, Series\n box_cls : {Index, Series, DataFrame}\n\n Returns\n -------\n subclass of box_cls\n """\n if box_cls is pd.array:\n if isinstance(expected, RangeIndex):\n # pd.array would return an IntegerArray\n expected = NumpyExtensionArray(np.asarray(expected._values))\n else:\n expected = pd.array(expected, copy=False)\n elif box_cls is Index:\n with warnings.catch_warnings():\n warnings.filterwarnings("ignore", "Dtype inference", category=FutureWarning)\n expected = Index(expected)\n elif box_cls is Series:\n with warnings.catch_warnings():\n warnings.filterwarnings("ignore", "Dtype inference", category=FutureWarning)\n expected = Series(expected)\n elif box_cls is DataFrame:\n with warnings.catch_warnings():\n warnings.filterwarnings("ignore", "Dtype inference", category=FutureWarning)\n expected = Series(expected).to_frame()\n if transpose:\n # for vector operations, we need a DataFrame to be a single-row,\n # not a single-column, in order to operate against non-DataFrame\n # vectors of the same length. But convert to two rows to avoid\n # single-row special cases in datetime arithmetic\n expected = expected.T\n expected = pd.concat([expected] * 2, ignore_index=True)\n elif box_cls is np.ndarray or box_cls is np.array:\n expected = np.array(expected)\n elif box_cls is to_array:\n expected = to_array(expected)\n else:\n raise NotImplementedError(box_cls)\n return expected\n\n\ndef to_array(obj):\n """\n Similar to pd.array, but does not cast numpy dtypes to nullable dtypes.\n """\n # temporary implementation until we get pd.array in place\n dtype = getattr(obj, "dtype", None)\n\n if dtype is None:\n return np.asarray(obj)\n\n return extract_array(obj, extract_numpy=True)\n\n\nclass SubclassedSeries(Series):\n _metadata = ["testattr", "name"]\n\n @property\n def _constructor(self):\n # For testing, those properties return a generic callable, and not\n # the actual class. In this case that is equivalent, but it is to\n # ensure we don't rely on the property returning a class\n # See https://github.com/pandas-dev/pandas/pull/46018 and\n # https://github.com/pandas-dev/pandas/issues/32638 and linked issues\n return lambda *args, **kwargs: SubclassedSeries(*args, **kwargs)\n\n @property\n def _constructor_expanddim(self):\n return lambda *args, **kwargs: SubclassedDataFrame(*args, **kwargs)\n\n\nclass SubclassedDataFrame(DataFrame):\n _metadata = ["testattr"]\n\n @property\n def _constructor(self):\n return lambda *args, **kwargs: SubclassedDataFrame(*args, **kwargs)\n\n @property\n def _constructor_sliced(self):\n return lambda *args, **kwargs: SubclassedSeries(*args, **kwargs)\n\n\ndef convert_rows_list_to_csv_str(rows_list: list[str]) -> str:\n """\n Convert list of CSV rows to single CSV-formatted string for current OS.\n\n This method is used for creating expected value of to_csv() method.\n\n Parameters\n ----------\n rows_list : List[str]\n Each element represents the row of csv.\n\n Returns\n -------\n str\n Expected output of to_csv() in current OS.\n """\n sep = os.linesep\n return sep.join(rows_list) + sep\n\n\ndef external_error_raised(expected_exception: type[Exception]) -> ContextManager:\n """\n Helper function to mark pytest.raises that have an external error message.\n\n Parameters\n ----------\n expected_exception : Exception\n Expected error to raise.\n\n Returns\n -------\n Callable\n Regular `pytest.raises` function with `match` equal to `None`.\n """\n import pytest\n\n return pytest.raises(expected_exception, match=None)\n\n\ncython_table = pd.core.common._cython_table.items()\n\n\ndef get_cython_table_params(ndframe, func_names_and_expected):\n """\n Combine frame, functions from com._cython_table\n keys and expected result.\n\n Parameters\n ----------\n ndframe : DataFrame or Series\n func_names_and_expected : Sequence of two items\n The first item is a name of a NDFrame method ('sum', 'prod') etc.\n The second item is the expected return value.\n\n Returns\n -------\n list\n List of three items (DataFrame, function, expected result)\n """\n results = []\n for func_name, expected in func_names_and_expected:\n results.append((ndframe, func_name, expected))\n results += [\n (ndframe, func, expected)\n for func, name in cython_table\n if name == func_name\n ]\n return results\n\n\ndef get_op_from_name(op_name: str) -> Callable:\n """\n The operator function for a given op name.\n\n Parameters\n ----------\n op_name : str\n The op name, in form of "add" or "__add__".\n\n Returns\n -------\n function\n A function performing the operation.\n """\n short_opname = op_name.strip("_")\n try:\n op = getattr(operator, short_opname)\n except AttributeError:\n # Assume it is the reverse operator\n rop = getattr(operator, short_opname[1:])\n op = lambda x, y: rop(y, x)\n\n return op\n\n\n# -----------------------------------------------------------------------------\n# Indexing test helpers\n\n\ndef getitem(x):\n return x\n\n\ndef setitem(x):\n return x\n\n\ndef loc(x):\n return x.loc\n\n\ndef iloc(x):\n return x.iloc\n\n\ndef at(x):\n return x.at\n\n\ndef iat(x):\n return x.iat\n\n\n# -----------------------------------------------------------------------------\n\n_UNITS = ["s", "ms", "us", "ns"]\n\n\ndef get_finest_unit(left: str, right: str):\n """\n Find the higher of two datetime64 units.\n """\n if _UNITS.index(left) >= _UNITS.index(right):\n return left\n return right\n\n\ndef shares_memory(left, right) -> bool:\n """\n Pandas-compat for np.shares_memory.\n """\n if isinstance(left, np.ndarray) and isinstance(right, np.ndarray):\n return np.shares_memory(left, right)\n elif isinstance(left, np.ndarray):\n # Call with reversed args to get to unpacking logic below.\n return shares_memory(right, left)\n\n if isinstance(left, RangeIndex):\n return False\n if isinstance(left, MultiIndex):\n return shares_memory(left._codes, right)\n if isinstance(left, (Index, Series)):\n if isinstance(right, (Index, Series)):\n return shares_memory(left._values, right._values)\n return shares_memory(left._values, right)\n\n if isinstance(left, NDArrayBackedExtensionArray):\n return shares_memory(left._ndarray, right)\n if isinstance(left, pd.core.arrays.SparseArray):\n return shares_memory(left.sp_values, right)\n if isinstance(left, pd.core.arrays.IntervalArray):\n return shares_memory(left._left, right) or shares_memory(left._right, right)\n\n if isinstance(left, ArrowExtensionArray):\n if isinstance(right, ArrowExtensionArray):\n # https://github.com/pandas-dev/pandas/pull/43930#discussion_r736862669\n left_pa_data = left._pa_array\n right_pa_data = right._pa_array\n left_buf1 = left_pa_data.chunk(0).buffers()[1]\n right_buf1 = right_pa_data.chunk(0).buffers()[1]\n return left_buf1.address == right_buf1.address\n else:\n # if we have one one ArrowExtensionArray and one other array, assume\n # they can only share memory if they share the same numpy buffer\n return np.shares_memory(left, right)\n\n if isinstance(left, BaseMaskedArray) and isinstance(right, BaseMaskedArray):\n # By convention, we'll say these share memory if they share *either*\n # the _data or the _mask\n return np.shares_memory(left._data, right._data) or np.shares_memory(\n left._mask, right._mask\n )\n\n if isinstance(left, DataFrame) and len(left._mgr.arrays) == 1:\n arr = left._mgr.arrays[0]\n return shares_memory(arr, right)\n\n raise NotImplementedError(type(left), type(right))\n\n\n__all__ = [\n "ALL_INT_EA_DTYPES",\n "ALL_INT_NUMPY_DTYPES",\n "ALL_NUMPY_DTYPES",\n "ALL_REAL_NUMPY_DTYPES",\n "assert_almost_equal",\n "assert_attr_equal",\n "assert_categorical_equal",\n "assert_class_equal",\n "assert_contains_all",\n "assert_copy",\n "assert_datetime_array_equal",\n "assert_dict_equal",\n "assert_equal",\n "assert_extension_array_equal",\n "assert_frame_equal",\n "assert_index_equal",\n "assert_indexing_slices_equivalent",\n "assert_interval_array_equal",\n "assert_is_sorted",\n "assert_is_valid_plot_return_object",\n "assert_metadata_equivalent",\n "assert_numpy_array_equal",\n "assert_period_array_equal",\n "assert_produces_warning",\n "assert_series_equal",\n "assert_sp_array_equal",\n "assert_timedelta_array_equal",\n "assert_cow_warning",\n "at",\n "BOOL_DTYPES",\n "box_expected",\n "BYTES_DTYPES",\n "can_set_locale",\n "COMPLEX_DTYPES",\n "convert_rows_list_to_csv_str",\n "DATETIME64_DTYPES",\n "decompress_file",\n "ENDIAN",\n "ensure_clean",\n "external_error_raised",\n "FLOAT_EA_DTYPES",\n "FLOAT_NUMPY_DTYPES",\n "get_cython_table_params",\n "get_dtype",\n "getitem",\n "get_locales",\n "get_finest_unit",\n "get_obj",\n "get_op_from_name",\n "iat",\n "iloc",\n "loc",\n "maybe_produces_warning",\n "NARROW_NP_DTYPES",\n "NP_NAT_OBJECTS",\n "NULL_OBJECTS",\n "OBJECT_DTYPES",\n "raise_assert_detail",\n "raises_chained_assignment_error",\n "round_trip_localpath",\n "round_trip_pathlib",\n "round_trip_pickle",\n "setitem",\n "set_locale",\n "set_timezone",\n "shares_memory",\n "SIGNED_INT_EA_DTYPES",\n "SIGNED_INT_NUMPY_DTYPES",\n "STRING_DTYPES",\n "SubclassedDataFrame",\n "SubclassedSeries",\n "TIMEDELTA64_DTYPES",\n "to_array",\n "UNSIGNED_INT_EA_DTYPES",\n "UNSIGNED_INT_NUMPY_DTYPES",\n "use_numexpr",\n "with_csv_dialect",\n "write_to_compressed",\n]\n | .venv\Lib\site-packages\pandas\_testing\__init__.py | __init__.py | Python | 17,525 | 0.95 | 0.107087 | 0.05 | node-utils | 799 | 2025-05-15T13:51:06.186208 | MIT | true | 180138cebd581244e12ef370b1bb1c6d |
\n\n | .venv\Lib\site-packages\pandas\_testing\__pycache__\asserters.cpython-313.pyc | asserters.cpython-313.pyc | Other | 51,360 | 0.95 | 0.043539 | 0.00624 | react-lib | 643 | 2023-10-02T02:36:48.368502 | GPL-3.0 | true | 1ef49e8bbab9a3462bcdcb00b2b5283d |
\n\n | .venv\Lib\site-packages\pandas\_testing\__pycache__\compat.cpython-313.pyc | compat.cpython-313.pyc | Other | 1,139 | 0.8 | 0.058824 | 0 | react-lib | 221 | 2025-03-29T09:20:51.600086 | GPL-3.0 | true | da6a4e3a0aef1649affd2429e283a3ce |
\n\n | .venv\Lib\site-packages\pandas\_testing\__pycache__\contexts.cpython-313.pyc | contexts.cpython-313.pyc | Other | 8,160 | 0.95 | 0.040816 | 0.015748 | react-lib | 805 | 2023-07-20T13:19:27.775343 | GPL-3.0 | true | 1d8a878247676efc833dbc93cf20519d |
\n\n | .venv\Lib\site-packages\pandas\_testing\__pycache__\_hypothesis.cpython-313.pyc | _hypothesis.cpython-313.pyc | Other | 3,331 | 0.8 | 0 | 0 | python-kit | 380 | 2023-07-18T19:29:21.643584 | BSD-3-Clause | true | 4a521b90212bc9a9e93382499d8093a6 |
\n\n | .venv\Lib\site-packages\pandas\_testing\__pycache__\_io.cpython-313.pyc | _io.cpython-313.pyc | Other | 5,312 | 0.95 | 0.046296 | 0.010204 | python-kit | 886 | 2023-10-31T21:53:14.595270 | BSD-3-Clause | true | fd231be09ab3d94c39b476dffbdb12be |
\n\n | .venv\Lib\site-packages\pandas\_testing\__pycache__\_warnings.cpython-313.pyc | _warnings.cpython-313.pyc | Other | 8,570 | 0.95 | 0.073171 | 0.052632 | python-kit | 630 | 2023-08-12T01:07:08.452486 | MIT | true | fd4617ac71cfa073d9cd72ce194fba7e |
\n\n | .venv\Lib\site-packages\pandas\_testing\__pycache__\__init__.cpython-313.pyc | __init__.cpython-313.pyc | Other | 20,175 | 0.95 | 0.052885 | 0.015707 | awesome-app | 51 | 2025-04-05T13:15:23.031798 | Apache-2.0 | true | a93eacbe89ce8e7521112f5cf869a7a2 |
\n\n | .venv\Lib\site-packages\pandas\__pycache__\conftest.cpython-313.pyc | conftest.cpython-313.pyc | Other | 67,211 | 0.75 | 0.106593 | 0.301663 | awesome-app | 99 | 2024-04-26T14:04:00.363500 | Apache-2.0 | true | 152d6acc2a282ea6c1d351bedd783209 |
\n\n | .venv\Lib\site-packages\pandas\__pycache__\testing.cpython-313.pyc | testing.cpython-313.pyc | Other | 447 | 0.95 | 0 | 0 | node-utils | 812 | 2023-10-29T01:14:26.778083 | GPL-3.0 | true | a3eb8488d57d7aba9500c4b281e93c5e |
\n\n | .venv\Lib\site-packages\pandas\__pycache__\_typing.cpython-313.pyc | _typing.cpython-313.pyc | Other | 14,928 | 0.8 | 0 | 0 | react-lib | 196 | 2023-07-31T01:58:22.399262 | MIT | false | 7e467bc5b4ea9074651f2922df9b2625 |
\n\n | .venv\Lib\site-packages\pandas\__pycache__\_version.cpython-313.pyc | _version.cpython-313.pyc | Other | 22,599 | 0.8 | 0.031579 | 0.003861 | awesome-app | 802 | 2024-03-16T22:47:09.446248 | Apache-2.0 | false | 8d987671c5d268f7a97b9fab49f0e664 |
\n\n | .venv\Lib\site-packages\pandas\__pycache__\_version_meson.cpython-313.pyc | _version_meson.cpython-313.pyc | Other | 281 | 0.7 | 0 | 0 | awesome-app | 965 | 2024-06-23T08:46:14.137209 | Apache-2.0 | false | e7b48bb04db2cc59fcbe34273482e186 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.