def _apply_prediction(G, func, ebunch=None):
    if ebunch is None:
        ebunch = nx.non_edges(G)
    return ((u, v, func(u, v)) for u, v in ebunch)
Applies the given function to each edge in the specified iterable
dataset/ETHPy150Open networkx/networkx/networkx/algorithms/link_prediction.py/_apply_prediction