code: def test_transaction_write_concurrent(self):
      key4 = self._client.key("zxc", "vbn")
      entity4 = self._client.entity(key4)
      entity4["k7"] = "v7"
      entity3_upd = self._client.entity(self._key3)
      entity3_upd["k4"] = "upd_v4"
      entity3_upd_no_transact = self._client.entity(self._key3)
      entity3_upd_no_transact["k4"] = "another_v4"
      reached_end_of_transaction = False
      with self.assertRaises(Exception):
          with self._client.transaction() as transaction:
              # first write in transaction
              transaction.put(entity3_upd)
              # modify some data which are not references in the transaction
              self._client.put(entity3_upd_no_transact)
              # second write in transaction
              transaction.put(entity4)
              reached_end_of_transaction = True
      self.assertTrue(reached_end_of_transaction)
      # verify datastore content
      assertCountEqual(
          self,
          [self._key1, self._key2, self._key3],
          self._client.entities.keys(),
      )
      self.assertDictEqual(
          {"k1": "v1"}, dict(self._client.entities[self._key1])
      )
      self.assertDictEqual(
          {"k2": "v2", "k3": "v3"},
          dict(self._client.entities[self._key2]),
      )
      self.assertDictEqual(
          {"k4": "another_v4", "k5": "v5", "k6": "v6"},
          dict(self._client.entities[self._key3]),
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  from io import BytesIO
  import unittest
  from eval_lib.tests import fake_cloud_client
  from six import assertCountEqual
  from six import b
label_desc: Use image node_id 5 for calling the FakeDatastoreClientTransactionTest obj's underlying member method code with example usage: obj.test_transaction_write_concurrent() without return types