code: def get_val_dataloader(args):
      dataset = get_val_dataset(args)
      inv_map = {v: k for k, v in dataset.label_map.items()}
  
      if args.distributed:
          val_sampler = torch.utils.data.distributed.DistributedSampler(
              dataset
          )
      else:
          val_sampler = None
  
      val_dataloader = DataLoader(
          dataset,
          batch_size=args.eval_batch_size,
          shuffle=False,  # Note: distributed sampler is shuffled :(
          sampler=val_sampler,
          num_workers=args.num_workers,
      )
  
      return val_dataloader, inv_map
  
file_path: DALI/docs/examples/use_cases/pytorch/single_stage_detector/src/data.py
imports: import os
  import numpy
  import torch
  from torch.utils.data import DataLoader
  from src.utils import dboxes300_coco, COCODetection, SSDTransformer
  from src.coco import COCO
  from src.coco_pipeline import create_coco_pipeline
  from nvidia.dali.plugin.pytorch import DALIGenericIterator, LastBatchPolicy
label_desc: Use image node_id 7 for calling a global function with example usage: get_val_dataloader(args) and returns: val_dataloader,  inv_map