code: def grouper_dict(d, n):
      
      chunk = dict()
      counter = 0
      for k, v in d.items():
          counter += 1
          chunk[k] = v
          print(counter ,chunk)
          if counter == n:
              yield chunk
              chunk = dict()
              counter = 0
      if len(chunk) > 0:
          yield chunk
docs: Evenly divide dictionary into fixed-length piece, no filled value if
      chunk size smaller than fixed-length.
  
      Usage::
  
          >>> list(grouper_dict({1: 'A', 2: 'B', 3: 'C', 4: 'D', 5: 'E',
                                 6: 'F', 7: 'G', 8: 'H', 9: 'I', 10: 'J'}))
          [{1: 'A', 2: 'B', 3: 'C'}, {4: 'D', 5: 'E', 6: 'F'},
           {7: 'G', 8: 'H', 9: 'I'}, {10: 'J'}]