def commit_batch(self, table_name, batch, timeout=None):
_validate_not_none('<STR_LIT>', table_name)<EOL>request = HTTPRequest()<EOL>request.method = '<STR_LIT:POST>'<EOL>request.host_locations = self._get_host_locations()<EOL>request.path = '<STR_LIT:/>' + '<STR_LIT>'<EOL>request.query = {'<STR_LIT>': _int_to_str(timeout)}<EOL>for row_key, batch_request in batch._requests:<EOL><INDENT>if batch_request.method == '<STR_LIT:POST>':<EOL><INDENT>batch_request.path = '<STR_LIT:/>' + _to_str(table_name)<EOL><DEDENT>else:<EOL><INDENT>batch_request.path = _get_entity_path(table_name, batch._partition_key, row_key)<EOL><DEDENT>if self.is_emulated:<EOL><INDENT>batch_request.path = '<STR_LIT:/>' + DEV_ACCOUNT_NAME + batch_request.path<EOL><DEDENT>_update_request(batch_request, X_MS_VERSION, USER_AGENT_STRING)<EOL><DEDENT>request.body, boundary = _convert_batch_to_json(batch._requests)<EOL>request.headers = {'<STR_LIT:Content-Type>': boundary}<EOL>return self._perform_request(request, _parse_batch_response)<EOL>
Commits a :class:`~azure.storage.table.TableBatch` request.

:param str table_name:
    The name of the table to commit the batch to.
:param TableBatch batch:
    The batch to commit.
:param int timeout:
    The server timeout, expressed in seconds.
:return:
    A list of the batch responses corresponding to the requests in the batch.
    The items could either be an etag, in case of success, or an error object in case of failure.
:rtype: list(:class:`~azure.storage.table.models.AzureBatchOperationError`, str)