code: def request_response(func: typing.Callable) -> ASGIApp:
      
      is_coroutine = asyncio.iscoroutinefunction(func)
  
      async def app(scope: Scope, receive: Receive, send: Send) -> None:
          request = Request(scope, receive=receive)
          if is_coroutine:
              response = await func(request)
          else:
              response = await run_in_threadpool(func, request)
          await response(scope, receive, send)
  
      return app
docs: Takes a function or coroutine `func(request) -> response`,
      and returns an ASGI application.