<commit_before># -*- coding: utf-8 -*-

import logging

from kudzu import LoggingMiddleware

logging.basicConfig(level=logging.DEBUG)


def example_app(environ, start_response):
    """Simplest possible application object"""
    status = '200 OK'
    response_headers = [('Content-type', 'text/plain')]
    start_response(status, response_headers)
    return ['Hello world!\n']


application = LoggingMiddleware(example_app)<commit_msg>Simple server and wsgi validator.<commit_after># -*- coding: utf-8 -*-

import logging
from wsgiref.simple_server import make_server
from wsgiref.validate import validator
from kudzu import LoggingMiddleware

logging.basicConfig(level=logging.DEBUG)


def example_app(environ, start_response):
    """Simplest possible application object"""
    status = '200 OK'
    response_headers = [('Content-type', 'text/plain')]
    start_response(status, response_headers)
    return ['Hello world!\n']


application = example_app
application = validator(application)
application = LoggingMiddleware(application)
application = validator(application)


if __name__ == '__main__':
    httpd = make_server('', 8000, application)
    print "Serving HTTP on port 8000..."
    httpd.serve_forever()
{'fraction_non_alphanumeric': 0.11320754716981132, 'fraction_numerical': 0.013125512715340444, 'mean_word_length': 5.1, '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': '4568553', 'n_tokens_mistral': 366, 'n_tokens_neox': 351, 'n_words': 91}