import random


def sample(max_index, size=40000, split=8000):
    """Samples indices."""
    indices = random.sample(range(max_index), size)
    train = indices[:-split]
    test = indices[-split:]
    return train, test