code: def build_data_loader(
      dataset, batch_size, num_workers, training=True
  ):
      return torch.utils.data.DataLoader(
          dataset,
          sampler=(TrainingSampler if training else InferenceSampler)(
              len(dataset)
          ),
          batch_size=batch_size,
          num_workers=num_workers,
          pin_memory=True,
      )
  
imports: import torch
  from torch import nn
  from torch.nn import functional
  from omegaconf import OmegaConf
  import torchvision
  from torchvision.transforms import transforms
  from torchvision.models.resnet import ResNet, Bottleneck
  from fvcore.common.param_scheduler import MultiStepParamScheduler
  from detectron2.solver import WarmupParamScheduler
  from detectron2.solver.build import get_default_optimizer_params
  from detectron2.config import LazyCall
  from detectron2.model_zoo import get_config
  from detectron2.data.samplers import TrainingSampler, InferenceSampler
  from detectron2.evaluation import DatasetEvaluator
  from detectron2.utils import comm
label_desc: Use image node_id 1 for calling a global function with example usage: build_data_loader(dataset, batch_size, num_workers, training) and returns: torch