code: def build_detection_test_loader(cfg, dataset_name, mapper=None):
      """
      Similar to `build_detection_train_loader`.
      But this function uses the given `dataset_name` argument (instead of the names in cfg),
      and uses batch size 1.
  
      Args:
          cfg: a detectron2 CfgNode
          dataset_name (str): a name of the dataset that's available in the DatasetCatalog
          mapper (callable): a callable which takes a sample (dict) from dataset
              and returns the format to be consumed by the model.
              By default it will be `DatasetMapper(cfg, False)`.
  
      Returns:
          DataLoader: a torch DataLoader, that loads the given detection
              dataset, with test-time transformation and batching.
      """
      _add_category_whitelists_to_metadata(cfg)
      _add_category_maps_to_metadata(cfg)
      _maybe_add_class_to_mesh_name_map_to_metadata([dataset_name], cfg)
      dataset_dicts = combine_detection_dataset_dicts(
          [dataset_name],
          keep_instance_predicate=_get_test_keep_instance_predicate(
              cfg
          ),
          proposal_files=[
              cfg.DATASETS.PROPOSAL_FILES_TEST[
                  list(cfg.DATASETS.TEST).index(dataset_name)
              ]
          ]
          if cfg.MODEL.LOAD_PROPOSALS
          else None,
      )
      sampler = None
      if not cfg.DENSEPOSE_EVALUATION.DISTRIBUTED_INFERENCE:
          sampler = torch.utils.data.SequentialSampler(dataset_dicts)
      if mapper is None:
          mapper = DatasetMapper(cfg, False)
      return d2_build_detection_test_loader(
          dataset_dicts,
          mapper=mapper,
          num_workers=cfg.DATALOADER.NUM_WORKERS,
          sampler=sampler,
      )
  
imports: import itertools
  import logging
  import numpy
  from collections import UserDict, defaultdict
  from dataclasses import dataclass
  from typing import Any, Callable, Collection, Dict, Iterable, List, Optional, Sequence, Tuple
  import torch
  from torch.utils.data.dataset import Dataset
  from detectron2.config import CfgNode
  from detectron2.data.build import build_detection_test_loader
  from detectron2.data.build import build_detection_train_loader
  from detectron2.data.build import load_proposals_into_dataset, print_instances_class_histogram, trivial_batch_collator, worker_init_reset_seed
  from detectron2.data.catalog import DatasetCatalog, Metadata, MetadataCatalog
  from detectron2.data.samplers import TrainingSampler
  from detectron2.utils.comm import get_world_size
  from densepose.config import get_bootstrap_dataset_config
  from densepose.modeling import build_densepose_embedder
  from .combined_loader import CombinedDataLoader, Loader
  from .dataset_mapper import DatasetMapper
  from .datasets.coco import DENSEPOSE_CSE_KEYS_WITHOUT_MASK, DENSEPOSE_IUV_KEYS_WITHOUT_MASK
  from .datasets.dataset_type import DatasetType
  from .inference_based_loader import InferenceBasedLoader, ScoreBasedFilter
  from .samplers import DensePoseConfidenceBasedSampler, DensePoseCSEConfidenceBasedSampler, DensePoseCSEUniformSampler, DensePoseUniformSampler, MaskFromDensePoseSampler, PredictionToGroundTruthSampler
  from .transform import ImageResizeTransform
  from .utils import get_category_to_class_mapping, get_class_to_mesh_name_mapping
  from .video import FirstKFramesSelector, FrameSelectionStrategy, LastKFramesSelector, RandomKFramesSelector, VideoKeyframeDataset, video_list_from_file
label_desc: Use image node_id 20 for calling a global function with example usage: build_detection_test_loader(cfg, dataset_name, mapper) and returns: d2_build_detection_test_loader