def node_rank(self):
nodes = self.postorder()<EOL>node_rank = {}<EOL>for node in nodes:<EOL><INDENT>max_rank = <NUM_LIT:0><EOL>for child in self[node].nodes():<EOL><INDENT>some_rank = node_rank[child] + <NUM_LIT:1><EOL>max_rank = max(max_rank, some_rank)<EOL><DEDENT>node_rank[node] = max_rank<EOL><DEDENT>return node_rank<EOL>
Returns the maximum rank for each **topological node** in the 
``DictGraph``. The rank of a node is defined as the number of edges 
between the node and a node which has rank 0. A **topological node** 
has rank 0 if it has no incoming edges.