def METHOD_NAME(file_list,
                    mode,
                    shuffle=False,
                    color_jitter=False,
                    rotate=False,
                    data_dir=DATA_DIR,
                    crop_size=DATA_DIM,
                    resize_size=RESIZE_DIM,
                    batch_size=1):
    def reader():
        try:
            with open(file_list) as flist:
                full_lines = [line.strip() for line in flist]
                if shuffle:
                    np.random.shuffle(full_lines)
                lines = full_lines
                for line in lines:
                    if mode == 'train' or mode == 'val':
                        img_path, label = line.split()
                        img_path = os.path.join(data_dir, img_path)
                        yield img_path, int(label)
                    elif mode == 'test':
                        img_path = os.path.join(data_dir, line)
                        yield [img_path]
        except Exception as e:
            print("Reader failed!\n{}".format(str(e)))
            os._exit(1)
    mapper = functools.partial(
        process_image,
        mode=mode,
        color_jitter=color_jitter,
        rotate=rotate,
        crop_size=crop_size,
        resize_size=resize_size)
    return paddle.reader.xmap_readers(mapper, reader, THREAD, BUF_SIZE)