code: def __key_press_events(self, obj, event):
      key = obj.GetKeySym()
      # TODO: Move to another class/module
      if self.cluster:
          # retract help panel
          if key in ("o", "O"):
              panel_size = self.help_panel._get_size()
              if self.__help_visible:
                  new_pos = np.array(self.__win_size) - 10
                  self.__help_visible = False
              else:
                  new_pos = np.array(self.__win_size) - panel_size - 5
                  self.__help_visible = True
              self.help_panel._set_position(new_pos)
              self.show_m.render()
          if key in ("a", "A"):
              self.__show_all()
          if key in ("e", "E"):
              self.__expand()
          # hide on/off unselected centroids
          if key in ("h", "H"):
              self.__hide()
          # invert selection
          if key in ("i", "I"):
              self.__invert()
          if key in ("r", "R"):
              self.__reset()
          # save current result
          if key in ("s", "S"):
              self.__save()
          if key in ("y", "Y"):
              self.__new_window()
  
imports: from packaging.version import Version
  import warnings
  import numpy
  from dipy import __version__
  from dipy.io.stateful_tractogram import Space, StatefulTractogram
  from dipy.io.streamline import save_tractogram
  from dipy.tracking.streamline import Streamlines
  from dipy.utils.optpkg import optional_package
  from dipy.viz.gmem import GlobalHorizon
  from dipy.viz.horizon.tab import ClustersTab, PeaksTab, ROIsTab, SlicesTab, TabManager, build_label
  from dipy.viz.horizon.visualizer import ClustersVisualizer, SlicesVisualizer
  from dipy.viz.horizon.util import check_img_dtype, check_img_shapes
label_desc: Use image node_id 5 for calling the Horizon obj's underlying member method code with example usage: obj.__key_press_events(obj, event) without return types