  
      def run(self) -> None:
          """ Runs the target, reraising any errors from within the thread in the caller. """
          try:
              if self._target:
                  self._target(*self._args, **self._kwargs)
          except Exception as err:  # pylint: disable=broad-except
              self.err = sys.exc_info()
              logger.debug("Error in thread (%s): %s", self._name, str(err))
          finally:
 
</s> remove             if self._target:
 </s> add             if self._target is not None: </s> remove     def __init__(self):
        logger.debug("Initializing: %s", __class__.__name__)
 </s> add     def __init__(self) -> None:
        logger.debug("Initializing: %s", self.__class__.__name__) </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             logger.trace("Rendering from cache. Frame no: %s", save_no)  # type: ignore
 </s> add             logger.trace("Rendering from cache. Frame no: %s",  # type:ignore[attr-defined]
                         save_no)
            if self._target is not None:
  
      def run(self) -> None:
          """ Runs the target, reraising any errors from within the thread in the caller. """
          try:
            if self._target is not None:
                  self._target(*self._args, **self._kwargs)
          except Exception as err:  # pylint: disable=broad-except
              self.err = sys.exc_info()
              logger.debug("Error in thread (%s): %s", self._name, str(err))
          finally:
keep keep keep keep replace keep keep keep keep keep
 tests:
  - unit test: tools.alignments.media
  - Add mypy test
  - Typing fixes 
lib/multithreading.py