code: def get_trajectory(
      self, sort_by: str = "trials"
  ) -> tuple[list[float], list[float]]:
      if len(self.task.objectives) > 1:
          raise NotSupportedError
  
      assert self._smac is not None
      rh = self._smac.runhistory
      trajectory = self._smac.intensifier.trajectory
      X: list[int | float] = []
      Y: list[float] = []
  
      for traj in trajectory:
          assert len(traj.config_ids) == 1
          config_id = traj.config_ids[0]
          config = rh.get_config(config_id)
  
          cost = rh.get_cost(config)
          if cost > 1e6:
              continue
  
          if sort_by == "trials":
              X.append(traj.trial)
          elif sort_by == "walltime":
              X.append(traj.walltime)
          else:
              raise RuntimeError("Unknown sort_by.")
  
          Y.append(cost)
  
      return X, Y
  
file_path: SMAC3/benchmark/src/wrappers/v20.py
imports: from __future__ import annotations
  from src.tasks.task import Task
  from src.utils.exceptions import NotSupportedError
  from src.wrappers.wrapper import Wrapper
label_desc: Use image node_id 3 for calling the Version20 obj's underlying member method code with example usage: obj.get_trajectory(sort_by) and returns: X,  Y