determines the target node (the node to perform the change) of one event item
199039
protected Node getContentNode(Session session, String path)
            throws RepositoryException {
        Node node = null;
        try {
            Item item = session.getItem(path);
            if (item.isNode()) {
                node = (Node) item;
            } else {
                node = item.getParent();
            }
            while (node != null
                    && !isTargetNode(node)
                    && (path = getTargetPath(node)) != null) {
                node = node.getParent();
            }
        } catch (PathNotFoundException ignore) {
            // probably removed... ignore
        }
        return path != null ? node : null;
    }
978911
function($item, e) {
			var self = this;
			var eventName;
			var i, idx, begin, end, item, swap;
			var $last;
	
			if (self.settings.mode === 'single') return;
			$item = $($item);
	
			// clear the active selection
			if (!$item.length) {
				$(self.$activeItems).removeClass('active');
				self.$activeItems = [];
				if (self.isFocused) {
					self.showInput();
				}
				return;
			}
	
			// modify selection
			eventName = e && e.type.toLowerCase();
	
			if (eventName === 'mousedown' && self.isShiftDown && self.$activeItems.length) {
				$last = self.$control.children('.active:last');
				begin = Array.prototype.indexOf.apply(self.$control[0].childNodes, [$last[0]]);
				end   = Array.prototype.indexOf.apply(self.$control[0].childNodes, [$item[0]]);
				if (begin > end) {
					swap  = begin;
					begin = end;
					end   = swap;
				}
				for (i = begin; i <= end; i++) {
					item = self.$control[0].childNodes[i];
					if (self.$activeItems.indexOf(item) === -1) {
						$(item).addClass('active');
						self.$activeItems.push(item);
					}
				}
				e.preventDefault();
			} else if ((eventName === 'mousedown' && self.isCtrlDown) || (eventName === 'keydown' && this.isShiftDown)) {
				if ($item.hasClass('active')) {
					idx = self.$activeItems.indexOf($item[0]);
					self.$activeItems.splice(idx, 1);
					$item.removeClass('active');
				} else {
					self.$activeItems.push($item.addClass('active')[0]);
				}
			} else {
				$(self.$activeItems).removeClass('active');
				self.$activeItems = [$item.addClass('active')[0]];
			}
	
			// ensure control has focus
			self.hideInput();
			if (!this.isFocused) {
				self.focus();
			}
		}
170085
function(node) {
			this.currentNode = node;

			// Updates the code path due to node's position in its parent node.
			if (node.parent) {
				preprocess(this, node);
			}

			// Updates the code path.
			// And emits onCodePathStart/onCodePathSegmentStart events.
			processCodePathToEnter(this, node);

			// Emits node events.
			this.original.enterNode(node);

			this.currentNode = null;
		}
139410
function getTargetInstForInputEventPolyfill(topLevelType, targetInst, nativeEvent) {
  if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
    // On the selectionchange event, the target is just document which isn't
    // helpful for us so just check activeElement instead.
    //
    // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
    // propertychange on the first input event after setting `value` from a
    // script and fires only keydown, keypress, keyup. Catching keyup usually
    // gets it and catching keydown lets us fire an event for the first
    // keystroke if user does a key repeat (it'll be a little delayed: right
    // before the second keystroke). Other input methods (e.g., paste) seem to
    // fire selectionchange normally.
    return getInstIfValueChanged(activeElementInst, nativeEvent);
  }
}
1336168
function (event) {
            var item, c;
            for (var i = 0; i < event.$.items.length; i++) {
                item = event.$.items[i];
                c = this.getComponentForItem(item);
                // TODO:
                this.$parent.removeChild(c);
                this._innerAddChild(c);
            }
        }
33327
function _onRemoteShowGoto(event, res) {
        // res = {nodeId, name, value}
        var node = DOMAgent.nodeWithId(res.nodeId);

        // get all css rules that apply to the given node
        Inspector.CSS.getMatchedStylesForNode(node.nodeId, function onMatchedStyles(res) {
            var i, targets = [];
            _makeHTMLTarget(targets, node);
            for (i in node.trace) {
                _makeJSTarget(targets, node.trace[i]);
            }
            for (i in node.events) {
                var trace = node.events[i];
                _makeJSTarget(targets, trace.callFrames[0]);
            }
            for (i in res.matchedCSSRules.reverse()) {
                _makeCSSTarget(targets, res.matchedCSSRules[i].rule);
            }
            RemoteAgent.call("showGoto", targets);
        });
    }
1357955
function eventHandler(trackedElements = {}, options = { tolerance: 0 }) {
    const selectors = Object.keys(trackedElements);
    let testVisibility;

    if (!selectors.length) return;

    if (options.container === window) {
        testVisibility = inViewport;
    } else {
        testVisibility = inContainer;
    }

    selectors.forEach((selector) => {
        trackedElements[selector].nodes.forEach((item) => {
            if (testVisibility(item.node, options)) {
                item.wasVisible = item.isVisible;
                item.isVisible = true;
            } else {
                item.wasVisible = item.isVisible;
                item.isVisible = false;
            }
            if (item.isVisible === true && item.wasVisible === false) {
                if (!trackedElements[selector].enter) return;

                Object.keys(trackedElements[selector].enter).forEach((callback) => {
                    if (typeof trackedElements[selector].enter[callback] === 'function') {
                        trackedElements[selector].enter[callback](item.node, 'enter');
                    }
                });
            }
            if (item.isVisible === false && item.wasVisible === true) {
                if (!trackedElements[selector].leave) return;

                Object.keys(trackedElements[selector].leave).forEach((callback) => {
                    if (typeof trackedElements[selector].leave[callback] === 'function') {
                        trackedElements[selector].leave[callback](item.node, 'leave');
                    }
                });
            }
        });
    });
}
443000
def _updateTargetFromNode(self):
        
        if self.axisNumber == X_AXIS:
            xMode, yMode = self.configValue, None
        else:
            xMode, yMode = None, self.configValue

        self.plotItem.setLogMode(x=xMode, y=yMode)
1328993
function( node, events ) {
            var specific = this.specific();
            // console.log('#', this );

            if ( specific ) {
                pickValue.call(
                    this,
                    specific,
                    node,
                    function ( valueNode ) {
                        // console.log(' spec', valueNode );
                        if ( valueNode ) {
                            pathFindEachAll.call( this, node, events );
                        }
                    },
                    End
                );
            }
            else {
                pathFindEachAll.call( this, node, events );
            }

        }
374777
function(target, skeleton) {
//            console.log("Applying change: "+JSON.stringify(skeleton));
            if (skeleton == null) {
                return false;
            }
            if (typeof skeleton != typeof target) {
                return false;
            }
            switch (typeof skeleton)
            {
                case 'string':
                case 'number':
                case 'boolean':
                    // gone too far
                    return false;
                case 'object':
                    if (skeleton instanceof Array)
                    {
                        // for now only support direct replacement/mutation of elements, skeleton is insufficient to describe splicing
                        if (target.length != skeleton.length) {
                            return false;
                        }
                        var changed = false;
                        for (var i=0; i<skeleton.length; i++) {
                            if (skeleton[i] == null) {
                                continue;
                            }
                            switch (typeof skeleton[i]) {
                                case 'string':
                                case 'number':
                                case 'boolean':
                                    changed = (target[i] != skeleton[i]) || changed;
                                    target[i] = skeleton[i];
                                    break;
                                case 'object':
                                    changed = deepApply(target[i], skeleton[i]) || changed;
                                    break;
                                default:
                                    throw 'Unrecognized type: '+(typeof skeleton[i]);
                            }
                        }
                        return changed;
                    }
                    else {
                        var changed = false;
                        for (var k in skeleton) {
                            if (skeleton.hasOwnProperty(k)) {
                                if (target.hasOwnProperty(k)) {
                                    if (skeleton[k] == null) {
                                        continue;
                                    }
                                    switch (typeof skeleton[k]) {
                                        case 'string':
                                        case 'number':
                                        case 'boolean':
                                            changed = target[k] != skeleton[k] || changed;
                                            target[k] = skeleton[k];
                                            break;
                                        case 'object':
                                            changed = deepApply(target[k], skeleton[k]) || changed;
                                            break;
                                        default:
                                            throw 'Unrecognized type: '+(typeof skeleton[k]);
                                    }
                                }
                                else {
                                    target[k] = skeleton[k];
                                }
                            }
                        }
                        return changed;
                    }
                    break;
                default:
                    throw 'Unrecognized type: '+(typeof incoming);
            }
        }
922286
function( node, events ) {
            // console.log('pathFind.#', node.docPath(), testSpecific );

            if ( this.child ) {
                this._specific = this.child.filter;
            }

            nextTick.call( this.child, node, null, events );
        }
676775
function(oThis, oEvent){
		var jRef = jQuery(oEvent.target);
		if (!jRef.attr("itemidx")) {
			jRef = jRef.parent();
		}
		return jRef.attr("itemidx") ? jRef : null;
	}
544713
function(e) {
		var target = e.target,
		setting = data.getSetting(e.data.treeId),
		tId = "", node = null,
		nodeEventType = "", treeEventType = "",
		nodeEventCallback = null, treeEventCallback = null;

		if (tools.eqs(e.type, "mouseover")) {
			if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
				tId = tools.getNodeMainDom(target).id;
				nodeEventType = "mouseoverCheck";
			}
		} else if (tools.eqs(e.type, "mouseout")) {
			if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
				tId = tools.getNodeMainDom(target).id;
				nodeEventType = "mouseoutCheck";
			}
		} else if (tools.eqs(e.type, "click")) {
			if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
				tId = tools.getNodeMainDom(target).id;
				nodeEventType = "checkNode";
			}
		}
		if (tId.length>0) {
			node = data.getNodeCache(setting, tId);
			switch (nodeEventType) {
				case "checkNode" :
					nodeEventCallback = _handler.onCheckNode;
					break;
				case "mouseoverCheck" :
					nodeEventCallback = _handler.onMouseoverCheck;
					break;
				case "mouseoutCheck" :
					nodeEventCallback = _handler.onMouseoutCheck;
					break;
			}
		}
		var proxyResult = {
			stop: nodeEventType === "checkNode",
			node: node,
			nodeEventType: nodeEventType,
			nodeEventCallback: nodeEventCallback,
			treeEventType: treeEventType,
			treeEventCallback: treeEventCallback
		};
		return proxyResult
	}
1315529
function isDomEventTarget (obj) {
	if (!(obj && obj.nodeName)) {
		return obj === window;
	}
	var nodeType = obj.nodeType;
	return (
		nodeType === 1 || // Node.ELEMENT_NODE
		nodeType === 9 || // Node.DOCUMENT_NODE
		nodeType === 11 // Node.DOCUMENT_FRAGMENT_NODE
	);
}
879547
function( event ) {
				var target = event.target;
				return rcheckableType.test( target.type ) &&
					target.click && nodeName( target, "input" ) &&
					dataPriv.get( target, "click" ) ||
					nodeName( target, "a" );
			}
38605
function onDomMutate(event) {

	var mutation = {
		addedNodes: [],
		removedNodes: [],
	};
	mutation[
		(event.type === 'DOMNodeInserted' ? 'added' : 'removed') + 'Nodes'
	] = [event.target];

	domMutations.push(mutation);

	// Delay the call to checkMutations()
	setTimeout(function() {
		checkMutations(domMutations);
		domMutations = [];
	});

}
216506
def SetSelected(self, node):
        """"""
        self.selected_node = node
        index = self.NodeToIndex(node)
        if index != -1:
            self.Focus(index)
            self.Select(index, True)
        return index