def generate_n_shadow_models_datasets(n, train_dataset, test_dataset):
    """
    split the original dataset in n disjoint train datasets and n disjoint
    test datasets of equal size, that can be then used to train n different
    'shadow' models of a given model.
    Args:
    -n : number of 'shadow' datasets to split the original datasets into.
    -train_dataset: original train dataset
    -test_dataset: original test dataset
    Returns:
    -list of n 'shadow' train datasets
    -list of n 'shadow' test datasets
    """
    train_step = train_dataset[0].shape[0]//n
    test_step = test_dataset[0].shape[0]//n
    
    shadow_train_inputs = list()
    shadow_train_targets = list()
    shadow_test_inputs = list()
    shadow_test_targets = list()

    shadow_train_datasets = list()
    shadow_test_datasets = list() 
    
    for i in range(n):
        shadow_train_inputs.append(train_dataset[0][i*train_step:(i+1)*train_step])
        shadow_train_targets.append(train_dataset[1][i*train_step:(i+1)*train_step])
        shadow_train_datasets.append((shadow_train_inputs[i], shadow_train_targets[i]))

        shadow_test_inputs.append(test_dataset[0][i*test_step:(i+1)*test_step])
        shadow_test_targets.append(test_dataset[1][i*test_step:(i+1)*test_step])
        shadow_test_datasets.append((shadow_test_inputs[i], shadow_test_targets[i]))
        
    return (shadow_train_datasets, shadow_test_datasets)