code: def _convert(lines):
      
  
      def parse(line):
          line = line.replace("from PySide2 import", "from Qt import QtCompat,")
          line = line.replace("QtWidgets.QApplication.translate",
                              "QtCompat.translate")
          if "QtCore.SIGNAL" in line:
              raise NotImplementedError("QtCore.SIGNAL is missing from PyQt5 "
                                        "and so Qt.py does not support it: you "
                                        "should avoid defining signals inside "
                                        "your ui files.")
          return line
  
      parsed = list()
      for line in lines:
          line = parse(line)
          parsed.append(line)
  
      return parsed
docs: Convert compiled .ui file from PySide2 to Qt.py
  
      Arguments:
          lines (list): Each line of of .ui file
  
      Usage:
          >> with open("myui.py") as f:
          ..   lines = _convert(f.readlines())