repo
stringclasses
195 values
path
stringlengths
4
99
func_name
stringlengths
0
41
original_string
stringlengths
72
56.1k
language
stringclasses
1 value
code
stringlengths
72
56.1k
code_tokens
listlengths
25
8.12k
docstring
stringlengths
2
12.5k
docstring_tokens
listlengths
1
449
sha
stringclasses
197 values
url
stringlengths
88
186
partition
stringclasses
1 value
summary
stringlengths
8
338
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
adobe/brackets
src/LiveDevelopment/main.js
_showStatusChangeReason
function _showStatusChangeReason(reason) { // Destroy the previous twipsy (options are not updated otherwise) _$btnGoLive.twipsy("hide").removeData("twipsy"); // If there was no reason or the action was an explicit request by the user, don't show a twipsy if (!reason || reason === "explicit_close") { return; } // Translate the reason var translatedReason = Strings["LIVE_DEV_" + reason.toUpperCase()]; if (!translatedReason) { translatedReason = StringUtils.format(Strings.LIVE_DEV_CLOSED_UNKNOWN_REASON, reason); } // Configure the twipsy var options = { placement: "left", trigger: "manual", autoHideDelay: 5000, title: function () { return translatedReason; } }; // Show the twipsy with the explanation _$btnGoLive.twipsy(options).twipsy("show"); }
javascript
function _showStatusChangeReason(reason) { // Destroy the previous twipsy (options are not updated otherwise) _$btnGoLive.twipsy("hide").removeData("twipsy"); // If there was no reason or the action was an explicit request by the user, don't show a twipsy if (!reason || reason === "explicit_close") { return; } // Translate the reason var translatedReason = Strings["LIVE_DEV_" + reason.toUpperCase()]; if (!translatedReason) { translatedReason = StringUtils.format(Strings.LIVE_DEV_CLOSED_UNKNOWN_REASON, reason); } // Configure the twipsy var options = { placement: "left", trigger: "manual", autoHideDelay: 5000, title: function () { return translatedReason; } }; // Show the twipsy with the explanation _$btnGoLive.twipsy(options).twipsy("show"); }
[ "function", "_showStatusChangeReason", "(", "reason", ")", "{", "// Destroy the previous twipsy (options are not updated otherwise)", "_$btnGoLive", ".", "twipsy", "(", "\"hide\"", ")", ".", "removeData", "(", "\"twipsy\"", ")", ";", "// If there was no reason or the action was...
Called on status change
[ "Called", "on", "status", "change" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L197-L224
train
Show the status change reason
[ 30522, 3853, 1035, 3065, 29336, 2271, 22305, 7869, 3022, 2239, 1006, 3114, 1007, 1063, 1013, 1013, 6033, 1996, 3025, 1056, 9148, 18075, 1006, 7047, 2024, 2025, 7172, 4728, 1007, 1035, 1002, 18411, 16656, 3669, 3726, 1012, 1056, 9148, 18075,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/semi-spacing.js
hasTrailingSpace
function hasTrailingSpace(token) { const tokenAfter = sourceCode.getTokenAfter(token); return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter); }
javascript
function hasTrailingSpace(token) { const tokenAfter = sourceCode.getTokenAfter(token); return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter); }
[ "function", "hasTrailingSpace", "(", "token", ")", "{", "const", "tokenAfter", "=", "sourceCode", ".", "getTokenAfter", "(", "token", ")", ";", "return", "tokenAfter", "&&", "astUtils", ".", "isTokenOnSameLine", "(", "token", ",", "tokenAfter", ")", "&&", "sou...
Checks if a given token has trailing whitespace. @param {Object} token The token to check. @returns {boolean} True if the given token has trailing space, false if not.
[ "Checks", "if", "a", "given", "token", "has", "trailing", "whitespace", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/semi-spacing.js#L73-L77
train
Check if a token has trailing space
[ 30522, 3853, 2038, 6494, 16281, 23058, 1006, 19204, 1007, 1063, 9530, 3367, 19204, 10354, 3334, 1027, 3120, 16044, 1012, 2131, 18715, 8189, 6199, 2121, 1006, 19204, 1007, 1025, 2709, 19204, 10354, 3334, 1004, 1004, 2004, 8525, 3775, 4877, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
goldfire/howler.js
dist/howler.js
function() { var self = this; // Fire an error event and pass back the code. self._parent._emit('loaderror', self._id, self._node.error ? self._node.error.code : 0); // Clear the event listener. self._node.removeEventListener('error', self._errorFn, false); }
javascript
function() { var self = this; // Fire an error event and pass back the code. self._parent._emit('loaderror', self._id, self._node.error ? self._node.error.code : 0); // Clear the event listener. self._node.removeEventListener('error', self._errorFn, false); }
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "// Fire an error event and pass back the code.", "self", ".", "_parent", ".", "_emit", "(", "'loaderror'", ",", "self", ".", "_id", ",", "self", ".", "_node", ".", "error", "?", "self", ".", "_no...
HTML5 Audio error listener callback.
[ "HTML5", "Audio", "error", "listener", "callback", "." ]
030db918dd8ce640afd57e172418472497e8f113
https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L2257-L2265
train
Handle load error.
[ 30522, 3853, 1006, 1007, 1063, 13075, 2969, 1027, 2023, 1025, 1013, 1013, 2543, 2019, 7561, 2724, 1998, 3413, 2067, 1996, 3642, 1012, 2969, 1012, 1035, 6687, 1012, 1035, 12495, 2102, 1006, 1005, 7170, 2121, 29165, 1005, 1010, 2969, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/core/util/util.js
disableElementScroll
function disableElementScroll(element) { element = angular.element(element || body); var scrollMask; if (options.disableScrollMask) { scrollMask = element; } else { scrollMask = angular.element( '<div class="md-scroll-mask">' + ' <div class="md-scroll-mask-bar"></div>' + '</div>'); element.append(scrollMask); } scrollMask.on('wheel', preventDefault); scrollMask.on('touchmove', preventDefault); return function restoreElementScroll() { scrollMask.off('wheel'); scrollMask.off('touchmove'); if (!options.disableScrollMask && scrollMask[0].parentNode) { scrollMask[0].parentNode.removeChild(scrollMask[0]); } }; function preventDefault(e) { e.preventDefault(); } }
javascript
function disableElementScroll(element) { element = angular.element(element || body); var scrollMask; if (options.disableScrollMask) { scrollMask = element; } else { scrollMask = angular.element( '<div class="md-scroll-mask">' + ' <div class="md-scroll-mask-bar"></div>' + '</div>'); element.append(scrollMask); } scrollMask.on('wheel', preventDefault); scrollMask.on('touchmove', preventDefault); return function restoreElementScroll() { scrollMask.off('wheel'); scrollMask.off('touchmove'); if (!options.disableScrollMask && scrollMask[0].parentNode) { scrollMask[0].parentNode.removeChild(scrollMask[0]); } }; function preventDefault(e) { e.preventDefault(); } }
[ "function", "disableElementScroll", "(", "element", ")", "{", "element", "=", "angular", ".", "element", "(", "element", "||", "body", ")", ";", "var", "scrollMask", ";", "if", "(", "options", ".", "disableScrollMask", ")", "{", "scrollMask", "=", "element",...
Creates a virtual scrolling mask to prevent touchmove, keyboard, scrollbar clicking, and wheel events
[ "Creates", "a", "virtual", "scrolling", "mask", "to", "prevent", "touchmove", "keyboard", "scrollbar", "clicking", "and", "wheel", "events" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L252-L282
train
disable element scroll
[ 30522, 3853, 4487, 19150, 12260, 8163, 26775, 14511, 1006, 5783, 1007, 1063, 5783, 1027, 16108, 1012, 5783, 1006, 5783, 1064, 1064, 2303, 1007, 1025, 13075, 17186, 9335, 2243, 1025, 2065, 1006, 7047, 1012, 4487, 19150, 11020, 28402, 9335, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Freeboard/freeboard
js/freeboard.thirdparty.js
Coords
function Coords(obj) { if(obj[0] && $.isPlainObject(obj[0])) { this.data = obj[0]; } else { this.el = obj; } this.isCoords = true; this.coords = {}; this.init(); return this; }
javascript
function Coords(obj) { if(obj[0] && $.isPlainObject(obj[0])) { this.data = obj[0]; } else { this.el = obj; } this.isCoords = true; this.coords = {}; this.init(); return this; }
[ "function", "Coords", "(", "obj", ")", "{", "if", "(", "obj", "[", "0", "]", "&&", "$", ".", "isPlainObject", "(", "obj", "[", "0", "]", ")", ")", "{", "this", ".", "data", "=", "obj", "[", "0", "]", ";", "}", "else", "{", "this", ".", "el"...
Creates objects with coordinates (x1, y1, x2, y2, cx, cy, width, height) to simulate DOM elements on the screen. Coords is used by Gridster to create a faux grid with any DOM element can collide. @class Coords @param {HTMLElement|Object} obj The jQuery HTMLElement or a object with: left, top, width and height properties. @return {Object} Coords instance. @constructor
[ "Creates", "objects", "with", "coordinates", "(", "x1", "y1", "x2", "y2", "cx", "cy", "width", "height", ")", "to", "simulate", "DOM", "elements", "on", "the", "screen", ".", "Coords", "is", "used", "by", "Gridster", "to", "create", "a", "faux", "grid", ...
38789f6e8bd3d04f7d3b2c3427e509d00f2610fc
https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L15139-L15154
train
The Coords constructor.
[ 30522, 3853, 2522, 8551, 2015, 1006, 27885, 3501, 1007, 1063, 2065, 1006, 27885, 3501, 1031, 1014, 1033, 1004, 1004, 1002, 1012, 2003, 24759, 8113, 16429, 20614, 1006, 27885, 3501, 1031, 1014, 1033, 1007, 1007, 1063, 2023, 1012, 2951, 1027,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jgraph/mxgraph
javascript/mxClient.js
mxValueChange
function mxValueChange(model, cell, value) { this.model = model; this.cell = cell; this.value = value; this.previous = value; }
javascript
function mxValueChange(model, cell, value) { this.model = model; this.cell = cell; this.value = value; this.previous = value; }
[ "function", "mxValueChange", "(", "model", ",", "cell", ",", "value", ")", "{", "this", ".", "model", "=", "model", ";", "this", ".", "cell", "=", "cell", ";", "this", ".", "value", "=", "value", ";", "this", ".", "previous", "=", "value", ";", "}"...
Class: mxValueChange Action to change a user object in a model. Constructor: mxValueChange Constructs a change of a user object in the specified model.
[ "Class", ":", "mxValueChange" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L41742-L41748
train
Change value of cell
[ 30522, 3853, 25630, 10175, 5657, 22305, 2063, 1006, 2944, 1010, 3526, 1010, 3643, 1007, 1063, 2023, 1012, 2944, 1027, 2944, 1025, 2023, 1012, 3526, 1027, 3526, 1025, 2023, 1012, 3643, 1027, 3643, 1025, 2023, 1012, 3025, 1027, 3643, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jantimon/html-webpack-plugin
lib/hooks.js
createHtmlWebpackPluginHooks
function createHtmlWebpackPluginHooks () { return { beforeAssetTagGeneration: new AsyncSeriesWaterfallHook(['pluginArgs']), alterAssetTags: new AsyncSeriesWaterfallHook(['pluginArgs']), alterAssetTagGroups: new AsyncSeriesWaterfallHook(['pluginArgs']), afterTemplateExecution: new AsyncSeriesWaterfallHook(['pluginArgs']), beforeEmit: new AsyncSeriesWaterfallHook(['pluginArgs']), afterEmit: new AsyncSeriesWaterfallHook(['pluginArgs']) }; }
javascript
function createHtmlWebpackPluginHooks () { return { beforeAssetTagGeneration: new AsyncSeriesWaterfallHook(['pluginArgs']), alterAssetTags: new AsyncSeriesWaterfallHook(['pluginArgs']), alterAssetTagGroups: new AsyncSeriesWaterfallHook(['pluginArgs']), afterTemplateExecution: new AsyncSeriesWaterfallHook(['pluginArgs']), beforeEmit: new AsyncSeriesWaterfallHook(['pluginArgs']), afterEmit: new AsyncSeriesWaterfallHook(['pluginArgs']) }; }
[ "function", "createHtmlWebpackPluginHooks", "(", ")", "{", "return", "{", "beforeAssetTagGeneration", ":", "new", "AsyncSeriesWaterfallHook", "(", "[", "'pluginArgs'", "]", ")", ",", "alterAssetTags", ":", "new", "AsyncSeriesWaterfallHook", "(", "[", "'pluginArgs'", "...
Add hooks to the webpack compilation object to allow foreign plugins to extend the HtmlWebpackPlugin @returns {HtmlWebpackPluginHooks}
[ "Add", "hooks", "to", "the", "webpack", "compilation", "object", "to", "allow", "foreign", "plugins", "to", "extend", "the", "HtmlWebpackPlugin" ]
38db64ae8805de37d038e0ee0f6dfa2a26e2163a
https://github.com/jantimon/html-webpack-plugin/blob/38db64ae8805de37d038e0ee0f6dfa2a26e2163a/lib/hooks.js#L93-L102
train
Creates a hook object for webpack - plugin - webpack
[ 30522, 3853, 3443, 11039, 19968, 8545, 2497, 23947, 24759, 15916, 29344, 6559, 2015, 1006, 1007, 1063, 2709, 1063, 2077, 27241, 5946, 13871, 30524, 1005, 13354, 3981, 10623, 2015, 1005, 1033, 1007, 1010, 11477, 27241, 5946, 13871, 22107, 2015...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/cache/CacheManager.js
function () { var pReset, oMsr = startMeasurements("reset"); Log.debug("Cache Manager: Reset called."); pReset = this._callInstanceMethod("reset", arguments).then(function callInstanceHandler() { Log.debug("Cache Manager: Reset completed successfully."); oMsr.endAsync(); //nothing to return, just logging. }, function (e) { Log.debug("Cache Manager: Reset failed. Error: " + e); oMsr.endAsync(); throw e; }); oMsr.endSync(); return pReset; }
javascript
function () { var pReset, oMsr = startMeasurements("reset"); Log.debug("Cache Manager: Reset called."); pReset = this._callInstanceMethod("reset", arguments).then(function callInstanceHandler() { Log.debug("Cache Manager: Reset completed successfully."); oMsr.endAsync(); //nothing to return, just logging. }, function (e) { Log.debug("Cache Manager: Reset failed. Error: " + e); oMsr.endAsync(); throw e; }); oMsr.endSync(); return pReset; }
[ "function", "(", ")", "{", "var", "pReset", ",", "oMsr", "=", "startMeasurements", "(", "\"reset\"", ")", ";", "Log", ".", "debug", "(", "\"Cache Manager: Reset called.\"", ")", ";", "pReset", "=", "this", ".", "_callInstanceMethod", "(", "\"reset\"", ",", "...
Clears all entries in the cache. @returns {Promise} a promise that would be resolved in case of successful operation or rejected with value of the error message if the operation fails. @public
[ "Clears", "all", "entries", "in", "the", "cache", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/cache/CacheManager.js#L222-L237
train
Reset the cache
[ 30522, 3853, 1006, 1007, 1063, 13075, 3653, 13462, 1010, 18168, 21338, 1027, 2707, 4168, 3022, 5397, 8163, 1006, 1000, 25141, 1000, 1007, 1025, 8833, 1012, 2139, 8569, 2290, 1006, 1000, 17053, 3208, 1024, 25141, 2170, 1012, 1000, 1007, 1025...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jgraph/mxgraph
javascript/examples/webpack/src/anchors.js
main
function main(container) { // Disables the built-in context menu mxEvent.disableContextMenu(container); // Creates the graph inside the given container var graph = new mxGraph(container); graph.setConnectable(true); // Enables connect preview for the default edge style graph.connectionHandler.createEdgeState = function(me) { var edge = graph.createEdge(null, null, null, null, null); return new mxCellState(this.graph.view, edge, this.graph.getCellStyle(edge)); }; // Specifies the default edge style graph.getStylesheet().getDefaultEdgeStyle()['edgeStyle'] = 'orthogonalEdgeStyle'; // Enables rubberband selection new mxRubberband(graph); // Gets the default parent for inserting new cells. This // is normally the first child of the root (ie. layer 0). var parent = graph.getDefaultParent(); // Adds cells to the model in a single step graph.getModel().beginUpdate(); try { var v1 = graph.insertVertex(parent, null, 'Hello,', 20, 20, 80, 30); var v2 = graph.insertVertex(parent, null, 'World!', 200, 150, 80, 30); var e1 = graph.insertEdge(parent, null, '', v1, v2); } finally { // Updates the display graph.getModel().endUpdate(); } }
javascript
function main(container) { // Disables the built-in context menu mxEvent.disableContextMenu(container); // Creates the graph inside the given container var graph = new mxGraph(container); graph.setConnectable(true); // Enables connect preview for the default edge style graph.connectionHandler.createEdgeState = function(me) { var edge = graph.createEdge(null, null, null, null, null); return new mxCellState(this.graph.view, edge, this.graph.getCellStyle(edge)); }; // Specifies the default edge style graph.getStylesheet().getDefaultEdgeStyle()['edgeStyle'] = 'orthogonalEdgeStyle'; // Enables rubberband selection new mxRubberband(graph); // Gets the default parent for inserting new cells. This // is normally the first child of the root (ie. layer 0). var parent = graph.getDefaultParent(); // Adds cells to the model in a single step graph.getModel().beginUpdate(); try { var v1 = graph.insertVertex(parent, null, 'Hello,', 20, 20, 80, 30); var v2 = graph.insertVertex(parent, null, 'World!', 200, 150, 80, 30); var e1 = graph.insertEdge(parent, null, '', v1, v2); } finally { // Updates the display graph.getModel().endUpdate(); } }
[ "function", "main", "(", "container", ")", "{", "// Disables the built-in context menu", "mxEvent", ".", "disableContextMenu", "(", "container", ")", ";", "// Creates the graph inside the given container", "var", "graph", "=", "new", "mxGraph", "(", "container", ")", ";...
Program starts here. Creates a sample graph in the DOM node with the specified ID. This function is invoked from the onLoad event handler of the document (see below).
[ "Program", "starts", "here", ".", "Creates", "a", "sample", "graph", "in", "the", "DOM", "node", "with", "the", "specified", "ID", ".", "This", "function", "is", "invoked", "from", "the", "onLoad", "event", "handler", "of", "the", "document", "(", "see", ...
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/examples/webpack/src/anchors.js#L56-L96
train
Main entry point for the cluster
[ 30522, 3853, 2364, 1006, 11661, 1007, 1063, 1013, 1013, 4487, 19150, 2015, 1996, 2328, 1011, 1999, 6123, 12183, 25630, 18697, 3372, 1012, 4487, 19150, 8663, 18209, 3549, 2226, 1006, 11661, 1007, 1025, 1013, 1013, 9005, 1996, 10629, 2503, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/components/tabs/js/tabsController.js
scroll
function scroll (event) { if (!ctrl.shouldPaginate) return; event.preventDefault(); if (event.deltaY) { ctrl.offsetLeft = fixOffset(ctrl.offsetLeft + event.deltaY); } else if (event.deltaX) { ctrl.offsetLeft = fixOffset(ctrl.offsetLeft + event.deltaX); } }
javascript
function scroll (event) { if (!ctrl.shouldPaginate) return; event.preventDefault(); if (event.deltaY) { ctrl.offsetLeft = fixOffset(ctrl.offsetLeft + event.deltaY); } else if (event.deltaX) { ctrl.offsetLeft = fixOffset(ctrl.offsetLeft + event.deltaX); } }
[ "function", "scroll", "(", "event", ")", "{", "if", "(", "!", "ctrl", ".", "shouldPaginate", ")", "return", ";", "event", ".", "preventDefault", "(", ")", ";", "if", "(", "event", ".", "deltaY", ")", "{", "ctrl", ".", "offsetLeft", "=", "fixOffset", ...
When pagination is on, this makes sure the selected index is in view. @param {WheelEvent} event
[ "When", "pagination", "is", "on", "this", "makes", "sure", "the", "selected", "index", "is", "in", "view", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L353-L361
train
scroll to the right of the page
[ 30522, 3853, 17186, 1006, 2724, 1007, 1063, 2065, 1006, 999, 14931, 12190, 1012, 2323, 4502, 20876, 2618, 1007, 2709, 1025, 2724, 1012, 4652, 3207, 7011, 11314, 1006, 1007, 1025, 2065, 1006, 2724, 1012, 7160, 2100, 1007, 1063, 14931, 12190,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jgraph/mxgraph
javascript/mxClient.js
function() { var string = ''; for (var i = 0; i < arguments.length; i++) { string += arguments[i]; if (i < arguments.length - 1) { string += ' '; } } if (mxLog.textarea != null) { mxLog.textarea.value = mxLog.textarea.value + string; // Workaround for no update in Presto 2.5.22 (Opera 10.5) if (navigator.userAgent.indexOf('Presto/2.5') >= 0) { mxLog.textarea.style.visibility = 'hidden'; mxLog.textarea.style.visibility = 'visible'; } mxLog.textarea.scrollTop = mxLog.textarea.scrollHeight; } else { mxLog.buffer += string; } }
javascript
function() { var string = ''; for (var i = 0; i < arguments.length; i++) { string += arguments[i]; if (i < arguments.length - 1) { string += ' '; } } if (mxLog.textarea != null) { mxLog.textarea.value = mxLog.textarea.value + string; // Workaround for no update in Presto 2.5.22 (Opera 10.5) if (navigator.userAgent.indexOf('Presto/2.5') >= 0) { mxLog.textarea.style.visibility = 'hidden'; mxLog.textarea.style.visibility = 'visible'; } mxLog.textarea.scrollTop = mxLog.textarea.scrollHeight; } else { mxLog.buffer += string; } }
[ "function", "(", ")", "{", "var", "string", "=", "''", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "arguments", ".", "length", ";", "i", "++", ")", "{", "string", "+=", "arguments", "[", "i", "]", ";", "if", "(", "i", "<", "argument...
Function: write Adds the specified strings to the console.
[ "Function", ":", "write" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L982-L1013
train
Adds the given string to the log buffer
[ 30522, 3853, 1006, 1007, 1063, 13075, 5164, 1027, 1005, 1005, 1025, 2005, 1006, 13075, 1045, 1027, 1014, 1025, 1045, 1026, 9918, 1012, 3091, 1025, 1045, 1009, 1009, 1007, 1063, 5164, 1009, 1027, 9918, 1031, 1045, 1033, 1025, 2065, 1006, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/RecentProjects/main.js
selectNextItem
function selectNextItem(direction) { var $links = $dropdown.find("a"), index = $dropdownItem ? $links.index($dropdownItem) : (direction > 0 ? -1 : 0), $newItem = $links.eq((index + direction) % $links.length); if ($dropdownItem) { $dropdownItem.removeClass("selected"); } $newItem.addClass("selected"); $dropdownItem = $newItem; removeDeleteButton(); }
javascript
function selectNextItem(direction) { var $links = $dropdown.find("a"), index = $dropdownItem ? $links.index($dropdownItem) : (direction > 0 ? -1 : 0), $newItem = $links.eq((index + direction) % $links.length); if ($dropdownItem) { $dropdownItem.removeClass("selected"); } $newItem.addClass("selected"); $dropdownItem = $newItem; removeDeleteButton(); }
[ "function", "selectNextItem", "(", "direction", ")", "{", "var", "$links", "=", "$dropdown", ".", "find", "(", "\"a\"", ")", ",", "index", "=", "$dropdownItem", "?", "$links", ".", "index", "(", "$dropdownItem", ")", ":", "(", "direction", ">", "0", "?",...
Selects the next or previous item in the list @param {number} direction +1 for next, -1 for prev
[ "Selects", "the", "next", "or", "previous", "item", "in", "the", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L162-L174
train
select next item
[ 30522, 3853, 7276, 2638, 18413, 4221, 2213, 1006, 3257, 1007, 1063, 13075, 1002, 6971, 1027, 1002, 4530, 7698, 1012, 2424, 1006, 1000, 1037, 1000, 1007, 1010, 5950, 1027, 1002, 4530, 7698, 4221, 2213, 1029, 1002, 6971, 1012, 5950, 1006, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
GitbookIO/gitbook
lib/utils/promise.js
map
function map(arr, iter) { if (Immutable.Map.isMap(arr)) { var type = 'Map'; if (Immutable.OrderedMap.isOrderedMap(arr)) { type = 'OrderedMap'; } return mapAsList(arr, function(value, key) { return Q(iter(value, key)) .then(function(result) { return [key, result]; }); }) .then(function(result) { return Immutable[type](result); }); } else { return mapAsList(arr, iter) .then(function(result) { return Immutable.List(result); }); } }
javascript
function map(arr, iter) { if (Immutable.Map.isMap(arr)) { var type = 'Map'; if (Immutable.OrderedMap.isOrderedMap(arr)) { type = 'OrderedMap'; } return mapAsList(arr, function(value, key) { return Q(iter(value, key)) .then(function(result) { return [key, result]; }); }) .then(function(result) { return Immutable[type](result); }); } else { return mapAsList(arr, iter) .then(function(result) { return Immutable.List(result); }); } }
[ "function", "map", "(", "arr", ",", "iter", ")", "{", "if", "(", "Immutable", ".", "Map", ".", "isMap", "(", "arr", ")", ")", "{", "var", "type", "=", "'Map'", ";", "if", "(", "Immutable", ".", "OrderedMap", ".", "isOrderedMap", "(", "arr", ")", ...
Map an array or map @param {Array|List|Map|OrderedMap} arr @param {Function(element, key)} @return {Promise<List|Map|OrderedMap>}
[ "Map", "an", "array", "or", "map" ]
6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4
https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/promise.js#L100-L122
train
mapAsList - Map - Iterator - Iterator - Function
[ 30522, 3853, 4949, 1006, 12098, 2099, 1010, 2009, 2121, 1007, 1063, 2065, 1006, 10047, 28120, 3085, 1012, 4949, 1012, 2003, 2863, 2361, 1006, 12098, 2099, 1007, 1007, 1063, 13075, 2828, 1027, 1005, 4949, 1005, 1025, 2065, 1006, 10047, 28120...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mui-org/material-ui
docs/src/modules/utils/find.js
findPagesMarkdown
function findPagesMarkdown( directory = path.resolve(__dirname, '../../../src/pages'), pagesMarkdown = [], ) { const items = fs.readdirSync(directory); items.forEach(item => { const itemPath = path.resolve(directory, item); if (fs.statSync(itemPath).isDirectory()) { findPagesMarkdown(itemPath, pagesMarkdown); return; } if (!markdownRegex.test(item)) { return; } let pathname = itemPath .replace(new RegExp(`\\${path.sep}`, 'g'), '/') .replace(/^.*\/pages/, '') .replace('.md', ''); // Remove the last pathname segment. pathname = pathname .split('/') .slice(0, 3) .join('/'); pagesMarkdown.push({ // Relative location in the path (URL) system. pathname, // Relative location in the file system. filename: itemPath, }); }); return pagesMarkdown; }
javascript
function findPagesMarkdown( directory = path.resolve(__dirname, '../../../src/pages'), pagesMarkdown = [], ) { const items = fs.readdirSync(directory); items.forEach(item => { const itemPath = path.resolve(directory, item); if (fs.statSync(itemPath).isDirectory()) { findPagesMarkdown(itemPath, pagesMarkdown); return; } if (!markdownRegex.test(item)) { return; } let pathname = itemPath .replace(new RegExp(`\\${path.sep}`, 'g'), '/') .replace(/^.*\/pages/, '') .replace('.md', ''); // Remove the last pathname segment. pathname = pathname .split('/') .slice(0, 3) .join('/'); pagesMarkdown.push({ // Relative location in the path (URL) system. pathname, // Relative location in the file system. filename: itemPath, }); }); return pagesMarkdown; }
[ "function", "findPagesMarkdown", "(", "directory", "=", "path", ".", "resolve", "(", "__dirname", ",", "'../../../src/pages'", ")", ",", "pagesMarkdown", "=", "[", "]", ",", ")", "{", "const", "items", "=", "fs", ".", "readdirSync", "(", "directory", ")", ...
Returns the markdowns of the documentation in a flat array. { pathname: String, filename: String, }
[ "Returns", "the", "markdowns", "of", "the", "documentation", "in", "a", "flat", "array", ".", "{", "pathname", ":", "String", "filename", ":", "String", "}" ]
1555e52367835946382fbf2a8f681de71318915d
https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/docs/src/modules/utils/find.js#L11-L49
train
Find the pages markdown file in the specified directory
[ 30522, 3853, 2424, 13704, 26212, 8024, 7698, 1006, 14176, 1027, 4130, 1012, 10663, 1006, 1035, 1035, 16101, 18442, 1010, 1005, 1012, 1012, 1013, 1012, 1012, 1013, 1012, 1012, 1013, 5034, 2278, 1013, 5530, 1005, 1007, 1010, 5530, 10665, 7698...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/components/autocomplete/demoCustomTemplate/script.js
createFilterFor
function createFilterFor(query) { var lowercaseQuery = query.toLowerCase(); return function filterFn(item) { return (item.value.indexOf(lowercaseQuery) === 0); }; }
javascript
function createFilterFor(query) { var lowercaseQuery = query.toLowerCase(); return function filterFn(item) { return (item.value.indexOf(lowercaseQuery) === 0); }; }
[ "function", "createFilterFor", "(", "query", ")", "{", "var", "lowercaseQuery", "=", "query", ".", "toLowerCase", "(", ")", ";", "return", "function", "filterFn", "(", "item", ")", "{", "return", "(", "item", ".", "value", ".", "indexOf", "(", "lowercaseQu...
Create filter function for a query string
[ "Create", "filter", "function", "for", "a", "query", "string" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/autocomplete/demoCustomTemplate/script.js#L97-L104
train
Create a filter function for a given query
[ 30522, 3853, 3443, 8873, 21928, 29278, 1006, 23032, 1007, 1063, 13075, 2896, 18382, 4226, 2854, 1027, 23032, 1012, 2000, 27663, 18992, 3366, 1006, 1007, 1025, 2709, 3853, 11307, 2546, 2078, 1006, 8875, 1007, 1063, 2709, 1006, 8875, 1012, 36...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js
function (oModelData, oPage, oMetadata) { oModelData.metadata = oMetadata; this.oSelectedContentModel.setData(oModelData); var oCore = sap.ui.getCore(); var sIconTabBarId = this.getView().createId("contentDetailsIconTabBar"); var oIconTabBar = oCore.getElementById(sIconTabBarId); if (oIconTabBar){ var oFirstIconTabBarItem = oIconTabBar.getItems()[0]; if (oIconTabBar.getSelectedKey() !== oFirstIconTabBarItem.getId()) { oIconTabBar.setSelectedItem(oFirstIconTabBarItem); } } oPage.setBusy(false); }
javascript
function (oModelData, oPage, oMetadata) { oModelData.metadata = oMetadata; this.oSelectedContentModel.setData(oModelData); var oCore = sap.ui.getCore(); var sIconTabBarId = this.getView().createId("contentDetailsIconTabBar"); var oIconTabBar = oCore.getElementById(sIconTabBarId); if (oIconTabBar){ var oFirstIconTabBarItem = oIconTabBar.getItems()[0]; if (oIconTabBar.getSelectedKey() !== oFirstIconTabBarItem.getId()) { oIconTabBar.setSelectedItem(oFirstIconTabBarItem); } } oPage.setBusy(false); }
[ "function", "(", "oModelData", ",", "oPage", ",", "oMetadata", ")", "{", "oModelData", ".", "metadata", "=", "oMetadata", ";", "this", ".", "oSelectedContentModel", ".", "setData", "(", "oModelData", ")", ";", "var", "oCore", "=", "sap", ".", "ui", ".", ...
Handler if content metadata was received; Sets the received data to the current content model, updates the icon tab bar, and releases the busy mode of the current page. @param {Object} oModelData - model data of current page @param {Object} oPage - current page used to set display busy mode on/off @param {Object} oMetadata - metadata which is received from <code>LRepConnector</code> "getContent" promise @private
[ "Handler", "if", "content", "metadata", "was", "received", ";", "Sets", "the", "received", "data", "to", "the", "current", "content", "model", "updates", "the", "icon", "tab", "bar", "and", "releases", "the", "busy", "mode", "of", "the", "current", "page", ...
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js#L124-L137
train
Sets the selected content model and sets the busy flag
[ 30522, 3853, 1006, 18168, 10244, 15150, 2696, 1010, 6728, 4270, 1010, 18168, 12928, 2850, 2696, 1007, 1063, 18168, 10244, 15150, 2696, 1012, 27425, 1027, 18168, 12928, 2850, 2696, 1025, 2023, 1012, 9808, 12260, 10985, 8663, 6528, 21246, 10244...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
goldfire/howler.js
examples/3d/js/map.js
function(x, y) { x = Math.floor(x); y = Math.floor(y); if (x < 0 || x > this.size - 1 || y < 0 || y > this.size - 1) { return -1; } return this.grid[y * this.size + x]; }
javascript
function(x, y) { x = Math.floor(x); y = Math.floor(y); if (x < 0 || x > this.size - 1 || y < 0 || y > this.size - 1) { return -1; } return this.grid[y * this.size + x]; }
[ "function", "(", "x", ",", "y", ")", "{", "x", "=", "Math", ".", "floor", "(", "x", ")", ";", "y", "=", "Math", ".", "floor", "(", "y", ")", ";", "if", "(", "x", "<", "0", "||", "x", ">", "this", ".", "size", "-", "1", "||", "y", "<", ...
Check if a gird location is out of bounds, a wall or empty. @param {Number} x x-coordinate @param {Number} y y-coordinate @return {Number} -1, 0, 1
[ "Check", "if", "a", "gird", "location", "is", "out", "of", "bounds", "a", "wall", "or", "empty", "." ]
030db918dd8ce640afd57e172418472497e8f113
https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/3d/js/map.js#L49-L58
train
Returns the index of the element at the specified location
[ 30522, 3853, 1006, 1060, 1010, 1061, 1007, 1063, 1060, 1027, 8785, 1012, 2723, 1006, 1060, 1007, 1025, 1061, 1027, 8785, 1012, 2723, 1006, 1061, 1007, 1025, 2065, 1006, 1060, 1026, 1014, 1064, 1064, 1060, 1028, 2023, 1012, 2946, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/ComponentContainer.js
createComponentConfig
function createComponentConfig(oComponentContainer) { var sName = oComponentContainer.getName(); var vManifest = oComponentContainer.getManifest(); var sUrl = oComponentContainer.getUrl(); var mSettings = oComponentContainer.getSettings(); var mConfig = { name: sName ? sName : undefined, manifest: vManifest !== null ? vManifest : false, async: oComponentContainer.getAsync(), url: sUrl ? sUrl : undefined, handleValidation: oComponentContainer.getHandleValidation(), settings: mSettings !== null ? mSettings : undefined }; return mConfig; }
javascript
function createComponentConfig(oComponentContainer) { var sName = oComponentContainer.getName(); var vManifest = oComponentContainer.getManifest(); var sUrl = oComponentContainer.getUrl(); var mSettings = oComponentContainer.getSettings(); var mConfig = { name: sName ? sName : undefined, manifest: vManifest !== null ? vManifest : false, async: oComponentContainer.getAsync(), url: sUrl ? sUrl : undefined, handleValidation: oComponentContainer.getHandleValidation(), settings: mSettings !== null ? mSettings : undefined }; return mConfig; }
[ "function", "createComponentConfig", "(", "oComponentContainer", ")", "{", "var", "sName", "=", "oComponentContainer", ".", "getName", "(", ")", ";", "var", "vManifest", "=", "oComponentContainer", ".", "getManifest", "(", ")", ";", "var", "sUrl", "=", "oCompone...
/* Helper to create the settings object for the Component Factory or the createComponent function.
[ "/", "*", "Helper", "to", "create", "the", "settings", "object", "for", "the", "Component", "Factory", "or", "the", "createComponent", "function", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/ComponentContainer.js#L264-L278
train
Creates a configuration object for a component container.
[ 30522, 3853, 3443, 9006, 29513, 3372, 8663, 8873, 2290, 1006, 1051, 9006, 29513, 3372, 8663, 18249, 2121, 1007, 1063, 13075, 1055, 18442, 1027, 1051, 9006, 29513, 3372, 8663, 18249, 2121, 1012, 2131, 18442, 1006, 1007, 1025, 13075, 1058, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jgraph/mxgraph
javascript/mxClient.js
function(x1, y1, x2, y2, px, py) { x2 -= x1; y2 -= y1; px -= x1; py -= y1; var ccw = px * y2 - py * x2; if (ccw == 0.0) { ccw = px * x2 + py * y2; if (ccw > 0.0) { px -= x2; py -= y2; ccw = px * x2 + py * y2; if (ccw < 0.0) { ccw = 0.0; } } } return (ccw < 0.0) ? -1 : ((ccw > 0.0) ? 1 : 0); }
javascript
function(x1, y1, x2, y2, px, py) { x2 -= x1; y2 -= y1; px -= x1; py -= y1; var ccw = px * y2 - py * x2; if (ccw == 0.0) { ccw = px * x2 + py * y2; if (ccw > 0.0) { px -= x2; py -= y2; ccw = px * x2 + py * y2; if (ccw < 0.0) { ccw = 0.0; } } } return (ccw < 0.0) ? -1 : ((ccw > 0.0) ? 1 : 0); }
[ "function", "(", "x1", ",", "y1", ",", "x2", ",", "y2", ",", "px", ",", "py", ")", "{", "x2", "-=", "x1", ";", "y2", "-=", "y1", ";", "px", "-=", "x1", ";", "py", "-=", "y1", ";", "var", "ccw", "=", "px", "*", "y2", "-", "py", "*", "x2"...
Function: relativeCcw Returns 1 if the given point on the right side of the segment, 0 if its on the segment, and -1 if the point is on the left side of the segment. Parameters: x1 - X-coordinate of the startpoint of the segment. y1 - Y-coordinate of the startpoint of the segment. x2 - X-coordinate of the endpoint of the segment. y2 - Y-coordinate of the endpoint of the segment. px - X-coordinate of the point. py - Y-coordinate of the point.
[ "Function", ":", "relativeCcw" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L5131-L5157
train
Compute the cCW of a curve
[ 30522, 3853, 1006, 1060, 2487, 1010, 1061, 2487, 1010, 1060, 2475, 1010, 1061, 2475, 1010, 1052, 2595, 1010, 1052, 2100, 1007, 1063, 1060, 2475, 1011, 1027, 1060, 2487, 1025, 1061, 2475, 1011, 1027, 1061, 2487, 1025, 1052, 2595, 1011, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/thirdparty/jquery-mobile-custom.js
checkAndClearTapHandlers
function checkAndClearTapHandlers( mouseUpEvent ) { // if the mouseup event occurs out of the origin target of the mousedown event, // unbind all of the listeners if (mouseUpEvent.target !== mouseDownTarget && !$.contains(mouseDownTarget, mouseUpEvent.target) && !buttonTappedInEdgeBrowser( mouseUpEvent )) { clearTapHandlers(); } }
javascript
function checkAndClearTapHandlers( mouseUpEvent ) { // if the mouseup event occurs out of the origin target of the mousedown event, // unbind all of the listeners if (mouseUpEvent.target !== mouseDownTarget && !$.contains(mouseDownTarget, mouseUpEvent.target) && !buttonTappedInEdgeBrowser( mouseUpEvent )) { clearTapHandlers(); } }
[ "function", "checkAndClearTapHandlers", "(", "mouseUpEvent", ")", "{", "// if the mouseup event occurs out of the origin target of the mousedown event,", "// unbind all of the listeners", "if", "(", "mouseUpEvent", ".", "target", "!==", "mouseDownTarget", "&&", "!", "$", ".", "...
SAP MODIFICATION: terminate the firing of 'tap' event if 'mouseup' event occurs out of the 'mousedown' target
[ "SAP", "MODIFICATION", ":", "terminate", "the", "firing", "of", "tap", "event", "if", "mouseup", "event", "occurs", "out", "of", "the", "mousedown", "target" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jquery-mobile-custom.js#L1986-L1992
train
check and clear tap handlers
[ 30522, 3853, 4638, 5685, 14321, 8445, 9331, 11774, 12910, 1006, 8000, 6279, 18697, 3372, 1007, 1063, 1013, 1013, 2065, 1996, 8000, 6279, 2724, 5158, 2041, 1997, 1996, 4761, 4539, 1997, 1996, 8000, 7698, 2724, 1010, 1013, 1013, 4895, 8428, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Freeboard/freeboard
js/freeboard.thirdparty.js
function(inst, date) { var minDate = this._getMinMaxDate(inst, "min"), maxDate = this._getMinMaxDate(inst, "max"), newDate = (minDate && date < minDate ? minDate : date); return (maxDate && newDate > maxDate ? maxDate : newDate); }
javascript
function(inst, date) { var minDate = this._getMinMaxDate(inst, "min"), maxDate = this._getMinMaxDate(inst, "max"), newDate = (minDate && date < minDate ? minDate : date); return (maxDate && newDate > maxDate ? maxDate : newDate); }
[ "function", "(", "inst", ",", "date", ")", "{", "var", "minDate", "=", "this", ".", "_getMinMaxDate", "(", "inst", ",", "\"min\"", ")", ",", "maxDate", "=", "this", ".", "_getMinMaxDate", "(", "inst", ",", "\"max\"", ")", ",", "newDate", "=", "(", "m...
/* Ensure a date is within any min/max bounds.
[ "/", "*", "Ensure", "a", "date", "is", "within", "any", "min", "/", "max", "bounds", "." ]
38789f6e8bd3d04f7d3b2c3427e509d00f2610fc
https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L9468-L9473
train
Returns the new date
[ 30522, 3853, 1006, 16021, 2102, 1010, 3058, 1007, 1063, 13075, 2568, 3686, 1027, 2023, 1012, 1035, 2131, 10020, 17848, 13701, 1006, 16021, 2102, 1010, 1000, 8117, 1000, 1007, 1010, 4098, 13701, 1027, 2023, 1012, 1035, 2131, 10020, 17848, 13...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js
updateTimeProgression
function updateTimeProgression(curve, x, y) { var percentX = Math.round(100 * x / WIDTH_MAIN), percentY = Math.round(100 * ((HEIGHT_MAIN - y) / HEIGHT_MAIN)); // Constrain horizontal percentage to [0, 100] range percentX = Math.min(Math.max(0, percentX), 100); curve.parentNode.setAttribute("data-time", percentX); curve.parentNode.setAttribute("data-progression", percentY); }
javascript
function updateTimeProgression(curve, x, y) { var percentX = Math.round(100 * x / WIDTH_MAIN), percentY = Math.round(100 * ((HEIGHT_MAIN - y) / HEIGHT_MAIN)); // Constrain horizontal percentage to [0, 100] range percentX = Math.min(Math.max(0, percentX), 100); curve.parentNode.setAttribute("data-time", percentX); curve.parentNode.setAttribute("data-progression", percentY); }
[ "function", "updateTimeProgression", "(", "curve", ",", "x", ",", "y", ")", "{", "var", "percentX", "=", "Math", ".", "round", "(", "100", "*", "x", "/", "WIDTH_MAIN", ")", ",", "percentY", "=", "Math", ".", "round", "(", "100", "*", "(", "(", "HEI...
Update Time (x-axis) and Progression (y-axis) data for mouse position @param {Element} canvas <canvas> element @param {number} x Horizontal position @param {number} y Vertical position
[ "Update", "Time", "(", "x", "-", "axis", ")", "and", "Progression", "(", "y", "-", "axis", ")", "data", "for", "mouse", "position" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L343-L352
train
Update the time and progression of the log curve
[ 30522, 3853, 10651, 7292, 21572, 17603, 28231, 1006, 7774, 1010, 1060, 1010, 1061, 1007, 1063, 13075, 3867, 2595, 1027, 8785, 1012, 2461, 1006, 2531, 1008, 1060, 1013, 9381, 1035, 2364, 1007, 1010, 3867, 2100, 1027, 8785, 1012, 2461, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.table/src/sap/ui/table/TableRendererUtils.js
function(rm, sClassName, bShouldAdd) { if (sClassName && (!!bShouldAdd || arguments.length == 2)) { rm.addClass(sClassName); if (TAGCONTEXT) { TAGCONTEXT.writeClasses = true; } } return TableRendererUtils; }
javascript
function(rm, sClassName, bShouldAdd) { if (sClassName && (!!bShouldAdd || arguments.length == 2)) { rm.addClass(sClassName); if (TAGCONTEXT) { TAGCONTEXT.writeClasses = true; } } return TableRendererUtils; }
[ "function", "(", "rm", ",", "sClassName", ",", "bShouldAdd", ")", "{", "if", "(", "sClassName", "&&", "(", "!", "!", "bShouldAdd", "||", "arguments", ".", "length", "==", "2", ")", ")", "{", "rm", ".", "addClass", "(", "sClassName", ")", ";", "if", ...
Adds the given CSS class if no condition is given or the condition is truthy. @param {sap.ui.core.RenderManager} rm Instance of the rendermanager @param {string} sClassName The CSS class which should be written @param {boolean} [bShouldAdd] optional condition @returns TableRendererUtils to allow method chaining @private
[ "Adds", "the", "given", "CSS", "class", "if", "no", "condition", "is", "given", "or", "the", "condition", "is", "truthy", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableRendererUtils.js#L33-L41
train
Adds a class to the specified markup manager.
[ 30522, 3853, 1006, 28549, 1010, 8040, 27102, 18442, 1010, 18667, 6806, 21285, 4215, 2094, 1007, 1063, 2065, 1006, 8040, 27102, 18442, 1004, 1004, 1006, 999, 999, 18667, 6806, 21285, 4215, 2094, 1064, 1064, 9918, 1012, 3091, 1027, 1027, 1016...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mochajs/mocha
lib/reporters/json-stream.js
clean
function clean(test) { return { title: test.title, fullTitle: test.fullTitle(), duration: test.duration, currentRetry: test.currentRetry() }; }
javascript
function clean(test) { return { title: test.title, fullTitle: test.fullTitle(), duration: test.duration, currentRetry: test.currentRetry() }; }
[ "function", "clean", "(", "test", ")", "{", "return", "{", "title", ":", "test", ".", "title", ",", "fullTitle", ":", "test", ".", "fullTitle", "(", ")", ",", "duration", ":", "test", ".", "duration", ",", "currentRetry", ":", "test", ".", "currentRetr...
Returns an object literal representation of `test` free of cyclic properties, etc. @private @param {Test} test - Instance used as data source. @return {Object} object containing pared-down test instance data
[ "Returns", "an", "object", "literal", "representation", "of", "test", "free", "of", "cyclic", "properties", "etc", "." ]
9b00fedb610241e33f7592c40164e42a38a793cf
https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/json-stream.js#L81-L88
train
clean test object
[ 30522, 3853, 4550, 1006, 3231, 1007, 1063, 2709, 1063, 2516, 1024, 3231, 1012, 2516, 1010, 2440, 3775, 9286, 1024, 3231, 1012, 2440, 3775, 9286, 1006, 1007, 1010, 9367, 1024, 3231, 1012, 9367, 1010, 2783, 13465, 2854, 1024, 3231, 1012, 27...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/CodeFolding/main.js
setupGutterEventListeners
function setupGutterEventListeners(editor) { var cm = editor._codeMirror; $(editor.getRootElement()).addClass("folding-enabled"); cm.setOption("foldGutter", {onGutterClick: onGutterClick}); $(cm.getGutterElement()).on({ mouseenter: function () { if (prefs.getSetting("hideUntilMouseover")) { foldGutter.updateInViewport(cm); } else { $(editor.getRootElement()).addClass("over-gutter"); } }, mouseleave: function () { if (prefs.getSetting("hideUntilMouseover")) { clearGutter(editor); } else { $(editor.getRootElement()).removeClass("over-gutter"); } } }); }
javascript
function setupGutterEventListeners(editor) { var cm = editor._codeMirror; $(editor.getRootElement()).addClass("folding-enabled"); cm.setOption("foldGutter", {onGutterClick: onGutterClick}); $(cm.getGutterElement()).on({ mouseenter: function () { if (prefs.getSetting("hideUntilMouseover")) { foldGutter.updateInViewport(cm); } else { $(editor.getRootElement()).addClass("over-gutter"); } }, mouseleave: function () { if (prefs.getSetting("hideUntilMouseover")) { clearGutter(editor); } else { $(editor.getRootElement()).removeClass("over-gutter"); } } }); }
[ "function", "setupGutterEventListeners", "(", "editor", ")", "{", "var", "cm", "=", "editor", ".", "_codeMirror", ";", "$", "(", "editor", ".", "getRootElement", "(", ")", ")", ".", "addClass", "(", "\"folding-enabled\"", ")", ";", "cm", ".", "setOption", ...
Renders and sets up event listeners the code-folding gutter. @param {Editor} editor the editor on which to initialise the fold gutter
[ "Renders", "and", "sets", "up", "event", "listeners", "the", "code", "-", "folding", "gutter", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L288-L309
train
Setup event listeners for fold gutter
[ 30522, 3853, 16437, 27920, 3334, 18697, 3372, 9863, 24454, 2015, 1006, 3559, 1007, 1063, 13075, 4642, 1027, 3559, 1012, 1035, 3642, 14503, 29165, 1025, 1002, 1006, 3559, 1012, 2131, 3217, 12184, 16930, 4765, 1006, 1007, 1007, 1012, 5587, 26...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
babel/babel
packages/babel-standalone/src/index.js
loadBuiltin
function loadBuiltin(builtinTable, name) { if (isArray(name) && typeof name[0] === "string") { if (builtinTable.hasOwnProperty(name[0])) { return [builtinTable[name[0]]].concat(name.slice(1)); } return; } else if (typeof name === "string") { return builtinTable[name]; } // Could be an actual preset/plugin module return name; }
javascript
function loadBuiltin(builtinTable, name) { if (isArray(name) && typeof name[0] === "string") { if (builtinTable.hasOwnProperty(name[0])) { return [builtinTable[name[0]]].concat(name.slice(1)); } return; } else if (typeof name === "string") { return builtinTable[name]; } // Could be an actual preset/plugin module return name; }
[ "function", "loadBuiltin", "(", "builtinTable", ",", "name", ")", "{", "if", "(", "isArray", "(", "name", ")", "&&", "typeof", "name", "[", "0", "]", "===", "\"string\"", ")", "{", "if", "(", "builtinTable", ".", "hasOwnProperty", "(", "name", "[", "0"...
Loads the given name (or [name, options] pair) from the given table object holding the available presets or plugins. Returns undefined if the preset or plugin is not available; passes through name unmodified if it (or the first element of the pair) is not a string.
[ "Loads", "the", "given", "name", "(", "or", "[", "name", "options", "]", "pair", ")", "from", "the", "given", "table", "object", "holding", "the", "available", "presets", "or", "plugins", "." ]
1969e6b6aa7d90be3fbb3aca98ea96849656a55a
https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-standalone/src/index.js#L41-L52
train
Load a builtin module
[ 30522, 3853, 7170, 8569, 4014, 7629, 1006, 2328, 18447, 3085, 1010, 2171, 1007, 1063, 2065, 1006, 18061, 11335, 2100, 1006, 2171, 1007, 1004, 1004, 2828, 11253, 2171, 1031, 1014, 1033, 1027, 1027, 1027, 1000, 5164, 1000, 1007, 1063, 2065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jgraph/mxgraph
javascript/mxClient.js
function(pageCount, graph, pageFormat, border) { if (pageCount < 1) { // We can't work with less than 1 page, return no scale // change return 1; } pageFormat = (pageFormat != null) ? pageFormat : mxConstants.PAGE_FORMAT_A4_PORTRAIT; border = (border != null) ? border : 0; var availablePageWidth = pageFormat.width - (border * 2); var availablePageHeight = pageFormat.height - (border * 2); // Work out the number of pages required if the // graph is not scaled. var graphBounds = graph.getGraphBounds().clone(); var sc = graph.getView().getScale(); graphBounds.width /= sc; graphBounds.height /= sc; var graphWidth = graphBounds.width; var graphHeight = graphBounds.height; var scale = 1; // The ratio of the width/height for each printer page var pageFormatAspectRatio = availablePageWidth / availablePageHeight; // The ratio of the width/height for the graph to be printer var graphAspectRatio = graphWidth / graphHeight; // The ratio of horizontal pages / vertical pages for this // graph to maintain its aspect ratio on this page format var pagesAspectRatio = graphAspectRatio / pageFormatAspectRatio; // Factor the square root of the page count up and down // by the pages aspect ratio to obtain a horizontal and // vertical page count that adds up to the page count // and has the correct aspect ratio var pageRoot = Math.sqrt(pageCount); var pagesAspectRatioSqrt = Math.sqrt(pagesAspectRatio); var numRowPages = pageRoot * pagesAspectRatioSqrt; var numColumnPages = pageRoot / pagesAspectRatioSqrt; // These value are rarely more than 2 rounding downs away from // a total that meets the page count. In cases of one being less // than 1 page, the other value can be too high and take more iterations // In this case, just change that value to be the page count, since // we know the other value is 1 if (numRowPages < 1 && numColumnPages > pageCount) { var scaleChange = numColumnPages / pageCount; numColumnPages = pageCount; numRowPages /= scaleChange; } if (numColumnPages < 1 && numRowPages > pageCount) { var scaleChange = numRowPages / pageCount; numRowPages = pageCount; numColumnPages /= scaleChange; } var currentTotalPages = Math.ceil(numRowPages) * Math.ceil(numColumnPages); var numLoops = 0; // Iterate through while the rounded up number of pages comes to // a total greater than the required number while (currentTotalPages > pageCount) { // Round down the page count (rows or columns) that is // closest to its next integer down in percentage terms. // i.e. Reduce the page total by reducing the total // page area by the least possible amount var roundRowDownProportion = Math.floor(numRowPages) / numRowPages; var roundColumnDownProportion = Math.floor(numColumnPages) / numColumnPages; // If the round down proportion is, work out the proportion to // round down to 1 page less if (roundRowDownProportion == 1) { roundRowDownProportion = Math.floor(numRowPages-1) / numRowPages; } if (roundColumnDownProportion == 1) { roundColumnDownProportion = Math.floor(numColumnPages-1) / numColumnPages; } // Check which rounding down is smaller, but in the case of very small roundings // try the other dimension instead var scaleChange = 1; // Use the higher of the two values if (roundRowDownProportion > roundColumnDownProportion) { scaleChange = roundRowDownProportion; } else { scaleChange = roundColumnDownProportion; } numRowPages = numRowPages * scaleChange; numColumnPages = numColumnPages * scaleChange; currentTotalPages = Math.ceil(numRowPages) * Math.ceil(numColumnPages); numLoops++; if (numLoops > 10) { break; } } // Work out the scale from the number of row pages required // The column pages will give the same value var posterWidth = availablePageWidth * numRowPages; scale = posterWidth / graphWidth; // Allow for rounding errors return scale * 0.99999; }
javascript
function(pageCount, graph, pageFormat, border) { if (pageCount < 1) { // We can't work with less than 1 page, return no scale // change return 1; } pageFormat = (pageFormat != null) ? pageFormat : mxConstants.PAGE_FORMAT_A4_PORTRAIT; border = (border != null) ? border : 0; var availablePageWidth = pageFormat.width - (border * 2); var availablePageHeight = pageFormat.height - (border * 2); // Work out the number of pages required if the // graph is not scaled. var graphBounds = graph.getGraphBounds().clone(); var sc = graph.getView().getScale(); graphBounds.width /= sc; graphBounds.height /= sc; var graphWidth = graphBounds.width; var graphHeight = graphBounds.height; var scale = 1; // The ratio of the width/height for each printer page var pageFormatAspectRatio = availablePageWidth / availablePageHeight; // The ratio of the width/height for the graph to be printer var graphAspectRatio = graphWidth / graphHeight; // The ratio of horizontal pages / vertical pages for this // graph to maintain its aspect ratio on this page format var pagesAspectRatio = graphAspectRatio / pageFormatAspectRatio; // Factor the square root of the page count up and down // by the pages aspect ratio to obtain a horizontal and // vertical page count that adds up to the page count // and has the correct aspect ratio var pageRoot = Math.sqrt(pageCount); var pagesAspectRatioSqrt = Math.sqrt(pagesAspectRatio); var numRowPages = pageRoot * pagesAspectRatioSqrt; var numColumnPages = pageRoot / pagesAspectRatioSqrt; // These value are rarely more than 2 rounding downs away from // a total that meets the page count. In cases of one being less // than 1 page, the other value can be too high and take more iterations // In this case, just change that value to be the page count, since // we know the other value is 1 if (numRowPages < 1 && numColumnPages > pageCount) { var scaleChange = numColumnPages / pageCount; numColumnPages = pageCount; numRowPages /= scaleChange; } if (numColumnPages < 1 && numRowPages > pageCount) { var scaleChange = numRowPages / pageCount; numRowPages = pageCount; numColumnPages /= scaleChange; } var currentTotalPages = Math.ceil(numRowPages) * Math.ceil(numColumnPages); var numLoops = 0; // Iterate through while the rounded up number of pages comes to // a total greater than the required number while (currentTotalPages > pageCount) { // Round down the page count (rows or columns) that is // closest to its next integer down in percentage terms. // i.e. Reduce the page total by reducing the total // page area by the least possible amount var roundRowDownProportion = Math.floor(numRowPages) / numRowPages; var roundColumnDownProportion = Math.floor(numColumnPages) / numColumnPages; // If the round down proportion is, work out the proportion to // round down to 1 page less if (roundRowDownProportion == 1) { roundRowDownProportion = Math.floor(numRowPages-1) / numRowPages; } if (roundColumnDownProportion == 1) { roundColumnDownProportion = Math.floor(numColumnPages-1) / numColumnPages; } // Check which rounding down is smaller, but in the case of very small roundings // try the other dimension instead var scaleChange = 1; // Use the higher of the two values if (roundRowDownProportion > roundColumnDownProportion) { scaleChange = roundRowDownProportion; } else { scaleChange = roundColumnDownProportion; } numRowPages = numRowPages * scaleChange; numColumnPages = numColumnPages * scaleChange; currentTotalPages = Math.ceil(numRowPages) * Math.ceil(numColumnPages); numLoops++; if (numLoops > 10) { break; } } // Work out the scale from the number of row pages required // The column pages will give the same value var posterWidth = availablePageWidth * numRowPages; scale = posterWidth / graphWidth; // Allow for rounding errors return scale * 0.99999; }
[ "function", "(", "pageCount", ",", "graph", ",", "pageFormat", ",", "border", ")", "{", "if", "(", "pageCount", "<", "1", ")", "{", "// We can't work with less than 1 page, return no scale", "// change", "return", "1", ";", "}", "pageFormat", "=", "(", "pageForm...
Function: getScaleForPageCount Returns the scale to be used for printing the graph with the given bounds across the specifies number of pages with the given format. The scale is always computed such that it given the given amount or fewer pages in the print output. See <mxPrintPreview> for an example. Parameters: pageCount - Specifies the number of pages in the print output. graph - <mxGraph> that should be printed. pageFormat - Optional <mxRectangle> that specifies the page format. Default is <mxConstants.PAGE_FORMAT_A4_PORTRAIT>. border - The border along each side of every page.
[ "Function", ":", "getScaleForPageCount" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L5884-L6007
train
Calculates the number of pages required for a graph
[ 30522, 3853, 1006, 3931, 3597, 16671, 1010, 10629, 1010, 3931, 14192, 4017, 1010, 3675, 1007, 1063, 2065, 1006, 3931, 3597, 16671, 1026, 1015, 1007, 1063, 1013, 1013, 2057, 2064, 1005, 1056, 2147, 2007, 2625, 2084, 1015, 3931, 1010, 2709, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/RuleEngineOpaExtension.js
function(options) { var ruleDeferred = jQueryDOM.Deferred(), options = options[0] || {}, failOnAnyRuleIssues = options["failOnAnyIssues"], failOnHighRuleIssues = options["failOnHighIssues"], rules = options.rules, preset = options.preset, metadata = options.metadata, executionScope = options.executionScope; // private API provided by jquery.sap.global RuleAnalyzer.analyze(executionScope, rules || preset, metadata).then(function () { var analysisHistory = RuleAnalyzer.getAnalysisHistory(), lastAnalysis = { issues: [] }; if (analysisHistory.length) { lastAnalysis = analysisHistory[analysisHistory.length - 1]; } var issueSummary = lastAnalysis.issues.reduce(function (summary, issue) { summary[issue.severity.toLowerCase()] += 1; return summary; }, { high: 0, medium: 0, low: 0 }); var assertionResult = lastAnalysis.issues.length === 0; if (failOnHighRuleIssues) { assertionResult = issueSummary.high === 0; } else if (failOnAnyRuleIssues === false || failOnHighRuleIssues === false) { assertionResult = true; } if (fnShouldSkipRulesIssues()) { assertionResult = true; } ruleDeferred.resolve({ result: assertionResult, message: "Support Assistant issues found: [High: " + issueSummary.high + ", Medium: " + issueSummary.medium + ", Low: " + issueSummary.low + "]", expected: "0 high 0 medium 0 low", actual: issueSummary.high + " high " + issueSummary.medium + " medium " + issueSummary.low + " low" }); }); return ruleDeferred.promise(); }
javascript
function(options) { var ruleDeferred = jQueryDOM.Deferred(), options = options[0] || {}, failOnAnyRuleIssues = options["failOnAnyIssues"], failOnHighRuleIssues = options["failOnHighIssues"], rules = options.rules, preset = options.preset, metadata = options.metadata, executionScope = options.executionScope; // private API provided by jquery.sap.global RuleAnalyzer.analyze(executionScope, rules || preset, metadata).then(function () { var analysisHistory = RuleAnalyzer.getAnalysisHistory(), lastAnalysis = { issues: [] }; if (analysisHistory.length) { lastAnalysis = analysisHistory[analysisHistory.length - 1]; } var issueSummary = lastAnalysis.issues.reduce(function (summary, issue) { summary[issue.severity.toLowerCase()] += 1; return summary; }, { high: 0, medium: 0, low: 0 }); var assertionResult = lastAnalysis.issues.length === 0; if (failOnHighRuleIssues) { assertionResult = issueSummary.high === 0; } else if (failOnAnyRuleIssues === false || failOnHighRuleIssues === false) { assertionResult = true; } if (fnShouldSkipRulesIssues()) { assertionResult = true; } ruleDeferred.resolve({ result: assertionResult, message: "Support Assistant issues found: [High: " + issueSummary.high + ", Medium: " + issueSummary.medium + ", Low: " + issueSummary.low + "]", expected: "0 high 0 medium 0 low", actual: issueSummary.high + " high " + issueSummary.medium + " medium " + issueSummary.low + " low" }); }); return ruleDeferred.promise(); }
[ "function", "(", "options", ")", "{", "var", "ruleDeferred", "=", "jQueryDOM", ".", "Deferred", "(", ")", ",", "options", "=", "options", "[", "0", "]", "||", "{", "}", ",", "failOnAnyRuleIssues", "=", "options", "[", "\"failOnAnyIssues\"", "]", ",", "fa...
Run the Support Assistant and analyze against a specific state of the application. Depending on the options passed the assertion might either fail or not if any issues were found. If "sap-skip-rules-issues=true" is set as an URI parameter, assertion result will be always positive. @function @name sap.ui.core.support.RuleEngineOpaAssertions#noRuleFailures @param {Object} [options] The options used to configure an analysis. @param {boolean} [options.failOnAnyIssues=true] Should the test fail or not if there are issues of any severity. @param {boolean} [options.failOnHighIssues] Should the test fail or not if there are issues of high severity. This parameter will override failOnAnyIssues if set. @param {Array.<{libName:string, ruleId:string}>} [options.rules] The rules to check. @param {Object} [options.executionScope] The execution scope of the analysis. @param {Object} [options.metadata] The metadata that will be passed to the analyse method. @param {string} [options.executionScope.type=global] The type of the execution scope, one of 'global', 'subtree' or 'components'. @param {string|string[]} [options.executionScope.selectors] The IDs of the components or the subtree. @public @returns {Promise} Promise.
[ "Run", "the", "Support", "Assistant", "and", "analyze", "against", "a", "specific", "state", "of", "the", "application", ".", "Depending", "on", "the", "options", "passed", "the", "assertion", "might", "either", "fail", "or", "not", "if", "any", "issues", "w...
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/RuleEngineOpaExtension.js#L109-L156
train
Returns a promise that resolves to a rule
[ 30522, 3853, 1006, 7047, 1007, 1063, 13075, 5451, 27235, 20529, 1027, 1046, 4226, 2854, 9527, 1012, 13366, 28849, 2094, 1006, 1007, 1010, 7047, 1027, 7047, 1031, 1014, 1033, 1064, 1064, 1063, 1065, 1010, 8246, 7856, 4890, 6820, 23057, 4757,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/Manifest.js
function() { // skip loading includes once already loaded if (this._bIncludesLoaded) { return; } var mResources = this.getEntry("/sap.ui5/resources"); if (!mResources) { return; } var sComponentName = this.getComponentName(); // load JS files var aJSResources = mResources["js"]; if (aJSResources) { for (var i = 0; i < aJSResources.length; i++) { var oJSResource = aJSResources[i]; var sFile = oJSResource.uri; if (sFile) { // load javascript file var m = sFile.match(/\.js$/i); if (m) { //var sJsUrl = this.resolveUri(sFile.slice(0, m.index)); var sJsUrl = sComponentName.replace(/\./g, '/') + (sFile.slice(0, 1) === '/' ? '' : '/') + sFile.slice(0, m.index); Log.info("Component \"" + sComponentName + "\" is loading JS: \"" + sJsUrl + "\""); // call internal sap.ui.require variant that accepts a requireJS path and loads the module synchronously sap.ui.requireSync(sJsUrl); } } } } // include CSS files var aCSSResources = mResources["css"]; if (aCSSResources) { for (var j = 0; j < aCSSResources.length; j++) { var oCSSResource = aCSSResources[j]; if (oCSSResource.uri) { var sCssUrl = this.resolveUri(oCSSResource.uri); Log.info("Component \"" + sComponentName + "\" is loading CSS: \"" + sCssUrl + "\""); includeStylesheet(sCssUrl, { id: oCSSResource.id, "data-sap-ui-manifest-uid": this._uid }); } } } this._bIncludesLoaded = true; }
javascript
function() { // skip loading includes once already loaded if (this._bIncludesLoaded) { return; } var mResources = this.getEntry("/sap.ui5/resources"); if (!mResources) { return; } var sComponentName = this.getComponentName(); // load JS files var aJSResources = mResources["js"]; if (aJSResources) { for (var i = 0; i < aJSResources.length; i++) { var oJSResource = aJSResources[i]; var sFile = oJSResource.uri; if (sFile) { // load javascript file var m = sFile.match(/\.js$/i); if (m) { //var sJsUrl = this.resolveUri(sFile.slice(0, m.index)); var sJsUrl = sComponentName.replace(/\./g, '/') + (sFile.slice(0, 1) === '/' ? '' : '/') + sFile.slice(0, m.index); Log.info("Component \"" + sComponentName + "\" is loading JS: \"" + sJsUrl + "\""); // call internal sap.ui.require variant that accepts a requireJS path and loads the module synchronously sap.ui.requireSync(sJsUrl); } } } } // include CSS files var aCSSResources = mResources["css"]; if (aCSSResources) { for (var j = 0; j < aCSSResources.length; j++) { var oCSSResource = aCSSResources[j]; if (oCSSResource.uri) { var sCssUrl = this.resolveUri(oCSSResource.uri); Log.info("Component \"" + sComponentName + "\" is loading CSS: \"" + sCssUrl + "\""); includeStylesheet(sCssUrl, { id: oCSSResource.id, "data-sap-ui-manifest-uid": this._uid }); } } } this._bIncludesLoaded = true; }
[ "function", "(", ")", "{", "// skip loading includes once already loaded", "if", "(", "this", ".", "_bIncludesLoaded", ")", "{", "return", ";", "}", "var", "mResources", "=", "this", ".", "getEntry", "(", "\"/sap.ui5/resources\"", ")", ";", "if", "(", "!", "mR...
Loads the included CSS and JavaScript resources. The resources will be resolved relative to the component location. @private
[ "Loads", "the", "included", "CSS", "and", "JavaScript", "resources", ".", "The", "resources", "will", "be", "resolved", "relative", "to", "the", "component", "location", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Manifest.js#L397-L450
train
Loads all includes from the component s resources
[ 30522, 3853, 1006, 1007, 1063, 1013, 1013, 13558, 10578, 2950, 2320, 2525, 8209, 2065, 1006, 2023, 1012, 1035, 8026, 20464, 22087, 17468, 1007, 1063, 2709, 1025, 1065, 13075, 2720, 2229, 8162, 9623, 1027, 2023, 1012, 2131, 4765, 2854, 1006,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/preferences/PreferencesBase.js
function (id, type, initial, options) { options = options || {}; if (this._knownPrefs.hasOwnProperty(id)) { throw new Error("Preference " + id + " was redefined"); } var pref = this._knownPrefs[id] = new Preference({ type: type, initial: initial, name: options.name, description: options.description, validator: options.validator, excludeFromHints: options.excludeFromHints, keys: options.keys, values: options.values, valueType: options.valueType }); this.set(id, initial, { location: { scope: "default" } }); return pref; }
javascript
function (id, type, initial, options) { options = options || {}; if (this._knownPrefs.hasOwnProperty(id)) { throw new Error("Preference " + id + " was redefined"); } var pref = this._knownPrefs[id] = new Preference({ type: type, initial: initial, name: options.name, description: options.description, validator: options.validator, excludeFromHints: options.excludeFromHints, keys: options.keys, values: options.values, valueType: options.valueType }); this.set(id, initial, { location: { scope: "default" } }); return pref; }
[ "function", "(", "id", ",", "type", ",", "initial", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "if", "(", "this", ".", "_knownPrefs", ".", "hasOwnProperty", "(", "id", ")", ")", "{", "throw", "new", "Error", "(", "\"P...
Defines a new preference. @param {string} id identifier of the preference. Generally a dotted name. @param {string} type Data type for the preference (generally, string, boolean, number) @param {Object} initial Default value for the preference @param {?{name: string=, description: string=, validator: function=, excludeFromHints: boolean=, keys: object=, values: array=, valueType: string=}} options Additional options for the pref. - `options.name` Name of the preference that can be used in the UI. - `options.description` A description of the preference. - `options.validator` A function to validate the value of a preference. - `options.excludeFromHints` True if you want to exclude a preference from code hints. - `options.keys` An object that will hold the child preferences in case the preference type is `object` - `options.values` An array of possible values of a preference. It will show up in code hints. - `options.valueType` In case the preference type is `array`, `valueType` should hold data type of its elements. @return {Object} The preference object.
[ "Defines", "a", "new", "preference", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1311-L1333
train
Create a new preference
[ 30522, 3853, 1006, 8909, 1010, 2828, 1010, 3988, 1010, 7047, 1007, 1063, 7047, 1027, 7047, 1064, 1064, 1063, 1065, 1025, 30524, 10343, 1012, 2038, 12384, 21572, 4842, 3723, 1006, 8909, 1007, 1007, 1063, 5466, 2047, 7561, 1006, 1000, 12157, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/filesystem/impls/appshell/AppshellFileSystem.js
initWatchers
function initWatchers(changeCallback, offlineCallback) { _changeCallback = changeCallback; _offlineCallback = offlineCallback; if (_isRunningOnWindowsXP && _offlineCallback) { _offlineCallback(); } }
javascript
function initWatchers(changeCallback, offlineCallback) { _changeCallback = changeCallback; _offlineCallback = offlineCallback; if (_isRunningOnWindowsXP && _offlineCallback) { _offlineCallback(); } }
[ "function", "initWatchers", "(", "changeCallback", ",", "offlineCallback", ")", "{", "_changeCallback", "=", "changeCallback", ";", "_offlineCallback", "=", "offlineCallback", ";", "if", "(", "_isRunningOnWindowsXP", "&&", "_offlineCallback", ")", "{", "_offlineCallback...
Initialize file watching for this filesystem, using the supplied changeCallback to provide change notifications. The first parameter of changeCallback specifies the changed path (either a file or a directory); if this parameter is null, it indicates that the implementation cannot specify a particular changed path, and so the callers should consider all paths to have changed and to update their state accordingly. The second parameter to changeCallback is an optional FileSystemStats object that may be provided in case the changed path already exists and stats are readily available. The offlineCallback will be called in case watchers are no longer expected to function properly. All watched paths are cleared when the offlineCallback is called. @param {function(?string, FileSystemStats=)} changeCallback @param {function()=} offlineCallback
[ "Initialize", "file", "watching", "for", "this", "filesystem", "using", "the", "supplied", "changeCallback", "to", "provide", "change", "notifications", ".", "The", "first", "parameter", "of", "changeCallback", "specifies", "the", "changed", "path", "(", "either", ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L506-L513
train
Initialize the watchers
[ 30522, 3853, 1999, 4183, 18866, 2545, 1006, 2689, 9289, 20850, 8684, 1010, 2125, 4179, 9289, 20850, 8684, 1007, 1063, 1035, 2689, 9289, 20850, 8684, 1027, 2689, 9289, 20850, 8684, 1025, 1035, 2125, 4179, 9289, 20850, 8684, 1027, 2125, 4179,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-echarts
src/coord/parallel/Parallel.js
function (parallelModel, ecModel, api) { var dimensions = parallelModel.dimensions; var parallelAxisIndex = parallelModel.parallelAxisIndex; each(dimensions, function (dim, idx) { var axisIndex = parallelAxisIndex[idx]; var axisModel = ecModel.getComponent('parallelAxis', axisIndex); var axis = this._axesMap.set(dim, new ParallelAxis( dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex )); var isCategory = axis.type === 'category'; axis.onBand = isCategory && axisModel.get('boundaryGap'); axis.inverse = axisModel.get('inverse'); // Injection axisModel.axis = axis; axis.model = axisModel; axis.coordinateSystem = axisModel.coordinateSystem = this; }, this); }
javascript
function (parallelModel, ecModel, api) { var dimensions = parallelModel.dimensions; var parallelAxisIndex = parallelModel.parallelAxisIndex; each(dimensions, function (dim, idx) { var axisIndex = parallelAxisIndex[idx]; var axisModel = ecModel.getComponent('parallelAxis', axisIndex); var axis = this._axesMap.set(dim, new ParallelAxis( dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex )); var isCategory = axis.type === 'category'; axis.onBand = isCategory && axisModel.get('boundaryGap'); axis.inverse = axisModel.get('inverse'); // Injection axisModel.axis = axis; axis.model = axisModel; axis.coordinateSystem = axisModel.coordinateSystem = this; }, this); }
[ "function", "(", "parallelModel", ",", "ecModel", ",", "api", ")", "{", "var", "dimensions", "=", "parallelModel", ".", "dimensions", ";", "var", "parallelAxisIndex", "=", "parallelModel", ".", "parallelAxisIndex", ";", "each", "(", "dimensions", ",", "function"...
Initialize cartesian coordinate systems @private
[ "Initialize", "cartesian", "coordinate", "systems" ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/parallel/Parallel.js#L90-L118
train
Initialize the series model
[ 30522, 3853, 1006, 5903, 5302, 9247, 1010, 14925, 5302, 9247, 1010, 17928, 1007, 1063, 13075, 9646, 1027, 5903, 5302, 9247, 1012, 9646, 1025, 13075, 5903, 8528, 17417, 13629, 2595, 1027, 5903, 5302, 9247, 1012, 5903, 8528, 17417, 13629, 259...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SheetJS/js-xlsx
demos/altjs/nashorn.js
b2a
function b2a(b) { var out = new Array(b.length); for(var i = 0; i < out.length; i++) out[i] = (b[i] < 0 ? b[i] + 256 : b[i]); return out; }
javascript
function b2a(b) { var out = new Array(b.length); for(var i = 0; i < out.length; i++) out[i] = (b[i] < 0 ? b[i] + 256 : b[i]); return out; }
[ "function", "b2a", "(", "b", ")", "{", "var", "out", "=", "new", "Array", "(", "b", ".", "length", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "out", ".", "length", ";", "i", "++", ")", "out", "[", "i", "]", "=", "(", "b", ...
/* helper to convert byte array to plain JS array
[ "/", "*", "helper", "to", "convert", "byte", "array", "to", "plain", "JS", "array" ]
9a6d8a1d3d80c78dad5201fb389316f935279cdc
https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/demos/altjs/nashorn.js#L9-L13
train
Convert a byte array to a byte array
[ 30522, 3853, 1038, 2475, 2050, 1006, 1038, 1007, 1063, 13075, 2041, 1027, 2047, 9140, 1006, 1038, 1012, 3091, 1007, 1025, 2005, 1006, 13075, 1045, 1027, 1014, 1025, 1045, 1026, 2041, 1012, 3091, 1025, 1045, 1009, 1009, 1007, 2041, 1031, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/project/FileSyncManager.js
syncOpenDocuments
function syncOpenDocuments(title) { title = title || Strings.EXT_MODIFIED_TITLE; // We can become "re-entrant" if the user leaves & then returns to Brackets before we're // done -- easy if a prompt dialog is left open. Since the user may have left Brackets to // revert some of the disk changes, etc. we want to cancel the current sync and immediately // begin a new one. We let the orig sync run until the user-visible dialog phase, then // bail; if we're already there we programmatically close the dialog to bail right away. if (_alreadyChecking) { _restartPending = true; // Close dialog if it was open. This will 'unblock' presentConflict(), which bails back // to us immediately upon seeing _restartPending. We then restart the sync - see below Dialogs.cancelModalDialogIfOpen(DefaultDialogs.DIALOG_ID_EXT_CHANGED); Dialogs.cancelModalDialogIfOpen(DefaultDialogs.DIALOG_ID_EXT_DELETED); return; } _alreadyChecking = true; // Syncing proceeds in four phases: // 1) Check all open files for external modifications // 2) Check any other working set entries (that are not open) for deletion, and remove // from working set if deleted // 3) Refresh all Documents that are clean (if file changed on disk) // 4) Close all Documents that are clean (if file deleted on disk) // 5) Prompt about any Documents that are dirty (if file changed/deleted on disk) // Each phase fully completes (asynchronously) before the next one begins. // 1) Check for external modifications var allDocs = DocumentManager.getAllOpenDocuments(); findExternalChanges(allDocs) .done(function () { // 2) Check un-open working set entries for deletion (& "close" if needed) syncUnopenWorkingSet() .always(function () { // If we were unable to check any un-open files for deletion, silently ignore // (after logging to console). This doesn't have any bearing on syncing truly // open Documents (which we've already successfully checked). // 3) Reload clean docs as needed reloadChangedDocs() .always(function () { // 4) Close clean docs as needed // This phase completes synchronously closeDeletedDocs(); // 5) Prompt for dirty editors (conflicts) presentConflicts(title) .always(function () { if (_restartPending) { // Restart the sync if needed _restartPending = false; _alreadyChecking = false; syncOpenDocuments(); } else { // We're really done! _alreadyChecking = false; // If we showed a dialog, restore focus to editor if (editConflicts.length > 0 || deleteConflicts.length > 0) { MainViewManager.focusActivePane(); } // (Any errors that ocurred during presentConflicts() have already // shown UI & been dismissed, so there's no fail() handler here) } }); }); // Note: if any auto-reloads failed, we silently ignore (after logging to console) // and we still continue onto phase 4 and try to process those files anyway. // (We'll retry the auto-reloads next time window is activated... and evenually // we'll also be double checking before each Save). }); }).fail(function () { // Unable to fetch timestamps for some reason - silently ignore (after logging to console) // (We'll retry next time window is activated... and evenually we'll also be double // checking before each Save). // We can't go on without knowing which files are dirty, so bail now _alreadyChecking = false; }); }
javascript
function syncOpenDocuments(title) { title = title || Strings.EXT_MODIFIED_TITLE; // We can become "re-entrant" if the user leaves & then returns to Brackets before we're // done -- easy if a prompt dialog is left open. Since the user may have left Brackets to // revert some of the disk changes, etc. we want to cancel the current sync and immediately // begin a new one. We let the orig sync run until the user-visible dialog phase, then // bail; if we're already there we programmatically close the dialog to bail right away. if (_alreadyChecking) { _restartPending = true; // Close dialog if it was open. This will 'unblock' presentConflict(), which bails back // to us immediately upon seeing _restartPending. We then restart the sync - see below Dialogs.cancelModalDialogIfOpen(DefaultDialogs.DIALOG_ID_EXT_CHANGED); Dialogs.cancelModalDialogIfOpen(DefaultDialogs.DIALOG_ID_EXT_DELETED); return; } _alreadyChecking = true; // Syncing proceeds in four phases: // 1) Check all open files for external modifications // 2) Check any other working set entries (that are not open) for deletion, and remove // from working set if deleted // 3) Refresh all Documents that are clean (if file changed on disk) // 4) Close all Documents that are clean (if file deleted on disk) // 5) Prompt about any Documents that are dirty (if file changed/deleted on disk) // Each phase fully completes (asynchronously) before the next one begins. // 1) Check for external modifications var allDocs = DocumentManager.getAllOpenDocuments(); findExternalChanges(allDocs) .done(function () { // 2) Check un-open working set entries for deletion (& "close" if needed) syncUnopenWorkingSet() .always(function () { // If we were unable to check any un-open files for deletion, silently ignore // (after logging to console). This doesn't have any bearing on syncing truly // open Documents (which we've already successfully checked). // 3) Reload clean docs as needed reloadChangedDocs() .always(function () { // 4) Close clean docs as needed // This phase completes synchronously closeDeletedDocs(); // 5) Prompt for dirty editors (conflicts) presentConflicts(title) .always(function () { if (_restartPending) { // Restart the sync if needed _restartPending = false; _alreadyChecking = false; syncOpenDocuments(); } else { // We're really done! _alreadyChecking = false; // If we showed a dialog, restore focus to editor if (editConflicts.length > 0 || deleteConflicts.length > 0) { MainViewManager.focusActivePane(); } // (Any errors that ocurred during presentConflicts() have already // shown UI & been dismissed, so there's no fail() handler here) } }); }); // Note: if any auto-reloads failed, we silently ignore (after logging to console) // and we still continue onto phase 4 and try to process those files anyway. // (We'll retry the auto-reloads next time window is activated... and evenually // we'll also be double checking before each Save). }); }).fail(function () { // Unable to fetch timestamps for some reason - silently ignore (after logging to console) // (We'll retry next time window is activated... and evenually we'll also be double // checking before each Save). // We can't go on without knowing which files are dirty, so bail now _alreadyChecking = false; }); }
[ "function", "syncOpenDocuments", "(", "title", ")", "{", "title", "=", "title", "||", "Strings", ".", "EXT_MODIFIED_TITLE", ";", "// We can become \"re-entrant\" if the user leaves & then returns to Brackets before we're", "// done -- easy if a prompt dialog is left open. Since the use...
Check to see whether any open files have been modified by an external app since the last time Brackets synced up with the copy on disk (either by loading or saving the file). For clean files, we silently upate the editor automatically. For files with unsaved changes, we prompt the user. @param {string} title Title to use for document. Default is "External Changes".
[ "Check", "to", "see", "whether", "any", "open", "files", "have", "been", "modified", "by", "an", "external", "app", "since", "the", "last", "time", "Brackets", "synced", "up", "with", "the", "copy", "on", "disk", "(", "either", "by", "loading", "or", "sa...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileSyncManager.js#L404-L492
train
Syncs all open files for modifications
[ 30522, 3853, 26351, 26915, 3527, 24894, 11187, 1006, 2516, 1007, 1063, 2516, 1027, 2516, 1064, 1064, 7817, 1012, 4654, 2102, 1035, 6310, 1035, 2516, 1025, 1013, 1013, 2057, 2064, 2468, 1000, 2128, 1011, 4372, 6494, 3372, 1000, 2065, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Dogfalo/materialize
extras/noUiSlider/nouislider.js
getClosestHandle
function getClosestHandle ( proposal ) { var closest = 100; var handleNumber = false; scope_Handles.forEach(function(handle, index){ // Disabled handles are ignored if ( handle.hasAttribute('disabled') ) { return; } var pos = Math.abs(scope_Locations[index] - proposal); if ( pos < closest ) { handleNumber = index; closest = pos; } }); return handleNumber; }
javascript
function getClosestHandle ( proposal ) { var closest = 100; var handleNumber = false; scope_Handles.forEach(function(handle, index){ // Disabled handles are ignored if ( handle.hasAttribute('disabled') ) { return; } var pos = Math.abs(scope_Locations[index] - proposal); if ( pos < closest ) { handleNumber = index; closest = pos; } }); return handleNumber; }
[ "function", "getClosestHandle", "(", "proposal", ")", "{", "var", "closest", "=", "100", ";", "var", "handleNumber", "=", "false", ";", "scope_Handles", ".", "forEach", "(", "function", "(", "handle", ",", "index", ")", "{", "// Disabled handles are ignored", ...
Find handle closest to a certain percentage on the slider
[ "Find", "handle", "closest", "to", "a", "certain", "percentage", "on", "the", "slider" ]
1122efadad8f1433d404696f7613e3cc13fb83a4
https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L1367-L1388
train
Get closest handle to proposal
[ 30522, 3853, 2131, 20464, 27465, 21604, 10362, 1006, 6378, 1007, 1063, 13075, 7541, 1027, 2531, 1025, 13075, 5047, 19172, 5677, 1027, 6270, 1025, 9531, 1035, 16024, 1012, 18921, 6776, 1006, 3853, 1006, 5047, 1010, 5950, 1007, 1063, 1013, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/base/syncXHRFix.js
wrapTimerHandler
function wrapTimerHandler(vHandler) { var fnWrappedHandler = function() { var aArgs, fnHandler; if (bPromisesQueued) { aArgs = [fnWrappedHandler, 0].concat(arguments); _timeout.apply(window, aArgs); } else { fnHandler = typeof vHandler !== "function" ? new Function(vHandler) : vHandler; // eslint-disable-line no-new-func fnHandler.apply(window, arguments); } }; return fnWrappedHandler; }
javascript
function wrapTimerHandler(vHandler) { var fnWrappedHandler = function() { var aArgs, fnHandler; if (bPromisesQueued) { aArgs = [fnWrappedHandler, 0].concat(arguments); _timeout.apply(window, aArgs); } else { fnHandler = typeof vHandler !== "function" ? new Function(vHandler) : vHandler; // eslint-disable-line no-new-func fnHandler.apply(window, arguments); } }; return fnWrappedHandler; }
[ "function", "wrapTimerHandler", "(", "vHandler", ")", "{", "var", "fnWrappedHandler", "=", "function", "(", ")", "{", "var", "aArgs", ",", "fnHandler", ";", "if", "(", "bPromisesQueued", ")", "{", "aArgs", "=", "[", "fnWrappedHandler", ",", "0", "]", ".", ...
If there are promise handlers waiting for execution at the time the timeout fires, start another timeout to postpone timer execution after promise execution.
[ "If", "there", "are", "promise", "handlers", "waiting", "for", "execution", "at", "the", "time", "the", "timeout", "fires", "start", "another", "timeout", "to", "postpone", "timer", "execution", "after", "promise", "execution", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/syncXHRFix.js#L94-L106
train
wrap timer handler
[ 30522, 3853, 10236, 7292, 25032, 5685, 3917, 1006, 1058, 11774, 3917, 1007, 1063, 13075, 1042, 2078, 13088, 29098, 2098, 11774, 3917, 1027, 3853, 1006, 1007, 1063, 13075, 9779, 10623, 2015, 1010, 1042, 25311, 5685, 3917, 1025, 2065, 1006, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
google/material-design-icons
gulpfile.babel.js
generateIjmap
function generateIjmap(ijmapPath) { return through2.obj((codepointsFile, encoding, callback) => { const ijmap = { icons: codepointsToIjmap(codepointsFile.contents.toString()) }; callback(null, new File({ path: ijmapPath, contents: new Buffer(JSON.stringify(ijmap), 'utf8') })); function codepointsToIjmap(codepoints) { return _(codepoints) .split('\n') // split into lines .reject(_.isEmpty) // remove empty lines .reduce((codepointMap, line) => { // build up the codepoint map let [ name, codepoint ] = line.split(' '); codepointMap[codepoint] = { name: titleize(humanize(name)) }; return codepointMap; }, {}); } }); }
javascript
function generateIjmap(ijmapPath) { return through2.obj((codepointsFile, encoding, callback) => { const ijmap = { icons: codepointsToIjmap(codepointsFile.contents.toString()) }; callback(null, new File({ path: ijmapPath, contents: new Buffer(JSON.stringify(ijmap), 'utf8') })); function codepointsToIjmap(codepoints) { return _(codepoints) .split('\n') // split into lines .reject(_.isEmpty) // remove empty lines .reduce((codepointMap, line) => { // build up the codepoint map let [ name, codepoint ] = line.split(' '); codepointMap[codepoint] = { name: titleize(humanize(name)) }; return codepointMap; }, {}); } }); }
[ "function", "generateIjmap", "(", "ijmapPath", ")", "{", "return", "through2", ".", "obj", "(", "(", "codepointsFile", ",", "encoding", ",", "callback", ")", "=>", "{", "const", "ijmap", "=", "{", "icons", ":", "codepointsToIjmap", "(", "codepointsFile", "."...
Returns a stream that transforms between our icon font's codepoint file and an Iconjar ijmap.
[ "Returns", "a", "stream", "that", "transforms", "between", "our", "icon", "font", "s", "codepoint", "file", "and", "an", "Iconjar", "ijmap", "." ]
224895a86501195e7a7ff3dde18e39f00b8e3d5a
https://github.com/google/material-design-icons/blob/224895a86501195e7a7ff3dde18e39f00b8e3d5a/gulpfile.babel.js#L94-L116
train
Generate an ijmap file
[ 30522, 3853, 9699, 28418, 2863, 2361, 1006, 1045, 24703, 29098, 8988, 1007, 1063, 2709, 2083, 2475, 1012, 27885, 3501, 1006, 1006, 3642, 26521, 8873, 30524, 26521, 3406, 28418, 2863, 2361, 1006, 3642, 26521, 8873, 2571, 1012, 8417, 1012, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js
_findODataProperty
function _findODataProperty(aBindingPaths, aODataProperties) { return aODataProperties.filter(function (oDataProperty) { return aBindingPaths.indexOf(oDataProperty.bindingPath) !== -1; }).pop(); }
javascript
function _findODataProperty(aBindingPaths, aODataProperties) { return aODataProperties.filter(function (oDataProperty) { return aBindingPaths.indexOf(oDataProperty.bindingPath) !== -1; }).pop(); }
[ "function", "_findODataProperty", "(", "aBindingPaths", ",", "aODataProperties", ")", "{", "return", "aODataProperties", ".", "filter", "(", "function", "(", "oDataProperty", ")", "{", "return", "aBindingPaths", ".", "indexOf", "(", "oDataProperty", ".", "bindingPat...
Looks for a ODataProperty for a set of bindings paths @param {Array.<String>} aBindingPaths - Array of collected binding paths @param {Array.<Object>} aODataProperties - Array of Fields @return {Object|undefined} - returns first found Object with Field (Property) description, undefined if not found @private
[ "Looks", "for", "a", "ODataProperty", "for", "a", "set", "of", "bindings", "paths" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js#L356-L360
train
Find the last OData property in the array of OData properties
[ 30522, 3853, 1035, 2424, 13390, 2696, 21572, 4842, 3723, 1006, 11113, 22254, 2075, 15069, 2015, 1010, 20118, 2850, 2696, 21572, 4842, 7368, 1007, 1063, 2709, 20118, 2850, 2696, 21572, 4842, 7368, 1012, 11307, 1006, 3853, 1006, 1051, 2850, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/file/FileUtils.js
getRelativeFilename
function getRelativeFilename(basePath, filename) { if (!filename || filename.substr(0, basePath.length) !== basePath) { return; } return filename.substr(basePath.length); }
javascript
function getRelativeFilename(basePath, filename) { if (!filename || filename.substr(0, basePath.length) !== basePath) { return; } return filename.substr(basePath.length); }
[ "function", "getRelativeFilename", "(", "basePath", ",", "filename", ")", "{", "if", "(", "!", "filename", "||", "filename", ".", "substr", "(", "0", ",", "basePath", ".", "length", ")", "!==", "basePath", ")", "{", "return", ";", "}", "return", "filenam...
Computes filename as relative to the basePath. For example: basePath: /foo/bar/, filename: /foo/bar/baz.txt returns: baz.txt The net effect is that the common prefix is stripped away. If basePath is not a prefix of filename, then undefined is returned. @param {string} basePath Path against which we're computing the relative path @param {string} filename Full path to the file for which we are computing a relative path @return {string} relative path
[ "Computes", "filename", "as", "relative", "to", "the", "basePath", ".", "For", "example", ":", "basePath", ":", "/", "foo", "/", "bar", "/", "filename", ":", "/", "foo", "/", "bar", "/", "baz", ".", "txt", "returns", ":", "baz", ".", "txt" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L380-L386
train
Get the relative filename of a file
[ 30522, 3853, 2131, 16570, 8082, 8873, 20844, 4168, 1006, 2918, 15069, 1010, 5371, 18442, 1007, 1063, 2065, 1006, 999, 5371, 18442, 1064, 1064, 5371, 18442, 1012, 4942, 3367, 2099, 1006, 1014, 1010, 2918, 15069, 1012, 3091, 1007, 999, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/AutoUpdate/main.js
checkUpdateStatus
function checkUpdateStatus() { var filesToCache = ['.logs'], downloadCompleted = updateJsonHandler.get("downloadCompleted"), updateInitiatedInPrevSession = updateJsonHandler.get("updateInitiatedInPrevSession"); if (downloadCompleted && updateInitiatedInPrevSession) { var isNewVersion = checkIfVersionUpdated(); updateJsonHandler.reset(); if (isNewVersion) { // We get here if the update was successful UpdateInfoBar.showUpdateBar({ type: "success", title: Strings.UPDATE_SUCCESSFUL, description: "" }); HealthLogger.sendAnalyticsData( autoUpdateEventNames.AUTOUPDATE_INSTALLATION_SUCCESS, "autoUpdate", "install", "complete", "" ); } else { // We get here if the update started but failed checkInstallationStatus(); UpdateInfoBar.showUpdateBar({ type: "error", title: Strings.UPDATE_FAILED, description: Strings.GO_TO_SITE }); } } else if (downloadCompleted && !updateInitiatedInPrevSession) { // We get here if the download was complete and user selected UpdateLater if (brackets.platform === "mac") { filesToCache = ['.dmg', '.json']; } else if (brackets.platform === "win") { filesToCache = ['.msi', '.json']; } } postMessageToNode(MessageIds.PERFORM_CLEANUP, filesToCache); }
javascript
function checkUpdateStatus() { var filesToCache = ['.logs'], downloadCompleted = updateJsonHandler.get("downloadCompleted"), updateInitiatedInPrevSession = updateJsonHandler.get("updateInitiatedInPrevSession"); if (downloadCompleted && updateInitiatedInPrevSession) { var isNewVersion = checkIfVersionUpdated(); updateJsonHandler.reset(); if (isNewVersion) { // We get here if the update was successful UpdateInfoBar.showUpdateBar({ type: "success", title: Strings.UPDATE_SUCCESSFUL, description: "" }); HealthLogger.sendAnalyticsData( autoUpdateEventNames.AUTOUPDATE_INSTALLATION_SUCCESS, "autoUpdate", "install", "complete", "" ); } else { // We get here if the update started but failed checkInstallationStatus(); UpdateInfoBar.showUpdateBar({ type: "error", title: Strings.UPDATE_FAILED, description: Strings.GO_TO_SITE }); } } else if (downloadCompleted && !updateInitiatedInPrevSession) { // We get here if the download was complete and user selected UpdateLater if (brackets.platform === "mac") { filesToCache = ['.dmg', '.json']; } else if (brackets.platform === "win") { filesToCache = ['.msi', '.json']; } } postMessageToNode(MessageIds.PERFORM_CLEANUP, filesToCache); }
[ "function", "checkUpdateStatus", "(", ")", "{", "var", "filesToCache", "=", "[", "'.logs'", "]", ",", "downloadCompleted", "=", "updateJsonHandler", ".", "get", "(", "\"downloadCompleted\"", ")", ",", "updateInitiatedInPrevSession", "=", "updateJsonHandler", ".", "g...
Checks and handles the update success and failure scenarios
[ "Checks", "and", "handles", "the", "update", "success", "and", "failure", "scenarios" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L219-L260
train
Check update status
[ 30522, 3853, 4638, 6279, 27122, 30524, 1005, 1012, 15664, 1005, 1033, 1010, 8816, 9006, 10814, 3064, 1027, 10651, 22578, 2239, 11774, 3917, 1012, 2131, 1006, 1000, 8816, 9006, 10814, 3064, 1000, 1007, 1010, 10651, 5498, 10711, 3064, 2378, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/project/WorkingSetView.js
createWorkingSetViewForPane
function createWorkingSetViewForPane($container, paneId) { var view = _views[paneId]; if (!view) { view = new WorkingSetView($container, paneId); _views[view.paneId] = view; } }
javascript
function createWorkingSetViewForPane($container, paneId) { var view = _views[paneId]; if (!view) { view = new WorkingSetView($container, paneId); _views[view.paneId] = view; } }
[ "function", "createWorkingSetViewForPane", "(", "$container", ",", "paneId", ")", "{", "var", "view", "=", "_views", "[", "paneId", "]", ";", "if", "(", "!", "view", ")", "{", "view", "=", "new", "WorkingSetView", "(", "$container", ",", "paneId", ")", "...
Creates a new WorkingSetView object for the specified pane @param {!jQuery} $container - the WorkingSetView's DOM parent node @param {!string} paneId - the id of the pane the view is being created for
[ "Creates", "a", "new", "WorkingSetView", "object", "for", "the", "specified", "pane" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L1427-L1433
train
Creates a WorkingSetView for the given paneId
[ 30522, 3853, 3443, 21398, 13462, 8584, 29278, 9739, 2063, 1006, 1002, 11661, 1010, 6090, 7416, 2094, 1007, 1063, 13075, 3193, 1027, 1035, 5328, 1031, 6090, 7416, 2094, 1033, 1025, 2065, 1006, 999, 3193, 1007, 1063, 3193, 1027, 2047, 24884, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/InlineTimingFunctionEditor/main.js
init
function init() { // Load our stylesheet ExtensionUtils.loadStyleSheet(module, "main.less"); ExtensionUtils.addEmbeddedStyleSheet(Mustache.render(Localized, Strings)); EditorManager.registerInlineEditProvider(inlineTimingFunctionEditorProvider); }
javascript
function init() { // Load our stylesheet ExtensionUtils.loadStyleSheet(module, "main.less"); ExtensionUtils.addEmbeddedStyleSheet(Mustache.render(Localized, Strings)); EditorManager.registerInlineEditProvider(inlineTimingFunctionEditorProvider); }
[ "function", "init", "(", ")", "{", "// Load our stylesheet", "ExtensionUtils", ".", "loadStyleSheet", "(", "module", ",", "\"main.less\"", ")", ";", "ExtensionUtils", ".", "addEmbeddedStyleSheet", "(", "Mustache", ".", "render", "(", "Localized", ",", "Strings", "...
Initialization code
[ "Initialization", "code" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/main.js#L154-L160
train
Initialize the plugin
[ 30522, 3853, 1999, 4183, 1006, 1007, 1063, 1013, 1013, 7170, 2256, 6782, 21030, 2102, 5331, 21823, 4877, 1012, 15665, 27983, 4095, 15558, 1006, 11336, 1010, 1000, 2364, 1012, 2625, 1000, 1007, 1025, 5331, 21823, 4877, 1012, 5587, 6633, 8270...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
catapult-project/catapult
netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js
parseQueryParams
function parseQueryParams(location) { var params = {}; var query = unescape(location.search.substring(1)); var vars = query.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); params[pair[0]] = pair[1]; } return params; }
javascript
function parseQueryParams(location) { var params = {}; var query = unescape(location.search.substring(1)); var vars = query.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); params[pair[0]] = pair[1]; } return params; }
[ "function", "parseQueryParams", "(", "location", ")", "{", "var", "params", "=", "{", "}", ";", "var", "query", "=", "unescape", "(", "location", ".", "search", ".", "substring", "(", "1", ")", ")", ";", "var", "vars", "=", "query", ".", "split", "("...
Parses query parameters from Location. @param {Location} location The URL to generate the CSS url for. @return {Object} Dictionary containing name value pairs for URL
[ "Parses", "query", "parameters", "from", "Location", "." ]
992929ffccac68827869a497f01ee4d653ed4f25
https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L72-L81
train
Parse the query string
[ 30522, 3853, 11968, 3366, 4226, 2854, 28689, 5244, 1006, 3295, 1007, 1063, 13075, 11498, 5244, 1027, 1063, 1065, 1025, 13075, 23032, 1027, 16655, 15782, 5051, 1006, 3295, 1012, 3945, 1012, 4942, 3367, 4892, 1006, 1015, 1007, 1007, 1025, 130...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
summernote/summernote
src/js/base/core/dom.js
replace
function replace(node, nodeName) { if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) { return node; } const newNode = create(nodeName); if (node.style.cssText) { newNode.style.cssText = node.style.cssText; } appendChildNodes(newNode, lists.from(node.childNodes)); insertAfter(newNode, node); remove(node); return newNode; }
javascript
function replace(node, nodeName) { if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) { return node; } const newNode = create(nodeName); if (node.style.cssText) { newNode.style.cssText = node.style.cssText; } appendChildNodes(newNode, lists.from(node.childNodes)); insertAfter(newNode, node); remove(node); return newNode; }
[ "function", "replace", "(", "node", ",", "nodeName", ")", "{", "if", "(", "node", ".", "nodeName", ".", "toUpperCase", "(", ")", "===", "nodeName", ".", "toUpperCase", "(", ")", ")", "{", "return", "node", ";", "}", "const", "newNode", "=", "create", ...
@method replace replace node with provided nodeName @param {Node} node @param {String} nodeName @return {Node} - new node
[ "@method", "replace" ]
8dcafb8107453006b905ef697a529c42e76beb3f
https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L921-L937
train
Replace node with nodeName
[ 30522, 3853, 5672, 1006, 13045, 1010, 13045, 18442, 1007, 1063, 2065, 1006, 13045, 1012, 13045, 18442, 1012, 2000, 29547, 18992, 3366, 1006, 1007, 1027, 1027, 1027, 13045, 18442, 1012, 2000, 29547, 18992, 3366, 1006, 1007, 1007, 1063, 2709, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/object-shorthand.js
checkConsistency
function checkConsistency(node, checkRedundancy) { // We are excluding getters/setters and spread properties as they are considered neither longform nor shorthand. const properties = node.properties.filter(canHaveShorthand); // Do we still have properties left after filtering the getters and setters? if (properties.length > 0) { const shorthandProperties = properties.filter(isShorthand); /* * If we do not have an equal number of longform properties as * shorthand properties, we are using the annotations inconsistently */ if (shorthandProperties.length !== properties.length) { // We have at least 1 shorthand property if (shorthandProperties.length > 0) { context.report({ node, message: "Unexpected mix of shorthand and non-shorthand properties." }); } else if (checkRedundancy) { /* * If all properties of the object contain a method or value with a name matching it's key, * all the keys are redundant. */ const canAlwaysUseShorthand = properties.every(isRedundant); if (canAlwaysUseShorthand) { context.report({ node, message: "Expected shorthand for all properties." }); } } } } }
javascript
function checkConsistency(node, checkRedundancy) { // We are excluding getters/setters and spread properties as they are considered neither longform nor shorthand. const properties = node.properties.filter(canHaveShorthand); // Do we still have properties left after filtering the getters and setters? if (properties.length > 0) { const shorthandProperties = properties.filter(isShorthand); /* * If we do not have an equal number of longform properties as * shorthand properties, we are using the annotations inconsistently */ if (shorthandProperties.length !== properties.length) { // We have at least 1 shorthand property if (shorthandProperties.length > 0) { context.report({ node, message: "Unexpected mix of shorthand and non-shorthand properties." }); } else if (checkRedundancy) { /* * If all properties of the object contain a method or value with a name matching it's key, * all the keys are redundant. */ const canAlwaysUseShorthand = properties.every(isRedundant); if (canAlwaysUseShorthand) { context.report({ node, message: "Expected shorthand for all properties." }); } } } } }
[ "function", "checkConsistency", "(", "node", ",", "checkRedundancy", ")", "{", "// We are excluding getters/setters and spread properties as they are considered neither longform nor shorthand.", "const", "properties", "=", "node", ".", "properties", ".", "filter", "(", "canHaveSh...
Ensures that an object's properties are consistently shorthand, or not shorthand at all. @param {ASTNode} node Property AST node @param {boolean} checkRedundancy Whether to check longform redundancy @returns {void}
[ "Ensures", "that", "an", "object", "s", "properties", "are", "consistently", "shorthand", "or", "not", "shorthand", "at", "all", ".", "@param", "{", "ASTNode", "}", "node", "Property", "AST", "node", "@param", "{", "boolean", "}", "checkRedundancy", "Whether",...
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/object-shorthand.js#L197-L229
train
Check consistency of the node
[ 30522, 3853, 4638, 8663, 6190, 6528, 5666, 1006, 13045, 1010, 4638, 5596, 18426, 9407, 1007, 1063, 1013, 1013, 2057, 2024, 13343, 2131, 7747, 1013, 2275, 7747, 1998, 3659, 5144, 2004, 2027, 2024, 2641, 4445, 2146, 14192, 4496, 2460, 11774, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
third_party/js/mozmill/shared-modules/addons.js
addonsManager_undo
function addonsManager_undo(aSpec) { var spec = aSpec || { }; spec.link = "undo"; var link = this.getAddonLink(spec); this._controller.click(link); }
javascript
function addonsManager_undo(aSpec) { var spec = aSpec || { }; spec.link = "undo"; var link = this.getAddonLink(spec); this._controller.click(link); }
[ "function", "addonsManager_undo", "(", "aSpec", ")", "{", "var", "spec", "=", "aSpec", "||", "{", "}", ";", "spec", ".", "link", "=", "\"undo\"", ";", "var", "link", "=", "this", ".", "getAddonLink", "(", "spec", ")", ";", "this", ".", "_controller", ...
Undo the last action performed for the given add-on @param {object} aSpec Information on which add-on to operate on Elements: addon - Add-on element
[ "Undo", "the", "last", "action", "performed", "for", "the", "given", "add", "-", "on" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/addons.js#L416-L422
train
Undo an add - on
[ 30522, 3853, 5587, 5644, 24805, 4590, 1035, 25672, 1006, 2004, 5051, 2278, 1007, 1063, 13075, 28699, 1027, 2004, 5051, 2278, 1064, 1064, 1063, 1065, 1025, 28699, 1012, 4957, 1027, 1000, 25672, 1000, 1025, 13075, 4957, 1027, 2023, 1012, 2131...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/no-lone-blocks.js
markLoneBlock
function markLoneBlock() { if (loneBlocks.length === 0) { return; } const block = context.getAncestors().pop(); if (loneBlocks[loneBlocks.length - 1] === block) { loneBlocks.pop(); } }
javascript
function markLoneBlock() { if (loneBlocks.length === 0) { return; } const block = context.getAncestors().pop(); if (loneBlocks[loneBlocks.length - 1] === block) { loneBlocks.pop(); } }
[ "function", "markLoneBlock", "(", ")", "{", "if", "(", "loneBlocks", ".", "length", "===", "0", ")", "{", "return", ";", "}", "const", "block", "=", "context", ".", "getAncestors", "(", ")", ".", "pop", "(", ")", ";", "if", "(", "loneBlocks", "[", ...
Checks the enclosing block of the current node for block-level bindings, and "marks it" as valid if any. @returns {void}
[ "Checks", "the", "enclosing", "block", "of", "the", "current", "node", "for", "block", "-", "level", "bindings", "and", "marks", "it", "as", "valid", "if", "any", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-lone-blocks.js#L61-L71
train
Mark the last block in the list of lone blocks
[ 30522, 3853, 2928, 27165, 23467, 1006, 1007, 1063, 2065, 1006, 10459, 23467, 2015, 1012, 3091, 1027, 1027, 1027, 1014, 1007, 1063, 2709, 1025, 1065, 9530, 3367, 3796, 1027, 6123, 1012, 2131, 26755, 6591, 1006, 1007, 1012, 3769, 1006, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getsentry/sentry-javascript
packages/raven-js/src/raven.js
function(ex, options) { options = objectMerge({trimHeadFrames: 0}, options ? options : {}); if (isErrorEvent(ex) && ex.error) { // If it is an ErrorEvent with `error` property, extract it to get actual Error ex = ex.error; } else if (isDOMError(ex) || isDOMException(ex)) { // If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers) // then we just extract the name and message, as they don't provide anything else // https://developer.mozilla.org/en-US/docs/Web/API/DOMError // https://developer.mozilla.org/en-US/docs/Web/API/DOMException var name = ex.name || (isDOMError(ex) ? 'DOMError' : 'DOMException'); var message = ex.message ? name + ': ' + ex.message : name; return this.captureMessage( message, objectMerge(options, { // neither DOMError or DOMException provide stack trace and we most likely wont get it this way as well // but it's barely any overhead so we may at least try stacktrace: true, trimHeadFrames: options.trimHeadFrames + 1 }) ); } else if (isError(ex)) { // we have a real Error object ex = ex; } else if (isPlainObject(ex)) { // If it is plain Object, serialize it manually and extract options // This will allow us to group events based on top-level keys // which is much better than creating new group when any key/value change options = this._getCaptureExceptionOptionsFromPlainObject(options, ex); ex = new Error(options.message); } else { // If none of previous checks were valid, then it means that // it's not a DOMError/DOMException // it's not a plain Object // it's not a valid ErrorEvent (one with an error property) // it's not an Error // So bail out and capture it as a simple message: return this.captureMessage( ex, objectMerge(options, { stacktrace: true, // if we fall back to captureMessage, default to attempting a new trace trimHeadFrames: options.trimHeadFrames + 1 }) ); } // Store the raw exception object for potential debugging and introspection this._lastCapturedException = ex; // TraceKit.report will re-raise any exception passed to it, // which means you have to wrap it in try/catch. Instead, we // can wrap it here and only re-raise if TraceKit.report // raises an exception different from the one we asked to // report on. try { var stack = TraceKit.computeStackTrace(ex); this._handleStackInfo(stack, options); } catch (ex1) { if (ex !== ex1) { throw ex1; } } return this; }
javascript
function(ex, options) { options = objectMerge({trimHeadFrames: 0}, options ? options : {}); if (isErrorEvent(ex) && ex.error) { // If it is an ErrorEvent with `error` property, extract it to get actual Error ex = ex.error; } else if (isDOMError(ex) || isDOMException(ex)) { // If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers) // then we just extract the name and message, as they don't provide anything else // https://developer.mozilla.org/en-US/docs/Web/API/DOMError // https://developer.mozilla.org/en-US/docs/Web/API/DOMException var name = ex.name || (isDOMError(ex) ? 'DOMError' : 'DOMException'); var message = ex.message ? name + ': ' + ex.message : name; return this.captureMessage( message, objectMerge(options, { // neither DOMError or DOMException provide stack trace and we most likely wont get it this way as well // but it's barely any overhead so we may at least try stacktrace: true, trimHeadFrames: options.trimHeadFrames + 1 }) ); } else if (isError(ex)) { // we have a real Error object ex = ex; } else if (isPlainObject(ex)) { // If it is plain Object, serialize it manually and extract options // This will allow us to group events based on top-level keys // which is much better than creating new group when any key/value change options = this._getCaptureExceptionOptionsFromPlainObject(options, ex); ex = new Error(options.message); } else { // If none of previous checks were valid, then it means that // it's not a DOMError/DOMException // it's not a plain Object // it's not a valid ErrorEvent (one with an error property) // it's not an Error // So bail out and capture it as a simple message: return this.captureMessage( ex, objectMerge(options, { stacktrace: true, // if we fall back to captureMessage, default to attempting a new trace trimHeadFrames: options.trimHeadFrames + 1 }) ); } // Store the raw exception object for potential debugging and introspection this._lastCapturedException = ex; // TraceKit.report will re-raise any exception passed to it, // which means you have to wrap it in try/catch. Instead, we // can wrap it here and only re-raise if TraceKit.report // raises an exception different from the one we asked to // report on. try { var stack = TraceKit.computeStackTrace(ex); this._handleStackInfo(stack, options); } catch (ex1) { if (ex !== ex1) { throw ex1; } } return this; }
[ "function", "(", "ex", ",", "options", ")", "{", "options", "=", "objectMerge", "(", "{", "trimHeadFrames", ":", "0", "}", ",", "options", "?", "options", ":", "{", "}", ")", ";", "if", "(", "isErrorEvent", "(", "ex", ")", "&&", "ex", ".", "error",...
Manually capture an exception and send it over to Sentry @param {error} ex An exception to be logged @param {object} options A specific set of options for this error [optional] @return {Raven}
[ "Manually", "capture", "an", "exception", "and", "send", "it", "over", "to", "Sentry" ]
a872223343fecf7364473b78bede937f1eb57bd0
https://github.com/getsentry/sentry-javascript/blob/a872223343fecf7364473b78bede937f1eb57bd0/packages/raven-js/src/raven.js#L468-L534
train
Returns an Error object containing the name and message of the error and the stack trace of the error.
[ 30522, 3853, 1006, 4654, 1010, 7047, 1007, 1063, 7047, 1027, 4874, 5017, 3351, 1006, 1063, 12241, 4974, 15643, 2015, 1024, 1014, 1065, 1010, 7047, 1029, 7047, 1024, 1063, 1065, 1007, 1025, 2065, 1006, 2003, 2121, 29165, 18697, 3372, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ngrx/platform
projects/ngrx.io/tools/examples/run-example-e2e.js
reportStatus
function reportStatus(status, outputFile) { let log = ['']; log.push('Suites passed:'); status.passed.forEach(function (val) { log.push(' ' + val); }); if (status.failed.length == 0) { log.push('All tests passed'); } else { log.push('Suites failed:'); status.failed.forEach(function (val) { log.push(' ' + val); }); } log.push('\nElapsed time: ' + status.elapsedTime + ' seconds'); log = log.join('\n'); console.log(log); fs.appendFileSync(outputFile, log); }
javascript
function reportStatus(status, outputFile) { let log = ['']; log.push('Suites passed:'); status.passed.forEach(function (val) { log.push(' ' + val); }); if (status.failed.length == 0) { log.push('All tests passed'); } else { log.push('Suites failed:'); status.failed.forEach(function (val) { log.push(' ' + val); }); } log.push('\nElapsed time: ' + status.elapsedTime + ' seconds'); log = log.join('\n'); console.log(log); fs.appendFileSync(outputFile, log); }
[ "function", "reportStatus", "(", "status", ",", "outputFile", ")", "{", "let", "log", "=", "[", "''", "]", ";", "log", ".", "push", "(", "'Suites passed:'", ")", ";", "status", ".", "passed", ".", "forEach", "(", "function", "(", "val", ")", "{", "lo...
Report final status.
[ "Report", "final", "status", "." ]
eec9cc615440526ddedac04ae0082bfecef13d50
https://github.com/ngrx/platform/blob/eec9cc615440526ddedac04ae0082bfecef13d50/projects/ngrx.io/tools/examples/run-example-e2e.js#L224-L243
train
Report the status of a suite
[ 30522, 3853, 4311, 29336, 2271, 1006, 3570, 1010, 6434, 8873, 2571, 1007, 1063, 2292, 8833, 1027, 1031, 1005, 1005, 1033, 1025, 8833, 1012, 5245, 1006, 1005, 19796, 2979, 1024, 1005, 1007, 30524, 1063, 8833, 1012, 5245, 1006, 1005, 2035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
verdaccio/verdaccio
src/lib/logger.js
pad
function pad(str) { if (str.length < max) { return str + ' '.repeat(max - str.length); } return str; }
javascript
function pad(str) { if (str.length < max) { return str + ' '.repeat(max - str.length); } return str; }
[ "function", "pad", "(", "str", ")", "{", "if", "(", "str", ".", "length", "<", "max", ")", "{", "return", "str", "+", "' '", ".", "repeat", "(", "max", "-", "str", ".", "length", ")", ";", "}", "return", "str", ";", "}" ]
Apply whitespaces based on the length @param {*} str the log message @return {String}
[ "Apply", "whitespaces", "based", "on", "the", "length" ]
daa7e897b6d093bf8282ff12df3f450bcd73476c
https://github.com/verdaccio/verdaccio/blob/daa7e897b6d093bf8282ff12df3f450bcd73476c/src/lib/logger.js#L179-L184
train
Pads a string if it is too long
[ 30522, 3853, 11687, 1006, 2358, 2099, 1007, 1063, 2065, 1006, 2358, 2099, 30524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/keyword-spacing.js
parseOptions
function parseOptions(options = {}) { const before = options.before !== false; const after = options.after !== false; const defaultValue = { before: before ? expectSpaceBefore : unexpectSpaceBefore, after: after ? expectSpaceAfter : unexpectSpaceAfter }; const overrides = (options && options.overrides) || {}; const retv = Object.create(null); for (let i = 0; i < KEYS.length; ++i) { const key = KEYS[i]; const override = overrides[key]; if (override) { const thisBefore = ("before" in override) ? override.before : before; const thisAfter = ("after" in override) ? override.after : after; retv[key] = { before: thisBefore ? expectSpaceBefore : unexpectSpaceBefore, after: thisAfter ? expectSpaceAfter : unexpectSpaceAfter }; } else { retv[key] = defaultValue; } } return retv; }
javascript
function parseOptions(options = {}) { const before = options.before !== false; const after = options.after !== false; const defaultValue = { before: before ? expectSpaceBefore : unexpectSpaceBefore, after: after ? expectSpaceAfter : unexpectSpaceAfter }; const overrides = (options && options.overrides) || {}; const retv = Object.create(null); for (let i = 0; i < KEYS.length; ++i) { const key = KEYS[i]; const override = overrides[key]; if (override) { const thisBefore = ("before" in override) ? override.before : before; const thisAfter = ("after" in override) ? override.after : after; retv[key] = { before: thisBefore ? expectSpaceBefore : unexpectSpaceBefore, after: thisAfter ? expectSpaceAfter : unexpectSpaceAfter }; } else { retv[key] = defaultValue; } } return retv; }
[ "function", "parseOptions", "(", "options", "=", "{", "}", ")", "{", "const", "before", "=", "options", ".", "before", "!==", "false", ";", "const", "after", "=", "options", ".", "after", "!==", "false", ";", "const", "defaultValue", "=", "{", "before", ...
Parses the option object and determines check methods for each keyword. @param {Object|undefined} options - The option object to parse. @returns {Object} - Normalized option object. Keys are keywords (there are for every keyword). Values are instances of `{"before": function, "after": function}`.
[ "Parses", "the", "option", "object", "and", "determines", "check", "methods", "for", "each", "keyword", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/keyword-spacing.js#L231-L259
train
parse options
[ 30522, 3853, 11968, 3366, 7361, 9285, 1006, 7047, 1027, 1063, 1065, 1007, 1063, 9530, 3367, 2077, 1027, 7047, 1012, 2077, 999, 1027, 1027, 6270, 1025, 9530, 3367, 2044, 1027, 7047, 1012, 2044, 999, 1027, 1027, 6270, 1025, 30524, 2015, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ecomfe/zrender
src/graphic/mixin/RectText.js
function (ctx, rect) { var style = this.style; rect = style.textRect || rect; // Optimize, avoid normalize every time. this.__dirty && textHelper.normalizeTextStyle(style, true); var text = style.text; // Convert to string text != null && (text += ''); if (!textHelper.needDrawText(text, style)) { return; } // FIXME // Do not provide prevEl to `textHelper.renderText` for ctx prop cache, // but use `ctx.save()` and `ctx.restore()`. Because the cache for rect // text propably break the cache for its host elements. ctx.save(); // Transform rect to view space var transform = this.transform; if (!style.transformText) { if (transform) { tmpRect.copy(rect); tmpRect.applyTransform(transform); rect = tmpRect; } } else { this.setTransform(ctx); } // transformText and textRotation can not be used at the same time. textHelper.renderText(this, ctx, text, style, rect, WILL_BE_RESTORED); ctx.restore(); }
javascript
function (ctx, rect) { var style = this.style; rect = style.textRect || rect; // Optimize, avoid normalize every time. this.__dirty && textHelper.normalizeTextStyle(style, true); var text = style.text; // Convert to string text != null && (text += ''); if (!textHelper.needDrawText(text, style)) { return; } // FIXME // Do not provide prevEl to `textHelper.renderText` for ctx prop cache, // but use `ctx.save()` and `ctx.restore()`. Because the cache for rect // text propably break the cache for its host elements. ctx.save(); // Transform rect to view space var transform = this.transform; if (!style.transformText) { if (transform) { tmpRect.copy(rect); tmpRect.applyTransform(transform); rect = tmpRect; } } else { this.setTransform(ctx); } // transformText and textRotation can not be used at the same time. textHelper.renderText(this, ctx, text, style, rect, WILL_BE_RESTORED); ctx.restore(); }
[ "function", "(", "ctx", ",", "rect", ")", "{", "var", "style", "=", "this", ".", "style", ";", "rect", "=", "style", ".", "textRect", "||", "rect", ";", "// Optimize, avoid normalize every time.", "this", ".", "__dirty", "&&", "textHelper", ".", "normalizeTe...
Draw text in a rect with specified position. @param {CanvasRenderingContext2D} ctx @param {Object} rect Displayable rect
[ "Draw", "text", "in", "a", "rect", "with", "specified", "position", "." ]
30321b57cba3149c30eacb0c1e18276f0f001b9f
https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/graphic/mixin/RectText.js#L23-L63
train
Render text to the given canvas
[ 30522, 3853, 1006, 14931, 2595, 1010, 28667, 2102, 1007, 1063, 13075, 2806, 1027, 2023, 1012, 2806, 1025, 28667, 2102, 1027, 2806, 1012, 3793, 2890, 6593, 1064, 1064, 28667, 2102, 1025, 1013, 1013, 23569, 27605, 4371, 1010, 4468, 3671, 4697...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/core/util/util.js
function(node, child) { var hasContains = (window.Node && window.Node.prototype && Node.prototype.contains); var findFn = hasContains ? angular.bind(node, node.contains) : angular.bind(node, function(arg) { // compares the positions of two nodes and returns a bitmask return (node === child) || !!(this.compareDocumentPosition(arg) & 16); }); return findFn(child); }
javascript
function(node, child) { var hasContains = (window.Node && window.Node.prototype && Node.prototype.contains); var findFn = hasContains ? angular.bind(node, node.contains) : angular.bind(node, function(arg) { // compares the positions of two nodes and returns a bitmask return (node === child) || !!(this.compareDocumentPosition(arg) & 16); }); return findFn(child); }
[ "function", "(", "node", ",", "child", ")", "{", "var", "hasContains", "=", "(", "window", ".", "Node", "&&", "window", ".", "Node", ".", "prototype", "&&", "Node", ".", "prototype", ".", "contains", ")", ";", "var", "findFn", "=", "hasContains", "?", ...
Build polyfill for the Node.contains feature (if needed) @param {Node} node @param {Node} child @returns {Node}
[ "Build", "polyfill", "for", "the", "Node", ".", "contains", "feature", "(", "if", "needed", ")" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L578-L586
train
Find the child node
[ 30522, 3853, 1006, 13045, 1010, 2775, 1007, 1063, 13075, 2038, 8663, 18249, 2015, 1027, 1006, 3332, 1012, 13045, 1004, 1004, 3332, 1012, 13045, 1012, 8773, 1004, 1004, 13045, 1012, 8773, 1012, 3397, 1007, 1025, 13075, 2424, 2546, 2078, 1027...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js
function(oBody, sDensityMode){ switch (sDensityMode) { case COMPACT: oBody.toggleClass("sapUiSizeCompact", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCondensed", false); break; case CONDENSED: oBody.toggleClass("sapUiSizeCondensed", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCompact", true); break; default: oBody.toggleClass("sapUiSizeCozy", true).toggleClass("sapUiSizeCondensed", false).toggleClass("sapUiSizeCompact", false); } }
javascript
function(oBody, sDensityMode){ switch (sDensityMode) { case COMPACT: oBody.toggleClass("sapUiSizeCompact", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCondensed", false); break; case CONDENSED: oBody.toggleClass("sapUiSizeCondensed", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCompact", true); break; default: oBody.toggleClass("sapUiSizeCozy", true).toggleClass("sapUiSizeCondensed", false).toggleClass("sapUiSizeCompact", false); } }
[ "function", "(", "oBody", ",", "sDensityMode", ")", "{", "switch", "(", "sDensityMode", ")", "{", "case", "COMPACT", ":", "oBody", ".", "toggleClass", "(", "\"sapUiSizeCompact\"", ",", "true", ")", ".", "toggleClass", "(", "\"sapUiSizeCozy\"", ",", "false", ...
Toggles content density classes in the provided html body @param {object} oBody the html body to set the correct class on @param {string} sDensityMode content density mode @private
[ "Toggles", "content", "density", "classes", "in", "the", "provided", "html", "body" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js#L203-L214
train
Toggles the CSS class of the given control based on the density mode.
[ 30522, 3853, 1006, 27885, 7716, 2100, 1010, 17371, 6132, 3012, 5302, 3207, 1007, 1063, 6942, 1006, 17371, 6132, 3012, 5302, 3207, 1007, 1063, 2553, 9233, 1024, 27885, 7716, 2100, 1012, 2000, 24679, 26266, 1006, 1000, 20066, 27020, 4697, 900...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
electron/electron
npm/install.js
extractFile
function extractFile (err, zipPath) { if (err) return onerror(err) extract(zipPath, { dir: path.join(__dirname, 'dist') }, function (err) { if (err) return onerror(err) fs.writeFile(path.join(__dirname, 'path.txt'), platformPath, function (err) { if (err) return onerror(err) }) }) }
javascript
function extractFile (err, zipPath) { if (err) return onerror(err) extract(zipPath, { dir: path.join(__dirname, 'dist') }, function (err) { if (err) return onerror(err) fs.writeFile(path.join(__dirname, 'path.txt'), platformPath, function (err) { if (err) return onerror(err) }) }) }
[ "function", "extractFile", "(", "err", ",", "zipPath", ")", "{", "if", "(", "err", ")", "return", "onerror", "(", "err", ")", "extract", "(", "zipPath", ",", "{", "dir", ":", "path", ".", "join", "(", "__dirname", ",", "'dist'", ")", "}", ",", "fun...
unzips and makes path.txt point at the correct executable
[ "unzips", "and", "makes", "path", ".", "txt", "point", "at", "the", "correct", "executable" ]
6e29611788277729647acf465f10db1ea6f15788
https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/npm/install.js#L42-L50
train
Extract the platform file
[ 30522, 3853, 14817, 8873, 2571, 1006, 9413, 2099, 1010, 14101, 15069, 1007, 1063, 2065, 1006, 9413, 2099, 1007, 2709, 2028, 18933, 2099, 1006, 9413, 2099, 1007, 14817, 1006, 14101, 15069, 1010, 1063, 16101, 1024, 4130, 1012, 3693, 1006, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
javascript/node/selenium-webdriver/firefox.js
installExtension
async function installExtension(extension, dir) { if (extension.slice(-4) !== '.xpi') { throw Error('Path ath is not a xpi file: ' + extension); } let archive = await zip.load(extension); if (!archive.has('manifest.json')) { throw new AddonFormatError(`Couldn't find manifest.json in ${extension}`); } let buf = await archive.getFile('manifest.json'); let {applications} = /** @type {{applications:{gecko:{id:string}}}} */( JSON.parse(buf.toString('utf8'))); if (!(applications && applications.gecko && applications.gecko.id)) { throw new AddonFormatError(`Could not find add-on ID for ${extension}`); } await io.copy(extension, `${path.join(dir, applications.gecko.id)}.xpi`); return applications.gecko.id; }
javascript
async function installExtension(extension, dir) { if (extension.slice(-4) !== '.xpi') { throw Error('Path ath is not a xpi file: ' + extension); } let archive = await zip.load(extension); if (!archive.has('manifest.json')) { throw new AddonFormatError(`Couldn't find manifest.json in ${extension}`); } let buf = await archive.getFile('manifest.json'); let {applications} = /** @type {{applications:{gecko:{id:string}}}} */( JSON.parse(buf.toString('utf8'))); if (!(applications && applications.gecko && applications.gecko.id)) { throw new AddonFormatError(`Could not find add-on ID for ${extension}`); } await io.copy(extension, `${path.join(dir, applications.gecko.id)}.xpi`); return applications.gecko.id; }
[ "async", "function", "installExtension", "(", "extension", ",", "dir", ")", "{", "if", "(", "extension", ".", "slice", "(", "-", "4", ")", "!==", "'.xpi'", ")", "{", "throw", "Error", "(", "'Path ath is not a xpi file: '", "+", "extension", ")", ";", "}", ...
Installs an extension to the given directory. @param {string} extension Path to the xpi extension file to install. @param {string} dir Path to the directory to install the extension in. @return {!Promise<string>} A promise for the add-on ID once installed.
[ "Installs", "an", "extension", "to", "the", "given", "directory", "." ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/firefox.js#L158-L178
train
Installs an extension to the add - on.
[ 30522, 2004, 6038, 2278, 3853, 16500, 10288, 29048, 1006, 5331, 1010, 16101, 1007, 1063, 2065, 1006, 5331, 1012, 14704, 1006, 1011, 1018, 1007, 999, 1027, 1027, 1005, 1012, 26726, 2072, 1005, 1007, 1063, 5466, 7561, 1006, 1005, 4130, 2012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
wuchangming/spy-debugger
buildin_modules/weinre/web/modjewel.js
getModulePath
function getModulePath(module) { if (!module || !module.id) return "" var parts = module.id.split("/") return parts.slice(0, parts.length-1).join("/") }
javascript
function getModulePath(module) { if (!module || !module.id) return "" var parts = module.id.split("/") return parts.slice(0, parts.length-1).join("/") }
[ "function", "getModulePath", "(", "module", ")", "{", "if", "(", "!", "module", "||", "!", "module", ".", "id", ")", "return", "\"\"", "var", "parts", "=", "module", ".", "id", ".", "split", "(", "\"/\"", ")", "return", "parts", ".", "slice", "(", ...
---------------------------------------------------------------------------- get the path of a module ----------------------------------------------------------------------------
[ "----------------------------------------------------------------------------", "get", "the", "path", "of", "a", "module", "----------------------------------------------------------------------------" ]
55c1dda0dff0c44920673711656ddfd7ff03c307
https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/modjewel.js#L233-L239
train
Get the path of a module
[ 30522, 3853, 2131, 5302, 8566, 2571, 15069, 1006, 11336, 1007, 1063, 2065, 1006, 999, 11336, 1064, 1064, 999, 11336, 1012, 8909, 1007, 2709, 1000, 1000, 13075, 3033, 1027, 11336, 1012, 8909, 1012, 3975, 1006, 1000, 1013, 1000, 1007, 2709, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
facebook/relay
packages/relay-runtime/handlers/connection/RelayConnectionHandler.js
insertEdgeAfter
function insertEdgeAfter( record: RecordProxy, newEdge: RecordProxy, cursor?: ?string, ): void { const {CURSOR, EDGES} = RelayConnectionInterface.get(); const edges = record.getLinkedRecords(EDGES); if (!edges) { record.setLinkedRecords([newEdge], EDGES); return; } let nextEdges; if (cursor == null) { nextEdges = edges.concat(newEdge); } else { nextEdges = []; let foundCursor = false; for (let ii = 0; ii < edges.length; ii++) { const edge = edges[ii]; nextEdges.push(edge); if (edge == null) { continue; } const edgeCursor = edge.getValue(CURSOR); if (cursor === edgeCursor) { nextEdges.push(newEdge); foundCursor = true; } } if (!foundCursor) { nextEdges.push(newEdge); } } record.setLinkedRecords(nextEdges, EDGES); }
javascript
function insertEdgeAfter( record: RecordProxy, newEdge: RecordProxy, cursor?: ?string, ): void { const {CURSOR, EDGES} = RelayConnectionInterface.get(); const edges = record.getLinkedRecords(EDGES); if (!edges) { record.setLinkedRecords([newEdge], EDGES); return; } let nextEdges; if (cursor == null) { nextEdges = edges.concat(newEdge); } else { nextEdges = []; let foundCursor = false; for (let ii = 0; ii < edges.length; ii++) { const edge = edges[ii]; nextEdges.push(edge); if (edge == null) { continue; } const edgeCursor = edge.getValue(CURSOR); if (cursor === edgeCursor) { nextEdges.push(newEdge); foundCursor = true; } } if (!foundCursor) { nextEdges.push(newEdge); } } record.setLinkedRecords(nextEdges, EDGES); }
[ "function", "insertEdgeAfter", "(", "record", ":", "RecordProxy", ",", "newEdge", ":", "RecordProxy", ",", "cursor", "?", ":", "?", "string", ",", ")", ":", "void", "{", "const", "{", "CURSOR", ",", "EDGES", "}", "=", "RelayConnectionInterface", ".", "get"...
@public Inserts an edge after the given cursor, or at the end of the list if no cursor is provided. Example: Given that data has already been fetched on some user `<id>` on the `friends` field: ``` fragment FriendsFragment on User { friends(first: 10) @connection(key: "FriendsFragment_friends") { edges { node { id } } } } ``` An edge can be appended with: ``` store => { const user = store.get('<id>'); const friends = RelayConnectionHandler.getConnection(user, 'FriendsFragment_friends'); const edge = store.create('<edge-id>', 'FriendsEdge'); RelayConnectionHandler.insertEdgeAfter(friends, edge); } ```
[ "@public" ]
7fb9be5182b9650637d7b92ead9a42713ac30aa4
https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-runtime/handlers/connection/RelayConnectionHandler.js#L291-L326
train
Insert an edge after the cursor
[ 30522, 3853, 12889, 3351, 10354, 3334, 1006, 2501, 1024, 2501, 21572, 18037, 1010, 2047, 24225, 1024, 2501, 21572, 18037, 1010, 12731, 25301, 2099, 1029, 1024, 1029, 5164, 1010, 1007, 1024, 11675, 1063, 9530, 3367, 1063, 12731, 25301, 2099, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jgraph/mxgraph
javascript/mxClient.js
function(container, scrollOffset) { var offsetLeft = 0; var offsetTop = 0; // Ignores document scroll origin for fixed elements var fixed = false; var node = container; var b = document.body; var d = document.documentElement; while (node != null && node != b && node != d && !fixed) { var style = mxUtils.getCurrentStyle(node); if (style != null) { fixed = fixed || style.position == 'fixed'; } node = node.parentNode; } if (!scrollOffset && !fixed) { var offset = mxUtils.getDocumentScrollOrigin(container.ownerDocument); offsetLeft += offset.x; offsetTop += offset.y; } var r = container.getBoundingClientRect(); if (r != null) { offsetLeft += r.left; offsetTop += r.top; } return new mxPoint(offsetLeft, offsetTop); }
javascript
function(container, scrollOffset) { var offsetLeft = 0; var offsetTop = 0; // Ignores document scroll origin for fixed elements var fixed = false; var node = container; var b = document.body; var d = document.documentElement; while (node != null && node != b && node != d && !fixed) { var style = mxUtils.getCurrentStyle(node); if (style != null) { fixed = fixed || style.position == 'fixed'; } node = node.parentNode; } if (!scrollOffset && !fixed) { var offset = mxUtils.getDocumentScrollOrigin(container.ownerDocument); offsetLeft += offset.x; offsetTop += offset.y; } var r = container.getBoundingClientRect(); if (r != null) { offsetLeft += r.left; offsetTop += r.top; } return new mxPoint(offsetLeft, offsetTop); }
[ "function", "(", "container", ",", "scrollOffset", ")", "{", "var", "offsetLeft", "=", "0", ";", "var", "offsetTop", "=", "0", ";", "// Ignores document scroll origin for fixed elements", "var", "fixed", "=", "false", ";", "var", "node", "=", "container", ";", ...
Function: getOffset Returns the offset for the specified container as an <mxPoint>. The offset is the distance from the top left corner of the container to the top left corner of the document. Parameters: container - DOM node to return the offset for. scollOffset - Optional boolean to add the scroll offset of the document. Default is false.
[ "Function", ":", "getOffset" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L4754-L4793
train
Returns the absolute position of the container.
[ 30522, 3853, 1006, 11661, 1010, 17186, 27475, 3388, 1007, 1063, 13075, 16396, 2571, 6199, 1027, 1014, 1025, 13075, 16396, 14399, 1027, 1014, 1025, 1013, 1013, 26663, 6254, 17186, 4761, 2005, 4964, 3787, 13075, 4964, 1027, 6270, 1025, 13075, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mui-org/material-ui
packages/material-ui-styles/src/jssPreset/jssPreset.js
jssPreset
function jssPreset() { return { plugins: [ functions(), global(), nested(), camelCase(), defaultUnit(), // Disable the vendor prefixer server-side, it does nothing. // This way, we can get a performance boost. // In the documentation, we are using `autoprefixer` to solve this problem. typeof window === 'undefined' ? null : vendorPrefixer(), propsSort(), ], }; }
javascript
function jssPreset() { return { plugins: [ functions(), global(), nested(), camelCase(), defaultUnit(), // Disable the vendor prefixer server-side, it does nothing. // This way, we can get a performance boost. // In the documentation, we are using `autoprefixer` to solve this problem. typeof window === 'undefined' ? null : vendorPrefixer(), propsSort(), ], }; }
[ "function", "jssPreset", "(", ")", "{", "return", "{", "plugins", ":", "[", "functions", "(", ")", ",", "global", "(", ")", ",", "nested", "(", ")", ",", "camelCase", "(", ")", ",", "defaultUnit", "(", ")", ",", "// Disable the vendor prefixer server-side,...
Subset of jss-preset-default with only the plugins the Material-UI components are using.
[ "Subset", "of", "jss", "-", "preset", "-", "default", "with", "only", "the", "plugins", "the", "Material", "-", "UI", "components", "are", "using", "." ]
1555e52367835946382fbf2a8f681de71318915d
https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/packages/material-ui-styles/src/jssPreset/jssPreset.js#L10-L25
train
The jss preset is a function that can be used to generate a plugin for the jss module.
[ 30522, 3853, 1046, 4757, 28994, 3388, 1006, 1007, 1063, 2709, 30524, 19150, 1996, 21431, 17576, 2121, 8241, 1011, 2217, 1010, 2009, 2515, 2498, 1012, 1013, 1013, 2023, 2126, 1010, 2057, 2064, 2131, 1037, 2836, 12992, 1012, 1013, 1013, 1999,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dcloudio/mui
examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js
function (handler, ns, name, type, id) { var hand = new Strophe.Handler(handler, ns, name, type, id); hand.user = false; this.addHandlers.push(hand); return hand; }
javascript
function (handler, ns, name, type, id) { var hand = new Strophe.Handler(handler, ns, name, type, id); hand.user = false; this.addHandlers.push(hand); return hand; }
[ "function", "(", "handler", ",", "ns", ",", "name", ",", "type", ",", "id", ")", "{", "var", "hand", "=", "new", "Strophe", ".", "Handler", "(", "handler", ",", "ns", ",", "name", ",", "type", ",", "id", ")", ";", "hand", ".", "user", "=", "fal...
PrivateFunction: _addSysHandler _Private_ function to add a system level stanza handler. This function is used to add a Strophe.Handler for the library code. System stanza handlers are allowed to run before authentication is complete. Parameters: (Function) handler - The callback function. (String) ns - The namespace to match. (String) name - The stanza name to match. (String) type - The stanza type attribute to match. (String) id - The stanza id attribute to match.
[ "PrivateFunction", ":", "_addSysHandler", "_Private_", "function", "to", "add", "a", "system", "level", "stanza", "handler", "." ]
ff74c90a1671a552f3604b1288bf38a4126312d0
https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L3405-L3411
train
Add a new handler to the end of the list of handlers
[ 30522, 3853, 1006, 28213, 1010, 24978, 1010, 2171, 1010, 2828, 1010, 8909, 1007, 1063, 13075, 2192, 1027, 2047, 2358, 18981, 5369, 1012, 28213, 1006, 28213, 1010, 24978, 1010, 2171, 1010, 2828, 1010, 8909, 1007, 1025, 2192, 1012, 5310, 1027...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sparksuite/simplemde-markdown-editor
src/js/simplemde.js
drawLink
function drawLink(editor) { var cm = editor.codemirror; var stat = getState(cm); var options = editor.options; var url = "http://"; if(options.promptURLs) { url = prompt(options.promptTexts.link); if(!url) { return false; } } _replaceSelection(cm, stat.link, options.insertTexts.link, url); }
javascript
function drawLink(editor) { var cm = editor.codemirror; var stat = getState(cm); var options = editor.options; var url = "http://"; if(options.promptURLs) { url = prompt(options.promptTexts.link); if(!url) { return false; } } _replaceSelection(cm, stat.link, options.insertTexts.link, url); }
[ "function", "drawLink", "(", "editor", ")", "{", "var", "cm", "=", "editor", ".", "codemirror", ";", "var", "stat", "=", "getState", "(", "cm", ")", ";", "var", "options", "=", "editor", ".", "options", ";", "var", "url", "=", "\"http://\"", ";", "if...
Action for drawing a link.
[ "Action", "for", "drawing", "a", "link", "." ]
6abda7ab68cc20f4aca870eb243747951b90ab04
https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js#L616-L628
train
Draw link text
[ 30522, 3853, 4009, 13767, 1006, 3559, 1007, 1063, 13075, 4642, 1027, 3559, 1012, 3642, 14503, 29165, 1025, 13075, 28093, 1027, 4152, 12259, 1006, 4642, 30524, 1024, 1013, 1013, 1000, 1025, 2065, 1006, 7047, 1012, 25732, 3126, 4877, 1007, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/components/menu/js/menuServiceProvider.js
onRemove
function onRemove(scope, element, opts) { opts.cleanupInteraction(); opts.cleanupBackdrop(); opts.cleanupResizing(); opts.hideBackdrop(); // Before the menu is closing remove the clickable class. element.removeClass('md-clickable'); // For navigation $destroy events, do a quick, non-animated removal, // but for normal closes (from clicks, etc) animate the removal return (opts.$destroy === true) ? detachAndClean() : animateRemoval().then(detachAndClean); /** * For normal closes, animate the removal. * For forced closes (like $destroy events), skip the animations */ function animateRemoval() { return $animateCss(element, {addClass: 'md-leave'}).start(); } /** * Detach the element */ function detachAndClean() { element.removeClass('md-active'); detachElement(element, opts); opts.alreadyOpen = false; } }
javascript
function onRemove(scope, element, opts) { opts.cleanupInteraction(); opts.cleanupBackdrop(); opts.cleanupResizing(); opts.hideBackdrop(); // Before the menu is closing remove the clickable class. element.removeClass('md-clickable'); // For navigation $destroy events, do a quick, non-animated removal, // but for normal closes (from clicks, etc) animate the removal return (opts.$destroy === true) ? detachAndClean() : animateRemoval().then(detachAndClean); /** * For normal closes, animate the removal. * For forced closes (like $destroy events), skip the animations */ function animateRemoval() { return $animateCss(element, {addClass: 'md-leave'}).start(); } /** * Detach the element */ function detachAndClean() { element.removeClass('md-active'); detachElement(element, opts); opts.alreadyOpen = false; } }
[ "function", "onRemove", "(", "scope", ",", "element", ",", "opts", ")", "{", "opts", ".", "cleanupInteraction", "(", ")", ";", "opts", ".", "cleanupBackdrop", "(", ")", ";", "opts", ".", "cleanupResizing", "(", ")", ";", "opts", ".", "hideBackdrop", "(",...
Removing the menu element from the DOM and remove all associated event listeners and backdrop
[ "Removing", "the", "menu", "element", "from", "the", "DOM", "and", "remove", "all", "associated", "event", "listeners", "and", "backdrop" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L78-L109
train
Remove the menu element
[ 30522, 3853, 2006, 28578, 21818, 1006, 9531, 1010, 5783, 1010, 23569, 2015, 1007, 1063, 23569, 2015, 1012, 27686, 18447, 6906, 7542, 1006, 1007, 1025, 23569, 2015, 1012, 27686, 5963, 25711, 1006, 1007, 1025, 23569, 2015, 1012, 27686, 6072, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dcloudio/mui
examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js
function () { var data = this._conn._data; if (data.length > 0 && !this._conn.paused) { for (var i = 0; i < data.length; i++) { if (data[i] !== null) { var stanza, rawStanza; if (data[i] === "restart") { stanza = this._buildStream().tree(); } else { stanza = data[i]; } rawStanza = Strophe.serialize(stanza); this._conn.xmlOutput(stanza); this._conn.rawOutput(rawStanza); this.socket.send(rawStanza); } } this._conn._data = []; } }
javascript
function () { var data = this._conn._data; if (data.length > 0 && !this._conn.paused) { for (var i = 0; i < data.length; i++) { if (data[i] !== null) { var stanza, rawStanza; if (data[i] === "restart") { stanza = this._buildStream().tree(); } else { stanza = data[i]; } rawStanza = Strophe.serialize(stanza); this._conn.xmlOutput(stanza); this._conn.rawOutput(rawStanza); this.socket.send(rawStanza); } } this._conn._data = []; } }
[ "function", "(", ")", "{", "var", "data", "=", "this", ".", "_conn", ".", "_data", ";", "if", "(", "data", ".", "length", ">", "0", "&&", "!", "this", ".", "_conn", ".", "paused", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "...
PrivateFunction: _onIdle _Private_ function called by Strophe.Connection._onIdle sends all queued stanzas
[ "PrivateFunction", ":", "_onIdle", "_Private_", "function", "called", "by", "Strophe", ".", "Connection", ".", "_onIdle" ]
ff74c90a1671a552f3604b1288bf38a4126312d0
https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L5097-L5116
train
End of the function
[ 30522, 3853, 1006, 1007, 1063, 13075, 2951, 1027, 2023, 1012, 1035, 9530, 2078, 1012, 1035, 2951, 1025, 2065, 1006, 2951, 1012, 3091, 1028, 1014, 1004, 1004, 999, 2023, 1012, 1035, 9530, 2078, 1012, 5864, 1007, 1063, 2005, 1006, 13075, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
fex-team/webuploader
dist/webuploader.withoutimage.js
function( file ) { var invalid = !file || !file.size || this.accept && // 如果名字中有后缀,才做后缀白名单处理。 rExt.exec( file.name ) && !this.accept.test( file.name ); return !invalid; }
javascript
function( file ) { var invalid = !file || !file.size || this.accept && // 如果名字中有后缀,才做后缀白名单处理。 rExt.exec( file.name ) && !this.accept.test( file.name ); return !invalid; }
[ "function", "(", "file", ")", "{", "var", "invalid", "=", "!", "file", "||", "!", "file", ".", "size", "||", "this", ".", "accept", "&&", "// 如果名字中有后缀,才做后缀白名单处理。", "rExt", ".", "exec", "(", "file", ".", "name", ")", "&&", "!", "this", ".", "accept", ...
判断文件是否可以被加入队列
[ "判断文件是否可以被加入队列" ]
7094e4476c5af3b06993d91dde2d223200b9feb7
https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/dist/webuploader.withoutimage.js#L2469-L2476
train
check if file is valid
[ 30522, 3853, 1006, 5371, 1007, 1063, 13075, 19528, 1027, 999, 5371, 1064, 1064, 999, 5371, 1012, 2946, 1064, 1064, 2023, 1012, 5138, 1004, 1004, 1013, 1013, 100, 100, 1795, 100, 1746, 1873, 100, 100, 1989, 100, 100, 100, 100, 1915, 1795...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
shipshapecode/shepherd
src/js/utils/modal.js
_setAttributes
function _setAttributes(el, attrs) { Object.keys(attrs).forEach((key) => { el.setAttribute(key, attrs[key]); }); }
javascript
function _setAttributes(el, attrs) { Object.keys(attrs).forEach((key) => { el.setAttribute(key, attrs[key]); }); }
[ "function", "_setAttributes", "(", "el", ",", "attrs", ")", "{", "Object", ".", "keys", "(", "attrs", ")", ".", "forEach", "(", "(", "key", ")", "=>", "{", "el", ".", "setAttribute", "(", "key", ",", "attrs", "[", "key", "]", ")", ";", "}", ")", ...
Set multiple attributes on an element, via a hash @param {HTMLElement|SVGElement} el The element to set the attributes on @param {Object} attrs A hash of key value pairs for attributes to set @private
[ "Set", "multiple", "attributes", "on", "an", "element", "via", "a", "hash" ]
0cb1c63fb07b58796358f6d33da5f6405e2b05f4
https://github.com/shipshapecode/shepherd/blob/0cb1c63fb07b58796358f6d33da5f6405e2b05f4/src/js/utils/modal.js#L183-L187
train
Set attributes on an element
[ 30522, 3853, 1035, 2275, 19321, 3089, 8569, 4570, 1006, 3449, 1010, 2012, 16344, 2015, 1007, 1063, 4874, 1012, 6309, 1006, 2012, 16344, 2015, 1007, 1012, 18921, 6776, 1006, 1006, 3145, 1007, 1027, 1028, 1063, 3449, 1012, 2275, 19321, 3089, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
BrainJS/brain.js
dist/recurrent/matrix/multiply-element-b.js
multiplyElementB
function multiplyElementB(product, left, right) { for (var i = 0; i < left.weights.length; i++) { left.deltas[i] = right.weights[i] * product.deltas[i]; right.deltas[i] = left.weights[i] * product.deltas[i]; } }
javascript
function multiplyElementB(product, left, right) { for (var i = 0; i < left.weights.length; i++) { left.deltas[i] = right.weights[i] * product.deltas[i]; right.deltas[i] = left.weights[i] * product.deltas[i]; } }
[ "function", "multiplyElementB", "(", "product", ",", "left", ",", "right", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "left", ".", "weights", ".", "length", ";", "i", "++", ")", "{", "left", ".", "deltas", "[", "i", "]", "=", "r...
multiplies {left} and {right} weight by {from} deltas into {left} and {right} deltas @param {Matrix} product @param {Matrix} left @param {Matrix} right
[ "multiplies", "{", "left", "}", "and", "{", "right", "}", "weight", "by", "{", "from", "}", "deltas", "into", "{", "left", "}", "and", "{", "right", "}", "deltas" ]
ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef
https://github.com/BrainJS/brain.js/blob/ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef/dist/recurrent/matrix/multiply-element-b.js#L13-L18
train
multiply element B
[ 30522, 3853, 4800, 22086, 12260, 3672, 2497, 1006, 4031, 1010, 2187, 1010, 2157, 1007, 1063, 2005, 1006, 13075, 1045, 1027, 1014, 1025, 1045, 1026, 2187, 1012, 15871, 1012, 3091, 1025, 1045, 1009, 1009, 1007, 1063, 2187, 1012, 7160, 2015, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
testing-library/react-testing-library
src/act-compat.js
actPolyfill
function actPolyfill(cb) { ReactDOM.unstable_batchedUpdates(cb) ReactDOM.render(<div />, document.createElement('div')) }
javascript
function actPolyfill(cb) { ReactDOM.unstable_batchedUpdates(cb) ReactDOM.render(<div />, document.createElement('div')) }
[ "function", "actPolyfill", "(", "cb", ")", "{", "ReactDOM", ".", "unstable_batchedUpdates", "(", "cb", ")", "ReactDOM", ".", "render", "(", "<", "div", "/", ">", ",", "document", ".", "createElement", "(", "'div'", ")", ")", "}" ]
act is supported react-dom@16.8.0 so for versions that don't have act from test utils we do this little polyfill. No warnings, but it's better than nothing.
[ "act", "is", "supported", "react", "-", "dom" ]
960451b00196352fc3085a3d1bb233b5b85f454b
https://github.com/testing-library/react-testing-library/blob/960451b00196352fc3085a3d1bb233b5b85f454b/src/act-compat.js#L33-L36
train
act polyfill
[ 30522, 3853, 2552, 18155, 2100, 8873, 3363, 1006, 17324, 1007, 1063, 10509, 9527, 1012, 14480, 1035, 14108, 2098, 6279, 27122, 1006, 17324, 1007, 10509, 9527, 30524, 3672, 1006, 1005, 4487, 2615, 1005, 1007, 1007, 1065, 102, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aframevr/aframe
src/components/look-controls.js
function () { var el = this.el; this.savedPose.position.copy(el.object3D.position); this.savedPose.rotation.copy(el.object3D.rotation); this.hasSavedPose = true; }
javascript
function () { var el = this.el; this.savedPose.position.copy(el.object3D.position); this.savedPose.rotation.copy(el.object3D.rotation); this.hasSavedPose = true; }
[ "function", "(", ")", "{", "var", "el", "=", "this", ".", "el", ";", "this", ".", "savedPose", ".", "position", ".", "copy", "(", "el", ".", "object3D", ".", "position", ")", ";", "this", ".", "savedPose", ".", "rotation", ".", "copy", "(", "el", ...
Save camera pose before entering VR to restore later if exiting.
[ "Save", "camera", "pose", "before", "entering", "VR", "to", "restore", "later", "if", "exiting", "." ]
24acc78a7299a4cdfe3ef617f4d40ddf6275c992
https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/look-controls.js#L409-L415
train
Save pose to saved position rotation and position
[ 30522, 3853, 1006, 1007, 1063, 13075, 3449, 1027, 2023, 1012, 3449, 1025, 2023, 1012, 5552, 20688, 1012, 2597, 1012, 6100, 1006, 3449, 1012, 4874, 29097, 1012, 2597, 1007, 1025, 2023, 1012, 5552, 20688, 1012, 9963, 1012, 6100, 1006, 3449, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/code-path-analysis/code-path-state.js
getBreakContext
function getBreakContext(state, label) { let context = state.breakContext; while (context) { if (label ? context.label === label : context.breakable) { return context; } context = context.upper; } /* istanbul ignore next: foolproof (syntax error) */ return null; }
javascript
function getBreakContext(state, label) { let context = state.breakContext; while (context) { if (label ? context.label === label : context.breakable) { return context; } context = context.upper; } /* istanbul ignore next: foolproof (syntax error) */ return null; }
[ "function", "getBreakContext", "(", "state", ",", "label", ")", "{", "let", "context", "=", "state", ".", "breakContext", ";", "while", "(", "context", ")", "{", "if", "(", "label", "?", "context", ".", "label", "===", "label", ":", "context", ".", "br...
Gets a context for a `break` statement. @param {CodePathState} state - A state to get. @param {string} label - The label of a `break` statement. @returns {LoopContext|SwitchContext} A context for a `break` statement.
[ "Gets", "a", "context", "for", "a", "break", "statement", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/code-path-analysis/code-path-state.js#L75-L87
train
Get the break context for a given label
[ 30522, 3853, 2131, 23890, 8663, 18209, 1006, 2110, 1010, 3830, 1007, 1063, 2292, 6123, 1027, 2110, 1012, 3338, 8663, 18209, 1025, 2096, 1006, 6123, 1007, 1063, 2065, 1006, 3830, 1029, 6123, 1012, 3830, 1027, 1027, 1027, 3830, 1024, 6123, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/Utils.js
function(sLogType, aMessageComponents, aValuesToInsert, sCallStack) { var sLogMessage = aMessageComponents.join(' '); sLogMessage = formatMessage(sLogMessage, aValuesToInsert); this.log[sLogType](sLogMessage, sCallStack || ""); }
javascript
function(sLogType, aMessageComponents, aValuesToInsert, sCallStack) { var sLogMessage = aMessageComponents.join(' '); sLogMessage = formatMessage(sLogMessage, aValuesToInsert); this.log[sLogType](sLogMessage, sCallStack || ""); }
[ "function", "(", "sLogType", ",", "aMessageComponents", ",", "aValuesToInsert", ",", "sCallStack", ")", "{", "var", "sLogMessage", "=", "aMessageComponents", ".", "join", "(", "' '", ")", ";", "sLogMessage", "=", "formatMessage", "(", "sLogMessage", ",", "aValue...
Formats the log message by replacing placeholders with values and logging the message. @param {string} sLogType - Logging type to be used. Possible values: info | warning | debug | error @param {array.<string>} aMessageComponents - Individual parts of the message text @param {array.<any>} aValuesToInsert - The values to be used instead of the placeholders in the message @param {string} [sCallStack] - Passes the callstack to the logging function
[ "Formats", "the", "log", "message", "by", "replacing", "placeholders", "with", "values", "and", "logging", "the", "message", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L90-L94
train
Log a message to the log file
[ 30522, 3853, 1006, 22889, 8649, 13874, 1010, 19900, 3736, 3351, 9006, 29513, 7666, 1010, 10927, 7630, 4355, 28765, 8043, 2102, 1010, 8040, 8095, 9153, 3600, 1007, 1063, 13075, 22889, 8649, 7834, 3736, 3351, 1027, 19900, 3736, 3351, 9006, 29...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/components/tooltip/tooltip.js
MdTooltipDirective
function MdTooltipDirective($timeout, $window, $$rAF, $document, $interpolate, $mdUtil, $mdPanel, $$mdTooltipRegistry) { var ENTER_EVENTS = 'focus touchstart mouseenter'; var LEAVE_EVENTS = 'blur touchcancel mouseleave'; var TOOLTIP_DEFAULT_Z_INDEX = 100; var TOOLTIP_DEFAULT_SHOW_DELAY = 0; var TOOLTIP_DEFAULT_DIRECTION = 'bottom'; var TOOLTIP_DIRECTIONS = { top: { x: $mdPanel.xPosition.CENTER, y: $mdPanel.yPosition.ABOVE }, right: { x: $mdPanel.xPosition.OFFSET_END, y: $mdPanel.yPosition.CENTER }, bottom: { x: $mdPanel.xPosition.CENTER, y: $mdPanel.yPosition.BELOW }, left: { x: $mdPanel.xPosition.OFFSET_START, y: $mdPanel.yPosition.CENTER } }; return { restrict: 'E', priority: 210, // Before ngAria scope: { mdZIndex: '=?mdZIndex', mdDelay: '=?mdDelay', mdVisible: '=?mdVisible', mdAutohide: '=?mdAutohide', mdDirection: '@?mdDirection' // Do not expect expressions. }, link: linkFunc }; function linkFunc(scope, element, attr) { // Set constants. var tooltipId = 'md-tooltip-' + $mdUtil.nextUid(); var parent = $mdUtil.getParentWithPointerEvents(element); var debouncedOnResize = $$rAF.throttle(updatePosition); var mouseActive = false; var origin, position, panelPosition, panelRef, autohide, showTimeout, elementFocusedOnWindowBlur = null; // Set defaults setDefaults(); // Set parent aria-label. addAriaLabel(); // Remove the element from its current DOM position. element.detach(); updatePosition(); bindEvents(); configureWatchers(); function setDefaults() { scope.mdZIndex = scope.mdZIndex || TOOLTIP_DEFAULT_Z_INDEX; scope.mdDelay = scope.mdDelay || TOOLTIP_DEFAULT_SHOW_DELAY; if (!TOOLTIP_DIRECTIONS[scope.mdDirection]) { scope.mdDirection = TOOLTIP_DEFAULT_DIRECTION; } } function addAriaLabel(labelText) { // Only interpolate the text from the HTML element because otherwise the custom text could // be interpolated twice and cause XSS violations. var interpolatedText = labelText || $interpolate(element.text().trim())(scope.$parent); // Only add the `aria-label` to the parent if there isn't already one, if there isn't an // already present `aria-labelledby`, or if the previous `aria-label` was added by the // tooltip directive. if ( (!parent.attr('aria-label') && !parent.attr('aria-labelledby')) || parent.attr('md-labeled-by-tooltip') ) { parent.attr('aria-label', interpolatedText); // Set the `md-labeled-by-tooltip` attribute if it has not already been set. if (!parent.attr('md-labeled-by-tooltip')) { parent.attr('md-labeled-by-tooltip', tooltipId); } } } function updatePosition() { setDefaults(); // If the panel has already been created, remove the current origin // class from the panel element. if (panelRef && panelRef.panelEl) { panelRef.panelEl.removeClass(origin); } // Set the panel element origin class based off of the current // mdDirection. origin = 'md-origin-' + scope.mdDirection; // Create the position of the panel based off of the mdDirection. position = TOOLTIP_DIRECTIONS[scope.mdDirection]; // Using the newly created position object, use the MdPanel // panelPosition API to build the panel's position. panelPosition = $mdPanel.newPanelPosition() .relativeTo(parent) .addPanelPosition(position.x, position.y); // If the panel has already been created, add the new origin class to // the panel element and update it's position with the panelPosition. if (panelRef && panelRef.panelEl) { panelRef.panelEl.addClass(origin); panelRef.updatePosition(panelPosition); } } function bindEvents() { // Add a mutationObserver where there is support for it and the need // for it in the form of viable host(parent[0]). if (parent[0] && 'MutationObserver' in $window) { // Use a mutationObserver to tackle #2602. var attributeObserver = new MutationObserver(function(mutations) { if (isDisabledMutation(mutations)) { $mdUtil.nextTick(function() { setVisible(false); }); } }); attributeObserver.observe(parent[0], { attributes: true }); } elementFocusedOnWindowBlur = false; $$mdTooltipRegistry.register('scroll', windowScrollEventHandler, true); $$mdTooltipRegistry.register('blur', windowBlurEventHandler); $$mdTooltipRegistry.register('resize', debouncedOnResize); scope.$on('$destroy', onDestroy); // To avoid 'synthetic clicks', we listen to mousedown instead of // 'click'. parent.on('mousedown', mousedownEventHandler); parent.on(ENTER_EVENTS, enterEventHandler); function isDisabledMutation(mutations) { mutations.some(function(mutation) { return mutation.attributeName === 'disabled' && parent[0].disabled; }); return false; } function windowScrollEventHandler() { setVisible(false); } function windowBlurEventHandler() { elementFocusedOnWindowBlur = document.activeElement === parent[0]; } function enterEventHandler($event) { // Prevent the tooltip from showing when the window is receiving // focus. if ($event.type === 'focus' && elementFocusedOnWindowBlur) { elementFocusedOnWindowBlur = false; } else if (!scope.mdVisible) { parent.on(LEAVE_EVENTS, leaveEventHandler); setVisible(true); // If the user is on a touch device, we should bind the tap away // after the 'touched' in order to prevent the tooltip being // removed immediately. if ($event.type === 'touchstart') { parent.one('touchend', function() { $mdUtil.nextTick(function() { $document.one('touchend', leaveEventHandler); }, false); }); } } } function leaveEventHandler() { autohide = scope.hasOwnProperty('mdAutohide') ? scope.mdAutohide : attr.hasOwnProperty('mdAutohide'); if (autohide || mouseActive || $document[0].activeElement !== parent[0]) { // When a show timeout is currently in progress, then we have // to cancel it, otherwise the tooltip will remain showing // without focus or hover. if (showTimeout) { $timeout.cancel(showTimeout); setVisible.queued = false; showTimeout = null; } parent.off(LEAVE_EVENTS, leaveEventHandler); parent.triggerHandler('blur'); setVisible(false); } mouseActive = false; } function mousedownEventHandler() { mouseActive = true; } function onDestroy() { $$mdTooltipRegistry.deregister('scroll', windowScrollEventHandler, true); $$mdTooltipRegistry.deregister('blur', windowBlurEventHandler); $$mdTooltipRegistry.deregister('resize', debouncedOnResize); parent .off(ENTER_EVENTS, enterEventHandler) .off(LEAVE_EVENTS, leaveEventHandler) .off('mousedown', mousedownEventHandler); // Trigger the handler in case any of the tooltips are // still visible. leaveEventHandler(); attributeObserver && attributeObserver.disconnect(); } } function configureWatchers() { if (element[0] && 'MutationObserver' in $window) { var attributeObserver = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.attributeName === 'md-visible' && !scope.visibleWatcher) { scope.visibleWatcher = scope.$watch('mdVisible', onVisibleChanged); } }); }); attributeObserver.observe(element[0], { attributes: true }); // Build watcher only if mdVisible is being used. if (attr.hasOwnProperty('mdVisible')) { scope.visibleWatcher = scope.$watch('mdVisible', onVisibleChanged); } } else { // MutationObserver not supported scope.visibleWatcher = scope.$watch('mdVisible', onVisibleChanged); } // Direction watcher scope.$watch('mdDirection', updatePosition); // Clean up if the element or parent was removed via jqLite's .remove. // A couple of notes: // - In these cases the scope might not have been destroyed, which // is why we destroy it manually. An example of this can be having // `md-visible="false"` and adding tooltips while they're // invisible. If `md-visible` becomes true, at some point, you'd // usually get a lot of tooltips. // - We use `.one`, not `.on`, because this only needs to fire once. // If we were using `.on`, it would get thrown into an infinite // loop. // - This kicks off the scope's `$destroy` event which finishes the // cleanup. element.one('$destroy', onElementDestroy); parent.one('$destroy', onElementDestroy); scope.$on('$destroy', function() { setVisible(false); panelRef && panelRef.destroy(); attributeObserver && attributeObserver.disconnect(); element.remove(); }); // Updates the aria-label when the element text changes. This watch // doesn't need to be set up if the element doesn't have any data // bindings. if (element.text().indexOf($interpolate.startSymbol()) > -1) { scope.$watch(function() { return element.text().trim(); }, addAriaLabel); } function onElementDestroy() { scope.$destroy(); } } function setVisible(value) { // Break if passed value is already in queue or there is no queue and // passed value is current in the controller. if (setVisible.queued && setVisible.value === !!value || !setVisible.queued && scope.mdVisible === !!value) { return; } setVisible.value = !!value; if (!setVisible.queued) { if (value) { setVisible.queued = true; showTimeout = $timeout(function() { scope.mdVisible = setVisible.value; setVisible.queued = false; showTimeout = null; if (!scope.visibleWatcher) { onVisibleChanged(scope.mdVisible); } }, scope.mdDelay); } else { $mdUtil.nextTick(function() { scope.mdVisible = false; if (!scope.visibleWatcher) { onVisibleChanged(false); } }); } } } function onVisibleChanged(isVisible) { isVisible ? showTooltip() : hideTooltip(); } function showTooltip() { // Do not show the tooltip if the text is empty. if (!element[0].textContent.trim()) { throw new Error('Text for the tooltip has not been provided. ' + 'Please include text within the mdTooltip element.'); } if (!panelRef) { var attachTo = angular.element(document.body); var panelAnimation = $mdPanel.newPanelAnimation() .openFrom(parent) .closeTo(parent) .withAnimation({ open: 'md-show', close: 'md-hide' }); var panelConfig = { id: tooltipId, attachTo: attachTo, contentElement: element, propagateContainerEvents: true, panelClass: 'md-tooltip', animation: panelAnimation, position: panelPosition, zIndex: scope.mdZIndex, focusOnOpen: false, onDomAdded: function() { panelRef.panelEl.addClass(origin); } }; panelRef = $mdPanel.create(panelConfig); } panelRef.open().then(function() { panelRef.panelEl.attr('role', 'tooltip'); }); } function hideTooltip() { panelRef && panelRef.close(); } } }
javascript
function MdTooltipDirective($timeout, $window, $$rAF, $document, $interpolate, $mdUtil, $mdPanel, $$mdTooltipRegistry) { var ENTER_EVENTS = 'focus touchstart mouseenter'; var LEAVE_EVENTS = 'blur touchcancel mouseleave'; var TOOLTIP_DEFAULT_Z_INDEX = 100; var TOOLTIP_DEFAULT_SHOW_DELAY = 0; var TOOLTIP_DEFAULT_DIRECTION = 'bottom'; var TOOLTIP_DIRECTIONS = { top: { x: $mdPanel.xPosition.CENTER, y: $mdPanel.yPosition.ABOVE }, right: { x: $mdPanel.xPosition.OFFSET_END, y: $mdPanel.yPosition.CENTER }, bottom: { x: $mdPanel.xPosition.CENTER, y: $mdPanel.yPosition.BELOW }, left: { x: $mdPanel.xPosition.OFFSET_START, y: $mdPanel.yPosition.CENTER } }; return { restrict: 'E', priority: 210, // Before ngAria scope: { mdZIndex: '=?mdZIndex', mdDelay: '=?mdDelay', mdVisible: '=?mdVisible', mdAutohide: '=?mdAutohide', mdDirection: '@?mdDirection' // Do not expect expressions. }, link: linkFunc }; function linkFunc(scope, element, attr) { // Set constants. var tooltipId = 'md-tooltip-' + $mdUtil.nextUid(); var parent = $mdUtil.getParentWithPointerEvents(element); var debouncedOnResize = $$rAF.throttle(updatePosition); var mouseActive = false; var origin, position, panelPosition, panelRef, autohide, showTimeout, elementFocusedOnWindowBlur = null; // Set defaults setDefaults(); // Set parent aria-label. addAriaLabel(); // Remove the element from its current DOM position. element.detach(); updatePosition(); bindEvents(); configureWatchers(); function setDefaults() { scope.mdZIndex = scope.mdZIndex || TOOLTIP_DEFAULT_Z_INDEX; scope.mdDelay = scope.mdDelay || TOOLTIP_DEFAULT_SHOW_DELAY; if (!TOOLTIP_DIRECTIONS[scope.mdDirection]) { scope.mdDirection = TOOLTIP_DEFAULT_DIRECTION; } } function addAriaLabel(labelText) { // Only interpolate the text from the HTML element because otherwise the custom text could // be interpolated twice and cause XSS violations. var interpolatedText = labelText || $interpolate(element.text().trim())(scope.$parent); // Only add the `aria-label` to the parent if there isn't already one, if there isn't an // already present `aria-labelledby`, or if the previous `aria-label` was added by the // tooltip directive. if ( (!parent.attr('aria-label') && !parent.attr('aria-labelledby')) || parent.attr('md-labeled-by-tooltip') ) { parent.attr('aria-label', interpolatedText); // Set the `md-labeled-by-tooltip` attribute if it has not already been set. if (!parent.attr('md-labeled-by-tooltip')) { parent.attr('md-labeled-by-tooltip', tooltipId); } } } function updatePosition() { setDefaults(); // If the panel has already been created, remove the current origin // class from the panel element. if (panelRef && panelRef.panelEl) { panelRef.panelEl.removeClass(origin); } // Set the panel element origin class based off of the current // mdDirection. origin = 'md-origin-' + scope.mdDirection; // Create the position of the panel based off of the mdDirection. position = TOOLTIP_DIRECTIONS[scope.mdDirection]; // Using the newly created position object, use the MdPanel // panelPosition API to build the panel's position. panelPosition = $mdPanel.newPanelPosition() .relativeTo(parent) .addPanelPosition(position.x, position.y); // If the panel has already been created, add the new origin class to // the panel element and update it's position with the panelPosition. if (panelRef && panelRef.panelEl) { panelRef.panelEl.addClass(origin); panelRef.updatePosition(panelPosition); } } function bindEvents() { // Add a mutationObserver where there is support for it and the need // for it in the form of viable host(parent[0]). if (parent[0] && 'MutationObserver' in $window) { // Use a mutationObserver to tackle #2602. var attributeObserver = new MutationObserver(function(mutations) { if (isDisabledMutation(mutations)) { $mdUtil.nextTick(function() { setVisible(false); }); } }); attributeObserver.observe(parent[0], { attributes: true }); } elementFocusedOnWindowBlur = false; $$mdTooltipRegistry.register('scroll', windowScrollEventHandler, true); $$mdTooltipRegistry.register('blur', windowBlurEventHandler); $$mdTooltipRegistry.register('resize', debouncedOnResize); scope.$on('$destroy', onDestroy); // To avoid 'synthetic clicks', we listen to mousedown instead of // 'click'. parent.on('mousedown', mousedownEventHandler); parent.on(ENTER_EVENTS, enterEventHandler); function isDisabledMutation(mutations) { mutations.some(function(mutation) { return mutation.attributeName === 'disabled' && parent[0].disabled; }); return false; } function windowScrollEventHandler() { setVisible(false); } function windowBlurEventHandler() { elementFocusedOnWindowBlur = document.activeElement === parent[0]; } function enterEventHandler($event) { // Prevent the tooltip from showing when the window is receiving // focus. if ($event.type === 'focus' && elementFocusedOnWindowBlur) { elementFocusedOnWindowBlur = false; } else if (!scope.mdVisible) { parent.on(LEAVE_EVENTS, leaveEventHandler); setVisible(true); // If the user is on a touch device, we should bind the tap away // after the 'touched' in order to prevent the tooltip being // removed immediately. if ($event.type === 'touchstart') { parent.one('touchend', function() { $mdUtil.nextTick(function() { $document.one('touchend', leaveEventHandler); }, false); }); } } } function leaveEventHandler() { autohide = scope.hasOwnProperty('mdAutohide') ? scope.mdAutohide : attr.hasOwnProperty('mdAutohide'); if (autohide || mouseActive || $document[0].activeElement !== parent[0]) { // When a show timeout is currently in progress, then we have // to cancel it, otherwise the tooltip will remain showing // without focus or hover. if (showTimeout) { $timeout.cancel(showTimeout); setVisible.queued = false; showTimeout = null; } parent.off(LEAVE_EVENTS, leaveEventHandler); parent.triggerHandler('blur'); setVisible(false); } mouseActive = false; } function mousedownEventHandler() { mouseActive = true; } function onDestroy() { $$mdTooltipRegistry.deregister('scroll', windowScrollEventHandler, true); $$mdTooltipRegistry.deregister('blur', windowBlurEventHandler); $$mdTooltipRegistry.deregister('resize', debouncedOnResize); parent .off(ENTER_EVENTS, enterEventHandler) .off(LEAVE_EVENTS, leaveEventHandler) .off('mousedown', mousedownEventHandler); // Trigger the handler in case any of the tooltips are // still visible. leaveEventHandler(); attributeObserver && attributeObserver.disconnect(); } } function configureWatchers() { if (element[0] && 'MutationObserver' in $window) { var attributeObserver = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.attributeName === 'md-visible' && !scope.visibleWatcher) { scope.visibleWatcher = scope.$watch('mdVisible', onVisibleChanged); } }); }); attributeObserver.observe(element[0], { attributes: true }); // Build watcher only if mdVisible is being used. if (attr.hasOwnProperty('mdVisible')) { scope.visibleWatcher = scope.$watch('mdVisible', onVisibleChanged); } } else { // MutationObserver not supported scope.visibleWatcher = scope.$watch('mdVisible', onVisibleChanged); } // Direction watcher scope.$watch('mdDirection', updatePosition); // Clean up if the element or parent was removed via jqLite's .remove. // A couple of notes: // - In these cases the scope might not have been destroyed, which // is why we destroy it manually. An example of this can be having // `md-visible="false"` and adding tooltips while they're // invisible. If `md-visible` becomes true, at some point, you'd // usually get a lot of tooltips. // - We use `.one`, not `.on`, because this only needs to fire once. // If we were using `.on`, it would get thrown into an infinite // loop. // - This kicks off the scope's `$destroy` event which finishes the // cleanup. element.one('$destroy', onElementDestroy); parent.one('$destroy', onElementDestroy); scope.$on('$destroy', function() { setVisible(false); panelRef && panelRef.destroy(); attributeObserver && attributeObserver.disconnect(); element.remove(); }); // Updates the aria-label when the element text changes. This watch // doesn't need to be set up if the element doesn't have any data // bindings. if (element.text().indexOf($interpolate.startSymbol()) > -1) { scope.$watch(function() { return element.text().trim(); }, addAriaLabel); } function onElementDestroy() { scope.$destroy(); } } function setVisible(value) { // Break if passed value is already in queue or there is no queue and // passed value is current in the controller. if (setVisible.queued && setVisible.value === !!value || !setVisible.queued && scope.mdVisible === !!value) { return; } setVisible.value = !!value; if (!setVisible.queued) { if (value) { setVisible.queued = true; showTimeout = $timeout(function() { scope.mdVisible = setVisible.value; setVisible.queued = false; showTimeout = null; if (!scope.visibleWatcher) { onVisibleChanged(scope.mdVisible); } }, scope.mdDelay); } else { $mdUtil.nextTick(function() { scope.mdVisible = false; if (!scope.visibleWatcher) { onVisibleChanged(false); } }); } } } function onVisibleChanged(isVisible) { isVisible ? showTooltip() : hideTooltip(); } function showTooltip() { // Do not show the tooltip if the text is empty. if (!element[0].textContent.trim()) { throw new Error('Text for the tooltip has not been provided. ' + 'Please include text within the mdTooltip element.'); } if (!panelRef) { var attachTo = angular.element(document.body); var panelAnimation = $mdPanel.newPanelAnimation() .openFrom(parent) .closeTo(parent) .withAnimation({ open: 'md-show', close: 'md-hide' }); var panelConfig = { id: tooltipId, attachTo: attachTo, contentElement: element, propagateContainerEvents: true, panelClass: 'md-tooltip', animation: panelAnimation, position: panelPosition, zIndex: scope.mdZIndex, focusOnOpen: false, onDomAdded: function() { panelRef.panelEl.addClass(origin); } }; panelRef = $mdPanel.create(panelConfig); } panelRef.open().then(function() { panelRef.panelEl.attr('role', 'tooltip'); }); } function hideTooltip() { panelRef && panelRef.close(); } } }
[ "function", "MdTooltipDirective", "(", "$timeout", ",", "$window", ",", "$$rAF", ",", "$document", ",", "$interpolate", ",", "$mdUtil", ",", "$mdPanel", ",", "$$mdTooltipRegistry", ")", "{", "var", "ENTER_EVENTS", "=", "'focus touchstart mouseenter'", ";", "var", ...
@ngdoc directive @name mdTooltip @module material.components.tooltip @description Tooltips are used to describe elements that are interactive and primarily graphical (not textual). Place a `<md-tooltip>` as a child of the element it describes. A tooltip will activate when the user hovers over, focuses, or touches the parent element. @usage <hljs lang="html"> <md-button class="md-fab md-accent" aria-label="Play"> <md-tooltip>Play Music</md-tooltip> <md-icon md-svg-src="img/icons/ic_play_arrow_24px.svg"></md-icon> </md-button> </hljs> @param {number=} md-z-index The visual level that the tooltip will appear in comparison with the rest of the elements of the application. @param {expression=} md-visible Boolean bound to whether the tooltip is currently visible. @param {number=} md-delay How many milliseconds to wait to show the tooltip after the user hovers over, focuses, or touches the parent element. Defaults to 0ms on non-touch devices and 75ms on touch. @param {boolean=} md-autohide If present or provided with a boolean value, the tooltip will hide on mouse leave, regardless of focus. @param {string=} md-direction The direction that the tooltip is shown, relative to the parent element. Supports top, right, bottom, and left. Defaults to bottom.
[ "@ngdoc", "directive", "@name", "mdTooltip", "@module", "material", ".", "components", ".", "tooltip", "@description", "Tooltips", "are", "used", "to", "describe", "elements", "that", "are", "interactive", "and", "primarily", "graphical", "(", "not", "textual", ")...
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tooltip/tooltip.js#L48-L413
train
A directive that displays the tooltip in the DOM.
[ 30522, 3853, 9108, 3406, 27914, 11514, 4305, 2890, 15277, 1006, 1002, 2051, 5833, 1010, 1002, 3332, 1010, 1002, 1002, 7148, 1010, 1002, 6254, 1010, 1002, 6970, 18155, 3686, 1010, 1002, 9108, 21823, 2140, 1010, 1002, 9108, 9739, 2884, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/view/ThemeManager.js
refresh
function refresh(force) { if (force) { currentTheme = null; } $.when(force && loadCurrentTheme()).done(function () { var editor = EditorManager.getActiveEditor(); if (!editor || !editor._codeMirror) { return; } var cm = editor._codeMirror; ThemeView.updateThemes(cm); // currentTheme can be undefined, so watch out cm.setOption("addModeClass", !!(currentTheme && currentTheme.addModeClass)); }); }
javascript
function refresh(force) { if (force) { currentTheme = null; } $.when(force && loadCurrentTheme()).done(function () { var editor = EditorManager.getActiveEditor(); if (!editor || !editor._codeMirror) { return; } var cm = editor._codeMirror; ThemeView.updateThemes(cm); // currentTheme can be undefined, so watch out cm.setOption("addModeClass", !!(currentTheme && currentTheme.addModeClass)); }); }
[ "function", "refresh", "(", "force", ")", "{", "if", "(", "force", ")", "{", "currentTheme", "=", "null", ";", "}", "$", ".", "when", "(", "force", "&&", "loadCurrentTheme", "(", ")", ")", ".", "done", "(", "function", "(", ")", "{", "var", "editor...
Refresh current theme in the editor @param {boolean} force Forces a reload of the current theme. It reloads the theme file.
[ "Refresh", "current", "theme", "in", "the", "editor" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeManager.js#L254-L271
train
refresh theme view
[ 30522, 3853, 25416, 21898, 30524, 1007, 1063, 13075, 3559, 1027, 3559, 24805, 4590, 1012, 2131, 19620, 2098, 15660, 1006, 1007, 1025, 2065, 1006, 999, 3559, 1064, 1064, 999, 3559, 1012, 1035, 3642, 14503, 29165, 1007, 1063, 2709, 1025, 1065...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
blueimp/jQuery-File-Upload
js/jquery.fileupload-ui.js
function (e, data) { if (e.isDefaultPrevented()) { return false; } var that = $(this).data('blueimp-fileupload') || $(this).data('fileupload'), removeNode = function () { that._transition(data.context).done( function () { $(this).remove(); that._trigger('destroyed', e, data); } ); }; if (data.url) { data.dataType = data.dataType || that.options.dataType; $.ajax(data).done(removeNode).fail(function () { that._trigger('destroyfailed', e, data); }); } else { removeNode(); } }
javascript
function (e, data) { if (e.isDefaultPrevented()) { return false; } var that = $(this).data('blueimp-fileupload') || $(this).data('fileupload'), removeNode = function () { that._transition(data.context).done( function () { $(this).remove(); that._trigger('destroyed', e, data); } ); }; if (data.url) { data.dataType = data.dataType || that.options.dataType; $.ajax(data).done(removeNode).fail(function () { that._trigger('destroyfailed', e, data); }); } else { removeNode(); } }
[ "function", "(", "e", ",", "data", ")", "{", "if", "(", "e", ".", "isDefaultPrevented", "(", ")", ")", "{", "return", "false", ";", "}", "var", "that", "=", "$", "(", "this", ")", ".", "data", "(", "'blueimp-fileupload'", ")", "||", "$", "(", "th...
Callback for file deletion:
[ "Callback", "for", "file", "deletion", ":" ]
4586771d65482dc9678c7e48d245a1501bf96ff5
https://github.com/blueimp/jQuery-File-Upload/blob/4586771d65482dc9678c7e48d245a1501bf96ff5/js/jquery.fileupload-ui.js#L371-L393
train
Called when the file upload is destroyed
[ 30522, 3853, 1006, 1041, 1010, 2951, 1007, 1063, 2065, 1006, 1041, 1012, 2003, 3207, 7011, 11314, 28139, 15338, 2098, 1006, 1007, 1007, 1063, 2709, 6270, 1025, 1065, 13075, 2008, 1027, 1002, 1006, 2023, 1007, 1012, 2951, 1006, 1005, 2630, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
google/closure-library
closure/goog/html/sanitizer/safedomtreeprocessor.js
getDomTreeWalker
function getDomTreeWalker(html) { var iteratorParent; var safeHtml = uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract( Const.from('Never attached to DOM.'), html); // Use a <template> element if possible. var templateElement = document.createElement('template'); if ('content' in templateElement) { safe.unsafeSetInnerHtmlDoNotUseOrElse(templateElement, safeHtml); iteratorParent = templateElement.content; } else { // In browsers where <template> is not implemented, use an inert // HTMLDocument. var doc = document.implementation.createHTMLDocument('x'); iteratorParent = doc.body; safe.unsafeSetInnerHtmlDoNotUseOrElse(doc.body, safeHtml); } return document.createTreeWalker( iteratorParent, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, null /* filter */, false /* entityReferenceExpansion */); }
javascript
function getDomTreeWalker(html) { var iteratorParent; var safeHtml = uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract( Const.from('Never attached to DOM.'), html); // Use a <template> element if possible. var templateElement = document.createElement('template'); if ('content' in templateElement) { safe.unsafeSetInnerHtmlDoNotUseOrElse(templateElement, safeHtml); iteratorParent = templateElement.content; } else { // In browsers where <template> is not implemented, use an inert // HTMLDocument. var doc = document.implementation.createHTMLDocument('x'); iteratorParent = doc.body; safe.unsafeSetInnerHtmlDoNotUseOrElse(doc.body, safeHtml); } return document.createTreeWalker( iteratorParent, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, null /* filter */, false /* entityReferenceExpansion */); }
[ "function", "getDomTreeWalker", "(", "html", ")", "{", "var", "iteratorParent", ";", "var", "safeHtml", "=", "uncheckedconversions", ".", "safeHtmlFromStringKnownToSatisfyTypeContract", "(", "Const", ".", "from", "(", "'Never attached to DOM.'", ")", ",", "html", ")",...
Parses a string of unsanitized HTML and provides an iterator over the resulting DOM tree nodes. The parsing operation is inert (that is, it does not cause execution of any active content or cause the browser to issue any requests). The returned iterator is guaranteed to iterate over a parent element before iterating over any of its children. @param {string} html @return {!TreeWalker}
[ "Parses", "a", "string", "of", "unsanitized", "HTML", "and", "provides", "an", "iterator", "over", "the", "resulting", "DOM", "tree", "nodes", ".", "The", "parsing", "operation", "is", "inert", "(", "that", "is", "it", "does", "not", "cause", "execution", ...
97390e9ca4483cebb9628e06026139fbb3023d65
https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/closure/goog/html/sanitizer/safedomtreeprocessor.js#L60-L80
train
Returns a treeWalker for the given HTML string.
[ 30522, 3853, 2131, 9527, 13334, 26965, 1006, 16129, 1007, 1063, 13075, 2009, 6906, 4263, 19362, 4765, 1025, 13075, 3647, 11039, 19968, 1027, 4895, 5403, 18141, 8663, 27774, 2015, 1012, 3647, 11039, 19968, 19699, 22225, 18886, 3070, 2243, 1977...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/search/FindInFiles.js
_addSearchResultsForEntries
function _addSearchResultsForEntries(entries) { var fullPaths = []; return Async.doInParallel(entries, function (entry) { var addedFiles = [], addedFilePaths = [], deferred = new $.Deferred(); // gather up added files var visitor = function (child) { // Replicate filtering that getAllFiles() does if (ProjectManager.shouldShow(child)) { if (child.isFile && _isReadableText(child.name)) { // Re-check the filtering that the initial search applied if (_inSearchScope(child)) { addedFiles.push(child); addedFilePaths.push(child.fullPath); } } return true; } return false; }; entry.visit(visitor, function (err) { if (err) { deferred.reject(err); return; } //node Search : inform node about the file changes //filesChanged(addedFilePaths); fullPaths = fullPaths.concat(addedFilePaths); if (findOrReplaceInProgress) { // find additional matches in all added files Async.doInParallel(addedFiles, function (file) { return _doSearchInOneFile(file) .done(function (foundMatches) { resultsChanged = resultsChanged || foundMatches; }); }).always(deferred.resolve); } else { deferred.resolve(); } }); return deferred.promise(); }).always(function () { // this should be called once with a large array instead of numerous calls with single items filesChanged(fullPaths); }); }
javascript
function _addSearchResultsForEntries(entries) { var fullPaths = []; return Async.doInParallel(entries, function (entry) { var addedFiles = [], addedFilePaths = [], deferred = new $.Deferred(); // gather up added files var visitor = function (child) { // Replicate filtering that getAllFiles() does if (ProjectManager.shouldShow(child)) { if (child.isFile && _isReadableText(child.name)) { // Re-check the filtering that the initial search applied if (_inSearchScope(child)) { addedFiles.push(child); addedFilePaths.push(child.fullPath); } } return true; } return false; }; entry.visit(visitor, function (err) { if (err) { deferred.reject(err); return; } //node Search : inform node about the file changes //filesChanged(addedFilePaths); fullPaths = fullPaths.concat(addedFilePaths); if (findOrReplaceInProgress) { // find additional matches in all added files Async.doInParallel(addedFiles, function (file) { return _doSearchInOneFile(file) .done(function (foundMatches) { resultsChanged = resultsChanged || foundMatches; }); }).always(deferred.resolve); } else { deferred.resolve(); } }); return deferred.promise(); }).always(function () { // this should be called once with a large array instead of numerous calls with single items filesChanged(fullPaths); }); }
[ "function", "_addSearchResultsForEntries", "(", "entries", ")", "{", "var", "fullPaths", "=", "[", "]", ";", "return", "Async", ".", "doInParallel", "(", "entries", ",", "function", "(", "entry", ")", "{", "var", "addedFiles", "=", "[", "]", ",", "addedFil...
/* Add new search results for these entries and all of its children @param {Array.<(File|Directory)>} entries @return {jQuery.Promise} Resolves when the results have been added
[ "/", "*", "Add", "new", "search", "results", "for", "these", "entries", "and", "all", "of", "its", "children" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L775-L826
train
Add search results for all entries
[ 30522, 3853, 1035, 9909, 14644, 2818, 6072, 11314, 22747, 5686, 3372, 5134, 1006, 10445, 1007, 1063, 13075, 2440, 15069, 2015, 1027, 1031, 1033, 1025, 2709, 2004, 6038, 2278, 1012, 24341, 28689, 6216, 2140, 1006, 10445, 1010, 3853, 1006, 44...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/document/DocumentManager.js
getCurrentDocument
function getCurrentDocument() { var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE); if (file) { return getOpenDocumentForPath(file.fullPath); } return null; }
javascript
function getCurrentDocument() { var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE); if (file) { return getOpenDocumentForPath(file.fullPath); } return null; }
[ "function", "getCurrentDocument", "(", ")", "{", "var", "file", "=", "MainViewManager", ".", "getCurrentlyViewedFile", "(", "MainViewManager", ".", "ACTIVE_PANE", ")", ";", "if", "(", "file", ")", "{", "return", "getOpenDocumentForPath", "(", "file", ".", "fullP...
Returns the Document that is currently open in the editor UI. May be null. @return {?Document}
[ "Returns", "the", "Document", "that", "is", "currently", "open", "in", "the", "editor", "UI", ".", "May", "be", "null", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L140-L148
train
Get the current document
[ 30522, 3853, 2131, 10841, 14343, 3372, 3527, 24894, 4765, 1006, 1007, 1063, 13075, 5371, 1027, 2364, 8584, 24805, 4590, 1012, 2131, 10841, 14343, 20630, 8584, 2098, 8873, 2571, 1006, 2364, 8584, 24805, 4590, 1012, 3161, 1035, 6090, 2063, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/ODataUtils.js
function (sDate) { var oDate = rDate.test(sDate) && DateFormat.getDateInstance({ pattern : "yyyy-MM-dd", strictParsing : true, UTC : true }).parse(sDate); if (!oDate) { throw new Error("Not a valid Edm.Date value: " + sDate); } return oDate; }
javascript
function (sDate) { var oDate = rDate.test(sDate) && DateFormat.getDateInstance({ pattern : "yyyy-MM-dd", strictParsing : true, UTC : true }).parse(sDate); if (!oDate) { throw new Error("Not a valid Edm.Date value: " + sDate); } return oDate; }
[ "function", "(", "sDate", ")", "{", "var", "oDate", "=", "rDate", ".", "test", "(", "sDate", ")", "&&", "DateFormat", ".", "getDateInstance", "(", "{", "pattern", ":", "\"yyyy-MM-dd\"", ",", "strictParsing", ":", "true", ",", "UTC", ":", "true", "}", "...
Parses an "Edm.Date" value and returns the corresponding JavaScript <code>Date</code> value (UTC with a time value of "00:00:00"). @param {string} sDate The "Edm.Date" value to parse @returns {Date} The JavaScript <code>Date</code> value @throws {Error} If the input cannot be parsed @public @since 1.43.0
[ "Parses", "an", "Edm", ".", "Date", "value", "and", "returns", "the", "corresponding", "JavaScript", "<code", ">", "Date<", "/", "code", ">", "value", "(", "UTC", "with", "a", "time", "value", "of", "00", ":", "00", ":", "00", ")", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataUtils.js#L111-L122
train
Parses a Edm. Date value
[ 30522, 3853, 1006, 17371, 3686, 1007, 1063, 13075, 1051, 13701, 1027, 16428, 3686, 1012, 3231, 1006, 17371, 3686, 1007, 1004, 1004, 3058, 14192, 4017, 1012, 2131, 13701, 7076, 26897, 1006, 1063, 5418, 1024, 1000, 1061, 2100, 2100, 2100, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/base/ManagedObjectObserver.js
remove
function remove(oTarget, oListener, oConfiguration) { oConfiguration = oConfiguration || getConfiguration(oTarget, oListener); updateConfiguration(oTarget, oListener, oConfiguration, true); }
javascript
function remove(oTarget, oListener, oConfiguration) { oConfiguration = oConfiguration || getConfiguration(oTarget, oListener); updateConfiguration(oTarget, oListener, oConfiguration, true); }
[ "function", "remove", "(", "oTarget", ",", "oListener", ",", "oConfiguration", ")", "{", "oConfiguration", "=", "oConfiguration", "||", "getConfiguration", "(", "oTarget", ",", "oListener", ")", ";", "updateConfiguration", "(", "oTarget", ",", "oListener", ",", ...
removes the given configuration for the given listener from the internal list of observed targets mTargets. removes the observer from the target managed object if the target hasn't to be observed any longer
[ "removes", "the", "given", "configuration", "for", "the", "given", "listener", "from", "the", "internal", "list", "of", "observed", "targets", "mTargets", ".", "removes", "the", "observer", "from", "the", "target", "managed", "object", "if", "the", "target", "...
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ManagedObjectObserver.js#L481-L484
train
Removes the specified event listener from the target.
[ 30522, 3853, 6366, 1006, 27178, 2906, 18150, 1010, 19330, 27870, 3678, 1010, 1051, 8663, 8873, 27390, 3370, 1007, 1063, 1051, 8663, 8873, 27390, 3370, 1027, 1051, 8663, 8873, 27390, 3370, 1064, 1064, 2131, 8663, 8873, 27390, 3370, 1006, 271...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/Exact.js
function(oThis, oEvent){ oThis._sSearchQuery = oEvent.getParameter("query"); //Store the value until next Search oThis.fireSearch({query: oThis._sSearchQuery}); oThis._bDetailsVisible = true; oThis.invalidate(); }
javascript
function(oThis, oEvent){ oThis._sSearchQuery = oEvent.getParameter("query"); //Store the value until next Search oThis.fireSearch({query: oThis._sSearchQuery}); oThis._bDetailsVisible = true; oThis.invalidate(); }
[ "function", "(", "oThis", ",", "oEvent", ")", "{", "oThis", ".", "_sSearchQuery", "=", "oEvent", ".", "getParameter", "(", "\"query\"", ")", ";", "//Store the value until next Search", "oThis", ".", "fireSearch", "(", "{", "query", ":", "oThis", ".", "_sSearch...
*** Private helper functions *** Handles the search event
[ "***", "Private", "helper", "functions", "***", "Handles", "the", "search", "event" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/Exact.js#L220-L225
train
Search on the details
[ 30522, 3853, 1006, 27178, 24158, 1010, 1051, 18697, 3372, 1007, 1063, 27178, 24158, 1012, 1035, 7020, 14644, 2818, 4226, 2854, 1027, 1051, 18697, 3372, 1012, 2131, 28689, 22828, 1006, 1000, 23032, 1000, 1007, 1025, 1013, 1013, 3573, 1996, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/handlebarsFold.js
scanTextUntil
function scanTextUntil(cm, startCh, startLine, condition) { var line = cm.getLine(startLine), seen = "", characterIndex = startCh, currentLine = startLine, range; while (currentLine <= cm.lastLine()) { if (line.length === 0) { characterIndex = 0; line = cm.getLine(++currentLine); } else { seen = seen.concat(line[characterIndex] || ""); if (condition(seen)) { range = { from: {ch: startCh, line: startLine}, to: {ch: characterIndex, line: currentLine}, string: seen }; return range; } else if (characterIndex >= line.length) { seen = seen.concat(cm.lineSeparator()); if (condition(seen)) { range = { from: {ch: startCh, line: startLine}, to: {ch: characterIndex, line: currentLine}, string: seen }; return range; } characterIndex = 0; line = cm.getLine(++currentLine); } else { ++characterIndex; } } } }
javascript
function scanTextUntil(cm, startCh, startLine, condition) { var line = cm.getLine(startLine), seen = "", characterIndex = startCh, currentLine = startLine, range; while (currentLine <= cm.lastLine()) { if (line.length === 0) { characterIndex = 0; line = cm.getLine(++currentLine); } else { seen = seen.concat(line[characterIndex] || ""); if (condition(seen)) { range = { from: {ch: startCh, line: startLine}, to: {ch: characterIndex, line: currentLine}, string: seen }; return range; } else if (characterIndex >= line.length) { seen = seen.concat(cm.lineSeparator()); if (condition(seen)) { range = { from: {ch: startCh, line: startLine}, to: {ch: characterIndex, line: currentLine}, string: seen }; return range; } characterIndex = 0; line = cm.getLine(++currentLine); } else { ++characterIndex; } } } }
[ "function", "scanTextUntil", "(", "cm", ",", "startCh", ",", "startLine", ",", "condition", ")", "{", "var", "line", "=", "cm", ".", "getLine", "(", "startLine", ")", ",", "seen", "=", "\"\"", ",", "characterIndex", "=", "startCh", ",", "currentLine", "=...
Utility function for scanning the text in a document until a certain condition is met @param {object} cm The code mirror object representing the document @param {string} startCh The start character position for the scan operation @param {number} startLine The start line position for the scan operation @param {function (string): boolean} condition A predicate function that takes in the text seen so far and returns true if the scanning process should be halted @returns {{from:CodeMirror.Pos, to: CodeMirror.Pos, string: string}} An object representing the range of text scanned.
[ "Utility", "function", "for", "scanning", "the", "text", "in", "a", "document", "until", "a", "certain", "condition", "is", "met" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/handlebarsFold.js#L44-L80
train
Scan text until condition returns true
[ 30522, 3853, 13594, 18209, 16671, 4014, 1006, 4642, 1010, 2707, 2818, 1010, 2707, 4179, 1010, 4650, 1007, 1063, 13075, 2240, 1027, 4642, 1012, 2131, 4179, 1006, 2707, 4179, 1007, 1010, 2464, 1027, 1000, 1000, 1010, 2839, 22254, 10288, 1027,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/AutoUpdate/main.js
registerBracketsFunctions
function registerBracketsFunctions() { functionMap["brackets.notifyinitializationComplete"] = handleInitializationComplete; functionMap["brackets.showStatusInfo"] = showStatusInfo; functionMap["brackets.notifyDownloadSuccess"] = handleDownloadSuccess; functionMap["brackets.showErrorMessage"] = showErrorMessage; functionMap["brackets.notifyDownloadFailure"] = handleDownloadFailure; functionMap["brackets.notifySafeToDownload"] = handleSafeToDownload; functionMap["brackets.notifyvalidationStatus"] = handleValidationStatus; functionMap["brackets.notifyInstallationStatus"] = handleInstallationStatus; ProjectManager.on("beforeProjectClose beforeAppClose", _handleAppClose); }
javascript
function registerBracketsFunctions() { functionMap["brackets.notifyinitializationComplete"] = handleInitializationComplete; functionMap["brackets.showStatusInfo"] = showStatusInfo; functionMap["brackets.notifyDownloadSuccess"] = handleDownloadSuccess; functionMap["brackets.showErrorMessage"] = showErrorMessage; functionMap["brackets.notifyDownloadFailure"] = handleDownloadFailure; functionMap["brackets.notifySafeToDownload"] = handleSafeToDownload; functionMap["brackets.notifyvalidationStatus"] = handleValidationStatus; functionMap["brackets.notifyInstallationStatus"] = handleInstallationStatus; ProjectManager.on("beforeProjectClose beforeAppClose", _handleAppClose); }
[ "function", "registerBracketsFunctions", "(", ")", "{", "functionMap", "[", "\"brackets.notifyinitializationComplete\"", "]", "=", "handleInitializationComplete", ";", "functionMap", "[", "\"brackets.showStatusInfo\"", "]", "=", "showStatusInfo", ";", "functionMap", "[", "\...
Generates a map for brackets side functions
[ "Generates", "a", "map", "for", "brackets", "side", "functions" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L1098-L1109
train
Registers brackets functions
[ 30522, 3853, 4236, 10024, 19869, 3215, 11263, 27989, 2015, 1006, 1007, 1063, 3853, 2863, 2361, 1031, 1000, 19719, 1012, 2025, 8757, 5498, 20925, 3989, 9006, 10814, 2618, 1000, 1033, 1027, 5047, 5498, 20925, 3989, 9006, 10814, 2618, 1025, 38...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
KaTeX/KaTeX
contrib/mhchem/mhchem.js
function (m, input) { var pattern = mhchemParser.patterns.patterns[m]; if (pattern === undefined) { throw ["MhchemBugP", "mhchem bug P. Please report. (" + m + ")"]; // Trying to use non-existing pattern } else if (typeof pattern === "function") { return mhchemParser.patterns.patterns[m](input); // cannot use cached var pattern here, because some pattern functions need this===mhchemParser } else { // RegExp var match = input.match(pattern); if (match) { var mm; if (match[2]) { mm = [ match[1], match[2] ]; } else if (match[1]) { mm = match[1]; } else { mm = match[0]; } return { match_: mm, remainder: input.substr(match[0].length) }; } return null; } }
javascript
function (m, input) { var pattern = mhchemParser.patterns.patterns[m]; if (pattern === undefined) { throw ["MhchemBugP", "mhchem bug P. Please report. (" + m + ")"]; // Trying to use non-existing pattern } else if (typeof pattern === "function") { return mhchemParser.patterns.patterns[m](input); // cannot use cached var pattern here, because some pattern functions need this===mhchemParser } else { // RegExp var match = input.match(pattern); if (match) { var mm; if (match[2]) { mm = [ match[1], match[2] ]; } else if (match[1]) { mm = match[1]; } else { mm = match[0]; } return { match_: mm, remainder: input.substr(match[0].length) }; } return null; } }
[ "function", "(", "m", ",", "input", ")", "{", "var", "pattern", "=", "mhchemParser", ".", "patterns", ".", "patterns", "[", "m", "]", ";", "if", "(", "pattern", "===", "undefined", ")", "{", "throw", "[", "\"MhchemBugP\"", ",", "\"mhchem bug P. Please repo...
Matching function e.g. match("a", input) will look for the regexp called "a" and see if it matches returns null or {match_:"a", remainder:"bc"}
[ "Matching", "function", "e", ".", "g", ".", "match", "(", "a", "input", ")", "will", "look", "for", "the", "regexp", "called", "a", "and", "see", "if", "it", "matches", "returns", "null", "or", "{", "match_", ":", "a", "remainder", ":", "bc", "}" ]
17bfb247b88070267f3e5c7b21fe4a360fdf49d9
https://github.com/KaTeX/KaTeX/blob/17bfb247b88070267f3e5c7b21fe4a360fdf49d9/contrib/mhchem/mhchem.js#L444-L465
train
returns the match_ and remainder of the input string
[ 30522, 3853, 1006, 1049, 1010, 7953, 1007, 1063, 13075, 5418, 1027, 1049, 16257, 29122, 19362, 8043, 1012, 7060, 1012, 7060, 1031, 1049, 1033, 1025, 2065, 1006, 5418, 1027, 1027, 1027, 6151, 28344, 1007, 1063, 5466, 1031, 1000, 1049, 16257,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
goldfire/howler.js
examples/3d/js/controls.js
function() { // Define our control key codes and states. this.codes = { // Arrows 37: 'left', 39: 'right', 38: 'front', 40: 'back', // WASD 65: 'left', 68: 'right', 87: 'front', 83: 'back', }; this.states = {left: false, right: false, front: false, back: false}; // Setup the DOM listeners. document.addEventListener('keydown', this.key.bind(this, true), false); document.addEventListener('keyup', this.key.bind(this, false), false); document.addEventListener('touchstart', this.touch.bind(this), false); document.addEventListener('touchmove', this.touch.bind(this), false); document.addEventListener('touchend', this.touchEnd.bind(this), false); }
javascript
function() { // Define our control key codes and states. this.codes = { // Arrows 37: 'left', 39: 'right', 38: 'front', 40: 'back', // WASD 65: 'left', 68: 'right', 87: 'front', 83: 'back', }; this.states = {left: false, right: false, front: false, back: false}; // Setup the DOM listeners. document.addEventListener('keydown', this.key.bind(this, true), false); document.addEventListener('keyup', this.key.bind(this, false), false); document.addEventListener('touchstart', this.touch.bind(this), false); document.addEventListener('touchmove', this.touch.bind(this), false); document.addEventListener('touchend', this.touchEnd.bind(this), false); }
[ "function", "(", ")", "{", "// Define our control key codes and states.", "this", ".", "codes", "=", "{", "// Arrows", "37", ":", "'left'", ",", "39", ":", "'right'", ",", "38", ":", "'front'", ",", "40", ":", "'back'", ",", "// WASD", "65", ":", "'left'",...
Defines and handles the various controls.
[ "Defines", "and", "handles", "the", "various", "controls", "." ]
030db918dd8ce640afd57e172418472497e8f113
https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/3d/js/controls.js#L16-L32
train
Initialize the key handling
[ 30522, 3853, 1006, 1007, 1063, 1013, 1013, 9375, 2256, 2491, 3145, 9537, 1998, 2163, 1012, 2023, 1012, 9537, 1027, 1063, 1013, 1013, 12563, 4261, 1024, 1005, 2187, 1005, 1010, 4464, 1024, 1005, 2157, 1005, 1010, 4229, 1024, 1005, 2392, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jhipster/generator-jhipster
generators/utils.js
normalizeBlueprintName
function normalizeBlueprintName(blueprint) { if (blueprint && blueprint.startsWith('@')) { return blueprint; } if (blueprint && !blueprint.startsWith('generator-jhipster')) { return `generator-jhipster-${blueprint}`; } return blueprint; }
javascript
function normalizeBlueprintName(blueprint) { if (blueprint && blueprint.startsWith('@')) { return blueprint; } if (blueprint && !blueprint.startsWith('generator-jhipster')) { return `generator-jhipster-${blueprint}`; } return blueprint; }
[ "function", "normalizeBlueprintName", "(", "blueprint", ")", "{", "if", "(", "blueprint", "&&", "blueprint", ".", "startsWith", "(", "'@'", ")", ")", "{", "return", "blueprint", ";", "}", "if", "(", "blueprint", "&&", "!", "blueprint", ".", "startsWith", "...
Normalize blueprint name: prepend 'generator-jhipster-' if needed @param {string} blueprint - name of the blueprint
[ "Normalize", "blueprint", "name", ":", "prepend", "generator", "-", "jhipster", "-", "if", "needed" ]
6a7d614d6756e003b700d07dad6e4c41b3234502
https://github.com/jhipster/generator-jhipster/blob/6a7d614d6756e003b700d07dad6e4c41b3234502/generators/utils.js#L477-L485
train
Normalize blueprint name
[ 30522, 3853, 3671, 4697, 16558, 5657, 16550, 18442, 1006, 2630, 16550, 1007, 1063, 2065, 1006, 2630, 16550, 1004, 1004, 2630, 16550, 1012, 4627, 24415, 1006, 1005, 1030, 1005, 1007, 1007, 1063, 2709, 2630, 16550, 1025, 1065, 2065, 1006, 263...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.table/src/sap/ui/table/TableGrouping.js
function(oTable, oRow, bChildren, bExpanded, bHidden, bSum, iLevel, sGroupHeaderText) { var oDomRefs = oRow.getDomRefs(true), $Row = oDomRefs.row, $ScrollRow = oDomRefs.rowScrollPart, $FixedRow = oDomRefs.rowFixedPart, $RowHdr = oDomRefs.rowSelector, $RowAct = oDomRefs.rowAction; $Row.attr({ "data-sap-ui-level": iLevel }); $Row.data("sap-ui-level", iLevel); if (TableGrouping.isGroupMode(oTable)) { $Row.toggleClass("sapUiAnalyticalTableSum", !bChildren && bSum) .toggleClass("sapUiAnalyticalTableDummy", false) .toggleClass("sapUiTableGroupHeader", bChildren) .toggleClass("sapUiTableRowHidden", bChildren && bHidden || oRow._bHidden); jQuery(document.getElementById(oRow.getId() + "-groupHeader")) .toggleClass("sapUiTableGroupIconOpen", bChildren && bExpanded) .toggleClass("sapUiTableGroupIconClosed", bChildren && !bExpanded) .attr("title", oTable._getShowStandardTooltips() && sGroupHeaderText ? sGroupHeaderText : null) .text(sGroupHeaderText || ""); var iIndent = TableGrouping.calcGroupIndent(oTable, iLevel, bChildren, bSum); TableGrouping.setIndent(oTable, $Row, $RowHdr, iIndent); $Row.toggleClass("sapUiTableRowIndented", iIndent > 0); } var $TreeIcon = null; if (TableGrouping.isTreeMode(oTable)) { $TreeIcon = $Row.find(".sapUiTableTreeIcon"); $TreeIcon.css(oTable._bRtlMode ? "margin-right" : "margin-left", (iLevel * 17) + "px") .toggleClass("sapUiTableTreeIconLeaf", !bChildren) .toggleClass("sapUiTableTreeIconNodeOpen", bChildren && bExpanded) .toggleClass("sapUiTableTreeIconNodeClosed", bChildren && !bExpanded); } if (TableGrouping.showGroupMenuButton(oTable)) { // Update the GroupMenuButton var iScrollbarOffset = 0; var $Table = oTable.$(); if ($Table.hasClass("sapUiTableVScr")) { iScrollbarOffset += $Table.find(".sapUiTableVSb").width(); } var $GroupHeaderMenuButton = $RowHdr.find(".sapUiTableGroupMenuButton"); if (oTable._bRtlMode) { $GroupHeaderMenuButton.css("right", ($Table.width() - $GroupHeaderMenuButton.width() + $RowHdr.position().left - iScrollbarOffset - 5) + "px"); } else { $GroupHeaderMenuButton.css("left", ($Table.width() - $GroupHeaderMenuButton.width() - $RowHdr.position().left - iScrollbarOffset - 5) + "px"); } } oTable._getAccExtension() .updateAriaExpandAndLevelState(oRow, $ScrollRow, $RowHdr, $FixedRow, $RowAct, bChildren, bExpanded, iLevel, $TreeIcon); }
javascript
function(oTable, oRow, bChildren, bExpanded, bHidden, bSum, iLevel, sGroupHeaderText) { var oDomRefs = oRow.getDomRefs(true), $Row = oDomRefs.row, $ScrollRow = oDomRefs.rowScrollPart, $FixedRow = oDomRefs.rowFixedPart, $RowHdr = oDomRefs.rowSelector, $RowAct = oDomRefs.rowAction; $Row.attr({ "data-sap-ui-level": iLevel }); $Row.data("sap-ui-level", iLevel); if (TableGrouping.isGroupMode(oTable)) { $Row.toggleClass("sapUiAnalyticalTableSum", !bChildren && bSum) .toggleClass("sapUiAnalyticalTableDummy", false) .toggleClass("sapUiTableGroupHeader", bChildren) .toggleClass("sapUiTableRowHidden", bChildren && bHidden || oRow._bHidden); jQuery(document.getElementById(oRow.getId() + "-groupHeader")) .toggleClass("sapUiTableGroupIconOpen", bChildren && bExpanded) .toggleClass("sapUiTableGroupIconClosed", bChildren && !bExpanded) .attr("title", oTable._getShowStandardTooltips() && sGroupHeaderText ? sGroupHeaderText : null) .text(sGroupHeaderText || ""); var iIndent = TableGrouping.calcGroupIndent(oTable, iLevel, bChildren, bSum); TableGrouping.setIndent(oTable, $Row, $RowHdr, iIndent); $Row.toggleClass("sapUiTableRowIndented", iIndent > 0); } var $TreeIcon = null; if (TableGrouping.isTreeMode(oTable)) { $TreeIcon = $Row.find(".sapUiTableTreeIcon"); $TreeIcon.css(oTable._bRtlMode ? "margin-right" : "margin-left", (iLevel * 17) + "px") .toggleClass("sapUiTableTreeIconLeaf", !bChildren) .toggleClass("sapUiTableTreeIconNodeOpen", bChildren && bExpanded) .toggleClass("sapUiTableTreeIconNodeClosed", bChildren && !bExpanded); } if (TableGrouping.showGroupMenuButton(oTable)) { // Update the GroupMenuButton var iScrollbarOffset = 0; var $Table = oTable.$(); if ($Table.hasClass("sapUiTableVScr")) { iScrollbarOffset += $Table.find(".sapUiTableVSb").width(); } var $GroupHeaderMenuButton = $RowHdr.find(".sapUiTableGroupMenuButton"); if (oTable._bRtlMode) { $GroupHeaderMenuButton.css("right", ($Table.width() - $GroupHeaderMenuButton.width() + $RowHdr.position().left - iScrollbarOffset - 5) + "px"); } else { $GroupHeaderMenuButton.css("left", ($Table.width() - $GroupHeaderMenuButton.width() - $RowHdr.position().left - iScrollbarOffset - 5) + "px"); } } oTable._getAccExtension() .updateAriaExpandAndLevelState(oRow, $ScrollRow, $RowHdr, $FixedRow, $RowAct, bChildren, bExpanded, iLevel, $TreeIcon); }
[ "function", "(", "oTable", ",", "oRow", ",", "bChildren", ",", "bExpanded", ",", "bHidden", ",", "bSum", ",", "iLevel", ",", "sGroupHeaderText", ")", "{", "var", "oDomRefs", "=", "oRow", ".", "getDomRefs", "(", "true", ")", ",", "$Row", "=", "oDomRefs", ...
Updates the dom of the given row depending on the given parameters. @param {sap.ui.table.Table} oTable Instance of the table. @param {sap.ui.table.Row} oRow Instance of the row. @param {boolean} bChildren Whether the row is a group (has children). @param {boolean} bExpanded Whether the row should be expanded. @param {boolean} bHidden Whether the row content should be hidden. @param {boolean} bSum Whether the row should be a summary row. @param {number} iLevel The hierarchy level. @param {string} sGroupHeaderText The title of the group header.
[ "Updates", "the", "dom", "of", "the", "given", "row", "depending", "on", "the", "given", "parameters", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableGrouping.js#L353-L414
train
Sets the class of the table row
[ 30522, 3853, 1006, 27178, 3085, 1010, 20298, 2860, 1010, 4647, 19466, 16200, 2078, 1010, 2022, 2595, 9739, 5732, 1010, 1038, 27511, 4181, 1010, 18667, 2819, 1010, 17869, 15985, 1010, 22214, 22107, 4974, 8743, 10288, 2102, 1007, 1063, 13075, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
lovell/sharp
lib/output.js
jpeg
function jpeg (options) { if (is.object(options)) { if (is.defined(options.quality)) { if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) { this.options.jpegQuality = options.quality; } else { throw new Error('Invalid quality (integer, 1-100) ' + options.quality); } } if (is.defined(options.progressive)) { this._setBooleanOption('jpegProgressive', options.progressive); } if (is.defined(options.chromaSubsampling)) { if (is.string(options.chromaSubsampling) && is.inArray(options.chromaSubsampling, ['4:2:0', '4:4:4'])) { this.options.jpegChromaSubsampling = options.chromaSubsampling; } else { throw new Error('Invalid chromaSubsampling (4:2:0, 4:4:4) ' + options.chromaSubsampling); } } const trellisQuantisation = is.bool(options.trellisQuantization) ? options.trellisQuantization : options.trellisQuantisation; if (is.defined(trellisQuantisation)) { this._setBooleanOption('jpegTrellisQuantisation', trellisQuantisation); } if (is.defined(options.overshootDeringing)) { this._setBooleanOption('jpegOvershootDeringing', options.overshootDeringing); } const optimiseScans = is.bool(options.optimizeScans) ? options.optimizeScans : options.optimiseScans; if (is.defined(optimiseScans)) { this._setBooleanOption('jpegOptimiseScans', optimiseScans); if (optimiseScans) { this.options.jpegProgressive = true; } } const optimiseCoding = is.bool(options.optimizeCoding) ? options.optimizeCoding : options.optimiseCoding; if (is.defined(optimiseCoding)) { this._setBooleanOption('jpegOptimiseCoding', optimiseCoding); } const quantisationTable = is.number(options.quantizationTable) ? options.quantizationTable : options.quantisationTable; if (is.defined(quantisationTable)) { if (is.integer(quantisationTable) && is.inRange(quantisationTable, 0, 8)) { this.options.jpegQuantisationTable = quantisationTable; } else { throw new Error('Invalid quantisation table (integer, 0-8) ' + quantisationTable); } } } return this._updateFormatOut('jpeg', options); }
javascript
function jpeg (options) { if (is.object(options)) { if (is.defined(options.quality)) { if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) { this.options.jpegQuality = options.quality; } else { throw new Error('Invalid quality (integer, 1-100) ' + options.quality); } } if (is.defined(options.progressive)) { this._setBooleanOption('jpegProgressive', options.progressive); } if (is.defined(options.chromaSubsampling)) { if (is.string(options.chromaSubsampling) && is.inArray(options.chromaSubsampling, ['4:2:0', '4:4:4'])) { this.options.jpegChromaSubsampling = options.chromaSubsampling; } else { throw new Error('Invalid chromaSubsampling (4:2:0, 4:4:4) ' + options.chromaSubsampling); } } const trellisQuantisation = is.bool(options.trellisQuantization) ? options.trellisQuantization : options.trellisQuantisation; if (is.defined(trellisQuantisation)) { this._setBooleanOption('jpegTrellisQuantisation', trellisQuantisation); } if (is.defined(options.overshootDeringing)) { this._setBooleanOption('jpegOvershootDeringing', options.overshootDeringing); } const optimiseScans = is.bool(options.optimizeScans) ? options.optimizeScans : options.optimiseScans; if (is.defined(optimiseScans)) { this._setBooleanOption('jpegOptimiseScans', optimiseScans); if (optimiseScans) { this.options.jpegProgressive = true; } } const optimiseCoding = is.bool(options.optimizeCoding) ? options.optimizeCoding : options.optimiseCoding; if (is.defined(optimiseCoding)) { this._setBooleanOption('jpegOptimiseCoding', optimiseCoding); } const quantisationTable = is.number(options.quantizationTable) ? options.quantizationTable : options.quantisationTable; if (is.defined(quantisationTable)) { if (is.integer(quantisationTable) && is.inRange(quantisationTable, 0, 8)) { this.options.jpegQuantisationTable = quantisationTable; } else { throw new Error('Invalid quantisation table (integer, 0-8) ' + quantisationTable); } } } return this._updateFormatOut('jpeg', options); }
[ "function", "jpeg", "(", "options", ")", "{", "if", "(", "is", ".", "object", "(", "options", ")", ")", "{", "if", "(", "is", ".", "defined", "(", "options", ".", "quality", ")", ")", "{", "if", "(", "is", ".", "integer", "(", "options", ".", "...
Use these JPEG options for output image. @example // Convert any input to very high quality JPEG output const data = await sharp(input) .jpeg({ quality: 100, chromaSubsampling: '4:4:4' }) .toBuffer(); @param {Object} [options] - output options @param {Number} [options.quality=80] - quality, integer 1-100 @param {Boolean} [options.progressive=false] - use progressive (interlace) scan @param {String} [options.chromaSubsampling='4:2:0'] - set to '4:4:4' to prevent chroma subsampling when quality <= 90 @param {Boolean} [options.trellisQuantisation=false] - apply trellis quantisation, requires libvips compiled with support for mozjpeg @param {Boolean} [options.overshootDeringing=false] - apply overshoot deringing, requires libvips compiled with support for mozjpeg @param {Boolean} [options.optimiseScans=false] - optimise progressive scans, forces progressive, requires libvips compiled with support for mozjpeg @param {Boolean} [options.optimizeScans=false] - alternative spelling of optimiseScans @param {Boolean} [options.optimiseCoding=true] - optimise Huffman coding tables @param {Boolean} [options.optimizeCoding=true] - alternative spelling of optimiseCoding @param {Number} [options.quantisationTable=0] - quantization table to use, integer 0-8, requires libvips compiled with support for mozjpeg @param {Number} [options.quantizationTable=0] - alternative spelling of quantisationTable @param {Boolean} [options.force=true] - force JPEG output, otherwise attempt to use input format @returns {Sharp} @throws {Error} Invalid options
[ "Use", "these", "JPEG", "options", "for", "output", "image", "." ]
05d76eeadfe54713606a615185b2da047923406b
https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/output.js#L159-L206
train
Set JPEG parameters
[ 30522, 3853, 16545, 13910, 1006, 7047, 1007, 1063, 2065, 1006, 2003, 1012, 4874, 30524, 1012, 3737, 1010, 1015, 1010, 2531, 1007, 1007, 1063, 2023, 1012, 7047, 1012, 16545, 13910, 26426, 3012, 1027, 7047, 1012, 3737, 1025, 1065, 2842, 1063,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
markdown-it/markdown-it
lib/parser_core.js
Core
function Core() { /** * Core#ruler -> Ruler * * [[Ruler]] instance. Keep configuration of core rules. **/ this.ruler = new Ruler(); for (var i = 0; i < _rules.length; i++) { this.ruler.push(_rules[i][0], _rules[i][1]); } }
javascript
function Core() { /** * Core#ruler -> Ruler * * [[Ruler]] instance. Keep configuration of core rules. **/ this.ruler = new Ruler(); for (var i = 0; i < _rules.length; i++) { this.ruler.push(_rules[i][0], _rules[i][1]); } }
[ "function", "Core", "(", ")", "{", "/**\n * Core#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of core rules.\n **/", "this", ".", "ruler", "=", "new", "Ruler", "(", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "_rules", ".", ...
new Core()
[ "new", "Core", "()" ]
ba6830ba13fb92953a91fb90318964ccd15b82c4
https://github.com/markdown-it/markdown-it/blob/ba6830ba13fb92953a91fb90318964ccd15b82c4/lib/parser_core.js#L26-L37
train
Core class.
[ 30522, 3853, 4563, 1006, 1007, 1063, 1013, 1008, 1008, 1008, 4563, 1001, 7786, 1011, 1028, 7786, 1008, 1008, 1031, 1031, 7786, 1033, 1033, 6013, 1012, 2562, 9563, 1997, 4563, 3513, 1012, 1008, 1008, 1013, 2023, 1012, 7786, 1027, 2047, 778...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/BlockLayerUtils.js
fnHandleInteraction
function fnHandleInteraction (bEnabled) { if (bEnabled) { var oParentDOM = this.$parent.get(0); if (oParentDOM){ // Those two elements handle the tab chain so it is not possible to tab behind the busy section. this.fnRedirectFocus = redirectFocus.bind(this); this.oTabbableBefore = createTabbable(this.fnRedirectFocus); this.oTabbableAfter = createTabbable(this.fnRedirectFocus); oParentDOM.parentNode.insertBefore(this.oTabbableBefore, oParentDOM); oParentDOM.parentNode.insertBefore(this.oTabbableAfter, oParentDOM.nextSibling); this._fnSuppressDefaultAndStopPropagationHandler = suppressDefaultAndStopPropagation.bind(this); this._aSuppressHandler = registerInteractionHandler.call(this, this._fnSuppressDefaultAndStopPropagationHandler); } else { Log.warning("fnHandleInteraction called with bEnabled true, but no DOMRef exists!"); } } else { if (this.oTabbableBefore) { removeTabbable(this.oTabbableBefore, this.fnRedirectFocus); delete this.oTabbableBefore; } if (this.oTabbableAfter) { removeTabbable(this.oTabbableAfter, this.fnRedirectFocus); delete this.oTabbableAfter; } delete this.fnRedirectFocus; //trigger handler deregistration needs to be done even if DomRef is already destroyed deregisterInteractionHandler.call(this, this._fnSuppressDefaultAndStopPropagationHandler); } /** * Handler which suppresses event bubbling for blocked section * * @param {object} oEvent The event on the suppressed DOM * @private */ function suppressDefaultAndStopPropagation(oEvent) { var bTargetIsBlockLayer = oEvent.target === this.$blockLayer.get(0), oTabbable; if (bTargetIsBlockLayer && oEvent.type === 'keydown' && oEvent.keyCode === 9) { // Special handling for "tab" keydown: redirect to next element before or after busy section Log.debug("Local Busy Indicator Event keydown handled: " + oEvent.type); oTabbable = oEvent.shiftKey ? this.oTabbableBefore : this.oTabbableAfter; oTabbable.setAttribute("tabindex", -1); // ignore execution of focus handler this.bIgnoreFocus = true; oTabbable.focus(); this.bIgnoreFocus = false; oTabbable.setAttribute("tabindex", 0); oEvent.stopImmediatePropagation(); } else if (bTargetIsBlockLayer && (oEvent.type === 'mousedown' || oEvent.type === 'touchstart')) { // Do not "preventDefault" to allow to focus busy indicator Log.debug("Local Busy Indicator click handled on busy area: " + oEvent.target.id); oEvent.stopImmediatePropagation(); } else { Log.debug("Local Busy Indicator Event Suppressed: " + oEvent.type); oEvent.preventDefault(); oEvent.stopImmediatePropagation(); } } /** * Captures and redirects focus before it reaches blocked section (from both sides) * * @private */ function redirectFocus() { if (!this.bIgnoreFocus) { // Redirect focus onto busy indicator (if not already focused) this.$blockLayer.get(0).focus(); } } /** * Create a tabbable span for the block section of the control with according focus handling. * * @param {function} fnRedirectFocus Focus handling function * @returns {object} The span element's DOM node * @private */ function createTabbable(fnRedirectFocus) { var oBlockSpan = document.createElement("span"); oBlockSpan.setAttribute("tabindex", 0); oBlockSpan.addEventListener('focusin', fnRedirectFocus); return oBlockSpan; } /** * Create a tabbable span for the block section of the control with according focus handling. * * @param {function} fnRedirectFocus Focus handling function * @returns {object} The span element's DOM node * @private */ function removeTabbable(oBlockSpan, fnRedirectFocus) { if (oBlockSpan.parentNode) { oBlockSpan.parentNode.removeChild(oBlockSpan); } oBlockSpan.removeEventListener('focusin', fnRedirectFocus); } /** * Register event handler to suppress event within busy section */ function registerInteractionHandler(fnHandler) { var aSuppressHandler = [], oParentDOM = this.$parent.get(0), oBlockLayerDOM = this.$blockLayer.get(0); for (var i = 0; i < aPreventedEvents.length; i++) { // Add event listeners with "useCapture" settings to suppress events before dispatching/bubbling starts oParentDOM.addEventListener(aPreventedEvents[i], fnHandler, { capture: true, passive: false }); aSuppressHandler.push(EventTriggerHook.suppress(aPreventedEvents[i], oParentDOM, oBlockLayerDOM)); } //for jQuery triggered events we also need the keydown handler this.$blockLayer.bind('keydown', fnHandler); return aSuppressHandler; } /** * Deregister event handler to suppress event within busy section */ function deregisterInteractionHandler(fnHandler) { var i, oParentDOM = this.$parent.get(0), oBlockLayerDOM = this.$blockLayer.get(0); if (oParentDOM) { for (i = 0; i < aPreventedEvents.length; i++) { // Remove event listeners with "useCapture" settings oParentDOM.removeEventListener(aPreventedEvents[i], fnHandler, { capture: true, passive: false }); } } if (this._aSuppressHandler) { for (i = 0; i < this._aSuppressHandler.length; i++) { // this part should be done even no DOMRef exists EventTriggerHook.release(this._aSuppressHandler[i]); } } if (oBlockLayerDOM) { this.$blockLayer.unbind('keydown', fnHandler); } } }
javascript
function fnHandleInteraction (bEnabled) { if (bEnabled) { var oParentDOM = this.$parent.get(0); if (oParentDOM){ // Those two elements handle the tab chain so it is not possible to tab behind the busy section. this.fnRedirectFocus = redirectFocus.bind(this); this.oTabbableBefore = createTabbable(this.fnRedirectFocus); this.oTabbableAfter = createTabbable(this.fnRedirectFocus); oParentDOM.parentNode.insertBefore(this.oTabbableBefore, oParentDOM); oParentDOM.parentNode.insertBefore(this.oTabbableAfter, oParentDOM.nextSibling); this._fnSuppressDefaultAndStopPropagationHandler = suppressDefaultAndStopPropagation.bind(this); this._aSuppressHandler = registerInteractionHandler.call(this, this._fnSuppressDefaultAndStopPropagationHandler); } else { Log.warning("fnHandleInteraction called with bEnabled true, but no DOMRef exists!"); } } else { if (this.oTabbableBefore) { removeTabbable(this.oTabbableBefore, this.fnRedirectFocus); delete this.oTabbableBefore; } if (this.oTabbableAfter) { removeTabbable(this.oTabbableAfter, this.fnRedirectFocus); delete this.oTabbableAfter; } delete this.fnRedirectFocus; //trigger handler deregistration needs to be done even if DomRef is already destroyed deregisterInteractionHandler.call(this, this._fnSuppressDefaultAndStopPropagationHandler); } /** * Handler which suppresses event bubbling for blocked section * * @param {object} oEvent The event on the suppressed DOM * @private */ function suppressDefaultAndStopPropagation(oEvent) { var bTargetIsBlockLayer = oEvent.target === this.$blockLayer.get(0), oTabbable; if (bTargetIsBlockLayer && oEvent.type === 'keydown' && oEvent.keyCode === 9) { // Special handling for "tab" keydown: redirect to next element before or after busy section Log.debug("Local Busy Indicator Event keydown handled: " + oEvent.type); oTabbable = oEvent.shiftKey ? this.oTabbableBefore : this.oTabbableAfter; oTabbable.setAttribute("tabindex", -1); // ignore execution of focus handler this.bIgnoreFocus = true; oTabbable.focus(); this.bIgnoreFocus = false; oTabbable.setAttribute("tabindex", 0); oEvent.stopImmediatePropagation(); } else if (bTargetIsBlockLayer && (oEvent.type === 'mousedown' || oEvent.type === 'touchstart')) { // Do not "preventDefault" to allow to focus busy indicator Log.debug("Local Busy Indicator click handled on busy area: " + oEvent.target.id); oEvent.stopImmediatePropagation(); } else { Log.debug("Local Busy Indicator Event Suppressed: " + oEvent.type); oEvent.preventDefault(); oEvent.stopImmediatePropagation(); } } /** * Captures and redirects focus before it reaches blocked section (from both sides) * * @private */ function redirectFocus() { if (!this.bIgnoreFocus) { // Redirect focus onto busy indicator (if not already focused) this.$blockLayer.get(0).focus(); } } /** * Create a tabbable span for the block section of the control with according focus handling. * * @param {function} fnRedirectFocus Focus handling function * @returns {object} The span element's DOM node * @private */ function createTabbable(fnRedirectFocus) { var oBlockSpan = document.createElement("span"); oBlockSpan.setAttribute("tabindex", 0); oBlockSpan.addEventListener('focusin', fnRedirectFocus); return oBlockSpan; } /** * Create a tabbable span for the block section of the control with according focus handling. * * @param {function} fnRedirectFocus Focus handling function * @returns {object} The span element's DOM node * @private */ function removeTabbable(oBlockSpan, fnRedirectFocus) { if (oBlockSpan.parentNode) { oBlockSpan.parentNode.removeChild(oBlockSpan); } oBlockSpan.removeEventListener('focusin', fnRedirectFocus); } /** * Register event handler to suppress event within busy section */ function registerInteractionHandler(fnHandler) { var aSuppressHandler = [], oParentDOM = this.$parent.get(0), oBlockLayerDOM = this.$blockLayer.get(0); for (var i = 0; i < aPreventedEvents.length; i++) { // Add event listeners with "useCapture" settings to suppress events before dispatching/bubbling starts oParentDOM.addEventListener(aPreventedEvents[i], fnHandler, { capture: true, passive: false }); aSuppressHandler.push(EventTriggerHook.suppress(aPreventedEvents[i], oParentDOM, oBlockLayerDOM)); } //for jQuery triggered events we also need the keydown handler this.$blockLayer.bind('keydown', fnHandler); return aSuppressHandler; } /** * Deregister event handler to suppress event within busy section */ function deregisterInteractionHandler(fnHandler) { var i, oParentDOM = this.$parent.get(0), oBlockLayerDOM = this.$blockLayer.get(0); if (oParentDOM) { for (i = 0; i < aPreventedEvents.length; i++) { // Remove event listeners with "useCapture" settings oParentDOM.removeEventListener(aPreventedEvents[i], fnHandler, { capture: true, passive: false }); } } if (this._aSuppressHandler) { for (i = 0; i < this._aSuppressHandler.length; i++) { // this part should be done even no DOMRef exists EventTriggerHook.release(this._aSuppressHandler[i]); } } if (oBlockLayerDOM) { this.$blockLayer.unbind('keydown', fnHandler); } } }
[ "function", "fnHandleInteraction", "(", "bEnabled", ")", "{", "if", "(", "bEnabled", ")", "{", "var", "oParentDOM", "=", "this", ".", "$parent", ".", "get", "(", "0", ")", ";", "if", "(", "oParentDOM", ")", "{", "// Those two elements handle the tab chain so i...
Suppress interactions on all DOM elements in the blocked section. Starting with the fnHandleInteraction call, all following function calls are bound in the context of the block-state object. Meaning "this" will always reference the block-state object. @param {boolean} bEnabled New blocked state @private
[ "Suppress", "interactions", "on", "all", "DOM", "elements", "in", "the", "blocked", "section", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/BlockLayerUtils.js#L176-L334
train
Handles the interaction event on the DOMRef.
[ 30522, 3853, 1042, 25311, 5685, 19856, 14621, 7542, 1006, 3841, 3085, 2094, 1007, 1063, 2065, 1006, 3841, 3085, 2094, 1007, 1063, 13075, 6728, 12069, 3372, 9527, 1027, 2023, 1012, 1002, 6687, 1012, 2131, 1006, 1014, 1007, 1025, 2065, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/core/services/interimElement/interimElement.js
createAndTransitionIn
function createAndTransitionIn() { return $q(function(resolve, reject) { // Trigger onCompiling callback before the compilation starts. // This is useful, when modifying options, which can be influenced by developers. options.onCompiling && options.onCompiling(options); compileElement(options) .then(function(compiledData) { element = linkElement(compiledData, options); // Expose the cleanup function from the compiler. options.cleanupElement = compiledData.cleanup; showAction = showElement(element, options, compiledData.controller) .then(resolve, rejectAll); }).catch(rejectAll); function rejectAll(fault) { // Force the '$md<xxx>.show()' promise to reject self.deferred.reject(fault); // Continue rejection propagation reject(fault); } }); }
javascript
function createAndTransitionIn() { return $q(function(resolve, reject) { // Trigger onCompiling callback before the compilation starts. // This is useful, when modifying options, which can be influenced by developers. options.onCompiling && options.onCompiling(options); compileElement(options) .then(function(compiledData) { element = linkElement(compiledData, options); // Expose the cleanup function from the compiler. options.cleanupElement = compiledData.cleanup; showAction = showElement(element, options, compiledData.controller) .then(resolve, rejectAll); }).catch(rejectAll); function rejectAll(fault) { // Force the '$md<xxx>.show()' promise to reject self.deferred.reject(fault); // Continue rejection propagation reject(fault); } }); }
[ "function", "createAndTransitionIn", "(", ")", "{", "return", "$q", "(", "function", "(", "resolve", ",", "reject", ")", "{", "// Trigger onCompiling callback before the compilation starts.", "// This is useful, when modifying options, which can be influenced by developers.", "opti...
Compile, link, and show this interim element Use optional autoHided and transition-in effects
[ "Compile", "link", "and", "show", "this", "interim", "element", "Use", "optional", "autoHided", "and", "transition", "-", "in", "effects" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/interimElement/interimElement.js#L492-L518
train
Creates a promise that will be resolved when the element is not yet rendered.
[ 30522, 3853, 3443, 5685, 6494, 3619, 22753, 2378, 1006, 1007, 1063, 2709, 1002, 1053, 1006, 3853, 1006, 10663, 1010, 15454, 1007, 1063, 1013, 1013, 9495, 2006, 9006, 8197, 2989, 2655, 5963, 2077, 1996, 6268, 4627, 1012, 1013, 1013, 2023, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
nhn/tui.editor
src/js/extensions/mark/viewerMarkerHelper.js
getRange
function getRange() { const selection = window.getSelection(); let range; if (selection && selection.rangeCount) { range = selection.getRangeAt(0).cloneRange(); } else { range = document.createRange(); range.selectNodeContents(this.preview.$el[0]); range.collapse(true); } return range; }
javascript
function getRange() { const selection = window.getSelection(); let range; if (selection && selection.rangeCount) { range = selection.getRangeAt(0).cloneRange(); } else { range = document.createRange(); range.selectNodeContents(this.preview.$el[0]); range.collapse(true); } return range; }
[ "function", "getRange", "(", ")", "{", "const", "selection", "=", "window", ".", "getSelection", "(", ")", ";", "let", "range", ";", "if", "(", "selection", "&&", "selection", ".", "rangeCount", ")", "{", "range", "=", "selection", ".", "getRangeAt", "("...
getRange get current range @returns {Range} @ignore
[ "getRange", "get", "current", "range" ]
e75ab08c2a7ab07d1143e318f7cde135c5e3002e
https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/mark/viewerMarkerHelper.js#L207-L220
train
Get the range of the preview element
[ 30522, 3853, 2131, 24388, 2063, 1006, 1007, 1063, 9530, 3367, 4989, 1027, 3332, 1012, 4152, 12260, 7542, 1006, 1007, 1025, 2292, 2846, 1025, 2065, 1006, 4989, 1004, 1004, 4989, 1012, 2846, 3597, 16671, 1007, 1063, 2846, 1027, 4989, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
javascript/node/selenium-webdriver/lib/webdriver.js
fromWireValue
function fromWireValue(driver, value) { if (Array.isArray(value)) { value = value.map(v => fromWireValue(driver, v)); } else if (WebElement.isId(value)) { let id = WebElement.extractId(value); value = new WebElement(driver, id); } else if (value && typeof value === 'object') { let result = {}; for (let key in value) { if (value.hasOwnProperty(key)) { result[key] = fromWireValue(driver, value[key]); } } value = result; } return value; }
javascript
function fromWireValue(driver, value) { if (Array.isArray(value)) { value = value.map(v => fromWireValue(driver, v)); } else if (WebElement.isId(value)) { let id = WebElement.extractId(value); value = new WebElement(driver, id); } else if (value && typeof value === 'object') { let result = {}; for (let key in value) { if (value.hasOwnProperty(key)) { result[key] = fromWireValue(driver, value[key]); } } value = result; } return value; }
[ "function", "fromWireValue", "(", "driver", ",", "value", ")", "{", "if", "(", "Array", ".", "isArray", "(", "value", ")", ")", "{", "value", "=", "value", ".", "map", "(", "v", "=>", "fromWireValue", "(", "driver", ",", "v", ")", ")", ";", "}", ...
Converts a value from its JSON representation according to the WebDriver wire protocol. Any JSON object that defines a WebElement ID will be decoded to a {@link WebElement} object. All other values will be passed through as is. @param {!WebDriver} driver The driver to use as the parent of any unwrapped {@link WebElement} values. @param {*} value The value to convert. @return {*} The converted value.
[ "Converts", "a", "value", "from", "its", "JSON", "representation", "according", "to", "the", "WebDriver", "wire", "protocol", ".", "Any", "JSON", "object", "that", "defines", "a", "WebElement", "ID", "will", "be", "decoded", "to", "a", "{", "@link", "WebElem...
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/lib/webdriver.js#L206-L222
train
Converts a value from a wire format to a WebElement
[ 30522, 3853, 2013, 20357, 10175, 5657, 1006, 4062, 1010, 3643, 1007, 1063, 2065, 1006, 9140, 1012, 18061, 11335, 2100, 1006, 3643, 1007, 1007, 1063, 3643, 1027, 3643, 1012, 4949, 1006, 1058, 1027, 1028, 2013, 20357, 10175, 5657, 1006, 4062,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/thirdparty/jszip.js
function(file) { var result = getRawData(file), type = utils.getTypeOf(result); if (type === "string") { if (!file.options.binary) { // unicode text ! // unicode string => binary string is a painful process, check if we can avoid it. if (textEncoder) { return textEncoder.encode(result); } if (support.nodebuffer) { return nodeBuffer(result, "utf-8"); } } return file.asBinary(); } return result; }
javascript
function(file) { var result = getRawData(file), type = utils.getTypeOf(result); if (type === "string") { if (!file.options.binary) { // unicode text ! // unicode string => binary string is a painful process, check if we can avoid it. if (textEncoder) { return textEncoder.encode(result); } if (support.nodebuffer) { return nodeBuffer(result, "utf-8"); } } return file.asBinary(); } return result; }
[ "function", "(", "file", ")", "{", "var", "result", "=", "getRawData", "(", "file", ")", ",", "type", "=", "utils", ".", "getTypeOf", "(", "result", ")", ";", "if", "(", "type", "===", "\"string\"", ")", "{", "if", "(", "!", "file", ".", "options",...
Returns the data of a ZipObject in a binary form. If the content is an unicode string, encode it. @param {ZipObject} file the file to use. @return {String|ArrayBuffer|Uint8Array|Buffer} the data.
[ "Returns", "the", "data", "of", "a", "ZipObject", "in", "a", "binary", "form", ".", "If", "the", "content", "is", "an", "unicode", "string", "encode", "it", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jszip.js#L398-L415
train
get the raw data of a file
[ 30522, 3853, 1006, 5371, 1007, 1063, 13075, 2765, 1027, 2131, 2527, 21724, 6790, 1006, 5371, 1007, 1010, 2828, 1027, 21183, 12146, 1012, 2131, 13874, 11253, 1006, 2765, 1007, 1025, 2065, 1006, 2828, 1027, 1027, 1027, 1000, 5164, 1000, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_addToMROFList
function _addToMROFList(file, paneId, cursorPos) { var filePath = file.fullPath; if (!paneId) { // Don't handle this if not a full view/editor return; } // Check existing list for this doc path and pane entry var index = _.findIndex(_mrofList, function (record) { return (record && record.file === filePath && record.paneId === paneId); }); var entry; if (index !== -1) { entry = _mrofList[index]; if (entry.cursor && !cursorPos) { cursorPos = entry.cursor; } } entry = _makeMROFListEntry(filePath, paneId, cursorPos); // Check if the file is an InMemoryFile if (file.constructor.name === "InMemoryFile") { // Mark the entry as inMem, so that we can knock it off from the list when removed from working set entry.inMem = true; } if (index !== -1) { _mrofList.splice(index, 1); } // add it to the front of the list _mrofList.unshift(entry); PreferencesManager.setViewState(OPEN_FILES_VIEW_STATE, _mrofList, _getPrefsContext(), true); }
javascript
function _addToMROFList(file, paneId, cursorPos) { var filePath = file.fullPath; if (!paneId) { // Don't handle this if not a full view/editor return; } // Check existing list for this doc path and pane entry var index = _.findIndex(_mrofList, function (record) { return (record && record.file === filePath && record.paneId === paneId); }); var entry; if (index !== -1) { entry = _mrofList[index]; if (entry.cursor && !cursorPos) { cursorPos = entry.cursor; } } entry = _makeMROFListEntry(filePath, paneId, cursorPos); // Check if the file is an InMemoryFile if (file.constructor.name === "InMemoryFile") { // Mark the entry as inMem, so that we can knock it off from the list when removed from working set entry.inMem = true; } if (index !== -1) { _mrofList.splice(index, 1); } // add it to the front of the list _mrofList.unshift(entry); PreferencesManager.setViewState(OPEN_FILES_VIEW_STATE, _mrofList, _getPrefsContext(), true); }
[ "function", "_addToMROFList", "(", "file", ",", "paneId", ",", "cursorPos", ")", "{", "var", "filePath", "=", "file", ".", "fullPath", ";", "if", "(", "!", "paneId", ")", "{", "// Don't handle this if not a full view/editor", "return", ";", "}", "// Check existi...
Adds an entry to MROF list @private @param {Editor} editor - editor to extract file information
[ "Adds", "an", "entry", "to", "MROF", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L579-L618
train
Add a file to the MROF list
[ 30522, 3853, 1035, 5587, 20389, 3217, 10258, 2923, 1006, 5371, 1010, 6090, 7416, 2094, 1010, 12731, 25301, 14536, 2891, 1007, 1063, 13075, 5371, 15069, 1027, 5371, 1012, 2440, 15069, 1025, 2065, 1006, 999, 6090, 7416, 2094, 1007, 1063, 1013...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
goldfire/howler.js
dist/howler.js
function(from, to, len, id) { var self = this; // If the sound hasn't loaded, add it to the load queue to fade when capable. if (self._state !== 'loaded' || self._playLock) { self._queue.push({ event: 'fade', action: function() { self.fade(from, to, len, id); } }); return self; } // Make sure the to/from/len values are numbers. from = parseFloat(from); to = parseFloat(to); len = parseFloat(len); // Set the volume to the start position. self.volume(from, id); // Fade the volume of one or all sounds. var ids = self._getSoundIds(id); for (var i=0; i<ids.length; i++) { // Get the sound. var sound = self._soundById(ids[i]); // Create a linear fade or fall back to timeouts with HTML5 Audio. if (sound) { // Stop the previous fade if no sprite is being used (otherwise, volume handles this). if (!id) { self._stopFade(ids[i]); } // If we are using Web Audio, let the native methods do the actual fade. if (self._webAudio && !sound._muted) { var currentTime = Howler.ctx.currentTime; var end = currentTime + (len / 1000); sound._volume = from; sound._node.gain.setValueAtTime(from, currentTime); sound._node.gain.linearRampToValueAtTime(to, end); } self._startFadeInterval(sound, from, to, len, ids[i], typeof id === 'undefined'); } } return self; }
javascript
function(from, to, len, id) { var self = this; // If the sound hasn't loaded, add it to the load queue to fade when capable. if (self._state !== 'loaded' || self._playLock) { self._queue.push({ event: 'fade', action: function() { self.fade(from, to, len, id); } }); return self; } // Make sure the to/from/len values are numbers. from = parseFloat(from); to = parseFloat(to); len = parseFloat(len); // Set the volume to the start position. self.volume(from, id); // Fade the volume of one or all sounds. var ids = self._getSoundIds(id); for (var i=0; i<ids.length; i++) { // Get the sound. var sound = self._soundById(ids[i]); // Create a linear fade or fall back to timeouts with HTML5 Audio. if (sound) { // Stop the previous fade if no sprite is being used (otherwise, volume handles this). if (!id) { self._stopFade(ids[i]); } // If we are using Web Audio, let the native methods do the actual fade. if (self._webAudio && !sound._muted) { var currentTime = Howler.ctx.currentTime; var end = currentTime + (len / 1000); sound._volume = from; sound._node.gain.setValueAtTime(from, currentTime); sound._node.gain.linearRampToValueAtTime(to, end); } self._startFadeInterval(sound, from, to, len, ids[i], typeof id === 'undefined'); } } return self; }
[ "function", "(", "from", ",", "to", ",", "len", ",", "id", ")", "{", "var", "self", "=", "this", ";", "// If the sound hasn't loaded, add it to the load queue to fade when capable.", "if", "(", "self", ".", "_state", "!==", "'loaded'", "||", "self", ".", "_playL...
Fade a currently playing sound between two volumes (if no id is passsed, all sounds will fade). @param {Number} from The value to fade from (0.0 to 1.0). @param {Number} to The volume to fade to (0.0 to 1.0). @param {Number} len Time in milliseconds to fade. @param {Number} id The sound id (omit to fade all sounds). @return {Howl}
[ "Fade", "a", "currently", "playing", "sound", "between", "two", "volumes", "(", "if", "no", "id", "is", "passsed", "all", "sounds", "will", "fade", ")", "." ]
030db918dd8ce640afd57e172418472497e8f113
https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L1261-L1311
train
Fade the sound at the specified location.
[ 30522, 3853, 1006, 2013, 1010, 2000, 1010, 18798, 1010, 8909, 1007, 1063, 13075, 2969, 1027, 2023, 1025, 1013, 1013, 2065, 1996, 2614, 8440, 1005, 1056, 8209, 1010, 5587, 2009, 2000, 30524, 5245, 1006, 1063, 2724, 1024, 1005, 12985, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jantimon/html-webpack-plugin
lib/compiler.js
clearCache
function clearCache (mainCompiler) { const childCompiler = getChildCompiler(mainCompiler); // If this childCompiler was already used // remove the entire childCompiler from the cache if (childCompiler.isCompiling() || childCompiler.didCompile()) { childCompilerCache.delete(mainCompiler); } }
javascript
function clearCache (mainCompiler) { const childCompiler = getChildCompiler(mainCompiler); // If this childCompiler was already used // remove the entire childCompiler from the cache if (childCompiler.isCompiling() || childCompiler.didCompile()) { childCompilerCache.delete(mainCompiler); } }
[ "function", "clearCache", "(", "mainCompiler", ")", "{", "const", "childCompiler", "=", "getChildCompiler", "(", "mainCompiler", ")", ";", "// If this childCompiler was already used", "// remove the entire childCompiler from the cache", "if", "(", "childCompiler", ".", "isCom...
Remove the childCompiler from the cache @param {WebpackCompiler} mainCompiler
[ "Remove", "the", "childCompiler", "from", "the", "cache" ]
38db64ae8805de37d038e0ee0f6dfa2a26e2163a
https://github.com/jantimon/html-webpack-plugin/blob/38db64ae8805de37d038e0ee0f6dfa2a26e2163a/lib/compiler.js#L225-L232
train
Clear the cache for a given mainCompiler
[ 30522, 3853, 3154, 3540, 5403, 1006, 2364, 9006, 22090, 2099, 1007, 1063, 9530, 3367, 2775, 9006, 22090, 2099, 1027, 2131, 19339, 9006, 22090, 2099, 1006, 2364, 9006, 22090, 2099, 1007, 1025, 1013, 1013, 2065, 2023, 2775, 9006, 22090, 2099,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
function(aDimensionName) { if (!aDimensionName) { return; } this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties for (var i = -1, sDimName; (sDimName = aDimensionName[++i]) !== undefined;) { if (!this._oQueryResult.findDimensionByName(sDimName)) { throw sDimName + " is not a valid dimension name"; // TODO } if (this._oAggregationLevel[sDimName] != undefined) { delete this._oAggregationLevel[sDimName]; // remove potential sort expression on this dimension this.getSortExpression().removeSorter(sDimName); } } }
javascript
function(aDimensionName) { if (!aDimensionName) { return; } this._oSelectedPropertyNames = null; // reset previously compiled list of selected properties for (var i = -1, sDimName; (sDimName = aDimensionName[++i]) !== undefined;) { if (!this._oQueryResult.findDimensionByName(sDimName)) { throw sDimName + " is not a valid dimension name"; // TODO } if (this._oAggregationLevel[sDimName] != undefined) { delete this._oAggregationLevel[sDimName]; // remove potential sort expression on this dimension this.getSortExpression().removeSorter(sDimName); } } }
[ "function", "(", "aDimensionName", ")", "{", "if", "(", "!", "aDimensionName", ")", "{", "return", ";", "}", "this", ".", "_oSelectedPropertyNames", "=", "null", ";", "// reset previously compiled list of selected properties", "for", "(", "var", "i", "=", "-", "...
Remove one or more dimensions from the aggregation level. The method also removed a potential sort expression on the dimension. @param aDimensionName Array of dimension names to be removed from the already defined aggregation level. @public @function @name sap.ui.model.analytics.odata4analytics.QueryResultRequest#removeFromAggregationLevel
[ "Remove", "one", "or", "more", "dimensions", "from", "the", "aggregation", "level", ".", "The", "method", "also", "removed", "a", "potential", "sort", "expression", "on", "the", "dimension", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4230-L4247
train
Removes the aggregation level for a dimension
[ 30522, 3853, 1006, 27133, 3549, 10992, 18442, 1007, 1063, 2065, 1006, 999, 27133, 3549, 10992, 18442, 1007, 1063, 2709, 1025, 1065, 2023, 1012, 1035, 9808, 12260, 10985, 21572, 4842, 25680, 14074, 2015, 1027, 19701, 1025, 1013, 1013, 25141, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
goldfire/howler.js
examples/3d/js/camera.js
function(height, angle, dist) { var z = dist * Math.cos(angle); var wallH = this.height * height / z; var bottom = this.height / 2 * (1 + 1 / z); return { top: bottom - wallH, height: wallH }; }
javascript
function(height, angle, dist) { var z = dist * Math.cos(angle); var wallH = this.height * height / z; var bottom = this.height / 2 * (1 + 1 / z); return { top: bottom - wallH, height: wallH }; }
[ "function", "(", "height", ",", "angle", ",", "dist", ")", "{", "var", "z", "=", "dist", "*", "Math", ".", "cos", "(", "angle", ")", ";", "var", "wallH", "=", "this", ".", "height", "*", "height", "/", "z", ";", "var", "bottom", "=", "this", "....
Based on the angle and distance, determine how we are going to project the image. @param {Number} height Wall piece height. @param {Number} angle Angle of the ray. @param {Number} dist Distnace from the player. @return {Object} top and height
[ "Based", "on", "the", "angle", "and", "distance", "determine", "how", "we", "are", "going", "to", "project", "the", "image", "." ]
030db918dd8ce640afd57e172418472497e8f113
https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/3d/js/camera.js#L143-L152
train
Compute the top and height of the line
[ 30522, 3853, 1006, 4578, 1010, 6466, 1010, 4487, 3367, 1007, 1063, 13075, 1062, 1027, 4487, 3367, 1008, 8785, 1012, 2522, 2015, 1006, 6466, 1007, 1025, 13075, 2813, 2232, 1027, 2023, 1012, 4578, 1008, 4578, 1013, 1062, 1025, 13075, 3953, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/ODataListBinding.js
replaceLambdaVariables
function replaceLambdaVariables(sPath, mLambdaVariableToPath) { var aSegments = sPath.split("/"); aSegments[0] = mLambdaVariableToPath[aSegments[0]]; return aSegments[0] ? aSegments.join("/") : sPath; }
javascript
function replaceLambdaVariables(sPath, mLambdaVariableToPath) { var aSegments = sPath.split("/"); aSegments[0] = mLambdaVariableToPath[aSegments[0]]; return aSegments[0] ? aSegments.join("/") : sPath; }
[ "function", "replaceLambdaVariables", "(", "sPath", ",", "mLambdaVariableToPath", ")", "{", "var", "aSegments", "=", "sPath", ".", "split", "(", "\"/\"", ")", ";", "aSegments", "[", "0", "]", "=", "mLambdaVariableToPath", "[", "aSegments", "[", "0", "]", "]"...
Replaces an optional lambda variable in the first segment of the given path by the correct path. @param {string} sPath The path with an optional lambda variable at the beginning @param {object} mLambdaVariableToPath The map from lambda variable to full path @returns {string} The path with replaced lambda variable
[ "Replaces", "an", "optional", "lambda", "variable", "in", "the", "first", "segment", "of", "the", "given", "path", "by", "the", "correct", "path", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataListBinding.js#L968-L973
train
Replaces the given path with the corresponding value in the given map.
[ 30522, 3853, 5672, 10278, 2497, 29045, 10980, 13510, 1006, 14690, 2232, 1010, 18619, 14905, 29045, 10980, 3468, 14399, 8988, 1007, 1063, 13075, 2004, 13910, 8163, 1027, 14690, 2232, 1012, 3975, 1006, 1000, 1013, 1000, 1007, 1025, 2004, 13910,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-echarts
src/scale/Log.js
function (opt) { intervalScaleProto.niceExtent.call(this, opt); var originalScale = this._originalScale; originalScale.__fixMin = opt.fixMin; originalScale.__fixMax = opt.fixMax; }
javascript
function (opt) { intervalScaleProto.niceExtent.call(this, opt); var originalScale = this._originalScale; originalScale.__fixMin = opt.fixMin; originalScale.__fixMax = opt.fixMax; }
[ "function", "(", "opt", ")", "{", "intervalScaleProto", ".", "niceExtent", ".", "call", "(", "this", ",", "opt", ")", ";", "var", "originalScale", "=", "this", ".", "_originalScale", ";", "originalScale", ".", "__fixMin", "=", "opt", ".", "fixMin", ";", ...
Nice extent. @override
[ "Nice", "extent", "." ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/scale/Log.js#L181-L187
train
This method is called by the base class to determine the extent of the interval.
[ 30522, 3853, 1006, 23569, 1007, 1063, 14025, 9289, 13699, 21709, 2080, 1012, 3835, 10288, 6528, 2102, 1012, 2655, 1006, 2023, 1010, 23569, 1007, 1025, 13075, 23728, 9289, 2063, 1027, 2023, 1012, 1035, 23728, 9289, 2063, 1025, 23728, 9289, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...