def exec_cmd(cmd_args, *args, **kw):
    if 'stdout' not in kw.keys():
        kw['stdout'] = PIPE
    if 'stderr' not in kw.keys():
        kw['stderr'] = PIPE

    proc = Popen(cmd_args, *args, **kw)
    (stdout, stderr) = proc.communicate()
    proc.wait()
    return (stdout, stderr, proc.returncode)
Execute a shell call using Subprocess.  All additional `*args` and
dataset/ETHPy150Open datafolklabs/cement/cement/utils/shell.py/exec_cmd