code: def test_multi_same_bucket(
      self, shuffle, drop_last, pad, num_samples, num_replicas
  ):
      # def test_multi_same_bucket(self, shuffle=True, drop_last=True, pad=True, num_samples=623, num_replicas=2):
      dataset = DatasetWithVaryLength(num_of_data=num_samples)
      batch_size = 6
      if num_replicas * batch_size > num_samples:
          return
      num_batch_per_bucket = 10
      samplers = []
      lengths = []
      for i in range(num_replicas):
          sampler = BucketedBatchSampler(
              dataset,
              length=dataset.data,
              batch_size=batch_size,
              num_batch_per_bucket=num_batch_per_bucket,
              shuffle=shuffle,
              drop_last=drop_last,
          )
          sampler.set_distributed(num_replicas, rank=i, pad=pad)
          sampler.set_epoch(0)
          samplers.append(sampler)
          lengths.append(len(list(iter(sampler))))
      assert len(set(lengths)) == 1
      bucket_diff = batch_size * num_batch_per_bucket * num_replicas
  
      for bs in zip(*samplers):
          diff = max(chain(*bs)) - min(chain(*bs))
          assert diff <= bucket_diff
  
imports: import numpy
  import pytest
  from itertools import chain
  from copy import deepcopy
  from array import array
  from tests.helpers.datasets.normal_data import NormalSampler, NormalBatchSampler
  from fastNLP.core.samplers import ReproduceBatchSampler, BucketedBatchSampler, RandomBatchSampler
label_desc: Use image node_id 4 for calling the TestBucketedBatchSampler obj's underlying member method code with example usage: obj.test_multi_same_bucket(shuffle, drop_last, pad, num_samples, num_replicas) without return types