import itertools


def dictToCartesianProduct(dct):
    """Transform a dict of lists into a lists of all possible combination."""

    # Convert dict of hyperparameters as list of lists
    dct_l = [dct[key] for key in dct.keys()]

    # Cartesian product of all the possible combination of model hp
    grid_dct_l = [elt for elt in itertools.product(*dct_l)]

    return grid_dct_l