class_docstr: 专门测试 set_dist_repro_dataloader 函数的类
class_docstr_tok: ["\u4e13\u95e8\u6d4b\u8bd5","set_dist_repro_dataloader","\u51fd\u6570\u7684\u7c7b"]
docstr: 测试 set_dist_repro_dataloader 参数 dataloader 已经支持断点重训时的表现
  应该返回新的 dataloader，且其余各项设置和原来相同
docstr_tok: ["\u6d4b\u8bd5","set_dist_repro_dataloader","\u53c2\u6570","dataloader","\u5df2\u7ecf\u652f\u6301\u65ad\u70b9\u91cd\u8bad\u65f6\u7684\u8868\u73b0","\u5e94\u8be5\u8fd4\u56de\u65b0\u7684","dataloader\uff0c\u4e14\u5176\u4f59\u5404\u9879\u8bbe\u7f6e\u548c\u539f\u6765\u76f8\u540c"]
code: def test_with_dataloader_reproducible_sampler(
      self, shuffle, use_dataloader
  ):
      """
      测试 set_dist_repro_dataloader 参数 dataloader 已经支持断点重训时的表现
      应该返回新的 dataloader，且其余各项设置和原来相同
      """
      dataloader = get_dataloader(
          self.dataset,
          use_dataloader=use_dataloader,
          sampler=RandomSampler(self.dataset, shuffle),
          batch_size=2,
          shuffle=shuffle,
      )
      replaced_loader = self.driver.set_dist_repro_dataloader(
          dataloader, dist="dist", reproducible=False
      )
  
      assert not (replaced_loader is dataloader)
      assert not (replaced_loader.sampler is dataloader.sampler)
      assert isinstance(replaced_loader.sampler, RandomSampler)
      assert replaced_loader.batch_size == 2
      assert replaced_loader.shuffle == shuffle
  
      self.check_set_dist_repro_dataloader(
          dataloader, replaced_loader, shuffle, use_dataloader
      )
  
imports: import pytest
  from copy import deepcopy
  from pathlib import Path
  from fastNLP.core.drivers.jittor_driver import JittorSingleDriver
  from fastNLP.core.samplers import ReproduceBatchSampler, RandomSampler
  from fastNLP.core.dataloaders import JittorDataLoader
  from tests.helpers.models.jittor_model import JittorNormalModel_Classification_1
  from tests.helpers.datasets.jittor_data import JittorNormalDataset, JittorNormalXYDataset
  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_JITTOR, _NEED_IMPORT_TORCH
label_desc: Use image node_id 7 for calling the TestSetDistReproDataloader obj's underlying member method code with example usage: obj.test_with_dataloader_reproducible_sampler(shuffle, use_dataloader) without return types