<commit_before>import math


class PrimeChecker(object):

    def run(self, **kwargs):
        return self._is_prime(**kwargs)

    def _is_prime(self, value=0):
        if math.floor(value) != value:
            raise ValueError('%s should be an integer.' % value)
        if value < 2:
            return False
        for test in range(2, int(math.floor(math.sqrt(value)))+1):
            if value % test == 0:
                return False
        return True

if __name__ == '__main__':
    checker = PrimeChecker()
    for i in range(0, 10):
        print '%s : %s' % (i, checker.run(**{'value': i}))
<commit_msg>Update pythonaction sample for simpler run.<commit_after>import math


class PrimeChecker(object):

    def run(self, value=0):
        if math.floor(value) != value:
            raise ValueError('%s should be an integer.' % value)
        if value < 2:
            return False
        for test in range(2, int(math.floor(math.sqrt(value)))+1):
            if value % test == 0:
                return False
        return True

if __name__ == '__main__':
    checker = PrimeChecker()
    for i in range(0, 10):
        print '%s : %s' % (i, checker.run(**{'value': i}))

{'fraction_non_alphanumeric': 0.13445378151260504, 'fraction_numerical': 0.013445378151260505, 'mean_word_length': 2.2016129032258065, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5993965', 'n_tokens_mistral': 375, 'n_tokens_neox': 362, 'n_words': 112}