class_docstr: A dictionary that maintains up to :maxsize: key-value-expiration tuples until their expiration_time
class_docstr_tok: ["A","dictionary","that","maintains","up","to",":","maxsize",":","key-value-expiration","tuples","until","their","expiration_time"]
code: def __init__(self, maxsize: Optional[int] = None):
      self.maxsize = maxsize or float("inf")
      self.data: Dict[KeyType, ValueWithExpiration[ValueType]] = dict()
      self.expiration_heap: List[HeapEntry[KeyType]] = []
      self.key_to_heap: Dict[KeyType, HeapEntry[KeyType]] = dict()
  
imports: from __future__ import annotations
  import heapq
  import time
  from contextlib import contextmanager
  from dataclasses import dataclass
  from typing import Dict, Generic, Iterator, List, Optional, Tuple, TypeVar
label_desc: Use image node_id 1 to create a new TimedStorage object from inherited base classes: Generic with example: obj = TimedStorage(maxsize)