code: def exec_command(
      command,
      execute_in="",
      use_shell=None,
      use_tee=None,
      _with_python=1,
      **env,
  ):
      """
      Return (status,output) of executed command.
  
      Parameters
      ----------
      command : str
          A concatenated string of executable and arguments.
      execute_in : str
          Before running command ``cd execute_in`` and after ``cd -``.
      use_shell : {bool, None}, optional
          If True, execute ``sh -c command``. Default None (True)
      use_tee : {bool, None}, optional
          If True use tee. Default None (True)
  
  
      Returns
      -------
      res : str
          Both stdout and stderr messages.
  
      Notes
      -----
      On NT, DOS systems the returned status is correct for external commands.
      Wild cards will not work for non-posix systems or when use_shell=0.
  
      """
      log.debug(
          "exec_command(%r,%s)"
          % (command, ",".join(["%s=%r" % kv for kv in env.items()]))
      )
  
      if use_tee is None:
          use_tee = os.name == "posix"
      if use_shell is None:
          use_shell = os.name == "posix"
      execute_in = os.path.abspath(execute_in)
      oldcwd = os.path.abspath(os.getcwd())
  
      if __name__[-12:] == "exec_command":
          exec_dir = os.path.dirname(os.path.abspath(__file__))
      elif os.path.isfile("exec_command.py"):
          exec_dir = os.path.abspath(".")
      else:
          exec_dir = os.path.abspath(sys.argv[0])
          if os.path.isfile(exec_dir):
              exec_dir = os.path.dirname(exec_dir)
  
      if oldcwd != execute_in:
          os.chdir(execute_in)
          log.debug("New cwd: %s" % execute_in)
      else:
          log.debug("Retaining cwd: %s" % oldcwd)
  
      oldenv = _preserve_environment(list(env.keys()))
      _update_environment(**env)
  
      try:
          st = _exec_command(
              command, use_shell=use_shell, use_tee=use_tee, **env
          )
      finally:
          if oldcwd != execute_in:
              os.chdir(oldcwd)
              log.debug("Restored cwd to %s" % oldcwd)
          _update_environment(**oldenv)
  
      return st
  
file_path: catboost/contrib/python/numpy/py2/numpy/distutils/exec_command.py
imports: from __future__ import division, absolute_import, print_function
  import os
  import sys
  import subprocess
  import locale
  from numpy.distutils.misc_util import is_sequence, make_temp_file
  from numpy.distutils import log
label_desc: Use image node_id 9 for calling a global function with example usage: exec_command(command, execute_in, use_shell, use_tee, _with_python) and returns: st