code: def array_map(f, ar):
      "Apply an ordinary function to all values in an array."
      flat_ar = ravel(ar)
      out = zeros(len(flat_ar), flat_ar.typecode())
      for i in range(len(flat_ar)):
          out[i] = f(flat_ar[i])
      out.shape = ar.shape
      return ouf array_map(f, ar):
      "Apply an ordinary function to all values in an array."
      flat_ar = ravel(ar)
      out = zeros(len(flat_ar), flat_ar.typecode())
      for i in range(len(flat_ar)):
          out[i] = f(flat_ar[i])
      out.shape = ar.shape
      return out
docs: Apply an ordinary function to all values in an array.