<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def memoized_method(func=None, key_factory=per_instance, **kwargs):
 """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: Is equivalent to: :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. """

  return memoized(func=func, key_factory=key_factory, **kwargs)