code: def sort_schedule_fn(*cmps):
      """
      Make a schedule function from comparators.
  
      See Also
      --------
      sort_apply_nodes
  
      """
      dependence = make_dependence_cmp()
      cmps = (dependence,) + cmps
  
      def schedule(fgraph):
          """
          Order nodes in a FunctionGraph.
  
          """
          return sort_apply_nodes(fgraph.inputs, fgraph.outputs, cmps)
  
      return schedule
  
file_path: Theano/theano/gof/sched.py
imports: from __future__ import absolute_import, print_function, division
  from collections import defaultdict
  from six import iteritems
  from theano.gof.graph import list_of_nodes
  from theano.compat import cmp
label_desc: Use image node_id 8 for calling a global function with example usage: sort_schedule_fn() and returns: schedule, sort_apply_nodes