code: def numberarray(x, shape):
      
      try:
          iter(x)
      except TypeError:
          return numpy.ones(shape) * x
      else:
          return x
docs: Return x if it is an array or create an array and fill it with x.