<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setup(app: web.Application, *, defaults: Mapping[str, Union[ResourceOptions, Mapping[str, Any]]]=None) -> CorsConfig: """Setup CORS processing for the application. To enable CORS for a resource you need to explicitly add route for that resource using `CorsConfig.add()` method:: app = aiohttp.web.Application() cors = aiohttp_cors.setup(app) cors.add( app.router.add_route("GET", "/resource", handler), { "*": aiohttp_cors.ResourceOptions( allow_credentials=True, expose_headers="*", allow_headers="*"), }) :param app: The application for which CORS will be configured. :param defaults: Default settings for origins. ) """

    cors = CorsConfig(app, defaults=defaults)
    app[APP_CONFIG_KEY] = cors
    return cors