human
I wrote the below code

    if (target not in G):
        raise nx.NodeNotFound('Target    {}    not    in    G'.format(source))
    def join(p1, p2):
        return (p2 + p1)
    adj = (G.pred if G.is_directed() else G.adj)
    if (cutoff is None):
        cutoff = float('inf')
    nextlevel = {target: 1}
    paths = {target: [target]}
    return _single_shortest_path(adj, nextlevel, paths, cutoff, join)

What's a good function header?

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

def single_target_shortest_path(G, target, cutoff=None):