class_docstr: Fast, lightweight cache which keeps at most `size` items.
  It will discard the oldest items in the cache first.
  
  The cache is a dictionary, which doesn't keep track of access counts.
  It is perfect to cache little immutable objects which are not expensive to
  create, but where a dictionary lookup is still much faster than an object
  instantiation.
  
  :param get_value: Callable that's called in case of a missing key.
class_docstr_tok: ["Fast",",","lightweight","cache","which","keeps","at","most","`","size","`","items",".","It","will","discard","the","oldest","items","in","the","cache","first",".","The","cache","is","a","dictionary",",","which","does","n't","keep","track","of","access","counts",".","It","is","perfect","to","cache","little","immutable","objects","which","are","not","expensive","to","create",",","but","where","a","dictionary","lookup","is","still","much","faster","than","an","object","instantiation",".",":","param","get_value",":","Callable","that","'s","called","in","case","of","a","missing","key","."]
code: def __init__(
      self, get_value: Callable[..., _V], size: int = 1000000
  ) -> None:
      assert size > 0
  
      self._keys: deque[_K] = deque()
      self.get_value = get_value
      self.size = size
  
file_path: catboost/contrib/python/prompt-toolkit/py3/prompt_toolkit/cache.py
imports: from __future__ import annotations
  from collections import deque
  from functools import wraps
  from typing import Any, Callable, Dict, Generic, Hashable, Tuple, TypeVar, cast
label_desc: Use image node_id 1 to create a new FastDictCache object from inherited base classes: Dict with example: obj = FastDictCache(get_value, size)