mtrand.pyi 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. import builtins
  2. from collections.abc import Callable
  3. from typing import Any, overload, Literal
  4. import numpy as np
  5. from numpy import (
  6. dtype,
  7. float64,
  8. int8,
  9. int16,
  10. int32,
  11. int64,
  12. int_,
  13. long,
  14. uint8,
  15. uint16,
  16. uint32,
  17. uint64,
  18. uint,
  19. ulong,
  20. )
  21. from numpy.random.bit_generator import BitGenerator
  22. from numpy._typing import (
  23. ArrayLike,
  24. NDArray,
  25. _ArrayLikeFloat_co,
  26. _ArrayLikeInt_co,
  27. _DTypeLikeBool,
  28. _Int8Codes,
  29. _Int16Codes,
  30. _Int32Codes,
  31. _Int64Codes,
  32. _IntCodes,
  33. _LongCodes,
  34. _ShapeLike,
  35. _SupportsDType,
  36. _UInt8Codes,
  37. _UInt16Codes,
  38. _UInt32Codes,
  39. _UInt64Codes,
  40. _UIntCodes,
  41. _ULongCodes,
  42. )
  43. class RandomState:
  44. _bit_generator: BitGenerator
  45. def __init__(self, seed: None | _ArrayLikeInt_co | BitGenerator = ...) -> None: ...
  46. def __repr__(self) -> str: ...
  47. def __str__(self) -> str: ...
  48. def __getstate__(self) -> dict[str, Any]: ...
  49. def __setstate__(self, state: dict[str, Any]) -> None: ...
  50. def __reduce__(self) -> tuple[Callable[[BitGenerator], RandomState], tuple[BitGenerator], dict[str, Any]]: ...
  51. def seed(self, seed: None | _ArrayLikeFloat_co = ...) -> None: ...
  52. @overload
  53. def get_state(self, legacy: Literal[False] = ...) -> dict[str, Any]: ...
  54. @overload
  55. def get_state(
  56. self, legacy: Literal[True] = ...
  57. ) -> dict[str, Any] | tuple[str, NDArray[uint32], int, int, float]: ...
  58. def set_state(
  59. self, state: dict[str, Any] | tuple[str, NDArray[uint32], int, int, float]
  60. ) -> None: ...
  61. @overload
  62. def random_sample(self, size: None = ...) -> float: ... # type: ignore[misc]
  63. @overload
  64. def random_sample(self, size: _ShapeLike) -> NDArray[float64]: ...
  65. @overload
  66. def random(self, size: None = ...) -> float: ... # type: ignore[misc]
  67. @overload
  68. def random(self, size: _ShapeLike) -> NDArray[float64]: ...
  69. @overload
  70. def beta(self, a: float, b: float, size: None = ...) -> float: ... # type: ignore[misc]
  71. @overload
  72. def beta(
  73. self, a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  74. ) -> NDArray[float64]: ...
  75. @overload
  76. def exponential(self, scale: float = ..., size: None = ...) -> float: ... # type: ignore[misc]
  77. @overload
  78. def exponential(
  79. self, scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...
  80. ) -> NDArray[float64]: ...
  81. @overload
  82. def standard_exponential(self, size: None = ...) -> float: ... # type: ignore[misc]
  83. @overload
  84. def standard_exponential(self, size: _ShapeLike) -> NDArray[float64]: ...
  85. @overload
  86. def tomaxint(self, size: None = ...) -> int: ... # type: ignore[misc]
  87. @overload
  88. # Generates long values, but stores it in a 64bit int:
  89. def tomaxint(self, size: _ShapeLike) -> NDArray[int64]: ...
  90. @overload
  91. def randint( # type: ignore[misc]
  92. self,
  93. low: int,
  94. high: None | int = ...,
  95. size: None = ...,
  96. ) -> int: ...
  97. @overload
  98. def randint( # type: ignore[misc]
  99. self,
  100. low: int,
  101. high: None | int = ...,
  102. size: None = ...,
  103. dtype: type[bool] = ...,
  104. ) -> bool: ...
  105. @overload
  106. def randint( # type: ignore[misc]
  107. self,
  108. low: int,
  109. high: None | int = ...,
  110. size: None = ...,
  111. dtype: type[np.bool] = ...,
  112. ) -> np.bool: ...
  113. @overload
  114. def randint( # type: ignore[misc]
  115. self,
  116. low: int,
  117. high: None | int = ...,
  118. size: None = ...,
  119. dtype: type[int] = ...,
  120. ) -> int: ...
  121. @overload
  122. def randint( # type: ignore[misc]
  123. self,
  124. low: int,
  125. high: None | int = ...,
  126. size: None = ...,
  127. dtype: dtype[uint8] | type[uint8] | _UInt8Codes | _SupportsDType[dtype[uint8]] = ...,
  128. ) -> uint8: ...
  129. @overload
  130. def randint( # type: ignore[misc]
  131. self,
  132. low: int,
  133. high: None | int = ...,
  134. size: None = ...,
  135. dtype: dtype[uint16] | type[uint16] | _UInt16Codes | _SupportsDType[dtype[uint16]] = ...,
  136. ) -> uint16: ...
  137. @overload
  138. def randint( # type: ignore[misc]
  139. self,
  140. low: int,
  141. high: None | int = ...,
  142. size: None = ...,
  143. dtype: dtype[uint32] | type[uint32] | _UInt32Codes | _SupportsDType[dtype[uint32]] = ...,
  144. ) -> uint32: ...
  145. @overload
  146. def randint( # type: ignore[misc]
  147. self,
  148. low: int,
  149. high: None | int = ...,
  150. size: None = ...,
  151. dtype: dtype[uint] | type[uint] | _UIntCodes | _SupportsDType[dtype[uint]] = ...,
  152. ) -> uint: ...
  153. @overload
  154. def randint( # type: ignore[misc]
  155. self,
  156. low: int,
  157. high: None | int = ...,
  158. size: None = ...,
  159. dtype: dtype[ulong] | type[ulong] | _ULongCodes | _SupportsDType[dtype[ulong]] = ...,
  160. ) -> ulong: ...
  161. @overload
  162. def randint( # type: ignore[misc]
  163. self,
  164. low: int,
  165. high: None | int = ...,
  166. size: None = ...,
  167. dtype: dtype[uint64] | type[uint64] | _UInt64Codes | _SupportsDType[dtype[uint64]] = ...,
  168. ) -> uint64: ...
  169. @overload
  170. def randint( # type: ignore[misc]
  171. self,
  172. low: int,
  173. high: None | int = ...,
  174. size: None = ...,
  175. dtype: dtype[int8] | type[int8] | _Int8Codes | _SupportsDType[dtype[int8]] = ...,
  176. ) -> int8: ...
  177. @overload
  178. def randint( # type: ignore[misc]
  179. self,
  180. low: int,
  181. high: None | int = ...,
  182. size: None = ...,
  183. dtype: dtype[int16] | type[int16] | _Int16Codes | _SupportsDType[dtype[int16]] = ...,
  184. ) -> int16: ...
  185. @overload
  186. def randint( # type: ignore[misc]
  187. self,
  188. low: int,
  189. high: None | int = ...,
  190. size: None = ...,
  191. dtype: dtype[int32] | type[int32] | _Int32Codes | _SupportsDType[dtype[int32]] = ...,
  192. ) -> int32: ...
  193. @overload
  194. def randint( # type: ignore[misc]
  195. self,
  196. low: int,
  197. high: None | int = ...,
  198. size: None = ...,
  199. dtype: dtype[int_] | type[int_] | _IntCodes | _SupportsDType[dtype[int_]] = ...,
  200. ) -> int_: ...
  201. @overload
  202. def randint( # type: ignore[misc]
  203. self,
  204. low: int,
  205. high: None | int = ...,
  206. size: None = ...,
  207. dtype: dtype[long] | type[long] | _LongCodes | _SupportsDType[dtype[long]] = ...,
  208. ) -> long: ...
  209. @overload
  210. def randint( # type: ignore[misc]
  211. self,
  212. low: int,
  213. high: None | int = ...,
  214. size: None = ...,
  215. dtype: dtype[int64] | type[int64] | _Int64Codes | _SupportsDType[dtype[int64]] = ...,
  216. ) -> int64: ...
  217. @overload
  218. def randint( # type: ignore[misc]
  219. self,
  220. low: _ArrayLikeInt_co,
  221. high: None | _ArrayLikeInt_co = ...,
  222. size: None | _ShapeLike = ...,
  223. ) -> NDArray[long]: ...
  224. @overload
  225. def randint( # type: ignore[misc]
  226. self,
  227. low: _ArrayLikeInt_co,
  228. high: None | _ArrayLikeInt_co = ...,
  229. size: None | _ShapeLike = ...,
  230. dtype: _DTypeLikeBool = ...,
  231. ) -> NDArray[np.bool]: ...
  232. @overload
  233. def randint( # type: ignore[misc]
  234. self,
  235. low: _ArrayLikeInt_co,
  236. high: None | _ArrayLikeInt_co = ...,
  237. size: None | _ShapeLike = ...,
  238. dtype: dtype[int8] | type[int8] | _Int8Codes | _SupportsDType[dtype[int8]] = ...,
  239. ) -> NDArray[int8]: ...
  240. @overload
  241. def randint( # type: ignore[misc]
  242. self,
  243. low: _ArrayLikeInt_co,
  244. high: None | _ArrayLikeInt_co = ...,
  245. size: None | _ShapeLike = ...,
  246. dtype: dtype[int16] | type[int16] | _Int16Codes | _SupportsDType[dtype[int16]] = ...,
  247. ) -> NDArray[int16]: ...
  248. @overload
  249. def randint( # type: ignore[misc]
  250. self,
  251. low: _ArrayLikeInt_co,
  252. high: None | _ArrayLikeInt_co = ...,
  253. size: None | _ShapeLike = ...,
  254. dtype: dtype[int32] | type[int32] | _Int32Codes | _SupportsDType[dtype[int32]] = ...,
  255. ) -> NDArray[int32]: ...
  256. @overload
  257. def randint( # type: ignore[misc]
  258. self,
  259. low: _ArrayLikeInt_co,
  260. high: None | _ArrayLikeInt_co = ...,
  261. size: None | _ShapeLike = ...,
  262. dtype: None | dtype[int64] | type[int64] | _Int64Codes | _SupportsDType[dtype[int64]] = ...,
  263. ) -> NDArray[int64]: ...
  264. @overload
  265. def randint( # type: ignore[misc]
  266. self,
  267. low: _ArrayLikeInt_co,
  268. high: None | _ArrayLikeInt_co = ...,
  269. size: None | _ShapeLike = ...,
  270. dtype: dtype[uint8] | type[uint8] | _UInt8Codes | _SupportsDType[dtype[uint8]] = ...,
  271. ) -> NDArray[uint8]: ...
  272. @overload
  273. def randint( # type: ignore[misc]
  274. self,
  275. low: _ArrayLikeInt_co,
  276. high: None | _ArrayLikeInt_co = ...,
  277. size: None | _ShapeLike = ...,
  278. dtype: dtype[uint16] | type[uint16] | _UInt16Codes | _SupportsDType[dtype[uint16]] = ...,
  279. ) -> NDArray[uint16]: ...
  280. @overload
  281. def randint( # type: ignore[misc]
  282. self,
  283. low: _ArrayLikeInt_co,
  284. high: None | _ArrayLikeInt_co = ...,
  285. size: None | _ShapeLike = ...,
  286. dtype: dtype[uint32] | type[uint32] | _UInt32Codes | _SupportsDType[dtype[uint32]] = ...,
  287. ) -> NDArray[uint32]: ...
  288. @overload
  289. def randint( # type: ignore[misc]
  290. self,
  291. low: _ArrayLikeInt_co,
  292. high: None | _ArrayLikeInt_co = ...,
  293. size: None | _ShapeLike = ...,
  294. dtype: dtype[uint64] | type[uint64] | _UInt64Codes | _SupportsDType[dtype[uint64]] = ...,
  295. ) -> NDArray[uint64]: ...
  296. @overload
  297. def randint( # type: ignore[misc]
  298. self,
  299. low: _ArrayLikeInt_co,
  300. high: None | _ArrayLikeInt_co = ...,
  301. size: None | _ShapeLike = ...,
  302. dtype: dtype[long] | type[int] | type[long] | _LongCodes | _SupportsDType[dtype[long]] = ...,
  303. ) -> NDArray[long]: ...
  304. @overload
  305. def randint( # type: ignore[misc]
  306. self,
  307. low: _ArrayLikeInt_co,
  308. high: None | _ArrayLikeInt_co = ...,
  309. size: None | _ShapeLike = ...,
  310. dtype: dtype[ulong] | type[ulong] | _ULongCodes | _SupportsDType[dtype[ulong]] = ...,
  311. ) -> NDArray[ulong]: ...
  312. def bytes(self, length: int) -> builtins.bytes: ...
  313. @overload
  314. def choice(
  315. self,
  316. a: int,
  317. size: None = ...,
  318. replace: bool = ...,
  319. p: None | _ArrayLikeFloat_co = ...,
  320. ) -> int: ...
  321. @overload
  322. def choice(
  323. self,
  324. a: int,
  325. size: _ShapeLike = ...,
  326. replace: bool = ...,
  327. p: None | _ArrayLikeFloat_co = ...,
  328. ) -> NDArray[long]: ...
  329. @overload
  330. def choice(
  331. self,
  332. a: ArrayLike,
  333. size: None = ...,
  334. replace: bool = ...,
  335. p: None | _ArrayLikeFloat_co = ...,
  336. ) -> Any: ...
  337. @overload
  338. def choice(
  339. self,
  340. a: ArrayLike,
  341. size: _ShapeLike = ...,
  342. replace: bool = ...,
  343. p: None | _ArrayLikeFloat_co = ...,
  344. ) -> NDArray[Any]: ...
  345. @overload
  346. def uniform(self, low: float = ..., high: float = ..., size: None = ...) -> float: ... # type: ignore[misc]
  347. @overload
  348. def uniform(
  349. self,
  350. low: _ArrayLikeFloat_co = ...,
  351. high: _ArrayLikeFloat_co = ...,
  352. size: None | _ShapeLike = ...,
  353. ) -> NDArray[float64]: ...
  354. @overload
  355. def rand(self) -> float: ...
  356. @overload
  357. def rand(self, *args: int) -> NDArray[float64]: ...
  358. @overload
  359. def randn(self) -> float: ...
  360. @overload
  361. def randn(self, *args: int) -> NDArray[float64]: ...
  362. @overload
  363. def random_integers(self, low: int, high: None | int = ..., size: None = ...) -> int: ... # type: ignore[misc]
  364. @overload
  365. def random_integers(
  366. self,
  367. low: _ArrayLikeInt_co,
  368. high: None | _ArrayLikeInt_co = ...,
  369. size: None | _ShapeLike = ...,
  370. ) -> NDArray[long]: ...
  371. @overload
  372. def standard_normal(self, size: None = ...) -> float: ... # type: ignore[misc]
  373. @overload
  374. def standard_normal( # type: ignore[misc]
  375. self, size: _ShapeLike = ...
  376. ) -> NDArray[float64]: ...
  377. @overload
  378. def normal(self, loc: float = ..., scale: float = ..., size: None = ...) -> float: ... # type: ignore[misc]
  379. @overload
  380. def normal(
  381. self,
  382. loc: _ArrayLikeFloat_co = ...,
  383. scale: _ArrayLikeFloat_co = ...,
  384. size: None | _ShapeLike = ...,
  385. ) -> NDArray[float64]: ...
  386. @overload
  387. def standard_gamma( # type: ignore[misc]
  388. self,
  389. shape: float,
  390. size: None = ...,
  391. ) -> float: ...
  392. @overload
  393. def standard_gamma(
  394. self,
  395. shape: _ArrayLikeFloat_co,
  396. size: None | _ShapeLike = ...,
  397. ) -> NDArray[float64]: ...
  398. @overload
  399. def gamma(self, shape: float, scale: float = ..., size: None = ...) -> float: ... # type: ignore[misc]
  400. @overload
  401. def gamma(
  402. self,
  403. shape: _ArrayLikeFloat_co,
  404. scale: _ArrayLikeFloat_co = ...,
  405. size: None | _ShapeLike = ...,
  406. ) -> NDArray[float64]: ...
  407. @overload
  408. def f(self, dfnum: float, dfden: float, size: None = ...) -> float: ... # type: ignore[misc]
  409. @overload
  410. def f(
  411. self, dfnum: _ArrayLikeFloat_co, dfden: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  412. ) -> NDArray[float64]: ...
  413. @overload
  414. def noncentral_f(self, dfnum: float, dfden: float, nonc: float, size: None = ...) -> float: ... # type: ignore[misc]
  415. @overload
  416. def noncentral_f(
  417. self,
  418. dfnum: _ArrayLikeFloat_co,
  419. dfden: _ArrayLikeFloat_co,
  420. nonc: _ArrayLikeFloat_co,
  421. size: None | _ShapeLike = ...,
  422. ) -> NDArray[float64]: ...
  423. @overload
  424. def chisquare(self, df: float, size: None = ...) -> float: ... # type: ignore[misc]
  425. @overload
  426. def chisquare(
  427. self, df: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  428. ) -> NDArray[float64]: ...
  429. @overload
  430. def noncentral_chisquare(self, df: float, nonc: float, size: None = ...) -> float: ... # type: ignore[misc]
  431. @overload
  432. def noncentral_chisquare(
  433. self, df: _ArrayLikeFloat_co, nonc: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  434. ) -> NDArray[float64]: ...
  435. @overload
  436. def standard_t(self, df: float, size: None = ...) -> float: ... # type: ignore[misc]
  437. @overload
  438. def standard_t(
  439. self, df: _ArrayLikeFloat_co, size: None = ...
  440. ) -> NDArray[float64]: ...
  441. @overload
  442. def standard_t(
  443. self, df: _ArrayLikeFloat_co, size: _ShapeLike = ...
  444. ) -> NDArray[float64]: ...
  445. @overload
  446. def vonmises(self, mu: float, kappa: float, size: None = ...) -> float: ... # type: ignore[misc]
  447. @overload
  448. def vonmises(
  449. self, mu: _ArrayLikeFloat_co, kappa: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  450. ) -> NDArray[float64]: ...
  451. @overload
  452. def pareto(self, a: float, size: None = ...) -> float: ... # type: ignore[misc]
  453. @overload
  454. def pareto(
  455. self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  456. ) -> NDArray[float64]: ...
  457. @overload
  458. def weibull(self, a: float, size: None = ...) -> float: ... # type: ignore[misc]
  459. @overload
  460. def weibull(
  461. self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  462. ) -> NDArray[float64]: ...
  463. @overload
  464. def power(self, a: float, size: None = ...) -> float: ... # type: ignore[misc]
  465. @overload
  466. def power(
  467. self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  468. ) -> NDArray[float64]: ...
  469. @overload
  470. def standard_cauchy(self, size: None = ...) -> float: ... # type: ignore[misc]
  471. @overload
  472. def standard_cauchy(self, size: _ShapeLike = ...) -> NDArray[float64]: ...
  473. @overload
  474. def laplace(self, loc: float = ..., scale: float = ..., size: None = ...) -> float: ... # type: ignore[misc]
  475. @overload
  476. def laplace(
  477. self,
  478. loc: _ArrayLikeFloat_co = ...,
  479. scale: _ArrayLikeFloat_co = ...,
  480. size: None | _ShapeLike = ...,
  481. ) -> NDArray[float64]: ...
  482. @overload
  483. def gumbel(self, loc: float = ..., scale: float = ..., size: None = ...) -> float: ... # type: ignore[misc]
  484. @overload
  485. def gumbel(
  486. self,
  487. loc: _ArrayLikeFloat_co = ...,
  488. scale: _ArrayLikeFloat_co = ...,
  489. size: None | _ShapeLike = ...,
  490. ) -> NDArray[float64]: ...
  491. @overload
  492. def logistic(self, loc: float = ..., scale: float = ..., size: None = ...) -> float: ... # type: ignore[misc]
  493. @overload
  494. def logistic(
  495. self,
  496. loc: _ArrayLikeFloat_co = ...,
  497. scale: _ArrayLikeFloat_co = ...,
  498. size: None | _ShapeLike = ...,
  499. ) -> NDArray[float64]: ...
  500. @overload
  501. def lognormal(self, mean: float = ..., sigma: float = ..., size: None = ...) -> float: ... # type: ignore[misc]
  502. @overload
  503. def lognormal(
  504. self,
  505. mean: _ArrayLikeFloat_co = ...,
  506. sigma: _ArrayLikeFloat_co = ...,
  507. size: None | _ShapeLike = ...,
  508. ) -> NDArray[float64]: ...
  509. @overload
  510. def rayleigh(self, scale: float = ..., size: None = ...) -> float: ... # type: ignore[misc]
  511. @overload
  512. def rayleigh(
  513. self, scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...
  514. ) -> NDArray[float64]: ...
  515. @overload
  516. def wald(self, mean: float, scale: float, size: None = ...) -> float: ... # type: ignore[misc]
  517. @overload
  518. def wald(
  519. self, mean: _ArrayLikeFloat_co, scale: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  520. ) -> NDArray[float64]: ...
  521. @overload
  522. def triangular(self, left: float, mode: float, right: float, size: None = ...) -> float: ... # type: ignore[misc]
  523. @overload
  524. def triangular(
  525. self,
  526. left: _ArrayLikeFloat_co,
  527. mode: _ArrayLikeFloat_co,
  528. right: _ArrayLikeFloat_co,
  529. size: None | _ShapeLike = ...,
  530. ) -> NDArray[float64]: ...
  531. @overload
  532. def binomial(self, n: int, p: float, size: None = ...) -> int: ... # type: ignore[misc]
  533. @overload
  534. def binomial(
  535. self, n: _ArrayLikeInt_co, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  536. ) -> NDArray[long]: ...
  537. @overload
  538. def negative_binomial(self, n: float, p: float, size: None = ...) -> int: ... # type: ignore[misc]
  539. @overload
  540. def negative_binomial(
  541. self, n: _ArrayLikeFloat_co, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  542. ) -> NDArray[long]: ...
  543. @overload
  544. def poisson(self, lam: float = ..., size: None = ...) -> int: ... # type: ignore[misc]
  545. @overload
  546. def poisson(
  547. self, lam: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...
  548. ) -> NDArray[long]: ...
  549. @overload
  550. def zipf(self, a: float, size: None = ...) -> int: ... # type: ignore[misc]
  551. @overload
  552. def zipf(
  553. self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  554. ) -> NDArray[long]: ...
  555. @overload
  556. def geometric(self, p: float, size: None = ...) -> int: ... # type: ignore[misc]
  557. @overload
  558. def geometric(
  559. self, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  560. ) -> NDArray[long]: ...
  561. @overload
  562. def hypergeometric(self, ngood: int, nbad: int, nsample: int, size: None = ...) -> int: ... # type: ignore[misc]
  563. @overload
  564. def hypergeometric(
  565. self,
  566. ngood: _ArrayLikeInt_co,
  567. nbad: _ArrayLikeInt_co,
  568. nsample: _ArrayLikeInt_co,
  569. size: None | _ShapeLike = ...,
  570. ) -> NDArray[long]: ...
  571. @overload
  572. def logseries(self, p: float, size: None = ...) -> int: ... # type: ignore[misc]
  573. @overload
  574. def logseries(
  575. self, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  576. ) -> NDArray[long]: ...
  577. def multivariate_normal(
  578. self,
  579. mean: _ArrayLikeFloat_co,
  580. cov: _ArrayLikeFloat_co,
  581. size: None | _ShapeLike = ...,
  582. check_valid: Literal["warn", "raise", "ignore"] = ...,
  583. tol: float = ...,
  584. ) -> NDArray[float64]: ...
  585. def multinomial(
  586. self, n: _ArrayLikeInt_co, pvals: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  587. ) -> NDArray[long]: ...
  588. def dirichlet(
  589. self, alpha: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  590. ) -> NDArray[float64]: ...
  591. def shuffle(self, x: ArrayLike) -> None: ...
  592. @overload
  593. def permutation(self, x: int) -> NDArray[long]: ...
  594. @overload
  595. def permutation(self, x: ArrayLike) -> NDArray[Any]: ...
  596. _rand: RandomState
  597. beta = _rand.beta
  598. binomial = _rand.binomial
  599. bytes = _rand.bytes
  600. chisquare = _rand.chisquare
  601. choice = _rand.choice
  602. dirichlet = _rand.dirichlet
  603. exponential = _rand.exponential
  604. f = _rand.f
  605. gamma = _rand.gamma
  606. get_state = _rand.get_state
  607. geometric = _rand.geometric
  608. gumbel = _rand.gumbel
  609. hypergeometric = _rand.hypergeometric
  610. laplace = _rand.laplace
  611. logistic = _rand.logistic
  612. lognormal = _rand.lognormal
  613. logseries = _rand.logseries
  614. multinomial = _rand.multinomial
  615. multivariate_normal = _rand.multivariate_normal
  616. negative_binomial = _rand.negative_binomial
  617. noncentral_chisquare = _rand.noncentral_chisquare
  618. noncentral_f = _rand.noncentral_f
  619. normal = _rand.normal
  620. pareto = _rand.pareto
  621. permutation = _rand.permutation
  622. poisson = _rand.poisson
  623. power = _rand.power
  624. rand = _rand.rand
  625. randint = _rand.randint
  626. randn = _rand.randn
  627. random = _rand.random
  628. random_integers = _rand.random_integers
  629. random_sample = _rand.random_sample
  630. rayleigh = _rand.rayleigh
  631. seed = _rand.seed
  632. set_state = _rand.set_state
  633. shuffle = _rand.shuffle
  634. standard_cauchy = _rand.standard_cauchy
  635. standard_exponential = _rand.standard_exponential
  636. standard_gamma = _rand.standard_gamma
  637. standard_normal = _rand.standard_normal
  638. standard_t = _rand.standard_t
  639. triangular = _rand.triangular
  640. uniform = _rand.uniform
  641. vonmises = _rand.vonmises
  642. wald = _rand.wald
  643. weibull = _rand.weibull
  644. zipf = _rand.zipf
  645. # Two legacy that are trivial wrappers around random_sample
  646. sample = _rand.random_sample
  647. ranf = _rand.random_sample
  648. def set_bit_generator(bitgen: BitGenerator) -> None:
  649. ...
  650. def get_bit_generator() -> BitGenerator:
  651. ...