  #!/usr/bin/env python3
  """ Tools for manipulating the alignments using extracted Faces as a source """
  import os
  import sys
  import logging
  from argparse import Namespace
  from operator import itemgetter
  from typing import cast, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
  
 
</s> remove from lib.image import update_existing_metadata, read_image_meta_batch  # TODO remove
 </s> add from lib.image import update_existing_metadata  # TODO remove </s> remove     from lib.align.alignments import AlignmentFileDict, PNGHeaderSourceDict
 </s> add     from lib.align.alignments import (AlignmentDict, AlignmentFileDict,
                                      PNGHeaderDict, PNGHeaderSourceDict) </s> remove                          ) -> Dict[str, Dict[str, List["AlignmentFileDict"]]]:
 </s> add                          ) -> Dict[str, Dict[str, "AlignmentDict"]]: </s> remove     def _get_filenames(self) -> List[str]:
        """ Obtain the full path to all filenames in the specified faces folder.

        Only png files will be returned, any other files will be ignored. An error is output if
        the returned filelist is not valid

        Returns
        -------
        list
            Full path list to face png files
        """
        err = None
        if not self._faces_dir:
            err = "A faces folder must be provided."
        elif not os.path.isdir(self._faces_dir):
            err = f"The Faces location '{self._faces_dir}' does not exit"
        else:
            filelist = [os.path.join(self._faces_dir, fname)
                        for fname in os.listdir(self._faces_dir)
                        if os.path.splitext(fname.lower())[1] == ".png"]
        if not err and not filelist:
            err = "Faces folder should contain Faceswap extracted PNG files"
        if err:
            logger.error(err)
            sys.exit(0)
        logger.debug("Collected %s png images from folder '%s'", len(filelist), self._faces_dir)
        return filelist

 </s> add  </s> remove         skip_count = 0
 </s> add         all_versions: Dict[str, List[float]] = {}
  #!/usr/bin/env python3
  """ Tools for manipulating the alignments using extracted Faces as a source """
  import os

  import logging
  from argparse import Namespace
  from operator import itemgetter
  from typing import cast, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
  
keep keep keep replace keep keep keep keep keep
 alignments tool - Remove-face - Minor update 
tools/alignments/jobs_faces.py