def sentinel_to_cofense_threat_level_mapping(confidence, azure_function_name):
    """To convert sentinel confidence value to threat level."""
    __method_name = inspect.currentframe().f_code.co_name
    if (
        confidence is None
        or confidence == ""
        or int(confidence) == 0
        or (
            int(confidence) >= THREAT_LEVEL_BENIGN
            and int(confidence) <= THREAT_LEVEL_INTERMEDIATE
        )
    ):
        threat_level = "Benign"
    elif (
        int(confidence) > THREAT_LEVEL_INTERMEDIATE
        and int(confidence) <= THREAT_LEVEL_SUSPICIOUS
    ):
        threat_level = "Suspicious"
    elif (
        int(confidence) > THREAT_LEVEL_SUSPICIOUS
        and int(confidence) <= THREAT_LEVEL_MALICIOUS
    ):
        threat_level = "Malicious"
    else:
        applogger.error(
            "{}(method={}) : {} : Unknown confidence value.".format(
                LOGS_STARTS_WITH, __method_name, azure_function_name
            )
        )
        raise CofenseException()

    return threat_level
To convert sentinel confidence value to threat level.
Solutions/CofenseTriage/Data Connectors/CofenseTriageDataConnector/SharedCode/utils.py