code: def memoize_method(method):
      """A normal memoize function."""
  
      @wraps(method)
      def wrapper(self, *args, **kwargs):
          cache_dict = self.__dict__.setdefault(
              "_memoize_method_dct", {}
          )
          dct = cache_dict.setdefault(method, {})
          key = (args, frozenset(kwargs.items()))
          try:
              return dct[key]
          except KeyError:
              result = method(self, *args, **kwargs)
              dct[key] = result
              return result
  
      return wrapper
  
file_path: catboost/contrib/python/jedi/py2/jedi/cache.py
imports: import time
  from functools import wraps
  from jedi import settings
  from parso.cache import parser_cache
label_desc: Use image node_id 5 for calling a global function with example usage: memoize_method(method) and returns: wrapper, dct, result