code: def _init_data(self, seed=0):
      generator = torch.Generator()
      generator.manual_seed(seed)
  
      samplers = []
      dataloaders = []
      torch.distributed.get_world_size = lambda: self.world_size
      for rank in range(self.world_size):
          torch.distributed.get_rank = lambda: rank
          sampler = DistributedUniformWithReplacementSampler(
              total_size=len(self.dataset),
              sample_rate=self.batch_size / len(self.dataset),
              generator=generator,
          )
          dataloader = torch.utils.data.DataLoader(
              self.dataset, batch_sampler=sampler
          )
  
          samplers.append(sampler)
          dataloaders.append(dataloader)
  
      return samplers, dataloaders
  
file_path: opacus/opacus/tests/distributed_poisson_test.py
imports: import unittest
  import numpy
  import torch
  from opacus.utils.uniform_sampler import DistributedUniformWithReplacementSampler
label_desc: Use image node_id 1 for calling the PoissonSamplingTest obj's underlying member method code with example usage: obj._init_data(seed) and returns: samplers,  dataloaders