code: def _extract_pareto_frontier_results(
      param_dicts: List[TParameterization],
      means: Mu,
      variances: Cov,
      primary_metric: str,
      secondary_metric: str,
      absolute_metrics: List[str],
      outcome_constraints: Optional[List[OutcomeConstraint]],
      status_quo_prediction: Optional[Tuple[Mu, Cov]],
  ) -> ParetoFrontierResults:
      """Extract prediction results into ParetoFrontierResults struture."""
      metrics = list(means.keys())
      means_out = {metric: m.copy() for metric, m in means.items()}
      sems_out = {
          metric: np.sqrt(v[metric]) for metric, v in variances.items()
      }
  
      # relativize predicted outcomes if requested
      primary_is_relative = primary_metric not in absolute_metrics
      secondary_is_relative = secondary_metric not in absolute_metrics
      # Relativized metrics require a status quo prediction
      if primary_is_relative or secondary_is_relative:
          if status_quo_prediction is None:
              raise AxError(
                  "Relativized metrics require a valid status quo prediction"
              )
          sq_mean, sq_sem = status_quo_prediction
  
          for metric in metrics:
              if metric not in absolute_metrics and metric in sq_mean:
                  means_out[metric], sems_out[metric] = relativize(
                      means_t=means_out[metric],
                      sems_t=sems_out[metric],
                      mean_c=sq_mean[metric][0],
                      sem_c=np.sqrt(sq_sem[metric][metric][0]),
                      as_percent=True,
                  )
  
      return ParetoFrontierResults(
          param_dicts=param_dicts,
          means=means_out,
          sems=sems_out,
          primary_metric=primary_metric,
          secondary_metric=secondary_metric,
          absolute_metrics=absolute_metrics,
          objective_thresholds=None,
          arm_names=None,
      )
  
imports: import copy
  from copy import deepcopy
  from itertools import combinations
  from logging import Logger
  from typing import cast, Dict, List, NamedTuple, Optional, Tuple, Union
  import numpy
  import torch
  from ax.core.batch_trial import BatchTrial
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.metric import Metric
  from ax.core.objective import ScalarizedObjective
  from ax.core.observation import ObservationFeatures
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.outcome_constraint import ComparisonOp, ObjectiveThreshold, OutcomeConstraint
  from ax.core.search_space import RobustSearchSpace, SearchSpace
  from ax.core.types import TParameterization
  from ax.exceptions.core import AxError, UnsupportedError, UserInputError
  from ax.modelbridge.modelbridge_utils import _get_modelbridge_training_data, get_pareto_frontier_and_configs, observed_pareto_frontier
  from ax.modelbridge.registry import Models
  from ax.modelbridge.torch import TorchModelBridge
  from ax.modelbridge.transforms.search_space_to_float import SearchSpaceToFloat
  from ax.models.torch.posterior_mean import get_PosteriorMean
  from ax.models.torch_base import TorchModel
  from ax.utils.common.logger import get_logger
  from ax.utils.stats.statstools import relativize
  from botorch.utils.multi_objective import is_non_dominated
  from botorch.utils.multi_objective.hypervolume import infer_reference_point
label_desc: Use image node_id 8 for calling a global function with example usage: _extract_pareto_frontier_results(param_dicts, means, variances, primary_metric, secondary_metric, absolute_metrics, outcome_constraints, status_quo_prediction) and returns: ParetoFrontierResults