def METHOD_NAME(*args, **kwargs):
    global cache
    key = json.dumps((func, args, kwargs), sort_keys=True, default=str)
    try:
        return cache[key]
    except KeyError:
        pass  # Drop out of the exception handler scope.
    res = func(*args, **kwargs)
    cache[key] = res
    return res