<commit_before># -*- coding: utf-8 -*-

from tablib.compat import is_py3, StringIO


title = 'txt'
extensions = ('txt',)


DEFAULT_ENCODING = 'utf-8'


def export_set(dataset, **kwargs):
    """Returns text representation of Dataset."""
    stream = StringIO()

    if not is_py3:
        kwargs.setdefault('encoding', DEFAULT_ENCODING)

    for row in dataset._package():
        for key, val in row.iteritems():
            stream.write('-' * len(key) + '\n')
            stream.write(key.encode('utf-8') + '\n')
            stream.write('-' * len(key) + '\n')
            stream.write(val.encode('utf-8') + '\n\n')
        stream.write('\n' + '*' * 50 + '\n\n\n')

    return stream.getvalue()<commit_msg>Removed redundant code from _txt.py<commit_after># -*- coding: utf-8 -*-

from tablib.compat import StringIO


title = 'txt'
extensions = ('txt',)


DEFAULT_ENCODING = 'utf-8'


def export_set(dataset, **kwargs):
    """Returns text representation of Dataset."""
    stream = StringIO()

    for row in dataset._package():
        for key, val in row.iteritems():
            stream.write('-' * len(key) + '\n')
            stream.write(key.encode('utf-8') + '\n')
            stream.write('-' * len(key) + '\n')
            stream.write(val.encode('utf-8') + '\n\n')
        stream.write('\n' + '*' * 50 + '\n\n\n')

    return stream.getvalue()
{'fraction_non_alphanumeric': 0.18980797636632202, 'fraction_numerical': 0.0103397341211226, 'mean_word_length': 2.4743589743589745, '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': '6498461', 'n_tokens_mistral': 468, 'n_tokens_neox': 442, 'n_words': 103}