                             skip_count, side.upper())
          return detected_faces
  
      def _validate_face(self, face, filename, idx, side, side_hashes):
          """ Validate that the currently processing face has a corresponding hash entry and the
          requested mask exists
  
          Parameters
 
</s> remove     # Load alignments
 </s> add     def _get_masks(self, side, detected_faces):
        """ For each face, obtain the mask and set the requested blurring and threshold level.

        Parameters
        ----------
        side: {"a" or "b"}
            The side currently being processed
        detected_faces: dict
            Key is the hash of the face, value is the corresponding
            :class:`lib.faces_detect.DetectedFace` object

        Returns
        -------
        dict
            The face filenames as keys with the :class:`lib.faces_detect.Mask` as value.
        """

        masks = dict()
        for fhash, face in detected_faces.items():
            mask = face.mask[self._training_opts["mask_type"]]
            mask.set_blur_kernel_and_threshold(blur_kernel=self._training_opts["mask_blur_kernel"],
                                               threshold=self._training_opts["mask_threshold"])
            for filename in self._hash_to_filenames(side, fhash):
                masks[filename] = mask
        return masks

    # Pre flight checks
    def _check_alignments_exist(self):
        """ Ensure the alignments files exist prior to running any longer running tasks.

        Raises
        ------
        FaceswapError
            If at least one alignments file does not exist
        """
        for fullpath in self._training_opts["alignments"].values():
            if not os.path.exists(fullpath):
                raise FaceswapError("Alignments file does not exist: `{}`".format(fullpath))

    # Hashes for image folders </s> remove     # Get landmarks
    def _transform_landmarks(self, side, detected_faces):
        """ Transform frame landmarks to their aligned face variant.

        Parameters
        ----------
        side: {"a" or "b"}
            The side currently being processed
        detected_faces: list
            A list of :class:`lib.faces_detect.DetectedFace` objects

        Returns
        -------
        dict
            The face filenames as keys with the aligned landmarks as value.
        """
        landmarks = dict()
        for face in detected_faces:
            face.load_aligned(None, size=self._training_opts["training_size"])
            for filename in self._hash_to_filenames(side, face.hash):
                landmarks[filename] = face.aligned_landmarks
        return landmarks

    # Get masks
    def _get_masks(self, side, detected_faces):
        """ For each face, obtain the mask and set the requested blurring and threshold level.

        Parameters
        ----------
        side: {"a" or "b"}
            The side currently being processed
        detected_faces: list
            A list of :class:`lib.faces_detect.DetectedFace` objects

        Returns
        -------
        dict
            The face filenames as keys with the :class:`lib.faces_detect.Mask` as value.
        """

        masks = dict()
        for face in detected_faces:
            mask = face.mask[self._training_opts["mask_type"]]
            mask.set_blur_kernel_and_threshold(blur_kernel=self._training_opts["mask_blur_kernel"],
                                               threshold=self._training_opts["mask_threshold"])
            for filename in self._hash_to_filenames(side, face.hash):
                masks[filename] = mask
        return masks

 </s> add     # Utils </s> remove         side_hashes = set(self._hashes[side]["hashes"])
        detected_faces = []
 </s> add         dupe_count = 0
        side_hashes = set(self._hashes[side])
        detected_faces = dict() </s> remove         side_hashes = self._hashes[side]
        hash_indices = [idx for idx, hsh in enumerate(side_hashes["hashes"]) if hsh == face_hash]
        retval = [side_hashes["filenames"][idx] for idx in hash_indices]
 </s> add         retval = self._hashes[side][face_hash]
    # Validation
                             skip_count, side.upper())
          return detected_faces
  
    # Validation
      def _validate_face(self, face, filename, idx, side, side_hashes):
          """ Validate that the currently processing face has a corresponding hash entry and the
          requested mask exists
  
          Parameters
keep keep add keep keep keep keep keep
 plugins.train.trainer - Speed up mask caching 
plugins/train/trainer/_base.py