403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/numpy/core/_internal.pyi
from typing import Any, TypeVar, Type, overload, Optional, Generic
import ctypes as ct

from numpy import ndarray

_CastT = TypeVar("_CastT", bound=ct._CanCastTo)  # Copied from `ctypes.cast`
_CT = TypeVar("_CT", bound=ct._CData)
_PT = TypeVar("_PT", bound=Optional[int])

# TODO: Let the likes of `shape_as` and `strides_as` return `None`
# for 0D arrays once we've got shape-support

class _ctypes(Generic[_PT]):
    @overload
    def __new__(cls, array: ndarray[Any, Any], ptr: None = ...) -> _ctypes[None]: ...
    @overload
    def __new__(cls, array: ndarray[Any, Any], ptr: _PT) -> _ctypes[_PT]: ...

    # NOTE: In practice `shape` and `strides` return one of the concrete
    # platform dependant array-types (`c_int`, `c_long` or `c_longlong`)
    # corresponding to C's `int_ptr_t`, as determined by `_getintp_ctype`
    # TODO: Hook this in to the mypy plugin so that a more appropiate
    # `ctypes._SimpleCData[int]` sub-type can be returned
    @property
    def data(self) -> _PT: ...
    @property
    def shape(self) -> ct.Array[ct.c_int64]: ...
    @property
    def strides(self) -> ct.Array[ct.c_int64]: ...
    @property
    def _as_parameter_(self) -> ct.c_void_p: ...

    def data_as(self, obj: Type[_CastT]) -> _CastT: ...
    def shape_as(self, obj: Type[_CT]) -> ct.Array[_CT]: ...
    def strides_as(self, obj: Type[_CT]) -> ct.Array[_CT]: ...

Youez - 2016 - github.com/yon3zu
LinuXploit