code: def get_plot_data(
      model: ModelBridge,
      generator_runs_dict: Dict[str, GeneratorRun],
      metric_names: Optional[Set[str]] = None,
      fixed_features: Optional[ObservationFeatures] = None,
      data_selector: Optional[Callable[[Observation], bool]] = None,
      scalarized_metric_config: Optional[
          List[Dict[str, Dict[str, float]]]
      ] = None,
  ) -> Tuple[PlotData, RawData, Dict[str, TParameterization]]:
      """Format data object with metrics for in-sample and out-of-sample
      arms.
  
      Calculate both observed and predicted metrics for in-sample arms.
      Calculate predicted metrics for out-of-sample arms passed via the
      `generator_runs_dict` argument.
  
      In PlotData, in-sample observations are merged with IVW. In RawData, they
      are left un-merged and given as a list of dictionaries, one for each
      observation and having keys 'arm_name', 'mean', and 'sem'.
  
      Args:
          model: The model.
          generator_runs_dict: a mapping from generator run name to generator run.
          metric_names: Restrict predictions to this set. If None, all metrics
              in the model will be returned.
          fixed_features: Fixed features to use when making model predictions.
          data_selector: Function for selecting observations for plotting.
          scalarized_metric_config: An optional list of dicts specifying how to aggregate
              multiple metrics into a single scalarized metric. For each dict, the key is
              the name of the new scalarized metric, and the value is a dictionary mapping
              each metric to its weight. e.g.
              {"name": "metric1:agg", "weight": {"metric1_c1": 0.5, "metric1_c2": 0.5}}.
  
      Returns:
          A tuple containing
  
          - PlotData object with in-sample and out-of-sample predictions.
          - List of observations like::
  
              {'metric_name': 'likes', 'arm_name': '0_1', 'mean': 1., 'sem': 0.1}.
  
          - Mapping from arm name to parameters.
      """
      metrics_plot = (
          model.metric_names if metric_names is None else metric_names
      )
      (
          in_sample_plot,
          raw_data,
          cond_name_to_parameters,
      ) = _get_in_sample_arms(
          model=model,
          metric_names=metrics_plot,
          fixed_features=fixed_features,
          data_selector=data_selector,
          scalarized_metric_config=scalarized_metric_config,
      )
      out_of_sample_plot = _get_out_of_sample_arms(
          model=model,
          generator_runs_dict=generator_runs_dict,
          metric_names=metrics_plot,
          fixed_features=fixed_features,
          scalarized_metric_config=scalarized_metric_config,
      )
      status_quo_name = (
          None
          if model.status_quo is None
          else model.status_quo.arm_name
      )
      plot_data = PlotData(
          metrics=list(metrics_plot),
          in_sample=in_sample_plot,
          out_of_sample=out_of_sample_plot,
          status_quo_name=status_quo_name,
      )
      return plot_data, raw_data, cond_name_to_parameters
  
imports: import math
  from collections import Counter
  from logging import Logger
  from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
  import numpy
  from ax.core.generator_run import GeneratorRun
  from ax.core.observation import Observation, ObservationFeatures
  from ax.core.parameter import ChoiceParameter, FixedParameter, Parameter, ParameterType, RangeParameter
  from ax.core.types import TParameterization
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.prediction_utils import _compute_scalarized_outcome, predict_at_point
  from ax.modelbridge.transforms.ivw import IVW
  from ax.plot.base import DECIMALS, PlotData, PlotInSampleArm, PlotOutOfSampleArm, Z
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 11 for calling a global function with example usage: get_plot_data(model, generator_runs_dict, metric_names, fixed_features, data_selector, scalarized_metric_config) and returns: plot_data,  raw_data,  cond_name_to_parameters