import random


def random_grid(n=30, **kwargs):
    """
    Generates a random grid settings.

    Arguments:
        kwargs: the name of parameter is the key while the values represent items to iterate over

    Example

    ```python
    from memo import random_grid

    settings = random_grid(n=30, a=[1,2], b=[1, 2])
    assert len(settings) == 30
    ```
    """
    return [{k: random.choice(v) for k, v in kwargs.items()} for _ in range(n)]