<commit_before>import abc
import traceback

FUNC_LIST = []

class WithStackTrace(object):
    """abstract class that can be mixed in to allow functions to use the
        'with_stacktrace' decorator.
        This will enable proper error reporting in functions that can be overridden
        by either end-users or developers
    """
    __metaclass__ = abc.ABCMeta

    def __getattribute__(self, name):
        if name in FUNC_LIST:
            obj_getattribute = object.__getattribute__(self, name)

            def catche_errs(*pargs, **kwargs):
                try:
                    res = obj_getattribute(*pargs, **kwargs)
                except BaseException as err:
                    traceback.print_exc()
                    raise err

                return res

            return catche_errs
        else:
            return object.__getattribute__(self, name)

def with_stacktrace(func):
    FUNC_LIST.append(func.__name__)<commit_msg>#479: rename function as per comment request<commit_after>import abc
import traceback

FUNC_LIST = []

class WithStackTrace(object):
    """abstract class that can be mixed in to allow functions to use the
        'with_stacktrace' decorator.
        This will enable proper error reporting in functions that can be overridden
        by either end-users or developers
    """
    __metaclass__ = abc.ABCMeta

    def __getattribute__(self, name):
        if name in FUNC_LIST:
            func_needing_stacktrace = object.__getattribute__(self, name)

            def catche_errs(*pargs, **kwargs):
                try:
                    res = func_needing_stacktrace(*pargs, **kwargs)
                except BaseException as err:
                    traceback.print_exc()
                    raise err

                return res

            return catche_errs
        else:
            return object.__getattribute__(self, name)

def with_stacktrace(func):
    FUNC_LIST.append(func.__name__)
{'fraction_non_alphanumeric': 0.0645822655048693, 'fraction_numerical': 0.0015376729882111738, 'mean_word_length': 2.093502377179081, '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': '4028161', 'n_tokens_mistral': 518, 'n_tokens_neox': 494, 'n_words': 157}