human
I wrote the below code

    if (((s is not None) and (t is None)) or ((s is None) and (t is not None))):
        raise nx.NetworkXError('Both    source    and    target    must    be    specified.')
    if ((s is not None) and (t is not None)):
        if (s not in G):
            raise nx.NetworkXError(('node    %s    not    in    graph' % s))
        if (t not in G):
            raise nx.NetworkXError(('node    %s    not    in    graph' % t))
        return minimum_st_node_cut(G, s, t, flow_func=flow_func)
    if G.is_directed():
        if (not nx.is_weakly_connected(G)):
            raise nx.NetworkXError('Input    graph    is    not    connected')
        iter_func = itertools.permutations
        def neighbors(v):
            return itertools.chain.from_iterable([G.predecessors(v), G.successors(v)])
    else:
        if (not nx.is_connected(G)):
            raise nx.NetworkXError('Input    graph    is    not    connected')
        iter_func = itertools.combinations
        neighbors = G.neighbors
    H = build_auxiliary_node_connectivity(G)
    R = build_residual_network(H, 'capacity')
    kwargs = dict(flow_func=flow_func, auxiliary=H, residual=R)
    v = min(G, key=G.degree)
    min_cut = set(G[v])
    for w in ((set(G) - set(neighbors(v))) - set([v])):
        this_cut = minimum_st_node_cut(G, v, w, **kwargs)
        if (len(min_cut) >= len(this_cut)):
            min_cut = this_cut
    for (x, y) in iter_func(neighbors(v), 2):
        if (y in G[x]):
            continue
        this_cut = minimum_st_node_cut(G, x, y, **kwargs)
        if (len(min_cut) >= len(this_cut)):
            min_cut = this_cut
    return min_cut

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

def minimum_node_cut(G, s=None, t=None, flow_func=None):