human
I wrote the below code

    out.write('digraph    traceroute    {\n')
    nodes = set()
    edges = set()
    if (cluster is None):
        def _add_node(node):
            if (node not in nodes):
                nodes.add(node)
                out.write((' DCTB %d    [label="%s"];\n' % (node, utils.int2ip(node))))
    else:
        clusters = {}
        def _add_node(node):
            if (node not in nodes):
                nodes.add(node)
                clusters.setdefault(cluster(node), set()).update([node])
    for (node, node_edges) in viewitems(graph):
        _add_node(node)
        for destnode in node_edges:
            _add_node(destnode)
            if ((node, destnode) not in edges):
                out.write((' DCTB %d    ->    %d;\n' % (node, destnode)))
                edges.add((node, destnode))
    if (cluster is not None):
        if (None in clusters):
            for node in clusters.pop(None):
                out.write((' DCTB %d    [label="%s"];\n' % (node, utils.int2ip(node))))
        for (clu, nodes) in viewitems(clusters):
            if isinstance(clu, basestring):
                clu = (clu, clu)
            out.write((' DCTB subgraph    cluster_%s    {\n' % clu[0]))
            out.write((' DCTB  DCTB label    =    "%s";\n' % clu[1]))
            for node in nodes:
                out.write((' DCTB  DCTB %d    [label="%s"];\n' % (node, utils.int2ip(node))))
            out.write(' DCTB }\n')
    out.write('}\n')

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

def writedotgraph(graph, out, cluster=None):