<commit_before>#!/usr/bin/env python
import logging
from flask import Flask
from npactflask import app

logger = logging.getLogger('npactflask')
logger.setLevel(logging.DEBUG)
# logger.addHandler(logging.StreamHandler())
fmt = "%(asctime)s %(levelname)-7s %(name)-20s| %(message)s"
sh = logging.StreamHandler()
sh.setFormatter(logging.Formatter(fmt, datefmt='%H:%M:%S'))
logger.addHandler(sh)
# logger.addHandler(logging.getLogger('werkzeug').handlers[0])
if __name__ == '__main__':
    # Relevant documents:
    # http://werkzeug.pocoo.org/docs/middlewares/
    # http://flask.pocoo.org/docs/patterns/appdispatch/
    from werkzeug.serving import run_simple
    from werkzeug.wsgi import DispatcherMiddleware
    app.config['DEBUG'] = True
    # Load a dummy app at the root URL to give 404 errors.
    # Serve app at APPLICATION_ROOT for localhost development.
    application = DispatcherMiddleware(Flask('dummy_app'), {
        app.config['APPLICATION_ROOT']: app,
    })
    run_simple('localhost', 5000, application, use_reloader=True, use_debugger=True, use_evalex=True)<commit_msg>redirect to /npact/ from /<commit_after>#!/usr/bin/env python
import logging
from flask import Flask, redirect
from npactflask import app

logger = logging.getLogger('npactflask')
logger.setLevel(logging.DEBUG)
# logger.addHandler(logging.StreamHandler())
fmt = "%(asctime)s %(levelname)-7s %(name)-20s| %(message)s"
sh = logging.StreamHandler()
sh.setFormatter(logging.Formatter(fmt, datefmt='%H:%M:%S'))
logger.addHandler(sh)
# logger.addHandler(logging.getLogger('werkzeug').handlers[0])


redirectapp = Flask('redirectapp')


@redirectapp.route('/')
def doredirect():
    return redirect(app.config['APPLICATION_ROOT'])


if __name__ == '__main__':
    # Relevant documents:
    # http://werkzeug.pocoo.org/docs/middlewares/
    # http://flask.pocoo.org/docs/patterns/appdispatch/
    from werkzeug.serving import run_simple
    from werkzeug.wsgi import DispatcherMiddleware
    app.config['DEBUG'] = True
    # Load a redirect app at the root URL to redirect us to the target app.
    # Serve app at APPLICATION_ROOT for localhost development.
    application = DispatcherMiddleware(redirectapp, {
        app.config['APPLICATION_ROOT']: app,
    })
    run_simple('localhost', 5000, application,
               use_reloader=True, use_debugger=True, use_evalex=True)
{'fraction_non_alphanumeric': 0.13130029648454045, 'fraction_numerical': 0.008047437526471834, 'mean_word_length': 4.846534653465347, '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': '6779338', 'n_tokens_mistral': 785, 'n_tokens_neox': 762, 'n_words': 160}