  
      def update_legacy(self):
          """ Update legacy alignments """
          updated = False
          if self.has_legacy_landmarksxy():
              logger.info("Updating legacy landmarksXY to landmarks_xy")
              self.update_legacy_landmarksxy()
              updated = True
          if self.has_legacy_landmarks_list():
              logger.info("Updating legacy landmarks from list to numpy array")
 
</s> remove             self.update_legacy_landmarksxy()
 </s> add             self._update_legacy_landmarksxy() </s> remove         if self.has_legacy_landmarks_list():
 </s> add         if self._has_legacy_landmarks_list(): </s> remove     def update_legacy(self):
        """ Update legacy alignments """
 </s> add     def _update_legacy(self):
        """ Check whether the alignments are legacy, and if so update them to current alignments
        format. """ </s> remove             self.update_legacy_landmarks_list()
 </s> add             self._update_legacy_landmarks_list() </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"])
        if self._has_legacy_structure():
            self._update_legacy_structure()

        if self._has_legacy_landmarksxy():
  
      def update_legacy(self):
          """ Update legacy alignments """
          updated = False
        if self._has_legacy_structure():
            self._update_legacy_structure()

        if self._has_legacy_landmarksxy():
              logger.info("Updating legacy landmarksXY to landmarks_xy")
              self.update_legacy_landmarksxy()
              updated = True
          if self.has_legacy_landmarks_list():
              logger.info("Updating legacy landmarks from list to numpy array")
keep keep keep keep 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