                          self._num_images)
          self._feeder.set_timelapse_feed(images, batchsize)
          logger.debug("Set up time-lapse")
  
      def output_timelapse(self, timelapse_kwargs: Dict[str, str]) -> None:
          """ Generate the time-lapse samples and output the created time-lapse to the specified
          output folder.
  
          Parameters
          ----------
 
</s> remove                         timelapse_kwargs: Optional[Dict[str, str]]) -> None:
 </s> add                         timelapse_kwargs: Optional[Dict[Literal["input_a",
                                                                "input_b",
                                                                "output"], str]]) -> None: </s> remove             self._setup(**timelapse_kwargs)
 </s> add             self._setup(**cast(Dict[str, str], timelapse_kwargs)) </s> remove         Parameters
        ----------
        event:
            The key press received
        """
        key = event.key.lower()
        if key not in self._callbacks:
 </s> add     def shutdown(self) -> None:
        """ Send a signal to shutdown the preview window. """
        if not self._active: </s> remove class Preview():
    """ Holds the pop up preview window and options relating to the preview in the window and the
    GUI. Thread safe to take requests from the main thread and the training thread. """
    def __init__(self) -> None:
        self._lock = Lock()
        self._dpi: float = 0.0
        self._triggers: Dict[str, bool] = dict(toggle_mask=False,
                                               full_size=False,
                                               refresh=False,
                                               save=False,
                                               quit=False)
        self._needs_update: bool = False
        self._preview_buffer: Dict[str, np.ndarray] = {}
        self._images: Dict[str, Tuple[figure.Figure, Tuple[float, float]]] = {}
        self._resize_ids: List[Tuple[figure.Figure, int]] = []
        self._callbacks = dict(f="full_size",
                               m="toggle_mask",
                               r="refresh",
                               s="save",
                               enter="quit")
        self._configure_matplotlib()

    def _toggle_size(self) -> None:  # pylint:disable=unused-argument
        """ Toggle between actual size and screen-fit size. """
        self._triggers["full_size"] = not self._triggers["full_size"]
        self._set_resize_callback()

    @classmethod
    def _configure_matplotlib(cls):
        """ Remove `F`, 'S' and 'R' from their default bindings and stop Matplotlib from stealing
        focus """
        rcParams["keymap.fullscreen"] = [k for k in rcParams["keymap.fullscreen"] if k != "f"]
        rcParams["keymap.save"] = [k for k in rcParams["keymap.save"] if k != "s"]
        rcParams["keymap.home"] = [k for k in rcParams["keymap.home"] if k != "r"]
        rcParams["figure.raise_window"] = False
 </s> add class PreviewInterface():
    """ Run the preview window in a thread and interface with it </s> remove                 getattr(self._preview, parent_flags[trigger])()
 </s> add         return retval
    def output_timelapse(self, timelapse_kwargs: Dict[Literal["input_a",
                                                              "input_b",
                                                              "output"], str]) -> None:
                          self._num_images)
          self._feeder.set_timelapse_feed(images, batchsize)
          logger.debug("Set up time-lapse")
  
    def output_timelapse(self, timelapse_kwargs: Dict[Literal["input_a",
                                                              "input_b",
                                                              "output"], str]) -> None:
          """ Generate the time-lapse samples and output the created time-lapse to the specified
          output folder.
  
          Parameters
          ----------
keep keep keep keep replace keep keep keep keep keep
 Training - Use custom preview pop-out 
plugins/train/trainer/_base.py