code: def grouped_iterator(n, it):
      group = []
      while True:
          if len(group) == n:
              yield group
              group = []
  
          try:
              elt = next(it)
          except StopIteration:
              break
  
          group.append(elt)
  
      if group:
          yield group
  
imports: import gzip
  import io
  import json
  import os
  import re
  import shlex
  import subprocess
  import sys
  import time
  from typing import List
label_desc: Use image node_id 1 for calling a global function with example usage: grouped_iterator(n, it) without return types