code: def test_shuffle_dataloader(
      shuffle, batch_size, drop_last, reproducible
  ):
      # 需要检验一下 set_dist_repro_dataloader 没有修改参数
      num_samples = 100
      dataset = OneflowNormalXYDataset(num_samples)
      dl = prepare_oneflow_dataloader(
          dataset,
          shuffle=shuffle,
          batch_size=batch_size,
          drop_last=drop_last,
      )
      model = OneflowNormalModel_Classification_1(10, 32)
      driver = OneflowSingleDriver(model, device="cpu")
      dl = driver.set_dist_repro_dataloader(
          dataloader=dl, reproducible=reproducible
      )
  
      data = []
      flags = []
      for batch in dl:
          flags.append(batch["x"].size(0) == batch_size)
          data.extend(batch["x"].reshape(-1).tolist())
  
      if drop_last and num_samples % batch_size != 0:
          assert len(data) != num_samples
          assert all(flags) == True
      elif num_samples % batch_size != 0:
          assert flags[-1] is False
      else:
          assert len(data) == num_samples
  
      if not shuffle:
          for i in range(1, len(data)):
              assert data[i] > data[i - 1]
      else:
          flags = []
          for i in range(1, len(data)):
              flags.append(data[i] > data[i - 1])
          assert all(flags) is False
  
imports: import pytest
  from pathlib import Path
  from fastNLP.core.drivers.oneflow_driver.single_device import OneflowSingleDriver
  from fastNLP.core.samplers import ReproduceBatchSampler, RandomSampler
  from tests.helpers.models.oneflow_model import OneflowNormalModel_Classification_1
  from tests.helpers.datasets.oneflow_data import OneflowNormalDataset, OneflowNormalXYDataset
  from tests.helpers.datasets.torch_data import TorchNormalDataset
  from tests.helpers.models.torch_model import TorchNormalModel_Classification_1
  from fastNLP.envs.distributed import rank_zero_rm
  from fastNLP.envs.imports import _NEED_IMPORT_ONEFLOW, _NEED_IMPORT_TORCH
  from fastNLP import prepare_oneflow_dataloader, BucketedBatchSampler
label_desc: Use image node_id 7 for calling a global function with example usage: test_shuffle_dataloader(shuffle, batch_size, drop_last, reproducible) without return types