def _is_within_bounds(X, Bounds):
    """Checks that elements of the arrays in X are all (strictly) within the given bounds.

    Parameters
    ----------
    X : list of numpy.ndarray
    Bounds : list of tuples
        The bounds for each array; must be of equal length to X.

    Returns
    -------
    within_bounds : bool
        True if all the elements of the arrays in X are within their
        correspoding bounds.

    """
    within_bounds = True
    for x, bounds in zip(X, Bounds):
        if bounds[0] > bounds[1]:
            raise ValueError("Lower bound cannot be larger than upper bound.")
        if (x <= bounds[0]).any() or (x >= bounds[1]).any():
            within_bounds = False
            break
    return within_bounds