code: def fill_traversals(traversals, edges, edges_hash=None):
      
      # make sure edges are correct type
      edges = np.asanyarray(edges, dtype=np.int64)
      # make sure edges are sorted
      edges.sort(axis=1)
  
      # if there are no traversals just return edges
      if len(traversals) == 0:
          return edges.copy()
  
      # hash edges for contains checks
      if edges_hash is None:
          edges_hash = grouping.hashable_rows(edges)
  
      splits = []
      for nodes in traversals:
          # split traversals to remove edges
          # that don't actually exist
          splits.extend(split_traversal(
              traversal=nodes,
              edges=edges,
              edges_hash=edges_hash))
      # turn the split traversals back into (n,2) edges
      included = util.vstack_empty([np.column_stack((i[:-1], i[1:]))
                                    for i in splits])
      if len(included) > 0:
          # sort included edges in place
          included.sort(axis=1)
          # make sure any edges not included in split traversals
          # are just added as a length 2 traversal
          splits.extend(grouping.boolean_rows(
              edges,
              included,
              operation=np.setdiff1d))
      else:
          # no edges were included, so our filled traversal
          # is just the original edges copied over
          splits = edges.copy()
  
      return splits
docs: Convert a traversal of a list of edges into a sequence of
      traversals where every pair of consecutive node indexes
      is an edge in a passed edge list
  
      Parameters
      -------------
      traversals : sequence of (m,) int
         Node indexes of traversals of a graph
      edges : (n, 2) int
         Pairs of connected node indexes
      edges_hash : None, or (n,) int
         Edges sorted along axis 1 then hashed
         using grouping.hashable_rows
  
      Returns
      --------------
      splits : sequence of (p,) int
         Node indexes of connected traversals