def __getmappingcases__(mapping, value):
    """
    Gets index of case 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["cases"]:
        return mapping["cases"].index(value)
    else:
        return len(mapping["cases"]) + 1