import itertools


def get_grid(args):
    """ Make a dict that contains every combination of hyperparameters to explore"""

    # Make a list of every value in the dict if its not
    for k, v in args.items():
        if type(v) is not list:
            args[k] = [v]
    # Get every pairwise combination
    hyperparam, values = zip(*args.items())
    grid = [dict(zip(hyperparam, v)) for v in itertools.product(*values)]

    return grid