Did I find the right examples for you? yes no

All Samples(5)  |  Call(0)  |  Derive(0)  |  Import(5)
caches func return value 

        def cached(func):
    """ caches func return value """
    def cached_func(self, *args, **kwargs):
        attr = '_cached_' + func.__name__
        if not hasattr(self, attr):
            setattr(self, attr, func(self, *args, **kwargs))
        return getattr(self, attr)
    return cached_func
        


src/c/o/confine-controller-0.10.5/controller/utils/plugins/models.py   confine-controller(Download)
from django.db import models
 
from controller.utils.functional import cached
 
 

src/c/o/confine-controller-0.10.5/controller/apps/state/models.py   confine-controller(Download)
from django_transaction_signals import defer
 
from controller.utils.functional import cached
from controller.utils.time import heartbeat_expires as heartbeatexpires
from nodes.models import Node

src/c/o/confine-controller-0.10.5/controller/apps/resources/models.py   confine-controller(Download)
 
from controller.utils import autodiscover
from controller.utils.functional import cached
 
from . import ResourcePlugin

src/c/o/confine-controller-0.10.5/controller/apps/nodes/models.py   confine-controller(Download)
from controller.settings import PRIV_IPV6_PREFIX, PRIV_IPV4_PREFIX_DFLT, SLIVER_MAC_PREFIX_DFLT
from controller.core.validators import validate_name, validate_prop_name, validate_net_iface_name
from controller.utils.functional import cached
from controller.utils.singletons.models import SingletonModel
from pki import ca, Bob

src/c/o/confine-controller-0.10.5/controller/apps/firmware/models.py   confine-controller(Download)
from controller.models.utils import generate_chainer_manager
from controller.utils.auth import any_auth_method
from controller.utils.functional import cached
from nodes.models import Server
from nodes.settings import NODES_NODE_ARCHS