code: def getoutput(cmd):
      """Run a command and return its stdout/stderr as a string.
  
      Parameters
      ----------
      cmd : str or list
        A command to be executed in the system shell.
  
      Returns
      -------
      output : str
        A string containing the combination of stdout and stderr from the
      subprocess, in whatever order the subprocess originally wrote to its
      file descriptors (so the order of the information in this string is the
      correct order as would be seen if running the command in a terminal).
      """
      out = process_handler(
          cmd, lambda p: p.communicate()[0], subprocess.STDOUT
      )
      if out is None:
          return ""
      return py3compat.bytes_to_str(out)
  
file_path: catboost/contrib/python/ipython/py2/IPython/utils/_process_common.py
imports: import subprocess
  import shlex
  import sys
  import os
  from IPython.utils import py3compat
label_desc: Use image node_id 3 for calling a global function with example usage: getoutput(cmd) and returns: py3compat, str