code: def get_model_trace_of_times(
      experiment: Experiment,
  ) -> Tuple[List[Optional[float]], List[Optional[float]]]:
      """
      Get time spent fitting the model and generating candidates during each trial.
      Not cumulative.
  
      Returns:
          List of fit times, list of gen times.
      """
      generator_runs = [
          _extract_generator_run(trial=trial)
          for trial in experiment.trials.values()
      ]
      fit_times = [gr.fit_time for gr in generator_runs]
      gen_times = [gr.gen_time for gr in generator_runs]
      return fit_times, gen_times
  
imports: from collections import defaultdict
  from typing import Dict, Iterable, List, NamedTuple, Optional, Set, Tuple
  import numpy
  from ax.core.arm import Arm
  from ax.core.base_trial import BaseTrial, 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
  from ax.core.observation import ObservationFeatures
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.trial import Trial
  from ax.core.types import ComparisonOp
  from ax.utils.common.typeutils import not_none
  from pyre_extensions import none_throws
label_desc: Use image node_id 6 for calling a global function with example usage: get_model_trace_of_times(experiment) and returns: fit_times,  gen_times