<commit_before># -*- coding: utf-8 -*-
"""
Validators lib application file.
"""
from formencode.validators import UnicodeString


class TweetMessage(UnicodeString):
    """
    Validate Tweet message.

    Twitter has changed the max at the end of 2017 from 140 to 280 characters.
    """
    max = 280

    def _validate_other(self, value, state):
        """
        Override the parent method so that validation is done on the unicode
        value, since the str value would be longer for unicode characters.

        @return: None
        """
        if type(value) == str:
            value = value.decode('utf-8')
        super(TweetMessage, self)._validate_other(value, state)<commit_msg>Add line break to validators.py<commit_after># -*- coding: utf-8 -*-
"""
Validators lib application file.
"""
from formencode.validators import UnicodeString


class TweetMessage(UnicodeString):
    """
    Validate Tweet message.

    Twitter has changed the max at the end of 2017 from 140 to 280 characters.
    """

    max = 280

    def _validate_other(self, value, state):
        """
        Override the parent method so that validation is done on the unicode
        value, since the str value would be longer for unicode characters.

        @return: None
        """
        if type(value) == str:
            value = value.decode('utf-8')
        super(TweetMessage, self)._validate_other(value, state)
{'fraction_non_alphanumeric': 0.09425939050318922, 'fraction_numerical': 0.021261516654854713, 'mean_word_length': 2.648578811369509, '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': '5408967', 'n_tokens_mistral': 409, 'n_tokens_neox': 368, 'n_words': 143}