/usr/share/pyshared/Scientific/N.py is in python-scientific 2.8-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | import Scientific_numerics_package_id
package = Scientific_numerics_package_id.getNumericsPackageName()
del Scientific_numerics_package_id
if package == "Numeric":
from Numeric import *
def int_sum(a, axis=0):
return add.reduce(a, axis)
def zeros_st(shape, other):
return zeros(shape, other.typecode())
array_type = ArrayType
elif package == "NumPy":
from numpy.oldnumeric import *
def int_sum(a, axis=0):
return add.reduce(a, axis)
def zeros_st(shape, other):
return zeros(shape, dtype=other.dtype)
from numpy import ndarray as array_type
elif package == "Numarray":
from numarray import *
def int_sum(a, axis=0):
return add.reduce(a, axis, type=Int)
def zeros_st(shape, other):
return zeros(shape, other.typecode())
else:
raise ImportError("Unknown numerics package " + package)
|