code: def fast_map_structure(func, *structure, **kwargs):
      expand_composites = kwargs.get("expand_composites", False)
      flat_structure = [
          tf.nest.flatten(s, expand_composites=expand_composites)
          for s in structure
      ]
      entries = zip(*flat_structure)
  
      return tf.nest.pack_sequence_as(
          structure[0],
          [func(*x) for x in entries],
          expand_composites=expand_composites,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import numbers
  from typing import Optional, Text
  from absl import logging
  import numpy
  from six.moves import zip
  import tensorflow
  from tf_agents.typing import types
  from tf_agents.utils import composite
  import wrapt
  from tensorflow.python.util import nest
label_desc: Use image node_id 4 for calling a global function with example usage: fast_map_structure(func) and returns: tf