def _check_dataset_shapes(datasets):
    """ If the  datasets are not the same shape throw a ValueError Exception

    :param datasets: OCW Datasets to check for a consistent shape
    :type datasets: List of OCW Dataset Objects

    :raises: ValueError
    """
    dataset_shape = None
    for dataset in datasets:
        if dataset_shape is None:
            dataset_shape = dataset.values.shape
        elif dataset.values.shape != dataset_shape:
            msg = '%s != %s' % (dataset.values.shape, dataset_shape)
            raise ValueError(
                'Input datasets must be the same shape for an ensemble :: ',
                msg)
        else:
            pass
