    def get_top_sort(nodes: Dict[str, NodeRepr]):
        """Get the topological order of the DAG.

        Args:
            nodes (`Dict[str, NodeRepr]`): All the nodes repr from DAG.

        Returns:
           List: Topological list.
        """
        graph = dict((name, nodes[name].next_nodes) for name in nodes)
        if OutputConst.name in graph:
            graph[OutputConst.name] = []
        result = []
        while True:
            temp_list = {j for i in graph.values() for j in i}
            node = [x for x in (list(graph.keys())) if x not in temp_list]
            if not node:
                break
            result.append(node[0])
            del graph[node[0]]
        return result
Get the topological order of the DAG.

Args:
nodes (`Dict[str, NodeRepr]`): All the nodes repr from DAG.

Returns:
List: Topological list.
towhee/runtime/dag_repr.py