#NEWLINE# def matches( self , url ) : #NEWLINE# #INDENT# if ( self . allow_domains and ( not url_is_from_any_domain ( url , self . allow_domains ) ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( self . deny_domains and url_is_from_any_domain ( url , self . deny_domains ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# allowed = ( [ regex . search ( url ) for regex in self . allow_res ] if self . allow_res else [ True ] ) #NEWLINE# denied = ( [ regex . search ( url ) for regex in self . deny_res ] if self . deny_res else [ ] ) #NEWLINE# return ( any ( allowed ) and ( not any ( denied ) ) )