code: def test_simple_profiler_summary(tmpdir, extended):
      """Test the summary of `SimpleProfiler`."""
      profiler = SimpleProfiler(extended=extended)
      profiler.start_time = 63.0
      hooks = [
          "on_train_start",
          "on_train_end",
          "on_train_epoch_start",
          "on_train_epoch_end",
          "on_before_batch_transfer",
          "on_fit_start",
      ]
      sometime = 0.773434
      sep = os.linesep
      max_action_len = len("on_before_batch_transfer")
  
      for i, hook in enumerate(hooks):
          with profiler.profile(hook):
              pass
  
          profiler.recorded_durations[hook] = [sometime + i]
  
      if extended:
          header_string = (
              f"{sep}|  {'Action':<{max_action_len}s}\t|  {'Mean duration (s)':<15}\t|  {'Num calls':<15}\t|"
              f"  {'Total time (s)':<15}\t|  {'Percentage %':<15}\t|"
          )
          output_string_len = len(header_string.expandtabs())
          sep_lines = f"{sep}{'-' * output_string_len}"
          expected_text = (
              f"Profiler Report{sep}"
              f"{sep_lines}"
              f"{sep}|  Action                       |  Mean duration (s)    |  Num calls            |  Total time (s)       |  Percentage %         |"  # noqa: E501
              f"{sep_lines}"
              f"{sep}|  Total                        |  -                    |  6                    |  7.0                  |  100 %                |"  # noqa: E501
              f"{sep_lines}"
              f"{sep}|  on_fit_start                 |  5.7734               |  1                    |  5.7734               |  82.478               |"  # noqa: E501
              f"{sep}|  on_before_batch_transfer     |  4.7734               |  1                    |  4.7734               |  68.192               |"  # noqa: E501
              f"{sep}|  on_train_epoch_end           |  3.7734               |  1                    |  3.7734               |  53.906               |"  # noqa: E501
              f"{sep}|  on_train_epoch_start         |  2.7734               |  1                    |  2.7734               |  39.62                |"  # noqa: E501
              f"{sep}|  on_train_end                 |  1.7734               |  1                    |  1.7734               |  25.335               |"  # noqa: E501
              f"{sep}|  on_train_start               |  0.77343              |  1                    |  0.77343              |  11.049               |"  # noqa: E501
              f"{sep_lines}{sep}"
          )
      else:
          header_string = f"{sep}|  {'Action':<{max_action_len}s}\t|  {'Mean duration (s)':<15}\t|  {'Total time (s)':<15}\t|"
          output_string_len = len(header_string.expandtabs())
          sep_lines = f"{sep}{'-' * output_string_len}"
          expected_text = (
              f"Profiler Report{sep}"
              f"{sep_lines}"
              f"{sep}|  Action                       |  Mean duration (s)    |  Total time (s)       |"
              f"{sep_lines}"
              f"{sep}|  on_fit_start                 |  5.7734               |  5.7734               |"
              f"{sep}|  on_before_batch_transfer     |  4.7734               |  4.7734               |"
              f"{sep}|  on_train_epoch_end           |  3.7734               |  3.7734               |"
              f"{sep}|  on_train_epoch_start         |  2.7734               |  2.7734               |"
              f"{sep}|  on_train_end                 |  1.7734               |  1.7734               |"
              f"{sep}|  on_train_start               |  0.77343              |  0.77343              |"
              f"{sep_lines}{sep}"
          )
  
      summary = profiler.summary().expandtabs()
      assert expected_text == summary
  
imports: import logging
  import os
  import platform
  import time
  from copy import deepcopy
  from unittest.mock import patch
  import numpy
  import pytest
  import torch
  from lightning.pytorch import Callback, Trainer
  from lightning.pytorch.callbacks import EarlyStopping, StochasticWeightAveraging
  from lightning.pytorch.demos.boring_classes import BoringModel, ManualOptimBoringModel
  from lightning.pytorch.loggers import CSVLogger, TensorBoardLogger
  from lightning.pytorch.profilers import AdvancedProfiler, PassThroughProfiler, PyTorchProfiler, SimpleProfiler
  from lightning.pytorch.profilers.pytorch import _KINETO_AVAILABLE, RegisterRecordFunction, warning_cache
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 13 for calling a global function with example usage: test_simple_profiler_summary(tmpdir, extended) without return types