code: def test_ModuleAnalyzer_find_tags():
      code = (
          "class Foo(object):\n"  # line: 1
          '    """class Foo!"""\n'
          "    def __init__(self):\n"
          "       pass\n"
          "\n"
          "    def bar(self, arg1, arg2=True, *args, **kwargs):\n"
          '       """method Foo.bar"""\n'
          "       pass\n"
          "\n"
          "    class Baz(object):\n"
          "       def __init__(self):\n"  # line: 11
          "           pass\n"
          "\n"
          "def qux():\n"
          '   """function baz"""\n'
          "   pass\n"
          "\n"
          "@decorator1\n"
          "@decorator2\n"
          "def quux():\n"
          "   pass\n"  # line: 21
          "\n"
          "class Corge(object):\n"
          "    @decorator1\n"
          "    @decorator2\n"
          "    def grault(self):\n"
          "        pass\n"
      )
      analyzer = ModuleAnalyzer.for_string(code, "module")
      tags = analyzer.find_tags()
      assert set(tags.keys()) == {
          "Foo",
          "Foo.__init__",
          "Foo.bar",
          "Foo.Baz",
          "Foo.Baz.__init__",
          "qux",
          "quux",
          "Corge",
          "Corge.grault",
      }
      assert tags["Foo"] == ("class", 1, 12)  # type, start, end
      assert tags["Foo.__init__"] == ("def", 3, 4)
      assert tags["Foo.bar"] == ("def", 6, 8)
      assert tags["Foo.Baz"] == ("class", 10, 12)
      assert tags["Foo.Baz.__init__"] == ("def", 11, 12)
      assert tags["qux"] == ("def", 14, 16)
      assert tags["quux"] == ("def", 18, 21)
      assert tags["Corge"] == ("class", 23, 27)
      assert tags["Corge.grault"] == ("def", 24, 27)
  
file_path: sphinx/tests/test_pycode/test_pycode.py
imports: import os
  import sys
  import pytest
  import sphinx
  from sphinx.errors import PycodeError
  from sphinx.pycode import ModuleAnalyzer
label_desc: Use image node_id 5 for calling a global function with example usage: test_ModuleAnalyzer_find_tags() without return types