code: def test_detection_dataloader():
      dataset = DummyDetectionDataset(8)
      for num_workers in [0, 1, 2, 4]:
          for shuffle in (True, False):
              for last_batch in ("keep", "discard", "rollover"):
                  dataloader = DetectionDataLoader(
                      dataset,
                      batch_size=2,
                      shuffle=shuffle,
                      last_batch=last_batch,
                      num_workers=num_workers,
                  )
                  for batch in dataloader:
                      mx.nd.waitall()
                      pass
  
                  # new dataloader methods
                  batchify_fn = Tuple(Stack(), Pad(pad_val=-1))
                  dataloader = mx.gluon.data.DataLoader(
                      dataset,
                      batch_size=2,
                      shuffle=shuffle,
                      last_batch=last_batch,
                      batchify_fn=batchify_fn,
                      num_workers=num_workers,
                  )
                  for batch in dataloader:
                      mx.nd.waitall()
                      pass
  
                  batchify_fn = Tuple(Append(), Append())
                  dataloader = mx.gluon.data.DataLoader(
                      dataset,
                      batch_size=2,
                      shuffle=shuffle,
                      last_batch=last_batch,
                      batchify_fn=batchify_fn,
                      num_workers=num_workers,
                  )
                  for batch in dataloader:
                      mx.nd.waitall()
                      pass
  
imports: from __future__ import print_function
  from __future__ import division
  import mxnet
  import numpy
  import gluoncv
  from gluoncv.data.batchify import *
  from gluoncv.data import DetectionDataLoader, RandomTransformDataLoader
label_desc: Use image node_id 1 for calling a global function with example usage: test_detection_dataloader() without return types