<commit_before>import json
import flask
import sys
import traceback
from flask import Flask, request, make_response, session, g, redirect, url_for, \
     abort, render_template, flash
from dataactcore.utils.responseException import ResponseException

class JsonResponse :

    debugMode = True
    printDebug = False

    @staticmethod
    def create(code,dictionaryData):
        """
        Creates a JSON response object
        if debugMode is enabled errors are added
        """
        jsondata  =  flask.Response()
        jsondata.headers["Content-Type"] = "application/json"
        jsondata.status_code = code
        jsondata.set_data(json.dumps(dictionaryData))
        open("errorLog","a").write("Finished creating response\n")
        return jsondata
<commit_msg>Still debugging web-api on ec2<commit_after>import json
import flask
import sys
import traceback
from flask import Flask, request, make_response, session, g, redirect, url_for, \
     abort, render_template, flash
from dataactcore.utils.responseException import ResponseException

class JsonResponse :

    debugMode = True
    printDebug = False

    @staticmethod
    def create(code,dictionaryData):
        """
        Creates a JSON response object
        if debugMode is enabled errors are added
        """
        open("errorLog","a").write("Called create response\n")
        jsondata  =  flask.Response()
        jsondata.headers["Content-Type"] = "application/json"
        jsondata.status_code = code
        open("errorLog","a").write("Setting data\n")
        jsondata.set_data(json.dumps(dictionaryData))
        open("errorLog","a").write("Finished creating response\n")
        return jsondata

{'fraction_non_alphanumeric': 0.09166173861620343, 'fraction_numerical': 0.0005913660555884093, 'mean_word_length': 3.2194513715710724, 'pattern_counts': {'":': 0, '<': 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': '5195590', 'n_tokens_mistral': 459, 'n_tokens_neox': 459, 'n_words': 125}