code: def test_defer_sigint_monkey_patch():
      # Tests that setting a SIGINT signal handler within a DeferSigint context is not
      # allowed.
      orig_sigint_handler = signal.getsignal(signal.SIGINT)
      with pytest.raises(ValueError):
          with DeferSigint():
              signal.signal(signal.SIGINT, orig_sigint_handler)
  
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 5 for calling a global function with example usage: test_defer_sigint_monkey_patch() without return types