def latest_consent(user, org_id=None, include_suspended=False):
    """Lookup latest consent for user

    :param user: subject of query
    :param org_id: define to restrict to given org
    :param include_suspended: set true to stop looking back, even if
        the consent is marked suspended (aka withdrawn).  By default,
        suspended consents are ignored, looking back to find the
        previously valid acceptance date.  NB in a currently suspended
        state, the previous is marked deleted
    :returns: the most recent consent based on given criteria, or None
        if no match is located

    """
    if org_id:
        raise NotImplementedError

    # consents are ordered desc(acceptance_date)
    # ignore suspended unless `include_suspended` is set
    # include deleted, as in a suspended state, the previous
    # acceptance will now be marked deleted.
    for consent in user.all_consents:
        if include_suspended and consent.status == 'suspended':
            return consent
        if not include_suspended and consent.status == 'suspended':
            continue
        return consent

    return None