code: def replace_with(self, other):
          
          match_ids_to_delete = list(self.update_matches(other))
          TextLogErrorMatch.objects.filter(id__in=match_ids_to_delete).delete()
  
          # Update best classifications
          self.best_for_errors.update(best_classification=other)
  
          self.delete()
docs: Replace this instance with the given other.
  
          Deletes stale Match objects and updates related TextLogErrorMetadatas'
          best_classifications to point to the given other.