code: def _np_to_list(elem):
      """Returns list from list, tuple or ndarray."""
      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))
          )
  
imports: from __future__ import annotations
  from typing import List, Optional, Union
  import numpy
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.features import features_dict
  from tensorflow_datasets.core.features import tensor_feature
  from tensorflow_datasets.core.features import top_level_feature
  from tensorflow_datasets.core.proto import feature_pb2
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import tree_utils
  from tensorflow_datasets.core.utils import type_utils
label_desc: Use image node_id 3 for calling a global function with example usage: _np_to_list(elem) and returns: elem, list, list