<commit_before>import unittest
from game import Game

class BowlingGameTest(unittest.TestCase):

    def setUp(self):
        self.g = Game()

    def tearDown(self):
        self.g = None

    def test_gutter_game(self):
        for i in range(20):
            self.g.roll(0);

        self.assertEqual(0, self.g.score())

    def test_all_ones(self):
        for i in range(20):
            self.g.roll(1)

        self.assertEqual(20, self.g.score())

if __name__ == '__main__':
    unittest.main()<commit_msg>[Python] Refactor for code to roll many times<commit_after>import unittest
from game import Game

class BowlingGameTest(unittest.TestCase):

    def setUp(self):
        self.g = Game()

    def tearDown(self):
        self.g = None

    def _roll_many(self, n, pins):
        "Roll 'n' times a roll of 'pins' pins"
        for i in range(n):
            self.g.roll(pins)

    def test_gutter_game(self):
        self._roll_many(20, 0)
        self.assertEqual(0, self.g.score())

    def test_all_ones(self):
        self._roll_many(20, 1)
        self.assertEqual(20, self.g.score())

if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.12292938099389712, 'fraction_numerical': 0.015693112467306015, 'mean_word_length': 2.437125748502994, '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': '920424', 'n_tokens_mistral': 406, 'n_tokens_neox': 380, 'n_words': 93}