code: def test_kill_process_interrupted():
      # Launch a subprocess that launches and kills another subprocess
      process = multiprocessing.Process(target=process_patiently_kill)
      process.start()
      time.sleep(3)
  
      os.kill(process.pid, signal.SIGINT)
      # it doesn't work
      assert process.is_alive()  # Sometimes this is false on darwin.
      time.sleep(0.5)
      # Ctrl+C again.
      os.kill(process.pid, signal.SIGINT)
      time.sleep(0.5)
      assert not process.is_alive()
      if sys.platform == "linux":
          # exit code could be different on non-linux platforms
          assert process.exitcode != 0
  
file_path: nni/test/ut/tools/nnictl/test_kill_command.py
imports: import argparse
  import multiprocessing
  import os
  import subprocess
  import signal
  import sys
  import signal
  import time
  import pytest
  from nni.tools.nnictl.command_utils import kill_command, _check_pid_running
label_desc: Use image node_id 7 for calling a global function with example usage: test_kill_process_interrupted() without return types