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 /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
data
[ DIR ]
drwxr-xr-x
examples
[ DIR ]
drwxr-xr-x
__init__.py
0
B
-rw-r--r--
_locales.py
2.14
KB
-rw-r--r--
test__exceptions.py
1.96
KB
-rw-r--r--
test_abc.py
2.27
KB
-rw-r--r--
test_api.py
21.76
KB
-rw-r--r--
test_argparse.py
1.93
KB
-rw-r--r--
test_array_coercion.py
27.27
KB
-rw-r--r--
test_arraymethod.py
2.34
KB
-rw-r--r--
test_arrayprint.py
36.3
KB
-rw-r--r--
test_casting_unittests.py
27.19
KB
-rw-r--r--
test_conversion_utils.py
6.26
KB
-rw-r--r--
test_cpu_dispatcher.py
1.48
KB
-rw-r--r--
test_cpu_features.py
6.62
KB
-rw-r--r--
test_cython.py
3.45
KB
-rw-r--r--
test_datetime.py
109.93
KB
-rw-r--r--
test_defchararray.py
24.01
KB
-rw-r--r--
test_deprecations.py
44.47
KB
-rw-r--r--
test_dtype.py
59.15
KB
-rw-r--r--
test_einsum.py
47.9
KB
-rw-r--r--
test_errstate.py
2.02
KB
-rw-r--r--
test_extint128.py
5.51
KB
-rw-r--r--
test_function_base.py
14.07
KB
-rw-r--r--
test_getlimits.py
4.2
KB
-rw-r--r--
test_half.py
23.26
KB
-rw-r--r--
test_indexerrors.py
5.01
KB
-rw-r--r--
test_indexing.py
52.71
KB
-rw-r--r--
test_item_selection.py
3.5
KB
-rw-r--r--
test_longdouble.py
12.74
KB
-rw-r--r--
test_machar.py
1.04
KB
-rw-r--r--
test_mem_overlap.py
28.4
KB
-rw-r--r--
test_memmap.py
7.29
KB
-rw-r--r--
test_multiarray.py
328.73
KB
-rw-r--r--
test_nditer.py
124.75
KB
-rw-r--r--
test_numeric.py
132.07
KB
-rw-r--r--
test_numerictypes.py
20.36
KB
-rw-r--r--
test_overrides.py
19.66
KB
-rw-r--r--
test_print.py
6.58
KB
-rw-r--r--
test_protocols.py
1.14
KB
-rw-r--r--
test_records.py
19.79
KB
-rw-r--r--
test_regression.py
88.97
KB
-rw-r--r--
test_scalar_ctors.py
3.6
KB
-rw-r--r--
test_scalar_methods.py
4
KB
-rw-r--r--
test_scalarbuffer.py
5.5
KB
-rw-r--r--
test_scalarinherit.py
2.35
KB
-rw-r--r--
test_scalarmath.py
31.92
KB
-rw-r--r--
test_scalarprint.py
18.21
KB
-rw-r--r--
test_shape_base.py
26.61
KB
-rw-r--r--
test_simd.py
34.55
KB
-rw-r--r--
test_simd_module.py
3.67
KB
-rw-r--r--
test_ufunc.py
92.25
KB
-rw-r--r--
test_umath.py
137.25
KB
-rw-r--r--
test_umath_accuracy.py
3.04
KB
-rw-r--r--
test_umath_complex.py
22.76
KB
-rw-r--r--
test_unicode.py
12.26
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_conversion_utils.py
""" Tests for numpy/core/src/multiarray/conversion_utils.c """ import re import pytest import numpy as np import numpy.core._multiarray_tests as mt from numpy.testing import assert_warns class StringConverterTestCase: allow_bytes = True case_insensitive = True exact_match = False warn = True def _check_value_error(self, val): pattern = r'\(got {}\)'.format(re.escape(repr(val))) with pytest.raises(ValueError, match=pattern) as exc: self.conv(val) def _check_conv_assert_warn(self, val, expected): if self.warn: with assert_warns(DeprecationWarning) as exc: assert self.conv(val) == expected else: assert self.conv(val) == expected def _check(self, val, expected): """Takes valid non-deprecated inputs for converters, runs converters on inputs, checks correctness of outputs, warnings and errors""" assert self.conv(val) == expected if self.allow_bytes: assert self.conv(val.encode('ascii')) == expected else: with pytest.raises(TypeError): self.conv(val.encode('ascii')) if len(val) != 1: if self.exact_match: self._check_value_error(val[:1]) self._check_value_error(val + '\0') else: self._check_conv_assert_warn(val[:1], expected) if self.case_insensitive: if val != val.lower(): self._check_conv_assert_warn(val.lower(), expected) if val != val.upper(): self._check_conv_assert_warn(val.upper(), expected) else: if val != val.lower(): self._check_value_error(val.lower()) if val != val.upper(): self._check_value_error(val.upper()) def test_wrong_type(self): # common cases which apply to all the below with pytest.raises(TypeError): self.conv({}) with pytest.raises(TypeError): self.conv([]) def test_wrong_value(self): # nonsense strings self._check_value_error('') self._check_value_error('\N{greek small letter pi}') if self.allow_bytes: self._check_value_error(b'') # bytes which can't be converted to strings via utf8 self._check_value_error(b"\xFF") if self.exact_match: self._check_value_error("there's no way this is supported") class TestByteorderConverter(StringConverterTestCase): """ Tests of PyArray_ByteorderConverter """ conv = mt.run_byteorder_converter warn = False def test_valid(self): for s in ['big', '>']: self._check(s, 'NPY_BIG') for s in ['little', '<']: self._check(s, 'NPY_LITTLE') for s in ['native', '=']: self._check(s, 'NPY_NATIVE') for s in ['ignore', '|']: self._check(s, 'NPY_IGNORE') for s in ['swap']: self._check(s, 'NPY_SWAP') class TestSortkindConverter(StringConverterTestCase): """ Tests of PyArray_SortkindConverter """ conv = mt.run_sortkind_converter warn = False def test_valid(self): self._check('quicksort', 'NPY_QUICKSORT') self._check('heapsort', 'NPY_HEAPSORT') self._check('mergesort', 'NPY_STABLESORT') # alias self._check('stable', 'NPY_STABLESORT') class TestSelectkindConverter(StringConverterTestCase): """ Tests of PyArray_SelectkindConverter """ conv = mt.run_selectkind_converter case_insensitive = False exact_match = True def test_valid(self): self._check('introselect', 'NPY_INTROSELECT') class TestSearchsideConverter(StringConverterTestCase): """ Tests of PyArray_SearchsideConverter """ conv = mt.run_searchside_converter def test_valid(self): self._check('left', 'NPY_SEARCHLEFT') self._check('right', 'NPY_SEARCHRIGHT') class TestOrderConverter(StringConverterTestCase): """ Tests of PyArray_OrderConverter """ conv = mt.run_order_converter warn = False def test_valid(self): self._check('c', 'NPY_CORDER') self._check('f', 'NPY_FORTRANORDER') self._check('a', 'NPY_ANYORDER') self._check('k', 'NPY_KEEPORDER') def test_flatten_invalid_order(self): # invalid after gh-14596 with pytest.raises(ValueError): self.conv('Z') for order in [False, True, 0, 8]: with pytest.raises(TypeError): self.conv(order) class TestClipmodeConverter(StringConverterTestCase): """ Tests of PyArray_ClipmodeConverter """ conv = mt.run_clipmode_converter def test_valid(self): self._check('clip', 'NPY_CLIP') self._check('wrap', 'NPY_WRAP') self._check('raise', 'NPY_RAISE') # integer values allowed here assert self.conv(np.CLIP) == 'NPY_CLIP' assert self.conv(np.WRAP) == 'NPY_WRAP' assert self.conv(np.RAISE) == 'NPY_RAISE' class TestCastingConverter(StringConverterTestCase): """ Tests of PyArray_CastingConverter """ conv = mt.run_casting_converter case_insensitive = False exact_match = True def test_valid(self): self._check("no", "NPY_NO_CASTING") self._check("equiv", "NPY_EQUIV_CASTING") self._check("safe", "NPY_SAFE_CASTING") self._check("same_kind", "NPY_SAME_KIND_CASTING") self._check("unsafe", "NPY_UNSAFE_CASTING") class TestIntpConverter: """ Tests of PyArray_IntpConverter """ conv = mt.run_intp_converter def test_basic(self): assert self.conv(1) == (1,) assert self.conv((1, 2)) == (1, 2) assert self.conv([1, 2]) == (1, 2) assert self.conv(()) == () def test_none(self): # once the warning expires, this will raise TypeError with pytest.warns(DeprecationWarning): assert self.conv(None) == () def test_float(self): with pytest.raises(TypeError): self.conv(1.0) with pytest.raises(TypeError): self.conv([1, 1.0]) def test_too_large(self): with pytest.raises(ValueError): self.conv(2**64) def test_too_many_dims(self): assert self.conv([1]*32) == (1,)*32 with pytest.raises(ValueError): self.conv([1]*33)
Close