def shell_out(cmd, stderr=STDOUT, cwd=None):
if cwd is None:<EOL><INDENT>from os import getcwd<EOL>cwd = getcwd()  <EOL><DEDENT>out = check_output(cmd, cwd=cwd, stderr=stderr, universal_newlines=True)<EOL>return _clean_output(out)<EOL>
Friendlier version of check_output.