<commit_before>"""

This module contains all of the APIs for managing speedtests,
including the creation and completion thereof.

Author: <NAME>
Date: 02/21/2015

"""
from flask import request
from common.auth_model import User
from common.test_result import TestResult
from common.auth_util import requires_token
from common.json_util import JSON_SUCCESS
from . import rest_blueprint

@rest_blueprint.route("/testfunc", methods=['POST'])
@requires_token()
def test_func():
    """ Test function for logged in users. """
    auth_user = User.get_user(auth_token=request.form['token'])

    return JSON_SUCCESS(
        your_email=auth_user.email
        )

@rest_blueprint.route("/start_test", methods=['POST'])
def start_test():
    """ Test function for logged in users. """

    ip = request.remote_addr
    token = request.form['token']
    print ip, token

    rec = TestResult.get_set_by_token_ip(token, ip)

    rec.state = 'ack'


    # Ookla IPs / DNS IPs / Ping IPs
    config = {<commit_msg>Should expect id, not token as parameter.<commit_after>"""

This module contains all of the APIs for managing speedtests,
including the creation and completion thereof.

Author: <NAME>
Date: 02/21/2015

"""
from flask import request
from common.auth_model import User
from common.test_result import TestResult
from common.auth_util import requires_token
from common.json_util import JSON_SUCCESS
from . import rest_blueprint

@rest_blueprint.route("/testfunc", methods=['POST'])
@requires_token()
def test_func():
    """ Test function for logged in users. """
    auth_user = User.get_user(auth_token=request.form['id'])

    return JSON_SUCCESS(
        your_email=auth_user.email
        )

@rest_blueprint.route("/start_test", methods=['POST'])
def start_test():
    """ Test function for logged in users. """

    ip = request.remote_addr
    token = request.form['token']
    print ip, token

    rec = TestResult.get_set_by_token_ip(token, ip)

    rec.state = 'ack'


    # Ookla IPs / DNS IPs / Ping IPs
    config = {
{'fraction_non_alphanumeric': 0.1074420896993593, 'fraction_numerical': 0.007885657959586003, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 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': '5256675', 'n_tokens_mistral': 642, 'n_tokens_neox': 607, 'n_words': 184}