<commit_before>from http.server import BaseHTTPRequestHandler, HTTPServer

import response

# HTTPRequestHandler class

ret = ""


class ServerHandler(BaseHTTPRequestHandler):

    def do_GET(self):
        global ret
        # Send response status code
        self.send_response(200)

        # Send headers
        self.send_header('Content-type', 'text/html')
        self.end_headers()

        # Write content as utf-8 data
        self.wfile.write(bytes(ret, "utf8"))

        ret = response.get_json()

        return


def run():
    global ret
    print('starting server...')

    ret = response.get_json()

    # Server settings
    server_address = ('127.0.0.1', 3001)
    httpd = HTTPServer(server_address, ServerHandler)
    print('running server...')
    httpd.serve_forever()

run()
<commit_msg>Add Connection: close to header<commit_after>from http.server import BaseHTTPRequestHandler, HTTPServer

import response

ret = ""


class ServerHandler(BaseHTTPRequestHandler):

    def do_GET(self):
        global ret
        # Send response status code
        self.send_response(200)

        # Send headers
        self.send_header('Content-type', 'application/json')
        self.send_header('Connection', 'close')
        self.end_headers()

        # Write content as utf-8 data
        self.wfile.write(bytes(ret, "utf8"))

        ret = response.get_json()

        return


def run():
    global ret
    print('starting server...')

    ret = response.get_json()

    # Server settings
    server_address = ('127.0.0.1', 3001)
    httpd = HTTPServer(server_address, ServerHandler)
    print('running server...')
    httpd.serve_forever()

run()

{'fraction_non_alphanumeric': 0.11037792441511697, 'fraction_numerical': 0.017996400719856028, 'mean_word_length': 2.7066666666666666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2460459', 'n_tokens_mistral': 516, 'n_tokens_neox': 485, 'n_words': 116}