def sh(cmd):
  ps = Popen(cmd, stdout=PIPE, stderr=PIPE, close_fds=True, shell=True)
  subprocess_pipes = ps.communicate()
  status = ps.wait()
  if status != 0:
    raise OSError('%r exited with status %d: %s' % (cmd, status, subprocess_pipes[1].strip()))
  return subprocess_pipes[0].strip()
Execute command in shell, returning value of stdout.
dataset/ETHPy150Open rsms/smisk/lib/smisk/test/live/__init__.py/sh