called from Document
962826
public int createIndex(String tokenForm) {
		int[] index = (int[]) tokenForm2index.get(tokenForm);
		if (index == null) {
			index = new int[] { nextAttributeID };
			tokenForm2index.put(tokenForm, index);
			nextAttributeID++;
		}
		// add information about number of documents
		// for the term
		Integer integ = Integer.valueOf(index[0]);
		int[] docfreq = (int[]) this.index2docfreq.get(integ);
		if (docfreq == null) {
			docfreq = new int[] { 0 };
			index2docfreq.put(integ, docfreq);
		}
		docfreq[0]++;
		return index[0];
	}
206495
function delegateListener (event, useCapture) {
        var fakeEvent = {},
            delegated = delegatedEvents[event.type],
            eventTarget = getActualElement(event.path
                                           ? event.path[0]
                                           : event.target),
            element = eventTarget;

        useCapture = useCapture? true: false;

        // duplicate the event so that currentTarget can be changed
        for (var prop in event) {
            fakeEvent[prop] = event[prop];
        }

        fakeEvent.originalEvent = event;
        fakeEvent.preventDefault = preventOriginalDefault;

        // climb up document tree looking for selector matches
        while (isElement(element)) {
            for (var i = 0; i < delegated.selectors.length; i++) {
                var selector = delegated.selectors[i],
                    context = delegated.contexts[i];

                if (matchesSelector(element, selector)
                    && nodeContains(context, eventTarget)
                    && nodeContains(context, element)) {

                    var listeners = delegated.listeners[i];

                    fakeEvent.currentTarget = element;

                    for (var j = 0; j < listeners.length; j++) {
                        if (listeners[j][1] === useCapture) {
                            listeners[j][0](fakeEvent);
                        }
                    }
                }
            }

            element = parentElement(element);
        }
    }
4856
def apply(self, event, document, *args, **kwargs):
        
        for fn in self._handler_dict.get(event, []):
            fn(document, *args, **kwargs)
1094010
public static void parse(DocListener document, String file) {
        HtmlParser p = new HtmlParser();
        p.go(document, file);
    }
142149
def create(handler, item_document):
    """"""
    data = {'operation': 'create',
            'item': json.load(item_document)}
    handler.invoke(data)
974660
function pushDocument(doc) {
    if (!(doc instanceof Document)) {
        console.warn('Cannot navigate to the document.', doc);
        return;
    }
    navigationDocument.pushDocument(doc);
}
1217457
function() {
            var docElement = document.documentElement || {},
                body    = document.body || {};

            if ( typeof ( window.innerWidth ) == 'number' ) {
                $.getWindowSize = function(){
                    return new $.Point(
                        window.innerWidth,
                        window.innerHeight
                    );
                };
            } else if ( docElement.clientWidth || docElement.clientHeight ) {
                $.getWindowSize = function(){
                    return new $.Point(
                        document.documentElement.clientWidth,
                        document.documentElement.clientHeight
                    );
                };
            } else if ( body.clientWidth || body.clientHeight ) {
                $.getWindowSize = function(){
                    return new $.Point(
                        document.body.clientWidth,
                        document.body.clientHeight
                    );
                };
            } else {
                throw new Error("Unknown window size, no known technique.");
            }

            return $.getWindowSize();
        }
426450
def dispatch(self, receiver):
        ''' 

        '''
        super(DocumentPatchedEvent, self).dispatch(receiver)
        if hasattr(receiver, '_document_patched'):
            receiver._document_patched(self)
68090
function(doc) {
    if (!doc) {
      doc = document;
    }
    if (doc === document && this.pool.length) {
      return this.pool.pop();
    }

    return View.makeInstanceOf(doc.importNode(this, true), this);
  }
774721
function(){
      var value = this.get();
      var cursor = this;

      while (cursor = cursor.handler)
        cursor.fn.call(cursor.context, value);
    }
179875
function each(collection, callback) {
        if (utils.isNode(collection) || collection === window || collection === document) {
            collection = [collection];
        }
        if (!utils.isArrayLike(collection) && !utils.isObject(collection)) {
            collection = [collection];
        }
        if (utils.size(collection) == 0) {
            return;
        }

        if (utils.isArrayLike(collection) && !utils.isObject(collection)) {
            var l = collection.length,
                i = 0;
            for (; i < l; i++) {
                if (callback.call(collection[i], collection[i], i, collection) === false) {
                    break;
                }
            }
        } else if (utils.isObject(collection)) {
            for (var key in collection) {
                if (utils.has(collection, key)) {
                    if (callback.call(collection[key], collection[key], key, collection) === false) {
                        break;
                    }
                }
            }
        }
    }
576638
@Override
    public Object call(PageContext pc, Collection.Key key, Object[] arguments) throws PageException {
	// first check variables
	Object o = shadow.get(key);
	if (o instanceof UDFPlus) {
	    return ((UDFPlus) o).call(pc, key, arguments, false);
	}

	// then check in component
	Member m = component.getMember(access, key, false, false);
	if (m != null) {
	    if (m instanceof UDFPlus) return ((UDFPlus) m).call(pc, key, arguments, false);
	}

	return MemberUtil.call(pc, this, key, arguments, new short[] { CFTypes.TYPE_STRUCT }, new String[] { "struct" });
	// throw ComponentUtil.notFunction(component, key, m!=null?m.getValue():null,access);
    }
922342
function(_document){
                var _osc = _document.onselectionchange;
                if (_osc !== undefined) {
                    try {
                        _document.onselectionchange = 0;
                        return _document.onselectionchange === null;
                    } catch (e) {
                    } finally {
                        _document.onselectionchange = _osc;
                    }
                }
                return false;
            }
111613
function Doc(text, file, line, options) {
  if (typeof text == 'object') {
    for ( var key in text) {
      this[key] = text[key];
    }
  } else {
    this.text = text;
    this.file = file;
    this.line = line;
  }
  this.options = options || {};
  this.scenarios = this.scenarios || [];
  this.requires = this.requires || [];
  this.param = this.param || [];
  this.properties = this.properties || [];
  this.methods = this.methods || [];
  this.events = this.events || [];
  this.links = this.links || [];
  this.anchors = this.anchors || [];
}
199612
function onDocumentClick(event) {
        var element = event.target;
        if (element && element.hasAttribute('data-brackets-id')) {
            MessageBroker.send({"tagId": element.getAttribute('data-brackets-id')});
        }
    }
657789
def call_doctree_resolved(cls, kb_app, sphinx_app: Sphinx,
                              doctree: doctree,
                              fromdocname: str):
        

        for callback in EventAction.get_callbacks(kb_app,
                                                  SphinxEvent.DRES):
            callback(kb_app, sphinx_app, doctree, fromdocname)
809538
private void documentChanged() {
    // View of the component has not been updated at the time
    // the DocumentEvent is fired

    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        try {
          int endPos = component.getDocument().getLength();
          Rectangle rect = component.modelToView(endPos);

          if (rect != null && rect.y != lastHeight) {
            setPreferredWidth();
            repaint();
            lastHeight = rect.y;
          }
        } catch (BadLocationException ex) {
          /* nothing to do */
        }
      }
    });
  }