code: def normalize_shape(
      shape: Union[type_utils.Shape, tf.TensorShape]
  ) -> type_utils.Shape:
      """Normalize `tf.TensorShape` to tuple of int/None."""
      if isinstance(shape, tf.TensorShape):
          return tuple(
              shape.as_list()
          )  # pytype: disable=attribute-error
      else:
          assert isinstance(shape, tuple)
          return shape
  
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 5 for calling a global function with example usage: normalize_shape(shape) and returns: tuple, shape