class_docstr: Change the relative flag of the given relative optimization configuration
  to False. This is needed in order for the new opt config to pass ModelBridge
  that requires non-relativized opt config.
  
  Also transforms absolute data and opt configs to relative.
  
  Requires a modelbridge with a status quo set to work.
  
  Abstract property control_as_constant is set to True/False in its subclasses
  Relativize and RelativizeWithConstantControl respectively to account for
  appropriate transform/untransform differently.
docstr: Relativize or unrelativize `data` based on `status_quo_data` based on `rel_op`
  
  Args:
      data: ObservationData object to relativize
      status_quo_data: The status quo data (un)relativization is based upon
      rel_op: relativize or unrelativize operator.
      control_as_constant: if treating the control metric as constant
  
  Returns:
      (un)relativized ObservationData
docstr_tok: ["Relativize","or","unrelativize","`","data","`","based","on","`","status_quo_data","`","based","on","`","rel_op","`","Args",":","data",":","ObservationData","object","to","relativize","status_quo_data",":","The","status","quo","data","(","un",")","relativization","is","based","upon","rel_op",":","relativize","or","unrelativize","operator",".","control_as_constant",":","if","treating","the","control","metric","as","constant","Returns",":","(","un",")","relativized","ObservationData"]
code: def _get_relative_data(
      self,
      data: ObservationData,
      status_quo_data: ObservationData,
      rel_op: Callable[..., Tuple[np.ndarray, np.ndarray]],
  ) -> ObservationData:
      r"""
      Relativize or unrelativize `data` based on `status_quo_data` based on `rel_op`
  
      Args:
          data: ObservationData object to relativize
          status_quo_data: The status quo data (un)relativization is based upon
          rel_op: relativize or unrelativize operator.
          control_as_constant: if treating the control metric as constant
  
      Returns:
          (un)relativized ObservationData
      """
      L = len(data.metric_names)
      result = ObservationData(
          metric_names=data.metric_names,
          # zeros are just to create the shape so values can be set by index
          means=np.zeros(L),
          covariance=np.zeros((L, L)),
      )
      for i, metric in enumerate(data.metric_names):
          try:
              j = next(
                  k
                  for k in range(L)
                  if status_quo_data.metric_names[k] == metric
              )
          except (IndexError, StopIteration):
              raise ValueError(
                  "Relativization cannot be performed because "
                  "ObservationData for status quo is missing metrics"
              )
  
          means_t = data.means[i]
          sems_t = sqrt(data.covariance[i][i])
          mean_c = status_quo_data.means[j]
          sem_c = sqrt(status_quo_data.covariance[j][j])
  
          # if the is the status quo
          if means_t == mean_c and sems_t == sem_c:
              means_rel, sems_rel = 0, 0
          else:
              means_rel, sems_rel = rel_op(
                  means_t=means_t,
                  sems_t=sems_t,
                  mean_c=mean_c,
                  sem_c=sem_c,
                  as_percent=True,
                  control_as_constant=self.control_as_constant,
              )
          result.means[i] = means_rel
          result.covariance[i][i] = sems_rel**2
      return result
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from math import sqrt
  from typing import Callable, Dict, List, Optional, Tuple, TYPE_CHECKING
  import numpy
  from ax.core.observation import Observation, ObservationData, ObservationFeatures
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.outcome_constraint import OutcomeConstraint
  from ax.core.search_space import SearchSpace
  from ax.modelbridge import ModelBridge
  from ax.modelbridge.transforms.base import Transform
  from ax.models.types import TConfig
  from ax.utils.common.typeutils import not_none
  from ax.utils.stats.statstools import relativize, unrelativize
label_desc: Use image node_id 8 for calling the BaseRelativize obj's underlying member method code with example usage: obj._get_relative_data(data, status_quo_data, rel_op) and returns: result