code: def test_winsorization_with_optimization_config(self) -> None:
      obsd_1 = ObservationData(
          metric_names=["m1"] * 10,
          means=np.array([-100, 0, 1, 2, 3, 4, 5, 6, 7, 50]),
          covariance=np.eye(10),
      )
      obsd_2 = ObservationData(
          metric_names=["m2"] * 7,
          means=np.array([-10, 0, 1, 2, 3, 4, 47]),
          covariance=np.eye(7),
      )
      obsd_3 = ObservationData(
          metric_names=["m3"] * 6,
          means=np.array([-456, 1, 2, 3, 4, 9]),
          covariance=np.eye(6),
      )
      all_obsd = [obsd_1, obsd_2, obsd_3]
      m1 = Metric(name="m1", lower_is_better=False)
      m2 = Metric(name="m2", lower_is_better=True)
      m3 = Metric(name="m3")
      # Scalarized objective
      for minimize in [True, False]:
          optimization_config = OptimizationConfig(
              objective=ScalarizedObjective(
                  metrics=[Metric(name="m1"), Metric(name="m2")],
                  weights=[1, -1],
                  minimize=minimize,
              )
          )
          transform = get_transform(
              observation_data=deepcopy(all_obsd),
              optimization_config=optimization_config,
          )
          if minimize:
              self.assertEqual(
                  transform.cutoffs,
                  {
                      "m1": (-INF, 13.5),
                      "m2": (-6.0, INF),
                      "m3": (-INF, INF),
                  },
              )
          else:
              self.assertEqual(
                  transform.cutoffs,
                  {
                      "m1": (-6.5, INF),
                      "m2": (-INF, 10.0),
                      "m3": (-INF, INF),
                  },
              )
      # Simple single-objective problem
      optimization_config = OptimizationConfig(
          objective=Objective(metric=m2, minimize=True)
      )
      transform = get_transform(
          observation_data=deepcopy(all_obsd),
          optimization_config=optimization_config,
      )
      self.assertEqual(transform.cutoffs["m1"], (-INF, INF))
      self.assertEqual(
          transform.cutoffs["m2"], (-INF, 10.0)
      )  # 4 + 1.5 * 4
      self.assertEqual(transform.cutoffs["m3"], (-INF, INF))
      # Add a relative constraint, which should raise an error
      outcome_constraint = OutcomeConstraint(
          metric=m1, op=ComparisonOp.LEQ, bound=3, relative=True
      )
      optimization_config = OptimizationConfig(
          objective=Objective(metric=m2, minimize=True),
          outcome_constraints=[outcome_constraint],
      )
      with self.assertRaisesRegex(
          UnsupportedError,
          "Automatic winsorization doesn't support relative outcome constraints "
          "or objective thresholds when `derelativize_with_raw_status_quo` is not "
          "set to `True`.",
      ):
          get_transform(
              observation_data=deepcopy(all_obsd),
              optimization_config=optimization_config,
          )
      # Make the constraint absolute, which should trigger winsorization
      optimization_config.outcome_constraints[0].relative = False
      transform = get_transform(
          observation_data=deepcopy(all_obsd),
          optimization_config=optimization_config,
      )
      self.assertEqual(
          transform.cutoffs["m1"], (-INF, 13.5)
      )  # 6 + 1.5 * 5
      self.assertEqual(
          transform.cutoffs["m2"], (-INF, 10.0)
      )  # 4 + 1.5 * 4
      self.assertEqual(transform.cutoffs["m3"], (-INF, INF))
      # Change to a GEQ constraint
      optimization_config.outcome_constraints[0].op = ComparisonOp.GEQ
      transform = get_transform(
          observation_data=deepcopy(all_obsd),
          optimization_config=optimization_config,
      )
      self.assertEqual(
          transform.cutoffs["m1"], (-6.5, INF)
      )  # 1 - 1.5 * 5
      self.assertEqual(
          transform.cutoffs["m2"], (-INF, 10.0)
      )  # 4 + 1.5 * 4
      self.assertEqual(transform.cutoffs["m3"], (-INF, INF))
      # Add a scalarized outcome constraint which should print a warning
      optimization_config.outcome_constraints = [
          ScalarizedOutcomeConstraint(
              metrics=[m1, m3],
              op=ComparisonOp.GEQ,
              bound=3,
              relative=False,
          )
      ]
      warnings.simplefilter("always", append=True)
      with warnings.catch_warnings(record=True) as ws:
          transform = get_transform(
              observation_data=deepcopy(all_obsd),
              optimization_config=optimization_config,
          )
          for i in range(2):
              self.assertTrue(
                  "Automatic winsorization isn't supported for a "
                  "`ScalarizedOutcomeConstraint`. Specify the winsorization settings "
                  f"manually if you want to winsorize metric m{['1', '3'][i]}."
                  in [str(w.message) for w in ws]
              )
      # Multi-objective without objective thresholds should warn and winsorize
      moo_objective = MultiObjective(
          [Objective(m1, minimize=False), Objective(m2, minimize=True)]
      )
      optimization_config = MultiObjectiveOptimizationConfig(
          objective=moo_objective
      )
      warnings.simplefilter("always", append=True)
      with warnings.catch_warnings(record=True) as ws:
          transform = get_transform(
              observation_data=deepcopy(all_obsd),
              optimization_config=optimization_config,
          )
          for _ in range(2):
              self.assertTrue(
                  "Encountered a `MultiObjective` without objective thresholds. We "
                  "will winsorize each objective separately. We strongly recommend "
                  "specifying the objective thresholds when using multi-objective "
                  "optimization." in [str(w.message) for w in ws]
              )
      self.assertEqual(transform.cutoffs["m1"], (-6.5, INF))
      self.assertEqual(transform.cutoffs["m2"], (-INF, 10.0))
      self.assertEqual(transform.cutoffs["m3"], (-INF, INF))
      # Add relative objective thresholds (should raise an error)
      objective_thresholds = [
          ObjectiveThreshold(m1, 3, relative=True),
          ObjectiveThreshold(m2, 4, relative=True),
      ]
      optimization_config = MultiObjectiveOptimizationConfig(
          objective=moo_objective,
          objective_thresholds=objective_thresholds,
          outcome_constraints=[],
      )
      with self.assertRaisesRegex(
          UnsupportedError,
          "Automatic winsorization doesn't support relative outcome constraints or "
          "objective thresholds when `derelativize_with_raw_status_quo` is not set "
          "to `True`.",
      ):
          get_transform(
              observation_data=deepcopy(all_obsd),
              optimization_config=optimization_config,
          )
      # Make the objective thresholds absolute (should trigger winsorization)
      optimization_config.objective_thresholds[0].relative = False
      optimization_config.objective_thresholds[1].relative = False
      transform = get_transform(
          observation_data=deepcopy(all_obsd),
          optimization_config=optimization_config,
      )
      self.assertEqual(
          transform.cutoffs["m1"], (-6.5, INF)
      )  # 1 - 1.5 * 5
      self.assertEqual(
          transform.cutoffs["m2"], (-INF, 10.0)
      )  # 4 + 1.5 * 4
      self.assertEqual(transform.cutoffs["m3"], (-INF, INF))
      # Add an absolute outcome constraint
      optimization_config.outcome_constraints = [
          OutcomeConstraint(
              metric=m3, op=ComparisonOp.GEQ, bound=3, relative=False
          )
      ]
      transform = get_transform(
          observation_data=deepcopy(all_obsd),
          optimization_config=optimization_config,
      )
      self.assertEqual(
          transform.cutoffs["m1"], (-6.5, INF)
      )  # 1 - 1.5 * 5
      self.assertEqual(
          transform.cutoffs["m2"], (-INF, 10.0)
      )  # 4 + 1.5 * 4
      self.assertEqual(transform.cutoffs["m3"], (-3.5, INF))
  
imports: import warnings
  from copy import deepcopy
  from typing import Dict, Optional, Tuple
  from unittest import mock
  import numpy
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.metric import Metric
  from ax.core.objective import MultiObjective, Objective, ScalarizedObjective
  from ax.core.observation import Observation, ObservationData, ObservationFeatures
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.outcome_constraint import ComparisonOp, ObjectiveThreshold, OutcomeConstraint, ScalarizedOutcomeConstraint
  from ax.core.parameter import ParameterType, RangeParameter
  from ax.core.search_space import SearchSpace
  from ax.exceptions.core import DataRequiredError, UnsupportedError, UserInputError
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.transforms.winsorize import _get_auto_winsorization_cutoffs_outcome_constraint, _get_auto_winsorization_cutoffs_single_objective, _get_tukey_cutoffs, AUTO_WINS_QUANTILE, Winsorize
  from ax.models.winsorization_config import WinsorizationConfig
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_optimization_config
  from typing_extensions import SupportsIndex
label_desc: Use image node_id 13 for calling the WinsorizeTransformTest obj's underlying member method code with example usage: obj.test_winsorization_with_optimization_config() without return types