code: def get_qapp():
      
      global app
      app = QtGui.QApplication.instance()
      if app is None:
          app = QtGui.QApplication([], QtGui.QApplication.GuiClient)
      return app
docs: Return an instance of QApplication. Creates one if neccessary.
  
      :returns: a QApplication instance
      :rtype: QApplication
      :raises: None