<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def relabel_polymers(self, labels=None):
 """Relabels the component Polymers either in alphabetical order or using a list of labels. Parameters labels : list, optional A list of new labels. Raises ------ ValueError Raised if the number of labels does not match the number of component Polymer objects. """

        if labels:
            if len(self._molecules) == len(labels):
                for polymer, label in zip(self._molecules, labels):
                    polymer.id = label
            else:
                raise ValueError('Number of polymers ({}) and number of labels ({}) must be equal.'.format(
                    len(self._molecules), len(labels)))
        else:
            for i, polymer in enumerate(self._molecules):
                polymer.id = chr(i + 65)
        return