Bust the cache for all :class:`.cached_property` objects on `obj`

        :param obj: The instance on which to bust the caches.
969189
def bust_caches(cls, obj, excludes=()):
        
        for name, _ in cls.get_cached_properties(obj):
            if name in obj.__dict__ and not name in excludes:
                delattr(obj, name)
260379
public void cache(String key, Object obj) {
        H.Session sess = session();
        if (null != sess) {
            sess.cache(key, obj);
        } else {
            app().cache().put(key, obj);
        }
    }
885415
def _clean_dirty(self, obj=None):
        
        obj = obj or self
        obj.__dict__['_dirty_attributes'].clear()
        obj._dirty = False
        for key, val in vars(obj).items():
            if isinstance(val, BaseObject):
                self._clean_dirty(val)
            else:
                func = getattr(val, '_clean_dirty', None)
                if callable(func):
                    func()
148702
def cached(f):
    
    @functools.wraps(f)
    def wrapped(*args, **kwargs):
        with _cache_lock:
            identifier = (f.__name__,  args, kwargs)
            key = pickle.dumps(identifier)
            value = cache.get(key)
            if value is not None:
                logger.debug("HIT for %s -> %s" % (str(identifier), value))
            else:
                logger.debug("MISS for %s" % str(identifier))
                value = f(*args, **kwargs)
                cache[key] = value
            return value
    return wrapped
956433
def clear(self, obj):
        
        self.proxy_for(obj).restore_original_object()
        del self._proxies[id(obj)]
881955
def get(self, object_type, cache_key):
        
        if object_type not in self.mapping or self.disabled:
            return None
        cache = self.mapping[object_type]
        if cache_key in cache:
            log.debug("Cache HIT: [%s %s]" % (object_type.capitalize(), cache_key))
            return cache[cache_key]
        else:
            log.debug('Cache MISS: [%s %s]' % (object_type.capitalize(), cache_key))
180218
def memoize(obj):
    
    cache = obj.cache = {}

    @functools.wraps(obj)
    def memoizer(*args, **kwargs):
        key = str(args) + str(kwargs)
        if key not in cache:
            cache[key] = obj(*args, **kwargs)
        # only keep the most recent 100 entries
        if len(cache) > 100:
            cache.popitem(last=False)
        return cache[key]
    return memoizer
1274379
def clean_cache(cached, **kwargs):
    "  "

    if isinstance(cached, basestring):
        cached = _str_to_model(cached)

    cache_key = generate_cache_key(cached, **kwargs)
    cache.delete(cache_key)
1007280
function (obj) {
			for (var i in obj) if (obj.hasOwnProperty(i)) delete obj[i];
			this.objects.push(obj);
			// this.collected++;
		}
1054042
def popattr(obj, attr, default=NOT_PROVIDED):
    
    val = getattr(obj, attr, default)
    try:
        delattr(obj, attr)
    except AttributeError:
        if default is NOT_PROVIDED:
            raise
    return val
164022
def _recursive_reindex_object_security(self, obj):
        
        if hasattr(aq_base(obj), "objectValues"):
            for obj in obj.objectValues():
                self._recursive_reindex_object_security(obj)

        logger.debug("Reindexing object security for {}".format(repr(obj)))
        obj.reindexObjectSecurity()
444448
def remove_object(self, obj):
        """"""
        self._objects.remove(obj)
        self._pairs.difference_update((obj, p) for p in self._properties)
927810
function inspect(prop, cache, clone) {
        var key,
            x,
            length,
            ret;

        cache = cache || {
            others: [],
            instances: [],
            constructors: []
        };

        if (isObject(prop)) {
            // Check if it is an instance
            if (prop.$static) {
                return prop.$static[$class].inspectInstance ?
                    prop.$static[$class].inspectInstance(prop, cache) :
                    inspectInstance(prop, cache);
            }

            // Object is a collection
            // Attempt to fetch from cache
            ret = fetchCache(prop, cache.others);
            if (ret) {
                return ret;
            }

            ret = {};
            cache.others.push({ target: prop, inspect: ret });

            // Iterate over each key value of the object, inspecting it
            for (key in prop) {
                ret[key] = inspect(prop[key], cache, clone);
            }

            return ret;
        }

        // Array is a collection
        if (isArray(prop)) {
            // Attempt to fetch from cache
            ret = fetchCache(prop, cache.others);
            if (ret) {
                return ret;
            }

            ret = [];
            cache.others.push({ target: prop, inspect: ret });

            // Iterate over each item of the array, inspecting it
            length = prop.length;
            for (x = 0; x < length; x += 1) {
                ret.push(inspect(prop[x], cache, clone));
            }

            return ret;
        }

        if (isFunction(prop)) {
            // Check if is a constructor
            if (prop[$class]) {
                return prop[$class].inspectConstructor ?
                    prop[$class].inspectConstructor(prop, cache) :
                    inspectConstructor(prop, cache);
            }

            // Otherwise check if it is a wrapper function or a normal one
            return prop[$wrapped] || prop;
        }

        return prop;
    }
1046535
public void cache(Identity oid, Object obj)
    {
        if (oid != null && obj != null)
        {
            ObjectCache cache = getCache(oid, obj, METHOD_CACHE);
            if (cache != null)
            {
                cache.cache(oid, obj);
            }
        }
    }
1263131
def destroy_all(cls, objs):
        
        if not objs:
            return
        if any(x.is_new() for x in objs):
            raise ValueError("Could not destroy unsaved object")

        dumped_objs = []
        for obj in objs:
            dumped_obj = {
                'method': 'DELETE',
                'path': '/{0}/classes/{1}/{2}'.format(client.SERVER_VERSION, obj._class_name, obj.id),
                'body': obj._flags,
            }
            dumped_objs.append(dumped_obj)

        response = client.post('/batch', params={'requests': dumped_objs}).json()

        errors = []
        for idx, obj in enumerate(objs):
            content = response[idx]
            error = content.get('error')
            if error:
                errors.append(leancloud.LeanCloudError(error.get('code'), error.get('error')))

        if errors:
            # TODO: how to raise list of errors?
            # raise MultipleValidationErrors(errors)
            # add test
            raise errors[0]
82298
def from_def(cls, obj):
        
        prof = cls(obj["steamid"])
        prof._cache = obj

        return prof
145561
def _dumps(self, obj):
        
        if not self.serialized:
            return obj
        return self.serializer.dumps(obj)