code: def check_variables_same(test_case, old_vars_numpy, new_vars_numpy):
      """Tests whether the two sets of variables are the same.
  
      Useful for checking if variables were not updated, i.e. a loss step was run.
  
      Args:
        test_case: an instande of tf.test.TestCase for assertions
        old_vars_numpy: numpy representation of old variables
        new_vars_numpy: numpy representation of new variables
      """
  
      # Check that there is no change.
      def same(a, b):
          return np.equal(a, b).all()
  
      vars_same = tf.nest.flatten(
          tf.nest.map_structure(same, old_vars_numpy, new_vars_numpy)
      )
  
      # Assert if all of the variables are the same.
      test_case.assertTrue(np.all(vars_same))
  
imports: import functools
  from absl import logging
  import numpy
  import reverb
  import tensorflow
  from tf_agents.agents.dqn import dqn_agent
  from tf_agents.agents.ppo import ppo_clip_agent
  from tf_agents.environments import suite_gym
  from tf_agents.experimental.distributed import reverb_variable_container
  from tf_agents.networks import actor_distribution_network
  from tf_agents.networks import sequential
  from tf_agents.networks import value_network
  from tf_agents.policies import py_tf_eager_policy
  from tf_agents.replay_buffers import reverb_replay_buffer
  from tf_agents.specs import tensor_spec
  from tf_agents.train import actor
  from tf_agents.train.utils import replay_buffer_utils
  from tf_agents.train.utils import spec_utils
  from tf_agents.train.utils import train_utils
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
label_desc: Use image node_id 9 for calling a global function with example usage: check_variables_same(test_case, old_vars_numpy, new_vars_numpy) and returns: np