<commit_before>"""
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import sys
import traceback
from coalib.misc.StringConstants import StringConstants
from coalib.misc.i18n import _
from coalib.output.LOG_LEVEL import LOG_LEVEL
from coalib.processes.Process import Process
from coalib.processes.communication.LogMessage import LogMessage


class Analyser(Process):
    """
    This is the base class for every analyser. If you want to write an analyser, inherit from this class and overwrite
    at least the run_analyser method. You can send debug/warning/error messages through the debug_msg(), warn_msg(),
    fail_msg() functions. These will send the appropriate messages so that they are outputted. Be aware that if you
    use fail_msg(), you are expected to also terminate the analyser run-through immediately.

    If you need some setup or teardown for your analyser, feel free to overwrite the set_up() and tear_down() functions.
    They will be invoked before/after every run_analyser invocation.

    Settings are available at all times through self.settings. You can access the translation database with the self._()
    function, it will be routed to the usual gettext _(). Be aware that the strings you use are not necessarily in the
    database, especially if your analyser is not shipped with coala. Feel free to use your own translation database in
    this case or consider make your analyser available to the coala project.
    """
    def __init__(self, settings,
                 message_queue,
                 TIMEOUT=0.2):
        self.settings = settings
        self.message_queue = message_queue
        self.TIMEOUT = TIMEOUT

    def _(self, msg):
        return _(msg)

    def set_up(self):
        pass

    def tear_down(self):
        pass
<commit_msg>Analyser: Codestyle fix<commit_after>"""
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import sys
import traceback
from coalib.misc.StringConstants import StringConstants
from coalib.misc.i18n import _
from coalib.output.LOG_LEVEL import LOG_LEVEL
from coalib.processes.Process import Process
from coalib.processes.communication.LogMessage import LogMessage


class Analyser(Process):
    """
    This is the base class for every analyser. If you want to write an analyser, inherit from this class and overwrite
    at least the run_analyser method. You can send debug/warning/error messages through the debug_msg(), warn_msg(),
    fail_msg() functions. These will send the appropriate messages so that they are outputted. Be aware that if you
    use fail_msg(), you are expected to also terminate the analyser run-through immediately.

    If you need some setup or teardown for your analyser, feel free to overwrite the set_up() and tear_down() functions.
    They will be invoked before/after every run_analyser invocation.

    Settings are available at all times through self.settings. You can access the translation database with the self._()
    function, it will be routed to the usual gettext _(). Be aware that the strings you use are not necessarily in the
    database, especially if your analyser is not shipped with coala. Feel free to use your own translation database in
    this case or consider make your analyser available to the coala project.
    """
    def __init__(self,
                 settings,
                 message_queue,
                 TIMEOUT=0.2):
        self.settings = settings
        self.message_queue = message_queue
        self.TIMEOUT = TIMEOUT

    def _(self, msg):
        return _(msg)

    def set_up(self):
        pass

    def tear_down(self):
        pass

{'fraction_non_alphanumeric': 0.050031665611146296, 'fraction_numerical': 0.0021110407430863414, 'mean_word_length': 3.512380952380952, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5081528', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1150, 'n_words': 618}