def task_builder(generator, n_train=1000, n_test=250):
    """
    creates the task generator
    
    :generator: generator for the wanted task
    :n_train: number of samples to generate for training
    :n_test: number of samples to generate for testing
    
    :returns: dictionary of the task of generated samples
    """
    
    task = {'train':[], 'test':[]}
    for i in range(0,n_train):
        inp, out = generator()
        task['train'].append({'input':inp, 'output':out})
    for i in range(0,n_test):
        inp, out = generator()
        task['test'].append({'input':inp, 'output':out})
        
    return task