human
I wrote the below code

    if (nodes is not None):
        G = G.subgraph(nodes)
    H = nx.convert_node_labels_to_integers(G)
    ns = sorted(H.nodes())
    def bits():
        for (i, j) in [(i, j) for j in range(1, n) for i in range(j)]:
            (yield G.has_edge(ns[i], ns[j]))
    n = G.order()
    data = n_to_data(n)
    d = 0
    flush = False
    for (i, b) in zip(range((n * n)), bits()):
        d |= (b << (5 - (i % 6)))
        flush = True
        if ((i % 6) == 5):
            data.append(d)
            d = 0
            flush = False
    if flush:
        data.append(d)
    string_data = data_to_graph6(data)
    if header:
        string_data = ('>>graph6<<' + string_data)
    return string_data

What's a good function header?

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

@not_implemented_for('directed', 'multigraph')
def generate_graph6(G, nodes=None, header=True):