<commit_before>#!/usr/bin/env python

from collections import Counter
from .player import Player

class Game:

    def __init__(self, players=None):
        """
        Initialize the game instance.
        players may be initialized by argument or by calling the begin method.
        winning_numbers is initialized with an empty list. It should be populated
        by the generate_winning_numbers method when called.

        :param players (list): list of players
        """

        self.players = list()
        self.winning_numbers = list()

    def add_player(self):
        """
        Create a new player by calling the from_input method of Player class which returns Player instance.
        Add the instance to player list.
        """

        player = Player.from_input()
        self.players.append(player)

    def begin(self):
        """
        Begin the game by calling the add_player to add the first player.
        Keep asking if want to add more players.
        Call add_player till the answer is yes.
        """

        add_more = True

        # since add_more is True, this will ask for first player details by default.
        # further players data depend on user response to add more.

        while add_more:
            self.add_player()

            # True if user enters 'Y' or 'y'. False for any other input.

            add_more = (input("Do you want to add another employee? (y/n) : ").strip().lower() == 'y')

    def display_players(self):
        """
        Print all players data.
        """

        print('\n')

        for player in self.players:
            print(player)<commit_msg>add method to get white and power ball numbers of all players<commit_after>#!/usr/bin/env python

from collections import Counter
from .player import Player

class Game:

    def __init__(self, players=None):
        """
        Initialize the game instance.
        players may be initialized by argument or by calling the begin method.
        winning_numbers is initialized with an empty list. It should be populated
        by the generate_winning_numbers method when called.

        :param players (list): list of players
        """

        self.players = list()
        self.winning_numbers = list()

    def add_player(self):
        """
        Create a new player by calling the from_input method of Player class which returns Player instance.
        Add the instance to player list.
        """

        player = Player.from_input()
        self.players.append(player)

    def begin(self):
        """
        Begin the game by calling the add_player to add the first player.
        Keep asking if want to add more players.
        Call add_player till the answer is yes.
        """

        add_more = True

        # since add_more is True, this will ask for first player details by default.
        # further players data depend on user response to add more.

        while add_more:
            self.add_player()

            # True if user enters 'Y' or 'y'. False for any other input.

            add_more = (input("Do you want to add another employee? (y/n) : ").strip().lower() == 'y')

    def get_white_ball_numbers(self):
        """
        Get the white ball numbers from all the players and return as a list.

        :return (list): list of white ball numbers extracted from all the players numbers.
        """

        numbers = list()

        for player in self.players:
            numbers.extend(player.numbers[:-1])

        return numbers

    def get_power_ball_numbers(self):
        """
        Get the power ball numbers from all the players and return as a list.

        :return (list): list of power ball numbers extracted from all the players numbers.
        """

        numbers = list()

        for player in self.players:
            numbers.append(player.numbers[-1])

        return numbers

    def display_players(self):
        """
        Print all players data.
        """

        print('\n')

        for player in self.players:
            print(player)
{'fraction_non_alphanumeric': 0.07574636072045399, 'fraction_numerical': 0.0004934616333580064, 'mean_word_length': 2.04812030075188, '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': '760831', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1001, 'n_words': 440}