          logger.info("Total removed - faces: %s, frames: %s", del_faces_count, del_frames_count)
  
      def check_exists(self, frame, alignment, idx):
          """ Check whether this face already exists """
          existing_frame = self.final_alignments.hashes_to_frame.get(alignment["hash"], None)
          if not existing_frame:
              return False
          if frame in existing_frame.keys():
              logger.verbose("Face '%s': %s already exists in destination at position %s. "
                             "Skipping", frame, idx, existing_frame[frame])
 
</s> remove     def remove_alignment(self, item):
        """ Remove the alignment from the alignments file """
        del_count = 0
        frame_name, alignments, number_alignments = item[:3]
        for idx in self.alignments.yield_original_index_reverse(alignments, number_alignments):
            face_indexes = self.items.items.get(frame_name, [-1])
            if idx not in face_indexes:
                del alignments[idx]
                self.removed.add(frame_name)
                logger.verbose("Removed alignment data for image: '%s' index: %s",
                               frame_name, str(idx))
                del_count += 1
            else:
                logger.trace("Not removing alignment data for image: '%s' index: %s",
                             frame_name, str(idx))
        return del_count

 </s> add  </s> remove                          for frame, idx in self.alignments.hashes_to_frame[f_hash].items()]
 </s> add                          for frame, idx in hashes_to_frame[f_hash].items()] </s> remove         frames = [item["frame_fullname"] for item in self.items]
 </s> add         frames = set([item["frame_fullname"] for item in self.items]) </s> remove             if not self.alignments.hashes_to_frame.get(f_hash, None):
 </s> add             if f_hash not in hashes_to_frame:
        existing_frame = self._hashes_to_frame.get(alignment["hash"], None)
          logger.info("Total removed - faces: %s, frames: %s", del_faces_count, del_frames_count)
  
      def check_exists(self, frame, alignment, idx):
          """ Check whether this face already exists """
        existing_frame = self._hashes_to_frame.get(alignment["hash"], None)
          if not existing_frame:
              return False
          if frame in existing_frame.keys():
              logger.verbose("Face '%s': %s already exists in destination at position %s. "
                             "Skipping", frame, idx, existing_frame[frame])
keep keep keep keep replace keep keep keep keep keep
 Multiple Tools->Alignmet speed ups (#785) 
tools/lib_alignments/jobs.py