<commit_before>import smtplib
from email.mime.text import MIMEText


def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None,
                retry=None, retry_delay=None):

    mail_from = "<NAME> <<EMAIL>>" if not mail_from else mail_from
    if not job_id or not job_fail:
        raise Exception("Empty job failure reason or job id: Cannot continue")
    if not mail_to:
        raise Exception("mail_to cannot be empty: Requires a list of recipient addresses")
    if retry and retry_delay:
        retry_str = ' [AUTO-RETRY IN %s HOUR(s)]' % str(retry_delay)
    mail_server = "localhost" if not mail_server else mail_server
    msg_body = str(job_fail)
    msg = MIMEText(msg_body)
    msg['Subject'] = "Job Status: %s" % job_id + (retry_str if retry_str else '')
    msg['From'] = mail_from
    msg['To'] = ", ".join(mail_to)
    try:
        s = smtplib.SMTP(mail_server)
        s.sendmail(mail_from, mail_to, msg.as_string())
        s.quit()
        return True
    except:
        return False<commit_msg>notification fix<commit_after>import smtplib
from email.mime.text import MIMEText


def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None,
                retry=None, retry_delay=None):

    mail_from = "<NAME> <<EMAIL>>" if not mail_from else mail_from
    if not job_id or not job_fail:
        raise Exception("Empty job failure reason or job id: Cannot continue")
    if not mail_to:
        raise Exception("mail_to cannot be empty: Requires a list of recipient addresses")
    if retry and retry_delay:
        retry_str = ' [AUTO-RETRY IN %s HOUR(s)]' % str(retry_delay)
    else:
        retry_str = False
    mail_server = "localhost" if not mail_server else mail_server
    msg_body = str(job_fail)
    msg = MIMEText(msg_body)
    msg['Subject'] = "Job Status: %s" % job_id + (retry_str if retry_str else '')
    msg['From'] = mail_from
    msg['To'] = ", ".join(mail_to)
    try:
        s = smtplib.SMTP(mail_server)
        s.sendmail(mail_from, mail_to, msg.as_string())
        s.quit()
        return True
    except:
        return False
{'fraction_non_alphanumeric': 0.10555815039701075, 'fraction_numerical': 0.0, 'mean_word_length': 3.1192307692307693, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6787365', 'n_tokens_mistral': 711, 'n_tokens_neox': 717, 'n_words': 203}