code: def test_customized_sampler_dataloader(self, inherit):
      # TODO 由于 paddle.io.DataLoader 没有 sampler 参数，因此 prepare_paddle_dataloader 没有 sampler，这里暂时跳过
      try:
          logger.set_stdout("raw", level="info")
          # 需要检验一下 set_dist_repro_dataloader 是否可以在定制 batch_sampler 的情况下正确运行
          num_samples = 10
          dataset = PaddleNormalXYDataset(num_samples)
          if inherit:
  
              class Sampler(paddle.io.RandomSampler):
                  def __init__(self, dataset, batch_size):
                      self.dataset = dataset
                      self.batch_size = batch_size
  
                  def __iter__(self):
                      indices = list(range(len(dataset)))
                      return iter(indices)
  
                  def __len__(self):
                      return len(self.dataset)
  
          else:
  
              class Sampler:
                  def __init__(self, dataset, batch_size):
                      self.dataset = dataset
                      self.batch_size = batch_size
  
                  def __iter__(self):
                      indices = list(range(len(dataset)))
                      return iter(indices)
  
                  def __len__(self):
                      return len(self.dataset)
  
          dl = prepare_paddle_dataloader(
              dataset, sampler=Sampler(dataset, batch_size=4)
          )
          self.driver.setup()
          # TODO 这里需要raise
          with pytest.raises(TypeError):
              dl = self.driver.set_dist_repro_dataloader(
                  dataloader=dl, dist="dist", reproducible=False
              )
      finally:
          pass
  
imports: import pytest
  from pathlib import Path
  from fastNLP.core.drivers.paddle_driver.fleet import PaddleFleetDriver
  from fastNLP.core.samplers import RandomSampler, UnrepeatedSampler, BucketedBatchSampler, UnrepeatedRandomSampler, UnrepeatedSequentialSampler
  from tests.helpers.models.paddle_model import PaddleNormalModel_Classification_1
  from tests.helpers.datasets.paddle_data import PaddleNormalDataset, PaddleNormalXYDataset
  from tests.helpers.utils import magic_argv_env_context, recover_logger
  from fastNLP.envs.distributed import rank_zero_rm
  from fastNLP import prepare_paddle_dataloader
  from fastNLP.core.drivers.paddle_driver.dist_utils import fastnlp_paddle_all_gather
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE
  from fastNLP import logger
label_desc: Use image node_id 20 for calling the TestSetDistReproDataloader obj's underlying member method code with example usage: obj.test_customized_sampler_dataloader(inherit) and returns: iter, len, iter, len