def get_pointer(self, name, timeout=None):
exist = self._exist(name)<EOL>isobject = self._isobject(name, exist)<EOL>if exist == <NUM_LIT:0>:<EOL><INDENT>raise Oct2PyError('<STR_LIT>' % name)<EOL><DEDENT>elif exist == <NUM_LIT:1>:<EOL><INDENT>return _make_variable_ptr_instance(self, name)<EOL><DEDENT>elif isobject:<EOL><INDENT>return self._get_user_class(name)<EOL><DEDENT>elif exist in [<NUM_LIT:2>, <NUM_LIT:3>, <NUM_LIT:5>]:<EOL><INDENT>return self._get_function_ptr(name)<EOL><DEDENT>raise Oct2PyError('<STR_LIT>' % name)<EOL>
Get a pointer to a named object in the Octave workspace.

        Parameters
        ----------
        name: str
            The name of the object in the Octave workspace.
        timemout: float, optional.
            Time to wait for response from Octave (per line).

        Examples
        --------
        >>> from oct2py import octave
        >>> octave.eval('foo = [1, 2];')
        >>> ptr = octave.get_pointer('foo')
        >>> ptr.value
        array([[ 1.,  2.]])
        >>> ptr.address
        'foo'
        >>> # Can be passed as an argument
        >>> octave.disp(ptr)  # doctest: +SKIP
        1  2

        >>> from oct2py import octave
        >>> sin = octave.get_pointer('sin')  # equivalent to `octave.sin`
        >>> sin.address
        '@sin'
        >>> x = octave.quad(sin, 0, octave.pi())
        >>> x
        2.0

        Notes
        -----
        Pointers can be passed to `feval` or dynamic functions as function arguments.  A pointer passed as a nested value will be passed by value instead.

        Raises
        ------
        Oct2PyError
            If the variable does not exist in the Octave session or is of
            unknown type.

        Returns
        -------
        A variable, object, user class, or function pointer as appropriate.