code: def _get_dataset(dataset, args):
      if dataset.lower() == "coco":
          train_dataset = gdata.COCOInstance(
              splits="instances_train2017"
          )
          val_dataset = gdata.COCOInstance(
              splits="instances_val2017", skip_empty=False
          )
          starting_id = 0
          if args.horovod and MPI:
              length = len(val_dataset)
              shard_len = length // hvd.size()
              rest = length % hvd.size()
              # Compute the start index for this partition
              starting_id = shard_len * hvd.rank() + min(
                  hvd.rank(), rest
              )
          val_metric = COCOInstanceMetric(
              val_dataset,
              os.path.join(args.logdir, args.save_prefix + "_eval"),
              use_ext=args.use_ext,
              starting_id=starting_id,
          )
      else:
          raise NotImplementedError(
              "Dataset: {} not implemented.".format(dataset)
          )
      if args.horovod and MPI:
          val_dataset = val_dataset.shard(hvd.size(), hvd.rank())
      return train_dataset, val_dataset, val_metric
  
file_path: gluon-cv/gluoncv/auto/estimators/mask_rcnn/utils.py
imports: import os
  import logging
  import mxnet
  from mxnet import gluon
  from ....None import data
  from ....data import batchify
  from ....data.sampler import SplitSortedBucketSampler
  from ....utils.metrics.coco_instance import COCOInstanceMetric
label_desc: Use image node_id 1 for calling a global function with example usage: _get_dataset(dataset, args) and returns: train_dataset,  val_dataset,  val_metric