  
      def run(self) -> None:
          """ Commence the given task in a background thread. """
          try:
              if self._target:
                  retval = self._target(*self._args, **self._kwargs)
                  self._queue.put(retval)
          except Exception:  # pylint: disable=broad-except
              self.err = cast(Tuple[Type[BaseException], BaseException, "TracebackType"],
                              sys.exc_info())
 
</s> remove             if self._target:
 </s> add             if self._target is not None: </s> remove         reader = imageio.get_reader(self._source_video, "ffmpeg")
 </s> add         reader = imageio.get_reader(self._source_video, "ffmpeg")  # type:ignore[arg-type] </s> remove             logger.trace("Loading video frame: '%s'", filename)  # type: ignore
 </s> add             logger.trace("Loading video frame: '%s'", filename)  # type:ignore[attr-defined] </s> remove         logger.trace("Current cache size: %s", len(self.cache))  # type: ignore
 </s> add         logger.trace("Current cache size: %s", len(self.cache))  # type:ignore[attr-defined] </s> remove     def __init__(self, arguments):
 </s> add     def __init__(self, arguments: Namespace) -> None:
            if self._target is not None:
  
      def run(self) -> None:
          """ Commence the given task in a background thread. """
          try:
            if self._target is not None:
                  retval = self._target(*self._args, **self._kwargs)
                  self._queue.put(retval)
          except Exception:  # pylint: disable=broad-except
              self.err = cast(Tuple[Type[BaseException], BaseException, "TracebackType"],
                              sys.exc_info())
keep keep keep keep replace keep keep keep keep keep
 tests:
  - unit test: tools.alignments.media
  - Add mypy test
  - Typing fixes 
lib/gui/utils/misc.py