code: def interact_fitted_plotly(
      model: ModelBridge,
      generator_runs_dict: TNullableGeneratorRunsDict = None,
      rel: bool = True,
      show_arm_details_on_hover: bool = True,
      show_CI: bool = True,
      arm_noun: str = "arm",
      metrics: Optional[List[str]] = None,
      fixed_features: Optional[ObservationFeatures] = None,
      data_selector: Optional[Callable[[Observation], bool]] = None,
      label_dict: Optional[Dict[str, str]] = None,
      scalarized_metric_config: Optional[List[Dict[str, Any]]] = None,
  ) -> go.Figure:
      """Interactive fitted outcome plots for each arm used in fitting the model.
  
      Choose the outcome to plot using a dropdown.
  
      Args:
          model: model to use for predictions.
          generator_runs_dict: a mapping from
              generator run name to generator run.
          rel: if True, use relative effects. Default is True.
          show_arm_details_on_hover: if True, display
              parameterizations of arms on hover. Default is True.
          show_CI: if True, render confidence intervals.
          arm_noun: noun to use instead of "arm" (e.g. group)
          metrics: List of metric names to restrict to when plotting.
          fixed_features: Fixed features to use when making model predictions.
          data_selector: Function for selecting observations for plotting.
          label_dict: A dictionary that maps the label to
              an alias to be used in the plot.
          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}}.
      """
      traces_per_metric = (
          1
          if generator_runs_dict is None
          else len(generator_runs_dict) + 1
      )
      metrics = sorted(metrics or model.metric_names)
      if not label_dict:
          _check_label_lengths(metrics)
  
      traces = []
      dropdown = []
  
      if scalarized_metric_config is not None:
          all_metrics = metrics + [
              agg["name"] for agg in scalarized_metric_config
          ]
      else:
          all_metrics = metrics
  
      for i, metric in enumerate(all_metrics):
          data = _single_metric_traces(
              model,
              metric,
              generator_runs_dict,
              rel,
              showlegend=i == 0,
              show_arm_details_on_hover=show_arm_details_on_hover,
              show_CI=show_CI,
              arm_noun=arm_noun,
              fixed_features=fixed_features,
              data_selector=data_selector,
              scalarized_metric_config=scalarized_metric_config,
          )
  
          for d in data:
              d["visible"] = i == 0
              traces.append(d)
  
          # only the first two traces are visible (corresponding to first outcome
          # in dropdown)
          is_visible = [False] * (len(all_metrics) * traces_per_metric)
          for j in range(
              (traces_per_metric * i), (traces_per_metric * (i + 1))
          ):
              is_visible[j] = True
  
          # on dropdown change, restyle
          dropdown.append(
              {
                  "args": ["visible", is_visible],
                  "label": _replace_str(
                      metric,
                      label_dict,
                  ),
                  "method": "restyle",
              }
          )
  
      layout = go.Layout(
          xaxis={
              "title": arm_noun.title(),
              "zeroline": False,
              "type": "category",
          },
          yaxis={
              "ticksuffix": "%" if rel else "",
              "title": ("Relative " if rel else "") + "Effect",
              "zeroline": True,
              "zerolinecolor": "red",
          },
          hovermode="closest",
          updatemenus=[
              {
                  "buttons": dropdown,
                  "x": 0.075,
                  "xanchor": "left",
                  "y": 1.1,
                  "yanchor": "middle",
              }
          ],
          annotations=[
              {
                  "font": {"size": 12},
                  "showarrow": False,
                  "text": "Metric",
                  "x": 0.05,
                  "xanchor": "right",
                  "xref": "paper",
                  "y": 1.1,
                  "yanchor": "middle",
                  "yref": "paper",
              }
          ],
          legend={
              "orientation": "h",
              "x": 0.065,
              "xanchor": "left",
              "y": 1.2,
              "yanchor": "middle",
          },
          height=500,
      )
  
      if traces_per_metric > 1:
          layout["annotations"] = layout["annotations"] + (
              {
                  "font": {"size": 12},
                  "showarrow": False,
                  "text": "Arm Source",
                  "x": 0.05,
                  "xanchor": "right",
                  "xref": "paper",
                  "y": 1.2,
                  "yanchor": "middle",
                  "yref": "paper",
              },
          )
  
      return go.Figure(data=traces, layout=layout)
  
imports: import numbers
  import warnings
  from collections import OrderedDict
  from logging import Logger
  from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Union
  import numpy
  import plotly.graph_objs
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.observation import Observation, ObservationFeatures
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.registry import Models
  from ax.plot.base import AxPlotConfig, AxPlotTypes, CI_OPACITY, DECIMALS, PlotInSampleArm, PlotMetric, PlotOutOfSampleArm, Z
  from ax.plot.color import BLUE_SCALE, COLORS, DISCRETE_COLOR_SCALE, rgba
  from ax.plot.helper import _format_CI, _format_dict, _wrap_metric, arm_name_to_sort_key, arm_name_to_tuple, get_plot_data, infer_is_relative, resize_subtitles, TNullableGeneratorRunsDict
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import checked_cast_optional
  from ax.utils.stats.statstools import relativize
  from plotly import subplots
label_desc: Use image node_id 12 for calling a global function with example usage: interact_fitted_plotly(model, generator_runs_dict, rel, show_arm_details_on_hover, show_CI, arm_noun, metrics, fixed_features, data_selector, label_dict, scalarized_metric_config) and returns: go