def get_job_name(flags):
    """ Generates the name of the output file for a training run as a function of the config

    Source setup:
    <objective>_<dataset>_<test_env>_H<hparams_seed>_T<trial_seed>.json
    Time setup:
    <objective>_<dataset>_<test_env>_H<hparams_seed>_T<trial_seed>_S<test_step>.json

    Args:
        flags (dict): dictionnary of the config for a training run

    Returns:
        str: name of the output json file of the training run 
    """
    
    job_id = flags['objective'] + '_' + flags['dataset'] + '_' + str(flags['test_env']) + '_H' + str(flags['hparams_seed']) + '_T' + str(flags['trial_seed'])

    return job_id