<commit_before>#! coding:utf-8


class FailureException(Exception):
    """This class mainly used for __bool__,
        self.error for reviewing the source exception."""

    def __init__(self, error):
        self.__dict__ = error.__dict__
        self.error = error
        self.ok = False

    def __bool__(self):
        return False

    def __nonzero__(self):
        return False

    def __str__(self):
        return repr(self)<commit_msg>set CommonException as default Exception with always False not callable<commit_after>#! coding:utf-8


class CommonException(Exception):

    def __init__(self, name):
        self.name = name

    def __bool__(self):
        return False

    def __nonzero__(self):
        return False

    def __call__(self, *args, **kwargs):
        raise TypeError('%s object is not callable' % repr(self))

    def __str__(self):
        return "%s: %s" % (self.__class__.__name__, self.name)

    def __repr__(self):
        return "%s('%s',)" % (self.__class__.__name__, self.name)


class FailureException(CommonException):
    """This class mainly used for __bool__,
        self.error for reviewing the source exception."""

    def __init__(self, error, name=None):
        self.__dict__ = error.__dict__
        self.error = error
        self.name = self.error.__class__.__name__
        self.ok = False


class ImportErrorModule(CommonException, ImportError):
    """
    This obj will raise error while __call__.
    bool(self) will always be False.
    """
{'fraction_non_alphanumeric': 0.10431893687707641, 'fraction_numerical': 0.00132890365448505, 'mean_word_length': 2.7839195979899496, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7025219', 'n_tokens_mistral': 439, 'n_tokens_neox': 416, 'n_words': 127}