code: def test_experiment_completed_record_from_experiment(self) -> None:
      experiment = get_experiment_with_custom_runner_and_metric()
  
      record = ExperimentCompletedRecord.from_experiment(
          experiment=experiment
      )
  
      # Calculate these here, may change from run to run
      fit_time, gen_time = get_model_times(experiment=experiment)
      expected = ExperimentCompletedRecord(
          num_initialization_trials=1,
          num_bayesopt_trials=0,
          num_other_trials=0,
          num_completed_trials=1,
          num_failed_trials=0,
          num_abandoned_trials=0,
          num_early_stopped_trials=0,
          total_fit_time=int(fit_time),
          total_gen_time=int(gen_time),
      )
      self.assertEqual(record, expected)
  
imports: from ax.core.utils import get_model_times
  from ax.telemetry.experiment import ExperimentCompletedRecord, ExperimentCreatedRecord
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_experiment_with_custom_runner_and_metric
label_desc: Use image node_id 2 for calling the TestExperiment obj's underlying member method code with example usage: obj.test_experiment_completed_record_from_experiment() without return types