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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SheetJS/js-xlsx | xlsx.js | parse_FormulaValue | function parse_FormulaValue(blob) {
var b;
if(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n'];
switch(blob[blob.l]) {
case 0x00: blob.l += 8; return ["String", 's'];
case 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b'];
case 0x02: b = blob[blob.l+2]; blob.l += 8; return ... | javascript | function parse_FormulaValue(blob) {
var b;
if(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n'];
switch(blob[blob.l]) {
case 0x00: blob.l += 8; return ["String", 's'];
case 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b'];
case 0x02: b = blob[blob.l+2]; blob.l += 8; return ... | [
"function",
"parse_FormulaValue",
"(",
"blob",
")",
"{",
"var",
"b",
";",
"if",
"(",
"__readUInt16LE",
"(",
"blob",
",",
"blob",
".",
"l",
"+",
"6",
")",
"!==",
"0xFFFF",
")",
"return",
"[",
"parse_Xnum",
"(",
"blob",
")",
",",
"'n'",
"]",
";",
"sw... | /* [MS-XLS] 2.5.133 TODO: how to emit empty strings? | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"5",
".",
"133",
"TODO",
":",
"how",
"to",
"emit",
"empty",
"strings?"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L11303-L11313 | train | Parse an formula value | [
30522,
3853,
11968,
3366,
1035,
5675,
10175,
5657,
1006,
1038,
4135,
2497,
1007,
1063,
13075,
1038,
1025,
2065,
1006,
1035,
1035,
3191,
20023,
2102,
16048,
2571,
1006,
1038,
4135,
2497,
1010,
1038,
4135,
2497,
1012,
1048,
1009,
1020,
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... |
NetEase/pomelo | lib/connectors/siosocket.js | function(msgs){
var res = '[', msg;
for(var i=0, l=msgs.length; i<l; i++) {
if(i > 0) {
res += ',';
}
msg = msgs[i];
if(typeof msg === 'string') {
res += msg;
} else {
res += JSON.stringify(msg);
}
}
res += ']';
return res;
} | javascript | function(msgs){
var res = '[', msg;
for(var i=0, l=msgs.length; i<l; i++) {
if(i > 0) {
res += ',';
}
msg = msgs[i];
if(typeof msg === 'string') {
res += msg;
} else {
res += JSON.stringify(msg);
}
}
res += ']';
return res;
} | [
"function",
"(",
"msgs",
")",
"{",
"var",
"res",
"=",
"'['",
",",
"msg",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"=",
"msgs",
".",
"length",
";",
"i",
"<",
"l",
";",
"i",
"++",
")",
"{",
"if",
"(",
"i",
">",
"0",
")",
"{",
"res... | Encode batch msg to client | [
"Encode",
"batch",
"msg",
"to",
"client"
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/connectors/siosocket.js#L64-L79 | train | Returns a string containing the msgs as an array of strings | [
30522,
3853,
1006,
5796,
5620,
1007,
1063,
13075,
24501,
1027,
1005,
1031,
1005,
1010,
5796,
2290,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1010,
1048,
1027,
5796,
5620,
1012,
3091,
1025,
1045,
1026,
1048,
1025,
1045,
1009,
1009,
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... | |
google/material-design-lite | src/mdlComponentHandler.js | upgradeDomInternal | function upgradeDomInternal(optJsClass, optCssClass) {
if (typeof optJsClass === 'undefined' &&
typeof optCssClass === 'undefined') {
for (var i = 0; i < registeredComponents_.length; i++) {
upgradeDomInternal(registeredComponents_[i].className,
registeredComponents_[i].cssClass);
... | javascript | function upgradeDomInternal(optJsClass, optCssClass) {
if (typeof optJsClass === 'undefined' &&
typeof optCssClass === 'undefined') {
for (var i = 0; i < registeredComponents_.length; i++) {
upgradeDomInternal(registeredComponents_[i].className,
registeredComponents_[i].cssClass);
... | [
"function",
"upgradeDomInternal",
"(",
"optJsClass",
",",
"optCssClass",
")",
"{",
"if",
"(",
"typeof",
"optJsClass",
"===",
"'undefined'",
"&&",
"typeof",
"optCssClass",
"===",
"'undefined'",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"reg... | Searches existing DOM for elements of our component type and upgrades them
if they have not already been upgraded.
@param {string=} optJsClass the programatic name of the element class we
need to create a new instance of.
@param {string=} optCssClass the name of the CSS class elements of this
type will have. | [
"Searches",
"existing",
"DOM",
"for",
"elements",
"of",
"our",
"component",
"type",
"and",
"upgrades",
"them",
"if",
"they",
"have",
"not",
"already",
"been",
"upgraded",
"."
] | 60f441a22ed98ed2c03f6179adf460d888bf459f | https://github.com/google/material-design-lite/blob/60f441a22ed98ed2c03f6179adf460d888bf459f/src/mdlComponentHandler.js#L173-L194 | train | This function is called by the upgradeDom function. It is called by the upgradeDom function. It is called by the upgradeDom function. It is called by the upgradeDom function. It is called by the upgradeDom function. It is called by the upgradeDom function. It is called by the upgradeDom function. It is called by the up... | [
30522,
3853,
9725,
20936,
10111,
12789,
2140,
1006,
23569,
22578,
26266,
1010,
23569,
6169,
11020,
27102,
1007,
1063,
2065,
1006,
2828,
11253,
23569,
22578,
26266,
1027,
1027,
1027,
1005,
6151,
28344,
1005,
1004,
1004,
2828,
11253,
23569,
616... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/TableScrollExtension.js | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var aEventListenerTargets = ScrollingHelper.getEventListenerTargets(oTable);
oScrollExtension._mMouseWheelEventListener = this.addMouseWheelEventListener(aEventListenerTargets, oTable, {
scrollDirection: ScrollDirection.BOTH
});
... | javascript | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var aEventListenerTargets = ScrollingHelper.getEventListenerTargets(oTable);
oScrollExtension._mMouseWheelEventListener = this.addMouseWheelEventListener(aEventListenerTargets, oTable, {
scrollDirection: ScrollDirection.BOTH
});
... | [
"function",
"(",
"oTable",
")",
"{",
"var",
"oScrollExtension",
"=",
"oTable",
".",
"_getScrollExtension",
"(",
")",
";",
"var",
"aEventListenerTargets",
"=",
"ScrollingHelper",
".",
"getEventListenerTargets",
"(",
"oTable",
")",
";",
"oScrollExtension",
".",
"_mM... | Adds mouse wheel and touch event listeners.
@param {sap.ui.table.Table} oTable Instance of the table. | [
"Adds",
"mouse",
"wheel",
"and",
"touch",
"event",
"listeners",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableScrollExtension.js#L1059-L1069 | train | Adds mouse wheel and touch event listeners to the table. | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
13075,
9808,
26775,
14511,
10288,
29048,
1027,
27178,
3085,
1012,
1035,
4152,
26775,
14511,
10288,
29048,
1006,
1007,
1025,
13075,
29347,
15338,
9863,
24454,
7559,
18150,
2015,
1027,
28903,
16001,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... | |
caolan/async | lib/concatLimit.js | concatLimit | function concatLimit(coll, limit, iteratee, callback) {
var _iteratee = wrapAsync(iteratee);
return mapLimit(coll, limit, (val, iterCb) => {
_iteratee(val, (err, ...args) => {
if (err) return iterCb(err);
return iterCb(err, args);
});
}, (err, mapResults) => {
... | javascript | function concatLimit(coll, limit, iteratee, callback) {
var _iteratee = wrapAsync(iteratee);
return mapLimit(coll, limit, (val, iterCb) => {
_iteratee(val, (err, ...args) => {
if (err) return iterCb(err);
return iterCb(err, args);
});
}, (err, mapResults) => {
... | [
"function",
"concatLimit",
"(",
"coll",
",",
"limit",
",",
"iteratee",
",",
"callback",
")",
"{",
"var",
"_iteratee",
"=",
"wrapAsync",
"(",
"iteratee",
")",
";",
"return",
"mapLimit",
"(",
"coll",
",",
"limit",
",",
"(",
"val",
",",
"iterCb",
")",
"=>... | The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time.
@name concatLimit
@static
@memberOf module:Collections
@method
@see [async.concat]{@link module:Collections.concat}
@category Collection
@alias flatMapLimit
@param {Array|Iterable|AsyncIterable|Object} col... | [
"The",
"same",
"as",
"[",
"concat",
"]",
"{",
"@link",
"module",
":",
"Collections",
".",
"concat",
"}",
"but",
"runs",
"a",
"maximum",
"of",
"limit",
"async",
"operations",
"at",
"a",
"time",
"."
] | 4330d536c106592139fa82062494c9dba0da1fdb | https://github.com/caolan/async/blob/4330d536c106592139fa82062494c9dba0da1fdb/lib/concatLimit.js#L25-L42 | train | Concat a collection of tcube tables | [
30522,
3853,
9530,
11266,
17960,
4183,
1006,
8902,
2140,
1010,
5787,
1010,
2009,
22139,
2063,
1010,
2655,
5963,
1007,
1063,
13075,
1035,
2009,
22139,
2063,
1027,
10236,
3022,
6038,
2278,
1006,
2009,
22139,
2063,
1007,
1025,
2709,
4949,
1796... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
TryGhost/Ghost | core/server/helpers/navigation.js | _isCurrentUrl | function _isCurrentUrl(href, currentUrl) {
if (!currentUrl) {
return false;
}
var strippedHref = href.replace(/\/+$/, ''),
strippedCurrentUrl = currentUrl.replace(/\/+$/, '');
return strippedHref === strippedCurrentUrl;
} | javascript | function _isCurrentUrl(href, currentUrl) {
if (!currentUrl) {
return false;
}
var strippedHref = href.replace(/\/+$/, ''),
strippedCurrentUrl = currentUrl.replace(/\/+$/, '');
return strippedHref === strippedCurrentUrl;
} | [
"function",
"_isCurrentUrl",
"(",
"href",
",",
"currentUrl",
")",
"{",
"if",
"(",
"!",
"currentUrl",
")",
"{",
"return",
"false",
";",
"}",
"var",
"strippedHref",
"=",
"href",
".",
"replace",
"(",
"/",
"\\/+$",
"/",
",",
"''",
")",
",",
"strippedCurren... | strips trailing slashes and compares urls | [
"strips",
"trailing",
"slashes",
"and",
"compares",
"urls"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/helpers/navigation.js#L53-L61 | train | Check if the current url is the same as the href | [
30522,
3853,
1035,
2003,
10841,
14343,
3372,
3126,
2140,
1006,
17850,
12879,
1010,
2783,
3126,
2140,
1007,
1063,
2065,
1006,
999,
2783,
3126,
2140,
1007,
1063,
2709,
6270,
1025,
1065,
13075,
10040,
28362,
2546,
1027,
17850,
12879,
1012,
567... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/component/tooltip/TooltipView.js | function (tooltipModel, ecModel, api, payload) {
var seriesIndex = payload.seriesIndex;
var dataIndex = payload.dataIndex;
var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;
if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {
... | javascript | function (tooltipModel, ecModel, api, payload) {
var seriesIndex = payload.seriesIndex;
var dataIndex = payload.dataIndex;
var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;
if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {
... | [
"function",
"(",
"tooltipModel",
",",
"ecModel",
",",
"api",
",",
"payload",
")",
"{",
"var",
"seriesIndex",
"=",
"payload",
".",
"seriesIndex",
";",
"var",
"dataIndex",
"=",
"payload",
".",
"dataIndex",
";",
"var",
"coordSysAxesInfo",
"=",
"ecModel",
".",
... | Be compatible with previous design, that is, when tooltip.type is 'axis' and dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer and tooltip. | [
"Be",
"compatible",
"with",
"previous",
"design",
"that",
"is",
"when",
"tooltip",
".",
"type",
"is",
"axis",
"and",
"dispatchAction",
"showTip",
"with",
"seriesIndex",
"and",
"dataIndex",
"will",
"trigger",
"axis",
"pointer",
"and",
"tooltip",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/component/tooltip/TooltipView.js#L272-L306 | train | update axisPointer | [
30522,
3853,
1006,
6994,
25101,
5302,
9247,
1010,
14925,
5302,
9247,
1010,
17928,
1010,
18093,
1007,
1063,
13075,
2186,
22254,
10288,
1027,
18093,
1012,
2186,
22254,
10288,
1025,
13075,
2951,
22254,
10288,
1027,
18093,
1012,
2951,
22254,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... | |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onReauthenticateWithEmailLink | function onReauthenticateWithEmailLink() {
var email = $('#link-with-email-link-email').val();
var link = $('#link-with-email-link-link').val() || undefined;
var credential = firebase.auth.EmailAuthProvider
.credentialWithLink(email, link);
activeUser().reauthenticateWithCredential(credential)
.then... | javascript | function onReauthenticateWithEmailLink() {
var email = $('#link-with-email-link-email').val();
var link = $('#link-with-email-link-link').val() || undefined;
var credential = firebase.auth.EmailAuthProvider
.credentialWithLink(email, link);
activeUser().reauthenticateWithCredential(credential)
.then... | [
"function",
"onReauthenticateWithEmailLink",
"(",
")",
"{",
"var",
"email",
"=",
"$",
"(",
"'#link-with-email-link-email'",
")",
".",
"val",
"(",
")",
";",
"var",
"link",
"=",
"$",
"(",
"'#link-with-email-link-link'",
")",
".",
"val",
"(",
")",
"||",
"undefi... | Re-authenticate a user with email link credential. | [
"Re",
"-",
"authenticate",
"a",
"user",
"with",
"email",
"link",
"credential",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L355-L366 | train | Reauthenticate with email link | [
30522,
3853,
2006,
16416,
14317,
4765,
24695,
24415,
14545,
8591,
19839,
1006,
1007,
1063,
13075,
10373,
1027,
1002,
1006,
1005,
1001,
4957,
1011,
2007,
1011,
10373,
1011,
4957,
1011,
10373,
1005,
1007,
1012,
11748,
1006,
1007,
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... |
adobe/brackets | src/editor/EditorStatusBar.js | _updateCursorInfo | function _updateCursorInfo(event, editor) {
editor = editor || EditorManager.getActiveEditor();
// compute columns, account for tab size
var cursor = editor.getCursorPos(true);
var cursorStr = StringUtils.format(Strings.STATUSBAR_CURSOR_POSITION, cursor.line + 1, cursor.ch + 1);
... | javascript | function _updateCursorInfo(event, editor) {
editor = editor || EditorManager.getActiveEditor();
// compute columns, account for tab size
var cursor = editor.getCursorPos(true);
var cursorStr = StringUtils.format(Strings.STATUSBAR_CURSOR_POSITION, cursor.line + 1, cursor.ch + 1);
... | [
"function",
"_updateCursorInfo",
"(",
"event",
",",
"editor",
")",
"{",
"editor",
"=",
"editor",
"||",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
";",
"// compute columns, account for tab size",
"var",
"cursor",
"=",
"editor",
".",
"getCursorPos",
"(",
"tr... | Update cursor(s)/selection(s) information
@param {Event} event (unused)
@param {Editor} editor Current editor | [
"Update",
"cursor",
"(",
"s",
")",
"/",
"selection",
"(",
"s",
")",
"information"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L166-L200 | train | Update cursor info | [
30522,
3853,
1035,
10651,
10841,
25301,
6657,
14876,
1006,
2724,
1010,
3559,
1007,
1063,
3559,
1027,
3559,
1064,
1064,
3559,
24805,
4590,
1012,
2131,
19620,
2098,
15660,
1006,
1007,
1025,
1013,
1013,
24134,
7753,
1010,
4070,
2005,
21628,
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... |
SAP/openui5 | src/sap.ui.support/src/sap/ui/support/supportRules/ui/models/PresetsUtils.js | function (oImport) {
var bIsFileValid = true;
if (!oImport.hasOwnProperty("title")) {
bIsFileValid = false;
}
if (!oImport.hasOwnProperty("selections")) {
bIsFileValid = false;
} else if (!Array.isArray(oImport.selections)) {
bIsFileValid = false;
} else {
for (var i = 0; i < oImport... | javascript | function (oImport) {
var bIsFileValid = true;
if (!oImport.hasOwnProperty("title")) {
bIsFileValid = false;
}
if (!oImport.hasOwnProperty("selections")) {
bIsFileValid = false;
} else if (!Array.isArray(oImport.selections)) {
bIsFileValid = false;
} else {
for (var i = 0; i < oImport... | [
"function",
"(",
"oImport",
")",
"{",
"var",
"bIsFileValid",
"=",
"true",
";",
"if",
"(",
"!",
"oImport",
".",
"hasOwnProperty",
"(",
"\"title\"",
")",
")",
"{",
"bIsFileValid",
"=",
"false",
";",
"}",
"if",
"(",
"!",
"oImport",
".",
"hasOwnProperty",
... | Validates if the given import is in the correct format.
@param {Object} oImport The preset object to import
@return {boolean} Is the import data a valid rule preset file | [
"Validates",
"if",
"the",
"given",
"import",
"is",
"in",
"the",
"correct",
"format",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/models/PresetsUtils.js#L139-L161 | train | Checks if the import has a title and selections | [
30522,
3853,
1006,
1051,
5714,
6442,
1007,
1063,
13075,
20377,
8873,
20414,
11475,
2094,
1027,
2995,
1025,
2065,
1006,
999,
1051,
5714,
6442,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
1000,
2516,
1000,
1007,
1007,
1063,
20377,
8873,
20414... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... | |
webpack/webpack | lib/node/NodeMainTemplateAsync.runtime.js | hotDownloadManifest | function hotDownloadManifest() {
var filename = require("path").join(__dirname, $hotMainFilename$);
return new Promise(function(resolve, reject) {
require("fs").readFile(filename, "utf-8", function(err, content) {
if (err) return resolve();
try {
var update = JSON.parse(content);
} catch (e) {
... | javascript | function hotDownloadManifest() {
var filename = require("path").join(__dirname, $hotMainFilename$);
return new Promise(function(resolve, reject) {
require("fs").readFile(filename, "utf-8", function(err, content) {
if (err) return resolve();
try {
var update = JSON.parse(content);
} catch (e) {
... | [
"function",
"hotDownloadManifest",
"(",
")",
"{",
"var",
"filename",
"=",
"require",
"(",
"\"path\"",
")",
".",
"join",
"(",
"__dirname",
",",
"$hotMainFilename$",
")",
";",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"... | eslint-disable-next-line no-unused-vars | [
"eslint",
"-",
"disable",
"-",
"next",
"-",
"line",
"no",
"-",
"unused",
"-",
"vars"
] | 81cf088cd6a0231b94fa2399bd29294eccee1907 | https://github.com/webpack/webpack/blob/81cf088cd6a0231b94fa2399bd29294eccee1907/lib/node/NodeMainTemplateAsync.runtime.js#L25-L38 | train | Download the hot - main manifest | [
30522,
3853,
2980,
7698,
11066,
20799,
14081,
1006,
1007,
1063,
13075,
5371,
18442,
1027,
5478,
1006,
1000,
4130,
1000,
1007,
1012,
3693,
1006,
1035,
1035,
16101,
18442,
1010,
1002,
2980,
24238,
8873,
20844,
4168,
1002,
1007,
1025,
2709,
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... |
firebase/firebaseui-web | demo/public/app.js | handleConfigChange | function handleConfigChange() {
var newRecaptchaValue = document.querySelector(
'input[name="recaptcha"]:checked').value;
var newEmailSignInMethodValue = document.querySelector(
'input[name="emailSignInMethod"]:checked').value;
location.replace(
location.pathname + '#recaptcha=' + newRecaptchaVa... | javascript | function handleConfigChange() {
var newRecaptchaValue = document.querySelector(
'input[name="recaptcha"]:checked').value;
var newEmailSignInMethodValue = document.querySelector(
'input[name="emailSignInMethod"]:checked').value;
location.replace(
location.pathname + '#recaptcha=' + newRecaptchaVa... | [
"function",
"handleConfigChange",
"(",
")",
"{",
"var",
"newRecaptchaValue",
"=",
"document",
".",
"querySelector",
"(",
"'input[name=\"recaptcha\"]:checked'",
")",
".",
"value",
";",
"var",
"newEmailSignInMethodValue",
"=",
"document",
".",
"querySelector",
"(",
"'in... | Handles when the user changes the reCAPTCHA or email signInMethod config. | [
"Handles",
"when",
"the",
"user",
"changes",
"the",
"reCAPTCHA",
"or",
"email",
"signInMethod",
"config",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L190-L202 | train | Handle the config change | [
30522,
3853,
5047,
8663,
8873,
18195,
18003,
2063,
1006,
1007,
1063,
13075,
30524,
1012,
23032,
11246,
22471,
2953,
1006,
1005,
7953,
1031,
2171,
1027,
1000,
28667,
9331,
10649,
2050,
1000,
1033,
1024,
7039,
1005,
1007,
1012,
3643,
1025,
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... |
badges/shields | core/badge-urls/path-helpers.js | escapeFormat | function escapeFormat(t) {
return (
t
// Inline single underscore.
.replace(/([^_])_([^_])/g, '$1 $2')
// Leading or trailing underscore.
.replace(/([^_])_$/, '$1 ')
.replace(/^_([^_])/, ' $1')
// Double underscore and double dash.
.replace(/__/g, '_')
.replace(/--/... | javascript | function escapeFormat(t) {
return (
t
// Inline single underscore.
.replace(/([^_])_([^_])/g, '$1 $2')
// Leading or trailing underscore.
.replace(/([^_])_$/, '$1 ')
.replace(/^_([^_])/, ' $1')
// Double underscore and double dash.
.replace(/__/g, '_')
.replace(/--/... | [
"function",
"escapeFormat",
"(",
"t",
")",
"{",
"return",
"(",
"t",
"// Inline single underscore.",
".",
"replace",
"(",
"/",
"([^_])_([^_])",
"/",
"g",
",",
"'$1 $2'",
")",
"// Leading or trailing underscore.",
".",
"replace",
"(",
"/",
"([^_])_$",
"/",
",",
... | Escapes `t` using the format specified in <https://github.com/espadrine/gh-badges/issues/12#issuecomment-31518129> | [
"Escapes",
"t",
"using",
"the",
"format",
"specified",
"in",
"<https",
":",
"//",
"github",
".",
"com",
"/",
"espadrine",
"/",
"gh",
"-",
"badges",
"/",
"issues",
"/",
"12#issuecomment",
"-",
"31518129",
">"
] | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/core/badge-urls/path-helpers.js#L5-L17 | train | Escape a format string | [
30522,
3853,
4019,
14192,
4017,
1006,
1056,
1007,
1063,
2709,
1006,
1056,
1013,
1013,
23881,
2309,
2104,
9363,
2890,
1012,
1012,
5672,
1006,
1013,
1006,
1031,
1034,
1035,
1033,
1007,
1035,
1006,
1031,
1034,
1035,
1033,
1007,
1013,
1043,
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... |
chartjs/Chart.js | src/core/core.tooltip.js | pushOrConcat | function pushOrConcat(base, toPush) {
if (toPush) {
if (helpers.isArray(toPush)) {
// base = base.concat(toPush);
Array.prototype.push.apply(base, toPush);
} else {
base.push(toPush);
}
}
return base;
} | javascript | function pushOrConcat(base, toPush) {
if (toPush) {
if (helpers.isArray(toPush)) {
// base = base.concat(toPush);
Array.prototype.push.apply(base, toPush);
} else {
base.push(toPush);
}
}
return base;
} | [
"function",
"pushOrConcat",
"(",
"base",
",",
"toPush",
")",
"{",
"if",
"(",
"toPush",
")",
"{",
"if",
"(",
"helpers",
".",
"isArray",
"(",
"toPush",
")",
")",
"{",
"// base = base.concat(toPush);",
"Array",
".",
"prototype",
".",
"push",
".",
"apply",
"... | Helper to push or concat based on if the 2nd parameter is an array or not | [
"Helper",
"to",
"push",
"or",
"concat",
"based",
"on",
"if",
"the",
"2nd",
"parameter",
"is",
"an",
"array",
"or",
"not"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/core/core.tooltip.js#L178-L189 | train | push or concat to array | [
30522,
3853,
5245,
2953,
8663,
11266,
1006,
2918,
1010,
2327,
20668,
1007,
1063,
2065,
1006,
2327,
20668,
1007,
1063,
2065,
1006,
2393,
2545,
1012,
18061,
11335,
2100,
1006,
2327,
20668,
1007,
1007,
1063,
1013,
1013,
2918,
1027,
2918,
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/error.js | throwDecodedError | function throwDecodedError(data) {
if (isErrorResponse(data)) {
let ctor = ERROR_CODE_TO_TYPE.get(data.error) || WebDriverError;
let err = new ctor(data.message);
// TODO(jleyba): remove whichever case is excluded from the final W3C spec.
if (typeof data.stacktrace === 'string') {
err.remoteStac... | javascript | function throwDecodedError(data) {
if (isErrorResponse(data)) {
let ctor = ERROR_CODE_TO_TYPE.get(data.error) || WebDriverError;
let err = new ctor(data.message);
// TODO(jleyba): remove whichever case is excluded from the final W3C spec.
if (typeof data.stacktrace === 'string') {
err.remoteStac... | [
"function",
"throwDecodedError",
"(",
"data",
")",
"{",
"if",
"(",
"isErrorResponse",
"(",
"data",
")",
")",
"{",
"let",
"ctor",
"=",
"ERROR_CODE_TO_TYPE",
".",
"get",
"(",
"data",
".",
"error",
")",
"||",
"WebDriverError",
";",
"let",
"err",
"=",
"new",... | Throws an error coded from the W3C protocol. A generic error will be thrown
if the provided `data` is not a valid encoded error.
@param {{error: string, message: string}} data The error data to decode.
@throws {WebDriverError} the decoded error.
@see https://w3c.github.io/webdriver/webdriver-spec.html#protocol | [
"Throws",
"an",
"error",
"coded",
"from",
"the",
"W3C",
"protocol",
".",
"A",
"generic",
"error",
"will",
"be",
"thrown",
"if",
"the",
"provided",
"data",
"is",
"not",
"a",
"valid",
"encoded",
"error",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/lib/error.js#L547-L560 | train | Throw an error from the server | [
30522,
3853,
5466,
3207,
16044,
4063,
29165,
1006,
2951,
1007,
1063,
2065,
1006,
2003,
2121,
29165,
6072,
26029,
3366,
1006,
2951,
1007,
1007,
1063,
2292,
14931,
2953,
1027,
7561,
1035,
3642,
1035,
2000,
1035,
2828,
1012,
2131,
1006,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.demokit/src/sap/ui/demokit/demoapps/controller/App.controller.js | function (oEvent) {
var oDownloadDialog = this.byId("downloadDialog");
this._oDownloadButton = oEvent.getSource();
oDownloadDialog.getBinding("items").filter([]);
oDownloadDialog.open();
// hack: override of the SelectDialog's internal dialog height
oDownloadDialog._oDialog.setContentHeight("");
} | javascript | function (oEvent) {
var oDownloadDialog = this.byId("downloadDialog");
this._oDownloadButton = oEvent.getSource();
oDownloadDialog.getBinding("items").filter([]);
oDownloadDialog.open();
// hack: override of the SelectDialog's internal dialog height
oDownloadDialog._oDialog.setContentHeight("");
} | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"oDownloadDialog",
"=",
"this",
".",
"byId",
"(",
"\"downloadDialog\"",
")",
";",
"this",
".",
"_oDownloadButton",
"=",
"oEvent",
".",
"getSource",
"(",
")",
";",
"oDownloadDialog",
".",
"getBinding",
"(",
"\"items... | /* =========================================================== /* event handlers /* ===========================================================
Opens the download dialog
@param {sap.ui.base.Event} oEvent the Button press event
@public | [
"/",
"*",
"===========================================================",
"/",
"*",
"event",
"handlers",
"/",
"*",
"===========================================================",
"Opens",
"the",
"download",
"dialog"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/demoapps/controller/App.controller.js#L32-L40 | train | Opens the download dialog | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
1051,
7698,
11066,
27184,
8649,
1027,
2023,
1012,
2011,
3593,
1006,
30524,
1025,
1051,
7698,
11066,
27184,
8649,
1012,
2330,
1006,
1007,
1025,
1013,
1013,
20578,
1024,
2058,
15637,
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... | |
adobe/brackets | src/search/FindBar.js | _handleKeydown | function _handleKeydown(e) {
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
e.stopPropagation();
e.preventDefault();
self.close();
}
} | javascript | function _handleKeydown(e) {
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
e.stopPropagation();
e.preventDefault();
self.close();
}
} | [
"function",
"_handleKeydown",
"(",
"e",
")",
"{",
"if",
"(",
"e",
".",
"keyCode",
"===",
"KeyEvent",
".",
"DOM_VK_ESCAPE",
")",
"{",
"e",
".",
"stopPropagation",
"(",
")",
";",
"e",
".",
"preventDefault",
"(",
")",
";",
"self",
".",
"close",
"(",
")"... | Done this way because ModalBar.js seems to react unreliably when modifying it to handle the escape key - the findbar wasn't getting closed as it should, instead persisting in the background | [
"Done",
"this",
"way",
"because",
"ModalBar",
".",
"js",
"seems",
"to",
"react",
"unreliably",
"when",
"modifying",
"it",
"to",
"handle",
"the",
"escape",
"key",
"-",
"the",
"findbar",
"wasn",
"t",
"getting",
"closed",
"as",
"it",
"should",
"instead",
"per... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindBar.js#L288-L294 | train | handle keydown event | [
30522,
3853,
1035,
5047,
14839,
7698,
1006,
1041,
1007,
1063,
2065,
1006,
1041,
1012,
3145,
16044,
1027,
1027,
1027,
3145,
18697,
3372,
1012,
14383,
1035,
1058,
2243,
1035,
4019,
1007,
1063,
1041,
1012,
2644,
21572,
4502,
12540,
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... |
NG-ZORRO/ng-zorro-antd | scripts/publish/publish.js | changeVersion | function changeVersion() {
log.info('Updating version number...');
const packageJsonPath = path.join(__dirname, '../../components/package.json');
const appComponentPath = path.join(__dirname, '../site/_site/doc/app/app.component.ts');
const codeBoxPath = path.join(__dirname, '../site/_site/doc/app/share/nz-cod... | javascript | function changeVersion() {
log.info('Updating version number...');
const packageJsonPath = path.join(__dirname, '../../components/package.json');
const appComponentPath = path.join(__dirname, '../site/_site/doc/app/app.component.ts');
const codeBoxPath = path.join(__dirname, '../site/_site/doc/app/share/nz-cod... | [
"function",
"changeVersion",
"(",
")",
"{",
"log",
".",
"info",
"(",
"'Updating version number...'",
")",
";",
"const",
"packageJsonPath",
"=",
"path",
".",
"join",
"(",
"__dirname",
",",
"'../../components/package.json'",
")",
";",
"const",
"appComponentPath",
"=... | publish();
Publisher should input the new version number. This script would check if the input is valid. | [
"publish",
"()",
";",
"Publisher",
"should",
"input",
"the",
"new",
"version",
"number",
".",
"This",
"script",
"would",
"check",
"if",
"the",
"input",
"is",
"valid",
"."
] | b0f353cbf15682b437a819a8721b34aacaa9e3e1 | https://github.com/NG-ZORRO/ng-zorro-antd/blob/b0f353cbf15682b437a819a8721b34aacaa9e3e1/scripts/publish/publish.js#L42-L120 | train | Updates the version number of the current package. json file. | [
30522,
3853,
2689,
27774,
1006,
1007,
1063,
8833,
1012,
18558,
1006,
1005,
2039,
16616,
2544,
2193,
1012,
1012,
1012,
1005,
1007,
1025,
9530,
3367,
7427,
22578,
2239,
15069,
1027,
4130,
1012,
3693,
1006,
1035,
1035,
16101,
18442,
1010,
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... |
openlayers/openlayers | src/ol/control/FullScreen.js | requestFullScreen | function requestFullScreen(element) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
}
} | javascript | function requestFullScreen(element) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
}
} | [
"function",
"requestFullScreen",
"(",
"element",
")",
"{",
"if",
"(",
"element",
".",
"requestFullscreen",
")",
"{",
"element",
".",
"requestFullscreen",
"(",
")",
";",
"}",
"else",
"if",
"(",
"element",
".",
"msRequestFullscreen",
")",
"{",
"element",
".",
... | Request to fullscreen an element.
@param {HTMLElement} element Element to request fullscreen | [
"Request",
"to",
"fullscreen",
"an",
"element",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/control/FullScreen.js#L230-L238 | train | Request fullscreen of an element | [
30522,
3853,
5227,
3993,
4877,
24410,
1006,
5783,
1007,
1063,
2065,
1006,
5783,
1012,
5227,
3993,
4877,
24410,
1007,
1063,
5783,
1012,
5227,
3993,
4877,
24410,
1006,
1007,
1025,
1065,
2842,
2065,
1006,
5783,
1012,
5796,
2890,
15500,
3993,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/cleanup.js | cleanupOldServerFiles | function cleanupOldServerFiles(generator, javaDir, testDir, mainResourceDir, testResourceDir) {
if (generator.isJhipsterVersionLessThan('3.5.0')) {
generator.removeFile(`${javaDir}domain/util/JSR310DateTimeSerializer.java`);
generator.removeFile(`${javaDir}domain/util/JSR310LocalDateDeserializer.jav... | javascript | function cleanupOldServerFiles(generator, javaDir, testDir, mainResourceDir, testResourceDir) {
if (generator.isJhipsterVersionLessThan('3.5.0')) {
generator.removeFile(`${javaDir}domain/util/JSR310DateTimeSerializer.java`);
generator.removeFile(`${javaDir}domain/util/JSR310LocalDateDeserializer.jav... | [
"function",
"cleanupOldServerFiles",
"(",
"generator",
",",
"javaDir",
",",
"testDir",
",",
"mainResourceDir",
",",
"testResourceDir",
")",
"{",
"if",
"(",
"generator",
".",
"isJhipsterVersionLessThan",
"(",
"'3.5.0'",
")",
")",
"{",
"generator",
".",
"removeFile"... | Removes server files that where generated in previous JHipster versions and therefore
need to be removed.
@param {any} generator - reference to generator
@param {string} javaDir - Java directory
@param {string} testDir - Java tests directory
@param {string} mainResourceDir - Main resources directory
@param {string} te... | [
"Removes",
"server",
"files",
"that",
"where",
"generated",
"in",
"previous",
"JHipster",
"versions",
"and",
"therefore",
"need",
"to",
"be",
"removed",
"."
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/cleanup.js#L90-L193 | train | Removes old server files | [
30522,
3853,
27686,
11614,
8043,
6299,
8873,
4244,
1006,
13103,
1010,
9262,
4305,
2099,
1010,
3231,
4305,
2099,
1010,
2364,
6072,
8162,
11788,
4313,
1010,
3231,
6072,
8162,
11788,
4313,
1007,
1063,
2065,
1006,
13103,
1012,
2003,
3501,
19801... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 (elem, elemName, func)
{
var i, childNode;
for (i = 0; i < elem.childNodes.length; i++) {
childNode = elem.childNodes[i];
if (childNode.nodeType == Strophe.ElementType.NORMAL &&
(!elemName || this.isTagEqual(childNode, elemName))) {
... | javascript | function (elem, elemName, func)
{
var i, childNode;
for (i = 0; i < elem.childNodes.length; i++) {
childNode = elem.childNodes[i];
if (childNode.nodeType == Strophe.ElementType.NORMAL &&
(!elemName || this.isTagEqual(childNode, elemName))) {
... | [
"function",
"(",
"elem",
",",
"elemName",
",",
"func",
")",
"{",
"var",
"i",
",",
"childNode",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"elem",
".",
"childNodes",
".",
"length",
";",
"i",
"++",
")",
"{",
"childNode",
"=",
"elem",
".",
"ch... | Function: forEachChild
Map a function over some or all child elements of a given element.
This is a small convenience function for mapping a function over
some or all of the children of an element. If elemName is null, all
children will be passed to the function, otherwise only children
whose tag names match elemName... | [
"Function",
":",
"forEachChild",
"Map",
"a",
"function",
"over",
"some",
"or",
"all",
"child",
"elements",
"of",
"a",
"given",
"element",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L871-L882 | train | Private function to call func for each node in the tree | [
30522,
3853,
1006,
3449,
6633,
1010,
3449,
6633,
18442,
1010,
4569,
2278,
1007,
1063,
13075,
1045,
1010,
2775,
3630,
3207,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
3449,
6633,
1012,
2775,
3630,
6155,
1012,
3091,
1025,
1045,
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... | |
eslint/eslint | lib/rules/key-spacing.js | getPropertyWhitespace | function getPropertyWhitespace(property) {
const whitespace = /(\s*):(\s*)/u.exec(sourceCode.getText().slice(
property.key.range[1], property.value.range[0]
));
if (whitespace) {
return {
beforeColon: whitespace[1],
... | javascript | function getPropertyWhitespace(property) {
const whitespace = /(\s*):(\s*)/u.exec(sourceCode.getText().slice(
property.key.range[1], property.value.range[0]
));
if (whitespace) {
return {
beforeColon: whitespace[1],
... | [
"function",
"getPropertyWhitespace",
"(",
"property",
")",
"{",
"const",
"whitespace",
"=",
"/",
"(\\s*):(\\s*)",
"/",
"u",
".",
"exec",
"(",
"sourceCode",
".",
"getText",
"(",
")",
".",
"slice",
"(",
"property",
".",
"key",
".",
"range",
"[",
"1",
"]",
... | Gets the whitespace around the colon in an object literal property.
@param {ASTNode} property Property node from an object literal.
@returns {Object} Whitespace before and after the property's colon. | [
"Gets",
"the",
"whitespace",
"around",
"the",
"colon",
"in",
"an",
"object",
"literal",
"property",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/key-spacing.js#L503-L515 | train | Get whitespace from property | [
30522,
3853,
2131,
21572,
4842,
3723,
2860,
16584,
2229,
15327,
1006,
3200,
1007,
1063,
9530,
3367,
12461,
15327,
1027,
1013,
1006,
1032,
1055,
1008,
1007,
1024,
1006,
1032,
1055,
1008,
1007,
1013,
1057,
1012,
4654,
8586,
1006,
3120,
16044,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/qunit/utils/MemoryLeakCheck.js | function(oControl) {
var mProperties = oControl.getMetadata().getAllProperties();
for (var sPropertyName in mProperties) {
if (oControl.isPropertyInitial(sPropertyName)) { // if no value has been set yet by the control factory
var oProperty = mProperties[sPropertyName];
try {
oControl[oProperty._sM... | javascript | function(oControl) {
var mProperties = oControl.getMetadata().getAllProperties();
for (var sPropertyName in mProperties) {
if (oControl.isPropertyInitial(sPropertyName)) { // if no value has been set yet by the control factory
var oProperty = mProperties[sPropertyName];
try {
oControl[oProperty._sM... | [
"function",
"(",
"oControl",
")",
"{",
"var",
"mProperties",
"=",
"oControl",
".",
"getMetadata",
"(",
")",
".",
"getAllProperties",
"(",
")",
";",
"for",
"(",
"var",
"sPropertyName",
"in",
"mProperties",
")",
"{",
"if",
"(",
"oControl",
".",
"isPropertyIn... | tries to fill all control properties with string values (hoping this might trigger more leaks) | [
"tries",
"to",
"fill",
"all",
"control",
"properties",
"with",
"string",
"values",
"(",
"hoping",
"this",
"might",
"trigger",
"more",
"leaks",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/utils/MemoryLeakCheck.js#L57-L73 | train | sets the tooltip of the control | [
30522,
3853,
1006,
1051,
8663,
13181,
2140,
1007,
1063,
30524,
1006,
1051,
8663,
13181,
2140,
1012,
2003,
21572,
4842,
3723,
5498,
20925,
1006,
11867,
18981,
15010,
18442,
1007,
1007,
1063,
1013,
1013,
2065,
2053,
3643,
2038,
2042,
2275,
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... | |
eslint/eslint | Makefile.js | generateFormatterExamples | function generateFormatterExamples(formatterInfo, prereleaseVersion) {
const output = ejs.render(cat("./templates/formatter-examples.md.ejs"), formatterInfo);
let filename = "../eslint.github.io/docs/user-guide/formatters/index.md",
htmlFilename = "../eslint.github.io/docs/user-guide/formatters/html-for... | javascript | function generateFormatterExamples(formatterInfo, prereleaseVersion) {
const output = ejs.render(cat("./templates/formatter-examples.md.ejs"), formatterInfo);
let filename = "../eslint.github.io/docs/user-guide/formatters/index.md",
htmlFilename = "../eslint.github.io/docs/user-guide/formatters/html-for... | [
"function",
"generateFormatterExamples",
"(",
"formatterInfo",
",",
"prereleaseVersion",
")",
"{",
"const",
"output",
"=",
"ejs",
".",
"render",
"(",
"cat",
"(",
"\"./templates/formatter-examples.md.ejs\"",
")",
",",
"formatterInfo",
")",
";",
"let",
"filename",
"="... | Generates a doc page with formatter result examples
@param {Object} formatterInfo Linting results from each formatter
@param {string} [prereleaseVersion] The version used for a prerelease. This
changes where the output is stored.
@returns {void} | [
"Generates",
"a",
"doc",
"page",
"with",
"formatter",
"result",
"examples"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/Makefile.js#L155-L170 | train | Generates formatter examples | [
30522,
3853,
9699,
14192,
20097,
10288,
16613,
4244,
1006,
4289,
3334,
2378,
14876,
1010,
3653,
16570,
19500,
27774,
1007,
1063,
9530,
3367,
6434,
1027,
1041,
22578,
1012,
17552,
1006,
30524,
9686,
4115,
2102,
1012,
21025,
2705,
12083,
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... |
nhn/tui.editor | src/js/wysiwygCommands/tableAddRow.js | getNewRow | function getNewRow($tr) {
const cloned = $tr.clone();
const htmlString = util.browser.msie ? '' : '<br />';
cloned.find('td').html(htmlString);
return cloned;
} | javascript | function getNewRow($tr) {
const cloned = $tr.clone();
const htmlString = util.browser.msie ? '' : '<br />';
cloned.find('td').html(htmlString);
return cloned;
} | [
"function",
"getNewRow",
"(",
"$tr",
")",
"{",
"const",
"cloned",
"=",
"$tr",
".",
"clone",
"(",
")",
";",
"const",
"htmlString",
"=",
"util",
".",
"browser",
".",
"msie",
"?",
"''",
":",
"'<br />'",
";",
"cloned",
".",
"find",
"(",
"'td'",
")",
".... | Get new row of given row
@param {jQuery} $tr - jQuery wrapped table row
@returns {jQuery} - new cloned jquery element
@ignore | [
"Get",
"new",
"row",
"of",
"given",
"row"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/wysiwygCommands/tableAddRow.js#L80-L87 | train | Get a new row | [
30522,
3853,
2131,
2638,
13088,
5004,
1006,
1002,
19817,
1007,
1063,
9530,
3367,
17598,
2094,
1027,
1002,
19817,
1012,
17598,
1006,
1007,
1025,
9530,
3367,
16129,
3367,
4892,
1027,
21183,
4014,
1012,
16602,
1012,
5796,
2666,
1029,
1005,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 bodyWrap = $build('body', {
rid: this.rid++,
xmlns: Strophe.NS.HTTPBIND
});
if (this.sid !== null) {
bodyWrap.attrs({sid: this.sid});
}
return bodyWrap;
} | javascript | function ()
{
var bodyWrap = $build('body', {
rid: this.rid++,
xmlns: Strophe.NS.HTTPBIND
});
if (this.sid !== null) {
bodyWrap.attrs({sid: this.sid});
}
return bodyWrap;
} | [
"function",
"(",
")",
"{",
"var",
"bodyWrap",
"=",
"$build",
"(",
"'body'",
",",
"{",
"rid",
":",
"this",
".",
"rid",
"++",
",",
"xmlns",
":",
"Strophe",
".",
"NS",
".",
"HTTPBIND",
"}",
")",
";",
"if",
"(",
"this",
".",
"sid",
"!==",
"null",
"... | PrivateFunction: _buildBody
_Private_ helper function to generate the <body/> wrapper for BOSH.
Returns:
A Strophe.Builder with a <body/> element. | [
"PrivateFunction",
":",
"_buildBody",
"_Private_",
"helper",
"function",
"to",
"generate",
"the",
"<body",
"/",
">",
"wrapper",
"for",
"BOSH",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L4036-L4048 | train | Creates a body wrapper for the
| [
30522,
3853,
1006,
1007,
1063,
13075,
2303,
13088,
9331,
1027,
1002,
3857,
1006,
1005,
2303,
1005,
1010,
1063,
9436,
1024,
2023,
1012,
9436,
1009,
1009,
1010,
20950,
3619,
1024,
2358,
18981,
5369,
1012,
24978,
1012,
8299,
8428,
2094,
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... | |
fex-team/webuploader | dist/webuploader.withoutimage.js | function() {
var orders = this.options.runtimeOrder || Runtime.orders,
type = this.type,
i, len;
if ( !type ) {
orders = orders.split( /\s*,\s*/g );
for ( i = 0, len = orders.length; i < len; i++ ) ... | javascript | function() {
var orders = this.options.runtimeOrder || Runtime.orders,
type = this.type,
i, len;
if ( !type ) {
orders = orders.split( /\s*,\s*/g );
for ( i = 0, len = orders.length; i < len; i++ ) ... | [
"function",
"(",
")",
"{",
"var",
"orders",
"=",
"this",
".",
"options",
".",
"runtimeOrder",
"||",
"Runtime",
".",
"orders",
",",
"type",
"=",
"this",
".",
"type",
",",
"i",
",",
"len",
";",
"if",
"(",
"!",
"type",
")",
"{",
"orders",
"=",
"orde... | 预测Uploader将采用哪个`Runtime`
@grammar predictRuntimeType() => String
@method predictRuntimeType
@for Uploader | [
"预测Uploader将采用哪个",
"Runtime"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/dist/webuploader.withoutimage.js#L2716-L2733 | train | Get the runtime type | [
30522,
3853,
1006,
1007,
1063,
13075,
4449,
1027,
2023,
1012,
7047,
1012,
2448,
7292,
8551,
2121,
1064,
1064,
2448,
7292,
1012,
4449,
1010,
2828,
1027,
2023,
1012,
2828,
1010,
1045,
1010,
18798,
1025,
2065,
1006,
999,
2828,
1007,
1063,
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... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/mvc/Controller.js | loadControllerClass | function loadControllerClass(sName, bAsync) {
if (!sName) {
throw new Error("Controller name ('sName' parameter) is required");
}
var sControllerName = sName.replace(/\./g, "/") + ".controller",
ControllerClass = resolveClass(sap.ui.require(sControllerName));
function resolveClass(ControllerClass)... | javascript | function loadControllerClass(sName, bAsync) {
if (!sName) {
throw new Error("Controller name ('sName' parameter) is required");
}
var sControllerName = sName.replace(/\./g, "/") + ".controller",
ControllerClass = resolveClass(sap.ui.require(sControllerName));
function resolveClass(ControllerClass)... | [
"function",
"loadControllerClass",
"(",
"sName",
",",
"bAsync",
")",
"{",
"if",
"(",
"!",
"sName",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Controller name ('sName' parameter) is required\"",
")",
";",
"}",
"var",
"sControllerName",
"=",
"sName",
".",
"replace... | /* load controller class
@param {string} sName the controller name
@param {boolean} bAsync Load async or not
@return {{sap.ui.core.mvc.Controller | Promise} oController <code>Promise</code> in case of asynchronous loading
or <code>undefined</code> in case of synchronous loading | [
"/",
"*",
"load",
"controller",
"class"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/mvc/Controller.js#L259-L294 | train | Loads a controller class | [
30522,
3853,
7170,
8663,
13181,
10820,
26266,
1006,
1055,
18442,
1010,
19021,
6038,
2278,
1007,
1063,
2065,
1006,
999,
1055,
18442,
1007,
1063,
5466,
2047,
7561,
1006,
1000,
11486,
2171,
1006,
1005,
1055,
18442,
1005,
16381,
1007,
2003,
322... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/_AnnotationHelperExpression.js | function (oPathValue) {
if (oPathValue.value === undefined) {
return undefined;
}
Measurement.average(sPerformanceGetExpression, "", aPerformanceCategories);
if (!bSimpleParserWarningLogged
&& ManagedObject.bindingParser === BindingParser.simpleParser) {
Log.warning("Complex binding syntax no... | javascript | function (oPathValue) {
if (oPathValue.value === undefined) {
return undefined;
}
Measurement.average(sPerformanceGetExpression, "", aPerformanceCategories);
if (!bSimpleParserWarningLogged
&& ManagedObject.bindingParser === BindingParser.simpleParser) {
Log.warning("Complex binding syntax no... | [
"function",
"(",
"oPathValue",
")",
"{",
"if",
"(",
"oPathValue",
".",
"value",
"===",
"undefined",
")",
"{",
"return",
"undefined",
";",
"}",
"Measurement",
".",
"average",
"(",
"sPerformanceGetExpression",
",",
"\"\"",
",",
"aPerformanceCategories",
")",
";"... | Calculates an expression. Ensures that errors that are thrown while processing are
handled accordingly.
@param {object} oPathValue
path and value information pointing to the expression (see Expression object)
@returns {Promise|string}
the expression value or "Unsupported: oRawValue" in case of an error or
<code>undefi... | [
"Calculates",
"an",
"expression",
".",
"Ensures",
"that",
"errors",
"that",
"are",
"thrown",
"while",
"processing",
"are",
"handled",
"accordingly",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js#L566-L590 | train | Returns the value of the expression at the given path. | [
30522,
3853,
1006,
6728,
8988,
10175,
5657,
1007,
1063,
2065,
1006,
6728,
8988,
10175,
5657,
1012,
3643,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
2709,
6151,
28344,
1025,
1065,
10903,
1012,
2779,
1006,
11867,
2121,
14192,
6651,
18150,
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... | |
radare/radare2 | shlr/www/graph/js-graph-it.js | DocumentScanner | function DocumentScanner(visitor, scanElementsOnly) {
this.visitor = visitor;
this.scanElementsOnly = scanElementsOnly;
/**
* Scans the element
*/
this.scan = function(element) {
if (this.visitor.visit(element)) {
// visit child elements
var children = element.childNodes;
for(var i = 0; i < children... | javascript | function DocumentScanner(visitor, scanElementsOnly) {
this.visitor = visitor;
this.scanElementsOnly = scanElementsOnly;
/**
* Scans the element
*/
this.scan = function(element) {
if (this.visitor.visit(element)) {
// visit child elements
var children = element.childNodes;
for(var i = 0; i < children... | [
"function",
"DocumentScanner",
"(",
"visitor",
",",
"scanElementsOnly",
")",
"{",
"this",
".",
"visitor",
"=",
"visitor",
";",
"this",
".",
"scanElementsOnly",
"=",
"scanElementsOnly",
";",
"/**\n\t * Scans the element\n\t */",
"this",
".",
"scan",
"=",
"function",
... | **************************************************
This class is a scanner for the visitor pattern. *
**************************************************
Constructor, parameters are:
visitor: the visitor implementation, it must be a class with a visit(element) method.
scanElementsOnly: a flag telling whether to scan ht... | [
"**************************************************",
"This",
"class",
"is",
"a",
"scanner",
"for",
"the",
"visitor",
"pattern",
".",
"*",
"**************************************************",
"Constructor",
"parameters",
"are",
":",
"visitor",
":",
"the",
"visitor",
"imple... | bf5e3028810a0ec7c267c6fe4bfad639b4819e35 | https://github.com/radare/radare2/blob/bf5e3028810a0ec7c267c6fe4bfad639b4819e35/shlr/www/graph/js-graph-it.js#L17-L34 | train | The DocumentScanner class | [
30522,
3853,
5491,
9336,
3678,
1006,
10367,
1010,
13594,
12260,
8163,
2239,
2135,
1007,
1063,
2023,
1012,
10367,
1027,
10367,
1025,
2023,
1012,
13594,
12260,
8163,
2239,
2135,
1027,
13594,
12260,
8163,
2239,
2135,
1025,
1013,
1008,
1008,
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... |
eslint/eslint | lib/rules/indent-legacy.js | isOuterIIFE | function isOuterIIFE(node) {
const parent = node.parent;
let stmt = parent.parent;
/*
* Verify that the node is an IIEF
*/
if (
parent.type !== "CallExpression" ||
parent.callee !== node) {
return... | javascript | function isOuterIIFE(node) {
const parent = node.parent;
let stmt = parent.parent;
/*
* Verify that the node is an IIEF
*/
if (
parent.type !== "CallExpression" ||
parent.callee !== node) {
return... | [
"function",
"isOuterIIFE",
"(",
"node",
")",
"{",
"const",
"parent",
"=",
"node",
".",
"parent",
";",
"let",
"stmt",
"=",
"parent",
".",
"parent",
";",
"/*\n * Verify that the node is an IIEF\n */",
"if",
"(",
"parent",
".",
"type",
"!==",
... | Check to see if the node is a file level IIFE
@param {ASTNode} node The function node to check.
@returns {boolean} True if the node is the outer IIFE | [
"Check",
"to",
"see",
"if",
"the",
"node",
"is",
"a",
"file",
"level",
"IIFE"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/indent-legacy.js#L567-L603 | train | Determines whether or not a node is an outer IIEF. | [
30522,
3853,
11163,
19901,
6137,
7959,
1006,
13045,
1007,
1063,
9530,
3367,
6687,
1027,
13045,
1012,
6687,
1025,
2292,
2358,
20492,
1027,
6687,
1012,
6687,
1025,
1013,
1008,
1008,
20410,
2008,
1996,
13045,
2003,
2019,
2462,
12879,
1008,
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... |
SheetJS/js-xlsx | bits/75_xlml.js | write_sty_xlml | function write_sty_xlml(wb, opts)/*:string*/ {
/* Styles */
var styles/*:Array<string>*/ = ['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];
opts.cellXfs.forEach(function(xf, id) {
var payload/*:Array<string>*/ = [];
payload.push(writextag('NumberFormat', null, {"ss:Format": escapexml(SSF._tab... | javascript | function write_sty_xlml(wb, opts)/*:string*/ {
/* Styles */
var styles/*:Array<string>*/ = ['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];
opts.cellXfs.forEach(function(xf, id) {
var payload/*:Array<string>*/ = [];
payload.push(writextag('NumberFormat', null, {"ss:Format": escapexml(SSF._tab... | [
"function",
"write_sty_xlml",
"(",
"wb",
",",
"opts",
")",
"/*:string*/",
"{",
"/* Styles */",
"var",
"styles",
"/*:Array<string>*/",
"=",
"[",
"'<Style ss:ID=\"Default\" ss:Name=\"Normal\"><NumberFormat/></Style>'",
"]",
";",
"opts",
".",
"cellXfs",
".",
"forEach",
"("... | /* TODO | [
"/",
"*",
"TODO"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/75_xlml.js#L866-L875 | train | Write the stylus xlml | [
30522,
3853,
4339,
1035,
2358,
2100,
1035,
28712,
19968,
1006,
25610,
1010,
23569,
2015,
1007,
1013,
1008,
1024,
5164,
1008,
1013,
1063,
1013,
1008,
6782,
1008,
1013,
13075,
6782,
1013,
1008,
1024,
9140,
1026,
5164,
1028,
1008,
1013,
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... |
eslint/eslint | lib/linter.js | getDirectiveComments | function getDirectiveComments(filename, ast, ruleMapper) {
const configuredRules = {};
const enabledGlobals = {};
const exportedVariables = {};
const problems = [];
const disableDirectives = [];
ast.comments.filter(token => token.type !== "Shebang").forEach(comment => {
const trimmedCom... | javascript | function getDirectiveComments(filename, ast, ruleMapper) {
const configuredRules = {};
const enabledGlobals = {};
const exportedVariables = {};
const problems = [];
const disableDirectives = [];
ast.comments.filter(token => token.type !== "Shebang").forEach(comment => {
const trimmedCom... | [
"function",
"getDirectiveComments",
"(",
"filename",
",",
"ast",
",",
"ruleMapper",
")",
"{",
"const",
"configuredRules",
"=",
"{",
"}",
";",
"const",
"enabledGlobals",
"=",
"{",
"}",
";",
"const",
"exportedVariables",
"=",
"{",
"}",
";",
"const",
"problems"... | Parses comments in file to extract file-specific config of rules, globals
and environments and merges them with global config; also code blocks
where reporting is disabled or enabled and merges them with reporting config.
@param {string} filename The file being checked.
@param {ASTNode} ast The top node of the AST.
@pa... | [
"Parses",
"comments",
"in",
"file",
"to",
"extract",
"file",
"-",
"specific",
"config",
"of",
"rules",
"globals",
"and",
"environments",
"and",
"merges",
"them",
"with",
"global",
"config",
";",
"also",
"code",
"blocks",
"where",
"reporting",
"is",
"disabled",... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/linter.js#L165-L288 | train | Get all directives from the given file | [
30522,
3853,
2131,
4305,
2890,
15277,
9006,
8163,
1006,
5371,
18442,
1010,
2004,
2102,
1010,
3627,
2863,
18620,
1007,
1063,
9530,
3367,
26928,
6820,
4244,
1027,
1063,
1065,
1025,
9530,
3367,
9124,
23296,
16429,
9777,
1027,
1063,
1065,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/routing/Router.js | function (sViewName, sViewType, sViewId) {
Log.warning("Deprecated API Router#getView called - use Router#getViews instead.", this);
var oView = this._oViews._getViewWithGlobalId({
viewName: sViewName,
type: sViewType,
id: sViewId
});
this.fireViewCreated({
view: oView,
viewNa... | javascript | function (sViewName, sViewType, sViewId) {
Log.warning("Deprecated API Router#getView called - use Router#getViews instead.", this);
var oView = this._oViews._getViewWithGlobalId({
viewName: sViewName,
type: sViewType,
id: sViewId
});
this.fireViewCreated({
view: oView,
viewNa... | [
"function",
"(",
"sViewName",
",",
"sViewType",
",",
"sViewId",
")",
"{",
"Log",
".",
"warning",
"(",
"\"Deprecated API Router#getView called - use Router#getViews instead.\"",
",",
"this",
")",
";",
"var",
"oView",
"=",
"this",
".",
"_oViews",
".",
"_getViewWithGlo... | Returns a cached view for a given name or creates it if it does not yet exists
@deprecated Since 1.28.1 use {@link #getViews} instead.
@param {string} sViewName Name of the view
@param {string} sViewType Type of the view
@param {string} sViewId Optional view id
@return {sap.ui.core.mvc.View} the view instance
@public | [
"Returns",
"a",
"cached",
"view",
"for",
"a",
"given",
"name",
"or",
"creates",
"it",
"if",
"it",
"does",
"not",
"yet",
"exists"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L586-L602 | train | Returns the view with the given name and type | [
30522,
3853,
1006,
17917,
2666,
7962,
14074,
1010,
17917,
2666,
26677,
18863,
1010,
17917,
2666,
9148,
2094,
1007,
1063,
8833,
1012,
5432,
1006,
1000,
2139,
28139,
12921,
17928,
2799,
2099,
1001,
2131,
8584,
2170,
1011,
2224,
2799,
2099,
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... | |
aws/aws-sdk-js | features/extra/cleanup.js | function(bucket, callback) {
var s3 = new AWS.S3({maxRetries: 100});
var params = {
Bucket: bucket
};
s3.listObjects(params, function (err, data) {
if (err) return callback(err);
if (data.Contents.length > 0) {
params.Delete = { Objects: [] };
data.Contents.forEach(fun... | javascript | function(bucket, callback) {
var s3 = new AWS.S3({maxRetries: 100});
var params = {
Bucket: bucket
};
s3.listObjects(params, function (err, data) {
if (err) return callback(err);
if (data.Contents.length > 0) {
params.Delete = { Objects: [] };
data.Contents.forEach(fun... | [
"function",
"(",
"bucket",
",",
"callback",
")",
"{",
"var",
"s3",
"=",
"new",
"AWS",
".",
"S3",
"(",
"{",
"maxRetries",
":",
"100",
"}",
")",
";",
"var",
"params",
"=",
"{",
"Bucket",
":",
"bucket",
"}",
";",
"s3",
".",
"listObjects",
"(",
"para... | Delete objects. | [
"Delete",
"objects",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/cleanup.js#L83-L101 | train | Delete all the objects in the bucket | [
30522,
3853,
1006,
13610,
1010,
2655,
5963,
1007,
1063,
13075,
1055,
2509,
1027,
2047,
22091,
2015,
1012,
1055,
2509,
1006,
1063,
4098,
13465,
5134,
1024,
2531,
1065,
1007,
1025,
13075,
11498,
5244,
1027,
1063,
13610,
1024,
13610,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/dialog/dialog.js | lockScreenReader | function lockScreenReader(element, options) {
var isHidden = true;
// get raw DOM node
walkDOM(element[0]);
options.unlockScreenReader = function () {
isHidden = false;
walkDOM(element[0]);
options.unlockScreenReader = null;
};
/**
* Get all of an e... | javascript | function lockScreenReader(element, options) {
var isHidden = true;
// get raw DOM node
walkDOM(element[0]);
options.unlockScreenReader = function () {
isHidden = false;
walkDOM(element[0]);
options.unlockScreenReader = null;
};
/**
* Get all of an e... | [
"function",
"lockScreenReader",
"(",
"element",
",",
"options",
")",
"{",
"var",
"isHidden",
"=",
"true",
";",
"// get raw DOM node",
"walkDOM",
"(",
"element",
"[",
"0",
"]",
")",
";",
"options",
".",
"unlockScreenReader",
"=",
"function",
"(",
")",
"{",
... | Prevents screen reader interaction behind modal window
on swipe interfaces | [
"Prevents",
"screen",
"reader",
"interaction",
"behind",
"modal",
"window",
"on",
"swipe",
"interfaces"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1142-L1190 | train | Lock screen reader | [
30522,
3853,
11223,
24410,
16416,
4063,
1006,
5783,
1010,
7047,
1007,
1063,
13075,
2003,
27511,
4181,
1027,
2995,
1025,
1013,
1013,
2131,
6315,
14383,
13045,
3328,
9527,
1006,
5783,
1031,
1014,
1033,
1007,
1025,
7047,
1012,
19829,
18182,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/selenium-core/scripts/htmlutils.js | are_equal | function are_equal(a1, a2)
{
if (typeof(a1) != typeof(a2))
return false;
switch(typeof(a1)) {
case 'object':
// arrays
if (a1.length) {
if (a1.length != a2.length)
return false;
for (var i = 0; i < a1.length; ++i) {
... | javascript | function are_equal(a1, a2)
{
if (typeof(a1) != typeof(a2))
return false;
switch(typeof(a1)) {
case 'object':
// arrays
if (a1.length) {
if (a1.length != a2.length)
return false;
for (var i = 0; i < a1.length; ++i) {
... | [
"function",
"are_equal",
"(",
"a1",
",",
"a2",
")",
"{",
"if",
"(",
"typeof",
"(",
"a1",
")",
"!=",
"typeof",
"(",
"a2",
")",
")",
"return",
"false",
";",
"switch",
"(",
"typeof",
"(",
"a1",
")",
")",
"{",
"case",
"'object'",
":",
"// arrays",
"i... | Returns true if two arrays are identical, and false otherwise.
@param a1 the first array, may only contain simple values (strings or
numbers)
@param a2 the second array, same restricts on data as for a1
@return true if the arrays are equivalent, false otherwise. | [
"Returns",
"true",
"if",
"two",
"arrays",
"are",
"identical",
"and",
"false",
"otherwise",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L2292-L2327 | train | returns true if a1 and a2 are equal | [
30522,
3853,
2024,
1035,
5020,
1006,
17350,
1010,
22441,
1007,
1063,
2065,
1006,
2828,
11253,
1006,
17350,
1007,
999,
1027,
2828,
11253,
1006,
22441,
1007,
1007,
2709,
6270,
1025,
6942,
1006,
2828,
11253,
1006,
17350,
1007,
1007,
1063,
2553... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/LiveDevelopment/LiveDevelopment.js | _closeRelatedDocument | function _closeRelatedDocument(liveDoc) {
if (_relatedDocuments[liveDoc.doc.url]) {
delete _relatedDocuments[liveDoc.doc.url];
}
if (_server) {
_server.remove(liveDoc);
}
_closeDocument(liveDoc);
} | javascript | function _closeRelatedDocument(liveDoc) {
if (_relatedDocuments[liveDoc.doc.url]) {
delete _relatedDocuments[liveDoc.doc.url];
}
if (_server) {
_server.remove(liveDoc);
}
_closeDocument(liveDoc);
} | [
"function",
"_closeRelatedDocument",
"(",
"liveDoc",
")",
"{",
"if",
"(",
"_relatedDocuments",
"[",
"liveDoc",
".",
"doc",
".",
"url",
"]",
")",
"{",
"delete",
"_relatedDocuments",
"[",
"liveDoc",
".",
"doc",
".",
"url",
"]",
";",
"}",
"if",
"(",
"_serve... | Removes the given CSS/JSDocument from _relatedDocuments. Signals that the
given file is no longer associated with the HTML document that is live (e.g.
if the related file has been deleted on disk). | [
"Removes",
"the",
"given",
"CSS",
"/",
"JSDocument",
"from",
"_relatedDocuments",
".",
"Signals",
"that",
"the",
"given",
"file",
"is",
"no",
"longer",
"associated",
"with",
"the",
"HTML",
"document",
"that",
"is",
"live",
"(",
"e",
".",
"g",
".",
"if",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevelopment.js#L315-L325 | train | Close a related document | [
30522,
3853,
1035,
3553,
10581,
3064,
3527,
24894,
4765,
1006,
2973,
10085,
1007,
1063,
2065,
1006,
1035,
3141,
3527,
24894,
11187,
1031,
2973,
10085,
1012,
9986,
1012,
24471,
2140,
1033,
1007,
1063,
3972,
12870,
1035,
3141,
3527,
24894,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ApiDetail.controller.js | function (aElements, fnFilter, fnFormat) {
var i,
iLength = aElements.length,
aNewElements = [],
oElement;
for (i = 0; i < iLength; i++) {
oElement = aElements[i];
if (fnFilter && !fnFilter(oElement)) {
continue;
}
if (fnFormat) {
fnFormat(oElement);
}
... | javascript | function (aElements, fnFilter, fnFormat) {
var i,
iLength = aElements.length,
aNewElements = [],
oElement;
for (i = 0; i < iLength; i++) {
oElement = aElements[i];
if (fnFilter && !fnFilter(oElement)) {
continue;
}
if (fnFormat) {
fnFormat(oElement);
}
... | [
"function",
"(",
"aElements",
",",
"fnFilter",
",",
"fnFormat",
")",
"{",
"var",
"i",
",",
"iLength",
"=",
"aElements",
".",
"length",
",",
"aNewElements",
"=",
"[",
"]",
",",
"oElement",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"iLength",
";... | Filter and format elements
@param {array} aElements list of elements
@param {function} fnFilter filtering function
@param {function} fnFormat formatting function
@returns {array} transformed elements list | [
"Filter",
"and",
"format",
"elements"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ApiDetail.controller.js#L603-L621 | train | Returns an array of elements that match the filter function | [
30522,
3853,
1006,
29347,
16930,
11187,
1010,
1042,
2078,
8873,
21928,
1010,
1042,
2078,
14192,
4017,
1007,
1063,
13075,
1045,
1010,
17869,
3070,
2705,
1027,
29347,
16930,
11187,
1012,
3091,
1010,
2019,
7974,
12260,
8163,
1027,
1031,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/selenium-core/scripts/htmlutils.js | to_kwargs | function to_kwargs(args, sortedKeys)
{
var s = '';
if (!sortedKeys) {
var sortedKeys = keys(args).sort();
}
for (var i = 0; i < sortedKeys.length; ++i) {
var k = sortedKeys[i];
if (args[k] != undefined) {
if (s) {
s += ', ';
}
s... | javascript | function to_kwargs(args, sortedKeys)
{
var s = '';
if (!sortedKeys) {
var sortedKeys = keys(args).sort();
}
for (var i = 0; i < sortedKeys.length; ++i) {
var k = sortedKeys[i];
if (args[k] != undefined) {
if (s) {
s += ', ';
}
s... | [
"function",
"to_kwargs",
"(",
"args",
",",
"sortedKeys",
")",
"{",
"var",
"s",
"=",
"''",
";",
"if",
"(",
"!",
"sortedKeys",
")",
"{",
"var",
"sortedKeys",
"=",
"keys",
"(",
"args",
")",
".",
"sort",
"(",
")",
";",
"}",
"for",
"(",
"var",
"i",
... | Creates a python-style keyword arguments string from an object.
@param args an associative array mapping strings to strings
@param sortedKeys (optional) a list of keys of the args parameter that
specifies the order in which the arguments will appear in
the returned kwargs string
@return a kwarg str... | [
"Creates",
"a",
"python",
"-",
"style",
"keyword",
"arguments",
"string",
"from",
"an",
"object",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L2517-L2533 | train | to_kwargs - returns a string | [
30522,
3853,
2000,
1035,
6448,
2906,
5620,
1006,
12098,
5620,
1010,
19616,
14839,
2015,
1007,
1063,
13075,
1055,
1027,
1005,
1005,
1025,
2065,
1006,
999,
19616,
14839,
2015,
1007,
1063,
13075,
19616,
14839,
2015,
1027,
6309,
1006,
12098,
56... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
chartjs/Chart.js | src/core/core.datasetController.js | unlistenArrayEvents | function unlistenArrayEvents(array, listener) {
var stub = array._chartjs;
if (!stub) {
return;
}
var listeners = stub.listeners;
var index = listeners.indexOf(listener);
if (index !== -1) {
listeners.splice(index, 1);
}
if (listeners.length > 0) {
return;
}
arrayEvents.forEach(function(key) {
dele... | javascript | function unlistenArrayEvents(array, listener) {
var stub = array._chartjs;
if (!stub) {
return;
}
var listeners = stub.listeners;
var index = listeners.indexOf(listener);
if (index !== -1) {
listeners.splice(index, 1);
}
if (listeners.length > 0) {
return;
}
arrayEvents.forEach(function(key) {
dele... | [
"function",
"unlistenArrayEvents",
"(",
"array",
",",
"listener",
")",
"{",
"var",
"stub",
"=",
"array",
".",
"_chartjs",
";",
"if",
"(",
"!",
"stub",
")",
"{",
"return",
";",
"}",
"var",
"listeners",
"=",
"stub",
".",
"listeners",
";",
"var",
"index",... | Removes the given array event listener and cleanup extra attached properties (such as
the _chartjs stub and overridden methods) if array doesn't have any more listeners. | [
"Removes",
"the",
"given",
"array",
"event",
"listener",
"and",
"cleanup",
"extra",
"attached",
"properties",
"(",
"such",
"as",
"the",
"_chartjs",
"stub",
"and",
"overridden",
"methods",
")",
"if",
"array",
"doesn",
"t",
"have",
"any",
"more",
"listeners",
... | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/core/core.datasetController.js#L55-L76 | train | Unlisten an array event listener | [
30522,
3853,
4895,
9863,
8189,
11335,
17240,
11187,
1006,
9140,
1010,
19373,
1007,
1063,
13075,
24646,
2497,
1027,
9140,
1012,
1035,
3673,
22578,
1025,
2065,
1006,
999,
24646,
2497,
1007,
1063,
2709,
1025,
1065,
13075,
13810,
1027,
24646,
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... |
nhn/tui.editor | src/js/extensions/table/tableRangeHandler.js | _expandRowMergedRange | function _expandRowMergedRange(tableData, tableRange, rangeType) {
const {rowIndex} = tableRange[rangeType];
const rowData = tableData[rowIndex];
util.range(tableRange.start.colIndex, tableRange.end.colIndex + 1).forEach(colIndex => {
const cellData = rowData[colIndex];
const {rowMergeWith} = cellData;
... | javascript | function _expandRowMergedRange(tableData, tableRange, rangeType) {
const {rowIndex} = tableRange[rangeType];
const rowData = tableData[rowIndex];
util.range(tableRange.start.colIndex, tableRange.end.colIndex + 1).forEach(colIndex => {
const cellData = rowData[colIndex];
const {rowMergeWith} = cellData;
... | [
"function",
"_expandRowMergedRange",
"(",
"tableData",
",",
"tableRange",
",",
"rangeType",
")",
"{",
"const",
"{",
"rowIndex",
"}",
"=",
"tableRange",
"[",
"rangeType",
"]",
";",
"const",
"rowData",
"=",
"tableData",
"[",
"rowIndex",
"]",
";",
"util",
".",
... | Expand table range by row merge properties like rowspan, rowMergeWith.
@param {Array.<Array.<object>>} tableData - table data
@param {{
start: {rowIndex: number, colIndex: number},
end: {rowIndex: number, colIndex: number}
}} tableRange - table range
@param {string} rangeType - range type like start, end
@private | [
"Expand",
"table",
"range",
"by",
"row",
"merge",
"properties",
"like",
"rowspan",
"rowMergeWith",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/tableRangeHandler.js#L65-L88 | train | Expand row merged range | [
30522,
3853,
1035,
7818,
10524,
5017,
5999,
24388,
2063,
1006,
2795,
2850,
2696,
1010,
2795,
24388,
2063,
1010,
2846,
13874,
1007,
1063,
9530,
3367,
1063,
5216,
22254,
10288,
1065,
1027,
2795,
24388,
2063,
1031,
2846,
13874,
1033,
1025,
953... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | docs/app/js/codepen.js | processHtml | function processHtml(demo) {
var allContent = demo.files.index.contents;
var processors = [
applyAngularAttributesToParentElement,
insertTemplatesAsScriptTags,
htmlEscapeAmpersand
];
processors.forEach(function(processor) {
allContent = processor(allContent, de... | javascript | function processHtml(demo) {
var allContent = demo.files.index.contents;
var processors = [
applyAngularAttributesToParentElement,
insertTemplatesAsScriptTags,
htmlEscapeAmpersand
];
processors.forEach(function(processor) {
allContent = processor(allContent, de... | [
"function",
"processHtml",
"(",
"demo",
")",
"{",
"var",
"allContent",
"=",
"demo",
".",
"files",
".",
"index",
".",
"contents",
";",
"var",
"processors",
"=",
"[",
"applyAngularAttributesToParentElement",
",",
"insertTemplatesAsScriptTags",
",",
"htmlEscapeAmpersan... | Modifies index.html with necessary changes in order to display correctly in codepen See each processor to determine how each modifies the html | [
"Modifies",
"index",
".",
"html",
"with",
"necessary",
"changes",
"in",
"order",
"to",
"display",
"correctly",
"in",
"codepen",
"See",
"each",
"processor",
"to",
"determine",
"how",
"each",
"modifies",
"the",
"html"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/app/js/codepen.js#L98-L113 | train | Process HTML files | [
30522,
3853,
2832,
11039,
19968,
30524,
1033,
1025,
18017,
1012,
18921,
6776,
1006,
3853,
1006,
13151,
1007,
1063,
2035,
8663,
6528,
2102,
1027,
13151,
1006,
2035,
8663,
6528,
2102,
1010,
9703,
1007,
1025,
1065,
1007,
1025,
2709,
2035,
8663... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/sprite/sprite.js | function() {
var self = this;
// Loop through all active sounds and update their progress bar.
for (var i=0; i<self.sounds.length; i++) {
var id = parseInt(self.sounds[i].id, 10);
var offset = self._sprite[self.sounds[i].dataset.sprite][0];
var seek = (self.sound.seek(id) || 0) - (offset ... | javascript | function() {
var self = this;
// Loop through all active sounds and update their progress bar.
for (var i=0; i<self.sounds.length; i++) {
var id = parseInt(self.sounds[i].id, 10);
var offset = self._sprite[self.sounds[i].dataset.sprite][0];
var seek = (self.sound.seek(id) || 0) - (offset ... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Loop through all active sounds and update their progress bar.",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"self",
".",
"sounds",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"id",
... | The step called within requestAnimationFrame to update the playback positions. | [
"The",
"step",
"called",
"within",
"requestAnimationFrame",
"to",
"update",
"the",
"playback",
"positions",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/sprite/sprite.js#L115-L127 | train | Update the progress bar | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
1013,
1013,
7077,
2083,
2035,
3161,
4165,
1998,
10651,
2037,
5082,
3347,
1012,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
2969,
1012,
4165,
1012,
3091,
1025,
1045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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(parent, text, funct, pad)
{
var a = document.createElement('span');
a.style.color = 'blue';
a.style.textDecoration = 'underline';
a.style.cursor = 'pointer';
if (pad != null)
{
a.style.paddingLeft = pad+'px';
}
mxEvent.addListener(a, 'click', funct);
mxUtils.write(a, text);
... | javascript | function(parent, text, funct, pad)
{
var a = document.createElement('span');
a.style.color = 'blue';
a.style.textDecoration = 'underline';
a.style.cursor = 'pointer';
if (pad != null)
{
a.style.paddingLeft = pad+'px';
}
mxEvent.addListener(a, 'click', funct);
mxUtils.write(a, text);
... | [
"function",
"(",
"parent",
",",
"text",
",",
"funct",
",",
"pad",
")",
"{",
"var",
"a",
"=",
"document",
".",
"createElement",
"(",
"'span'",
")",
";",
"a",
".",
"style",
".",
"color",
"=",
"'blue'",
";",
"a",
".",
"style",
".",
"textDecoration",
"... | Function: link
Adds a hyperlink to the specified parent and invokes the given function
when the link is clicked.
Parameters:
parent - DOM node to contain the new link.
text - String that is used as the link label.
funct - Function to execute when the link is clicked.
pad - Optional left-padding for the link. Default... | [
"Function",
":",
"link"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L3449-L3471 | train | Creates a span element and adds it to the parent | [
30522,
3853,
1006,
6687,
1010,
3793,
1010,
4569,
6593,
1010,
11687,
1007,
1063,
13075,
1037,
1027,
6254,
1012,
3443,
12260,
3672,
1006,
1005,
8487,
1005,
1007,
1025,
1037,
1012,
2806,
1012,
3609,
1027,
1005,
2630,
1005,
1025,
1037,
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... | |
catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | getSVGElement | function getSVGElement(id) {
var el = document.getElementById(id);
return el ? assertInstanceof(el, Element) : null;
} | javascript | function getSVGElement(id) {
var el = document.getElementById(id);
return el ? assertInstanceof(el, Element) : null;
} | [
"function",
"getSVGElement",
"(",
"id",
")",
"{",
"var",
"el",
"=",
"document",
".",
"getElementById",
"(",
"id",
")",
";",
"return",
"el",
"?",
"assertInstanceof",
"(",
"el",
",",
"Element",
")",
":",
"null",
";",
"}"
] | TODO(devlin): This should return SVGElement, but closure compiler is missing those externs.
Alias for document.getElementById. Found elements must be SVGElements.
@param {string} id The ID of the element to find.
@return {Element} The found element or null if not found. | [
"TODO",
"(",
"devlin",
")",
":",
"This",
"should",
"return",
"SVGElement",
"but",
"closure",
"compiler",
"is",
"missing",
"those",
"externs",
".",
"Alias",
"for",
"document",
".",
"getElementById",
".",
"Found",
"elements",
"must",
"be",
"SVGElements",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L24-L27 | train | Get SVG element by id | [
30522,
3853,
4152,
2615,
12439,
13665,
1006,
8909,
1007,
1063,
13075,
3449,
1027,
6254,
1012,
2131,
12260,
3672,
3762,
3593,
1006,
8909,
1007,
1025,
2709,
3449,
1029,
20865,
7076,
26897,
11253,
1006,
3449,
1010,
5783,
1007,
1024,
19701,
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... |
aframevr/aframe | src/components/hand-controls.js | function (gesture) {
var clip;
var i;
for (i = 0; i < this.clips.length; i++) {
clip = this.clips[i];
if (clip.name !== gesture) { continue; }
return clip;
}
} | javascript | function (gesture) {
var clip;
var i;
for (i = 0; i < this.clips.length; i++) {
clip = this.clips[i];
if (clip.name !== gesture) { continue; }
return clip;
}
} | [
"function",
"(",
"gesture",
")",
"{",
"var",
"clip",
";",
"var",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"clips",
".",
"length",
";",
"i",
"++",
")",
"{",
"clip",
"=",
"this",
".",
"clips",
"[",
"i",
"]",
";",
"if",... | Play corresponding clip to a gesture | [
"Play",
"corresponding",
"clip",
"to",
"a",
"gesture"
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/hand-controls.js#L275-L283 | train | Returns the last clip of the given gesture | [
30522,
3853,
1006,
9218,
1007,
1063,
13075,
12528,
1025,
13075,
1045,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
2023,
1012,
15281,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
12528,
1027,
2023,
1012,
15281,
1031,
1045,
1033,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/performance/Measurement.js | Measurement | function Measurement(sId, sInfo, iStart, iEnd, aCategories) {
this.id = sId;
this.info = sInfo;
this.start = iStart;
this.end = iEnd;
this.pause = 0;
this.resume = 0;
this.duration = 0; // used time
this.time = 0; // time from start to end
this.categories = aCategories;
this.average = fals... | javascript | function Measurement(sId, sInfo, iStart, iEnd, aCategories) {
this.id = sId;
this.info = sInfo;
this.start = iStart;
this.end = iEnd;
this.pause = 0;
this.resume = 0;
this.duration = 0; // used time
this.time = 0; // time from start to end
this.categories = aCategories;
this.average = fals... | [
"function",
"Measurement",
"(",
"sId",
",",
"sInfo",
",",
"iStart",
",",
"iEnd",
",",
"aCategories",
")",
"{",
"this",
".",
"id",
"=",
"sId",
";",
"this",
".",
"info",
"=",
"sInfo",
";",
"this",
".",
"start",
"=",
"iStart",
";",
"this",
".",
"end",... | Single Measurement Entry
@public
@typedef {object} module:sap/ui/performance/Measurement.Entry
@property {string} sId ID of the measurement
@property {string} sInfo Info for the measurement
@property {int} iStart Start time
@property {int} iEnd End time
@property {string | string[]} [aCategories="javascript"] An optio... | [
"Single",
"Measurement",
"Entry"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/performance/Measurement.js#L37-L50 | train | A measurement object | [
30522,
3853,
10903,
1006,
15765,
1010,
8254,
14876,
1010,
21541,
8445,
1010,
29464,
4859,
1010,
9353,
3686,
20255,
3111,
1007,
1063,
2023,
1012,
8909,
1027,
15765,
1025,
2023,
1012,
18558,
1027,
8254,
14876,
1025,
2023,
1012,
2707,
1027,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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(id) {
var self = this;
if (self._endTimers[id]) {
// Clear the timeout or remove the ended listener.
if (typeof self._endTimers[id] !== 'function') {
clearTimeout(self._endTimers[id]);
} else {
var sound = self._soundById(id);
if (sound && soun... | javascript | function(id) {
var self = this;
if (self._endTimers[id]) {
// Clear the timeout or remove the ended listener.
if (typeof self._endTimers[id] !== 'function') {
clearTimeout(self._endTimers[id]);
} else {
var sound = self._soundById(id);
if (sound && soun... | [
"function",
"(",
"id",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"self",
".",
"_endTimers",
"[",
"id",
"]",
")",
"{",
"// Clear the timeout or remove the ended listener.",
"if",
"(",
"typeof",
"self",
".",
"_endTimers",
"[",
"id",
"]",
"!==",
... | Clear the end timer for a sound playback.
@param {Number} id The sound ID.
@return {Howl} | [
"Clear",
"the",
"end",
"timer",
"for",
"a",
"sound",
"playback",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L1967-L1985 | train | Removes a timeout or a listener for a specific sound | [
30522,
3853,
1006,
8909,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2065,
1006,
2969,
1012,
1035,
2203,
7292,
2869,
1031,
8909,
1033,
1007,
1063,
1013,
1013,
3154,
1996,
2051,
5833,
2030,
6366,
1996,
3092,
19373,
1012,
2065,
1006,
2828,
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... | |
Microsoft/vscode | build/lib/bundle.js | bundle | function bundle(entryPoints, config, callback) {
const entryPointsMap = {};
entryPoints.forEach((module) => {
entryPointsMap[module.name] = module;
});
const allMentionedModulesMap = {};
entryPoints.forEach((module) => {
allMentionedModulesMap[module.name] = true;
(module.inc... | javascript | function bundle(entryPoints, config, callback) {
const entryPointsMap = {};
entryPoints.forEach((module) => {
entryPointsMap[module.name] = module;
});
const allMentionedModulesMap = {};
entryPoints.forEach((module) => {
allMentionedModulesMap[module.name] = true;
(module.inc... | [
"function",
"bundle",
"(",
"entryPoints",
",",
"config",
",",
"callback",
")",
"{",
"const",
"entryPointsMap",
"=",
"{",
"}",
";",
"entryPoints",
".",
"forEach",
"(",
"(",
"module",
")",
"=>",
"{",
"entryPointsMap",
"[",
"module",
".",
"name",
"]",
"=",
... | Bundle `entryPoints` given config `config`. | [
"Bundle",
"entryPoints",
"given",
"config",
"config",
"."
] | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/build/lib/bundle.js#L13-L70 | train | Bundle the modules | [
30522,
3853,
14012,
1006,
4443,
26521,
1010,
9530,
8873,
2290,
1010,
2655,
5963,
1007,
1063,
9530,
3367,
4443,
26521,
2863,
2361,
1027,
1063,
1065,
1025,
4443,
26521,
1012,
18921,
6776,
1006,
1006,
11336,
1007,
1027,
1028,
1063,
4443,
26521... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
TryGhost/Ghost | core/server/services/routing/helpers/fetch-data.js | fetchData | function fetchData(pathOptions, routerOptions, locals) {
pathOptions = pathOptions || {};
routerOptions = routerOptions || {};
let postQuery = _.cloneDeep(defaultPostQuery),
props = {};
if (routerOptions.filter) {
postQuery.options.filter = routerOptions.filter;
}
if (routerOp... | javascript | function fetchData(pathOptions, routerOptions, locals) {
pathOptions = pathOptions || {};
routerOptions = routerOptions || {};
let postQuery = _.cloneDeep(defaultPostQuery),
props = {};
if (routerOptions.filter) {
postQuery.options.filter = routerOptions.filter;
}
if (routerOp... | [
"function",
"fetchData",
"(",
"pathOptions",
",",
"routerOptions",
",",
"locals",
")",
"{",
"pathOptions",
"=",
"pathOptions",
"||",
"{",
"}",
";",
"routerOptions",
"=",
"routerOptions",
"||",
"{",
"}",
";",
"let",
"postQuery",
"=",
"_",
".",
"cloneDeep",
... | @description Fetch data from API helper for controllers.
Calls out to get posts per page, builds the final posts query & builds any additional queries
Wraps the queries using Promise.props to ensure it gets named responses
Does a first round of formatting on the response, and returns | [
"@description",
"Fetch",
"data",
"from",
"API",
"helper",
"for",
"controllers",
"."
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/services/routing/helpers/fetch-data.js#L78-L131 | train | Fetch data from the database | [
30522,
3853,
18584,
2850,
2696,
1006,
4130,
7361,
9285,
1010,
2799,
18981,
9285,
1010,
10575,
1007,
1063,
4130,
7361,
9285,
1027,
4130,
7361,
9285,
1064,
1064,
1063,
1065,
1025,
2799,
18981,
9285,
1027,
2799,
18981,
9285,
1064,
1064,
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... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (jid, sid, rid, callback, wait, hold, wind)
{
this._proto._attach(jid, sid, rid, callback, wait, hold, wind);
} | javascript | function (jid, sid, rid, callback, wait, hold, wind)
{
this._proto._attach(jid, sid, rid, callback, wait, hold, wind);
} | [
"function",
"(",
"jid",
",",
"sid",
",",
"rid",
",",
"callback",
",",
"wait",
",",
"hold",
",",
"wind",
")",
"{",
"this",
".",
"_proto",
".",
"_attach",
"(",
"jid",
",",
"sid",
",",
"rid",
",",
"callback",
",",
"wait",
",",
"hold",
",",
"wind",
... | Function: attach
Attach to an already created and authenticated BOSH session.
This function is provided to allow Strophe to attach to BOSH
sessions which have been created externally, perhaps by a Web
application. This is often used to support auto-login type features
without putting user credentials into the page.
... | [
"Function",
":",
"attach",
"Attach",
"to",
"an",
"already",
"created",
"and",
"authenticated",
"BOSH",
"session",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L2309-L2312 | train | Attach a new node to the cluster | [
30522,
3853,
1006,
10147,
2094,
1010,
15765,
1010,
9436,
1010,
2655,
5963,
1010,
3524,
1010,
2907,
1010,
3612,
1007,
1063,
2023,
1012,
1035,
15053,
1012,
1035,
22476,
1006,
10147,
2094,
1010,
15765,
1010,
9436,
1010,
2655,
5963,
1010,
3524,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_getElements | function addonsManager_getElements(aSpec) {
var spec = aSpec || { };
var type = spec.type;
var subtype = spec.subtype;
var value = spec.value;
var parent = spec.parent;
var root = parent ? parent.getNode() : this._controller.tabs.activeTab;
var nodeCollector = new domUtils.nodeCollector(roo... | javascript | function addonsManager_getElements(aSpec) {
var spec = aSpec || { };
var type = spec.type;
var subtype = spec.subtype;
var value = spec.value;
var parent = spec.parent;
var root = parent ? parent.getNode() : this._controller.tabs.activeTab;
var nodeCollector = new domUtils.nodeCollector(roo... | [
"function",
"addonsManager_getElements",
"(",
"aSpec",
")",
"{",
"var",
"spec",
"=",
"aSpec",
"||",
"{",
"}",
";",
"var",
"type",
"=",
"spec",
".",
"type",
";",
"var",
"subtype",
"=",
"spec",
".",
"subtype",
";",
"var",
"value",
"=",
"spec",
".",
"va... | Retrieve list of UI elements based on the given specification
@param {object} aSpec
Information of the UI elements which should be retrieved
Elements: type - Identifier of the element
subtype - Attribute of the element to filter
[optional - default: ""]
value - Value of the attribute to filter
[optional - defa... | [
"Retrieve",
"list",
"of",
"UI",
"elements",
"based",
"on",
"the",
"given",
"specification"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/addons.js#L1081-L1226 | train | Returns the elements of the add - ons | [
30522,
3853,
5587,
5644,
24805,
4590,
1035,
2131,
12260,
8163,
1006,
2004,
5051,
2278,
1007,
1063,
13075,
28699,
1027,
2004,
5051,
2278,
1064,
1064,
1063,
1065,
1025,
13075,
2828,
1027,
28699,
1012,
2828,
1025,
13075,
4942,
13874,
1027,
286... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/padding-line-between-statements.js | getPaddingLineSequences | function getPaddingLineSequences(prevNode, nextNode) {
const pairs = [];
let prevToken = getActualLastToken(sourceCode, prevNode);
if (nextNode.loc.start.line - prevToken.loc.end.line >= 2) {
do {
const token = sourceCode.getTokenAfter(
... | javascript | function getPaddingLineSequences(prevNode, nextNode) {
const pairs = [];
let prevToken = getActualLastToken(sourceCode, prevNode);
if (nextNode.loc.start.line - prevToken.loc.end.line >= 2) {
do {
const token = sourceCode.getTokenAfter(
... | [
"function",
"getPaddingLineSequences",
"(",
"prevNode",
",",
"nextNode",
")",
"{",
"const",
"pairs",
"=",
"[",
"]",
";",
"let",
"prevToken",
"=",
"getActualLastToken",
"(",
"sourceCode",
",",
"prevNode",
")",
";",
"if",
"(",
"nextNode",
".",
"loc",
".",
"s... | Gets padding line sequences between the given 2 statements.
Comments are separators of the padding line sequences.
@param {ASTNode} prevNode The previous statement to count.
@param {ASTNode} nextNode The current statement to count.
@returns {Array<Token[]>} The array of token pairs.
@private | [
"Gets",
"padding",
"line",
"sequences",
"between",
"the",
"given",
"2",
"statements",
".",
"Comments",
"are",
"separators",
"of",
"the",
"padding",
"line",
"sequences",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/padding-line-between-statements.js#L563-L583 | train | get padding line sequences | [
30522,
3853,
2131,
15455,
4667,
12735,
2063,
4226,
5897,
2015,
1006,
3653,
16022,
10244,
1010,
2279,
3630,
3207,
1007,
1063,
9530,
3367,
7689,
1027,
1031,
1033,
1025,
2292,
3653,
2615,
18715,
2368,
1027,
2131,
18908,
8787,
8523,
9284,
7520,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/MainViewManager.js | _doSplit | function _doSplit(orientation) {
var firstPane, newPane;
if (orientation === _orientation) {
return;
}
firstPane = _panes[FIRST_PANE];
Resizer.removeSizable(firstPane.$el);
if (_orientation) {
_$el.removeClass("split-" + _orientation.toLowerCase... | javascript | function _doSplit(orientation) {
var firstPane, newPane;
if (orientation === _orientation) {
return;
}
firstPane = _panes[FIRST_PANE];
Resizer.removeSizable(firstPane.$el);
if (_orientation) {
_$el.removeClass("split-" + _orientation.toLowerCase... | [
"function",
"_doSplit",
"(",
"orientation",
")",
"{",
"var",
"firstPane",
",",
"newPane",
";",
"if",
"(",
"orientation",
"===",
"_orientation",
")",
"{",
"return",
";",
"}",
"firstPane",
"=",
"_panes",
"[",
"FIRST_PANE",
"]",
";",
"Resizer",
".",
"removeSi... | Creates a split for the specified orientation
@private
@param {!string} orientation (VERTICAL|HORIZONTAL) | [
"Creates",
"a",
"split",
"for",
"the",
"specified",
"orientation"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1154-L1184 | train | Split the pane in the specified orientation | [
30522,
3853,
1035,
9998,
24759,
4183,
1006,
10296,
1007,
1063,
13075,
2034,
9739,
2063,
1010,
2047,
9739,
2063,
1025,
2065,
1006,
10296,
1027,
1027,
1027,
1035,
10296,
1007,
1063,
2709,
1025,
1065,
2034,
9739,
2063,
1027,
1035,
6090,
2229,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/index.js | replaceText | function replaceText(id, text) {
var element = document.getElementById(id)
if (null == element) {
// alert("error: can't find element with id '" + id + "'")
return
}
element.innerHTML = text
} | javascript | function replaceText(id, text) {
var element = document.getElementById(id)
if (null == element) {
// alert("error: can't find element with id '" + id + "'")
return
}
element.innerHTML = text
} | [
"function",
"replaceText",
"(",
"id",
",",
"text",
")",
"{",
"var",
"element",
"=",
"document",
".",
"getElementById",
"(",
"id",
")",
"if",
"(",
"null",
"==",
"element",
")",
"{",
"// alert(\"error: can't find element with id '\" + id + \"'\")",
"return",
"}... | --------------------------------------------------------------------- | [
"---------------------------------------------------------------------"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/index.js#L101-L109 | train | replace text with id | [
30522,
3853,
5672,
18209,
1006,
8909,
1010,
3793,
1007,
1063,
13075,
5783,
1027,
6254,
1012,
2131,
12260,
3672,
3762,
3593,
1006,
8909,
1007,
2065,
1006,
19701,
1027,
1027,
5783,
1007,
1063,
1013,
1013,
9499,
1006,
1000,
7561,
1024,
2064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/date/Persian.js | toPersian | function toPersian(oGregorian) {
var iJulianDayNumber = g2d(oGregorian.year, oGregorian.month + 1, oGregorian.day);
return d2j(iJulianDayNumber);
} | javascript | function toPersian(oGregorian) {
var iJulianDayNumber = g2d(oGregorian.year, oGregorian.month + 1, oGregorian.day);
return d2j(iJulianDayNumber);
} | [
"function",
"toPersian",
"(",
"oGregorian",
")",
"{",
"var",
"iJulianDayNumber",
"=",
"g2d",
"(",
"oGregorian",
".",
"year",
",",
"oGregorian",
".",
"month",
"+",
"1",
",",
"oGregorian",
".",
"day",
")",
";",
"return",
"d2j",
"(",
"iJulianDayNumber",
")",
... | Calculate Persian date from gregorian
@param {object} oGregorian a JS object containing day, month and year in the gregorian calendar
@private | [
"Calculate",
"Persian",
"date",
"from",
"gregorian"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/date/Persian.js#L50-L53 | train | Converts a gregorian date to Persian | [
30522,
3853,
2327,
2545,
2937,
1006,
13958,
2890,
20255,
2937,
1007,
1063,
13075,
1045,
9103,
15204,
10259,
19172,
5677,
1027,
1043,
2475,
2094,
30524,
1012,
2154,
1007,
1025,
2709,
1040,
2475,
3501,
1006,
1045,
9103,
15204,
10259,
19172,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/controls/ObjectViewer.js | RenderContext | function RenderContext() {
this._aBuffer = [];
var that = this;
this.add = function() {
that._aBuffer.push.apply(that._aBuffer, arguments);
};
this.addWithParam = function(s, o) {
for (var n in o) {
var reg = new RegExp("\{" + n + "\}","g");
s = s.replace(reg,o[n]);
}
that.add(s);
};
t... | javascript | function RenderContext() {
this._aBuffer = [];
var that = this;
this.add = function() {
that._aBuffer.push.apply(that._aBuffer, arguments);
};
this.addWithParam = function(s, o) {
for (var n in o) {
var reg = new RegExp("\{" + n + "\}","g");
s = s.replace(reg,o[n]);
}
that.add(s);
};
t... | [
"function",
"RenderContext",
"(",
")",
"{",
"this",
".",
"_aBuffer",
"=",
"[",
"]",
";",
"var",
"that",
"=",
"this",
";",
"this",
".",
"add",
"=",
"function",
"(",
")",
"{",
"that",
".",
"_aBuffer",
".",
"push",
".",
"apply",
"(",
"that",
".",
"_... | function _visitObject(oObject, oRenderContext) { //not implemented }; | [
"function",
"_visitObject",
"(",
"oObject",
"oRenderContext",
")",
"{",
"//",
"not",
"implemented",
"}",
";"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/controls/ObjectViewer.js#L148-L164 | train | The RenderContext class | [
30522,
3853,
17552,
8663,
18209,
1006,
1007,
1063,
2023,
1012,
1035,
8273,
12494,
1027,
1031,
1033,
1025,
13075,
2008,
1027,
2023,
1025,
2023,
1012,
5587,
1027,
3853,
1006,
1007,
1063,
2008,
1012,
1035,
8273,
12494,
1012,
5245,
1012,
6611,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/command/KeyBindingManager.js | _readUserKeyMap | function _readUserKeyMap() {
var file = FileSystem.getFileForPath(_getUserKeyMapFilePath()),
result = new $.Deferred();
file.exists(function (err, doesExist) {
if (doesExist) {
FileUtils.readAsText(file)
.done(function (text) {
... | javascript | function _readUserKeyMap() {
var file = FileSystem.getFileForPath(_getUserKeyMapFilePath()),
result = new $.Deferred();
file.exists(function (err, doesExist) {
if (doesExist) {
FileUtils.readAsText(file)
.done(function (text) {
... | [
"function",
"_readUserKeyMap",
"(",
")",
"{",
"var",
"file",
"=",
"FileSystem",
".",
"getFileForPath",
"(",
"_getUserKeyMapFilePath",
"(",
")",
")",
",",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"file",
".",
"exists",
"(",
"function",
"... | @private
Reads in the user key map file and parses its content into JSON.
Returns the user key bindings if JSON has "overrides".
Otherwise, returns an empty object or an error if the file
cannot be parsed or loaded.
@return {$.Promise} a jQuery promise that will be resolved with the JSON
object if the user key map fi... | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L1305-L1338 | train | Reads the user key map file | [
30522,
3853,
1035,
3191,
20330,
14839,
2863,
2361,
1006,
1007,
1063,
13075,
5371,
1027,
6764,
27268,
6633,
1012,
2131,
8873,
2571,
29278,
15069,
1006,
1035,
2131,
20330,
14839,
2863,
14376,
9463,
15069,
1006,
1007,
1007,
1010,
2765,
1027,
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/view/MainViewManager.js | _edit | function _edit(paneId, doc, optionsIn) {
var options = optionsIn || {};
var pane = _getPane(paneId);
// If file is untitled or otherwise not within project tree, add it to
// working set right now (don't wait for it to become dirty)
if (doc.isUntitled() || !ProjectManager.isWit... | javascript | function _edit(paneId, doc, optionsIn) {
var options = optionsIn || {};
var pane = _getPane(paneId);
// If file is untitled or otherwise not within project tree, add it to
// working set right now (don't wait for it to become dirty)
if (doc.isUntitled() || !ProjectManager.isWit... | [
"function",
"_edit",
"(",
"paneId",
",",
"doc",
",",
"optionsIn",
")",
"{",
"var",
"options",
"=",
"optionsIn",
"||",
"{",
"}",
";",
"var",
"pane",
"=",
"_getPane",
"(",
"paneId",
")",
";",
"// If file is untitled or otherwise not within project tree, add it to",
... | Edits a document in the specified pane.
This function is only used by:
- Unit Tests (which construct Mock Document objects),
- by File > New because there is yet to be an established File object
- by Find In Files which needs to open documents synchronously in some cases
Do not use this API it is for internal use only... | [
"Edits",
"a",
"document",
"in",
"the",
"specified",
"pane",
".",
"This",
"function",
"is",
"only",
"used",
"by",
":",
"-",
"Unit",
"Tests",
"(",
"which",
"construct",
"Mock",
"Document",
"objects",
")",
"-",
"by",
"File",
">",
"New",
"because",
"there",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1198-L1216 | train | Edit a document | [
30522,
3853,
1035,
10086,
1006,
6090,
7416,
2094,
1010,
9986,
1010,
7047,
2378,
1007,
1063,
13075,
7047,
1027,
7047,
2378,
1064,
1064,
1063,
1065,
1025,
13075,
6090,
2063,
1027,
1035,
2131,
9739,
2063,
1006,
6090,
7416,
2094,
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... |
SAP/openui5 | src/sap.ui.demokit/src/sap/ui/demokit/demoapps/controller/App.controller.js | function (oEvent) {
var oSelectedItem = oEvent.getParameters().selectedItem,
oListItem = oSelectedItem ? oSelectedItem : oEvent.getSource().getParent();
this._oDownloadButton.setBusy(true);
sap.ui.require([
"sap/ui/core/util/File",
"sap/ui/thirdparty/jszip"
], function (oFile) {
var oZipFil... | javascript | function (oEvent) {
var oSelectedItem = oEvent.getParameters().selectedItem,
oListItem = oSelectedItem ? oSelectedItem : oEvent.getSource().getParent();
this._oDownloadButton.setBusy(true);
sap.ui.require([
"sap/ui/core/util/File",
"sap/ui/thirdparty/jszip"
], function (oFile) {
var oZipFil... | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"oSelectedItem",
"=",
"oEvent",
".",
"getParameters",
"(",
")",
".",
"selectedItem",
",",
"oListItem",
"=",
"oSelectedItem",
"?",
"oSelectedItem",
":",
"oEvent",
".",
"getSource",
"(",
")",
".",
"getParent",
"(",
... | Downloads a demo app
@param {sap.ui.base.Event} oEvent the Button press event
@public | [
"Downloads",
"a",
"demo",
"app"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/demoapps/controller/App.controller.js#L58-L112 | train | Downloads the files from the selected item | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
9808,
12260,
10985,
4221,
2213,
1027,
1051,
18697,
3372,
1012,
2131,
28689,
22828,
2015,
1006,
1007,
1012,
3479,
4221,
2213,
1010,
19330,
2923,
4221,
2213,
1027,
9808,
12260,
10985,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.commons/src/sap/ui/commons/RoadMapRenderer.js | function(oStep, sLabel){
var bIsExpandable = oStep.getParent() instanceof sap.ui.commons.RoadMap && oStep.getSubSteps().length > 0;
var sResult = sLabel || "";
if (oStep.getEnabled()) {
sResult = getText(bIsExpandable ? "RDMP_ARIA_EXPANDABLE_STEP" : "RDMP_ARIA_STANDARD_STEP", [sResult]);
}
return sResult... | javascript | function(oStep, sLabel){
var bIsExpandable = oStep.getParent() instanceof sap.ui.commons.RoadMap && oStep.getSubSteps().length > 0;
var sResult = sLabel || "";
if (oStep.getEnabled()) {
sResult = getText(bIsExpandable ? "RDMP_ARIA_EXPANDABLE_STEP" : "RDMP_ARIA_STANDARD_STEP", [sResult]);
}
return sResult... | [
"function",
"(",
"oStep",
",",
"sLabel",
")",
"{",
"var",
"bIsExpandable",
"=",
"oStep",
".",
"getParent",
"(",
")",
"instanceof",
"sap",
".",
"ui",
".",
"commons",
".",
"RoadMap",
"&&",
"oStep",
".",
"getSubSteps",
"(",
")",
".",
"length",
">",
"0",
... | Computes how the aria-label property should be set for the given step | [
"Computes",
"how",
"the",
"aria",
"-",
"label",
"property",
"should",
"be",
"set",
"for",
"the",
"given",
"step"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L676-L685 | train | Returns the label for the given step | [
30522,
3853,
1006,
9808,
2618,
2361,
1010,
17584,
2884,
1007,
1063,
13075,
20377,
10288,
9739,
20782,
1027,
9808,
2618,
2361,
1012,
2131,
19362,
4765,
1006,
1007,
6013,
11253,
20066,
1012,
21318,
1012,
7674,
1012,
2346,
2863,
2361,
1004,
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... | |
adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | function (element) {
var p = this.padding,
w = this.canvas.width,
h = this.canvas.height * 0.5;
// Convert padding percentage to actual padding
p = p.map(function (a, i) {
return a * ((i % 2) ? w : h);
});
retu... | javascript | function (element) {
var p = this.padding,
w = this.canvas.width,
h = this.canvas.height * 0.5;
// Convert padding percentage to actual padding
p = p.map(function (a, i) {
return a * ((i % 2) ? w : h);
});
retu... | [
"function",
"(",
"element",
")",
"{",
"var",
"p",
"=",
"this",
".",
"padding",
",",
"w",
"=",
"this",
".",
"canvas",
".",
"width",
",",
"h",
"=",
"this",
".",
"canvas",
".",
"height",
"*",
"0.5",
";",
"// Convert padding percentage to actual padding",
"p... | Get CSS left, top offsets for endpoint handle
@param {Element} element Endpoint handle <button> element
@return {Array.string[2]} | [
"Get",
"CSS",
"left",
"top",
"offsets",
"for",
"endpoint",
"handle"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L129-L143 | train | Returns an array of padding percentage values | [
30522,
3853,
1006,
5783,
1007,
1063,
13075,
1052,
1027,
2023,
1012,
11687,
4667,
1010,
1059,
1027,
2023,
1012,
10683,
1012,
9381,
1010,
1044,
1027,
2023,
1012,
10683,
1012,
4578,
1008,
1014,
1012,
1019,
1025,
1013,
1013,
10463,
11687,
4667,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/space-unary-ops.js | verifyWordHasSpaces | function verifyWordHasSpaces(node, firstToken, secondToken, word) {
if (secondToken.range[0] === firstToken.range[1]) {
context.report({
node,
messageId: "wordOperator",
data: {
word
},
... | javascript | function verifyWordHasSpaces(node, firstToken, secondToken, word) {
if (secondToken.range[0] === firstToken.range[1]) {
context.report({
node,
messageId: "wordOperator",
data: {
word
},
... | [
"function",
"verifyWordHasSpaces",
"(",
"node",
",",
"firstToken",
",",
"secondToken",
",",
"word",
")",
"{",
"if",
"(",
"secondToken",
".",
"range",
"[",
"0",
"]",
"===",
"firstToken",
".",
"range",
"[",
"1",
"]",
")",
"{",
"context",
".",
"report",
"... | Verify Unary Word Operator has spaces after the word operator
@param {ASTnode} node AST node
@param {Object} firstToken first token from the AST node
@param {Object} secondToken second token from the AST node
@param {string} word The word to be used for reporting
@returns {void} | [
"Verify",
"Unary",
"Word",
"Operator",
"has",
"spaces",
"after",
"the",
"word",
"operator"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/space-unary-ops.js#L107-L120 | train | Verify word has spaces | [
30522,
3853,
20410,
18351,
14949,
23058,
2015,
1006,
13045,
1010,
2034,
18715,
2368,
1010,
2117,
18715,
2368,
1010,
2773,
1007,
1063,
2065,
1006,
2117,
18715,
2368,
1012,
2846,
1031,
1014,
1033,
1027,
1027,
1027,
2034,
18715,
2368,
1012,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/aws-containers/prompts.js | askForSubnets | function askForSubnets() {
if (this.abort) return null;
const done = this.async();
const subnetList = _.map(this.awsFacts.availableSubnets, sn => {
const friendlyName = _getFriendlyNameFromTag(sn);
const formattedFriendlyName = friendlyName ? `name: '${friendlyName}', ` : '';
return... | javascript | function askForSubnets() {
if (this.abort) return null;
const done = this.async();
const subnetList = _.map(this.awsFacts.availableSubnets, sn => {
const friendlyName = _getFriendlyNameFromTag(sn);
const formattedFriendlyName = friendlyName ? `name: '${friendlyName}', ` : '';
return... | [
"function",
"askForSubnets",
"(",
")",
"{",
"if",
"(",
"this",
".",
"abort",
")",
"return",
"null",
";",
"const",
"done",
"=",
"this",
".",
"async",
"(",
")",
";",
"const",
"subnetList",
"=",
"_",
".",
"map",
"(",
"this",
".",
"awsFacts",
".",
"ava... | Ask user to select availability information (availability, zones)/ | [
"Ask",
"user",
"to",
"select",
"availability",
"information",
"(",
"availability",
"zones",
")",
"/"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/aws-containers/prompts.js#L386-L449 | train | Ask For Subnets | [
30522,
3853,
3198,
29278,
6342,
24700,
8454,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
11113,
11589,
1007,
2709,
19701,
1025,
9530,
3367,
2589,
1027,
2023,
1012,
2004,
6038,
2278,
1006,
1007,
1025,
9530,
3367,
4942,
7159,
9863,
1027,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/js/autocompleteController.js | init | function init () {
$mdUtil.initOptionalProperties($scope, $attrs, {
searchText: '',
selectedItem: null,
clearButton: false,
disableVirtualRepeat: false,
});
$mdTheming($element);
configureWatchers();
$mdUtil.nextTick(function () {
gatherElements();
moveDropdown... | javascript | function init () {
$mdUtil.initOptionalProperties($scope, $attrs, {
searchText: '',
selectedItem: null,
clearButton: false,
disableVirtualRepeat: false,
});
$mdTheming($element);
configureWatchers();
$mdUtil.nextTick(function () {
gatherElements();
moveDropdown... | [
"function",
"init",
"(",
")",
"{",
"$mdUtil",
".",
"initOptionalProperties",
"(",
"$scope",
",",
"$attrs",
",",
"{",
"searchText",
":",
"''",
",",
"selectedItem",
":",
"null",
",",
"clearButton",
":",
"false",
",",
"disableVirtualRepeat",
":",
"false",
",",
... | initialization methods
Initialize the controller, setup watchers, gather elements | [
"initialization",
"methods",
"Initialize",
"the",
"controller",
"setup",
"watchers",
"gather",
"elements"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/autocomplete/js/autocompleteController.js#L80-L115 | train | Initializes the optional properties of the optional element | [
30522,
3853,
1999,
4183,
1006,
1007,
1063,
1002,
9108,
21823,
2140,
1012,
1999,
9956,
16790,
2389,
21572,
4842,
7368,
1006,
1002,
9531,
1010,
1002,
2012,
16344,
2015,
1010,
1063,
3945,
18209,
1024,
1005,
1005,
1010,
3479,
4221,
2213,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/FindUtils.js | _doReplaceInOneFile | function _doReplaceInOneFile(fullPath, matchInfo, replaceText, options) {
var doc = DocumentManager.getOpenDocumentForPath(fullPath);
options = options || {};
// If we're forcing files open, or if the document is in the working set but not actually open
// yet, we want to open the file a... | javascript | function _doReplaceInOneFile(fullPath, matchInfo, replaceText, options) {
var doc = DocumentManager.getOpenDocumentForPath(fullPath);
options = options || {};
// If we're forcing files open, or if the document is in the working set but not actually open
// yet, we want to open the file a... | [
"function",
"_doReplaceInOneFile",
"(",
"fullPath",
",",
"matchInfo",
",",
"replaceText",
",",
"options",
")",
"{",
"var",
"doc",
"=",
"DocumentManager",
".",
"getOpenDocumentForPath",
"(",
"fullPath",
")",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
... | Does a set of replacements in a single file. If the file is already open in a Document in memory,
will do the replacement there, otherwise does it directly on disk.
@param {string} fullPath The full path to the file.
@param {Object} matchInfo The match info for this file, as returned by `_addSearchMatches()`.
@param {s... | [
"Does",
"a",
"set",
"of",
"replacements",
"in",
"a",
"single",
"file",
".",
"If",
"the",
"file",
"is",
"already",
"open",
"in",
"a",
"Document",
"in",
"memory",
"will",
"do",
"the",
"replacement",
"there",
"otherwise",
"does",
"it",
"directly",
"on",
"di... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L190-L204 | train | Replace a file in the file system | [
30522,
3853,
1035,
2079,
2890,
24759,
10732,
5740,
2638,
8873,
2571,
1006,
2440,
15069,
1010,
2674,
2378,
14876,
1010,
5672,
18209,
1010,
7047,
1007,
1063,
13075,
9986,
1027,
6254,
24805,
4590,
1012,
2131,
26915,
3527,
24894,
4765,
29278,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Manifest.js | function() {
// version check => only if minVersion is available a warning
// will be logged and the debug mode is turned on
// TODO: enhance version check also for libraries and components
var sMinUI5Version = this.getEntry("/sap.ui5/dependencies/minUI5Version");
if (sMinUI5Version &&
Log.isLoggabl... | javascript | function() {
// version check => only if minVersion is available a warning
// will be logged and the debug mode is turned on
// TODO: enhance version check also for libraries and components
var sMinUI5Version = this.getEntry("/sap.ui5/dependencies/minUI5Version");
if (sMinUI5Version &&
Log.isLoggabl... | [
"function",
"(",
")",
"{",
"// version check => only if minVersion is available a warning",
"// will be logged and the debug mode is turned on",
"// TODO: enhance version check also for libraries and components",
"var",
"sMinUI5Version",
"=",
"this",
".",
"getEntry",
"(",
"\"/sap.ui5/dep... | Validates the current UI5 version with the minimal version defined in the
manifest. If the minimal version is greater than the current version an
issue will be reported in the console if open.
@private | [
"Validates",
"the",
"current",
"UI5",
"version",
"with",
"the",
"minimal",
"version",
"defined",
"in",
"the",
"manifest",
".",
"If",
"the",
"minimal",
"version",
"is",
"greater",
"than",
"the",
"current",
"version",
"an",
"issue",
"will",
"be",
"reported",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Manifest.js#L368-L388 | train | Checks that the component requires at least a version | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
2544,
4638,
1027,
1028,
2069,
2065,
8117,
27774,
2003,
2800,
1037,
5432,
1013,
1013,
2097,
2022,
26618,
1998,
1996,
2139,
8569,
2290,
5549,
2003,
2357,
2006,
1013,
1013,
28681,
2080,
1024,
11598,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | extractHelperFilesFromCompilation | function extractHelperFilesFromCompilation (mainCompilation, childCompilation, filename, childEntryChunks) {
const helperAssetNames = childEntryChunks.map((entryChunk, index) => {
return mainCompilation.mainTemplate.hooks.assetPath.call(filename, {
hash: childCompilation.hash,
chunk: entryChunk,
... | javascript | function extractHelperFilesFromCompilation (mainCompilation, childCompilation, filename, childEntryChunks) {
const helperAssetNames = childEntryChunks.map((entryChunk, index) => {
return mainCompilation.mainTemplate.hooks.assetPath.call(filename, {
hash: childCompilation.hash,
chunk: entryChunk,
... | [
"function",
"extractHelperFilesFromCompilation",
"(",
"mainCompilation",
",",
"childCompilation",
",",
"filename",
",",
"childEntryChunks",
")",
"{",
"const",
"helperAssetNames",
"=",
"childEntryChunks",
".",
"map",
"(",
"(",
"entryChunk",
",",
"index",
")",
"=>",
"... | The webpack child compilation will create files as a side effect.
This function will extract them and clean them up so they won't be written to disk.
Returns the source code of the compiled templates as string
@returns Array<string> | [
"The",
"webpack",
"child",
"compilation",
"will",
"create",
"files",
"as",
"a",
"side",
"effect",
".",
"This",
"function",
"will",
"extract",
"them",
"and",
"clean",
"them",
"up",
"so",
"they",
"won",
"t",
"be",
"written",
"to",
"disk",
"."
] | 38db64ae8805de37d038e0ee0f6dfa2a26e2163a | https://github.com/jantimon/html-webpack-plugin/blob/38db64ae8805de37d038e0ee0f6dfa2a26e2163a/lib/compiler.js#L180-L198 | train | Extract all helper files from the compilation | [
30522,
3853,
14817,
16001,
4842,
8873,
4244,
19699,
5358,
9006,
8197,
13490,
1006,
2364,
9006,
8197,
13490,
1010,
2775,
9006,
8197,
13490,
1010,
5371,
18442,
1010,
2775,
4765,
2854,
20760,
8950,
2015,
1007,
1063,
9530,
3367,
2393,
24140,
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... |
angular/material | src/components/tabs/tabsPaginationService.js | getTotalTabsWidth | function getTotalTabsWidth(elements) {
var sum = 0, i, tab;
for (i = 0; i < elements.tabs.length; i++) {
tab = elements.tabs[i];
sum += tab.offsetWidth;
}
return sum;
} | javascript | function getTotalTabsWidth(elements) {
var sum = 0, i, tab;
for (i = 0; i < elements.tabs.length; i++) {
tab = elements.tabs[i];
sum += tab.offsetWidth;
}
return sum;
} | [
"function",
"getTotalTabsWidth",
"(",
"elements",
")",
"{",
"var",
"sum",
"=",
"0",
",",
"i",
",",
"tab",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"elements",
".",
"tabs",
".",
"length",
";",
"i",
"++",
")",
"{",
"tab",
"=",
"elements",
"... | Sum the width of all tabs.
@param elements
@returns {number} | [
"Sum",
"the",
"width",
"of",
"all",
"tabs",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/tabsPaginationService.js#L101-L110 | train | Returns the total width of all tabs in the specified elements | [
30522,
3853,
2131,
3406,
9080,
2696,
5910,
9148,
11927,
2232,
1006,
3787,
1007,
1063,
13075,
7680,
1027,
1014,
1010,
1045,
1010,
21628,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
3787,
1012,
21628,
2015,
1012,
3091,
1025,
1045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | Makefile.js | generateRuleIndexPage | function generateRuleIndexPage(basedir) {
const outputFile = "../eslint.github.io/_data/rules.yml",
categoryList = "conf/category-list.json",
categoriesData = JSON.parse(cat(path.resolve(categoryList)));
find(path.join(basedir, "/lib/rules/")).filter(fileType("js"))
.map(filename => [fi... | javascript | function generateRuleIndexPage(basedir) {
const outputFile = "../eslint.github.io/_data/rules.yml",
categoryList = "conf/category-list.json",
categoriesData = JSON.parse(cat(path.resolve(categoryList)));
find(path.join(basedir, "/lib/rules/")).filter(fileType("js"))
.map(filename => [fi... | [
"function",
"generateRuleIndexPage",
"(",
"basedir",
")",
"{",
"const",
"outputFile",
"=",
"\"../eslint.github.io/_data/rules.yml\"",
",",
"categoryList",
"=",
"\"conf/category-list.json\"",
",",
"categoriesData",
"=",
"JSON",
".",
"parse",
"(",
"cat",
"(",
"path",
".... | Generate a doc page that lists all of the rules and links to them
@param {string} basedir The directory in which to look for code.
@returns {void} | [
"Generate",
"a",
"doc",
"page",
"that",
"lists",
"all",
"of",
"the",
"rules",
"and",
"links",
"to",
"them"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/Makefile.js#L177-L215 | train | Generate rule index page | [
30522,
3853,
9699,
6820,
19856,
3207,
2595,
13704,
1006,
2241,
4313,
1007,
1063,
9530,
3367,
6434,
8873,
2571,
1027,
1000,
1012,
1012,
1013,
9686,
4115,
2102,
1012,
21025,
2705,
12083,
1012,
22834,
1013,
1035,
2951,
1013,
3513,
1012,
1061,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
aws/aws-sdk-js | lib/event-stream/split-message.js | splitMessage | function splitMessage(message) {
if (!util.Buffer.isBuffer(message)) message = toBuffer(message);
if (message.length < MINIMUM_MESSAGE_LENGTH) {
throw new Error('Provided message too short to accommodate event stream message overhead');
}
if (message.length !== message.readUInt32BE(0)) {
... | javascript | function splitMessage(message) {
if (!util.Buffer.isBuffer(message)) message = toBuffer(message);
if (message.length < MINIMUM_MESSAGE_LENGTH) {
throw new Error('Provided message too short to accommodate event stream message overhead');
}
if (message.length !== message.readUInt32BE(0)) {
... | [
"function",
"splitMessage",
"(",
"message",
")",
"{",
"if",
"(",
"!",
"util",
".",
"Buffer",
".",
"isBuffer",
"(",
"message",
")",
")",
"message",
"=",
"toBuffer",
"(",
"message",
")",
";",
"if",
"(",
"message",
".",
"length",
"<",
"MINIMUM_MESSAGE_LENGT... | @api private
@param {Buffer} message | [
"@api",
"private"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/event-stream/split-message.js#L18-L63 | train | Split the message into two parts | [
30522,
3853,
3975,
7834,
3736,
3351,
1006,
4471,
1007,
1063,
2065,
1006,
999,
21183,
4014,
1012,
17698,
1012,
2003,
8569,
12494,
1006,
4471,
1007,
1007,
4471,
1027,
2000,
8569,
12494,
1006,
4471,
1007,
1025,
2065,
1006,
4471,
1012,
3091,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Configuration.js | function(sFormatId) {
sFormatId = sFormatId ? String(sFormatId).toUpperCase() : "";
check(!sFormatId || M_ABAP_DATE_FORMAT_PATTERN.hasOwnProperty(sFormatId), "sFormatId must be one of ['1','2','3','4','5','6','7','8','9','A','B','C'] or empty");
var mChanges = this.oConfiguration._collect();
this.sLegacyDat... | javascript | function(sFormatId) {
sFormatId = sFormatId ? String(sFormatId).toUpperCase() : "";
check(!sFormatId || M_ABAP_DATE_FORMAT_PATTERN.hasOwnProperty(sFormatId), "sFormatId must be one of ['1','2','3','4','5','6','7','8','9','A','B','C'] or empty");
var mChanges = this.oConfiguration._collect();
this.sLegacyDat... | [
"function",
"(",
"sFormatId",
")",
"{",
"sFormatId",
"=",
"sFormatId",
"?",
"String",
"(",
"sFormatId",
")",
".",
"toUpperCase",
"(",
")",
":",
"\"\"",
";",
"check",
"(",
"!",
"sFormatId",
"||",
"M_ABAP_DATE_FORMAT_PATTERN",
".",
"hasOwnProperty",
"(",
"sFor... | Allows to specify one of the legacy ABAP date formats.
This method modifies the date patterns for 'short' and 'medium' style with the corresponding ABAP
format. When called with a null or undefined format id, any previously applied format will be removed.
After changing the legacy date format, the framework tries to ... | [
"Allows",
"to",
"specify",
"one",
"of",
"the",
"legacy",
"ABAP",
"date",
"formats",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Configuration.js#L2057-L2066 | train | Sets the legacy date format | [
30522,
3853,
1006,
16420,
2953,
18900,
3593,
1007,
1063,
16420,
2953,
18900,
3593,
1027,
16420,
2953,
18900,
3593,
1029,
5164,
1006,
16420,
2953,
18900,
3593,
1007,
1012,
2000,
29547,
18992,
3366,
1006,
1007,
1024,
1000,
1000,
1025,
4638,
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... | |
TryGhost/Ghost | core/server/data/importer/index.js | function (directory) {
// Globs match root level only
var extMatches = glob.sync(this.getExtensionGlob(this.getExtensions(), ROOT_ONLY), {cwd: directory}),
dirMatches = glob.sync(this.getDirectoryGlob(this.getDirectories(), ROOT_ONLY), {cwd: directory}),
extMatchesAll;
/... | javascript | function (directory) {
// Globs match root level only
var extMatches = glob.sync(this.getExtensionGlob(this.getExtensions(), ROOT_ONLY), {cwd: directory}),
dirMatches = glob.sync(this.getDirectoryGlob(this.getDirectories(), ROOT_ONLY), {cwd: directory}),
extMatchesAll;
/... | [
"function",
"(",
"directory",
")",
"{",
"// Globs match root level only",
"var",
"extMatches",
"=",
"glob",
".",
"sync",
"(",
"this",
".",
"getExtensionGlob",
"(",
"this",
".",
"getExtensions",
"(",
")",
",",
"ROOT_ONLY",
")",
",",
"{",
"cwd",
":",
"director... | Get the name of the single base directory if there is one, else return an empty string
@param {String} directory
@returns {Promise (String)} | [
"Get",
"the",
"name",
"of",
"the",
"single",
"base",
"directory",
"if",
"there",
"is",
"one",
"else",
"return",
"an",
"empty",
"string"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/data/importer/index.js#L197-L216 | train | Get the base directory of the zip file | [
30522,
3853,
1006,
14176,
1007,
1063,
1013,
1013,
1043,
4135,
5910,
2674,
7117,
2504,
2069,
13075,
4654,
29418,
10649,
2229,
1027,
1043,
4135,
2497,
1012,
26351,
1006,
2023,
1012,
2131,
10288,
29048,
23296,
16429,
1006,
2023,
1012,
2131,
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... | |
jgraph/mxgraph | javascript/mxClient.js | mxCellTracker | function mxCellTracker(graph, color, funct)
{
mxCellMarker.call(this, graph, color);
this.graph.addMouseListener(this);
if (funct != null)
{
this.getCell = funct;
}
// Automatic deallocation of memory
if (mxClient.IS_IE)
{
mxEvent.addListener(window, 'unload', mxUtils.bind(this, function()
{
this.... | javascript | function mxCellTracker(graph, color, funct)
{
mxCellMarker.call(this, graph, color);
this.graph.addMouseListener(this);
if (funct != null)
{
this.getCell = funct;
}
// Automatic deallocation of memory
if (mxClient.IS_IE)
{
mxEvent.addListener(window, 'unload', mxUtils.bind(this, function()
{
this.... | [
"function",
"mxCellTracker",
"(",
"graph",
",",
"color",
",",
"funct",
")",
"{",
"mxCellMarker",
".",
"call",
"(",
"this",
",",
"graph",
",",
"color",
")",
";",
"this",
".",
"graph",
".",
"addMouseListener",
"(",
"this",
")",
";",
"if",
"(",
"funct",
... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxCellTracker
Event handler that highlights cells. Inherits from <mxCellMarker>.
Example:
(code)
new mxCellTracker(graph, '#00FF00');
(end)
For detecting dragEnter, dragOver and dragLeave on cells, the following
code can be used:
(... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxCellTracker"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L81453-L81472 | train | A cell tracker that is used to track the state of a cell. | [
30522,
3853,
25630,
29109,
7096,
22648,
5484,
1006,
10629,
1010,
3609,
1010,
4569,
6593,
1007,
1063,
25630,
29109,
19145,
25074,
2099,
1012,
2655,
1006,
2023,
1010,
10629,
1010,
3609,
1007,
1025,
2023,
1012,
10629,
1012,
5587,
27711,
29282,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
uber/deck.gl | modules/aggregation-layers/src/utils/gpu-grid-aggregation/grid-aggregation-utils.js | getGridOffset | function getGridOffset(boundingBox, cellSize) {
const {yMin, yMax} = boundingBox;
const latMin = yMin;
const latMax = yMax;
const centerLat = (latMin + latMax) / 2;
return calculateGridLatLonOffset(cellSize, centerLat);
} | javascript | function getGridOffset(boundingBox, cellSize) {
const {yMin, yMax} = boundingBox;
const latMin = yMin;
const latMax = yMax;
const centerLat = (latMin + latMax) / 2;
return calculateGridLatLonOffset(cellSize, centerLat);
} | [
"function",
"getGridOffset",
"(",
"boundingBox",
",",
"cellSize",
")",
"{",
"const",
"{",
"yMin",
",",
"yMax",
"}",
"=",
"boundingBox",
";",
"const",
"latMin",
"=",
"yMin",
";",
"const",
"latMax",
"=",
"yMax",
";",
"const",
"centerLat",
"=",
"(",
"latMin... | /* eslint-enable max-statements
Based on geometric center of sample points, calculate cellSize in lng/lat (degree) space
@param {object} gridData - contains bounding box of data
@param {number} cellSize - grid cell size in meters
@returns {yOffset, xOffset} - cellSize size lng/lat (degree) space. | [
"/",
"*",
"eslint",
"-",
"enable",
"max",
"-",
"statements",
"Based",
"on",
"geometric",
"center",
"of",
"sample",
"points",
"calculate",
"cellSize",
"in",
"lng",
"/",
"lat",
"(",
"degree",
")",
"space"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/aggregation-layers/src/utils/gpu-grid-aggregation/grid-aggregation-utils.js#L155-L162 | train | Calculate grid offset | [
30522,
3853,
2131,
16523,
13820,
21807,
3388,
1006,
5391,
2075,
8758,
1010,
4442,
4697,
1007,
1063,
9530,
3367,
1063,
1061,
10020,
1010,
1061,
17848,
1065,
1027,
5391,
2075,
8758,
1025,
9530,
3367,
2474,
21246,
2378,
1027,
1061,
10020,
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... |
adobe/brackets | src/editor/CodeHintManager.js | _endSession | function _endSession() {
if (!hintList) {
return;
}
hintList.close();
hintList = null;
codeHintOpened = false;
keyDownEditor = null;
sessionProvider = null;
sessionEditor = null;
if (deferredHints) {
deferredHints.reject();
... | javascript | function _endSession() {
if (!hintList) {
return;
}
hintList.close();
hintList = null;
codeHintOpened = false;
keyDownEditor = null;
sessionProvider = null;
sessionEditor = null;
if (deferredHints) {
deferredHints.reject();
... | [
"function",
"_endSession",
"(",
")",
"{",
"if",
"(",
"!",
"hintList",
")",
"{",
"return",
";",
"}",
"hintList",
".",
"close",
"(",
")",
";",
"hintList",
"=",
"null",
";",
"codeHintOpened",
"=",
"false",
";",
"keyDownEditor",
"=",
"null",
";",
"sessionP... | End the current hinting session | [
"End",
"the",
"current",
"hinting",
"session"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L373-L387 | train | End session | [
30522,
3853,
1035,
4515,
7971,
3258,
1006,
1007,
1063,
2065,
1006,
999,
9374,
9863,
1007,
1063,
2709,
1025,
1065,
9374,
9863,
1012,
2485,
1006,
1007,
1025,
9374,
9863,
1027,
19701,
1025,
3642,
10606,
14399,
6675,
1027,
6270,
1025,
3145,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/components/AppWrapper.js | forcePageReload | function forcePageReload(registration) {
// console.log('already controlled?', Boolean(navigator.serviceWorker.controller));
if (!navigator.serviceWorker.controller) {
// The window client isn't currently controlled so it's a new service
// worker that will activate immediately.
return;
}
// conso... | javascript | function forcePageReload(registration) {
// console.log('already controlled?', Boolean(navigator.serviceWorker.controller));
if (!navigator.serviceWorker.controller) {
// The window client isn't currently controlled so it's a new service
// worker that will activate immediately.
return;
}
// conso... | [
"function",
"forcePageReload",
"(",
"registration",
")",
"{",
"// console.log('already controlled?', Boolean(navigator.serviceWorker.controller));",
"if",
"(",
"!",
"navigator",
".",
"serviceWorker",
".",
"controller",
")",
"{",
"// The window client isn't currently controlled so i... | Inspired by https://developers.google.com/web/tools/workbox/guides/advanced-recipes#offer_a_page_reload_for_users | [
"Inspired",
"by",
"https",
":",
"//",
"developers",
".",
"google",
".",
"com",
"/",
"web",
"/",
"tools",
"/",
"workbox",
"/",
"guides",
"/",
"advanced",
"-",
"recipes#offer_a_page_reload_for_users"
] | 1555e52367835946382fbf2a8f681de71318915d | https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/docs/src/modules/components/AppWrapper.js#L59-L97 | train | Force a reload of the page by the active service worker. | [
30522,
3853,
2486,
13704,
16570,
10441,
2094,
1006,
8819,
1007,
1063,
1013,
1013,
10122,
1012,
8833,
1006,
1005,
2525,
4758,
1029,
1005,
1010,
22017,
20898,
1006,
20532,
1012,
2326,
6198,
2121,
1012,
11486,
1007,
1007,
1025,
2065,
1006,
999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/config/config-rule.js | explodeArray | function explodeArray(xs) {
return xs.reduce((accumulator, x) => {
accumulator.push([x]);
return accumulator;
}, []);
} | javascript | function explodeArray(xs) {
return xs.reduce((accumulator, x) => {
accumulator.push([x]);
return accumulator;
}, []);
} | [
"function",
"explodeArray",
"(",
"xs",
")",
"{",
"return",
"xs",
".",
"reduce",
"(",
"(",
"accumulator",
",",
"x",
")",
"=>",
"{",
"accumulator",
".",
"push",
"(",
"[",
"x",
"]",
")",
";",
"return",
"accumulator",
";",
"}",
",",
"[",
"]",
")",
";... | ------------------------------------------------------------------------------ Helpers ------------------------------------------------------------------------------
Wrap all of the elements of an array into arrays.
@param {*[]} xs Any array.
@returns {Array[]} An array of arrays. | [
"------------------------------------------------------------------------------",
"Helpers",
"------------------------------------------------------------------------------",
"Wrap",
"all",
"of",
"the",
"elements",
"of",
"an",
"array",
"into",
"arrays",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-rule.js#L26-L31 | train | Explode an array of tokens into an array of tokens | [
30522,
3853,
15044,
2906,
9447,
1006,
1060,
2015,
1007,
1063,
2709,
1060,
2015,
1012,
5547,
1006,
1006,
16222,
2819,
20350,
1010,
1060,
1007,
1027,
1028,
1063,
16222,
2819,
20350,
1012,
5245,
1006,
1031,
1060,
1033,
1007,
1025,
2709,
16222,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 (data, oldContext, newContext) {
var newGlob = _findMatchingGlob(data,
FileUtils.getRelativeFilename(this.prefFilePath, newContext[this.key])),
oldGlob = _findMatchingGlob(data,
FileUtils.getRelativeFilename(this.prefFilePa... | javascript | function (data, oldContext, newContext) {
var newGlob = _findMatchingGlob(data,
FileUtils.getRelativeFilename(this.prefFilePath, newContext[this.key])),
oldGlob = _findMatchingGlob(data,
FileUtils.getRelativeFilename(this.prefFilePa... | [
"function",
"(",
"data",
",",
"oldContext",
",",
"newContext",
")",
"{",
"var",
"newGlob",
"=",
"_findMatchingGlob",
"(",
"data",
",",
"FileUtils",
".",
"getRelativeFilename",
"(",
"this",
".",
"prefFilePath",
",",
"newContext",
"[",
"this",
".",
"key",
"]",... | Determines if there are preference IDs that could change as a result of
a change in the context. This implementation considers only the path portion
of the context and looks up matching globes if any.
@param {Object} data Data in the Scope
@param {{path: string}} oldContext Old context
@param {{path: string}} newConte... | [
"Determines",
"if",
"there",
"are",
"preference",
"IDs",
"that",
"could",
"change",
"as",
"a",
"result",
"of",
"a",
"change",
"in",
"the",
"context",
".",
"This",
"implementation",
"considers",
"only",
"the",
"path",
"portion",
"of",
"the",
"context",
"and",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1001-L1018 | train | returns the keys of the new and old globs | [
30522,
3853,
1006,
2951,
1010,
2214,
8663,
18209,
1010,
2047,
8663,
18209,
1007,
1063,
13075,
2047,
23296,
16429,
1027,
1035,
2424,
18900,
8450,
23296,
16429,
1006,
2951,
1010,
5371,
21823,
4877,
1012,
2131,
16570,
8082,
8873,
20844,
4168,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... | |
zeit/now-cli | src/commands/inspect.js | stateString | function stateString(s) {
switch (s) {
case 'INITIALIZING':
return chalk.yellow(s);
case 'ERROR':
return chalk.red(s);
case 'READY':
return s;
default:
return chalk.gray('UNKNOWN');
}
} | javascript | function stateString(s) {
switch (s) {
case 'INITIALIZING':
return chalk.yellow(s);
case 'ERROR':
return chalk.red(s);
case 'READY':
return s;
default:
return chalk.gray('UNKNOWN');
}
} | [
"function",
"stateString",
"(",
"s",
")",
"{",
"switch",
"(",
"s",
")",
"{",
"case",
"'INITIALIZING'",
":",
"return",
"chalk",
".",
"yellow",
"(",
"s",
")",
";",
"case",
"'ERROR'",
":",
"return",
"chalk",
".",
"red",
"(",
"s",
")",
";",
"case",
"'R... | renders the state string | [
"renders",
"the",
"state",
"string"
] | b53d907b745126113bc3e251ac2451088026a363 | https://github.com/zeit/now-cli/blob/b53d907b745126113bc3e251ac2451088026a363/src/commands/inspect.js#L309-L323 | train | Returns the state string for a cluster | [
30522,
3853,
2163,
18886,
3070,
1006,
1055,
1007,
1063,
6942,
1006,
1055,
1007,
1063,
2553,
1005,
3988,
6026,
1005,
1024,
2709,
16833,
1012,
3756,
1006,
1055,
1007,
1025,
2553,
1005,
7561,
1005,
1024,
2709,
16833,
1012,
2417,
1006,
1055,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Configuration.js | function (mUnits) {
// add custom units, or remove the existing ones if none are given
var mExistingUnits = this.getCustomUnits();
if (mExistingUnits){
mUnits = jQuery.extend({}, mExistingUnits, mUnits);
}
this.setCustomUnits(mUnits);
return this;
} | javascript | function (mUnits) {
// add custom units, or remove the existing ones if none are given
var mExistingUnits = this.getCustomUnits();
if (mExistingUnits){
mUnits = jQuery.extend({}, mExistingUnits, mUnits);
}
this.setCustomUnits(mUnits);
return this;
} | [
"function",
"(",
"mUnits",
")",
"{",
"// add custom units, or remove the existing ones if none are given",
"var",
"mExistingUnits",
"=",
"this",
".",
"getCustomUnits",
"(",
")",
";",
"if",
"(",
"mExistingUnits",
")",
"{",
"mUnits",
"=",
"jQuery",
".",
"extend",
"(",... | Adds custom units.
Similar to {@link sap.ui.core.Configuration#setCustomUnits} but instead of setting the custom units, it will add additional ones.
@param mUnits {object} custom unit object which replaces the current custom unit definition. Call with <code>null</code> to delete custom units.
@return {sap.ui.core.Confi... | [
"Adds",
"custom",
"units",
".",
"Similar",
"to",
"{"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Configuration.js#L1759-L1767 | train | Adds custom units to the current unit list | [
30522,
3853,
1006,
14163,
3490,
3215,
1007,
1063,
1013,
1013,
5587,
7661,
3197,
1010,
2030,
6366,
1996,
4493,
3924,
2065,
3904,
2024,
2445,
13075,
2033,
9048,
16643,
3070,
19496,
3215,
1027,
2023,
1012,
2131,
7874,
20389,
19496,
3215,
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 | lib/jsdoc/transform-apijson-for-sdk.js | transformer | function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles, options) {
const fs = options && options.fs || require("fs");
const returnOutputFiles = options && !!options.returnOutputFiles;
log.info("Transform API index files for sap.ui.documentation");
log.info(" original file: " + sInputFile)... | javascript | function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles, options) {
const fs = options && options.fs || require("fs");
const returnOutputFiles = options && !!options.returnOutputFiles;
log.info("Transform API index files for sap.ui.documentation");
log.info(" original file: " + sInputFile)... | [
"function",
"transformer",
"(",
"sInputFile",
",",
"sOutputFile",
",",
"sLibraryFile",
",",
"vDependencyAPIFiles",
",",
"options",
")",
"{",
"const",
"fs",
"=",
"options",
"&&",
"options",
".",
"fs",
"||",
"require",
"(",
"\"fs\"",
")",
";",
"const",
"return... | /*
Transforms the api.json as created by the JSDoc build into a pre-processed api.json file suitable for the SDK.
The pre-processing includes formatting of type references, rewriting of links and other time consuming calculations.
@param {string} sInputFile Path of the original api.json file that should be transforme... | [
"/",
"*",
"Transforms",
"the",
"api",
".",
"json",
"as",
"created",
"by",
"the",
"JSDoc",
"build",
"into",
"a",
"pre",
"-",
"processed",
"api",
".",
"json",
"file",
"suitable",
"for",
"the",
"SDK",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/transform-apijson-for-sdk.js#L40-L1977 | train | Transforms the api. json file for sap. ui. documentation. | [
30522,
3853,
10938,
2121,
1006,
8254,
18780,
8873,
2571,
1010,
2061,
4904,
18780,
8873,
2571,
1010,
22889,
12322,
19848,
2100,
8873,
2571,
1010,
1058,
3207,
11837,
4181,
5666,
9331,
10128,
9463,
2015,
1010,
7047,
1007,
1063,
9530,
3367,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Tools.controller.js | function () {
BaseController.prototype.onInit.call(this);
// manually call the handler once at startup as device API won't do this for us
this._onOrientationChange({
landscape: Device.orientation.landscape
});
this.getRouter().getRoute("tools").attachPatternMatched(this._onMatched, this);
} | javascript | function () {
BaseController.prototype.onInit.call(this);
// manually call the handler once at startup as device API won't do this for us
this._onOrientationChange({
landscape: Device.orientation.landscape
});
this.getRouter().getRoute("tools").attachPatternMatched(this._onMatched, this);
} | [
"function",
"(",
")",
"{",
"BaseController",
".",
"prototype",
".",
"onInit",
".",
"call",
"(",
"this",
")",
";",
"// manually call the handler once at startup as device API won't do this for us",
"this",
".",
"_onOrientationChange",
"(",
"{",
"landscape",
":",
"Device"... | /* =========================================================== /* lifecycle methods /* ===========================================================
Called when the controller is instantiated.
@public | [
"/",
"*",
"===========================================================",
"/",
"*",
"lifecycle",
"methods",
"/",
"*",
"===========================================================",
"Called",
"when",
"the",
"controller",
"is",
"instantiated",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/Tools.controller.js#L23-L32 | train | This controller is called when the device is initialized | [
30522,
3853,
1006,
1007,
1063,
2918,
8663,
13181,
10820,
1012,
8773,
1012,
2006,
5498,
2102,
1012,
2655,
1006,
2023,
1007,
1025,
1013,
1013,
21118,
2655,
1996,
28213,
2320,
2012,
22752,
2004,
5080,
17928,
2180,
1005,
1056,
2079,
2023,
2005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... | |
moment/luxon | src/interval.js | validateStartEnd | function validateStartEnd(start, end) {
if (!start || !start.isValid) {
return new Invalid("missing or invalid start");
} else if (!end || !end.isValid) {
return new Invalid("missing or invalid end");
} else if (end < start) {
return new Invalid(
"end before start",
`The end of an interval... | javascript | function validateStartEnd(start, end) {
if (!start || !start.isValid) {
return new Invalid("missing or invalid start");
} else if (!end || !end.isValid) {
return new Invalid("missing or invalid end");
} else if (end < start) {
return new Invalid(
"end before start",
`The end of an interval... | [
"function",
"validateStartEnd",
"(",
"start",
",",
"end",
")",
"{",
"if",
"(",
"!",
"start",
"||",
"!",
"start",
".",
"isValid",
")",
"{",
"return",
"new",
"Invalid",
"(",
"\"missing or invalid start\"",
")",
";",
"}",
"else",
"if",
"(",
"!",
"end",
"|... | checks if the start is equal to or before the end | [
"checks",
"if",
"the",
"start",
"is",
"equal",
"to",
"or",
"before",
"the",
"end"
] | 236f2badea297ee73421aa39a83e06177c1be6d0 | https://github.com/moment/luxon/blob/236f2badea297ee73421aa39a83e06177c1be6d0/src/interval.js#L10-L23 | train | Validate start and end | [
30522,
3853,
9398,
8520,
7559,
6528,
2094,
1006,
2707,
1010,
2203,
1007,
1063,
2065,
1006,
999,
2707,
1064,
1064,
999,
2707,
1012,
2003,
10175,
3593,
1007,
1063,
2709,
2047,
19528,
1006,
1000,
4394,
2030,
19528,
2707,
1000,
1007,
1025,
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... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/dom-utils.js | DOMWalker_getNode | function DOMWalker_getNode(idSet) {
var doc = this._controller.window.document;
// QuerySelector seems to be unusuale for id's in this case:
// https://developer.mozilla.org/En/Code_snippets/QuerySelector
switch (idSet.getBy) {
case DOMWalker.GET_BY_ID:
return doc.getElementById(idSet[idS... | javascript | function DOMWalker_getNode(idSet) {
var doc = this._controller.window.document;
// QuerySelector seems to be unusuale for id's in this case:
// https://developer.mozilla.org/En/Code_snippets/QuerySelector
switch (idSet.getBy) {
case DOMWalker.GET_BY_ID:
return doc.getElementById(idSet[idS... | [
"function",
"DOMWalker_getNode",
"(",
"idSet",
")",
"{",
"var",
"doc",
"=",
"this",
".",
"_controller",
".",
"window",
".",
"document",
";",
"// QuerySelector seems to be unusuale for id's in this case:",
"// https://developer.mozilla.org/En/Code_snippets/QuerySelector",
"switc... | Retrieves and returns a wanted node based on the provided identification
set.
@param {array of objects} idSet
Contains informations on the elements to open while
Object-elements: getBy - attribute-name of the attribute
containing the identification
information for the opener-element
subContent - array of i... | [
"Retrieves",
"and",
"returns",
"a",
"wanted",
"node",
"based",
"on",
"the",
"provided",
"identification",
"set",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/dom-utils.js#L213-L226 | train | Get node from idSet | [
30522,
3853,
14383,
26965,
1035,
2131,
3630,
3207,
1006,
8909,
13462,
1007,
1063,
13075,
9986,
1027,
2023,
1012,
1035,
11486,
1012,
3332,
1012,
6254,
1025,
1013,
1013,
23032,
11246,
22471,
2953,
3849,
2000,
2022,
5866,
2063,
2005,
8909,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/language/CodeInspection.js | updateListeners | function updateListeners() {
if (_enabled) {
// register our event listeners
MainViewManager
.on("currentFileChange.codeInspection", function () {
run();
});
DocumentManager
.on("currentDocumentLanguageChange... | javascript | function updateListeners() {
if (_enabled) {
// register our event listeners
MainViewManager
.on("currentFileChange.codeInspection", function () {
run();
});
DocumentManager
.on("currentDocumentLanguageChange... | [
"function",
"updateListeners",
"(",
")",
"{",
"if",
"(",
"_enabled",
")",
"{",
"// register our event listeners",
"MainViewManager",
".",
"on",
"(",
"\"currentFileChange.codeInspection\"",
",",
"function",
"(",
")",
"{",
"run",
"(",
")",
";",
"}",
")",
";",
"D... | Update DocumentManager listeners. | [
"Update",
"DocumentManager",
"listeners",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L533-L553 | train | updateListeners - update listeners | [
30522,
3853,
10651,
9863,
24454,
2015,
1006,
1007,
1063,
2065,
1006,
1035,
9124,
1007,
1063,
1013,
1013,
4236,
2256,
2724,
13810,
2364,
8584,
24805,
4590,
1012,
2006,
1006,
1000,
2783,
8873,
2571,
22305,
2063,
1012,
3642,
7076,
5051,
7542,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Entity.controller.js | function () {
this.router = this.getRouter();
this.router.getRoute("entity").attachPatternMatched(this.onRouteMatched, this);
this._oObjectPage = this.byId("ObjectPageLayout");
this.getView().setModel(new JSONModel());
} | javascript | function () {
this.router = this.getRouter();
this.router.getRoute("entity").attachPatternMatched(this.onRouteMatched, this);
this._oObjectPage = this.byId("ObjectPageLayout");
this.getView().setModel(new JSONModel());
} | [
"function",
"(",
")",
"{",
"this",
".",
"router",
"=",
"this",
".",
"getRouter",
"(",
")",
";",
"this",
".",
"router",
".",
"getRoute",
"(",
"\"entity\"",
")",
".",
"attachPatternMatched",
"(",
"this",
".",
"onRouteMatched",
",",
"this",
")",
";",
"thi... | /* =========================================================== /* lifecycle methods /* =========================================================== | [
"/",
"*",
"===========================================================",
"/",
"*",
"lifecycle",
"methods",
"/",
"*",
"==========================================================="
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/Entity.controller.js#L29-L37 | train | Initializes the layout and the model | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
2799,
2099,
1027,
2023,
1012,
2131,
22494,
3334,
1006,
1007,
1025,
2023,
1012,
2799,
2099,
1012,
2131,
22494,
2618,
1006,
1000,
9178,
1000,
1007,
1012,
22476,
4502,
12079,
2078,
18900,
7690,
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/extensions/default/JavaScriptRefactoring/WrapSelection.js | createGettersAndSetters | function createGettersAndSetters() {
var editor = EditorManager.getActiveEditor();
if (!editor) {
return;
}
initializeRefactoringSession(editor);
var startIndex = current.startIndex,
endIndex = current.endIndex,
selectedText = current.selected... | javascript | function createGettersAndSetters() {
var editor = EditorManager.getActiveEditor();
if (!editor) {
return;
}
initializeRefactoringSession(editor);
var startIndex = current.startIndex,
endIndex = current.endIndex,
selectedText = current.selected... | [
"function",
"createGettersAndSetters",
"(",
")",
"{",
"var",
"editor",
"=",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
";",
"if",
"(",
"!",
"editor",
")",
"{",
"return",
";",
"}",
"initializeRefactoringSession",
"(",
"editor",
")",
";",
"var",
"start... | Create gtteres and setters for a property | [
"Create",
"gtteres",
"and",
"setters",
"for",
"a",
"property"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/WrapSelection.js#L230-L327 | train | Create getters and setters | [
30522,
3853,
3443,
18150,
7747,
29560,
7585,
2869,
1006,
1007,
1063,
13075,
3559,
1027,
3559,
24805,
4590,
1012,
2131,
19620,
2098,
15660,
1006,
1007,
1025,
2065,
1006,
999,
3559,
1007,
1063,
2709,
1025,
1065,
3988,
17629,
12879,
18908,
287... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | notifyPathNameChanged | function notifyPathNameChanged(oldName, newName) {
// Notify all open documents
_.forEach(_openDocuments, function (doc) {
// TODO: Only notify affected documents? For now _notifyFilePathChange
// just updates the language if the extension changed, so it's fine
// to ... | javascript | function notifyPathNameChanged(oldName, newName) {
// Notify all open documents
_.forEach(_openDocuments, function (doc) {
// TODO: Only notify affected documents? For now _notifyFilePathChange
// just updates the language if the extension changed, so it's fine
// to ... | [
"function",
"notifyPathNameChanged",
"(",
"oldName",
",",
"newName",
")",
"{",
"// Notify all open documents",
"_",
".",
"forEach",
"(",
"_openDocuments",
",",
"function",
"(",
"doc",
")",
"{",
"// TODO: Only notify affected documents? For now _notifyFilePathChange",
"// ju... | Called after a file or folder name has changed. This function is responsible
for updating underlying model data and notifying all views of the change.
@param {string} oldName The old name of the file/folder
@param {string} newName The new name of the file/folder | [
"Called",
"after",
"a",
"file",
"or",
"folder",
"name",
"has",
"changed",
".",
"This",
"function",
"is",
"responsible",
"for",
"updating",
"underlying",
"model",
"data",
"and",
"notifying",
"all",
"views",
"of",
"the",
"change",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L531-L542 | train | Notify all open documents that the file path has changed. | [
30522,
3853,
2025,
8757,
15069,
18442,
22305,
2098,
1006,
2214,
18442,
1010,
2047,
18442,
1007,
1063,
1013,
1013,
2025,
8757,
2035,
2330,
5491,
1035,
1012,
18921,
6776,
1006,
1035,
2330,
3527,
24894,
11187,
1010,
3853,
1006,
9986,
1007,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
ColorlibHQ/AdminLTE | bower_components/jquery-sparkline/src/chart-bar.js | function (valuenum, highlight) {
var vals = this.values[valuenum],
options = this.options,
xaxisOffset = this.xaxisOffset,
result = [],
range = this.range,
stacked = this.stacked,
target = this.target,
... | javascript | function (valuenum, highlight) {
var vals = this.values[valuenum],
options = this.options,
xaxisOffset = this.xaxisOffset,
result = [],
range = this.range,
stacked = this.stacked,
target = this.target,
... | [
"function",
"(",
"valuenum",
",",
"highlight",
")",
"{",
"var",
"vals",
"=",
"this",
".",
"values",
"[",
"valuenum",
"]",
",",
"options",
"=",
"this",
".",
"options",
",",
"xaxisOffset",
"=",
"this",
".",
"xaxisOffset",
",",
"result",
"=",
"[",
"]",
... | Render bar(s) for a region | [
"Render",
"bar",
"(",
"s",
")",
"for",
"a",
"region"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/jquery-sparkline/src/chart-bar.js#L193-L254 | train | draws a single value | [
30522,
3853,
1006,
3643,
19172,
1010,
12944,
1007,
1063,
13075,
11748,
2015,
1027,
2023,
30524,
1060,
8528,
19565,
21807,
3388,
1027,
2023,
1012,
1060,
8528,
19565,
21807,
3388,
1010,
2765,
1027,
1031,
1033,
1010,
2846,
1027,
2023,
1012,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... | |
laurent22/joplin | Clipper/joplin-webclipper/content_scripts/JSDOMParser.js | function (node) {
var name = "";
var n = this.html.indexOf("=", this.currentChar);
if (n === -1) {
this.currentChar = this.html.length;
} else {
// Read until a '=' character is hit; this will be the attribute key
name = this.html.substring(this.currentChar, n);
... | javascript | function (node) {
var name = "";
var n = this.html.indexOf("=", this.currentChar);
if (n === -1) {
this.currentChar = this.html.length;
} else {
// Read until a '=' character is hit; this will be the attribute key
name = this.html.substring(this.currentChar, n);
... | [
"function",
"(",
"node",
")",
"{",
"var",
"name",
"=",
"\"\"",
";",
"var",
"n",
"=",
"this",
".",
"html",
".",
"indexOf",
"(",
"\"=\"",
",",
"this",
".",
"currentChar",
")",
";",
"if",
"(",
"n",
"===",
"-",
"1",
")",
"{",
"this",
".",
"currentC... | Called when parsing a node. This finds the next name/value attribute
pair and adds the result to the attributes list. | [
"Called",
"when",
"parsing",
"a",
"node",
".",
"This",
"finds",
"the",
"next",
"name",
"/",
"value",
"attribute",
"pair",
"and",
"adds",
"the",
"result",
"to",
"the",
"attributes",
"list",
"."
] | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/Clipper/joplin-webclipper/content_scripts/JSDOMParser.js#L903-L931 | train | Read an attribute | [
30522,
3853,
1006,
13045,
1007,
1063,
13075,
2171,
1027,
1000,
1000,
1025,
13075,
1050,
1027,
2023,
1012,
16129,
1012,
5950,
11253,
1006,
1000,
1027,
1000,
1010,
2023,
1012,
2783,
7507,
2099,
1007,
1025,
2065,
1006,
1050,
1027,
1027,
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... | |
GitbookIO/gitbook | lib/output/website/copyPluginAssets.js | copyAssets | function copyAssets(output, plugin) {
var logger = output.getLogger();
var pluginRoot = plugin.getPath();
var options = output.getOptions();
var outputRoot = options.get('root');
var assetOutputFolder = path.join(outputRoot, 'gitbook');
var prefix = options.get('prefix');
var assetFolder =... | javascript | function copyAssets(output, plugin) {
var logger = output.getLogger();
var pluginRoot = plugin.getPath();
var options = output.getOptions();
var outputRoot = options.get('root');
var assetOutputFolder = path.join(outputRoot, 'gitbook');
var prefix = options.get('prefix');
var assetFolder =... | [
"function",
"copyAssets",
"(",
"output",
",",
"plugin",
")",
"{",
"var",
"logger",
"=",
"output",
".",
"getLogger",
"(",
")",
";",
"var",
"pluginRoot",
"=",
"plugin",
".",
"getPath",
"(",
")",
";",
"var",
"options",
"=",
"output",
".",
"getOptions",
"(... | Copy assets from a plugin
@param {Plugin}
@return {Promise} | [
"Copy",
"assets",
"from",
"a",
"plugin"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/website/copyPluginAssets.js#L45-L70 | train | Copy assets from the plugin to the output folder | [
30522,
3853,
6100,
27241,
3215,
1006,
6434,
1010,
13354,
2378,
1007,
1063,
13075,
8833,
4590,
1027,
6434,
1012,
2131,
21197,
4590,
1006,
1007,
1025,
13075,
13354,
2378,
3217,
4140,
1027,
13354,
2378,
1012,
2131,
15069,
1006,
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... |
google/closure-library | closure/goog/dom/uri.js | normalizeUri | function normalizeUri(uri) {
const anchor = createElement(TagName.A);
// This is safe even though the URL might be untrustworthy.
// The SafeURL is only used to set the href of an HTMLAnchorElement
// that is never added to the DOM. Therefore, the user cannot navigate
// to this URL.
const safeUrl =
u... | javascript | function normalizeUri(uri) {
const anchor = createElement(TagName.A);
// This is safe even though the URL might be untrustworthy.
// The SafeURL is only used to set the href of an HTMLAnchorElement
// that is never added to the DOM. Therefore, the user cannot navigate
// to this URL.
const safeUrl =
u... | [
"function",
"normalizeUri",
"(",
"uri",
")",
"{",
"const",
"anchor",
"=",
"createElement",
"(",
"TagName",
".",
"A",
")",
";",
"// This is safe even though the URL might be untrustworthy.",
"// The SafeURL is only used to set the href of an HTMLAnchorElement",
"// that is never a... | Normalizes a URL by assigning it to an anchor element and reading back href.
This converts relative URLs to absolute, and cleans up whitespace.
@param {string} uri A string containing a URI.
@return {string} Normalized, absolute form of uri. | [
"Normalizes",
"a",
"URL",
"by",
"assigning",
"it",
"to",
"an",
"anchor",
"element",
"and",
"reading",
"back",
"href",
"."
] | 97390e9ca4483cebb9628e06026139fbb3023d65 | https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/closure/goog/dom/uri.js#L30-L41 | train | Normalize a URI. | [
30522,
3853,
3671,
4697,
9496,
1006,
24471,
2072,
1007,
1063,
9530,
3367,
8133,
1027,
3443,
12260,
3672,
1006,
6415,
18442,
1012,
1037,
1007,
1025,
1013,
1013,
2023,
2003,
3647,
2130,
2295,
1996,
24471,
2140,
2453,
2022,
4895,
24669,
13966,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
TryGhost/Ghost | core/server/data/importer/index.js | function (file) {
var self = this;
return this.extractZip(file.path).then(function (zipDirectory) {
var ops = [],
importData = {},
baseDir;
self.isValidZip(zipDirectory);
baseDir = self.getBaseDirectory(zipDirectory);
_.e... | javascript | function (file) {
var self = this;
return this.extractZip(file.path).then(function (zipDirectory) {
var ops = [],
importData = {},
baseDir;
self.isValidZip(zipDirectory);
baseDir = self.getBaseDirectory(zipDirectory);
_.e... | [
"function",
"(",
"file",
")",
"{",
"var",
"self",
"=",
"this",
";",
"return",
"this",
".",
"extractZip",
"(",
"file",
".",
"path",
")",
".",
"then",
"(",
"function",
"(",
"zipDirectory",
")",
"{",
"var",
"ops",
"=",
"[",
"]",
",",
"importData",
"="... | Process Zip
Takes a reference to a zip file, extracts it, sends any relevant files from inside to the right handler, and
returns an object in the importData format: {data: {}, images: []}
The data key contains JSON representing any data that should be imported
The image key contains references to images that will be st... | [
"Process",
"Zip",
"Takes",
"a",
"reference",
"to",
"a",
"zip",
"file",
"extracts",
"it",
"sends",
"any",
"relevant",
"files",
"from",
"inside",
"to",
"the",
"right",
"handler",
"and",
"returns",
"an",
"object",
"in",
"the",
"importData",
"format",
":",
"{"... | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/data/importer/index.js#L226-L266 | train | Load a file from a zip | [
30522,
3853,
1006,
5371,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2709,
2023,
1012,
14817,
5831,
2361,
1006,
5371,
1012,
4130,
1007,
1012,
2059,
1006,
3853,
1006,
14101,
4305,
2890,
16761,
2100,
1007,
1063,
13075,
23092,
1027,
1031,
1033,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | MdTooltipRegistry | function MdTooltipRegistry() {
var listeners = {};
var ngWindow = angular.element(window);
return {
register: register,
deregister: deregister
};
/**
* Global event handler that dispatches the registered handlers in the
* service.
* @param {!Event} event Event object passed in by the browse... | javascript | function MdTooltipRegistry() {
var listeners = {};
var ngWindow = angular.element(window);
return {
register: register,
deregister: deregister
};
/**
* Global event handler that dispatches the registered handlers in the
* service.
* @param {!Event} event Event object passed in by the browse... | [
"function",
"MdTooltipRegistry",
"(",
")",
"{",
"var",
"listeners",
"=",
"{",
"}",
";",
"var",
"ngWindow",
"=",
"angular",
".",
"element",
"(",
"window",
")",
";",
"return",
"{",
"register",
":",
"register",
",",
"deregister",
":",
"deregister",
"}",
";"... | Service that is used to reduce the amount of listeners that are being
registered on the `window` by the tooltip component. Works by collecting
the individual event handlers and dispatching them from a global handler.
@ngInject | [
"Service",
"that",
"is",
"used",
"to",
"reduce",
"the",
"amount",
"of",
"listeners",
"that",
"are",
"being",
"registered",
"on",
"the",
"window",
"by",
"the",
"tooltip",
"component",
".",
"Works",
"by",
"collecting",
"the",
"individual",
"event",
"handlers",
... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tooltip/tooltip.js#L423-L483 | train | The tooltip registry. | [
30522,
3853,
9108,
3406,
27914,
11514,
2890,
24063,
2854,
1006,
1007,
1063,
13075,
13810,
1027,
1063,
1065,
1025,
13075,
12835,
11101,
5004,
1027,
16108,
1012,
5783,
1006,
3332,
1007,
1025,
2709,
1063,
4236,
1024,
4236,
1010,
4315,
13910,
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... |
expressjs/express | lib/response.js | stringify | function stringify (value, replacer, spaces, escape) {
// v8 checks arguments.length for optimizing simple call
// https://bugs.chromium.org/p/v8/issues/detail?id=4730
var json = replacer || spaces
? JSON.stringify(value, replacer, spaces)
: JSON.stringify(value);
if (escape) {
json = json.replace(... | javascript | function stringify (value, replacer, spaces, escape) {
// v8 checks arguments.length for optimizing simple call
// https://bugs.chromium.org/p/v8/issues/detail?id=4730
var json = replacer || spaces
? JSON.stringify(value, replacer, spaces)
: JSON.stringify(value);
if (escape) {
json = json.replace(... | [
"function",
"stringify",
"(",
"value",
",",
"replacer",
",",
"spaces",
",",
"escape",
")",
"{",
"// v8 checks arguments.length for optimizing simple call",
"// https://bugs.chromium.org/p/v8/issues/detail?id=4730",
"var",
"json",
"=",
"replacer",
"||",
"spaces",
"?",
"JSON"... | Stringify JSON, like JSON.stringify, but v8 optimized, with the
ability to escape characters that can trigger HTML sniffing.
@param {*} value
@param {function} replaces
@param {number} spaces
@param {boolean} escape
@returns {string}
@private | [
"Stringify",
"JSON",
"like",
"JSON",
".",
"stringify",
"but",
"v8",
"optimized",
"with",
"the",
"ability",
"to",
"escape",
"characters",
"that",
"can",
"trigger",
"HTML",
"sniffing",
"."
] | dc538f6e810bd462c98ee7e6aae24c64d4b1da93 | https://github.com/expressjs/express/blob/dc538f6e810bd462c98ee7e6aae24c64d4b1da93/lib/response.js#L1114-L1137 | train | Stringify value | [
30522,
3853,
5164,
8757,
1006,
3643,
1010,
5672,
2099,
1010,
7258,
1010,
4019,
1007,
1063,
1013,
1013,
15754,
30524,
1029,
8909,
1027,
4700,
14142,
13075,
1046,
3385,
1027,
5672,
2099,
1064,
1064,
7258,
1029,
1046,
3385,
1012,
5164,
8757,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
aws/aws-sdk-js | lib/publisher/configuration.js | resolveMonitoringConfig | function resolveMonitoringConfig() {
var config = {
port: undefined,
clientId: undefined,
enabled: undefined,
};
if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config);
return toJSType(config);
} | javascript | function resolveMonitoringConfig() {
var config = {
port: undefined,
clientId: undefined,
enabled: undefined,
};
if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config);
return toJSType(config);
} | [
"function",
"resolveMonitoringConfig",
"(",
")",
"{",
"var",
"config",
"=",
"{",
"port",
":",
"undefined",
",",
"clientId",
":",
"undefined",
",",
"enabled",
":",
"undefined",
",",
"}",
";",
"if",
"(",
"fromEnvironment",
"(",
"config",
")",
"||",
"fromConf... | Resolve client-side monitoring configuration from either environmental variables
or shared config file. Configurations from environmental variables have higher priority
than those from shared config file. The resolver will try to read the shared config file
no matter whether the AWS_SDK_LOAD_CONFIG variable is set.
@ap... | [
"Resolve",
"client",
"-",
"side",
"monitoring",
"configuration",
"from",
"either",
"environmental",
"variables",
"or",
"shared",
"config",
"file",
".",
"Configurations",
"from",
"environmental",
"variables",
"have",
"higher",
"priority",
"than",
"those",
"from",
"sh... | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/publisher/configuration.js#L10-L18 | train | Resolves the monitoring configuration from the environment or the config file. | [
30522,
3853,
10663,
8202,
15660,
2075,
8663,
8873,
2290,
1006,
1007,
1063,
13075,
9530,
8873,
2290,
1027,
1063,
3417,
1024,
6151,
28344,
1010,
7396,
3593,
1024,
6151,
28344,
1010,
9124,
1024,
6151,
28344,
1010,
1065,
1025,
2065,
1006,
2013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
moleculerjs/moleculer | src/serializers/proto/packets.proto.js | PacketDisconnect | function PacketDisconnect(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | javascript | function PacketDisconnect(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | [
"function",
"PacketDisconnect",
"(",
"properties",
")",
"{",
"if",
"(",
"properties",
")",
"for",
"(",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"properties",
")",
",",
"i",
"=",
"0",
";",
"i",
"<",
"keys",
".",
"length",
";",
"++",
"i",
")",... | Properties of a PacketDisconnect.
@memberof packets
@interface IPacketDisconnect
@property {string} ver PacketDisconnect ver
@property {string} sender PacketDisconnect sender
Constructs a new PacketDisconnect.
@memberof packets
@classdesc Represents a PacketDisconnect.
@implements IPacketDisconnect
@constructor
@para... | [
"Properties",
"of",
"a",
"PacketDisconnect",
"."
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L1952-L1957 | train | Properties of a PacketDisconnect. | [
30522,
3853,
14771,
10521,
8663,
2638,
6593,
1006,
5144,
1007,
1063,
2065,
1006,
5144,
1007,
2005,
1006,
13075,
6309,
1027,
4874,
1012,
6309,
1006,
5144,
1007,
1010,
1045,
1027,
1014,
1025,
1045,
1026,
6309,
1012,
3091,
1025,
1009,
1009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
twbs/bootstrap | dist/js/bootstrap.esm.js | getUID | function getUID(prefix) {
do {
// eslint-disable-next-line no-bitwise
prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
} while (document.getElementById(prefix));
return prefix;
} | javascript | function getUID(prefix) {
do {
// eslint-disable-next-line no-bitwise
prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
} while (document.getElementById(prefix));
return prefix;
} | [
"function",
"getUID",
"(",
"prefix",
")",
"{",
"do",
"{",
"// eslint-disable-next-line no-bitwise",
"prefix",
"+=",
"~",
"~",
"(",
"Math",
".",
"random",
"(",
")",
"*",
"MAX_UID",
")",
";",
"// \"~~\" acts like a faster Math.floor() here",
"}",
"while",
"(",
"do... | --------------------------------------------------------------------------
Public Util Api
-------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------",
"Public",
"Util",
"Api",
"--------------------------------------------------------------------------"
] | d806e874b4b9c4a3bb2d0715415aebbad78466a2 | https://github.com/twbs/bootstrap/blob/d806e874b4b9c4a3bb2d0715415aebbad78466a2/dist/js/bootstrap.esm.js#L86-L93 | train | Returns a unique ID | [
30522,
3853,
2131,
21272,
1006,
17576,
1007,
1063,
2079,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2279,
1011,
2240,
2053,
1011,
2978,
14244,
17576,
1009,
1027,
1066,
1066,
1006,
8785,
1012,
6721,
1006,
1007,
1008,
4098,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.