code: def test_recordio():
      class MXNetReaderPipeline(Pipeline):
          def __init__(
              self,
              batch_size,
              num_threads,
              device_id,
              num_gpus,
              data,
              data_idx,
          ):
              super(MXNetReaderPipeline, self).__init__(
                  batch_size, num_threads, device_id
              )
              self.input = ops.readers.MXNet(
                  path=[data],
                  index_path=[data_idx],
                  shard_id=device_id,
                  num_shards=num_gpus,
              )
  
          def define_graph(self):
              images, _ = self.input(name="Reader")
              return images
  
      recordio = os.path.join(
          get_dali_extra_path(), "db", "recordio", "train.rec"
      )
      recordio_idx_org = os.path.join(
          get_dali_extra_path(), "db", "recordio", "train.idx"
      )
      recordio_idx = "rio_train.idx"
  
      idx_files_dir = tempfile.TemporaryDirectory()
      idx_file = os.path.join(idx_files_dir.name, recordio_idx)
  
      skip_second(recordio_idx_org, idx_file)
  
      pipe = MXNetReaderPipeline(1, 1, 0, 1, recordio, idx_file)
      pipe_org = MXNetReaderPipeline(
          1, 1, 0, 1, recordio, recordio_idx_org
      )
      pipe.build()
      pipe_org.build()
      iters = pipe.epoch_size("Reader")
      for _ in range(iters):
          out = pipe.run()
          out_ref = pipe_org.run()
          for a, b in zip(out, out_ref):
              assert np.array_equal(a.as_array(), b.as_array())
          _ = pipe_org.run()
  
imports: from nvidia.dali import Pipeline, pipeline_def
  import nvidia.dali.ops
  import nvidia.dali.fn
  import nvidia.dali.types
  import nvidia.dali.tfrecord
  import os.path
  import tempfile
  import numpy
  from test_utils import compare_pipelines, get_dali_extra_path
  from nose_utils import assert_raises
  from nose2.tools import cartesian_params
  from nose import SkipTest
label_desc: Use image node_id 5 for calling a global function with example usage: test_recordio() and returns: images