m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

651 lines
22 KiB

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