code: def dedupe(self):
          
          if len(self.pool) == 1:
              logger.debug("Ignore set: only one message found.")
              self.stats['mail_unique'] += 1
              self.stats['set_ignored'] += 1
              return
  
          try:
              # Fine-grained checks on mail differences.
              self.check_differences()
              # Call the deduplication strategy.
              self.apply_strategy()
          except UnicodeDecodeError as expt:
              self.stats['set_rejected_encoding'] += 1
              logger.warning(
                  "Reject set: unparseable mails due to bad encoding.")
              logger.debug(str(expt))
          except SizeDiffAboveThreshold:
              self.stats['set_rejected_size'] += 1
              logger.warning("Reject set: mails are too dissimilar in size.")
          except ContentDiffAboveThreshold:
              self.stats['set_rejected_content'] += 1
              logger.warning("Reject set: mails are too dissimilar in content.")
          else:
              # Count duplicate sets without deletion as skipped.
              if not self.stats['mail_deleted']:
                  logger.info("Skip set: no deletion happened.")
                  self.stats['set_skipped'] += 1
              else:
                  self.stats['set_deduplicated'] += 1
docs: Performs the deduplication and its preliminary checks.