code: def _get_output(cmd):
      """Get output of a command, raising IOError if it fails"""
      startupinfo = None
      if os.name == "nt":
          startupinfo = subprocess.STARTUPINFO()
          startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
      p = Popen(cmd, stdout=PIPE, stderr=PIPE, startupinfo=startupinfo)
      stdout, stderr = p.communicate()
      if p.returncode:
          raise IOError(
              "Failed to run %s: %s"
              % (cmd, stderr.decode("utf8", "replace"))
          )
      return stdout.decode("utf8", "replace")
  
imports: import os
  import re
  import socket
  import subprocess
  from subprocess import Popen, PIPE
  from warnings import warn
label_desc: Use image node_id 2 for calling a global function with example usage: _get_output(cmd) and returns: stdout