code: def build_dataloader(
      mode, batch_size=4, seed=None, num_workers=0, device="gpu:0"
  ):
      normalize = Normalize(
          mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], data_format="HWC"
      )
  
      if mode.lower() == "train":
          dataset = Cifar100(mode=mode, transform=normalize)
      elif mode.lower() in ["test", "valid", "eval"]:
          dataset = Cifar100(mode="test", transform=normalize)
      else:
          raise ValueError(f"{mode} should be one of ['train', 'test']")
  
      # define batch sampler
      batch_sampler = DistributedBatchSampler(
          dataset=dataset,
          batch_size=batch_size,
          shuffle=False,
          drop_last=True,
      )
  
      data_loader = DataLoader(
          dataset=dataset,
          batch_sampler=batch_sampler,
          places=device,
          num_workers=num_workers,
          return_list=True,
          use_shared_memory=False,
      )
  
      # support exit using ctrl+c
      signal.signal(signal.SIGINT, term_mp)
      signal.signal(signal.SIGTERM, term_mp)
  
      return data_loader
  
file_path: PaddleOCR/test_tipc/supplementary/data_loader.py
imports: import numpy
  from paddle.vision.datasets import Cifar100
  from paddle.vision.transforms import Normalize
  import signal
  import os
  from paddle.io import Dataset, DataLoader, DistributedBatchSampler
label_desc: Use image node_id 2 for calling a global function with example usage: build_dataloader(mode, batch_size, seed, num_workers, device) and returns: data_loader