code: def _to_array(value):
      
      if isinstance(value, (tuple, list)):
          return array(value)
      elif isinstance(value, (float, int)):
          return np.float64(value)
      else:
          return value
docs: As a convenience, turn Python lists and tuples into NumPy arrays.