def _convert_batch_to_json(batch_requests):
batch_boundary = b'<STR_LIT>' + _new_boundary()<EOL>changeset_boundary = b'<STR_LIT>' + _new_boundary()<EOL>body = [b'<STR_LIT>' + batch_boundary + b'<STR_LIT:\n>',<EOL>b'<STR_LIT>',<EOL>changeset_boundary + b'<STR_LIT>']<EOL>content_id = <NUM_LIT:1><EOL>for _, request in batch_requests:<EOL><INDENT>body.append(b'<STR_LIT>' + changeset_boundary + b'<STR_LIT:\n>')<EOL>body.append(b'<STR_LIT>')<EOL>body.append(b'<STR_LIT>')<EOL>body.append(request.method.encode('<STR_LIT:utf-8>'))<EOL>body.append(b'<STR_LIT:U+0020>')<EOL>body.append(request.path.encode('<STR_LIT:utf-8>'))<EOL>body.append(b'<STR_LIT>')<EOL>body.append(b'<STR_LIT>')<EOL>body.append(str(content_id).encode('<STR_LIT:utf-8>') + b'<STR_LIT:\n>')<EOL>content_id += <NUM_LIT:1><EOL>for name, value in request.headers.items():<EOL><INDENT>if name in _SUB_HEADERS:<EOL><INDENT>body.append(name.encode('<STR_LIT:utf-8>') + b'<STR_LIT>')<EOL>body.append(value.encode('<STR_LIT:utf-8>') + b'<STR_LIT:\n>')<EOL><DEDENT><DEDENT>if not request.method == '<STR_LIT>':<EOL><INDENT>body.append(b'<STR_LIT>')<EOL>body.append(str(len(request.body)).encode('<STR_LIT:utf-8>'))<EOL>body.append(b'<STR_LIT>')<EOL>body.append(request.body + b'<STR_LIT:\n>')<EOL><DEDENT>body.append(b'<STR_LIT:\n>')<EOL><DEDENT>body.append(b'<STR_LIT>' + changeset_boundary + b'<STR_LIT>' + b'<STR_LIT:\n>')<EOL>body.append(b'<STR_LIT>' + batch_boundary + b'<STR_LIT>')<EOL>return b'<STR_LIT>'.join(body), '<STR_LIT>' + batch_boundary.decode('<STR_LIT:utf-8>')<EOL>
Create json to send for an array of batch requests.

batch_requests:
    an array of requests