def invalidate(self, func, *args, **kwargs):
        """Invalidate a cache decorated function.  You must call this with
        the same positional and keyword arguments as what you did when you
        call the decorated function, otherwise the cache will not be deleted.
        The usage is simple::

            @cache.cache()
            def load(name, limit):
                return load_from_database(name, limit)

            rv = load('foo', limit=5)

            cache.invalidate(load, 'foo', limit=5)

        :param func: decorated function to invalidate
        :param args: same positional arguments as you call the function
        :param kwargs: same keyword arguments as you call the function
        :return: whether it is invalidated or not
        """
        try:
            cache_params = func.__rc_cache_params__
        except __HOLE__:
            raise TypeError('Attempted to invalidate a function that is'
                            'not cache decorated')
        key_prefix = cache_params['key_prefix']
        cache_args = args
        include_self = cache_params.get('include_self', False)
        if include_self:
            instance_self = getattr(func, '__self__', None)
            if instance_self:
                cache_args = tuple([instance_self] + list(args))
        cache_key = generate_key_for_cached_func(
            key_prefix, func, *cache_args, **kwargs)
        return self.delete(cache_key)
dataset/ETHPy150Open fengsp/rc/rc/cache.py/BaseCache.invalidate