def METHOD_NAME(task, states, return_ptr):
    ret = self.predict_stages(task, states)
    return_ptr = ctypes.cast(return_ptr, ctypes.POINTER(ctypes.c_float))
    array_wrapper = np.ctypeslib.as_array(return_ptr, shape=ret.shape)
    array_wrapper[:] = ret