def METHOD_NAME(nodes, *cmps):
    """
    Partially ordered sort with multiple comparators.
    Given a list of comparators, orders the elements in `nodes` so that the
    comparators are satisfied as much as possible giving precedence to
    earlier comparators.
    Parameters
    ----------
    nodes
        An iterable of nodes in a graph.
    cmps
        A sequence of comparator functions that describe which nodes should
        come before which others.
    Returns
    -------
    list
        A list of nodes which satisfy the comparators as much as possible.
    Notes
    -----
    Implemented with _toposort.
    Examples
    --------
    >>> lower_tens = lambda a, b: a/10 - b/10 # prefer lower numbers div 10
    >>> prefer evens = lambda a, b: a%2 - b%2 # prefer even numbers
    >>> posort(list(range(20)), lower_tens, prefer_evens)
    [0, 8, 2, 4, 6, 1, 3, 5, 7, 9, 16, 18, 10, 12, 14, 17, 19, 11, 13, 15]
    """
    comes_before = {a: set() for a in nodes}
    comes_after = {a: set() for a in nodes}
    def add_links(a, b):  # b depends on a
        comes_after[a].add(b)
        comes_after[a].update(comes_after[b])
        for c in comes_before[a]:
            comes_after[c].update(comes_after[a])
        comes_before[b].add(a)
        comes_before[b].update(comes_before[a])
        for c in comes_after[b]:
            comes_before[c].update(comes_before[b])
    def check():
        """
        Tests for cycles in manufactured edges.
        """
        for a in nodes:
            for b in nodes:
                assert not (b in comes_after[a] and a in comes_after[b])
    for cmp_fn in cmps:
        for a in nodes:
            for b in nodes:
                if cmp_fn(a, b) < 0:  # a wants to come before b
                    # if this wouldn't cause a cycle and isn't already known
                    if b not in comes_before[a] and b not in comes_after[a]:
                        add_links(a, b)
    # check() # debug code
    return _toposort(comes_after)