human
Here's a good function header given the following:
I wrote the below code

    n = len(T)
    if (n < 2):
        msg = 'Pr\xc3\xbcfer    sequence    undefined    for    trees    with    fewer    than    two    nodes'
        raise nx.NetworkXPointlessConcept(msg)
    if (not nx.is_tree(T)):
        raise nx.NotATree('provided    graph    is    not    a    tree')
    if (set(T) != set(range(n))):
        raise KeyError('tree    must    have    node    labels    {0,    ...,    n    -    1}')
    degree = dict(T.degree())
    def parents(u):
        return next((v for v in T[u] if (degree[v] > 1)))
    index = u = min((k for k in range(n) if (degree[k] == 1)))
    result = []
    for i in range((n - 2)):
        v = parents(u)
        result.append(v)
        degree[v] -= 1
        if ((v < index) and (degree[v] == 1)):
            u = v
        else:
            index = u = min((k for k in range((index + 1), n) if (degree[k] == 1)))
    return result

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

@not_implemented_for('directed')
def to_prufer_sequence(T):