<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def defer(self, *args, **kwargs):
 """Call the function and immediately return an asynchronous object. The calling code will need to check for the result at a later time using: In Python 2/3 using ThreadPools - an AsyncResult (https://docs.python.org/2/library/multiprocessing.html#multiprocessing.pool.AsyncResult) In Python 3 using Asyncio - a Future (https://docs.python.org/3/library/asyncio-task.html#future) :param args: :param kwargs: :return: """

        LOG.debug(
            '%s on %s (awaitable %s async %s provider %s)',
            'deferring',
            self._func,
            self._is_awaitable,
            self._is_asyncio_provider,
            self._concurrency_provider
        )

        if self._blocked:
            raise RuntimeError('Already activated this deferred call by blocking on it')
        with self._lock:
            if not self._deferable:
                func_partial = functools.partial(self._func, *args, **kwargs)

                # we are either:
                # - pure asyncio
                # - asyncio but with blocking function
                # - not asyncio, use threadpool
                self._deferable = (
                    # pure asyncio
                    asyncio.ensure_future(func_partial(), loop=self._concurrency_provider)
                    if self._is_awaitable else (
                        # asyncio blocked
                        self._concurrency_provider.run_in_executor(
                            func=func_partial,
                            executor=None
                        )
                        if self._is_asyncio_provider else (
                            # not asyncio
                            self._concurrency_provider.apply_async(func_partial)
                        )
                    )
                )
        return self._deferable