code: def test_operator_coco_reader_label_remap(avoid_remap):
      batch_size = 2
      images = list(test_data.keys())
      ids_map = {
          s.id: s.cls if avoid_remap else s.mapped_cls
          for s in test_data.values()
      }
  
      pipeline = Pipeline(
          batch_size=batch_size, num_threads=4, device_id=0
      )
      with pipeline:
          _, _, labels, ids = fn.readers.coco(
              file_root=file_root,
              annotations_file=train_annotations,
              image_ids=True,
              images=images,
              avoid_class_remapping=avoid_remap,
          )
          pipeline.set_outputs(ids, labels)
      pipeline.build()
  
      i = 0
      assert len(images) % batch_size == 0
      while i < len(images):
          out = pipeline.run()
          for s in range(batch_size):
              print(out[0].at(s), out[1].at(s))
              assert ids_map[int(out[0].at(s))] == int(
                  out[1].at(s)
              ), f"{i}, {ids_map[int(out[0].at(s))]} vs {out[1].at(s)}"
              i = i + 1
  
imports: import numpy
  import nvidia.dali.fn
  import os
  import tempfile
  import json
  from nvidia.dali import Pipeline, pipeline_def
  from nose_utils import raises
  from nose2.tools import params
  from test_utils import compare_pipelines, get_dali_extra_path
label_desc: Use image node_id 3 for calling a global function with example usage: test_operator_coco_reader_label_remap(avoid_remap) without return types