code: def test_batch_range(self):
      posterior = MockPosterior()
      sampler = NonAbstractSampler(sample_shape=torch.Size([4]))
      # Default: read from the posterior.
      self.assertEqual(
          sampler._get_batch_range(posterior=posterior),
          posterior.batch_range,
      )
      # Overwrite.
      sampler.batch_range_override = (0, -5)
      self.assertEqual(
          sampler._get_batch_range(posterior=posterior), (0, -5)
      )
  
file_path: botorch/test/sampling/test_base.py
imports: import torch
  from botorch.exceptions.errors import InputDataError
  from botorch.sampling.base import MCSampler
  from botorch.utils.testing import BotorchTestCase, MockPosterior
label_desc: Use image node_id 3 for calling the TestBaseMCSampler obj's underlying member method code with example usage: obj.test_batch_range() without return types