def matches(event, token_values):
    'See if the token matches the revocation event.\n\n    A brute force approach to checking.\n    Compare each attribute from the event with the corresponding\n    value from the token.  If the event does not have a value for\n    the attribute, a match is still possible.  If the event has a\n    value for the attribute, and it does not match the token, no match\n    is possible, so skip the remaining checks.\n\n    :param event: a RevokeEvent instance\n    :param token_values: dictionary with set of values taken from the\n                         token\n    :returns: True if the token matches the revocation event, indicating the\n              token has been revoked\n    '
    if (event.user_id is not None):
        if all(((event.user_id != token_values[attribute_name]) for attribute_name in ['user_id', 'trustor_id', 'trustee_id'])):
            return False
    if (event.domain_id is not None):
        if all(((event.domain_id != token_values[attribute_name]) for attribute_name in ['identity_domain_id', 'assignment_domain_id'])):
            return False
    if (event.domain_scope_id is not None):
        if (event.domain_scope_id != token_values['assignment_domain_id']):
            return False
    attribute_names = ['project_id', 'expires_at', 'trust_id', 'consumer_id', 'access_token_id', 'audit_id', 'audit_chain_id']
    for attribute_name in attribute_names:
        if (getattr(event, attribute_name) is not None):
            if (getattr(event, attribute_name) != token_values[attribute_name]):
                return False
    if (event.role_id is not None):
        roles = token_values['roles']
        if all(((event.role_id != role) for role in roles)):
            return False
    if (token_values['issued_at'] > event.issued_before):
        return False
    return True
See if the token matches the revocation event.

A brute force approach to checking.
Compare each attribute from the event with the corresponding
value from the token.  If the event does not have a value for
the attribute, a match is still possible.  If the event has a
value for the attribute, and it does not match the token, no match
is possible, so skip the remaining checks.

:param event: a RevokeEvent instance
:param token_values: dictionary with set of values taken from the
                     token
:returns: True if the token matches the revocation event, indicating the
          token has been revoked
def matches(event, token_values):
    'See if the token matches the revocation event.\n\n    A brute force approach to checking.\n    Compare each attribute from the event with the corresponding\n    value from the token.  If the event does not have a value for\n    the attribute, a match is still possible.  If the event has a\n    value for the attribute, and it does not match the token, no match\n    is possible, so skip the remaining checks.\n\n    :param event: a RevokeEvent instance\n    :param token_values: dictionary with set of values taken from the\n                         token\n    :returns: True if the token matches the revocation event, indicating the\n              token has been revoked\n    '
    if (event.user_id is not None):
        if all(((event.user_id != token_values[attribute_name]) for attribute_name in ['user_id', 'trustor_id', 'trustee_id'])):
            return False
    if (event.domain_id is not None):
        if all(((event.domain_id != token_values[attribute_name]) for attribute_name in ['identity_domain_id', 'assignment_domain_id'])):
            return False
    if (event.domain_scope_id is not None):
        if (event.domain_scope_id != token_values['assignment_domain_id']):
            return False
    attribute_names = ['project_id', 'expires_at', 'trust_id', 'consumer_id', 'access_token_id', 'audit_id', 'audit_chain_id']
    for attribute_name in attribute_names:
        if (getattr(event, attribute_name) is not None):
            if (getattr(event, attribute_name) != token_values[attribute_name]):
                return False
    if (event.role_id is not None):
        roles = token_values['roles']
        if all(((event.role_id != role) for role in roles)):
            return False
    if (token_values['issued_at'] > event.issued_before):
        return False
    return True