code: def test_get_items_summary(make_app, app_params):
      import sphinx.ext.autosummary
      import sphinx.ext.autosummary.generate
  
      args, kwargs = app_params
      app = make_app(*args, **kwargs)
      sphinx.ext.autosummary.generate.setup_documenters(app)
      # monkey-patch Autosummary.get_items so we can easily get access to it's
      # results..
      orig_get_items = sphinx.ext.autosummary.Autosummary.get_items
  
      autosummary_items = {}
  
      def new_get_items(self, names, *args, **kwargs):
          results = orig_get_items(self, names, *args, **kwargs)
          for name, result in zip(names, results):
              autosummary_items[name] = result  # NoQA: PERF403
          return results
  
      def handler(app, what, name, obj, options, lines):
          assert isinstance(lines, list)
  
          # ensure no docstring is processed twice:
          assert "THIS HAS BEEN HANDLED" not in lines
          lines.append("THIS HAS BEEN HANDLED")
  
      app.connect("autodoc-process-docstring", handler)
  
      sphinx.ext.autosummary.Autosummary.get_items = new_get_items
      try:
          app.build(force_all=True)
      finally:
          sphinx.ext.autosummary.Autosummary.get_items = orig_get_items
  
      html_warnings = app._warning.getvalue()
      assert html_warnings == ""
  
      expected_values = {
          "withSentence": "I have a sentence which spans multiple lines.",
          "noSentence": "this doesn't start with a capital.",
          "emptyLine": "This is the real summary",
          "module_attr": "This is a module attribute",
          "C.class_attr": "This is a class attribute",
          "C.instance_attr": "This is an instance attribute",
          "C.prop_attr1": "This is a function docstring",
          "C.prop_attr2": "This is a attribute docstring",
          "C.C2": "This is a nested inner class docstring",
      }
      for key, expected in expected_values.items():
          assert (
              autosummary_items[key][2] == expected
          ), "Summary for %s was %r -" " expected %r" % (
              key,
              autosummary_items[key],
              expected,
          )
  
      # check an item in detail
      assert "func" in autosummary_items
      func_attrs = (
          "func",
          "(arg_, *args, **kwargs)",
          "Test function take an argument ended with underscore.",
          "dummy_module.func",
      )
      assert autosummary_items["func"] == func_attrs
  
imports: import sys
  from io import StringIO
  from pathlib import Path
  from unittest.mock import Mock, patch
  import pytest
  from docutils import nodes
  from sphinx import addnodes
  from sphinx.ext.autosummary import autosummary_table, autosummary_toc, extract_summary, import_by_name, mangle_signature
  from sphinx.ext.autosummary.generate import AutosummaryEntry, generate_autosummary_content, generate_autosummary_docs
  from sphinx.ext.autosummary.generate import main
  from sphinx.testing.util import assert_node, etree_parse
  from sphinx.util.docutils import new_document
label_desc: Use image node_id 4 for calling a global function with example usage: test_get_items_summary(make_app, app_params) and returns: results