                           landmarks_xy=self.landmarks_xy.tolist(),
                           mask={name: mask.to_png_meta() for name, mask in self.mask.items()})
          return alignment
  
      def from_png_meta(self, alignment):
          """ Set the attributes of this class from alignments stored in a png exif header.
  
          Parameters
          ----------
          alignment: dict
 
</s> remove         alignment = dict(x=self.x,
                         w=self.w,
                         y=self.y,
                         h=self.h,
                         landmarks_xy=self.landmarks_xy.tolist(),
                         mask={name: mask.to_png_meta() for name, mask in self.mask.items()})
 </s> add         if (self.left is None or self.width is None or self.top is None or self.height is None):
            raise AssertionError("Some detected face variables have not been initialized")
        alignment = PNGHeaderAlignmentsDict(
            x=self.left,
            w=self.width,
            y=self.top,
            h=self.height,
            landmarks_xy=self.landmarks_xy.tolist(),
            mask={name: mask.to_png_meta() for name, mask in self.mask.items()}) </s> remove     def from_alignment(self, alignment, image=None, with_thumb=False):
 </s> add     def from_alignment(self, alignment: AlignmentFileDict,
                       image: Optional[np.ndarray] = None, with_thumb: bool = False) -> None: </s> remove         alignment = dict(x=self.x,
                         w=self.w,
                         y=self.y,
                         h=self.h,
                         landmarks_xy=self.landmarks_xy,
                         mask={name: mask.to_dict() for name, mask in self.mask.items()})
        if self.thumbnail is not None:
            alignment["thumb"] = self.thumbnail
        logger.trace("Returning: %s", alignment)
 </s> add         if (self.left is None or self.width is None or self.top is None or self.height is None):
            raise AssertionError("Some detected face variables have not been initialized")
        alignment = AlignmentFileDict(x=self.left,
                                      w=self.width,
                                      y=self.top,
                                      h=self.height,
                                      landmarks_xy=self.landmarks_xy,
                                      mask={name: mask.to_dict()
                                            for name, mask in self.mask.items()},
                                      thumb=self.thumbnail)
        logger.trace("Returning: %s", alignment)  # type: ignore </s> remove         self.x = alignment["x"]
        self.w = alignment["w"]
        self.y = alignment["y"]
        self.h = alignment["h"]
        self.landmarks_xy = np.array(alignment["landmarks_xy"], dtype="float32")
        self.mask = dict()
 </s> add         self.left = alignment["x"]
        self.width = alignment["w"]
        self.top = alignment["y"]
        self.height = alignment["h"]
        self._landmarks_xy = np.array(alignment["landmarks_xy"], dtype="float32")
        self.mask = {} </s> remove     def to_png_meta(self):
 </s> add     def to_png_meta(self) -> PNGHeaderAlignmentsDict:
    def from_png_meta(self, alignment: PNGHeaderAlignmentsDict) -> None:
                           landmarks_xy=self.landmarks_xy.tolist(),
                           mask={name: mask.to_png_meta() for name, mask in self.mask.items()})
          return alignment
  
    def from_png_meta(self, alignment: PNGHeaderAlignmentsDict) -> None:
          """ Set the attributes of this class from alignments stored in a png exif header.
  
          Parameters
          ----------
          alignment: dict
keep keep keep keep replace keep keep keep keep keep
 lib.align updates:
  - alignments.py
    - Add typed dicts for imported alignments
    - Explicitly check for presence of thumb value in alignments dict
    - linting
  - detected_face.py
    - Typing
    - Linting
    - Legacy support for pre-aligned face
    - Update dependencies to new property names 
lib/align/detected_face.py