code: def test_3(self):
      data_length = 100
  
      torch_normal_data = TorchNormalDataset(num_of_data=data_length)
      random_sampler_1 = partial(
          RandomSampler, dataset=torch_normal_data, shuffle=False
      )
      random_sampler_2 = partial(
          RandomSampler, dataset=torch_normal_data, shuffle=True
      )
      iterable_items = [random_sampler_1, random_sampler_2]
  
      world_size = 3
      for pad in {True, False}:
          for iterable in iterable_items:
              for rank in range(world_size):
                  each_rank_iterable = iterable()
                  each_rank_iterable.set_epoch(0)
                  each_rank_iterable.set_distributed(
                      num_replicas=world_size, rank=rank, pad=pad
                  )
                  # 迭代一些数据，但是不迭代完；
                  iterator = iter(each_rank_iterable)
                  pre_data = []
                  forward_steps = 10
                  for _ in range(forward_steps):
                      pre_data.append(next(iterator))
  
                  # 看重新生成迭代器是否能够完全重置状态；
                  iterator = iter(each_rank_iterable)
                  res = []
                  for _ in range(forward_steps):
                      res.append(next(iterator))
                  assert res == pre_data
  
imports: import numpy
  import pytest
  from functools import partial
  from itertools import chain
  from copy import deepcopy
  from fastNLP.core.samplers.reproducible_sampler import RandomSampler, SortedSampler, SequentialSampler
  from tests.helpers.datasets.torch_data import TorchNormalDataset
label_desc: Use image node_id 3 for calling the TestRandomSampler obj's underlying member method code with example usage: obj.test_3() without return types