def get_number_of_samples(dataset):
    """Get the number of samples held in a dataset."""
    keys = list(dataset.inputs.keys())
    if not keys:
        raise AssertionError('Dataset has no inputs!')

    first_set = dataset.inputs[keys[0]]
    if hasattr(first_set, 'shape'):
        return first_set.shape[0]
    return len(first_set)