code: def test_cancel_during_arg_deser(ray_start_regular, use_force):
      time_to_sleep = 5
  
      class SlowToDeserialize:
          def __reduce__(self):
              def reconstruct():
                  import time
  
                  time.sleep(time_to_sleep)
                  return SlowToDeserialize()
  
              return reconstruct, ()
  
      @ray.remote
      def dummy(a: SlowToDeserialize):
          # Task should never execute.
          assert False
  
      arg = SlowToDeserialize()
      obj = dummy.remote(arg)
      # Check that task isn't done.
      assert len(ray.wait([obj], timeout=0.1)[0]) == 0
      # Cancel task.
      ray.cancel(obj, force=use_force)
      with pytest.raises(valid_exceptions(use_force)):
          ray.get(obj)
  
imports: import os
  import random
  import signal
  import sys
  import threading
  import _thread
  import time
  import pytest
  import ray
  from ray.exceptions import TaskCancelledError, RayTaskError, GetTimeoutError, WorkerCrashedError, ObjectLostError
  from ray._private.utils import DeferSigint
  from ray._private.test_utils import SignalActor, wait_for_condition
  from ray.util.state import list_tasks
label_desc: Use image node_id 3 for calling a global function with example usage: test_cancel_during_arg_deser(ray_start_regular, use_force) and returns: reconstruct,  , SlowToDeserialize