code: def merge_shape(
      tf_shape: Union[tf.Tensor, np.ndarray], np_shape: type_utils.Shape
  ):
      """Returns the most static version of the shape.
  
      Static `None` values are replaced by dynamic `tf.Tensor` values.
  
      Example:
  
      ```
      merge_shape(
          tf_shape=tf.constant([28, 28, 3]),
          np_shape=(None, None, 3),
      ) == (tf.Tensor(numpy=28), tf.Tensor(numpy=28), 3)
      ```
  
      Args:
        tf_shape: The tf.Tensor containing the shape (e.g. `tf.shape(x)`)
        np_shape: The static shape tuple (e.g. `(None, None, 3)`)
  
      Returns:
        A tuple like np_shape, but with `None` values replaced by `tf.Tensor` values
      """
      assert_shape_match(tf_shape.shape, (len(np_shape),))
      return tuple(
          tf_shape[i] if dim is None else dim
          for i, dim in enumerate(np_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 6 for calling a global function with example usage: merge_shape(tf_shape, np_shape) and returns: tuple