<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(method=None, cache_factory=None):
 """ Memoize a class's method. Arguments are similar to to `memoized`, except that the cache container is specified with `cache_factory`: a function called with no arguments to create the caching container for the instance. Note that, unlike `memoized`, the result cache will be stored on the instance, so cached results will be deallocated along with the instance. Example:: Calling get_name on 'shazow' 'shazow' 'shazow' {((), ()):
 'shazow'} Example with a specific cache container:: Calling add with 1 and 1 2 2 Calling add with 2 and 2 4 Calling add with 3 and 3 6 Calling add with 1 and 1 2 """


    if method is None:
        return lambda f: memoized_method(f, cache_factory=cache_factory)

    cache_factory = cache_factory or dict

    @wraps(method)
    def memoized_method_property(self):
        cache = cache_factory()
        cache_attr = "_%s_cache" %(method.__name__, )
        setattr(self, cache_attr, cache)
        result = partial(
            _memoized_call,
            partial(method, self),
            cache
        )
        result.memoize_cache = cache
        return result
    return memoized_property(memoized_method_property)