def METHOD_NAME(self):
    if self._before_radio.isChecked():
        self.location = OP_BEFORE
    else:
        self.location = OP_AFTER
    if self._arg_radiobox.isChecked():
        try:
            self.arg = int(self._arg_box.text())
        except ValueError:
            # invalid argument index
            QMessageBox(self).critical(
                self,
                "Invalid argument index",
                'The given function argument index "%s" is unsupported. Only integers are allowed.'
                % self._arg_box.text(),
                buttons=QMessageBox.Ok,
            )
            return
    else:
        raise NotImplementedError
    self.close()