def feval(self, func_path, *func_args, **kwargs):
if not self._engine:<EOL><INDENT>raise Oct2PyError('<STR_LIT>')<EOL><DEDENT>nout = kwargs.get('<STR_LIT>', None)<EOL>if nout is None:<EOL><INDENT>nout = <NUM_LIT:1><EOL><DEDENT>plot_dir = kwargs.get('<STR_LIT>')<EOL>settings = dict(backend='<STR_LIT>' if plot_dir else self.backend,<EOL>format=kwargs.get('<STR_LIT>'),<EOL>name=kwargs.get('<STR_LIT>'),<EOL>width=kwargs.get('<STR_LIT>'),<EOL>height=kwargs.get('<STR_LIT>'),<EOL>resolution=kwargs.get('<STR_LIT>'))<EOL>self._engine.plot_settings = settings<EOL>dname = osp.dirname(func_path)<EOL>fname = osp.basename(func_path)<EOL>func_name, ext = osp.splitext(fname)<EOL>if ext and not ext == '<STR_LIT>':<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if func_name == '<STR_LIT>':<EOL><INDENT>raise Oct2PyError('<STR_LIT>' +<EOL>'<STR_LIT>')<EOL><DEDENT>stream_handler = kwargs.get('<STR_LIT>')<EOL>verbose = kwargs.get('<STR_LIT>', True)<EOL>store_as = kwargs.get('<STR_LIT>', '<STR_LIT>')<EOL>timeout = kwargs.get('<STR_LIT>', self.timeout)<EOL>if not stream_handler:<EOL><INDENT>stream_handler = self.logger.info if verbose else self.logger.debug<EOL><DEDENT>return self._feval(func_name, func_args, dname=dname, nout=nout,<EOL>timeout=timeout, stream_handler=stream_handler,<EOL>store_as=store_as, plot_dir=plot_dir)<EOL>
Run a function in Octave and return the result.

        Parameters
        ----------
        func_path: str
            Name of function to run or a path to an m-file.
        func_args: object, optional
            Args to send to the function.
        nout: int, optional
            Desired number of return arguments, defaults to 1.
        store_as: str, optional
            If given, saves the result to the given Octave variable name
            instead of returning it.
        verbose : bool, optional
            Log Octave output at INFO level.  If False, log at DEBUG level.
        stream_handler: callable, optional
            A function that is called for each line of output from the
            evaluation.
        timeout: float, optional
            The timeout in seconds for the call.
        plot_dir: str, optional
            If specificed, save the session's plot figures to the plot
            directory instead of displaying the plot window.
        plot_name : str, optional
            Saved plots will start with `plot_name` and
            end with "_%%.xxx' where %% is the plot number and
            xxx is the `plot_format`.
        plot_format: str, optional
            The format in which to save the plot.
        plot_width: int, optional
            The plot with in pixels.
        plot_height: int, optional
            The plot height in pixels.

        Notes
        -----
        The function arguments passed follow Octave calling convention, not
        Python. That is, all values must be passed as a comma separated list,
        not using `x=foo` assignment.

        Examples
        --------
        >>> from oct2py import octave
        >>> cell = octave.feval('cell', 10, 10, 10)
        >>> cell.shape
        (10, 10, 10)

        >>> from oct2py import octave
        >>> x = octave.feval('linspace', 0, octave.pi() / 2)
        >>> x.shape
        (1, 100)

        >>> from oct2py import octave
        >>> x = octave.feval('svd', octave.hilb(3))
        >>> x
        array([[ 1.40831893],
               [ 0.12232707],
               [ 0.00268734]])
        >>> # specify three return values
        >>> (u, v, d) = octave.feval('svd', octave.hilb(3), nout=3)
        >>> u.shape
        (3, 3)

        Returns
        -------
        The Python value(s) returned by the Octave function call.