#NEWLINE# def verify_realms( self , token , realms , request ) : #NEWLINE# #INDENT# 'Verify if the realms match the requested realms.' #NEWLINE# log . debug ( 'Verify realms %r' , realms ) #NEWLINE# tok = ( request . request_token or self . _grantgetter ( token = token ) ) #NEWLINE# if ( not realms ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# request . request_token = tok #NEWLINE# if ( not hasattr ( tok , 'realms' ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# return ( set ( tok . realms ) == set ( realms ) )