code: def test_prune_baseline(self):
      no = "botorch.utils.testing.MockModel.num_outputs"
      prune = "botorch.acquisition.logei.prune_inferior_points"
      constraints = [lambda Y: Y[..., 1] + 0.1]
      # only the last sample if feasible and it has the worst objective value
  
      for dtype in (torch.float, torch.double):
          samples = torch.tensor(
              [[1.0, 1.0], [0.0, 0.0], [-1.0, -1.0]],
              device=self.device,
              dtype=dtype,
          )
          mm = MockModel(
              MockPosterior(
                  samples=samples,
              )
          )
          X_baseline = torch.zeros(
              3, 1, device=self.device, dtype=dtype
          )
          with mock.patch(
              no, new_callable=mock.PropertyMock
          ) as mock_num_outputs:
              mock_num_outputs.return_value = 2
              with mock.patch(
                  prune, wraps=prune_inferior_points
              ) as mock_prune:
                  acqf = qLogNoisyExpectedImprovement(
                      model=mm,
                      X_baseline=X_baseline,
                      prune_baseline=True,
                      cache_root=False,
                      objective=GenericMCObjective(
                          objective=lambda Y: Y[..., 0]
                      ),
                      constraints=constraints,
                  )
              mock_prune.assert_called_once()
              self.assertIs(
                  mock_prune.call_args[1]["constraints"], constraints
              )
              self.assertTrue(
                  torch.equal(acqf.X_baseline, X_baseline[[-1]])
              )
              # test marginalize_dim
              samples2 = torch.stack([samples, samples * 2], dim=0)
              mm = MockModel(
                  MockPosterior(
                      samples=samples2,
                  )
              )
              with mock.patch(
                  prune, wraps=prune_inferior_points
              ) as mock_prune:
                  acqf = qLogNoisyExpectedImprovement(
                      model=mm,
                      X_baseline=X_baseline,
                      prune_baseline=True,
                      cache_root=False,
                      marginalize_dim=-3,
                      objective=GenericMCObjective(
                          objective=lambda Y: Y[..., 0]
                      ),
                      constraints=constraints,
                  )
                  mock_prune.assert_called_once()
                  _, kwargs = mock_prune.call_args
                  self.assertIs(kwargs["constraints"], constraints)
                  self.assertTrue(
                      torch.equal(acqf.X_baseline, X_baseline[[-1]])
                  )
                  self.assertEqual(kwargs["marginalize_dim"], -3)
  
imports: import warnings
  from copy import deepcopy
  from itertools import product
  from math import pi
  from unittest import mock
  import torch
  from botorch import settings
  from botorch.acquisition import AcquisitionFunction, LogImprovementMCAcquisitionFunction, qLogExpectedImprovement, qLogNoisyExpectedImprovement
  from botorch.acquisition.analytic import ExpectedImprovement, LogExpectedImprovement, LogNoisyExpectedImprovement, NoisyExpectedImprovement
  from botorch.acquisition.input_constructors import ACQF_INPUT_CONSTRUCTOR_REGISTRY
  from botorch.acquisition.monte_carlo import qExpectedImprovement, qNoisyExpectedImprovement
  from botorch.acquisition.multi_objective.logei import qLogNoisyExpectedHypervolumeImprovement
  from botorch.acquisition.objective import ConstrainedMCObjective, GenericMCObjective, IdentityMCObjective, PosteriorTransform, ScalarizedPosteriorTransform
  from botorch.acquisition.utils import prune_inferior_points
  from botorch.exceptions import BotorchWarning, UnsupportedError
  from botorch.exceptions.errors import BotorchError
  from botorch.models import ModelListGP, SingleTaskGP
  from botorch.models.gp_regression import FixedNoiseGP
  from botorch.sampling.normal import IIDNormalSampler, SobolQMCNormalSampler
  from botorch.utils.low_rank import sample_cached_cholesky
  from botorch.utils.testing import BotorchTestCase, MockModel, MockPosterior
  from botorch.utils.transforms import standardize
  from torch import Tensor
label_desc: Use image node_id 3 for calling the TestQLogNoisyExpectedImprovement obj's underlying member method code with example usage: obj.test_prune_baseline() without return types