class_docstr: Fake for CompetitionDatastoreClient.
class_docstr_tok: ["Fake","for","CompetitionDatastoreClient","."]
docstr: Sets transaction hook.
  
  This hook will be executed right after next transaction created.
  It helps to model a situation when data are modified outside of transaction.
  To be used in tests to test how your code handles edits concurrent with
  transaction.
  
  Args:
    hook: transaction hook, should be a function which takes exactly
          one argument - instance of this class.
  
  Raises:
    ValueError: if transaction hook was already set
docstr_tok: ["Sets","transaction","hook",".","This","hook","will","be","executed","right","after","next","transaction","created",".","It","helps","to","model","a","situation","when","data","are","modified","outside","of","transaction",".","To","be","used","in","tests","to","test","how","your","code","handles","edits","concurrent","with","transaction",".","Args",":","hook",":","transaction","hook",",","should","be","a","function","which","takes","exactly","one","argument","-","instance","of","this","class",".","Raises",":","ValueError",":","if","transaction","hook","was","already","set"]
code: def set_transaction_hook(self, hook):
      """Sets transaction hook.
  
      This hook will be executed right after next transaction created.
      It helps to model a situation when data are modified outside of transaction.
      To be used in tests to test how your code handles edits concurrent with
      transaction.
  
      Args:
        hook: transaction hook, should be a function which takes exactly
              one argument - instance of this class.
  
      Raises:
        ValueError: if transaction hook was already set
      """
      if self._transaction_hook is not None:
          raise ValueError("Attempt to set transaction hook twice")
      self._transaction_hook = hook
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  from io import StringIO
  import six
label_desc: Use image node_id 11 for calling the FakeDatastoreClient obj's underlying member method code with example usage: obj.set_transaction_hook(hook) without return types