_philox.pyi 1013 B

123456789101112131415161718192021222324252627282930313233343536
  1. from typing import TypedDict, type_check_only
  2. from numpy import uint64
  3. from numpy._typing import _ArrayLikeInt_co
  4. from numpy.random.bit_generator import BitGenerator, SeedSequence
  5. from numpy.typing import NDArray
  6. __all__ = ["Philox"]
  7. @type_check_only
  8. class _PhiloxInternal(TypedDict):
  9. counter: NDArray[uint64]
  10. key: NDArray[uint64]
  11. @type_check_only
  12. class _PhiloxState(TypedDict):
  13. bit_generator: str
  14. state: _PhiloxInternal
  15. buffer: NDArray[uint64]
  16. buffer_pos: int
  17. has_uint32: int
  18. uinteger: int
  19. class Philox(BitGenerator):
  20. def __init__(
  21. self,
  22. seed: _ArrayLikeInt_co | SeedSequence | None = ...,
  23. counter: _ArrayLikeInt_co | None = ...,
  24. key: _ArrayLikeInt_co | None = ...,
  25. ) -> None: ...
  26. @property # type: ignore[override]
  27. def state(self) -> _PhiloxState: ...
  28. @state.setter
  29. def state(self, value: _PhiloxState) -> None: ...
  30. def jumped(self, jumps: int = 1) -> Philox: ...
  31. def advance(self, delta: int) -> Philox: ...