code: def test_kv_store_partition_update_multithreaded(
      root_verify_key,
      kv_store_partition: KeyValueStorePartition,
  ) -> None:
      thread_cnt = 5
      repeats = 50
  
      obj = MockSyftObject(data=0)
      key = kv_store_partition.settings.store_key.with_obj(obj)
      kv_store_partition.set(
          root_verify_key, obj, ignore_duplicates=False
      )
      execution_err = None
  
      def _kv_cbk(tid: int) -> None:
          nonlocal execution_err
          for repeat in range(repeats):
              obj = MockSyftObject(data=repeat)
  
              for _ in range(10):
                  res = kv_store_partition.update(
                      root_verify_key, key, obj
                  )
                  if res.is_ok():
                      break
  
              if res.is_err():
                  execution_err = res
              assert res.is_ok()
  
      tids = []
      for tid in range(thread_cnt):
          thread = Thread(target=_kv_cbk, args=(tid,))
          thread.start()
  
          tids.append(thread)
  
      for thread in tids:
          thread.join()
  
      assert execution_err is None
  
file_path: PySyft/packages/syft/tests/syft/stores/kv_document_store_test.py
imports: from copy import copy
  from threading import Thread
  import pytest
  from syft.store.document_store import PartitionSettings
  from syft.store.document_store import QueryKeys
  from syft.store.kv_document_store import KeyValueStorePartition
  from .store_mocks_test import MockObjectType
  from .store_mocks_test import MockStoreConfig
  from .store_mocks_test import MockSyftObject
label_desc: Use image node_id 10 for calling a global function with example usage: test_kv_store_partition_update_multithreaded(root_verify_key, kv_store_partition) without return types