<s> from watson . framework import views , controllers <EOL> def view ( template = None , format = None ) : <EOL> """<STR_LIT>""" <EOL> def decorator ( func ) : <EOL> def wrapper ( self , * args , ** kwargs ) : <EOL> controller_response = func ( self , * args , ** kwargs ) <EOL> if controller_response is None : <EOL> controller_response = { } <EOL> if isinstance ( controller_response , controllers . ACCEPTABLE_RETURN_TYPES ) : <EOL> controller_response = { '<STR_LIT:content>' : controller_response } <EOL> if isinstance ( controller_response , ( dict , list , tuple ) ) : <EOL> controller_response = views . Model ( data = controller_response ) <EOL> if format : <EOL> controller_response . format = format <EOL> if template : <EOL> controller_response . template = template <EOL> return controller_response <EOL> return wrapper <EOL> return decorator </s>
