def _matches(event, token_values):
 if (event.user_id is not None):
  for attribute_name in ['user_id', 'trustor_id', 'trustee_id']:
   if (event.user_id == token_values[attribute_name]):
    break
  else:
   return False
 if (event.domain_id is not None):
  for attribute_name in ['identity_domain_id', 'assignment_domain_id']:
   if (event.domain_id == token_values[attribute_name]):
    break
  else:
   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']
  for role in roles:
   if (event.role_id == role):
    break
  else:
   return False
 if (token_values['issued_at'] > event.issued_before):
  return False
 return True

def _matches ( event , token_values ) : if ( event . user_id is not None ) : for attribute_name in [ 'user_id' , 'trustor_id' , 'trustee_id' ] : if ( event . user_id == token_values [ attribute_name ] ) : break else : return False if ( event . domain_id is not None ) : for attribute_name in [ 'identity_domain_id' , 'assignment_domain_id' ] : if ( event . domain_id == token_values [ attribute_name ] ) : break else : 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' ] for role in roles : if ( event . role_id == role ) : break else : return False if ( token_values [ 'issued_at' ] > event . issued_before ) : return False return True
see if the token matches the revocation event .