from typing import List


def list_params(pop: list, gen: int, lamarck: bool, multicore: bool, 
                **extra_params: dict) -> List:
    """
    Internal function to list execution parameters.
    For advanced users only.

    Parameters
    ----------
    pop : list
        List of individuals.
    gen : int
        Number of generations.
    lamarck : bool
        If Lamarckian Evolution is used.
    multicore : bool
        If parallelism is used.
    **extra_params : dict
        Extra parameters. For details, please check: https://github.com/PonyGE/PonyGE2/wiki/Evolutionary-Parameters.

    Returns
    -------
    param_list : List
        List of parameters.

    """
    param_list = []
    if 'population_size' not in extra_params.keys():
        param_list.append('--population_size={0}'.format(str(pop)))
    
    if 'generations' not in extra_params.keys():
        param_list.append('--generations={0}'.format(str(gen)))
    
    if multicore and 'multicore' not in extra_params.keys():
        param_list.append("--multicore")
    if lamarck and 'lamarck' not in extra_params.keys():
        param_list.append("--lamarck")
    
    for (key, val) in extra_params.items():
        if val == "True":
            param_list.append("--"+key)
        elif val=="False" or val=="":
            continue
        else:
            param_list.append("--{0}={1}".format(key, val))
    return param_list