import glob


def get_cppn_file_list(training_run, cppn_genome_folder=None):
    """
    Get a list containing all files with cppn parameters in the run

    :param training_run: String, the name of the training run during which the cppns were saved
    :param cppn_genome_folder: String, full path of the folder containing the cppn genomes.
    When None, a default location is used
    """
    if cppn_genome_folder is None:
        cppn_genome_folder = '/uio/hume/student-u31/eirikolb/tmp/niche_encodings/poet_{}/'.format(training_run)

    cppn_genome_file_name = 'genome_*.pickle'
    cppn_genome_file = cppn_genome_folder + cppn_genome_file_name

    return glob.glob(cppn_genome_file)