<s> """<STR_LIT>""" <EOL> from freezer_api . common import exceptions as freezer_api_exc <EOL> import json <EOL> from webob . dec import wsgify <EOL> @ wsgify . middleware <EOL> def json_translator ( req , app ) : <EOL> resp = req . get_response ( app ) <EOL> if resp . body : <EOL> if isinstance ( resp . body , dict ) : <EOL> try : <EOL> resp . body = json . dumps ( resp . body ) <EOL> except Exception : <EOL> raise freezer_api_exc . FreezerAPIException ( <EOL> '<STR_LIT>' ) <EOL> return resp <EOL> class HealthApp ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , app , path ) : <EOL> self . app = app <EOL> self . path = path <EOL> def __call__ ( self , environ , start_response ) : <EOL> if environ . get ( '<STR_LIT>' ) == self . path : <EOL> start_response ( '<STR_LIT>' , [ ] ) <EOL> return [ ] <EOL> return self . app ( environ , start_response ) </s>
