<s> """<STR_LIT>""" <EOL> try : <EOL> from functools import wraps , update_wrapper <EOL> except ImportError : <EOL> from django . utils . functional import wraps , update_wrapper <EOL> """<STR_LIT>""" <EOL> def method_decorator ( decorator ) : <EOL> """<STR_LIT>""" <EOL> def _dec ( func ) : <EOL> def _wrapper ( self , * args , ** kwargs ) : <EOL> def bound_func ( * args2 , ** kwargs2 ) : <EOL> return func ( self , * args2 , ** kwargs2 ) <EOL> return decorator ( bound_func ) ( * args , ** kwargs ) <EOL> return wraps ( func ) ( _wrapper ) <EOL> update_wrapper ( _dec , decorator ) <EOL> _dec . __name__ = '<STR_LIT>' % decorator . __name__ <EOL> return _dec </s>
