Update get_all_referenced_nodes.py