code: def run_infer_task(req, datastore, infer):
      handle_torch_linalg_multithread(req)
  
      image_id = req.get("image")
      logger.info(f"Running inference for image id {image_id}")
      r = infer(req, datastore)
      if r.get("file"):
          remove_file(r.get("file"))
          r.pop("file")
      return r
  
file_path: MONAILabel/monailabel/interfaces/tasks/batch_infer.py
imports: import copy
  import logging
  import multiprocessing
  import time
  from concurrent.futures import ThreadPoolExecutor
  from enum import Enum
  from typing import Callable
  import torch
  from monailabel.interfaces.datastore import Datastore, DefaultLabelTag
  from monailabel.utils.others.generic import handle_torch_linalg_multithread, name_to_device, remove_file
label_desc: Use image node_id 1 for calling a global function with example usage: run_infer_task(req, datastore, infer) and returns: r