def run(self, halt_on_nonzero=True, quiet=False, q=False, streaming=False):
commands = str(self)<EOL>if not (quiet or q):<EOL><INDENT>self._echo.cmd(commands)<EOL><DEDENT>env = self._context[<NUM_LIT:0>].get('<STR_LIT>', {}) if len(self._context) > <NUM_LIT:0> else os.environ<EOL>executable = self.current_context.get('<STR_LIT>')<EOL>try:<EOL><INDENT>process = subprocess.Popen(commands,<EOL>bufsize=<NUM_LIT:1>,<EOL>shell=True,<EOL>env=env,<EOL>stdin=subprocess.PIPE,<EOL>stdout=subprocess.PIPE,<EOL>stderr=subprocess.PIPE,<EOL>executable=executable,<EOL>universal_newlines=True)<EOL>result = Result(process, commands, self._context, streaming, halt_on_nonzero=halt_on_nonzero)<EOL><DEDENT>except Exception as e:<EOL><INDENT>result = Result(None, commands, self._context, exception=e)<EOL>result.dump_exception()<EOL>if halt_on_nonzero:<EOL><INDENT>raise e<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>self.clear()<EOL><DEDENT>return result<EOL>
After building your commands, call `run()` to have your code executed.