code: def pytest_terminal_summary(terminalreporter):
      durations = terminalreporter.config.option.durations
      verbose = terminalreporter.config.getvalue("verbose")
      if durations is None:
          return
      tr = terminalreporter
      dlist = []
      for replist in tr.stats.values():
          for rep in replist:
              if hasattr(rep, "duration"):
                  dlist.append(rep)
      if not dlist:
          return
      dlist.sort(key=lambda x: x.duration)
      dlist.reverse()
      if not durations:
          tr.write_sep("=", "slowest test durations")
      else:
          tr.write_sep("=", "slowest %s test durations" % durations)
          dlist = dlist[:durations]
  
      for rep in dlist:
          if verbose < 2 and rep.duration < 0.005:
              tr.write_line("")
              tr.write_line(
                  "(0.00 durations hidden.  Use -vv to show these durations.)"
              )
              break
          tr.write_line(
              "%02.2fs %-8s %s" % (rep.duration, rep.when, rep.nodeid)
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import bdb
  import os
  import sys
  from time import time
  import attr
  import six
  from .reports import CollectErrorRepr
  from .reports import CollectReport
  from .reports import TestReport
  from _pytest._code.code import ExceptionInfo
  from _pytest.compat import safe_str
  from _pytest.outcomes import Exit
  from _pytest.outcomes import Skipped
  from _pytest.outcomes import TEST_OUTCOME
label_desc: Use image node_id 2 for calling a global function with example usage: pytest_terminal_summary(terminalreporter) without return types