<commit_before>import datetime as dt
import pytz

from dateutil import parser
from functools import wraps
from flask import Flask, render_template
from flask import Markup, request
from werkzeug.routing import BaseConverter
from werkzeug.contrib.atom import AtomFeed
from werkzeug.contrib.cache import SimpleCache

import config
import data


# create our application
app = Flask(__name__)
cache = SimpleCache()
app.config.from_object(config.Config)


def cached(timeout=60 * 60, key='view/%s'):
    def decorator(f):
        @wraps(f)
        def decorated_function(*args, **kwargs):
            cache_key = key % request.path
            rv = cache.get(cache_key)
            if rv is not None:
                return rv
            rv = f(*args, **kwargs)
            cache.set(cache_key, rv, timeout=timeout)
            return rv
        return decorated_function
    return decorator


class RegexConverter(BaseConverter):

    def __init__(self, url_map, *items):
        super(RegexConverter, self).__init__(url_map)
        self.regex = items[0]


app.url_map.converters['regex'] = RegexConverter


@app.context_processor
def inject_site_defaults():
    return dict(site_title=app.config['SITE_TITLE'],
                tagline=app.config['SITE_TAGLINE'],
                )<commit_msg>Formatting<commit_after>import datetime as dt
import pytz

from dateutil import parser
from functools import wraps
from flask import Flask, render_template
from flask import Markup, request
from werkzeug.routing import BaseConverter
from werkzeug.contrib.atom import AtomFeed
from werkzeug.contrib.cache import SimpleCache

import config
import data


# create our application
app = Flask(__name__)
cache = SimpleCache()
app.config.from_object(config.Config)


def cached(timeout=60 * 60, key='view/%s'):
    def decorator(f):
        @wraps(f)
        def decorated_function(*args, **kwargs):
            cache_key = key % request.path
            rv = cache.get(cache_key)
            if rv is not None:
                return rv
            rv = f(*args, **kwargs)
            cache.set(cache_key, rv, timeout=timeout)
            return rv
        return decorated_function
    return decorator


class RegexConverter(BaseConverter):
    def __init__(self, url_map, *items):
        super(RegexConverter, self).__init__(url_map)
        self.regex = items[0]
app.url_map.converters['regex'] = RegexConverter


@app.context_processor
def inject_site_defaults():
    return dict(site_title=app.config['SITE_TITLE'],
                tagline=app.config['SITE_TAGLINE'],
                )
{'fraction_non_alphanumeric': 0.08837209302325581, 'fraction_numerical': 0.003875968992248062, 'mean_word_length': 3.0709779179810726, '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': '5190484', 'n_tokens_mistral': 767, 'n_tokens_neox': 745, 'n_words': 200}