<commit_before>import StringIO
from zipfile import ZipFile

from django.core.mail import EmailMessage
from django.utils.translation import ugettext as _


def mail_export(email, filename, data):
    zip_data = StringIO.StringIO()
    zipfile = ZipFile(zip_data, mode='w')
    zipfile.writestr(filename, data)
    zipfile.close()

    subject = _("Database Export")
    message = _("Database Export Attached")
    email = EmailMessage(subject, message, to=[email])
    email.attach(filename, zip_data.getvalue(), 'application/zip')
    email.send()

    zip_data.close()<commit_msg>Fixed merge conflict<commit_after>import StringIO
from zipfile import ZipFile

from django.core.mail import EmailMessage
from django.utils.translation import ugettext as _


def mail_export(email, filename, data):
    zip_data = StringIO.StringIO()
    zipfile = ZipFile(zip_data, mode='w')
    zipfile.writestr(str(filename), data.encode('utf-8'))
    zipfile.close()

    subject = _("Database Export")
    message = _("Database Export Attached")
    email = EmailMessage(subject, message, to=[email])
    email.attach(filename, zip_data.getvalue(), 'application/zip')

    zip_data.close()

    return email.send()
{'fraction_non_alphanumeric': 0.11519198664440734, 'fraction_numerical': 0.0008347245409015025, 'mean_word_length': 4.525345622119816, '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': '7342042', 'n_tokens_mistral': 369, 'n_tokens_neox': 355, 'n_words': 88}