Check if an event error has expired.

def annotation_has_expired(event, key, timeout):
    """Check if an event error has expired."""
    anns = get_annotations(event, key)
    if anns:
        return (time.time() - anns[0]["ts"]) > timeout
    else:
        return False