Current Path: > > opt > cloudlinux > venv > lib64 > python3.11 > > site-packages > numpy > typing > tests > > data > pass
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
__pycache__ | Directory | - | - | |
arithmetic.py | File | 7455 bytes | April 17 2025 13:10:58. | |
array_constructors.py | File | 2419 bytes | April 17 2025 13:10:58. | |
array_like.py | File | 916 bytes | April 17 2025 13:10:58. | |
arrayprint.py | File | 766 bytes | April 17 2025 13:10:58. | |
arrayterator.py | File | 393 bytes | April 17 2025 13:10:58. | |
bitwise_ops.py | File | 970 bytes | April 17 2025 13:10:58. | |
comparisons.py | File | 2992 bytes | April 17 2025 13:10:58. | |
dtype.py | File | 1069 bytes | April 17 2025 13:10:58. | |
einsumfunc.py | File | 1370 bytes | April 17 2025 13:10:58. | |
flatiter.py | File | 174 bytes | April 17 2025 13:10:58. | |
fromnumeric.py | File | 3742 bytes | April 17 2025 13:10:58. | |
index_tricks.py | File | 1492 bytes | April 17 2025 13:10:58. | |
lib_utils.py | File | 420 bytes | April 17 2025 13:10:58. | |
lib_version.py | File | 299 bytes | April 17 2025 13:10:58. | |
literal.py | File | 1331 bytes | April 17 2025 13:10:58. | |
mod.py | File | 1578 bytes | April 17 2025 13:10:58. | |
modules.py | File | 595 bytes | April 17 2025 13:10:58. | |
multiarray.py | File | 1331 bytes | April 17 2025 13:10:58. | |
ndarray_conversion.py | File | 1626 bytes | April 17 2025 13:10:58. | |
ndarray_misc.py | File | 2715 bytes | April 17 2025 13:10:58. | |
ndarray_shape_manipulation.py | File | 640 bytes | April 17 2025 13:10:58. | |
numeric.py | File | 1490 bytes | April 17 2025 13:10:58. | |
numerictypes.py | File | 750 bytes | April 17 2025 13:10:58. | |
random.py | File | 61881 bytes | April 17 2025 13:10:58. | |
scalars.py | File | 3479 bytes | April 17 2025 13:10:58. | |
simple.py | File | 2676 bytes | April 17 2025 13:10:58. | |
simple_py3.py | File | 96 bytes | April 17 2025 13:10:58. | |
ufunc_config.py | File | 1120 bytes | April 17 2025 13:10:58. | |
ufunclike.py | File | 1039 bytes | April 17 2025 13:10:58. | |
ufuncs.py | File | 462 bytes | April 17 2025 13:10:58. | |
warnings_and_errors.py | File | 150 bytes | April 17 2025 13:10:58. |
"""Simple expression that should pass with mypy.""" import operator import numpy as np from collections.abc import Iterable # Basic checks array = np.array([1, 2]) def ndarray_func(x): # type: (np.ndarray) -> np.ndarray return x ndarray_func(np.array([1, 2])) array == 1 array.dtype == float # Dtype construction np.dtype(float) np.dtype(np.float64) np.dtype(None) np.dtype("float64") np.dtype(np.dtype(float)) np.dtype(("U", 10)) np.dtype((np.int32, (2, 2))) # Define the arguments on the previous line to prevent bidirectional # type inference in mypy from broadening the types. two_tuples_dtype = [("R", "u1"), ("G", "u1"), ("B", "u1")] np.dtype(two_tuples_dtype) three_tuples_dtype = [("R", "u1", 2)] np.dtype(three_tuples_dtype) mixed_tuples_dtype = [("R", "u1"), ("G", np.str_, 1)] np.dtype(mixed_tuples_dtype) shape_tuple_dtype = [("R", "u1", (2, 2))] np.dtype(shape_tuple_dtype) shape_like_dtype = [("R", "u1", (2, 2)), ("G", np.str_, 1)] np.dtype(shape_like_dtype) object_dtype = [("field1", object)] np.dtype(object_dtype) np.dtype((np.int32, (np.int8, 4))) # Dtype comparison np.dtype(float) == float np.dtype(float) != np.float64 np.dtype(float) < None np.dtype(float) <= "float64" np.dtype(float) > np.dtype(float) np.dtype(float) >= np.dtype(("U", 10)) # Iteration and indexing def iterable_func(x): # type: (Iterable) -> Iterable return x iterable_func(array) [element for element in array] iter(array) zip(array, array) array[1] array[:] array[...] array[:] = 0 array_2d = np.ones((3, 3)) array_2d[:2, :2] array_2d[..., 0] array_2d[:2, :2] = 0 # Other special methods len(array) str(array) array_scalar = np.array(1) int(array_scalar) float(array_scalar) # currently does not work due to https://github.com/python/typeshed/issues/1904 # complex(array_scalar) bytes(array_scalar) operator.index(array_scalar) bool(array_scalar) # comparisons array < 1 array <= 1 array == 1 array != 1 array > 1 array >= 1 1 < array 1 <= array 1 == array 1 != array 1 > array 1 >= array # binary arithmetic array + 1 1 + array array += 1 array - 1 1 - array array -= 1 array * 1 1 * array array *= 1 nonzero_array = np.array([1, 2]) array / 1 1 / nonzero_array float_array = np.array([1.0, 2.0]) float_array /= 1 array // 1 1 // nonzero_array array //= 1 array % 1 1 % nonzero_array array %= 1 divmod(array, 1) divmod(1, nonzero_array) array ** 1 1 ** array array **= 1 array << 1 1 << array array <<= 1 array >> 1 1 >> array array >>= 1 array & 1 1 & array array &= 1 array ^ 1 1 ^ array array ^= 1 array | 1 1 | array array |= 1 # unary arithmetic -array +array abs(array) ~array # Other methods np.array([1, 2]).transpose()
SILENT KILLER Tool