<commit_before>#!/usr/bin/env python2
from bottle import route, template, request, static_file, redirect, response, default_app
import config
import preferences
import structured_metrics
from graphs import Graphs
from backend import Backend, get_action_on_rules_match
from simple_match import match
from query import parse_query, normalize_query, parse_patterns
import logging
import re
import convert


# contains all errors as key:(title,msg) items.
# will be used throughout the runtime to track all encountered errors
errors = {}

# will contain the latest data
last_update = None

logger = logging.getLogger('app')
logger.setLevel(logging.DEBUG)
chandler = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
chandler.setFormatter(formatter)
logger.addHandler(chandler)
if config.log_file:
    fhandler = logging.FileHandler(config.log_file)
    fhandler.setFormatter(formatter)
    logger.addHandler(fhandler)

logger.debug('app starting')
backend = Backend(config)
s_metrics = structured_metrics.StructuredMetrics(config)
graphs = Graphs()
graphs.load_plugins()
graphs_all = graphs.list_graphs()


@route('<path:re:/assets/.*>')<commit_msg>pass correct logger to SM and Backend<commit_after>#!/usr/bin/env python2
from bottle import route, template, request, static_file, redirect, response, default_app
import config
import preferences
import structured_metrics
from graphs import Graphs
from backend import Backend, get_action_on_rules_match
from simple_match import match
from query import parse_query, normalize_query, parse_patterns
import logging
import re
import convert


# contains all errors as key:(title,msg) items.
# will be used throughout the runtime to track all encountered errors
errors = {}

# will contain the latest data
last_update = None

logger = logging.getLogger('app')
logger.setLevel(logging.DEBUG)
chandler = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
chandler.setFormatter(formatter)
logger.addHandler(chandler)
if config.log_file:
    fhandler = logging.FileHandler(config.log_file)
    fhandler.setFormatter(formatter)
    logger.addHandler(fhandler)

logger.debug('app starting')
backend = Backend(config, logger)
s_metrics = structured_metrics.StructuredMetrics(config, logger)
graphs = Graphs()
graphs.load_plugins()
graphs_all = graphs.list_graphs()


@route('<path:re:/assets/.*>')
{'fraction_non_alphanumeric': 0.09714285714285714, 'fraction_numerical': 0.0008163265306122449, 'mean_word_length': 6.495412844036697, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6209284', 'n_tokens_mistral': 734, 'n_tokens_neox': 705, 'n_words': 203}