def make_grid(xx, yy):
    """
    Returns two n-by-n matrices. The first one contains all the x values 
    and the second all the y values of a cartesian product between `xx` and `yy`.
    """
    n = len(xx)
    xx, yy = np.meshgrid(xx, yy)
    grid = np.array([xx.ravel(), yy.ravel()]).T
    x = grid[:, 0].reshape(n, n)
    y = grid[:, 1].reshape(n, n)
    return x, y
Returns two n-by-n matrices. The first one contains all the x values 
    and the second all the y values of a cartesian product between `xx` and `yy`.