def _reverse_sort_by_order(name_to_order_node):
  """Sorts map of name_to_order_node nodes in reverse order.

  The output is such that the nodes in name_to_order_node are sorted in
  descending order of the "order" field.

  Args:
    name_to_order_node: Map from name to {order, node}. Output of
      graph_compute_order.get_compute_order().

  Returns:
    sorted_name_to_order_node: Sorted version of the input, in descending order.
  """
  return sorted(name_to_order_node.items(), key=lambda x: -x[1].order)