GRAYBYTE WORDPRESS FILE MANAGER3992

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.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
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy//_globals.py
"""
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

from ._utils import set_module as _set_module

__all__ = ['_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 _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 "<no value>"


_NoValue = _NoValueType()


@_set_module("numpy")
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.")

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 25 2025 08:31:36
root / root
0755
__pycache__
--
May 15 2025 08:31:38
root / root
0755
_pyinstaller
--
May 15 2025 08:30:33
root / root
0755
_typing
--
May 15 2025 08:30:33
root / root
0755
_utils
--
May 15 2025 08:30:33
root / root
0755
array_api
--
May 15 2025 08:30:33
root / root
0755
compat
--
May 15 2025 08:30:33
root / root
0755
core
--
May 15 2025 08:30:33
root / root
0755
distutils
--
May 15 2025 08:30:33
root / root
0755
doc
--
May 15 2025 08:30:33
root / root
0755
f2py
--
May 15 2025 08:30:33
root / root
0755
fft
--
May 15 2025 08:30:33
root / root
0755
lib
--
May 15 2025 08:30:33
root / root
0755
linalg
--
May 15 2025 08:30:33
root / root
0755
ma
--
May 15 2025 08:30:33
root / root
0755
matrixlib
--
May 15 2025 08:30:33
root / root
0755
polynomial
--
May 15 2025 08:30:34
root / root
0755
random
--
May 15 2025 08:30:34
root / root
0755
testing
--
May 15 2025 08:30:34
root / root
0755
tests
--
May 15 2025 08:30:34
root / root
0755
typing
--
May 15 2025 08:30:34
root / root
0755
LICENSE.txt
44.621 KB
April 17 2025 13:10:58
root / root
0644
__config__.py
5.022 KB
April 17 2025 13:10:58
root / root
0644
__init__.cython-30.pxd
35.814 KB
April 17 2025 13:10:58
root / root
0644
__init__.pxd
34.222 KB
April 17 2025 13:10:58
root / root
0644
__init__.py
16.099 KB
April 17 2025 13:10:58
root / root
0644
__init__.pyi
150.111 KB
April 17 2025 13:10:58
root / root
0644
_distributor_init.py
0.323 KB
April 17 2025 13:10:58
root / root
0644
_globals.py
3.021 KB
April 17 2025 13:10:58
root / root
0644
_pytesttester.py
6.512 KB
April 17 2025 13:10:58
root / root
0644
_pytesttester.pyi
0.478 KB
April 17 2025 13:10:58
root / root
0644
_version.py
0.486 KB
April 17 2025 13:10:58
root / root
0644
conftest.py
4.515 KB
April 17 2025 13:10:58
root / root
0644
ctypeslib.py
16.843 KB
April 17 2025 13:10:58
root / root
0644
ctypeslib.pyi
7.785 KB
April 17 2025 13:10:58
root / root
0644
dtypes.py
2.177 KB
April 17 2025 13:10:58
root / root
0644
dtypes.pyi
1.284 KB
April 17 2025 13:10:58
root / root
0644
exceptions.py
7.167 KB
April 17 2025 13:10:58
root / root
0644
exceptions.pyi
0.586 KB
April 17 2025 13:10:58
root / root
0644
matlib.py
10.22 KB
April 17 2025 13:10:58
root / root
0644
py.typed
0 KB
April 17 2025 13:10:58
root / root
0644
setup.py
1.11 KB
April 17 2025 13:10:58
root / root
0644
version.py
0.608 KB
April 17 2025 13:10:58
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF