def execute(self, arg_str='<STR_LIT>', **kwargs):
cmd = "<STR_LIT>".format(self.cmd_prefix, self.script, arg_str)<EOL>expected_ret_code = kwargs.pop('<STR_LIT:code>', <NUM_LIT:0>)<EOL>environ = self.environ<EOL>for k in list(kwargs.keys()):<EOL><INDENT>if k.isupper():<EOL><INDENT>environ[k] = kwargs.pop(k)<EOL><DEDENT><DEDENT>kwargs.setdefault("<STR_LIT>", subprocess.STDOUT)<EOL>kwargs["<STR_LIT>"] = True<EOL>kwargs["<STR_LIT>"] = subprocess.PIPE<EOL>kwargs["<STR_LIT>"] = self.cwd<EOL>kwargs["<STR_LIT>"] = environ<EOL>process = None<EOL>self.buf = deque(maxlen=self.bufsize)<EOL>try:<EOL><INDENT>process = subprocess.Popen(<EOL>cmd,<EOL>**kwargs<EOL>)<EOL>for line in iter(process.stdout.readline, b"<STR_LIT>"):<EOL><INDENT>line = line.decode(self.encoding)<EOL>self.buf.append(line.rstrip())<EOL>yield line<EOL><DEDENT>process.wait()<EOL>if process.returncode != expected_ret_code:<EOL><INDENT>if process.returncode > <NUM_LIT:0>:<EOL><INDENT>raise RuntimeError("<STR_LIT>".format(<EOL>cmd,<EOL>process.returncode,<EOL>self.output<EOL>))<EOL><DEDENT><DEDENT><DEDENT>except subprocess.CalledProcessError as e:<EOL><INDENT>if e.returncode != expected_ret_code:<EOL><INDENT>raise RuntimeError("<STR_LIT>".format(<EOL>cmd,<EOL>e.returncode,<EOL>self.output<EOL>))<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>if process:<EOL><INDENT>process.stdout.close()<EOL><DEDENT><DEDENT>
runs the passed in arguments and returns an iterator on the output of
        running command