def all_neighbors(graph, node):
    if graph.is_directed():
        values = chain(graph.predecessors(node), graph.successors(node))
    else:
        values = graph.neighbors(node)
    return values
Returns all of the neighbors of a node in the graph.
dataset/ETHPy150Open networkx/networkx/networkx/classes/function.py/all_neighbors