code: def compute_score_trace(
      optimization_trace: np.ndarray,
      num_baseline_trials: int,
      problem: BenchmarkProblemBase,
  ) -> np.ndarray:
      """Computes a score trace from the optimization trace."""
  
      # Use the first GenerationStep's best found point as baseline. Sometimes (ex. in
      # a timeout) the first GenerationStep will not have not completed and we will not
      # have enough trials; in this case we do not score.
      if (
          len(optimization_trace) <= num_baseline_trials
      ) or not isinstance(problem, BenchmarkProblemWithKnownOptimum):
          return np.full(len(optimization_trace), np.nan)
      optimum = problem.optimal_value
      baseline = optimization_trace[num_baseline_trials - 1]
  
      score_trace = 100 * (
          1 - (optimization_trace - optimum) / (baseline - optimum)
      )
      if score_trace.max() > 100:
          logger.info(
              "Observed scores above 100. This indicates that we found a trial that is "
              "better than the optimum. Clipping scores to 100 for now."
          )
      return score_trace.clip(min=0, max=100)
  
file_path: Ax/ax/benchmark/benchmark.py
imports: from itertools import product
  from logging import Logger
  from time import time
  from typing import Iterable, List
  import numpy
  from ax.benchmark.benchmark_method import BenchmarkMethod
  from ax.benchmark.benchmark_problem import BenchmarkProblemBase, BenchmarkProblemWithKnownOptimum
  from ax.benchmark.benchmark_result import AggregatedBenchmarkResult, BenchmarkResult
  from ax.core.experiment import Experiment
  from ax.core.utils import get_model_times
  from ax.service.scheduler import Scheduler
  from ax.utils.common.logger import get_logger
  from botorch.utils.sampling import manual_seed
label_desc: Use image node_id 1 for calling a global function with example usage: compute_score_trace(optimization_trace, num_baseline_trials, problem) and returns: score_trace, np