def are_ancestors(node1, node2):
    """
    Take two ete3 tree nodes.

    Return True if either is the ancestor of another
    :param node1:
    :param node2:
    :return:
    """
    for ancestor in node1.iter_ancestors():
        if ancestor == node2:
            return True
    for ancestor in node2.iter_ancestors():
        if ancestor == node1:
            return True
    return False