code: def _worker(
      execute: Callable[[Any], Any],
      inputs: mp.Queue,  # type: ignore
      outputs: mp.Queue,  # type: ignore
  ) -> None:
      while True:
          # Timeout is needed to shutdown workers if no tasks are available anymore.
          try:
              i = inputs.get(timeout=10)
          except Empty:
              return
          data = _GLOBAL_DATA_CACHE[i]  # type: ignore
          output = execute(data)
          outputs.put((i, output))
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/tsbench/analysis/utils/multiprocessing.py
imports: import math
  import multiprocessing
  import os
  from multiprocessing.pool import ThreadPool
  from queue import Empty
  from typing import Any, Callable, cast, List, TypeVar
  import psutil
  from tqdm.auto import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: _worker(execute, inputs, outputs) without return types