def __missing__(self, key):
        # Remove the oldest key when the size is exceeded.
        if len(self) > self.size:
            key_to_remove = self._keys.popleft()
            if key_to_remove in self:
                del self[key_to_remove]

        result = self.get_value(*key)
        self[key] = result
        self._keys.append(key)
        return result
dataset/ETHPy150Open jonathanslenders/python-prompt-toolkit/prompt_toolkit/cache.py/FastDictCache.__missing__/original