<commit_before>import logging
from carrot.messaging import Publisher
from carrot.connection import BrokerConnection

from lamson.routing import route, route_like, stateless
from config.settings import relay
from lamson import view, queue



@route("forge-list@(host)")
#@route("(post_name)@osb\\.(host)")
@stateless
def POSTING(message, post_name=None, host=None):
    relay.deliver(message)

    conn = BrokerConnection(hostname="localhost", port=5672,
                              userid="celeryuser", password="<PASSWORD>",
                              virtual_host="celeryvhost")

    publisher = Publisher(connection=conn,
                            exchange="forge", routing_key="mail")
    publisher.send({"message": message})
    publisher.close()

    #index_q = queue.Queue("run/posts")
    #index_q.push(message)
<commit_msg>Change carrot serialization from JSON to 'pickle'<commit_after>import logging
from carrot.messaging import Publisher
from carrot.connection import BrokerConnection

from lamson.routing import route, route_like, stateless
from config.settings import relay
from lamson import view, queue



@route("forge-list@(host)")
#@route("(post_name)@osb\\.(host)")
@stateless
def POSTING(message, post_name=None, host=None):
    relay.deliver(message)

    conn = BrokerConnection(hostname="localhost", port=5672,
                              userid="celeryuser", password="<PASSWORD>",
                              virtual_host="celeryvhost")

    publisher = Publisher(connection=conn,
                            exchange="forge", routing_key="mail")
    publisher.send({"message": message}, serializer="pickle")
    publisher.close()

    #index_q = queue.Queue("run/posts")
    #index_q.push(message)

{'fraction_non_alphanumeric': 0.11988472622478386, 'fraction_numerical': 0.004610951008645533, 'mean_word_length': 3.4974093264248705, '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': '7428654', 'n_tokens_mistral': 516, 'n_tokens_neox': 498, 'n_words': 105}