code: def test_initialize_qMFKG(self):
      for dtype in (torch.float, torch.double):
          mean = torch.zeros(1, 1, device=self.device, dtype=dtype)
          mm = MockModel(MockPosterior(mean=mean))
          # test error when not specifying current_value
          with self.assertRaises(UnsupportedError):
              qMultiFidelityKnowledgeGradient(
                  model=mm,
                  num_fantasies=None,
                  cost_aware_utility=mock.Mock(),
              )
          # test default construction
          mock_cau = mock.Mock()
          current_value = torch.zeros(
              1, device=self.device, dtype=dtype
          )
          qMFKG = qMultiFidelityKnowledgeGradient(
              model=mm,
              num_fantasies=32,
              current_value=current_value,
              cost_aware_utility=mock_cau,
          )
          self.assertEqual(qMFKG.num_fantasies, 32)
          self.assertIsInstance(qMFKG.sampler, SobolQMCNormalSampler)
          self.assertEqual(qMFKG.sampler.sample_shape, torch.Size([32]))
          self.assertIsNone(qMFKG.objective)
          self.assertIsNone(qMFKG.inner_sampler)
          self.assertIsNone(qMFKG.X_pending)
          self.assertEqual(
              qMFKG.get_augmented_q_batch_size(q=3), 32 + 3
          )
          self.assertEqual(qMFKG.cost_aware_utility, mock_cau)
          self.assertTrue(
              torch.equal(qMFKG.current_value, current_value)
          )
          self.assertIsNone(qMFKG._cost_sampler)
          X = torch.rand(2, 3, device=self.device, dtype=dtype)
          self.assertTrue(torch.equal(qMFKG.project(X), X))
          self.assertTrue(torch.equal(qMFKG.expand(X), X))
          self.assertIsNone(qMFKG.valfunc_cls)
          self.assertIsNone(qMFKG.valfunc_argfac)
          # make sure cost sampling logic works
          self.assertIsInstance(
              qMFKG.cost_sampler, SobolQMCNormalSampler
          )
          self.assertEqual(
              qMFKG.cost_sampler.sample_shape, torch.Size([32])
          )
  
imports: from contextlib import ExitStack
  from unittest import mock
  import torch
  from botorch.acquisition.analytic import PosteriorMean, ScalarizedPosteriorMean
  from botorch.acquisition.cost_aware import GenericCostAwareUtility
  from botorch.acquisition.knowledge_gradient import _get_value_function, _split_fantasy_points, ProjectedAcquisitionFunction, qKnowledgeGradient, qMultiFidelityKnowledgeGradient
  from botorch.acquisition.monte_carlo import qExpectedImprovement, qSimpleRegret
  from botorch.acquisition.objective import GenericMCObjective, ScalarizedPosteriorTransform
  from botorch.acquisition.utils import project_to_sample_points
  from botorch.exceptions.errors import UnsupportedError
  from botorch.generation.gen import gen_candidates_scipy
  from botorch.models import SingleTaskGP
  from botorch.optim.optimize import optimize_acqf
  from botorch.optim.utils import _filter_kwargs
  from botorch.posteriors.gpytorch import GPyTorchPosterior
  from botorch.sampling.normal import IIDNormalSampler, SobolQMCNormalSampler
  from botorch.utils.test_helpers import DummyNonScalarizingPosteriorTransform
  from botorch.utils.testing import BotorchTestCase, MockModel, MockPosterior
  from gpytorch.distributions import MultitaskMultivariateNormal
label_desc: Use image node_id 1 for calling the TestQMultiFidelityKnowledgeGradient obj's underlying member method code with example usage: obj.test_initialize_qMFKG() without return types