<commit_before>"""
Simple twillio callback app
"""

from flask import Flask
from twilio import twiml

app = Flask(__name__)

@app.route("/record.xml", methods=['GET', 'POST'])
def record():
    response = twiml.Response()
    response.pause(length=120)
    return str(response)<commit_msg>add basic rest api<commit_after>"""
Simple twillio callback app
"""

import sys
from flask import Flask
from twilio import twiml

from storage.models import Database

app = Flask(__name__)
db = Database()


@app.route("/", methods=['GET', 'POST'])
def index():
    return str(db.list_calls())


@app.route("/ain/<ain>", methods=['GET'])
def get_ain(ain):
    return str(db.get_ain(ain))
    

@app.route("/ain/<ain>", methods=['POST'])
def post_ain(ain):
    return db.upload_new_requests([ain]) 
    

@app.route("/record.xml", methods=['GET', 'POST'])
def record():
    response = twiml.Response()
    response.pause(length=120)
    return str(response)
{'fraction_non_alphanumeric': 0.1694915254237288, 'fraction_numerical': 0.006355932203389831, 'mean_word_length': 4.658682634730539, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7435107', 'n_tokens_mistral': 324, 'n_tokens_neox': 314, 'n_words': 79}