code: def timeout(time, message):
      timer = None
      try:
          timer = Timer(time, interrupt_main)
          timer.daemon = True
          timer.start()
          yield
      except KeyboardInterrupt as e:
          if timer is not None and timer.is_alive():
              raise e  # interrupt from user?
          raise TimeoutError(message) from e
      finally:
          if timer is not None:
              try:
                  timer.cancel()
              finally:
                  pass
  
file_path: MONAI/monai/_extensions/loader.py
imports: from __future__ import annotations
  import platform
  from _thread import interrupt_main
  from contextlib import contextmanager
  from glob import glob
  from os import path
  from threading import Timer
  from types import ModuleType
  import torch
  from monai.utils.module import get_torch_version_tuple, optional_import
label_desc: Use image node_id 1 for calling a global function with example usage: timeout(time, message) without return types