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 local_node_connectivity(G, s, t)
    if G.is_directed():
        connected_func = nx.is_weakly_connected
        iter_func = itertools.permutations
        def neighbors(v):
            return itertools.chain(G.predecessors(v), G.successors(v))
    else:
        connected_func = nx.is_connected
        iter_func = itertools.combinations
        neighbors = G.neighbors
    if (not connected_func(G)):
        return 0
    (v, minimum_degree) = min(G.degree(), key=itemgetter(1))
    K = minimum_degree
    for w in ((set(G) - set(neighbors(v))) - set([v])):
        K = min(K, local_node_connectivity(G, v, w, cutoff=K))
    for (x, y) in iter_func(neighbors(v), 2):
        if ((y not in G[x]) and (x != y)):
            K = min(K, local_node_connectivity(G, x, y, cutoff=K))
    return K

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

def node_connectivity(G, s=None, t=None):