code: def test_get_botorch_objective(self, _) -> None:
      # For KG with outcome constraints, use a ConstrainedMCObjective
      obj, tf = get_botorch_objective_and_transform(
          botorch_acqf_class=qKnowledgeGradient,
          model=self.mock_botorch_model,
          outcome_constraints=self.outcome_constraints,
          objective_weights=self.objective_weights,
          X_observed=self.X_dummy,
      )
      self.assertIsInstance(obj, ConstrainedMCObjective)
      self.assertIsNone(tf)
  
      # SampleReducingMCAcquisitionFunctions with outcome constraints, handle
      # the constraints separately
      obj, tf = get_botorch_objective_and_transform(
          botorch_acqf_class=qLogNoisyExpectedImprovement,
          model=self.mock_botorch_model,
          outcome_constraints=self.outcome_constraints,
          objective_weights=self.objective_weights,
          X_observed=self.X_dummy,
      )
      self.assertIsInstance(obj, GenericMCObjective)
      self.assertIsNone(tf)
  
      # By default, `ScalarizedPosteriorTransform` should be picked in absence of
      # outcome constraints.
      obj, tf = get_botorch_objective_and_transform(
          botorch_acqf_class=qNoisyExpectedImprovement,
          model=self.mock_botorch_model,
          objective_weights=self.objective_weights,
          X_observed=self.X_dummy,
      )
      self.assertIsNone(obj)
      self.assertIsInstance(tf, ScalarizedPosteriorTransform)
  
      # Test MOO case.
      with self.assertRaises(BotorchTensorDimensionError):
          get_botorch_objective_and_transform(
              botorch_acqf_class=qNoisyExpectedHypervolumeImprovement,
              model=self.mock_botorch_model,
              objective_weights=self.objective_weights,  # Only has 1 objective.
              X_observed=self.X_dummy,
          )
  
      obj, tf = get_botorch_objective_and_transform(
          botorch_acqf_class=qNoisyExpectedHypervolumeImprovement,
          model=self.mock_botorch_model,
          objective_weights=self.moo_objective_weights,  # Has 2 objectives.
          X_observed=self.X_dummy,
      )
      self.assertIsInstance(obj, WeightedMCMultiOutputObjective)
      self.assertIsNone(tf)
  
imports: from typing import Set, Tuple
  from unittest.mock import MagicMock, Mock, patch
  import torch
  from ax.exceptions.core import UnsupportedError
  from ax.models.torch.utils import _get_X_pending_and_observed, get_botorch_objective_and_transform
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import checked_cast, not_none
  from botorch.acquisition.knowledge_gradient import qKnowledgeGradient
  from botorch.acquisition.logei import qLogNoisyExpectedImprovement
  from botorch.acquisition.monte_carlo import qNoisyExpectedImprovement
  from botorch.acquisition.multi_objective.monte_carlo import qNoisyExpectedHypervolumeImprovement
  from botorch.acquisition.multi_objective.multi_output_risk_measures import MARS, MultiOutputExpectation
  from botorch.acquisition.multi_objective.objective import WeightedMCMultiOutputObjective
  from botorch.acquisition.objective import ConstrainedMCObjective, GenericMCObjective, ScalarizedPosteriorTransform
  from botorch.acquisition.risk_measures import Expectation
  from botorch.exceptions.errors import BotorchTensorDimensionError
  from botorch.models.model import Model
label_desc: Use image node_id 3 for calling the TorchUtilsTest obj's underlying member method code with example usage: obj.test_get_botorch_objective(_) without return types