human
I wrote the below code

    class NoNode:
        'Dummy    value    which    is    different    from    any    node.'
        pass
    class Blossom:
        'Representation    of    a    non-trivial    blossom    or    sub-blossom.'
        __slots__ = ['childs', 'edges', 'mybestedges']
        def leaves(self):
            for t in self.childs:
                if isinstance(t, Blossom):
                    for v in t.leaves():
                        (yield v)
                else:
                    (yield t)
    gnodes = list(G)
    if (not gnodes):
        return {}
    maxweight = 0
    allinteger = True
    for (i, j, d) in G.edges(data=True):
        wt = d.get(weight, 1)
        if ((i != j) and (wt > maxweight)):
            maxweight = wt
        allinteger = (allinteger and (str(type(wt)).split("'")[1] in ('int', 'long')))
    mate = {}
    label = {}
    labeledge = {}
    inblossom = dict(zip(gnodes, gnodes))
    blossomparent = dict(zip(gnodes, repeat(None)))
    blossombase = dict(zip(gnodes, gnodes))
    bestedge = {}
    dualvar = dict(zip(gnodes, repeat(maxweight)))
    blossomdual = {}
    allowedge = {}
    queue = []
    def slack(v, w):
        return ((dualvar[v] + dualvar[w]) - (2 * G[v][w].get(weight, 1)))
    def assignLabel(w, t, v):
        b = inblossom[w]
        assert ((label.get(w) is None) and (label.get(b) is None))
        label[w] = label[b] = t
        if (v is not None):
            labeledge[w] = labeledge[b] = (v, w)
        else:
            labeledge[w] = labeledge[b] = None
        bestedge[w] = bestedge[b] = None
        if (t == 1):
            if isinstance(b, Blossom):
                queue.extend(b.leaves())
            else:
                queue.append(b)
        elif (t == 2):
            base = blossombase[b]
            assignLabel(mate[base], 1, base)
    def scanBlossom(v, w):
        path = []
        base = NoNode
        while (v is not NoNode):
            b = inblossom[v]
            if (label[b] & 4):
                base = blossombase[b]
                break
        ...

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

def max_weight_matching(G, maxcardinality=False, weight='weight'):