          :class:`numpy.ndarray`
              The image for the requested filename,
  
          """
          logger.trace("Loading image: '%s'", filename)  # type: ignore
          if self._is_video:
              if filename.isdigit():
                  frame_no = filename
              else:
                  frame_no = os.path.splitext(filename)[0][filename.rfind("_") + 1:]
 
</s> remove                 logger.trace("Extracted frame_no %s from filename '%s'",  # type: ignore
                             frame_no, filename)
 </s> add                 logger.trace(  # type:ignore[attr-defined]
                    "Extracted frame_no %s from filename '%s'", frame_no, filename) </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("Received frame: (filename: '%s', shape: %s",  # type: ignore
 </s> add         logger.trace("Received frame: (filename: '%s', shape: %s",  # type:ignore[attr-defined] </s> remove         logger.trace("Loading video frame: %s", frame_no)  # type: ignore
        reader = imageio.get_reader(self._args.input_dir, "ffmpeg")
 </s> add         logger.trace("Loading video frame: %s", frame_no)  # type:ignore[attr-defined]
        reader = imageio.get_reader(self._args.input_dir, "ffmpeg")  # type:ignore[arg-type] </s> remove         reader = imageio.get_reader(self._args.input_dir, "ffmpeg")
        for i, frame in enumerate(reader):
 </s> add         reader = imageio.get_reader(self._args.input_dir, "ffmpeg")  # type:ignore[arg-type]
        for i, frame in enumerate(cast(Iterator[np.ndarray], reader)):
        logger.trace("Loading image: '%s'", filename)  # type:ignore[attr-defined]
          :class:`numpy.ndarray`
              The image for the requested filename,
  
          """
        logger.trace("Loading image: '%s'", filename)  # type:ignore[attr-defined]
          if self._is_video:
              if filename.isdigit():
                  frame_no = filename
              else:
                  frame_no = os.path.splitext(filename)[0][filename.rfind("_") + 1:]
keep keep keep keep replace keep keep keep keep keep
 tests:
  - unit test: tools.alignments.media
  - Add mypy test
  - Typing fixes 
scripts/fsmedia.py