def _FindAncestorAtIndent(node, indent):
 if (node.parent.parent is None):
  return node
 parent_indent = pytree_utils.GetNodeAnnotation(node.parent, pytree_utils.Annotation.CHILD_INDENT)
 if ((parent_indent is not None) and indent.startswith(parent_indent)):
  return node
 else:
  return _FindAncestorAtIndent(node.parent, indent)

def _FindAncestorAtIndent ( node , indent ) : if ( node . parent . parent is None ) : return node parent_indent = pytree_utils . GetNodeAnnotation ( node . parent , pytree_utils . Annotation . CHILD_INDENT ) if ( ( parent_indent is not None ) and indent . startswith ( parent_indent ) ) : return node else : return _FindAncestorAtIndent ( node . parent , indent )
find an ancestor of node with the given indentation .