def config_dict_to_flags(config):
    """Converts a dictioanry to command line flags.
    e.g. {a:1, b:2, c:True} to ['--a', '1', '--b', '2', '--c']
    """
    result = []
    for key, val in config.items():

        if key in {'job_name', 'output_dir', 'config'}:
            continue

        key = '--' + key

        if isinstance(val, bool) and (val is False):
            continue
        result.append(key)

        if not isinstance(val, bool):

            assert isinstance(val, (str, int, float))
            result.append(str(val))

    return result