<s> '''<STR_LIT>''' <EOL> from django . conf import settings <EOL> class RegexMatcher ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , setting_name ) : <EOL> import re <EOL> self . patterns = [ ] <EOL> for regex in getattr ( settings , setting_name , ( ) ) : <EOL> self . patterns . append ( re . compile ( regex ) ) <EOL> def matches ( self , path ) : <EOL> for p in self . patterns : <EOL> m = p . match ( path ) <EOL> if m : return m </s>
