code: def test_scheduler_completed_record_from_scheduler(self) -> None:
      scheduler = Scheduler(
          experiment=get_branin_experiment(),
          generation_strategy=get_generation_strategy(),
          options=SchedulerOptions(
              total_trials=0,
              tolerated_trial_failure_rate=0.2,
              init_seconds_between_polls=10,
          ),
      )
  
      with mock.patch.object(
          scheduler, "get_improvement_over_baseline", return_value=5.0
      ):
          record = SchedulerCompletedRecord.from_scheduler(
              scheduler=scheduler
          )
      expected = SchedulerCompletedRecord(
          experiment_completed_record=ExperimentCompletedRecord.from_experiment(
              experiment=scheduler.experiment
          ),
          best_point_quality=float("-inf"),
          model_fit_quality=float(
              "-inf"
          ),  # -inf because no model has been fit
          model_std_quality=float("-inf"),
          model_fit_generalization=float("-inf"),
          model_std_generalization=float("-inf"),
          improvement_over_baseline=5.0,
          num_metric_fetch_e_encountered=0,
          num_trials_bad_due_to_err=0,
      )
      self.assertEqual(record, expected)
  
      flat = record.flatten()
      expected_dict = {
          **ExperimentCompletedRecord.from_experiment(
              experiment=scheduler.experiment
          ).__dict__,
          "best_point_quality": float("-inf"),
          "model_fit_quality": float("-inf"),
          "model_std_quality": float("-inf"),
          "model_fit_generalization": float("-inf"),
          "model_std_generalization": float("-inf"),
          "improvement_over_baseline": 5.0,
          "num_metric_fetch_e_encountered": 0,
          "num_trials_bad_due_to_err": 0,
      }
      self.assertEqual(flat, expected_dict)
  
imports: from typing import cast, Dict
  from unittest import mock
  from ax.core.experiment import Experiment
  from ax.core.objective import Objective
  from ax.core.optimization_config import OptimizationConfig
  from ax.metrics.branin import BraninMetric
  from ax.modelbridge.generation_strategy import GenerationStep, GenerationStrategy
  from ax.modelbridge.registry import Models
  from ax.runners.synthetic import SyntheticRunner
  from ax.service.scheduler import get_fitted_model_bridge, Scheduler, SchedulerOptions
  from ax.telemetry.experiment import ExperimentCompletedRecord, ExperimentCreatedRecord
  from ax.telemetry.generation_strategy import GenerationStrategyCreatedRecord
  from ax.telemetry.scheduler import SchedulerCompletedRecord, SchedulerCreatedRecord
  from ax.utils.common.constants import Keys
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_branin_experiment, get_branin_search_space
  from ax.utils.testing.modeling_stubs import get_generation_strategy
label_desc: Use image node_id 2 for calling the TestScheduler obj's underlying member method code with example usage: obj.test_scheduler_completed_record_from_scheduler() without return types