def non_neighbors(graph, node):
    nbors = set(neighbors(graph, node)) | {node}
    return (nnode for nnode in graph if nnode not in nbors)
Returns the non-neighbors of the node in the graph.
dataset/ETHPy150Open networkx/networkx/networkx/classes/function.py/non_neighbors