  from tkinter import filedialog
  from threading import Event, Thread
  from queue import Queue
  
  import numpy as np
  
 
</s> remove _CONFIG = None
_IMAGES = None
_PREVIEW_TRIGGER = None
 </s> add _CONFIG: Optional["Config"] = None
_IMAGES: Optional["Images"] = None
_PREVIEW_TRIGGER: Optional["PreviewTrigger"] = None </s> remove     def set_cursor_busy(self, widget=None):
 </s> add     def set_cursor_busy(self, widget: Optional[tk.Widget] = None) -> None: </s> remove     def clear(self, trigger_type=None):
 </s> add     def clear(self, trigger_type: Optional[Literal["update", "mask_toggle"]] = None) -> None:
from typing import (Any, Callable, cast, Dict, IO, List, Optional,
                    Sequence, Tuple, Type, TYPE_CHECKING, Union)
  from tkinter import filedialog
  from threading import Event, Thread
from typing import (Any, Callable, cast, Dict, IO, List, Optional,
                    Sequence, Tuple, Type, TYPE_CHECKING, Union)
  from queue import Queue
  
  import numpy as np
  
keep add keep keep keep keep
 Bugfix: Preview for extract in batch mode 
lib/gui/utils.py