code: def choose_directory(self, line_edit, title):
          
          path = line_edit.text()
          # noinspection PyCallByClass,PyTypeChecker
          new_path = QFileDialog.getExistingDirectory(
              self, title, path, QFileDialog.ShowDirsOnly)
          if new_path is not None and os.path.exists(new_path):
              line_edit.setText(new_path)
docs: Show a directory selection dialog.
          This function will show the dialog then set line_edit widget
          text with output from the dialog.
  
          :param line_edit: Widget whose text should be updated.
          :type line_edit: QLineEdit
  
          :param title: title of dialog
          :type title: str, QString