| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/numpy/core/ |
Upload File : |
import sys
from typing import TypeVar, Union, Iterable, overload
from numpy import ndarray, _OrderKACF
from numpy.typing import ArrayLike, DTypeLike
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
_ArrayType = TypeVar("_ArrayType", bound=ndarray)
# TODO: The following functions are now defined in C, so should be defined
# in a (not yet existing) `multiarray.pyi`.
# (with the exception of `require`)
def asarray(
a: object,
dtype: DTypeLike = ...,
order: _OrderKACF = ...,
*,
like: ArrayLike = ...
) -> ndarray: ...
@overload
def asanyarray(
a: _ArrayType,
dtype: None = ...,
order: _OrderKACF = ...,
*,
like: ArrayLike = ...
) -> _ArrayType: ...
@overload
def asanyarray(
a: object,
dtype: DTypeLike = ...,
order: _OrderKACF = ...,
*,
like: ArrayLike = ...
) -> ndarray: ...
def ascontiguousarray(
a: object, dtype: DTypeLike = ..., *, like: ArrayLike = ...
) -> ndarray: ...
def asfortranarray(
a: object, dtype: DTypeLike = ..., *, like: ArrayLike = ...
) -> ndarray: ...
_Requirements = Literal[
"C", "C_CONTIGUOUS", "CONTIGUOUS",
"F", "F_CONTIGUOUS", "FORTRAN",
"A", "ALIGNED",
"W", "WRITEABLE",
"O", "OWNDATA"
]
_E = Literal["E", "ENSUREARRAY"]
_RequirementsWithE = Union[_Requirements, _E]
@overload
def require(
a: _ArrayType,
dtype: None = ...,
requirements: Union[None, _Requirements, Iterable[_Requirements]] = ...,
*,
like: ArrayLike = ...
) -> _ArrayType: ...
@overload
def require(
a: object,
dtype: DTypeLike = ...,
requirements: Union[_E, Iterable[_RequirementsWithE]] = ...,
*,
like: ArrayLike = ...
) -> ndarray: ...
@overload
def require(
a: object,
dtype: DTypeLike = ...,
requirements: Union[None, _Requirements, Iterable[_Requirements]] = ...,
*,
like: ArrayLike = ...
) -> ndarray: ...