def memoize(fun):
    """A simple memoize decorator for functions supporting positional args."""
    @wraps(fun)
    def wrapper(*args, **kwargs):
        key = (args, frozenset(sorted(kwargs.items())))
        try:
            return cache[key]
        except __HOLE__:
            ret = cache[key] = fun(*args, **kwargs)
        return ret
    cache = {}
    return wrapper
dataset/ETHPy150Open graphql-python/graphene/graphene/utils/caching.py/memoize