mtrand.pyi 22 KB

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