<commit_before>from flask import render_template, request
from papertalk import papertalk, mongo
from papertalk.utils.utils import jsonify
from papertalk.models.reaction import Reaction

@papertalk.route('/reaction/<int:id>')
def reaction(id):
    context = {}
    context["reaction"] = mongo.db.find_one({"_id" : id})
    return render_template('reaction.html', **context)

@papertalk.route('/reaction/new', methods=["GET", "POST"])
def reaction_author():
    if request.method == "GET":
        context = {}
        return render_template('reaction_author.html', **context)
    elif request.method == "POST":
        reaction = Reaction()
        reaction['title'] = request.form['title'].strip()
        reaction['body'] = request.form['text']
        reaction.save()
        return jsonify({'status': 'reaction saved'})


<commit_msg>pull from reactions collection<commit_after>from flask import render_template, request
from papertalk import papertalk, mongo
from papertalk.utils.utils import jsonify
from papertalk.models.reaction import Reaction

@papertalk.route('/reaction/<int:id>')
def reaction(id):
    context = {}
    context["reaction"] = mongo.db.reactions.find_one({"_id" : id})
    return render_template('reaction.html', **context)

@papertalk.route('/reaction/new', methods=["GET", "POST"])
def reaction_author():
    if request.method == "GET":
        context = {}
        return render_template('reaction_author.html', **context)
    elif request.method == "POST":
        reaction = Reaction()
        reaction['title'] = request.form['title'].strip()
        reaction['body'] = request.form['text']
        reaction.save()
        return jsonify({'status': 'reaction saved'})



{'fraction_non_alphanumeric': 0.15208455666470932, 'fraction_numerical': 0.0, 'mean_word_length': 4.086567164179105, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 5, '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': '1654529', 'n_tokens_mistral': 513, 'n_tokens_neox': 475, 'n_words': 111}