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"]
docstr: Store a (key, value) pair locally at least until expiration_time. See class docstring for details.
  :returns: True if new value was stored, False it was rejected (current value is newer)
docstr_tok: ["Store","a","(","key",",","value",")","pair","locally","at","least","until","expiration_time",".","See","class","docstring","for","details",".",":","returns",":","True","if","new","value","was","stored",",","False","it","was","rejected","(","current","value","is","newer",")"]
code: def store(
      self,
      key: KeyType,
      value: ValueType,
      expiration_time: DHTExpiration,
  ) -> bool:
      """
      Store a (key, value) pair locally at least until expiration_time. See class docstring for details.
      :returns: True if new value was stored, False it was rejected (current value is newer)
      """
      if expiration_time < get_dht_time() and not self.frozen:
          return False
      self.key_to_heap[key] = HeapEntry(expiration_time, key)
      heapq.heappush(self.expiration_heap, self.key_to_heap[key])
      if key in self.data:
          if self.data[key].expiration_time < expiration_time:
              self.data[key] = ValueWithExpiration(
                  value, expiration_time
              )
              return True
          return False
      self.data[key] = ValueWithExpiration(value, expiration_time)
      self._remove_outdated()
      return True
  
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 3 for calling the TimedStorage obj's underlying member method code with example usage: obj.store(key, value, expiration_time) and returns: True, False, False, True