code: def run_cmd(cmd):
      if isinstance(cmd, six.string_types):
          cmd = cmd.split(" ")
  
      try:
          output = subprocess.check_output(cmd)
      except subprocess.CalledProcessError as e:
          # this avoids hiding the stdout / stderr of failed processes
          print("Command failed: %s" % cmd)
          print("With output:")
          print("--------------")
          print(e.output)
          print("--------------")
          raise e
  
      if isinstance(output, six.binary_type):
          output = output.decode("utf-8")
      return output
  
imports: import configparser
  import os
  import pprint
  import re
  import subprocess
  import sys
  import requests
  import getpass
  from six.moves import input
  import six
label_desc: Use image node_id 2 for calling a global function with example usage: run_cmd(cmd) and returns: output