class_docstr: simple cache for WarmProcess-es
      
class_docstr_tok: ["simple","cache","for","WarmProcess-es"]
docstr: Args:
  ttl (int) time to live for unused process
docstr_tok: ["Args",":","ttl","(","int",")","time","to","live","for","unused","process"]
code: def __init__(self, ttl: int = 120):
      """Args:
      ttl (int) time to live for unused process
      """
      self.cache = {}
      self._init = False
      self._lock = threading.Lock()
      self._ttl = ttl
      self._keep_alive = {}
      self._stop_event = threading.Event()
      self.cleaner_thread = None
      self._start_clean()
  
imports: import sys
  import time
  import threading
  from typing import Optional, Callable
  from concurrent.futures import ProcessPoolExecutor, Future
  from pandas import DataFrame
  from mindsdb.utilities.config import Config
  from mindsdb.utilities.context import context
  from mindsdb.utilities.ml_task_queue.const import ML_TASK_TYPE
  from mindsdb.integrations.libs.learn_process import learn_process, predict_process
label_desc: Use image node_id 1 to create a new ProcessCache object  with example: obj = ProcessCache(ttl)