code: def pytest_terminal_summary(terminalreporter):
      import _pytest.config
  
      if terminalreporter.config.option.pastebin != "failed":
          return
      tr = terminalreporter
      if "failed" in tr.stats:
          terminalreporter.write_sep(
              "=", "Sending information to Paste Service"
          )
          for rep in terminalreporter.stats.get("failed"):
              try:
                  msg = rep.longrepr.reprtraceback.reprentries[
                      -1
                  ].reprfileloc
              except AttributeError:
                  msg = tr._getfailureheadline(rep)
              tw = _pytest.config.create_terminal_writer(
                  terminalreporter.config, stringio=True
              )
              rep.toterminal(tw)
              s = tw.stringio.getvalue()
              assert len(s)
              pastebinurl = create_new_paste(s)
              tr.write_line("%s --> %s" % (msg, pastebinurl))
  
file_path: catboost/contrib/python/pytest/py2/_pytest/pastebin.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  import tempfile
  import six
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: pytest_terminal_summary(terminalreporter) without return types