code: def testGetEpisodeId(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=2
      )
      episode_id = replay_buffer.create_episode_ids()
      self.evaluate(tf.compat.v1.global_variables_initializer())
      self.evaluate(tf.compat.v1.local_variables_initializer())
      self.assertEqual(self.evaluate(episode_id), -1)
  
      # episode_id should be updated when begin_episode is True.
      new_episode_id_0 = replay_buffer._get_episode_id(
          episode_id, begin_episode=True
      )
  
      # episode_id should not be updated when begin_episode is False and the input
      # episode_id is not negative.
      new_episode_id_1 = replay_buffer._get_episode_id(
          new_episode_id_0, begin_episode=False
      )
  
      # episode_id should be updated when begin_episode is True even when the
      # input episode_id is not negative.
      new_episode_id_2 = replay_buffer._get_episode_id(
          new_episode_id_1, begin_episode=True
      )
  
      (
          new_episode_id_0_value,
          new_episode_id_1_value,
          new_episode_id_2_value,
      ) = self.evaluate(
          (new_episode_id_0, new_episode_id_1, new_episode_id_2)
      )
  
      self.assertEqual(new_episode_id_0_value, 0)
      self.assertEqual(new_episode_id_1_value, 0)
      self.assertEqual(new_episode_id_2_value, 1)
  
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 6 for calling the EpisodicReplayBufferTest obj's underlying member method code with example usage: obj.testGetEpisodeId() without return types