code: def key_to_cmp(key):
      """
      comparator function based on "key" function
      """
  
      def key_cmp(a, b):
          return cmp(key(a), key(b))
  
      return key_cmp
  
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 9 for calling a global function with example usage: key_to_cmp(key) and returns: key_cmp, cmp