Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib64 /
python2.7 /
site-packages /
numpy /
testing /
Delete
Unzip
Name
Size
Permission
Date
Action
tests
[ DIR ]
drwxr-xr-x
2021-09-16 10:54
__init__.py
424
B
-rw-r--r--
2013-04-07 01:04
__init__.pyc
677
B
-rw-r--r--
2018-04-10 19:40
__init__.pyo
677
B
-rw-r--r--
2018-04-10 19:40
decorators.py
8.27
KB
-rw-r--r--
2013-04-07 01:04
decorators.pyc
9.5
KB
-rw-r--r--
2018-04-10 19:40
decorators.pyo
9.5
KB
-rw-r--r--
2018-04-10 19:40
noseclasses.py
14.02
KB
-rw-r--r--
2013-04-07 01:04
noseclasses.pyc
10.97
KB
-rw-r--r--
2018-04-10 19:40
noseclasses.pyo
10.97
KB
-rw-r--r--
2018-04-10 19:40
nosetester.py
14.93
KB
-rw-r--r--
2013-04-07 01:04
nosetester.pyc
13.89
KB
-rw-r--r--
2018-04-10 19:40
nosetester.pyo
13.89
KB
-rw-r--r--
2018-04-10 19:40
nulltester.py
419
B
-rw-r--r--
2013-04-07 01:04
nulltester.pyc
917
B
-rw-r--r--
2018-04-10 19:40
nulltester.pyo
917
B
-rw-r--r--
2018-04-10 19:40
numpytest.py
1.42
KB
-rw-r--r--
2013-04-07 01:04
numpytest.pyc
1.91
KB
-rw-r--r--
2018-04-10 19:40
numpytest.pyo
1.91
KB
-rw-r--r--
2018-04-10 19:40
print_coercion_tables.py
2.46
KB
-rw-r--r--
2013-04-07 01:04
print_coercion_tables.pyc
2.83
KB
-rw-r--r--
2018-04-10 19:40
print_coercion_tables.pyo
2.83
KB
-rw-r--r--
2018-04-10 19:40
setup.py
598
B
-rw-r--r--
2013-04-07 01:04
setup.pyc
889
B
-rw-r--r--
2018-04-10 19:40
setup.pyo
889
B
-rw-r--r--
2018-04-10 19:40
setupscons.py
564
B
-rw-r--r--
2013-04-07 01:04
setupscons.pyc
857
B
-rw-r--r--
2018-04-10 19:40
setupscons.pyo
857
B
-rw-r--r--
2018-04-10 19:40
utils.py
49.34
KB
-rw-r--r--
2013-04-07 01:04
utils.pyc
48.13
KB
-rw-r--r--
2018-04-10 19:40
utils.pyo
48.13
KB
-rw-r--r--
2018-04-10 19:40
Save
Rename
#!/usr/bin/env python """Prints type-coercion tables for the built-in NumPy types""" import numpy as np # Generic object that can be added, but doesn't do anything else class GenericObject(object): def __init__(self, v): self.v = v def __add__(self, other): return self def __radd__(self, other): return self dtype = np.dtype('O') def print_cancast_table(ntypes): print 'X', for char in ntypes: print char, print for row in ntypes: print row, for col in ntypes: print int(np.can_cast(row, col)), print def print_coercion_table(ntypes, inputfirstvalue, inputsecondvalue, firstarray, use_promote_types=False): print '+', for char in ntypes: print char, print for row in ntypes: if row == 'O': rowtype = GenericObject else: rowtype = np.obj2sctype(row) print row, for col in ntypes: if col == 'O': coltype = GenericObject else: coltype = np.obj2sctype(col) try: if firstarray: rowvalue = np.array([rowtype(inputfirstvalue)], dtype=rowtype) else: rowvalue = rowtype(inputfirstvalue) colvalue = coltype(inputsecondvalue) if use_promote_types: char = np.promote_types(rowvalue.dtype, colvalue.dtype).char else: value = np.add(rowvalue,colvalue) if isinstance(value, np.ndarray): char = value.dtype.char else: char = np.dtype(type(value)).char except ValueError: char = '!' except OverflowError: char = '@' except TypeError: char = '#' print char, print print "can cast" print_cancast_table(np.typecodes['All']) print print "In these tables, ValueError is '!', OverflowError is '@', TypeError is '#'" print print "scalar + scalar" print_coercion_table(np.typecodes['All'], 0, 0, False) print print "scalar + neg scalar" print_coercion_table(np.typecodes['All'], 0, -1, False) print print "array + scalar" print_coercion_table(np.typecodes['All'], 0, 0, True) print print "array + neg scalar" print_coercion_table(np.typecodes['All'], 0, -1, True) print print "promote_types" print_coercion_table(np.typecodes['All'], 0, 0, False, True)