code: def test_GetQPI(self, mock_acqf):
      # basic test
      n = len(self.X_observed)
      mean = torch.arange(n, dtype=torch.double).view(-1, 1)
      var = torch.ones_like(mean)
      self.model = MockModel(MockPosterior(mean=mean, variance=var))
      acqf = get_acquisition_function(
          acquisition_function_name="qPI",
          model=self.model,
          objective=self.objective,
          X_observed=self.X_observed,
          X_pending=self.X_pending,
          mc_samples=self.mc_samples,
          seed=self.seed,
      )
      self.assertEqual(acqf, mock_acqf.return_value)
      best_f = (
          self.objective(self.model.posterior(self.X_observed).mean)
          .max()
          .item()
      )
      mock_acqf.assert_called_once_with(
          model=self.model,
          best_f=best_f,
          sampler=mock.ANY,
          objective=self.objective,
          posterior_transform=None,
          X_pending=self.X_pending,
          tau=1e-3,
          constraints=None,
          eta=1e-3,
      )
      args, kwargs = mock_acqf.call_args
      self.assertEqual(args, ())
      sampler = kwargs["sampler"]
      self.assertEqual(
          sampler.sample_shape, torch.Size([self.mc_samples])
      )
      self.assertEqual(sampler.seed, 1)
      self.assertTrue(torch.equal(kwargs["X_pending"], self.X_pending))
      # test with different tau, non-qmc
      acqf = get_acquisition_function(
          acquisition_function_name="qPI",
          model=self.model,
          objective=self.objective,
          X_observed=self.X_observed,
          X_pending=self.X_pending,
          mc_samples=self.mc_samples,
          seed=2,
          tau=1.0,
      )
      self.assertEqual(mock_acqf.call_count, 2)
      args, kwargs = mock_acqf.call_args
      self.assertEqual(args, ())
      self.assertEqual(kwargs["tau"], 1.0)
      sampler = kwargs["sampler"]
      self.assertEqual(
          sampler.sample_shape, torch.Size([self.mc_samples])
      )
      self.assertEqual(sampler.seed, 2)
      self.assertTrue(torch.equal(kwargs["X_pending"], self.X_pending))
      acqf = get_acquisition_function(
          acquisition_function_name="qPI",
          model=self.model,
          objective=self.objective,
          X_observed=self.X_observed,
          X_pending=self.X_pending,
          mc_samples=self.mc_samples,
          seed=2,
          tau=1.0,
      )
      # test batched model
      self.model = MockModel(MockPosterior(mean=torch.zeros(1, 2, 1)))
      acqf = get_acquisition_function(
          acquisition_function_name="qPI",
          model=self.model,
          objective=self.objective,
          X_observed=self.X_observed,
          X_pending=self.X_pending,
          mc_samples=self.mc_samples,
          seed=self.seed,
      )
      self.assertEqual(acqf, mock_acqf.return_value)
  
      # with constraints
      n = len(self.X_observed)
      mean = torch.arange(n, dtype=torch.double).view(-1, 1)
      var = torch.ones_like(mean)
      self.model = MockModel(MockPosterior(mean=mean, variance=var))
      upper_bound = self.Y[0, 0] + 1 / 2  # = 1.5
      constraints = [lambda samples: samples[..., 0] - upper_bound]
      eta = math.pi * 1e-2  # testing non-standard eta
      acqf = get_acquisition_function(
          acquisition_function_name="qPI",
          model=self.model,
          objective=self.objective,
          X_observed=self.X_observed,
          X_pending=self.X_pending,
          mc_samples=self.mc_samples,
          seed=self.seed,
          marginalize_dim=0,
          constraints=constraints,
          eta=eta,
      )
      self.assertEqual(acqf, mock_acqf.return_value)
      best_feasible_f = compute_best_feasible_objective(
          samples=mean,
          obj=self.objective(mean),
          constraints=constraints,
          model=self.model,
          objective=self.objective,
          X_baseline=self.X_observed,
      )
      mock_acqf.assert_called_with(
          model=self.model,
          best_f=best_feasible_f,
          sampler=mock.ANY,
          objective=self.objective,
          posterior_transform=None,
          X_pending=self.X_pending,
          tau=1e-3,
          constraints=constraints,
          eta=eta,
      )
  
imports: import math
  from unittest import mock
  import torch
  from botorch.acquisition import logei, monte_carlo
  from botorch.acquisition.factory import get_acquisition_function
  from botorch.acquisition.multi_objective import logei, MCMultiOutputObjective, monte_carlo
  from botorch.acquisition.objective import MCAcquisitionObjective, ScalarizedPosteriorTransform
  from botorch.acquisition.utils import compute_best_feasible_objective
  from botorch.utils.multi_objective.box_decompositions.non_dominated import FastNondominatedPartitioning, NondominatedPartitioning
  from botorch.utils.testing import BotorchTestCase, MockModel, MockPosterior
  from gpytorch.distributions import MultivariateNormal
  from torch import Tensor
label_desc: Use image node_id 5 for calling the TestGetAcquisitionFunction obj's underlying member method code with example usage: obj.test_GetQPI(mock_acqf) without return types