                        for face in faces])
          logger.debug(retval)
          return retval
  
      @property
      def mask_summary(self):
          """ Dict: The mask types and the number of faces which have each type that exist with in
          the loaded alignments """
          masks = dict()
          for faces in self.data.values():
              for face in faces:
                  if face.get("mask", None) is None:
                      masks["none"] = masks.get("none", 0) + 1
                  for key in face.get("mask", dict()):
                      masks[key] = masks.get(key, 0) + 1
          return masks
  
      # << DATA >> #
  
      def get_faces_in_frame(self, frame):
          """ Return the alignments for the selected frame """
          logger.trace("Getting faces for frame: '%s'", frame)
 
</s> remove     def get_faces_in_frame(self, frame):
        """ Return the alignments for the selected frame """
        logger.trace("Getting faces for frame: '%s'", frame)
        return self.data.get(frame, list())

    def get_full_frame_name(self, frame):
        """ Return a frame with extension for when the extension is
            not known """
        retval = next(key for key in self.data.keys()
                      if key.startswith(frame))
        logger.trace("Requested: '%s', Returning: '%s'", frame, retval)
        return retval
 </s> add     def get_faces_in_frame(self, frame_name):
        """ Obtain the faces from :attr:`data` associated with a given frame_name. </s> remove                       for faces in self.data.values()
                      for face in faces])
 </s> add                       for val in self._data.values()
                      for face in val["faces"]]) </s> remove         """ Yield face alignments for one image """
        for frame_fullname, alignments in self.data.items():
 </s> add         """ Generator to obtain all faces with meta information from :attr:`data`. The results
        are yielded by frame.

        Notes
        -----
        The yielded order is non-deterministic.

        Yields
        ------
        frame_name: str
            The frame name that the face belongs to. This is the base name of the frame, as it
            appears in :attr:`data`, not the full path
        faces: list
            The list of face `dict` objects that exist for this frame
        face_count: int
            The number of faces that exist within :attr:`data` for this frame
        frame_fullname: str
            The full path (folder and filename) for the yielded frame
        """
        for frame_fullname, val in self._data.items(): </s> remove         """ Return current faces count """
        retval = sum(len(faces) for faces in self.data.values())
 </s> add         """ int: The total number of faces that appear in the alignments :attr:`data`. """
        retval = sum(len(val["faces"]) for val in self._data.values())
                        for face in faces])
          logger.debug(retval)
          return retval
  













      # << DATA >> #
  
      def get_faces_in_frame(self, frame):
          """ Return the alignments for the selected frame """
          logger.trace("Getting faces for frame: '%s'", frame)
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 lib.alignments - Slight update (#978)

* lib.alignments update:
  - Minor structure change (faces to nested dictionary)
  - Refactor internal and external methods
  - Documentation 
lib/alignments.py