<commit_before># -*- coding: utf-8 -*-
from django.utils.encoding import force_text
from django.utils.translation import get_language
from django.db.models.query import EmptyQuerySet


class KeyBitBase(object):
    def __init__(self, params=None):
        self.params = params

    def get_data(self, params, view_instance, view_method, request, args, kwargs):
        """
        @rtype: dict
        """
        raise NotImplementedError()


class KeyBitDictBase(KeyBitBase):
    """Base class for dict-like source data processing.
<commit_msg>Use 'force_text' from compat in key_constructor/bits.py<commit_after># -*- coding: utf-8 -*-
from django.utils.translation import get_language
from django.db.models.query import EmptyQuerySet
from rest_framework_extensions.compat import force_text


class KeyBitBase(object):
    def __init__(self, params=None):
        self.params = params

    def get_data(self, params, view_instance, view_method, request, args, kwargs):
        """
        @rtype: dict
        """
        raise NotImplementedError()


class KeyBitDictBase(KeyBitBase):
    """Base class for dict-like source data processing.

{'fraction_non_alphanumeric': 0.10043668122270742, 'fraction_numerical': 0.0017467248908296944, 'mean_word_length': 3.639676113360324, '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': '1454474', 'n_tokens_mistral': 328, 'n_tokens_neox': 321, 'n_words': 91}