code: def np_to_list(elem):
    
    if isinstance(elem, list):
      return elem
    elif isinstance(elem, tuple):
      return list(elem)
    elif isinstance(elem, np.ndarray):
      return list(elem)
    else:
      raise ValueError(
          'Input elements of a sequence should be either a numpy array, a '
          'python list or tuple. Got {}'.format(type(elem)))
docs: Returns list from list, tuple or ndarray.