_generator.pyi 21 KB

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