code: def _get_auto_winsorization_cutoffs_outcome_constraint(
      metric_values: List[float],
      outcome_constraints: Union[
          List[ObjectiveThreshold], List[OutcomeConstraint]
      ],
  ) -> Tuple[float, float]:
      """Automatic winsorization to an outcome constraint.
  
      We need to be careful here so we don't make infeasible points feasible.
      While it is possible to winsorize from both ends, we only winsorize from the
      infeasible direction for now so the same method can be used for MOO. We rely on
      a heuristic similar to `_get_tukey_cutoffs`, but instead take the max of
      q3 and the bound when we have a LEQ constraint and the min of q1 and the bound
      with a GEQ constraint.
      """
      Y = np.array(metric_values)
      # TODO: replace interpolation->method once it becomes standard.
      q1 = np.percentile(Y, q=25, interpolation="lower")
      q3 = np.percentile(Y, q=75, interpolation="higher")
      lower_cutoff, upper_cutoff = DEFAULT_CUTOFFS
      for oc in outcome_constraints:
          bnd = oc.bound
          if oc.op == ComparisonOp.LEQ:
              upper_cutoff = max(q3, bnd) + 1.5 * (max(q3, bnd) - q1)
          elif oc.op == ComparisonOp.GEQ:
              lower_cutoff = min(q1, bnd) - 1.5 * (q3 - min(q1, bnd))
          else:
              raise ValueError(
                  "Exected outcome_constraint to use operator LEQ or GEQ"
              )
      return lower_cutoff, upper_cutoff
  
imports: import warnings
  from logging import Logger
  from typing import Dict, List, Optional, Tuple, TYPE_CHECKING, Union
  import numpy
  from ax.core.objective import MultiObjective, ScalarizedObjective
  from ax.core.observation import Observation, ObservationData
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.outcome_constraint import ComparisonOp, ObjectiveThreshold, OutcomeConstraint, ScalarizedOutcomeConstraint
  from ax.core.search_space import SearchSpace
  from ax.exceptions.core import DataRequiredError, UnsupportedError, UserInputError
  from ax.modelbridge.transforms.base import Transform
  from ax.modelbridge.transforms.utils import derelativize_optimization_config_with_raw_status_quo, get_data
  from ax.models.types import TConfig, WinsorizationConfig
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import checked_cast
label_desc: Use image node_id 8 for calling a global function with example usage: _get_auto_winsorization_cutoffs_outcome_constraint(metric_values, outcome_constraints) and returns: lower_cutoff,  upper_cutoff