<commit_before>import logging
from urllib.parse import parse_qs, urlparse

import threading
from http.server import BaseHTTPRequestHandler, HTTPServer

logger = logging.getLogger(__name__)
HTTP_ADDRESS = '0.0.0.0'
HTTP_PORT = 8157


def get_handler(callback_on_token):
    class HTTPHandler(BaseHTTPRequestHandler):
<commit_msg>Fix imports for py27<commit_after>import logging
try:
    from urllib.parse import parse_qs, urlparse
except ImportError:
    from urlparse import parse_qs, urlparse

import threading
try:
    from http.server import BaseHTTPRequestHandler, HTTPServer
except ImportError:
    from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer

logger = logging.getLogger(__name__)
HTTP_ADDRESS = '0.0.0.0'
HTTP_PORT = 8157


def get_handler(callback_on_token):
    class HTTPHandler(BaseHTTPRequestHandler):

{'fraction_non_alphanumeric': 0.06498194945848375, 'fraction_numerical': 0.021660649819494584, 'mean_word_length': 6.0508474576271185, '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': '3703884', 'n_tokens_mistral': 256, 'n_tokens_neox': 250, 'n_words': 67}