def create_mating_pool(population, fitnesses, norm=True):
    """
    Generate a mating pool

    This will create a new population proportional to the fitnesses
    of the original population. The pool will the be used as the basis
    for generating the next generation.

    Parameters
    ----------
    population : list of MiniMaxAgent
        The current population
    fitnesses : list of int
        The fitness values for each member of the population
    norm : bool
        True will apply basic normilization to the fitness values before
        creating the pool

    Returns
    -------
    list of MiniMaxAgent
        The mating pool with the frequency of each agent proportional to
        its fitness
    """
    if norm:
        mx = max(fitnesses)
        fitnesses = [ int((f / mx) * 10.0) for f in fitnesses ]

    pool = []

    for i, fitness in enumerate(fitnesses):

        for _ in range(fitness):

            pool.append(population[i])

    return pool