code: def pytest_terminal_summary(
      terminalreporter: TerminalReporter,
  ) -> None:
      if terminalreporter.config.option.pastebin != "failed":
          return
      if "failed" in terminalreporter.stats:
          terminalreporter.write_sep(
              "=", "Sending information to Paste Service"
          )
          for rep in terminalreporter.stats["failed"]:
              try:
                  msg = rep.longrepr.reprtraceback.reprentries[
                      -1
                  ].reprfileloc
              except AttributeError:
                  msg = terminalreporter._getfailureheadline(rep)
              file = StringIO()
              tw = create_terminal_writer(terminalreporter.config, file)
              rep.toterminal(tw)
              s = file.getvalue()
              assert len(s)
              pastebinurl = create_new_paste(s)
              terminalreporter.write_line(f"{msg} --> {pastebinurl}")
  
file_path: pytest/src/_pytest/pastebin.py
imports: import tempfile
  from io import StringIO
  from typing import IO
  from typing import Union
  import pytest
  from _pytest.config import Config
  from _pytest.config import create_terminal_writer
  from _pytest.config.argparsing import Parser
  from _pytest.stash import StashKey
  from _pytest.terminal import TerminalReporter
label_desc: Use image node_id 5 for calling a global function with example usage: pytest_terminal_summary(terminalreporter) without return types