def on_doctree_read(app, document):
cache: Dict[type, Dict[str, object]] = {}<EOL>for desc_node in document.traverse(addnodes.desc):<EOL><INDENT>if desc_node.get("<STR_LIT>") != "<STR_LIT>":<EOL><INDENT>continue<EOL><DEDENT>signature_node = desc_node.traverse(addnodes.desc_signature)[<NUM_LIT:0>]<EOL>module_name = signature_node.get("<STR_LIT>")<EOL>object_name = signature_node.get("<STR_LIT>")<EOL>object_type = desc_node.get("<STR_LIT>")<EOL>module = importlib.import_module(module_name)<EOL>if object_type == "<STR_LIT:class>":<EOL><INDENT>handle_class(signature_node, module, object_name, cache)<EOL><DEDENT>elif object_type in ("<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>handle_method(signature_node, module, object_name, cache)<EOL><DEDENT><DEDENT>
Hooks into Sphinx's ``doctree-read`` event.