code: def get_dataset(dataset, args):
      if dataset.lower() == "voc":
          train_dataset = gdata.VOCDetection(
              splits=[(2007, "trainval"), (2012, "trainval")]
          )
          val_dataset = gdata.VOCDetection(splits=[(2007, "test")])
          val_metric = VOC07MApMetric(
              iou_thresh=0.5, class_names=val_dataset.classes
          )
      elif dataset.lower() == "coco":
          train_dataset = gdata.COCODetection(
              root=args.dataset_root + "/coco",
              splits="instances_train2017",
          )
          val_dataset = gdata.COCODetection(
              root=args.dataset_root + "/coco",
              splits="instances_val2017",
              skip_empty=False,
          )
          val_metric = COCODetectionMetric(
              val_dataset,
              args.save_prefix + "_eval",
              cleanup=True,
              data_shape=(args.data_shape, args.data_shape),
          )
          # coco validation is slow, consider increase the validation interval
          if args.val_interval == 1:
              args.val_interval = 10
      else:
          raise NotImplementedError(
              "Dataset: {} not implemented.".format(dataset)
          )
      return train_dataset, val_dataset, val_metric
  
imports: import argparse
  import os
  import logging
  import warnings
  import time
  import numpy
  import mxnet
  from mxnet import nd
  from mxnet import gluon
  from mxnet import autograd
  import gluoncv
  from gluoncv import data
  from gluoncv import utils
  from gluoncv.model_zoo import get_model
  from gluoncv.data.batchify import Tuple, Stack, Pad
  from gluoncv.data.transforms.presets.ssd import SSDDefaultTrainTransform
  from gluoncv.data.transforms.presets.ssd import SSDDefaultValTransform
  from gluoncv.data.transforms.presets.ssd import SSDDALIPipeline
  from gluoncv.utils.metrics.voc_detection import VOC07MApMetric
  from gluoncv.utils.metrics.coco_detection import COCODetectionMetric
  from gluoncv.utils.metrics.accuracy import Accuracy
  from mxnet.contrib import amp
label_desc: Use image node_id 2 for calling a global function with example usage: get_dataset(dataset, args) and returns: train_dataset,  val_dataset,  val_metric