code: def itergroups(items, group_size):
      """An iterator that iterates a list with batch data."""
      assert group_size >= 1
      group = []
      for x in items:
          group.append(x)
          if len(group) == group_size:
              yield tuple(group)
              del group[:]
      if group:
          yield tuple(group)
  
imports: import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: itergroups(items, group_size) without return types