code: def create_dataloader(
      dataset_origin,
      mode="train",
      batch_size=1,
      batchify_fn=None,
      trans_fn=None,
  ):
      if trans_fn:
          dataset = dataset_origin.map(trans_fn)
      else:
          dataset = dataset_origin
      shuffle = True if mode == "train" else False
      if mode == "train":
          batch_sampler = paddle.io.DistributedBatchSampler(
              dataset, batch_size=batch_size, shuffle=shuffle
          )
      else:
          batch_sampler = paddle.io.BatchSampler(
              dataset, batch_size=batch_size, shuffle=shuffle
          )
      return paddle.io.DataLoader(
          dataset=dataset,
          batch_sampler=batch_sampler,
          collate_fn=batchify_fn,
          return_list=True,
      )
  
file_path: OpenPrompt/tutorial/7_ernie_paddlepaddle/dataloader.py
imports: from typing import *
  from tqdm import tqdm
  from collections import defaultdict
  import warnings
  import numpy
  from paddlenlp.data import Stack, Tuple, Pad
  import paddle
  from utils import signature
  from data_utils import InputFeatures
label_desc: Use image node_id 1 for calling a global function with example usage: create_dataloader(dataset_origin, mode, batch_size, batchify_fn, trans_fn) and returns: paddle