code: def ancestor(vil, v, default_ancestor):
      # the relevant text is at the bottom of page 7 of
      # "Improving Walker's Algorithm to Run in Linear Time" by Buchheim et al,
      # (2002)
      # https://citeseerx.ist.psu.edu/doc_view/pid/1f41c3c2a4880dc49238e46d555f16d28da2940d
      if vil.ancestor in v.parent.children:
          return vil.ancestor
      else:
          return default_ancestor
  
file_path: scikit-learn/sklearn/tree/_reingold_tilford.py
imports: import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: ancestor(vil, v, default_ancestor) and returns: vil, default_ancestor