/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy
NameSizeModeActions
array_api/-0755rm
compat/-0755rm
core/-0755rm
distutils/-0755rm
doc/-0755rm
f2py/-0755rm
fft/-0755rm
lib/-0755rm
linalg/-0755rm
ma/-0755rm
matrixlib/-0755rm
polynomial/-0755rm
random/-0755rm
testing/-0755rm
tests/-0755rm
typing/-0755rm
_pyinstaller/-0755rm
_typing/-0755rm
__pycache__/-0755rm
conftest.py45280644editdlrm
ctypeslib.py174600644editdlrm
ctypeslib.pyi79620644editdlrm
dual.py22140644editdlrm
LICENSE.txt21790644editdlrm
matlib.py104650644editdlrm
py.typed00644editdlrm
setup.py11010644editdlrm
version.py4750644editdlrm
_distributor_init.py3310644editdlrm
_globals.py38850644editdlrm
_pytesttester.py66680644editdlrm
_pytesttester.pyi4890644editdlrm
_version.py4980644editdlrm
__config__.py51550644editdlrm
__init__.cython-30.pxd362160644editdlrm
__init__.pxd345840644editdlrm
__init__.py161740644editdlrm
__init__.pyi1511660644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/_globals.py (3885B)
""" Module defining global singleton classes. This module raises a RuntimeError if an attempt to reload it is made. In that way the identities of the classes defined here are fixed and will remain so even if numpy itself is reloaded. In particular, a function like the following will still work correctly after numpy is reloaded:: def foo(arg=np._NoValue): if arg is np._NoValue: ... That was not the case when the singleton classes were defined in the numpy ``__init__.py`` file. See gh-7844 for a discussion of the reload problem that motivated this module. """ import enum __ALL__ = [ 'ModuleDeprecationWarning', 'VisibleDeprecationWarning', '_NoValue', '_CopyMode' ] # Disallow reloading this module so as to preserve the identities of the # classes defined here. if '_is_loaded' in globals(): raise RuntimeError('Reloading numpy._globals is not allowed') _is_loaded = True class ModuleDeprecationWarning(DeprecationWarning): """Module deprecation warning. The nose tester turns ordinary Deprecation warnings into test failures. That makes it hard to deprecate whole modules, because they get imported by default. So this is a special Deprecation warning that the nose tester will let pass without making tests fail. """ ModuleDeprecationWarning.__module__ = 'numpy' class VisibleDeprecationWarning(UserWarning): """Visible deprecation warning. By default, python will not show deprecation warnings, so this class can be used when a very visible warning is helpful, for example because the usage is most likely a user bug. """ VisibleDeprecationWarning.__module__ = 'numpy' class _NoValueType: """Special keyword value. The instance of this class may be used as the default value assigned to a keyword if no other obvious default (e.g., `None`) is suitable, Common reasons for using this keyword are: - A new keyword is added to a function, and that function forwards its inputs to another function or method which can be defined outside of NumPy. For example, ``np.std(x)`` calls ``x.std``, so when a ``keepdims`` keyword was added that could only be forwarded if the user explicitly specified ``keepdims``; downstream array libraries may not have added the same keyword, so adding ``x.std(..., keepdims=keepdims)`` unconditionally could have broken previously working code. - A keyword is being deprecated, and a deprecation warning must only be emitted when the keyword is used. """ __instance = None def __new__(cls): # ensure that only one instance exists if not cls.__instance: cls.__instance = super().__new__(cls) return cls.__instance def __repr__(self): return "" _NoValue = _NoValueType() class _CopyMode(enum.Enum): """ An enumeration for the copy modes supported by numpy.copy() and numpy.array(). The following three modes are supported, - ALWAYS: This means that a deep copy of the input array will always be taken. - IF_NEEDED: This means that a deep copy of the input array will be taken only if necessary. - NEVER: This means that the deep copy will never be taken. If a copy cannot be avoided then a `ValueError` will be raised. Note that the buffer-protocol could in theory do copies. NumPy currently assumes an object exporting the buffer protocol will never do this. """ ALWAYS = True IF_NEEDED = False NEVER = 2 def __bool__(self): # For backwards compatibility if self == _CopyMode.ALWAYS: return True if self == _CopyMode.IF_NEEDED: return False raise ValueError(f"{self} is neither True nor False.") _CopyMode.__module__ = 'numpy'