<commit_before>import logging
from flask import Flask, request
from flask.ext.images import Images
from flask_mail import Mail
from flask_login import LoginManager, UserMixin
from pubs_ui.custom_filters import display_publication_info
from itsdangerous import URLSafeTimedSerializer


FORMAT = '%(asctime)s %(message)s'
fmt = logging.Formatter(FORMAT)
handler = logging.FileHandler('pubs_ui.log')
handler.setLevel(logging.INFO)
handler.setFormatter(fmt)


app = Flask(__name__)
app.config.from_object('settings')  # load configuration before passing the app object to other things


@app.before_request
def log_request():
    if app.config.get('LOGGING_ON'):
        request_str = str(request)
        request_headers = str(request.headers)
        log_str = 'Request: ({0}); Headers: ({1})'.format(request_str, request_headers)
        app.logger.info(log_str)


if app.config.get('LOGGING_ON'):
    app.logger.addHandler(handler)
images = Images(app)
mail = Mail(app)
app.view_functions['images'] = images.handle_request
#app.jinja_env.trim_blocks = True
#app.jinja_env.lstrip_blocks = True
app.jinja_env.filters['display_pub_info'] = display_publication_info
app.jinja_env.globals.update(wsgi_str=app.config['WSGI_STR'])<commit_msg>remove commented code that was for formatting the html<commit_after>import logging
from flask import Flask, request
from flask.ext.images import Images
from flask_mail import Mail
from flask_login import LoginManager, UserMixin
from pubs_ui.custom_filters import display_publication_info
from itsdangerous import URLSafeTimedSerializer


FORMAT = '%(asctime)s %(message)s'
fmt = logging.Formatter(FORMAT)
handler = logging.FileHandler('pubs_ui.log')
handler.setLevel(logging.INFO)
handler.setFormatter(fmt)


app = Flask(__name__)
app.config.from_object('settings')  # load configuration before passing the app object to other things


@app.before_request
def log_request():
    if app.config.get('LOGGING_ON'):
        request_str = str(request)
        request_headers = str(request.headers)
        log_str = 'Request: ({0}); Headers: ({1})'.format(request_str, request_headers)
        app.logger.info(log_str)


if app.config.get('LOGGING_ON'):
    app.logger.addHandler(handler)
images = Images(app)
mail = Mail(app)
app.view_functions['images'] = images.handle_request
app.jinja_env.filters['display_pub_info'] = display_publication_info
app.jinja_env.globals.update(wsgi_str=app.config['WSGI_STR'])
{'fraction_non_alphanumeric': 0.10815239655878738, 'fraction_numerical': 0.0016386726751331422, 'mean_word_length': 5.878873239436619, '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': '6570051', 'n_tokens_mistral': 789, 'n_tokens_neox': 761, 'n_words': 167}