def _prune(self):
        now = time()
        pruned = []

        for key, value in self._cache.items():
            expires = value.get("expires", time())
            if expires <= now:
                pruned.append(key)

        for key in pruned:
            self._cache.pop(key, None)

        return len(pruned) > 0
dataset/ETHPy150Open chrippa/livestreamer/src/livestreamer/cache.py/Cache._prune/original