def memoize(func, cache, num_args):
    def wrapper(*args):
        mem_args = args[:num_args]
        if mem_args in cache:
            return cache[mem_args]
        result = func(*args)
        cache[mem_args] = result
        return result
    return wraps(func)(wrapper)
Establish a set of translation functions for the domain.
dataset/ETHPy150Open CollabQ/CollabQ/vendor/django/utils/functional.py/memoize--crossover with--dataset/ETHPy150Open openstack/python-solumclient/solumclient/openstack/common/gettextutils.py/TranslatorFactory.__init__