code: def _validate_and_maybe_get_default_metric_names(
      metric_names: Optional[Tuple[str, str]],
      optimization_config: Optional[OptimizationConfig],
  ) -> Tuple[str, str]:
      # Default metric_names is all metrics, producing an error if more than 2
      if metric_names is None:
          if not_none(optimization_config).is_moo_problem:
              multi_objective = checked_cast(
                  MultiObjective,
                  not_none(optimization_config).objective,
              )
              metric_names = tuple(
                  obj.metric.name for obj in multi_objective.objectives
              )
          else:
              raise UserInputError(
                  "Inference of `metric_names` failed. Expected `MultiObjective` but "
                  f"got {not_none(optimization_config).objective}. Please specify "
                  "`metric_names` of length 2 or provide an experiment whose "
                  "`optimization_config` has 2 objective metrics."
              )
      if metric_names is not None and len(metric_names) == 2:
          return metric_names
      raise UserInputError(
          f"Expected 2 metrics but got {len(metric_names or [])}: {metric_names}. "
          "Please specify `metric_names` of length 2 or provide an experiment whose "
          "`optimization_config` has 2 objective metrics."
      )
  
imports: import warnings
  from typing import Dict, Iterable, List, Optional, Tuple, Union
  import numpy
  import pandas
  import plotly.graph_objs
  from ax.core.experiment import Experiment
  from ax.core.objective import MultiObjective
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.outcome_constraint import ObjectiveThreshold
  from ax.exceptions.core import UserInputError
  from ax.plot.base import AxPlotConfig, AxPlotTypes, CI_OPACITY, DECIMALS
  from ax.plot.color import COLORS, DISCRETE_COLOR_SCALE, rgba
  from ax.plot.helper import _format_CI, _format_dict, extend_range
  from ax.plot.pareto_utils import ParetoFrontierResults
  from ax.service.utils.best_point_mixin import BestPointMixin
  from ax.utils.common.typeutils import checked_cast, not_none
  from plotly import express
  from scipy.stats import norm
label_desc: Use image node_id 13 for calling a global function with example usage: _validate_and_maybe_get_default_metric_names(metric_names, optimization_config) and returns: metric_names