human
I wrote the below code

    if (s not in G):
        raise nx.NetworkXError(('node    %s    not    in    graph' % str(s)))
    if (t not in G):
        raise nx.NetworkXError(('node    %s    not    in    graph' % str(t)))
    if (s == t):
        raise nx.NetworkXError('source    and    sink    are    the    same    node')
    if (residual is None):
        R = build_residual_network(G, capacity)
    else:
        R = residual
    R_node = R.node
    R_pred = R.pred
    R_succ = R.succ
    for u in R:
        for e in R_succ[u].values():
            e['flow'] = 0
    heights = {t: 0}
    q = deque([(t, 0)])
    while q:
        (u, height) = q.popleft()
        height += 1
        for (v, attr) in R_pred[u].items():
            if ((v not in heights) and (attr['flow'] < attr['capacity'])):
                heights[v] = height
                q.append((v, height))
    if (s not in heights):
        R.graph['flow_value'] = 0
        return R
    n = len(G)
    m = (R.size() / 2)
    for u in R:
        R_node[u]['height'] = (heights[u] if (u in heights) else n)
        R_node[u]['curr_edge'] = CurrentEdge(R_succ[u])
    counts = ([0] * ((2 * n) - 1))
    for u in R:
        counts[R_node[u]['height']] += 1
    inf = R.graph['inf']
    def augment(path):
        'Augment    flow    along    a    path    from    s    to    t.\n                                '
        flow = inf
        it = iter(path)
        u = next(it)
        for v in it:
            attr = R_succ[u][v]
            flow = min(flow, (attr['capacity'] - attr['flow']))
            u = v
        if ((flow * 2) > inf):
            raise nx.NetworkXUnbounded('Infinite    capacity    path,    flow    unbounded    above.')
        it = iter(path)
        u = next(it)
        for v in it:
            R_succ[u][v]['flow'] += flow
            R_succ[v][u]['flow'] -= flow
            u = v
        return flow
    def relabel(u):
        'Relabel    a    node    to    create    an    admissible    edge.\n                                '
        height = (n - 1)
        for (v,...

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

def shortest_augmenting_path_impl(G, s, t, capacity, residual, two_phase, cutoff):