code: def _process(
      q, generator, generator_params, output_shapes, batch_size
  ):
      batch_data = {key: [] for key in output_shapes}
      num_data_points = 0
  
      for single_data in generator(*generator_params):
          for key in single_data:
              batch_data[key].append(single_data[key])
          num_data_points += 1
          if num_data_points == batch_size:
              q.put(batch_data)
              batch_data = {key: [] for key in output_shapes}
              num_data_points = 0
  
      if num_data_points > 0:
          q.put(batch_data)
      q.put(None)
  
imports: import multiprocessing
  import tensorflow
  import numpy
  import random
label_desc: Use image node_id 1 for calling a global function with example usage: _process(q, generator, generator_params, output_shapes, batch_size) without return types