

def run_command(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, cwd=None, env=None):
    '\n    Run the provided command in a subprocess and wait until it completes.\n\n    :param cmd: Command to run.\n    :type cmd: ``str`` or ``list``\n\n    :param stdin: Process stdin.\n    :type stdin: ``object``\n\n    :param stdout: Process stdout.\n    :type stdout: ``object``\n\n    :param stderr: Process stderr.\n    :type stderr: ``object``\n\n    :param shell: True to use a shell.\n    :type shell ``boolean``\n\n    :param cwd: Optional working directory.\n    :type cwd: ``str``\n\n    :param env: Optional environment to use with the command. If not provided,\n                environment from the current process is inherited.\n    :type env: ``dict``\n\n    :rtype: ``tuple`` (exit_code, stdout, stderr)\n    '
    assert isinstance(cmd, ((list, tuple) + six.string_types))
    if (not env):
        env = os.environ.copy()
    process = subprocess.Popen(cmd, stdin=stdin, stdout=stdout, stderr=stderr, env=env, cwd=cwd, shell=shell)
    (stdout, stderr) = process.communicate()
    exit_code = process.returncode
    return (exit_code, env, stderr)

dataset/ETHPy150Open StackStorm/st2/st2common/st2common/util/shell.py run_command/VarMisuse@132/417 `stdout`->`env`