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 (global_relabel_freq is None):
        global_relabel_freq = 0
    if (global_relabel_freq < 0):
        raise nx.NetworkXError('global_relabel_freq    must    be    nonnegative.')
    if (residual is None):
        R = build_residual_network(G, capacity)
    else:
        R = residual
    detect_unboundedness(R, s, t)
    R_node = R.node
    R_pred = R.pred
    R_succ = R.succ
    for u in R:
        R_node[u]['excess'] = 0
        for e in R_succ[u].values():
            e['flow'] = 0
    def reverse_bfs(src):
        'Perform    a    reverse    breadth-first    search    from    src    in    the    residual\n                                network.\n                                '
        heights = {src: 0}
        q = deque([(src, 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))
        return heights
    heights = reverse_bfs(t)
    if (s not in heights):
        R.graph['flow_value'] = 0
        return R
    n = len(R)
    max_height = max((heights[u] for u in heights if (u != s)))
    heights[s] = n
    grt = GlobalRelabelThreshold(n, R.size(), global_relabel_freq)
    for u in R:
        R_node[u]['height'] = (heights[u] if (u in heights) else (n + 1))
        R_node[u]['curr_edge'] = CurrentEdge(R_succ[u])
    def push(u, v, flow):
        'Push    flow    units    of    flow    from    u    to    v.\n                                '
        R_succ[u][v]['flow'] += flow
        R_succ[v][u]['flow'] -= flow
        R_node[u]['excess'] -= flow
       ...

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

def preflow_push_impl(G, s, t, capacity, residual, global_relabel_freq, value_only):