_generator.pyi 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  1. from collections.abc import Callable
  2. from typing import Any, Literal, TypeAlias, TypeVar, overload
  3. import numpy as np
  4. from numpy import dtype, float32, float64, int64
  5. from numpy._typing import (
  6. ArrayLike,
  7. DTypeLike,
  8. NDArray,
  9. _ArrayLikeFloat_co,
  10. _ArrayLikeInt_co,
  11. _BoolCodes,
  12. _DoubleCodes,
  13. _DTypeLike,
  14. _DTypeLikeBool,
  15. _Float32Codes,
  16. _Float64Codes,
  17. _FloatLike_co,
  18. _Int8Codes,
  19. _Int16Codes,
  20. _Int32Codes,
  21. _Int64Codes,
  22. _IntPCodes,
  23. _ShapeLike,
  24. _SingleCodes,
  25. _SupportsDType,
  26. _UInt8Codes,
  27. _UInt16Codes,
  28. _UInt32Codes,
  29. _UInt64Codes,
  30. _UIntPCodes,
  31. )
  32. from numpy.random import BitGenerator, RandomState, SeedSequence
  33. _IntegerT = TypeVar("_IntegerT", bound=np.integer)
  34. _DTypeLikeFloat32: TypeAlias = (
  35. dtype[float32]
  36. | _SupportsDType[dtype[float32]]
  37. | type[float32]
  38. | _Float32Codes
  39. | _SingleCodes
  40. )
  41. _DTypeLikeFloat64: TypeAlias = (
  42. dtype[float64]
  43. | _SupportsDType[dtype[float64]]
  44. | type[float]
  45. | type[float64]
  46. | _Float64Codes
  47. | _DoubleCodes
  48. )
  49. class Generator:
  50. def __init__(self, bit_generator: BitGenerator) -> None: ...
  51. def __repr__(self) -> str: ...
  52. def __str__(self) -> str: ...
  53. def __getstate__(self) -> None: ...
  54. def __setstate__(self, state: dict[str, Any] | None) -> None: ...
  55. def __reduce__(self) -> tuple[
  56. Callable[[BitGenerator], Generator],
  57. tuple[BitGenerator],
  58. None]: ...
  59. @property
  60. def bit_generator(self) -> BitGenerator: ...
  61. def spawn(self, n_children: int) -> list[Generator]: ...
  62. def bytes(self, length: int) -> bytes: ...
  63. @overload
  64. def standard_normal( # type: ignore[misc]
  65. self,
  66. size: None = ...,
  67. dtype: _DTypeLikeFloat32 | _DTypeLikeFloat64 = ...,
  68. out: None = ...,
  69. ) -> float: ...
  70. @overload
  71. def standard_normal( # type: ignore[misc]
  72. self,
  73. size: _ShapeLike = ...,
  74. ) -> NDArray[float64]: ...
  75. @overload
  76. def standard_normal( # type: ignore[misc]
  77. self,
  78. *,
  79. out: NDArray[float64] = ...,
  80. ) -> NDArray[float64]: ...
  81. @overload
  82. def standard_normal( # type: ignore[misc]
  83. self,
  84. size: _ShapeLike = ...,
  85. dtype: _DTypeLikeFloat32 = ...,
  86. out: None | NDArray[float32] = ...,
  87. ) -> NDArray[float32]: ...
  88. @overload
  89. def standard_normal( # type: ignore[misc]
  90. self,
  91. size: _ShapeLike = ...,
  92. dtype: _DTypeLikeFloat64 = ...,
  93. out: None | NDArray[float64] = ...,
  94. ) -> NDArray[float64]: ...
  95. @overload
  96. def permutation(self, x: int, axis: int = ...) -> NDArray[int64]: ...
  97. @overload
  98. def permutation(self, x: ArrayLike, axis: int = ...) -> NDArray[Any]: ...
  99. @overload
  100. def standard_exponential( # type: ignore[misc]
  101. self,
  102. size: None = ...,
  103. dtype: _DTypeLikeFloat32 | _DTypeLikeFloat64 = ...,
  104. method: Literal["zig", "inv"] = ...,
  105. out: None = ...,
  106. ) -> float: ...
  107. @overload
  108. def standard_exponential(
  109. self,
  110. size: _ShapeLike = ...,
  111. ) -> NDArray[float64]: ...
  112. @overload
  113. def standard_exponential(
  114. self,
  115. *,
  116. out: NDArray[float64] = ...,
  117. ) -> NDArray[float64]: ...
  118. @overload
  119. def standard_exponential(
  120. self,
  121. size: _ShapeLike = ...,
  122. *,
  123. method: Literal["zig", "inv"] = ...,
  124. out: None | NDArray[float64] = ...,
  125. ) -> NDArray[float64]: ...
  126. @overload
  127. def standard_exponential(
  128. self,
  129. size: _ShapeLike = ...,
  130. dtype: _DTypeLikeFloat32 = ...,
  131. method: Literal["zig", "inv"] = ...,
  132. out: None | NDArray[float32] = ...,
  133. ) -> NDArray[float32]: ...
  134. @overload
  135. def standard_exponential(
  136. self,
  137. size: _ShapeLike = ...,
  138. dtype: _DTypeLikeFloat64 = ...,
  139. method: Literal["zig", "inv"] = ...,
  140. out: None | NDArray[float64] = ...,
  141. ) -> NDArray[float64]: ...
  142. @overload
  143. def random( # type: ignore[misc]
  144. self,
  145. size: None = ...,
  146. dtype: _DTypeLikeFloat32 | _DTypeLikeFloat64 = ...,
  147. out: None = ...,
  148. ) -> float: ...
  149. @overload
  150. def random(
  151. self,
  152. *,
  153. out: NDArray[float64] = ...,
  154. ) -> NDArray[float64]: ...
  155. @overload
  156. def random(
  157. self,
  158. size: _ShapeLike = ...,
  159. *,
  160. out: None | NDArray[float64] = ...,
  161. ) -> NDArray[float64]: ...
  162. @overload
  163. def random(
  164. self,
  165. size: _ShapeLike = ...,
  166. dtype: _DTypeLikeFloat32 = ...,
  167. out: None | NDArray[float32] = ...,
  168. ) -> NDArray[float32]: ...
  169. @overload
  170. def random(
  171. self,
  172. size: _ShapeLike = ...,
  173. dtype: _DTypeLikeFloat64 = ...,
  174. out: None | NDArray[float64] = ...,
  175. ) -> NDArray[float64]: ...
  176. @overload
  177. def beta(
  178. self,
  179. a: _FloatLike_co,
  180. b: _FloatLike_co,
  181. size: None = ...,
  182. ) -> float: ... # type: ignore[misc]
  183. @overload
  184. def beta(
  185. self,
  186. a: _ArrayLikeFloat_co,
  187. b: _ArrayLikeFloat_co,
  188. size: None | _ShapeLike = ...
  189. ) -> NDArray[float64]: ...
  190. @overload
  191. def exponential(self, scale: _FloatLike_co = ..., size: None = ...) -> float: ... # type: ignore[misc]
  192. @overload
  193. def exponential(self, scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> NDArray[float64]: ...
  194. #
  195. @overload
  196. def integers(
  197. self,
  198. low: int,
  199. high: int | None = None,
  200. size: None = None,
  201. dtype: _DTypeLike[np.int64] | _Int64Codes = ...,
  202. endpoint: bool = False,
  203. ) -> np.int64: ...
  204. @overload
  205. def integers(
  206. self,
  207. low: int,
  208. high: int | None = None,
  209. size: None = None,
  210. *,
  211. dtype: type[bool],
  212. endpoint: bool = False,
  213. ) -> bool: ...
  214. @overload
  215. def integers(
  216. self,
  217. low: int,
  218. high: int | None = None,
  219. size: None = None,
  220. *,
  221. dtype: type[int],
  222. endpoint: bool = False,
  223. ) -> int: ...
  224. @overload
  225. def integers(
  226. self,
  227. low: int,
  228. high: int | None = None,
  229. size: None = None,
  230. *,
  231. dtype: _DTypeLike[np.bool] | _BoolCodes,
  232. endpoint: bool = False,
  233. ) -> np.bool: ...
  234. @overload
  235. def integers(
  236. self,
  237. low: int,
  238. high: int | None = None,
  239. size: None = None,
  240. *,
  241. dtype: _DTypeLike[_IntegerT],
  242. endpoint: bool = False,
  243. ) -> _IntegerT: ...
  244. @overload
  245. def integers(
  246. self,
  247. low: _ArrayLikeInt_co,
  248. high: _ArrayLikeInt_co | None = None,
  249. size: _ShapeLike | None = None,
  250. dtype: _DTypeLike[np.int64] | _Int64Codes = ...,
  251. endpoint: bool = False,
  252. ) -> NDArray[np.int64]: ...
  253. @overload
  254. def integers(
  255. self,
  256. low: _ArrayLikeInt_co,
  257. high: _ArrayLikeInt_co | None = None,
  258. size: _ShapeLike | None = None,
  259. *,
  260. dtype: _DTypeLikeBool,
  261. endpoint: bool = False,
  262. ) -> NDArray[np.bool]: ...
  263. @overload
  264. def integers(
  265. self,
  266. low: _ArrayLikeInt_co,
  267. high: _ArrayLikeInt_co | None = None,
  268. size: _ShapeLike | None = None,
  269. *,
  270. dtype: _DTypeLike[_IntegerT],
  271. endpoint: bool = False,
  272. ) -> NDArray[_IntegerT]: ...
  273. @overload
  274. def integers(
  275. self,
  276. low: int,
  277. high: int | None = None,
  278. size: None = None,
  279. *,
  280. dtype: _Int8Codes,
  281. endpoint: bool = False,
  282. ) -> np.int8: ...
  283. @overload
  284. def integers(
  285. self,
  286. low: _ArrayLikeInt_co,
  287. high: _ArrayLikeInt_co | None = None,
  288. size: _ShapeLike | None = None,
  289. *,
  290. dtype: _Int8Codes,
  291. endpoint: bool = False,
  292. ) -> NDArray[np.int8]: ...
  293. @overload
  294. def integers(
  295. self,
  296. low: int,
  297. high: int | None = None,
  298. size: None = None,
  299. *,
  300. dtype: _UInt8Codes,
  301. endpoint: bool = False,
  302. ) -> np.uint8: ...
  303. @overload
  304. def integers(
  305. self,
  306. low: _ArrayLikeInt_co,
  307. high: _ArrayLikeInt_co | None = None,
  308. size: _ShapeLike | None = None,
  309. *,
  310. dtype: _UInt8Codes,
  311. endpoint: bool = False,
  312. ) -> NDArray[np.uint8]: ...
  313. @overload
  314. def integers(
  315. self,
  316. low: int,
  317. high: int | None = None,
  318. size: None = None,
  319. *,
  320. dtype: _Int16Codes,
  321. endpoint: bool = False,
  322. ) -> np.int16: ...
  323. @overload
  324. def integers(
  325. self,
  326. low: _ArrayLikeInt_co,
  327. high: _ArrayLikeInt_co | None = None,
  328. size: _ShapeLike | None = None,
  329. *,
  330. dtype: _Int16Codes,
  331. endpoint: bool = False,
  332. ) -> NDArray[np.int16]: ...
  333. @overload
  334. def integers(
  335. self,
  336. low: int,
  337. high: int | None = None,
  338. size: None = None,
  339. *,
  340. dtype: _UInt16Codes,
  341. endpoint: bool = False,
  342. ) -> np.uint16: ...
  343. @overload
  344. def integers(
  345. self,
  346. low: _ArrayLikeInt_co,
  347. high: _ArrayLikeInt_co | None = None,
  348. size: _ShapeLike | None = None,
  349. *,
  350. dtype: _UInt16Codes,
  351. endpoint: bool = False,
  352. ) -> NDArray[np.uint16]: ...
  353. @overload
  354. def integers(
  355. self,
  356. low: int,
  357. high: int | None = None,
  358. size: None = None,
  359. *,
  360. dtype: _Int32Codes,
  361. endpoint: bool = False,
  362. ) -> np.int32: ...
  363. @overload
  364. def integers(
  365. self,
  366. low: _ArrayLikeInt_co,
  367. high: _ArrayLikeInt_co | None = None,
  368. size: _ShapeLike | None = None,
  369. *,
  370. dtype: _Int32Codes,
  371. endpoint: bool = False,
  372. ) -> NDArray[np.int32]: ...
  373. @overload
  374. def integers(
  375. self,
  376. low: int,
  377. high: int | None = None,
  378. size: None = None,
  379. *,
  380. dtype: _UInt32Codes,
  381. endpoint: bool = False,
  382. ) -> np.uint32: ...
  383. @overload
  384. def integers(
  385. self,
  386. low: _ArrayLikeInt_co,
  387. high: _ArrayLikeInt_co | None = None,
  388. size: _ShapeLike | None = None,
  389. *,
  390. dtype: _UInt32Codes,
  391. endpoint: bool = False,
  392. ) -> NDArray[np.uint32]: ...
  393. @overload
  394. def integers(
  395. self,
  396. low: int,
  397. high: int | None = None,
  398. size: None = None,
  399. *,
  400. dtype: _UInt64Codes,
  401. endpoint: bool = False,
  402. ) -> np.uint64: ...
  403. @overload
  404. def integers(
  405. self,
  406. low: _ArrayLikeInt_co,
  407. high: _ArrayLikeInt_co | None = None,
  408. size: _ShapeLike | None = None,
  409. *,
  410. dtype: _UInt64Codes,
  411. endpoint: bool = False,
  412. ) -> NDArray[np.uint64]: ...
  413. @overload
  414. def integers(
  415. self,
  416. low: int,
  417. high: int | None = None,
  418. size: None = None,
  419. *,
  420. dtype: _IntPCodes,
  421. endpoint: bool = False,
  422. ) -> np.intp: ...
  423. @overload
  424. def integers(
  425. self,
  426. low: _ArrayLikeInt_co,
  427. high: _ArrayLikeInt_co | None = None,
  428. size: _ShapeLike | None = None,
  429. *,
  430. dtype: _IntPCodes,
  431. endpoint: bool = False,
  432. ) -> NDArray[np.intp]: ...
  433. @overload
  434. def integers(
  435. self,
  436. low: int,
  437. high: int | None = None,
  438. size: None = None,
  439. *,
  440. dtype: _UIntPCodes,
  441. endpoint: bool = False,
  442. ) -> np.uintp: ...
  443. @overload
  444. def integers(
  445. self,
  446. low: _ArrayLikeInt_co,
  447. high: _ArrayLikeInt_co | None = None,
  448. size: _ShapeLike | None = None,
  449. *,
  450. dtype: _UIntPCodes,
  451. endpoint: bool = False,
  452. ) -> NDArray[np.uintp]: ...
  453. @overload
  454. def integers(
  455. self,
  456. low: int,
  457. high: int | None = None,
  458. size: None = None,
  459. dtype: DTypeLike = ...,
  460. endpoint: bool = False,
  461. ) -> Any: ...
  462. @overload
  463. def integers(
  464. self,
  465. low: _ArrayLikeInt_co,
  466. high: _ArrayLikeInt_co | None = None,
  467. size: _ShapeLike | None = None,
  468. dtype: DTypeLike = ...,
  469. endpoint: bool = False,
  470. ) -> NDArray[Any]: ...
  471. # TODO: Use a TypeVar _T here to get away from Any output?
  472. # Should be int->NDArray[int64], ArrayLike[_T] -> _T | NDArray[Any]
  473. @overload
  474. def choice(
  475. self,
  476. a: int,
  477. size: None = ...,
  478. replace: bool = ...,
  479. p: None | _ArrayLikeFloat_co = ...,
  480. axis: int = ...,
  481. shuffle: bool = ...,
  482. ) -> int: ...
  483. @overload
  484. def choice(
  485. self,
  486. a: int,
  487. size: _ShapeLike = ...,
  488. replace: bool = ...,
  489. p: None | _ArrayLikeFloat_co = ...,
  490. axis: int = ...,
  491. shuffle: bool = ...,
  492. ) -> NDArray[int64]: ...
  493. @overload
  494. def choice(
  495. self,
  496. a: ArrayLike,
  497. size: None = ...,
  498. replace: bool = ...,
  499. p: None | _ArrayLikeFloat_co = ...,
  500. axis: int = ...,
  501. shuffle: bool = ...,
  502. ) -> Any: ...
  503. @overload
  504. def choice(
  505. self,
  506. a: ArrayLike,
  507. size: _ShapeLike = ...,
  508. replace: bool = ...,
  509. p: None | _ArrayLikeFloat_co = ...,
  510. axis: int = ...,
  511. shuffle: bool = ...,
  512. ) -> NDArray[Any]: ...
  513. @overload
  514. def uniform(
  515. self,
  516. low: _FloatLike_co = ...,
  517. high: _FloatLike_co = ...,
  518. size: None = ...,
  519. ) -> float: ... # type: ignore[misc]
  520. @overload
  521. def uniform(
  522. self,
  523. low: _ArrayLikeFloat_co = ...,
  524. high: _ArrayLikeFloat_co = ...,
  525. size: None | _ShapeLike = ...,
  526. ) -> NDArray[float64]: ...
  527. @overload
  528. def normal(
  529. self,
  530. loc: _FloatLike_co = ...,
  531. scale: _FloatLike_co = ...,
  532. size: None = ...,
  533. ) -> float: ... # type: ignore[misc]
  534. @overload
  535. def normal(
  536. self,
  537. loc: _ArrayLikeFloat_co = ...,
  538. scale: _ArrayLikeFloat_co = ...,
  539. size: None | _ShapeLike = ...,
  540. ) -> NDArray[float64]: ...
  541. @overload
  542. def standard_gamma( # type: ignore[misc]
  543. self,
  544. shape: _FloatLike_co,
  545. size: None = ...,
  546. dtype: _DTypeLikeFloat32 | _DTypeLikeFloat64 = ...,
  547. out: None = ...,
  548. ) -> float: ...
  549. @overload
  550. def standard_gamma(
  551. self,
  552. shape: _ArrayLikeFloat_co,
  553. size: None | _ShapeLike = ...,
  554. ) -> NDArray[float64]: ...
  555. @overload
  556. def standard_gamma(
  557. self,
  558. shape: _ArrayLikeFloat_co,
  559. *,
  560. out: NDArray[float64] = ...,
  561. ) -> NDArray[float64]: ...
  562. @overload
  563. def standard_gamma(
  564. self,
  565. shape: _ArrayLikeFloat_co,
  566. size: None | _ShapeLike = ...,
  567. dtype: _DTypeLikeFloat32 = ...,
  568. out: None | NDArray[float32] = ...,
  569. ) -> NDArray[float32]: ...
  570. @overload
  571. def standard_gamma(
  572. self,
  573. shape: _ArrayLikeFloat_co,
  574. size: None | _ShapeLike = ...,
  575. dtype: _DTypeLikeFloat64 = ...,
  576. out: None | NDArray[float64] = ...,
  577. ) -> NDArray[float64]: ...
  578. @overload
  579. def gamma(
  580. self, shape: _FloatLike_co, scale: _FloatLike_co = ..., size: None = ...
  581. ) -> float: ... # type: ignore[misc]
  582. @overload
  583. def gamma(
  584. self,
  585. shape: _ArrayLikeFloat_co,
  586. scale: _ArrayLikeFloat_co = ...,
  587. size: None | _ShapeLike = ...,
  588. ) -> NDArray[float64]: ...
  589. @overload
  590. def f(
  591. self, dfnum: _FloatLike_co, dfden: _FloatLike_co, size: None = ...
  592. ) -> float: ... # type: ignore[misc]
  593. @overload
  594. def f(
  595. self,
  596. dfnum: _ArrayLikeFloat_co,
  597. dfden: _ArrayLikeFloat_co,
  598. size: None | _ShapeLike = ...
  599. ) -> NDArray[float64]: ...
  600. @overload
  601. def noncentral_f(
  602. self,
  603. dfnum: _FloatLike_co,
  604. dfden: _FloatLike_co,
  605. nonc: _FloatLike_co, size: None = ...
  606. ) -> float: ... # type: ignore[misc]
  607. @overload
  608. def noncentral_f(
  609. self,
  610. dfnum: _ArrayLikeFloat_co,
  611. dfden: _ArrayLikeFloat_co,
  612. nonc: _ArrayLikeFloat_co,
  613. size: None | _ShapeLike = ...,
  614. ) -> NDArray[float64]: ...
  615. @overload
  616. def chisquare(self, df: _FloatLike_co, size: None = ...) -> float: ... # type: ignore[misc]
  617. @overload
  618. def chisquare(
  619. self, df: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  620. ) -> NDArray[float64]: ...
  621. @overload
  622. def noncentral_chisquare(
  623. self, df: _FloatLike_co, nonc: _FloatLike_co, size: None = ...
  624. ) -> float: ... # type: ignore[misc]
  625. @overload
  626. def noncentral_chisquare(
  627. self,
  628. df: _ArrayLikeFloat_co,
  629. nonc: _ArrayLikeFloat_co,
  630. size: None | _ShapeLike = ...
  631. ) -> NDArray[float64]: ...
  632. @overload
  633. def standard_t(self, df: _FloatLike_co, size: None = ...) -> float: ... # type: ignore[misc]
  634. @overload
  635. def standard_t(
  636. self, df: _ArrayLikeFloat_co, size: None = ...
  637. ) -> NDArray[float64]: ...
  638. @overload
  639. def standard_t(
  640. self, df: _ArrayLikeFloat_co, size: _ShapeLike = ...
  641. ) -> NDArray[float64]: ...
  642. @overload
  643. def vonmises(
  644. self, mu: _FloatLike_co, kappa: _FloatLike_co, size: None = ...
  645. ) -> float: ... # type: ignore[misc]
  646. @overload
  647. def vonmises(
  648. self,
  649. mu: _ArrayLikeFloat_co,
  650. kappa: _ArrayLikeFloat_co,
  651. size: None | _ShapeLike = ...
  652. ) -> NDArray[float64]: ...
  653. @overload
  654. def pareto(self, a: _FloatLike_co, size: None = ...) -> float: ... # type: ignore[misc]
  655. @overload
  656. def pareto(
  657. self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  658. ) -> NDArray[float64]: ...
  659. @overload
  660. def weibull(self, a: _FloatLike_co, size: None = ...) -> float: ... # type: ignore[misc]
  661. @overload
  662. def weibull(
  663. self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  664. ) -> NDArray[float64]: ...
  665. @overload
  666. def power(self, a: _FloatLike_co, size: None = ...) -> float: ... # type: ignore[misc]
  667. @overload
  668. def power(
  669. self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  670. ) -> NDArray[float64]: ...
  671. @overload
  672. def standard_cauchy(self, size: None = ...) -> float: ... # type: ignore[misc]
  673. @overload
  674. def standard_cauchy(self, size: _ShapeLike = ...) -> NDArray[float64]: ...
  675. @overload
  676. def laplace(
  677. self,
  678. loc: _FloatLike_co = ...,
  679. scale: _FloatLike_co = ...,
  680. size: None = ...,
  681. ) -> float: ... # type: ignore[misc]
  682. @overload
  683. def laplace(
  684. self,
  685. loc: _ArrayLikeFloat_co = ...,
  686. scale: _ArrayLikeFloat_co = ...,
  687. size: None | _ShapeLike = ...,
  688. ) -> NDArray[float64]: ...
  689. @overload
  690. def gumbel(
  691. self,
  692. loc: _FloatLike_co = ...,
  693. scale: _FloatLike_co = ...,
  694. size: None = ...,
  695. ) -> float: ... # type: ignore[misc]
  696. @overload
  697. def gumbel(
  698. self,
  699. loc: _ArrayLikeFloat_co = ...,
  700. scale: _ArrayLikeFloat_co = ...,
  701. size: None | _ShapeLike = ...,
  702. ) -> NDArray[float64]: ...
  703. @overload
  704. def logistic(
  705. self,
  706. loc: _FloatLike_co = ...,
  707. scale: _FloatLike_co = ...,
  708. size: None = ...,
  709. ) -> float: ... # type: ignore[misc]
  710. @overload
  711. def logistic(
  712. self,
  713. loc: _ArrayLikeFloat_co = ...,
  714. scale: _ArrayLikeFloat_co = ...,
  715. size: None | _ShapeLike = ...,
  716. ) -> NDArray[float64]: ...
  717. @overload
  718. def lognormal(
  719. self,
  720. mean: _FloatLike_co = ...,
  721. sigma: _FloatLike_co = ...,
  722. size: None = ...,
  723. ) -> float: ... # type: ignore[misc]
  724. @overload
  725. def lognormal(
  726. self,
  727. mean: _ArrayLikeFloat_co = ...,
  728. sigma: _ArrayLikeFloat_co = ...,
  729. size: None | _ShapeLike = ...,
  730. ) -> NDArray[float64]: ...
  731. @overload
  732. def rayleigh(self, scale: _FloatLike_co = ..., size: None = ...) -> float: ... # type: ignore[misc]
  733. @overload
  734. def rayleigh(
  735. self, scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...
  736. ) -> NDArray[float64]: ...
  737. @overload
  738. def wald(
  739. self, mean: _FloatLike_co, scale: _FloatLike_co, size: None = ...
  740. ) -> float: ... # type: ignore[misc]
  741. @overload
  742. def wald(
  743. self,
  744. mean: _ArrayLikeFloat_co,
  745. scale: _ArrayLikeFloat_co,
  746. size: None | _ShapeLike = ...
  747. ) -> NDArray[float64]: ...
  748. @overload
  749. def triangular(
  750. self,
  751. left: _FloatLike_co,
  752. mode: _FloatLike_co,
  753. right: _FloatLike_co,
  754. size: None = ...,
  755. ) -> float: ... # type: ignore[misc]
  756. @overload
  757. def triangular(
  758. self,
  759. left: _ArrayLikeFloat_co,
  760. mode: _ArrayLikeFloat_co,
  761. right: _ArrayLikeFloat_co,
  762. size: None | _ShapeLike = ...,
  763. ) -> NDArray[float64]: ...
  764. @overload
  765. def binomial(self, n: int, p: _FloatLike_co, size: None = ...) -> int: ... # type: ignore[misc]
  766. @overload
  767. def binomial(
  768. self, n: _ArrayLikeInt_co, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  769. ) -> NDArray[int64]: ...
  770. @overload
  771. def negative_binomial(
  772. self, n: _FloatLike_co, p: _FloatLike_co, size: None = ...
  773. ) -> int: ... # type: ignore[misc]
  774. @overload
  775. def negative_binomial(
  776. self,
  777. n: _ArrayLikeFloat_co,
  778. p: _ArrayLikeFloat_co,
  779. size: None | _ShapeLike = ...
  780. ) -> NDArray[int64]: ...
  781. @overload
  782. def poisson(self, lam: _FloatLike_co = ..., size: None = ...) -> int: ... # type: ignore[misc]
  783. @overload
  784. def poisson(
  785. self, lam: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...
  786. ) -> NDArray[int64]: ...
  787. @overload
  788. def zipf(self, a: _FloatLike_co, size: None = ...) -> int: ... # type: ignore[misc]
  789. @overload
  790. def zipf(
  791. self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  792. ) -> NDArray[int64]: ...
  793. @overload
  794. def geometric(self, p: _FloatLike_co, size: None = ...) -> int: ... # type: ignore[misc]
  795. @overload
  796. def geometric(
  797. self, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  798. ) -> NDArray[int64]: ...
  799. @overload
  800. def hypergeometric(
  801. self, ngood: int, nbad: int, nsample: int, size: None = ...
  802. ) -> int: ... # type: ignore[misc]
  803. @overload
  804. def hypergeometric(
  805. self,
  806. ngood: _ArrayLikeInt_co,
  807. nbad: _ArrayLikeInt_co,
  808. nsample: _ArrayLikeInt_co,
  809. size: None | _ShapeLike = ...,
  810. ) -> NDArray[int64]: ...
  811. @overload
  812. def logseries(self, p: _FloatLike_co, size: None = ...) -> int: ... # type: ignore[misc]
  813. @overload
  814. def logseries(
  815. self, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  816. ) -> NDArray[int64]: ...
  817. def multivariate_normal(
  818. self,
  819. mean: _ArrayLikeFloat_co,
  820. cov: _ArrayLikeFloat_co,
  821. size: None | _ShapeLike = ...,
  822. check_valid: Literal["warn", "raise", "ignore"] = ...,
  823. tol: float = ...,
  824. *,
  825. method: Literal["svd", "eigh", "cholesky"] = ...,
  826. ) -> NDArray[float64]: ...
  827. def multinomial(
  828. self, n: _ArrayLikeInt_co,
  829. pvals: _ArrayLikeFloat_co,
  830. size: None | _ShapeLike = ...
  831. ) -> NDArray[int64]: ...
  832. def multivariate_hypergeometric(
  833. self,
  834. colors: _ArrayLikeInt_co,
  835. nsample: int,
  836. size: None | _ShapeLike = ...,
  837. method: Literal["marginals", "count"] = ...,
  838. ) -> NDArray[int64]: ...
  839. def dirichlet(
  840. self, alpha: _ArrayLikeFloat_co, size: None | _ShapeLike = ...
  841. ) -> NDArray[float64]: ...
  842. def permuted(
  843. self, x: ArrayLike, *, axis: None | int = ..., out: None | NDArray[Any] = ...
  844. ) -> NDArray[Any]: ...
  845. def shuffle(self, x: ArrayLike, axis: int = ...) -> None: ...
  846. def default_rng(
  847. seed: None | _ArrayLikeInt_co | SeedSequence | BitGenerator | Generator | RandomState = ...
  848. ) -> Generator: ...