code: def test_seed_work_when_shuffle_is_true(self):
      data_length = 100
  
      torch_normal_data = TorchNormalDataset(num_of_data=data_length)
      for shuffle in [True, False]:
          iterable = RandomSampler(
              dataset=torch_normal_data, shuffle=shuffle
          )
          # 迭代一些数据，但是不迭代完；
          iterable.set_epoch(1)
          iterator = iter(iterable)
          pre_data = []
          forward_steps = 30
          for _ in range(forward_steps):
              pre_data.append(next(iterator))
  
          # 看重新生成迭代器是否能够完全重置状态；
          iterator = iter(iterable)
          res = []
          for _ in range(forward_steps):
              res.append(next(iterator))
          assert pre_data == res
  
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 1 for calling the TestRandomSampler obj's underlying member method code with example usage: obj.test_seed_work_when_shuffle_is_true() without return types