code: def create_sampler(dataset, shuffle, cfg):
      """
      Create sampler for the given dataset.
      Args:
          dataset (torch.utils.data.Dataset): the given dataset.
          shuffle (bool): set to ``True`` to have the data reshuffled
              at every epoch.
          cfg (CfgNode): configs. Details can be found in
              slowfast/config/defaults.py
      Returns:
          sampler (Sampler): the created sampler.
      """
      sampler = (
          DistributedSampler(dataset) if cfg.NUM_GPUS > 1 else None
      )
  
      return sampler
  
imports: import logging
  import numpy
  import os
  import random
  import time
  from collections import defaultdict
  import cv2
  import torch
  from torch.utils.data.distributed import DistributedSampler
  from torchvision import transforms
  from slowfast.utils.env import pathmgr
  from .None import transform
  from .random_erasing import RandomErasing
  from .transform import create_random_augment
label_desc: Use image node_id 12 for calling a global function with example usage: create_sampler(dataset, shuffle, cfg) and returns: sampler