Decorator to add a reset() method that clears data cached by
    the @resettable_cached_property decorator. Technically this could
    be a mixin...
974472
def cacheable_object(cls):
    

    def reset(self):
        if hasattr(self, '_resettable_cached_properties'):
            self._resettable_cached_properties = {}

    cls.reset = reset
    return cls
519950
def clear_cache(cls):
        """"""
        #Prevent tkinter errors on python 2 ??
        for key in cls._cached:
            cls._cached[key] = None
        cls._cached = {}
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)
1011474
def reset!
      if RSpec.configuration.server_runner_clear_cookbooks
        @server.clear_data
        @cookbooks_uploaded = false
      else
        # If we don't want to do a full clear, iterate through each value that we
        # set and manually remove it.
        @data_loaded.each do |key, names|
          if key == "data"
            names.each { |n| @server.data_store.delete_dir(["organizations", "chef", key, n]) }
          else
            names.each { |n| @server.data_store.delete(["organizations", "chef", key, n]) }
          end
        end
      end
      @data_loaded = {}
    end
490610
Double resettableFunctionalCounter(String functionalCounterKey, DoubleSupplier function) {
        Double result = function.getAsDouble();
        Double previousResult = previousValueCacheMap.getOrDefault(functionalCounterKey, 0D);
        Double beforeResetValue = beforeResetValuesCacheMap.getOrDefault(functionalCounterKey, 0D);
        Double correctedValue = result + beforeResetValue;

        if (correctedValue < previousResult) {
            beforeResetValuesCacheMap.put(functionalCounterKey, previousResult);
            correctedValue = previousResult + result;
        }
        previousValueCacheMap.put(functionalCounterKey, correctedValue);
        return correctedValue;
    }
1073240
def _reset_attr(self, name, func=None, doc=None, preload=False):
        ""

        keys = set(self)
        if name not in keys:
            try:
                data, funcs = zip(*[
                    (
                        (
                            key, (
                                getattr(self._attr_data_, key)
                                if hasattr(self._attr_data_, key)
                                else None
                            )
                        ),
                        (
                            key, (
                                getattr(self._attr_func_, key)
                                if hasattr(self._attr_func_, key)
                                else None
                            )
                        ),
                    )
                    for key in keys
                ])

                keys.add(name)
                self._attr_data_ = keys
                self._attr_func_ = keys

                [
                    setattr(self._attr_data_, key,  value)
                    for key, value in data
                    if value is not None
                ]
                [
                    setattr(self._attr_func_, key,  value)
                    for key, value in funcs
                    if value is not None
                ]

            except ValueError:
                keys.add(name)
                self._attr_data_ = keys
                self._attr_func_ = keys

        if hasattr(self._attr_data_, name):
            delattr(self._attr_data_, name)

        if func is not None:
            setattr(self._attr_func_, name, func)

        elif hasattr(self._attr_func_, name):
            delattr(self._attr_func_, name)

        self._set_attr(name, doc, preload)
1157348
def _reset(self, **kwargs):
        

        # there are some inconsistenciens in the API regarding these
        # note: this could be written in fancier ways, but this way is simpler

        if 'uuid' in kwargs:
            self.uuid = kwargs['uuid']
        elif 'storage' in kwargs:  # let's never use storage.storage internally
            self.uuid = kwargs['storage']

        if 'title' in kwargs:
            self.title = kwargs['title']
        elif 'storage_title' in kwargs:
            self.title = kwargs['storage_title']

        if 'size' in kwargs:
            self.size = kwargs['size']
        elif 'storage_size' in kwargs:
            self.size = kwargs['storage_size']

        # send the rest to super._reset

        filtered_kwargs = dict(
            (key, val)
            for key, val in kwargs.items()
            if key not in ['uuid', 'storage', 'title', 'storage_title', 'size', 'storage_size']
        )
        super(Storage, self)._reset(**filtered_kwargs)
898583
def clear(cls, fn):
        # type: (FunctionType) -> None
        
        if hasattr(fn, cls.CACHE_VAR):
            delattr(fn, cls.CACHE_VAR)
673512
public void reset() {
		this.location = 0;
		this.first_created = 0;
		this.expiration = -1;
		this.validatorExpiration = -1;  // LI4537-24
		this.tableid = 0;
		this.key = null;
		this.value = null;
		this.next = 0;
		this.previous = 0;
		this.valuelen = -1;
		this.hash = 0;
		this.index = 0;
        this.size = -1;
        this.serializedKey        = null;
        this.serializedCacheValue = null;
        this.cacheValueSize = 0;
        this.cacheValueHashcode = 0;  // LI4337-17
        this.bAliasId = false;
        this.bValidHashcode = true;  // LI4337-17
	}
40767
function reset () {
    var immutable = global.__immutable_core__
    // default options
    immutable.defaultAjv = new Ajv({
        allErrors: true,
        coerceTypes: 'array',
        removeAdditional: true,
        useDefaults: true,
        v5: true,
    })
    immutable.defaultAllowOverride = false
    immutable.defaultAutomock = undefined
    immutable.defaultCacheClient = undefined
    immutable.defaultFreeze = false
    immutable.defaultFreezeData = true
    immutable.defaultImmutableAI = true
    immutable.defaultLogClient = undefined
    immutable.defaultResolve = false
    immutable.defaultStrictArgs = true
    immutable.defaultValidateArgs = true
    immutable.defaultValidateReturn = true
    // global data stores
    immutable.binds = {}
    immutable.caches = {}
    immutable.functions = {}
    immutable.modules = {}
    // return immutable
    return ImmutableCore
}
876260
def cached_per_instance():
    

    def cache_fun(fun):
        argspec = inspect2.getfullargspec(fun)
        arg_names = argspec.args[1:] + argspec.kwonlyargs  # remove self
        kwargs_defaults = get_kwargs_defaults(argspec)
        cache = {}

        def cache_key(args, kwargs):
            return get_args_tuple(args, kwargs, arg_names, kwargs_defaults)

        def clear_cache(instance_key, ref):
            del cache[instance_key]

        @functools.wraps(fun)
        def new_fun(self, *args, **kwargs):
            instance_key = id(self)
            if instance_key not in cache:
                ref = weakref.ref(self, functools.partial(clear_cache, instance_key))
                cache[instance_key] = (ref, {})
            instance_cache = cache[instance_key][1]

            k = cache_key(args, kwargs)
            if k not in instance_cache:
                instance_cache[k] = fun(self, *args, **kwargs)
            return instance_cache[k]

        # just so unit tests can check that this is cleaned up correctly
        new_fun.__cached_per_instance_cache__ = cache
        return new_fun

    return cache_fun
763604
private static void resetMapperForThrift(boolean isCql3Enabled)
    {
        if (isCql3Enabled)
        {
            validationClassMapper.put(Byte.class, BytesType.class);
            validationClassMapper.put(byte.class, BytesType.class);
            validationClassMapper.put(Short.class, IntegerType.class);
            validationClassMapper.put(short.class, IntegerType.class);
            validationClassMapper.put(java.sql.Time.class, DateType.class);
            validationClassMapper.put(java.sql.Date.class, DateType.class);
            validationClassMapper.put(java.util.Date.class, DateType.class);
            validationClassMapper.put(java.sql.Timestamp.class, DateType.class);
        }
    }
969796
public function resetDefault()
    {
        if ($record = $this->getSettingsRecord()) {
            $record->delete();
            unset(self::$instances[$this->recordCode]);
            Cache::forget($this->getCacheKey());
        }
    }
935529
def _reset_cache(self, key=None):
        
        if getattr(self, '_cache', None) is None:
            return
        if key is None:
            self._cache.clear()
        else:
            self._cache.pop(key, None)
479537
def cache(ignore=None):
    
    def decorator(func):
        # Initialize both cached versions
        joblib_cached = constants.joblib_memory.cache(func, ignore=ignore)
        db_cached = DbMemoizedFunc(func, ignore)

        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            """Dynamically choose the cache at call-time, not at import."""
            if func.__name__ == '_sia' and not config.CACHE_SIAS:
                f = func
            elif config.CACHING_BACKEND == 'fs':
                f = joblib_cached
            elif config.CACHING_BACKEND == 'db':
                f = db_cached
            return f(*args, **kwargs)

        return wrapper
    return decorator
1060369
def cached(func):
    
    cache = {}

    @f.wraps(func)
    def wrapper(*args, **kwargs):
        key = func.__name__ + str(sorted(args)) + str(sorted(kwargs.items()))
        if key not in cache:
            cache[key] = func(*args, **kwargs)
        return cache[key]
    return wrapper
1260621
def reset(self, force_flush_cache: bool = False) -> None:
        
        super(LDAPwrapper, self).reset()
        if len(self._transactions) == 0:
            raise RuntimeError("reset called outside a transaction.")
        self._transactions[-1] = []