code: def getCommandOutput(cmd):
      result = subprocess.run(
          cmd,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          shell=True,
      )
      stdout = result.stdout.decode().strip()
      if result.returncode == 0:
          return stdout
  
      stderr = result.stderr.decode().strip()
      raise RuntimeError(
          "Problem running '%s' (STDOUT: '%s' STDERR: '%s')"
          % (cmd, stdout, stderr)
      )
  
imports: import subprocess
label_desc: Use image node_id 2 for calling a global function with example usage: getCommandOutput(cmd) and returns: stdout