code: def multigraph_collect(G, traversal, attrib=None):
      
  
      collected = []
      for u, v in util.pairwise(traversal):
          attribs = G[u[0]][v[0]][v[1]]
          if attrib is None:
              collected.append(attribs)
          else:
              collected.append(attribs[attrib])
      return collected
docs: Given a MultiDiGraph traversal, collect attributes along it.
  
      Parameters
      -------------
      G:          networkx.MultiDiGraph
      traversal:  (n) list of (node, instance) tuples
      attrib:     dict key, name to collect. If None, will return all
  
      Returns
      -------------
      collected: (len(traversal) - 1) list of attributes