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


def process_email(data):
    table_template = open('table_template.html', 'r').read()

    same_guild_html = []
    for game in data['same_guild']:
        tt = table_template
        same_guild_html.append(tt.format(**game))

    games_html = []
    for game in data['games']:
        tt = table_template
        games_html.append(tt.format(**game))

    send(same_guild_html + games_html)


def connect():
    gmail_user = '<EMAIL>'
    gmail_passwd = '<PASSWORD>'

    server = smtplib.SMTP('smtp.gmail.com', 587)
    server.ehlo()
    server.starttls()
    server.ehlo()
    server.login(gmail_user, gmail_passwd)
    return server


def send(data):
    TO = '<EMAIL>'
    FROM = '<EMAIL>'
    SUBJECT = 'KGS - DuelGo Results'<commit_msg>Update email subject with datetime so as to not have it end up in a thread in email client.<commit_after>import datetime
import smtplib
from email.mime.text import MIMEText


def process_email(data):
    table_template = open('table_template.html', 'r').read()

    same_guild_html = []
    for game in data['same_guild']:
        tt = table_template
        same_guild_html.append(tt.format(**game))

    games_html = []
    for game in data['games']:
        tt = table_template
        games_html.append(tt.format(**game))

    send(same_guild_html + games_html)


def connect():
    gmail_user = '<EMAIL>'
    gmail_passwd = '<PASSWORD>'

    server = smtplib.SMTP('smtp.gmail.com', 587)
    server.ehlo()
    server.starttls()
    server.ehlo()
    server.login(gmail_user, gmail_passwd)
    return server


def send(data):
    TO = '<EMAIL>'
    FROM = '<EMAIL>'
    SUBJECT = 'KGS - DuelGo Results - {}'.format(datetime.datetime.now().strftime('%m/%d/%Y %I:%M %p'))
{'fraction_non_alphanumeric': 0.13628715647784634, 'fraction_numerical': 0.0033651149747616375, 'mean_word_length': 3.2174940898345152, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2677841', 'n_tokens_mistral': 633, 'n_tokens_neox': 603, 'n_words': 132}