def split_indices(a: int, b: int, val_split=0.15, test_split=0.15):
    """
    Calculate the necessary indices for splitting a dataset into
    training, validation and test set in a diversified manner.
    :param a: First index.
    :param b: Last index.
    :param val_split: Float describing the fraction used for validation.
    :param test_split: Float describing the fraction used for testing.
    :return: A 7-tuple of integers with the following values:
             a: First index for training data
             val1: Starting index of first validation split
             test1: Starting index of first testset split
             data: Second index for training data
             val2: Starting index of second validation split
             test2: Starting index of second testset split
             b: Last index of the data
    """
    half = int((b - a) / 2)
    val_len = int(half * val_split)
    test_len = int(half * test_split)
    val1 = a + half - val_len - test_len
    test1 = a + half - test_len
    data = a + half
    val2 = b - val_len - test_len
    test2 = b - test_len
    return a, val1, test1, data, val2, test2, b