Set the custom_labels field of the object to a standardized format:
        3 column pandas df with ann_label_fields as columns.

        Does nothing if there are no custom labels defined.
        Does nothing if custom_labels is already a df with all 3 columns

        If custom_labels is an iterable of pairs/triplets, this
        function will convert it into a df.

        If the label_store attribute is not already defined, this
        function will automatically choose values by trying to use:
        1. The undefined store values from the standard wfdb annotation
           label map.
        2. The unused label store values. This is extracted by finding the
           set of all labels contained in this annotation object and seeing
           which symbols/descriptions are not used.

        If there are more custom labels defined than there are enough spaces,
        even in condition 2 from above, this function will raise an error.

        This function must work when called as a standalone.

def standardize_custom_labels(self):
        """
        Set the custom_labels field of the object to a standardized format:
        3 column pandas df with ann_label_fields as columns.

        Does nothing if there are no custom labels defined.
        Does nothing if custom_labels is already a df with all 3 columns

        If custom_labels is an iterable of pairs/triplets, this
        function will convert it into a df.

        If the label_store attribute is not already defined, this
        function will automatically choose values by trying to use:
        1. The undefined store values from the standard wfdb annotation
           label map.
        2. The unused label store values. This is extracted by finding the
           set of all labels contained in this annotation object and seeing
           which symbols/descriptions are not used.

        If there are more custom labels defined than there are enough spaces,
        even in condition 2 from above, this function will raise an error.

        This function must work when called as a standalone.
        """
        custom_labels = self.custom_labels

        if custom_labels is None:
            return

        self.check_field('custom_labels')

        # Convert to dataframe if not already
        if not isinstance(custom_labels, pd.DataFrame):
            if len(self.custom_labels[0]) == 2:
                symbol = self.get_custom_label_attribute('symbol')
                description = self.get_custom_label_attribute('description')
                custom_labels = pd.DataFrame({'symbol': symbol, 'description': description})
            else:
                label_store = self.get_custom_label_attribute('label_store')
                symbol = self.get_custom_label_attribute('symbol')
                description = self.get_custom_label_attribute('description')
                custom_labels = pd.DataFrame({'label_store':label_store, 'symbol': symbol, 'description': description})

        # Assign label_store values to the custom labels if not defined
        if 'label_store' not in list(custom_labels):
            undefined_label_stores = self.get_undefined_label_stores()

            if len(custom_labels) > len(undefined_label_stores):
                available_label_stores = self.get_available_label_stores()
            else:
                available_label_stores = undefined_label_stores

            n_custom_labels = custom_labels.shape[0]

            if n_custom_labels > len(available_label_stores):
                raise ValueError('There are more custom_label definitions than storage values available for them.')

            custom_labels['label_store'] = available_label_stores[:n_custom_labels]

        custom_labels.set_index(custom_labels['label_store'].values, inplace=True)
        custom_labels = custom_labels[list(ann_label_fields)]

        self.custom_labels = custom_labels

        return