code: def check_output(args, **kw):
      proc = subprocess.Popen(args, **kw, stdout=subprocess.PIPE)
      out, _ = proc.communicate()
      if proc.returncode:
          sys.stderr.write(
              "exited with code %d: %s\n"
              % (proc.returncode, " ".join(args))
          )
          sys.exit(2)
  
      if sys.version_info[0] == 2:
          return unicode(out, "utf-8")
      else:
          return str(out, "utf-8")
  
imports: import os.path
  import subprocess
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: check_output(args) and returns: unicode, str