code: def prefetch_data(
      queue,
      data_loader,
      transform,
      queue_min_size,
      process_id,
      wait_time=0.2,
  ):
      while True:
          try:
              cur_size = queue.qsize()
              if cur_size < queue_min_size:
                  item = next(data_loader)
                  item = transform(**item)
                  if not queue.full():
                      queue.put(item)
              else:
                  sleep(wait_time)
          except Exception as exp:
              raise exp
      return
  
file_path: PaddleSeg/contrib/MedicalSeg/nnunet/transforms/multi_threaded_augmenter.py
imports: import sys
  import paddle
  import traceback
  from multiprocessing import Event, Queue, Process
  from time import sleep
  from threadpoolctl import threadpool_limits
label_desc: Use image node_id 1 for calling a global function with example usage: prefetch_data(queue, data_loader, transform, queue_min_size, process_id, wait_time) without return types