def commit_batch_requests(self):
batch_boundary = b'<STR_LIT>' + _new_boundary()<EOL>changeset_boundary = b'<STR_LIT>' + _new_boundary()<EOL>if self.batch_requests:<EOL><INDENT>request = HTTPRequest()<EOL>request.method = '<STR_LIT:POST>'<EOL>request.host = self.batch_requests[<NUM_LIT:0>].host<EOL>request.path = '<STR_LIT>'<EOL>request.headers = [<EOL>('<STR_LIT:Content-Type>', '<STR_LIT>' +batch_boundary.decode('<STR_LIT:utf-8>')),<EOL>('<STR_LIT>', '<STR_LIT>'),<EOL>('<STR_LIT>', '<STR_LIT>')]<EOL>request.body = b'<STR_LIT>' + batch_boundary + b'<STR_LIT:\n>'<EOL>request.body += b'<STR_LIT>'<EOL>request.body += changeset_boundary + b'<STR_LIT>'<EOL>content_id = <NUM_LIT:1><EOL>for batch_request in self.batch_requests:<EOL><INDENT>request.body += b'<STR_LIT>' + changeset_boundary + b'<STR_LIT:\n>'<EOL>request.body += b'<STR_LIT>'<EOL>request.body += b'<STR_LIT>'<EOL>request.body += batch_request.method.encode('<STR_LIT:utf-8>')<EOL>request.body += b'<STR_LIT>'<EOL>request.body += batch_request.host.encode('<STR_LIT:utf-8>')<EOL>request.body += batch_request.path.encode('<STR_LIT:utf-8>')<EOL>request.body += b'<STR_LIT>'<EOL>request.body += b'<STR_LIT>'<EOL>request.body += str(content_id).encode('<STR_LIT:utf-8>') + b'<STR_LIT:\n>'<EOL>content_id += <NUM_LIT:1><EOL>if not batch_request.method == '<STR_LIT>':<EOL><INDENT>request.body +=b'<STR_LIT>'<EOL>for name, value in batch_request.headers:<EOL><INDENT>if name == '<STR_LIT>':<EOL><INDENT>request.body += name.encode('<STR_LIT:utf-8>') + b'<STR_LIT>'<EOL>request.body += value.encode('<STR_LIT:utf-8>') + b'<STR_LIT:\n>'<EOL>break<EOL><DEDENT><DEDENT>request.body += b'<STR_LIT>'<EOL>request.body += str(len(batch_request.body)).encode('<STR_LIT:utf-8>')<EOL>request.body += b'<STR_LIT>'<EOL>request.body += batch_request.body + b'<STR_LIT:\n>'<EOL><DEDENT>else:<EOL><INDENT>for name, value in batch_request.headers:<EOL><INDENT>if name == '<STR_LIT>':<EOL><INDENT>request.body += name.encode('<STR_LIT:utf-8>') + b'<STR_LIT>'<EOL>request.body += value.encode('<STR_LIT:utf-8>') + b'<STR_LIT>'<EOL>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>request.body += b'<STR_LIT>'<EOL><DEDENT><DEDENT><DEDENT>request.body += b'<STR_LIT>' + changeset_boundary + b'<STR_LIT>' + b'<STR_LIT:\n>'<EOL>request.body += b'<STR_LIT>' + batch_boundary + b'<STR_LIT>'<EOL>request.path, request.query = _update_request_uri_query(request)<EOL>request.headers = _update_storage_table_header(request)<EOL>self.authentication.sign_request(request)<EOL>response = self.perform_request(request)<EOL>if response.status >= <NUM_LIT>:<EOL><INDENT>raise HTTPError(response.status,<EOL>_ERROR_BATCH_COMMIT_FAIL,<EOL>self.respheader,<EOL>response.body)<EOL><DEDENT>responses = self._parse_batch_response(response.body)<EOL>if responses and responses[<NUM_LIT:0>].status >= <NUM_LIT>:<EOL><INDENT>self._report_batch_error(responses[<NUM_LIT:0>])<EOL><DEDENT><DEDENT>
Commits the batch requests.