code: def convert_to_shape(shape: Any) -> type_utils.Shape:
      """Converts a shape to a TFDS shape."""
      if isinstance(shape, tuple):
          return shape
      if isinstance(shape, tf.TensorShape):
          return tuple(shape.as_list())
      if isinstance(shape, list):
          return tuple(shape)
      raise ValueError(
          f"Shape of type {type(shape)} with content {shape} is not supported!"
      )
  
imports: from __future__ import annotations
  import collections
  import contextlib
  from typing import Any, Union
  import numpy
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import tree_utils
  from tensorflow_datasets.core.utils import type_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: convert_to_shape(shape) and returns: shape, tuple, tuple