docstr: Sends preemption or timeout signal to the job (for testing purpose)
  
  Parameter
  ---------
  timeout: bool
      Whether to trigger a job time-out (if False, it triggers preemption)
docstr_tok: ["Sends","preemption","or","timeout","signal","to","the","job","(","for","testing","purpose",")","Parameter","--","--","--","--","-","timeout",":","bool","Whether","to","trigger","a","job","time-out","(","if","False",",","it","triggers","preemption",")"]
code: def _interrupt(self, timeout: bool = False) -> None:
      """Sends preemption or timeout signal to the job (for testing purpose)
  
      Parameter
      ---------
      timeout: bool
          Whether to trigger a job time-out (if False, it triggers preemption)
      """
      cmd = ["scancel", self.job_id, "--signal"]
      # in case of preemption, SIGTERM is sent first
      if not timeout:
          subprocess.check_call(cmd + ["SIGTERM"])
      subprocess.check_call(cmd + [SlurmJobEnvironment.USR_SIG])
  
imports: import functools
  import inspect
  import os
  import re
  import shlex
  import shutil
  import subprocess
  import sys
  import typing
  import uuid
  import warnings
  from pathlib import Path
  from ..core import core, job_environment, logger, utils
label_desc: Use image node_id 1 for calling the SlurmJob obj's underlying member method code with example usage: obj._interrupt(timeout) without return types