class_docstr: Performs bucketing of elements in a dataset by length.
code: def _generate_buckets(self, data_iter: Iterator) -> List[List]:
      buffered_data = self._fetch_buffered_data(data_iter)
      while len(buffered_data) > 0:
          buckets = self._to_buckets(buffered_data)
          for bucket in buckets:
              for element in bucket:
                  yield element
          buffered_data = self._fetch_buffered_data(data_iter)
          del buckets
  
file_path: headliner/headliner/preprocessing/bucket_generator.py
imports: from random import Random
  from typing import Iterable, Callable, Iterator, List
label_desc: Use image node_id 3 for calling the BucketGenerator obj's underlying member method code with example usage: obj._generate_buckets(data_iter) without return types