def check_threat_level_input(self):
        """To check the validity of user input threat level."""
        __method_name = inspect.currentframe().f_code.co_name
        threat_level = consts.THREAT_LEVEL.upper()
        if threat_level in [
            consts.THREAT_LEVEL_FILTER_BENIGN.upper(),
            consts.THREAT_LEVEL_FILTER_SUSPICIOUS.upper(),
            consts.THREAT_LEVEL_FILTER_MALICIOUS.upper(),
        ]:
            applogger.debug(
                "{}(method={}) : {} : Threat_Level value successfully verified. ".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.SENTINEL_TO_DEFENDER,
                )
            )
            return True
        else:
            applogger.error(
                "{}(method={}) : {} : Invalid Threat_Level value. "
                "Valid values are {}, {} and {}.".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.SENTINEL_TO_DEFENDER,
                    consts.THREAT_LEVEL_FILTER_BENIGN,
                    consts.THREAT_LEVEL_FILTER_SUSPICIOUS,
                    consts.THREAT_LEVEL_FILTER_MALICIOUS,
                )
            )
            raise CofenseException("Invalid Threat_Level input in configuration.")
To check the validity of user input threat level.
Solutions/CofenseTriage/Data Connectors/CofenseTriageDataConnector/IndicatorCreatorToDefender/sentinel.py