code: def test_replace_sampler_dataset(dataset):
      dataset = JittorNormalDataset(20)
      sampler = RandomSampler(dataset)
  
      replaced_loader = replace_sampler(dataset, sampler)
  
      assert not (replaced_loader is dataset)
      assert isinstance(replaced_loader.sampler, RandomSampler)
      assert replaced_loader.batch_size == dataset.batch_size
      assert replaced_loader.drop_last == dataset.drop_last
      assert replaced_loader.shuffle == dataset.shuffle
      assert replaced_loader.total_len == dataset.total_len
  
imports: import pytest
  from fastNLP.core.drivers.jittor_driver.utils import replace_sampler
  from fastNLP.core.samplers import ReproduceBatchSampler, RandomSampler
  from fastNLP.core.dataloaders import JittorDataLoader
  from fastNLP.envs.imports import _NEED_IMPORT_JITTOR
  from tests.helpers.datasets.jittor_data import JittorNormalDataset
label_desc: Use image node_id 1 for calling a global function with example usage: test_replace_sampler_dataset(dataset) without return types