multiarray.pyi 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355
  1. # TODO: Sort out any and all missing functions in this namespace
  2. import datetime as dt
  3. from _typeshed import StrOrBytesPath, SupportsLenAndGetItem
  4. from collections.abc import Sequence, Callable, Iterable
  5. from typing import (
  6. Literal as L,
  7. Any,
  8. TypeAlias,
  9. overload,
  10. TypeVar,
  11. TypedDict,
  12. SupportsIndex,
  13. final,
  14. Final,
  15. Protocol,
  16. ClassVar,
  17. type_check_only,
  18. )
  19. from typing_extensions import CapsuleType, Unpack
  20. import numpy as np
  21. from numpy import ( # type: ignore[attr-defined]
  22. # Re-exports
  23. busdaycalendar,
  24. broadcast,
  25. correlate,
  26. count_nonzero,
  27. dtype,
  28. einsum as c_einsum,
  29. flatiter,
  30. from_dlpack,
  31. interp,
  32. matmul,
  33. ndarray,
  34. nditer,
  35. vecdot,
  36. # The rest
  37. ufunc,
  38. str_,
  39. uint8,
  40. intp,
  41. int_,
  42. float64,
  43. timedelta64,
  44. datetime64,
  45. generic,
  46. unsignedinteger,
  47. signedinteger,
  48. floating,
  49. complexfloating,
  50. _AnyShapeType,
  51. _OrderKACF,
  52. _OrderCF,
  53. _CastingKind,
  54. _ModeKind,
  55. _SupportsBuffer,
  56. _SupportsFileMethods,
  57. _CopyMode,
  58. _NDIterFlagsKind,
  59. _NDIterFlagsOp,
  60. )
  61. from numpy.lib._array_utils_impl import normalize_axis_index
  62. from numpy._typing import (
  63. # Shapes
  64. _ShapeLike,
  65. # DTypes
  66. DTypeLike,
  67. _DTypeLike,
  68. _SupportsDType,
  69. # Arrays
  70. NDArray,
  71. ArrayLike,
  72. _ArrayLike,
  73. _SupportsArrayFunc,
  74. _NestedSequence,
  75. _ArrayLikeBool_co,
  76. _ArrayLikeUInt_co,
  77. _ArrayLikeInt_co,
  78. _ArrayLikeFloat_co,
  79. _ArrayLikeComplex_co,
  80. _ArrayLikeTD64_co,
  81. _ArrayLikeDT64_co,
  82. _ArrayLikeObject_co,
  83. _ArrayLikeStr_co,
  84. _ArrayLikeBytes_co,
  85. _ScalarLike_co,
  86. _IntLike_co,
  87. _FloatLike_co,
  88. _TD64Like_co,
  89. )
  90. from numpy._typing._ufunc import (
  91. _2PTuple,
  92. _PyFunc_Nin1_Nout1,
  93. _PyFunc_Nin2_Nout1,
  94. _PyFunc_Nin3P_Nout1,
  95. _PyFunc_Nin1P_Nout2P,
  96. )
  97. __all__ = [
  98. "_ARRAY_API",
  99. "ALLOW_THREADS",
  100. "BUFSIZE",
  101. "CLIP",
  102. "DATETIMEUNITS",
  103. "ITEM_HASOBJECT",
  104. "ITEM_IS_POINTER",
  105. "LIST_PICKLE",
  106. "MAXDIMS",
  107. "MAY_SHARE_BOUNDS",
  108. "MAY_SHARE_EXACT",
  109. "NEEDS_INIT",
  110. "NEEDS_PYAPI",
  111. "RAISE",
  112. "USE_GETITEM",
  113. "USE_SETITEM",
  114. "WRAP",
  115. "_flagdict",
  116. "from_dlpack",
  117. "_place",
  118. "_reconstruct",
  119. "_vec_string",
  120. "_monotonicity",
  121. "add_docstring",
  122. "arange",
  123. "array",
  124. "asarray",
  125. "asanyarray",
  126. "ascontiguousarray",
  127. "asfortranarray",
  128. "bincount",
  129. "broadcast",
  130. "busday_count",
  131. "busday_offset",
  132. "busdaycalendar",
  133. "can_cast",
  134. "compare_chararrays",
  135. "concatenate",
  136. "copyto",
  137. "correlate",
  138. "correlate2",
  139. "count_nonzero",
  140. "c_einsum",
  141. "datetime_as_string",
  142. "datetime_data",
  143. "dot",
  144. "dragon4_positional",
  145. "dragon4_scientific",
  146. "dtype",
  147. "empty",
  148. "empty_like",
  149. "error",
  150. "flagsobj",
  151. "flatiter",
  152. "format_longfloat",
  153. "frombuffer",
  154. "fromfile",
  155. "fromiter",
  156. "fromstring",
  157. "get_handler_name",
  158. "get_handler_version",
  159. "inner",
  160. "interp",
  161. "interp_complex",
  162. "is_busday",
  163. "lexsort",
  164. "matmul",
  165. "vecdot",
  166. "may_share_memory",
  167. "min_scalar_type",
  168. "ndarray",
  169. "nditer",
  170. "nested_iters",
  171. "normalize_axis_index",
  172. "packbits",
  173. "promote_types",
  174. "putmask",
  175. "ravel_multi_index",
  176. "result_type",
  177. "scalar",
  178. "set_datetimeparse_function",
  179. "set_typeDict",
  180. "shares_memory",
  181. "typeinfo",
  182. "unpackbits",
  183. "unravel_index",
  184. "vdot",
  185. "where",
  186. "zeros",
  187. ]
  188. _SCT = TypeVar("_SCT", bound=generic)
  189. _DType = TypeVar("_DType", bound=np.dtype[Any])
  190. _ArrayType = TypeVar("_ArrayType", bound=ndarray[Any, Any])
  191. _ArrayType_co = TypeVar(
  192. "_ArrayType_co",
  193. bound=ndarray[Any, Any],
  194. covariant=True,
  195. )
  196. _ReturnType = TypeVar("_ReturnType")
  197. _IDType = TypeVar("_IDType")
  198. _Nin = TypeVar("_Nin", bound=int)
  199. _Nout = TypeVar("_Nout", bound=int)
  200. _ShapeT = TypeVar("_ShapeT", bound=tuple[int, ...])
  201. _Array: TypeAlias = ndarray[_ShapeT, dtype[_SCT]]
  202. _Array1D: TypeAlias = ndarray[tuple[int], dtype[_SCT]]
  203. # Valid time units
  204. _UnitKind: TypeAlias = L[
  205. "Y",
  206. "M",
  207. "D",
  208. "h",
  209. "m",
  210. "s",
  211. "ms",
  212. "us", "μs",
  213. "ns",
  214. "ps",
  215. "fs",
  216. "as",
  217. ]
  218. _RollKind: TypeAlias = L[ # `raise` is deliberately excluded
  219. "nat",
  220. "forward",
  221. "following",
  222. "backward",
  223. "preceding",
  224. "modifiedfollowing",
  225. "modifiedpreceding",
  226. ]
  227. @type_check_only
  228. class _SupportsArray(Protocol[_ArrayType_co]):
  229. def __array__(self, /) -> _ArrayType_co: ...
  230. @type_check_only
  231. class _KwargsEmpty(TypedDict, total=False):
  232. device: None | L["cpu"]
  233. like: None | _SupportsArrayFunc
  234. @type_check_only
  235. class _ConstructorEmpty(Protocol):
  236. # 1-D shape
  237. @overload
  238. def __call__(
  239. self,
  240. /,
  241. shape: SupportsIndex,
  242. dtype: None = ...,
  243. order: _OrderCF = ...,
  244. **kwargs: Unpack[_KwargsEmpty],
  245. ) -> _Array1D[float64]: ...
  246. @overload
  247. def __call__(
  248. self,
  249. /,
  250. shape: SupportsIndex,
  251. dtype: _DType | _SupportsDType[_DType],
  252. order: _OrderCF = ...,
  253. **kwargs: Unpack[_KwargsEmpty],
  254. ) -> ndarray[tuple[int], _DType]: ...
  255. @overload
  256. def __call__(
  257. self,
  258. /,
  259. shape: SupportsIndex,
  260. dtype: type[_SCT],
  261. order: _OrderCF = ...,
  262. **kwargs: Unpack[_KwargsEmpty],
  263. ) -> _Array1D[_SCT]: ...
  264. @overload
  265. def __call__(
  266. self,
  267. /,
  268. shape: SupportsIndex,
  269. dtype: DTypeLike,
  270. order: _OrderCF = ...,
  271. **kwargs: Unpack[_KwargsEmpty],
  272. ) -> _Array1D[Any]: ...
  273. # known shape
  274. @overload
  275. def __call__(
  276. self,
  277. /,
  278. shape: _AnyShapeType,
  279. dtype: None = ...,
  280. order: _OrderCF = ...,
  281. **kwargs: Unpack[_KwargsEmpty],
  282. ) -> _Array[_AnyShapeType, float64]: ...
  283. @overload
  284. def __call__(
  285. self,
  286. /,
  287. shape: _AnyShapeType,
  288. dtype: _DType | _SupportsDType[_DType],
  289. order: _OrderCF = ...,
  290. **kwargs: Unpack[_KwargsEmpty],
  291. ) -> ndarray[_AnyShapeType, _DType]: ...
  292. @overload
  293. def __call__(
  294. self,
  295. /,
  296. shape: _AnyShapeType,
  297. dtype: type[_SCT],
  298. order: _OrderCF = ...,
  299. **kwargs: Unpack[_KwargsEmpty],
  300. ) -> _Array[_AnyShapeType, _SCT]: ...
  301. @overload
  302. def __call__(
  303. self,
  304. /,
  305. shape: _AnyShapeType,
  306. dtype: DTypeLike,
  307. order: _OrderCF = ...,
  308. **kwargs: Unpack[_KwargsEmpty],
  309. ) -> _Array[_AnyShapeType, Any]: ...
  310. # unknown shape
  311. @overload
  312. def __call__(
  313. self, /,
  314. shape: _ShapeLike,
  315. dtype: None = ...,
  316. order: _OrderCF = ...,
  317. **kwargs: Unpack[_KwargsEmpty],
  318. ) -> NDArray[float64]: ...
  319. @overload
  320. def __call__(
  321. self, /,
  322. shape: _ShapeLike,
  323. dtype: _DType | _SupportsDType[_DType],
  324. order: _OrderCF = ...,
  325. **kwargs: Unpack[_KwargsEmpty],
  326. ) -> ndarray[Any, _DType]: ...
  327. @overload
  328. def __call__(
  329. self, /,
  330. shape: _ShapeLike,
  331. dtype: type[_SCT],
  332. order: _OrderCF = ...,
  333. **kwargs: Unpack[_KwargsEmpty],
  334. ) -> NDArray[_SCT]: ...
  335. @overload
  336. def __call__(
  337. self, /,
  338. shape: _ShapeLike,
  339. dtype: DTypeLike,
  340. order: _OrderCF = ...,
  341. **kwargs: Unpack[_KwargsEmpty],
  342. ) -> NDArray[Any]: ...
  343. # using `Final` or `TypeAlias` will break stubtest
  344. error = Exception
  345. # from ._multiarray_umath
  346. ITEM_HASOBJECT: Final[L[1]]
  347. LIST_PICKLE: Final[L[2]]
  348. ITEM_IS_POINTER: Final[L[4]]
  349. NEEDS_INIT: Final[L[8]]
  350. NEEDS_PYAPI: Final[L[16]]
  351. USE_GETITEM: Final[L[32]]
  352. USE_SETITEM: Final[L[64]]
  353. DATETIMEUNITS: Final[CapsuleType]
  354. _ARRAY_API: Final[CapsuleType]
  355. _flagdict: Final[dict[str, int]]
  356. _monotonicity: Final[Callable[..., object]]
  357. _place: Final[Callable[..., object]]
  358. _reconstruct: Final[Callable[..., object]]
  359. _vec_string: Final[Callable[..., object]]
  360. correlate2: Final[Callable[..., object]]
  361. dragon4_positional: Final[Callable[..., object]]
  362. dragon4_scientific: Final[Callable[..., object]]
  363. interp_complex: Final[Callable[..., object]]
  364. set_datetimeparse_function: Final[Callable[..., object]]
  365. def get_handler_name(a: NDArray[Any] = ..., /) -> str | None: ...
  366. def get_handler_version(a: NDArray[Any] = ..., /) -> int | None: ...
  367. def format_longfloat(x: np.longdouble, precision: int) -> str: ...
  368. def scalar(dtype: _DType, object: bytes | object = ...) -> ndarray[tuple[()], _DType]: ...
  369. def set_typeDict(dict_: dict[str, np.dtype[Any]], /) -> None: ...
  370. typeinfo: Final[dict[str, np.dtype[np.generic]]]
  371. ALLOW_THREADS: Final[int] # 0 or 1 (system-specific)
  372. BUFSIZE: L[8192]
  373. CLIP: L[0]
  374. WRAP: L[1]
  375. RAISE: L[2]
  376. MAXDIMS: L[32]
  377. MAY_SHARE_BOUNDS: L[0]
  378. MAY_SHARE_EXACT: L[-1]
  379. tracemalloc_domain: L[389047]
  380. zeros: Final[_ConstructorEmpty]
  381. empty: Final[_ConstructorEmpty]
  382. @overload
  383. def empty_like(
  384. prototype: _ArrayType,
  385. dtype: None = ...,
  386. order: _OrderKACF = ...,
  387. subok: bool = ...,
  388. shape: None | _ShapeLike = ...,
  389. *,
  390. device: None | L["cpu"] = ...,
  391. ) -> _ArrayType: ...
  392. @overload
  393. def empty_like(
  394. prototype: _ArrayLike[_SCT],
  395. dtype: None = ...,
  396. order: _OrderKACF = ...,
  397. subok: bool = ...,
  398. shape: None | _ShapeLike = ...,
  399. *,
  400. device: None | L["cpu"] = ...,
  401. ) -> NDArray[_SCT]: ...
  402. @overload
  403. def empty_like(
  404. prototype: object,
  405. dtype: None = ...,
  406. order: _OrderKACF = ...,
  407. subok: bool = ...,
  408. shape: None | _ShapeLike = ...,
  409. *,
  410. device: None | L["cpu"] = ...,
  411. ) -> NDArray[Any]: ...
  412. @overload
  413. def empty_like(
  414. prototype: Any,
  415. dtype: _DTypeLike[_SCT],
  416. order: _OrderKACF = ...,
  417. subok: bool = ...,
  418. shape: None | _ShapeLike = ...,
  419. *,
  420. device: None | L["cpu"] = ...,
  421. ) -> NDArray[_SCT]: ...
  422. @overload
  423. def empty_like(
  424. prototype: Any,
  425. dtype: DTypeLike,
  426. order: _OrderKACF = ...,
  427. subok: bool = ...,
  428. shape: None | _ShapeLike = ...,
  429. *,
  430. device: None | L["cpu"] = ...,
  431. ) -> NDArray[Any]: ...
  432. @overload
  433. def array(
  434. object: _ArrayType,
  435. dtype: None = ...,
  436. *,
  437. copy: None | bool | _CopyMode = ...,
  438. order: _OrderKACF = ...,
  439. subok: L[True],
  440. ndmin: int = ...,
  441. like: None | _SupportsArrayFunc = ...,
  442. ) -> _ArrayType: ...
  443. @overload
  444. def array(
  445. object: _SupportsArray[_ArrayType],
  446. dtype: None = ...,
  447. *,
  448. copy: None | bool | _CopyMode = ...,
  449. order: _OrderKACF = ...,
  450. subok: L[True],
  451. ndmin: L[0] = ...,
  452. like: None | _SupportsArrayFunc = ...,
  453. ) -> _ArrayType: ...
  454. @overload
  455. def array(
  456. object: _ArrayLike[_SCT],
  457. dtype: None = ...,
  458. *,
  459. copy: None | bool | _CopyMode = ...,
  460. order: _OrderKACF = ...,
  461. subok: bool = ...,
  462. ndmin: int = ...,
  463. like: None | _SupportsArrayFunc = ...,
  464. ) -> NDArray[_SCT]: ...
  465. @overload
  466. def array(
  467. object: object,
  468. dtype: None = ...,
  469. *,
  470. copy: None | bool | _CopyMode = ...,
  471. order: _OrderKACF = ...,
  472. subok: bool = ...,
  473. ndmin: int = ...,
  474. like: None | _SupportsArrayFunc = ...,
  475. ) -> NDArray[Any]: ...
  476. @overload
  477. def array(
  478. object: Any,
  479. dtype: _DTypeLike[_SCT],
  480. *,
  481. copy: None | bool | _CopyMode = ...,
  482. order: _OrderKACF = ...,
  483. subok: bool = ...,
  484. ndmin: int = ...,
  485. like: None | _SupportsArrayFunc = ...,
  486. ) -> NDArray[_SCT]: ...
  487. @overload
  488. def array(
  489. object: Any,
  490. dtype: DTypeLike,
  491. *,
  492. copy: None | bool | _CopyMode = ...,
  493. order: _OrderKACF = ...,
  494. subok: bool = ...,
  495. ndmin: int = ...,
  496. like: None | _SupportsArrayFunc = ...,
  497. ) -> NDArray[Any]: ...
  498. @overload
  499. def unravel_index( # type: ignore[misc]
  500. indices: _IntLike_co,
  501. shape: _ShapeLike,
  502. order: _OrderCF = ...,
  503. ) -> tuple[intp, ...]: ...
  504. @overload
  505. def unravel_index(
  506. indices: _ArrayLikeInt_co,
  507. shape: _ShapeLike,
  508. order: _OrderCF = ...,
  509. ) -> tuple[NDArray[intp], ...]: ...
  510. @overload
  511. def ravel_multi_index( # type: ignore[misc]
  512. multi_index: Sequence[_IntLike_co],
  513. dims: Sequence[SupportsIndex],
  514. mode: _ModeKind | tuple[_ModeKind, ...] = ...,
  515. order: _OrderCF = ...,
  516. ) -> intp: ...
  517. @overload
  518. def ravel_multi_index(
  519. multi_index: Sequence[_ArrayLikeInt_co],
  520. dims: Sequence[SupportsIndex],
  521. mode: _ModeKind | tuple[_ModeKind, ...] = ...,
  522. order: _OrderCF = ...,
  523. ) -> NDArray[intp]: ...
  524. # NOTE: Allow any sequence of array-like objects
  525. @overload
  526. def concatenate( # type: ignore[misc]
  527. arrays: _ArrayLike[_SCT],
  528. /,
  529. axis: None | SupportsIndex = ...,
  530. out: None = ...,
  531. *,
  532. dtype: None = ...,
  533. casting: None | _CastingKind = ...
  534. ) -> NDArray[_SCT]: ...
  535. @overload
  536. def concatenate( # type: ignore[misc]
  537. arrays: SupportsLenAndGetItem[ArrayLike],
  538. /,
  539. axis: None | SupportsIndex = ...,
  540. out: None = ...,
  541. *,
  542. dtype: None = ...,
  543. casting: None | _CastingKind = ...
  544. ) -> NDArray[Any]: ...
  545. @overload
  546. def concatenate( # type: ignore[misc]
  547. arrays: SupportsLenAndGetItem[ArrayLike],
  548. /,
  549. axis: None | SupportsIndex = ...,
  550. out: None = ...,
  551. *,
  552. dtype: _DTypeLike[_SCT],
  553. casting: None | _CastingKind = ...
  554. ) -> NDArray[_SCT]: ...
  555. @overload
  556. def concatenate( # type: ignore[misc]
  557. arrays: SupportsLenAndGetItem[ArrayLike],
  558. /,
  559. axis: None | SupportsIndex = ...,
  560. out: None = ...,
  561. *,
  562. dtype: DTypeLike,
  563. casting: None | _CastingKind = ...
  564. ) -> NDArray[Any]: ...
  565. @overload
  566. def concatenate(
  567. arrays: SupportsLenAndGetItem[ArrayLike],
  568. /,
  569. axis: None | SupportsIndex = ...,
  570. out: _ArrayType = ...,
  571. *,
  572. dtype: DTypeLike = ...,
  573. casting: None | _CastingKind = ...
  574. ) -> _ArrayType: ...
  575. def inner(
  576. a: ArrayLike,
  577. b: ArrayLike,
  578. /,
  579. ) -> Any: ...
  580. @overload
  581. def where(
  582. condition: ArrayLike,
  583. /,
  584. ) -> tuple[NDArray[intp], ...]: ...
  585. @overload
  586. def where(
  587. condition: ArrayLike,
  588. x: ArrayLike,
  589. y: ArrayLike,
  590. /,
  591. ) -> NDArray[Any]: ...
  592. def lexsort(
  593. keys: ArrayLike,
  594. axis: None | SupportsIndex = ...,
  595. ) -> Any: ...
  596. def can_cast(
  597. from_: ArrayLike | DTypeLike,
  598. to: DTypeLike,
  599. casting: None | _CastingKind = ...,
  600. ) -> bool: ...
  601. def min_scalar_type(
  602. a: ArrayLike, /,
  603. ) -> dtype[Any]: ...
  604. def result_type(
  605. *arrays_and_dtypes: ArrayLike | DTypeLike,
  606. ) -> dtype[Any]: ...
  607. @overload
  608. def dot(a: ArrayLike, b: ArrayLike, out: None = ...) -> Any: ...
  609. @overload
  610. def dot(a: ArrayLike, b: ArrayLike, out: _ArrayType) -> _ArrayType: ...
  611. @overload
  612. def vdot(a: _ArrayLikeBool_co, b: _ArrayLikeBool_co, /) -> np.bool: ... # type: ignore[misc]
  613. @overload
  614. def vdot(a: _ArrayLikeUInt_co, b: _ArrayLikeUInt_co, /) -> unsignedinteger[Any]: ... # type: ignore[misc]
  615. @overload
  616. def vdot(a: _ArrayLikeInt_co, b: _ArrayLikeInt_co, /) -> signedinteger[Any]: ... # type: ignore[misc]
  617. @overload
  618. def vdot(a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co, /) -> floating[Any]: ... # type: ignore[misc]
  619. @overload
  620. def vdot(a: _ArrayLikeComplex_co, b: _ArrayLikeComplex_co, /) -> complexfloating[Any, Any]: ... # type: ignore[misc]
  621. @overload
  622. def vdot(a: _ArrayLikeTD64_co, b: _ArrayLikeTD64_co, /) -> timedelta64: ...
  623. @overload
  624. def vdot(a: _ArrayLikeObject_co, b: Any, /) -> Any: ...
  625. @overload
  626. def vdot(a: Any, b: _ArrayLikeObject_co, /) -> Any: ...
  627. def bincount(
  628. x: ArrayLike,
  629. /,
  630. weights: None | ArrayLike = ...,
  631. minlength: SupportsIndex = ...,
  632. ) -> NDArray[intp]: ...
  633. def copyto(
  634. dst: NDArray[Any],
  635. src: ArrayLike,
  636. casting: None | _CastingKind = ...,
  637. where: None | _ArrayLikeBool_co = ...,
  638. ) -> None: ...
  639. def putmask(
  640. a: NDArray[Any],
  641. /,
  642. mask: _ArrayLikeBool_co,
  643. values: ArrayLike,
  644. ) -> None: ...
  645. def packbits(
  646. a: _ArrayLikeInt_co,
  647. /,
  648. axis: None | SupportsIndex = ...,
  649. bitorder: L["big", "little"] = ...,
  650. ) -> NDArray[uint8]: ...
  651. def unpackbits(
  652. a: _ArrayLike[uint8],
  653. /,
  654. axis: None | SupportsIndex = ...,
  655. count: None | SupportsIndex = ...,
  656. bitorder: L["big", "little"] = ...,
  657. ) -> NDArray[uint8]: ...
  658. def shares_memory(
  659. a: object,
  660. b: object,
  661. /,
  662. max_work: None | int = ...,
  663. ) -> bool: ...
  664. def may_share_memory(
  665. a: object,
  666. b: object,
  667. /,
  668. max_work: None | int = ...,
  669. ) -> bool: ...
  670. @overload
  671. def asarray(
  672. a: _ArrayLike[_SCT],
  673. dtype: None = ...,
  674. order: _OrderKACF = ...,
  675. *,
  676. device: None | L["cpu"] = ...,
  677. copy: None | bool = ...,
  678. like: None | _SupportsArrayFunc = ...,
  679. ) -> NDArray[_SCT]: ...
  680. @overload
  681. def asarray(
  682. a: object,
  683. dtype: None = ...,
  684. order: _OrderKACF = ...,
  685. *,
  686. device: None | L["cpu"] = ...,
  687. copy: None | bool = ...,
  688. like: None | _SupportsArrayFunc = ...,
  689. ) -> NDArray[Any]: ...
  690. @overload
  691. def asarray(
  692. a: Any,
  693. dtype: _DTypeLike[_SCT],
  694. order: _OrderKACF = ...,
  695. *,
  696. device: None | L["cpu"] = ...,
  697. copy: None | bool = ...,
  698. like: None | _SupportsArrayFunc = ...,
  699. ) -> NDArray[_SCT]: ...
  700. @overload
  701. def asarray(
  702. a: Any,
  703. dtype: DTypeLike,
  704. order: _OrderKACF = ...,
  705. *,
  706. device: None | L["cpu"] = ...,
  707. copy: None | bool = ...,
  708. like: None | _SupportsArrayFunc = ...,
  709. ) -> NDArray[Any]: ...
  710. @overload
  711. def asanyarray(
  712. a: _ArrayType, # Preserve subclass-information
  713. dtype: None = ...,
  714. order: _OrderKACF = ...,
  715. *,
  716. device: None | L["cpu"] = ...,
  717. copy: None | bool = ...,
  718. like: None | _SupportsArrayFunc = ...,
  719. ) -> _ArrayType: ...
  720. @overload
  721. def asanyarray(
  722. a: _ArrayLike[_SCT],
  723. dtype: None = ...,
  724. order: _OrderKACF = ...,
  725. *,
  726. device: None | L["cpu"] = ...,
  727. copy: None | bool = ...,
  728. like: None | _SupportsArrayFunc = ...,
  729. ) -> NDArray[_SCT]: ...
  730. @overload
  731. def asanyarray(
  732. a: object,
  733. dtype: None = ...,
  734. order: _OrderKACF = ...,
  735. *,
  736. device: None | L["cpu"] = ...,
  737. copy: None | bool = ...,
  738. like: None | _SupportsArrayFunc = ...,
  739. ) -> NDArray[Any]: ...
  740. @overload
  741. def asanyarray(
  742. a: Any,
  743. dtype: _DTypeLike[_SCT],
  744. order: _OrderKACF = ...,
  745. *,
  746. device: None | L["cpu"] = ...,
  747. copy: None | bool = ...,
  748. like: None | _SupportsArrayFunc = ...,
  749. ) -> NDArray[_SCT]: ...
  750. @overload
  751. def asanyarray(
  752. a: Any,
  753. dtype: DTypeLike,
  754. order: _OrderKACF = ...,
  755. *,
  756. device: None | L["cpu"] = ...,
  757. copy: None | bool = ...,
  758. like: None | _SupportsArrayFunc = ...,
  759. ) -> NDArray[Any]: ...
  760. @overload
  761. def ascontiguousarray(
  762. a: _ArrayLike[_SCT],
  763. dtype: None = ...,
  764. *,
  765. like: None | _SupportsArrayFunc = ...,
  766. ) -> NDArray[_SCT]: ...
  767. @overload
  768. def ascontiguousarray(
  769. a: object,
  770. dtype: None = ...,
  771. *,
  772. like: None | _SupportsArrayFunc = ...,
  773. ) -> NDArray[Any]: ...
  774. @overload
  775. def ascontiguousarray(
  776. a: Any,
  777. dtype: _DTypeLike[_SCT],
  778. *,
  779. like: None | _SupportsArrayFunc = ...,
  780. ) -> NDArray[_SCT]: ...
  781. @overload
  782. def ascontiguousarray(
  783. a: Any,
  784. dtype: DTypeLike,
  785. *,
  786. like: None | _SupportsArrayFunc = ...,
  787. ) -> NDArray[Any]: ...
  788. @overload
  789. def asfortranarray(
  790. a: _ArrayLike[_SCT],
  791. dtype: None = ...,
  792. *,
  793. like: None | _SupportsArrayFunc = ...,
  794. ) -> NDArray[_SCT]: ...
  795. @overload
  796. def asfortranarray(
  797. a: object,
  798. dtype: None = ...,
  799. *,
  800. like: None | _SupportsArrayFunc = ...,
  801. ) -> NDArray[Any]: ...
  802. @overload
  803. def asfortranarray(
  804. a: Any,
  805. dtype: _DTypeLike[_SCT],
  806. *,
  807. like: None | _SupportsArrayFunc = ...,
  808. ) -> NDArray[_SCT]: ...
  809. @overload
  810. def asfortranarray(
  811. a: Any,
  812. dtype: DTypeLike,
  813. *,
  814. like: None | _SupportsArrayFunc = ...,
  815. ) -> NDArray[Any]: ...
  816. def promote_types(__type1: DTypeLike, __type2: DTypeLike) -> dtype[Any]: ...
  817. # `sep` is a de facto mandatory argument, as its default value is deprecated
  818. @overload
  819. def fromstring(
  820. string: str | bytes,
  821. dtype: None = ...,
  822. count: SupportsIndex = ...,
  823. *,
  824. sep: str,
  825. like: None | _SupportsArrayFunc = ...,
  826. ) -> NDArray[float64]: ...
  827. @overload
  828. def fromstring(
  829. string: str | bytes,
  830. dtype: _DTypeLike[_SCT],
  831. count: SupportsIndex = ...,
  832. *,
  833. sep: str,
  834. like: None | _SupportsArrayFunc = ...,
  835. ) -> NDArray[_SCT]: ...
  836. @overload
  837. def fromstring(
  838. string: str | bytes,
  839. dtype: DTypeLike,
  840. count: SupportsIndex = ...,
  841. *,
  842. sep: str,
  843. like: None | _SupportsArrayFunc = ...,
  844. ) -> NDArray[Any]: ...
  845. @overload
  846. def frompyfunc( # type: ignore[overload-overlap]
  847. func: Callable[[Any], _ReturnType], /,
  848. nin: L[1],
  849. nout: L[1],
  850. *,
  851. identity: None = ...,
  852. ) -> _PyFunc_Nin1_Nout1[_ReturnType, None]: ...
  853. @overload
  854. def frompyfunc( # type: ignore[overload-overlap]
  855. func: Callable[[Any], _ReturnType], /,
  856. nin: L[1],
  857. nout: L[1],
  858. *,
  859. identity: _IDType,
  860. ) -> _PyFunc_Nin1_Nout1[_ReturnType, _IDType]: ...
  861. @overload
  862. def frompyfunc( # type: ignore[overload-overlap]
  863. func: Callable[[Any, Any], _ReturnType], /,
  864. nin: L[2],
  865. nout: L[1],
  866. *,
  867. identity: None = ...,
  868. ) -> _PyFunc_Nin2_Nout1[_ReturnType, None]: ...
  869. @overload
  870. def frompyfunc( # type: ignore[overload-overlap]
  871. func: Callable[[Any, Any], _ReturnType], /,
  872. nin: L[2],
  873. nout: L[1],
  874. *,
  875. identity: _IDType,
  876. ) -> _PyFunc_Nin2_Nout1[_ReturnType, _IDType]: ...
  877. @overload
  878. def frompyfunc( # type: ignore[overload-overlap]
  879. func: Callable[..., _ReturnType], /,
  880. nin: _Nin,
  881. nout: L[1],
  882. *,
  883. identity: None = ...,
  884. ) -> _PyFunc_Nin3P_Nout1[_ReturnType, None, _Nin]: ...
  885. @overload
  886. def frompyfunc( # type: ignore[overload-overlap]
  887. func: Callable[..., _ReturnType], /,
  888. nin: _Nin,
  889. nout: L[1],
  890. *,
  891. identity: _IDType,
  892. ) -> _PyFunc_Nin3P_Nout1[_ReturnType, _IDType, _Nin]: ...
  893. @overload
  894. def frompyfunc(
  895. func: Callable[..., _2PTuple[_ReturnType]], /,
  896. nin: _Nin,
  897. nout: _Nout,
  898. *,
  899. identity: None = ...,
  900. ) -> _PyFunc_Nin1P_Nout2P[_ReturnType, None, _Nin, _Nout]: ...
  901. @overload
  902. def frompyfunc(
  903. func: Callable[..., _2PTuple[_ReturnType]], /,
  904. nin: _Nin,
  905. nout: _Nout,
  906. *,
  907. identity: _IDType,
  908. ) -> _PyFunc_Nin1P_Nout2P[_ReturnType, _IDType, _Nin, _Nout]: ...
  909. @overload
  910. def frompyfunc(
  911. func: Callable[..., Any], /,
  912. nin: SupportsIndex,
  913. nout: SupportsIndex,
  914. *,
  915. identity: None | object = ...,
  916. ) -> ufunc: ...
  917. @overload
  918. def fromfile(
  919. file: StrOrBytesPath | _SupportsFileMethods,
  920. dtype: None = ...,
  921. count: SupportsIndex = ...,
  922. sep: str = ...,
  923. offset: SupportsIndex = ...,
  924. *,
  925. like: None | _SupportsArrayFunc = ...,
  926. ) -> NDArray[float64]: ...
  927. @overload
  928. def fromfile(
  929. file: StrOrBytesPath | _SupportsFileMethods,
  930. dtype: _DTypeLike[_SCT],
  931. count: SupportsIndex = ...,
  932. sep: str = ...,
  933. offset: SupportsIndex = ...,
  934. *,
  935. like: None | _SupportsArrayFunc = ...,
  936. ) -> NDArray[_SCT]: ...
  937. @overload
  938. def fromfile(
  939. file: StrOrBytesPath | _SupportsFileMethods,
  940. dtype: DTypeLike,
  941. count: SupportsIndex = ...,
  942. sep: str = ...,
  943. offset: SupportsIndex = ...,
  944. *,
  945. like: None | _SupportsArrayFunc = ...,
  946. ) -> NDArray[Any]: ...
  947. @overload
  948. def fromiter(
  949. iter: Iterable[Any],
  950. dtype: _DTypeLike[_SCT],
  951. count: SupportsIndex = ...,
  952. *,
  953. like: None | _SupportsArrayFunc = ...,
  954. ) -> NDArray[_SCT]: ...
  955. @overload
  956. def fromiter(
  957. iter: Iterable[Any],
  958. dtype: DTypeLike,
  959. count: SupportsIndex = ...,
  960. *,
  961. like: None | _SupportsArrayFunc = ...,
  962. ) -> NDArray[Any]: ...
  963. @overload
  964. def frombuffer(
  965. buffer: _SupportsBuffer,
  966. dtype: None = ...,
  967. count: SupportsIndex = ...,
  968. offset: SupportsIndex = ...,
  969. *,
  970. like: None | _SupportsArrayFunc = ...,
  971. ) -> NDArray[float64]: ...
  972. @overload
  973. def frombuffer(
  974. buffer: _SupportsBuffer,
  975. dtype: _DTypeLike[_SCT],
  976. count: SupportsIndex = ...,
  977. offset: SupportsIndex = ...,
  978. *,
  979. like: None | _SupportsArrayFunc = ...,
  980. ) -> NDArray[_SCT]: ...
  981. @overload
  982. def frombuffer(
  983. buffer: _SupportsBuffer,
  984. dtype: DTypeLike,
  985. count: SupportsIndex = ...,
  986. offset: SupportsIndex = ...,
  987. *,
  988. like: None | _SupportsArrayFunc = ...,
  989. ) -> NDArray[Any]: ...
  990. @overload
  991. def arange( # type: ignore[misc]
  992. stop: _IntLike_co,
  993. /, *,
  994. dtype: None = ...,
  995. device: None | L["cpu"] = ...,
  996. like: None | _SupportsArrayFunc = ...,
  997. ) -> _Array1D[signedinteger]: ...
  998. @overload
  999. def arange( # type: ignore[misc]
  1000. start: _IntLike_co,
  1001. stop: _IntLike_co,
  1002. step: _IntLike_co = ...,
  1003. dtype: None = ...,
  1004. *,
  1005. device: None | L["cpu"] = ...,
  1006. like: None | _SupportsArrayFunc = ...,
  1007. ) -> _Array1D[signedinteger]: ...
  1008. @overload
  1009. def arange( # type: ignore[misc]
  1010. stop: _FloatLike_co,
  1011. /, *,
  1012. dtype: None = ...,
  1013. device: None | L["cpu"] = ...,
  1014. like: None | _SupportsArrayFunc = ...,
  1015. ) -> _Array1D[floating]: ...
  1016. @overload
  1017. def arange( # type: ignore[misc]
  1018. start: _FloatLike_co,
  1019. stop: _FloatLike_co,
  1020. step: _FloatLike_co = ...,
  1021. dtype: None = ...,
  1022. *,
  1023. device: None | L["cpu"] = ...,
  1024. like: None | _SupportsArrayFunc = ...,
  1025. ) -> _Array1D[floating]: ...
  1026. @overload
  1027. def arange(
  1028. stop: _TD64Like_co,
  1029. /, *,
  1030. dtype: None = ...,
  1031. device: None | L["cpu"] = ...,
  1032. like: None | _SupportsArrayFunc = ...,
  1033. ) -> _Array1D[timedelta64]: ...
  1034. @overload
  1035. def arange(
  1036. start: _TD64Like_co,
  1037. stop: _TD64Like_co,
  1038. step: _TD64Like_co = ...,
  1039. dtype: None = ...,
  1040. *,
  1041. device: None | L["cpu"] = ...,
  1042. like: None | _SupportsArrayFunc = ...,
  1043. ) -> _Array1D[timedelta64]: ...
  1044. @overload
  1045. def arange( # both start and stop must always be specified for datetime64
  1046. start: datetime64,
  1047. stop: datetime64,
  1048. step: datetime64 = ...,
  1049. dtype: None = ...,
  1050. *,
  1051. device: None | L["cpu"] = ...,
  1052. like: None | _SupportsArrayFunc = ...,
  1053. ) -> _Array1D[datetime64]: ...
  1054. @overload
  1055. def arange(
  1056. stop: Any,
  1057. /, *,
  1058. dtype: _DTypeLike[_SCT],
  1059. device: None | L["cpu"] = ...,
  1060. like: None | _SupportsArrayFunc = ...,
  1061. ) -> _Array1D[_SCT]: ...
  1062. @overload
  1063. def arange(
  1064. start: Any,
  1065. stop: Any,
  1066. step: Any = ...,
  1067. dtype: _DTypeLike[_SCT] = ...,
  1068. *,
  1069. device: None | L["cpu"] = ...,
  1070. like: None | _SupportsArrayFunc = ...,
  1071. ) -> _Array1D[_SCT]: ...
  1072. @overload
  1073. def arange(
  1074. stop: Any, /,
  1075. *,
  1076. dtype: DTypeLike,
  1077. device: None | L["cpu"] = ...,
  1078. like: None | _SupportsArrayFunc = ...,
  1079. ) -> _Array1D[Any]: ...
  1080. @overload
  1081. def arange(
  1082. start: Any,
  1083. stop: Any,
  1084. step: Any = ...,
  1085. dtype: DTypeLike = ...,
  1086. *,
  1087. device: None | L["cpu"] = ...,
  1088. like: None | _SupportsArrayFunc = ...,
  1089. ) -> _Array1D[Any]: ...
  1090. def datetime_data(
  1091. dtype: str | _DTypeLike[datetime64] | _DTypeLike[timedelta64], /,
  1092. ) -> tuple[str, int]: ...
  1093. # The datetime functions perform unsafe casts to `datetime64[D]`,
  1094. # so a lot of different argument types are allowed here
  1095. @overload
  1096. def busday_count( # type: ignore[misc]
  1097. begindates: _ScalarLike_co | dt.date,
  1098. enddates: _ScalarLike_co | dt.date,
  1099. weekmask: ArrayLike = ...,
  1100. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1101. busdaycal: None | busdaycalendar = ...,
  1102. out: None = ...,
  1103. ) -> int_: ...
  1104. @overload
  1105. def busday_count( # type: ignore[misc]
  1106. begindates: ArrayLike | dt.date | _NestedSequence[dt.date],
  1107. enddates: ArrayLike | dt.date | _NestedSequence[dt.date],
  1108. weekmask: ArrayLike = ...,
  1109. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1110. busdaycal: None | busdaycalendar = ...,
  1111. out: None = ...,
  1112. ) -> NDArray[int_]: ...
  1113. @overload
  1114. def busday_count(
  1115. begindates: ArrayLike | dt.date | _NestedSequence[dt.date],
  1116. enddates: ArrayLike | dt.date | _NestedSequence[dt.date],
  1117. weekmask: ArrayLike = ...,
  1118. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1119. busdaycal: None | busdaycalendar = ...,
  1120. out: _ArrayType = ...,
  1121. ) -> _ArrayType: ...
  1122. # `roll="raise"` is (more or less?) equivalent to `casting="safe"`
  1123. @overload
  1124. def busday_offset( # type: ignore[misc]
  1125. dates: datetime64 | dt.date,
  1126. offsets: _TD64Like_co | dt.timedelta,
  1127. roll: L["raise"] = ...,
  1128. weekmask: ArrayLike = ...,
  1129. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1130. busdaycal: None | busdaycalendar = ...,
  1131. out: None = ...,
  1132. ) -> datetime64: ...
  1133. @overload
  1134. def busday_offset( # type: ignore[misc]
  1135. dates: _ArrayLike[datetime64] | dt.date | _NestedSequence[dt.date],
  1136. offsets: _ArrayLikeTD64_co | dt.timedelta | _NestedSequence[dt.timedelta],
  1137. roll: L["raise"] = ...,
  1138. weekmask: ArrayLike = ...,
  1139. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1140. busdaycal: None | busdaycalendar = ...,
  1141. out: None = ...,
  1142. ) -> NDArray[datetime64]: ...
  1143. @overload
  1144. def busday_offset( # type: ignore[misc]
  1145. dates: _ArrayLike[datetime64] | dt.date | _NestedSequence[dt.date],
  1146. offsets: _ArrayLikeTD64_co | dt.timedelta | _NestedSequence[dt.timedelta],
  1147. roll: L["raise"] = ...,
  1148. weekmask: ArrayLike = ...,
  1149. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1150. busdaycal: None | busdaycalendar = ...,
  1151. out: _ArrayType = ...,
  1152. ) -> _ArrayType: ...
  1153. @overload
  1154. def busday_offset( # type: ignore[misc]
  1155. dates: _ScalarLike_co | dt.date,
  1156. offsets: _ScalarLike_co | dt.timedelta,
  1157. roll: _RollKind,
  1158. weekmask: ArrayLike = ...,
  1159. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1160. busdaycal: None | busdaycalendar = ...,
  1161. out: None = ...,
  1162. ) -> datetime64: ...
  1163. @overload
  1164. def busday_offset( # type: ignore[misc]
  1165. dates: ArrayLike | dt.date | _NestedSequence[dt.date],
  1166. offsets: ArrayLike | dt.timedelta | _NestedSequence[dt.timedelta],
  1167. roll: _RollKind,
  1168. weekmask: ArrayLike = ...,
  1169. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1170. busdaycal: None | busdaycalendar = ...,
  1171. out: None = ...,
  1172. ) -> NDArray[datetime64]: ...
  1173. @overload
  1174. def busday_offset(
  1175. dates: ArrayLike | dt.date | _NestedSequence[dt.date],
  1176. offsets: ArrayLike | dt.timedelta | _NestedSequence[dt.timedelta],
  1177. roll: _RollKind,
  1178. weekmask: ArrayLike = ...,
  1179. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1180. busdaycal: None | busdaycalendar = ...,
  1181. out: _ArrayType = ...,
  1182. ) -> _ArrayType: ...
  1183. @overload
  1184. def is_busday( # type: ignore[misc]
  1185. dates: _ScalarLike_co | dt.date,
  1186. weekmask: ArrayLike = ...,
  1187. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1188. busdaycal: None | busdaycalendar = ...,
  1189. out: None = ...,
  1190. ) -> np.bool: ...
  1191. @overload
  1192. def is_busday( # type: ignore[misc]
  1193. dates: ArrayLike | _NestedSequence[dt.date],
  1194. weekmask: ArrayLike = ...,
  1195. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1196. busdaycal: None | busdaycalendar = ...,
  1197. out: None = ...,
  1198. ) -> NDArray[np.bool]: ...
  1199. @overload
  1200. def is_busday(
  1201. dates: ArrayLike | _NestedSequence[dt.date],
  1202. weekmask: ArrayLike = ...,
  1203. holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ...,
  1204. busdaycal: None | busdaycalendar = ...,
  1205. out: _ArrayType = ...,
  1206. ) -> _ArrayType: ...
  1207. @overload
  1208. def datetime_as_string( # type: ignore[misc]
  1209. arr: datetime64 | dt.date,
  1210. unit: None | L["auto"] | _UnitKind = ...,
  1211. timezone: L["naive", "UTC", "local"] | dt.tzinfo = ...,
  1212. casting: _CastingKind = ...,
  1213. ) -> str_: ...
  1214. @overload
  1215. def datetime_as_string(
  1216. arr: _ArrayLikeDT64_co | _NestedSequence[dt.date],
  1217. unit: None | L["auto"] | _UnitKind = ...,
  1218. timezone: L["naive", "UTC", "local"] | dt.tzinfo = ...,
  1219. casting: _CastingKind = ...,
  1220. ) -> NDArray[str_]: ...
  1221. @overload
  1222. def compare_chararrays(
  1223. a1: _ArrayLikeStr_co,
  1224. a2: _ArrayLikeStr_co,
  1225. cmp: L["<", "<=", "==", ">=", ">", "!="],
  1226. rstrip: bool,
  1227. ) -> NDArray[np.bool]: ...
  1228. @overload
  1229. def compare_chararrays(
  1230. a1: _ArrayLikeBytes_co,
  1231. a2: _ArrayLikeBytes_co,
  1232. cmp: L["<", "<=", "==", ">=", ">", "!="],
  1233. rstrip: bool,
  1234. ) -> NDArray[np.bool]: ...
  1235. def add_docstring(obj: Callable[..., Any], docstring: str, /) -> None: ...
  1236. _GetItemKeys: TypeAlias = L[
  1237. "C", "CONTIGUOUS", "C_CONTIGUOUS",
  1238. "F", "FORTRAN", "F_CONTIGUOUS",
  1239. "W", "WRITEABLE",
  1240. "B", "BEHAVED",
  1241. "O", "OWNDATA",
  1242. "A", "ALIGNED",
  1243. "X", "WRITEBACKIFCOPY",
  1244. "CA", "CARRAY",
  1245. "FA", "FARRAY",
  1246. "FNC",
  1247. "FORC",
  1248. ]
  1249. _SetItemKeys: TypeAlias = L[
  1250. "A", "ALIGNED",
  1251. "W", "WRITEABLE",
  1252. "X", "WRITEBACKIFCOPY",
  1253. ]
  1254. @final
  1255. class flagsobj:
  1256. __hash__: ClassVar[None] # type: ignore[assignment]
  1257. aligned: bool
  1258. # NOTE: deprecated
  1259. # updateifcopy: bool
  1260. writeable: bool
  1261. writebackifcopy: bool
  1262. @property
  1263. def behaved(self) -> bool: ...
  1264. @property
  1265. def c_contiguous(self) -> bool: ...
  1266. @property
  1267. def carray(self) -> bool: ...
  1268. @property
  1269. def contiguous(self) -> bool: ...
  1270. @property
  1271. def f_contiguous(self) -> bool: ...
  1272. @property
  1273. def farray(self) -> bool: ...
  1274. @property
  1275. def fnc(self) -> bool: ...
  1276. @property
  1277. def forc(self) -> bool: ...
  1278. @property
  1279. def fortran(self) -> bool: ...
  1280. @property
  1281. def num(self) -> int: ...
  1282. @property
  1283. def owndata(self) -> bool: ...
  1284. def __getitem__(self, key: _GetItemKeys) -> bool: ...
  1285. def __setitem__(self, key: _SetItemKeys, value: bool) -> None: ...
  1286. def nested_iters(
  1287. op: ArrayLike | Sequence[ArrayLike],
  1288. axes: Sequence[Sequence[SupportsIndex]],
  1289. flags: None | Sequence[_NDIterFlagsKind] = ...,
  1290. op_flags: None | Sequence[Sequence[_NDIterFlagsOp]] = ...,
  1291. op_dtypes: DTypeLike | Sequence[DTypeLike] = ...,
  1292. order: _OrderKACF = ...,
  1293. casting: _CastingKind = ...,
  1294. buffersize: SupportsIndex = ...,
  1295. ) -> tuple[nditer, ...]: ...