code: def make_paths(paths, weights=None):
      
      npaths = len(paths)
      weights = weights or [1] * npaths
      assert len(paths) == len(weights)
  
      G = nx.DiGraph()
      for path, w in zip(paths, weights):
          for a, b in pairwise(path):
              update_weight(G, a, b, w)
      return G
docs: Zip together paths. Called by merge_paths().