Current Path: > > opt > cloudlinux > venv > lib64 > python3.11 > > site-packages > numpy > core >
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 | - | - | |
include | Directory | - | - | |
lib | Directory | - | - | |
tests | Directory | - | - | |
__init__.py | File | 5779 bytes | April 17 2025 13:10:58. | |
__init__.pyi | File | 126 bytes | April 17 2025 13:10:58. | |
_add_newdocs.py | File | 208972 bytes | April 17 2025 13:10:58. | |
_add_newdocs_scalars.py | File | 12106 bytes | April 17 2025 13:10:58. | |
_asarray.py | File | 3884 bytes | April 17 2025 13:10:58. | |
_asarray.pyi | File | 1086 bytes | April 17 2025 13:10:58. | |
_dtype.py | File | 10606 bytes | April 17 2025 13:10:58. | |
_dtype_ctypes.py | File | 3673 bytes | April 17 2025 13:10:58. | |
_exceptions.py | File | 5379 bytes | April 17 2025 13:10:58. | |
_internal.py | File | 28348 bytes | April 17 2025 13:10:58. | |
_internal.pyi | File | 1032 bytes | April 17 2025 13:10:58. | |
_machar.py | File | 11565 bytes | April 17 2025 13:10:58. | |
_methods.py | File | 8613 bytes | April 17 2025 13:10:58. | |
_multiarray_tests.cpython-311-x86_64-linux-gnu.so | File | 175512 bytes | April 17 2025 13:11:30. | |
_multiarray_umath.cpython-311-x86_64-linux-gnu.so | File | 6959064 bytes | April 17 2025 13:11:30. | |
_operand_flag_tests.cpython-311-x86_64-linux-gnu.so | File | 16944 bytes | April 17 2025 13:11:30. | |
_rational_tests.cpython-311-x86_64-linux-gnu.so | File | 59688 bytes | April 17 2025 13:11:30. | |
_simd.cpython-311-x86_64-linux-gnu.so | File | 2586024 bytes | April 17 2025 13:11:30. | |
_string_helpers.py | File | 2852 bytes | April 17 2025 13:10:58. | |
_struct_ufunc_tests.cpython-311-x86_64-linux-gnu.so | File | 17048 bytes | April 17 2025 13:11:30. | |
_type_aliases.py | File | 7534 bytes | April 17 2025 13:10:58. | |
_type_aliases.pyi | File | 404 bytes | April 17 2025 13:10:58. | |
_ufunc_config.py | File | 13944 bytes | April 17 2025 13:10:58. | |
_ufunc_config.pyi | File | 1066 bytes | April 17 2025 13:10:58. | |
_umath_tests.cpython-311-x86_64-linux-gnu.so | File | 41992 bytes | April 17 2025 13:11:30. | |
arrayprint.py | File | 63608 bytes | April 17 2025 13:10:58. | |
arrayprint.pyi | File | 4428 bytes | April 17 2025 13:10:58. | |
cversions.py | File | 347 bytes | April 17 2025 13:10:58. | |
defchararray.py | File | 73617 bytes | April 17 2025 13:10:58. | |
defchararray.pyi | File | 9216 bytes | April 17 2025 13:10:58. | |
einsumfunc.py | File | 51868 bytes | April 17 2025 13:10:58. | |
einsumfunc.pyi | File | 4860 bytes | April 17 2025 13:10:58. | |
fromnumeric.py | File | 128821 bytes | April 17 2025 13:10:58. | |
fromnumeric.pyi | File | 23510 bytes | April 17 2025 13:10:58. | |
function_base.py | File | 19836 bytes | April 17 2025 13:10:58. | |
function_base.pyi | File | 4725 bytes | April 17 2025 13:10:58. | |
generate_numpy_api.py | File | 7654 bytes | April 17 2025 13:10:58. | |
getlimits.py | File | 25865 bytes | April 17 2025 13:10:58. | |
getlimits.pyi | File | 82 bytes | April 17 2025 13:10:58. | |
memmap.py | File | 11771 bytes | April 17 2025 13:10:58. | |
memmap.pyi | File | 55 bytes | April 17 2025 13:10:58. | |
multiarray.py | File | 56097 bytes | April 17 2025 13:10:58. | |
multiarray.pyi | File | 24768 bytes | April 17 2025 13:10:58. | |
numeric.py | File | 77014 bytes | April 17 2025 13:10:58. | |
numeric.pyi | File | 14230 bytes | April 17 2025 13:10:58. | |
numerictypes.py | File | 18098 bytes | April 17 2025 13:10:58. | |
numerictypes.pyi | File | 3267 bytes | April 17 2025 13:10:58. | |
overrides.py | File | 7093 bytes | April 17 2025 13:10:58. | |
records.py | File | 37533 bytes | April 17 2025 13:10:58. | |
records.pyi | File | 5692 bytes | April 17 2025 13:10:58. | |
setup.py | File | 48182 bytes | April 17 2025 13:10:58. | |
setup_common.py | File | 17085 bytes | April 17 2025 13:10:58. | |
shape_base.py | File | 29743 bytes | April 17 2025 13:10:58. | |
shape_base.pyi | File | 2774 bytes | April 17 2025 13:10:58. | |
umath.py | File | 2040 bytes | April 17 2025 13:10:58. | |
umath_tests.py | File | 389 bytes | April 17 2025 13:10:58. |
""" Functions in the ``as*array`` family that promote array-likes into arrays. `require` fits this category despite its name not matching this pattern. """ from .overrides import ( array_function_dispatch, set_array_function_like_doc, set_module, ) from .multiarray import array, asanyarray __all__ = ["require"] POSSIBLE_FLAGS = { 'C': 'C', 'C_CONTIGUOUS': 'C', 'CONTIGUOUS': 'C', 'F': 'F', 'F_CONTIGUOUS': 'F', 'FORTRAN': 'F', 'A': 'A', 'ALIGNED': 'A', 'W': 'W', 'WRITEABLE': 'W', 'O': 'O', 'OWNDATA': 'O', 'E': 'E', 'ENSUREARRAY': 'E' } @set_array_function_like_doc @set_module('numpy') def require(a, dtype=None, requirements=None, *, like=None): """ Return an ndarray of the provided type that satisfies requirements. This function is useful to be sure that an array with the correct flags is returned for passing to compiled code (perhaps through ctypes). Parameters ---------- a : array_like The object to be converted to a type-and-requirement-satisfying array. dtype : data-type The required data-type. If None preserve the current dtype. If your application requires the data to be in native byteorder, include a byteorder specification as a part of the dtype specification. requirements : str or sequence of str The requirements list can be any of the following * 'F_CONTIGUOUS' ('F') - ensure a Fortran-contiguous array * 'C_CONTIGUOUS' ('C') - ensure a C-contiguous array * 'ALIGNED' ('A') - ensure a data-type aligned array * 'WRITEABLE' ('W') - ensure a writable array * 'OWNDATA' ('O') - ensure an array that owns its own data * 'ENSUREARRAY', ('E') - ensure a base array, instead of a subclass ${ARRAY_FUNCTION_LIKE} .. versionadded:: 1.20.0 Returns ------- out : ndarray Array with specified requirements and type if given. See Also -------- asarray : Convert input to an ndarray. asanyarray : Convert to an ndarray, but pass through ndarray subclasses. ascontiguousarray : Convert input to a contiguous array. asfortranarray : Convert input to an ndarray with column-major memory order. ndarray.flags : Information about the memory layout of the array. Notes ----- The returned array will be guaranteed to have the listed requirements by making a copy if needed. Examples -------- >>> x = np.arange(6).reshape(2,3) >>> x.flags C_CONTIGUOUS : True F_CONTIGUOUS : False OWNDATA : False WRITEABLE : True ALIGNED : True WRITEBACKIFCOPY : False >>> y = np.require(x, dtype=np.float32, requirements=['A', 'O', 'W', 'F']) >>> y.flags C_CONTIGUOUS : False F_CONTIGUOUS : True OWNDATA : True WRITEABLE : True ALIGNED : True WRITEBACKIFCOPY : False """ if like is not None: return _require_with_like( like, a, dtype=dtype, requirements=requirements, ) if not requirements: return asanyarray(a, dtype=dtype) requirements = {POSSIBLE_FLAGS[x.upper()] for x in requirements} if 'E' in requirements: requirements.remove('E') subok = False else: subok = True order = 'A' if requirements >= {'C', 'F'}: raise ValueError('Cannot specify both "C" and "F" order') elif 'F' in requirements: order = 'F' requirements.remove('F') elif 'C' in requirements: order = 'C' requirements.remove('C') arr = array(a, dtype=dtype, order=order, copy=False, subok=subok) for prop in requirements: if not arr.flags[prop]: return arr.copy(order) return arr _require_with_like = array_function_dispatch()(require)
SILENT KILLER Tool