graph = inputs.exi_graph.reverse()
    nodes = flat_node_order_

def nx_topsort_rank(graph, nodes=None):
    """
    graph = inputs.exi_graph.reverse()
    nodes = flat_node_order_
    """
    import utool as ut
    if False:
        # Determenistic version
        # Ok, this doesn't work.
        dag_ranks = nx_dag_node_rank(graph, nodes)
        toprank = ut.argsort(dag_ranks, list(map(str, nodes)))
    else:
        # Non-determenistic version
        dag_ranks = nx_dag_node_rank(graph, nodes)
        topsort = list(nx.topological_sort(graph))
        # print('topsort = %r' % (topsort,))
        node_to_top_rank = ut.make_index_lookup(topsort)
        toprank = ut.dict_take(node_to_top_rank, nodes)
    return toprank