import warnings


def get_valid_keys(args_list, black_list=['out', 'gpu']):
    """Get list of keys that are going to be used.

    We define "valid" in the following sense:
        1. There need to be variations in the values of keys
            among the experiments.
        2. The key is not included in the black_list

    Returns:
        List of strings

    """
    keys = args_list[0].keys()
    valid_keys = []
    for key in keys:
        if key not in black_list:
            cur = None
            for args in args_list:
                if cur is None:
                    cur = args[key]
                if key not in args:
                    warnings.warn('{} not in args={}'.format(key, args))
                    continue
                if cur != args[key]:
                    valid_keys.append(key)
                    break
    return valid_keys