code: def testProcessExperienceGlobalFeatures(self):
      observation_spec = {
          "f1": tf.TensorSpec(shape=(5,), dtype=tf.string),
          "f2": tf.TensorSpec(shape=(5, 2), dtype=tf.int32),
      }
      time_step_spec = time_step.time_step_spec(observation_spec)
      training_data_spec = trajectory.Trajectory(
          step_type=time_step_spec.step_type,
          observation=time_step_spec.observation,
          action=tensor_spec.BoundedTensorSpec(
              shape=(), minimum=0, maximum=4, dtype=tf.int32
          ),
          policy_info=(),
          next_step_type=time_step_spec.step_type,
          reward=tensor_spec.BoundedTensorSpec(
              shape=(), minimum=0, maximum=2, dtype=tf.float32
          ),
          discount=time_step_spec.discount,
      )
      experience = tensor_spec.sample_spec_nest(
          training_data_spec, outer_dims=(7, 2)
      )
      (
          observation,
          action,
          reward,
      ) = utils.process_experience_for_neural_agents(
          experience, False, training_data_spec
      )
      self.assertAllEqual(
          observation["f1"][0], experience.observation["f1"][0, 0]
      )
      self.assertEqual(action[0], experience.action[0, 0])
      self.assertEqual(reward[0], experience.reward[0, 0])
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  import tensorflow_probability
  from tf_agents.bandits.agents import utils
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
label_desc: Use image node_id 6 for calling the UtilsTest obj's underlying member method code with example usage: obj.testProcessExperienceGlobalFeatures() without return types