<commit_before>from flask import Blueprint, request, url_for, jsonify
from app.models import Simulation
api = Blueprint('api', __name__)

@api.route('/')
def home():
    return jsonify(hello='world')

@api.route('/simulations', methods=['POST'])
def getSimulation():
    body = request.get_json()
    start = body['start']
    end = body['end']
    aggregate = body['aggregate']
    results = Simulation.getRange(start, end)
    return jsonify(contents=results, average="not implemented")

@api.route('/dailyLoad')
def getDaily():
    return jsonify(status='sup')

@api.route('/weeklyLoad')
def getWeekly():
    return jsonify(load='week')

@api.route('/test')
def test():
    return jsonify(
        [
            {"name": "General", "toggle": {"switchIsOn": False}, "options": [
                {"name": "Temperature", "optionType": "slider", "state": {"minimum": "20", "maximum":"120"}},
                {"name": "Microwave", "optionType": "switch", "state": {"switchIsOn": False}},
                {"name": "Dishwasher", "optionType": "switch", "state": {"switchIsOn": False}}
                ]
            },
            {"name": "Kitchen", "toggle": {"switchIsOn": False}, "options": [
                {"name": "Lights", "optionType": "switch", "state": {"switchIsOn": False}},
                {"name": "Microwave", "optionType": "switch", "state": {"switchIsOn": False}},
                {"name": "Dishwasher", "optionType": "switch", "state": {"switchIsOn": False}}
                ]
            },
            {"name": "Living Room", "toggle": {"switchIsOn": False}, "options": [<commit_msg>Working API aggregator<commit_after>from flask import Blueprint, request, url_for, jsonify
from app.models import Simulation
api = Blueprint('api', __name__)

@api.route('/')
def home():
    return jsonify(hello='world')

@api.route('/simulations', methods=['POST'])
def getSimulation():
    body = request.get_json()
    start = body['start']
    end = body['end']
    aggregate = body['aggregate']
    results = Simulation.getRange(start, end, aggregate)
    return jsonify(contents=results, average="not implemented")

@api.route('/dailyLoad')
def getDaily():
    return jsonify(status='sup')

@api.route('/weeklyLoad')
def getWeekly():
    return jsonify(load='week')

@api.route('/test')
def test():
    return jsonify(
        [
            {"name": "General", "toggle": {"switchIsOn": False}, "options": [
                {"name": "Temperature", "optionType": "slider", "state": {"minimum": "20", "maximum":"120"}},
                {"name": "Microwave", "optionType": "switch", "state": {"switchIsOn": False}},
                {"name": "Dishwasher", "optionType": "switch", "state": {"switchIsOn": False}}
                ]
            },
            {"name": "Kitchen", "toggle": {"switchIsOn": False}, "options": [
                {"name": "Lights", "optionType": "switch", "state": {"switchIsOn": False}},
                {"name": "Microwave", "optionType": "switch", "state": {"switchIsOn": False}},
                {"name": "Dishwasher", "optionType": "switch", "state": {"switchIsOn": False}}
                ]
            },
            {"name": "Living Room", "toggle": {"switchIsOn": False}, "options": [
{'fraction_non_alphanumeric': 0.20341614906832298, 'fraction_numerical': 0.003105590062111801, 'mean_word_length': 3.1940104166666665, 'pattern_counts': {'":': 74, '<': 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': '1839173', 'n_tokens_mistral': 981, 'n_tokens_neox': 940, 'n_words': 233}