Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cortex/blob/main/tests/json/gen_big.py # cortex aien-dev/cortex Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `cortex / tests / json / gen_big.py` 19 lines ยท 1125 bytes Raw Blame History 1 #!/usr/bin/env python3 2 """Large-document corpus for tests/json (each doc <= 4 MiB, the jes / request limit). Writes framed records.""" 3 import random, sys 4 random.seed(7) 5 docs = [] 6 docs.append(b'"' + b'a' * `3000000` + b'"') 7 docs.append(b'"' + ('\u00e9\\n\\u00e9x' * 300000).encode() + b'"') 8 docs.append(b'[' + b','.join(b'0' for _ in range(`1500000`)) + b']') 9 docs.append(b'[' + b','.join(b'0' for _ in range(`1500000`)) + b',]') 10 docs.append(b'{' + b','.join(b'"k%d":%d' % (random.randrange(10**6), i) for i in range(250000)) + b'}') 11 docs.append(b'{' + b','.join(b'"k%d":%d' % (random.randrange(1000), i) for i in range(300000)) + b'}') 12 docs.append(b' ' * `2000000` + b'\n' * `1500000` + b'[1,2') 13 docs.append(b'[' + b','.join(b'"%s"' % (b'x' * random.randrange(5)) for _ in range(800000)) + b'] x') 14 docs.append(b'{"' + b'k' * `1200000` + b'":1,"' + b'k' * `1200000` + b'":2}') 15 docs.append(b'"' + b'\\u0041' * 600000 + b'\xff"') 16 docs.append(b'[' * 127 + b']' * 127) 17 docs.append(b'{"a":' * 127 + b'1' + b'}' * 127) 18 assert all(len(d) <= `4194304` for d in docs) 19 sys.stdout.buffer.write(b''.join(len(d).to_bytes(4, 'little') + d for d in docs))