code: def _construct_loader(
      dataset_name, split, batch_size, shuffle, drop_last
  ):
      """Constructs the data loader for the given dataset."""
      err_str = "Dataset '{}' not supported".format(dataset_name)
      assert (
          dataset_name in _DATASETS and dataset_name in _PATHS
      ), err_str
      # Retrieve the data path for the dataset
      data_path = os.path.join(_DATA_DIR, _PATHS[dataset_name])
      # Construct the dataset
      dataset = _DATASETS[dataset_name](data_path, split)
      # Create a sampler for multi-process training
      sampler = (
          DistributedSampler(dataset) if cfg.NUM_GPUS > 1 else None
      )
      # Create a loader
      loader = torch.utils.data.DataLoader(
          dataset,
          batch_size=batch_size,
          shuffle=(False if sampler else shuffle),
          sampler=sampler,
          num_workers=cfg.DATA_LOADER.NUM_WORKERS,
          pin_memory=cfg.DATA_LOADER.PIN_MEMORY,
          drop_last=drop_last,
      )
      return loader
  
file_path: pycls/pycls/datasets/loader.py
imports: import os
  import torch
  from pycls.core.config import cfg
  from pycls.datasets.cifar10 import Cifar10
  from pycls.datasets.imagenet import ImageNet, ImageNetFFCV
  from torch.utils.data.distributed import DistributedSampler
  from torch.utils.data.sampler import RandomSampler
label_desc: Use image node_id 1 for calling a global function with example usage: _construct_loader(dataset_name, split, batch_size, shuffle, drop_last) and returns: loader