code: def test_interrupted_scatter_gather_now():
      count = 2
  
      runner = new_runner(2, n_workers=8)
      runner.fct = function
      client = runner.client
  
      client.trials.extend(
          [new_trial(i, sleep=0.75) for i in range(count, -1, -1)]
      )
  
      def interrupt():
          # this will stop the runner right now
          time.sleep(0.5)
          os.kill(os.getpid(), signal.SIGINT)
  
          # We need the sleep here or the second SIGINT is ignored
          time.sleep(0.1)
          os.kill(os.getpid(), signal.SIGINT)
  
      def slow_gather():
          # Sleep until some results are ready
          time.sleep(1)
          Runner.gather(runner)
  
      runner.gather = slow_gather
  
      with pytest.raises(KeyboardInterrupt):
          start = time.time()
          Thread(target=interrupt).start()
  
          # the two interrupts forced runner to stop right now
          runner.run()
  
      elapsed = time.time() - start
      assert (
          elapsed > 0.5 and elapsed < 1
      ), "Stopped right after the 2 interrupts"
      status = ["interrupted" for i in range(count)]
      assert (
          client.status == status
      ), "Trials did not have time to finish"
      runner.client.close()
  
imports: from __future__ import annotations
  import os
  import signal
  import sys
  import time
  import traceback
  from contextlib import contextmanager
  from multiprocessing import Process, Queue
  from pathlib import Path
  from threading import Thread
  from typing import Callable, Literal
  import pytest
  from orion.client.experiment import ExperimentClient
  from orion.client.runner import LazyWorkers, Runner, prepare_trial_working_dir
  from orion.core.utils.exceptions import BrokenExperiment, CompletedExperiment, InvalidResult, ReservationRaceCondition, WaitingForTrials
  from orion.core.worker.trial import Trial
  from orion.executor.base import BaseExecutor, executor_factory
  from orion.executor.dask_backend import HAS_DASK, Dask
  from orion.storage.base import LockAcquisitionTimeout
label_desc: Use image node_id 11 for calling a global function with example usage: test_interrupted_scatter_gather_now() without return types