/opt/alt/python37/lib64/python3.7/site-packages/numpy/core/tests
NameSizeModeActions
data/-0755rm
__pycache__/-0755rm
test_abc.py20140644editdlrm
test_api.py189060644editdlrm
test_arrayprint.py102150644editdlrm
test_datetime.py925270644editdlrm
test_defchararray.py257640644editdlrm
test_deprecations.py188020644editdlrm
test_dtype.py262020644editdlrm
test_einsum.py395980644editdlrm
test_errstate.py15880644editdlrm
test_extint128.py57740644editdlrm
test_function_base.py114290644editdlrm
test_getlimits.py46130644editdlrm
test_half.py186480644editdlrm
test_indexerrors.py49380644editdlrm
test_indexing.py479660644editdlrm
test_item_selection.py36650644editdlrm
test_longdouble.py59670644editdlrm
test_machar.py10140644editdlrm
test_memmap.py70750644editdlrm
test_mem_overlap.py295640644editdlrm
test_multiarray.py2608050644editdlrm
test_nditer.py1082830644editdlrm
test_numeric.py1008540644editdlrm
test_numerictypes.py146100644editdlrm
test_print.py80890644editdlrm
test_records.py156350644editdlrm
test_regression.py812110644editdlrm
test_scalarinherit.py7710644editdlrm
test_scalarmath.py250330644editdlrm
test_scalarprint.py9170644editdlrm
test_shape_base.py185440644editdlrm
test_ufunc.py549850644editdlrm
test_umath.py987850644editdlrm
test_umath_complex.py198000644editdlrm
test_unicode.py142380644editdlrm
Edit: /opt/alt/python37/lib64/python3.7/site-packages/numpy/core/tests/test_unicode.py (14238B)
from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.compat import unicode from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_array_equal) # Guess the UCS length for this python interpreter if sys.version_info[:2] >= (3, 3): # Python 3.3 uses a flexible string representation ucs4 = False def buffer_length(arr): if isinstance(arr, unicode): arr = str(arr) if not arr: charmax = 0 else: charmax = max([ord(c) for c in arr]) if charmax < 256: size = 1 elif charmax < 65536: size = 2 else: size = 4 return size * len(arr) v = memoryview(arr) if v.shape is None: return len(v) * v.itemsize else: return np.prod(v.shape) * v.itemsize else: if len(buffer(u'u')) == 4: ucs4 = True else: ucs4 = False def buffer_length(arr): if isinstance(arr, np.ndarray): return len(arr.data) return len(buffer(arr)) # In both cases below we need to make sure that the byte swapped value (as # UCS4) is still a valid unicode: # Value that can be represented in UCS2 interpreters ucs2_value = u'\u0900' # Value that cannot be represented in UCS2 interpreters (but can in UCS4) ucs4_value = u'\U00100900' def test_string_cast(): str_arr = np.array(["1234", "1234\0\0"], dtype='S') uni_arr1 = str_arr.astype('>U') uni_arr2 = str_arr.astype('