human
I wrote the below code

    comes_before = dict(((a, set()) for a in l))
    comes_after = dict(((a, set()) for a in l))
    def add_links(a, b):
        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():
        '\n                                Tests    for    cycles    in    manufactured    edges.\n\n                                '
        for a in l:
            for b in l:
                assert (not ((b in comes_after[a]) and (a in comes_after[b])))
    for cmp_fn in cmps:
        for a in l:
            for b in l:
                if (cmp_fn(a, b) < 0):
                    if ((b not in comes_before[a]) and (b not in comes_after[a])):
                        add_links(a, b)
    return _toposort(comes_after)

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def posort(l, *cmps):