code: def _merge_selectors(left, right):
      
  
      if not left or not right:
          # At least one is empty, so there are no conflicts; just return
          # whichever isn't empty.  Remember to return a LIST, though
          return [left or right]
  
      lcs = longest_common_subsequence(left, right, _merge_simple_selectors)
  
      ret = [()]  # start with a dummy empty chain or weaving won't work
  
      left_last = 0
      right_last = 0
      for left_next, right_next, merged in lcs:
          ret = _weave_conflicting_selectors(
              ret,
              left[left_last:left_next],
              right[right_last:right_next],
              (merged,))
  
          left_last = left_next + 1
          right_last = right_next + 1
  
      ret = _weave_conflicting_selectors(
          ret,
          left[left_last:],
          right[right_last:])
  
      return ret
docs: Given two selector chains (lists of simple selectors), return a list of
      selector chains representing elements matched by both of them.
  
      This operation is not exact, and involves some degree of fudging -- the
      wackier and more divergent the input, the more fudging.  It's meant to be
      what a human might expect rather than a precise covering of all possible
      cases.  Most notably, when the two input chains have absolutely nothing in
      common, the output is merely ``left + right`` and ``right + left`` rather
      than all possible interleavings.