human
I wrote the below code

    if (compute_deps_cache is None):
        deps_cache = {}
        def compute_deps_cache(io):
            if (io not in deps_cache):
                d = deps(io)
                if d:
                    if (not isinstance(d, (list, OrderedSet))):
                        raise TypeError('Non-deterministic    collections    here    make    toposort    non-deterministic.')
                    deps_cache[io] = list(d)
                else:
                    deps_cache[io] = d
                return d
            else:
                return deps_cache[io]
    assert (deps_cache is not None)
    assert isinstance(outputs, (tuple, list, deque))
    (reachable, _clients) = stack_search(deque(outputs), compute_deps_cache, 'dfs', True)
    if (clients is not None):
        clients.update(_clients)
    sources = deque([r for r in reachable if (not deps_cache.get(r, None))])
    rset = set()
    rlist = []
    while sources:
        node = sources.popleft()
        if (node not in rset):
            rlist.append(node)
            rset.add(node)
            for client in _clients.get(node, []):
                d = [a for a in deps_cache[client] if (a is not node)]
                deps_cache[client] = d
                if (not d):
                    sources.append(client)
    if (len(rlist) != len(reachable)):
        if debug_print:
            print('')
            print(reachable)
            print(rlist)
        raise ValueError('graph    contains    cycles')
    return rlist

What's a good function header?

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

def general_toposort(outputs, deps, debug_print=False, compute_deps_cache=None, deps_cache=None, clients=None):