<commit_before>from flask import Flask, render_template, request
from forms import ContactForm


app = Flask(__name__)
app.secret_key = "Development Secret Key"


@app.route('/', methods=['GET', 'POST'])
def contact():
    skin = 'skin_development.html'
    form = ContactForm()
    if request.method == 'POST':
        if form.validate():
            return "valid Form posted"
    return render_template('contact.html', skin=skin, form=form)


if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True)<commit_msg>send mail<commit_after>from flask import Flask, render_template, request
from flask.ext.mail import Message, Mail
from forms import ContactForm


app = Flask(__name__)
app.secret_key = "Development Secret Key"
app.config['MAIL_SERVER'] = 'localhost'
app.config['MAIL_PORT'] = 25
app.config['MAIL_USE_SSL'] = False
app.config['MAIL_RECIPIENT'] = '<EMAIL>'
app.config['MAIL_SENDER'] = '<EMAIL>'

mail = Mail()
mail.init_app(app)

@app.route('/', methods=['GET', 'POST'])
def contact():
    skin = 'skin_development.html'
    form = ContactForm()
    if request.method == 'POST':
        if form.validate():
            send_message(form)
            return 'Message sent'
    return render_template('contact.html', skin=skin, form=form)


def send_message(form):
    message = Message(form.subject.data,
                      sender=app.config['MAIL_SENDER'],
                      recipients=['<EMAIL>'])
    message.body = """
    Website contact message from {0} ({1}):

    {2}""".format(form.name.data, form.email.data, form.message.data)
    mail.send(message)


if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True)
{'fraction_non_alphanumeric': 0.15389257694628847, 'fraction_numerical': 0.007845503922751962, 'mean_word_length': 3.6704225352112676, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '601192', 'n_tokens_mistral': 547, 'n_tokens_neox': 529, 'n_words': 121}