code: def testGetBatchEpisodeIdsEndEpisode(self):
      spec = [
          specs.TensorSpec([3], tf.float32, "action"),
          [
              specs.TensorSpec([5], tf.float32, "lidar"),
              specs.TensorSpec([3, 2], tf.float32, "camera"),
          ],
      ]
      replay_buffer = episodic_replay_buffer.EpisodicReplayBuffer(
          spec, capacity=3
      )
      batch_episode_ids = [
          replay_buffer.create_episode_ids(num_episodes=3)
      ]
      expected_episode_ids = [[-1, -1, -1]]
      self.evaluate(tf.compat.v1.global_variables_initializer())
      self.evaluate(tf.compat.v1.local_variables_initializer())
  
      batch_episode_ids.append(
          replay_buffer._get_batch_episode_ids(batch_episode_ids[-1])
      )
      with tf.control_dependencies([batch_episode_ids[-1]]):
          completed = [
              replay_buffer._maybe_end_batch_episodes(
                  batch_episode_ids[-1]
              )
          ]
      with tf.control_dependencies(completed):
          completed_episodes = [replay_buffer._completed_episodes()]
      expected_episode_ids.append([0, 1, 2])
      expected_completed = [[False, False, False]]
      expected_completed_episodes = [[]]
  
      # Mark all episodes as completed.
      with tf.control_dependencies([completed_episodes[-1]]):
          batch_episode_ids.append(
              replay_buffer._get_batch_episode_ids(
                  batch_episode_ids[-1], end_episode=True
              )
          )
      with tf.control_dependencies([batch_episode_ids[-1]]):
          completed_episodes.append(replay_buffer._completed_episodes())
      expected_episode_ids.append([0, 1, 2])
      expected_completed_episodes.append([0, 1, 2])
  
      # Begin new episodes, it would overwrite the previous ones.
      with tf.control_dependencies([completed_episodes[-1]]):
          batch_episode_ids.append(
              replay_buffer._get_batch_episode_ids(
                  batch_episode_ids[-1], begin_episode=True
              )
          )
      with tf.control_dependencies([batch_episode_ids[-1]]):
          completed_episodes.append(replay_buffer._completed_episodes())
      expected_episode_ids.append([3, 4, 5])
      expected_completed_episodes.append([])
  
      # Mark one of the new episodes as completed.
      with tf.control_dependencies([completed_episodes[-1]]):
          batch_episode_ids.append(
              replay_buffer._get_batch_episode_ids(
                  batch_episode_ids[-1],
                  end_episode=[False, True, False],
              )
          )
      with tf.control_dependencies([batch_episode_ids[-1]]):
          completed_episodes.append(replay_buffer._completed_episodes())
      expected_episode_ids.append([3, 4, 5])
      expected_completed_episodes.append([4])
  
      (
          batch_episode_ids_values,
          completed_episodes_values,
          completed_values,
      ) = self.evaluate(
          (batch_episode_ids, completed_episodes, completed)
      )
  
      self.assertAllEqual(
          expected_episode_ids, batch_episode_ids_values
      )
      tf.nest.map_structure(
          self.assertAllEqual,
          [np.array(x) for x in expected_completed_episodes],
          completed_episodes_values,
      )
      self.assertAllEqual(expected_completed, completed_values)
  
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 11 for calling the EpisodicReplayBufferTest obj's underlying member method code with example usage: obj.testGetBatchEpisodeIdsEndEpisode() without return types