code: def batch(iterable: list, n: int = 1) -> Iterable[list]:
      """Batches an iterable into chunks of size n."""
      length = len(iterable)
      for ndx in range(0, length, n):
          yield iterable[ndx : min(ndx + n, length)]
  
imports: from __future__ import annotations
  from typing import Iterable
  from smac.utils.logging import get_logger
label_desc: Use image node_id 2 for calling a global function with example usage: batch(iterable, n) without return types