code: def _update_labels(self):
          
          labels = set()
          for page in self.get_pages():
              for label in page.labels:
                  labels.add(label)
          to_delete = self._labels - labels
          for label in labels:
              self._labels.add(label)
          for label in to_delete:
              self._labels.discard(label)
docs: Updates list of available labels.