def classify(alert, rules):
    """Determine the severity of an alert

    :param alert: The alert to test
    :param rules: An array of classification rules to test against
    :returns: Alert - The Alert object with severity added
    """
    sev = [rule(alert) for rule in rules]

    # Pick the highest priority classification from the classifications
    sev.sort(key=lambda x: x.value)
    alert.severity = sev.pop()

    return alert