Only safe to call within a click context.
323153
def get_jmespath_expression():
    
    ctx = click.get_current_context()
    state = ctx.ensure_object(CommandState)
    return state.jmespath_expr
380116
function (v, e) {
            var self = this;
            self.callSuper(v, e);    // sync
            // sync
            if (!e) {
                return;
            }
            if (e.fromMouse) {
                return;
            }
            if (v && !e.fromKeyboard) {
                showMenu.call(self);
            } else if (!v) {
                hideMenu.call(self);
            }
        }
226625
function () {
            /*  determine parameters  */
            var params = $cs.params("touch", arguments, {
                name: { pos: 0, req: true, valid: "string" }
            });

            /*  simply force value to same value in order to trigger event  */
            this.value({
                name:     params.name,
                value:    this.value(params.name),
                injected: true,
                force:    true
            });
        }
107282
def on_click(self, event):
        
        if event["button"] == self.button_toggle:
            # we only toggle if button was used
            if event.get("index") == "button" and self.py3.is_my_event(event):
                self.urgent = False
                self.open = not self.open
136291
function exitHook (context, func) {
	if (!func) {
		func = context;
		context = func;
	}

	if (typeof func === 'function') {
		subs.push([func, context])
	}

	return exitHook;
}
239443
def reject(self):
        """"""
        self.canvas.unsetMapTool(self.tool)
        if self.previous_map_tool != self.tool:
            self.canvas.setMapTool(self.previous_map_tool)
        self.tool.reset()
        self.extent_selector_closed.emit()
        super(ExtentSelectorDialog, self).reject()
612443
def allow(self):
        """"""
        with self.selenium.context(self.selenium.CONTEXT_CHROME):
            self.find_primary_button().click()
966417
function preventGhostClick(ev) {
        for (var i = 0; i < coordinates.length; i++) {
            var x = coordinates[i][0];
            var y = coordinates[i][1];

            // within the range, so prevent the click
            if (Math.abs(ev.clientX - x) < threshold && Math.abs(ev.clientY - y) < threshold) {
                ev.stopPropagation();
                ev.preventDefault();
                break;
            }
        }
    }
592207
def cancel(self):
        """"""
        with self.selenium.context(self.selenium.CONTEXT_CHROME):
            self.find_secondary_button().click()
1060083
def safe_call(cls, method, *args):
        
        return cls.call(method, *args, safe=True)
494666
def calledWithExactly(cls, spy, *args, **kwargs): #pylint: disable=invalid-name
        
        cls.__is_spy(spy)
        if not (spy.calledWithExactly(*args, **kwargs)):
            raise cls.failException(cls.message)
1262479
def mouseDoubleClickEvent(self, event):
        """"""
        index_clicked = self.indexAt(event.pos())
        if index_clicked.isValid():
            row = index_clicked.row()
            # TODO: Remove hard coded "Value" column number (3 here)
            index_clicked = index_clicked.child(row, 3)
            self.edit(index_clicked)
        else:
            event.accept()
272838
def is_any_clicked(self):
        """"""
        for key in range(len(self.current_state.key_states)):
            if self.is_clicked(key):
                return True
        return False
1166071
function(e) {
      var redirectedEvent = document.createEvent('MouseEvents');
      redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,
          e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,
          e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);
      this.dialog_.dispatchEvent(redirectedEvent);
      e.stopPropagation();
    }
839226
function handleMouseUp (e) {
                    if(enabled){
                        var selectable = (e.target.attributes && 'drag-scroll-text' in e.target.attributes);
                        var withinXConstraints = (e.clientX >= (startClientX - allowedClickOffset) && e.clientX <= (startClientX + allowedClickOffset));
                        var withinYConstraints = (e.clientY >= (startClientY - allowedClickOffset) && e.clientY <= (startClientY + allowedClickOffset));

                        // Set 'pushed' state
                        pushed = false;

                        // Check if cursor falls within X and Y axis constraints
                        if(selectable && withinXConstraints && withinYConstraints) {
                            // If so, select the text inside the target element
                            selectText(e.target);
                        }

                        $scope.$apply(function() {
                            onDragEnd($scope);
                        });

                        removeDragListeners();
                    }

                }
977625
protected void onClickOk() {

        CmsResource res1 = m_context.getResources().get(0);
        CmsResource res2 = m_otherResource;
        try {
            CmsObject cms = A_CmsUI.getCmsObject();
            CmsLocaleGroupService groupService = cms.getLocaleGroupService();
            groupService.detachLocaleGroup(res1, res2);
            m_context.finish(Arrays.asList(m_context.getResources().get(0).getStructureId()));
        } catch (Exception e) {
            LOG.error(e.getLocalizedMessage());
            m_context.error(e);
        }

    }
160571
function _handleClick() {
    perfBar.el.querySelector('.perfBar-bar').addEventListener('click', function(e) {
      perfBar.el.classList.toggle('perfBar-is-active')
    })
  }