def cached(f):

    cache = f.cache = {}

    @functools.wraps(f)
    def decorator(*args, **kwargs):
        key = str(args) + str(kwargs)
        if key not in cache:
            cache[key] = f(*args, **kwargs)
        return cache[key]
    return decorator
NAPALM library must be installed for this module to work.
dataset/ETHPy150Open viniciuschiele/flask-apidoc/flask_apidoc/utils.py/cached--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/napalm_network.py/__virtual__