def METHOD_NAME(stats, logbook, gen, population, invalid_count):
    """Update the statistics with the new population"""
    record = stats.compile(population) if stats is not None else {}
    logbook.record(gen=gen, nevals=invalid_count, **record)