def METHOD_NAME(term, item, data):
    default = data['default']
    max_threshold = data['max_threshold']
    value = getattr(term.stat, item, default)
    if isinstance(value, bool) and value != max_threshold:
        return
    elif isinstance(value, (int, float)) and value < max_threshold:
        return
    msg = data['alarm_msg_format']
    error = msg.format(max_threshold=max_threshold, value=value, name=term.name)
    return error