def output_json(data, code, headers=None):
settings = current_app.config.get('<STR_LIT>', {})<EOL>if current_app.debug:<EOL><INDENT>settings.setdefault('<STR_LIT>', <NUM_LIT:4>)<EOL>settings.setdefault('<STR_LIT>', not PY3)<EOL><DEDENT>dumped = dumps(data, **settings) + "<STR_LIT:\n>"<EOL>resp = make_response(dumped, code)<EOL>resp.headers.extend(headers or {})<EOL>return resp<EOL>
Makes a Flask response with a JSON encoded body