          error = False
          retval: List[List[str]] = []
  
          for files in (filter_files, nfilter_files):
  
              if isinstance(files, list) and len(files) == 1 and os.path.isdir(files[0]):
                  # Get images from folder, if folder passed in
                  dirname = files[0]
                  files = [os.path.join(dirname, fname)
                           for fname in os.listdir(dirname)
                           if os.path.splitext(fname)[-1].lower() in _image_extensions]
                  logger.debug("Collected files from folder '%s': %s", dirname,
                               [os.path.basename(f) for f in files])
  
              filt_files = [] if files is None else files
              for file in filt_files:
                  if (not os.path.isfile(file) or
                          os.path.splitext(file)[-1].lower() not in _image_extensions):
                      logger.warning("Filter file '%s' does not exist or is not an image file", file)
                      error = True
 
</s> remove     def _validate_inputs(cls,
 </s> add     def _files_from_folder(cls, input_location: List[str]) -> List[str]:
        """ Test whether the input location is a folder and if so, return the list of contained
        image files, otherwise return the original input location

        Parameters
        ---------
        input_files: list
            A list of full paths to individual files or to a folder location

        Returns
        -------
        bool
            Either the original list of files provided, or the image files that exist in the
            provided folder location
        """
        if not input_location or len(input_location) > 1:
            return input_location

        test_folder = input_location[0]
        if not os.path.isdir(test_folder):
            logger.debug("'%s' is not a folder. Returning original list", test_folder)
            return input_location

        retval = [os.path.join(test_folder, fname)
                  for fname in os.listdir(test_folder)
                  if os.path.splitext(fname)[-1].lower() in _image_extensions]
        logger.info("Collected files from folder '%s': %s", test_folder,
                    [os.path.basename(f) for f in retval])
        return retval

    def _validate_inputs(self, </s> remove     pass  # pylint: disable=unnecessary-pass
 </s> add     def __call__(self, parser, namespace, values, option_string=None) -> None:
        """ Override :class:`_FullPaths` __call__ function.

        The input for this option can be a space separated list of files or a single folder.
        Folders can have spaces in them, so we don't want to blindly expand the paths.

        We check whether the input can be resolved to a folder first before expanding.
        """
        assert isinstance(values, (list, tuple))
        folder = os.path.abspath(os.path.expanduser(" ".join(values)))
        if os.path.isdir(folder):
            setattr(namespace, self.dest, [folder])
        else:  # file list so call parent method
            super().__call__(parser, namespace, values, option_string) </s> remove     pass  # pylint: disable=unnecessary-pass
 </s> add  </s> remove     def __call__(self, parser, namespace, values, option_string=None):
 </s> add     def __call__(self, parser, namespace, values, option_string=None) -> None: </s> remove     def __init__(self, *args, filetypes=None, action_option=None, **kwargs):
 </s> add     def __init__(self,
                 *args,
                 filetypes: Optional[str] = None,
                 action_option: Optional[str] = None,
                 **kwargs) -> None:
            filt_files = [] if files is None else self._files_from_folder(files)
          error = False
          retval: List[List[str]] = []
  
          for files in (filter_files, nfilter_files):
            filt_files = [] if files is None else self._files_from_folder(files)
            filt_files = [] if files is None else self._files_from_folder(files)
            filt_files = [] if files is None else self._files_from_folder(files)
            filt_files = [] if files is None else self._files_from_folder(files)
            filt_files = [] if files is None else self._files_from_folder(files)
            filt_files = [] if files is None else self._files_from_folder(files)
            filt_files = [] if files is None else self._files_from_folder(files)
            filt_files = [] if files is None else self._files_from_folder(files)
            filt_files = [] if files is None else self._files_from_folder(files)
            filt_files = [] if files is None else self._files_from_folder(files)
            filt_files = [] if files is None else self._files_from_folder(files)
              for file in filt_files:
                  if (not os.path.isfile(file) or
                          os.path.splitext(file)[-1].lower() not in _image_extensions):
                      logger.warning("Filter file '%s' does not exist or is not an image file", file)
                      error = True
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 bugfix - extract filters: spaces in folder names 
scripts/extract.py