code: def _quantiles_to_cutoffs(
      metric_name: str,
      metric_values: List[float],
      metric_config: WinsorizationConfig,
  ) -> Tuple[float, float]:
      """Compute winsorization cutoffs from a config and values."""
      Y = np.array(metric_values)
      lower = metric_config.lower_quantile_margin or 0.0
      upper = metric_config.upper_quantile_margin or 0.0
      bnd_l = metric_config.lower_boundary
      bnd_u = metric_config.upper_boundary
      if (
          lower != AUTO_WINS_QUANTILE
          and upper != AUTO_WINS_QUANTILE
          and lower >= 1 - upper
      ):
          raise ValueError(
              f"Lower bound: {lower} was greater than the inverse of the "
              f"upper bound: {1 - upper} for metric {metric_name}. Decrease "
              f"one or both of `lower_quantile_margin` and "
              "`upper_quantile_margin`."
          )
      if lower == AUTO_WINS_QUANTILE:
          cutoff_l = _get_tukey_cutoffs(Y=Y, lower=True)
      elif (
          lower == 0.0
      ):  # Use the default cutoff if there is no winsorization
          cutoff_l = DEFAULT_CUTOFFS[0]
      else:
          cutoff_l = np.percentile(
              Y, lower * 100, interpolation="lower"
          )
  
      if upper == AUTO_WINS_QUANTILE:
          cutoff_u = _get_tukey_cutoffs(Y=Y, lower=False)
      elif (
          upper == 0.0
      ):  # Use the default cutoff if there is no winsorization
          cutoff_u = DEFAULT_CUTOFFS[1]
      else:
          cutoff_u = np.percentile(
              Y, (1 - upper) * 100, interpolation="higher"
          )
  
      cutoff_l = min(cutoff_l, bnd_l) if bnd_l is not None else cutoff_l
      cutoff_u = max(cutoff_u, bnd_u) if bnd_u is not None else cutoff_u
      return (cutoff_l, cutoff_u)
  
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 9 for calling a global function with example usage: _quantiles_to_cutoffs(metric_name, metric_values, metric_config) and returns: cutoff_l,  cutoff_u