<commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging
import pika
from typing import Text

logger = logging.getLogger(__name__)


class EventChannel(object):
    def publish(self, event):
        # type: (Text) -> None
        """Publishes a json-formatted Rasa Core event into an event queue."""

        raise NotImplementedError("Event broker must implement the `publish` "
                                  "method")


class PikaProducer(EventChannel):
    def __init__(self, host, username, password, queue='rasa_core_events'):
        self.queue = queue
        self.host = host
        self.credentials = pika.PlainCredentials(username, password)

    def publish(self, event):<commit_msg>set pika log level to info by default<commit_after>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging
import pika
from typing import Text

logger = logging.getLogger(__name__)


class EventChannel(object):
    def publish(self, event):
        # type: (Text) -> None
        """Publishes a json-formatted Rasa Core event into an event queue."""

        raise NotImplementedError("Event broker must implement the `publish` "
                                  "method")


class PikaProducer(EventChannel):
    def __init__(self, host, username, password,
                 queue='rasa_core_events',
                 loglevel=logging.INFO):
        logger.level = loglevel
        self.queue = queue
        self.host = host
        self.credentials = pika.PlainCredentials(username, password)

    def publish(self, event):
{'fraction_non_alphanumeric': 0.07455890722822994, 'fraction_numerical': 0.0, 'mean_word_length': 3.107476635514019, 'pattern_counts': {'":': 0, '<': 3, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '468095', 'n_tokens_mistral': 462, 'n_tokens_neox': 449, 'n_words': 149}