<commit_before>from reg import Lookup
from morepath.app import App
from morepath.publish import publish
from morepath.request import Request, Response
from morepath.view import register_view, render_json, render_html
from morepath.setup import setup
from werkzeug.test import EnvironBuilder


def get_request(*args, **kw):
    app = kw.pop('app')
    lookup = Lookup(app.class_lookup())
    result = Request(EnvironBuilder(*args, **kw).get_environ())
    result.lookup = lookup
    return result


class Model(object):
    pass


# XXX these tests have gained more dependencies, on app and setup and
# lookup generation. see about refactor code so that they can be tested
# with less heavy installation
def test_view():
    setup()
    app = App()

    def view(request, model):<commit_msg>Use method from app.<commit_after>from reg import Lookup
from morepath.app import App
from morepath.publish import publish
from morepath.request import Request, Response
from morepath.view import register_view, render_json, render_html
from morepath.setup import setup
from werkzeug.test import EnvironBuilder


def get_request(*args, **kw):
    app = kw.pop('app')
    lookup = app.lookup()
    result = Request(EnvironBuilder(*args, **kw).get_environ())
    result.lookup = lookup
    return result


class Model(object):
    pass


# XXX these tests have gained more dependencies, on app and setup and
# lookup generation. see about refactor code so that they can be tested
# with less heavy installation
def test_view():
    setup()
    app = App()

    def view(request, model):
{'fraction_non_alphanumeric': 0.08200890019071837, 'fraction_numerical': 0.0, 'mean_word_length': 4.335593220338983, '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': '793236', 'n_tokens_mistral': 435, 'n_tokens_neox': 430, 'n_words': 170}