MAINT: move get_node_to_distn into a more generic module