    def set(self, key, value):
        """Store an entry in the cache

        Purges oldest entry if cache is full
        """
        self._cache[key] = value
        # cache is full, purge oldest entry
        if len(self._cache) > self.maxsize:
            self._cache.popitem(last=False)
Store an entry in the cache

Purges oldest entry if cache is full
jupyterhub/_memoize.py