<s> import types <EOL> from django . core import urlresolvers as django_urlresolvers <EOL> from urldecorators . helpers import func_from_callable <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> class DecoratorMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( DecoratorMixin , self ) . __init__ ( * args , ** kwargs ) <EOL> self . decorators = [ ] <EOL> def resolve ( self , path ) : <EOL> match = super ( DecoratorMixin , self ) . resolve ( path ) <EOL> if not match : <EOL> return match <EOL> try : <EOL> match . func = self . apply_decorators ( match . func ) <EOL> except AttributeError : <EOL> match = self . apply_decorators ( match [ <NUM_LIT:0> ] ) , match [ <NUM_LIT:1> ] , match [ <NUM_LIT:2> ] <EOL> return match <EOL> def apply_decorators ( self , callback ) : <EOL> if not isinstance ( callback , types . FunctionType ) : <EOL> callback = func_from_callable ( callback ) <EOL> for decorator in self . decorators : <EOL> callback = decorator ( callback ) <EOL> return callback <EOL> class RegexURLPattern ( DecoratorMixin , django_urlresolvers . RegexURLPattern ) : <EOL> """<STR_LIT>""" <EOL> class RegexURLResolver ( DecoratorMixin , django_urlresolvers . RegexURLResolver ) : <EOL> """<STR_LIT>""" </s>
