class_docstr: Starts a long-running subprocess and restarts it on matched events.
  
  The command parameter is a list of command arguments, such as
  ['bin/myserver', '-c', 'etc/myconfig.ini'].
  
  Call start() after creating the Trick. Call stop() when stopping
  the process.
class_docstr_tok: ["Starts","a","long-running","subprocess","and","restarts","it","on","matched","events",".","The","command","parameter","is","a","list","of","command","arguments",",","such","as","[","'bin\/myserver","'",",","'-c","'",",","'etc\/myconfig.ini","'","]",".","Call","start","(",")","after","creating","the","Trick",".","Call","stop","(",")","when","stopping","the","process","."]
code: def __init__(
      self,
      command,
      patterns=None,
      ignore_patterns=None,
      ignore_directories=False,
      stop_signal=signal.SIGINT,
      kill_after=10,
  ):
      super(AutoRestartTrick, self).__init__(
          patterns, ignore_patterns, ignore_directories
      )
      self.command = command
      self.stop_signal = stop_signal
      self.kill_after = kill_after
      self.process = None
  
imports: import os
  import signal
  import subprocess
  import time
  from wandb_watchdog.utils import echo, has_attribute
  from wandb_watchdog.events import PatternMatchingEventHandler
label_desc: Use image node_id 1 to create a new AutoRestartTrick object from inherited base classes: Trick with example: obj = AutoRestartTrick(command, patterns, ignore_patterns, ignore_directories, stop_signal, kill_after)