def dict_to_numpy(fold_dict, main_data):
    """Given a dict representing the indices from the dataset each set (LUVT)
       has, return numpy arrays containing the rows from the dataset for each
       such set.
    """
    LX = main_data['X'][fold_dict['L']]
    Ly = main_data['y'][fold_dict['L']]

    UX = main_data['X'][fold_dict['U']]
    Uy = main_data['y'][fold_dict['U']]

    VX = main_data['X'][fold_dict['V']]
    Vy = main_data['y'][fold_dict['V']]

    TX = main_data['X'][fold_dict['T']]
    Ty = main_data['y'][fold_dict['T']]

    return [(LX,Ly), (UX,Uy), (VX,Vy), (TX,Ty)]