code: def _test_loader_from_config(cfg, dataset_name, mapper=None):
      """
      Uses the given `dataset_name` argument (instead of the names in cfg), because the
      standard practice is to evaluate each test set individually (not combining them).
      """
      if isinstance(dataset_name, str):
          dataset_name = [dataset_name]
  
      dataset = get_detection_dataset_dicts(
          dataset_name,
          filter_empty=False,
          proposal_files=[
              cfg.DATASETS.PROPOSAL_FILES_TEST[
                  list(cfg.DATASETS.TEST).index(x)
              ]
              for x in dataset_name
          ]
          if cfg.MODEL.LOAD_PROPOSALS
          else None,
      )
      if mapper is None:
          mapper = DatasetMapper(cfg, False)
      return {
          "dataset": dataset,
          "mapper": mapper,
          "num_workers": cfg.DATALOADER.NUM_WORKERS,
          "sampler": InferenceSampler(len(dataset))
          if not isinstance(dataset, torchdata.IterableDataset)
          else None,
      }
  
imports: import itertools
  import logging
  import numpy
  import operator
  import pickle
  from collections import OrderedDict, defaultdict
  from typing import Any, Callable, Dict, List, Optional, Union
  import torch
  import torch.utils.data
  from tabulate import tabulate
  from termcolor import colored
  from detectron2.config import configurable
  from detectron2.structures import BoxMode
  from detectron2.utils.comm import get_world_size
  from detectron2.utils.env import seed_all_rng
  from detectron2.utils.file_io import PathManager
  from detectron2.utils.logger import _log_api_usage, log_first_n
  from .catalog import DatasetCatalog, MetadataCatalog
  from .common import AspectRatioGroupedDataset, DatasetFromList, MapDataset, ToIterableDataset
  from .dataset_mapper import DatasetMapper
  from .detection_utils import check_metadata_consistency
  from .samplers import InferenceSampler, RandomSubsetTrainingSampler, RepeatFactorTrainingSampler, TrainingSampler
label_desc: Use image node_id 11 for calling a global function with example usage: _test_loader_from_config(cfg, dataset_name, mapper) and returns: dict