code: def subproc_call(cmd, timeout=None):
      """
      Execute a command with timeout, and return STDOUT and STDERR
  
      Args:
          cmd(str): the command to execute.
          timeout(float): timeout in seconds.
  
      Returns:
          output(bytes), retcode(int). If timeout, retcode is -1.
      """
      try:
          output = subprocess.check_output(
              cmd, stderr=subprocess.STDOUT, shell=True, timeout=timeout
          )
          return output, 0
      except subprocess.TimeoutExpired as e:
          logger.warn("Command '{}' timeout!".format(cmd))
          if e.output:
              logger.warn(e.output.decode("utf-8"))
              return e.output, -1
          else:
              return "", -1
      except subprocess.CalledProcessError as e:
          logger.warn(
              "Command '{}' failed, return code={}".format(
                  cmd, e.returncode
              )
          )
          logger.warn(e.output.decode("utf-8"))
          return e.output, e.returncode
      except Exception:
          logger.warn("Command '{}' failed to run.".format(cmd))
          return "", -2
  
imports: import sys
  import atexit
  import bisect
  import multiprocessing
  import platform
  import signal
  import threading
  import weakref
  from contextlib import contextmanager
  import six
  from six.moves import queue
  import subprocess
  from .None import logger
  from .argtools import log_once
label_desc: Use image node_id 6 for calling a global function with example usage: subproc_call(cmd, timeout) and returns: output,  int, e,  e, str,  unknown, e,  unknown, str,  unknown