code: def _get_trace_by_progression(
      experiment: Experiment,
      optimization_config: Optional[OptimizationConfig] = None,
      bins: Optional[List[float]] = None,
      final_progression_only: bool = False,
  ) -> Tuple[List[float], List[float]]:
      optimization_config = optimization_config or not_none(
          experiment.optimization_config
      )
      objective = optimization_config.objective.metric.name
      minimize = optimization_config.objective.minimize
      map_data = experiment.lookup_data()
      if not isinstance(map_data, MapData):
          raise ValueError(
              "`get_trace_by_progression` requires MapData."
          )
      map_df = map_data.map_df
  
      # assume the first map_key is progression
      map_key = map_data.map_keys[0]
  
      map_df = map_df[map_df["metric_name"] == objective]
      map_df = map_df.sort_values(by=["trial_index", map_key])
      df = (
          map_df.drop_duplicates(
              MapData.DEDUPLICATE_BY_COLUMNS, keep="last"
          )
          if final_progression_only
          else map_df
      )
  
      # compute cumulative steps
      prev_steps_df = map_df.drop_duplicates(
          MapData.DEDUPLICATE_BY_COLUMNS, keep="last"
      )[["trial_index", map_key]].copy()
  
      # shift the cumsum by one so that we count cumulative steps not including
      # the current trial
      prev_steps_df[map_key] = (
          prev_steps_df[map_key].cumsum().shift(periods=1).fillna(0)
      )
      prev_steps_df = prev_steps_df.rename(
          columns={map_key: "prev_steps"}
      )
      df = df.merge(prev_steps_df, on=["trial_index"])
      df["cumulative_steps"] = df[map_key] + df["prev_steps"]
      progressions = df["cumulative_steps"].to_numpy()
  
      if bins is None:
          # this assumes that there is at least one completed trial that
          # reached the maximum progression
          prog_per_trial = df[map_key].max()
          num_trials = len(experiment.trials)
          bins = np.linspace(
              0,
              prog_per_trial * num_trials,
              NUM_BINS_PER_TRIAL * num_trials,
          )
      else:
          bins = np.array(bins)  # pyre-ignore[9]
  
      bins = np.expand_dims(bins, axis=0)
  
      # compute for each bin value the largest trial index finished by then
      # (interpreting the bin value as a cumulative progression)
      best_observed_idcs = np.maximum.accumulate(
          np.argmax(
              np.expand_dims(progressions, axis=1) >= bins, axis=0
          )
      )
      obj_vals = (
          df["mean"].cummin() if minimize else df["mean"].cummax()
      ).to_numpy()
      best_observed = obj_vals[best_observed_idcs]
      return best_observed.tolist(), bins.squeeze(axis=0).tolist()
  
imports: from abc import ABCMeta, abstractmethod
  from functools import partial
  from logging import Logger
  from typing import Dict, Iterable, List, Optional, Tuple
  import numpy
  import torch
  from ax.core.experiment import Experiment
  from ax.core.map_data import MapData
  from ax.core.objective import ScalarizedObjective
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.types import TModelPredictArm, TParameterization
  from ax.modelbridge.generation_strategy import GenerationStrategy
  from ax.modelbridge.modelbridge_utils import extract_objective_thresholds, extract_objective_weights, extract_outcome_constraints, observed_hypervolume, predicted_hypervolume, validate_and_apply_final_transform
  from ax.modelbridge.registry import get_model_from_generator_run, ModelRegistryBase
  from ax.modelbridge.torch import TorchModelBridge
  from ax.modelbridge.transforms.derelativize import Derelativize
  from ax.models.torch.botorch_moo_defaults import get_outcome_constraint_transforms, get_weighted_mc_objective_and_objective_thresholds
  from ax.plot.pareto_utils import get_tensor_converter_model
  from ax.service.utils import best_point
  from ax.service.utils.best_point import extract_Y_from_data, fill_missing_thresholds_from_nadir
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import checked_cast, not_none
  from botorch.utils.multi_objective.box_decompositions import DominatedPartitioning
label_desc: Use image node_id 12 for calling the BestPointMixin obj's underlying member method code with example usage: obj._get_trace_by_progression(experiment, optimization_config, bins, final_progression_only) and returns: best_observed,  bins