  import time
  import os
  import warnings
  
  from math import ceil
  from threading import Event
  
  import numpy as np
  import tensorflow as tf
 
</s> remove from math import ceil, sqrt
 </s> add from math import ceil
from threading import Event </s> remove from .control_helper import ControlBuilder, ControlPanelOption
from .display_graph import SessionGraph
from .display_page import DisplayPage
from .stats import Calculations, Session
 </s> add  </s> remove from lib.gui import (TaskBar, CliOptions, CommandNotebook, ConsoleOut, Session, DisplayNotebook,
 </s> add from lib.gui import (TaskBar, CliOptions, CommandNotebook, ConsoleOut, DisplayNotebook, </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.

"""
import zlib
  import time
  import os
  import warnings
import zlib
  
  from math import ceil
  from threading import Event
  
  import numpy as np
  import tensorflow as tf
keep keep add keep 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/stats.py