class_docstr: No transaction batch to write large number of entities.
  
  Usage:
    client = ...  # instance of CompetitionDatastoreClient
    with NoTransactionBatch(client) as batch:
      batch.put(entity1)
      ...
      batch.put(entityN)
      batch.delete(del_entity1)
      ...
      batch.delete(del_entityM)
  
  It could be also used via CompetitionDatastoreClient.no_transact_batch:
    client = ...  # instance of CompetitionDatastoreClient
    with client.no_transact_batch() as batch:
      batch.put(entity1)
      ...
      batch.put(entityN)
      batch.delete(del_entity1)
      ...
      batch.delete(del_entityM)
  
  Most methods of this class are provided to simulate
  google.cloud.datastore.batch.Batch interface, so they could be used
  interchangeably.
  Practically speaking, this class works by maintaining a buffer of
  pending mutations and committing them as soon as the length of the buffer
  reaches MAX_MUTATIONS_IN_BATCH.
docstr: Rolls back pending mutations.
  
  Keep in mind that NoTransactionBatch splits all mutations into smaller
  batches and commit them as soon as mutation buffer reaches maximum length.
  That's why rollback method will only roll back pending mutations from the
  buffer, but won't be able to rollback already committed mutations.
docstr_tok: ["Rolls","back","pending","mutations",".","Keep","in","mind","that","NoTransactionBatch","splits","all","mutations","into","smaller","batches","and","commit","them","as","soon","as","mutation","buffer","reaches","maximum","length",".","That","'s","why","rollback","method","will","only","roll","back","pending","mutations","from","the","buffer",",","but","wo","n't","be","able","to","rollback","already","committed","mutations","."]
code: def rollback(self):
      """Rolls back pending mutations.
  
      Keep in mind that NoTransactionBatch splits all mutations into smaller
      batches and commit them as soon as mutation buffer reaches maximum length.
      That's why rollback method will only roll back pending mutations from the
      buffer, but won't be able to rollback already committed mutations.
      """
      try:
          if self._cur_batch:
              self._cur_batch.rollback()
      except ValueError:
          # ignore "Batch must be in progress to rollback" error
          pass
      self._cur_batch = None
      self._num_mutations = 0
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import math
  import random
  import time
  import traceback
  from google.cloud import datastore
  from google.cloud import storage
  from google.cloud.exceptions import TooManyRequests
label_desc: Use image node_id 4 for calling the NoTransactionBatch obj's underlying member method code with example usage: obj.rollback() without return types