@app.route('<STR_LIT>')<EOL>def stream_n_messages(request, n):
n = int(n)<EOL>response = get_dict(request, '<STR_LIT:url>', '<STR_LIT:args>', '<STR_LIT>', '<STR_LIT>')<EOL>n = min(n, <NUM_LIT:100>)<EOL>def generate_stream():<EOL><INDENT>for i in range(n):<EOL><INDENT>response['<STR_LIT:id>'] = i<EOL>yield json.dumps(response, default=json_dumps_default) + '<STR_LIT:\n>'<EOL><DEDENT><DEDENT>return Response(generate_stream(), headers={<EOL>'<STR_LIT:Content-Type>': '<STR_LIT:application/json>',<EOL>})<EOL>
Stream n JSON messages