<commit_before>from themint import app
from themint.utils import unixts
from datatypes import system_of_record_request_validator
from datatypes.core import str_to_uni_dict
import json

class MintMessageService(object):
    def __init__(self, writer):
        self.writer = writer

    def wrap_message_for_system_of_record(self, message):
        signed = str_to_uni_dict({
            'object' : {
                "data": json.dumps(message),
                "object_id": message['title_number'],
                "initial_request_timestamp": unixts()
                # optional:
                # created_by
                # reason_for_change
                # chains  [ chain_name, chain_value ]
            }
        })

        system_of_record_request_validator.validate(signed)

        app.logger.info("Submitting %s to the system or record" % signed)
        self.writer.send_to_system_of_record(signed)

    def health(self):
        return self.writer.health()<commit_msg>use new unicoded function name<commit_after>from themint import app
from themint.utils import unixts
from datatypes import system_of_record_request_validator
from datatypes.core import unicoded
import json

class MintMessageService(object):
    def __init__(self, writer):
        self.writer = writer

    def wrap_message_for_system_of_record(self, message):
        signed = unicoded({
            'object' : {
                "data": json.dumps(message),
                "object_id": message['title_number'],
                "initial_request_timestamp": unixts()
                # optional:
                # created_by
                # reason_for_change
                # chains  [ chain_name, chain_value ]
            }
        })

        system_of_record_request_validator.validate(signed)

        app.logger.info("Submitting %s to the system or record" % signed)
        self.writer.send_to_system_of_record(signed)

    def health(self):
        return self.writer.health()
{'fraction_non_alphanumeric': 0.0792280345352971, 'fraction_numerical': 0.0, 'mean_word_length': 2.3675213675213675, 'pattern_counts': {'":': 6, '<': 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': '5311458', 'n_tokens_mistral': 565, 'n_tokens_neox': 542, 'n_words': 117}