human
I wrote the below code

    if (not nx.is_weighted(G, weight=weight)):
        raise nx.NetworkXError('Graph    is    not    weighted.')
    dist = {v: 0 for v in G}
    pred = {v: [None] for v in G}
    weight = _weight_function(G, weight)
    dist_bellman = _bellman_ford(G, list(G), weight, pred=pred, dist=dist)
    def new_weight(u, v, d):
        return ((weight(u, v, d) + dist_bellman[u]) - dist_bellman[v])
    def dist_path(v):
        paths = {v: [v]}
        _dijkstra(G, v, new_weight, paths=paths)
        return paths
    return {v: dist_path(v) for v in G}

What's a good function header?

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

def johnson(G, weight='weight'):