code: def add_path(G, nodes, t, **attr):
      
      nlist = list(nodes)
      edges = zip(nlist[:-1], nlist[1:])
      G.add_interactions_from(edges, t, **attr)
docs: Add a path at time t.
  
              Parameters
              ----------
              G : graph
                  A DyNetx graph
  
              nodes : iterable container
                  A container of nodes.
  
              t : snapshot id (default=None)
                  snapshot id
  
              See Also
              --------
              add_path, add_cycle
  
              Examples
              --------
              >>> G = dn.DynGraph()
              >>> dn.add_path(G, [0,1,2,3], t=0)