code: def setup_ui(uifile, base_instance=None):
      
      ui = QtCompat.loadUi(uifile)  # Qt.py mapped function
      if not base_instance:
          return ui
      else:
          for member in dir(ui):
              if not member.startswith('__') and \
                 member is not 'staticMetaObject':
                  setattr(base_instance, member, getattr(ui, member))
          return ui
docs: Load a Qt Designer .ui file and returns an instance of the user interface
  
      Args:
          uifile (str): Absolute path to .ui file
          base_instance (QWidget): The widget into which UI widgets are loaded
  
      Returns:
          QWidget: the base instance