class_docstr: Performs bucketing of elements in a dataset by length.
code: def _sort_blocks(self, buffered_data: List) -> List:
      block_size = self.batches_to_shuffle * self.batch_size
      buffered_data_sorted = []
      for i in range(0, len(buffered_data), block_size):
          sorted_block = buffered_data[i : i + block_size]
          sorted_block.sort(key=self.sequence_length_function)
          buffered_data_sorted.extend(sorted_block)
      return buffered_data_sorted
  
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 5 for calling the BucketGenerator obj's underlying member method code with example usage: obj._sort_blocks(buffered_data) and returns: buffered_data_sorted