code: def unrelativize(
      means_t: Union[np.ndarray, List[float], float],
      sems_t: Union[np.ndarray, List[float], float],
      mean_c: float,
      sem_c: float,
      bias_correction: bool = True,
      cov_means: Union[np.ndarray, List[float], float] = 0.0,
      as_percent: bool = False,
      control_as_constant: bool = False,
  ) -> Tuple[np.ndarray, np.ndarray]:
      """
      Reverse operation of ax.utils.stats.statstools.relativize.
  
      Args:
          means_t: Relativized sample means (test) to be unrelativized
          sems_t: Relativized sample SEM of the means (test) to be unrelativized
          mean_c: Unrelativized control mean
          sem_c: Unrelativized control SEM of the mean
          bias_correction: if `means_t` and `sems_t` are obtained with
                           `bias_correction=True` in ax.utils.stats.statstools.relativize
          cov_means: Sample covariance between the **unrelativized** test and control
          as_percent: If true, assuming `means_t` and `sems_t` are percentages
                      (i.e., 1 means 1%).
          control_as_constant: If true, control is treated as a constant.
              bias_correction, sem_c, and cov_means are ignored when this is true.
  
      Returns:
          m_t: Inferred sample (test) means in the unrelativized scale
          s_t: Inferred SEM of sample (test) means in the unrelativized scale
      """
      means_t = np.array(means_t, dtype=float)
      sems_t = np.array(sems_t, dtype=float)
  
      if as_percent:
          means_t = means_t / 100
          sems_t = sems_t / 100
  
      abs_mean_c = np.abs(mean_c)
      m_t = means_t * abs_mean_c + mean_c
  
      if control_as_constant:
          s_t = sems_t * abs_mean_c
      else:
          if bias_correction:
              m_t = m_t / (1 - (sem_c / abs_mean_c) ** 2)
  
          var = sems_t**2
          c = m_t / mean_c
          s_t2 = (
              var * (mean_c**2)
              + 2 * c * cov_means
              - (c**2) * (sem_c**2)
          )
  
          # This is only positive when sems_t > sem_c * mean_c * (means_t + 1)
          # If above condition cannot be guaranteed, use control_as_constant = True
          s_t = np.sqrt(s_t2.clip(min=0.0))
  
      # if means_t is 0.0 exactly, return control mean and sem directly
      if np.isscalar(means_t):
          if means_t == 0.0:
              m_t = mean_c
              s_t = sem_c
      else:
          m_t[means_t == 0.0] = mean_c
          s_t[means_t == 0.0] = sem_c
  
      return m_t, s_t
  
file_path: Ax/ax/utils/stats/statstools.py
imports: from logging import Logger
  from typing import List, Tuple, Union
  import numpy
  import pandas
  from ax.core.data import Data
  from ax.utils.common.logger import get_logger
label_desc: Use image node_id 5 for calling a global function with example usage: unrelativize(means_t, sems_t, mean_c, sem_c, bias_correction, cov_means, as_percent, control_as_constant) and returns: m_t,  s_t