code: def memoized_method(func=None, key_factory=per_instance, **kwargs):
    
    return memoized(func=func, key_factory=key_factory, **kwargs)
docs: A convenience wrapper for memoizing instance methods.
  
    Typically you'd expect a memoized instance method to hold a cached value per class instance;
    however, for classes that implement a custom `__hash__`/`__eq__` that can hash separate instances
    the same, `@memoized` will share cached values across `==` class instances.  Using
    `@memoized_method` defaults to a `per_instance` key for the cache to provide the expected cached
    value per-instance behavior.
  
    Applied like so:
  
    >>> class Foo(object):
    ...   @memoized_method
    ...   def name(self):
    ...     pass
  
    Is equivalent to:
  
    >>> class Foo(object):
    ...   @memoized(key_factory=per_instance)
    ...   def name(self):
    ...     pass
  
    :API: public
  
    :param func: The function to wrap.  Only generally passed by the python runtime and should be
                 omitted when passing a custom `key_factory` or `cache_factory`.
    :param key_factory: A function that can form a cache key from the arguments passed to the
                        wrapped, memoized function; by default `per_instance`.
    :param kwargs: Any extra keyword args accepted by `memoized`.
    :raises: `ValueError` if the wrapper is applied to anything other than a function.
    :returns: A wrapped function that memoizes its results or else a function wrapper that does this.