<commit_before>import smtplib
import config

from email.mime.text import MIMEText
from time import sleep

SLEEP_TIME = config.SLEEP_TIME
VALID_MESSAGE_HEADERS = ["To", "From", "Subject", "Cc"]
VALID_MESSAGE_FIELDS = VALID_MESSAGE_HEADERS + ["Bcc", "Body"]

def validateFields(fields):
    '''Require that all fields used are legitimate.
    return dictionary where all fields used.
    '''
    for i in fields:
        assert i in VALID_MESSAGE_FIELDS,
            "Message field {} is invalid".format(i)
    out = {}
    for i in VALID_MESSAGE_FIELDS:
        if i in fields:
            out[i] = fields[i]
        else:
            out[i] = ""<commit_msg>Fixed syntax error<commit_after>import smtplib
import config

from email.mime.text import MIMEText
from time import sleep

SLEEP_TIME = config.SLEEP_TIME
VALID_MESSAGE_HEADERS = ["To", "From", "Subject", "Cc"]
VALID_MESSAGE_FIELDS = VALID_MESSAGE_HEADERS + ["Bcc", "Body"]

def validateFields(fields):
    '''Require that all fields used are legitimate.
    return dictionary where all fields used.
    '''
    for i in fields:
        assert i in VALID_MESSAGE_FIELDS, \
            "Message field {} is invalid".format(i)
    out = {}
    for i in VALID_MESSAGE_FIELDS:
        if i in fields:
            out[i] = fields[i]
        else:
            out[i] = ""
{'fraction_non_alphanumeric': 0.10068130204390613, 'fraction_numerical': 0.0, 'mean_word_length': 2.922848664688427, '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': '4389692', 'n_tokens_mistral': 418, 'n_tokens_neox': 419, 'n_words': 128}