<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals


class PageContextTitleMixin(object):
    """
    Provides update of response context data with variable "title"
    valorized with value of attribute "page_title".
    """
    page_title = None

    def get_page_title(self):
        """
        Returns the attribute "page_title".
        """
        return self.page_title

    def get_context_data(self, **kwargs):
        """
        Update of response context data with variable "title" valorized with
        value of attribute "page_title".
        """
        context = super(PageContextTitleMixin, self).get_context_data(**kwargs)
        context.update({"title": self.get_page_title()})
        return context


def setup_cbview(view, request, *args, **kwargs):
    view.request = request
    view.args = args
    view.kwargs = kwargs

<commit_msg>add utils for PageContentTitleMixin, it must porting to stand-alone app<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals


class PageContextTitleMixin(object):
    """
    Provides update of response context data with variable "title"
    valorized with value of attribute "page_title".
    """
    page_title = None

    def get_page_title(self):
        """
        Returns the attribute "page_title".
        """
        return self.page_title

    def get_context_data(self, **kwargs):
        """
        Update of response context data with variable "title" valorized with
        value of attribute "page_title".
        """
        context = super(PageContextTitleMixin, self).get_context_data(**kwargs)
        context.update({"title": self.get_page_title()})
        return context

{'fraction_non_alphanumeric': 0.10011709601873536, 'fraction_numerical': 0.00117096018735363, 'mean_word_length': 2.8577878103837473, 'pattern_counts': {'":': 2, '<': 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': '1948765', 'n_tokens_mistral': 473, 'n_tokens_neox': 465, 'n_words': 136}