<s> from flask import jsonify , Response , render_template <EOL> from utils import get_excuse <EOL> class Which ( object ) : <EOL> def __init__ ( self , mime_type , args ) : <EOL> self . mime_type = mime_type <EOL> self . args = args <EOL> @ property <EOL> def _excuse ( self ) : <EOL> return get_excuse ( ) <EOL> def get_response ( self ) : <EOL> if self . mime_type == "<STR_LIT:application/json>" : <EOL> return jsonify ( { <EOL> "<STR_LIT>" : self . _excuse <EOL> } ) , "<STR_LIT>" <EOL> elif self . mime_type == "<STR_LIT>" : <EOL> return Response ( <EOL> render_template ( '<STR_LIT>' , excuse = self . _excuse ) , <EOL> mimetype = '<STR_LIT>' <EOL> ) , "<STR_LIT>" <EOL> elif self . mime_type == "<STR_LIT>" or "<STR_LIT>" in self . args : <EOL> return Response ( <EOL> render_template ( '<STR_LIT>' , excuse = self . _excuse ) , <EOL> mimetype = '<STR_LIT>' <EOL> ) , "<STR_LIT>" <EOL> elif self . mime_type == "<STR_LIT>" : <EOL> return Response ( self . _excuse , mimetype = '<STR_LIT>' ) , "<STR_LIT>" <EOL> else : <EOL> return render_template ( '<STR_LIT>' , excuse = self . _excuse ) , "<STR_LIT>" </s>
