/
opt
/
imh-python
/
lib
/
python3.9
/
site-packages
/
numpy
/
core
/
/opt/imh-python/lib/python3.9/site-packages/numpy/core
mkdir
upload
Name
Size
Mode
Actions
include/
-
0755
rm
lib/
-
0755
rm
tests/
-
0755
rm
__pycache__/
-
0755
rm
arrayprint.py
63608
0644
edit
dl
rm
arrayprint.pyi
4428
0644
edit
dl
rm
cversions.py
347
0644
edit
dl
rm
defchararray.py
73617
0644
edit
dl
rm
defchararray.pyi
9216
0644
edit
dl
rm
einsumfunc.py
51868
0644
edit
dl
rm
einsumfunc.pyi
4860
0644
edit
dl
rm
fromnumeric.py
128821
0644
edit
dl
rm
fromnumeric.pyi
23726
0644
edit
dl
rm
function_base.py
19836
0644
edit
dl
rm
function_base.pyi
4725
0644
edit
dl
rm
getlimits.py
25865
0644
edit
dl
rm
getlimits.pyi
82
0644
edit
dl
rm
memmap.py
11771
0644
edit
dl
rm
memmap.pyi
55
0644
edit
dl
rm
multiarray.py
56097
0644
edit
dl
rm
multiarray.pyi
24768
0644
edit
dl
rm
numeric.py
77014
0644
edit
dl
rm
numeric.pyi
14315
0644
edit
dl
rm
numerictypes.py
18098
0644
edit
dl
rm
numerictypes.pyi
3267
0644
edit
dl
rm
overrides.py
7093
0644
edit
dl
rm
records.py
37533
0644
edit
dl
rm
records.pyi
5692
0644
edit
dl
rm
shape_base.py
29743
0644
edit
dl
rm
shape_base.pyi
2774
0644
edit
dl
rm
umath.py
2040
0644
edit
dl
rm
umath_tests.py
389
0644
edit
dl
rm
_add_newdocs.py
208972
0644
edit
dl
rm
_add_newdocs_scalars.py
12106
0644
edit
dl
rm
_asarray.py
3884
0644
edit
dl
rm
_asarray.pyi
1086
0644
edit
dl
rm
_dtype.py
10606
0644
edit
dl
rm
_dtype_ctypes.py
3673
0644
edit
dl
rm
_exceptions.py
5379
0644
edit
dl
rm
_internal.py
28348
0644
edit
dl
rm
_internal.pyi
1032
0644
edit
dl
rm
_machar.py
11565
0644
edit
dl
rm
_methods.py
8613
0644
edit
dl
rm
_multiarray_tests.cpython-39-x86_64-linux-gnu.so
151008
0755
edit
dl
rm
_multiarray_umath.cpython-39-x86_64-linux-gnu.so
7382112
0755
edit
dl
rm
_operand_flag_tests.cpython-39-x86_64-linux-gnu.so
16728
0755
edit
dl
rm
_rational_tests.cpython-39-x86_64-linux-gnu.so
59640
0755
edit
dl
rm
_simd.cpython-39-x86_64-linux-gnu.so
3526664
0755
edit
dl
rm
_string_helpers.py
2852
0644
edit
dl
rm
_struct_ufunc_tests.cpython-39-x86_64-linux-gnu.so
16832
0755
edit
dl
rm
_type_aliases.py
7534
0644
edit
dl
rm
_type_aliases.pyi
404
0644
edit
dl
rm
_ufunc_config.py
13944
0644
edit
dl
rm
_ufunc_config.pyi
1066
0644
edit
dl
rm
_umath_tests.cpython-39-x86_64-linux-gnu.so
42008
0755
edit
dl
rm
__init__.py
5780
0644
edit
dl
rm
__init__.pyi
126
0644
edit
dl
rm
Edit:
/opt/imh-python/lib/python3.9/site-packages/numpy/core/_string_helpers.py
(2852B)
""" String-handling utilities to avoid locale-dependence. Used primarily to generate type name aliases. """ # "import string" is costly to import! # Construct the translation tables directly # "A" = chr(65), "a" = chr(97) _all_chars = tuple(map(chr, range(256))) _ascii_upper = _all_chars[65:65+26] _ascii_lower = _all_chars[97:97+26] LOWER_TABLE = "".join(_all_chars[:65] + _ascii_lower + _all_chars[65+26:]) UPPER_TABLE = "".join(_all_chars[:97] + _ascii_upper + _all_chars[97+26:]) def english_lower(s): """ Apply English case rules to convert ASCII strings to all lower case. This is an internal utility function to replace calls to str.lower() such that we can avoid changing behavior with changing locales. In particular, Turkish has distinct dotted and dotless variants of the Latin letter "I" in both lowercase and uppercase. Thus, "I".lower() != "i" in a "tr" locale. Parameters ---------- s : str Returns ------- lowered : str Examples -------- >>> from numpy.core.numerictypes import english_lower >>> english_lower('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_') 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789_' >>> english_lower('') '' """ lowered = s.translate(LOWER_TABLE) return lowered def english_upper(s): """ Apply English case rules to convert ASCII strings to all upper case. This is an internal utility function to replace calls to str.upper() such that we can avoid changing behavior with changing locales. In particular, Turkish has distinct dotted and dotless variants of the Latin letter "I" in both lowercase and uppercase. Thus, "i".upper() != "I" in a "tr" locale. Parameters ---------- s : str Returns ------- uppered : str Examples -------- >>> from numpy.core.numerictypes import english_upper >>> english_upper('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_') 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_' >>> english_upper('') '' """ uppered = s.translate(UPPER_TABLE) return uppered def english_capitalize(s): """ Apply English case rules to convert the first character of an ASCII string to upper case. This is an internal utility function to replace calls to str.capitalize() such that we can avoid changing behavior with changing locales. Parameters ---------- s : str Returns ------- capitalized : str Examples -------- >>> from numpy.core.numerictypes import english_capitalize >>> english_capitalize('int8') 'Int8' >>> english_capitalize('Int8') 'Int8' >>> english_capitalize('') '' """ if s: return english_upper(s[0]) + s[1:] else: return s
Save
cmd:
run