repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
badges/shields | services/php-version.js | numberedVersionData | function numberedVersionData(version) {
// A version has a numbered part and a modifier part
// (eg, 1.0.0-patch, 2.0.x-dev).
const parts = version.split('-')
const numbered = parts[0]
// Aliases that get caught here.
if (numbered === 'dev') {
return {
numbers: parts[1],
modifier: 5,
... | javascript | function numberedVersionData(version) {
// A version has a numbered part and a modifier part
// (eg, 1.0.0-patch, 2.0.x-dev).
const parts = version.split('-')
const numbered = parts[0]
// Aliases that get caught here.
if (numbered === 'dev') {
return {
numbers: parts[1],
modifier: 5,
... | [
"function",
"numberedVersionData",
"(",
"version",
")",
"{",
"// A version has a numbered part and a modifier part",
"// (eg, 1.0.0-patch, 2.0.x-dev).",
"const",
"parts",
"=",
"version",
".",
"split",
"(",
"'-'",
")",
"const",
"numbered",
"=",
"parts",
"[",
"0",
"]",
... | Take a version without the starting v. eg, '1.0.x-beta' Return { numbers: [1,0,something big], modifier: 2, modifierCount: 1 } | [
"Take",
"a",
"version",
"without",
"the",
"starting",
"v",
".",
"eg",
"1",
".",
"0",
".",
"x",
"-",
"beta",
"Return",
"{",
"numbers",
":",
"[",
"1",
"0",
"something",
"big",
"]",
"modifier",
":",
"2",
"modifierCount",
":",
"1",
"}"
] | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/services/php-version.js#L29-L114 | train | Returns the data for a numbered version. | [
30522,
3853,
8597,
27774,
2850,
2696,
1006,
2544,
1007,
1063,
1013,
1013,
1037,
2544,
2038,
1037,
8597,
2112,
1998,
1037,
16913,
18095,
2112,
1013,
1013,
1006,
1041,
2290,
1010,
1015,
1012,
1014,
1012,
1014,
1011,
8983,
1010,
1016,
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/switch-colon-spacing.js | commentsExistBetween | function commentsExistBetween(left, right) {
return sourceCode.getFirstTokenBetween(
left,
right,
{
includeComments: true,
filter: astUtils.isCommentToken
}
) !== null;
} | javascript | function commentsExistBetween(left, right) {
return sourceCode.getFirstTokenBetween(
left,
right,
{
includeComments: true,
filter: astUtils.isCommentToken
}
) !== null;
} | [
"function",
"commentsExistBetween",
"(",
"left",
",",
"right",
")",
"{",
"return",
"sourceCode",
".",
"getFirstTokenBetween",
"(",
"left",
",",
"right",
",",
"{",
"includeComments",
":",
"true",
",",
"filter",
":",
"astUtils",
".",
"isCommentToken",
"}",
")",
... | Check whether comments exist between the given 2 tokens.
@param {Token} left The left token to check.
@param {Token} right The right token to check.
@returns {boolean} `true` if comments exist between the given 2 tokens. | [
"Check",
"whether",
"comments",
"exist",
"between",
"the",
"given",
"2",
"tokens",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/switch-colon-spacing.js#L87-L96 | train | Check if comments exist between two tokens | [
30522,
3853,
7928,
10288,
2923,
20915,
28394,
2078,
1006,
2187,
1010,
2157,
1007,
1063,
2709,
3120,
16044,
1012,
2131,
8873,
12096,
18715,
2368,
20915,
28394,
2078,
1006,
2187,
1010,
2157,
1010,
1063,
2421,
9006,
8163,
1024,
2995,
1010,
113... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/Agents/GotoAgent.js | _makeHTMLTarget | function _makeHTMLTarget(targets, node) {
if (node.location) {
var url = DOMAgent.url;
var location = node.location;
if (node.canHaveChildren()) {
location += node.length;
}
url += ":" + location;
var name = "<" + node.na... | javascript | function _makeHTMLTarget(targets, node) {
if (node.location) {
var url = DOMAgent.url;
var location = node.location;
if (node.canHaveChildren()) {
location += node.length;
}
url += ":" + location;
var name = "<" + node.na... | [
"function",
"_makeHTMLTarget",
"(",
"targets",
",",
"node",
")",
"{",
"if",
"(",
"node",
".",
"location",
")",
"{",
"var",
"url",
"=",
"DOMAgent",
".",
"url",
";",
"var",
"location",
"=",
"node",
".",
"location",
";",
"if",
"(",
"node",
".",
"canHave... | Make the given node a target for goto
@param [] targets array
@param {DOMNode} node | [
"Make",
"the",
"given",
"node",
"a",
"target",
"for",
"goto"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/GotoAgent.js#L67-L79 | train | Aliquivo HTML target | [
30522,
3853,
1035,
2191,
11039,
19968,
7559,
18150,
1006,
7889,
1010,
13045,
1007,
1063,
2065,
1006,
13045,
1012,
3295,
1007,
1063,
13075,
24471,
2140,
1027,
14383,
4270,
3372,
1012,
24471,
2140,
1025,
13075,
3295,
1027,
13045,
1012,
3295,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laurent22/joplin | ReactNativeClient/lib/file-api.js | basicDelta | async function basicDelta(path, getDirStatFn, options) {
const outputLimit = 50;
const itemIds = await options.allItemIdsHandler();
if (!Array.isArray(itemIds)) throw new Error('Delta API not supported - local IDs must be provided');
const context = basicDeltaContextFromOptions_(options);
let newContext = {
ti... | javascript | async function basicDelta(path, getDirStatFn, options) {
const outputLimit = 50;
const itemIds = await options.allItemIdsHandler();
if (!Array.isArray(itemIds)) throw new Error('Delta API not supported - local IDs must be provided');
const context = basicDeltaContextFromOptions_(options);
let newContext = {
ti... | [
"async",
"function",
"basicDelta",
"(",
"path",
",",
"getDirStatFn",
",",
"options",
")",
"{",
"const",
"outputLimit",
"=",
"50",
";",
"const",
"itemIds",
"=",
"await",
"options",
".",
"allItemIdsHandler",
"(",
")",
";",
"if",
"(",
"!",
"Array",
".",
"is... | This is the basic delta algorithm, which can be used in case the cloud service does not have a built-in delta API. OneDrive and Dropbox have one for example, but Nextcloud and obviously the file system do not. | [
"This",
"is",
"the",
"basic",
"delta",
"algorithm",
"which",
"can",
"be",
"used",
"in",
"case",
"the",
"cloud",
"service",
"does",
"not",
"have",
"a",
"built",
"-",
"in",
"delta",
"API",
".",
"OneDrive",
"and",
"Dropbox",
"have",
"one",
"for",
"example",... | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/ReactNativeClient/lib/file-api.js#L218-L316 | train | This function is the main entry point of the delta function. It is the main entry point of the delta function. | [
30522,
2004,
6038,
2278,
3853,
3937,
9247,
2696,
1006,
4130,
1010,
2131,
4305,
12096,
4017,
2546,
2078,
1010,
7047,
1007,
1063,
9530,
3367,
6434,
17960,
4183,
1027,
2753,
1025,
9530,
3367,
8875,
9821,
1027,
26751,
7047,
1012,
2035,
4221,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/preferences/PreferencesBase.js | function (data) {
if (!data) {
return;
}
return _.union.apply(null, _.map(_.values(data), _.keys));
} | javascript | function (data) {
if (!data) {
return;
}
return _.union.apply(null, _.map(_.values(data), _.keys));
} | [
"function",
"(",
"data",
")",
"{",
"if",
"(",
"!",
"data",
")",
"{",
"return",
";",
"}",
"return",
"_",
".",
"union",
".",
"apply",
"(",
"null",
",",
"_",
".",
"map",
"(",
"_",
".",
"values",
"(",
"data",
")",
",",
"_",
".",
"keys",
")",
")... | Retrieves the keys provided by this layer object.
@param {Object} data the preference data from the Scope | [
"Retrieves",
"the",
"keys",
"provided",
"by",
"this",
"layer",
"object",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L684-L690 | train | get a list of all the tables | [
30522,
3853,
1006,
2951,
1007,
1063,
2065,
1006,
999,
2951,
1007,
1063,
2709,
1025,
1065,
2709,
1035,
1012,
2586,
1012,
6611,
1006,
19701,
1010,
1035,
1012,
4949,
1006,
1035,
1012,
5300,
1006,
2951,
1007,
1010,
1035,
1012,
6309,
1007,
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/util/reflection/BaseTreeModifier.js | function (oControl) {
var sControlType = oControl.namespaceURI;
sControlType = sControlType ? sControlType + "." : ""; // add a dot if there is already a prefix
sControlType += oControl.localName;
return sControlType;
} | javascript | function (oControl) {
var sControlType = oControl.namespaceURI;
sControlType = sControlType ? sControlType + "." : ""; // add a dot if there is already a prefix
sControlType += oControl.localName;
return sControlType;
} | [
"function",
"(",
"oControl",
")",
"{",
"var",
"sControlType",
"=",
"oControl",
".",
"namespaceURI",
";",
"sControlType",
"=",
"sControlType",
"?",
"sControlType",
"+",
"\".\"",
":",
"\"\"",
";",
"// add a dot if there is already a prefix",
"sControlType",
"+=",
"oCo... | Gets the ControlType of an XML control.
@param {Element} oControl - Control in XML
@returns {string} Control type as a string, e.g. 'sap.m.Button' | [
"Gets",
"the",
"ControlType",
"of",
"an",
"XML",
"control",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js#L306-L312 | train | Returns the control type | [
30522,
3853,
1006,
1051,
8663,
13181,
2140,
1007,
1063,
13075,
8040,
12162,
13153,
13874,
1027,
1051,
8663,
13181,
2140,
1012,
3415,
15327,
9496,
1025,
8040,
12162,
13153,
13874,
1027,
8040,
12162,
13153,
13874,
1029,
8040,
12162,
13153,
1387... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | handleGetFile | function handleGetFile(file, text) {
var next = fileCallBacks[file];
if (next) {
try {
next(null, text);
} catch (e) {
_reportError(e, file);
}
}
delete fileCallBacks[file];
} | javascript | function handleGetFile(file, text) {
var next = fileCallBacks[file];
if (next) {
try {
next(null, text);
} catch (e) {
_reportError(e, file);
}
}
delete fileCallBacks[file];
} | [
"function",
"handleGetFile",
"(",
"file",
",",
"text",
")",
"{",
"var",
"next",
"=",
"fileCallBacks",
"[",
"file",
"]",
";",
"if",
"(",
"next",
")",
"{",
"try",
"{",
"next",
"(",
"null",
",",
"text",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
... | Handle a response from the main thread providing the contents of a file
@param {string} file - the name of the file
@param {string} text - the contents of the file | [
"Handle",
"a",
"response",
"from",
"the",
"main",
"thread",
"providing",
"the",
"contents",
"of",
"a",
"file"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L90-L100 | train | Handle the get file callback | [
30522,
3853,
5047,
18150,
8873,
2571,
1006,
5371,
1010,
3793,
1007,
1063,
13075,
2279,
1027,
5371,
9289,
20850,
8684,
2015,
1031,
5371,
1033,
1025,
2065,
1006,
2279,
1007,
1063,
3046,
1063,
2279,
1006,
19701,
1010,
3793,
1007,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/Session.js | isOnFunctionIdentifier | function isOnFunctionIdentifier() {
// Check if we might be on function identifier of the function call.
var type = token.type,
nextToken,
localLexical,
localCursor = {line: cursor.line, ch: token.end};
if (type === "variable-2" || ty... | javascript | function isOnFunctionIdentifier() {
// Check if we might be on function identifier of the function call.
var type = token.type,
nextToken,
localLexical,
localCursor = {line: cursor.line, ch: token.end};
if (type === "variable-2" || ty... | [
"function",
"isOnFunctionIdentifier",
"(",
")",
"{",
"// Check if we might be on function identifier of the function call.",
"var",
"type",
"=",
"token",
".",
"type",
",",
"nextToken",
",",
"localLexical",
",",
"localCursor",
"=",
"{",
"line",
":",
"cursor",
".",
"lin... | Test if the cursor is on a function identifier
@return {Object} - lexical state if on a function identifier, null otherwise. | [
"Test",
"if",
"the",
"cursor",
"is",
"on",
"a",
"function",
"identifier"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/Session.js#L364-L381 | train | Check if the current token is on function identifier | [
30522,
3853,
11163,
2078,
11263,
27989,
5178,
16778,
8873,
2121,
1006,
1007,
1063,
1013,
1013,
4638,
2065,
2057,
2453,
2022,
2006,
3853,
8909,
4765,
18095,
1997,
1996,
3853,
2655,
1012,
13075,
2828,
1027,
19204,
1012,
2828,
1010,
2279,
1871... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mochajs/mocha | lib/reporters/tap.js | TAP13Producer | function TAP13Producer() {
/**
* Writes the TAP version to reporter output stream.
* @override
*/
this.writeVersion = function() {
println('TAP version 13');
};
/**
* Writes that test failed to reporter output stream, with error formatting.
* @override
*/
this.writeFail = function(n, te... | javascript | function TAP13Producer() {
/**
* Writes the TAP version to reporter output stream.
* @override
*/
this.writeVersion = function() {
println('TAP version 13');
};
/**
* Writes that test failed to reporter output stream, with error formatting.
* @override
*/
this.writeFail = function(n, te... | [
"function",
"TAP13Producer",
"(",
")",
"{",
"/**\n * Writes the TAP version to reporter output stream.\n * @override\n */",
"this",
".",
"writeVersion",
"=",
"function",
"(",
")",
"{",
"println",
"(",
"'TAP version 13'",
")",
";",
"}",
";",
"/**\n * Writes that test... | @summary
Constructs a new TAP13Producer.
@description
Produces output conforming to the TAP13 specification.
@private
@constructor
@extends TAPProducer
@see {@link https://testanything.org/tap-version-13-specification.html|Specification} | [
"@summary",
"Constructs",
"a",
"new",
"TAP13Producer",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/tap.js#L254-L287 | train | TAP13Producer - TAP13 reporter | [
30522,
3853,
11112,
17134,
21572,
8566,
17119,
1006,
1007,
1063,
1013,
1008,
1008,
1008,
7009,
1996,
11112,
2544,
2000,
6398,
6434,
5460,
1012,
1008,
1030,
2058,
15637,
1008,
1013,
2023,
1012,
4339,
27774,
1027,
3853,
1006,
1007,
1063,
6140... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/WorkspaceManager.js | triggerUpdateLayout | function triggerUpdateLayout(refreshHint) {
// Find how much space is left for the editor
var editorAreaHeight = calcAvailableHeight();
$editorHolder.height(editorAreaHeight); // affects size of "not-editor" placeholder as well
// Resize editor to fill the space
exports.trigge... | javascript | function triggerUpdateLayout(refreshHint) {
// Find how much space is left for the editor
var editorAreaHeight = calcAvailableHeight();
$editorHolder.height(editorAreaHeight); // affects size of "not-editor" placeholder as well
// Resize editor to fill the space
exports.trigge... | [
"function",
"triggerUpdateLayout",
"(",
"refreshHint",
")",
"{",
"// Find how much space is left for the editor",
"var",
"editorAreaHeight",
"=",
"calcAvailableHeight",
"(",
")",
";",
"$editorHolder",
".",
"height",
"(",
"editorAreaHeight",
")",
";",
"// affects size of \"n... | Calculates a new size for editor-holder and resizes it accordingly, then and dispatches the "workspaceUpdateLayout"
event. (The editors within are resized by EditorManager, in response to that event).
@param {boolean=} refreshHint true to force a complete refresh | [
"Calculates",
"a",
"new",
"size",
"for",
"editor",
"-",
"holder",
"and",
"resizes",
"it",
"accordingly",
"then",
"and",
"dispatches",
"the",
"workspaceUpdateLayout",
"event",
".",
"(",
"The",
"editors",
"within",
"are",
"resized",
"by",
"EditorManager",
"in",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/WorkspaceManager.js#L111-L119 | train | Trigger the layout update event | [
30522,
3853,
9495,
6279,
13701,
8485,
5833,
1006,
25416,
21898,
10606,
2102,
1007,
1063,
1013,
1013,
2424,
2129,
2172,
2686,
2003,
2187,
2005,
1996,
3559,
13075,
3559,
12069,
4430,
7416,
13900,
1027,
10250,
3540,
3567,
11733,
3468,
26036,
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... |
wuchangming/spy-debugger | buildin_modules/weinre/web/client/inspector.js | flushQueue | function flushQueue()
{
var queued = WebInspector.log.queued;
if (!queued)
return;
for (var i = 0; i < queued.length; ++i)
logMessage(queued[i]);
delete WebInspector.log.queued;
} | javascript | function flushQueue()
{
var queued = WebInspector.log.queued;
if (!queued)
return;
for (var i = 0; i < queued.length; ++i)
logMessage(queued[i]);
delete WebInspector.log.queued;
} | [
"function",
"flushQueue",
"(",
")",
"{",
"var",
"queued",
"=",
"WebInspector",
".",
"log",
".",
"queued",
";",
"if",
"(",
"!",
"queued",
")",
"return",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"queued",
".",
"length",
";",
"++",
"i",... | flush the queue of pending messages | [
"flush",
"the",
"queue",
"of",
"pending",
"messages"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/client/inspector.js#L1213-L1223 | train | Flush the queue of queued messages | [
30522,
3853,
13862,
4226,
5657,
1006,
1007,
1063,
13075,
24240,
2094,
1027,
4773,
7076,
5051,
16761,
1012,
8833,
1012,
24240,
2094,
1025,
2065,
1006,
999,
24240,
2094,
1007,
2709,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
airbnb/enzyme | packages/enzyme/src/ShallowWrapper.js | makeShallowOptions | function makeShallowOptions(nodes, root, passedOptions, wrapper) {
const options = makeOptions(passedOptions);
const adapter = getAdapter(passedOptions);
privateSet(options, PROVIDER_VALUES, passedOptions[PROVIDER_VALUES]);
if (root || !isCustomComponent(options.wrappingComponent, adapter)) {
return options... | javascript | function makeShallowOptions(nodes, root, passedOptions, wrapper) {
const options = makeOptions(passedOptions);
const adapter = getAdapter(passedOptions);
privateSet(options, PROVIDER_VALUES, passedOptions[PROVIDER_VALUES]);
if (root || !isCustomComponent(options.wrappingComponent, adapter)) {
return options... | [
"function",
"makeShallowOptions",
"(",
"nodes",
",",
"root",
",",
"passedOptions",
",",
"wrapper",
")",
"{",
"const",
"options",
"=",
"makeOptions",
"(",
"passedOptions",
")",
";",
"const",
"adapter",
"=",
"getAdapter",
"(",
"passedOptions",
")",
";",
"private... | Makes options specifically for `ShallowWrapper`. Most of the logic here is around rendering
a `wrappingComponent` (if one was provided) and adding the child context of that component
to `options.context`.
@param {ReactElement} nodes the nodes passed to `ShallowWrapper`
@param {ShallowWrapper} root this `ShallowWrapper... | [
"Makes",
"options",
"specifically",
"for",
"ShallowWrapper",
".",
"Most",
"of",
"the",
"logic",
"here",
"is",
"around",
"rendering",
"a",
"wrappingComponent",
"(",
"if",
"one",
"was",
"provided",
")",
"and",
"adding",
"the",
"child",
"context",
"of",
"that",
... | cd430eae95eba151f17e970ee77c18f09476de0e | https://github.com/airbnb/enzyme/blob/cd430eae95eba151f17e970ee77c18f09476de0e/packages/enzyme/src/ShallowWrapper.js#L343-L369 | train | Creates a shallow copy of passed options | [
30522,
3853,
3084,
9892,
5004,
7361,
9285,
1006,
14164,
1010,
7117,
1010,
2979,
7361,
9285,
1010,
10236,
4842,
1007,
1063,
9530,
3367,
7047,
1027,
2191,
7361,
9285,
1006,
2979,
7361,
9285,
1007,
1025,
9530,
3367,
15581,
2121,
1027,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | parse_theme_xml | function parse_theme_xml(data, opts) {
/* 20.1.6.9 theme CT_OfficeStyleSheet */
if(!data || data.length === 0) return parse_theme_xml(write_theme());
var t;
var themes = {};
/* themeElements CT_BaseStyles */
if(!(t=data.match(themeltregex))) throw new Error('themeElements not found in theme');
parse_themeEleme... | javascript | function parse_theme_xml(data, opts) {
/* 20.1.6.9 theme CT_OfficeStyleSheet */
if(!data || data.length === 0) return parse_theme_xml(write_theme());
var t;
var themes = {};
/* themeElements CT_BaseStyles */
if(!(t=data.match(themeltregex))) throw new Error('themeElements not found in theme');
parse_themeEleme... | [
"function",
"parse_theme_xml",
"(",
"data",
",",
"opts",
")",
"{",
"/* 20.1.6.9 theme CT_OfficeStyleSheet */",
"if",
"(",
"!",
"data",
"||",
"data",
".",
"length",
"===",
"0",
")",
"return",
"parse_theme_xml",
"(",
"write_theme",
"(",
")",
")",
";",
"var",
"... | /* 14.2.7 Theme Part | [
"/",
"*",
"14",
".",
"2",
".",
"7",
"Theme",
"Part"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L9496-L9508 | train | Parse theme XML | [
30522,
3853,
11968,
3366,
1035,
4323,
1035,
20950,
1006,
2951,
1010,
23569,
2015,
1007,
1063,
1013,
1008,
2322,
1012,
1015,
1012,
1020,
1012,
1023,
4323,
14931,
1035,
4822,
27983,
4095,
15558,
1008,
1013,
2065,
1006,
999,
2951,
1064,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sass/node-sass | lib/index.js | getStats | function getStats(options) {
var stats = {};
stats.entry = options.file || 'data';
stats.start = Date.now();
return stats;
} | javascript | function getStats(options) {
var stats = {};
stats.entry = options.file || 'data';
stats.start = Date.now();
return stats;
} | [
"function",
"getStats",
"(",
"options",
")",
"{",
"var",
"stats",
"=",
"{",
"}",
";",
"stats",
".",
"entry",
"=",
"options",
".",
"file",
"||",
"'data'",
";",
"stats",
".",
"start",
"=",
"Date",
".",
"now",
"(",
")",
";",
"return",
"stats",
";",
... | Get stats
@param {Object} options
@api private | [
"Get",
"stats"
] | 0c1a49eefa37544d16041c5fe5b2e3d9168004b7 | https://github.com/sass/node-sass/blob/0c1a49eefa37544d16041c5fe5b2e3d9168004b7/lib/index.js#L68-L75 | train | Get stats for a file | [
30522,
3853,
4152,
29336,
2015,
1006,
7047,
1007,
1063,
13075,
26319,
1027,
1063,
1065,
1025,
26319,
1012,
4443,
1027,
7047,
1012,
5371,
1064,
1064,
1005,
2951,
1005,
1025,
26319,
1012,
2707,
1027,
3058,
1012,
2085,
1006,
1007,
1025,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/less.js | function () {
var str, j = i, e, index = i;
if (input.charAt(j) === '~') { j++; e = true; } // Escaped strings
if (input.charAt(j) !== '"' && input.charAt(j) !== "'") { return; }
if (e) { $char('~'); }
str = $re(/^"((... | javascript | function () {
var str, j = i, e, index = i;
if (input.charAt(j) === '~') { j++; e = true; } // Escaped strings
if (input.charAt(j) !== '"' && input.charAt(j) !== "'") { return; }
if (e) { $char('~'); }
str = $re(/^"((... | [
"function",
"(",
")",
"{",
"var",
"str",
",",
"j",
"=",
"i",
",",
"e",
",",
"index",
"=",
"i",
";",
"if",
"(",
"input",
".",
"charAt",
"(",
"j",
")",
"===",
"'~'",
")",
"{",
"j",
"++",
";",
"e",
"=",
"true",
";",
"}",
"// Escaped strings",
... | A string, which supports escaping " and ' "milky way" 'he\'s the one!' | [
"A",
"string",
"which",
"supports",
"escaping",
"and",
"milky",
"way",
"he",
"\\",
"s",
"the",
"one!"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L812-L824 | train | Parse a quoted string | [
30522,
3853,
1006,
1007,
1063,
13075,
2358,
2099,
1010,
1046,
1027,
1045,
1010,
1041,
1010,
5950,
1027,
1045,
1025,
2065,
1006,
7953,
1012,
25869,
4017,
1006,
1046,
1007,
1027,
1027,
1027,
1005,
1066,
1005,
1007,
1063,
1046,
1009,
1009,
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... | |
summernote/summernote | src/js/base/core/dom.js | makePredByNodeName | function makePredByNodeName(nodeName) {
nodeName = nodeName.toUpperCase();
return function(node) {
return node && node.nodeName.toUpperCase() === nodeName;
};
} | javascript | function makePredByNodeName(nodeName) {
nodeName = nodeName.toUpperCase();
return function(node) {
return node && node.nodeName.toUpperCase() === nodeName;
};
} | [
"function",
"makePredByNodeName",
"(",
"nodeName",
")",
"{",
"nodeName",
"=",
"nodeName",
".",
"toUpperCase",
"(",
")",
";",
"return",
"function",
"(",
"node",
")",
"{",
"return",
"node",
"&&",
"node",
".",
"nodeName",
".",
"toUpperCase",
"(",
")",
"===",
... | @method makePredByNodeName
returns predicate which judge whether nodeName is same
@param {String} nodeName
@return {Function} | [
"@method",
"makePredByNodeName"
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L41-L46 | train | Returns a function that returns true if the node is a pred | [
30522,
3853,
2191,
28139,
18939,
6038,
10244,
18442,
1006,
13045,
18442,
1007,
1063,
13045,
18442,
1027,
13045,
18442,
1012,
2000,
29547,
18992,
3366,
1006,
1007,
1025,
2709,
3853,
1006,
13045,
1007,
1063,
2709,
13045,
1004,
1004,
13045,
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/model/analytics/odata4analytics.js | function() {
var oReferencedProperties = {};
for ( var i = -1, oUI5Filter; (oUI5Filter = this._aConditionUI5Filter[++i]) !== undefined;) {
if (oReferencedProperties[oUI5Filter.sPath] == undefined) {
oReferencedProperties[oUI5Filter.sPath] = [];
}
oReferencedProperties[oUI5Filter.sPath].push(oUI5... | javascript | function() {
var oReferencedProperties = {};
for ( var i = -1, oUI5Filter; (oUI5Filter = this._aConditionUI5Filter[++i]) !== undefined;) {
if (oReferencedProperties[oUI5Filter.sPath] == undefined) {
oReferencedProperties[oUI5Filter.sPath] = [];
}
oReferencedProperties[oUI5Filter.sPath].push(oUI5... | [
"function",
"(",
")",
"{",
"var",
"oReferencedProperties",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"oUI5Filter",
";",
"(",
"oUI5Filter",
"=",
"this",
".",
"_aConditionUI5Filter",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
"... | Get the properties referenced by the filter expression.
@returns {object} Object containing (JavaScript) properties for all (OData entity type)
properties referenced in the filter expression. The value for each of these properties is an array holding all used UI5 filters referencing them.
@private | [
"Get",
"the",
"properties",
"referenced",
"by",
"the",
"filter",
"expression",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3310-L3324 | train | Returns the properties referenced by the filter | [
30522,
3853,
1006,
1007,
1063,
13075,
10848,
25523,
18927,
18981,
8743,
3111,
1027,
1063,
1065,
1025,
2005,
1006,
13075,
1045,
1027,
1011,
1015,
1010,
15068,
2072,
2629,
8873,
21928,
1025,
1006,
15068,
2072,
2629,
8873,
21928,
1027,
2023,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/AutoUpdate/main.js | initState | function initState() {
var result = $.Deferred();
updateJsonHandler.parse()
.done(function() {
result.resolve();
})
.fail(function (code) {
var logMsg;
switch (code) {
case StateHandlerMessages.FILE_NOT_F... | javascript | function initState() {
var result = $.Deferred();
updateJsonHandler.parse()
.done(function() {
result.resolve();
})
.fail(function (code) {
var logMsg;
switch (code) {
case StateHandlerMessages.FILE_NOT_F... | [
"function",
"initState",
"(",
")",
"{",
"var",
"result",
"=",
"$",
".",
"Deferred",
"(",
")",
";",
"updateJsonHandler",
".",
"parse",
"(",
")",
".",
"done",
"(",
"function",
"(",
")",
"{",
"result",
".",
"resolve",
"(",
")",
";",
"}",
")",
".",
"... | Initializes the state of parsed content from updateHelper.json
returns Promise Object Which is resolved when parsing is success
and rejected if parsing is failed. | [
"Initializes",
"the",
"state",
"of",
"parsed",
"content",
"from",
"updateHelper",
".",
"json",
"returns",
"Promise",
"Object",
"Which",
"is",
"resolved",
"when",
"parsing",
"is",
"success",
"and",
"rejected",
"if",
"parsing",
"is",
"failed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L287-L313 | train | Initialize AutoUpdate state | [
30522,
3853,
1999,
12762,
12259,
1006,
1007,
1063,
13075,
2765,
1027,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
10651,
22578,
2239,
11774,
3917,
1012,
11968,
3366,
1006,
1007,
1012,
2589,
1006,
3853,
1006,
1007,
1063,
2765,
1012,
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.table/src/sap/ui/table/TableAccExtension.js | function(oExtension) {
if (oExtension._cleanupInfo) {
oExtension._cleanupInfo.cell.attr(oExtension._cleanupInfo.attr);
oExtension._cleanupInfo = null;
}
} | javascript | function(oExtension) {
if (oExtension._cleanupInfo) {
oExtension._cleanupInfo.cell.attr(oExtension._cleanupInfo.attr);
oExtension._cleanupInfo = null;
}
} | [
"function",
"(",
"oExtension",
")",
"{",
"if",
"(",
"oExtension",
".",
"_cleanupInfo",
")",
"{",
"oExtension",
".",
"_cleanupInfo",
".",
"cell",
".",
"attr",
"(",
"oExtension",
".",
"_cleanupInfo",
".",
"attr",
")",
";",
"oExtension",
".",
"_cleanupInfo",
... | /*
Removes the acc modifications of the cell which had the focus before. | [
"/",
"*",
"Removes",
"the",
"acc",
"modifications",
"of",
"the",
"cell",
"which",
"had",
"the",
"focus",
"before",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableAccExtension.js#L280-L285 | train | Removes the attribute from the cell if any. | [
30522,
3853,
1006,
1051,
10288,
29048,
1007,
1063,
2065,
1006,
1051,
10288,
29048,
1012,
1035,
27686,
2378,
14876,
1007,
1063,
1051,
10288,
29048,
1012,
1035,
27686,
2378,
14876,
1012,
3526,
1012,
2012,
16344,
1006,
1051,
10288,
29048,
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... | |
openlayers/openlayers | examples/geolocation-orientation.js | getCenterWithHeading | function getCenterWithHeading(position, rotation, resolution) {
const size = map.getSize();
const height = size[1];
return [
position[0] - Math.sin(rotation) * height * resolution * 1 / 4,
position[1] + Math.cos(rotation) * height * resolution * 1 / 4
];
} | javascript | function getCenterWithHeading(position, rotation, resolution) {
const size = map.getSize();
const height = size[1];
return [
position[0] - Math.sin(rotation) * height * resolution * 1 / 4,
position[1] + Math.cos(rotation) * height * resolution * 1 / 4
];
} | [
"function",
"getCenterWithHeading",
"(",
"position",
",",
"rotation",
",",
"resolution",
")",
"{",
"const",
"size",
"=",
"map",
".",
"getSize",
"(",
")",
";",
"const",
"height",
"=",
"size",
"[",
"1",
"]",
";",
"return",
"[",
"position",
"[",
"0",
"]",... | recenters the view by putting the given coordinates at 3/4 from the top or the screen | [
"recenters",
"the",
"view",
"by",
"putting",
"the",
"given",
"coordinates",
"at",
"3",
"/",
"4",
"from",
"the",
"top",
"or",
"the",
"screen"
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/geolocation-orientation.js#L128-L136 | train | Get center of the block with heading | [
30522,
3853,
2131,
13013,
2121,
24415,
4974,
2075,
1006,
2597,
1010,
9963,
1010,
5813,
1007,
1063,
9530,
3367,
2946,
1027,
4949,
1012,
4152,
4697,
1006,
1007,
1025,
9530,
3367,
4578,
1027,
2946,
1031,
1015,
1033,
1025,
2709,
1031,
2597,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/FileViewController.js | openAndSelectDocument | function openAndSelectDocument(fullPath, fileSelectionFocus, paneId) {
var result,
curDocChangedDueToMe = _curDocChangedDueToMe;
function _getDerivedPaneContext() {
function _secondPaneContext() {
return (window.event.ctrlKey || window.event.metaKey) && window.e... | javascript | function openAndSelectDocument(fullPath, fileSelectionFocus, paneId) {
var result,
curDocChangedDueToMe = _curDocChangedDueToMe;
function _getDerivedPaneContext() {
function _secondPaneContext() {
return (window.event.ctrlKey || window.event.metaKey) && window.e... | [
"function",
"openAndSelectDocument",
"(",
"fullPath",
",",
"fileSelectionFocus",
",",
"paneId",
")",
"{",
"var",
"result",
",",
"curDocChangedDueToMe",
"=",
"_curDocChangedDueToMe",
";",
"function",
"_getDerivedPaneContext",
"(",
")",
"{",
"function",
"_secondPaneContex... | Opens a document if it's not open and selects the file in the UI corresponding to
fileSelectionFocus
@param {!fullPath} fullPath - full path of the document to open
@param {string} fileSelectionFocus - (WORKING_SET_VIEW || PROJECT_MANAGER)
@param {string} paneId - pane in which to open the document
@return {$.Promise} | [
"Opens",
"a",
"document",
"if",
"it",
"s",
"not",
"open",
"and",
"selects",
"the",
"file",
"in",
"the",
"UI",
"corresponding",
"to",
"fileSelectionFocus"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileViewController.js#L145-L195 | train | Open a file and select a document in the specified pane | [
30522,
3853,
2330,
29560,
12260,
6593,
3527,
24894,
4765,
1006,
2440,
15069,
1010,
6764,
12260,
7542,
14876,
7874,
1010,
6090,
7416,
2094,
1007,
1063,
13075,
2765,
1010,
12731,
20683,
9468,
18003,
22367,
23361,
8462,
1027,
1035,
12731,
20683,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/Agents/DOMAgent.js | _onLoadEventFired | function _onLoadEventFired(event, res) {
// res = {timestamp}
Inspector.DOM.getDocument(function onGetDocument(res) {
exports.trigger("getDocument", res);
// res = {root}
_idToNode = {};
_pendingRequests = 0;
exports.root = new DOMNode(exports,... | javascript | function _onLoadEventFired(event, res) {
// res = {timestamp}
Inspector.DOM.getDocument(function onGetDocument(res) {
exports.trigger("getDocument", res);
// res = {root}
_idToNode = {};
_pendingRequests = 0;
exports.root = new DOMNode(exports,... | [
"function",
"_onLoadEventFired",
"(",
"event",
",",
"res",
")",
"{",
"// res = {timestamp}",
"Inspector",
".",
"DOM",
".",
"getDocument",
"(",
"function",
"onGetDocument",
"(",
"res",
")",
"{",
"exports",
".",
"trigger",
"(",
"\"getDocument\"",
",",
"res",
")"... | WebInspector Event: Page.loadEventFired | [
"WebInspector",
"Event",
":",
"Page",
".",
"loadEventFired"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L184-L193 | train | Load event fired | [
30522,
3853,
1035,
2006,
11066,
18697,
3372,
10273,
2094,
1006,
2724,
1010,
24501,
1007,
1063,
1013,
1013,
24501,
1027,
1063,
2335,
15464,
2361,
1065,
7742,
1012,
14383,
1012,
2131,
3527,
24894,
4765,
1006,
3853,
2006,
18150,
3527,
24894,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-return-await.js | isInTailCallPosition | function isInTailCallPosition(node) {
if (node.parent.type === "ArrowFunctionExpression") {
return true;
}
if (node.parent.type === "ReturnStatement") {
return !hasErrorHandler(node.parent);
}
if (node.parent.type === "Condition... | javascript | function isInTailCallPosition(node) {
if (node.parent.type === "ArrowFunctionExpression") {
return true;
}
if (node.parent.type === "ReturnStatement") {
return !hasErrorHandler(node.parent);
}
if (node.parent.type === "Condition... | [
"function",
"isInTailCallPosition",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"parent",
".",
"type",
"===",
"\"ArrowFunctionExpression\"",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"node",
".",
"parent",
".",
"type",
"===",
"\"ReturnStatement\"",... | Checks if a node is placed in tail call position. Once `return` arguments (or arrow function expressions) can be a complex expression,
an `await` expression could or could not be unnecessary by the definition of this rule. So we're looking for `await` expressions that are in tail position.
@param {ASTNode} node A node ... | [
"Checks",
"if",
"a",
"node",
"is",
"placed",
"in",
"tail",
"call",
"position",
".",
"Once",
"return",
"arguments",
"(",
"or",
"arrow",
"function",
"expressions",
")",
"can",
"be",
"a",
"complex",
"expression",
"an",
"await",
"expression",
"could",
"or",
"c... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-return-await.js#L74-L91 | train | Check if a node is in the tail of the call | [
30522,
3853,
2003,
18447,
12502,
9289,
14277,
19234,
1006,
13045,
1007,
1063,
2065,
1006,
13045,
1012,
6687,
1012,
2828,
1027,
1027,
1027,
1000,
8612,
11263,
27989,
10288,
20110,
3258,
1000,
1007,
1063,
2709,
2995,
1025,
1065,
2065,
1006,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mjmlio/mjml | packages/mjml-validator/src/dependencies.js | mergeArrays | function mergeArrays(objValue, srcValue) {
if (isArray(objValue) && isArray(srcValue)) {
return objValue.concat(srcValue)
}
} | javascript | function mergeArrays(objValue, srcValue) {
if (isArray(objValue) && isArray(srcValue)) {
return objValue.concat(srcValue)
}
} | [
"function",
"mergeArrays",
"(",
"objValue",
",",
"srcValue",
")",
"{",
"if",
"(",
"isArray",
"(",
"objValue",
")",
"&&",
"isArray",
"(",
"srcValue",
")",
")",
"{",
"return",
"objValue",
".",
"concat",
"(",
"srcValue",
")",
"}",
"}"
] | eslint-disable-next-line consistent-return | [
"eslint",
"-",
"disable",
"-",
"next",
"-",
"line",
"consistent",
"-",
"return"
] | 50e0505ef0377c13e7989a699b4c3c264faf4c0f | https://github.com/mjmlio/mjml/blob/50e0505ef0377c13e7989a699b4c3c264faf4c0f/packages/mjml-validator/src/dependencies.js#L4-L8 | train | Merge two arrays | [
30522,
3853,
13590,
2906,
9447,
2015,
1006,
27885,
3501,
10175,
5657,
1010,
5034,
2278,
10175,
5657,
1007,
1063,
2065,
1006,
18061,
11335,
2100,
1006,
27885,
3501,
10175,
5657,
1007,
1004,
1004,
18061,
11335,
2100,
1006,
5034,
2278,
10175,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | generateSelector | function generateSelector(elm, options, doc) {
/*eslint no-loop-func:0*/
if (!axe._selectorData) {
throw new Error('Expect axe._selectorData to be set up');
}
const { toRoot = false } = options;
let selector;
let similar;
/**
* Try to find a unique selector by filtering out all the clashing
* nodes by add... | javascript | function generateSelector(elm, options, doc) {
/*eslint no-loop-func:0*/
if (!axe._selectorData) {
throw new Error('Expect axe._selectorData to be set up');
}
const { toRoot = false } = options;
let selector;
let similar;
/**
* Try to find a unique selector by filtering out all the clashing
* nodes by add... | [
"function",
"generateSelector",
"(",
"elm",
",",
"options",
",",
"doc",
")",
"{",
"/*eslint no-loop-func:0*/",
"if",
"(",
"!",
"axe",
".",
"_selectorData",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Expect axe._selectorData to be set up'",
")",
";",
"}",
"const",... | generates a single selector for an element
@param {Element} elm The element for which to generate a selector
@param {Object} options Options for how to generate the selector
@param {RootNode} doc The root node of the document or document fragment
@returns {String} The selector | [
"generates",
"a",
"single",
"selector",
"for",
"an",
"element"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/get-selector.js#L336-L378 | train | Generates a unique selector for the given element | [
30522,
3853,
19421,
12260,
16761,
1006,
17709,
1010,
7047,
1010,
9986,
1007,
1063,
1013,
1008,
9686,
4115,
2102,
2053,
1011,
7077,
1011,
4569,
2278,
1024,
1014,
1008,
1013,
2065,
1006,
999,
12946,
1012,
1035,
27000,
2850,
2696,
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... |
getsentry/sentry-javascript | packages/raven-js/src/raven.js | function(current) {
var last = this._lastData;
if (
!last ||
current.message !== last.message || // defined for captureMessage
current.transaction !== last.transaction // defined for captureException/onerror
)
return false;
// Stacktrace interface (i.e. from captureMessage)
... | javascript | function(current) {
var last = this._lastData;
if (
!last ||
current.message !== last.message || // defined for captureMessage
current.transaction !== last.transaction // defined for captureException/onerror
)
return false;
// Stacktrace interface (i.e. from captureMessage)
... | [
"function",
"(",
"current",
")",
"{",
"var",
"last",
"=",
"this",
".",
"_lastData",
";",
"if",
"(",
"!",
"last",
"||",
"current",
".",
"message",
"!==",
"last",
".",
"message",
"||",
"// defined for captureMessage",
"current",
".",
"transaction",
"!==",
"l... | Returns true if the in-process data payload matches the signature
of the previously-sent data
NOTE: This has to be done at this level because TraceKit can generate
data from window.onerror WITHOUT an exception object (IE8, IE9,
other old browsers). This can take the form of an "exception"
data object with a single fra... | [
"Returns",
"true",
"if",
"the",
"in",
"-",
"process",
"data",
"payload",
"matches",
"the",
"signature",
"of",
"the",
"previously",
"-",
"sent",
"data"
] | a872223343fecf7364473b78bede937f1eb57bd0 | https://github.com/getsentry/sentry-javascript/blob/a872223343fecf7364473b78bede937f1eb57bd0/packages/raven-js/src/raven.js#L1908-L1930 | train | Returns true if current is the same as last data | [
30522,
3853,
1006,
2783,
1007,
1063,
13075,
2197,
1027,
2023,
1012,
1035,
2197,
2850,
2696,
1025,
2065,
1006,
999,
2197,
1064,
1064,
2783,
1012,
4471,
999,
1027,
1027,
2197,
1012,
4471,
1064,
1064,
1013,
1013,
4225,
2005,
5425,
7834,
3736... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TableAccExtension.js | function(oSourceInfo, oTargetInfo, iLevel) {
iLevel = iLevel ? iLevel : 0;
ACCInfoHelper._normalize(oSourceInfo);
if (iLevel == 0) {
ACCInfoHelper._normalize(oTargetInfo);
oTargetInfo._descriptions = [];
}
oTargetInfo._descriptions.push(ACCInfoHelper._getFullDescription(oSourceInfo));
oSour... | javascript | function(oSourceInfo, oTargetInfo, iLevel) {
iLevel = iLevel ? iLevel : 0;
ACCInfoHelper._normalize(oSourceInfo);
if (iLevel == 0) {
ACCInfoHelper._normalize(oTargetInfo);
oTargetInfo._descriptions = [];
}
oTargetInfo._descriptions.push(ACCInfoHelper._getFullDescription(oSourceInfo));
oSour... | [
"function",
"(",
"oSourceInfo",
",",
"oTargetInfo",
",",
"iLevel",
")",
"{",
"iLevel",
"=",
"iLevel",
"?",
"iLevel",
":",
"0",
";",
"ACCInfoHelper",
".",
"_normalize",
"(",
"oSourceInfo",
")",
";",
"if",
"(",
"iLevel",
"==",
"0",
")",
"{",
"ACCInfoHelper... | /*
Merges the focusable flag and the descriptions of the source and its children into the given target. | [
"/",
"*",
"Merges",
"the",
"focusable",
"flag",
"and",
"the",
"descriptions",
"of",
"the",
"source",
"and",
"its",
"children",
"into",
"the",
"given",
"target",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableAccExtension.js#L74-L100 | train | flattens the source and target information | [
30522,
3853,
1006,
9808,
8162,
3401,
2378,
14876,
1010,
27178,
2906,
18150,
2378,
14876,
1010,
17869,
15985,
1007,
1063,
17869,
15985,
1027,
17869,
15985,
1029,
17869,
15985,
1024,
1014,
1025,
16222,
2378,
14876,
16001,
4842,
1012,
1035,
3671... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 (moreattrs)
{
for (var k in moreattrs) {
if (moreattrs.hasOwnProperty(k)) {
this.node.setAttribute(k, moreattrs[k]);
}
}
return this;
} | javascript | function (moreattrs)
{
for (var k in moreattrs) {
if (moreattrs.hasOwnProperty(k)) {
this.node.setAttribute(k, moreattrs[k]);
}
}
return this;
} | [
"function",
"(",
"moreattrs",
")",
"{",
"for",
"(",
"var",
"k",
"in",
"moreattrs",
")",
"{",
"if",
"(",
"moreattrs",
".",
"hasOwnProperty",
"(",
"k",
")",
")",
"{",
"this",
".",
"node",
".",
"setAttribute",
"(",
"k",
",",
"moreattrs",
"[",
"k",
"]"... | Function: attrs
Add or modify attributes of the current element.
The attributes should be passed in object notation. This function
does not move the current element pointer.
Parameters:
(Object) moreattrs - The attributes to add/modify in object notation.
Returns:
The Strophe.Builder object. | [
"Function",
":",
"attrs",
"Add",
"or",
"modify",
"attributes",
"of",
"the",
"current",
"element",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L1660-L1668 | train | Returns a new node with the specified attributes. | [
30522,
3853,
1006,
2062,
19321,
2869,
1007,
1063,
2005,
1006,
13075,
1047,
1999,
2062,
19321,
2869,
1007,
1063,
2065,
1006,
2062,
19321,
2869,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
1047,
1007,
1007,
1063,
2023,
1012,
13045,
1012,
2275... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
nhn/tui.editor | src/js/extensions/table/mergedTableRemoveCol.js | _updateColspan | function _updateColspan(tableData, startColIndex, endColIndex) {
tableData.forEach(rowData => {
util.range(startColIndex, endColIndex + 1).forEach(colIndex => {
const cellData = rowData [colIndex];
if (util.isExisty(cellData.colMergeWith)) {
const merger = rowData [cellData.colMergeWith];
... | javascript | function _updateColspan(tableData, startColIndex, endColIndex) {
tableData.forEach(rowData => {
util.range(startColIndex, endColIndex + 1).forEach(colIndex => {
const cellData = rowData [colIndex];
if (util.isExisty(cellData.colMergeWith)) {
const merger = rowData [cellData.colMergeWith];
... | [
"function",
"_updateColspan",
"(",
"tableData",
",",
"startColIndex",
",",
"endColIndex",
")",
"{",
"tableData",
".",
"forEach",
"(",
"rowData",
"=>",
"{",
"util",
".",
"range",
"(",
"startColIndex",
",",
"endColIndex",
"+",
"1",
")",
".",
"forEach",
"(",
... | Update colspan to col merger.
@param {Array.<Array.<object>>} tableData - table data
@param {number} startColIndex - start col index
@param {number} endColIndex - end col index
@private | [
"Update",
"colspan",
"to",
"col",
"merger",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/mergedTableRemoveCol.js#L64-L86 | train | Update the colspan of the table data | [
30522,
3853,
1035,
30524,
1006,
5216,
2850,
2696,
1027,
1028,
1063,
21183,
4014,
1012,
2846,
1006,
2707,
25778,
22254,
10288,
1010,
2203,
25778,
22254,
10288,
1009,
1015,
1007,
1012,
18921,
6776,
1006,
6972,
3207,
2595,
1027,
1028,
1063,
95... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TableColumnUtils.js | function(oTable, sColumnId, iLevel) {
var oColumnMapItem = TableColumnUtils.getColumnMapItem(oTable, sColumnId);
if (!oColumnMapItem) {
return undefined;
}
var aChildren = [];
var iEnd;
if (iLevel === undefined) {
iEnd = oColumnMapItem.levelInfo.length;
} else {
iEnd = iLevel + 1;
}... | javascript | function(oTable, sColumnId, iLevel) {
var oColumnMapItem = TableColumnUtils.getColumnMapItem(oTable, sColumnId);
if (!oColumnMapItem) {
return undefined;
}
var aChildren = [];
var iEnd;
if (iLevel === undefined) {
iEnd = oColumnMapItem.levelInfo.length;
} else {
iEnd = iLevel + 1;
}... | [
"function",
"(",
"oTable",
",",
"sColumnId",
",",
"iLevel",
")",
"{",
"var",
"oColumnMapItem",
"=",
"TableColumnUtils",
".",
"getColumnMapItem",
"(",
"oTable",
",",
"sColumnId",
")",
";",
"if",
"(",
"!",
"oColumnMapItem",
")",
"{",
"return",
"undefined",
";"... | Returns an array of the column information about all columns which are spanned by the column identified by sColumnId.
If there is no "parent", it returns undefined.
@param {sap.ui.table.Table} oTable Instance of the table.
@param {string} sColumnId ID of the column for which the Span-parent shall be found.
@param {int... | [
"Returns",
"an",
"array",
"of",
"the",
"column",
"information",
"about",
"all",
"columns",
"which",
"are",
"spanned",
"by",
"the",
"column",
"identified",
"by",
"sColumnId",
".",
"If",
"there",
"is",
"no",
"parent",
"it",
"returns",
"undefined",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableColumnUtils.js#L210-L232 | train | Returns an array of the children of the column | [
30522,
3853,
1006,
27178,
3085,
1010,
8040,
4747,
2819,
3490,
2094,
1010,
17869,
15985,
1007,
1063,
13075,
1051,
25778,
2819,
2078,
2863,
23270,
6633,
1027,
2795,
25778,
2819,
24072,
12146,
1012,
2131,
25778,
2819,
2078,
2863,
23270,
6633,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/tracked-controls-webvr.js | function (id, buttonState) {
var evtName;
var previousButtonState = this.buttonStates[id];
// Not changed.
if (buttonState.touched === previousButtonState.touched) { return false; }
evtName = buttonState.touched ? EVENTS.TOUCHSTART : EVENTS.TOUCHEND;
this.el.emit(evtName, this.buttonEventDetai... | javascript | function (id, buttonState) {
var evtName;
var previousButtonState = this.buttonStates[id];
// Not changed.
if (buttonState.touched === previousButtonState.touched) { return false; }
evtName = buttonState.touched ? EVENTS.TOUCHSTART : EVENTS.TOUCHEND;
this.el.emit(evtName, this.buttonEventDetai... | [
"function",
"(",
"id",
",",
"buttonState",
")",
"{",
"var",
"evtName",
";",
"var",
"previousButtonState",
"=",
"this",
".",
"buttonStates",
"[",
"id",
"]",
";",
"// Not changed.",
"if",
"(",
"buttonState",
".",
"touched",
"===",
"previousButtonState",
".",
"... | Determine whether a button touch has occured and emit events as appropriate.
@param {string} id - ID of the button to check.
@param {object} buttonState - State of the button to check.
@returns {boolean} Whether button touch state changed. | [
"Determine",
"whether",
"a",
"button",
"touch",
"has",
"occured",
"and",
"emit",
"events",
"as",
"appropriate",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/tracked-controls-webvr.js#L306-L317 | train | Trigger a touch event on a button | [
30522,
3853,
1006,
8909,
1010,
11287,
12259,
1007,
1063,
13075,
23408,
2102,
18442,
1025,
13075,
3025,
8569,
15474,
9153,
2618,
1027,
2023,
1012,
11287,
12259,
2015,
1031,
8909,
1033,
1025,
1013,
1013,
2025,
2904,
1012,
2065,
1006,
11287,
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... | |
grpc/grpc | examples/node/dynamic_codegen/route_guide/route_guide_client.js | runRouteChat | function runRouteChat(callback) {
var call = client.routeChat();
call.on('data', function(note) {
console.log('Got message "' + note.message + '" at ' +
note.location.latitude + ', ' + note.location.longitude);
});
call.on('end', callback);
var notes = [{
location: {
latitude: 0,
... | javascript | function runRouteChat(callback) {
var call = client.routeChat();
call.on('data', function(note) {
console.log('Got message "' + note.message + '" at ' +
note.location.latitude + ', ' + note.location.longitude);
});
call.on('end', callback);
var notes = [{
location: {
latitude: 0,
... | [
"function",
"runRouteChat",
"(",
"callback",
")",
"{",
"var",
"call",
"=",
"client",
".",
"routeChat",
"(",
")",
";",
"call",
".",
"on",
"(",
"'data'",
",",
"function",
"(",
"note",
")",
"{",
"console",
".",
"log",
"(",
"'Got message \"'",
"+",
"note",... | Run the routeChat demo. Send some chat messages, and print any chat messages
that are sent from the server.
@param {function} callback Called when the demo is complete | [
"Run",
"the",
"routeChat",
"demo",
".",
"Send",
"some",
"chat",
"messages",
"and",
"print",
"any",
"chat",
"messages",
"that",
"are",
"sent",
"from",
"the",
"server",
"."
] | cc75d93818410e2b0edd0fa3009a6def9ac403ca | https://github.com/grpc/grpc/blob/cc75d93818410e2b0edd0fa3009a6def9ac403ca/examples/node/dynamic_codegen/route_guide/route_guide_client.js#L172-L213 | train | Run the route chat | [
30522,
3853,
2448,
22494,
15007,
4017,
1006,
2655,
5963,
1007,
1063,
13075,
2655,
1027,
7396,
1012,
2799,
7507,
2102,
1006,
1007,
1025,
2655,
1012,
2006,
1006,
1005,
2951,
1005,
1010,
3853,
1006,
3602,
1007,
1063,
10122,
1012,
8833,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.f/src/sap/f/GridContainer.js | isGridSupportedByBrowser | function isGridSupportedByBrowser() {
return !Device.browser.msie && !(Device.browser.edge && Device.browser.version < EDGE_VERSION_WITH_GRID_SUPPORT);
} | javascript | function isGridSupportedByBrowser() {
return !Device.browser.msie && !(Device.browser.edge && Device.browser.version < EDGE_VERSION_WITH_GRID_SUPPORT);
} | [
"function",
"isGridSupportedByBrowser",
"(",
")",
"{",
"return",
"!",
"Device",
".",
"browser",
".",
"msie",
"&&",
"!",
"(",
"Device",
".",
"browser",
".",
"edge",
"&&",
"Device",
".",
"browser",
".",
"version",
"<",
"EDGE_VERSION_WITH_GRID_SUPPORT",
")",
";... | Indicates whether the grid is supported by the browser.
@private
@returns {boolean} If native grid is supported by the browser | [
"Indicates",
"whether",
"the",
"grid",
"is",
"supported",
"by",
"the",
"browser",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.f/src/sap/f/GridContainer.js#L35-L37 | train | Check if the browser supports grid | [
30522,
3853,
2003,
16523,
9821,
6279,
6442,
2098,
3762,
12618,
9333,
2121,
1006,
1007,
1063,
2709,
999,
5080,
1012,
16602,
1012,
5796,
2666,
1004,
1004,
999,
1006,
5080,
1012,
16602,
1012,
3341,
1004,
1004,
5080,
1012,
16602,
1012,
2544,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/uml.js | umlExtension | function umlExtension(editor, options = {}) {
const {
rendererURL = DEFAULT_RENDERER_URL
} = options;
/**
* render html from uml
* @param {string} umlCode - plant uml code text
* @returns {string} - rendered html
*/
function plantUMLReplacer(umlCode) {
let renderedHTML;
try {
if ... | javascript | function umlExtension(editor, options = {}) {
const {
rendererURL = DEFAULT_RENDERER_URL
} = options;
/**
* render html from uml
* @param {string} umlCode - plant uml code text
* @returns {string} - rendered html
*/
function plantUMLReplacer(umlCode) {
let renderedHTML;
try {
if ... | [
"function",
"umlExtension",
"(",
"editor",
",",
"options",
"=",
"{",
"}",
")",
"{",
"const",
"{",
"rendererURL",
"=",
"DEFAULT_RENDERER_URL",
"}",
"=",
"options",
";",
"/**\n * render html from uml\n * @param {string} umlCode - plant uml code text\n * @returns {string} ... | plant uml plugin
@param {Editor} editor - editor
@param {object} [options={}] - plugin options
@param {string} options.rendererURL - plant uml renderer url
@ignore | [
"plant",
"uml",
"plugin"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/uml.js#L20-L52 | train | This function is called by the plantUMLEditor to render the HTML from a uml code | [
30522,
3853,
8529,
2571,
18413,
6132,
3258,
1006,
3559,
1010,
7047,
1027,
1063,
1065,
1007,
1063,
9530,
3367,
1063,
17552,
2121,
3126,
2140,
1027,
12398,
1035,
17552,
2121,
1035,
24471,
2140,
1065,
1027,
7047,
1025,
1013,
1008,
1008,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/UpdateNotification.js | _getUpdateInformation | function _getUpdateInformation(force, dontCache, _versionInfoUrl) {
// Last time the versionInfoURL was fetched
var lastInfoURLFetchTime = PreferencesManager.getViewState("lastInfoURLFetchTime");
var result = new $.Deferred();
var fetchData = false;
var data;
// If forc... | javascript | function _getUpdateInformation(force, dontCache, _versionInfoUrl) {
// Last time the versionInfoURL was fetched
var lastInfoURLFetchTime = PreferencesManager.getViewState("lastInfoURLFetchTime");
var result = new $.Deferred();
var fetchData = false;
var data;
// If forc... | [
"function",
"_getUpdateInformation",
"(",
"force",
",",
"dontCache",
",",
"_versionInfoUrl",
")",
"{",
"// Last time the versionInfoURL was fetched",
"var",
"lastInfoURLFetchTime",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"\"lastInfoURLFetchTime\"",
")",
";",
"v... | Get a data structure that has information for all builds of Brackets.
If force is true, the information is always fetched from _versionInfoURL.
If force is false, we try to use cached information. If more than
24 hours have passed since the last fetch, or if cached data can't be found,
the data is fetched again.
If n... | [
"Get",
"a",
"data",
"structure",
"that",
"has",
"information",
"for",
"all",
"builds",
"of",
"Brackets",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/UpdateNotification.js#L159-L262 | train | Get the update information from the cache | [
30522,
3853,
1035,
2131,
6279,
13701,
2378,
14192,
3370,
1006,
2486,
1010,
2123,
13535,
15395,
1010,
1035,
2544,
2378,
14876,
3126,
2140,
1007,
1063,
1013,
1013,
2197,
2051,
1996,
2544,
2378,
14876,
3126,
2140,
2001,
18584,
2098,
13075,
219... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/rules/CoreHelper.support.js | function (node, oScope) {
/**
* Here we white list all controls that can contain DOM elements with style different than the framework style
*/
var skipParents = ["sap.ui.core.HTML"],
parentNode = jQuery(node).control()[0];
if (!parentNode) {
return false;
}
var parentName = par... | javascript | function (node, oScope) {
/**
* Here we white list all controls that can contain DOM elements with style different than the framework style
*/
var skipParents = ["sap.ui.core.HTML"],
parentNode = jQuery(node).control()[0];
if (!parentNode) {
return false;
}
var parentName = par... | [
"function",
"(",
"node",
",",
"oScope",
")",
"{",
"/**\n\t\t\t\t * Here we white list all controls that can contain DOM elements with style different than the framework style\n\t\t\t\t */",
"var",
"skipParents",
"=",
"[",
"\"sap.ui.core.HTML\"",
"]",
",",
"parentNode",
"=",
"jQuery... | *
Checks of passed node has parent control of type UI5.
@param node HTML element that will be checked.
@param oScope Scope in witch checking will be executed.
@returns {boolean} If node has parent of type UI5 control it will return true, otherwise false. | [
"*",
"Checks",
"of",
"passed",
"node",
"has",
"parent",
"control",
"of",
"type",
"UI5",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/rules/CoreHelper.support.js#L18-L35 | train | Checks if the DOM node is a control that can be used as a parent of the parent of the parent | [
30522,
3853,
1006,
13045,
1010,
9808,
16186,
1007,
1063,
1013,
1008,
1008,
1008,
2182,
2057,
2317,
2862,
2035,
7711,
2008,
2064,
5383,
14383,
3787,
2007,
2806,
2367,
2084,
1996,
7705,
2806,
1008,
1013,
13075,
13558,
19362,
11187,
1027,
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... | |
wangfupeng1988/wangEditor | example/server/index.js | saveFiles | function saveFiles(req) {
return new Promise((resolve, reject) => {
const imgLinks = []
const form = new formidable.IncomingForm()
form.parse(req, function (err, fields, files) {
if (err) {
reject('formidable, form.parse err', err.stack)
}
... | javascript | function saveFiles(req) {
return new Promise((resolve, reject) => {
const imgLinks = []
const form = new formidable.IncomingForm()
form.parse(req, function (err, fields, files) {
if (err) {
reject('formidable, form.parse err', err.stack)
}
... | [
"function",
"saveFiles",
"(",
"req",
")",
"{",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"const",
"imgLinks",
"=",
"[",
"]",
"const",
"form",
"=",
"new",
"formidable",
".",
"IncomingForm",
"(",
")",
"form",
".",
... | 保存上传的文件 | [
"保存上传的文件"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/example/server/index.js#L31-L68 | train | saveFiles - Save files to disk | [
30522,
3853,
3828,
8873,
4244,
1006,
2128,
4160,
1007,
1063,
2709,
2047,
4872,
1006,
1006,
10663,
1010,
15454,
1007,
1027,
1028,
1063,
9530,
3367,
10047,
25394,
8950,
2015,
1027,
1031,
1033,
9530,
3367,
2433,
1027,
2047,
18085,
1012,
14932,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | tracing/third_party/oboe/src/lists.js | without | function without(list, test, removedFn) {
return withoutInner(list, removedFn || noop);
function withoutInner(subList, removedFn) {
return subList
? ( test(head(subList))
? (removedFn(head(subList)), tail(subList))
: cons(head(subList), withoutInner(tail... | javascript | function without(list, test, removedFn) {
return withoutInner(list, removedFn || noop);
function withoutInner(subList, removedFn) {
return subList
? ( test(head(subList))
? (removedFn(head(subList)), tail(subList))
: cons(head(subList), withoutInner(tail... | [
"function",
"without",
"(",
"list",
",",
"test",
",",
"removedFn",
")",
"{",
"return",
"withoutInner",
"(",
"list",
",",
"removedFn",
"||",
"noop",
")",
";",
"function",
"withoutInner",
"(",
"subList",
",",
"removedFn",
")",
"{",
"return",
"subList",
"?",
... | Return a list like the one given but with the first instance equal
to item removed | [
"Return",
"a",
"list",
"like",
"the",
"one",
"given",
"but",
"with",
"the",
"first",
"instance",
"equal",
"to",
"item",
"removed"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L128-L141 | train | Removes elements from list that pass test | [
30522,
3853,
2302,
1006,
2862,
1010,
3231,
1010,
3718,
2546,
2078,
1007,
1063,
2709,
2302,
23111,
2121,
1006,
2862,
1010,
3718,
2546,
2078,
1064,
1064,
2053,
7361,
1007,
1025,
3853,
2302,
23111,
2121,
1006,
4942,
9863,
1010,
3718,
2546,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js | function (oRawValue) {
if (oRawValue) {
if (oRawValue.hasOwnProperty("AnnotationPath")) {
return oRawValue.AnnotationPath;
}
if (oRawValue.hasOwnProperty("Path")) {
return oRawValue.Path;
}
if (oRawValue.hasOwnProperty("PropertyPath")) {
return oRawValue.PropertyPath;
}
if ... | javascript | function (oRawValue) {
if (oRawValue) {
if (oRawValue.hasOwnProperty("AnnotationPath")) {
return oRawValue.AnnotationPath;
}
if (oRawValue.hasOwnProperty("Path")) {
return oRawValue.Path;
}
if (oRawValue.hasOwnProperty("PropertyPath")) {
return oRawValue.PropertyPath;
}
if ... | [
"function",
"(",
"oRawValue",
")",
"{",
"if",
"(",
"oRawValue",
")",
"{",
"if",
"(",
"oRawValue",
".",
"hasOwnProperty",
"(",
"\"AnnotationPath\"",
")",
")",
"{",
"return",
"oRawValue",
".",
"AnnotationPath",
";",
"}",
"if",
"(",
"oRawValue",
".",
"hasOwnP... | Returns the dynamic "14.5.12 Expression edm:Path" (or variant thereof) contained within
the given raw value.
@param {object} oRawValue
the raw value from the meta model, e.g. <code>{AnnotationPath :
"ToSupplier/@com.sap.vocabularies.Communication.v1.Address"}</code> or <code>
{AnnotationPath : "@com.sap.vocabularies.U... | [
"Returns",
"the",
"dynamic",
"14",
".",
"5",
".",
"12",
"Expression",
"edm",
":",
"Path",
"(",
"or",
"variant",
"thereof",
")",
"contained",
"within",
"the",
"given",
"raw",
"value",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js#L233-L250 | train | Returns the path property path and navigation property path of the given annotation. | [
30522,
3853,
1006,
2030,
10376,
10175,
5657,
1007,
1063,
2065,
1006,
2030,
10376,
10175,
5657,
1007,
1063,
2065,
1006,
2030,
10376,
10175,
5657,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
1000,
5754,
17287,
3508,
15069,
1000,
1007,
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... | |
openlayers/openlayers | src/ol/interaction/Snap.js | sortByDistance | function sortByDistance(a, b) {
const deltaA = squaredDistanceToSegment(this.pixelCoordinate_, a.segment);
const deltaB = squaredDistanceToSegment(this.pixelCoordinate_, b.segment);
return deltaA - deltaB;
} | javascript | function sortByDistance(a, b) {
const deltaA = squaredDistanceToSegment(this.pixelCoordinate_, a.segment);
const deltaB = squaredDistanceToSegment(this.pixelCoordinate_, b.segment);
return deltaA - deltaB;
} | [
"function",
"sortByDistance",
"(",
"a",
",",
"b",
")",
"{",
"const",
"deltaA",
"=",
"squaredDistanceToSegment",
"(",
"this",
".",
"pixelCoordinate_",
",",
"a",
".",
"segment",
")",
";",
"const",
"deltaB",
"=",
"squaredDistanceToSegment",
"(",
"this",
".",
"p... | Sort segments by distance, helper function
@param {SegmentData} a The first segment data.
@param {SegmentData} b The second segment data.
@return {number} The difference in distance.
@this {Snap} | [
"Sort",
"segments",
"by",
"distance",
"helper",
"function"
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/interaction/Snap.js#L623-L627 | train | Sort by distance from one segment to another | [
30522,
3853,
4066,
3762,
10521,
26897,
1006,
1037,
1010,
1038,
1007,
1063,
9530,
3367,
7160,
2050,
1027,
19942,
10521,
26897,
22282,
21693,
4765,
1006,
2023,
1012,
22138,
3597,
8551,
14776,
1035,
1010,
1037,
1012,
6903,
1007,
1025,
9530,
33... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.integration/src/sap/ui/integration/host/HostConfigurationCompiler.js | loadResource | function loadResource(sUrl, sType) {
return new Promise(function (resolve, reject) {
jQuery.ajax({
url: sUrl,
async: true,
dataType: sType,
success: function (oJson) {
resolve(oJson);
},
error: function () {
reject();
}
});
});
} | javascript | function loadResource(sUrl, sType) {
return new Promise(function (resolve, reject) {
jQuery.ajax({
url: sUrl,
async: true,
dataType: sType,
success: function (oJson) {
resolve(oJson);
},
error: function () {
reject();
}
});
});
} | [
"function",
"loadResource",
"(",
"sUrl",
",",
"sType",
")",
"{",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"jQuery",
".",
"ajax",
"(",
"{",
"url",
":",
"sUrl",
",",
"async",
":",
"true",
",",
"dataType",
":... | Loads a resource of a given type async and returns a promise
@param {string} sUrl the URL to load
@param {string} sType the expected type of response "json" or "text"
@retunrs {Promise}
@private | [
"Loads",
"a",
"resource",
"of",
"a",
"given",
"type",
"async",
"and",
"returns",
"a",
"promise"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.integration/src/sap/ui/integration/host/HostConfigurationCompiler.js#L29-L43 | train | Load a resource | [
30522,
3853,
7170,
6072,
8162,
3401,
1006,
7505,
2140,
1010,
2358,
18863,
1007,
1063,
2709,
2047,
4872,
1006,
3853,
1006,
10663,
1010,
15454,
1007,
1063,
1046,
4226,
2854,
1012,
18176,
1006,
1063,
24471,
2140,
1024,
7505,
2140,
1010,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/examples/grapheditor/www/js/EditorUi.js | ChangePageSetup | function ChangePageSetup(ui, color, image, format)
{
this.ui = ui;
this.color = color;
this.previousColor = color;
this.image = image;
this.previousImage = image;
this.format = format;
this.previousFormat = format;
// Needed since null are valid values for color and image
this.ignoreColor = false;
this.igno... | javascript | function ChangePageSetup(ui, color, image, format)
{
this.ui = ui;
this.color = color;
this.previousColor = color;
this.image = image;
this.previousImage = image;
this.format = format;
this.previousFormat = format;
// Needed since null are valid values for color and image
this.ignoreColor = false;
this.igno... | [
"function",
"ChangePageSetup",
"(",
"ui",
",",
"color",
",",
"image",
",",
"format",
")",
"{",
"this",
".",
"ui",
"=",
"ui",
";",
"this",
".",
"color",
"=",
"color",
";",
"this",
".",
"previousColor",
"=",
"color",
";",
"this",
".",
"image",
"=",
"... | Change types | [
"Change",
"types"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/examples/grapheditor/www/js/EditorUi.js#L2624-L2637 | train | ChangePageSetup - Sets up the page | [
30522,
3853,
2689,
13704,
13462,
6279,
1006,
21318,
1010,
3609,
1010,
3746,
1010,
4289,
1007,
1063,
2023,
1012,
21318,
1027,
21318,
1025,
2023,
1012,
3609,
1027,
3609,
1025,
2023,
1012,
3025,
18717,
1027,
3609,
1025,
2023,
1012,
3746,
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... |
moleculerjs/moleculer | dev/dev.config.js | myMiddleware | function myMiddleware() {
return handler => async ctx => {
ctx.broker.logger.warn(">> MW1-before (from config)");
const res = await handler(ctx);
ctx.broker.logger.warn("<< MW1-after (from config)");
return res;
};
} | javascript | function myMiddleware() {
return handler => async ctx => {
ctx.broker.logger.warn(">> MW1-before (from config)");
const res = await handler(ctx);
ctx.broker.logger.warn("<< MW1-after (from config)");
return res;
};
} | [
"function",
"myMiddleware",
"(",
")",
"{",
"return",
"handler",
"=>",
"async",
"ctx",
"=>",
"{",
"ctx",
".",
"broker",
".",
"logger",
".",
"warn",
"(",
"\">> MW1-before (from config)\"",
")",
";",
"const",
"res",
"=",
"await",
"handler",
"(",
"ctx",
")",
... | /*
To test run:
node bin/moleculer-runner.js --config dev/dev.config.js --repl
Call the service and you will see middleware messages in console
mol $ call test.hello | [
"/",
"*",
"To",
"test",
"run",
":"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/dev/dev.config.js#L14-L21 | train | This is the middleware that is used to run a middleware in a middleware context. | [
30522,
3853,
2026,
4328,
20338,
8059,
1006,
1007,
1063,
2709,
28213,
1027,
1028,
2004,
6038,
2278,
14931,
2595,
1027,
1028,
1063,
14931,
2595,
1012,
20138,
1012,
8833,
4590,
1012,
11582,
1006,
1000,
1028,
1028,
12464,
2487,
1011,
2077,
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... |
ColorlibHQ/AdminLTE | bower_components/Flot/examples/axes-time-zones/date.js | function (number, digits) {
if (typeof number !== "number") { throw "not a number: " + number; }
var s = number.toString();
if (number.length > digits) {
return number.substr(number.length - digits, number.length);
}
while (s.length < digits) {
s = '0' + s;
}
return s;
} | javascript | function (number, digits) {
if (typeof number !== "number") { throw "not a number: " + number; }
var s = number.toString();
if (number.length > digits) {
return number.substr(number.length - digits, number.length);
}
while (s.length < digits) {
s = '0' + s;
}
return s;
} | [
"function",
"(",
"number",
",",
"digits",
")",
"{",
"if",
"(",
"typeof",
"number",
"!==",
"\"number\"",
")",
"{",
"throw",
"\"not a number: \"",
"+",
"number",
";",
"}",
"var",
"s",
"=",
"number",
".",
"toString",
"(",
")",
";",
"if",
"(",
"number",
... | Format a number to the length = digits. For ex: `_fixWidth(2, 2) = '02'` `_fixWidth(1998, 2) = '98'` This is used to pad numbers in converting date to string in ISO standard. | [
"Format",
"a",
"number",
"to",
"the",
"length",
"=",
"digits",
".",
"For",
"ex",
":",
"_fixWidth",
"(",
"2",
"2",
")",
"=",
"02",
"_fixWidth",
"(",
"1998",
"2",
")",
"=",
"98",
"This",
"is",
"used",
"to",
"pad",
"numbers",
"in",
"converting",
"date... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/Flot/examples/axes-time-zones/date.js#L92-L102 | train | Returns a number with the given number of digits | [
30522,
3853,
1006,
2193,
1010,
16648,
1007,
1063,
2065,
1006,
2828,
11253,
2193,
999,
1027,
1027,
1000,
2193,
1000,
1007,
1063,
5466,
1000,
2025,
1037,
2193,
1024,
1000,
1009,
2193,
1025,
1065,
13075,
1055,
1027,
2193,
1012,
2000,
3367,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js | function(oXhr, oEntry) {
var fnRespond = function() {
if (oXhr.readyState !== 0) {
var sResponseText = oEntry.response.content.text;
// Transform headers to the required format for XMLHttpRequests.
var oHeaders = {};
oEntry.response.headers.forEach(function(mHeader) {
oHeaders[mHeader.... | javascript | function(oXhr, oEntry) {
var fnRespond = function() {
if (oXhr.readyState !== 0) {
var sResponseText = oEntry.response.content.text;
// Transform headers to the required format for XMLHttpRequests.
var oHeaders = {};
oEntry.response.headers.forEach(function(mHeader) {
oHeaders[mHeader.... | [
"function",
"(",
"oXhr",
",",
"oEntry",
")",
"{",
"var",
"fnRespond",
"=",
"function",
"(",
")",
"{",
"if",
"(",
"oXhr",
".",
"readyState",
"!==",
"0",
")",
"{",
"var",
"sResponseText",
"=",
"oEntry",
".",
"response",
".",
"content",
".",
"text",
";"... | Responds to a given FakeXMLHttpRequest object with an entry from a har file.
If a delay is provided, the time is calculated and the response of async requests will be delayed.
Sync requests can not be deleayed.
@param {Object} oXhr FakeXMLHttpRequest to respond.
@param {Object} oEntry Entry from the har file. | [
"Responds",
"to",
"a",
"given",
"FakeXMLHttpRequest",
"object",
"with",
"an",
"entry",
"from",
"a",
"har",
"file",
".",
"If",
"a",
"delay",
"is",
"provided",
"the",
"time",
"is",
"calculated",
"and",
"the",
"response",
"of",
"async",
"requests",
"will",
"b... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L364-L396 | train | This function is called by the XMLHttpRequests module when the response is ready. | [
30522,
3853,
1006,
23060,
8093,
1010,
1051,
4765,
2854,
1007,
1063,
13075,
1042,
16118,
2229,
26029,
2094,
1027,
3853,
1006,
1007,
1063,
2065,
1006,
23060,
8093,
1012,
3201,
9153,
2618,
999,
1027,
1027,
1014,
1007,
1063,
13075,
5034,
2229,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
apache/incubator-echarts | src/coord/polar/polarCreator.js | resizePolar | function resizePolar(polar, polarModel, api) {
var center = polarModel.get('center');
var width = api.getWidth();
var height = api.getHeight();
polar.cx = parsePercent(center[0], width);
polar.cy = parsePercent(center[1], height);
var radiusAxis = polar.getRadiusAxis();
var size = Math.min... | javascript | function resizePolar(polar, polarModel, api) {
var center = polarModel.get('center');
var width = api.getWidth();
var height = api.getHeight();
polar.cx = parsePercent(center[0], width);
polar.cy = parsePercent(center[1], height);
var radiusAxis = polar.getRadiusAxis();
var size = Math.min... | [
"function",
"resizePolar",
"(",
"polar",
",",
"polarModel",
",",
"api",
")",
"{",
"var",
"center",
"=",
"polarModel",
".",
"get",
"(",
"'center'",
")",
";",
"var",
"width",
"=",
"api",
".",
"getWidth",
"(",
")",
";",
"var",
"height",
"=",
"api",
".",... | Resize method bound to the polar
@param {module:echarts/coord/polar/PolarModel} polarModel
@param {module:echarts/ExtensionAPI} api | [
"Resize",
"method",
"bound",
"to",
"the",
"polar"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/polar/polarCreator.js#L40-L54 | train | Resize polar to fit the specified size | [
30522,
3853,
24501,
4697,
18155,
2906,
1006,
11508,
1010,
11508,
5302,
9247,
1010,
17928,
1007,
1063,
13075,
2415,
1027,
11508,
5302,
9247,
1012,
2131,
1006,
1005,
2415,
1005,
1007,
1025,
13075,
9381,
1027,
17928,
1012,
2131,
9148,
11927,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-else-return.js | checkIfWithElse | function checkIfWithElse(node) {
const parent = node.parent;
/*
* Fixing this would require splitting one statement into two, so no error should
* be reported if this node is in a position where only one statement is allowed.
*/
if (!astUtils.... | javascript | function checkIfWithElse(node) {
const parent = node.parent;
/*
* Fixing this would require splitting one statement into two, so no error should
* be reported if this node is in a position where only one statement is allowed.
*/
if (!astUtils.... | [
"function",
"checkIfWithElse",
"(",
"node",
")",
"{",
"const",
"parent",
"=",
"node",
".",
"parent",
";",
"/*\n * Fixing this would require splitting one statement into two, so no error should\n * be reported if this node is in a position where only one statement is... | Check the if statement
@returns {void}
@param {Node} node The node for the if statement to check
@private | [
"Check",
"the",
"if",
"statement"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-else-return.js#L253-L270 | train | Check if node is a statement with an else statement | [
30522,
3853,
4638,
10128,
24415,
9050,
2063,
1006,
13045,
1007,
1063,
9530,
3367,
6687,
1027,
13045,
1012,
6687,
1025,
1013,
1008,
1008,
15887,
2023,
2052,
5478,
14541,
2028,
4861,
2046,
2048,
1010,
2061,
2053,
7561,
2323,
1008,
2022,
2988,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(mSettings) {
function applyAll(ctx, m) {
var sName, sMethod;
for ( sName in m ) {
sMethod = "set" + sName.slice(0,1).toUpperCase() + sName.slice(1);
if ( sName === 'formatSettings' && ctx.oFormatSettings ) {
applyAll(ctx.oFormatSettings, m[sName]);
} else if ( typeof ctx[sMetho... | javascript | function(mSettings) {
function applyAll(ctx, m) {
var sName, sMethod;
for ( sName in m ) {
sMethod = "set" + sName.slice(0,1).toUpperCase() + sName.slice(1);
if ( sName === 'formatSettings' && ctx.oFormatSettings ) {
applyAll(ctx.oFormatSettings, m[sName]);
} else if ( typeof ctx[sMetho... | [
"function",
"(",
"mSettings",
")",
"{",
"function",
"applyAll",
"(",
"ctx",
",",
"m",
")",
"{",
"var",
"sName",
",",
"sMethod",
";",
"for",
"(",
"sName",
"in",
"m",
")",
"{",
"sMethod",
"=",
"\"set\"",
"+",
"sName",
".",
"slice",
"(",
"0",
",",
"... | Applies multiple changes to the configuration at once.
If the changed settings contain localization related settings like <code>language</code>
or <ode>calendarType</code>, then only a single <code>localizationChanged</code> event will
be fired. As the framework has to inform all existing components, elements, models ... | [
"Applies",
"multiple",
"changes",
"to",
"the",
"configuration",
"at",
"once",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Configuration.js#L1475-L1498 | train | Apply all the settings to the current context | [
30522,
3853,
1006,
5796,
18319,
3070,
2015,
1007,
1063,
3853,
6611,
8095,
1006,
14931,
2595,
1010,
1049,
1007,
1063,
13075,
1055,
18442,
1010,
15488,
11031,
7716,
1025,
2005,
1006,
1055,
18442,
1999,
1049,
1007,
1063,
15488,
11031,
7716,
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/angular | tools/rebase-pr.js | _main | async function _main(repository, prNumber) {
console.log(`Determining target branch for PR ${prNumber} on ${repository}.`);
const targetBranch = await determineTargetBranch(repository, prNumber);
console.log(`Target branch is ${targetBranch}.`);
await exec(`git fetch origin ${targetBranch}`);
console.log(`Reb... | javascript | async function _main(repository, prNumber) {
console.log(`Determining target branch for PR ${prNumber} on ${repository}.`);
const targetBranch = await determineTargetBranch(repository, prNumber);
console.log(`Target branch is ${targetBranch}.`);
await exec(`git fetch origin ${targetBranch}`);
console.log(`Reb... | [
"async",
"function",
"_main",
"(",
"repository",
",",
"prNumber",
")",
"{",
"console",
".",
"log",
"(",
"`",
"${",
"prNumber",
"}",
"${",
"repository",
"}",
"`",
")",
";",
"const",
"targetBranch",
"=",
"await",
"determineTargetBranch",
"(",
"repository",
"... | Helpers | [
"Helpers"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/rebase-pr.js#L61-L69 | train | Main function. | [
30522,
2004,
6038,
2278,
3853,
1035,
2364,
1006,
22409,
1010,
10975,
19172,
5677,
1007,
1063,
10122,
1012,
8833,
1006,
1036,
12515,
4539,
3589,
2005,
10975,
1002,
1063,
10975,
19172,
5677,
1065,
2006,
1002,
1063,
22409,
1065,
1012,
1036,
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... |
mochajs/mocha | lib/runner.js | Runner | function Runner(suite, delay) {
var self = this;
this._globals = [];
this._abort = false;
this._delay = delay;
this.suite = suite;
this.started = false;
this.total = suite.total();
this.failures = 0;
this.on(constants.EVENT_TEST_END, function(test) {
self.checkGlobals(test);
});
this.on(consta... | javascript | function Runner(suite, delay) {
var self = this;
this._globals = [];
this._abort = false;
this._delay = delay;
this.suite = suite;
this.started = false;
this.total = suite.total();
this.failures = 0;
this.on(constants.EVENT_TEST_END, function(test) {
self.checkGlobals(test);
});
this.on(consta... | [
"function",
"Runner",
"(",
"suite",
",",
"delay",
")",
"{",
"var",
"self",
"=",
"this",
";",
"this",
".",
"_globals",
"=",
"[",
"]",
";",
"this",
".",
"_abort",
"=",
"false",
";",
"this",
".",
"_delay",
"=",
"delay",
";",
"this",
".",
"suite",
"=... | Initialize a `Runner` at the Root {@link Suite}, which represents a hierarchy of {@link Suite|Suites} and {@link Test|Tests}.
@extends external:EventEmitter
@public
@class
@param {Suite} suite Root suite
@param {boolean} [delay] Whether or not to delay execution of root suite
until ready. | [
"Initialize",
"a",
"Runner",
"at",
"the",
"Root",
"{",
"@link",
"Suite",
"}",
"which",
"represents",
"a",
"hierarchy",
"of",
"{",
"@link",
"Suite|Suites",
"}",
"and",
"{",
"@link",
"Test|Tests",
"}",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/runner.js#L127-L145 | train | A Runner is a suite of tests that run in a single test or hook. | [
30522,
3853,
5479,
1006,
7621,
1010,
8536,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2023,
1012,
1035,
3795,
2015,
1027,
1031,
1033,
1025,
2023,
1012,
1035,
11113,
11589,
1027,
6270,
1025,
2023,
1012,
1035,
8536,
1027,
8536,
1025,
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... |
adobe/brackets | src/LiveDevelopment/Agents/DOMAgent.js | _onChildNodeCountUpdated | function _onChildNodeCountUpdated(event, res) {
// res = {nodeId, childNodeCount}
if (res.nodeId > 0) {
Inspector.DOM.requestChildNodes(res.nodeId);
}
} | javascript | function _onChildNodeCountUpdated(event, res) {
// res = {nodeId, childNodeCount}
if (res.nodeId > 0) {
Inspector.DOM.requestChildNodes(res.nodeId);
}
} | [
"function",
"_onChildNodeCountUpdated",
"(",
"event",
",",
"res",
")",
"{",
"// res = {nodeId, childNodeCount}",
"if",
"(",
"res",
".",
"nodeId",
">",
"0",
")",
"{",
"Inspector",
".",
"DOM",
".",
"requestChildNodes",
"(",
"res",
".",
"nodeId",
")",
";",
"}",... | WebInspector Event: DOM.childNodeCountUpdated | [
"WebInspector",
"Event",
":",
"DOM",
".",
"childNodeCountUpdated"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L219-L224 | train | Called when the childNodeCount of the node has been updated | [
30522,
3853,
1035,
2006,
19339,
3630,
3207,
3597,
16671,
6279,
13701,
2094,
1006,
2724,
1010,
24501,
1007,
1063,
1013,
1013,
24501,
1027,
1063,
13045,
3593,
1010,
2775,
3630,
3207,
3597,
16671,
1065,
2065,
1006,
24501,
1012,
13045,
3593,
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/base/util/Properties.js | parse | function parse(sText, oProp) {
var aLines = sText.split(rLines), // split file into lines
sLine,rMatcher,sKey,sValue,i,m,iLastIndex,iConcatOps;
function append(s) {
if ( sValue ) {
sValue = sValue + s;
iConcatOps++;
} else {
sValue = s;
iConcatOps = 0;
}
}
oProp.mProperties = {};
... | javascript | function parse(sText, oProp) {
var aLines = sText.split(rLines), // split file into lines
sLine,rMatcher,sKey,sValue,i,m,iLastIndex,iConcatOps;
function append(s) {
if ( sValue ) {
sValue = sValue + s;
iConcatOps++;
} else {
sValue = s;
iConcatOps = 0;
}
}
oProp.mProperties = {};
... | [
"function",
"parse",
"(",
"sText",
",",
"oProp",
")",
"{",
"var",
"aLines",
"=",
"sText",
".",
"split",
"(",
"rLines",
")",
",",
"// split file into lines",
"sLine",
",",
"rMatcher",
",",
"sKey",
",",
"sValue",
",",
"i",
",",
"m",
",",
"iLastIndex",
",... | /*
Parses the given text sText and sets the properties
in the properties object oProp accordingly.
@param {string} sText the text to parse
@param oProp the properties object to fill
@private | [
"/",
"*",
"Parses",
"the",
"given",
"text",
"sText",
"and",
"sets",
"the",
"properties",
"in",
"the",
"properties",
"object",
"oProp",
"accordingly",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/util/Properties.js#L139-L209 | train | Parses a text file into a property object | [
30522,
3853,
11968,
3366,
1006,
26261,
18413,
1010,
6728,
18981,
1007,
1063,
13075,
4862,
5267,
1027,
26261,
18413,
1012,
3975,
1006,
1054,
12735,
1007,
1010,
1013,
1013,
3975,
5371,
2046,
3210,
22889,
3170,
1010,
28549,
4017,
7474,
1010,
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... |
elastic/elasticsearch-js | api/api/nodes.stats.js | buildNodesStats | function buildNodesStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [nodes.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html) request
*
* @param {list} metric ... | javascript | function buildNodesStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [nodes.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html) request
*
* @param {list} metric ... | [
"function",
"buildNodesStats",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [nodes.stats](http://www.elastic.co/guide... | /* eslint camelcase: 0 /* eslint no-unused-vars: 0 | [
"/",
"*",
"eslint",
"camelcase",
":",
"0",
"/",
"*",
"eslint",
"no",
"-",
"unused",
"-",
"vars",
":",
"0"
] | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/api/nodes.stats.js#L25-L132 | train | Build the nodes stats | [
30522,
3853,
3857,
3630,
6155,
9153,
3215,
1006,
23569,
2015,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2279,
1011,
2240,
2053,
1011,
15171,
1011,
13075,
2015,
9530,
3367,
1063,
9338,
2063,
15500,
1010,
9563,
2121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/guest-window-manager.js | function (embedder, options) {
if (options.webPreferences == null) {
options.webPreferences = {}
}
if (embedder.browserWindowOptions != null) {
let parentOptions = embedder.browserWindowOptions
// if parent's visibility is available, that overrides 'show' flag (#12125)
const win = BrowserWindow.f... | javascript | function (embedder, options) {
if (options.webPreferences == null) {
options.webPreferences = {}
}
if (embedder.browserWindowOptions != null) {
let parentOptions = embedder.browserWindowOptions
// if parent's visibility is available, that overrides 'show' flag (#12125)
const win = BrowserWindow.f... | [
"function",
"(",
"embedder",
",",
"options",
")",
"{",
"if",
"(",
"options",
".",
"webPreferences",
"==",
"null",
")",
"{",
"options",
".",
"webPreferences",
"=",
"{",
"}",
"}",
"if",
"(",
"embedder",
".",
"browserWindowOptions",
"!=",
"null",
")",
"{",
... | Merge |options| with the |embedder|'s window's options. | [
"Merge",
"|options|",
"with",
"the",
"|embedder|",
"s",
"window",
"s",
"options",
"."
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/guest-window-manager.js#L48-L80 | train | Inherit options from the parent window | [
30522,
3853,
1006,
7861,
8270,
4063,
1010,
7047,
1007,
1063,
2065,
1006,
7047,
1012,
4773,
28139,
25523,
2015,
1027,
1027,
19701,
1007,
1063,
7047,
1012,
4773,
28139,
25523,
2015,
1027,
1063,
1065,
1065,
2065,
1006,
7861,
8270,
4063,
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... | |
dequelabs/axe-core | lib/core/utils/get-selector.js | getNthChildString | function getNthChildString(elm, selector) {
const siblings =
(elm.parentNode && Array.from(elm.parentNode.children || '')) || [];
const hasMatchingSiblings = siblings.find(
sibling => sibling !== elm && axe.utils.matchesSelector(sibling, selector)
);
if (hasMatchingSiblings) {
const nthChild = 1 + siblings.in... | javascript | function getNthChildString(elm, selector) {
const siblings =
(elm.parentNode && Array.from(elm.parentNode.children || '')) || [];
const hasMatchingSiblings = siblings.find(
sibling => sibling !== elm && axe.utils.matchesSelector(sibling, selector)
);
if (hasMatchingSiblings) {
const nthChild = 1 + siblings.in... | [
"function",
"getNthChildString",
"(",
"elm",
",",
"selector",
")",
"{",
"const",
"siblings",
"=",
"(",
"elm",
".",
"parentNode",
"&&",
"Array",
".",
"from",
"(",
"elm",
".",
"parentNode",
".",
"children",
"||",
"''",
")",
")",
"||",
"[",
"]",
";",
"c... | Given an element and a selector that finds that element (but possibly other sibling elements)
return the :nth-child(n) pseudo selector that uniquely finds the node within its siblings
@param {Element} elm The Element
@param {String} selector The selector
@return {String} The nth-child selector | [
"Given",
"an",
"element",
"and",
"a",
"selector",
"that",
"finds",
"that",
"element",
"(",
"but",
"possibly",
"other",
"sibling",
"elements",
")",
"return",
"the",
":",
"nth",
"-",
"child",
"(",
"n",
")",
"pseudo",
"selector",
"that",
"uniquely",
"finds",
... | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/get-selector.js#L184-L196 | train | Returns the nth child of the element that matches the selector | [
30522,
3853,
2131,
3372,
16257,
19466,
5104,
18886,
3070,
1006,
17709,
1010,
27000,
1007,
1063,
9530,
3367,
9504,
1027,
1006,
17709,
1012,
6687,
3630,
3207,
1004,
1004,
9140,
1012,
2013,
1006,
17709,
1012,
6687,
3630,
3207,
1012,
2336,
1064... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/toolbars.js | locationBar_focus | function locationBar_focus(event) {
switch (event.type) {
case "click":
this._controller.click(this.urlbar);
break;
case "shortcut":
var cmdKey = utils.getEntity(this.getDtds(), "openCmd.commandkey");
this._controller.keypress(null, cmdKey, {accelKey: true});
brea... | javascript | function locationBar_focus(event) {
switch (event.type) {
case "click":
this._controller.click(this.urlbar);
break;
case "shortcut":
var cmdKey = utils.getEntity(this.getDtds(), "openCmd.commandkey");
this._controller.keypress(null, cmdKey, {accelKey: true});
brea... | [
"function",
"locationBar_focus",
"(",
"event",
")",
"{",
"switch",
"(",
"event",
".",
"type",
")",
"{",
"case",
"\"click\"",
":",
"this",
".",
"_controller",
".",
"click",
"(",
"this",
".",
"urlbar",
")",
";",
"break",
";",
"case",
"\"shortcut\"",
":",
... | Focus the location bar
@param {object} event
Focus the location bar with the given event (click or shortcut) | [
"Focus",
"the",
"location",
"bar"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/toolbars.js#L332-L348 | train | Focus the location bar | [
30522,
3853,
3295,
8237,
1035,
3579,
1006,
2724,
1007,
1063,
6942,
1006,
2724,
1012,
2828,
1007,
1063,
2553,
1000,
11562,
1000,
1024,
2023,
1012,
1035,
11486,
1012,
11562,
1006,
2023,
1012,
24471,
20850,
2906,
1007,
1025,
3338,
1025,
2553,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
didi/cube-ui | example/modules/image.js | detectVerticalSquash | function detectVerticalSquash(img) {
// 拍照在IOS7或以下的机型会出现照片被压扁的bug
var data;
var ih = img.naturalHeight;
var canvas = document.createElement('canvas');
canvas.width = 1;
canvas.height = ih;
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
try {
data = ctx.getImageD... | javascript | function detectVerticalSquash(img) {
// 拍照在IOS7或以下的机型会出现照片被压扁的bug
var data;
var ih = img.naturalHeight;
var canvas = document.createElement('canvas');
canvas.width = 1;
canvas.height = ih;
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
try {
data = ctx.getImageD... | [
"function",
"detectVerticalSquash",
"(",
"img",
")",
"{",
"// 拍照在IOS7或以下的机型会出现照片被压扁的bug",
"var",
"data",
";",
"var",
"ih",
"=",
"img",
".",
"naturalHeight",
";",
"var",
"canvas",
"=",
"document",
".",
"createElement",
"(",
"'canvas'",
")",
";",
"canvas",
".",
... | /*
Tencent is pleased to support the open source community by making WeUI.js available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
... | [
"/",
"*",
"Tencent",
"is",
"pleased",
"to",
"support",
"the",
"open",
"source",
"community",
"by",
"making",
"WeUI",
".",
"js",
"available",
"."
] | 29096d1fe600c699237db8039255f74126730157 | https://github.com/didi/cube-ui/blob/29096d1fe600c699237db8039255f74126730157/example/modules/image.js#L24-L53 | train | detect vertical squash | [
30522,
3853,
11487,
16874,
7476,
2015,
16211,
4095,
1006,
10047,
2290,
1007,
1063,
1013,
1013,
100,
100,
100,
16380,
2581,
100,
100,
1743,
1916,
100,
100,
1763,
1774,
100,
100,
100,
100,
100,
100,
1916,
11829,
13075,
2951,
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... |
airyland/vux | src/components/orientation/orientation.js | merge | function merge (s) {
var r = {}
var k
if (s) {
for (k in s) {
if (s.hasOwnProperty(k)) {
r[k] = s[k]
}
}
}
return r
} | javascript | function merge (s) {
var r = {}
var k
if (s) {
for (k in s) {
if (s.hasOwnProperty(k)) {
r[k] = s[k]
}
}
}
return r
} | [
"function",
"merge",
"(",
"s",
")",
"{",
"var",
"r",
"=",
"{",
"}",
"var",
"k",
"if",
"(",
"s",
")",
"{",
"for",
"(",
"k",
"in",
"s",
")",
"{",
"if",
"(",
"s",
".",
"hasOwnProperty",
"(",
"k",
")",
")",
"{",
"r",
"[",
"k",
"]",
"=",
"s"... | 混入对象属性
@method merge
@param {Object} s 提供对象
@return {Object} r 接收对象
@private | [
"混入对象属性"
] | 484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6 | https://github.com/airyland/vux/blob/484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6/src/components/orientation/orientation.js#L25-L38 | train | Merge the specified object with the current object | [
30522,
3853,
13590,
1006,
1055,
1007,
1063,
13075,
1054,
1027,
1063,
1065,
13075,
1047,
2065,
1006,
1055,
1007,
1063,
2005,
1006,
1047,
1999,
1055,
1007,
1063,
2065,
1006,
1055,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
1047,
1007,
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/events/TouchToMouseMapping.js | function(oEvent) {
var oTouch;
if (bHandleEvent) {
oTouch = oEvent.touches[0];
// Check if the finger is moved. When the finger was moved, no "click" event is fired.
if (Math.abs(oTouch.clientX - iStartX) > 10 || Math.abs(oTouch.clientY - iStartY) > 10) {
bIsMoved = true;
}
if (bIsMove... | javascript | function(oEvent) {
var oTouch;
if (bHandleEvent) {
oTouch = oEvent.touches[0];
// Check if the finger is moved. When the finger was moved, no "click" event is fired.
if (Math.abs(oTouch.clientX - iStartX) > 10 || Math.abs(oTouch.clientY - iStartY) > 10) {
bIsMoved = true;
}
if (bIsMove... | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"oTouch",
";",
"if",
"(",
"bHandleEvent",
")",
"{",
"oTouch",
"=",
"oEvent",
".",
"touches",
"[",
"0",
"]",
";",
"// Check if the finger is moved. When the finger was moved, no \"click\" event is fired.",
"if",
"(",
"Math"... | Touch move event handler. Fires mouse move event.
@param {jQuery.Event} oEvent the event object
@private | [
"Touch",
"move",
"event",
"handler",
".",
"Fires",
"mouse",
"move",
"event",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/TouchToMouseMapping.js#L116-L133 | train | Handles the mouse move event | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
27178,
7140,
2818,
1025,
2065,
1006,
1038,
11774,
10559,
15338,
1007,
1063,
27178,
30524,
7140,
2818,
1012,
7396,
2595,
1011,
21541,
8445,
2595,
1007,
1028,
2184,
1064,
1064,
8785,
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... | |
GeekyAnts/vue-native-core | dist/vue.runtime.common.js | getHookArgumentsLength | function getHookArgumentsLength (fn) {
if (isUndef(fn)) {
return false
}
var invokerFns = fn.fns;
if (isDef(invokerFns)) {
// invoker
return getHookArgumentsLength(
Array.isArray(invokerFns)
? invokerFns[0]
: invokerFns
)
} else {
return (fn._length || fn.length) > 1
... | javascript | function getHookArgumentsLength (fn) {
if (isUndef(fn)) {
return false
}
var invokerFns = fn.fns;
if (isDef(invokerFns)) {
// invoker
return getHookArgumentsLength(
Array.isArray(invokerFns)
? invokerFns[0]
: invokerFns
)
} else {
return (fn._length || fn.length) > 1
... | [
"function",
"getHookArgumentsLength",
"(",
"fn",
")",
"{",
"if",
"(",
"isUndef",
"(",
"fn",
")",
")",
"{",
"return",
"false",
"}",
"var",
"invokerFns",
"=",
"fn",
".",
"fns",
";",
"if",
"(",
"isDef",
"(",
"invokerFns",
")",
")",
"{",
"// invoker",
"r... | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | [
"Normalize",
"a",
"transition",
"hook",
"s",
"argument",
"length",
".",
"The",
"hook",
"may",
"be",
":",
"-",
"a",
"merged",
"hook",
"(",
"invoker",
")",
"with",
"the",
"original",
"in",
".",
"fns",
"-",
"a",
"wrapped",
"component",
"method",
"(",
"che... | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/dist/vue.runtime.common.js#L6003-L6018 | train | Returns the number of arguments in a hook | [
30522,
3853,
2131,
6806,
12352,
10623,
27417,
3215,
7770,
13512,
2232,
1006,
1042,
2078,
1007,
1063,
2065,
1006,
2003,
8630,
12879,
1006,
1042,
2078,
1007,
1007,
1063,
2709,
6270,
1065,
13075,
1999,
6767,
5484,
2546,
3619,
1027,
1042,
2078,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | dist/howler.js | function() {
var self = this;
self._drain();
// Find the first inactive node to recycle.
for (var i=0; i<self._sounds.length; i++) {
if (self._sounds[i]._ended) {
return self._sounds[i].reset();
}
}
// If no inactive node was found, create a new one.
... | javascript | function() {
var self = this;
self._drain();
// Find the first inactive node to recycle.
for (var i=0; i<self._sounds.length; i++) {
if (self._sounds[i]._ended) {
return self._sounds[i].reset();
}
}
// If no inactive node was found, create a new one.
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"_drain",
"(",
")",
";",
"// Find the first inactive node to recycle.",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"self",
".",
"_sounds",
".",
"length",
";",
"i",
"++",
"... | Return an inactive sound from the pool or create a new one.
@return {Sound} Sound playback object. | [
"Return",
"an",
"inactive",
"sound",
"from",
"the",
"pool",
"or",
"create",
"a",
"new",
"one",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L2009-L2023 | train | Returns the last node to recycle. | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2969,
1012,
1035,
12475,
1006,
1007,
1025,
1013,
1013,
2424,
1996,
2034,
16389,
13045,
2000,
28667,
2100,
14321,
1012,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
2969... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
goldfire/howler.js | examples/sprite/sprite.js | function() {
var self = this;
var keys = Object.keys(self._spriteMap);
keys.forEach(function(key) {
window[key].addEventListener('click', function() {
self.play(key);
}, false);
});
} | javascript | function() {
var self = this;
var keys = Object.keys(self._spriteMap);
keys.forEach(function(key) {
window[key].addEventListener('click', function() {
self.play(key);
}, false);
});
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"self",
".",
"_spriteMap",
")",
";",
"keys",
".",
"forEach",
"(",
"function",
"(",
"key",
")",
"{",
"window",
"[",
"key",
"]",
".",
"addEv... | Setup the listeners for each sprite click area. | [
"Setup",
"the",
"listeners",
"for",
"each",
"sprite",
"click",
"area",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/sprite/sprite.js#L52-L61 | train | Add event listeners to the sprites | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
6309,
1027,
4874,
1012,
6309,
1006,
2969,
1012,
1035,
11867,
17625,
2863,
2361,
1007,
1025,
6309,
1012,
18921,
6776,
1006,
3853,
1006,
3145,
1007,
1063,
3332,
1031,
3145,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ios7.js | function() {
var bIsIOS7Safari = sap.ui.Device.os.ios && sap.ui.Device.os.version >= 7 && sap.ui.Device.os.version < 8 && sap.ui.Device.browser.name === "sf";
//call the base to properly init the event registry
sap.ui.base.EventProvider.apply(this);
if (!bIsIOS7Safari) {
return;
}
this._... | javascript | function() {
var bIsIOS7Safari = sap.ui.Device.os.ios && sap.ui.Device.os.version >= 7 && sap.ui.Device.os.version < 8 && sap.ui.Device.browser.name === "sf";
//call the base to properly init the event registry
sap.ui.base.EventProvider.apply(this);
if (!bIsIOS7Safari) {
return;
}
this._... | [
"function",
"(",
")",
"{",
"var",
"bIsIOS7Safari",
"=",
"sap",
".",
"ui",
".",
"Device",
".",
"os",
".",
"ios",
"&&",
"sap",
".",
"ui",
".",
"Device",
".",
"os",
".",
"version",
">=",
"7",
"&&",
"sap",
".",
"ui",
".",
"Device",
".",
"os",
".",
... | IOS 7 behaves strange if the keyboard is open and you do an orientation change:
There will be a black space below the page and it will scroll away from the top in this case.
That's why we scroll to the top on orientation change.
We also need to catch blur since if you do orientation change with keyboard open, close the... | [
"IOS",
"7",
"behaves",
"strange",
"if",
"the",
"keyboard",
"is",
"open",
"and",
"you",
"do",
"an",
"orientation",
"change",
":",
"There",
"will",
"be",
"a",
"black",
"space",
"below",
"the",
"page",
"and",
"it",
"will",
"scroll",
"away",
"from",
"the",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/ios7.js#L21-L48 | train | Initializes the event registry | [
30522,
3853,
1006,
1007,
1063,
13075,
20377,
10735,
2581,
3736,
14971,
2072,
1027,
20066,
1012,
21318,
1012,
5080,
1012,
9808,
1012,
16380,
1004,
1004,
20066,
1012,
21318,
1012,
5080,
1012,
9808,
1012,
2544,
1028,
1027,
1021,
1004,
1004,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SeleniumHQ/selenium | third_party/closure/goog/bootstrap/nodejs.js | nodeGlobalRequire | function nodeGlobalRequire(file) {
vm.runInThisContext.call(global, fs.readFileSync(file), file);
} | javascript | function nodeGlobalRequire(file) {
vm.runInThisContext.call(global, fs.readFileSync(file), file);
} | [
"function",
"nodeGlobalRequire",
"(",
"file",
")",
"{",
"vm",
".",
"runInThisContext",
".",
"call",
"(",
"global",
",",
"fs",
".",
"readFileSync",
"(",
"file",
")",
",",
"file",
")",
";",
"}"
] | Declared here so it can be used to require base.js | [
"Declared",
"here",
"so",
"it",
"can",
"be",
"used",
"to",
"require",
"base",
".",
"js"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/closure/goog/bootstrap/nodejs.js#L86-L88 | train | Require a node module | [
30522,
3853,
13045,
23296,
16429,
2389,
2890,
15549,
2890,
1006,
5371,
1007,
1063,
1058,
2213,
1012,
2448,
18447,
24158,
8663,
18209,
1012,
2655,
1006,
3795,
1010,
1042,
2015,
1012,
3191,
8873,
4244,
6038,
2278,
1006,
5371,
1007,
1010,
5371... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/range.js | textRangeToPoint | function textRangeToPoint(textRange, isStart) {
let container = textRange.parentElement();
let offset;
const tester = document.body.createTextRange();
let prevContainer;
const childNodes = lists.from(container.childNodes);
for (offset = 0; offset < childNodes.length; offset++) {
if (dom.isText(childNod... | javascript | function textRangeToPoint(textRange, isStart) {
let container = textRange.parentElement();
let offset;
const tester = document.body.createTextRange();
let prevContainer;
const childNodes = lists.from(container.childNodes);
for (offset = 0; offset < childNodes.length; offset++) {
if (dom.isText(childNod... | [
"function",
"textRangeToPoint",
"(",
"textRange",
",",
"isStart",
")",
"{",
"let",
"container",
"=",
"textRange",
".",
"parentElement",
"(",
")",
";",
"let",
"offset",
";",
"const",
"tester",
"=",
"document",
".",
"body",
".",
"createTextRange",
"(",
")",
... | return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js
@param {TextRange} textRange
@param {Boolean} isStart
@return {BoundaryPoint}
@see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx | [
"return",
"boundaryPoint",
"from",
"TextRange",
"inspired",
"by",
"Andy",
"Na",
"s",
"HuskyRange",
".",
"js"
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/range.js#L16-L67 | train | Get the element that contains the given text range | [
30522,
3853,
3793,
24388,
18903,
8400,
1006,
3793,
24388,
2063,
1010,
26354,
7559,
2102,
1007,
1063,
2292,
11661,
1027,
3793,
24388,
2063,
1012,
6687,
12260,
3672,
1006,
1007,
1025,
2292,
16396,
1025,
9530,
3367,
3231,
2121,
1027,
6254,
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... |
apache/incubator-echarts | src/chart/treemap/treemapLayout.js | prunning | function prunning(node, clipRect, viewAbovePath, viewRoot, depth) {
var nodeLayout = node.getLayout();
var nodeInViewAbovePath = viewAbovePath[depth];
var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;
if (
(nodeInViewAbovePath && !isAboveViewRoot)
|| (depth === ... | javascript | function prunning(node, clipRect, viewAbovePath, viewRoot, depth) {
var nodeLayout = node.getLayout();
var nodeInViewAbovePath = viewAbovePath[depth];
var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;
if (
(nodeInViewAbovePath && !isAboveViewRoot)
|| (depth === ... | [
"function",
"prunning",
"(",
"node",
",",
"clipRect",
",",
"viewAbovePath",
",",
"viewRoot",
",",
"depth",
")",
"{",
"var",
"nodeLayout",
"=",
"node",
".",
"getLayout",
"(",
")",
";",
"var",
"nodeInViewAbovePath",
"=",
"viewAbovePath",
"[",
"depth",
"]",
"... | Mark nodes visible for prunning when visual coding and rendering. Prunning depends on layout and root position, so we have to do it after layout. | [
"Mark",
"nodes",
"visible",
"for",
"prunning",
"when",
"visual",
"coding",
"and",
"rendering",
".",
"Prunning",
"depends",
"on",
"layout",
"and",
"root",
"position",
"so",
"we",
"have",
"to",
"do",
"it",
"after",
"layout",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/treemap/treemapLayout.js#L563-L595 | train | prunning is called for each node in the view | [
30522,
3853,
10975,
4609,
5582,
1006,
13045,
1010,
12528,
2890,
6593,
1010,
3193,
7875,
21818,
15069,
1010,
3193,
3217,
4140,
1010,
5995,
1007,
1063,
13075,
13045,
8485,
5833,
1027,
13045,
1012,
2131,
8485,
5833,
1006,
1007,
1025,
13075,
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/sankey/sankeyLayout.js | moveSinksRight | function moveSinksRight(nodes, maxDepth) {
zrUtil.each(nodes, function (node) {
if (!isNodeDepth(node) && !node.outEdges.length) {
node.setLayout({depth: maxDepth}, true);
}
});
} | javascript | function moveSinksRight(nodes, maxDepth) {
zrUtil.each(nodes, function (node) {
if (!isNodeDepth(node) && !node.outEdges.length) {
node.setLayout({depth: maxDepth}, true);
}
});
} | [
"function",
"moveSinksRight",
"(",
"nodes",
",",
"maxDepth",
")",
"{",
"zrUtil",
".",
"each",
"(",
"nodes",
",",
"function",
"(",
"node",
")",
"{",
"if",
"(",
"!",
"isNodeDepth",
"(",
"node",
")",
"&&",
"!",
"node",
".",
"outEdges",
".",
"length",
")... | All the node without outEgdes are assigned maximum x-position and
be aligned in the last column.
@param {module:echarts/data/Graph~Node} nodes. node of sankey view.
@param {number} maxDepth. use to assign to node without outEdges as x-position. | [
"All",
"the",
"node",
"without",
"outEgdes",
"are",
"assigned",
"maximum",
"x",
"-",
"position",
"and",
"be",
"aligned",
"in",
"the",
"last",
"column",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sankey/sankeyLayout.js#L225-L231 | train | Move sinks right | [
30522,
3853,
5829,
19839,
21338,
18743,
1006,
14164,
1010,
4098,
3207,
13876,
2232,
1007,
1063,
1062,
22134,
4014,
1012,
2169,
1006,
14164,
1010,
3853,
1006,
13045,
1007,
1063,
2065,
1006,
999,
3475,
10244,
3207,
13876,
2232,
1006,
13045,
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 | bits/19_fsutils.js | read_binary | function read_binary(path/*:string*/) {
if(typeof _fs !== 'undefined') return _fs.readFileSync(path);
// $FlowIgnore
if(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript
// $FlowIgnore
var infile = File(path); infile.open("r"); infile.encoding = "bina... | javascript | function read_binary(path/*:string*/) {
if(typeof _fs !== 'undefined') return _fs.readFileSync(path);
// $FlowIgnore
if(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript
// $FlowIgnore
var infile = File(path); infile.open("r"); infile.encoding = "bina... | [
"function",
"read_binary",
"(",
"path",
"/*:string*/",
")",
"{",
"if",
"(",
"typeof",
"_fs",
"!==",
"'undefined'",
")",
"return",
"_fs",
".",
"readFileSync",
"(",
"path",
")",
";",
"// $FlowIgnore",
"if",
"(",
"typeof",
"$",
"!==",
"'undefined'",
"&&",
"ty... | /* read binary data from file | [
"/",
"*",
"read",
"binary",
"data",
"from",
"file"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/19_fsutils.js#L51-L61 | train | read binary file | [
30522,
3853,
3191,
1035,
12441,
1006,
4130,
1013,
1008,
1024,
5164,
1008,
1013,
1007,
1063,
2065,
1006,
2828,
11253,
1035,
1042,
2015,
999,
1027,
1027,
1005,
6151,
28344,
1005,
1007,
2709,
1035,
1042,
2015,
1012,
3191,
8873,
4244,
6038,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | release.js | replaceBaseHref | function replaceBaseHref (folder) {
// handle index.html
const filePath = path.join(__dirname, '/code.material.angularjs.org/', folder, '/index.html');
const file = fs.readFileSync(filePath);
const contents = file.toString().replace(/base href="\//g, 'base href="/' + folder + '/');
fs.writeFileSync(... | javascript | function replaceBaseHref (folder) {
// handle index.html
const filePath = path.join(__dirname, '/code.material.angularjs.org/', folder, '/index.html');
const file = fs.readFileSync(filePath);
const contents = file.toString().replace(/base href="\//g, 'base href="/' + folder + '/');
fs.writeFileSync(... | [
"function",
"replaceBaseHref",
"(",
"folder",
")",
"{",
"// handle index.html",
"const",
"filePath",
"=",
"path",
".",
"join",
"(",
"__dirname",
",",
"'/code.material.angularjs.org/'",
",",
"folder",
",",
"'/index.html'",
")",
";",
"const",
"file",
"=",
"fs",
".... | replaces base href in index.html for new version as well as latest | [
"replaces",
"base",
"href",
"in",
"index",
".",
"html",
"for",
"new",
"version",
"as",
"well",
"as",
"latest"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/release.js#L345-L351 | train | replace base href in index. html | [
30522,
3853,
5672,
15058,
28362,
2546,
1006,
19622,
1007,
1063,
1013,
1013,
5047,
5950,
1012,
16129,
9530,
3367,
5371,
15069,
1027,
4130,
1012,
3693,
1006,
1035,
1035,
16101,
18442,
1010,
1005,
1013,
3642,
1012,
3430,
1012,
16108,
22578,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/widgets/bootstrap-twipsy-mod.js | function ( element, options ) {
this.$element = $(element)
this.options = options
this.enabled = true
/***** [changed for Brackets] *****/
this.autoHideTimeout = null;
/***** [/changed for Brackets] *****/
this.fixTitle()
} | javascript | function ( element, options ) {
this.$element = $(element)
this.options = options
this.enabled = true
/***** [changed for Brackets] *****/
this.autoHideTimeout = null;
/***** [/changed for Brackets] *****/
this.fixTitle()
} | [
"function",
"(",
"element",
",",
"options",
")",
"{",
"this",
".",
"$element",
"=",
"$",
"(",
"element",
")",
"this",
".",
"options",
"=",
"options",
"this",
".",
"enabled",
"=",
"true",
"/***** [changed for Brackets] *****/",
"this",
".",
"autoHideTimeout",
... | /* TWIPSY PUBLIC CLASS DEFINITION
============================== | [
"/",
"*",
"TWIPSY",
"PUBLIC",
"CLASS",
"DEFINITION",
"=============================="
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/bootstrap-twipsy-mod.js#L86-L94 | train | Constructor for the node | [
30522,
3853,
1006,
5783,
1010,
7047,
1007,
1063,
2023,
1012,
1002,
5783,
1027,
1002,
1006,
5783,
1007,
2023,
1012,
7047,
1027,
7047,
2023,
1012,
9124,
1027,
2995,
1013,
1008,
1008,
1008,
1008,
1008,
1031,
2904,
2005,
19719,
1033,
1008,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
feathericons/feather | bin/process-svg.js | setAttrs | function setAttrs(svg) {
const $ = cheerio.load(svg);
Object.keys(DEFAULT_ATTRS).forEach(key =>
$('svg').attr(key, DEFAULT_ATTRS[key]),
);
return $('body').html();
} | javascript | function setAttrs(svg) {
const $ = cheerio.load(svg);
Object.keys(DEFAULT_ATTRS).forEach(key =>
$('svg').attr(key, DEFAULT_ATTRS[key]),
);
return $('body').html();
} | [
"function",
"setAttrs",
"(",
"svg",
")",
"{",
"const",
"$",
"=",
"cheerio",
".",
"load",
"(",
"svg",
")",
";",
"Object",
".",
"keys",
"(",
"DEFAULT_ATTRS",
")",
".",
"forEach",
"(",
"key",
"=>",
"$",
"(",
"'svg'",
")",
".",
"attr",
"(",
"key",
",... | Set default attibutes on SVG.
@param {string} svg - An SVG string.
@returns {string} | [
"Set",
"default",
"attibutes",
"on",
"SVG",
"."
] | 8f658193d25e943b196a2367319b5d9e85ee9f9f | https://github.com/feathericons/feather/blob/8f658193d25e943b196a2367319b5d9e85ee9f9f/bin/process-svg.js#L48-L56 | train | Set the SVG attributes | [
30522,
3853,
2275,
19321,
2869,
1006,
17917,
2290,
1007,
1063,
9530,
3367,
1002,
1027,
15138,
3695,
1012,
7170,
1006,
17917,
2290,
1007,
1025,
4874,
1012,
6309,
1006,
12398,
1035,
2012,
16344,
2015,
1007,
1012,
18921,
6776,
1006,
3145,
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/thirdparty/zyngascroll.js | function(left, top, animate) {
var self = this;
var startLeft = self.__isAnimating ? self.__scheduledLeft : self.__scrollLeft;
var startTop = self.__isAnimating ? self.__scheduledTop : self.__scrollTop;
self.scrollTo(startLeft + (left || 0), startTop + (top || 0), animate);
} | javascript | function(left, top, animate) {
var self = this;
var startLeft = self.__isAnimating ? self.__scheduledLeft : self.__scrollLeft;
var startTop = self.__isAnimating ? self.__scheduledTop : self.__scrollTop;
self.scrollTo(startLeft + (left || 0), startTop + (top || 0), animate);
} | [
"function",
"(",
"left",
",",
"top",
",",
"animate",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"startLeft",
"=",
"self",
".",
"__isAnimating",
"?",
"self",
".",
"__scheduledLeft",
":",
"self",
".",
"__scrollLeft",
";",
"var",
"startTop",
"=",
"... | Scroll by the given offset
@param {Number ? 0} left Scroll x-axis by given offset
@param {Number ? 0} top Scroll x-axis by given offset
@param {Boolean ? false} animate Whether to animate the given change | [
"Scroll",
"by",
"the",
"given",
"offset"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/zyngascroll.js#L872-L881 | train | Scrolls to the specified position | [
30522,
3853,
1006,
2187,
1010,
2327,
1010,
2019,
21499,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
2707,
2571,
6199,
1027,
2969,
1012,
1035,
1035,
18061,
3490,
18900,
2075,
1029,
2969,
1012,
1035,
1035,
5115,
2571,
6199,
1024,
2969,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/text.js | PromiseCache | function PromiseCache () {
var cache = this.cache = {};
this.get = function (key, promiseGenerator) {
if (key in cache) {
return cache[key];
}
cache[key] = promiseGenerator();
return cache[key];
};
} | javascript | function PromiseCache () {
var cache = this.cache = {};
this.get = function (key, promiseGenerator) {
if (key in cache) {
return cache[key];
}
cache[key] = promiseGenerator();
return cache[key];
};
} | [
"function",
"PromiseCache",
"(",
")",
"{",
"var",
"cache",
"=",
"this",
".",
"cache",
"=",
"{",
"}",
";",
"this",
".",
"get",
"=",
"function",
"(",
"key",
",",
"promiseGenerator",
")",
"{",
"if",
"(",
"key",
"in",
"cache",
")",
"{",
"return",
"cach... | Get or create a promise given a key and promise generator.
@todo Move to a utility and use in other parts of A-Frame. | [
"Get",
"or",
"create",
"a",
"promise",
"given",
"a",
"key",
"and",
"promise",
"generator",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/text.js#L473-L483 | train | A cache for the promise generator | [
30522,
3853,
4872,
3540,
5403,
1006,
1007,
1063,
13075,
17053,
1027,
2023,
1012,
17053,
1027,
1063,
1065,
1025,
2023,
1012,
2131,
1027,
3853,
1006,
3145,
1010,
4872,
6914,
6906,
4263,
1007,
1063,
2065,
1006,
3145,
1999,
17053,
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... |
babel/babel | packages/babel-plugin-transform-typescript/src/enum.js | enumFill | function enumFill(path, t, id) {
const x = translateEnumValues(path, t);
const assignments = x.map(([memberName, memberValue]) =>
buildEnumMember(t.isStringLiteral(memberValue), {
ENUM: t.cloneNode(id),
NAME: memberName,
VALUE: memberValue,
}),
);
return buildEnumWrapper({
ID: t.c... | javascript | function enumFill(path, t, id) {
const x = translateEnumValues(path, t);
const assignments = x.map(([memberName, memberValue]) =>
buildEnumMember(t.isStringLiteral(memberValue), {
ENUM: t.cloneNode(id),
NAME: memberName,
VALUE: memberValue,
}),
);
return buildEnumWrapper({
ID: t.c... | [
"function",
"enumFill",
"(",
"path",
",",
"t",
",",
"id",
")",
"{",
"const",
"x",
"=",
"translateEnumValues",
"(",
"path",
",",
"t",
")",
";",
"const",
"assignments",
"=",
"x",
".",
"map",
"(",
"(",
"[",
"memberName",
",",
"memberValue",
"]",
")",
... | Generates the statement that fills in the variable declared by the enum.
`(function (E) { ... assignments ... })(E || (E = {}));` | [
"Generates",
"the",
"statement",
"that",
"fills",
"in",
"the",
"variable",
"declared",
"by",
"the",
"enum",
".",
"(",
"function",
"(",
"E",
")",
"{",
"...",
"assignments",
"...",
"}",
")",
"(",
"E",
"||",
"(",
"E",
"=",
"{}",
"))",
";"
] | 1969e6b6aa7d90be3fbb3aca98ea96849656a55a | https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-plugin-transform-typescript/src/enum.js#L75-L89 | train | Fill an enum with the given path | [
30522,
3853,
4372,
2819,
8873,
3363,
1006,
4130,
1010,
1056,
1010,
8909,
1007,
1063,
9530,
3367,
1060,
1027,
17637,
2368,
2819,
10175,
15808,
1006,
4130,
1010,
1056,
1007,
1025,
9530,
3367,
14799,
1027,
1060,
1012,
4949,
1006,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Configuration.js | function (sLanguage, sSAPLogonLanguage) {
var oLocale = convertToLocaleOrNull(sLanguage),
bOldRTL = this.getRTL(),
mChanges;
check(oLocale, "Configuration.setLanguage: sLanguage must be a valid BCP47 language tag");
check(sSAPLogonLanguage == null || (typeof sSAPLogonLanguage === 'string' && /[A-Z0-9]... | javascript | function (sLanguage, sSAPLogonLanguage) {
var oLocale = convertToLocaleOrNull(sLanguage),
bOldRTL = this.getRTL(),
mChanges;
check(oLocale, "Configuration.setLanguage: sLanguage must be a valid BCP47 language tag");
check(sSAPLogonLanguage == null || (typeof sSAPLogonLanguage === 'string' && /[A-Z0-9]... | [
"function",
"(",
"sLanguage",
",",
"sSAPLogonLanguage",
")",
"{",
"var",
"oLocale",
"=",
"convertToLocaleOrNull",
"(",
"sLanguage",
")",
",",
"bOldRTL",
"=",
"this",
".",
"getRTL",
"(",
")",
",",
"mChanges",
";",
"check",
"(",
"oLocale",
",",
"\"Configuratio... | Sets a new language to be used from now on for language/region dependent
functionality (e.g. formatting, data types, translated texts, ...).
When the language can't be interpreted as a BCP47 language (using the relaxed syntax
described in {@link #getLanguage}, an error will be thrown.
When the language has changed, t... | [
"Sets",
"a",
"new",
"language",
"to",
"be",
"used",
"from",
"now",
"on",
"for",
"language",
"/",
"region",
"dependent",
"functionality",
"(",
"e",
".",
"g",
".",
"formatting",
"data",
"types",
"translated",
"texts",
"...",
")",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Configuration.js#L708-L730 | train | Sets the language tag of the configuration object. | [
30522,
3853,
1006,
21435,
6692,
3351,
1010,
7020,
9331,
21197,
2239,
25023,
6692,
3351,
1007,
1063,
13075,
19330,
24755,
2571,
1027,
10463,
3406,
4135,
9289,
8780,
6826,
18083,
1006,
21435,
6692,
3351,
1007,
1010,
7782,
5339,
2140,
1027,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/project/ProjectManager.js | getLanguageFilter | function getLanguageFilter(languageId) {
return function languageFilter(file) {
var id = LanguageManager.getLanguageForPath(file.fullPath).getId();
if (typeof languageId === "string") {
return (id === languageId);
} else {
return (languageId.in... | javascript | function getLanguageFilter(languageId) {
return function languageFilter(file) {
var id = LanguageManager.getLanguageForPath(file.fullPath).getId();
if (typeof languageId === "string") {
return (id === languageId);
} else {
return (languageId.in... | [
"function",
"getLanguageFilter",
"(",
"languageId",
")",
"{",
"return",
"function",
"languageFilter",
"(",
"file",
")",
"{",
"var",
"id",
"=",
"LanguageManager",
".",
"getLanguageForPath",
"(",
"file",
".",
"fullPath",
")",
".",
"getId",
"(",
")",
";",
"if",... | Returns a filter for use with getAllFiles() that filters files based on LanguageManager language id
@param {!(string|Array.<string>)} languageId a single string of a language id or an array of language ids
@return {!function(File):boolean} | [
"Returns",
"a",
"filter",
"for",
"use",
"with",
"getAllFiles",
"()",
"that",
"filters",
"files",
"based",
"on",
"LanguageManager",
"language",
"id"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L1152-L1161 | train | getLanguageFilter - returns a function that returns true if the file matches the given language | [
30522,
3853,
2131,
25023,
6692,
3351,
8873,
21928,
1006,
2653,
3593,
1007,
1063,
2709,
3853,
2653,
8873,
21928,
1006,
5371,
1007,
1063,
13075,
8909,
1027,
2653,
24805,
4590,
1012,
2131,
25023,
6692,
3351,
29278,
15069,
1006,
5371,
1012,
244... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | getElmId | function getElmId(elm) {
if (!elm.getAttribute('id')) {
return;
}
let doc = (elm.getRootNode && elm.getRootNode()) || document;
const id = '#' + escapeSelector(elm.getAttribute('id') || '');
if (
// Don't include youtube's uid values, they change on reload
!id.match(/player_uid_/) &&
// Don't include IDs t... | javascript | function getElmId(elm) {
if (!elm.getAttribute('id')) {
return;
}
let doc = (elm.getRootNode && elm.getRootNode()) || document;
const id = '#' + escapeSelector(elm.getAttribute('id') || '');
if (
// Don't include youtube's uid values, they change on reload
!id.match(/player_uid_/) &&
// Don't include IDs t... | [
"function",
"getElmId",
"(",
"elm",
")",
"{",
"if",
"(",
"!",
"elm",
".",
"getAttribute",
"(",
"'id'",
")",
")",
"{",
"return",
";",
"}",
"let",
"doc",
"=",
"(",
"elm",
".",
"getRootNode",
"&&",
"elm",
".",
"getRootNode",
"(",
")",
")",
"||",
"do... | Get ID selector | [
"Get",
"ID",
"selector"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/get-selector.js#L201-L215 | train | Get the id of an element | [
30522,
3853,
2131,
2884,
4328,
2094,
1006,
17709,
1007,
1063,
2065,
1006,
999,
17709,
1012,
2131,
19321,
3089,
8569,
2618,
1006,
1005,
8909,
1005,
1007,
1007,
1063,
2709,
1025,
1065,
2292,
9986,
1027,
1006,
17709,
1012,
2131,
3217,
4140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/prefer-const.js | getIdentifierIfShouldBeConst | function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) {
if (variable.eslintUsed && variable.scope.type === "global") {
return null;
}
// Finds the unique WriteReference.
let writer = null;
let isReadBeforeInit = false;
const references = variable.references;
for (... | javascript | function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) {
if (variable.eslintUsed && variable.scope.type === "global") {
return null;
}
// Finds the unique WriteReference.
let writer = null;
let isReadBeforeInit = false;
const references = variable.references;
for (... | [
"function",
"getIdentifierIfShouldBeConst",
"(",
"variable",
",",
"ignoreReadBeforeAssign",
")",
"{",
"if",
"(",
"variable",
".",
"eslintUsed",
"&&",
"variable",
".",
"scope",
".",
"type",
"===",
"\"global\"",
")",
"{",
"return",
"null",
";",
"}",
"// Finds the ... | Gets an identifier node of a given variable.
If the initialization exists or one or more reading references exist before
the first assignment, the identifier node is the node of the declaration.
Otherwise, the identifier node is the node of the first assignment.
If the variable should not change to const, this functi... | [
"Gets",
"an",
"identifier",
"node",
"of",
"a",
"given",
"variable",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-const.js#L173-L258 | train | Returns the identifier if the variable is a constant | [
30522,
3853,
2131,
5178,
16778,
8873,
11124,
10343,
6806,
21285,
4783,
8663,
3367,
1006,
8023,
1010,
8568,
16416,
18939,
12879,
5686,
12054,
23773,
1007,
1063,
2065,
1006,
8023,
1012,
9686,
4115,
5809,
2098,
1004,
1004,
8023,
1012,
9531,
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... |
goldfire/howler.js | dist/howler.js | function(event, fn, id) {
var self = this;
var events = self['_on' + event];
var i = 0;
// Allow passing just an event and ID.
if (typeof fn === 'number') {
id = fn;
fn = null;
}
if (fn || id) {
// Loop through event store and remove the passed functio... | javascript | function(event, fn, id) {
var self = this;
var events = self['_on' + event];
var i = 0;
// Allow passing just an event and ID.
if (typeof fn === 'number') {
id = fn;
fn = null;
}
if (fn || id) {
// Loop through event store and remove the passed functio... | [
"function",
"(",
"event",
",",
"fn",
",",
"id",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"events",
"=",
"self",
"[",
"'_on'",
"+",
"event",
"]",
";",
"var",
"i",
"=",
"0",
";",
"// Allow passing just an event and ID.",
"if",
"(",
"typeof",
"... | Remove a custom event. Call without parameters to remove all events.
@param {String} event Event name.
@param {Function} fn Listener to remove. Leave empty to remove all.
@param {Number} id (optional) Only remove events for this sound.
@return {Howl} | [
"Remove",
"a",
"custom",
"event",
".",
"Call",
"without",
"parameters",
"to",
"remove",
"all",
"events",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L1789-L1823 | train | Remove an event handler | [
30522,
3853,
1006,
2724,
1010,
1042,
2078,
1010,
8909,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
2824,
1027,
2969,
1031,
1005,
1035,
2006,
1005,
1009,
2724,
1033,
1025,
13075,
1045,
1027,
1014,
1025,
1013,
30524,
2078,
1025,
1042,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/lines-around-directive.js | checkDirectives | function checkDirectives(node) {
const directives = astUtils.getDirectivePrologue(node);
if (!directives.length) {
return;
}
const firstDirective = directives[0];
const leadingComments = sourceCode.getCommentsBefore(firstDirective);
... | javascript | function checkDirectives(node) {
const directives = astUtils.getDirectivePrologue(node);
if (!directives.length) {
return;
}
const firstDirective = directives[0];
const leadingComments = sourceCode.getCommentsBefore(firstDirective);
... | [
"function",
"checkDirectives",
"(",
"node",
")",
"{",
"const",
"directives",
"=",
"astUtils",
".",
"getDirectivePrologue",
"(",
"node",
")",
";",
"if",
"(",
"!",
"directives",
".",
"length",
")",
"{",
"return",
";",
"}",
"const",
"firstDirective",
"=",
"di... | Check lines around directives in node
@param {ASTNode} node - node to check
@returns {void} | [
"Check",
"lines",
"around",
"directives",
"in",
"node"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/lines-around-directive.js#L137-L188 | train | Check directives of a node | [
30522,
3853,
4638,
4305,
2890,
15277,
2015,
1006,
13045,
1007,
1063,
9530,
3367,
16449,
2015,
1027,
2004,
8525,
3775,
4877,
1012,
2131,
4305,
2890,
15277,
21572,
24277,
1006,
13045,
1007,
1025,
2065,
1006,
999,
16449,
2015,
1012,
3091,
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... |
NervJS/taro | packages/taro-transformer-wx/src/plugins/remove-dead-code.js | isControlTransfer | function isControlTransfer(stmt, path, control = "break") {
const { [control]: type } = {
break: "BreakStatement",
continue: "ContinueStatement"
};
if (!type) {
throw new Error("Can only handle break and continue statements");
}
const checker = `is${type}`;
if (stmt[checker]()... | javascript | function isControlTransfer(stmt, path, control = "break") {
const { [control]: type } = {
break: "BreakStatement",
continue: "ContinueStatement"
};
if (!type) {
throw new Error("Can only handle break and continue statements");
}
const checker = `is${type}`;
if (stmt[checker]()... | [
"function",
"isControlTransfer",
"(",
"stmt",
",",
"path",
",",
"control",
"=",
"\"break\"",
")",
"{",
"const",
"{",
"[",
"control",
"]",
":",
"type",
"}",
"=",
"{",
"break",
":",
"\"BreakStatement\"",
",",
"continue",
":",
"\"ContinueStatement\"",
"}",
";... | tells if a "stmt" is a break/continue statement | [
"tells",
"if",
"a",
"stmt",
"is",
"a",
"break",
"/",
"continue",
"statement"
] | 274e76d731d7f158141287e31cbd51f092d472c5 | https://github.com/NervJS/taro/blob/274e76d731d7f158141287e31cbd51f092d472c5/packages/taro-transformer-wx/src/plugins/remove-dead-code.js#L1189-L1302 | train | Checks if a statement is a break or continue statement | [
30522,
3853,
2003,
8663,
13181,
7096,
5521,
22747,
2121,
1006,
2358,
20492,
1010,
4130,
1010,
2491,
1027,
1000,
3338,
1000,
1007,
1063,
9530,
3367,
1063,
1031,
2491,
1033,
1024,
2828,
1065,
1027,
1063,
3338,
1024,
1000,
7807,
12259,
3672,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 (name, attrs, text)
{
var child = Strophe.xmlElement(name, attrs, text);
this.node.appendChild(child);
if (!text) {
this.node = child;
}
return this;
} | javascript | function (name, attrs, text)
{
var child = Strophe.xmlElement(name, attrs, text);
this.node.appendChild(child);
if (!text) {
this.node = child;
}
return this;
} | [
"function",
"(",
"name",
",",
"attrs",
",",
"text",
")",
"{",
"var",
"child",
"=",
"Strophe",
".",
"xmlElement",
"(",
"name",
",",
"attrs",
",",
"text",
")",
";",
"this",
".",
"node",
".",
"appendChild",
"(",
"child",
")",
";",
"if",
"(",
"!",
"t... | Function: c
Add a child to the current element and make it the new current
element.
This function moves the current element pointer to the child,
unless text is provided. If you need to add another child, it
is necessary to use up() to go back to the parent in the tree.
Parameters:
(String) name - The name of the ch... | [
"Function",
":",
"c",
"Add",
"a",
"child",
"to",
"the",
"current",
"element",
"and",
"make",
"it",
"the",
"new",
"current",
"element",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L1686-L1694 | train | Creates a new tag with the specified name and attributes. | [
30522,
3853,
1006,
2171,
1010,
2012,
16344,
2015,
1010,
3793,
1007,
1063,
13075,
2775,
1027,
2358,
18981,
5369,
1012,
20950,
12260,
3672,
1006,
2171,
1010,
2012,
16344,
2015,
1010,
3793,
1007,
1025,
2023,
1012,
13045,
1012,
10439,
10497,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
didi/cube-ui | build/build.js | buildPack | function buildPack(webpackConfig, cb, spinnerText) {
var spinner = ora(spinnerText || 'building for uncompressed files...')
spinner.start()
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) {
throw err
}
process.stdout.write(stats.toString({
colors: true,
mod... | javascript | function buildPack(webpackConfig, cb, spinnerText) {
var spinner = ora(spinnerText || 'building for uncompressed files...')
spinner.start()
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) {
throw err
}
process.stdout.write(stats.toString({
colors: true,
mod... | [
"function",
"buildPack",
"(",
"webpackConfig",
",",
"cb",
",",
"spinnerText",
")",
"{",
"var",
"spinner",
"=",
"ora",
"(",
"spinnerText",
"||",
"'building for uncompressed files...'",
")",
"spinner",
".",
"start",
"(",
")",
"webpack",
"(",
"webpackConfig",
",",
... | cp('-R', 'static/*', assetsPath) | [
"cp",
"(",
"-",
"R",
"static",
"/",
"*",
"assetsPath",
")"
] | 29096d1fe600c699237db8039255f74126730157 | https://github.com/didi/cube-ui/blob/29096d1fe600c699237db8039255f74126730157/build/build.js#L22-L39 | train | buildPack - build the webpack webpack | [
30522,
3853,
3857,
23947,
1006,
4773,
23947,
8663,
8873,
2290,
1010,
17324,
1010,
6714,
3678,
18209,
1007,
1063,
13075,
6714,
3678,
1027,
2030,
2050,
1006,
6714,
3678,
18209,
1064,
1064,
1005,
2311,
2005,
4895,
9006,
19811,
6764,
1012,
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/base/i18n/ResourceBundle.js | splitUrl | function splitUrl(sUrl) {
var m = rUrl.exec(sUrl);
if ( !m || A_VALID_FILE_TYPES.indexOf( m[2] ) < 0 ) {
throw new Error("resource URL '" + sUrl + "' has unknown type (should be one of " + A_VALID_FILE_TYPES.join(",") + ")");
}
return { url : sUrl, prefix : m[1], ext : m[2], query: m[4], hash: (m[5] || ""), ... | javascript | function splitUrl(sUrl) {
var m = rUrl.exec(sUrl);
if ( !m || A_VALID_FILE_TYPES.indexOf( m[2] ) < 0 ) {
throw new Error("resource URL '" + sUrl + "' has unknown type (should be one of " + A_VALID_FILE_TYPES.join(",") + ")");
}
return { url : sUrl, prefix : m[1], ext : m[2], query: m[4], hash: (m[5] || ""), ... | [
"function",
"splitUrl",
"(",
"sUrl",
")",
"{",
"var",
"m",
"=",
"rUrl",
".",
"exec",
"(",
"sUrl",
")",
";",
"if",
"(",
"!",
"m",
"||",
"A_VALID_FILE_TYPES",
".",
"indexOf",
"(",
"m",
"[",
"2",
"]",
")",
"<",
"0",
")",
"{",
"throw",
"new",
"Erro... | Helper to split a URL with the above regex.
Either returns an object with the parts or undefined.
@param {string} sUrl URL to analyze / split into pieces.
@returns {object} an object with properties for the individual URL parts | [
"Helper",
"to",
"split",
"a",
"URL",
"with",
"the",
"above",
"regex",
".",
"Either",
"returns",
"an",
"object",
"with",
"the",
"parts",
"or",
"undefined",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/i18n/ResourceBundle.js#L197-L203 | train | Split a URL into prefix ext query and suffix | [
30522,
3853,
3975,
3126,
2140,
1006,
7505,
2140,
1007,
1063,
13075,
1049,
1027,
21766,
12190,
1012,
4654,
8586,
1006,
7505,
2140,
1007,
1025,
2065,
1006,
999,
1049,
1064,
1064,
1037,
1035,
9398,
1035,
5371,
1035,
4127,
1012,
5950,
11253,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | features/extra/helpers.js | request | function request(svc, operation, params, next, extra) {
var world = this;
if (!svc) svc = this.service;
if (typeof svc === 'string') svc = this[svc];
svc[operation](params, function(err, data) {
world.response = this;
world.error = err;
world.data = data;
try {
if (typ... | javascript | function request(svc, operation, params, next, extra) {
var world = this;
if (!svc) svc = this.service;
if (typeof svc === 'string') svc = this[svc];
svc[operation](params, function(err, data) {
world.response = this;
world.error = err;
world.data = data;
try {
if (typ... | [
"function",
"request",
"(",
"svc",
",",
"operation",
",",
"params",
",",
"next",
",",
"extra",
")",
"{",
"var",
"world",
"=",
"this",
";",
"if",
"(",
"!",
"svc",
")",
"svc",
"=",
"this",
".",
"service",
";",
"if",
"(",
"typeof",
"svc",
"===",
"'s... | A short-cut for calling a service operation and waiting for it to
finish execution before moving onto the next step in the scenario. | [
"A",
"short",
"-",
"cut",
"for",
"calling",
"a",
"service",
"operation",
"and",
"waiting",
"for",
"it",
"to",
"finish",
"execution",
"before",
"moving",
"onto",
"the",
"next",
"step",
"in",
"the",
"scenario",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/helpers.js#L65-L98 | train | request function | [
30522,
3853,
5227,
1006,
17917,
2278,
1010,
3169,
1010,
11498,
5244,
1010,
2279,
1010,
4469,
1007,
1063,
13075,
2088,
1027,
2023,
1025,
2065,
1006,
999,
17917,
2278,
1007,
17917,
2278,
1027,
2023,
1012,
2326,
1025,
2065,
1006,
2828,
11253,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/material.js | function (material) {
var el = this.el;
var mesh;
var system = this.system;
if (this.material) { disposeMaterial(this.material, system); }
this.material = material;
system.registerMaterial(material);
// Set on mesh. If mesh does not exist, wait for it.
mesh = el.getObject3D('mesh');
... | javascript | function (material) {
var el = this.el;
var mesh;
var system = this.system;
if (this.material) { disposeMaterial(this.material, system); }
this.material = material;
system.registerMaterial(material);
// Set on mesh. If mesh does not exist, wait for it.
mesh = el.getObject3D('mesh');
... | [
"function",
"(",
"material",
")",
"{",
"var",
"el",
"=",
"this",
".",
"el",
";",
"var",
"mesh",
";",
"var",
"system",
"=",
"this",
".",
"system",
";",
"if",
"(",
"this",
".",
"material",
")",
"{",
"disposeMaterial",
"(",
"this",
".",
"material",
",... | (Re)create new material. Has side-effects of setting `this.material` and updating
material registration in scene.
@param {object} data - Material component data.
@param {object} type - Material type to create.
@returns {object} Material. | [
"(",
"Re",
")",
"create",
"new",
"material",
".",
"Has",
"side",
"-",
"effects",
"of",
"setting",
"this",
".",
"material",
"and",
"updating",
"material",
"registration",
"in",
"scene",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/material.js#L171-L192 | train | Set material on the mesh | [
30522,
3853,
1006,
3430,
1007,
1063,
13075,
3449,
1027,
2023,
1012,
3449,
1025,
13075,
20437,
1025,
13075,
2291,
1027,
2023,
1012,
2291,
1025,
2065,
1006,
2023,
1012,
3430,
1007,
1063,
27764,
8585,
14482,
1006,
2023,
1012,
3430,
1010,
2291,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
babel/babel | packages/babel-plugin-transform-template-literals/src/index.js | buildConcatCallExpressions | function buildConcatCallExpressions(items) {
let avail = true;
return items.reduce(function(left, right) {
let canBeInserted = t.isLiteral(right);
if (!canBeInserted && avail) {
canBeInserted = true;
avail = false;
}
if (canBeInserted && t.isCallExpression(left)) {
... | javascript | function buildConcatCallExpressions(items) {
let avail = true;
return items.reduce(function(left, right) {
let canBeInserted = t.isLiteral(right);
if (!canBeInserted && avail) {
canBeInserted = true;
avail = false;
}
if (canBeInserted && t.isCallExpression(left)) {
... | [
"function",
"buildConcatCallExpressions",
"(",
"items",
")",
"{",
"let",
"avail",
"=",
"true",
";",
"return",
"items",
".",
"reduce",
"(",
"function",
"(",
"left",
",",
"right",
")",
"{",
"let",
"canBeInserted",
"=",
"t",
".",
"isLiteral",
"(",
"right",
... | This function groups the objects into multiple calls to `.concat()` in
order to preserve execution order of the primitive conversion, e.g.
"".concat(obj.foo, "foo", obj2.foo, "foo2")
would evaluate both member expressions _first_ then, `concat` will
convert each one to a primitive, whereas
"".concat(obj.foo, "foo").... | [
"This",
"function",
"groups",
"the",
"objects",
"into",
"multiple",
"calls",
"to",
".",
"concat",
"()",
"in",
"order",
"to",
"preserve",
"execution",
"order",
"of",
"the",
"primitive",
"conversion",
"e",
".",
"g",
"."
] | 1969e6b6aa7d90be3fbb3aca98ea96849656a55a | https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-plugin-transform-template-literals/src/index.js#L26-L44 | train | Build concat call expressions | [
30522,
3853,
3857,
8663,
11266,
9289,
2571,
2595,
20110,
8496,
1006,
5167,
1007,
1063,
2292,
24608,
1027,
2995,
1025,
2709,
5167,
1012,
5547,
1006,
3853,
1006,
2187,
1010,
2157,
1007,
1063,
2292,
2064,
19205,
12325,
17724,
1027,
1056,
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... |
fengyuanchen/cropper | dist/cropper.common.js | getCroppedCanvas | function getCroppedCanvas() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
if (!this.ready || !window.HTMLCanvasElement) {
return null;
}
var canvasData = this.canvasData;
var source = getSourceCanvas(this.image, this.imageData, canvasData, options);... | javascript | function getCroppedCanvas() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
if (!this.ready || !window.HTMLCanvasElement) {
return null;
}
var canvasData = this.canvasData;
var source = getSourceCanvas(this.image, this.imageData, canvasData, options);... | [
"function",
"getCroppedCanvas",
"(",
")",
"{",
"var",
"options",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"{",
"}",
";",
"if",
"(",
"!",
"this",
".",
"rea... | Get a canvas drawn the cropped image.
@param {Object} [options={}] - The config options.
@returns {HTMLCanvasElement} - The result canvas. | [
"Get",
"a",
"canvas",
"drawn",
"the",
"cropped",
"image",
"."
] | 6677332a6a375b647f58808dfc24ea09f5804041 | https://github.com/fengyuanchen/cropper/blob/6677332a6a375b647f58808dfc24ea09f5804041/dist/cropper.common.js#L3057-L3195 | train | Returns the canvas element that is cropped to the specified size. | [
30522,
3853,
2131,
26775,
27288,
9336,
12044,
1006,
1007,
1063,
13075,
7047,
1027,
9918,
1012,
3091,
1028,
1014,
1004,
1004,
9918,
1031,
1014,
1033,
999,
1027,
1027,
6151,
28344,
1029,
9918,
1031,
1014,
1033,
1024,
1063,
1065,
1025,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js | function(oThis, sChangeType) {
var oLayout = oThis.getParent();
if (oLayout) {
oLayout.contentChanged(oThis, sChangeType);
}
} | javascript | function(oThis, sChangeType) {
var oLayout = oThis.getParent();
if (oLayout) {
oLayout.contentChanged(oThis, sChangeType);
}
} | [
"function",
"(",
"oThis",
",",
"sChangeType",
")",
"{",
"var",
"oLayout",
"=",
"oThis",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"oLayout",
")",
"{",
"oLayout",
".",
"contentChanged",
"(",
"oThis",
",",
"sChangeType",
")",
";",
"}",
"}"
] | Notifies the layout of this container about the change of the given type.
@private | [
"Notifies",
"the",
"layout",
"of",
"this",
"container",
"about",
"the",
"change",
"of",
"the",
"given",
"type",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js#L349-L354 | train | called when the content of the layout changes | [
30522,
3853,
1006,
27178,
24158,
1010,
8040,
18003,
27405,
5051,
1007,
1063,
13075,
19330,
28852,
4904,
1027,
27178,
24158,
1012,
2131,
19362,
4765,
1006,
1007,
1025,
2065,
1006,
19330,
28852,
4904,
1007,
1063,
19330,
28852,
4904,
1012,
4180,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/plugins/findInstalled.js | findInstalled | function findInstalled(folder) {
var options = {
dev: false,
log: function() {},
depth: 4
};
var results = Immutable.OrderedMap();
function onPackage(pkg, parent) {
if (!pkg.name) return;
var name = pkg.name;
var version = pkg.version;
var pkgPat... | javascript | function findInstalled(folder) {
var options = {
dev: false,
log: function() {},
depth: 4
};
var results = Immutable.OrderedMap();
function onPackage(pkg, parent) {
if (!pkg.name) return;
var name = pkg.name;
var version = pkg.version;
var pkgPat... | [
"function",
"findInstalled",
"(",
"folder",
")",
"{",
"var",
"options",
"=",
"{",
"dev",
":",
"false",
",",
"log",
":",
"function",
"(",
")",
"{",
"}",
",",
"depth",
":",
"4",
"}",
";",
"var",
"results",
"=",
"Immutable",
".",
"OrderedMap",
"(",
")... | List all packages installed inside a folder
@param {String} folder
@return {OrderedMap<String:Plugin>} | [
"List",
"all",
"packages",
"installed",
"inside",
"a",
"folder"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/plugins/findInstalled.js#L26-L89 | train | Find installed gitbook - plugins in a folder | [
30522,
3853,
2424,
7076,
9080,
3709,
1006,
19622,
1007,
1063,
13075,
7047,
1027,
1063,
16475,
1024,
6270,
1010,
8833,
1024,
3853,
1006,
1007,
1063,
1065,
1010,
5995,
1024,
1018,
1065,
1025,
13075,
3463,
1027,
10047,
28120,
3085,
1012,
3641,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/TopicDetailInitial.controller.js | function () {
BaseController.prototype.onInit.call(this);
// manually call the handler once at startup as device API won't do this for us
this._onOrientationChange({
landscape: Device.orientation.landscape
});
this.handleDocumentationDisclaimer();
} | javascript | function () {
BaseController.prototype.onInit.call(this);
// manually call the handler once at startup as device API won't do this for us
this._onOrientationChange({
landscape: Device.orientation.landscape
});
this.handleDocumentationDisclaimer();
} | [
"function",
"(",
")",
"{",
"BaseController",
".",
"prototype",
".",
"onInit",
".",
"call",
"(",
"this",
")",
";",
"// manually call the handler once at startup as device API won't do this for us",
"this",
".",
"_onOrientationChange",
"(",
"{",
"landscape",
":",
"Device"... | Called when the controller is instantiated.
@public | [
"Called",
"when",
"the",
"controller",
"is",
"instantiated",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/TopicDetailInitial.controller.js#L19-L28 | train | This controller is called when the device is initialized | [
30522,
3853,
1006,
1007,
1063,
2918,
8663,
13181,
10820,
1012,
8773,
1012,
2006,
5498,
2102,
1012,
2655,
1006,
2023,
1007,
1025,
1013,
1013,
21118,
2655,
1996,
28213,
2320,
2012,
22752,
2004,
5080,
17928,
2180,
1005,
1056,
2079,
2023,
2005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/semi.js | report | function report(node, missing) {
const lastToken = sourceCode.getLastToken(node);
let message,
fix,
loc = lastToken.loc;
if (!missing) {
message = "Missing semicolon.";
loc = loc.end;
fix = function(fixe... | javascript | function report(node, missing) {
const lastToken = sourceCode.getLastToken(node);
let message,
fix,
loc = lastToken.loc;
if (!missing) {
message = "Missing semicolon.";
loc = loc.end;
fix = function(fixe... | [
"function",
"report",
"(",
"node",
",",
"missing",
")",
"{",
"const",
"lastToken",
"=",
"sourceCode",
".",
"getLastToken",
"(",
"node",
")",
";",
"let",
"message",
",",
"fix",
",",
"loc",
"=",
"lastToken",
".",
"loc",
";",
"if",
"(",
"!",
"missing",
... | -------------------------------------------------------------------------- Helpers --------------------------------------------------------------------------
Reports a semicolon error with appropriate location and message.
@param {ASTNode} node The node with an extra or missing semicolon.
@param {boolean} missing True... | [
"--------------------------------------------------------------------------",
"Helpers",
"--------------------------------------------------------------------------",
"Reports",
"a",
"semicolon",
"error",
"with",
"appropriate",
"location",
"and",
"message",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/semi.js#L92-L127 | train | Reports a node with a semicolon. | [
30522,
3853,
3189,
1006,
13045,
1010,
4394,
1007,
1063,
9530,
3367,
2197,
18715,
2368,
1027,
3120,
16044,
1012,
2131,
8523,
9284,
7520,
1006,
13045,
1007,
1025,
2292,
4471,
1010,
8081,
1010,
8840,
2278,
1027,
2197,
18715,
2368,
1012,
8840,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/AutoUpdate/main.js | setupAutoUpdate | function setupAutoUpdate() {
updateJsonHandler = new StateHandler(updateJsonPath);
updateDomain.on('data', receiveMessageFromNode);
updateDomain.exec('initNode', {
messageIds: MessageIds,
updateDir: updateDir,
requester: domainID
});
} | javascript | function setupAutoUpdate() {
updateJsonHandler = new StateHandler(updateJsonPath);
updateDomain.on('data', receiveMessageFromNode);
updateDomain.exec('initNode', {
messageIds: MessageIds,
updateDir: updateDir,
requester: domainID
});
} | [
"function",
"setupAutoUpdate",
"(",
")",
"{",
"updateJsonHandler",
"=",
"new",
"StateHandler",
"(",
"updateJsonPath",
")",
";",
"updateDomain",
".",
"on",
"(",
"'data'",
",",
"receiveMessageFromNode",
")",
";",
"updateDomain",
".",
"exec",
"(",
"'initNode'",
","... | Sets up the Auto Update environment | [
"Sets",
"up",
"the",
"Auto",
"Update",
"environment"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L320-L329 | train | Setup auto update | [
30522,
3853,
16437,
4887,
24826,
17299,
3686,
1006,
1007,
1063,
10651,
22578,
2239,
11774,
3917,
1027,
2047,
2110,
11774,
3917,
1006,
10651,
22578,
2239,
15069,
1007,
1025,
7172,
9626,
2378,
1012,
2006,
1006,
1005,
2951,
1005,
1010,
4374,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/select/select.js | announceClosed | function announceClosed(opts) {
var mdSelect = opts.selectCtrl;
if (mdSelect) {
var menuController = opts.selectEl.controller('mdSelectMenu');
mdSelect.setLabelText(menuController ? menuController.selectedLabels() : '');
mdSelect.triggerClose();
}
} | javascript | function announceClosed(opts) {
var mdSelect = opts.selectCtrl;
if (mdSelect) {
var menuController = opts.selectEl.controller('mdSelectMenu');
mdSelect.setLabelText(menuController ? menuController.selectedLabels() : '');
mdSelect.triggerClose();
}
} | [
"function",
"announceClosed",
"(",
"opts",
")",
"{",
"var",
"mdSelect",
"=",
"opts",
".",
"selectCtrl",
";",
"if",
"(",
"mdSelect",
")",
"{",
"var",
"menuController",
"=",
"opts",
".",
"selectEl",
".",
"controller",
"(",
"'mdSelectMenu'",
")",
";",
"mdSele... | To notify listeners that the Select menu has closed,
trigger the [optional] user-defined expression | [
"To",
"notify",
"listeners",
"that",
"the",
"Select",
"menu",
"has",
"closed",
"trigger",
"the",
"[",
"optional",
"]",
"user",
"-",
"defined",
"expression"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/select/select.js#L1615-L1622 | train | announce closed event | [
30522,
3853,
14970,
20464,
24768,
1006,
23569,
2015,
1007,
1063,
13075,
9108,
11246,
22471,
1027,
23569,
2015,
1012,
7276,
6593,
12190,
1025,
2065,
1006,
9108,
11246,
22471,
1007,
1063,
13075,
12183,
8663,
13181,
10820,
1027,
23569,
2015,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function (vValue, sType) {
if (vValue === undefined) {
throw new Error("Illegal value: undefined");
}
if (vValue === null) {
return "null";
}
switch (sType) {
case "Edm.Binary":
return "binary'" + vValue + "'";
case "Edm.Boolean":
case "Edm.Byte":
case "Edm.Double":
case "Edm... | javascript | function (vValue, sType) {
if (vValue === undefined) {
throw new Error("Illegal value: undefined");
}
if (vValue === null) {
return "null";
}
switch (sType) {
case "Edm.Binary":
return "binary'" + vValue + "'";
case "Edm.Boolean":
case "Edm.Byte":
case "Edm.Double":
case "Edm... | [
"function",
"(",
"vValue",
",",
"sType",
")",
"{",
"if",
"(",
"vValue",
"===",
"undefined",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Illegal value: undefined\"",
")",
";",
"}",
"if",
"(",
"vValue",
"===",
"null",
")",
"{",
"return",
"\"null\"",
";",
... | Formats a given internal value into a literal suitable for usage in URLs.
@param {any} vValue
The value according to "OData JSON Format Version 4.0" section "7.1 Primitive Value"
@param {string} sType
The OData Edm type, e.g. "Edm.String"
@returns {string}
The literal according to "OData Version 4.0 Part 2: URL Conven... | [
"Formats",
"a",
"given",
"internal",
"value",
"into",
"a",
"literal",
"suitable",
"for",
"usage",
"in",
"URLs",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L446-L484 | train | Returns the value of an object in the specified type. | [
30522,
3853,
1006,
1058,
10175,
5657,
1010,
2358,
18863,
1007,
1063,
2065,
1006,
1058,
10175,
5657,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
5466,
2047,
7561,
1006,
1000,
6206,
3643,
1024,
6151,
28344,
1000,
1007,
1025,
1065,
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... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/HTMLRenderer.js | function(oRM, oControl) {
// render an invisible, but easily identifiable placeholder for the content
oRM.write("<div id=\"" + RenderPrefixes.Dummy + oControl.getId() + "\" style=\"display:none\">");
// Note: we do not render the content string here, but only in onAfterRendering
// This has the advantage t... | javascript | function(oRM, oControl) {
// render an invisible, but easily identifiable placeholder for the content
oRM.write("<div id=\"" + RenderPrefixes.Dummy + oControl.getId() + "\" style=\"display:none\">");
// Note: we do not render the content string here, but only in onAfterRendering
// This has the advantage t... | [
"function",
"(",
"oRM",
",",
"oControl",
")",
"{",
"// render an invisible, but easily identifiable placeholder for the content",
"oRM",
".",
"write",
"(",
"\"<div id=\\\"\"",
"+",
"RenderPrefixes",
".",
"Dummy",
"+",
"oControl",
".",
"getId",
"(",
")",
"+",
"\"\\\" s... | Renders either the configured content or a dummy div that will be replaced after rendering
@param {sap.ui.core.RenderManager} [oRM] The RenderManager instance
@param {sap.ui.core.Control} [oControl] The instance of the invisible control | [
"Renders",
"either",
"the",
"configured",
"content",
"or",
"a",
"dummy",
"div",
"that",
"will",
"be",
"replaced",
"after",
"rendering"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/HTMLRenderer.js#L21-L30 | train | Renders the content of the control tree | [
30522,
3853,
1006,
2030,
2213,
1010,
1051,
8663,
13181,
2140,
1007,
1063,
1013,
1013,
17552,
2019,
8841,
1010,
2021,
4089,
27800,
2173,
14528,
2005,
1996,
4180,
2030,
2213,
1012,
4339,
1006,
1000,
1026,
4487,
2615,
8909,
1027,
1032,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
NervJS/taro | packages/taro-components/src/components/swiper/swiper.js | parseType | function parseType (props) {
const {
current
} = props
// 抛出错误信息
const throwErrorMsg = type => {
throw new TypeError(type + ' must be number')
}
if (current) isNumber(current) ? '' : throwErrorMsg('current')
} | javascript | function parseType (props) {
const {
current
} = props
// 抛出错误信息
const throwErrorMsg = type => {
throw new TypeError(type + ' must be number')
}
if (current) isNumber(current) ? '' : throwErrorMsg('current')
} | [
"function",
"parseType",
"(",
"props",
")",
"{",
"const",
"{",
"current",
"}",
"=",
"props",
"// 抛出错误信息",
"const",
"throwErrorMsg",
"=",
"type",
"=>",
"{",
"throw",
"new",
"TypeError",
"(",
"type",
"+",
"' must be number'",
")",
"}",
"if",
"(",
"current",
... | props 类型检测
@param {Object} props | [
"props",
"类型检测"
] | 274e76d731d7f158141287e31cbd51f092d472c5 | https://github.com/NervJS/taro/blob/274e76d731d7f158141287e31cbd51f092d472c5/packages/taro-components/src/components/swiper/swiper.js#L11-L22 | train | parse type | [
30522,
3853,
11968,
13462,
18863,
1006,
24387,
1007,
1063,
9530,
3367,
1063,
2783,
1065,
1027,
24387,
1013,
1013,
100,
1774,
100,
100,
1767,
100,
9530,
3367,
5466,
2121,
29165,
5244,
2290,
1027,
2828,
1027,
1028,
1063,
5466,
2047,
2828,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _handleActiveEditorChange | function _handleActiveEditorChange(event, current, previous) {
if (previous && previous._paneId) { // Handle only full editors
previous.off("beforeSelectionChange", _recordJumpDef);
_captureFrame(previous);
_validateNavigationCmds();
}
if (current && ... | javascript | function _handleActiveEditorChange(event, current, previous) {
if (previous && previous._paneId) { // Handle only full editors
previous.off("beforeSelectionChange", _recordJumpDef);
_captureFrame(previous);
_validateNavigationCmds();
}
if (current && ... | [
"function",
"_handleActiveEditorChange",
"(",
"event",
",",
"current",
",",
"previous",
")",
"{",
"if",
"(",
"previous",
"&&",
"previous",
".",
"_paneId",
")",
"{",
"// Handle only full editors",
"previous",
".",
"off",
"(",
"\"beforeSelectionChange\"",
",",
"_rec... | Handle Active Editor change to update navigation information
@private | [
"Handle",
"Active",
"Editor",
"change",
"to",
"update",
"navigation",
"information"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L522-L536 | train | Handle active editor change | [
30522,
3853,
1035,
5047,
19620,
2098,
15660,
22305,
2063,
1006,
2724,
1010,
2783,
1010,
3025,
1007,
1063,
2065,
1006,
3025,
1004,
1004,
3025,
1012,
1035,
6090,
7416,
2094,
1007,
1063,
1013,
1013,
5047,
2069,
2440,
10195,
3025,
1012,
2125,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/polar/Polar.js | function (point) {
var coord = this.pointToCoord(point);
return this._radiusAxis.contain(coord[0])
&& this._angleAxis.contain(coord[1]);
} | javascript | function (point) {
var coord = this.pointToCoord(point);
return this._radiusAxis.contain(coord[0])
&& this._angleAxis.contain(coord[1]);
} | [
"function",
"(",
"point",
")",
"{",
"var",
"coord",
"=",
"this",
".",
"pointToCoord",
"(",
"point",
")",
";",
"return",
"this",
".",
"_radiusAxis",
".",
"contain",
"(",
"coord",
"[",
"0",
"]",
")",
"&&",
"this",
".",
"_angleAxis",
".",
"contain",
"("... | If contain coord
@param {Array.<number>} point
@return {boolean} | [
"If",
"contain",
"coord"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/polar/Polar.js#L90-L94 | train | Returns true if the given point is on the region of the region | [
30522,
3853,
1006,
2391,
1007,
1063,
13075,
2522,
8551,
1027,
2023,
1012,
2391,
3406,
3597,
8551,
1006,
2391,
1007,
1025,
2709,
2023,
1012,
1035,
12177,
8528,
2483,
1012,
5383,
1006,
2522,
8551,
1031,
1014,
1033,
1007,
1004,
1004,
2023,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
expressjs/express | lib/router/index.js | appendMethods | function appendMethods(list, addition) {
for (var i = 0; i < addition.length; i++) {
var method = addition[i];
if (list.indexOf(method) === -1) {
list.push(method);
}
}
} | javascript | function appendMethods(list, addition) {
for (var i = 0; i < addition.length; i++) {
var method = addition[i];
if (list.indexOf(method) === -1) {
list.push(method);
}
}
} | [
"function",
"appendMethods",
"(",
"list",
",",
"addition",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"addition",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"method",
"=",
"addition",
"[",
"i",
"]",
";",
"if",
"(",
"list",
... | append methods to a list of methods | [
"append",
"methods",
"to",
"a",
"list",
"of",
"methods"
] | dc538f6e810bd462c98ee7e6aae24c64d4b1da93 | https://github.com/expressjs/express/blob/dc538f6e810bd462c98ee7e6aae24c64d4b1da93/lib/router/index.js#L516-L523 | train | Append methods to the list | [
30522,
3853,
10439,
10497,
11368,
6806,
5104,
1006,
2862,
1010,
2804,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
2804,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
13075,
4118,
1027,
2804,
1031,
1045,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.