code: def test_sample(self):
      buffer = FifoReplayBuffer()
  
      buffer.add(
          SampleBatch(
              {
                  SampleBatch.T: [1],
                  SampleBatch.ACTIONS: [np.random.choice([0, 1])],
                  SampleBatch.REWARDS: [np.random.rand()],
                  SampleBatch.OBS: [np.random.random((4,))],
                  SampleBatch.NEXT_OBS: [np.random.random((4,))],
                  SampleBatch.TERMINATEDS: [
                      np.random.choice([False, True])
                  ],
                  SampleBatch.TRUNCATEDS: [
                      np.random.choice([False, False])
                  ],
              }
          )
      )
      buffer.add(
          SampleBatch(
              {
                  SampleBatch.T: [2],
                  SampleBatch.ACTIONS: [np.random.choice([0, 1])],
                  SampleBatch.REWARDS: [np.random.rand()],
                  SampleBatch.OBS: [np.random.random((4,))],
                  SampleBatch.NEXT_OBS: [np.random.random((4,))],
                  SampleBatch.TERMINATEDS: [
                      np.random.choice([False, False])
                  ],
                  SampleBatch.TRUNCATEDS: [
                      np.random.choice([False, True])
                  ],
              }
          )
      )
  
      batch = buffer.sample()
      self.assertEqual(batch[SampleBatch.T][0], 1)
      batch = buffer.sample()
      self.assertEqual(batch[SampleBatch.T][0], 2)
  
file_path: ray/python/ray/rllib/utils/replay_buffers/tests/test_fifo_replay_buffer.py
imports: import unittest
  import numpy
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.replay_buffers.fifo_replay_buffer import FifoReplayBuffer
label_desc: Use image node_id 2 for calling the TestFifoReplayBuffer obj's underlying member method code with example usage: obj.test_sample() without return types