code: def test_posort():
      l = list(range(1, 20))
      cmps = [
          lambda a, b: a % 10 - b % 10,
          lambda a, b: (a / 10) % 2 - (b / 10) % 2,
          lambda a, b: a - b,
      ]
      assert posort(l, *cmps) == [
          10,
          1,
          11,
          2,
          12,
          3,
          13,
          4,
          14,
          5,
          15,
          6,
          16,
          7,
          17,
          8,
          18,
          9,
          19,
      ]
  
file_path: Theano/theano/gof/tests/test_sched.py
imports: from __future__ import absolute_import, print_function, division
  from theano.gof.sched import make_dependence_cmp, sort_apply_nodes, reverse_dict, _toposort, posort
  from theano import tensor
  from theano.gof.graph import io_toposort
  from theano.compat import cmp
label_desc: Use image node_id 6 for calling a global function with example usage: test_posort() without return types