code: def get_application_instance():
      
  
      instance = QApplication.instance()
      if not instance:
          instance = QApplication(sys.argv)
      return instance
docs: Returns the current `QApplication <http://doc.qt.nokia.com/qapplication.html>`_ instance or
      create one if it doesn't exists.
  
      :return: Application instance.
      :rtype: QApplication