code: def _derel_opt_config_wrapper(
      optimization_config: OptimizationConfig,
      modelbridge: Optional[ModelBridge] = None,
      experiment: Optional[Experiment] = None,
      observations: Optional[List[Observation]] = None,
  ) -> OptimizationConfig:
      """Derelativize optimization_config using raw status-quo values"""
  
      # If optimization_config is already derelativized, return a copy.
      if not any(
          oc.relative for oc in optimization_config.all_constraints
      ):
          return optimization_config.clone()
  
      if modelbridge is None and experiment is None:
          raise ValueError(
              "Must specify ModelBridge or Experiment when calling "
              "`_derel_opt_config_wrapper`."
          )
      elif not modelbridge:
          modelbridge = get_tensor_converter_model(
              experiment=not_none(experiment),
              data=not_none(experiment).lookup_data(),
          )
      else:  # Both modelbridge and experiment specified.
          logger.warning(
              "ModelBridge and Experiment provided to `_derel_opt_config_wrapper`. "
              "Ignoring the latter."
          )
      if not modelbridge.status_quo:
          raise ValueError(
              "`modelbridge` must have status quo if specified. If `modelbridge` is "
              "unspecified, `experiment` must have a status quo."
          )
      observations = observations or modelbridge.get_training_data()
      return derelativize_optimization_config_with_raw_status_quo(
          optimization_config=optimization_config,
          modelbridge=modelbridge,
          observations=observations,
      )
  
imports: from collections import OrderedDict
  from functools import reduce
  from logging import Logger
  from typing import Dict, Iterable, List, Optional, Tuple, Type
  import pandas
  import torch
  from ax.core.base_trial import TrialStatus
  from ax.core.batch_trial import BatchTrial
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.generator_run import GeneratorRun
  from ax.core.objective import MultiObjective, Objective, ScalarizedObjective
  from ax.core.observation import Observation
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.outcome_constraint import ObjectiveThreshold, OutcomeConstraint
  from ax.core.trial import Trial
  from ax.core.types import ComparisonOp, TModelPredictArm, TParameterization
  from ax.exceptions.core import UnsupportedError, UserInputError
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.cross_validation import assess_model_fit, compute_diagnostics, cross_validate
  from ax.modelbridge.generation_strategy import GenerationStrategy
  from ax.modelbridge.modelbridge_utils import observed_pareto_frontier, predicted_pareto_frontier
  from ax.modelbridge.registry import get_model_from_generator_run, ModelRegistryBase, Models
  from ax.modelbridge.torch import TorchModelBridge
  from ax.modelbridge.transforms.utils import derelativize_optimization_config_with_raw_status_quo
  from ax.plot.pareto_utils import get_tensor_converter_model
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import checked_cast, not_none
  from numpy import NaN
  from torch import Tensor
label_desc: Use image node_id 17 for calling a global function with example usage: _derel_opt_config_wrapper(optimization_config, modelbridge, experiment, observations) and returns: derelativize_optimization_config_with_raw_status_quo, optimization_config