<commit_before>import wsgi_server

#This implements an embedded web server for development & testing usage
#Production deployment should be based on a formal web server environment such as Apache2
try:
    from werkzeug.serving import run_simple
    def start(port):
        print "Serving HTTP using werkzeug on port "+str(port)
        run_simple('localhost', port, wsgi_server.application, use_reloader=True, threaded=True)

except ImportError:
    print "******** ERROR: Werkzeug not found falling back to wsgiref! **********************"
    print "WARNING: this server is known not to be fully stable, notably when accessed from IE"
    from wsgiref.simple_server import make_server
    def start(port):
        httpd = make_server('', port, wsgi_server.application)
        print "Serving HTTP using wsgiref on port "+str(port)
        httpd.serve_forever()


if __name__ == '__main__':
    start(8000)<commit_msg>Add static serving<commit_after>import wsgi_server

#This implements an embedded web server for development & testing usage
#Production deployment should be based on a formal web server environment such as Apache2
try:
    from werkzeug.serving import run_simple
    from werkzeug.wsgi import SharedDataMiddleware
    def start(port):
        print "Serving HTTP using werkzeug on port "+str(port)
        app = SharedDataMiddleware(wsgi_server.application, {
            '/static': 'PATH_TO_YOUR_APP'
        })
        run_simple('0.0.0.0', port, app, use_reloader=True, threaded=True)
except ImportError:
    print "******** ERROR: Werkzeug not found falling back to wsgiref! **********************"
    print "WARNING: this server is known not to be fully stable, notably when accessed from IE"
    from wsgiref.simple_server import make_server
    def start(port):
        httpd = make_server('', port, wsgi_server.application)
        print "Serving HTTP using wsgiref on port "+str(port)
        httpd.serve_forever()


if __name__ == '__main__':
    start(8000)
{'fraction_non_alphanumeric': 0.10150753768844221, 'fraction_numerical': 0.007035175879396985, 'mean_word_length': 3.9282178217821784, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '7110462', 'n_tokens_mistral': 576, 'n_tokens_neox': 559, 'n_words': 201}