<commit_before>import itertools
import traceback
import json

from django.conf import settings
from django.utils import timezone

from realtime import crossbarconnect

if settings.USE_MQTT:
    import paho.mqtt.client as mqtt

def send_message(key, message, *args, **kwargs):
    print("MESSAGE")
    if settings.USE_WAMP:
        try:
            client = crossbarconnect.Client(
                settings.CROSSBAR_URL,
                secret=settings.CROSSBAR_SECRET,
                key="incubator"
            )

            client.publish(
                topic="incubator.actstream",
                key=key,
                text=message.format(*args, **kwargs),
                time=timezone.now().isoformat(),
            )
        except Exception:
            traceback.print_exc()
            try:
                from raven.contrib.django.raven_compat.models import client<commit_msg>Remove print<commit_after>import itertools
import traceback
import json

from django.conf import settings
from django.utils import timezone

from realtime import crossbarconnect

if settings.USE_MQTT:
    import paho.mqtt.client as mqtt

def send_message(key, message, *args, **kwargs):
    if settings.USE_WAMP:
        try:
            client = crossbarconnect.Client(
                settings.CROSSBAR_URL,
                secret=settings.CROSSBAR_SECRET,
                key="incubator"
            )

            client.publish(
                topic="incubator.actstream",
                key=key,
                text=message.format(*args, **kwargs),
                time=timezone.now().isoformat(),
            )
        except Exception:
            traceback.print_exc()
            try:
                from raven.contrib.django.raven_compat.models import client
{'fraction_non_alphanumeric': 0.08031674208144797, 'fraction_numerical': 0.0, 'mean_word_length': 1.9047619047619047, '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': '3784361', 'n_tokens_mistral': 496, 'n_tokens_neox': 473, 'n_words': 103}