def bounds_contains(bounds, x):
    """
    Returns True if `x` is contained in the bounds, and False otherwise.

    Parameters
    ----------
    bounds : numpy.ndarray
        Array of shape (d, 2).
        Bounds of each dimension [ [x0, y0], [x1, y1], ..., [xd, yd] ],
        representing the following cartesian product in R^d:
        [x0, y0] X [x1, y1] X ... X [xd, yd].
    x : numpy.ndarray
        Array of shape (d,)
    """
    dim = x.shape[0]
    for dd in range(dim):
        if x[dd] < bounds[dd, 0] or x[dd] > bounds[dd, 1]:
            return False
    return True