# Path: cogspaces/utils.py
# def zip_data(data, target):
#     return {study: (data[study], target[study]) for study in data}
# 
# def unzip_data(data):
#     return {study: data[study][0] for study in data}, \
#            {study: data[study][1] for study in data}


import numpy as np
from sklearn.model_selection import GroupShuffleSplit
from cogspaces.utils import zip_data, unzip_data
        Takes a collection of datasets and split them into a test and train
        collection.

    Parameters
    ----------
    data : Dict[str, np.ndarray]
        Collection of input data (one for each study)

    target : Dict[str, pd.DataFrame]
        Collection of targets (one for each study)

    test_size : float in [0, 1]  or Dict[str, float]
        Test size for each study

    train_size : float in [0, 1] or Dict[str, float]
        Train size for each study

    random_state: int or None
        Seed for the split

    Returns
    -------
    train_data : Dict[str, np.ndarray]

    test_data : Dict[str, np.ndarray]

    train_target : Dict[str, pd.DataFrame]

    test_target : Dict[str, pd.DataFrame]
    """

# Path: cogspaces/utils.py
# def zip_data(data, target):
#     return {study: (data[study], target[study]) for study in data}
# 
# def unzip_data(data):
#     return {study: data[study][0] for study in data}, \
#            {study: data[study][1] for study in data}


# Path: cogspaces/model_selection.py
import numpy as np
from sklearn.model_selection import GroupShuffleSplit
from cogspaces.utils import zip_data, unzip_data

        Takes a collection of datasets and split them into a test and train
        collection.

    Parameters
    ----------
    data : Dict[str, np.ndarray]
        Collection of input data (one for each study)

    target : Dict[str, pd.DataFrame]
        Collection of targets (one for each study)

    test_size : float in [0, 1]  or Dict[str, float]
        Test size for each study

    train_size : float in [0, 1] or Dict[str, float]
        Train size for each study

    random_state: int or None
        Seed for the split

    Returns
    -------
    train_data : Dict[str, np.ndarray]

    test_data : Dict[str, np.ndarray]

    train_target : Dict[str, pd.DataFrame]

    test_target : Dict[str, pd.DataFrame]
    """

    data = zip_data(data, target)