<commit_before>import sys
from tournament import Tournament
from tournament import NotEnoughStrategies
from tournament_view import TournamentView
from first_non_full_column_strategy import FirstNonFullColumnStrategy
from emptiest_column_strategy import EmptiestColumnStrategy
from closest_to_win_column_strategy import ClosestToWinColumnStrategy
from random_column_strategy import RandomColumnStrategy

strategies = (
    FirstNonFullColumnStrategy,
    EmptiestColumnStrategy,
    ClosestToWinColumnStrategy,
    RandomColumnStrategy
)

if __name__ == "__main__":
    try:
        tournament = Tournament(strategies)
    except NotEnoughStrategies:
        print "A minimum of 3 strategies is needed to play a tournament"
        sys.exit(1)
    tournament.run()
    tournament_view = TournamentView(tournament)
    tournament_view.show_results_table()
    tournament_view.show_summary()
<commit_msg>Added timeouts as parameters for run_tournament<commit_after>import sys
import argparse
from tournament import Tournament
from tournament import NotEnoughStrategies
from tournament_view import TournamentView
from first_non_full_column_strategy import FirstNonFullColumnStrategy
from emptiest_column_strategy import EmptiestColumnStrategy
from closest_to_win_column_strategy import ClosestToWinColumnStrategy
from random_column_strategy import RandomColumnStrategy

strategies = (
    FirstNonFullColumnStrategy,
    EmptiestColumnStrategy,
    ClosestToWinColumnStrategy,
    RandomColumnStrategy
)

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Runs a new tournament of the Connect Four game')
    parser.add_argument('--play-timeout', action='store', dest='play_timeout',
                        default=0.5, help="Time limit for each play")
    parser.add_argument('--prepare-timeout', action='store', dest='prepare_timeout',
                        default=5, help="Time limit for the prepare of each strategy")
    args = parser.parse_args()
    try:
        tournament = Tournament(strategies,
                                prepare_time_limit = args.prepare_timeout,
                                play_time_limit = args.play_timeout)
    except NotEnoughStrategies:
        print "A minimum of 3 strategies is needed to play a tournament"
        sys.exit(1)
    tournament.run()
    tournament_view = TournamentView(tournament)
    tournament_view.show_results_table()
    tournament_view.show_summary()

{'fraction_non_alphanumeric': 0.054760931753167146, 'fraction_numerical': 0.0028606456885982836, 'mean_word_length': 4.275862068965517, 'pattern_counts': {'":': 2, '<': 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': '7112334', 'n_tokens_mistral': 649, 'n_tokens_neox': 643, 'n_words': 166}