class_docstr: A sharded wrapper around an iterable (padded to length).
  
  Parameters
  ----------
  sampler
  num_parts
      Number of partitions which the data is split into (default: 1)
  part_index
      The index of the part to read from
  even_size
      If the number of batches is not even across all partitions, sample a few extra batches
      for the ones with fewer batches.
class_docstr_tok: ["A","sharded","wrapper","around","an","iterable","(","padded","to","length",")",".","Parameters","--","--","--","--","--","sampler","num_parts","Number","of","partitions","which","the","data","is","split","into","(","default",":","1",")","part_index","The","index","of","the","part","to","read","from","even_size","If","the","number","of","batches","is","not","even","across","all","partitions",",","sample","a","few","extra","batches","for","the","ones","with","fewer","batches","."]
code: def __iter__(self):
      # TODO(?), When the number of samples is large. We should improve the logic here.
      #  Since the python list can cost lots of memory
      batches = list(self._sampler)
      part_batches = batches[self._start : self._end]
      if self._even_size and len(part_batches) < self._part_len:
          candidates = self._rng.choice(
              len(batches), size=self._part_len - len(part_batches)
          )
          for idx in candidates:
              part_batches.append(batches[idx])
      logging.info("In ShardedIterator. Constructed part batches!")
      for batch in part_batches:
          yield batch
  
imports: import math
  import random
  import warnings
  import numpy
  import abc
  import logging
  from typing import Union, Sequence, Optional, List
  from ..base import INT_TYPES
label_desc: Use image node_id 3 for calling the ShardedIterator obj's underlying member method code with example usage: obj.__iter__() without return types