docs: def _merge_slices(match_slices):
          """Return a list of slice indices lists derived from `match_slices`
          with no overlaps."""
          # Sort by earliest range, then by largest range.
          match_slices.sort(key=lambda x: (x[0], -x[1]))
          merged_slices = [match_slices.pop(0)]
          for slice_indices in match_slices:
              last_end = merged_slices[-1][1]
              if slice_indices[0] <= last_end:
                  if slice_indices[1] > last_end:
                      merged_slices[-1][1] = slice_indices[1]
              else:
                  merged_slices.append(slice_indices)
          return merged_slices