parameters: (self, event)
docstring: User requested a context menu.
          Input:
              event: The QEvent()
docstring_summary: User requested a context menu.
          Input:
              event: The QEvent()
docstring_tokens: User requested a context menu . Input : event : The QEvent ()
function: def contextMenuEvent(self, event):
          """
          User requested a context menu.
          Input:
              event: The QEvent()
          """
          menu = QMenu()
          save_action = menu.addAction("Save")
          clear_action = menu.addAction("Clear")
          action = menu.exec_(event.globalPos())
  
          if action == save_action:
              self.save()
          elif action == clear_action:
              self.clear()
function_tokens: def contextMenuEvent ( self , event ) : menu = QMenu ( ) save_action = menu . addAction ( "Save" ) clear_action = menu . addAction ( "Clear" ) action = menu . exec_ ( event . globalPos ( ) ) if action == save_action : self . save ( ) elif action == clear_action : self . clear ( )