<commit_before>from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _

from .utils import get_provider_choices


class Keycode(models.Model):

    site = models.ForeignKey(
        Site, verbose_name=_('Site'), help_text=_('Site for which metrics keycode is registered.'))
    provider = models.CharField(
        _('Provider'), max_length=50, choices=get_provider_choices(), help_text=_('Metrics service provider name.'))
    keycode = models.CharField(
        _('Keycode'), max_length=80, help_text=_('Keycode or identifier given by metrics service provider for site(s).'))
    active = models.BooleanField(
        _('Active'), default=True, help_text=_('Whether this keycode is available to use.'))

    class Meta(object):
        verbose_name = _('Keycode')
        verbose_name_plural = _('Keycodes')

    def __unicode__(self):
        return u'Keycode by %s for %s' % (self.provider, self.keycode)
<commit_msg>Models switched to unicode_compatible.<commit_after>from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible

from .utils import get_provider_choices


@python_2_unicode_compatible
class Keycode(models.Model):

    site = models.ForeignKey(Site, verbose_name=_('Site'), help_text=_('Site for which metrics keycode is registered.'))

    provider = models.CharField(
        _('Provider'), max_length=50, choices=get_provider_choices(),
        help_text=_('Metrics service provider name.'))

    keycode = models.CharField(
        _('Keycode'), max_length=80,
        help_text=_('Keycode or identifier given by metrics service provider for site(s).'))

    active = models.BooleanField(_('Active'), default=True, help_text=_('Whether this keycode is available to use.'))

    class Meta(object):
        verbose_name = _('Keycode')
        verbose_name_plural = _('Keycodes')

    def __str__(self):
        return u'Keycode by %s: %s' % (self.provider, self.keycode)

{'fraction_non_alphanumeric': 0.11095238095238096, 'fraction_numerical': 0.004761904761904762, 'mean_word_length': 4.305555555555555, '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': '6848656', 'n_tokens_mistral': 622, 'n_tokens_neox': 602, 'n_words': 165}