<commit_before>import os
import tornado.web
from tornado.options import define

from .handlers import LandingHandler, RequestHandler


class InteractApp(tornado.web.Application):
    """
    Entry point for the interact app.
    """
    def __init__(self, config=None):
        # Terrible hack to get config object in global namespace. This allows
        # us to use options.config to get the global config object.
        #
        # TODO(sam): Replace with a better solution
        define('config', config)

        # Assumes config['URL'] has a trailing slash
        base_url = config['URL'][:-1]
        socket_url = config['URL'] + r'socket/(\w+)'

        handlers = [
            (base_url, LandingHandler),
            (socket_url, RequestHandler),
        ]<commit_msg>App should handle both trailing slash and without<commit_after>import os
import tornado.web
from tornado.options import define

from .handlers import LandingHandler, RequestHandler


class InteractApp(tornado.web.Application):
    """
    Entry point for the interact app.
    """
    def __init__(self, config=None):
        # Terrible hack to get config object in global namespace. This allows
        # us to use options.config to get the global config object.
        #
        # TODO(sam): Replace with a better solution
        define('config', config)

        # Assumes config['URL'] has a trailing slash
        base_url = config['URL']
        base_url_without_slash = base_url[:-1]
        socket_url = base_url + r'socket/(\w+)'

        handlers = [
            (base_url, LandingHandler),
            (base_url_without_slash, LandingHandler),
            (socket_url, RequestHandler),
        ]
{'fraction_non_alphanumeric': 0.09177027827116636, 'fraction_numerical': 0.0011841326228537595, 'mean_word_length': 2.603411513859275, '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': '2597778', 'n_tokens_mistral': 466, 'n_tokens_neox': 449, 'n_words': 149}