human
I wrote the below code

    if string.startswith('>>sparse6<<'):
        string = string[11:]
    if (not string.startswith(':')):
        raise NetworkXError('Expected    leading    colon    in    sparse6')
    (n, data) = data_to_n(graph6_to_data(string[1:]))
    k = 1
    while ((1 << k) < n):
        k += 1
    def parseData():
        'Return    stream    of    pairs    b[i],    x[i]    for    sparse6    format.'
        chunks = iter(data)
        d = None
        dLen = 0
        while 1:
            if (dLen < 1):
                d = next(chunks)
                dLen = 6
            dLen -= 1
            b = ((d >> dLen) & 1)
            x = (d & ((1 << dLen) - 1))
            xLen = dLen
            while (xLen < k):
                d = next(chunks)
                dLen = 6
                x = ((x << 6) + d)
                xLen += 6
            x = (x >> (xLen - k))
            dLen = (xLen - k)
            (yield (b, x))
    v = 0
    G = nx.MultiGraph()
    G.add_nodes_from(range(n))
    multigraph = False
    for (b, x) in parseData():
        if (b == 1):
            v += 1
        if ((x >= n) or (v >= n)):
            break
        elif (x > v):
            v = x
        else:
            if G.has_edge(x, v):
                multigraph = True
            G.add_edge(x, v)
    if (not multigraph):
        G = nx.Graph(G)
    return G

What's a good function header?

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

def parse_sparse6(string):