def split_awf_closed(r_train, r_test, nClass, mon_instance, unmon_instance, dim):
    mon_data = np.load((HOME + '/datasets/awf1.npz'), allow_pickle=True)
    mon_x = mon_data['feature']
    print('mon_instance', mon_instance)
    print('unmon_instance', unmon_instance)
    num_mtrain_instance = (mon_instance * (r_train / (r_train + r_test)))
    mon_random = np.array(range(int(mon_instance)))
    np.random.shuffle(mon_random)
    mon_train_ins = mon_random[:int(num_mtrain_instance)]
    mon_test_ins = mon_random[int(num_mtrain_instance):]
    print('mon_test_ins', len(mon_test_ins))
    train_feature = np.zeros(((nClass * len(mon_train_ins)), dim), dtype=int)
    test_feature = np.zeros(((nClass * len(mon_test_ins)), dim), dtype=int)
    print('test_feature', len(test_feature))
    train_label = np.zeros(((nClass * len(mon_train_ins)),), dtype=int)
    test_label = np.zeros(((nClass * len(mon_test_ins)),), dtype=int)
    print(len(mon_train_ins))
    print(len(mon_test_ins))
    i = 0
    mon_instance = int(mon_instance)
    print('Monitored training set partitioning...')
    print(nClass)
    print(len(mon_train_ins))
    for c in range(nClass):
        c = int(c)
        print(c)
        for instance in mon_train_ins:
            train_label[i] = c
            train_feature[i] = mon_x[((c * mon_instance) + instance)][:dim]
            i += 1
    print(i)
    print('Monitored testing set partitioning...')
    j = 0
    for c in range(nClass):
        c = int(c)
        for instance in mon_test_ins:
            test_label[j] = c
            test_feature[j] = mon_x[((c * mon_instance) + instance)][:dim]
            j += 1
    print(j)
    print(j)
    print('train_feature: ', len(train_feature))
    print('train_label: ', len(train_label))
    print('test_feature: ', len(test_feature))
    print('test_label: ', len(test_label))
    print('train_dim: ', len(train_feature[0]))
    print('test_dim: ', len(test_feature[0]))
    return (train_feature, train_label, test_feature, test_label)
def split_awf_closed(r_train, r_test, nClass, mon_instance, unmon_instance, dim):
    mon_data = np.load((HOME + '/datasets/awf1.npz'), allow_pickle=True)
    mon_x = mon_data['feature']
    print('mon_instance', mon_instance)
    print('unmon_instance', unmon_instance)
    num_mtrain_instance = (mon_instance * (r_train / (r_train + r_test)))
    mon_random = np.array(range(int(mon_instance)))
    np.random.shuffle(mon_random)
    mon_train_ins = mon_random[:int(num_mtrain_instance)]
    mon_test_ins = mon_random[int(num_mtrain_instance):]
    print('mon_test_ins', len(mon_test_ins))
    train_feature = np.zeros(((nClass * len(mon_train_ins)), dim), dtype=int)
    test_feature = np.zeros(((nClass * len(mon_test_ins)), dim), dtype=int)
    print('test_feature', len(test_feature))
    train_label = np.zeros(((nClass * len(mon_train_ins)),), dtype=int)
    test_label = np.zeros(((nClass * len(mon_test_ins)),), dtype=int)
    print(len(mon_train_ins))
    print(len(mon_test_ins))
    i = 0
    mon_instance = int(mon_instance)
    print('Monitored training set partitioning...')
    print(nClass)
    print(len(mon_train_ins))
    for c in range(nClass):
        c = int(c)
        print(c)
        for instance in mon_train_ins:
            train_label[i] = c
            train_feature[i] = mon_x[((c * mon_instance) + instance)][:dim]
            i += 1
    print(i)
    print('Monitored testing set partitioning...')
    j = 0
    for c in range(nClass):
        c = int(c)
        for instance in mon_test_ins:
            test_label[j] = c
            test_feature[j] = mon_x[((c * mon_instance) + instance)][:dim]
            j += 1
    print(j)
    print(j)
    print('train_feature: ', len(train_feature))
    print('train_label: ', len(train_label))
    print('test_feature: ', len(test_feature))
    print('test_label: ', len(test_label))
    print('train_dim: ', len(train_feature[0]))
    print('test_dim: ', len(test_feature[0]))
    return (train_feature, train_label, test_feature, test_label)