<commit_before>import functools
import operator


class CalculatorError(Exception):
    pass


class Calculator(object):

    def add(self, *args):
        try:
            return functools.reduce(operator.add, args, 0)
        except TypeError as ex:
            raise CalculatorError('Sorry! Your input is invalid.') from ex<commit_msg>Don't forget to refactor!<commit_after>class CalculatorError(Exception):
    pass


class Calculator(object):

    def add(self, *args):
        try:
            return sum(args)
        except TypeError as ex:
            raise CalculatorError('Sorry! Your input is invalid.') from ex
{'fraction_non_alphanumeric': 0.08667736757624397, 'fraction_numerical': 0.0016051364365971107, 'mean_word_length': 2.8518518518518516, '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': '2585323', 'n_tokens_mistral': 183, 'n_tokens_neox': 169, 'n_words': 54}