code: def run_command(
      cmd: list[str],
      *,
      print_output_on_error: bool = True,
      return_output: bool = False,
      check=True,
      **kwargs,
  ) -> str | bool:
      print(f"Running command: {' '.join(shlex.quote(c) for c in cmd)}")
      try:
          if return_output:
              return subprocess.check_output(cmd, **kwargs).decode()
          else:
              try:
                  result = subprocess.run(cmd, check=check, **kwargs)
                  return result.returncode == 0
              except FileNotFoundError:
                  if check:
                      raise
                  else:
                      return False
      except subprocess.CalledProcessError as ex:
          if print_output_on_error:
              print(
                  "========================= OUTPUT start ============================"
              )
              print(ex.stderr)
              print(ex.stdout)
              print(
                  "========================= OUTPUT end ============================"
              )
          raise
  
imports: from __future__ import annotations
  import shlex
  import subprocess
label_desc: Use image node_id 1 for calling a global function with example usage: run_command(cmd) and returns: subprocess, unknown, False