code: def test_mc_sampler_mixin(self):
      mm = MockModel(MockPosterior(samples=torch.rand(1, 2)))
      acqf = DummyMCAcqf(model=mm, sampler=None)
      self.assertIsNone(acqf.sampler)
      samples = acqf.get_posterior_samples(mm._posterior)
      self.assertEqual(samples.shape, torch.Size([512, 1, 2]))
      self.assertIsInstance(acqf.sampler, StochasticSampler)
      sampler = IIDNormalSampler(sample_shape=torch.Size([2]))
      acqf.sampler = sampler
      self.assertIs(acqf.sampler, sampler)
  
imports: import torch
  from botorch.acquisition.acquisition import AcquisitionFunction, MCSamplerMixin, MultiModelAcquisitionFunction, OneShotAcquisitionFunction
  from botorch.models.model import ModelDict
  from botorch.sampling.normal import IIDNormalSampler
  from botorch.sampling.stochastic_samplers import StochasticSampler
  from botorch.utils.testing import BotorchTestCase, MockModel, MockPosterior
label_desc: Use image node_id 1 for calling the TestMCSamplerMixin obj's underlying member method code with example usage: obj.test_mc_sampler_mixin() without return types