parameters: (method)
return_statement: return wrapper
docstring: A normal memoize function.
docstring_summary: A normal memoize function.
docstring_tokens: A normal memoize function .
function: 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
function_tokens: def memoize_method ( method ) : @ 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