def METHOD_NAME(split, frame_info, shuffle=False):
    def build_set_list(set_list):
        rgb_list = list()
        for item in set_list:
            if item[0] not in frame_info:
                continue
            elif frame_info[item[0]][1] > 0:
                rgb_cnt = frame_info[item[0]][1]
                rgb_list.append('{} {} {}\n'.format(item[0], rgb_cnt, item[1]))
            else:
                rgb_list.append('{} {}\n'.format(item[0], item[1]))
        if shuffle:
            random.shuffle(rgb_list)
        return rgb_list
    train_rgb_list = build_set_list(split[0])
    test_rgb_list = build_set_list(split[1])
    return (train_rgb_list, test_rgb_list)