code: def _chunked_iterator(i: Iterable, chunk_size: int, drop_last: bool):
      chunks = more_itertools.chunked(i, chunk_size)
      if drop_last:
          return (chunk for chunk in chunks if len(chunk) == chunk_size)
      else:
          return chunks
  
imports: from collections import defaultdict
  from typing import Any, Dict, Iterable, Union, List, Mapping
  import more_itertools
  from allennlp.common.registrable import Registrable
  from allennlp.data.instance import Instance
label_desc: Use image node_id 1 for calling a global function with example usage: _chunked_iterator(i, chunk_size, drop_last) and returns: unknown, chunks