<commit_before>from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy

def truncate_letters(s, num):
    """ truncates a string to a number of letters, similar to truncate_words """
    s = force_unicode(s)
    length = int(num)
    if len(s)>length:
    s = s[:length]
    if not s.endswith('...'):
        s += '...'
    return s
truncate_letters = allow_lazy(truncate_letters, unicode)
<commit_msg>Fixed stupid indentation bug introduced in r179<commit_after>from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy

def truncate_letters(s, num):
    """ truncates a string to a number of letters, similar to truncate_words """
    s = force_unicode(s)
    length = int(num)
    if len(s)>length:
        s = s[:length]
    if not s.endswith('...'):
        s += '...'
    return s
truncate_letters = allow_lazy(truncate_letters, unicode)

{'fraction_non_alphanumeric': 0.11304347826086956, 'fraction_numerical': 0.003260869565217391, 'mean_word_length': 3.582089552238806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1760592', 'n_tokens_mistral': 305, 'n_tokens_neox': 282, 'n_words': 84}