                  except FileNotFoundError:
                      logger.debug("File does not exist: %s", fname)
          self._clear_image_cache()
  
      def _clear_image_cache(self):
          """ Clear all cached images. """
          logger.debug("Clearing image cache")
          self._pathoutput = None
          self._previewoutput = None
          self._previewtrain = {}
 
</s> remove     def __init__(self):
 </s> add     def __init__(self) -> None: </s> remove         self._pathoutput = None
        self._previewoutput = None
        self._previewtrain = {}
        self._previewcache = dict(modified=None,  # cache for extract and convert
                                  images=None,
                                  filenames=[],
                                  placeholder=None)
 </s> add         self._pathoutput: Optional[str] = None
        self._batch_mode = False
        self._previewoutput: Optional[Tuple[Image.Image, ImageTk.PhotoImage]] = None
        self._previewtrain: Dict[str, List[Union[Image.Image,
                                                 ImageTk.PhotoImage,
                                                 None,
                                                 float]]] = {}
        self._previewcache: Dict[str, Union[None, float, np.ndarray, List[str]]] = dict(
            modified=None,  # cache for extract and convert
            images=None,
            filenames=[],
            placeholder=None) </s> remove         for fname in self._previewcache["filenames"]:
 </s> add         for fname in cast(List[str], self._previewcache["filenames"]): </s> remove         self.commands = dict()
        self.opts = dict()
 </s> add         self.commands = {}
        self.opts = {}
    def _clear_image_cache(self) -> None:
                  except FileNotFoundError:
                      logger.debug("File does not exist: %s", fname)
          self._clear_image_cache()
  
    def _clear_image_cache(self) -> None:
          """ Clear all cached images. """
          logger.debug("Clearing image cache")
          self._pathoutput = None
          self._previewoutput = None
          self._previewtrain = {}
keep keep keep keep replace keep keep keep keep keep
 Bugfix: Preview for extract in batch mode 
lib/gui/utils.py