<commit_before>from flask import Flask, request
app = Flask(__name__)
import json
from messageEntity import MessageEntity
from messageHandler import MessageHandler
import credentials

messageHandler = MessageHandler()
VERIFYTOKEN = credentials.VERIFYTOKEN
AUTHTOKEN = credentials.AUTHTOKEN

@app.route('/fbchatbot/', methods=['GET'])
def verify():
    if request.args.get('hub.verify_token', '') == VERIFYTOKEN:
        print 'verify token sent'
        return request.args.get('hub.challenge', '')
    else:
        return 'Error, wrong validation token'


@app.route('/fbchatbot/', methods=['POST'])
def webhook():
    print 'incoming msg!'
    payload = json.loads(request.get_data())

    response = messageHandler.buildResponseForRequest(payload)

    if response:

        ### temporary messy multiplechoice test
        if response['responsetext'] == 'multiplechoice':
            print 'testing multiple choice response...'
            messageHandler.testMultipleChoiceResponse(AUTHTOKEN)

        print 'sending response!'
        messageHandler.sendResponse(response, AUTHTOKEN)
    else:
        print 'no response was send.'
    return 'ok'


if __name__ == "__main__":
    app.run(debug=True)
<commit_msg>forgot to pass response to multiplechoice fn<commit_after>from flask import Flask, request
app = Flask(__name__)
import json
from messageEntity import MessageEntity
from messageHandler import MessageHandler
import credentials

messageHandler = MessageHandler()
VERIFYTOKEN = credentials.VERIFYTOKEN
AUTHTOKEN = credentials.AUTHTOKEN

@app.route('/fbchatbot/', methods=['GET'])
def verify():
    if request.args.get('hub.verify_token', '') == VERIFYTOKEN:
        print 'verify token sent'
        return request.args.get('hub.challenge', '')
    else:
        return 'Error, wrong validation token'


@app.route('/fbchatbot/', methods=['POST'])
def webhook():
    print 'incoming msg!'
    payload = json.loads(request.get_data())

    response = messageHandler.buildResponseForRequest(payload)

    if response:

        ### temporary messy multiplechoice test
        if response['responsetext'] == 'multiplechoice!':
            print 'testing multiple choice response...'
            messageHandler.testMultipleChoiceResponse(AUTHTOKEN)

        print 'sending response!'
        messageHandler.sendResponse(response, response, AUTHTOKEN)
    else:
        print 'no response was send.'
    return 'ok'


if __name__ == "__main__":
    app.run(debug=True)

{'fraction_non_alphanumeric': 0.1089588377723971, 'fraction_numerical': 0.0, 'mean_word_length': 3.7490421455938696, 'pattern_counts': {'":': 2, '<': 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': '5229095', 'n_tokens_mistral': 680, 'n_tokens_neox': 669, 'n_words': 181}