def _feval(self, func_name, func_args=(), dname='<STR_LIT>', nout=<NUM_LIT:0>,<EOL>timeout=None, stream_handler=None, store_as='<STR_LIT>', plot_dir=None):
engine = self._engine<EOL>if engine is None:<EOL><INDENT>raise Oct2PyError('<STR_LIT>')<EOL><DEDENT>out_file = osp.join(self.temp_dir, '<STR_LIT>')<EOL>out_file = out_file.replace(osp.sep, '<STR_LIT:/>')<EOL>in_file = osp.join(self.temp_dir, '<STR_LIT>')<EOL>in_file = in_file.replace(osp.sep, '<STR_LIT:/>')<EOL>func_args = list(func_args)<EOL>ref_indices = []<EOL>for (i, value) in enumerate(func_args):<EOL><INDENT>if isinstance(value, OctavePtr):<EOL><INDENT>ref_indices.append(i + <NUM_LIT:1>)<EOL>func_args[i] = value.address<EOL><DEDENT><DEDENT>ref_indices = np.array(ref_indices)<EOL>req = dict(func_name=func_name, func_args=tuple(func_args),<EOL>dname=dname or '<STR_LIT>', nout=nout,<EOL>store_as=store_as or '<STR_LIT>',<EOL>ref_indices=ref_indices)<EOL>write_file(req, out_file, oned_as=self._oned_as,<EOL>convert_to_float=self.convert_to_float)<EOL>engine.stream_handler = stream_handler or self.logger.info<EOL>if timeout is None:<EOL><INDENT>timeout = self.timeout<EOL><DEDENT>try:<EOL><INDENT>engine.eval('<STR_LIT>' % (out_file, in_file),<EOL>timeout=timeout)<EOL><DEDENT>except KeyboardInterrupt as e:<EOL><INDENT>stream_handler(engine.repl.interrupt())<EOL>raise<EOL><DEDENT>except TIMEOUT:<EOL><INDENT>stream_handler(engine.repl.interrupt())<EOL>raise Oct2PyError('<STR_LIT>')<EOL><DEDENT>except EOF:<EOL><INDENT>stream_handler(engine.repl.child.before)<EOL>self.restart()<EOL>raise Oct2PyError('<STR_LIT>')<EOL><DEDENT>resp = read_file(in_file, self)<EOL>if resp['<STR_LIT>']:<EOL><INDENT>msg = self._parse_error(resp['<STR_LIT>'])<EOL>raise Oct2PyError(msg)<EOL><DEDENT>result = resp['<STR_LIT:result>'].ravel().tolist()<EOL>if isinstance(result, list) and len(result) == <NUM_LIT:1>:<EOL><INDENT>result = result[<NUM_LIT:0>]<EOL><DEDENT>if (isinstance(result, Cell) and<EOL>result.size == <NUM_LIT:1> and<EOL>isinstance(result[<NUM_LIT:0>], string_types) and<EOL>result[<NUM_LIT:0>] == '<STR_LIT>'):<EOL><INDENT>result = None<EOL><DEDENT>if plot_dir:<EOL><INDENT>self._engine.make_figures(plot_dir)<EOL><DEDENT>return result<EOL>
Run the given function with the given args.