def incident_exists(name, message, status):
    """
    Check if an incident with these attributes already exists
    """
    incidents = cachet.Incidents(endpoint=ENDPOINT)
    all_incidents = json.loads(incidents.get())
    for incident in all_incidents['data']:
        if name == incident['name'] and \
           status == incident['status'] and \
           message.strip() == incident['message'].strip():
            return True
    return False
Check if an incident with these attributes already exists