      -------
      :class:`numpy.ndarray`
          The transformed image
      """
      logger.trace("image shape: %s, matrix: %s, size: %s. padding: %s",
                   image.shape, matrix, size, padding)
      # transform the matrix for size and padding
      mat = matrix * (size - 2 * padding)
      mat[:, 2] += padding
  
 
</s> remove         with self._cache["adjusted_matrix"][1]:
            if self._cache["adjusted_matrix"][0] is None:
 </s> add         with self._cache.lock("adjusted_matrix"):
            if self._cache.adjusted_matrix is None: </s> remove                 logger.trace("adjusted_matrix: %s", mat)
                self._cache["adjusted_matrix"][0] = mat
        return self._cache["adjusted_matrix"][0]
 </s> add                 logger.trace("adjusted_matrix: %s", mat)  # type: ignore
                self._cache.adjusted_matrix = mat
        return self._cache.adjusted_matrix </s> remove def transform_image(image, matrix, size, padding=0):
 </s> add def transform_image(image: np.ndarray,
                    matrix: np.ndarray,
                    size: int,
                    padding: int = 0) -> np.ndarray: </s> remove             logger.trace("original matrix: %s, new matrix: %s", self._matrices["legacy"], matrix)
 </s> add             logger.trace("original matrix: %s, new matrix: %s",  # type: ignore
                         self._matrices["legacy"], matrix) </s> remove         if self._matrices[self._centering] is None:
 </s> add         if not np.any(self._matrices[self._centering]):
    logger.trace("image shape: %s, matrix: %s, size: %s. padding: %s",  # type: ignore
      -------
      :class:`numpy.ndarray`
          The transformed image
      """
    logger.trace("image shape: %s, matrix: %s, size: %s. padding: %s",  # type: ignore
                   image.shape, matrix, size, padding)
      # transform the matrix for size and padding
      mat = matrix * (size - 2 * padding)
      mat[:, 2] += padding
  
keep keep keep keep replace keep keep keep keep keep
 lib.align.aligned_face updates
  - Typing
  - Legacy support for pre-aligned faces
  - Coverage support for pre-aligned faces
  - Standardized retrieval of sub-crops 
lib/align/aligned_face.py