code: def map_to_queue(fn, emitter, queue, encode, batch_size):
      for batch in into_batches(batch_size, map(encode, fn(emitter))):
          queue.put(batch)
      queue.put(sentinel)
  
file_path: gluonts/src/gluonts/nursery/glide/parallel.py
imports: import multiprocessing
  from functools import partial
  from toolz.itertoolz import partition_all
  from toolz.functoolz import identity
label_desc: Use image node_id 1 for calling a global function with example usage: map_to_queue(fn, emitter, queue, encode, batch_size) without return types