human
I wrote the below code

    path = set()
    visited_nodes = set()
    def visit(node):
        if (node not in visited_nodes):
            visited_nodes.add(node)
            path.add(node)
            for subnode in get_successive_nodes(node):
                run_on_edge(node, subnode)
                if (subnode in path):
                    raise CircularDependencyError([repr(subnode), '...', repr(subnode)])
                visit(subnode)
            path.remove(node)
    for node in start_nodes:
        visit(node)

What's a good function header?

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

def traverse_graph(start_nodes, get_successive_nodes, run_on_edge=(lambda prev, nxt: None)):