golden hour
/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/core
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.py
5.64 KB
Del
OK
__init__.pyi
126 B
Del
OK
__pycache__
-
Del
OK
_add_newdocs.py
204.07 KB
Del
OK
_add_newdocs_scalars.py
11.82 KB
Del
OK
_asarray.py
3.79 KB
Del
OK
_asarray.pyi
1.06 KB
Del
OK
_dtype.py
10.36 KB
Del
OK
_dtype_ctypes.py
3.59 KB
Del
OK
_exceptions.py
5.25 KB
Del
OK
_internal.py
27.68 KB
Del
OK
_internal.pyi
1.01 KB
Del
OK
_machar.py
11.29 KB
Del
OK
_methods.py
8.41 KB
Del
OK
_multiarray_tests.cpython-311-x86_64-linux-gnu.so
171.79 KB
Del
OK
_multiarray_umath.cpython-311-x86_64-linux-gnu.so
6.66 MB
Del
OK
_operand_flag_tests.cpython-311-x86_64-linux-gnu.so
16.67 KB
Del
OK
_rational_tests.cpython-311-x86_64-linux-gnu.so
58.41 KB
Del
OK
_simd.cpython-311-x86_64-linux-gnu.so
2.47 MB
Del
OK
_string_helpers.py
2.79 KB
Del
OK
_struct_ufunc_tests.cpython-311-x86_64-linux-gnu.so
16.77 KB
Del
OK
_type_aliases.py
7.36 KB
Del
OK
_type_aliases.pyi
404 B
Del
OK
_ufunc_config.py
13.62 KB
Del
OK
_ufunc_config.pyi
1.04 KB
Del
OK
_umath_tests.cpython-311-x86_64-linux-gnu.so
41.32 KB
Del
OK
arrayprint.py
62.12 KB
Del
OK
arrayprint.pyi
4.32 KB
Del
OK
cversions.py
347 B
Del
OK
defchararray.py
71.89 KB
Del
OK
defchararray.pyi
9 KB
Del
OK
einsumfunc.py
50.65 KB
Del
OK
einsumfunc.pyi
4.75 KB
Del
OK
fromnumeric.py
125.8 KB
Del
OK
fromnumeric.pyi
22.96 KB
Del
OK
function_base.py
19.37 KB
Del
OK
function_base.pyi
4.61 KB
Del
OK
generate_numpy_api.py
7.47 KB
Del
OK
getlimits.py
25.26 KB
Del
OK
getlimits.pyi
82 B
Del
OK
include
-
Del
OK
lib
-
Del
OK
memmap.py
11.5 KB
Del
OK
memmap.pyi
55 B
Del
OK
multiarray.py
54.78 KB
Del
OK
multiarray.pyi
24.19 KB
Del
OK
numeric.py
75.21 KB
Del
OK
numeric.pyi
13.9 KB
Del
OK
numerictypes.py
17.67 KB
Del
OK
numerictypes.pyi
3.19 KB
Del
OK
overrides.py
6.93 KB
Del
OK
records.py
36.65 KB
Del
OK
records.pyi
5.56 KB
Del
OK
setup.py
47.05 KB
Del
OK
setup_common.py
16.68 KB
Del
OK
shape_base.py
29.05 KB
Del
OK
shape_base.pyi
2.71 KB
Del
OK
tests
-
Del
OK
umath.py
1.99 KB
Del
OK
umath_tests.py
389 B
Del
OK
Edit: _string_helpers.py
""" 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