              graph.save_fig(graphlocation)
  
      def close(self):
          """ Clear the plots from RAM """
          for name, graph in self.subnotebook.children.items():
              logger.debug("Clearing: %s", name)
              graph.clear()
          super().close()
 
</s> remove             if region == "tree":
                self.data_popup()
 </s> add             if region == "tree" and self.check_valid_data(values):
                datapoints = int(values[self.columns.index("iterations")])
                self.data_popup(datapoints)

    def check_valid_data(self, values):
        """ Check there is valid data available for popping up a graph """
        col_indices = [self.columns.index("batch"), self.columns.index("iterations")]
        for idx in col_indices:
            if (isinstance(values[idx], int) or values[idx].isdigit()) and int(values[idx]) == 0:
                logger.warning("No data to graph for selected session")
                return False
        return True

    def data_popup(self, datapoints):
        """ Pop up a window and control it's position </s> remove         return self.state["sessions"][str(session_id)]["iterations"]
 </s> add         session = self.state["sessions"].get(str(session_id), None)
        if session is None:
            logger.warning("No session data found for session id: %s", session_id)
            return 0
        return session["iterations"] </s> remove                  for f in os.listdir(imgpath) if f.endswith((".png", ".jpg"))]
 </s> add                  for f in os.listdir(imgpath) if f.lower().endswith((".png", ".jpg"))] </s> remove         return self.state["sessions"][str(self.session_id)]
 </s> add         return self.state["sessions"].get(str(self.session_id), dict())
        if self.subnotebook is None:
            logger.debug("No graphs to clear. Returning")
            return
              graph.save_fig(graphlocation)
  
      def close(self):
          """ Clear the plots from RAM """
        if self.subnotebook is None:
            logger.debug("No graphs to clear. Returning")
            return
          for name, graph in self.subnotebook.children.items():
              logger.debug("Clearing: %s", name)
              graph.clear()
          super().close()
keep keep keep add keep keep keep keep
 GUI Fixups

- Analysis: Handle missing session Ids
- Analysis: Handle invalid data selections
- Analysis: Don't update graph on check box selection
- Analysis: Add cursor events to analysis tab
- Analysis: Change default graph view
- Training: Prevent GUI from attempting to close graphs which do not exist
- Extract/Convert: Make file extensions case-insensitive for preview
- Progress bar: Make compatible for downloads
- Progress bar: Add TQDM Description to progress bar stats text 
lib/gui/display_command.py