code: def _ascend(node, cls):
      while node and not isinstance(node, cls):
          node = node.parent
      return node
  
imports: import re
  import pydoc
  import inspect
  import collections
  import hashlib
  from docutils.nodes import citation, Text
  import sphinx
  from sphinx.addnodes import pending_xref, desc_content
  from .docscrape_sphinx import get_doc_object, SphinxDocString
  from .None import __version__
  from docutils.statemachine import ViewList
  from sphinx.domains.c import CDomain
  from sphinx.domains.python import PythonDomain
label_desc: Use image node_id 2 for calling a global function with example usage: _ascend(node, cls) and returns: node