      ----------
      logs_folder: str
          The folder that contains the Tensorboard log files
      """
      def __init__(self, logs_folder):
          logger.debug("Initializing: %s: (logs_folder: '%s')", self.__class__.__name__, logs_folder)
          self._logs_folder = logs_folder
          self._filenames = self._get_log_filenames()
          logger.debug("Initialized: %s", self.__class__.__name__)
  
 
</s> remove     def __init__(self, logs_folder, is_training):
 </s> add     def __init__(self, logs_folder: str, is_training: bool) -> None: </s> remove     session_ids: list
        List of `ints` pertaining to the session ids that exist in the Tensorflow events folder
 </s> add     labels: list[str]
        The labels for the loss values
    timestamps: :class:`np.ndarray`
        The timestamp of the event step (iteration)
    loss: :class:`np.ndarray`
        The loss values collected for A and B sides for the session </s> remove     def __init__(self, session_ids):
        logger.debug("Initializing: %s: (session_ids: %s)", self.__class__.__name__, session_ids)
        self._data = {idx: None for idx in session_ids}
        self._carry_over = {}
        self._loss_labels = []
 </s> add     def __init__(self, labels: List[str], timestamps: np.ndarray, loss: np.ndarray) -> None:
        self.labels = labels
        self._loss = zlib.compress(cast(bytes, loss))
        self._timestamps = zlib.compress(cast(bytes, timestamps))
        self._timestamps_shape = timestamps.shape
        self._loss_shape = loss.shape

    @property
    def loss(self) -> np.ndarray:
        """ :class:`numpy.ndarray`: The loss values for this session """
        retval: np.ndarray = np.frombuffer(zlib.decompress(self._loss), dtype="float32")
        if len(self._loss_shape) > 1:
            retval = retval.reshape(-1, *self._loss_shape[1:])
        return retval

    @property
    def timestamps(self) -> np.ndarray:
        """ :class:`numpy.ndarray`: The timestamps for this session """
        retval: np.ndarray = np.frombuffer(zlib.decompress(self._timestamps), dtype="float64")
        if len(self._timestamps_shape) > 1:
            retval = retval.reshape(-1, *self._timestamps_shape[1:])
        return retval

    def add_live_data(self, timestamps: np.ndarray, loss: np.ndarray) -> None:
        """ Add live data to the end of the stored data

        loss: :class:`numpy.ndarray`
            The latest loss values to add to the cache
        timestamps: :class:`numpy.ndarray`
            The latest timestamps  to add to the cache
        """
        new_buffer: List[bytes] = []
        new_shapes: List[Tuple[int, ...]] = []
        for data, buffer, dtype, shape in zip([timestamps, loss],
                                              [self._timestamps, self._loss],
                                              ["float64", "float32"],
                                              [self._timestamps_shape, self._loss_shape]):

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

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

            logger.debug("old_shape: %s new_shape: %s", shape, new.shape)
            new_buffer.append(zlib.compress(new))
            new_shapes.append(new.shape)
            del old

        self._timestamps = new_buffer[0]
        self._loss = new_buffer[1]
        self._timestamps_shape = new_shapes[0]
        self._loss_shape = new_shapes[1]


class _Cache():
    """ Holds parsed Tensorflow log event data in a compressed cache in memory. """
    def __init__(self) -> None:
        logger.debug("Initializing: %s", self.__class__.__name__)
        self._data: Dict[int, _CacheData] = {}
        self._carry_over: Dict[int, EventData] = {}
        self._loss_labels: List[str] = [] </s> remove         filenames: list
 </s> add         filenames: list[str] </s> remove     def session_ids(self):
        """ list: Sorted list of `ints` of available session ids. """
 </s> add     def session_ids(self) -> List[int]:
        """ list[int]: Sorted list of `ints` of available session ids. """
    def __init__(self, logs_folder: str) -> None:
      ----------
      logs_folder: str
          The folder that contains the Tensorboard log files
      """
    def __init__(self, logs_folder: str) -> None:
          logger.debug("Initializing: %s: (logs_folder: '%s')", self.__class__.__name__, logs_folder)
          self._logs_folder = logs_folder
          self._filenames = self._get_log_filenames()
          logger.debug("Initialized: %s", self.__class__.__name__)
  
keep keep keep keep 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