def add_alarm_filter_by_event_suppression(query, include_suppress):
    'Adds an event_suppression filter to a query.\n\n    Filters results by suppression status\n\n    :param query: Initial query to add filter to.\n    :param include_suppress: Value for filtering results by.\n    :return: Modified query.\n    '
    query = query.join(models.EventSuppression, (models.Alarm.alarm_id == models.EventSuppression.alarm_id))
    query = query.add_columns(models.EventSuppression.suppression_status)
    if include_suppress:
        return query
    return query.filter((models.EventSuppression.suppression_status == constants.FM_UNSUPPRESSED))
Adds an event_suppression filter to a query.

Filters results by suppression status

:param query: Initial query to add filter to.
:param include_suppress: Value for filtering results by.
:return: Modified query.
def add_alarm_filter_by_event_suppression(query, include_suppress):
    'Adds an event_suppression filter to a query.\n\n    Filters results by suppression status\n\n    :param query: Initial query to add filter to.\n    :param include_suppress: Value for filtering results by.\n    :return: Modified query.\n    '
    query = query.join(models.EventSuppression, (models.Alarm.alarm_id == models.EventSuppression.alarm_id))
    query = query.add_columns(models.EventSuppression.suppression_status)
    if include_suppress:
        return query
    return query.filter((models.EventSuppression.suppression_status == constants.FM_UNSUPPRESSED))