<commit_before>import tornado.web
import json
import json

import tornado.web


class APIHandler(tornado.web.RequestHandler):
    """
    A requests handler for API calls, build
    """

    def initialize(self, **objects):
        """
        Initializes the request to JSON, adds objects, and logging.
        """

        self.set_header("Content-Type", "application/json")
        self.objects = objects
        self.logger = objects["logger"]

        #print(self.request.headers["Content-Type"])
        self.json = json.loads(self.request.body.decode("UTF-8"))
        # Set logging
        # print(self.request.method)
        # self.objects["logger"].info("%s" % __api_name__)


class MoleculeHandler(APIHandler):
    """
    A handler to push and get molecules.
    """
<commit_msg>Server: Fix web handler import duplication<commit_after>"""
Web handlers for the FractalServer
"""
import json
import tornado.web


class APIHandler(tornado.web.RequestHandler):
    """
    A requests handler for API calls, build
    """

    def initialize(self, **objects):
        """
        Initializes the request to JSON, adds objects, and logging.
        """

        self.set_header("Content-Type", "application/json")
        self.objects = objects
        self.logger = objects["logger"]

        #print(self.request.headers["Content-Type"])
        self.json = json.loads(self.request.body.decode("UTF-8"))
        # Set logging
        # print(self.request.method)
        # self.objects["logger"].info("%s" % __api_name__)


class MoleculeHandler(APIHandler):
    """
    A handler to push and get molecules.
    """

{'fraction_non_alphanumeric': 0.12931034482758622, 'fraction_numerical': 0.0012315270935960591, 'mean_word_length': 2.7528868360277134, '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': '1650338', 'n_tokens_mistral': 468, 'n_tokens_neox': 450, 'n_words': 111}