code: def grouper(n, iterable, padvalue=None):
      "grouper(3, 'abcdefg', 'x') --> ('a','b','c'), ('d','e','f'), ('g','x','x')"
      return zip_longest(*[iter(iterable)] * n, fillvalue=padvalue)
  
imports: import logging
  import sys
  from io import open
  from os import path
  from time import time
  from glob import glob
  from six.moves import range, zip, zip_longest
  from six import iterkeys
  from collections import defaultdict, Iterable
  import random
  from random import shuffle
  from itertools import product, permutations
  from scipy.io import loadmat
  from scipy.sparse import issparse
label_desc: Use image node_id 4 for calling a global function with example usage: grouper(n, iterable, padvalue) and returns: zip_longest