code: def test_dict_store_partition_set_delete_multithreaded(
      root_verify_key,
      dict_store_partition: DictStorePartition,
  ) -> None:
      dict_store_partition.init_store()
  
      thread_cnt = 5
      repeats = 200
  
      execution_err = None
  
      def _kv_cbk(tid: int) -> None:
          nonlocal execution_err
          for idx in range(repeats):
              obj = MockSyftObject(data=idx)
  
              for _ in range(10):
                  res = dict_store_partition.set(
                      root_verify_key, obj, ignore_duplicates=False
                  )
                  if res.is_ok():
                      break
  
              if res.is_err():
                  execution_err = res
              assert res.is_ok()
  
              key = dict_store_partition.settings.store_key.with_obj(
                  obj
              )
  
              res = dict_store_partition.delete(root_verify_key, key)
              if res.is_err():
                  execution_err = res
  
      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
      stored_cnt = len(
          dict_store_partition.all(
              root_verify_key,
          ).ok()
      )
      assert stored_cnt == 0
  
file_path: PySyft/packages/syft/tests/syft/stores/dict_document_store_test.py
imports: from threading import Thread
  from syft.store.dict_document_store import DictStorePartition
  from syft.store.document_store import QueryKeys
  from .store_mocks_test import MockObjectType
  from .store_mocks_test import MockSyftObject
label_desc: Use image node_id 7 for calling a global function with example usage: test_dict_store_partition_set_delete_multithreaded(root_verify_key, dict_store_partition) without return types