import itertools


def expand_grid(param_dict):
    """
    Given a dictionary of list values, return a list with tuples of the cartesian product of
    every element of the matrix.
    """
    return list(itertools.product(*param_dict.values()))