@contextmanager<EOL><INDENT>def batch(self, table_name, timeout=None):<DEDENT>
batch = TableBatch(self.require_encryption, self.key_encryption_key, self.encryption_resolver_function)<EOL>yield batch<EOL>self.commit_batch(table_name, batch, timeout=timeout)<EOL>
Creates a batch object which can be used as a context manager. Commits the batch on exit.

:param str table_name:
    The name of the table to commit the batch to.
:param int timeout:
    The server timeout, expressed in seconds.