          if not self._hashes_to_frame:
              logger.debug("Generating hashes to frame")
              for frame_name, val in self._data.items():
                  for idx, face in enumerate(val["faces"]):
                      self._hashes_to_frame.setdefault(face["hash"], dict())[frame_name] = idx
          return self._hashes_to_frame
  
      @property
      def hashes_to_alignment(self):
          """ dict: The SHA1 hash of the face mapped to the alignment for the face that the hash
 
</s> remove         masks = dict()
 </s> add         masks = {} </s> remove _HASHES_SEEN = dict()
 </s> add _HASHES_SEEN: Dict[str, Dict[str, int]] = {} </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._canvas.addtag_withtag("active_mesh_{}".format(key), mesh_id)
 </s> add                 self._canvas.addtag_withtag(f"active_mesh_{key}", mesh_id) </s> remove def update_legacy_png_header(filename, alignments):
 </s> add def update_legacy_png_header(filename: str, alignments: Alignments
                             ) -> Optional[PNGHeaderDict]:
                    self._hashes_to_frame.setdefault(face["hash"], {})[frame_name] = idx
          if not self._hashes_to_frame:
              logger.debug("Generating hashes to frame")
              for frame_name, val in self._data.items():
                  for idx, face in enumerate(val["faces"]):
                    self._hashes_to_frame.setdefault(face["hash"], {})[frame_name] = idx
          return self._hashes_to_frame
  
      @property
      def hashes_to_alignment(self):
          """ dict: The SHA1 hash of the face mapped to the alignment for the face that the hash
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/alignments.py