code: def get_command_stdout(command, require_zero_status=True):
      """Executes a command and returns its stdout output as a string.  The
      command is executed with shell=True, so it may contain pipes and
      other shell constructs.
  
      If require_zero_stats is True, this function will raise an exception if
      the command has nonzero exit status.  If False, it just prints a warning
      if the exit status is nonzero.
  
      See also: execute_command, background_command
      """
      p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
  
      stdout = p.communicate()[0]
      if p.returncode is not 0:
          output = "Command exited with status {0}: {1}".format(
              p.returncode, command
          )
          if require_zero_status:
              raise Exception(output)
          else:
              logger.warning(output)
      return stdout if type(stdout) is str else stdout.decode()
  
imports: from __future__ import print_function
  from __future__ import division
  import argparse
  import logging
  import math
  import os
  import subprocess
  import sys
  import threading
label_desc: Use image node_id 5 for calling a global function with example usage: get_command_stdout(command, require_zero_status) and returns: unknown