code: def append(self, title, contents=None, event_fn=None):
      id = wx.NewId()
  
      self.Append(id, title)
  
      if event_fn:
          self.Bind(wx.EVT_MENU, event_fn, id=id)
      elif contents:
          self.Bind(
              wx.EVT_MENU,
              lambda _: self.__show_dialog(title, contents),
              id=id,
          )
  
imports: import wx
  import cellprofiler.gui.html.utils
  import cellprofiler.gui.htmldialog
label_desc: Use image node_id 2 for calling the Menu obj's underlying member method code with example usage: obj.append(title, contents, event_fn) without return types