          retval = sum(len(val["faces"]) for val in self._data.values())
          logger.trace(retval)
          return retval
  
      @property
      def have_alignments_file(self):
          """ bool: ``True`` if an alignments file exists at location :attr:`file` otherwise
          ``False``. """
 
</s> remove         """ Return whether an alignments file exists """
        retval = os.path.exists(self.file)
 </s> add         """ bool: ``True`` if an alignments file exists at location :attr:`file` otherwise
        ``False``. """
        retval = os.path.exists(self._file) </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()) </s> remove     def frame_has_faces(self, frame):
        """ Return true if frame exists and has faces """
        retval = bool(self.data.get(frame, list()))
        logger.trace("'%s': %s", frame, retval)
 </s> add     def frame_has_faces(self, frame_name):
        """ Check whether a given frame_name exists within the alignments :attr:`data` and contains
        at least 1 face.

        Parameters
        ----------
        frame_name: str
            The frame name to check. This should be the base name of the frame, not the full path

        Returns
        -------
        bool
            ``True`` if the given frame_name exists within the alignments :attr:`data` and has at
            least 1 face associated with it, otherwise ``False``
        """
        retval = bool(self._data.get(frame_name, dict()).get("faces", []))
        logger.trace("'%s': %s", frame_name, retval) </s> remove         """ Return current frames count """
        retval = len(self.data)
 </s> add         """ int: The number of frames that appear in the alignments :attr:`data`. """
        retval = len(self._data) </s> remove     def frame_exists(self, frame):
        """ return path of images that have faces """
        retval = frame in self.data.keys()
        logger.trace("'%s': %s", frame, retval)
 </s> add     def frame_exists(self, frame_name):
        """ Check whether a given frame_name exists within the alignments :attr:`data`.

        Parameters
        ----------
        frame_name: str
            The frame name to check. This should be the base name of the frame, not the full path

        Returns
        -------
        bool
            ``True`` if the given frame_name exists within the alignments :attr:`data`
            otherwise ``False``
        """
        retval = frame_name in self._data.keys()
        logger.trace("'%s': %s", frame_name, retval)
    @property
    def file(self):
        """ str: The full path to the currently loaded alignments file. """
        return self._file

    @property
    def data(self):
        """ dict: The loaded alignments :attr:`file` in dictionary form. """
        return self._data

          retval = sum(len(val["faces"]) for val in self._data.values())
          logger.trace(retval)
          return retval
  
    @property
    def file(self):
        """ str: The full path to the currently loaded alignments file. """
        return self._file

    @property
    def data(self):
        """ dict: The loaded alignments :attr:`file` in dictionary form. """
        return self._data

      @property
      def have_alignments_file(self):
          """ bool: ``True`` if an alignments file exists at location :attr:`file` otherwise
          ``False``. """
keep keep keep add 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