<commit_before>from flask import jsonify

class HttpError(Exception):
    status_code = 400

    def __init__(self, message, status_code=None):
        Exception.__init__(self)
        self.message = message
        if status_code is not None:
            self.status_code = status_code

    def to_json(self):
        dict = {"message": self.message}
        json = jsonify(dict)
        return json<commit_msg>Added license to exceptions.py<commit_after>"""
    Project Bluebox
    2015, University of Stuttgart, IPVS/AS
"""
""" 
    Project Bluebox 
    
    Copyright (C) <2015> <University of Stuttgart>
    
    This software may be modified and distributed under the terms
    of the MIT license.  See the LICENSE file for details.
"""

from flask import jsonify

class HttpError(Exception):
    status_code = 400

    def __init__(self, message, status_code=None):
        Exception.__init__(self)
        self.message = message
        if status_code is not None:
            self.status_code = status_code

    def to_json(self):
        d = {"message": self.message}
        json = jsonify(d)
        return json
{'fraction_non_alphanumeric': 0.0819234194122885, 'fraction_numerical': 0.012466607301869992, 'mean_word_length': 2.5910543130990416, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, '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': '7434737', 'n_tokens_mistral': 333, 'n_tokens_neox': 311, 'n_words': 100}