code: def deduplicate_sequences(records, out_file):
      
  
      logging.info('Applying _deduplicate_sequences generator: '
                   'removing any duplicate records with identical sequences.')
      checksum_sequences = collections.defaultdict(list)
      for record in records:
          checksum = seguid(record.seq)
          sequences = checksum_sequences[checksum]
          if not sequences:
              yield record
          sequences.append(record.id)
  
      if out_file is not None:
          with out_file:
              for sequences in checksum_sequences.values():
                  out_file.write('%s\n' % (' '.join(sequences),))
docs: Remove any duplicate records with identical sequences, keep the first
      instance seen and discard additional occurences.