import random


def truncation_selection(population, children, truncation=10):
    """
    Select the genomes with the highest fitness and sample
    uniformly from this list.

    Args:
      population: the parent population.
      children: the number of children to select.
      truncation: the number of top parents to use.
    """
    sorted_results = sorted(population, reverse=True)
    parents = [x[1] for x in sorted_results][:truncation]
    return [random.choice(parents) for _ in range(children)]