def METHOD_NAME(self):
    # type: () -> None
    """
    If get_response is a coroutine function, turns us into async mode so
    a thread is not consumed during a whole request.
    Taken from django.utils.deprecation::MiddlewareMixin._async_check
    """
    if asyncio.iscoroutinefunction(self.get_response):
        self._is_coroutine = asyncio.coroutines._is_coroutine  # type: ignore