def cacheable(cache_key, timeout=3600):
    def paramed_decorator(func):
        def decorated(self, *args, **kwargs):
            key = cache_key % self.__dict__
            res = cache.get(key)
            if res == None:
                res = func(self, *args, **kwargs)
                cache.set(key, res, timeout)
            return res
        decorated.__doc__ = func.__doc__
        decorated.__dict__ = func.__dict__
        return decorated 
    return paramed_decorator
dataset/ETHPy150Open niwinz/niwi-web/src/niwi/utils.py/cacheable/original