<commit_before>"""A script to run the Axelrod tournament.

The code for strategies is present in `axelrod/strategies`.
"""

from __future__ import division

import argparse
import os
import time
import axelrod

def run_tournament(turns, repetitions, exclude_basic, exclude_strategies, exclude_cheating, exclude_all, output_directory):
    """Main function for running Axelrod tournaments."""
    graphs_to_plot = {}

    init_strategies = lambda S: [s() for s in S]
    if not exclude_basic:
        graphs_to_plot[os.path.join(output_directory, 'basic_results.png')] = init_strategies(axelrod.basic_strategies)
    if not exclude_strategies:
        graphs_to_plot[os.path.join(output_directory, 'results.png')] = init_strategies(axelrod.strategies)
    if not exclude_cheating:
        graphs_to_plot[os.path.join(output_directory, 'cheating_results.png')] = init_strategies(axelrod.cheating_strategies)
    if not exclude_all:<commit_msg>replaces lambda function with named function<commit_after>"""A script to run the Axelrod tournament.

The code for strategies is present in `axelrod/strategies`.
"""

from __future__ import division

import argparse
import os
import time
import axelrod


def init_strategies(strategies):
    return [strategy() for strategy in strategies]


def run_tournament(turns, repetitions, exclude_basic, exclude_strategies, exclude_cheating, exclude_all, output_directory):
    """Main function for running Axelrod tournaments."""
    graphs_to_plot = {}

    # init_strategies = lambda S: [s() for s in S]
    if not exclude_basic:
        graphs_to_plot[os.path.join(output_directory, 'basic_results.png')] = init_strategies(axelrod.basic_strategies)
    if not exclude_strategies:
        graphs_to_plot[os.path.join(output_directory, 'results.png')] = init_strategies(axelrod.strategies)
    if not exclude_cheating:
        graphs_to_plot[os.path.join(output_directory, 'cheating_results.png')] = init_strategies(axelrod.cheating_strategies)
    if not exclude_all:
{'fraction_non_alphanumeric': 0.08891108891108891, 'fraction_numerical': 0.0, 'mean_word_length': 5.220496894409938, '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': '5748529', 'n_tokens_mistral': 646, 'n_tokens_neox': 626, 'n_words': 154}