docstr: Test sampling of sequences.
docstr_tok: ["Test","sampling","of","sequences","."]
code: def test_mixin_sampling_sequences(self):
      """Test sampling of sequences."""
      # 50% replay ratio.
      buffer = MultiAgentMixInReplayBuffer(
          capacity=100,
          storage_unit="sequences",
          replay_ratio=0.5,
          replay_sequence_length=2,
          replay_sequence_override=True,
      )
  
      # If we insert and replay n times, expect roughly return batches of
      # len 6 (replay_ratio=0.5 -> 50% replayed samples -> 2 new and 2
      # old sequences with an average length of 1.5 each.
      results = []
      batch = self._generate_episodes()
      for _ in range(400):
          buffer.add(batch)
          sample = buffer.sample(10)
          assert type(sample) == MultiAgentBatch
          results.append(len(sample.policy_batches[DEFAULT_POLICY_ID]))
      self.assertAlmostEqual(
          np.mean(results), 2 * len(batch), delta=0.1
      )
  
file_path: ray/rllib/utils/replay_buffers/tests/test_multi_agent_mixin_replay_buffer.py
imports: import numpy
  import unittest
  from ray.rllib.utils.replay_buffers.multi_agent_mixin_replay_buffer import MultiAgentMixInReplayBuffer
  from ray.rllib.policy.sample_batch import SampleBatch, DEFAULT_POLICY_ID, MultiAgentBatch
label_desc: Use image node_id 4 for calling the TestMixInMultiAgentReplayBuffer obj's underlying member method code with example usage: obj.test_mixin_sampling_sequences() without return types