def __getmappinglabel__(mapping, value):
    """
    Gets index of label value in mapping.
    :param mapping: mapping dictionary
    :param value: value for which the mapping is searched for
    :return: index of value in mapping
    """
    if value in mapping["labels"]:
        return mapping["labels"].index(value)
    else:
        raise KeyError('Label "' + str(value) + '" not known.')