code: def test_code_accept_deny(faker: Faker, worker: Worker):
      root_client = worker.root_client
      dummy_data = [1, 2, 3]
      data = ActionObject.from_obj(dummy_data)
      action_obj = root_client.api.services.action.set(data)
  
      ds_client = get_ds_client(faker, root_client, worker.guest_client)
  
      @syft.syft_function(
          input_policy=syft.ExactMatch(data=action_obj),
          output_policy=syft.SingleExecutionExactOutput(),
      )
      def simple_function(data):
          return sum(data)
  
      simple_function.code = dedent(simple_function.code)
  
      result = ds_client.code.request_code_execution(simple_function)
      assert not isinstance(result, SyftError)
  
      request = root_client.requests.get_all()[0]
      result = request.accept_by_depositing_result(result=10)
      assert isinstance(result, SyftSuccess)
  
      request = root_client.requests.get_all()[0]
      assert request.status == RequestStatus.APPROVED
      result = ds_client.code.simple_function(data=action_obj)
      assert result.get() == 10
  
      result = request.deny(
          reason="Function output needs differential privacy !!"
      )
      assert isinstance(result, SyftSuccess)
  
      request = root_client.requests.get_all()[0]
      assert request.status == RequestStatus.REJECTED
  
      user_code = ds_client.code.get_all()[0]
      assert not user_code.status.approved
  
      result = ds_client.code.simple_function(data=action_obj)
      assert isinstance(result, SyftError)
      assert "UserCodeStatus.DENIED" in result.message
  
imports: from textwrap import dedent
  from faker import Faker
  import pytest
  import syft
  from syft.client.client import SyftClient
  from syft.node.worker import Worker
  from syft.service.action.action_object import ActionObject
  from syft.service.action.action_permissions import ActionPermission
  from syft.service.code.user_code import UserCodeStatus
  from syft.service.context import ChangeContext
  from syft.service.request.request import ActionStoreChange
  from syft.service.request.request import ObjectMutation
  from syft.service.request.request import RequestStatus
  from syft.service.request.request import UserCodeStatusChange
  from syft.service.request.request_service import RequestService
  from syft.service.response import SyftError
  from syft.service.response import SyftSuccess
  from syft.service.settings.settings_service import SettingsService
  from syft.store.document_store import DocumentStore
  from syft.store.linked_obj import LinkedObject
label_desc: Use image node_id 6 for calling a global function with example usage: test_code_accept_deny(faker, worker) and returns: sum