code: def test_fixed_bucket_sampler(
      seq_lengths,
      ratio,
      shuffle,
      num_buckets,
      bucket_scheme,
      use_average_length,
  ):
      sampler = s.FixedBucketSampler(
          seq_lengths,
          batch_size=8,
          num_buckets=num_buckets,
          ratio=ratio,
          shuffle=shuffle,
          use_average_length=use_average_length,
          bucket_scheme=bucket_scheme,
      )
      # here we print sampler to cover the __repr__ func of the sampler
      print(sampler)
      total_sampled_ids = []
      for batch_sample_ids in sampler:
          total_sampled_ids.extend(batch_sample_ids)
      assert len(set(total_sampled_ids)) == len(total_sampled_ids) == N
  
file_path: gluon-nlp/tests/test_data_sampler.py
imports: import pytest
  import numpy
  from mxnet.gluon import data
  from gluonnlp.data import sampler
label_desc: Use image node_id 2 for calling a global function with example usage: test_fixed_bucket_sampler(seq_lengths, ratio, shuffle, num_buckets, bucket_scheme, use_average_length) without return types