<commit_before>""" BasePlugin definitions. """

import logging
import threading
import traceback
import Queue
from importer import Importer, ImporterError
from sjutils import threadpool

class BasePluginError(Exception):
    """ Raised by BasePlugin. """

    def __init__(self, error):
        """ Init method. """
        Exception.__init__(self, error)

class BasePlugin(threading.Thread):
    """ Base class for job implementation in spvd. """


    def __init__(self, name, log_dir, log_name, log_level, event, url=None, params=None):
        """ Init method.

        @url: url pass to Importer.

        @params is a dictionnary of optional parameters among:
        importer_retry_timeout: interval between successive importer calls if
                                importer failed.
        max_parallel_checks:    maximum number of threads for this plugin.
        max_checks_queue:       maximum number of checks to get from
                                the DB and queue for execution.
        check_poll:             interval between two get_checks call.<commit_msg>Fix deadly mistake in BasePlugin.__init__() docstring<commit_after>""" BasePlugin definitions. """

import logging
import threading
import traceback
import Queue
from importer import Importer, ImporterError
from sjutils import threadpool

class BasePluginError(Exception):
    """ Raised by BasePlugin. """

    def __init__(self, error):
        """ Init method. """
        Exception.__init__(self, error)

class BasePlugin(threading.Thread):
    """ Base class for job implementation in spvd. """


    def __init__(self, name, log_dir, log_name, log_level, event, url=None, params=None):
        """ Init method.

        @url: url pass to Importer.

        @params is a dictionary of optional parameters among:
        importer_retry_timeout: interval between successive importer calls if
                                importer failed.
        max_parallel_checks:    maximum number of threads for this plugin.
        max_checks_queue:       maximum number of checks to get from
                                the DB and queue for execution.
        check_poll:             interval between two get_checks call.
{'fraction_non_alphanumeric': 0.07035860190649115, 'fraction_numerical': 0.0, 'mean_word_length': 2.607201309328969, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '876079', 'n_tokens_mistral': 558, 'n_tokens_neox': 535, 'n_words': 208}