Override Qt method
339717
def paintEvent(self, event):
        """"""
        painter = QPainter(self)
        painter.setRenderHint(QPainter.Antialiasing)
        # Decoration
        painter.fillPath(self.path_current, QBrush(self.color))
        painter.strokePath(self.path_decoration, QPen(self.color_decoration,
                                                      self.stroke_decoration))
1309816
function overrideWebpack({ plugin, options }, cracoConfig, webpackConfig, context) {
    if (isFunction(plugin.overrideWebpackConfig)) {
        const resultingConfig = plugin.overrideWebpackConfig({
            cracoConfig: cracoConfig,
            webpackConfig: webpackConfig,
            pluginOptions: options,
            context: context
        });

        if (!resultingConfig) {
            throw new Error("craco: Plugin returned an undefined webpack config.");
        }
    }

    log("Overrided webpack config with plugin.");

    return webpackConfig;
}
858744
def edit(self, index, trigger, event):
        
        # disable right-click editing
        if trigger in (self.SelectedClicked, self.DoubleClicked) and \
           event.button() in (QtCore.Qt.RightButton, QtCore.Qt.MidButton):
            return False
        
        if not self.isColumnEditingEnabled(index.column()):
            return False
        
        item = self.itemFromIndex(index)
        if isinstance(item, XTreeWidgetItem) and \
            not item.isColumnEditingEnabled(index.column()):
            return False
        
        return super(XTreeWidget, self).edit(index, trigger, event)
619252
def keyPressEvent(self, event):
        
        if event.key() == QtCore.Qt.Key_Escape:
            self.reject()

        super(XOverlayWidget, self).keyPressEvent(event)
1370746
def mousePressEvent(self, event):
        """"""
        index = self.indexAt(event.pos())
        if index.isValid():
            if index.column() == 0:
                self.edit(index, QtGui.QAbstractItemView.DoubleClicked, event)
            else:
                super(ProtocolView, self).mousePressEvent(event)
904174
def _override_options(options, **overrides):
    """"""
    for opt, val in overrides.items():
        passed_value = getattr(options, opt, _Default())
        if opt in ('ignore', 'select') and passed_value:
            value = process_value(opt, passed_value.value)
            value += process_value(opt, val)
            setattr(options, opt, value)
        elif isinstance(passed_value, _Default):
            setattr(options, opt, process_value(opt, val))
1155642
def keyPressEvent(self, event):
        """"""
        ctrl = event.modifiers() & Qt.ControlModifier
        key = event.key()
        handled = False
        if ctrl and self.count() > 0:
            index = self.currentIndex()
            if key == Qt.Key_PageUp:
                if index > 0:
                    self.setCurrentIndex(index - 1)
                else:
                    self.setCurrentIndex(self.count() - 1)
                handled = True
            elif key == Qt.Key_PageDown:
                if index < self.count() - 1:
                    self.setCurrentIndex(index + 1)
                else:
                    self.setCurrentIndex(0)
                handled = True
        if not handled:
            QTabWidget.keyPressEvent(self, event)
185194
def enable_busy_cursor(self):
        """"""
        QgsApplication.instance().setOverrideCursor(
            QtGui.QCursor(QtCore.Qt.WaitCursor)
        )
30139
def rehighlight(self):
        
        start = time.time()
        QtWidgets.QApplication.setOverrideCursor(
            QtGui.QCursor(QtCore.Qt.WaitCursor))
        try:
            super(SyntaxHighlighter, self).rehighlight()
        except RuntimeError:
            # cloned widget, no need to rehighlight the same document twice ;)
            pass
        QtWidgets.QApplication.restoreOverrideCursor()
        end = time.time()
        _logger().debug('rehighlight duration: %fs' % (end - start))
187383
def initialize(self):
        """"""
        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
        QApplication.processEvents()
        self.start_server()
1083104
def openParametersDialog(params, title=None):
    '''
    
    '''
    QApplication.setOverrideCursor(QCursor(Qt.ArrowCursor))
    dlg = ParametersDialog(params, title)
    dlg.exec_()
    QApplication.restoreOverrideCursor()
    return dlg.values
1120332
def override_args(**kwargs):
  

  override_kwargs = kwargs

  def custom_getter(getter, *args, **kwargs):
    """Custom getter with certain named arguments overridden.

    Args:
      getter: Underlying variable getter to invoke.
      *args: Arguments, compatible with those of tf.get_variable.
      **kwargs: Keyword arguments, compatible with those of tf.get_variable.

    Returns:
      The result of invoking `getter(*args, **kwargs)` except that certain
      kwargs entries may have been overridden.
    """
    kwargs.update(override_kwargs)
    return getter(*args, **kwargs)

  return custom_getter
1365456
def override_if_not_in_args(flag, argument, args):
  """"""
  if flag not in args:
    args.extend([flag, argument])
978432
private void removeOverriddenMethod(ExecutableElement method) {
        TypeElement overriddenClass = utils.overriddenClass(method);
        if (overriddenClass != null) {
            for (int i = 0; i < methlist.size(); i++) {
                TypeElement te = utils.getEnclosingTypeElement(methlist.get(i));
                if (te == overriddenClass || utils.isSubclassOf(overriddenClass, te)) {
                    methlist.remove(i);  // remove overridden method
                    return;
                }
            }
        }
    }
761559
def set_close_function(self, func):
        """"""
        state = func is not None
        if state:
            self.sig_close_tab.connect(func)
        try:
            # Assuming Qt >= 4.5
            QTabWidget.setTabsClosable(self, state)
            self.tabCloseRequested.connect(func)
        except AttributeError:
            # Workaround for Qt < 4.5
            close_button = create_toolbutton(self, triggered=func,
                                             icon=ima.icon('fileclose'),
                                             tip=_("Close current tab"))
            self.setCornerWidget(close_button if state else None)
526521
def create_action(parent, text, shortcut=None, icon=None, tip=None,
                  toggled=None, triggered=None, data=None, menurole=None,
                  context=Qt.WindowShortcut):
    """"""
    action = QAction(text, parent)
    if triggered is not None:
        action.triggered.connect(triggered)
    if toggled is not None:
        action.toggled.connect(toggled)
        action.setCheckable(True)
    if icon is not None:
        action.setIcon(icon)
    if shortcut is not None:
        action.setShortcut(shortcut)
    if tip is not None:
        action.setToolTip(tip)
        action.setStatusTip(tip)
    if data is not None:
        action.setData(to_qvariant(data))
    if menurole is not None:
        action.setMenuRole(menurole)
    #TODO: Hard-code all shortcuts and choose context=Qt.WidgetShortcut
    # (this will avoid calling shortcuts from another dockwidget
    #  since the context thing doesn't work quite well with these widgets)
    action.setShortcutContext(context)
    return action
804414
private void overChoiceEntry(CmsChoiceMenuEntryWidget entryWidget) {

        cancelChoiceTimer();
        cleanUpSubmenus(entryWidget);
        CmsChoiceMenuEntryBean entryBean = entryWidget.getEntryBean();
        if (!entryBean.isLeaf()) {
            addSubmenu(entryWidget);
        }
    }