def METHOD_NAME(use_root, use_labels, shuffle):
    root = g_root
    fnames = g_files
    if not use_root:
        fnames = [os.path.join(root, f) for f in fnames]
        root = None
    lbl = None
    if use_labels:
        lbl = [10000 + i for i in range(len(fnames))]
    batch_size = 3
    pipe = Pipeline(batch_size, 1, 0)
    files, labels = fn.readers.file(file_root=root, files=fnames, labels=lbl,
                                    random_shuffle=shuffle)
    pipe.set_outputs(files, labels)
    pipe.build()
    num_iters = (len(fnames) + 2 * batch_size) // batch_size
    for i in range(num_iters):
        out_f, out_l = pipe.run()
        for j in range(batch_size):
            contents = bytes(out_f.at(j)).decode('utf-8')
            label = out_l.at(j)[0]
            index = label - 10000 if use_labels else label
            assert contents == ref_contents(fnames[index])