code: def test_replace_sampler():
      dataset = PaddleNormalDataset(10)
      dataloader = DataLoader(dataset, batch_size=32)
      sampler = RandomSampler(dataset)
  
      replaced_loader = replace_sampler(dataloader, sampler)
  
      assert not (replaced_loader is dataloader)
      assert isinstance(replaced_loader.batch_sampler, BatchSampler)
      assert isinstance(
          replaced_loader.batch_sampler.sampler, RandomSampler
      )
  
imports: import pytest
  from fastNLP.core.drivers.paddle_driver.utils import replace_batch_sampler, replace_sampler
  from fastNLP.core.samplers import ReproduceBatchSampler, RandomSampler
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE
  from tests.helpers.datasets.paddle_data import PaddleNormalDataset
label_desc: Use image node_id 2 for calling a global function with example usage: test_replace_sampler() without return types