code: def chunked(iterable, batch_size):
      """Break *iterable* into lists of length *n*:
  
          >>> list(chunked([1, 2, 3, 4, 5, 6], 3))
          [[1, 2, 3], [4, 5, 6]]
  
      By the default, the last yielded list will have fewer than *n* elements
      if the length of *iterable* is not divisible by *n*:
  
          >>> list(chunked([1, 2, 3, 4, 5, 6, 7, 8], 3))
          [[1, 2, 3], [4, 5, 6], [7, 8]]
  
  
      Adopted and simplified from more-itertools
      https://more-itertools.readthedocs.io/en/stable/_modules/more_itertools/more.html#chunked
  
      Arguments
      ---------
      iterable: iterable
          any iterable of individual samples
  
      batch_size: int
          the size of each chunk
  
      Returns
      -------
      batched_iterable: iterable
          an itearble of batches
  
      """
      iterable = iter(iterable)
      iterator = iter(
          lambda: list(itertools.islice(iterable, batch_size)), []
      )
      return iterator
  
imports: import itertools
  import math
  import os
  import speechbrain
  import sys
  import traceback
  from cmd import Cmd
  from argparse import ArgumentParser
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.inference.text import GraphemeToPhoneme
  from tqdm.auto import tqdm
label_desc: Use image node_id 5 for calling a global function with example usage: chunked(iterable, batch_size) and returns: iterator