def check_dataset_shape(dataset):
    """Confirm the dataset has shape 3 x nrows x ncols."""
    if len(dataset.shape) != 3:
        raise ValueError('Each image needs 3 dimensions: rgb, nrows, ncols')
    if dataset.shape[0] != 3:
        raise ValueError(
            """The dataset's first dimension must have all 3
colors: red, green, and blue...in that order."""
            )
