          return hlp
  
  
  class StatsData(ttk.Frame):  # pylint: disable=too-many-ancestors
      """ Stats frame of analysis tab.
  
      Holds the tree-view containing the summarized session statistics in the Analysis tab.
 
</s> remove     """ Stats frame of analysis tab """
 </s> add     """ Stats frame of analysis tab.

    Holds the tree-view containing the summarized session statistics in the Analysis tab.

    Parameters
    ----------
    parent: :class:`tkinter.Frame`
        The frame within the Analysis Notebook that will hold the statistics
    selected_id: :class:`tkinter.IntVar`
        The tkinter variable that holds the currently selected session ID
    helptext: str
        The help text to display for the summary statistics page
    """ </s> remove """ Stats functions for the GUI """
 </s> add """ Stats functions for the GUI.

Holds the globally loaded training session. This will either be a user selected session (loaded in
the analysis tab) or the currently training session.

""" </s> remove         elif btntype == "load":
 </s> add         elif button_type == "load": </s> remove         self.trace_var = None
 </s> add         self._trace_vars = dict() </s> remove         self.canvas.itemconfig(self.tree_canvas, width=canvas_width, height=canvas_height)
 </s> add         self._canvas.itemconfig(self._tree_canvas, width=canvas_width, height=canvas_height)
    def _add_training_callback(self):
        """ Add a callback to the training tkinter variable to disable save and clear buttons
        when a model is training. """
        var = self._parent.vars["is_training"]
        var.trace("w", self._set_buttons_state)

    def _set_buttons_state(self, *args):  # pylint:disable=unused-argument
        """ Callback to enable/disable button when training is commenced and stopped. """
        is_training = self._parent.vars["is_training"].get()
        state = "disabled" if is_training else "!disabled"
        for name, button in self._buttons.items():
            if name not in ("load", "clear"):
                continue
            logger.debug("Setting %s button state to %s", name, state)
            button.state([state])

          return hlp
  
    def _add_training_callback(self):
        """ Add a callback to the training tkinter variable to disable save and clear buttons
        when a model is training. """
        var = self._parent.vars["is_training"]
        var.trace("w", self._set_buttons_state)

    def _set_buttons_state(self, *args):  # pylint:disable=unused-argument
        """ Callback to enable/disable button when training is commenced and stopped. """
        is_training = self._parent.vars["is_training"].get()
        state = "disabled" if is_training else "!disabled"
        for name, button in self._buttons.items():
            if name not in ("load", "clear"):
                continue
            logger.debug("Setting %s button state to %s", name, state)
            button.state([state])

  
  class StatsData(ttk.Frame):  # pylint: disable=too-many-ancestors
      """ Stats frame of analysis tab.
  
      Holds the tree-view containing the summarized session statistics in the Analysis tab.
keep add keep keep keep keep keep
 GUI - Stats optimization (#1067)

* Faster stat loading + caching

* Compress data in cache

* Optimize some calculations

* Vectorize smoothing

* stats.Calculations optimized

* Load latest training data from live iterator

* Add options to training graph 
lib/gui/display_analysis.py