code: def chunks(iter, n):
      arr = []
      for x in iter:
          arr.append(x)
          if len(arr) == n:
              yield arr
              arr = []
  
      if arr:
          yield arr
  
imports: import os
  import pathlib
  import re
  import collections
  import functools
  import inspect
  import sys
  from typing import List, Union
  import torch
  from omegaconf import OmegaConf
  import sacrebleu
  from rouge_score import rouge_scorer, scoring
label_desc: Use image node_id 4 for calling a global function with example usage: chunks(iter, n) without return types