code: def test_format_stats(dummy_trial):
      """Test stats section formatting"""
      experiment = DummyExperiment()
      experiment.stats = ExperimentStats(
          best_trials_id="dummy",
          trials_completed=10,
          best_evaluation=0.1,
          start_time="yesterday",
          finish_time="now",
          elapsed_time="way too long",
      )
      experiment.get_trial = lambda trial=None, uid=None: dummy_trial
      experiment.is_done = False
      assert format_stats(experiment) == textwrap.dedent(
          """\
          Stats
          =====
          completed: False
          trials completed: 10
          best trial:
            id: dummy
            evaluation: 0.1
            params:
              a: 0.0
              b: 1
              c: Some
          start time: yesterday
          finish time: now
          elapsed_time: way too long
          """
      )
  
imports: import itertools
  import textwrap
  import pytest
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.utils.format_terminal import format_algorithm, format_commandline, format_config, format_dict, format_identification, format_info, format_list, format_metadata, format_refers, format_space, format_stats, format_title, get_trial_params
  from orion.core.worker.experiment import ExperimentStats
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 36 for calling a global function with example usage: test_format_stats(dummy_trial) without return types