图片解析应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. import sys
  2. from typing import Any, Union
  3. from numpy import dtype, ndarray, uint64
  4. from numpy.random.bit_generator import BitGenerator, SeedSequence
  5. from numpy.typing import _ArrayLikeInt_co
  6. if sys.version_info >= (3, 8):
  7. from typing import TypedDict
  8. else:
  9. from typing_extensions import TypedDict
  10. class _PhiloxInternal(TypedDict):
  11. counter: ndarray[Any, dtype[uint64]]
  12. key: ndarray[Any, dtype[uint64]]
  13. class _PhiloxState(TypedDict):
  14. bit_generator: str
  15. state: _PhiloxInternal
  16. buffer: ndarray[Any, dtype[uint64]]
  17. buffer_pos: int
  18. has_uint32: int
  19. uinteger: int
  20. class Philox(BitGenerator):
  21. def __init__(
  22. self,
  23. seed: Union[None, _ArrayLikeInt_co, SeedSequence] = ...,
  24. counter: Union[None, _ArrayLikeInt_co] = ...,
  25. key: Union[None, _ArrayLikeInt_co] = ...,
  26. ) -> None: ...
  27. @property
  28. def state(
  29. self,
  30. ) -> _PhiloxState: ...
  31. @state.setter
  32. def state(
  33. self,
  34. value: _PhiloxState,
  35. ) -> None: ...
  36. def jumped(self, jumps: int = ...) -> Philox: ...
  37. def advance(self, delta: int) -> Philox: ...