code: def testSampleIndexBatchTooManyFailedRetries(self):
      memory = self.create_default_memory()
      # Only adding a single observation is not enough to be able to sample
      # (as it both straddles the cursor and does not pass the
      # `index >= self.cursor() - self._update_horizon` check in
      # circular_replay_buffer.py).
      self.add_blank(memory)
      with self.assertRaises(
          RuntimeError,
          msg="Max sample attempts: Tried 10 times but only sampled 1 valid "
          "indices. Batch size is 2",
      ):
          memory.sample_index_batch(2)
  
file_path: ReAgent/reagent/test/replay_memory/prioritized_replay_buffer_test.py
imports: import unittest
  import numpy
  from reagent.replay_memory import prioritized_replay_buffer
label_desc: Use image node_id 9 for calling the PrioritizedReplayBufferTest obj's underlying member method code with example usage: obj.testSampleIndexBatchTooManyFailedRetries() without return types