code: def build_pose_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.from_config(cfg, False)`.
  
      Returns:
          DataLoader: a torch DataLoader, that loads the given detection
          dataset, with test-time transformation and batching.
      """
      dataset_dicts = get_detection_dataset_dicts(
          [dataset_name],
          filter_empty=False,
          proposal_files=[
              cfg.CONFIG.DATA.DATASET.PROPOSAL_FILES_TEST[
                  list(cfg.CONFIG.DATA.DATASET.VAL).index(dataset_name)
              ]
          ]
          if cfg.CONFIG.DATA.LOAD_PROPOSALS
          else None,
      )
  
      dataset = DatasetFromList(dataset_dicts)
      if mapper is None:
          mapper = DatasetMapperWithBasis(cfg, False)
      dataset = MapDataset(dataset, mapper)
  
      sampler = InferenceSampler(len(dataset))
      # Always use 1 image per worker during inference since this is the
      # standard when reporting inference time in papers.
      batch_sampler = torch.utils.data.sampler.BatchSampler(
          sampler, 1, drop_last=False
      )
  
      data_loader = torch.utils.data.DataLoader(
          dataset,
          num_workers=cfg.CONFIG.DATA.NUM_WORKERS,
          batch_sampler=batch_sampler,
          collate_fn=trivial_batch_collator,
      )
      return data_loader
  
imports: import itertools
  import copy
  import logging
  import numpy
  import torch
  from ..registry.catalog import DatasetCatalog, MetadataCatalog
  from ..detection.detection_dataset import load_proposals_into_dataset, filter_images_with_few_keypoints, filter_images_with_only_crowd_annotations, get_detection_dataset_dicts
  from ..detection.detection_dataset import print_instances_class_histogram, build_batch_data_loader, trivial_batch_collator
  from ..detection.detection_utils import check_metadata_consistency, read_image, filter_empty_instances, annotations_to_instances
  from ..detection.detection_utils import check_image_size, build_augmentation_ranged_clip, transform_instance_annotations
  from ..detection.detection_dataset import DatasetFromList, MapDataset, DatasetMapper
  from ..detection.samplers import RepeatFactorTrainingSampler, TrainingSampler, InferenceSampler
  from ..transforms import instance_transforms
  from ..transforms.instance_transforms import RandomCropWithInstance
  from ..structures import BoxMode
label_desc: Use image node_id 4 for calling a global function with example usage: build_pose_test_loader(cfg, dataset_name, mapper) and returns: data_loader