code: def test_sqlite_store_partition_set_threading(
      sqlite_workspace: Tuple,
      root_verify_key,
  ) -> None:
      thread_cnt = 3
      repeats = REPEATS
  
      execution_err = None
  
      def _kv_cbk(tid: int) -> None:
          nonlocal execution_err
  
          sqlite_store_partition = sqlite_store_partition_fn(
              root_verify_key, sqlite_workspace
          )
          for idx in range(repeats):
              obj = MockObjectType(data=idx)
  
              for _ in range(10):
                  res = sqlite_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(), res
  
          return execution_err
  
      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
  
      sqlite_store_partition = sqlite_store_partition_fn(
          root_verify_key, sqlite_workspace
      )
      stored_cnt = len(
          sqlite_store_partition.all(
              root_verify_key,
          ).ok()
      )
      assert stored_cnt == thread_cnt * repeats
  
file_path: PySyft/packages/syft/tests/syft/stores/sqlite_document_store_test.py
imports: from threading import Thread
  from typing import Tuple
  from joblib import Parallel
  from joblib import delayed
  import pytest
  from syft.store.document_store import QueryKeys
  from syft.store.sqlite_document_store import SQLiteStorePartition
  from .store_fixtures_test import sqlite_store_partition_fn
  from .store_mocks_test import MockObjectType
  from .store_mocks_test import MockSyftObject
label_desc: Use image node_id 5 for calling a global function with example usage: test_sqlite_store_partition_set_threading(sqlite_workspace, root_verify_key) and returns: execution_err