code: def test_best_point(
      self,
      _mock_gen,
      _mock_fit,
      _mock_predict,
      _mock_gen_arms,
      _mock_unwrap,
      _mock_obs_from_data,
  ) -> None:
      exp = Experiment(
          search_space=get_search_space_for_range_value(), name="test"
      )
      oc = OptimizationConfig(
          objective=Objective(metric=Metric("a"), minimize=False),
          outcome_constraints=[],
      )
      search_space = get_search_space_for_range_value()
      modelbridge = TorchModelBridge(
          search_space=search_space,
          model=TorchModel(),
          transforms=[transform_1, transform_2],
          experiment=exp,
          data=Data(),
          optimization_config=oc,
      )
  
      self.assertEqual(
          list(modelbridge.transforms.keys()),
          ["Cast", "transform_1", "transform_2"],
      )
  
      # _fit is mocked, which sets these
      modelbridge.parameters = list(search_space.parameters.keys())
      modelbridge.outcomes = ["a"]
  
      with mock.patch(
          f"{TorchModel.__module__}.TorchModel.best_point",
          return_value=torch.tensor([1.0, 2.0]),
          autospec=True,
      ):
          run = modelbridge.gen(n=1, optimization_config=oc)
          arm, predictions = not_none(run.best_arm_predictions)
          model_arm, model_predictions = not_none(
              modelbridge.model_best_point()
          )
          predictions = not_none(predictions)
          model_predictions = not_none(model_predictions)
      self.assertEqual(arm.parameters, {})
      self.assertEqual(predictions[0], {"m": 1.0})
      self.assertEqual(predictions[1], {"m": {"m": 2.0}})
      self.assertEqual(model_predictions[0], {"m": 1.0})
      self.assertEqual(model_predictions[1], {"m": {"m": 2.0}})
  
      # test optimization config validation - raise error when
      # ScalarizedOutcomeConstraint contains a metric that is not in the outcomes
      with self.assertRaises(ValueError):
          modelbridge.gen(
              n=1,
              optimization_config=OptimizationConfig(
                  objective=Objective(
                      metric=Metric("a"), minimize=False
                  ),
                  outcome_constraints=[
                      ScalarizedOutcomeConstraint(
                          metrics=[Metric("wrong_metric_name")],
                          weights=[1.0],
                          op=ComparisonOp.LEQ,
                          bound=0,
                      )
                  ],
              ),
          )
  
      with mock.patch(
          f"{TorchModel.__module__}.TorchModel.best_point",
          side_effect=NotImplementedError,
          autospec=True,
      ):
          res = modelbridge.model_best_point()
      self.assertIsNone(res)
  
imports: from contextlib import ExitStack
  from typing import Any, Dict, Optional
  from unittest import mock
  from unittest.mock import Mock
  import numpy
  import torch
  from ax.core.arm import Arm
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.metric import Metric
  from ax.core.objective import Objective
  from ax.core.observation import Observation, ObservationData, ObservationFeatures, recombine_observations
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.outcome_constraint import ScalarizedOutcomeConstraint
  from ax.core.parameter import ParameterType, RangeParameter
  from ax.core.search_space import SearchSpace, SearchSpaceDigest
  from ax.core.types import ComparisonOp
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.torch import TorchModelBridge
  from ax.modelbridge.transforms.base import Transform
  from ax.models.torch_base import TorchGenResults, TorchModel
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import checked_cast, not_none
  from ax.utils.testing.core_stubs import get_branin_data, get_branin_experiment, get_branin_search_space, get_experiment_with_observations, get_search_space_for_range_value
  from ax.utils.testing.modeling_stubs import get_observation1, transform_1, transform_2
  from botorch.utils.datasets import ContextualDataset, MultiTaskDataset, SupervisedDataset
label_desc: Use image node_id 5 for calling the TorchModelBridgeTest obj's underlying member method code with example usage: obj.test_best_point(_mock_gen, _mock_fit, _mock_predict, _mock_gen_arms, _mock_unwrap, _mock_obs_from_data) without return types