class_docstr: Defines an iterator that batches examples of similar lengths together.
  
  Minimizes amount of padding needed while producing freshly shuffled
  batches for each new epoch. See pool for the bucketing procedure used.
code: def create_batches(self):
      if self.sort:
          self.batches = batch(
              self.data(), self.batch_size, self.batch_size_fn
          )
      else:
          self.batches = pool(
              self.data(),
              self.batch_size,
              self.sort_key,
              self.batch_size_fn,
              random_shuffler=self.random_shuffler,
              shuffle=self.shuffle,
              sort_within_batch=self.sort_within_batch,
          )
  
imports: import logging
  import math
  import random
  import torch
  from torchtext.data.utils import RandomShuffler
  from .batch import Batch
  from .dataset import Dataset
label_desc: Use image node_id 1 for calling the BucketIterator obj's underlying member method code with example usage: obj.create_batches() without return types