human
Complete the below
def cachedmethod(function):

    ''''Decorator to make a method use the cache.
    .. note::
    This can NOT be used with static functions, it has to be used on
    methods of some class'
    '''
assistant
#Here is the Python code you requested.
    @wraps(function)
    def cached(*args):
        c = args[0].config.cache
        service_name = args[0].__class__.__name__
        func_key = c.cached_func_key(function, cls=args[0].__class__)
        func_cache = c.cache[service_name][func_key]
        key = args[1:]
        if (key in func_cache):
            result = func_cache[key]
            logger.debug((u'Using    cached    value    for    %s(%s),    returns:    %s' % (func_key, key, result)))
            return result
        result = function(*args)
        func_cache[key] = result
        return result
    return cached