<commit_before># -*- coding: utf-8 -*-

import unittest
import time

import intelmq.lib.test as test
from intelmq.lib import utils
from intelmq.bots.experts.threshold.expert import ThresholdExpertBot

EVENT_PATTERN = {
    'feed.url': 'file://localhost/test',
    'feed.name': 'Threshold expert test',
    '__type': 'Event',
    'raw': utils.base64_encode('test'),
    'time.observation': '2020-09-11T10:40:18+02:00',
    'source.ip': '192.0.2.0',
    'classification.type': 'test'
}

EVENTS_IN = []
for i in range(30):
    EVENTS_IN += [{**EVENT_PATTERN,
                   **{'destination.ip': '192.0.2.%d' % i}}]
EVENTS_OUT = [msg.copy() for msg in EVENTS_IN]
for msg in EVENTS_OUT:
    msg['extra.count'] = 10


PARAMETERS = {<commit_msg>TST BUG: fix threshold expert test<commit_after># -*- coding: utf-8 -*-

import unittest
import time

import intelmq.lib.test as test
from intelmq.lib import utils
from intelmq.bots.experts.threshold.expert import ThresholdExpertBot

EVENT_PATTERN = {
    'feed.url': 'file://localhost/test',
    'feed.name': 'Threshold expert test',
    '__type': 'Event',
    'raw': utils.base64_encode('test'),
    'time.observation': '2020-09-11T10:40:18+02:00',
    'source.ip': '192.0.2.0',
    'classification.type': 'test'
}

EVENTS_IN = []
for i in range(30):
    EVENTS_IN += [{**EVENT_PATTERN,
                   **{'destination.ip': '192.0.2.%d' % i}}]
EVENTS_OUT = [msg.copy() for msg in EVENTS_IN]
for msg in EVENTS_OUT:
    msg['extra.count'] = 10


PARAMETERS = {
    'add_keys': {},
{'fraction_non_alphanumeric': 0.1737704918032787, 'fraction_numerical': 0.04721311475409836, 'mean_word_length': 3.488235294117647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5557804', 'n_tokens_mistral': 603, 'n_tokens_neox': 560, 'n_words': 124}