def run(command, data=None, timeout=None, kill_timeout=None, env=None, cwd=None):
command = expand_args(command)<EOL>history = []<EOL>for c in command:<EOL><INDENT>if len(history):<EOL><INDENT>data = history[-<NUM_LIT:1>].std_out[<NUM_LIT:0>:<NUM_LIT:10>*<NUM_LIT>]<EOL><DEDENT>cmd = Command(c)<EOL>try:<EOL><INDENT>out, err = cmd.run(data, timeout, kill_timeout, env, cwd)<EOL>status_code = cmd.returncode<EOL><DEDENT>except OSError as e:<EOL><INDENT>out, err = '<STR_LIT>', u"<STR_LIT:\n>".join([e.strerror, traceback.format_exc()])<EOL>status_code = <NUM_LIT><EOL><DEDENT>r = Response(process=cmd)<EOL>r.command = c<EOL>r.std_out = out<EOL>r.std_err = err<EOL>r.status_code = status_code<EOL>history.append(r)<EOL><DEDENT>r = history.pop()<EOL>r.history = history<EOL>return r<EOL>
Executes a given commmand and returns Response.

    Blocks until process is complete, or timeout is reached.