Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
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 : _dtype_ctypes.py
""" Conversion from ctypes to dtype. In an ideal world, we could achieve this through the PEP3118 buffer protocol, something like:: def dtype_from_ctypes_type(t): # needed to ensure that the shape of `t` is within memoryview.format class DummyStruct(ctypes.Structure): _fields_ = [('a', t)] # empty to avoid memory allocation ctype_0 = (DummyStruct * 0)() mv = memoryview(ctype_0) # convert the struct, and slice back out the field return _dtype_from_pep3118(mv.format)['a'] Unfortunately, this fails because: * ctypes cannot handle length-0 arrays with PEP3118 (bpo-32782) * PEP3118 cannot represent unions, but both numpy and ctypes can * ctypes cannot handle big-endian structs with PEP3118 (bpo-32780) """ # We delay-import ctypes for distributions that do not include it. # While this module is not used unless the user passes in ctypes # members, it is eagerly imported from numpy/core/__init__.py. import numpy as np def _from_ctypes_array(t): return np.dtype((dtype_from_ctypes_type(t._type_), (t._length_,))) def _from_ctypes_structure(t): for item in t._fields_: if len(item) > 2: raise TypeError( "ctypes bitfields have no dtype equivalent") if hasattr(t, "_pack_"): import ctypes formats = [] offsets = [] names = [] current_offset = 0 for fname, ftyp in t._fields_: names.append(fname) formats.append(dtype_from_ctypes_type(ftyp)) # Each type has a default offset, this is platform dependent for some types. effective_pack = min(t._pack_, ctypes.alignment(ftyp)) current_offset = ((current_offset + effective_pack - 1) // effective_pack) * effective_pack offsets.append(current_offset) current_offset += ctypes.sizeof(ftyp) return np.dtype(dict( formats=formats, offsets=offsets, names=names, itemsize=ctypes.sizeof(t))) else: fields = [] for fname, ftyp in t._fields_: fields.append((fname, dtype_from_ctypes_type(ftyp))) # by default, ctypes structs are aligned return np.dtype(fields, align=True) def _from_ctypes_scalar(t): """ Return the dtype type with endianness included if it's the case """ if getattr(t, '__ctype_be__', None) is t: return np.dtype('>' + t._type_) elif getattr(t, '__ctype_le__', None) is t: return np.dtype('<' + t._type_) else: return np.dtype(t._type_) def _from_ctypes_union(t): import ctypes formats = [] offsets = [] names = [] for fname, ftyp in t._fields_: names.append(fname) formats.append(dtype_from_ctypes_type(ftyp)) offsets.append(0) # Union fields are offset to 0 return np.dtype(dict( formats=formats, offsets=offsets, names=names, itemsize=ctypes.sizeof(t))) def dtype_from_ctypes_type(t): """ Construct a dtype object from a ctypes type """ import _ctypes if issubclass(t, _ctypes.Array): return _from_ctypes_array(t) elif issubclass(t, _ctypes._Pointer): raise TypeError("ctypes pointers have no dtype equivalent") elif issubclass(t, _ctypes.Structure): return _from_ctypes_structure(t) elif issubclass(t, _ctypes.Union): return _from_ctypes_union(t) elif isinstance(getattr(t, '_type_', None), str): return _from_ctypes_scalar(t) else: raise NotImplementedError( "Unknown ctypes type {}".format(t.__name__))
Close