code: def multi_mask_sequences(records, slices):
      
      for record in records:
          record_indices = list(range(len(record)))
          keep_indices = reduce(lambda i, s: i - frozenset(record_indices[s]),
                                slices, frozenset(record_indices))
          seq = ''.join(b if i in keep_indices else '-'
                        for i, b in enumerate(str(record.seq)))
          record.seq = Seq(seq)
          yield record
docs: Replace characters sliced by slices with gap characters.