def is_in_section_title(node):
 from sphinx.util.nodes import traverse_parent
 for ancestor in traverse_parent(node):
  if (isinstance(ancestor, nodes.title) and isinstance(ancestor.parent, nodes.section)):
   return True
 return False

def is_in_section_title ( node ) : from sphinx . util . nodes import traverse_parent for ancestor in traverse_parent ( node ) : if ( isinstance ( ancestor , nodes . title ) and isinstance ( ancestor . parent , nodes . section ) ) : return True return False
determine whether the node is in a section title .