def _maintenance(self, sequence, timestamps):  # O(logN)
        """It will modify input sequence and timestamps in-place"""
        now = int(time.time())
        while sequence:  # Clean up expired items
            expires_at, created_at, key = sequence[0]
            if created_at <= now < expires_at:  # Then all remaining items are fresh
                break
            self._drop_indexed_entry(timestamps, sequence[0])  # It could error out
            heapq.heappop(sequence)  # Only pop it after a successful _drop_indexed_entry()
        while self._capacity is not None and len(timestamps) > self._capacity:
            self._drop_indexed_entry(timestamps, sequence[0])  # It could error out
            heapq.heappop(sequence)  # Only pop it after a successful _drop_indexed_entry()
It will modify input sequence and timestamps in-place
Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/msal/individual_cache.py