code: def all_neighbors(graph, node, t=None):
      
      if graph.is_directed():
          values = chain(graph.predecessors(node, t=t), graph.successors(node, t=t))
      else:
          values = graph.neighbors(node, t=t)
      return values
docs: Returns all of the neighbors of a node in the graph at time t.
  
          If the graph is directed returns predecessors as well as successors.
  
          Parameters
          ----------
  
          graph : DyNetx graph
              Graph to find neighbors.
  
          node : node
              The node whose neighbors will be returned.
  
          t : snapshot id (default=None)
              If None the neighbors are identified on the flattened graph.
  
          Returns
          -------
  
          neighbors : iterator
              Iterator of neighbors