def check_dataset_groups(dataset, groups):
    """Check that all groups given are actually contained in the dataset.
    """
    dataset_groups = {d.group for d in dataset}
    return set(groups) == dataset_groups