403Webshell
Server IP : 66.29.132.122  /  Your IP : 18.116.60.158
Web Server : LiteSpeed
System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : admazpex ( 531)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/typing/tests/data/reveal/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/typing/tests/data/reveal/ndarray_conversion.pyi
import numpy as np
import numpy.typing as npt

nd: npt.NDArray[np.int_] = np.array([[1, 2], [3, 4]])

# item
reveal_type(nd.item())  # E: int
reveal_type(nd.item(1))  # E: int
reveal_type(nd.item(0, 1))  # E: int
reveal_type(nd.item((0, 1)))  # E: int

# tolist
reveal_type(nd.tolist())  # E: Any

# itemset does not return a value
# tostring is pretty simple
# tobytes is pretty simple
# tofile does not return a value
# dump does not return a value
# dumps is pretty simple

# astype
reveal_type(nd.astype("float"))  # E: ndarray[Any, dtype[Any]]
reveal_type(nd.astype(float))  # E: ndarray[Any, dtype[Any]]
reveal_type(nd.astype(np.float64))  # E: ndarray[Any, dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K"))  # E: ndarray[Any, dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe"))  # E: ndarray[Any, dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe", True))  # E: ndarray[Any, dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe", True, True))  # E: ndarray[Any, dtype[{float64}]]

# byteswap
reveal_type(nd.byteswap())  # E: ndarray[Any, dtype[{int_}]]
reveal_type(nd.byteswap(True))  # E: ndarray[Any, dtype[{int_}]]

# copy
reveal_type(nd.copy())  # E: ndarray[Any, dtype[{int_}]]
reveal_type(nd.copy("C"))  # E: ndarray[Any, dtype[{int_}]]

reveal_type(nd.view())  # E: ndarray[Any, dtype[{int_}]]
reveal_type(nd.view(np.float64))  # E: ndarray[Any, dtype[{float64}]]
reveal_type(nd.view(float))  # E: ndarray[Any, dtype[Any]]
reveal_type(nd.view(np.float64, np.matrix))  # E: matrix[Any, Any]

# getfield
reveal_type(nd.getfield("float"))  # E: ndarray[Any, dtype[Any]]
reveal_type(nd.getfield(float))  # E: ndarray[Any, dtype[Any]]
reveal_type(nd.getfield(np.float64))  # E: ndarray[Any, dtype[{float64}]]
reveal_type(nd.getfield(np.float64, 8))  # E: ndarray[Any, dtype[{float64}]]

# setflags does not return a value
# fill does not return a value

Youez - 2016 - github.com/yon3zu
LinuXploit