                           metric, cache[f"{metric}_shape"], new.shape)
              cache[f"{metric}_shape"] = new.shape
              cache[metric] = zlib.compress(new)
  
              del old
  
      def get_data(self, session_id, metric):
          """ Retrieve the decompressed cached data from the cache for the given session id.
  
          Parameters
          ----------
          session_id: int or ``None``
 
</s> remove         cache = self._data[session_id]
        for metric in ("loss", "timestamps"):
            data = locals()[metric]
            dtype = "float32" if metric == "loss" else "float64"

            old = np.frombuffer(zlib.decompress(cache[metric]), dtype=dtype)
            if data.ndim > 1:
                old = old.reshape(-1, *data.shape[1:])

            new = np.concatenate((old, data))

            logger.debug("'%s' old_shape: %s new_shape: %s",
                         metric, cache[f"{metric}_shape"], new.shape)
            cache[f"{metric}_shape"] = new.shape
            cache[metric] = zlib.compress(new)
 </s> add         self._data[session_id].add_live_data(timestamps, loss) </s> remove     def get(self, session_id):
 </s> add     def get(self, session_id: int) -> str: </s> remove         int
 </s> add         int or ``None`` </s> remove     def is_cached(self, session_id):
        """ bool: ``True`` if the data already exists in the cache otherwise ``False``. """
 </s> add     def is_cached(self, session_id: int) -> bool:
        """ Check if the given session_id's data is already cached

        Parameters
        ----------
        session_id: int
            The session ID to check

        Returns
        -------
        bool
            ``True`` if the data already exists in the cache otherwise ``False``.
        """ </s> remove     def _add_latest_live(self, session_id, loss, timestamps):
 </s> add     def _add_latest_live(self, session_id: int, loss: np.ndarray, timestamps: np.ndarray) -> None:
    def get_data(self, session_id: int, metric: Literal["loss", "timestamps"]
                 ) -> Optional[Dict[int, Dict[str, Union[np.ndarray, List[str]]]]]:
                           metric, cache[f"{metric}_shape"], new.shape)
              cache[f"{metric}_shape"] = new.shape
              cache[metric] = zlib.compress(new)
  
    def get_data(self, session_id: int, metric: Literal["loss", "timestamps"]
                 ) -> Optional[Dict[int, Dict[str, Union[np.ndarray, List[str]]]]]:
    def get_data(self, session_id: int, metric: Literal["loss", "timestamps"]
                 ) -> Optional[Dict[int, Dict[str, Union[np.ndarray, List[str]]]]]:
    def get_data(self, session_id: int, metric: Literal["loss", "timestamps"]
                 ) -> Optional[Dict[int, Dict[str, Union[np.ndarray, List[str]]]]]:
          """ Retrieve the decompressed cached data from the cache for the given session id.
  
          Parameters
          ----------
          session_id: int or ``None``
keep keep keep keep replace replace replace keep keep keep keep keep
 Bugfixes
  - plugin.train.unbalanced - decoder b
  - gui.stats - crash when log folder deleted
  - setup.py - install gcc=12.1.0 on linux (scipy dep)
  - setup.py - don't test ROCm unless valid
  - typofix - cli_args extract singleprocess help
typing
  - lib.gui.analysis.event_reader
  - lib.gpu_stats.directml - make platform specific
unit tests
  - lib.gui.analysis.event_reader 
lib/gui/analysis/event_reader.py