<commit_before>"""
Routes and views for the flask application.
"""
import os
from datetime import datetime
from flask import render_template, request
from FlaskWebProject import app

from generate_summary_json import generate_summary_json


@app.route('/')
@app.route('/home')
def home():
    """Renders the home page."""
    return render_template(
        'index.html',
        title='Home Page',
        year=datetime.now().year,
    )


@app.route('/summarize', methods=['GET'])
def summarize():
    access_token = os.getenv('TEST_TEAM_SLACK_ACCESS_TOKEN')
    member_id = request.args.get('user_id')
    channel_id = request.args.get('channel_id')
    channel_name = request.args.get('channel_name')
    num_messages = request.args.get('text')
    summary_json = generate_summary_json(member_id, channel_id, channel_name, num_messages, access_token)
    return {'text': channel_name, 'private': True}<commit_msg>remove run<commit_after>"""
Routes and views for the flask application.
"""
import os
from datetime import datetime
from flask import render_template, request
from FlaskWebProject import app

from generate_summary_json import generate_summary_json


@app.route('/')
@app.route('/home')
def home():
    """Renders the home page."""
    return render_template(
        'index.html',
        title='Home Page',
        year=datetime.now().year,
    )


# @app.route('/summarize', methods=['GET'])
# def summarize():
#     access_token = os.getenv('TEST_TEAM_SLACK_ACCESS_TOKEN')
#     member_id = request.args.get('user_id')
#     channel_id = request.args.get('channel_id')
#     channel_name = request.args.get('channel_name')
#     num_messages = request.args.get('text')
#     summary_json = generate_summary_json(member_id, channel_id, channel_name, num_messages, access_token)
#     return {'text': channel_name, 'private': True}
{'fraction_non_alphanumeric': 0.13142239048134127, 'fraction_numerical': 0.0, 'mean_word_length': 4.522388059701493, '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': '2452356', 'n_tokens_mistral': 571, 'n_tokens_neox': 561, 'n_words': 132}