code: def test_class():
      source = (
          "class Foo(object):\n"
          "    attr1 = None  #: comment1\n"
          "    attr2 = None  #: comment2\n"
          "\n"
          "    def __init__(self):\n"
          "        self.a = 1 + 1  #: comment3\n"
          "        self.attr2 = 1 + 1  #: overridden\n"
          "        b = 1 + 1  #: comment5\n"
          "\n"
          "    def some_method(self):\n"
          "        c = 1 + 1  #: comment6\n"
      )
      parser = Parser(source)
      parser.parse()
      assert parser.comments == {
          ("Foo", "attr1"): "comment1",
          ("Foo", "a"): "comment3",
          ("Foo", "attr2"): "overridden",
      }
      assert parser.definitions == {
          "Foo": ("class", 1, 11),
          "Foo.__init__": ("def", 5, 8),
          "Foo.some_method": ("def", 10, 11),
      }
      assert parser.deforders == {
          "Foo": 0,
          "Foo.attr1": 1,
          "Foo.__init__": 3,
          "Foo.a": 4,
          "Foo.attr2": 5,
          "Foo.some_method": 6,
      }
  
imports: from sphinx.pycode.parser import Parser
  from sphinx.util.inspect import signature_from_str
label_desc: Use image node_id 10 for calling a global function with example usage: test_class() without return types