<commit_before># -*- coding: utf-8 -*-
"""
    solace.application
    ~~~~~~~~~~~~~~~~~~

    The WSGI application for Solace.

    :copyright: (c) 2009 by Plurk Inc., see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""
import os
from urlparse import urlparse, urlsplit, urljoin
from fnmatch import fnmatch
from functools import update_wrapper
from simplejson import dumps

from babel import UnknownLocaleError, Locale
from werkzeug import Request as RequestBase, Response, cached_property, \
     import_string, redirect, SharedDataMiddleware, url_quote
from werkzeug.exceptions import HTTPException, NotFound, Forbidden
from werkzeug.routing import BuildError, RequestRedirect
from werkzeug.contrib.securecookie import SecureCookie

from solace.utils.ctxlocal import local, local_mgr, LocalProperty


class Request(RequestBase):
    """The request class."""

    in_api = False
    _locale = None
    _pulled_flash_messages = None

    def __init__(self, environ):
        RequestBase.__init__(self, environ)
        emit(BEFORE_REQUEST_INIT)
        self.url_adapter = url_map.bind_to_environ(self.environ)
        self.view_lang = self.match_exception = None
        try:
            self.endpoint, self.view_arguments = self.url_adapter.match()
            view_lang = self.view_arguments.pop('lang_code', None)
            if view_lang is not None:
                try:<commit_msg>Local manager no longer needed in the application.<commit_after># -*- coding: utf-8 -*-
"""
    solace.application
    ~~~~~~~~~~~~~~~~~~

    The WSGI application for Solace.

    :copyright: (c) 2009 by Plurk Inc., see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""
import os
from urlparse import urlparse, urlsplit, urljoin
from fnmatch import fnmatch
from functools import update_wrapper
from simplejson import dumps

from babel import UnknownLocaleError, Locale
from werkzeug import Request as RequestBase, Response, cached_property, \
     import_string, redirect, SharedDataMiddleware, url_quote
from werkzeug.exceptions import HTTPException, NotFound, Forbidden
from werkzeug.routing import BuildError, RequestRedirect
from werkzeug.contrib.securecookie import SecureCookie

from solace.utils.ctxlocal import local, LocalProperty


class Request(RequestBase):
    """The request class."""

    in_api = False
    _locale = None
    _pulled_flash_messages = None

    def __init__(self, environ):
        RequestBase.__init__(self, environ)
        emit(BEFORE_REQUEST_INIT)
        self.url_adapter = url_map.bind_to_environ(self.environ)
        self.view_lang = self.match_exception = None
        try:
            self.endpoint, self.view_arguments = self.url_adapter.match()
            view_lang = self.view_arguments.pop('lang_code', None)
            if view_lang is not None:
                try:
{'fraction_non_alphanumeric': 0.08525506638714186, 'fraction_numerical': 0.0034940600978336828, 'mean_word_length': 3.5881410256410255, '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': '5682427', 'n_tokens_mistral': 808, 'n_tokens_neox': 802, 'n_words': 245}