<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/>.
"""
from coalib.bears.results.LineResult import Result, LineResult


class Outputter:
    def _print_result(self, result):
        raise NotImplementedError

    def _print_line_result(self, result):
        raise NotImplementedError

    def print_result(self, result):
        if not isinstance(result, Result):
            raise TypeError("print_result can only handle objects which inherit from Result.")

        if type(result) == LineResult:
            return self._print_line_result(result)

        return self._print_result(result)

    def acquire_settings(self, settings):
        """
        This method prompts the user for the given settings.

        :param settings: a dictionary with the settings name as key and a list containing a description in [0] and the
                         name of the bears who need this setting in [1] and following. Example:
        {"UseTabs": ["describes whether tabs should be used instead of spaces",
                     "SpaceConsistencyBear",
                     "SomeOtherBear"]}

        :return: a dictionary with the settings name as key and the given value as value.
        """
        raise NotImplementedError<commit_msg>Outputter: Fall back to _print_result if needed<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/>.
"""
from coalib.bears.results.LineResult import Result, LineResult


class Outputter:
    def _print_result(self, result):
        raise NotImplementedError

    def _print_line_result(self, result):
        return self._print_result(result)

    def print_result(self, result):
        if not isinstance(result, Result):
            raise TypeError("print_result can only handle objects which inherit from Result.")

        if type(result) == LineResult:
            return self._print_line_result(result)

        return self._print_result(result)

    def acquire_settings(self, settings):
        """
        This method prompts the user for the given settings.

        :param settings: a dictionary with the settings name as key and a list containing a description in [0] and the
                         name of the bears who need this setting in [1] and following. Example:
        {"UseTabs": ["describes whether tabs should be used instead of spaces",
                     "SpaceConsistencyBear",
                     "SomeOtherBear"]}

        :return: a dictionary with the settings name as key and the given value as value.
        """
        raise NotImplementedError
{'fraction_non_alphanumeric': 0.0587915078933043, 'fraction_numerical': 0.001633097441480675, 'mean_word_length': 3.0207877461706785, 'pattern_counts': {'":': 2, '<': 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': '4196337', 'n_tokens_mistral': 898, 'n_tokens_neox': 863, 'n_words': 435}