class_docstr: Very simple cache that discards the oldest item when the cache size is
  exceeded.
  
  :param maxsize: Maximum size of the cache. (Don't make it too big.)
docstr: Get object from the cache.
  If not found, call `getter_func` to resolve it, and put that on the top
  of the cache instead.
docstr_tok: ["Get","object","from","the","cache",".","If","not","found",",","call","`","getter_func","`","to","resolve","it",",","and","put","that","on","the","top","of","the","cache","instead","."]
code: def get(self, key: _T, getter_func: Callable[[], _U]) -> _U:
      """
      Get object from the cache.
      If not found, call `getter_func` to resolve it, and put that on the top
      of the cache instead.
      """
      # Look in cache first.
      try:
          return self._data[key]
      except KeyError:
          # Not found? Get it.
          value = getter_func()
          self._data[key] = value
          self._keys.append(key)
  
          # Remove the oldest key when the size is exceeded.
          if len(self._data) > self.maxsize:
              key_to_remove = self._keys.popleft()
              if key_to_remove in self._data:
                  del self._data[key_to_remove]
  
          return value
  
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 2 for calling the SimpleCache obj's underlying member method code with example usage: obj.get(key, getter_func) and returns: self, value