          """ Rename faces
              Done in 2 iterations as two files cannot share the same name """
          logger.trace("Renaming faces for frame: '%s'", frame_fullname)
          temp_ext = ".temp_move"
          frame_faces = [(f_hash, details[1])
                         for f_hash, details in self.alignments.hashes_to_frame.items()
                         if details[0] == frame_fullname]
          rename_count = 0
          for f_hash, idx in frame_faces:
              face_name, face_ext = self.faces.items[f_hash]
 
</s> remove                        if details[0] == frame_fullname]
 </s> add                        for frame_name, idx in details.items()
                       if frame_name == frame_fullname] </s> remove             face_name, face_ext = self.faces.items[f_hash]
 </s> add             faces = self.faces.items[f_hash]
            if len(faces) == 1:
                face_name, face_ext = faces[0]
            else:
                face_name, face_ext = self.check_multi_hashes(faces, frame, idx) </s> remove             for action in ("temp", "final"):
 </s> add             rename_files.append((old, new))
        for action in ("temp", "final"):
            for files in rename_files:
                old, new = files </s> remove         faces = {face["face_hash"]: (face["face_name"], face["face_extension"])
                 for face in self.file_list_sorted}
 </s> add         faces = dict()
        for face in self.file_list_sorted:
            faces.setdefault(face["face_hash"], list()).append((face["face_name"],
                                                                face["face_extension"]))
        frame_faces = list()
        frame_faces = [(f_hash, idx)
          """ Rename faces
              Done in 2 iterations as two files cannot share the same name """
          logger.trace("Renaming faces for frame: '%s'", frame_fullname)
          temp_ext = ".temp_move"
        frame_faces = list()
        frame_faces = [(f_hash, idx)
                         for f_hash, details in self.alignments.hashes_to_frame.items()
                         if details[0] == frame_fullname]
          rename_count = 0
          for f_hash, idx in frame_faces:
              face_name, face_ext = self.faces.items[f_hash]
keep keep keep keep replace keep keep keep keep keep
 Alignments tool: Filename clash bugfix 
tools/lib_alignments/jobs.py