def __call__(self, *args, **kw):
        obj = args[0]
        try:
            cache = obj.__cache
        except AttributeError:
            cache = obj.__cache = {}
        key = (self.func, args[1:], frozenset(list(kw.items())))
        try:
            res = cache[key]
        except __HOLE__:
            res = cache[key] = self.func(*args, **kw)
        return res
dataset/ETHPy150Open calliope-project/calliope/calliope/utils.py/memoize_instancemethod.__call__