<commit_before>from __future__ import unicode_literals

import os
import datetime

from clastic.core import Application, RESERVED_ARGS
from clastic.sinter import getargspec
from clastic.render import json_response
from clastic.render import AshesRenderFactory

_CUR_DIR = os.path.dirname(__file__)


def create_app():
    routes = [('/', get_routes_info, 'base.html'),
              ('/json/', get_routes_info, json_response)]
    resources = {'_meta_start_time': datetime.datetime.utcnow()}
    arf = AshesRenderFactory(_CUR_DIR)
    app = Application(routes, resources, arf)
    return app


def get_routes_info(_application, _meta_start_time):
    ret = {}
    app = _application
    route_infos = []
    for r in app.routes:
        r_info = {}
        r_info['url_rule'] = r.rule
        r_info['endpoint'] = get_endpoint_info(r)
        r_info['render'] = get_render_info(r)
        r_info['args'] = get_route_arg_info(r)
        route_infos.append(r_info)<commit_msg>add meta to main package, renaming 'base.html' to 'meta_base.html'<commit_after>from __future__ import unicode_literals

import os
import datetime

from core import Application, RESERVED_ARGS
from sinter import getargspec
from render import json_response, AshesRenderFactory


_CUR_DIR = os.path.dirname(__file__)


def create_app():
    routes = [('/', get_routes_info, 'meta_base.html'),
              ('/json/', get_routes_info, json_response)]
    resources = {'_meta_start_time': datetime.datetime.utcnow()}
    arf = AshesRenderFactory(_CUR_DIR)
    app = Application(routes, resources, arf)
    return app


def get_routes_info(_application, _meta_start_time):
    ret = {}
    app = _application
    route_infos = []
    for r in app.routes:
        r_info = {}
        r_info['url_rule'] = r.rule
        r_info['endpoint'] = get_endpoint_info(r)
        r_info['render'] = get_render_info(r)
        r_info['args'] = get_route_arg_info(r)
        route_infos.append(r_info)
{'fraction_non_alphanumeric': 0.10628513030148186, 'fraction_numerical': 0.0, 'mean_word_length': 3.763990267639903, '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': '2525158', 'n_tokens_mistral': 639, 'n_tokens_neox': 640, 'n_words': 138}