code: def stack_nested_arrays(nested_arrays):
      """Stack/batch a list of nested numpy arrays.
  
      Args:
        nested_arrays: A list of nested numpy arrays of the same shape/structure.
  
      Returns:
        A nested array containing batched items, where each batched item is obtained
          by stacking corresponding items from the list of nested_arrays.
      """
      nested_arrays_flattened = [
          tf.nest.flatten(a) for a in nested_arrays
      ]
      batched_nested_array_flattened = [
          np.stack(a) for a in zip(*nested_arrays_flattened)
      ]
      return tf.nest.pack_sequence_as(
          nested_arrays[0], batched_nested_array_flattened
      )
  
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 30 for calling a global function with example usage: stack_nested_arrays(nested_arrays) and returns: tf