          prev_pts_time = self._frame_pts[prev_keyframe]
          logger.trace("keyframe pts_time: %s, keyframe: %s", prev_pts_time, prev_keyframe)
          return prev_pts_time, prev_keyframe
  
      def _initialize(self, index=0):
          """ Replace ImageIO _initialize with a version that explictly uses keyframes.
  
          Notes
          -----
          This introduces a minor change by seeking fast to the previous keyframe and then discarding
 
</s> remove         """ makes sure that the frames or faces folder exists
 </s> add         """ Ensure that the frames or faces folder exists and is valid. </s> remove def layer_test(layer_cls, kwargs={}, input_shape=None, input_dtype=None,
 </s> add def layer_test(layer_cls, kwargs={}, input_shape=None, input_dtype=None,  # noqa:C901 </s> remove             lbl.bind("<Button-1>", lambda e, l=bind: self._link_callback(l))
 </s> add             lbl.bind("<Button-1>", lambda e, x=bind: self._link_callback(x)) </s> remove     def _get_unique_labels(cls, numbers: List[float]) -> List[str]:
 </s> add     def _get_unique_labels(cls, numbers: np.ndarray) -> List[str]: </s> remove         """ Check the alignments file exists
 </s> add         """  Check if the alignments file exists, and returns a tuple of the folder and filename.
    def _initialize(self, index=0):  # noqa:C901
          prev_pts_time = self._frame_pts[prev_keyframe]
          logger.trace("keyframe pts_time: %s, keyframe: %s", prev_pts_time, prev_keyframe)
          return prev_pts_time, prev_keyframe
  
    def _initialize(self, index=0):  # noqa:C901
          """ Replace ImageIO _initialize with a version that explictly uses keyframes.
  
          Notes
          -----
          This introduces a minor change by seeking fast to the previous keyframe and then discarding
keep keep keep keep replace keep keep keep keep keep
 tests:
  - unit test: tools.alignments.media
  - Add mypy test
  - Typing fixes 
lib/image.py