code: def test_mongo_store_partition_permissions_set(
      root_verify_key: SyftVerifyKey,
      guest_verify_key: SyftVerifyKey,
      mongo_store_partition: MongoStorePartition,
  ) -> None:
      """
      Test the permissions functionalities when using MongoStorePartition._set function
      """
      hacker_verify_key = SyftVerifyKey.from_string(
          test_verify_key_string_hacker
      )
      res = mongo_store_partition.init_store()
      assert res.is_ok()
  
      # set the object to mongo_store_partition.collection
      obj = MockSyftObject(data=1)
      res = mongo_store_partition.set(
          root_verify_key, obj, ignore_duplicates=False
      )
      assert res.is_ok()
      assert res.ok() == obj
  
      # check if the corresponding permissions has been added to the permissions
      # collection after the root client claim it
      pemissions_collection = mongo_store_partition.permissions.ok()
      assert isinstance(pemissions_collection, MongoCollection)
      permissions = pemissions_collection.find_one({"_id": obj.id})
      assert permissions is not None
      assert isinstance(permissions["permissions"], Set)
      assert len(permissions["permissions"]) == 4
      for permission in PERMISSIONS:
          assert mongo_store_partition.has_permission(
              permission(uid=obj.id, credentials=root_verify_key)
          )
  
      # the hacker tries to set duplicated object but should not be able to claim it
      res_2 = mongo_store_partition.set(
          guest_verify_key, obj, ignore_duplicates=True
      )
      assert res_2.is_ok()
      for permission in PERMISSIONS:
          assert not mongo_store_partition.has_permission(
              permission(uid=obj.id, credentials=hacker_verify_key)
          )
          assert mongo_store_partition.has_permission(
              permission(uid=obj.id, credentials=root_verify_key)
          )
  
imports: import sys
  from threading import Thread
  from typing import List
  from typing import Set
  from typing import Tuple
  from joblib import Parallel
  from joblib import delayed
  from pymongo.collection import Collection
  import pytest
  from result import Err
  from syft.node.credentials import SyftVerifyKey
  from syft.service.action.action_permissions import ActionObjectPermission
  from syft.service.action.action_permissions import ActionPermission
  from syft.service.action.action_store import ActionObjectEXECUTE
  from syft.service.action.action_store import ActionObjectOWNER
  from syft.service.action.action_store import ActionObjectREAD
  from syft.service.action.action_store import ActionObjectWRITE
  from syft.store.document_store import PartitionSettings
  from syft.store.document_store import QueryKey
  from syft.store.document_store import QueryKeys
  from syft.store.mongo_client import MongoStoreClientConfig
  from syft.store.mongo_document_store import MongoStoreConfig
  from syft.store.mongo_document_store import MongoStorePartition
  from .store_constants_test import generate_db_name
  from .store_constants_test import test_verify_key_string_hacker
  from .store_fixtures_test import mongo_store_partition_fn
  from .store_mocks_test import MockObjectType
  from .store_mocks_test import MockSyftObject
label_desc: Use image node_id 17 for calling a global function with example usage: test_mongo_store_partition_permissions_set(root_verify_key, guest_verify_key, mongo_store_partition) without return types