code: def _to_array(value):
      
      if hasattr(value, 'shape'):
          return value
      elif hasattr(value, '__len__'):
          return array(value)
      else:
          return float_(value)
docs: When `value` is a plain Python sequence, return it as a NumPy array.