code: def test_sharded_iterator_even_size(
      seq_lengths,
      max_num_tokens,
      max_num_sentences,
      required_batch_size_multiple,
      shuffle,
      num_parts,
      even_size,
  ):
      total_sampled_ids = []
      first_batch_num = None
      for part_index in range(num_parts):
          batch_num = 0
          # we use independent (but same) sampler to simulate multi process situation
          sampler = s.BoundedBudgetSampler(
              seq_lengths,
              max_num_tokens,
              max_num_sentences,
              required_batch_size_multiple,
              shuffle=shuffle,
              seed=100,
          )
          sharded_iter = s.ShardedIterator(
              sampler, num_parts, part_index, even_size
          )
          print(sharded_iter)
          for batch_sample_ids in sharded_iter:
              total_sampled_ids.extend(batch_sample_ids)
              batch_num += 1
          # assert batch num of each parts equals
          if first_batch_num is None:
              first_batch_num = batch_num
          else:
              assert first_batch_num == batch_num
      assert len(set(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 11 for calling a global function with example usage: test_sharded_iterator_even_size(seq_lengths, max_num_tokens, max_num_sentences, required_batch_size_multiple, shuffle, num_parts, even_size) without return types