code: def _tf_data_assert_shallow_structure(
      shallow_tree, input_tree, check_types=True
  ):
      if _tf_data_is_nested(shallow_tree):
          if not _tf_data_is_nested(input_tree):
              raise TypeError(
                  "If shallow structure is a sequence, input must also be a sequence. "
                  f"Input has type: '{type(input_tree).__name__}'."
              )
  
          if check_types and not isinstance(
              input_tree, type(shallow_tree)
          ):
              raise TypeError(
                  "The two structures don't have the same sequence type. Input "
                  f"structure has type '{type(input_tree).__name__}', while shallow "
                  f"structure has type '{type(shallow_tree).__name__}'."
              )
  
          if len(input_tree) != len(shallow_tree):
              raise ValueError(
                  "The two structures don't have the same sequence length. Input "
                  f"structure has length {len(input_tree)}, while shallow structure "
                  f"has length {len(shallow_tree)}."
              )
  
          if check_types and isinstance(
              shallow_tree, _collections_abc.Mapping
          ):
              if set(input_tree) != set(shallow_tree):
                  raise ValueError(
                      "The two structures don't have the same keys. Input "
                      f"structure has keys {list(input_tree)}, while shallow structure "
                      f"has keys {list(shallow_tree)}."
                  )
              input_tree = sorted(input_tree.items())
              shallow_tree = sorted(shallow_tree.items())
  
          for shallow_branch, input_branch in zip(
              shallow_tree, input_tree
          ):
              _tf_data_assert_shallow_structure(
                  shallow_branch, input_branch, check_types=check_types
              )
  
imports: import collections
  import enum
  import wrapt
  from tensorflow.python import pywrap_tensorflow
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import _pywrap_utils
  from tensorflow.python.util.compat import collections_abc
  from tensorflow.python.util.custom_nest_protocol import CustomNestProtocol
label_desc: Use image node_id 30 for calling a global function with example usage: _tf_data_assert_shallow_structure(shallow_tree, input_tree, check_types) without return types