invenio_migrator/legacy/utils.py
def memoize(func):
    """Cache for heavy function calls."""
    cache = {}

    @wraps(func)
    def wrap(*args, **kwargs):
        key = '{0}{1}'.format(args, kwargs)
        if key not in cache:
            cache[key] = func(*args, **kwargs)
        return cache[key]
    return wrap
def memoize(func):
    cache = {}

    @wraps(func)
    def wrap(*args, **kwargs):
        key = '{0}{1}'.format(args, kwargs)
        if key not in cache:
            cache[key] = func(*args, **kwargs)
        return cache[key]
    return wrap
def memoize ( func ) : cache = { } @ wraps ( func ) def wrap ( * args , * * kwargs ) : key = '{0}{1}' . format ( args , kwargs ) if key not in cache : cache [ key ] = func ( * args , * * kwargs ) return cache [ key ] return wrap
Cache for heavy function calls.
Cache for heavy function calls .