_generator.pyi 22 KB

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