code: def check_call(self, cmd, *args, **kwargs):
      with self.lock:
          self.ready_to_run.wait()
          self.calls.append(cmd)
          if self.print_out:
              print(f">>>Process runner: Executing \n {str(cmd)}")
          for token in self.cmd_to_callback:
              if token in str(cmd):
                  # Trigger a callback if token is in cmd.
                  # Can be used to simulate background events during a node
                  # update (e.g. node disconnected).
                  callback = self.cmd_to_callback[token]
                  callback()
  
          for token in self.fail_cmds:
              if token in str(cmd):
                  raise CalledProcessError(
                      1, token, "Failing command on purpose"
                  )
  
imports: import re
  import threading
  from subprocess import CalledProcessError
  from typing import Callable, Dict, List, Optional
  from ray.autoscaler.node_provider import NodeProvider
label_desc: Use image node_id 2 for calling the MockProcessRunner obj's underlying member method code with example usage: obj.check_call(cmd) without return types