<commit_before>from aiohttp import web

async def handle(request):
    name = request.match_info.get('name', "Anonymous")
    text = "Hello, " + name
    return web.Response(text=text)

app = web.Application()
app.router.add_get('/', handle)
app.router.add_get('/{name}', handle)

web.run_app(app)<commit_msg>Add cors headers config<commit_after>import uuid
import logging
import logging.handlers
from aiohttp import web
import aiohttp_cors

async def user_joined(request):
    user_id = str(uuid.uuid4())
    print("User with id %s just joined" % (user_id))
    uid = { "user_uuid": user_id }
    return web.json_response(uid)


app = web.Application()
app.router.add_get('/join', user_joined)

cors = aiohttp_cors.setup(app, defaults={
    "*": aiohttp_cors.ResourceOptions(
            allow_credentials=True,
            expose_headers="*",
            allow_headers="*",
        )
})

for route in list(app.router.routes()):
    cors.add(route)

web.run_app(app)
{'fraction_non_alphanumeric': 0.13650465356773525, 'fraction_numerical': 0.001034126163391934, 'mean_word_length': 3.888888888888889, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7019520', 'n_tokens_mistral': 331, 'n_tokens_neox': 332, 'n_words': 70}