def alarm_get_by_ids(self, alarm_id, entity_instance_id):
    query = model_query(models.Alarm)
    if (alarm_id and entity_instance_id):
        query = query.filter_by(alarm_id=alarm_id)
        query = query.filter_by(entity_instance_id=entity_instance_id)
        query = query.join(models.EventSuppression, (models.Alarm.alarm_id == models.EventSuppression.alarm_id))
        query = add_alarm_mgmt_affecting_by_event_suppression(query)
        query = add_alarm_degrade_affecting_by_event_suppression(query)
    try:
        result = query.one()
    except NoResultFound:
        return None
    return result
def alarm_get_by_ids(self, alarm_id, entity_instance_id):
    query = model_query(models.Alarm)
    if (alarm_id and entity_instance_id):
        query = query.filter_by(alarm_id=alarm_id)
        query = query.filter_by(entity_instance_id=entity_instance_id)
        query = query.join(models.EventSuppression, (models.Alarm.alarm_id == models.EventSuppression.alarm_id))
        query = add_alarm_mgmt_affecting_by_event_suppression(query)
        query = add_alarm_degrade_affecting_by_event_suppression(query)
    try:
        result = query.one()
    except NoResultFound:
        return None
    return result