code: def list_to_tuple(structure):
      """Replace all lists with tuples.
  
      The fork of nest that tf.data uses treats lists as atoms, while
      tf.nest treats them as structures to recurse into. Keras has chosen to adopt
      the latter convention, and must therefore deeply replace all lists with tuples
      before passing structures to Dataset.from_generator.
  
      Args:
        structure: A nested structure to be remapped.
  
      Returns:
        structure mapped to replace all lists with tuples.
      """
  
      def sequence_fn(instance, args):
          if isinstance(instance, list):
              return tuple(args)
          return nest_util.sequence_like(instance, args)
  
      return nest_util.pack_sequence_as(
          nest_util.Modality.CORE,
          structure,
          flatten(structure),
          False,
          sequence_fn=sequence_fn,
      )
  
imports: from tensorflow.python.util import _pywrap_nest
  from tensorflow.python.util import _pywrap_utils
  from tensorflow.python.util import nest_util
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 25 for calling a global function with example usage: list_to_tuple(structure) and returns: nest_util, nest_util, tuple