code: def dataloader_with_randomsampler(
      dataset, batch_size, shuffle, drop_last, seed=0, unrepeated=False
  ):
      """
      建立一个 sampler 为 RandomSampler 的 dataloader
      """
      if unrepeated:
          sampler = UnrepeatedRandomSampler(dataset, shuffle, seed)
      else:
          sampler = RandomSampler(dataset, shuffle, seed=seed)
      dataloader = DataLoader(
          dataset,
          sampler=sampler,
          drop_last=drop_last,
          batch_size=batch_size,
      )
      return dataloader
  
imports: import os
  import sys
  import pytest
  from pathlib import Path
  from fastNLP.core.drivers.oneflow_driver.ddp import OneflowDDPDriver
  from fastNLP import prepare_oneflow_dataloader
  from fastNLP.core.samplers import RandomSampler, UnrepeatedSampler, BucketedBatchSampler, UnrepeatedRandomSampler, UnrepeatedSequentialSampler
  from tests.helpers.models.oneflow_model import OneflowNormalModel_Classification_1
  from tests.helpers.datasets.oneflow_data import OneflowNormalDataset, OneflowNormalXYDataset
  from tests.helpers.utils import recover_logger
  from fastNLP.envs.distributed import rank_zero_rm
  from fastNLP import logger
  from fastNLP.core.drivers.oneflow_driver.dist_utils import fastnlp_oneflow_all_gather
  from fastNLP.envs.imports import _NEED_IMPORT_ONEFLOW
label_desc: Use image node_id 3 for calling a global function with example usage: dataloader_with_randomsampler(dataset, batch_size, shuffle, drop_last, seed, unrepeated) and returns: dataloader