<commit_before>import os
from flask import Flask, jsonify, render_template, json, request, redirect

from core import app
import logic

@app.route("/")
def home():
    return 'Nothing to see here - go to api'

@app.route('/api/v1/note/<id>', methods=['GET', 'POST'])
def api_note(id):
    if request.method == 'GET':
        out = logic.note_get(id)
        return jsonify(out)
    else:
        pass

@app.route('/api/v1/note', methods=['GET', 'POST', 'PUT'])
def api_note_index():
    if request.method == 'GET':
        # TODO: query
        pass
    else:
        print 'XXXX',  request.data
        data = json.loads(request.data)
        print 'XXXXX', data
        logic.note_upsert(data['id'], data)
        out = {
            'status': 'ok'
        }
        return jsonify(out)


if __name__ == "__main__":
    app.run(host='0.0.0.0', debug=True)
<commit_msg>[web.py][xs]: remove left-in print statements.<commit_after>import os
from flask import Flask, jsonify, render_template, json, request, redirect

from core import app
import logic

@app.route("/")
def home():
    return 'Nothing to see here - go to api'

@app.route('/api/v1/note/<id>', methods=['GET', 'POST'])
def api_note(id):
    if request.method == 'GET':
        out = logic.note_get(id)
        return jsonify(out)
    else:
        pass

@app.route('/api/v1/note', methods=['GET', 'POST', 'PUT'])
def api_note_index():
    if request.method == 'GET':
        # TODO: query
        pass
    else:
        data = json.loads(request.data)
        logic.note_upsert(data['id'], data)
        out = {
            'status': 'ok'
        }
        return jsonify(out)


if __name__ == "__main__":
    app.run(host='0.0.0.0', debug=True)

{'fraction_non_alphanumeric': 0.16091281451141018, 'fraction_numerical': 0.007021650087770626, 'mean_word_length': 2.577405857740586, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '184661', 'n_tokens_mistral': 579, 'n_tokens_neox': 581, 'n_words': 148}