<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _update_labels(self):
 """Updates list of available labels."""

        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)