(self, label)
Get a unique label name from the given label name.

        :param str label:   The desired label name.
        :return:            A unique label name.
Get a unique label name from the given label name.
Get a unique label name from the given label name .
def get_unique_label(self, label):
        """
        Get a unique label name from the given label name.

        :param str label:   The desired label name.
        :return:            A unique label name.
        """

        if label not in self._labels:
            return label

        # use it as the prefix
        i = 1
        while True:
            new_label = "%s_%d" % (label, i)
            if new_label not in self._labels:
                return new_label
            i += 1
def get_unique_label ( self , label ) : if label not in self . _labels : return label # use it as the prefix i = 1 while True : new_label = "%s_%d" % ( label , i ) if new_label not in self . _labels : return new_label i += 1