<commit_before>from flask import Blueprint, render_template, request, redirect, url_for
from flask.ext.login import login_required, current_user
from bnd.models import Team, Checkpoint, Goal, EvaluationChart
from bnd.forms import GoalForm


team_module = Blueprint(
    'team', __name__, template_folder='templates/team')


@team_module.route('/view_all')
def view_all():
    teams = Team.query.all()
    context = dict(
        teams=teams,
    )
    return render_template('view_all.html', **context)


@team_module.route('/<int:id>')
def view(id):
    team = Team.get_or_404(id)

    context = dict(
        team=team,
    )
    return render_template('team/view.html', **context)


@team_module.route('/<int:id>/progress')
def progress(id):
    team = Team.get_or_404(id)

    chart_data = EvaluationChart().get_chart_data(current_user, team)

    context = dict(
        team=team,
        chart_labels=chart_data[0],
        chart_evaluations=chart_data[1],
    )
    return render_template('team/progress.html', **context)


@team_module.route('/join/<id>')
def join(id):
    team = Team.get_or_404(id)
    context = dict(
        team=team,
    )
    return render_template('join.html', **context)


@team_module.route('/<int:team_id>/checkpoint/<int:checkpoint_id>')
@login_required
def checkpoint_view(team_id, checkpoint_id):
    team = Team.get_or_404(team_id)
    checkpoint = Checkpoint.get_or_404(checkpoint_id)
    context = dict(
        team=team,
        checkpoint=checkpoint,
    )
    return render_template('/checkpoint_view.html', **context)


@team_module.route(
    '/<int:team_id>/goal/new',
    methods=['get', 'post'],
    defaults=dict(goal_id='new'))
@team_module.route(<commit_msg>Being explicit is better than being implicit<commit_after>from flask import Blueprint, render_template, request, redirect, url_for
from flask.ext.login import login_required, current_user
from bnd.models import Team, Checkpoint, Goal, EvaluationChart
from bnd.forms import GoalForm


team_module = Blueprint(
    'team', __name__, template_folder='templates/team')


@team_module.route('/view_all')
def view_all():
    teams = Team.query.all()
    context = dict(
        teams=teams,
    )
    return render_template('view_all.html', **context)


@team_module.route('/<int:team_id>')
def view(team_id):
    team = Team.get_or_404(team_id)

    context = dict(
        team=team,
    )
    return render_template('team/view.html', **context)


@team_module.route('/<int:team_id>/progress')
def progress(team_id):
    team = Team.get_or_404(team_id)

    chart_data = EvaluationChart().get_chart_data(current_user, team)

    context = dict(
        team=team,
        chart_labels=chart_data[0],
        chart_evaluations=chart_data[1],
    )
    return render_template('team/progress.html', **context)


@team_module.route('/join/<int:team_id>')
def join(team_id):
    team = Team.get_or_404(team_id)
    context = dict(
        team=team,
    )
    return render_template('join.html', **context)


@team_module.route('/<int:team_id>/checkpoint/<int:checkpoint_id>')
@login_required
def checkpoint_view(team_id, checkpoint_id):
    team = Team.get_or_404(team_id)
    checkpoint = Checkpoint.get_or_404(checkpoint_id)
    context = dict(
        team=team,
        checkpoint=checkpoint,
    )
    return render_template('/checkpoint_view.html', **context)


@team_module.route(
    '/<int:team_id>/goal/new',
    methods=['get', 'post'],
    defaults=dict(goal_id='new'))
@team_module.route(
{'fraction_non_alphanumeric': 0.13548203080433543, 'fraction_numerical': 0.009697661152310326, 'mean_word_length': 4.075253256150506, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2296667', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1173, 'n_words': 205}