HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //lib/python3/dist-packages/numpy/core/_asarray.pyi
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: ...