Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
numpy /
core /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
include
[ DIR ]
drwxr-xr-x
lib
[ DIR ]
drwxr-xr-x
tests
[ DIR ]
drwxr-xr-x
__init__.py
5.24
KB
-rw-r--r--
__init__.pyi
126
B
-rw-r--r--
_add_newdocs.py
187.41
KB
-rw-r--r--
_add_newdocs_scalars.py
8.59
KB
-rw-r--r--
_asarray.py
4.08
KB
-rw-r--r--
_asarray.pyi
1.89
KB
-rw-r--r--
_dtype.py
9.61
KB
-rw-r--r--
_dtype_ctypes.py
3.59
KB
-rw-r--r--
_exceptions.py
5.99
KB
-rw-r--r--
_internal.py
26.73
KB
-rw-r--r--
_internal.pyi
1.34
KB
-rw-r--r--
_methods.py
10.54
KB
-rw-r--r--
_multiarray_tests.cpython-310-...
122.6
KB
-rw-r--r--
_multiarray_umath.cpython-310-...
3.63
MB
-rw-r--r--
_operand_flag_tests.cpython-31...
14.2
KB
-rw-r--r--
_rational_tests.cpython-310-x8...
43.46
KB
-rw-r--r--
_simd.cpython-310-x86_64-linux...
1.91
MB
-rw-r--r--
_string_helpers.py
2.79
KB
-rw-r--r--
_struct_ufunc_tests.cpython-31...
14.38
KB
-rw-r--r--
_type_aliases.py
7.1
KB
-rw-r--r--
_type_aliases.pyi
520
B
-rw-r--r--
_ufunc_config.py
13.07
KB
-rw-r--r--
_ufunc_config.pyi
1.22
KB
-rw-r--r--
_umath_tests.cpython-310-x86_6...
34.8
KB
-rw-r--r--
arrayprint.py
60.18
KB
-rw-r--r--
arrayprint.pyi
4.56
KB
-rw-r--r--
cversions.py
347
B
-rw-r--r--
defchararray.py
68.1
KB
-rw-r--r--
einsumfunc.py
50.24
KB
-rw-r--r--
einsumfunc.pyi
3.62
KB
-rw-r--r--
fromnumeric.py
119.9
KB
-rw-r--r--
fromnumeric.pyi
7.83
KB
-rw-r--r--
function_base.py
18.57
KB
-rw-r--r--
function_base.pyi
1.44
KB
-rw-r--r--
generate_numpy_api.py
6.94
KB
-rw-r--r--
getlimits.py
19.31
KB
-rw-r--r--
machar.py
10.56
KB
-rw-r--r--
memmap.py
11.41
KB
-rw-r--r--
multiarray.py
54.01
KB
-rw-r--r--
numeric.py
74.93
KB
-rw-r--r--
numeric.pyi
4.76
KB
-rw-r--r--
numerictypes.py
16.91
KB
-rw-r--r--
numerictypes.pyi
2.85
KB
-rw-r--r--
overrides.py
7.94
KB
-rw-r--r--
records.py
36.58
KB
-rw-r--r--
setup.py
44.62
KB
-rw-r--r--
setup_common.py
19.31
KB
-rw-r--r--
shape_base.py
28.32
KB
-rw-r--r--
shape_base.pyi
1.04
KB
-rw-r--r--
umath.py
1.99
KB
-rw-r--r--
umath_tests.py
389
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : _exceptions.py
""" Various richly-typed exceptions, that also help us deal with string formatting in python where it's easier. By putting the formatting in `__str__`, we also avoid paying the cost for users who silence the exceptions. """ from numpy.core.overrides import set_module def _unpack_tuple(tup): if len(tup) == 1: return tup[0] else: return tup def _display_as_base(cls): """ A decorator that makes an exception class look like its base. We use this to hide subclasses that are implementation details - the user should catch the base type, which is what the traceback will show them. Classes decorated with this decorator are subject to removal without a deprecation warning. """ assert issubclass(cls, Exception) cls.__name__ = cls.__base__.__name__ return cls class UFuncTypeError(TypeError): """ Base class for all ufunc exceptions """ def __init__(self, ufunc): self.ufunc = ufunc @_display_as_base class _UFuncBinaryResolutionError(UFuncTypeError): """ Thrown when a binary resolution fails """ def __init__(self, ufunc, dtypes): super().__init__(ufunc) self.dtypes = tuple(dtypes) assert len(self.dtypes) == 2 def __str__(self): return ( "ufunc {!r} cannot use operands with types {!r} and {!r}" ).format( self.ufunc.__name__, *self.dtypes ) @_display_as_base class _UFuncNoLoopError(UFuncTypeError): """ Thrown when a ufunc loop cannot be found """ def __init__(self, ufunc, dtypes): super().__init__(ufunc) self.dtypes = tuple(dtypes) def __str__(self): return ( "ufunc {!r} did not contain a loop with signature matching types " "{!r} -> {!r}" ).format( self.ufunc.__name__, _unpack_tuple(self.dtypes[:self.ufunc.nin]), _unpack_tuple(self.dtypes[self.ufunc.nin:]) ) @_display_as_base class _UFuncCastingError(UFuncTypeError): def __init__(self, ufunc, casting, from_, to): super().__init__(ufunc) self.casting = casting self.from_ = from_ self.to = to @_display_as_base class _UFuncInputCastingError(_UFuncCastingError): """ Thrown when a ufunc input cannot be casted """ def __init__(self, ufunc, casting, from_, to, i): super().__init__(ufunc, casting, from_, to) self.in_i = i def __str__(self): # only show the number if more than one input exists i_str = "{} ".format(self.in_i) if self.ufunc.nin != 1 else "" return ( "Cannot cast ufunc {!r} input {}from {!r} to {!r} with casting " "rule {!r}" ).format( self.ufunc.__name__, i_str, self.from_, self.to, self.casting ) @_display_as_base class _UFuncOutputCastingError(_UFuncCastingError): """ Thrown when a ufunc output cannot be casted """ def __init__(self, ufunc, casting, from_, to, i): super().__init__(ufunc, casting, from_, to) self.out_i = i def __str__(self): # only show the number if more than one output exists i_str = "{} ".format(self.out_i) if self.ufunc.nout != 1 else "" return ( "Cannot cast ufunc {!r} output {}from {!r} to {!r} with casting " "rule {!r}" ).format( self.ufunc.__name__, i_str, self.from_, self.to, self.casting ) # Exception used in shares_memory() @set_module('numpy') class TooHardError(RuntimeError): pass @set_module('numpy') class AxisError(ValueError, IndexError): """ Axis supplied was invalid. """ def __init__(self, axis, ndim=None, msg_prefix=None): # single-argument form just delegates to base class if ndim is None and msg_prefix is None: msg = axis # do the string formatting here, to save work in the C code else: msg = ("axis {} is out of bounds for array of dimension {}" .format(axis, ndim)) if msg_prefix is not None: msg = "{}: {}".format(msg_prefix, msg) super().__init__(msg) @_display_as_base class _ArrayMemoryError(MemoryError): """ Thrown when an array cannot be allocated""" def __init__(self, shape, dtype): self.shape = shape self.dtype = dtype @property def _total_size(self): num_bytes = self.dtype.itemsize for dim in self.shape: num_bytes *= dim return num_bytes @staticmethod def _size_to_string(num_bytes): """ Convert a number of bytes into a binary size string """ # https://en.wikipedia.org/wiki/Binary_prefix LOG2_STEP = 10 STEP = 1024 units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'] unit_i = max(num_bytes.bit_length() - 1, 1) // LOG2_STEP unit_val = 1 << (unit_i * LOG2_STEP) n_units = num_bytes / unit_val del unit_val # ensure we pick a unit that is correct after rounding if round(n_units) == STEP: unit_i += 1 n_units /= STEP # deal with sizes so large that we don't have units for them if unit_i >= len(units): new_unit_i = len(units) - 1 n_units *= 1 << ((unit_i - new_unit_i) * LOG2_STEP) unit_i = new_unit_i unit_name = units[unit_i] # format with a sensible number of digits if unit_i == 0: # no decimal point on bytes return '{:.0f} {}'.format(n_units, unit_name) elif round(n_units) < 1000: # 3 significant figures, if none are dropped to the left of the . return '{:#.3g} {}'.format(n_units, unit_name) else: # just give all the digits otherwise return '{:#.0f} {}'.format(n_units, unit_name) def __str__(self): size_str = self._size_to_string(self._total_size) return ( "Unable to allocate {} for an array with shape {} and data type {}" .format(size_str, self.shape, self.dtype) )
Close