class_docstr: A directive class for all autodoc directives. It works as a dispatcher of Documenters.
  
  It invokes a Documenter upon running. After the processing, it parses and returns
  the content generated by Documenter.
class_docstr_tok: ["A","directive","class","for","all","autodoc","directives",".","It","works","as","a","dispatcher","of","Documenters",".","It","invokes","a","Documenter","upon","running",".","After","the","processing",",","it","parses","and","returns","the","content","generated","by","Documenter","."]
code: def run(self) -> list[Node]:
      reporter = self.state.document.reporter
  
      try:
          source, lineno = reporter.get_source_and_line(  # type: ignore[attr-defined]
              self.lineno
          )
      except AttributeError:
          source, lineno = (None, None)
      logger.debug(
          "[autodoc] %s:%s: input:\n%s", source, lineno, self.block_text
      )
  
      # look up target Documenter
      objtype = self.name[4:]  # strip prefix (auto-).
      doccls = self.env.app.registry.documenters[objtype]
  
      # process the options with the selected documenter's option_spec
      try:
          documenter_options = process_documenter_options(
              doccls, self.config, self.options
          )
      except (KeyError, ValueError, TypeError) as exc:
          # an option is either unknown or has a wrong type
          logger.error(
              "An option to %s is either unknown or has an invalid value: %s"
              % (self.name, exc),
              location=(self.env.docname, lineno),
          )
          return []
  
      # generate the output
      params = DocumenterBridge(
          self.env, reporter, documenter_options, lineno, self.state
      )
      documenter = doccls(params, self.arguments[0])
      documenter.generate(more_content=self.content)
      if not params.result:
          return []
  
      logger.debug("[autodoc] output:\n%s", "\n".join(params.result))
  
      # record all filenames as dependencies -- this will at least
      # partially make automatic invalidation possible
      for fn in params.record_dependencies:
          self.state.document.settings.record_dependencies.add(fn)
  
      result = parse_generated_content(
          self.state, params.result, documenter
      )
      return result
  
file_path: sphinx/sphinx/ext/autodoc/directive.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, Callable
  from docutils import nodes
  from docutils.statemachine import StringList
  from docutils.utils import Reporter, assemble_option_dict
  from sphinx.ext.autodoc import Documenter, Options
  from sphinx.util import logging
  from sphinx.util.docutils import SphinxDirective, switch_source_input
  from sphinx.util.nodes import nested_parse_with_titles
label_desc: Use image node_id 1 for calling the AutodocDirective obj's underlying member method code with example usage: obj.run() and returns: result, list, list