def get_correctly_extended_latex_label(label, label_extension):
    """Function to obtain a correctly extended latex label.

    :param label: label to be extended
    :type label: str
    :param label_extension: extensions of the label
    :type label_extension: str
    :return: extended latex label
    :rtype: str
    """
    if '^{' in label and '^{' in label_extension:
        return label[:-1] + ',' + label_extension[2:]
    else:
        return label + label_extension
