code: def _error_scatter_data(
      arms: Iterable[Union[PlotInSampleArm, PlotOutOfSampleArm]],
      y_axis_var: PlotMetric,
      x_axis_var: Optional[PlotMetric] = None,
      status_quo_arm: Optional[PlotInSampleArm] = None,
  ) -> Tuple[
      List[float], Optional[List[float]], List[float], List[float]
  ]:
      y_metric_key = "y_hat" if y_axis_var.pred else "y"
      y_sd_key = "se_hat" if y_axis_var.pred else "se"
  
      arm_names = [a.name for a in arms]
      y = [
          getattr(a, y_metric_key).get(y_axis_var.metric, np.nan)
          for a in arms
      ]
      y_se = [
          getattr(a, y_sd_key).get(y_axis_var.metric, np.nan)
          for a in arms
      ]
  
      # Delta method if relative to status quo arm
      if y_axis_var.rel:
          if status_quo_arm is None:
              raise ValueError(
                  "`status_quo_arm` cannot be None for relative effects."
              )
          y_rel, y_se_rel = relativize(
              means_t=y,
              sems_t=y_se,
              mean_c=getattr(status_quo_arm, y_metric_key).get(
                  y_axis_var.metric
              ),
              sem_c=getattr(status_quo_arm, y_sd_key).get(
                  y_axis_var.metric
              ),
              as_percent=True,
          )
          y = y_rel.tolist()
          y_se = y_se_rel.tolist()
  
      # x can be metric for a metric or arm names
      if x_axis_var is None:
          x = arm_names
          x_se = None
      else:
          x_metric_key = "y_hat" if x_axis_var.pred else "y"
          x_sd_key = "se_hat" if x_axis_var.pred else "se"
          x = [
              getattr(a, x_metric_key).get(x_axis_var.metric, np.nan)
              for a in arms
          ]
          x_se = [
              getattr(a, x_sd_key).get(x_axis_var.metric, np.nan)
              for a in arms
          ]
  
          if x_axis_var.rel:
              # Delta method if relative to status quo arm
              x_rel, x_se_rel = relativize(
                  means_t=x,
                  sems_t=x_se,
                  mean_c=getattr(status_quo_arm, x_metric_key).get(
                      x_axis_var.metric
                  ),
                  sem_c=getattr(status_quo_arm, x_sd_key).get(
                      x_axis_var.metric
                  ),
                  as_percent=True,
              )
              x = x_rel.tolist()
              x_se = x_se_rel.tolist()
      return x, x_se, y, y_se
  
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 1 for calling a global function with example usage: _error_scatter_data(arms, y_axis_var, x_axis_var, status_quo_arm) and returns: x,  x_se,  y,  y_se