_array_utils_impl.pyi 793 B

12345678910111213141516171819202122232425
  1. from typing import Any, Iterable
  2. from numpy import generic
  3. from numpy.typing import NDArray
  4. __all__ = ["byte_bounds", "normalize_axis_tuple", "normalize_axis_index"]
  5. # NOTE: In practice `byte_bounds` can (potentially) take any object
  6. # implementing the `__array_interface__` protocol. The caveat is
  7. # that certain keys, marked as optional in the spec, must be present for
  8. # `byte_bounds`. This concerns `"strides"` and `"data"`.
  9. def byte_bounds(a: generic | NDArray[Any]) -> tuple[int, int]: ...
  10. def normalize_axis_tuple(
  11. axis: int | Iterable[int],
  12. ndim: int = ...,
  13. argname: None | str = ...,
  14. allow_duplicate: None | bool = ...,
  15. ) -> tuple[int, int]: ...
  16. def normalize_axis_index(
  17. axis: int = ...,
  18. ndim: int = ...,
  19. msg_prefix: None | str = ...,
  20. ) -> int: ...