<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_genome_fitness(self, delimiter=' ', filename='fitness_history.csv', with_cross_validation=False):
 """ Saves the population's best and average fitness. """

        with open(filename, 'w') as f:
            w = csv.writer(f, delimiter=delimiter)

            best_fitness = [c.fitness for c in self.most_fit_genomes]
            avg_fitness = self.get_fitness_mean()

            if with_cross_validation: # pragma: no cover
                cv_best_fitness = [c.cross_fitness for c in self.most_fit_genomes]
                cv_avg_fitness = self.get_average_cross_validation_fitness()
                for best, avg, cv_best, cv_avg in zip(best_fitness,
                                                      avg_fitness,
                                                      cv_best_fitness,
                                                      cv_avg_fitness):
                    w.writerow([best, avg, cv_best, cv_avg])
            else:
                for best, avg in zip(best_fitness, avg_fitness):
                    w.writerow([best, avg])