def set_labels(self, labels=[]):
"""Fix/reset the list of labels of this annotation.
:param labels: (sppasLabel, list) the label(s) to stamp this annotation, or a list of them.
:raises: AnnDataTypeError, TypeError, CtrlVocabContainsError, HierarchyContainsError, HierarchyTypeError
"""
self.__labels = list()
if labels is None:
return
if isinstance(labels, sppasLabel) is True:
self.validate_label(labels)
self.__labels.append(labels)
elif isinstance(labels, list) is True:
for label in labels:
if label is not None:
self.validate_label(label)
self.__labels.append(label)
else:
raise AnnDataTypeError(labels, 'sppasLabel/list')