code: def test_instantiate_MES(self) -> None:
      model = MaxValueEntropySearch()
      model.fit(
          datasets=self.training_data,
          metric_names=self.metric_names,
          search_space_digest=SearchSpaceDigest(
              feature_names=self.feature_names,
              bounds=self.bounds,
          ),
      )
  
      # test acquisition setting
      X_dummy = torch.ones(1, 3, **self.tkwargs)
      candidate_set = torch.rand(10, 3, **self.tkwargs)
      acq_function = _instantiate_MES(
          model=model.model, candidate_set=candidate_set
      )
  
      self.assertIsInstance(acq_function, qMaxValueEntropy)
      self.assertIsInstance(acq_function.sampler, SobolQMCNormalSampler)
      self.assertIsInstance(
          acq_function.fantasies_sampler, SobolQMCNormalSampler
      )
      self.assertEqual(acq_function.num_fantasies, 16)
      self.assertEqual(acq_function.num_mv_samples, 10)
      self.assertEqual(acq_function.use_gumbel, True)
      self.assertEqual(acq_function.maximize, True)
  
      acq_function = _instantiate_MES(
          model=model.model,
          candidate_set=candidate_set,
          X_pending=X_dummy,
      )
      self.assertTrue(torch.equal(acq_function.X_pending, X_dummy))
  
      # multi-fidelity tests
      model = MaxValueEntropySearch()
      model.fit(
          datasets=self.training_data,
          metric_names=self.metric_names,
          search_space_digest=SearchSpaceDigest(
              feature_names=self.feature_names,
              bounds=self.bounds,
              fidelity_features=[-1],
          ),
      )
  
      candidate_set = torch.rand(10, 3, **self.tkwargs)
      acq_function = _instantiate_MES(
          model=model.model,
          candidate_set=candidate_set,
          target_fidelities={2: 1.0},
      )
      self.assertIsInstance(acq_function, qMultiFidelityMaxValueEntropy)
      Xs = [self.training_data[0].X]
      self.assertEqual(acq_function.expand(Xs), Xs)
  
      # test error that target fidelity and fidelity weight indices must match
      with self.assertRaises(RuntimeError):
          _instantiate_MES(
              model=model.model,
              candidate_set=candidate_set,
              target_fidelities={1: 1.0},
              fidelity_weights={2: 1.0},
          )
  
file_path: Ax/ax/models/tests/test_botorch_mes.py
imports: import dataclasses
  from typing import Any, Dict
  from unittest import mock
  import torch
  from ax.core.search_space import SearchSpaceDigest
  from ax.models.torch.botorch_mes import _instantiate_MES, MaxValueEntropySearch
  from ax.models.torch_base import TorchOptConfig
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.mock import fast_botorch_optimize
  from botorch.acquisition.max_value_entropy_search import qMaxValueEntropy, qMultiFidelityMaxValueEntropy
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models.transforms.input import Warp
  from botorch.sampling.normal import SobolQMCNormalSampler
  from botorch.utils.datasets import SupervisedDataset
label_desc: Use image node_id 4 for calling the MaxValueEntropySearchTest obj's underlying member method code with example usage: obj.test_instantiate_MES() without return types