<commit_before>#!/usr/bin/env python3
"""Example for aiohttp.web websocket server
"""

import os

from aiohttp import web


WS_FILE = os.path.join(os.path.dirname(__file__), 'websocket.html')


async def wshandler(request):
    resp = web.WebSocketResponse()
    available = resp.can_prepare(request)
    if not available:
        with open(WS_FILE, 'rb') as fp:
            return web.Response(body=fp.read(), content_type='text/html')

    await resp.prepare(request)

    try:
        print('Someone joined.')
        for ws in request.app['sockets']:<commit_msg>Send welcome message at very first of communication channel<commit_after>#!/usr/bin/env python3
"""Example for aiohttp.web websocket server
"""

import os

from aiohttp import web


WS_FILE = os.path.join(os.path.dirname(__file__), 'websocket.html')


async def wshandler(request):
    resp = web.WebSocketResponse()
    available = resp.can_prepare(request)
    if not available:
        with open(WS_FILE, 'rb') as fp:
            return web.Response(body=fp.read(), content_type='text/html')

    await resp.prepare(request)

    await resp.send_str('Welcome!!!')

    try:
        print('Someone joined.')
        for ws in request.app['sockets']:
{'fraction_non_alphanumeric': 0.1265406737880033, 'fraction_numerical': 0.0016433853738701725, 'mean_word_length': 3.4944649446494465, 'pattern_counts': {'":': 0, '<': 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': '721581', 'n_tokens_mistral': 397, 'n_tokens_neox': 381, 'n_words': 95}