code: def _get_cutoffs_from_legacy_transform_config(
      metric_name: str,
      metric_values: List[float],
      transform_config: TConfig,
  ) -> Tuple[float, float]:
      winsorization_config = WinsorizationConfig()
      if "winsorization_lower" in transform_config:
          winsorization_lower = transform_config["winsorization_lower"]
          if isinstance(winsorization_lower, dict):
              if metric_name in winsorization_lower:
                  winsorization_config.lower_quantile_margin = winsorization_lower[
                      # pyre-fixme [6]: In call `dict.__getitem__`, for 1st positional
                      # argument, expected `int` but got `str`.
                      metric_name
                  ]
          elif isinstance(winsorization_lower, (int, float)):
              winsorization_config.lower_quantile_margin = (
                  winsorization_lower
              )
      if "winsorization_upper" in transform_config:
          winsorization_upper = transform_config["winsorization_upper"]
          if isinstance(winsorization_upper, dict):
              if metric_name in winsorization_upper:
                  winsorization_config.upper_quantile_margin = winsorization_upper[
                      # pyre-fixme [6]: In call `dict.__getitem__`, for 1st positional
                      # argument, expected `int` but got `str`.
                      metric_name
                  ]
          elif isinstance(winsorization_upper, (int, float)):
              winsorization_config.upper_quantile_margin = (
                  winsorization_upper
              )
      if "percentile_bounds" in transform_config:
          percentile_bounds = transform_config["percentile_bounds"]
          output_percentile_bounds = (None, None)
          if isinstance(percentile_bounds, dict):
              if metric_name in percentile_bounds:
                  # pyre-fixme [6]: In call `dict.__getitem__`, for 1st positional
                  # argument, expected `int` but got `str`.
                  output_percentile_bounds = percentile_bounds[
                      metric_name
                  ]
          elif isinstance(percentile_bounds, tuple):
              output_percentile_bounds = percentile_bounds
          if len(output_percentile_bounds) != 2 or not all(
              isinstance(pb, (int, float)) or pb is None
              for pb in output_percentile_bounds
          ):
              raise ValueError(
                  f"Expected percentile_bounds for metric {metric_name} to be "
                  f"of the form (l, u), got {output_percentile_bounds}."
              )
          winsorization_config.lower_boundary = (
              output_percentile_bounds[0]
          )
          winsorization_config.upper_boundary = (
              output_percentile_bounds[1]
          )
      return _quantiles_to_cutoffs(
          metric_name=metric_name,
          metric_values=metric_values,
          metric_config=winsorization_config,
      )
  
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 10 for calling a global function with example usage: _get_cutoffs_from_legacy_transform_config(metric_name, metric_values, transform_config) and returns: _quantiles_to_cutoffs