code: def get_model_times(experiment: Experiment) -> Tuple[float, float]:
      """Get total times spent fitting the model and generating candidates in the
      course of the experiment.
      """
      fit_times, gen_times = get_model_trace_of_times(experiment)
      fit_time = sum((t for t in fit_times if t is not None))
      gen_time = sum((t for t in gen_times if t is not None))
      return fit_time, gen_time
  
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 7 for calling a global function with example usage: get_model_times(experiment) and returns: fit_time,  gen_time