@app.route("<STR_LIT>")<EOL>def stream_random_bytes(n):
n = min(n, <NUM_LIT:100> * <NUM_LIT>)  <EOL>params = CaseInsensitiveDict(request.args.items())<EOL>if "<STR_LIT>" in params:<EOL><INDENT>random.seed(int(params["<STR_LIT>"]))<EOL><DEDENT>if "<STR_LIT>" in params:<EOL><INDENT>chunk_size = max(<NUM_LIT:1>, int(params["<STR_LIT>"]))<EOL><DEDENT>else:<EOL><INDENT>chunk_size = <NUM_LIT:10> * <NUM_LIT><EOL><DEDENT>def generate_bytes():<EOL><INDENT>chunks = bytearray()<EOL>for i in xrange(n):<EOL><INDENT>chunks.append(random.randint(<NUM_LIT:0>, <NUM_LIT:255>))<EOL>if len(chunks) == chunk_size:<EOL><INDENT>yield (bytes(chunks))<EOL>chunks = bytearray()<EOL><DEDENT><DEDENT>if chunks:<EOL><INDENT>yield (bytes(chunks))<EOL><DEDENT><DEDENT>headers = {"<STR_LIT:Content-Type>": "<STR_LIT>"}<EOL>return Response(generate_bytes(), headers=headers)<EOL>
Streams n random bytes generated with given seed, at given chunk size per packet.
    ---
    tags:
      - Dynamic data
    parameters:
      - in: path
        name: n
        type: int
    produces:
      - application/octet-stream
    responses:
      200:
        description: Bytes.