code: def get_ancestor_id_names(mention):
      
      span = _to_span(mention)
      id_names = []
      i = _get_node(span.sentence)
      while i is not None:
          id_names.insert(0, str(i.get("id")))
          i = i.getparent()
      return id_names
docs: Return the HTML id's of the Mention's ancestors.
  
      If a candidate is passed in, only the ancestors of its first Mention are
      returned.
  
      :param mention: The Mention to evaluate
      :rtype: list of strings