get_ancestor_of_level