def run_command(cmd, redirect_output=True, check_exit_code=True):
    if redirect_output:
        stdout = subprocess.PIPE
    else:
        stdout = None
    proc = subprocess.Popen(cmd, cwd=ROOT, stdout=stdout)
    output = proc.communicate()[0]
    if check_exit_code and proc.returncode != 0:
        raise Exception('Command "%s" failed.\n%s' % (' '.join(cmd), output))
    return output
Runs a command in an out-of-process shell, returning the
dataset/ETHPy150Open osrg/ryu/tools/install_venv.py/run_command