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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tgriesser/knex | src/query/joinclause.js | JoinClause | function JoinClause(table, type, schema) {
this.schema = schema;
this.table = table;
this.joinType = type;
this.and = this;
this.clauses = [];
} | javascript | function JoinClause(table, type, schema) {
this.schema = schema;
this.table = table;
this.joinType = type;
this.and = this;
this.clauses = [];
} | [
"function",
"JoinClause",
"(",
"table",
",",
"type",
",",
"schema",
")",
"{",
"this",
".",
"schema",
"=",
"schema",
";",
"this",
".",
"table",
"=",
"table",
";",
"this",
".",
"joinType",
"=",
"type",
";",
"this",
".",
"and",
"=",
"this",
";",
"this... | The "JoinClause" is an object holding any necessary info about a join, including the type, and any associated tables & columns being joined. | [
"The",
"JoinClause",
"is",
"an",
"object",
"holding",
"any",
"necessary",
"info",
"about",
"a",
"join",
"including",
"the",
"type",
"and",
"any",
"associated",
"tables",
"&",
"columns",
"being",
"joined",
"."
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/query/joinclause.js#L9-L15 | train | A join clause | [
30522,
3853,
3693,
20464,
20559,
2063,
1006,
2795,
1010,
2828,
1010,
8040,
28433,
1007,
1063,
2023,
1012,
8040,
28433,
1027,
8040,
28433,
1025,
2023,
1012,
2795,
1027,
2795,
1025,
2023,
1012,
4101,
18863,
1027,
2828,
1025,
2023,
1012,
1998,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/modifiers/summary/removeArticle.js | removeArticle | function removeArticle(summary, level) {
// Coerce to level
level = is.string(level)? level : level.getLevel();
var parent = summary.getParent(level);
var articles = parent.getArticles();
// Find the index to remove
var index = articles.findIndex(function(art) {
return art.getLevel() =... | javascript | function removeArticle(summary, level) {
// Coerce to level
level = is.string(level)? level : level.getLevel();
var parent = summary.getParent(level);
var articles = parent.getArticles();
// Find the index to remove
var index = articles.findIndex(function(art) {
return art.getLevel() =... | [
"function",
"removeArticle",
"(",
"summary",
",",
"level",
")",
"{",
"// Coerce to level",
"level",
"=",
"is",
".",
"string",
"(",
"level",
")",
"?",
"level",
":",
"level",
".",
"getLevel",
"(",
")",
";",
"var",
"parent",
"=",
"summary",
".",
"getParent"... | Remove an article from a level.
@param {Summary} summary
@param {String|SummaryArticle} level: level to remove
@return {Summary} | [
"Remove",
"an",
"article",
"from",
"a",
"level",
"."
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/modifiers/summary/removeArticle.js#L12-L35 | train | Remove an article from a summary | [
30522,
3853,
6366,
8445,
25128,
1006,
12654,
1010,
2504,
1007,
1063,
1013,
1013,
24873,
19170,
2000,
2504,
2504,
1027,
2003,
1012,
5164,
1006,
2504,
1007,
1029,
2504,
1024,
2504,
1012,
2131,
20414,
2884,
1006,
1007,
1025,
13075,
6687,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/view/Pane.js | _ensurePaneIsFocused | function _ensurePaneIsFocused(paneId) {
var pane = MainViewManager._getPane(paneId);
// Defer the focusing until other focus events have occurred.
setTimeout(function () {
// Focus has most likely changed: give it back to the given pane.
pane.focus();
this._l... | javascript | function _ensurePaneIsFocused(paneId) {
var pane = MainViewManager._getPane(paneId);
// Defer the focusing until other focus events have occurred.
setTimeout(function () {
// Focus has most likely changed: give it back to the given pane.
pane.focus();
this._l... | [
"function",
"_ensurePaneIsFocused",
"(",
"paneId",
")",
"{",
"var",
"pane",
"=",
"MainViewManager",
".",
"_getPane",
"(",
"paneId",
")",
";",
"// Defer the focusing until other focus events have occurred.",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"// Focus has mos... | Ensures that the given pane is focused after other focus related events occur
@params {string} paneId - paneId of the pane to focus
@private | [
"Ensures",
"that",
"the",
"given",
"pane",
"is",
"focused",
"after",
"other",
"focus",
"related",
"events",
"occur"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/Pane.js#L216-L226 | train | Ensure that the pane is focused. | [
30522,
3853,
1035,
5676,
9739,
17580,
14876,
7874,
2098,
1006,
6090,
7416,
2094,
1007,
1063,
13075,
6090,
2063,
1027,
2364,
8584,
24805,
4590,
1012,
1035,
2131,
9739,
2063,
1006,
6090,
7416,
2094,
1007,
1025,
1013,
1013,
13366,
2121,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/arrow-spacing.js | spaces | function spaces(node) {
const tokens = getTokens(node);
const countSpace = countSpaces(tokens);
if (rule.before) {
// should be space(s) before arrow
if (countSpace.before === 0) {
context.report({
node: to... | javascript | function spaces(node) {
const tokens = getTokens(node);
const countSpace = countSpaces(tokens);
if (rule.before) {
// should be space(s) before arrow
if (countSpace.before === 0) {
context.report({
node: to... | [
"function",
"spaces",
"(",
"node",
")",
"{",
"const",
"tokens",
"=",
"getTokens",
"(",
"node",
")",
";",
"const",
"countSpace",
"=",
"countSpaces",
"(",
"tokens",
")",
";",
"if",
"(",
"rule",
".",
"before",
")",
"{",
"// should be space(s) before arrow",
"... | Determines whether space(s) before after arrow(`=>`) is satisfy rule.
if before/after value is `true`, there should be space(s).
if before/after value is `false`, there should be no space.
@param {ASTNode} node The arrow function node.
@returns {void} | [
"Determines",
"whether",
"space",
"(",
"s",
")",
"before",
"after",
"arrow",
"(",
"=",
">",
")",
"is",
"satisfy",
"rule",
".",
"if",
"before",
"/",
"after",
"value",
"is",
"true",
"there",
"should",
"be",
"space",
"(",
"s",
")",
".",
"if",
"before",
... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/arrow-spacing.js#L100-L155 | train | Check if node has spaces | [
30522,
3853,
7258,
1006,
13045,
1007,
1063,
9530,
3367,
19204,
2015,
1027,
2131,
18715,
6132,
1006,
13045,
1007,
1025,
9530,
3367,
9294,
15327,
1027,
9294,
15327,
2015,
1006,
19204,
2015,
1007,
1025,
2065,
1006,
3627,
1012,
2077,
1007,
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... |
adobe/brackets | src/JSUtils/node/TernNodeDomain.js | getFile | function getFile(name, next) {
// save the callback
fileCallBacks[name] = next;
setImmediate(function () {
try {
ExtractContent.extractContent(name, handleGetFile, _requestFileContent);
} catch (error) {
console.log(error);
}
});
} | javascript | function getFile(name, next) {
// save the callback
fileCallBacks[name] = next;
setImmediate(function () {
try {
ExtractContent.extractContent(name, handleGetFile, _requestFileContent);
} catch (error) {
console.log(error);
}
});
} | [
"function",
"getFile",
"(",
"name",
",",
"next",
")",
"{",
"// save the callback",
"fileCallBacks",
"[",
"name",
"]",
"=",
"next",
";",
"setImmediate",
"(",
"function",
"(",
")",
"{",
"try",
"{",
"ExtractContent",
".",
"extractContent",
"(",
"name",
",",
"... | Provide the contents of the requested file to tern
@param {string} name - the name of the file
@param {Function} next - the function to call with the text of the file
once it has been read in. | [
"Provide",
"the",
"contents",
"of",
"the",
"requested",
"file",
"to",
"tern"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L133-L144 | train | get a file from the server | [
30522,
3853,
2131,
8873,
2571,
1006,
2171,
1010,
2279,
1007,
1063,
1013,
1013,
3828,
1996,
2655,
5963,
5371,
9289,
20850,
8684,
2015,
1031,
2171,
1033,
1027,
2279,
1025,
2275,
5714,
16969,
2618,
1006,
3853,
1006,
1007,
1063,
3046,
1063,
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... |
SheetJS/js-xlsx | xlsx.js | parse_HyperlinkString | function parse_HyperlinkString(blob) {
var len = blob.read_shift(4);
var o = len > 0 ? blob.read_shift(len, 'utf16le').replace(chr0, "") : "";
return o;
} | javascript | function parse_HyperlinkString(blob) {
var len = blob.read_shift(4);
var o = len > 0 ? blob.read_shift(len, 'utf16le').replace(chr0, "") : "";
return o;
} | [
"function",
"parse_HyperlinkString",
"(",
"blob",
")",
"{",
"var",
"len",
"=",
"blob",
".",
"read_shift",
"(",
"4",
")",
";",
"var",
"o",
"=",
"len",
">",
"0",
"?",
"blob",
".",
"read_shift",
"(",
"len",
",",
"'utf16le'",
")",
".",
"replace",
"(",
... | /* [MS-OSHARED] 2.3.7.9 HyperlinkString | [
"/",
"*",
"[",
"MS",
"-",
"OSHARED",
"]",
"2",
".",
"3",
".",
"7",
".",
"9",
"HyperlinkString"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L5499-L5503 | train | Parse Hyperlink String | [
30522,
3853,
11968,
3366,
1035,
23760,
13767,
3367,
4892,
1006,
1038,
4135,
2497,
1007,
1063,
13075,
18798,
1027,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1018,
1007,
1025,
13075,
1051,
1027,
18798,
1028,
1014,
1029,
1038,
4135,
2497... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/util/animation/animate.js | function (element, originator) {
var slideTemplate = "translate3d( {centerX}px, {centerY}px, 0 )";
var buildSlide = angular.bind(null, $mdUtil.supplant, slideTemplate);
return buildSlide(self.calculateTransformValues(element, originator));
} | javascript | function (element, originator) {
var slideTemplate = "translate3d( {centerX}px, {centerY}px, 0 )";
var buildSlide = angular.bind(null, $mdUtil.supplant, slideTemplate);
return buildSlide(self.calculateTransformValues(element, originator));
} | [
"function",
"(",
"element",
",",
"originator",
")",
"{",
"var",
"slideTemplate",
"=",
"\"translate3d( {centerX}px, {centerY}px, 0 )\"",
";",
"var",
"buildSlide",
"=",
"angular",
".",
"bind",
"(",
"null",
",",
"$mdUtil",
".",
"supplant",
",",
"slideTemplate",
")",
... | Calculate the slide transform from panel to origin.
NOTE: all values are rounded to the nearest integer | [
"Calculate",
"the",
"slide",
"transform",
"from",
"panel",
"to",
"origin",
".",
"NOTE",
":",
"all",
"values",
"are",
"rounded",
"to",
"the",
"nearest",
"integer"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/animation/animate.js#L154-L159 | train | Calculate the transform values for the slide | [
30522,
3853,
1006,
5783,
1010,
4761,
8844,
1007,
1063,
13075,
7358,
18532,
15725,
1027,
1000,
17637,
29097,
1006,
1063,
2415,
2595,
1065,
1052,
2595,
1010,
1063,
2415,
2100,
1065,
1052,
2595,
1010,
1014,
1007,
1000,
1025,
13075,
16473,
2419... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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(state, x, y)
{
var index = -1;
if (state.absolutePoints.length > 0)
{
var last = state.absolutePoints[0];
var min = null;
for (var i = 1; i < state.absolutePoints.length; i++)
{
var current = state.absolutePoints[i];
var dist = mxUtils.ptSegDistSq(last.x, last.y,
current.... | javascript | function(state, x, y)
{
var index = -1;
if (state.absolutePoints.length > 0)
{
var last = state.absolutePoints[0];
var min = null;
for (var i = 1; i < state.absolutePoints.length; i++)
{
var current = state.absolutePoints[i];
var dist = mxUtils.ptSegDistSq(last.x, last.y,
current.... | [
"function",
"(",
"state",
",",
"x",
",",
"y",
")",
"{",
"var",
"index",
"=",
"-",
"1",
";",
"if",
"(",
"state",
".",
"absolutePoints",
".",
"length",
">",
"0",
")",
"{",
"var",
"last",
"=",
"state",
".",
"absolutePoints",
"[",
"0",
"]",
";",
"v... | Function: findNearestSegment
Finds the index of the nearest segment on the given cell state for
the specified coordinate pair. | [
"Function",
":",
"findNearestSegment"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L4417-L4443 | train | Returns the index of the segment in the state where the segment is closest to the given point | [
30522,
3853,
1006,
2110,
1010,
1060,
1010,
1061,
1007,
1063,
13075,
5950,
1027,
1011,
1015,
1025,
2065,
1006,
2110,
1012,
7619,
26521,
1012,
3091,
1028,
1014,
1007,
1063,
13075,
2197,
1027,
2110,
1012,
7619,
26521,
1031,
1014,
1033,
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... | |
Microsoft/vscode | src/bootstrap-fork.js | safeToArray | function safeToArray(args) {
const seen = [];
const argsArray = [];
let res;
// Massage some arguments with special treatment
if (args.length) {
for (let i = 0; i < args.length; i++) {
// Any argument of type 'undefined' needs to be specially treated because
// JSON.stringify will simply ignore ... | javascript | function safeToArray(args) {
const seen = [];
const argsArray = [];
let res;
// Massage some arguments with special treatment
if (args.length) {
for (let i = 0; i < args.length; i++) {
// Any argument of type 'undefined' needs to be specially treated because
// JSON.stringify will simply ignore ... | [
"function",
"safeToArray",
"(",
"args",
")",
"{",
"const",
"seen",
"=",
"[",
"]",
";",
"const",
"argsArray",
"=",
"[",
"]",
";",
"let",
"res",
";",
"// Massage some arguments with special treatment",
"if",
"(",
"args",
".",
"length",
")",
"{",
"for",
"(",
... | Prevent circular stringify and convert arguments to real array | [
"Prevent",
"circular",
"stringify",
"and",
"convert",
"arguments",
"to",
"real",
"array"
] | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/src/bootstrap-fork.js#L50-L112 | train | Converts an array of arguments to an array of objects. | [
30522,
3853,
3647,
3406,
2906,
9447,
1006,
12098,
5620,
1007,
1063,
9530,
3367,
2464,
1027,
1031,
1033,
1025,
9530,
3367,
12098,
5620,
2906,
9447,
1027,
1031,
1033,
1025,
2292,
24501,
1025,
1013,
1013,
21881,
2070,
9918,
2007,
2569,
3949,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
LLK/scratch-blocks | i18n/js_to_json.js | function (str) {
if (str.indexOf('Blockly.Msg.') !== 0) return false;
assert.notStrictEqual(str.indexOf('";'), str.length - 2, `[${str}] uses double quoted string, should use single quotes.`);
if (str.indexOf("';") !== str.length - 2) return false;
return true;
} | javascript | function (str) {
if (str.indexOf('Blockly.Msg.') !== 0) return false;
assert.notStrictEqual(str.indexOf('";'), str.length - 2, `[${str}] uses double quoted string, should use single quotes.`);
if (str.indexOf("';") !== str.length - 2) return false;
return true;
} | [
"function",
"(",
"str",
")",
"{",
"if",
"(",
"str",
".",
"indexOf",
"(",
"'Blockly.Msg.'",
")",
"!==",
"0",
")",
"return",
"false",
";",
"assert",
".",
"notStrictEqual",
"(",
"str",
".",
"indexOf",
"(",
"'\";'",
")",
",",
"str",
".",
"length",
"-",
... | Match function | [
"Match",
"function"
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/i18n/js_to_json.js#L14-L19 | train | Check if string is a blockly. Msg. | [
30522,
3853,
1006,
2358,
2099,
1007,
1063,
2065,
1006,
2358,
2099,
1012,
5950,
11253,
1006,
1005,
3796,
2135,
1012,
5796,
2290,
1012,
1005,
1007,
999,
1027,
1027,
1014,
1007,
2709,
6270,
1025,
20865,
1012,
2025,
3367,
7277,
2618,
26426,
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... | |
jiahaog/nativefier | app/src/static/preload.js | setNotificationCallback | function setNotificationCallback(createCallback, clickCallback) {
const OldNotify = window.Notification;
const newNotify = (title, opt) => {
createCallback(title, opt);
const instance = new OldNotify(title, opt);
instance.addEventListener('click', clickCallback);
return instance;
};
newNotify.re... | javascript | function setNotificationCallback(createCallback, clickCallback) {
const OldNotify = window.Notification;
const newNotify = (title, opt) => {
createCallback(title, opt);
const instance = new OldNotify(title, opt);
instance.addEventListener('click', clickCallback);
return instance;
};
newNotify.re... | [
"function",
"setNotificationCallback",
"(",
"createCallback",
",",
"clickCallback",
")",
"{",
"const",
"OldNotify",
"=",
"window",
".",
"Notification",
";",
"const",
"newNotify",
"=",
"(",
"title",
",",
"opt",
")",
"=>",
"{",
"createCallback",
"(",
"title",
",... | Patches window.Notification to:
- set a callback on a new Notification
- set a callback for clicks on notifications
@param createCallback
@param clickCallback | [
"Patches",
"window",
".",
"Notification",
"to",
":",
"-",
"set",
"a",
"callback",
"on",
"a",
"new",
"Notification",
"-",
"set",
"a",
"callback",
"for",
"clicks",
"on",
"notifications"
] | b959956a38ce51a9dd95d42308f0a6c66489b624 | https://github.com/jiahaog/nativefier/blob/b959956a38ce51a9dd95d42308f0a6c66489b624/app/src/static/preload.js#L30-L44 | train | Sets a callback function to be called when the user clicks on a notification. | [
30522,
3853,
2275,
17048,
9031,
9289,
20850,
8684,
1006,
3443,
9289,
20850,
8684,
1010,
11562,
9289,
20850,
8684,
1007,
1063,
9530,
3367,
2214,
17048,
8757,
1027,
3332,
1012,
26828,
1025,
9530,
3367,
2047,
17048,
8757,
1027,
1006,
2516,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.m/src/sap/m/Support.js | line | function line(buffer, right, border, label, content) {
buffer.push("<tr class='sapUiSelectable'><td class='sapUiSupportTechInfoBorder sapUiSelectable'><label class='sapUiSupportLabel sapUiSelectable'>", encodeXML(label), "</label><br>");
var ctnt = content;
if (jQuery.isFunction(content)) {
ctnt = cont... | javascript | function line(buffer, right, border, label, content) {
buffer.push("<tr class='sapUiSelectable'><td class='sapUiSupportTechInfoBorder sapUiSelectable'><label class='sapUiSupportLabel sapUiSelectable'>", encodeXML(label), "</label><br>");
var ctnt = content;
if (jQuery.isFunction(content)) {
ctnt = cont... | [
"function",
"line",
"(",
"buffer",
",",
"right",
",",
"border",
",",
"label",
",",
"content",
")",
"{",
"buffer",
".",
"push",
"(",
"\"<tr class='sapUiSelectable'><td class='sapUiSupportTechInfoBorder sapUiSelectable'><label class='sapUiSupportLabel sapUiSelectable'>\"",
",",
... | variable used to open the support dialog on windows phone copied from core | [
"variable",
"used",
"to",
"open",
"the",
"support",
"dialog",
"on",
"windows",
"phone",
"copied",
"from",
"core"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/Support.js#L79-L87 | train | adds a line to the buffer | [
30522,
3853,
2240,
1006,
17698,
1010,
2157,
1010,
3675,
1010,
3830,
1010,
4180,
1007,
1063,
17698,
1012,
5245,
1006,
1000,
1026,
19817,
2465,
1027,
1005,
20066,
27020,
12260,
23576,
1005,
1028,
1026,
14595,
2465,
1027,
1005,
20066,
27020,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js | validateChecksum | function validateChecksum(requester, params) {
params = params || {
filePath: installerPath,
expectedChecksum: _updateParams.checksum
};
var hash = crypto.createHash('sha256'),
currentRequester = requester || "";
if (fs.existsSync(params.filePath)) {... | javascript | function validateChecksum(requester, params) {
params = params || {
filePath: installerPath,
expectedChecksum: _updateParams.checksum
};
var hash = crypto.createHash('sha256'),
currentRequester = requester || "";
if (fs.existsSync(params.filePath)) {... | [
"function",
"validateChecksum",
"(",
"requester",
",",
"params",
")",
"{",
"params",
"=",
"params",
"||",
"{",
"filePath",
":",
"installerPath",
",",
"expectedChecksum",
":",
"_updateParams",
".",
"checksum",
"}",
";",
"var",
"hash",
"=",
"crypto",
".",
"cre... | Validates the checksum of a file against a given checksum
@param {object} params - json containing {
filePath - path to the file,
expectedChecksum - the checksum to validate against } | [
"Validates",
"the",
"checksum",
"of",
"a",
"file",
"against",
"a",
"given",
"checksum"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L128-L180 | train | Validate Checksum | [
30522,
3853,
9398,
3686,
5403,
10603,
2819,
1006,
5227,
2121,
1010,
11498,
5244,
1007,
1063,
11498,
5244,
1027,
11498,
5244,
1064,
1064,
1063,
5371,
15069,
1024,
16500,
2121,
15069,
1010,
3517,
5403,
10603,
2819,
1024,
1035,
10651,
28689,
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... |
adobe/brackets | src/features/ParameterHintsManager.js | positionHint | function positionHint(xpos, ypos, ybot) {
var hintWidth = $hintContainer.width(),
hintHeight = $hintContainer.height(),
top = ypos - hintHeight - POINTER_TOP_OFFSET,
left = xpos,
$editorHolder = $("#editor-holder"),
editorLeft;
if ($editorHold... | javascript | function positionHint(xpos, ypos, ybot) {
var hintWidth = $hintContainer.width(),
hintHeight = $hintContainer.height(),
top = ypos - hintHeight - POINTER_TOP_OFFSET,
left = xpos,
$editorHolder = $("#editor-holder"),
editorLeft;
if ($editorHold... | [
"function",
"positionHint",
"(",
"xpos",
",",
"ypos",
",",
"ybot",
")",
"{",
"var",
"hintWidth",
"=",
"$hintContainer",
".",
"width",
"(",
")",
",",
"hintHeight",
"=",
"$hintContainer",
".",
"height",
"(",
")",
",",
"top",
"=",
"ypos",
"-",
"hintHeight",... | Position a function hint.
@param {number} xpos
@param {number} ypos
@param {number} ybot | [
"Position",
"a",
"function",
"hint",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/ParameterHintsManager.js#L81-L115 | train | Position hint in the editor | [
30522,
3853,
2597,
10606,
2102,
1006,
26726,
2891,
1010,
1061,
6873,
2015,
1010,
1061,
18384,
1007,
1063,
13075,
9374,
9148,
11927,
2232,
1027,
1002,
9374,
8663,
18249,
2121,
1012,
9381,
1006,
1007,
1010,
9374,
26036,
13900,
1027,
1002,
937... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/chart/bar/PictorialBarView.js | getSymbolMeta | function getSymbolMeta(data, dataIndex, itemModel, opt) {
var layout = data.getItemLayout(dataIndex);
var symbolRepeat = itemModel.get('symbolRepeat');
var symbolClip = itemModel.get('symbolClip');
var symbolPosition = itemModel.get('symbolPosition') || 'start';
var symbolRotate = itemModel.get('sym... | javascript | function getSymbolMeta(data, dataIndex, itemModel, opt) {
var layout = data.getItemLayout(dataIndex);
var symbolRepeat = itemModel.get('symbolRepeat');
var symbolClip = itemModel.get('symbolClip');
var symbolPosition = itemModel.get('symbolPosition') || 'start';
var symbolRotate = itemModel.get('sym... | [
"function",
"getSymbolMeta",
"(",
"data",
",",
"dataIndex",
",",
"itemModel",
",",
"opt",
")",
"{",
"var",
"layout",
"=",
"data",
".",
"getItemLayout",
"(",
"dataIndex",
")",
";",
"var",
"symbolRepeat",
"=",
"itemModel",
".",
"get",
"(",
"'symbolRepeat'",
... | Set or calculate default value about symbol, and calculate layout info. | [
"Set",
"or",
"calculate",
"default",
"value",
"about",
"symbol",
"and",
"calculate",
"layout",
"info",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/bar/PictorialBarView.js#L144-L195 | train | Get symbol meta | [
30522,
3853,
4152,
24335,
14956,
11368,
2050,
1006,
2951,
1010,
2951,
22254,
10288,
1010,
8875,
5302,
9247,
1010,
23569,
1007,
1063,
13075,
9621,
1027,
2951,
1012,
2131,
4221,
19968,
28852,
4904,
1006,
2951,
22254,
10288,
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/document/DocumentCommandHandlers.js | handleFileAddToWorkingSetAndOpen | function handleFileAddToWorkingSetAndOpen(commandData) {
return handleFileOpen(commandData).done(function (file) {
var paneId = (commandData && commandData.paneId) || MainViewManager.ACTIVE_PANE;
MainViewManager.addToWorkingSet(paneId, file, commandData.index, commandData.forceRedraw);
... | javascript | function handleFileAddToWorkingSetAndOpen(commandData) {
return handleFileOpen(commandData).done(function (file) {
var paneId = (commandData && commandData.paneId) || MainViewManager.ACTIVE_PANE;
MainViewManager.addToWorkingSet(paneId, file, commandData.index, commandData.forceRedraw);
... | [
"function",
"handleFileAddToWorkingSetAndOpen",
"(",
"commandData",
")",
"{",
"return",
"handleFileOpen",
"(",
"commandData",
")",
".",
"done",
"(",
"function",
"(",
"file",
")",
"{",
"var",
"paneId",
"=",
"(",
"commandData",
"&&",
"commandData",
".",
"paneId",
... | Opens the given file, makes it the current file, AND adds it to the workingset
@param {!PaneCommandData} commandData - record with the following properties:
fullPath: File to open;
index: optional index to position in workingset (defaults to last);
silent: optional flag to suppress error messages;
forceRedraw: flag to ... | [
"Opens",
"the",
"given",
"file",
"makes",
"it",
"the",
"current",
"file",
"AND",
"adds",
"it",
"to",
"the",
"workingset"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentCommandHandlers.js#L554-L560 | train | Add a file to the working set and open it | [
30522,
3853,
5047,
8873,
19738,
14141,
18790,
2953,
6834,
13462,
28574,
11837,
1006,
3094,
2850,
2696,
1007,
1063,
2709,
5047,
8873,
2571,
26915,
1006,
3094,
2850,
2696,
1007,
1012,
2589,
1006,
3853,
1006,
5371,
1007,
1063,
13075,
6090,
741... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | askRegion | function askRegion() {
if (this.abort) return null;
const done = this.async();
const prompts = [
{
type: 'list',
name: 'region',
message: 'Which region?',
choices: regionList,
default: this.aws.region ? _.indexOf(regionList, this.aws.region... | javascript | function askRegion() {
if (this.abort) return null;
const done = this.async();
const prompts = [
{
type: 'list',
name: 'region',
message: 'Which region?',
choices: regionList,
default: this.aws.region ? _.indexOf(regionList, this.aws.region... | [
"function",
"askRegion",
"(",
")",
"{",
"if",
"(",
"this",
".",
"abort",
")",
"return",
"null",
";",
"const",
"done",
"=",
"this",
".",
"async",
"(",
")",
";",
"const",
"prompts",
"=",
"[",
"{",
"type",
":",
"'list'",
",",
"name",
":",
"'region'",
... | Ask user what type of Region is to be created? | [
"Ask",
"user",
"what",
"type",
"of",
"Region",
"is",
"to",
"be",
"created?"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/aws-containers/prompts.js#L155-L178 | train | Ask what region is in the list of regions | [
30522,
3853,
3198,
23784,
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,
25732,
2015,
1027,
1031,
1063,
2828,
1024,
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... |
jiahaog/nativefier | app/src/helpers/helpers.js | debugLog | function debugLog(browserWindow, message) {
// need the timeout as it takes time for the preload javascript to be loaded in the window
setTimeout(() => {
browserWindow.webContents.send('debug', message);
}, 3000);
log.info(message);
} | javascript | function debugLog(browserWindow, message) {
// need the timeout as it takes time for the preload javascript to be loaded in the window
setTimeout(() => {
browserWindow.webContents.send('debug', message);
}, 3000);
log.info(message);
} | [
"function",
"debugLog",
"(",
"browserWindow",
",",
"message",
")",
"{",
"// need the timeout as it takes time for the preload javascript to be loaded in the window",
"setTimeout",
"(",
"(",
")",
"=>",
"{",
"browserWindow",
".",
"webContents",
".",
"send",
"(",
"'debug'",
... | Helper method to print debug messages from the main process in the browser window
@param {BrowserWindow} browserWindow
@param message | [
"Helper",
"method",
"to",
"print",
"debug",
"messages",
"from",
"the",
"main",
"process",
"in",
"the",
"browser",
"window"
] | b959956a38ce51a9dd95d42308f0a6c66489b624 | https://github.com/jiahaog/nativefier/blob/b959956a38ce51a9dd95d42308f0a6c66489b624/app/src/helpers/helpers.js#L54-L60 | train | debug log | [
30522,
3853,
2139,
8569,
23296,
8649,
1006,
16602,
11101,
5004,
1010,
4471,
1007,
1063,
1013,
1013,
2342,
1996,
2051,
5833,
2004,
2009,
3138,
2051,
2005,
1996,
3653,
11066,
9262,
22483,
2000,
2022,
8209,
1999,
1996,
3332,
2275,
7292,
5833,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js | function( elems, callback, arg ) {
var value, key, ret = [],
i = 0,
length = elems.length,
// jquery objects are treated as arrays
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArr... | javascript | function( elems, callback, arg ) {
var value, key, ret = [],
i = 0,
length = elems.length,
// jquery objects are treated as arrays
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArr... | [
"function",
"(",
"elems",
",",
"callback",
",",
"arg",
")",
"{",
"var",
"value",
",",
"key",
",",
"ret",
"=",
"[",
"]",
",",
"i",
"=",
"0",
",",
"length",
"=",
"elems",
".",
"length",
",",
"// jquery objects are treated as arrays",
"isArray",
"=",
"ele... | arg is for internal usage only | [
"arg",
"is",
"for",
"internal",
"usage",
"only"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js#L761-L791 | train | This function is a bit of a hack to get the array of items from the array | [
30522,
3853,
1006,
3449,
6633,
2015,
1010,
2655,
5963,
1010,
12098,
2290,
1007,
1063,
13075,
3643,
1010,
3145,
1010,
2128,
2102,
1027,
1031,
1033,
1010,
1045,
1027,
1014,
1010,
3091,
1027,
3449,
6633,
2015,
1012,
3091,
1010,
1013,
1013,
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/func-call-spacing.js | checkSpacing | function checkSpacing(node) {
const lastToken = sourceCode.getLastToken(node);
const lastCalleeToken = sourceCode.getLastToken(node.callee);
const parenToken = sourceCode.getFirstTokenBetween(lastCalleeToken, lastToken, astUtils.isOpeningParenToken);
const prevToken = par... | javascript | function checkSpacing(node) {
const lastToken = sourceCode.getLastToken(node);
const lastCalleeToken = sourceCode.getLastToken(node.callee);
const parenToken = sourceCode.getFirstTokenBetween(lastCalleeToken, lastToken, astUtils.isOpeningParenToken);
const prevToken = par... | [
"function",
"checkSpacing",
"(",
"node",
")",
"{",
"const",
"lastToken",
"=",
"sourceCode",
".",
"getLastToken",
"(",
"node",
")",
";",
"const",
"lastCalleeToken",
"=",
"sourceCode",
".",
"getLastToken",
"(",
"node",
".",
"callee",
")",
";",
"const",
"parenT... | Check if open space is present in a function name
@param {ASTNode} node node to evaluate
@returns {void}
@private | [
"Check",
"if",
"open",
"space",
"is",
"present",
"in",
"a",
"function",
"name"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/func-call-spacing.js#L84-L160 | train | Check spacing between function name and function name | [
30522,
3853,
14148,
19498,
2075,
1006,
13045,
1007,
1063,
9530,
3367,
2197,
18715,
2368,
1027,
3120,
16044,
1012,
2131,
8523,
9284,
7520,
1006,
13045,
1007,
1025,
9530,
3367,
2197,
9289,
10559,
18715,
2368,
1027,
3120,
16044,
1012,
2131,
85... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.dt/src/sap/ui/dt/ContextMenuControl.js | function() {
var sOverflowButtonId = "OVERFLOW_BUTTON",
oButtonOptions = {
icon: "sap-icon://overflow",
type: "Transparent",
enabled: true,
press: this._onOverflowPress.bind(this),
layoutData: new FlexItemData({})
};
return this._addButton(sOverflowButtonId, oButtonOptions);
} | javascript | function() {
var sOverflowButtonId = "OVERFLOW_BUTTON",
oButtonOptions = {
icon: "sap-icon://overflow",
type: "Transparent",
enabled: true,
press: this._onOverflowPress.bind(this),
layoutData: new FlexItemData({})
};
return this._addButton(sOverflowButtonId, oButtonOptions);
} | [
"function",
"(",
")",
"{",
"var",
"sOverflowButtonId",
"=",
"\"OVERFLOW_BUTTON\"",
",",
"oButtonOptions",
"=",
"{",
"icon",
":",
"\"sap-icon://overflow\"",
",",
"type",
":",
"\"Transparent\"",
",",
"enabled",
":",
"true",
",",
"press",
":",
"this",
".",
"_onOv... | Adds a overflowButton to the ContextMenu.
@return {sap.m.ContextMenu} Reference to this in order to allow method chaining
@public | [
"Adds",
"a",
"overflowButton",
"to",
"the",
"ContextMenu",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js#L555-L565 | train | Adds an overflow button to the toolbar. | [
30522,
3853,
1006,
1007,
1063,
13075,
2061,
6299,
12314,
8569,
15474,
3593,
1027,
1000,
2058,
12314,
1035,
6462,
1000,
1010,
27885,
4904,
2669,
7361,
9285,
1027,
1063,
12696,
1024,
1000,
20066,
1011,
30524,
1024,
1000,
13338,
1000,
1010,
91... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/webdriver/logging.js | getLevel | function getLevel(nameOrValue) {
// DEBUG is not a predefined Closure log level, but maps to CONFIG. Since
// DEBUG is a predefined level for the WebDriver protocol, we prefer it over
// CONFIG.
if ('DEBUG' === nameOrValue || Logger.Level.DEBUG.value === nameOrValue) {
return Logger.Level.DEBUG;
} else if... | javascript | function getLevel(nameOrValue) {
// DEBUG is not a predefined Closure log level, but maps to CONFIG. Since
// DEBUG is a predefined level for the WebDriver protocol, we prefer it over
// CONFIG.
if ('DEBUG' === nameOrValue || Logger.Level.DEBUG.value === nameOrValue) {
return Logger.Level.DEBUG;
} else if... | [
"function",
"getLevel",
"(",
"nameOrValue",
")",
"{",
"// DEBUG is not a predefined Closure log level, but maps to CONFIG. Since",
"// DEBUG is a predefined level for the WebDriver protocol, we prefer it over",
"// CONFIG.",
"if",
"(",
"'DEBUG'",
"===",
"nameOrValue",
"||",
"Logger",
... | Converts a level name or value to a {@link webdriver.logging.Level} value.
If the name/value is not recognized, {@link webdriver.logging.Level.ALL}
will be returned.
@param {(number|string)} nameOrValue The log level name, or value, to
convert .
@return {!Logger.Level} The converted level. | [
"Converts",
"a",
"level",
"name",
"or",
"value",
"to",
"a",
"{"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/webdriver/logging.js#L185-L198 | train | Returns the level of the given log message. | [
30522,
3853,
2131,
20414,
2884,
1006,
2171,
2953,
10175,
5657,
1007,
1063,
1013,
1013,
2139,
8569,
2290,
2003,
2025,
1037,
3653,
3207,
23460,
2094,
8503,
8833,
2504,
1010,
2021,
7341,
2000,
9530,
8873,
2290,
1012,
2144,
1013,
1013,
2139,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/utils/TokenUtils.js | moveNextToken | function moveNextToken(ctx, precise) {
var eol = ctx.editor.getLine(ctx.pos.line).length;
if (precise === undefined) {
precise = true;
}
if (ctx.pos.ch >= eol || ctx.token.end >= eol) {
//move down a line
if (ctx.pos.line >= ctx.editor.lineCount() - 1... | javascript | function moveNextToken(ctx, precise) {
var eol = ctx.editor.getLine(ctx.pos.line).length;
if (precise === undefined) {
precise = true;
}
if (ctx.pos.ch >= eol || ctx.token.end >= eol) {
//move down a line
if (ctx.pos.line >= ctx.editor.lineCount() - 1... | [
"function",
"moveNextToken",
"(",
"ctx",
",",
"precise",
")",
"{",
"var",
"eol",
"=",
"ctx",
".",
"editor",
".",
"getLine",
"(",
"ctx",
".",
"pos",
".",
"line",
")",
".",
"length",
";",
"if",
"(",
"precise",
"===",
"undefined",
")",
"{",
"precise",
... | Moves the given context forward by one token.
@param {!{editor:!CodeMirror, pos:!{ch:number, line:number}, token:Object}} ctx
@param {boolean=} precise If code is being edited, use true (default) for accuracy.
If parsing unchanging code, use false to use cache for performance.
@return {boolean} whether the context chan... | [
"Moves",
"the",
"given",
"context",
"forward",
"by",
"one",
"token",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/TokenUtils.js#L143-L161 | train | move the next token to the next line | [
30522,
3853,
2693,
2638,
18413,
18715,
2368,
1006,
14931,
2595,
1010,
10480,
1007,
1063,
13075,
1041,
4747,
1027,
14931,
2595,
1012,
3559,
1012,
2131,
4179,
1006,
14931,
2595,
1012,
13433,
2015,
1012,
2240,
1007,
1012,
3091,
1025,
2065,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/base/i18n/ResourceBundle.js | tryToLoadNextProperties | function tryToLoadNextProperties(oBundle, bAsync) {
// get the next fallback locale and calculate the next but one locale
var sLocale = oBundle._sNextLocale;
oBundle._sNextLocale = nextFallbackLocale(sLocale);
var aSupportedLanguages = window.sap && window.sap.ui && sap.ui.getCore && sap.ui.getCore().getConfi... | javascript | function tryToLoadNextProperties(oBundle, bAsync) {
// get the next fallback locale and calculate the next but one locale
var sLocale = oBundle._sNextLocale;
oBundle._sNextLocale = nextFallbackLocale(sLocale);
var aSupportedLanguages = window.sap && window.sap.ui && sap.ui.getCore && sap.ui.getCore().getConfi... | [
"function",
"tryToLoadNextProperties",
"(",
"oBundle",
",",
"bAsync",
")",
"{",
"// get the next fallback locale and calculate the next but one locale",
"var",
"sLocale",
"=",
"oBundle",
".",
"_sNextLocale",
";",
"oBundle",
".",
"_sNextLocale",
"=",
"nextFallbackLocale",
"(... | /*
Tries to load the properties file for the next fallback locale.
If there is no further fallback locale or when requests for the next fallback locale are
suppressed by configuration or when the file cannot be loaded, <code>null</code> is returned.
@param {ResourceBundle} oBundle ResourceBundle to extend
@param {boo... | [
"/",
"*",
"Tries",
"to",
"load",
"the",
"properties",
"file",
"for",
"the",
"next",
"fallback",
"locale",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/i18n/ResourceBundle.js#L497-L546 | train | Loads the next properties in the bundle | [
30522,
3853,
3046,
3406,
11066,
2638,
18413,
21572,
4842,
7368,
1006,
27885,
8630,
2571,
1010,
19021,
6038,
2278,
1007,
1063,
1013,
1013,
2131,
1996,
2279,
2991,
5963,
2334,
2063,
1998,
18422,
1996,
2279,
2021,
2028,
2334,
2063,
13075,
2288... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/lib/_V2MetadataConverter.js | V2MetadataConverter | function V2MetadataConverter() {
this.association = null; // the current association
this.associations = {}; // maps qualified name -> association
this.associationSet = null; // the current associationSet
this.associationSets = []; // list of associationSets
this.aBoundOperations = []; // list of bound operat... | javascript | function V2MetadataConverter() {
this.association = null; // the current association
this.associations = {}; // maps qualified name -> association
this.associationSet = null; // the current associationSet
this.associationSets = []; // list of associationSets
this.aBoundOperations = []; // list of bound operat... | [
"function",
"V2MetadataConverter",
"(",
")",
"{",
"this",
".",
"association",
"=",
"null",
";",
"// the current association",
"this",
".",
"associations",
"=",
"{",
"}",
";",
"// maps qualified name -> association",
"this",
".",
"associationSet",
"=",
"null",
";",
... | ********************************************************************************************* V2MetadataConverter *********************************************************************************************
Creates a converter for V2 metadata.
@constructor | [
"*********************************************************************************************",
"V2MetadataConverter",
"*********************************************************************************************",
"Creates",
"a",
"converter",
"for",
"V2",
"metadata",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js#L372-L393 | train | V2 Metadata Converter | [
30522,
3853,
1058,
2475,
11368,
8447,
2696,
8663,
16874,
2121,
1006,
1007,
1063,
2023,
1012,
2523,
1027,
19701,
1025,
1013,
1013,
1996,
2783,
2523,
2023,
1012,
8924,
1027,
1063,
1065,
1025,
1013,
1013,
7341,
4591,
2171,
1011,
1028,
2523,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.suite/src/sap/ui/suite/QuickViewUtils.js | function(sServiceUrl,sConfigName,sThingKey,mFormatter) {
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl,false);
var oQV = new sap.ui.ux3.QuickView({firstTitle: "{title}", firstTitleHref: "{titleLinkURL}", type:"{Thing/text}", icon:"{imageURL}"});
oQV.setModel(oModel);
oQV.bindObject("/Quickview... | javascript | function(sServiceUrl,sConfigName,sThingKey,mFormatter) {
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl,false);
var oQV = new sap.ui.ux3.QuickView({firstTitle: "{title}", firstTitleHref: "{titleLinkURL}", type:"{Thing/text}", icon:"{imageURL}"});
oQV.setModel(oModel);
oQV.bindObject("/Quickview... | [
"function",
"(",
"sServiceUrl",
",",
"sConfigName",
",",
"sThingKey",
",",
"mFormatter",
")",
"{",
"var",
"oModel",
"=",
"new",
"sap",
".",
"ui",
".",
"model",
".",
"odata",
".",
"ODataModel",
"(",
"sServiceUrl",
",",
"false",
")",
";",
"var",
"oQV",
"... | /* create a QV instance with content | [
"/",
"*",
"create",
"a",
"QV",
"instance",
"with",
"content"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.suite/src/sap/ui/suite/QuickViewUtils.js#L21-L36 | train | Creates a new QuickView with the given service url and config name and a formatter. | [
30522,
3853,
1006,
7020,
2121,
7903,
11236,
2140,
1010,
8040,
2239,
8873,
16989,
4168,
1010,
2358,
12053,
14839,
1010,
1049,
14192,
20097,
1007,
1063,
13075,
18168,
10244,
2140,
1027,
2047,
20066,
1012,
21318,
1012,
2944,
1012,
1051,
2850,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | isChildCompilerCacheOutdated | function isChildCompilerCacheOutdated (mainCompilation, childCompiler) {
// If the compilation was never run there is no invalid cache
if (!childCompiler.compilationStartedTimestamp) {
return false;
}
// Check if any dependent file was changed after the last compilation
const fileTimestamps = mainCompilat... | javascript | function isChildCompilerCacheOutdated (mainCompilation, childCompiler) {
// If the compilation was never run there is no invalid cache
if (!childCompiler.compilationStartedTimestamp) {
return false;
}
// Check if any dependent file was changed after the last compilation
const fileTimestamps = mainCompilat... | [
"function",
"isChildCompilerCacheOutdated",
"(",
"mainCompilation",
",",
"childCompiler",
")",
"{",
"// If the compilation was never run there is no invalid cache",
"if",
"(",
"!",
"childCompiler",
".",
"compilationStartedTimestamp",
")",
"{",
"return",
"false",
";",
"}",
"... | Returns `true` if the file dependencies of the given childCompiler are outdated.
@param {WebpackCompilation} mainCompilation
@param {HtmlWebpackChildCompiler} childCompiler
@returns {boolean} | [
"Returns",
"true",
"if",
"the",
"file",
"dependencies",
"of",
"the",
"given",
"childCompiler",
"are",
"outdated",
"."
] | 38db64ae8805de37d038e0ee0f6dfa2a26e2163a | https://github.com/jantimon/html-webpack-plugin/blob/38db64ae8805de37d038e0ee0f6dfa2a26e2163a/lib/compiler.js#L333-L348 | train | Checks if the childCompiler is outdated | [
30522,
3853,
2003,
19339,
9006,
22090,
18992,
5403,
5833,
13701,
2094,
1006,
2364,
9006,
8197,
13490,
1010,
2775,
9006,
22090,
2099,
1007,
1063,
1013,
1013,
2065,
1996,
6268,
2001,
2196,
2448,
2045,
2003,
2053,
19528,
17053,
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... |
GitbookIO/gitbook | lib/utils/command.js | exec | function exec(command, options) {
var d = Promise.defer();
var child = childProcess.exec(command, options, function(err, stdout, stderr) {
if (!err) {
return d.resolve();
}
err.message = stdout.toString('utf8') + stderr.toString('utf8');
d.reject(err);
});
... | javascript | function exec(command, options) {
var d = Promise.defer();
var child = childProcess.exec(command, options, function(err, stdout, stderr) {
if (!err) {
return d.resolve();
}
err.message = stdout.toString('utf8') + stderr.toString('utf8');
d.reject(err);
});
... | [
"function",
"exec",
"(",
"command",
",",
"options",
")",
"{",
"var",
"d",
"=",
"Promise",
".",
"defer",
"(",
")",
";",
"var",
"child",
"=",
"childProcess",
".",
"exec",
"(",
"command",
",",
"options",
",",
"function",
"(",
"err",
",",
"stdout",
",",
... | Execute a command
@param {String} command
@param {Object} options
@return {Promise} | [
"Execute",
"a",
"command"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/command.js#L13-L34 | train | Exec a command | [
30522,
3853,
4654,
8586,
1006,
3094,
1010,
7047,
1007,
1063,
13075,
1040,
1027,
4872,
1012,
13366,
2121,
1006,
1007,
1025,
13075,
2775,
1027,
30524,
2358,
26797,
2102,
1010,
2358,
4063,
2099,
1007,
1063,
2065,
1006,
999,
9413,
2099,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/AnnotationParser.js | function(oNodeList) {
var aNodeValues = [];
var xPath = AnnotationParser._oXPath;
for (var i = 0; i < oNodeList.length; i += 1) {
var oNode = xPath.nextNode(oNodeList, i);
var oValue = {};
var sText = xPath.getNodeText(oNode);
// TODO: Is nodeName correct or should we remove the namespace?
oValue[... | javascript | function(oNodeList) {
var aNodeValues = [];
var xPath = AnnotationParser._oXPath;
for (var i = 0; i < oNodeList.length; i += 1) {
var oNode = xPath.nextNode(oNodeList, i);
var oValue = {};
var sText = xPath.getNodeText(oNode);
// TODO: Is nodeName correct or should we remove the namespace?
oValue[... | [
"function",
"(",
"oNodeList",
")",
"{",
"var",
"aNodeValues",
"=",
"[",
"]",
";",
"var",
"xPath",
"=",
"AnnotationParser",
".",
"_oXPath",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"oNodeList",
".",
"length",
";",
"i",
"+=",
"1",
")",
... | /*
Extracts the text value from all nodes in the given NodeList and puts them into an array
@param {XPathResult} oNodeList - As many nodes as should be checked for Record values
@return {object[]} Array of values
@static
@private | [
"/",
"*",
"Extracts",
"the",
"text",
"value",
"from",
"all",
"nodes",
"in",
"the",
"given",
"NodeList",
"and",
"puts",
"them",
"into",
"an",
"array"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/AnnotationParser.js#L883-L897 | train | Returns an array of values for the given DOM nodes | [
30522,
3853,
1006,
21058,
9247,
2923,
1007,
1063,
13075,
2019,
10244,
10175,
15808,
1027,
1031,
1033,
1025,
13075,
26726,
8988,
1027,
5754,
17287,
3508,
19362,
8043,
1012,
1035,
23060,
15069,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
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.ux3/src/sap/ui/ux3/ToolPopup.js | function (oThis) {
// jQuery Plugin "rect"
var sKey = "",
iVal = 0,
iZero = 0, // this is the 0 of the relative position between ToolPopup and Opener
iHalfArrow = oThis.iArrowHeight / 2,
isRTL = sap.ui.getCo... | javascript | function (oThis) {
// jQuery Plugin "rect"
var sKey = "",
iVal = 0,
iZero = 0, // this is the 0 of the relative position between ToolPopup and Opener
iHalfArrow = oThis.iArrowHeight / 2,
isRTL = sap.ui.getCo... | [
"function",
"(",
"oThis",
")",
"{",
"// jQuery Plugin \"rect\"",
"var",
"sKey",
"=",
"\"\"",
",",
"iVal",
"=",
"0",
",",
"iZero",
"=",
"0",
",",
"// this is the 0 of the relative position between ToolPopup and Opener",
"iHalfArrow",
"=",
"oThis",
".",
"iArrowHeight",... | Calculates the desired arrow position related to the set docking and to the size of the popup.
This only works when "my" and "at" both use the jQuery-based docking which means they
are strings like "begin top".
If there is no opener set properly an error is logged into the console and there will
be no arrow for the Too... | [
"Calculates",
"the",
"desired",
"arrow",
"position",
"related",
"to",
"the",
"set",
"docking",
"and",
"to",
"the",
"size",
"of",
"the",
"popup",
".",
"This",
"only",
"works",
"when",
"my",
"and",
"at",
"both",
"use",
"the",
"jQuery",
"-",
"based",
"docki... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ToolPopup.js#L873-L989 | train | Calculates the arrow position of the arrow | [
30522,
3853,
1006,
27178,
24158,
1007,
1063,
1013,
1013,
1046,
4226,
2854,
13354,
2378,
1000,
28667,
2102,
1000,
13075,
15315,
3240,
1027,
1000,
1000,
1010,
4921,
2389,
1027,
1014,
1010,
1045,
6290,
2080,
1027,
1014,
1010,
1013,
1013,
2023,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
googleapis/google-api-nodejs-client | samples/compute/listVMs.js | listVMs | async function listVMs() {
// [START auth]
const authClient = await google.auth.getClient({
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/compute',
'https://www.googleapis.com/auth/compute.readonly',
],
});
// [END auth]
// [START list]... | javascript | async function listVMs() {
// [START auth]
const authClient = await google.auth.getClient({
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/compute',
'https://www.googleapis.com/auth/compute.readonly',
],
});
// [END auth]
// [START list]... | [
"async",
"function",
"listVMs",
"(",
")",
"{",
"// [START auth]",
"const",
"authClient",
"=",
"await",
"google",
".",
"auth",
".",
"getClient",
"(",
"{",
"scopes",
":",
"[",
"'https://www.googleapis.com/auth/cloud-platform'",
",",
"'https://www.googleapis.com/auth/compu... | [END initialize] | [
"[",
"END",
"initialize",
"]"
] | e6e632a29d0b246d058e3067de3a5c3827e2b54e | https://github.com/googleapis/google-api-nodejs-client/blob/e6e632a29d0b246d058e3067de3a5c3827e2b54e/samples/compute/listVMs.js#L24-L44 | train | List all virtual machines in the cluster | [
30522,
2004,
6038,
2278,
3853,
2862,
2615,
5244,
1006,
1007,
1063,
1013,
1013,
1031,
2707,
8740,
2705,
1033,
9530,
3367,
8740,
2705,
20464,
11638,
1027,
26751,
8224,
1012,
8740,
2705,
1012,
2131,
20464,
11638,
1006,
1063,
9531,
2015,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | mergeAnnotations | function mergeAnnotations(oSchema, mAnnotations, bPrivileged) {
var sTarget;
/*
* "PUT" semantics on term/qualifier level, only privileged sources may overwrite.
*
* @param {object} oTarget
* The target object (which is modified)
* @param {object} oSource
* The source object
*/
function ... | javascript | function mergeAnnotations(oSchema, mAnnotations, bPrivileged) {
var sTarget;
/*
* "PUT" semantics on term/qualifier level, only privileged sources may overwrite.
*
* @param {object} oTarget
* The target object (which is modified)
* @param {object} oSource
* The source object
*/
function ... | [
"function",
"mergeAnnotations",
"(",
"oSchema",
",",
"mAnnotations",
",",
"bPrivileged",
")",
"{",
"var",
"sTarget",
";",
"/*\n\t\t * \"PUT\" semantics on term/qualifier level, only privileged sources may overwrite.\n\t\t *\n\t\t * @param {object} oTarget\n\t\t * The target object (which... | Merges the given schema's annotations into the root scope's $Annotations.
@param {object} oSchema
a schema; schema children are ignored because they do not contain $Annotations
@param {object} mAnnotations
the root scope's $Annotations
@param {boolean} [bPrivileged=false]
whether the schema has been loaded from a priv... | [
"Merges",
"the",
"given",
"schema",
"s",
"annotations",
"into",
"the",
"root",
"scope",
"s",
"$Annotations",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L275-L303 | train | Merge annotations from a schema to a target object. | [
30522,
3853,
13590,
11639,
17287,
9285,
1006,
9808,
5403,
2863,
1010,
10856,
17287,
9285,
1010,
17531,
3089,
14762,
24746,
2094,
1007,
1063,
13075,
2732,
18150,
1025,
1013,
1008,
1008,
1000,
2404,
1000,
28081,
2006,
2744,
1013,
10981,
2504,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/hello-mui/js/mui.js | function(scroller, options) {
this.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;
this.wrapperStyle = this.wrapper.style;
this.indicator = this.wrapper.children[0];
this.indicatorStyle = this.indicator.style;
this.scroller = scroller;
this.options = $.extend({
... | javascript | function(scroller, options) {
this.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;
this.wrapperStyle = this.wrapper.style;
this.indicator = this.wrapper.children[0];
this.indicatorStyle = this.indicator.style;
this.scroller = scroller;
this.options = $.extend({
... | [
"function",
"(",
"scroller",
",",
"options",
")",
"{",
"this",
".",
"wrapper",
"=",
"typeof",
"options",
".",
"el",
"==",
"'string'",
"?",
"document",
".",
"querySelector",
"(",
"options",
".",
"el",
")",
":",
"options",
".",
"el",
";",
"this",
".",
... | Indicator | [
"Indicator"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/hello-mui/js/mui.js#L4407-L4432 | train | Initialize the object | [
30522,
3853,
1006,
17186,
2121,
1010,
7047,
1007,
1063,
2023,
1012,
10236,
4842,
1027,
2828,
11253,
7047,
1012,
3449,
1027,
1027,
1005,
5164,
1005,
1029,
6254,
1012,
23032,
11246,
22471,
2953,
1006,
7047,
1012,
3449,
1007,
1024,
7047,
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... | |
adobe/brackets | src/utils/HealthLogger.js | searchDone | function searchDone(searchType) {
var searchDetails = getHealthDataLog("searchDetails");
if (!searchDetails) {
searchDetails = {};
}
if (!searchDetails[searchType]) {
searchDetails[searchType] = 0;
}
searchDetails[searchType]++;
setHealthDa... | javascript | function searchDone(searchType) {
var searchDetails = getHealthDataLog("searchDetails");
if (!searchDetails) {
searchDetails = {};
}
if (!searchDetails[searchType]) {
searchDetails[searchType] = 0;
}
searchDetails[searchType]++;
setHealthDa... | [
"function",
"searchDone",
"(",
"searchType",
")",
"{",
"var",
"searchDetails",
"=",
"getHealthDataLog",
"(",
"\"searchDetails\"",
")",
";",
"if",
"(",
"!",
"searchDetails",
")",
"{",
"searchDetails",
"=",
"{",
"}",
";",
"}",
"if",
"(",
"!",
"searchDetails",
... | Increments health log count for a particular kind of search done
@param {string} searchType The kind of search type that needs to be logged- should be a js var compatible string | [
"Increments",
"health",
"log",
"count",
"for",
"a",
"particular",
"kind",
"of",
"search",
"done"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/HealthLogger.js#L294-L304 | train | search done - set searchDetails to the current search type | [
30522,
3853,
3945,
5280,
2063,
1006,
3945,
13874,
1007,
1063,
13075,
3945,
3207,
22081,
1027,
2131,
20192,
24658,
2850,
9080,
8649,
1006,
1000,
3945,
3207,
22081,
1000,
1007,
1025,
2065,
1006,
999,
3945,
3207,
22081,
1007,
1063,
3945,
3207,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.uxap/src/sap/uxap/component/ObjectPageLayoutUXDrivenFactory.controller.js | function (sStaticHandlerName) {
var fnNameSpace = window, aNameSpaceParts = sStaticHandlerName.split('.');
try {
jQueryDOM.each(aNameSpaceParts, function (iIndex, sNameSpacePart) {
fnNameSpace = fnNameSpace[sNameSpacePart];
});
} catch (sError) {
Log.error("ObjectPageLayoutFactory :: undefin... | javascript | function (sStaticHandlerName) {
var fnNameSpace = window, aNameSpaceParts = sStaticHandlerName.split('.');
try {
jQueryDOM.each(aNameSpaceParts, function (iIndex, sNameSpacePart) {
fnNameSpace = fnNameSpace[sNameSpacePart];
});
} catch (sError) {
Log.error("ObjectPageLayoutFactory :: undefin... | [
"function",
"(",
"sStaticHandlerName",
")",
"{",
"var",
"fnNameSpace",
"=",
"window",
",",
"aNameSpaceParts",
"=",
"sStaticHandlerName",
".",
"split",
"(",
"'.'",
")",
";",
"try",
"{",
"jQueryDOM",
".",
"each",
"(",
"aNameSpaceParts",
",",
"function",
"(",
"... | determine the static function to use from its name
@param {string} sStaticHandlerName the name of the handler
@returns {*|window|window} function | [
"determine",
"the",
"static",
"function",
"to",
"use",
"from",
"its",
"name"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.uxap/src/sap/uxap/component/ObjectPageLayoutUXDrivenFactory.controller.js#L112-L126 | train | Returns the static class name for the given static event handler name. | [
30522,
3853,
1006,
7020,
29336,
7033,
5685,
3917,
18442,
1007,
1063,
13075,
1042,
9516,
7834,
15327,
1027,
3332,
1010,
9617,
7834,
15327,
26950,
1027,
7020,
29336,
7033,
5685,
3917,
18442,
1012,
3975,
1006,
1005,
1012,
1005,
1007,
1025,
304... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
electron/electron | lib/browser/rpc-server.js | function (obj) {
return Object.getOwnPropertyNames(obj).map(function (name) {
return {
name: name,
value: obj[name]
}
})
} | javascript | function (obj) {
return Object.getOwnPropertyNames(obj).map(function (name) {
return {
name: name,
value: obj[name]
}
})
} | [
"function",
"(",
"obj",
")",
"{",
"return",
"Object",
".",
"getOwnPropertyNames",
"(",
"obj",
")",
".",
"map",
"(",
"function",
"(",
"name",
")",
"{",
"return",
"{",
"name",
":",
"name",
",",
"value",
":",
"obj",
"[",
"name",
"]",
"}",
"}",
")",
... | Convert object to meta by value. | [
"Convert",
"object",
"to",
"meta",
"by",
"value",
"."
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/rpc-server.js#L137-L144 | train | Returns an array of the chains of the given object | [
30522,
3853,
1006,
27885,
3501,
1007,
1063,
2709,
4874,
1012,
2131,
12384,
21572,
4842,
25680,
14074,
2015,
1006,
27885,
3501,
1007,
1012,
4949,
1006,
3853,
1006,
2171,
1007,
1063,
2709,
1063,
2171,
1024,
2171,
1010,
3643,
1024,
27885,
3501... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/blanket.js | parseExpression | function parseExpression() {
var expr, startToken = lookahead;
expr = parseAssignmentExpression();
if (match(',')) {
expr = delegate.createSequenceExpression([ expr ]);
while (index < length) {
if (!match(',')) {
break;
... | javascript | function parseExpression() {
var expr, startToken = lookahead;
expr = parseAssignmentExpression();
if (match(',')) {
expr = delegate.createSequenceExpression([ expr ]);
while (index < length) {
if (!match(',')) {
break;
... | [
"function",
"parseExpression",
"(",
")",
"{",
"var",
"expr",
",",
"startToken",
"=",
"lookahead",
";",
"expr",
"=",
"parseAssignmentExpression",
"(",
")",
";",
"if",
"(",
"match",
"(",
"','",
")",
")",
"{",
"expr",
"=",
"delegate",
".",
"createSequenceExpr... | 11.14 Comma Operator | [
"11",
".",
"14",
"Comma",
"Operator"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L2586-L2606 | train | ECMA - 262 12. 2 Assignment Expressions | [
30522,
3853,
11968,
19763,
2595,
20110,
3258,
1006,
1007,
1063,
13075,
4654,
18098,
1010,
2707,
18715,
2368,
1027,
2298,
4430,
13775,
1025,
4654,
18098,
1027,
11968,
17310,
18719,
16206,
3672,
10288,
20110,
3258,
1006,
1007,
1025,
2065,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getsentry/sentry-javascript | packages/raven-js/src/raven.js | function() {
var self = this;
var wrappedBuiltIns = self._wrappedBuiltIns;
function wrapTimeFn(orig) {
return function(fn, t) {
// preserve arity
// Make a copy of the arguments to prevent deoptimization
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32... | javascript | function() {
var self = this;
var wrappedBuiltIns = self._wrappedBuiltIns;
function wrapTimeFn(orig) {
return function(fn, t) {
// preserve arity
// Make a copy of the arguments to prevent deoptimization
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"wrappedBuiltIns",
"=",
"self",
".",
"_wrappedBuiltIns",
";",
"function",
"wrapTimeFn",
"(",
"orig",
")",
"{",
"return",
"function",
"(",
"fn",
",",
"t",
")",
"{",
"// preserve arity",
"/... | Wrap timer functions and event targets to catch errors and provide
better metadata. | [
"Wrap",
"timer",
"functions",
"and",
"event",
"targets",
"to",
"catch",
"errors",
"and",
"provide",
"better",
"metadata",
"."
] | a872223343fecf7364473b78bede937f1eb57bd0 | https://github.com/getsentry/sentry-javascript/blob/a872223343fecf7364473b78bede937f1eb57bd0/packages/raven-js/src/raven.js#L1102-L1308 | train | This function is called by the constructor when the constructor is called. | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
5058,
8569,
4014,
7629,
2015,
1027,
2969,
1012,
1035,
5058,
8569,
4014,
7629,
2015,
1025,
3853,
10236,
7292,
2546,
2078,
1006,
2030,
8004,
1007,
1063,
2709,
3853,
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/utils/Async.js | doSequentially | function doSequentially(items, beginProcessItem, failAndStopFast) {
var masterDeferred = new $.Deferred(),
hasFailed = false;
function doItem(i) {
if (i >= items.length) {
if (hasFailed) {
masterDeferred.reject();
} else {
... | javascript | function doSequentially(items, beginProcessItem, failAndStopFast) {
var masterDeferred = new $.Deferred(),
hasFailed = false;
function doItem(i) {
if (i >= items.length) {
if (hasFailed) {
masterDeferred.reject();
} else {
... | [
"function",
"doSequentially",
"(",
"items",
",",
"beginProcessItem",
",",
"failAndStopFast",
")",
"{",
"var",
"masterDeferred",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"hasFailed",
"=",
"false",
";",
"function",
"doItem",
"(",
"i",
")",
"{",
"if",... | Executes a series of tasks in serial (task N does not begin until task N-1 has completed).
Returns a "master" Promise that is resolved once all the tasks have resolved. If one or more
tasks fail, behavior depends on the failAndStopFast flag:
- If true, the master Promise is rejected as soon as the first task fails. The... | [
"Executes",
"a",
"series",
"of",
"tasks",
"in",
"serial",
"(",
"task",
"N",
"does",
"not",
"begin",
"until",
"task",
"N",
"-",
"1",
"has",
"completed",
")",
".",
"Returns",
"a",
"master",
"Promise",
"that",
"is",
"resolved",
"once",
"all",
"the",
"task... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/Async.js#L162-L196 | train | doSequentially - processes an array of items in sequence | [
30522,
3853,
13004,
15417,
4818,
2135,
1006,
5167,
1010,
4088,
21572,
9623,
30524,
29560,
14399,
24333,
1007,
1063,
13075,
3040,
3207,
7512,
5596,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
2038,
7011,
18450,
1027,
6270,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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() {
var sName;
// lazy load of LocaleData to avoid cyclic dependencies
if ( !LocaleData ) {
LocaleData = sap.ui.requireSync("sap/ui/core/LocaleData");
}
if (this.calendarType) {
for (sName in CalendarType) {
if (sName.toLowerCase() === this.calendarType.toLowerCase()) {
this... | javascript | function() {
var sName;
// lazy load of LocaleData to avoid cyclic dependencies
if ( !LocaleData ) {
LocaleData = sap.ui.requireSync("sap/ui/core/LocaleData");
}
if (this.calendarType) {
for (sName in CalendarType) {
if (sName.toLowerCase() === this.calendarType.toLowerCase()) {
this... | [
"function",
"(",
")",
"{",
"var",
"sName",
";",
"// lazy load of LocaleData to avoid cyclic dependencies",
"if",
"(",
"!",
"LocaleData",
")",
"{",
"LocaleData",
"=",
"sap",
".",
"ui",
".",
"requireSync",
"(",
"\"sap/ui/core/LocaleData\"",
")",
";",
"}",
"if",
"(... | Returns the calendar type which is being used in locale dependent functionality.
When it's explicitly set by calling <code>setCalendar</code>, the set calendar type is returned.
Otherwise, the calendar type is determined by checking the format settings and current locale.
@return {sap.ui.core.CalendarType} the curren... | [
"Returns",
"the",
"calendar",
"type",
"which",
"is",
"being",
"used",
"in",
"locale",
"dependent",
"functionality",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Configuration.js#L820-L860 | train | Returns the calendar type of the current locale | [
30522,
3853,
1006,
1007,
1063,
13075,
1055,
18442,
1025,
1013,
1013,
13971,
7170,
1997,
2334,
11960,
2696,
2000,
4468,
23750,
12530,
15266,
2065,
1006,
999,
2334,
11960,
2696,
1007,
1063,
2334,
11960,
2696,
1027,
20066,
1012,
21318,
1012,
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... | |
adobe/brackets | src/search/FindReplace.js | _selectAndScrollTo | function _selectAndScrollTo(editor, selections, center, preferNoScroll) {
var primarySelection = _.find(selections, function (sel) { return sel.primary; }) || _.last(selections),
resultVisible = editor.isLineVisible(primarySelection.start.line),
centerOptions = Editor.BOUNDARY_CHECK_NORM... | javascript | function _selectAndScrollTo(editor, selections, center, preferNoScroll) {
var primarySelection = _.find(selections, function (sel) { return sel.primary; }) || _.last(selections),
resultVisible = editor.isLineVisible(primarySelection.start.line),
centerOptions = Editor.BOUNDARY_CHECK_NORM... | [
"function",
"_selectAndScrollTo",
"(",
"editor",
",",
"selections",
",",
"center",
",",
"preferNoScroll",
")",
"{",
"var",
"primarySelection",
"=",
"_",
".",
"find",
"(",
"selections",
",",
"function",
"(",
"sel",
")",
"{",
"return",
"sel",
".",
"primary",
... | @private
Sets the given selections in the editor and applies some heuristics to determine whether and how we should
center the primary selection.
@param {!Editor} editor The editor to search in
@param {!Array<{start:{line:number, ch:number}, end:{line:number, ch:number}, primary:boolean, reversed: boolean}>} selection... | [
"@private",
"Sets",
"the",
"given",
"selections",
"in",
"the",
"editor",
"and",
"applies",
"some",
"heuristics",
"to",
"determine",
"whether",
"and",
"how",
"we",
"should",
"center",
"the",
"primary",
"selection",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindReplace.js#L212-L232 | train | Scrolls the given selection to the given center. | [
30522,
3853,
1035,
7276,
29560,
26775,
14511,
3406,
1006,
3559,
1010,
16310,
1010,
2415,
1010,
9544,
15460,
26775,
14511,
1007,
1063,
13075,
3078,
11246,
18491,
1027,
1035,
1012,
2424,
1006,
16310,
1010,
3853,
1006,
7367,
2140,
1007,
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... |
ColorlibHQ/AdminLTE | build/js/BoxRefresh.js | function (element, options) {
this.element = element;
this.options = options;
this.$overlay = $(options.overlayTemplate);
if (options.source === '') {
throw new Error('Source url was not defined. Please specify a url in your BoxRefresh source option.');
}
this._setUpListeners();
th... | javascript | function (element, options) {
this.element = element;
this.options = options;
this.$overlay = $(options.overlayTemplate);
if (options.source === '') {
throw new Error('Source url was not defined. Please specify a url in your BoxRefresh source option.');
}
this._setUpListeners();
th... | [
"function",
"(",
"element",
",",
"options",
")",
"{",
"this",
".",
"element",
"=",
"element",
";",
"this",
".",
"options",
"=",
"options",
";",
"this",
".",
"$overlay",
"=",
"$",
"(",
"options",
".",
"overlayTemplate",
")",
";",
"if",
"(",
"options",
... | BoxRefresh Class Definition ========================= | [
"BoxRefresh",
"Class",
"Definition",
"========================="
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/build/js/BoxRefresh.js#L35-L46 | train | Constructor for the BoxRefresh class | [
30522,
3853,
1006,
5783,
1010,
7047,
1007,
1063,
2023,
1012,
5783,
1027,
5783,
1025,
2023,
1012,
7047,
1027,
7047,
1025,
2023,
1012,
1002,
2058,
8485,
1027,
1002,
1006,
7047,
1012,
2058,
8485,
18532,
15725,
1007,
1025,
2065,
1006,
7047,
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... | |
badges/shields | lib/logos.js | decodeDataUrlFromQueryParam | function decodeDataUrlFromQueryParam(value) {
if (typeof value !== 'string') {
return undefined
}
const maybeDataUrl = prependPrefix(value, 'data:')
.replace(/ /g, '+')
.replace(/\s/g, '')
return isDataUrl(maybeDataUrl) ? maybeDataUrl : undefined
} | javascript | function decodeDataUrlFromQueryParam(value) {
if (typeof value !== 'string') {
return undefined
}
const maybeDataUrl = prependPrefix(value, 'data:')
.replace(/ /g, '+')
.replace(/\s/g, '')
return isDataUrl(maybeDataUrl) ? maybeDataUrl : undefined
} | [
"function",
"decodeDataUrlFromQueryParam",
"(",
"value",
")",
"{",
"if",
"(",
"typeof",
"value",
"!==",
"'string'",
")",
"{",
"return",
"undefined",
"}",
"const",
"maybeDataUrl",
"=",
"prependPrefix",
"(",
"value",
",",
"'data:'",
")",
".",
"replace",
"(",
"... | +'s are replaced with spaces when used in query params, this returns them to +'s, then removes remaining whitespace. https://github.com/badges/shields/pull/1546 | [
"+",
"s",
"are",
"replaced",
"with",
"spaces",
"when",
"used",
"in",
"query",
"params",
"this",
"returns",
"them",
"to",
"+",
"s",
"then",
"removes",
"remaining",
"whitespace",
".",
"https",
":",
"//",
"github",
".",
"com",
"/",
"badges",
"/",
"shields",... | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/lib/logos.js#L40-L48 | train | Decode data url from query string | [
30522,
3853,
21933,
5732,
6790,
3126,
10270,
21716,
4226,
2854,
28689,
2213,
1006,
3643,
1007,
1063,
2065,
1006,
2828,
11253,
3643,
999,
1027,
1027,
1005,
5164,
1005,
1007,
1063,
2709,
6151,
28344,
1065,
9530,
3367,
2672,
2850,
2696,
3126,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/lib/_Helper.js | function (mQueryOptions, sPath) {
sPath = sPath[0] === "("
? _Helper.getMetaPath(sPath).slice(1) // avoid leading "/"
: _Helper.getMetaPath(sPath);
if (sPath) {
sPath.split("/").some(function (sSegment) {
mQueryOptions = mQueryOptions && mQueryOptions.$expand
&& mQueryOptions.$expand[sSegme... | javascript | function (mQueryOptions, sPath) {
sPath = sPath[0] === "("
? _Helper.getMetaPath(sPath).slice(1) // avoid leading "/"
: _Helper.getMetaPath(sPath);
if (sPath) {
sPath.split("/").some(function (sSegment) {
mQueryOptions = mQueryOptions && mQueryOptions.$expand
&& mQueryOptions.$expand[sSegme... | [
"function",
"(",
"mQueryOptions",
",",
"sPath",
")",
"{",
"sPath",
"=",
"sPath",
"[",
"0",
"]",
"===",
"\"(\"",
"?",
"_Helper",
".",
"getMetaPath",
"(",
"sPath",
")",
".",
"slice",
"(",
"1",
")",
"// avoid leading \"/\"",
":",
"_Helper",
".",
"getMetaPat... | Returns the properties that have been selected for the given path.
@param {object} [mQueryOptions]
A map of query options as returned by
{@link sap.ui.model.odata.v4.ODataModel#buildQueryOptions}
@param {string} sPath
The path of the cache value in the cache
@returns {string[]} aSelect
The properties that have been se... | [
"Returns",
"the",
"properties",
"that",
"have",
"been",
"selected",
"for",
"the",
"given",
"path",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L650-L662 | train | Get the query options for the given path | [
30522,
3853,
1006,
1049,
4226,
2854,
7361,
9285,
1010,
14690,
2232,
1007,
1063,
14690,
2232,
1027,
14690,
2232,
1031,
1014,
1033,
1027,
1027,
1027,
1000,
1006,
1000,
1029,
1035,
2393,
2121,
1012,
2131,
11368,
22068,
2705,
1006,
14690,
2232,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/datepicker/js/calendarYearBody.js | mdCalendarYearDirective | function mdCalendarYearDirective() {
return {
require: ['^^mdCalendar', '^^mdCalendarYear', 'mdCalendarYearBody'],
scope: { offset: '=mdYearOffset' },
controller: CalendarYearBodyCtrl,
controllerAs: 'mdYearBodyCtrl',
bindToController: true,
link: function(scope, element, attrs, c... | javascript | function mdCalendarYearDirective() {
return {
require: ['^^mdCalendar', '^^mdCalendarYear', 'mdCalendarYearBody'],
scope: { offset: '=mdYearOffset' },
controller: CalendarYearBodyCtrl,
controllerAs: 'mdYearBodyCtrl',
bindToController: true,
link: function(scope, element, attrs, c... | [
"function",
"mdCalendarYearDirective",
"(",
")",
"{",
"return",
"{",
"require",
":",
"[",
"'^^mdCalendar'",
",",
"'^^mdCalendarYear'",
",",
"'mdCalendarYearBody'",
"]",
",",
"scope",
":",
"{",
"offset",
":",
"'=mdYearOffset'",
"}",
",",
"controller",
":",
"Calen... | Private component, consumed by the md-calendar-year, which separates the DOM construction logic
and allows for the year view to use md-virtual-repeat. | [
"Private",
"component",
"consumed",
"by",
"the",
"md",
"-",
"calendar",
"-",
"year",
"which",
"separates",
"the",
"DOM",
"construction",
"logic",
"and",
"allows",
"for",
"the",
"year",
"view",
"to",
"use",
"md",
"-",
"virtual",
"-",
"repeat",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendarYearBody.js#L11-L33 | train | A directive that allows you to control the year of the calendar. | [
30522,
3853,
9108,
9289,
10497,
5649,
14644,
4305,
2890,
15277,
1006,
1007,
1063,
2709,
1063,
5478,
1024,
1031,
1005,
1034,
1034,
9108,
9289,
10497,
2906,
1005,
1010,
1005,
1034,
1034,
9108,
9289,
10497,
5649,
14644,
1005,
1010,
1005,
9108,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
keplergl/kepler.gl | src/components/container.js | flattenDeps | function flattenDeps(allDeps, factory) {
const addToDeps = allDeps.concat([factory]);
return Array.isArray(factory.deps) && factory.deps.length ?
factory.deps.reduce((accu, dep) => flattenDeps(accu, dep), addToDeps) :
addToDeps;
} | javascript | function flattenDeps(allDeps, factory) {
const addToDeps = allDeps.concat([factory]);
return Array.isArray(factory.deps) && factory.deps.length ?
factory.deps.reduce((accu, dep) => flattenDeps(accu, dep), addToDeps) :
addToDeps;
} | [
"function",
"flattenDeps",
"(",
"allDeps",
",",
"factory",
")",
"{",
"const",
"addToDeps",
"=",
"allDeps",
".",
"concat",
"(",
"[",
"factory",
"]",
")",
";",
"return",
"Array",
".",
"isArray",
"(",
"factory",
".",
"deps",
")",
"&&",
"factory",
".",
"de... | entryPoint | [
"entryPoint"
] | 779238435707cc54335c2d00001e4b9334b314aa | https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/src/components/container.js#L144-L149 | train | flatten deps array | [
30522,
3853,
4257,
6528,
3207,
4523,
1006,
2035,
3207,
4523,
1010,
4713,
1007,
1063,
9530,
3367,
5587,
3406,
3207,
4523,
1027,
2035,
3207,
4523,
1012,
9530,
11266,
1006,
1031,
4713,
1033,
1007,
1025,
2709,
9140,
1012,
18061,
11335,
2100,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/core/component.js | function (value) {
var parsedValue;
if (typeof value !== 'string') { return value; }
if (this.isSingleProperty) {
parsedValue = this.schema.parse(value);
/**
* To avoid bogus double parsings. Cached values will be parsed when building
* component data. For instance when parsing a s... | javascript | function (value) {
var parsedValue;
if (typeof value !== 'string') { return value; }
if (this.isSingleProperty) {
parsedValue = this.schema.parse(value);
/**
* To avoid bogus double parsings. Cached values will be parsed when building
* component data. For instance when parsing a s... | [
"function",
"(",
"value",
")",
"{",
"var",
"parsedValue",
";",
"if",
"(",
"typeof",
"value",
"!==",
"'string'",
")",
"{",
"return",
"value",
";",
"}",
"if",
"(",
"this",
".",
"isSingleProperty",
")",
"{",
"parsedValue",
"=",
"this",
".",
"schema",
".",... | Given an HTML attribute value parses the string based on the component schema.
To avoid double parsings of strings into strings we store the original instead
of the parsed one
@param {string} value - HTML attribute value | [
"Given",
"an",
"HTML",
"attribute",
"value",
"parses",
"the",
"string",
"based",
"on",
"the",
"component",
"schema",
".",
"To",
"avoid",
"double",
"parsings",
"of",
"strings",
"into",
"strings",
"we",
"store",
"the",
"original",
"instead",
"of",
"the",
"pars... | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/component.js#L236-L254 | train | Parses the given value. | [
30522,
3853,
1006,
3643,
1007,
1063,
13075,
11968,
6924,
10175,
5657,
1025,
2065,
1006,
2828,
11253,
3643,
999,
1027,
1027,
1005,
5164,
1005,
1007,
1063,
2709,
3643,
1025,
1065,
2065,
1006,
2023,
1012,
26354,
2075,
2571,
21572,
4842,
3723,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... | |
mdx-js/mdx | packages/mdx/mdx-hast-to-jsx.js | toJSX | function toJSX(node, parentNode = {}, options = {}) {
const {
// Default options
skipExport = false,
preserveNewlines = false,
wrapExport
} = options
let children = ''
if (node.properties != null) {
// Turn style strings into JSX-friendly style object
if (typeof node.properties.style ==... | javascript | function toJSX(node, parentNode = {}, options = {}) {
const {
// Default options
skipExport = false,
preserveNewlines = false,
wrapExport
} = options
let children = ''
if (node.properties != null) {
// Turn style strings into JSX-friendly style object
if (typeof node.properties.style ==... | [
"function",
"toJSX",
"(",
"node",
",",
"parentNode",
"=",
"{",
"}",
",",
"options",
"=",
"{",
"}",
")",
"{",
"const",
"{",
"// Default options",
"skipExport",
"=",
"false",
",",
"preserveNewlines",
"=",
"false",
",",
"wrapExport",
"}",
"=",
"options",
"l... | eslint-disable-next-line complexity | [
"eslint",
"-",
"disable",
"-",
"next",
"-",
"line",
"complexity"
] | 7433324d209aca541ea72cb93fe570685b364b9f | https://github.com/mdx-js/mdx/blob/7433324d209aca541ea72cb93fe570685b364b9f/packages/mdx/mdx-hast-to-jsx.js#L65-L268 | train | Convert a node to JSX | [
30522,
3853,
2000,
22578,
2595,
1006,
13045,
1010,
6687,
3630,
3207,
1027,
1063,
1065,
1010,
7047,
1027,
1063,
1065,
1007,
1063,
9530,
3367,
1063,
1013,
1013,
12398,
7047,
13558,
10288,
6442,
1027,
6270,
1010,
7969,
2638,
13668,
10586,
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... |
mochajs/mocha | lib/runner.js | filterLeaks | function filterLeaks(ok, globals) {
return globals.filter(function(key) {
// Firefox and Chrome exposes iframes as index inside the window object
if (/^\d+/.test(key)) {
return false;
}
// in firefox
// if runner runs in an iframe, this iframe's window.getInterface method
// not init at... | javascript | function filterLeaks(ok, globals) {
return globals.filter(function(key) {
// Firefox and Chrome exposes iframes as index inside the window object
if (/^\d+/.test(key)) {
return false;
}
// in firefox
// if runner runs in an iframe, this iframe's window.getInterface method
// not init at... | [
"function",
"filterLeaks",
"(",
"ok",
",",
"globals",
")",
"{",
"return",
"globals",
".",
"filter",
"(",
"function",
"(",
"key",
")",
"{",
"// Firefox and Chrome exposes iframes as index inside the window object",
"if",
"(",
"/",
"^\\d+",
"/",
".",
"test",
"(",
... | Filter leaks with the given globals flagged as `ok`.
@private
@param {Array} ok
@param {Array} globals
@return {Array} | [
"Filter",
"leaks",
"with",
"the",
"given",
"globals",
"flagged",
"as",
"ok",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/runner.js#L958-L991 | train | filterLeaks returns true if any of the globals is not present in the ok array | [
30522,
3853,
11307,
19738,
5705,
1006,
7929,
1010,
3795,
2015,
1007,
1063,
2709,
3795,
2015,
1012,
11307,
1006,
3853,
1006,
3145,
1007,
1063,
1013,
1013,
2543,
14876,
2595,
1998,
18546,
14451,
2015,
2065,
6444,
2229,
2004,
5950,
2503,
1996,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableGrouping.js | function(oTable) {
var oBinding = oTable.getBinding("rows");
if (oBinding && oBinding._modified) {
TableGrouping.clearMode(oTable);
var oBindingInfo = oTable.getBindingInfo("rows");
oTable.unbindRows();
oTable.bindRows(oBindingInfo);
}
} | javascript | function(oTable) {
var oBinding = oTable.getBinding("rows");
if (oBinding && oBinding._modified) {
TableGrouping.clearMode(oTable);
var oBindingInfo = oTable.getBindingInfo("rows");
oTable.unbindRows();
oTable.bindRows(oBindingInfo);
}
} | [
"function",
"(",
"oTable",
")",
"{",
"var",
"oBinding",
"=",
"oTable",
".",
"getBinding",
"(",
"\"rows\"",
")",
";",
"if",
"(",
"oBinding",
"&&",
"oBinding",
".",
"_modified",
")",
"{",
"TableGrouping",
".",
"clearMode",
"(",
"oTable",
")",
";",
"var",
... | Cleans up the experimental grouping for sap.ui.table.Table.
@param {sap.ui.table.Table} oTable Instance of the table. | [
"Cleans",
"up",
"the",
"experimental",
"grouping",
"for",
"sap",
".",
"ui",
".",
"table",
".",
"Table",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableGrouping.js#L681-L689 | train | Removes all rows bindings and sets the table to the default mode. | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
13075,
27885,
22254,
2075,
1027,
27178,
3085,
1012,
2131,
8428,
4667,
1006,
1000,
10281,
1000,
1007,
1025,
2065,
1006,
27885,
22254,
2075,
1004,
1004,
27885,
22254,
2075,
1012,
1035,
6310,
1007,
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... | |
apache/incubator-echarts | src/component/graphic.js | getCleanedElOption | function getCleanedElOption(elOption) {
elOption = zrUtil.extend({}, elOption);
zrUtil.each(
['id', 'parentId', '$action', 'hv', 'bounding'].concat(layoutUtil.LOCATION_PARAMS),
function (name) {
delete elOption[name];
}
);
return elOption;
} | javascript | function getCleanedElOption(elOption) {
elOption = zrUtil.extend({}, elOption);
zrUtil.each(
['id', 'parentId', '$action', 'hv', 'bounding'].concat(layoutUtil.LOCATION_PARAMS),
function (name) {
delete elOption[name];
}
);
return elOption;
} | [
"function",
"getCleanedElOption",
"(",
"elOption",
")",
"{",
"elOption",
"=",
"zrUtil",
".",
"extend",
"(",
"{",
"}",
",",
"elOption",
")",
";",
"zrUtil",
".",
"each",
"(",
"[",
"'id'",
",",
"'parentId'",
",",
"'$action'",
",",
"'hv'",
",",
"'bounding'",... | Remove unnecessary props to avoid potential problems. | [
"Remove",
"unnecessary",
"props",
"to",
"avoid",
"potential",
"problems",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/component/graphic.js#L439-L448 | train | Returns an object with the cleared parameters | [
30522,
3853,
2131,
14321,
7231,
9247,
7361,
3508,
1006,
3449,
7361,
3508,
1007,
1063,
3449,
7361,
3508,
1027,
1062,
22134,
4014,
1012,
7949,
1006,
1063,
1065,
1010,
3449,
7361,
3508,
1007,
1025,
1062,
22134,
4014,
1012,
2169,
1006,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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)
{
var nsMatch;
var from = null;
if (this.options.matchBare) {
from = Strophe.getBareJidFromJid(elem.getAttribute('from'));
} else {
from = elem.getAttribute('from');
}
nsMatch = false;
if (!this.ns) {
... | javascript | function (elem)
{
var nsMatch;
var from = null;
if (this.options.matchBare) {
from = Strophe.getBareJidFromJid(elem.getAttribute('from'));
} else {
from = elem.getAttribute('from');
}
nsMatch = false;
if (!this.ns) {
... | [
"function",
"(",
"elem",
")",
"{",
"var",
"nsMatch",
";",
"var",
"from",
"=",
"null",
";",
"if",
"(",
"this",
".",
"options",
".",
"matchBare",
")",
"{",
"from",
"=",
"Strophe",
".",
"getBareJidFromJid",
"(",
"elem",
".",
"getAttribute",
"(",
"'from'",... | PrivateFunction: isMatch
Tests if a stanza matches the Strophe.Handler.
Parameters:
(XMLElement) elem - The XML element to test.
Returns:
true if the stanza matches and false otherwise. | [
"PrivateFunction",
":",
"isMatch",
"Tests",
"if",
"a",
"stanza",
"matches",
"the",
"Strophe",
".",
"Handler",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L1838-L1873 | train | Returns true if the element is a child of the tag | [
30522,
3853,
1006,
3449,
6633,
1007,
1063,
13075,
24978,
18900,
2818,
1025,
13075,
2013,
1027,
19701,
1025,
2065,
1006,
2023,
1012,
7047,
1012,
2674,
8237,
2063,
1007,
1063,
2013,
1027,
2358,
18981,
5369,
1012,
2131,
8237,
20518,
3593,
1969... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
apache/incubator-echarts | src/coord/parallel/Parallel.js | function (parallelModel, api) {
this._rect = layoutUtil.getLayoutRect(
parallelModel.getBoxLayoutParams(),
{
width: api.getWidth(),
height: api.getHeight()
}
);
this._layoutAxes();
} | javascript | function (parallelModel, api) {
this._rect = layoutUtil.getLayoutRect(
parallelModel.getBoxLayoutParams(),
{
width: api.getWidth(),
height: api.getHeight()
}
);
this._layoutAxes();
} | [
"function",
"(",
"parallelModel",
",",
"api",
")",
"{",
"this",
".",
"_rect",
"=",
"layoutUtil",
".",
"getLayoutRect",
"(",
"parallelModel",
".",
"getBoxLayoutParams",
"(",
")",
",",
"{",
"width",
":",
"api",
".",
"getWidth",
"(",
")",
",",
"height",
":"... | Resize the parallel coordinate system.
@param {module:echarts/coord/parallel/ParallelModel} parallelModel
@param {module:echarts/ExtensionAPI} api | [
"Resize",
"the",
"parallel",
"coordinate",
"system",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/parallel/Parallel.js#L176-L186 | train | Initialize the layout | [
30522,
3853,
1006,
5903,
5302,
9247,
1010,
17928,
1007,
1063,
2023,
1012,
1035,
28667,
2102,
1027,
9621,
21823,
2140,
1012,
2131,
8485,
5833,
2890,
6593,
1006,
5903,
5302,
9247,
1012,
2131,
8758,
8485,
5833,
28689,
5244,
1006,
1007,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
firebase/firebaseui-web | javascript/widgets/handler/phonesigninfinish.js | function(userCredential) {
component.dismissDialog();
// Show code verified dialog.
component.showProgressDialog(
firebaseui.auth.ui.element.progressDialog.State.DONE,
firebaseui.auth.soy2.strings.dialogCodeVerified().toString());
// Keep on display for long enoug... | javascript | function(userCredential) {
component.dismissDialog();
// Show code verified dialog.
component.showProgressDialog(
firebaseui.auth.ui.element.progressDialog.State.DONE,
firebaseui.auth.soy2.strings.dialogCodeVerified().toString());
// Keep on display for long enoug... | [
"function",
"(",
"userCredential",
")",
"{",
"component",
".",
"dismissDialog",
"(",
")",
";",
"// Show code verified dialog.",
"component",
".",
"showProgressDialog",
"(",
"firebaseui",
".",
"auth",
".",
"ui",
".",
"element",
".",
"progressDialog",
".",
"State",
... | On success a user credential is returned. | [
"On",
"success",
"a",
"user",
"credential",
"is",
"returned",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/phonesigninfinish.js#L141-L171 | train | Sign - in with a user credential. | [
30522,
3853,
1006,
5310,
16748,
16454,
4818,
1007,
1063,
6922,
1012,
19776,
27184,
8649,
1006,
1007,
1025,
1013,
1013,
2265,
3642,
20119,
13764,
8649,
1012,
6922,
1012,
2265,
21572,
17603,
4757,
27184,
8649,
1006,
2543,
15058,
10179,
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... | |
adobe/brackets | src/language/LanguageManager.js | _getLanguageForMode | function _getLanguageForMode(mode) {
var language = _modeToLanguageMap[mode];
if (language) {
return language;
}
// In case of unsupported languages
console.log("Called LanguageManager._getLanguageForMode with a mode for which no language has been registered:", mode)... | javascript | function _getLanguageForMode(mode) {
var language = _modeToLanguageMap[mode];
if (language) {
return language;
}
// In case of unsupported languages
console.log("Called LanguageManager._getLanguageForMode with a mode for which no language has been registered:", mode)... | [
"function",
"_getLanguageForMode",
"(",
"mode",
")",
"{",
"var",
"language",
"=",
"_modeToLanguageMap",
"[",
"mode",
"]",
";",
"if",
"(",
"language",
")",
"{",
"return",
"language",
";",
"}",
"// In case of unsupported languages",
"console",
".",
"log",
"(",
"... | Resolves a CodeMirror mode to a Language object.
@param {!string} mode CodeMirror mode
@return {Language} The language for the provided mode or the fallback language | [
"Resolves",
"a",
"CodeMirror",
"mode",
"to",
"a",
"Language",
"object",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/LanguageManager.js#L340-L349 | train | Returns the language for the given mode | [
30522,
3853,
1035,
2131,
25023,
6692,
3351,
14192,
10244,
1006,
5549,
1007,
1063,
13075,
2653,
1027,
1035,
5549,
3406,
25023,
6692,
3351,
2863,
2361,
1031,
5549,
1033,
1025,
2065,
1006,
2653,
1007,
1063,
2709,
2653,
1025,
1065,
1013,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
thomaspark/bootswatch | docs/_vendor/popper.js/dist/popper.js | getScrollParent | function getScrollParent(element) {
// Return body, `getScroll` will take care to get the correct `scrollTop` from it
if (!element) {
return document.body;
}
switch (element.nodeName) {
case 'HTML':
case 'BODY':
return element.ownerDocument.body;
case '#document':
return element.bod... | javascript | function getScrollParent(element) {
// Return body, `getScroll` will take care to get the correct `scrollTop` from it
if (!element) {
return document.body;
}
switch (element.nodeName) {
case 'HTML':
case 'BODY':
return element.ownerDocument.body;
case '#document':
return element.bod... | [
"function",
"getScrollParent",
"(",
"element",
")",
"{",
"// Return body, `getScroll` will take care to get the correct `scrollTop` from it",
"if",
"(",
"!",
"element",
")",
"{",
"return",
"document",
".",
"body",
";",
"}",
"switch",
"(",
"element",
".",
"nodeName",
"... | Returns the scrolling parent of the given element
@method
@memberof Popper.Utils
@argument {Element} element
@returns {Element} scroll parent | [
"Returns",
"the",
"scrolling",
"parent",
"of",
"the",
"given",
"element"
] | a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd | https://github.com/thomaspark/bootswatch/blob/a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd/docs/_vendor/popper.js/dist/popper.js#L126-L147 | train | Get the scroll parent of an element | [
30522,
3853,
4152,
26775,
14511,
19362,
4765,
1006,
5783,
1007,
1063,
1013,
1013,
2709,
2303,
1010,
1036,
4152,
26775,
14511,
1036,
2097,
2202,
2729,
2000,
2131,
1996,
6149,
1036,
17186,
14399,
1036,
2013,
2009,
2065,
1006,
999,
5783,
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... |
zloirock/core-js | packages/core-js/internals/collection-strong.js | clear | function clear() {
var that = this;
var state = getInternalState(that);
var data = state.index;
var entry = state.first;
while (entry) {
entry.removed = true;
if (entry.previous) entry.previous = entry.previous.next = undefined;
delete data[entry.ind... | javascript | function clear() {
var that = this;
var state = getInternalState(that);
var data = state.index;
var entry = state.first;
while (entry) {
entry.removed = true;
if (entry.previous) entry.previous = entry.previous.next = undefined;
delete data[entry.ind... | [
"function",
"clear",
"(",
")",
"{",
"var",
"that",
"=",
"this",
";",
"var",
"state",
"=",
"getInternalState",
"(",
"that",
")",
";",
"var",
"data",
"=",
"state",
".",
"index",
";",
"var",
"entry",
"=",
"state",
".",
"first",
";",
"while",
"(",
"ent... | 23.1.3.1 Map.prototype.clear() 23.2.3.2 Set.prototype.clear() | [
"23",
".",
"1",
".",
"3",
".",
"1",
"Map",
".",
"prototype",
".",
"clear",
"()",
"23",
".",
"2",
".",
"3",
".",
"2",
"Set",
".",
"prototype",
".",
"clear",
"()"
] | fe7c8511a6d27d03a9b8e075b3351416aae95c58 | https://github.com/zloirock/core-js/blob/fe7c8511a6d27d03a9b8e075b3351416aae95c58/packages/core-js/internals/collection-strong.js#L74-L88 | train | Clear the cache | [
30522,
3853,
3154,
1006,
1007,
1063,
13075,
2008,
1027,
2023,
1025,
13075,
2110,
1027,
2131,
18447,
11795,
9777,
12259,
1006,
2008,
1007,
1025,
13075,
2951,
1027,
2110,
1012,
5950,
1025,
13075,
4443,
1027,
2110,
1012,
2034,
1025,
2096,
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... |
moment/luxon | src/datetime.js | possiblyCachedWeekData | function possiblyCachedWeekData(dt) {
if (dt.weekData === null) {
dt.weekData = gregorianToWeek(dt.c);
}
return dt.weekData;
} | javascript | function possiblyCachedWeekData(dt) {
if (dt.weekData === null) {
dt.weekData = gregorianToWeek(dt.c);
}
return dt.weekData;
} | [
"function",
"possiblyCachedWeekData",
"(",
"dt",
")",
"{",
"if",
"(",
"dt",
".",
"weekData",
"===",
"null",
")",
"{",
"dt",
".",
"weekData",
"=",
"gregorianToWeek",
"(",
"dt",
".",
"c",
")",
";",
"}",
"return",
"dt",
".",
"weekData",
";",
"}"
] | we cache week data on the DT object and this intermediates the cache | [
"we",
"cache",
"week",
"data",
"on",
"the",
"DT",
"object",
"and",
"this",
"intermediates",
"the",
"cache"
] | 236f2badea297ee73421aa39a83e06177c1be6d0 | https://github.com/moment/luxon/blob/236f2badea297ee73421aa39a83e06177c1be6d0/src/datetime.js#L52-L57 | train | Returns week data from cache | [
30522,
3853,
4298,
3540,
7690,
28075,
2850,
2696,
1006,
26718,
1007,
1063,
2065,
1006,
26718,
1012,
2733,
2850,
2696,
1027,
1027,
1027,
19701,
1007,
1063,
26718,
1012,
2733,
2850,
2696,
1027,
25847,
18790,
4402,
2243,
1006,
26718,
1012,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/chart/treemap/treemapLayout.js | sort | function sort(viewChildren, orderBy) {
if (orderBy) {
viewChildren.sort(function (a, b) {
var diff = orderBy === 'asc'
? a.getValue() - b.getValue() : b.getValue() - a.getValue();
return diff === 0
? (orderBy === 'asc'
? a.dataIndex... | javascript | function sort(viewChildren, orderBy) {
if (orderBy) {
viewChildren.sort(function (a, b) {
var diff = orderBy === 'asc'
? a.getValue() - b.getValue() : b.getValue() - a.getValue();
return diff === 0
? (orderBy === 'asc'
? a.dataIndex... | [
"function",
"sort",
"(",
"viewChildren",
",",
"orderBy",
")",
"{",
"if",
"(",
"orderBy",
")",
"{",
"viewChildren",
".",
"sort",
"(",
"function",
"(",
"a",
",",
"b",
")",
"{",
"var",
"diff",
"=",
"orderBy",
"===",
"'asc'",
"?",
"a",
".",
"getValue",
... | Sort | [
"Sort"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/treemap/treemapLayout.js#L344-L357 | train | sorts the viewChildren array | [
30522,
3853,
4066,
1006,
3193,
19339,
7389,
1010,
2344,
3762,
1007,
1063,
2065,
1006,
2344,
3762,
1007,
1063,
3193,
19339,
7389,
1012,
4066,
1006,
3853,
1006,
1037,
1010,
1038,
1007,
1063,
13075,
4487,
4246,
1027,
2344,
3762,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/ODataTreeBindingAdapter.js | function() {
// ensure only TreeBindings are enhanced which have not been enhanced yet
if (!(this instanceof TreeBinding) || this._bIsAdapted) {
return;
}
TreeBindingAdapter.apply(this);
// apply the methods of the adapters prototype to the TreeBinding instance
for (var fn in ODataTreeBindingAdapter.p... | javascript | function() {
// ensure only TreeBindings are enhanced which have not been enhanced yet
if (!(this instanceof TreeBinding) || this._bIsAdapted) {
return;
}
TreeBindingAdapter.apply(this);
// apply the methods of the adapters prototype to the TreeBinding instance
for (var fn in ODataTreeBindingAdapter.p... | [
"function",
"(",
")",
"{",
"// ensure only TreeBindings are enhanced which have not been enhanced yet",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"TreeBinding",
")",
"||",
"this",
".",
"_bIsAdapted",
")",
"{",
"return",
";",
"}",
"TreeBindingAdapter",
".",
"apply",
... | Adapter for TreeBindings to add the ListBinding functionality and use the
tree structure in list based controls.
Only usable with the sap.ui.table.TreeTable control.
The functions defined here are only available when you are using a TreeTable and an ODataModel.
@alias sap.ui.model.odata.ODataTreeBindingAdapter
@functi... | [
"Adapter",
"for",
"TreeBindings",
"to",
"add",
"the",
"ListBinding",
"functionality",
"and",
"use",
"the",
"tree",
"structure",
"in",
"list",
"based",
"controls",
".",
"Only",
"usable",
"with",
"the",
"sap",
".",
"ui",
".",
"table",
".",
"TreeTable",
"contro... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/ODataTreeBindingAdapter.js#L22-L66 | train | Creates a new TreeBinding instance. | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
5676,
2069,
3392,
8428,
4667,
2015,
2024,
9412,
2029,
2031,
2025,
2042,
9412,
2664,
2065,
1006,
999,
1006,
2023,
6013,
11253,
3392,
8428,
4667,
1007,
1064,
1064,
2023,
1012,
1035,
20377,
8447,
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... | |
apache/incubator-echarts | src/chart/heatmap/HeatmapLayer.js | function (data, width, height, normalize, colorFunc, isInRange) {
var brush = this._getBrush();
var gradientInRange = this._getGradient(data, colorFunc, 'inRange');
var gradientOutOfRange = this._getGradient(data, colorFunc, 'outOfRange');
var r = this.pointSize + this.blurSize;
... | javascript | function (data, width, height, normalize, colorFunc, isInRange) {
var brush = this._getBrush();
var gradientInRange = this._getGradient(data, colorFunc, 'inRange');
var gradientOutOfRange = this._getGradient(data, colorFunc, 'outOfRange');
var r = this.pointSize + this.blurSize;
... | [
"function",
"(",
"data",
",",
"width",
",",
"height",
",",
"normalize",
",",
"colorFunc",
",",
"isInRange",
")",
"{",
"var",
"brush",
"=",
"this",
".",
"_getBrush",
"(",
")",
";",
"var",
"gradientInRange",
"=",
"this",
".",
"_getGradient",
"(",
"data",
... | Renders Heatmap and returns the rendered canvas
@param {Array} data array of data, each has x, y, value
@param {number} width canvas width
@param {number} height canvas height | [
"Renders",
"Heatmap",
"and",
"returns",
"the",
"rendered",
"canvas"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/heatmap/HeatmapLayer.js#L59-L120 | train | Creates a canvas with the given data | [
30522,
3853,
1006,
2951,
1010,
9381,
1010,
4578,
1010,
3671,
4697,
1010,
3609,
11263,
12273,
1010,
2003,
2378,
24388,
2063,
1007,
1063,
13075,
8248,
1027,
2023,
1012,
1035,
2131,
18623,
1006,
1007,
1025,
13075,
17978,
2378,
24388,
2063,
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... | |
summernote/summernote | src/js/base/core/dom.js | commonAncestor | function commonAncestor(nodeA, nodeB) {
const ancestors = listAncestor(nodeA);
for (let n = nodeB; n; n = n.parentNode) {
if (ancestors.indexOf(n) > -1) return n;
}
return null; // difference document area
} | javascript | function commonAncestor(nodeA, nodeB) {
const ancestors = listAncestor(nodeA);
for (let n = nodeB; n; n = n.parentNode) {
if (ancestors.indexOf(n) > -1) return n;
}
return null; // difference document area
} | [
"function",
"commonAncestor",
"(",
"nodeA",
",",
"nodeB",
")",
"{",
"const",
"ancestors",
"=",
"listAncestor",
"(",
"nodeA",
")",
";",
"for",
"(",
"let",
"n",
"=",
"nodeB",
";",
"n",
";",
"n",
"=",
"n",
".",
"parentNode",
")",
"{",
"if",
"(",
"ance... | returns common ancestor node between two nodes.
@param {Node} nodeA
@param {Node} nodeB | [
"returns",
"common",
"ancestor",
"node",
"between",
"two",
"nodes",
"."
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L302-L308 | train | Returns the common ancestor of nodeA and nodeB | [
30522,
3853,
2691,
26755,
4263,
1006,
13045,
2050,
1010,
13045,
2497,
1007,
1063,
9530,
3367,
10748,
1027,
2862,
26755,
4263,
1006,
13045,
2050,
1007,
1025,
2005,
1006,
2292,
1050,
1027,
13045,
2497,
1025,
1050,
1025,
1050,
1027,
1050,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/blanket.js | parseAssignmentExpression | function parseAssignmentExpression() {
var token, left, right, node, startToken;
token = lookahead;
startToken = lookahead;
node = left = parseConditionalExpression();
if (matchAssign()) {
// LeftHandSideExpression
if (!isLeftHandSide(left)) {
... | javascript | function parseAssignmentExpression() {
var token, left, right, node, startToken;
token = lookahead;
startToken = lookahead;
node = left = parseConditionalExpression();
if (matchAssign()) {
// LeftHandSideExpression
if (!isLeftHandSide(left)) {
... | [
"function",
"parseAssignmentExpression",
"(",
")",
"{",
"var",
"token",
",",
"left",
",",
"right",
",",
"node",
",",
"startToken",
";",
"token",
"=",
"lookahead",
";",
"startToken",
"=",
"lookahead",
";",
"node",
"=",
"left",
"=",
"parseConditionalExpression",... | 11.13 Assignment Operators | [
"11",
".",
"13",
"Assignment",
"Operators"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L2557-L2582 | train | ECMA - 262 12. 2 Assignment | [
30522,
3853,
11968,
17310,
18719,
16206,
3672,
10288,
20110,
3258,
1006,
1007,
1063,
13075,
19204,
1010,
2187,
1010,
2157,
1010,
13045,
1010,
2707,
18715,
2368,
1025,
19204,
1027,
2298,
4430,
13775,
1025,
2707,
18715,
2368,
1027,
2298,
4430,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/ManagedObjectObserver.js | handleChange | function handleChange(sType, oObject, sName, fnCreateChange) {
var sId = oObject.getId(),
oTargetConfig = mTargets[sId];
if (oTargetConfig) {
var oChange;
for (var i = 0; i < oTargetConfig.listeners.length; i++) {
if (isObserving(oTargetConfig.configurations[i], sType, sName)) {
if (!oChange) {
... | javascript | function handleChange(sType, oObject, sName, fnCreateChange) {
var sId = oObject.getId(),
oTargetConfig = mTargets[sId];
if (oTargetConfig) {
var oChange;
for (var i = 0; i < oTargetConfig.listeners.length; i++) {
if (isObserving(oTargetConfig.configurations[i], sType, sName)) {
if (!oChange) {
... | [
"function",
"handleChange",
"(",
"sType",
",",
"oObject",
",",
"sName",
",",
"fnCreateChange",
")",
"{",
"var",
"sId",
"=",
"oObject",
".",
"getId",
"(",
")",
",",
"oTargetConfig",
"=",
"mTargets",
"[",
"sId",
"]",
";",
"if",
"(",
"oTargetConfig",
")",
... | handles the change event and pipelines it to the ManagedObjectObservers that are attached as listeners | [
"handles",
"the",
"change",
"event",
"and",
"pipelines",
"it",
"to",
"the",
"ManagedObjectObservers",
"that",
"are",
"attached",
"as",
"listeners"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ManagedObjectObserver.js#L421-L439 | train | Handles a change event from the target | [
30522,
3853,
5047,
22305,
2063,
1006,
2358,
18863,
1010,
1051,
16429,
20614,
1010,
1055,
18442,
1010,
1042,
12273,
29313,
22305,
2063,
1007,
1063,
13075,
15765,
1027,
1051,
16429,
20614,
1012,
2131,
3593,
1006,
1007,
1010,
27178,
2906,
18150,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/utils/DragAndDrop.js | stopURIListPropagation | function stopURIListPropagation(files, event) {
var types = event.dataTransfer.types;
if ((!files || !files.length) && types) { // We only want to check if a string of text was dragged into the editor
types.forEach(function (value) {
//Dragging text externally (d... | javascript | function stopURIListPropagation(files, event) {
var types = event.dataTransfer.types;
if ((!files || !files.length) && types) { // We only want to check if a string of text was dragged into the editor
types.forEach(function (value) {
//Dragging text externally (d... | [
"function",
"stopURIListPropagation",
"(",
"files",
",",
"event",
")",
"{",
"var",
"types",
"=",
"event",
".",
"dataTransfer",
".",
"types",
";",
"if",
"(",
"(",
"!",
"files",
"||",
"!",
"files",
".",
"length",
")",
"&&",
"types",
")",
"{",
"// We only... | Determines if the event contains a type list that has a URI-list.
If it does and contains an empty file list, then what is being dropped is a URL.
If that is true then we stop the event propagation and default behavior to save Brackets editor from the browser taking over.
@param {Array.<File>} files Array of File objec... | [
"Determines",
"if",
"the",
"event",
"contains",
"a",
"type",
"list",
"that",
"has",
"a",
"URI",
"-",
"list",
".",
"If",
"it",
"does",
"and",
"contains",
"an",
"empty",
"file",
"list",
"then",
"what",
"is",
"being",
"dropped",
"is",
"a",
"URL",
".",
"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/DragAndDrop.js#L72-L88 | train | Stop propagation of URI list | [
30522,
3853,
2644,
9496,
9863,
21572,
4502,
12540,
1006,
6764,
1010,
2724,
1007,
1063,
13075,
4127,
1027,
2724,
1012,
2951,
6494,
3619,
7512,
1012,
4127,
1025,
2065,
1006,
1006,
999,
6764,
1064,
1064,
999,
6764,
1012,
3091,
1007,
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... |
aframevr/aframe | src/components/sound.js | function () {
var i;
var sound;
this.isPlaying = false;
for (i = 0; i < this.pool.children.length; i++) {
sound = this.pool.children[i];
if (!sound.source || !sound.source.buffer || !sound.isPlaying || sound.isPaused) {
continue;
}
sound.isPaused = true;
sound.paus... | javascript | function () {
var i;
var sound;
this.isPlaying = false;
for (i = 0; i < this.pool.children.length; i++) {
sound = this.pool.children[i];
if (!sound.source || !sound.source.buffer || !sound.isPlaying || sound.isPaused) {
continue;
}
sound.isPaused = true;
sound.paus... | [
"function",
"(",
")",
"{",
"var",
"i",
";",
"var",
"sound",
";",
"this",
".",
"isPlaying",
"=",
"false",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"pool",
".",
"children",
".",
"length",
";",
"i",
"++",
")",
"{",
"sound",
"=... | Pause all the sounds in the pool. | [
"Pause",
"all",
"the",
"sounds",
"in",
"the",
"pool",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/sound.js#L185-L198 | train | Pause all children of this group | [
30522,
3853,
1006,
1007,
1063,
13075,
1045,
1025,
13075,
2614,
1025,
2023,
1012,
2003,
13068,
2075,
1027,
6270,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
2023,
1012,
4770,
1012,
2336,
1012,
3091,
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... | |
BrainJS/brain.js | dist/recurrent/matrix/copy.js | copy | function copy(product, left) {
product.rows = parseInt(left.rows);
product.columns = parseInt(left.columns);
product.weights = left.weights.slice(0);
product.deltas = left.deltas.slice(0);
} | javascript | function copy(product, left) {
product.rows = parseInt(left.rows);
product.columns = parseInt(left.columns);
product.weights = left.weights.slice(0);
product.deltas = left.deltas.slice(0);
} | [
"function",
"copy",
"(",
"product",
",",
"left",
")",
"{",
"product",
".",
"rows",
"=",
"parseInt",
"(",
"left",
".",
"rows",
")",
";",
"product",
".",
"columns",
"=",
"parseInt",
"(",
"left",
".",
"columns",
")",
";",
"product",
".",
"weights",
"=",... | /*
@param {Matrix} product
@param {Matrix} left | [
"/",
"*"
] | ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef | https://github.com/BrainJS/brain.js/blob/ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef/dist/recurrent/matrix/copy.js#L12-L17 | train | Copy the values from the left to the product | [
30522,
3853,
6100,
1006,
4031,
1010,
2187,
1007,
1063,
4031,
1012,
10281,
1027,
11968,
20240,
3372,
1006,
2187,
1012,
10281,
1007,
1025,
4031,
1012,
7753,
1027,
11968,
20240,
3372,
1006,
2187,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
heyui/heyui | src/plugins/popper/index.js | clockwise | function clockwise(placement) {
var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var index = validPlacements.indexOf(placement);
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
return counter ? arr.reverse() : arr;
} | javascript | function clockwise(placement) {
var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var index = validPlacements.indexOf(placement);
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
return counter ? arr.reverse() : arr;
} | [
"function",
"clockwise",
"(",
"placement",
")",
"{",
"var",
"counter",
"=",
"arguments",
".",
"length",
">",
"1",
"&&",
"arguments",
"[",
"1",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"1",
"]",
":",
"false",
";",
"var",
"index",
"=",
"validPlace... | Given an initial placement, returns all the subsequent placements
clockwise (or counter-clockwise).
@method
@memberof Popper.Utils
@argument {String} placement - A valid placement (it accepts variations)
@argument {Boolean} counter - Set to true to walk the placements counterclockwise
@returns {Array} placements inclu... | [
"Given",
"an",
"initial",
"placement",
"returns",
"all",
"the",
"subsequent",
"placements",
"clockwise",
"(",
"or",
"counter",
"-",
"clockwise",
")",
"."
] | d5405d27d994151b676eb91c12b389316d7f6679 | https://github.com/heyui/heyui/blob/d5405d27d994151b676eb91c12b389316d7f6679/src/plugins/popper/index.js#L1529-L1535 | train | Get the list of valid placements in clockwise order | [
30522,
3853,
22839,
1006,
11073,
1007,
1063,
13075,
4675,
1027,
9918,
1012,
3091,
1028,
1015,
1004,
1004,
9918,
1031,
1015,
1033,
999,
1027,
1027,
6151,
28344,
30524,
5950,
11253,
1006,
11073,
1007,
1025,
13075,
12098,
2099,
1027,
9398,
247... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mui-org/material-ui | packages/material-ui-icons/scripts/create-typings.js | run | async function run() {
console.log(`\u{1f52c} Searching for modules inside "${chalk.dim(SRC_DIR)}".`);
const files = glob.sync('!(index)*.js', { cwd: SRC_DIR });
const typings = files.map(file => createIconTyping(file));
await Promise.all([...typings, createIndexTyping(files)]);
console.log(`\u{1F5C4} Writt... | javascript | async function run() {
console.log(`\u{1f52c} Searching for modules inside "${chalk.dim(SRC_DIR)}".`);
const files = glob.sync('!(index)*.js', { cwd: SRC_DIR });
const typings = files.map(file => createIconTyping(file));
await Promise.all([...typings, createIndexTyping(files)]);
console.log(`\u{1F5C4} Writt... | [
"async",
"function",
"run",
"(",
")",
"{",
"console",
".",
"log",
"(",
"`",
"\\u{1f52c}",
"${",
"chalk",
".",
"dim",
"(",
"SRC_DIR",
")",
"}",
"`",
")",
";",
"const",
"files",
"=",
"glob",
".",
"sync",
"(",
"'!(index)*.js'",
",",
"{",
"cwd",
":",
... | Generate TypeScript. | [
"Generate",
"TypeScript",
"."
] | 1555e52367835946382fbf2a8f681de71318915d | https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/packages/material-ui-icons/scripts/create-typings.js#L33-L39 | train | Create index and index. js | [
30522,
2004,
6038,
2278,
3853,
2448,
1006,
1007,
1063,
10122,
1012,
8833,
1006,
1036,
1032,
1057,
1063,
1015,
2546,
25746,
2278,
1065,
6575,
2005,
14184,
2503,
1000,
1002,
1063,
16833,
1012,
11737,
1006,
5034,
2278,
1035,
16101,
1007,
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... |
LLK/scratch-blocks | core/flyout_base.js | function() {
var topBlocks = this.workspace_.getTopBlocks(false);
for (var i = 0, block; block = topBlocks[i]; i++) {
block.removeSelect();
}
} | javascript | function() {
var topBlocks = this.workspace_.getTopBlocks(false);
for (var i = 0, block; block = topBlocks[i]; i++) {
block.removeSelect();
}
} | [
"function",
"(",
")",
"{",
"var",
"topBlocks",
"=",
"this",
".",
"workspace_",
".",
"getTopBlocks",
"(",
"false",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"block",
";",
"block",
"=",
"topBlocks",
"[",
"i",
"]",
";",
"i",
"++",
")",
"{",
... | IE 11 is an incompetent browser that fails to fire mouseout events. When the mouse is over the background, deselect all blocks. | [
"IE",
"11",
"is",
"an",
"incompetent",
"browser",
"that",
"fails",
"to",
"fire",
"mouseout",
"events",
".",
"When",
"the",
"mouse",
"is",
"over",
"the",
"background",
"deselect",
"all",
"blocks",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/core/flyout_base.js#L563-L568 | train | Remove all the selected blocks | [
30522,
3853,
1006,
1007,
1063,
13075,
2327,
23467,
2015,
1027,
2023,
1012,
2573,
15327,
1035,
1012,
2131,
14399,
23467,
2015,
1006,
6270,
1007,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1010,
3796,
1025,
3796,
1027,
2327,
23467,
2015,
1031... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 (rect, m, style, flipH, flipV)
{
var d = mxUtils.getValue(style, mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_EAST);
flipH = (flipH != null) ? flipH : mxUtils.getValue(style, mxConstants.STYLE_FLIPH, false);
flipV = (flipV != null) ? flipV : mxUtils.getValue(style, mxConstants.STYLE_FLIPV, false);... | javascript | function (rect, m, style, flipH, flipV)
{
var d = mxUtils.getValue(style, mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_EAST);
flipH = (flipH != null) ? flipH : mxUtils.getValue(style, mxConstants.STYLE_FLIPH, false);
flipV = (flipV != null) ? flipV : mxUtils.getValue(style, mxConstants.STYLE_FLIPV, false);... | [
"function",
"(",
"rect",
",",
"m",
",",
"style",
",",
"flipH",
",",
"flipV",
")",
"{",
"var",
"d",
"=",
"mxUtils",
".",
"getValue",
"(",
"style",
",",
"mxConstants",
".",
"STYLE_DIRECTION",
",",
"mxConstants",
".",
"DIRECTION_EAST",
")",
";",
"flipH",
... | Function: getDirectedBounds
Adds the given margins to the given rectangle and rotates and flips the
rectangle according to the respective styles in style. | [
"Function",
":",
"getDirectedBounds"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L4451-L4503 | train | Updates the bounds of the given rectangle with the given style | [
30522,
3853,
1006,
28667,
2102,
1010,
1049,
1010,
2806,
1010,
11238,
2232,
1010,
11238,
2615,
1007,
1063,
13075,
1040,
1027,
25630,
21823,
4877,
1012,
2131,
10175,
5657,
1006,
2806,
1010,
25630,
8663,
12693,
3215,
1012,
2806,
1035,
3257,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/sinon-server.js | FakeXMLHttpRequest | function FakeXMLHttpRequest() {
this.readyState = FakeXMLHttpRequest.UNSENT;
this.requestHeaders = {};
this.requestBody = null;
this.status = 0;
this.statusText = "";
this.upload = new UploadProgress();
if (sinonXhr.supportsCORS) {
this.withCredentials... | javascript | function FakeXMLHttpRequest() {
this.readyState = FakeXMLHttpRequest.UNSENT;
this.requestHeaders = {};
this.requestBody = null;
this.status = 0;
this.statusText = "";
this.upload = new UploadProgress();
if (sinonXhr.supportsCORS) {
this.withCredentials... | [
"function",
"FakeXMLHttpRequest",
"(",
")",
"{",
"this",
".",
"readyState",
"=",
"FakeXMLHttpRequest",
".",
"UNSENT",
";",
"this",
".",
"requestHeaders",
"=",
"{",
"}",
";",
"this",
".",
"requestBody",
"=",
"null",
";",
"this",
".",
"status",
"=",
"0",
"... | /*jsl:end | [
"/",
"*",
"jsl",
":",
"end"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/sinon-server.js#L1030-L1061 | train | FakeXMLHttpRequest - A FakeXMLHttpRequest | [
30522,
3853,
8275,
2595,
19968,
11039,
25856,
2890,
15500,
1006,
1007,
1063,
2023,
1012,
3201,
9153,
2618,
1027,
8275,
2595,
19968,
30524,
1012,
2039,
11066,
1027,
2047,
2039,
11066,
21572,
17603,
4757,
1006,
1007,
1025,
2065,
1006,
19432,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | services/php-version.js | compare | function compare(v1, v2) {
// Omit the starting `v`.
const rawv1 = omitv(v1)
const rawv2 = omitv(v2)
let v1data, v2data
try {
v1data = numberedVersionData(rawv1)
v2data = numberedVersionData(rawv2)
} catch (e) {
return asciiVersionCompare(rawv1, rawv2)
}
// Compare the numbered part (eg, 1.... | javascript | function compare(v1, v2) {
// Omit the starting `v`.
const rawv1 = omitv(v1)
const rawv2 = omitv(v2)
let v1data, v2data
try {
v1data = numberedVersionData(rawv1)
v2data = numberedVersionData(rawv2)
} catch (e) {
return asciiVersionCompare(rawv1, rawv2)
}
// Compare the numbered part (eg, 1.... | [
"function",
"compare",
"(",
"v1",
",",
"v2",
")",
"{",
"// Omit the starting `v`.",
"const",
"rawv1",
"=",
"omitv",
"(",
"v1",
")",
"const",
"rawv2",
"=",
"omitv",
"(",
"v2",
")",
"let",
"v1data",
",",
"v2data",
"try",
"{",
"v1data",
"=",
"numberedVersio... | Return a negative value if v1 < v2, zero if v1 = v2, a positive value otherwise. See https://getcomposer.org/doc/04-schema.md#version and https://github.com/badges/shields/issues/319#issuecomment-74411045 | [
"Return",
"a",
"negative",
"value",
"if",
"v1",
"<",
"v2",
"zero",
"if",
"v1",
"=",
"v2",
"a",
"positive",
"value",
"otherwise",
".",
"See",
"https",
":",
"//",
"getcomposer",
".",
"org",
"/",
"doc",
"/",
"04",
"-",
"schema",
".",
"md#version",
"and"... | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/services/php-version.js#L122-L155 | train | Compare two version strings. | [
30522,
3853,
12826,
1006,
1058,
2487,
1010,
1058,
2475,
1007,
1063,
1013,
1013,
18168,
4183,
1996,
3225,
1036,
1058,
1036,
1012,
9530,
3367,
6315,
2615,
2487,
1027,
18168,
4183,
2615,
1006,
1058,
2487,
1007,
9530,
3367,
6315,
2615,
2475,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/create-api-index.js | cleanTree | function cleanTree (oSymbol) {
delete oSymbol.treeName;
delete oSymbol.parent;
if (oSymbol.children) {
oSymbol.children.forEach(o => cleanTree(o));
}
} | javascript | function cleanTree (oSymbol) {
delete oSymbol.treeName;
delete oSymbol.parent;
if (oSymbol.children) {
oSymbol.children.forEach(o => cleanTree(o));
}
} | [
"function",
"cleanTree",
"(",
"oSymbol",
")",
"{",
"delete",
"oSymbol",
".",
"treeName",
";",
"delete",
"oSymbol",
".",
"parent",
";",
"if",
"(",
"oSymbol",
".",
"children",
")",
"{",
"oSymbol",
".",
"children",
".",
"forEach",
"(",
"o",
"=>",
"cleanTree... | Clean tree - keep file size down | [
"Clean",
"tree",
"-",
"keep",
"file",
"size",
"down"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/create-api-index.js#L329-L335 | train | clean up the tree | [
30522,
3853,
4550,
13334,
1006,
9808,
24335,
14956,
1007,
1063,
3972,
12870,
9808,
24335,
14956,
1012,
3392,
18442,
1025,
3972,
12870,
9808,
24335,
14956,
1012,
6687,
1025,
2065,
1006,
9808,
24335,
14956,
1012,
2336,
1007,
1063,
9808,
24335,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.uxap/src/sap/uxap/component/ObjectPageComponentContainer.js | function () {
var oObjectPageLayoutInstance = null;
if (this._oComponent && this._oComponent._oView) {
oObjectPageLayoutInstance = this._oComponent._oView.byId("ObjectPageLayout");
} else {
Log.error("ObjectPageComponentContainer :: cannot find children ObjectPageLayout, has it been rendered alrea... | javascript | function () {
var oObjectPageLayoutInstance = null;
if (this._oComponent && this._oComponent._oView) {
oObjectPageLayoutInstance = this._oComponent._oView.byId("ObjectPageLayout");
} else {
Log.error("ObjectPageComponentContainer :: cannot find children ObjectPageLayout, has it been rendered alrea... | [
"function",
"(",
")",
"{",
"var",
"oObjectPageLayoutInstance",
"=",
"null",
";",
"if",
"(",
"this",
".",
"_oComponent",
"&&",
"this",
".",
"_oComponent",
".",
"_oView",
")",
"{",
"oObjectPageLayoutInstance",
"=",
"this",
".",
"_oComponent",
".",
"_oView",
".... | Returns the instantiated objectPageLayout for further api manipulations or null if not not rendered already.
@returns {sap.uxap.ObjectPageLayout} Layout instanse | [
"Returns",
"the",
"instantiated",
"objectPageLayout",
"for",
"further",
"api",
"manipulations",
"or",
"null",
"if",
"not",
"not",
"rendered",
"already",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.uxap/src/sap/uxap/component/ObjectPageComponentContainer.js#L59-L68 | train | Returns the ObjectPageLayout instance | [
30522,
3853,
1006,
1007,
1063,
13075,
1051,
16429,
20614,
13704,
8485,
5833,
7076,
26897,
1027,
19701,
1025,
2065,
1006,
2023,
1012,
1035,
1051,
9006,
29513,
3372,
1004,
1004,
2023,
1012,
1035,
1051,
9006,
29513,
3372,
1012,
1035,
1051,
858... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/cli-engine.js | validateFixTypes | function validateFixTypes(fixTypes) {
for (const fixType of fixTypes) {
if (!validFixTypes.has(fixType)) {
throw new Error(`Invalid fix type "${fixType}" found.`);
}
}
} | javascript | function validateFixTypes(fixTypes) {
for (const fixType of fixTypes) {
if (!validFixTypes.has(fixType)) {
throw new Error(`Invalid fix type "${fixType}" found.`);
}
}
} | [
"function",
"validateFixTypes",
"(",
"fixTypes",
")",
"{",
"for",
"(",
"const",
"fixType",
"of",
"fixTypes",
")",
"{",
"if",
"(",
"!",
"validFixTypes",
".",
"has",
"(",
"fixType",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"`",
"${",
"fixType",
"}",
... | ------------------------------------------------------------------------------ Helpers ------------------------------------------------------------------------------
Determines if each fix type in an array is supported by ESLint and throws
an error if not.
@param {string[]} fixTypes An array of fix types to check.
@re... | [
"------------------------------------------------------------------------------",
"Helpers",
"------------------------------------------------------------------------------",
"Determines",
"if",
"each",
"fix",
"type",
"in",
"an",
"array",
"is",
"supported",
"by",
"ESLint",
"and",
"th... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/cli-engine.js#L98-L104 | train | Validate fix types | [
30522,
3853,
9398,
3686,
8873,
18413,
18863,
2015,
1006,
8081,
13874,
2015,
1007,
1063,
2005,
1006,
9530,
3367,
8081,
13874,
1997,
8081,
13874,
2015,
1007,
1063,
2065,
1006,
999,
9398,
8873,
18413,
18863,
2015,
1012,
2038,
1006,
8081,
13874... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/WorkingSetView.js | postDropCleanup | function postDropCleanup(noRefresh) {
if (dragged) {
// re-enable stuff we turned off
_suppressSortRedrawForAllViews(false);
_suppressScrollShadowsOnAllViews(false);
}
// we don't need to refresh if the item
... | javascript | function postDropCleanup(noRefresh) {
if (dragged) {
// re-enable stuff we turned off
_suppressSortRedrawForAllViews(false);
_suppressScrollShadowsOnAllViews(false);
}
// we don't need to refresh if the item
... | [
"function",
"postDropCleanup",
"(",
"noRefresh",
")",
"{",
"if",
"(",
"dragged",
")",
"{",
"// re-enable stuff we turned off",
"_suppressSortRedrawForAllViews",
"(",
"false",
")",
";",
"_suppressScrollShadowsOnAllViews",
"(",
"false",
")",
";",
"}",
"// we don't need to... | Final Cleanup | [
"Final",
"Cleanup"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L742-L758 | train | This function is called after the drop event is fired. | [
30522,
3853,
2695,
25711,
14321,
24076,
2361,
1006,
4496,
12879,
21898,
1007,
1063,
2065,
1006,
7944,
1007,
1063,
1013,
1013,
2128,
1011,
9585,
4933,
2057,
2357,
2125,
1035,
16081,
21748,
7913,
7265,
2860,
29278,
8095,
8584,
2015,
1006,
627... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/util/XMLPreprocessor.js | getIfChildren | function getIfChildren(oIfElement) {
var oChild,
aChildren = Array.prototype.filter.call(oIfElement.childNodes, isElementNode),
i, n,
bFoundElse = false;
/*
* Tells whether the given XML DOM node is an element node.
*
* @param {Node} oNode - an XML DOM node
* @returns {boolea... | javascript | function getIfChildren(oIfElement) {
var oChild,
aChildren = Array.prototype.filter.call(oIfElement.childNodes, isElementNode),
i, n,
bFoundElse = false;
/*
* Tells whether the given XML DOM node is an element node.
*
* @param {Node} oNode - an XML DOM node
* @returns {boolea... | [
"function",
"getIfChildren",
"(",
"oIfElement",
")",
"{",
"var",
"oChild",
",",
"aChildren",
"=",
"Array",
".",
"prototype",
".",
"filter",
".",
"call",
"(",
"oIfElement",
".",
"childNodes",
",",
"isElementNode",
")",
",",
"i",
",",
"n",
",",
"bFoundElse",... | Determines the relevant children for the <template:if> element.
@param {Element} oIfElement
the <template:if> XML DOM element
@returns {Element[]}
the XML DOM element children (a <then>, zero or more <elseif> and possibly an
<else>) or null if there is no <then>
@throws {Error}
if there is an unexpected child element | [
"Determines",
"the",
"relevant",
"children",
"for",
"the",
"<template",
":",
"if",
">",
"element",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L986-L1031 | train | Returns an array of children of an If element | [
30522,
3853,
2131,
10128,
19339,
7389,
1006,
1051,
29323,
16930,
4765,
1007,
1063,
13075,
28166,
4014,
2094,
1010,
9353,
19466,
16200,
2078,
1027,
9140,
1012,
8773,
1012,
11307,
1012,
2655,
1006,
1051,
29323,
16930,
4765,
1012,
2775,
3630,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
wangfupeng1988/wangEditor | src/js/text/index.js | pHandle | function pHandle(e) {
const $selectionElem = editor.selection.getSelectionContainerElem()
const $parentElem = $selectionElem.parent()
if ($parentElem.html() === '<code><br></code>') {
// 回车之前光标所在一个 <p><code>.....</code></p> ,忽然回车生成一个空的 <p><code><br></code></p>
... | javascript | function pHandle(e) {
const $selectionElem = editor.selection.getSelectionContainerElem()
const $parentElem = $selectionElem.parent()
if ($parentElem.html() === '<code><br></code>') {
// 回车之前光标所在一个 <p><code>.....</code></p> ,忽然回车生成一个空的 <p><code><br></code></p>
... | [
"function",
"pHandle",
"(",
"e",
")",
"{",
"const",
"$selectionElem",
"=",
"editor",
".",
"selection",
".",
"getSelectionContainerElem",
"(",
")",
"const",
"$parentElem",
"=",
"$selectionElem",
".",
"parent",
"(",
")",
"if",
"(",
"$parentElem",
".",
"html",
... | 将回车之后生成的非 <p> 的顶级标签,改为 <p> | [
"将回车之后生成的非",
"<p",
">",
"的顶级标签,改为",
"<p",
">"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/text/index.js#L186-L215 | train | Handle the p event | [
30522,
3853,
6887,
5685,
2571,
1006,
1041,
1007,
1063,
9530,
3367,
1002,
4989,
12260,
2213,
1027,
3559,
1012,
4989,
1012,
4152,
12260,
7542,
8663,
18249,
7869,
16930,
1006,
1007,
9530,
3367,
1002,
6687,
12260,
2213,
1027,
1002,
4989,
12260,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/object-curly-newline.js | areLineBreaksRequired | function areLineBreaksRequired(node, options, first, last) {
let objectProperties;
if (node.type === "ObjectExpression" || node.type === "ObjectPattern") {
objectProperties = node.properties;
} else {
// is ImportDeclaration or ExportNamedDeclaration
objectProperties = node.specifi... | javascript | function areLineBreaksRequired(node, options, first, last) {
let objectProperties;
if (node.type === "ObjectExpression" || node.type === "ObjectPattern") {
objectProperties = node.properties;
} else {
// is ImportDeclaration or ExportNamedDeclaration
objectProperties = node.specifi... | [
"function",
"areLineBreaksRequired",
"(",
"node",
",",
"options",
",",
"first",
",",
"last",
")",
"{",
"let",
"objectProperties",
";",
"if",
"(",
"node",
".",
"type",
"===",
"\"ObjectExpression\"",
"||",
"node",
".",
"type",
"===",
"\"ObjectPattern\"",
")",
... | Determines if ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration
node needs to be checked for missing line breaks
@param {ASTNode} node - Node under inspection
@param {Object} options - option specific to node type
@param {Token} first - First object property
@param {Token} last - Last object... | [
"Determines",
"if",
"ObjectExpression",
"ObjectPattern",
"ImportDeclaration",
"or",
"ExportNamedDeclaration",
"node",
"needs",
"to",
"be",
"checked",
"for",
"missing",
"line",
"breaks"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/object-curly-newline.js#L111-L129 | train | Check if a node is a line break | [
30522,
3853,
2024,
4179,
23890,
21338,
2063,
15549,
5596,
1006,
13045,
1010,
7047,
1010,
2034,
1010,
2197,
1007,
1063,
2292,
4874,
21572,
4842,
7368,
1025,
2065,
1006,
13045,
1012,
2828,
1027,
1027,
1027,
1000,
4874,
10288,
20110,
3258,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js | function () {
var oModel = this._oDialog.getModel("view"),
oTreeResults;
// early out if already open
if (this._oDebugPopover && this._oDebugPopover.isOpen()) {
return;
}
// fill and bind the tree structure from the currently loaded modules
oTreeResults = this._treeHelper.toTreeModel(this._o... | javascript | function () {
var oModel = this._oDialog.getModel("view"),
oTreeResults;
// early out if already open
if (this._oDebugPopover && this._oDebugPopover.isOpen()) {
return;
}
// fill and bind the tree structure from the currently loaded modules
oTreeResults = this._treeHelper.toTreeModel(this._o... | [
"function",
"(",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"oTreeResults",
";",
"// early out if already open",
"if",
"(",
"this",
".",
"_oDebugPopover",
"&&",
"this",
".",
"_oDebugPopover",
".",
"is... | Opens a dialog with debug package selection options | [
"Opens",
"a",
"dialog",
"with",
"debug",
"package",
"selection",
"options"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L171-L204 | train | Creates a debug module dialog | [
30522,
3853,
1006,
1007,
1063,
13075,
18168,
10244,
2140,
1027,
2023,
1012,
1035,
21045,
23067,
2290,
1012,
2131,
5302,
9247,
1006,
1000,
3193,
1000,
1007,
1010,
27178,
9910,
6072,
11314,
2015,
1025,
1013,
1013,
2220,
2041,
2065,
2525,
2330... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/EditorCommandHandlers.js | _getLineCommentEdits | function _getLineCommentEdits(editor, selections, command) {
// We need to expand line selections in order to coalesce cursors on the same line, but we
// don't want to merge adjacent line selections.
var lineSelections = editor.convertToLineSelections(selections, { mergeAdjacent: false }),
... | javascript | function _getLineCommentEdits(editor, selections, command) {
// We need to expand line selections in order to coalesce cursors on the same line, but we
// don't want to merge adjacent line selections.
var lineSelections = editor.convertToLineSelections(selections, { mergeAdjacent: false }),
... | [
"function",
"_getLineCommentEdits",
"(",
"editor",
",",
"selections",
",",
"command",
")",
"{",
"// We need to expand line selections in order to coalesce cursors on the same line, but we",
"// don't want to merge adjacent line selections.",
"var",
"lineSelections",
"=",
"editor",
".... | @private
Generates an array of edits for toggling line comments on the given selections.
@param {!Editor} editor The editor to edit within.
@param {Array.<{start:{line:number, ch:number}, end:{line:number, ch:number}, primary:boolean, reversed: boolean, isBeforeEdit: boolean}>}
selections The selections we want to lin... | [
"@private",
"Generates",
"an",
"array",
"of",
"edits",
"for",
"toggling",
"line",
"comments",
"on",
"the",
"given",
"selections",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorCommandHandlers.js#L650-L675 | train | Get an array of edits for a line comment. | [
30522,
3853,
1035,
2131,
4179,
9006,
3672,
2098,
12762,
1006,
3559,
1010,
16310,
1010,
3094,
1007,
1063,
1013,
1013,
2057,
2342,
2000,
7818,
2240,
16310,
1999,
2344,
2000,
5317,
2229,
3401,
12731,
25301,
2869,
2006,
1996,
2168,
2240,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/selenium-core/xpath/xpath.js | push_ | function push_(array, position, element) {
if (!array[position]) {
array[position] = [];
}
array[position].push(element);
} | javascript | function push_(array, position, element) {
if (!array[position]) {
array[position] = [];
}
array[position].push(element);
} | [
"function",
"push_",
"(",
"array",
",",
"position",
",",
"element",
")",
"{",
"if",
"(",
"!",
"array",
"[",
"position",
"]",
")",
"{",
"array",
"[",
"position",
"]",
"=",
"[",
"]",
";",
"}",
"array",
"[",
"position",
"]",
".",
"push",
"(",
"eleme... | Another slight optimization: sort the rules into bins according to the last element (observing quantifiers), so we can restrict the match against the stack to the subest of rules that match the top of the stack. TODO(mesch): What we actually want is to compute states as in bison, so that we don't have to do any explic... | [
"Another",
"slight",
"optimization",
":",
"sort",
"the",
"rules",
"into",
"bins",
"according",
"to",
"the",
"last",
"element",
"(",
"observing",
"quantifiers",
")",
"so",
"we",
"can",
"restrict",
"the",
"match",
"against",
"the",
"stack",
"to",
"the",
"subes... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/xpath/xpath.js#L2320-L2325 | train | push element to array at given position | [
30522,
3853,
5245,
1035,
1006,
9140,
1010,
2597,
1010,
5783,
1007,
1063,
2065,
1006,
999,
9140,
1031,
2597,
1033,
1007,
1063,
9140,
1031,
2597,
1033,
1027,
1031,
1033,
1025,
1065,
9140,
1031,
2597,
1033,
1012,
5245,
1006,
5783,
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... |
GitbookIO/gitbook | lib/output/modifiers/highlightCode.js | getLanguageForClass | function getLanguageForClass(classNames) {
return Immutable.List(classNames)
.map(function(cl) {
// Markdown
if (cl.search('lang-') === 0) {
return cl.slice('lang-'.length);
}
// Asciidoc
if (cl.search('language-') === 0) {
... | javascript | function getLanguageForClass(classNames) {
return Immutable.List(classNames)
.map(function(cl) {
// Markdown
if (cl.search('lang-') === 0) {
return cl.slice('lang-'.length);
}
// Asciidoc
if (cl.search('language-') === 0) {
... | [
"function",
"getLanguageForClass",
"(",
"classNames",
")",
"{",
"return",
"Immutable",
".",
"List",
"(",
"classNames",
")",
".",
"map",
"(",
"function",
"(",
"cl",
")",
"{",
"// Markdown",
"if",
"(",
"cl",
".",
"search",
"(",
"'lang-'",
")",
"===",
"0",
... | Return language for a code blocks from a list of class names
@param {Array<String>}
@return {String} | [
"Return",
"language",
"for",
"a",
"code",
"blocks",
"from",
"a",
"list",
"of",
"class",
"names"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/modifiers/highlightCode.js#L13-L31 | train | getLanguageForClass - Returns language code | [
30522,
3853,
2131,
25023,
6692,
3351,
29278,
26266,
1006,
2465,
18442,
2015,
1007,
1063,
2709,
10047,
28120,
3085,
1012,
2862,
1006,
2465,
18442,
2015,
1007,
1012,
4949,
1006,
3853,
1006,
18856,
1007,
1063,
1013,
1013,
2928,
7698,
2065,
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... |
swimlane/ngx-datatable | release/utils/column.js | columnGroupWidths | function columnGroupWidths(groups, all) {
return {
left: columnTotalWidth(groups.left),
center: columnTotalWidth(groups.center),
right: columnTotalWidth(groups.right),
total: Math.floor(columnTotalWidth(all))
};
} | javascript | function columnGroupWidths(groups, all) {
return {
left: columnTotalWidth(groups.left),
center: columnTotalWidth(groups.center),
right: columnTotalWidth(groups.right),
total: Math.floor(columnTotalWidth(all))
};
} | [
"function",
"columnGroupWidths",
"(",
"groups",
",",
"all",
")",
"{",
"return",
"{",
"left",
":",
"columnTotalWidth",
"(",
"groups",
".",
"left",
")",
",",
"center",
":",
"columnTotalWidth",
"(",
"groups",
".",
"center",
")",
",",
"right",
":",
"columnTota... | Returns the widths of all group sets of a column | [
"Returns",
"the",
"widths",
"of",
"all",
"group",
"sets",
"of",
"a",
"column"
] | d7df15a070282a169524dba51d9572008b74804c | https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column.js#L32-L39 | train | Returns the widths of the given group of terms | [
30522,
3853,
5930,
17058,
9148,
11927,
7898,
1006,
2967,
1010,
2035,
1007,
1063,
2709,
1063,
2187,
1024,
5930,
3406,
9080,
9148,
11927,
2232,
1006,
2967,
1012,
2187,
1007,
1010,
2415,
1024,
5930,
3406,
9080,
9148,
11927,
2232,
1006,
2967,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
PrismJS/prism | plugins/show-invisibles/prism-show-invisibles.js | addInvisibles | function addInvisibles(grammar) {
if (!grammar || grammar['tab']) {
return;
}
// assign invisibles here to "mark" the grammar in case of self references
for (var name in invisibles) {
if (invisibles.hasOwnProperty(name)) {
grammar[name] = invisibles[name];
}
}
for (var name in grammar) {
i... | javascript | function addInvisibles(grammar) {
if (!grammar || grammar['tab']) {
return;
}
// assign invisibles here to "mark" the grammar in case of self references
for (var name in invisibles) {
if (invisibles.hasOwnProperty(name)) {
grammar[name] = invisibles[name];
}
}
for (var name in grammar) {
i... | [
"function",
"addInvisibles",
"(",
"grammar",
")",
"{",
"if",
"(",
"!",
"grammar",
"||",
"grammar",
"[",
"'tab'",
"]",
")",
"{",
"return",
";",
"}",
"// assign invisibles here to \"mark\" the grammar in case of self references",
"for",
"(",
"var",
"name",
"in",
"in... | Recursively adds patterns to match invisible characters to the given grammar (if not added already).
@param {Object} grammar | [
"Recursively",
"adds",
"patterns",
"to",
"match",
"invisible",
"characters",
"to",
"the",
"given",
"grammar",
"(",
"if",
"not",
"added",
"already",
")",
"."
] | acceb3b56f0e8362a7ef274dbd85b17611df2ec4 | https://github.com/PrismJS/prism/blob/acceb3b56f0e8362a7ef274dbd85b17611df2ec4/plugins/show-invisibles/prism-show-invisibles.js#L58-L79 | train | Add invisibles to the grammar | [
30522,
3853,
5587,
2378,
11365,
7028,
2015,
1006,
8035,
1007,
1063,
2065,
1006,
999,
8035,
1064,
1064,
8035,
1031,
1005,
21628,
1005,
1033,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
23911,
8841,
2015,
2182,
2000,
1000,
2928,
1000,
1996,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/report/resources/filter.js | updateIssuesGroups | function updateIssuesGroups() {
// Get all groups.
var groupHeaderElements = document.querySelectorAll('[data-groupName]');
for (var i = 0; i < groupHeaderElements.length; i++) {
var groupHeader = groupHeaderElements[i];
var issuesGroupId = groupHeader.getAttribute('data-expandableElement');
var groupNa... | javascript | function updateIssuesGroups() {
// Get all groups.
var groupHeaderElements = document.querySelectorAll('[data-groupName]');
for (var i = 0; i < groupHeaderElements.length; i++) {
var groupHeader = groupHeaderElements[i];
var issuesGroupId = groupHeader.getAttribute('data-expandableElement');
var groupNa... | [
"function",
"updateIssuesGroups",
"(",
")",
"{",
"// Get all groups.",
"var",
"groupHeaderElements",
"=",
"document",
".",
"querySelectorAll",
"(",
"'[data-groupName]'",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"groupHeaderElements",
".",
"leng... | Used to update the groups counters and hide/show group headers if all of the elements are filtered. | [
"Used",
"to",
"update",
"the",
"groups",
"counters",
"and",
"hide",
"/",
"show",
"group",
"headers",
"if",
"all",
"of",
"the",
"elements",
"are",
"filtered",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/report/resources/filter.js#L11-L47 | train | Update the issues groups | [
30522,
3853,
10651,
14643,
15808,
17058,
2015,
1006,
1007,
1063,
1013,
1013,
2131,
2035,
2967,
1012,
13075,
2177,
4974,
7869,
16930,
11187,
1027,
6254,
1012,
23032,
11246,
22471,
6525,
3363,
1006,
1005,
1031,
2951,
1011,
2177,
18442,
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/core/util/DraftEnabledMockServer.js | function(aRequests) {
var that = this;
aRequests.push({
method: "POST",
path: new RegExp(that._oDraftMetadata.draftRootActivationName),
response: function(oXhr) {
var oRequestBody = JSON.parse(oXhr.requestBody);
var aFilter = [];
for (var property in oRequestBody) {
aFilter.push(p... | javascript | function(aRequests) {
var that = this;
aRequests.push({
method: "POST",
path: new RegExp(that._oDraftMetadata.draftRootActivationName),
response: function(oXhr) {
var oRequestBody = JSON.parse(oXhr.requestBody);
var aFilter = [];
for (var property in oRequestBody) {
aFilter.push(p... | [
"function",
"(",
"aRequests",
")",
"{",
"var",
"that",
"=",
"this",
";",
"aRequests",
".",
"push",
"(",
"{",
"method",
":",
"\"POST\"",
",",
"path",
":",
"new",
"RegExp",
"(",
"that",
".",
"_oDraftMetadata",
".",
"draftRootActivationName",
")",
",",
"res... | ================================= overridden functions of MockServer ================================= | [
"=================================",
"overridden",
"functions",
"of",
"MockServer",
"================================="
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/DraftEnabledMockServer.js#L395-L603 | train | Adds a request to the server | [
30522,
3853,
1006,
2024,
15500,
2015,
1007,
1063,
13075,
2008,
1027,
2023,
1025,
2024,
15500,
2015,
1012,
5245,
1006,
1063,
4118,
1024,
1000,
2695,
1000,
1010,
4130,
1024,
2047,
19723,
10288,
2361,
1006,
2008,
1012,
1035,
1051,
7265,
6199,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... | |
pixijs/pixi.js | packages/prepare/src/Prepare.js | uploadGraphics | function uploadGraphics(renderer, item)
{
if (item instanceof Graphics)
{
// if the item is not dirty and already has webgl data, then it got prepared or rendered
// before now and we shouldn't waste time updating it again
if (item.dirty || item.clearDirty || !item._webGL[renderer.plugin... | javascript | function uploadGraphics(renderer, item)
{
if (item instanceof Graphics)
{
// if the item is not dirty and already has webgl data, then it got prepared or rendered
// before now and we shouldn't waste time updating it again
if (item.dirty || item.clearDirty || !item._webGL[renderer.plugin... | [
"function",
"uploadGraphics",
"(",
"renderer",
",",
"item",
")",
"{",
"if",
"(",
"item",
"instanceof",
"Graphics",
")",
"{",
"// if the item is not dirty and already has webgl data, then it got prepared or rendered",
"// before now and we shouldn't waste time updating it again",
"i... | Built-in hook to upload PIXI.Graphics to the GPU.
@private
@param {PIXI.Renderer} renderer - instance of the webgl renderer
@param {PIXI.DisplayObject} item - Item to check
@return {boolean} If item was uploaded. | [
"Built",
"-",
"in",
"hook",
"to",
"upload",
"PIXI",
".",
"Graphics",
"to",
"the",
"GPU",
"."
] | 99ae03b7565ae7ca5a6de633b0a277f7128fa4d0 | https://github.com/pixijs/pixi.js/blob/99ae03b7565ae7ca5a6de633b0a277f7128fa4d0/packages/prepare/src/Prepare.js#L65-L80 | train | upload Graphics to the image | [
30522,
3853,
2039,
11066,
14773,
2015,
1006,
17552,
2121,
1010,
8875,
1007,
30524,
1063,
1013,
1013,
2065,
1996,
8875,
2003,
2025,
6530,
1998,
2525,
2038,
4773,
23296,
2951,
1010,
2059,
2009,
2288,
4810,
2030,
10155,
1013,
1013,
2077,
2085,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableRendererUtils.js | function(rm, sName, oValue, bShouldAdd) {
if (sName && oValue && (!!bShouldAdd || arguments.length == 3)) {
rm.addStyle(sName, oValue);
if (TAGCONTEXT) {
TAGCONTEXT.writeStyles = true;
}
}
return TableRendererUtils;
} | javascript | function(rm, sName, oValue, bShouldAdd) {
if (sName && oValue && (!!bShouldAdd || arguments.length == 3)) {
rm.addStyle(sName, oValue);
if (TAGCONTEXT) {
TAGCONTEXT.writeStyles = true;
}
}
return TableRendererUtils;
} | [
"function",
"(",
"rm",
",",
"sName",
",",
"oValue",
",",
"bShouldAdd",
")",
"{",
"if",
"(",
"sName",
"&&",
"oValue",
"&&",
"(",
"!",
"!",
"bShouldAdd",
"||",
"arguments",
".",
"length",
"==",
"3",
")",
")",
"{",
"rm",
".",
"addStyle",
"(",
"sName",... | Adds the given style if no condition is given or the condition is truthy.
@param {sap.ui.core.RenderManager} rm Instance of the rendermanager
@param {string} sName The style name which should be written
@param {string} oValue The style value which should be written
@param {boolean} [bShouldAdd] optional condition
@re... | [
"Adds",
"the",
"given",
"style",
"if",
"no",
"condition",
"is",
"given",
"or",
"the",
"condition",
"is",
"truthy",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableRendererUtils.js#L54-L62 | train | Adds a style to the table renderer. | [
30522,
3853,
1006,
28549,
1010,
1055,
18442,
1010,
9242,
5657,
1010,
18667,
6806,
21285,
4215,
2094,
1007,
1063,
2065,
1006,
1055,
18442,
1004,
1004,
9242,
5657,
30524,
1064,
1064,
9918,
1012,
3091,
1027,
1027,
1017,
1007,
1007,
1063,
28549... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... | |
vuejs/vue-devtools | src/util.js | internalSearchObject | function internalSearchObject (obj, searchTerm, seen, depth) {
if (depth > SEARCH_MAX_DEPTH) {
return false
}
let match = false
const keys = Object.keys(obj)
let key, value
for (let i = 0; i < keys.length; i++) {
key = keys[i]
value = obj[key]
match = internalSearchCheck(searchTerm, key, val... | javascript | function internalSearchObject (obj, searchTerm, seen, depth) {
if (depth > SEARCH_MAX_DEPTH) {
return false
}
let match = false
const keys = Object.keys(obj)
let key, value
for (let i = 0; i < keys.length; i++) {
key = keys[i]
value = obj[key]
match = internalSearchCheck(searchTerm, key, val... | [
"function",
"internalSearchObject",
"(",
"obj",
",",
"searchTerm",
",",
"seen",
",",
"depth",
")",
"{",
"if",
"(",
"depth",
">",
"SEARCH_MAX_DEPTH",
")",
"{",
"return",
"false",
"}",
"let",
"match",
"=",
"false",
"const",
"keys",
"=",
"Object",
".",
"key... | Executes a search on each field of the provided object
@param {*} obj Search target
@param {string} searchTerm Search string
@param {Map<any,boolean>} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times
@param {number} depth Deep search depth level, which is capp... | [
"Executes",
"a",
"search",
"on",
"each",
"field",
"of",
"the",
"provided",
"object"
] | 4de4b86388453cd07f0c1bf967d43a4dd4b011c9 | https://github.com/vuejs/vue-devtools/blob/4de4b86388453cd07f0c1bf967d43a4dd4b011c9/src/util.js#L421-L437 | train | internalSearchObject - Search object for searchTerm | [
30522,
3853,
4722,
17310,
11140,
16429,
20614,
1006,
27885,
3501,
1010,
3945,
3334,
2213,
1010,
2464,
1010,
5995,
1007,
1063,
2065,
1006,
5995,
1028,
3945,
1035,
4098,
1035,
5995,
1007,
1063,
2709,
6270,
1065,
2292,
2674,
1027,
6270,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/radix.js | checkArguments | function checkArguments(node) {
const args = node.arguments;
switch (args.length) {
case 0:
context.report({
node,
message: "Missing parameters."
});
break;
... | javascript | function checkArguments(node) {
const args = node.arguments;
switch (args.length) {
case 0:
context.report({
node,
message: "Missing parameters."
});
break;
... | [
"function",
"checkArguments",
"(",
"node",
")",
"{",
"const",
"args",
"=",
"node",
".",
"arguments",
";",
"switch",
"(",
"args",
".",
"length",
")",
"{",
"case",
"0",
":",
"context",
".",
"report",
"(",
"{",
"node",
",",
"message",
":",
"\"Missing para... | Checks the arguments of a given CallExpression node and reports it if it
offends this rule.
@param {ASTNode} node - A CallExpression node to check.
@returns {void} | [
"Checks",
"the",
"arguments",
"of",
"a",
"given",
"CallExpression",
"node",
"and",
"reports",
"it",
"if",
"it",
"offends",
"this",
"rule",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/radix.js#L107-L141 | train | Check arguments for an error message. | [
30522,
3853,
4638,
2906,
22850,
11187,
1006,
13045,
1007,
1063,
9530,
3367,
12098,
5620,
1027,
13045,
1012,
9918,
1025,
6942,
1006,
12098,
5620,
1012,
3091,
1007,
1063,
2553,
1014,
1024,
6123,
1012,
3189,
1006,
1063,
13045,
1010,
4471,
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... |
eslint/eslint | lib/rules/no-extra-semi.js | report | function report(nodeOrToken) {
context.report({
node: nodeOrToken,
messageId: "unexpected",
fix(fixer) {
/*
* Expand the replacement range to include the surrounding
* tokens to avoid conflicting w... | javascript | function report(nodeOrToken) {
context.report({
node: nodeOrToken,
messageId: "unexpected",
fix(fixer) {
/*
* Expand the replacement range to include the surrounding
* tokens to avoid conflicting w... | [
"function",
"report",
"(",
"nodeOrToken",
")",
"{",
"context",
".",
"report",
"(",
"{",
"node",
":",
"nodeOrToken",
",",
"messageId",
":",
"\"unexpected\"",
",",
"fix",
"(",
"fixer",
")",
"{",
"/*\n * Expand the replacement range to include the sur... | Reports an unnecessary semicolon error.
@param {Node|Token} nodeOrToken - A node or a token to be reported.
@returns {void} | [
"Reports",
"an",
"unnecessary",
"semicolon",
"error",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-extra-semi.js#L46-L62 | train | Reports an unexpected token. | [
30522,
3853,
3189,
1006,
13045,
11589,
11045,
2078,
1007,
1063,
6123,
1012,
3189,
1006,
1063,
13045,
1024,
13045,
11589,
11045,
2078,
1010,
4471,
3593,
1024,
1000,
9223,
1000,
1010,
8081,
1006,
8081,
2121,
1007,
1063,
1013,
1008,
1008,
7818... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/modifiers/svgToImg.js | svgToImg | function svgToImg(baseFolder, currentFile, $) {
var currentDirectory = path.dirname(currentFile);
return editHTMLElement($, 'svg', function($svg) {
var content = '<?xml version="1.0" encoding="UTF-8"?>' +
renderDOM($, $svg);
// We avoid generating twice the same PNG
var has... | javascript | function svgToImg(baseFolder, currentFile, $) {
var currentDirectory = path.dirname(currentFile);
return editHTMLElement($, 'svg', function($svg) {
var content = '<?xml version="1.0" encoding="UTF-8"?>' +
renderDOM($, $svg);
// We avoid generating twice the same PNG
var has... | [
"function",
"svgToImg",
"(",
"baseFolder",
",",
"currentFile",
",",
"$",
")",
"{",
"var",
"currentDirectory",
"=",
"path",
".",
"dirname",
"(",
"currentFile",
")",
";",
"return",
"editHTMLElement",
"(",
"$",
",",
"'svg'",
",",
"function",
"(",
"$svg",
")",... | Replace SVG tag by IMG
@param {String} baseFolder
@param {HTMLDom} $ | [
"Replace",
"SVG",
"tag",
"by",
"IMG"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/modifiers/svgToImg.js#L31-L54 | train | Convert svg to img | [
30522,
3853,
17917,
13512,
10448,
24798,
1006,
2918,
10371,
2121,
1010,
2783,
8873,
2571,
1010,
1002,
1007,
1063,
13075,
2783,
4305,
2890,
16761,
2100,
1027,
4130,
1012,
16101,
18442,
1006,
2783,
8873,
2571,
1007,
1025,
2709,
13257,
21246,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/interimElement/interimElement.js | hide | function hide(reason, options) {
options = options || {};
if (options.closeAll) {
// We have to make a shallow copy of the array, because otherwise the map will break.
return $q.all(showingInterims.slice().reverse().map(closeElement));
} else if (options.closeTo !== undefine... | javascript | function hide(reason, options) {
options = options || {};
if (options.closeAll) {
// We have to make a shallow copy of the array, because otherwise the map will break.
return $q.all(showingInterims.slice().reverse().map(closeElement));
} else if (options.closeTo !== undefine... | [
"function",
"hide",
"(",
"reason",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"if",
"(",
"options",
".",
"closeAll",
")",
"{",
"// We have to make a shallow copy of the array, because otherwise the map will break.",
"return",
"$q",
"."... | /*
@ngdoc method
@name $$interimElement.$service#hide
@kind function
@description
Removes the `$interimElement` from the DOM and resolves the promise returned from `show`
@param {*} resolveParam Data to resolve the promise with
@returns a Promise that will be resolved after the element has been removed. | [
"/",
"*",
"@ngdoc",
"method",
"@name",
"$$interimElement",
".",
"$service#hide",
"@kind",
"function"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/interimElement/interimElement.js#L354-L385 | train | Hide the last showing interim element | [
30522,
3853,
5342,
1006,
3114,
1010,
7047,
1007,
1063,
7047,
1027,
7047,
1064,
1064,
1063,
1065,
1025,
2065,
1006,
7047,
1012,
2485,
8095,
1007,
1063,
1013,
1013,
2057,
2031,
2000,
2191,
1037,
8467,
6100,
1997,
1996,
9140,
1010,
2138,
472... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Component.js | getManifestEntry | function getManifestEntry(oMetadata, oManifest, sKey, bMerged) {
var oData = oManifest.getEntry(sKey);
// merge / extend should only be done for objects or when entry wasn't found
if (oData !== undefined && !isPlainObject(oData)) {
return oData;
}
// merge the configuration of the parent manifest with lo... | javascript | function getManifestEntry(oMetadata, oManifest, sKey, bMerged) {
var oData = oManifest.getEntry(sKey);
// merge / extend should only be done for objects or when entry wasn't found
if (oData !== undefined && !isPlainObject(oData)) {
return oData;
}
// merge the configuration of the parent manifest with lo... | [
"function",
"getManifestEntry",
"(",
"oMetadata",
",",
"oManifest",
",",
"sKey",
",",
"bMerged",
")",
"{",
"var",
"oData",
"=",
"oManifest",
".",
"getEntry",
"(",
"sKey",
")",
";",
"// merge / extend should only be done for objects or when entry wasn't found",
"if",
"... | Returns the configuration of a manifest section or the value for a
specific path. If no section or key is specified, the return value is null.
@param {sap.ui.core.ComponentMetadata} oMetadata the Component metadata
@param {sap.ui.core.Manifest} oManifest the manifest
@param {string} sKey Either the manifest section na... | [
"Returns",
"the",
"configuration",
"of",
"a",
"manifest",
"section",
"or",
"the",
"value",
"for",
"a",
"specific",
"path",
".",
"If",
"no",
"section",
"or",
"key",
"is",
"specified",
"the",
"return",
"value",
"is",
"null",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Component.js#L102-L124 | train | Returns the manifest entry for the given key. | [
30522,
3853,
2131,
20799,
14081,
4765,
2854,
1006,
18168,
12928,
2850,
2696,
1010,
16640,
29323,
3367,
1010,
15315,
3240,
1010,
1038,
5017,
5999,
1007,
1063,
13075,
1051,
2850,
2696,
30524,
13590,
1013,
7949,
2323,
2069,
2022,
2589,
2005,
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... |
dequelabs/axe-core | lib/core/utils/get-selector.js | uncommonAttributes | function uncommonAttributes(node, selectorData) {
let retVal = [];
let attData = selectorData.attributes;
let tagData = selectorData.tags;
if (node.hasAttributes()) {
Array.from(axe.utils.getNodeAttributes(node))
.filter(filterAttributes)
.forEach(at => {
const atnv = getAttributeNameValue(node, at);
... | javascript | function uncommonAttributes(node, selectorData) {
let retVal = [];
let attData = selectorData.attributes;
let tagData = selectorData.tags;
if (node.hasAttributes()) {
Array.from(axe.utils.getNodeAttributes(node))
.filter(filterAttributes)
.forEach(at => {
const atnv = getAttributeNameValue(node, at);
... | [
"function",
"uncommonAttributes",
"(",
"node",
",",
"selectorData",
")",
"{",
"let",
"retVal",
"=",
"[",
"]",
";",
"let",
"attData",
"=",
"selectorData",
".",
"attributes",
";",
"let",
"tagData",
"=",
"selectorData",
".",
"tags",
";",
"if",
"(",
"node",
... | Given a node and the statistics on attribute frequency on the page,
return all its uncommon attribute data sorted in order of decreasing uniqueness
@param {Element} node The node
@param {Object} attData The map of attributes to counts
@return {Array} The sorted array of uncommon attribute data | [
"Given",
"a",
"node",
"and",
"the",
"statistics",
"on",
"attribute",
"frequency",
"on",
"the",
"page",
"return",
"all",
"its",
"uncommon",
"attribute",
"data",
"sorted",
"in",
"order",
"of",
"decreasing",
"uniqueness"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/get-selector.js#L236-L257 | train | Returns an array of uncommon attributes for a node | [
30522,
3853,
13191,
19321,
3089,
8569,
4570,
1006,
13045,
1010,
27000,
2850,
2696,
1007,
1063,
2292,
2128,
9189,
2389,
1027,
1031,
1033,
1025,
2292,
2012,
2102,
2850,
2696,
1027,
27000,
2850,
2696,
1012,
12332,
1025,
2292,
6415,
2850,
2696,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
juliangarnier/anime | lib/anime.js | getParentSvgEl | function getParentSvgEl(el) {
var parentEl = el.parentNode;
while (is.svg(parentEl)) {
parentEl = parentEl.parentNode;
if (!is.svg(parentEl.parentNode)) { break; }
}
return parentEl;
} | javascript | function getParentSvgEl(el) {
var parentEl = el.parentNode;
while (is.svg(parentEl)) {
parentEl = parentEl.parentNode;
if (!is.svg(parentEl.parentNode)) { break; }
}
return parentEl;
} | [
"function",
"getParentSvgEl",
"(",
"el",
")",
"{",
"var",
"parentEl",
"=",
"el",
".",
"parentNode",
";",
"while",
"(",
"is",
".",
"svg",
"(",
"parentEl",
")",
")",
"{",
"parentEl",
"=",
"parentEl",
".",
"parentNode",
";",
"if",
"(",
"!",
"is",
".",
... | Motion path | [
"Motion",
"path"
] | 875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a | https://github.com/juliangarnier/anime/blob/875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a/lib/anime.js#L585-L592 | train | Get parent SVG element | [
30522,
3853,
2131,
19362,
11187,
2615,
12439,
1006,
3449,
1007,
1063,
13075,
6687,
2884,
1027,
3449,
1012,
6687,
3630,
3207,
1025,
2096,
1006,
2003,
1012,
17917,
2290,
1006,
6687,
2884,
1007,
1007,
1063,
6687,
2884,
1027,
6687,
2884,
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... |
eslint/eslint | lib/rules/indent-legacy.js | checkIndentInArrayOrObjectBlock | function checkIndentInArrayOrObjectBlock(node) {
// Skip inline
if (isSingleLineNode(node)) {
return;
}
let elements = (node.type === "ArrayExpression") ? node.elements : node.properties;
// filter out empty elements example would be [ , 2] ... | javascript | function checkIndentInArrayOrObjectBlock(node) {
// Skip inline
if (isSingleLineNode(node)) {
return;
}
let elements = (node.type === "ArrayExpression") ? node.elements : node.properties;
// filter out empty elements example would be [ , 2] ... | [
"function",
"checkIndentInArrayOrObjectBlock",
"(",
"node",
")",
"{",
"// Skip inline",
"if",
"(",
"isSingleLineNode",
"(",
"node",
")",
")",
"{",
"return",
";",
"}",
"let",
"elements",
"=",
"(",
"node",
".",
"type",
"===",
"\"ArrayExpression\"",
")",
"?",
"... | Check indent for array block content or object block content
@param {ASTNode} node node to examine
@returns {void} | [
"Check",
"indent",
"for",
"array",
"block",
"content",
"or",
"object",
"block",
"content"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/indent-legacy.js#L718-L814 | train | Check indentation of array or object block | [
30522,
3853,
4638,
22254,
4765,
3981,
11335,
7677,
3217,
2497,
20614,
23467,
1006,
13045,
1007,
1063,
1013,
1013,
13558,
23881,
2065,
1006,
26354,
2075,
2571,
4179,
3630,
3207,
1006,
13045,
1007,
1007,
1063,
2709,
1025,
1065,
2292,
3787,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/chips/js/contactChipsDirective.js | MdContactChips | function MdContactChips($mdTheming, $mdUtil) {
return {
template: function(element, attrs) {
return MD_CONTACT_CHIPS_TEMPLATE;
},
restrict: 'E',
controller: 'MdContactChipsCtrl',
controllerAs: '$mdContactChipsCtrl',
bindToController: true,
compile: compile,
scope: {
contact... | javascript | function MdContactChips($mdTheming, $mdUtil) {
return {
template: function(element, attrs) {
return MD_CONTACT_CHIPS_TEMPLATE;
},
restrict: 'E',
controller: 'MdContactChipsCtrl',
controllerAs: '$mdContactChipsCtrl',
bindToController: true,
compile: compile,
scope: {
contact... | [
"function",
"MdContactChips",
"(",
"$mdTheming",
",",
"$mdUtil",
")",
"{",
"return",
"{",
"template",
":",
"function",
"(",
"element",
",",
"attrs",
")",
"{",
"return",
"MD_CONTACT_CHIPS_TEMPLATE",
";",
"}",
",",
"restrict",
":",
"'E'",
",",
"controller",
":... | MDContactChips Directive Definition
@param $mdTheming
@param $mdUtil
@returns {*}
@ngInject | [
"MDContactChips",
"Directive",
"Definition"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/chips/js/contactChipsDirective.js#L133-L181 | train | A directive that can be used to link a chips to a contact. | [
30522,
3853,
9108,
8663,
2696,
6593,
5428,
4523,
1006,
1002,
9108,
10760,
6562,
1010,
1002,
9108,
21823,
2140,
1007,
1063,
2709,
1063,
23561,
1024,
3853,
1006,
5783,
1010,
2012,
16344,
2015,
1007,
1063,
2709,
9108,
1035,
3967,
1035,
11772,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.