#NEWLINE# def _apply_prediction( G , func , ebunch = None ) : #NEWLINE# #INDENT# 'Applies the given function to each edge in the specified iterable\n    of edges.\n\n    `G` is an instance of :class:`networkx.Graph`.\n\n    `func` is a function on two inputs, each of which is a node in the\n    graph. The function can return anything, but it should return a\n    value representing a prediction of the likelihood of a "link"\n    joining the two nodes.\n\n    `ebunch` is an iterable of pairs of nodes. If not specified, all\n    non-edges in the graph `G` will be used.\n\n    ' #NEWLINE# if ( ebunch is None ) : #NEWLINE# #INDENT# ebunch = nx . non_edges ( G ) #NEWLINE# #UNINDENT# return ( ( u , v , func ( u , v ) ) for ( u , v ) in u )