'Create a low-level callback function from an exported Cython function.
Parameters
module : module
Cython module where the exported function resides
name : str
Name of the exported function
user_data : {PyCapsule, ctypes void pointer, cffi void pointer}, optional
User data to pass on to the callback function.
signature : str, optional
Signature of the function. If omitted, determined from *function*.'

@classmethod
def from_cython(cls, module, name, user_data=None, signature=None):

    try:
        function = module.__pyx_capi__[name]
    except AttributeError:
        raise ValueError('Given    module    is    not    a    Cython    module    with    __pyx_capi__    attribute')
    except KeyError:
        raise ValueError('No    function    {!r}    found    in    __pyx_capi__    of    the    module'.format(name))
    return cls(function, user_data, signature)
