code: def testParallelAddOverCapacity(self):
      num_adds = 3
      spec = specs.TensorSpec([], tf.int32, "action")
      replay_buffer = episodic_replay_buffer.EpisodicReplayBuffer(
          spec,
          capacity=4,
          begin_episode_fn=lambda _: True,
          end_episode_fn=lambda _: False,
      )
  
      a = common.create_variable("a", 0, dtype=spec.dtype)
      b = common.create_variable("b", 10, dtype=spec.dtype)
  
      replay_buffer_stateful_0 = (
          episodic_replay_buffer.StatefulEpisodicReplayBuffer(
              replay_buffer, num_episodes=1
          )
      )
      replay_buffer_stateful_1 = (
          episodic_replay_buffer.StatefulEpisodicReplayBuffer(
              replay_buffer, num_episodes=1
          )
      )
      episode_id_var_0 = replay_buffer_stateful_0.episode_ids
      episode_id_var_1 = replay_buffer_stateful_1.episode_ids
  
      expected = [2, 12, 1, 11]
  
      @common.function
      def add_elem_0(variable):
          elem = tf.expand_dims(variable, 0)
          replay_buffer_stateful_0.add_batch(elem)
          return elem
  
      @common.function
      def add_elem_1(variable):
          elem = tf.expand_dims(variable, 0)
          replay_buffer_stateful_1.add_batch(elem)
          return elem
  
      self.evaluate(tf.compat.v1.global_variables_initializer())
      self.evaluate(tf.compat.v1.local_variables_initializer())
      for _ in range(num_adds):
          self.evaluate([add_elem_0(a), add_elem_1(b)])
          self.evaluate([a.assign_add(1), b.assign_add(1)])
      items = replay_buffer.gather_all()
      items_ = self.evaluate(items)[0]
      episode_ids = self.evaluate([episode_id_var_0, episode_id_var_1])
      self.assertSameElements(episode_ids, [4, 5])
      self.assertSameElements(items_, expected)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tf_agents import specs
  from tf_agents.replay_buffers import episodic_replay_buffer
  from tf_agents.utils import common
  from tf_agents.utils import test_utils
  from tensorflow.python.ops import list_ops
label_desc: Use image node_id 14 for calling the StatefulEpisodicReplayBufferTest obj's underlying member method code with example usage: obj.testParallelAddOverCapacity() and returns: elem, elem