<commit_before>import json
from bson import json_util
from flask import Flask
from pymongo import MongoClient
from flask import Flask
from fake_data_crud_service.rest.books import books
from fake_data_crud_service.resources.schema import schema


class RootREST:

    def __init__(self, host, run_flask):
        self.host = host
        self.run_flask = run_flask
        self.app = Flask(__name__)
        self.app.register_blueprint(books, url_prefix='/books')

        # # Root service.
        @self.app.route('/', methods=['GET'])
        def say_hello_service():
            return json.dumps(schema, sort_keys=True, indent=4, default=json_util.default),\
                   200,\
                   {'Content-Type': 'application/schema+json; charset=utf-8'}

        # Run Flask.
        if self.run_flask:                              # pragma: no cover
            self.app.run(host=self.host, debug=True)    # pragma: no cover


def run_engine(host):                                   # pragma: no cover
    RootREST(host, True)                                # pragma: no cover

if __name__ == '__main__':                              # pragma: no cover
    run_engine('localhost')                             # pragma: no cover<commit_msg>Testing Heroku.<commit_after>import json
from bson import json_util
from flask import Flask
from pymongo import MongoClient
from flask import Flask
from fake_data_crud_service.rest.books import books
from fake_data_crud_service.resources.schema import schema


class RootREST:

    def __init__(self, host, run_flask):
        self.host = host
        self.run_flask = run_flask
        self.app = Flask(__name__)
        self.app.register_blueprint(books, url_prefix='/books')

        # # Root service.
        @self.app.route('/', methods=['GET'])
        def say_hello_service():
            return json.dumps(schema, sort_keys=True, indent=4, default=json_util.default),\
                   200,\
                   {'Content-Type': 'application/schema+json; charset=utf-8'}

        # Run Flask.
        if self.run_flask:                              # pragma: no cover
            self.app.run(host=self.host, debug=True)    # pragma: no cover


def run_engine(host):                                   # pragma: no cover
    RootREST(host, True)                                # pragma: no cover

if __name__ == '__main__':                              # pragma: no cover
    run_engine('0.0.0.0')                               # pragma: no cover
{'fraction_non_alphanumeric': 0.09417398244213887, 'fraction_numerical': 0.00558659217877095, 'mean_word_length': 1.868421052631579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1123425', 'n_tokens_mistral': 733, 'n_tokens_neox': 698, 'n_words': 174}