<commit_before>try:
    from uos import stat
except:
    from os import stat

import httpd

class MyHttpConnection(httpd.HttpConnection):

    def GET(self, request, options, data):

        # test an option which is unlikely unless this is a websocket request first
        if "Sec-WebSocket-Key" in options \
                and "Upgrade" in options and otions["Upgrade"] == "websocket" \
                and "Connection" in options and options["Connection"] == "Upgrade" \
                and "Sec-WebSocket-Version" and options["Sec-WebSocket-Version"] == "13" \
                and "Origin" in options \
                and "Host" in options \
                and request.ver.major >= 1 and request.ver.minor >= 1:
            
            # create a websocket
            pass
        
        else:
            return self.GET_file(request)<commit_msg>httpd/complex.py use is_websocket_request<commit_after>try:
    from uos import stat
except:
    from os import stat

import httpd

from httpd.websocket import *

class MyHttpConnection(httpd.HttpConnection):

    def GET(self, request):

        if is_websocket_request(request):
            
            # create websocket
            pass
        
        else:
            return self.GET_file(request)
{'fraction_non_alphanumeric': 0.08142292490118577, 'fraction_numerical': 0.0031620553359683794, 'mean_word_length': 1.9579439252336448, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7611831', 'n_tokens_mistral': 355, 'n_tokens_neox': 335, 'n_words': 105}