  
      Parameters
      ----------
      save_variable: :class:`tkinter.BooleanVar`
          Variable that indicates a save preview has been requested
      """
      def __init__(self, save_variable: tk.BooleanVar) -> None:
          logger.debug("Initializing %s: (save_variable: %s)",
                       self.__class__.__name__, save_variable)
          self._source: Optional["np.ndarray"] = None
 
</s> remove     def __init__(self, save_variable: tk.BooleanVar) -> None:
        logger.debug("Initializing %s: (save_variable: %s)",
                     self.__class__.__name__, save_variable)
 </s> add     def __init__(self, save_variable: tk.BooleanVar, is_standalone: bool) -> None:
        logger.debug("Initializing %s: (save_variable: %s, is_standalone: %s)",
                     self.__class__.__name__, save_variable, is_standalone)
        self._is_standalone = is_standalone </s> remove     def __init__(self, parent: tk.Frame, is_standalone: bool) -> None:
        logger.debug("Initializing %s (parent: '%s', is_standalone: %s)",
                     self.__class__.__name__, parent, is_standalone)
        super().__init__(parent)
 </s> add     def __init__(self, parent: tk.Frame, taskbar: Optional[ttk.Frame]) -> None:
        logger.debug("Initializing %s (parent: '%s', taskbar: %s)",
                     self.__class__.__name__, parent, taskbar)
        self._is_standalone = taskbar is None
        self._gui_mapped: List[tk.Widget] = []
        self._frame = tk.Frame(parent) if taskbar is None else taskbar
 </s> remove     is_standalone: bool
        ``True`` if preview is a pop-up window otherwise ``False``
 </s> add     taskbar: :class:`tkinter.ttk.Frame` or ``None``
        None if preview is a pop-up window otherwise ttk.Frame if taskbar is managed by the GUI </s> remove         for preview in self.subnotebook.children.values():
            preview.save_preview(location)


class PreviewTrainCanvas(ttk.Frame):  # pylint: disable=too-many-ancestors
    """ Canvas to hold a training preview image

    Parameters
    ----------
    parent: :class:`tkinter.ttk.Notebook`
        The notebook that the training image canvas belongs to
    previewname: str
        The name of the preview image displayed in the canvas
    """
    def __init__(self, parent: ttk.Notebook, previewname: str) -> None:
        logger.debug("Initializing %s: (previewname: '%s')", self.__class__.__name__, previewname)
        ttk.Frame.__init__(self, parent)

        self.name = previewname
        get_images().resize_image(self.name, None)
        self.previewimage = get_images().previewtrain[self.name][1]

        self.canvas = tk.Canvas(self, bd=0, highlightthickness=0)
        self.canvas.pack(side=tk.TOP, fill=tk.BOTH, expand=True)
        self.imgcanvas = self.canvas.create_image(0,
                                                  0,
                                                  image=self.previewimage,
                                                  anchor=tk.NW)
        self.bind("<Configure>", self.resize)
        logger.debug("Initialized %s:", self.__class__.__name__)

    def resize(self, event: tk.Event) -> None:
        """  Resize the image to fit the frame, maintaining aspect ratio
 </s> add  </s> remove         self.update_preview = get_config().tk_vars.update_preview
 </s> add         logger.debug("Initializing %s (args: %s, kwargs: %s)",
                     self.__class__.__name__, args, kwargs)
        self._preview = get_images().preview_train
        self._display: Optional[PreviewTk] = None
        Variable that indicates a save preview has been requested in standalone mode
    is_standalone: bool
        ``True`` if the preview is running in standalone mode. ``False`` if it is running in the
        GUI
  
      Parameters
      ----------
      save_variable: :class:`tkinter.BooleanVar`
        Variable that indicates a save preview has been requested in standalone mode
    is_standalone: bool
        ``True`` if the preview is running in standalone mode. ``False`` if it is running in the
        GUI
      """
      def __init__(self, save_variable: tk.BooleanVar) -> None:
          logger.debug("Initializing %s: (save_variable: %s)",
                       self.__class__.__name__, save_variable)
          self._source: Optional["np.ndarray"] = None
keep keep keep keep replace keep keep keep keep keep
 GUI - Preview updates
  - Training preview. Embed preview pop-out window
  - Bugfix - convert/extract previews 
lib/training/preview_tk.py