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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eslint/eslint | lib/rules/no-use-before-define.js | isOuterClass | function isOuterClass(variable, reference) {
return (
variable.defs[0].type === "ClassName" &&
variable.scope.variableScope !== reference.from.variableScope
);
} | javascript | function isOuterClass(variable, reference) {
return (
variable.defs[0].type === "ClassName" &&
variable.scope.variableScope !== reference.from.variableScope
);
} | [
"function",
"isOuterClass",
"(",
"variable",
",",
"reference",
")",
"{",
"return",
"(",
"variable",
".",
"defs",
"[",
"0",
"]",
".",
"type",
"===",
"\"ClassName\"",
"&&",
"variable",
".",
"scope",
".",
"variableScope",
"!==",
"reference",
".",
"from",
".",... | Checks whether or not a given variable is a class declaration in an upper function scope.
@param {eslint-scope.Variable} variable - A variable to check.
@param {eslint-scope.Reference} reference - A reference to check.
@returns {boolean} `true` if the variable is a class declaration. | [
"Checks",
"whether",
"or",
"not",
"a",
"given",
"variable",
"is",
"a",
"class",
"declaration",
"in",
"an",
"upper",
"function",
"scope",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-use-before-define.js#L54-L59 | train | Returns true if the variable is an outer class of the given reference | [
30522,
3853,
11163,
19901,
26266,
1006,
8023,
1010,
4431,
1007,
1063,
2709,
1006,
8023,
1012,
13366,
2015,
1031,
1014,
1033,
1012,
2828,
1027,
1027,
1027,
1000,
2465,
18442,
1000,
1004,
1004,
8023,
1012,
9531,
1012,
10857,
16186,
999,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | updateCollapsedAndCommonAncestor | function updateCollapsedAndCommonAncestor(range) {
range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);
range.commonAncestorContainer = range.collapsed ?
range.startContainer : dom.getCommonAncestor(range.startContainer, range.... | javascript | function updateCollapsedAndCommonAncestor(range) {
range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);
range.commonAncestorContainer = range.collapsed ?
range.startContainer : dom.getCommonAncestor(range.startContainer, range.... | [
"function",
"updateCollapsedAndCommonAncestor",
"(",
"range",
")",
"{",
"range",
".",
"collapsed",
"=",
"(",
"range",
".",
"startContainer",
"===",
"range",
".",
"endContainer",
"&&",
"range",
".",
"startOffset",
"===",
"range",
".",
"endOffset",
")",
";",
"ra... | /*---------------------------------------------------------------------------------------------------------------- Updates commonAncestorContainer and collapsed after boundary change | [
"/",
"*",
"----------------------------------------------------------------------------------------------------------------",
"Updates",
"commonAncestorContainer",
"and",
"collapsed",
"after",
"boundary",
"change"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L2131-L2135 | train | Update collapsed and common ancestor | [
30522,
3853,
10651,
26895,
9331,
6924,
5685,
9006,
21781,
5897,
23809,
1006,
2846,
1007,
1063,
2846,
1012,
7798,
1027,
1006,
2846,
1012,
2707,
8663,
18249,
2121,
1027,
1027,
1027,
2846,
1012,
2203,
8663,
18249,
2121,
1004,
1004,
2846,
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/odata/ODataUtils.js | parseDecimal | function parseDecimal(sValue) {
var aMatches;
if (typeof sValue !== "string") {
return undefined;
}
aMatches = rDecimal.exec(sValue);
if (!aMatches) {
return undefined;
}
return {
sign: aMatches[1] === "-" ? -1 : 1,
integerLength: aMatches[2].length,
// remove trailing decimal zeroes and p... | javascript | function parseDecimal(sValue) {
var aMatches;
if (typeof sValue !== "string") {
return undefined;
}
aMatches = rDecimal.exec(sValue);
if (!aMatches) {
return undefined;
}
return {
sign: aMatches[1] === "-" ? -1 : 1,
integerLength: aMatches[2].length,
// remove trailing decimal zeroes and p... | [
"function",
"parseDecimal",
"(",
"sValue",
")",
"{",
"var",
"aMatches",
";",
"if",
"(",
"typeof",
"sValue",
"!==",
"\"string\"",
")",
"{",
"return",
"undefined",
";",
"}",
"aMatches",
"=",
"rDecimal",
".",
"exec",
"(",
"sValue",
")",
";",
"if",
"(",
"!... | Parses a decimal given in a string.
@param {string} sValue
the value
@returns {object}
the result with the sign in <code>sign</code>, the number of integer digits in
<code>integerLength</code> and the trimmed absolute value in <code>abs</code> | [
"Parses",
"a",
"decimal",
"given",
"in",
"a",
"string",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/ODataUtils.js#L571-L588 | train | Parses a decimal value. | [
30522,
3853,
11968,
6924,
8586,
9581,
2140,
1006,
17917,
2389,
5657,
1007,
1063,
13075,
25933,
10649,
2229,
1025,
2065,
1006,
2828,
11253,
17917,
2389,
5657,
999,
1027,
1027,
1000,
5164,
1000,
1007,
1063,
2709,
6151,
28344,
1025,
1065,
2593... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/space-infix-ops.js | checkConditional | function checkConditional(node) {
const nonSpacedConsequesntNode = getFirstNonSpacedToken(node.test, node.consequent, "?");
const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate, ":");
if (nonSpacedConsequesntNode) {
report(node, nonSp... | javascript | function checkConditional(node) {
const nonSpacedConsequesntNode = getFirstNonSpacedToken(node.test, node.consequent, "?");
const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate, ":");
if (nonSpacedConsequesntNode) {
report(node, nonSp... | [
"function",
"checkConditional",
"(",
"node",
")",
"{",
"const",
"nonSpacedConsequesntNode",
"=",
"getFirstNonSpacedToken",
"(",
"node",
".",
"test",
",",
"node",
".",
"consequent",
",",
"\"?\"",
")",
";",
"const",
"nonSpacedAlternateNode",
"=",
"getFirstNonSpacedTok... | Check if the node is conditional
@param {ASTNode} node node to evaluate
@returns {void}
@private | [
"Check",
"if",
"the",
"node",
"is",
"conditional"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/space-infix-ops.js#L125-L134 | train | Check if a conditional node is valid | [
30522,
3853,
4638,
8663,
27064,
1006,
13045,
1007,
1063,
9530,
3367,
2512,
23058,
16409,
5644,
2063,
10997,
3372,
3630,
3207,
1027,
2131,
8873,
12096,
8540,
23058,
11927,
11045,
2078,
1006,
13045,
1012,
3231,
1010,
13045,
1012,
9530,
3366,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jhipster/generator-jhipster | generators/docker-cli.js | pushImage | function pushImage(repository) {
const commandLine = `docker push ${repository}`;
return new Promise((resolve, reject) =>
command(commandLine, (err, stdout) => {
if (err) {
reject(err);
}
resolve(stdout);
})
);
} | javascript | function pushImage(repository) {
const commandLine = `docker push ${repository}`;
return new Promise((resolve, reject) =>
command(commandLine, (err, stdout) => {
if (err) {
reject(err);
}
resolve(stdout);
})
);
} | [
"function",
"pushImage",
"(",
"repository",
")",
"{",
"const",
"commandLine",
"=",
"`",
"${",
"repository",
"}",
"`",
";",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"command",
"(",
"commandLine",
",",
"(",
"err",
",",
"... | Pushes the locally constructed Docker image to the supplied respository
@param repository tag, for example: 111111111.dkr.ecr.us-east-1.amazonaws.com/sample
@returns {Promise<any>} | [
"Pushes",
"the",
"locally",
"constructed",
"Docker",
"image",
"to",
"the",
"supplied",
"respository"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/docker-cli.js#L138-L148 | train | Pushes an image to the specified repository | [
30522,
3853,
5245,
9581,
3351,
1006,
22409,
1007,
1063,
9530,
3367,
3094,
4179,
1027,
1036,
8946,
2121,
5245,
1002,
1063,
22409,
1065,
1036,
1025,
2709,
2047,
4872,
1006,
1006,
10663,
1010,
15454,
1007,
1027,
1028,
3094,
1006,
3094,
4179,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
transloadit/uppy | packages/@uppy/webcam/src/index.js | getMediaDevices | function getMediaDevices () {
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
return navigator.mediaDevices
}
const getUserMedia = navigator.mozGetUserMedia || navigator.webkitGetUserMedia
if (!getUserMedia) {
return null
}
return {
getUserMedia (opts) {
return new P... | javascript | function getMediaDevices () {
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
return navigator.mediaDevices
}
const getUserMedia = navigator.mozGetUserMedia || navigator.webkitGetUserMedia
if (!getUserMedia) {
return null
}
return {
getUserMedia (opts) {
return new P... | [
"function",
"getMediaDevices",
"(",
")",
"{",
"if",
"(",
"navigator",
".",
"mediaDevices",
"&&",
"navigator",
".",
"mediaDevices",
".",
"getUserMedia",
")",
"{",
"return",
"navigator",
".",
"mediaDevices",
"}",
"const",
"getUserMedia",
"=",
"navigator",
".",
"... | Setup getUserMedia, with polyfill for older browsers Adapted from: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia | [
"Setup",
"getUserMedia",
"with",
"polyfill",
"for",
"older",
"browsers",
"Adapted",
"from",
":",
"https",
":",
"//",
"developer",
".",
"mozilla",
".",
"org",
"/",
"en",
"-",
"US",
"/",
"docs",
"/",
"Web",
"/",
"API",
"/",
"MediaDevices",
"/",
"getUserMed... | 7ae18bf992d544a64da998f033258ec09a3de275 | https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/packages/@uppy/webcam/src/index.js#L13-L30 | train | getMediaDevices - returns a Promise | [
30522,
3853,
2131,
16969,
24844,
23522,
1006,
1007,
1063,
2065,
1006,
20532,
1012,
2865,
24844,
23522,
1004,
1004,
20532,
1012,
2865,
24844,
23522,
1012,
2131,
20330,
16969,
1007,
1063,
2709,
20532,
1012,
2865,
24844,
23522,
1065,
9530,
3367,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
radare/radare2 | shlr/www/graph/index.js | setMenu | function setMenu() {
var url = document.location.href;
// strip extension
url = stripExtension(url);
var ulElement = document.getElementById("menu");
var links = ulElement.getElementsByTagName("A");
var i;
for(i = 0; i < links.length; i++) {
if(url.indexOf(stripExtension(links[i].href)) == 0) {
... | javascript | function setMenu() {
var url = document.location.href;
// strip extension
url = stripExtension(url);
var ulElement = document.getElementById("menu");
var links = ulElement.getElementsByTagName("A");
var i;
for(i = 0; i < links.length; i++) {
if(url.indexOf(stripExtension(links[i].href)) == 0) {
... | [
"function",
"setMenu",
"(",
")",
"{",
"var",
"url",
"=",
"document",
".",
"location",
".",
"href",
";",
"// strip extension",
"url",
"=",
"stripExtension",
"(",
"url",
")",
";",
"var",
"ulElement",
"=",
"document",
".",
"getElementById",
"(",
"\"menu\"",
"... | sets the active menu scanning for a menu item which url is a prefix
of the one of the current page ignoring file extension.
Nice trick! | [
"sets",
"the",
"active",
"menu",
"scanning",
"for",
"a",
"menu",
"item",
"which",
"url",
"is",
"a",
"prefix",
"of",
"the",
"one",
"of",
"the",
"current",
"page",
"ignoring",
"file",
"extension",
".",
"Nice",
"trick!"
] | bf5e3028810a0ec7c267c6fe4bfad639b4819e35 | https://github.com/radare/radare2/blob/bf5e3028810a0ec7c267c6fe4bfad639b4819e35/shlr/www/graph/index.js#L47-L61 | train | set menu | [
30522,
3853,
2275,
3549,
2226,
1006,
1007,
1063,
13075,
24471,
2140,
1027,
6254,
1012,
3295,
1012,
17850,
12879,
1025,
1013,
1013,
6167,
5331,
24471,
2140,
1027,
18247,
18413,
6132,
3258,
1006,
24471,
2140,
1007,
1025,
13075,
17359,
12260,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/base/util/array/uniqueSort.js | function(aArray) {
assert(aArray instanceof Array, "uniqueSort: input parameter must be an Array");
var l = aArray.length;
if ( l > 1 ) {
aArray.sort();
var j = 0;
for (var i = 1; i < l; i++) {
// invariant: i is the entry to check, j is the last unique entry known so far
if ( aArray[i] !== aArra... | javascript | function(aArray) {
assert(aArray instanceof Array, "uniqueSort: input parameter must be an Array");
var l = aArray.length;
if ( l > 1 ) {
aArray.sort();
var j = 0;
for (var i = 1; i < l; i++) {
// invariant: i is the entry to check, j is the last unique entry known so far
if ( aArray[i] !== aArra... | [
"function",
"(",
"aArray",
")",
"{",
"assert",
"(",
"aArray",
"instanceof",
"Array",
",",
"\"uniqueSort: input parameter must be an Array\"",
")",
";",
"var",
"l",
"=",
"aArray",
".",
"length",
";",
"if",
"(",
"l",
">",
"1",
")",
"{",
"aArray",
".",
"sort"... | Sorts the given array in-place and removes any duplicates (identified by "===").
Use <code>jQuery.unique()</code> for arrays of DOMElements.
@function
@since 1.58
@param {any[]} aArray An Array of any type
@alias module:sap/base/util/array/uniqueSort
@return {any[]} Same array as given (for chaining)
@public | [
"Sorts",
"the",
"given",
"array",
"in",
"-",
"place",
"and",
"removes",
"any",
"duplicates",
"(",
"identified",
"by",
"===",
")",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/util/array/uniqueSort.js#L19-L37 | train | uniqueSort - Sorts an array of unique entries | [
30522,
3853,
1006,
9779,
11335,
2100,
1007,
1063,
20865,
1006,
9779,
11335,
2100,
6013,
11253,
9140,
1010,
1000,
4310,
21748,
2102,
1024,
7953,
16381,
2442,
2022,
2019,
9140,
1000,
1007,
1025,
13075,
1048,
1027,
9779,
11335,
2100,
1012,
309... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ecomfe/zrender | src/mixin/Animatable.js | function (target, time, delay, easing, callback, forceAnimate) {
animateTo(this, target, time, delay, easing, callback, forceAnimate);
} | javascript | function (target, time, delay, easing, callback, forceAnimate) {
animateTo(this, target, time, delay, easing, callback, forceAnimate);
} | [
"function",
"(",
"target",
",",
"time",
",",
"delay",
",",
"easing",
",",
"callback",
",",
"forceAnimate",
")",
"{",
"animateTo",
"(",
"this",
",",
"target",
",",
"time",
",",
"delay",
",",
"easing",
",",
"callback",
",",
"forceAnimate",
")",
";",
"}"
... | Caution: this method will stop previous animation.
So do not use this method to one element twice before
animation starts, unless you know what you are doing.
@param {Object} target
@param {number} [time=500] Time in ms
@param {string} [easing='linear']
@param {number} [delay=0]
@param {Function} [callback]
@param {Fun... | [
"Caution",
":",
"this",
"method",
"will",
"stop",
"previous",
"animation",
".",
"So",
"do",
"not",
"use",
"this",
"method",
"to",
"one",
"element",
"twice",
"before",
"animation",
"starts",
"unless",
"you",
"know",
"what",
"you",
"are",
"doing",
".",
"@par... | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/mixin/Animatable.js#L141-L143 | train | Animate the current page to another page | [
30522,
3853,
1006,
4539,
1010,
2051,
1010,
8536,
1010,
24070,
1010,
2655,
5963,
1010,
2486,
7088,
8585,
1007,
1063,
2019,
21499,
3406,
1006,
2023,
1010,
4539,
1010,
2051,
1010,
8536,
1010,
24070,
1010,
2655,
5963,
1010,
2486,
7088,
8585,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/blur/blur.js | function (element, options) {
this.internalID = randomID()
this.element = element
this.width = element.offsetWidth
this.height = element.offsetHeight
this.element = element
this.parent = this.element.parentNode
this.options = Object.assign({}, Blur.DEFAULTS, options)
this.overlayEl = this.createOverlay(... | javascript | function (element, options) {
this.internalID = randomID()
this.element = element
this.width = element.offsetWidth
this.height = element.offsetHeight
this.element = element
this.parent = this.element.parentNode
this.options = Object.assign({}, Blur.DEFAULTS, options)
this.overlayEl = this.createOverlay(... | [
"function",
"(",
"element",
",",
"options",
")",
"{",
"this",
".",
"internalID",
"=",
"randomID",
"(",
")",
"this",
".",
"element",
"=",
"element",
"this",
".",
"width",
"=",
"element",
".",
"offsetWidth",
"this",
".",
"height",
"=",
"element",
".",
"o... | backgroundBlur PUBLIC CLASS DEFINITION ================================ | [
"backgroundBlur",
"PUBLIC",
"CLASS",
"DEFINITION",
"================================"
] | 484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6 | https://github.com/airyland/vux/blob/484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6/src/components/blur/blur.js#L92-L104 | train | Creates a new Blur instance | [
30522,
3853,
1006,
5783,
1010,
7047,
1007,
1063,
2023,
1012,
4722,
3593,
1027,
6721,
3593,
1006,
1007,
2023,
1012,
5783,
1027,
5783,
2023,
1012,
9381,
1027,
5783,
1012,
16396,
9148,
11927,
2232,
2023,
1012,
4578,
1027,
5783,
1012,
16396,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | setConstraint | function setConstraint(sKey, vValue) {
if (vValue !== undefined) {
mConstraints = mConstraints || {};
mConstraints[sKey] = vValue;
}
} | javascript | function setConstraint(sKey, vValue) {
if (vValue !== undefined) {
mConstraints = mConstraints || {};
mConstraints[sKey] = vValue;
}
} | [
"function",
"setConstraint",
"(",
"sKey",
",",
"vValue",
")",
"{",
"if",
"(",
"vValue",
"!==",
"undefined",
")",
"{",
"mConstraints",
"=",
"mConstraints",
"||",
"{",
"}",
";",
"mConstraints",
"[",
"sKey",
"]",
"=",
"vValue",
";",
"}",
"}"
] | /*
Adds a constraint to the map of constraints if a value is given. Does not create the map
or a constraint if not needed.
@param {string} sKey The constraint's name
@param {any} vValue The contraint's value | [
"/",
"*",
"Adds",
"a",
"constraint",
"to",
"the",
"map",
"of",
"constraints",
"if",
"a",
"value",
"is",
"given",
".",
"Does",
"not",
"create",
"the",
"map",
"or",
"a",
"constraint",
"if",
"not",
"needed",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L1854-L1859 | train | Sets constraint for the given key. | [
30522,
3853,
2275,
8663,
20528,
18447,
1006,
15315,
3240,
1010,
1058,
10175,
5657,
1007,
1063,
2065,
1006,
1058,
10175,
5657,
999,
1027,
1027,
6151,
28344,
1007,
1063,
11338,
5644,
23654,
3215,
1027,
11338,
5644,
23654,
3215,
1064,
1064,
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... |
NetEase/pomelo | lib/connectors/mqttsocket.js | function(id, socket, adaptor) {
EventEmitter.call(this);
this.id = id;
this.socket = socket;
this.remoteAddress = {
ip: socket.stream.remoteAddress,
port: socket.stream.remotePort
};
this.adaptor = adaptor;
var self = this;
socket.on('close', this.emit.bind(this, 'disconnect'));
socket.on('e... | javascript | function(id, socket, adaptor) {
EventEmitter.call(this);
this.id = id;
this.socket = socket;
this.remoteAddress = {
ip: socket.stream.remoteAddress,
port: socket.stream.remotePort
};
this.adaptor = adaptor;
var self = this;
socket.on('close', this.emit.bind(this, 'disconnect'));
socket.on('e... | [
"function",
"(",
"id",
",",
"socket",
",",
"adaptor",
")",
"{",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"id",
"=",
"id",
";",
"this",
".",
"socket",
"=",
"socket",
";",
"this",
".",
"remoteAddress",
"=",
"{",
"ip",
":",
"... | Socket class that wraps socket and websocket to provide unified interface for up level. | [
"Socket",
"class",
"that",
"wraps",
"socket",
"and",
"websocket",
"to",
"provide",
"unified",
"interface",
"for",
"up",
"level",
"."
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/connectors/mqttsocket.js#L10-L37 | train | A Knockout connection | [
30522,
3853,
1006,
8909,
1010,
22278,
1010,
15581,
2953,
1007,
1063,
2724,
23238,
12079,
1012,
2655,
1006,
2023,
1007,
1025,
2023,
1012,
8909,
1027,
8909,
1025,
2023,
1012,
22278,
1027,
22278,
1025,
2023,
1012,
6556,
4215,
16200,
4757,
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... | |
apache/incubator-echarts | src/chart/boxplot/boxplotLayout.js | layoutSingleSeries | function layoutSingleSeries(seriesModel, offset, boxWidth) {
var coordSys = seriesModel.coordinateSystem;
var data = seriesModel.getData();
var halfWidth = boxWidth / 2;
var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;
var vDimIdx = 1 - cDimIdx;
var coordDims = ['x', 'y'];
v... | javascript | function layoutSingleSeries(seriesModel, offset, boxWidth) {
var coordSys = seriesModel.coordinateSystem;
var data = seriesModel.getData();
var halfWidth = boxWidth / 2;
var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;
var vDimIdx = 1 - cDimIdx;
var coordDims = ['x', 'y'];
v... | [
"function",
"layoutSingleSeries",
"(",
"seriesModel",
",",
"offset",
",",
"boxWidth",
")",
"{",
"var",
"coordSys",
"=",
"seriesModel",
".",
"coordinateSystem",
";",
"var",
"data",
"=",
"seriesModel",
".",
"getData",
"(",
")",
";",
"var",
"halfWidth",
"=",
"b... | Calculate points location for each series. | [
"Calculate",
"points",
"location",
"for",
"each",
"series",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/boxplot/boxplotLayout.js#L126-L197 | train | Layouts a single series | [
30522,
3853,
9621,
7741,
24527,
5134,
1006,
2186,
5302,
9247,
1010,
16396,
1010,
3482,
9148,
11927,
2232,
1007,
1063,
13075,
2522,
8551,
6508,
2015,
1027,
2186,
5302,
9247,
1012,
12093,
27268,
6633,
1025,
13075,
2951,
1027,
2186,
5302,
9247... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jhipster/generator-jhipster | generators/aws-containers/prompts.js | askForSubnets | function askForSubnets() {
if (this.abort) return null;
const done = this.async();
const subnetList = _.map(this.awsFacts.availableSubnets, sn => {
const friendlyName = _getFriendlyNameFromTag(sn);
const formattedFriendlyName = friendlyName ? `name: '${friendlyName}', ` : '';
return... | javascript | function askForSubnets() {
if (this.abort) return null;
const done = this.async();
const subnetList = _.map(this.awsFacts.availableSubnets, sn => {
const friendlyName = _getFriendlyNameFromTag(sn);
const formattedFriendlyName = friendlyName ? `name: '${friendlyName}', ` : '';
return... | [
"function",
"askForSubnets",
"(",
")",
"{",
"if",
"(",
"this",
".",
"abort",
")",
"return",
"null",
";",
"const",
"done",
"=",
"this",
".",
"async",
"(",
")",
";",
"const",
"subnetList",
"=",
"_",
".",
"map",
"(",
"this",
".",
"awsFacts",
".",
"ava... | Ask user to select availability information (availability, zones)/ | [
"Ask",
"user",
"to",
"select",
"availability",
"information",
"(",
"availability",
"zones",
")",
"/"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/aws-containers/prompts.js#L386-L449 | train | Ask For Subnets | [
30522,
3853,
3198,
29278,
6342,
24700,
8454,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
11113,
11589,
1007,
2709,
19701,
1025,
9530,
3367,
2589,
1027,
2023,
1012,
2004,
6038,
2278,
1006,
1007,
1025,
9530,
3367,
4942,
7159,
9863,
1027,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/toolbars.js | locationBar_getElement | function locationBar_getElement(spec) {
var elem = null;
switch(spec.type) {
/**
* subtype: subtype to match
* value: value to match
*/
case "contextMenu":
elem = new elementslib.Lookup(this._controller.window.document, CONTEXT_MENU);
break;
case "contextM... | javascript | function locationBar_getElement(spec) {
var elem = null;
switch(spec.type) {
/**
* subtype: subtype to match
* value: value to match
*/
case "contextMenu":
elem = new elementslib.Lookup(this._controller.window.document, CONTEXT_MENU);
break;
case "contextM... | [
"function",
"locationBar_getElement",
"(",
"spec",
")",
"{",
"var",
"elem",
"=",
"null",
";",
"switch",
"(",
"spec",
".",
"type",
")",
"{",
"/**\n * subtype: subtype to match\n * value: value to match\n */",
"case",
"\"contextMenu\"",
":",
"elem",
"=",... | Retrieve an UI element based on the given spec
@param {object} spec
Information of the UI element which should be retrieved
type: General type information
subtype: Specific element or property
value: Value of the element or property
@returns Element which has been created
@type ElemBase | [
"Retrieve",
"an",
"UI",
"element",
"based",
"on",
"the",
"given",
"spec"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/toolbars.js#L373-L426 | train | Returns the element that matches the spec | [
30522,
3853,
3295,
8237,
1035,
2131,
12260,
3672,
1006,
28699,
1007,
1063,
13075,
3449,
6633,
1027,
19701,
1025,
6942,
1006,
28699,
1012,
2828,
1007,
1063,
1013,
1008,
1008,
1008,
4942,
13874,
1024,
4942,
13874,
2000,
2674,
1008,
3643,
1024... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js | debug | function debug(oElement) {
if (bDebug) {
Log.debug(
getNestingLevel() + Array.prototype.slice.call(arguments, 1).join(" "),
oElement && serializeSingleElement(oElement), sXMLPreprocessor);
}
} | javascript | function debug(oElement) {
if (bDebug) {
Log.debug(
getNestingLevel() + Array.prototype.slice.call(arguments, 1).join(" "),
oElement && serializeSingleElement(oElement), sXMLPreprocessor);
}
} | [
"function",
"debug",
"(",
"oElement",
")",
"{",
"if",
"(",
"bDebug",
")",
"{",
"Log",
".",
"debug",
"(",
"getNestingLevel",
"(",
")",
"+",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
".",
"join",
"(",
"\" ... | /*
Outputs a debug message with the current nesting level; takes care not to construct
the message or serialize XML in vain.
@param {Element} [oElement]
any XML DOM element which is serialized to the details
@param {...string} aTexts
the main text of the message is constructed from the rest of the arguments by
joining... | [
"/",
"*",
"Outputs",
"a",
"debug",
"message",
"with",
"the",
"current",
"nesting",
"level",
";",
"takes",
"care",
"not",
"to",
"construct",
"the",
"message",
"or",
"serialize",
"XML",
"in",
"vain",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L935-L941 | train | Log debug information | [
30522,
3853,
2139,
8569,
2290,
1006,
1051,
12260,
3672,
1007,
1063,
2065,
1006,
1038,
3207,
8569,
2290,
1007,
1063,
8833,
1012,
2139,
8569,
2290,
1006,
2131,
5267,
3436,
20414,
2884,
1006,
1007,
1009,
9140,
1012,
8773,
1012,
14704,
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... |
tgriesser/knex | src/migrate/MigrationGenerator.js | yyyymmddhhmmss | function yyyymmddhhmmss() {
const d = new Date();
return (
d.getFullYear().toString() +
padDate(d.getMonth() + 1) +
padDate(d.getDate()) +
padDate(d.getHours()) +
padDate(d.getMinutes()) +
padDate(d.getSeconds())
);
} | javascript | function yyyymmddhhmmss() {
const d = new Date();
return (
d.getFullYear().toString() +
padDate(d.getMonth() + 1) +
padDate(d.getDate()) +
padDate(d.getHours()) +
padDate(d.getMinutes()) +
padDate(d.getSeconds())
);
} | [
"function",
"yyyymmddhhmmss",
"(",
")",
"{",
"const",
"d",
"=",
"new",
"Date",
"(",
")",
";",
"return",
"(",
"d",
".",
"getFullYear",
"(",
")",
".",
"toString",
"(",
")",
"+",
"padDate",
"(",
"d",
".",
"getMonth",
"(",
")",
"+",
"1",
")",
"+",
... | Get a date object in the correct format, without requiring a full out library like "moment.js". | [
"Get",
"a",
"date",
"object",
"in",
"the",
"correct",
"format",
"without",
"requiring",
"a",
"full",
"out",
"library",
"like",
"moment",
".",
"js",
"."
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/migrate/MigrationGenerator.js#L87-L97 | train | Returns the date string | [
30522,
3853,
1061,
2100,
2100,
24335,
26876,
16425,
14227,
5244,
2015,
1006,
1007,
1063,
9530,
3367,
1040,
1027,
2047,
3058,
1006,
1007,
1025,
2709,
1006,
1040,
1012,
2131,
7699,
14644,
1006,
1007,
1012,
2000,
3367,
4892,
1006,
1007,
1009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
caolan/async | lib/race.js | race | function race(tasks, callback) {
callback = once(callback);
if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));
if (!tasks.length) return callback();
for (var i = 0, l = tasks.length; i < l; i++) {
wrapAsync(tasks[i])(callback);
... | javascript | function race(tasks, callback) {
callback = once(callback);
if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));
if (!tasks.length) return callback();
for (var i = 0, l = tasks.length; i < l; i++) {
wrapAsync(tasks[i])(callback);
... | [
"function",
"race",
"(",
"tasks",
",",
"callback",
")",
"{",
"callback",
"=",
"once",
"(",
"callback",
")",
";",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"tasks",
")",
")",
"return",
"callback",
"(",
"new",
"TypeError",
"(",
"'First argument to race... | Runs the `tasks` array of functions in parallel, without waiting until the
previous function has completed. Once any of the `tasks` complete or pass an
error to its callback, the main `callback` is immediately called. It's
equivalent to `Promise.race()`.
@name race
@static
@memberOf module:ControlFlow
@method
@categor... | [
"Runs",
"the",
"tasks",
"array",
"of",
"functions",
"in",
"parallel",
"without",
"waiting",
"until",
"the",
"previous",
"function",
"has",
"completed",
".",
"Once",
"any",
"of",
"the",
"tasks",
"complete",
"or",
"pass",
"an",
"error",
"to",
"its",
"callback"... | 4330d536c106592139fa82062494c9dba0da1fdb | https://github.com/caolan/async/blob/4330d536c106592139fa82062494c9dba0da1fdb/lib/race.js#L41-L48 | train | Race the tasks | [
30522,
3853,
2679,
1006,
8518,
1010,
2655,
5963,
1007,
1063,
2655,
5963,
1027,
2320,
1006,
2655,
5963,
1007,
1025,
2065,
1006,
999,
9140,
1012,
18061,
11335,
2100,
1006,
8518,
1007,
1007,
2709,
2655,
5963,
1006,
2047,
2828,
2121,
29165,
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... |
benweet/stackedit | src/libs/htmlSanitizer.js | htmlParser | function htmlParser(html, handler) {
if (typeof html !== 'string') {
if (html === null || typeof html === 'undefined') {
html = '';
} else {
html = '' + html;
}
}
var index, chars, match, stack = [],
last = html,
text;
stack.last = function () {
return stack[stack.length - 1]... | javascript | function htmlParser(html, handler) {
if (typeof html !== 'string') {
if (html === null || typeof html === 'undefined') {
html = '';
} else {
html = '' + html;
}
}
var index, chars, match, stack = [],
last = html,
text;
stack.last = function () {
return stack[stack.length - 1]... | [
"function",
"htmlParser",
"(",
"html",
",",
"handler",
")",
"{",
"if",
"(",
"typeof",
"html",
"!==",
"'string'",
")",
"{",
"if",
"(",
"html",
"===",
"null",
"||",
"typeof",
"html",
"===",
"'undefined'",
")",
"{",
"html",
"=",
"''",
";",
"}",
"else",
... | @example
htmlParser(htmlString, {
start: function(tag, attrs, unary) {},
end: function(tag) {},
chars: function(text) {},
comment: function(text) {}
});
@param {string} html string
@param {object} handler | [
"@example",
"htmlParser",
"(",
"htmlString",
"{",
"start",
":",
"function",
"(",
"tag",
"attrs",
"unary",
")",
"{}",
"end",
":",
"function",
"(",
"tag",
")",
"{}",
"chars",
":",
"function",
"(",
"text",
")",
"{}",
"comment",
":",
"function",
"(",
"text... | 91f8cf3c10b75df65b69f9181cee8151d65a788d | https://github.com/benweet/stackedit/blob/91f8cf3c10b75df65b69f9181cee8151d65a788d/src/libs/htmlSanitizer.js#L150-L307 | train | Parses the given HTML string. | [
30522,
3853,
16129,
19362,
8043,
1006,
16129,
1010,
28213,
1007,
1063,
2065,
1006,
2828,
11253,
16129,
999,
1027,
1027,
1005,
5164,
1005,
1007,
1063,
2065,
1006,
16129,
1027,
1027,
1027,
19701,
1064,
1064,
2828,
11253,
16129,
30524,
1033,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | src/core/core.tooltip.js | getBackgroundPoint | function getBackgroundPoint(vm, size, alignment, chart) {
// Background Position
var x = vm.x;
var y = vm.y;
var caretSize = vm.caretSize;
var caretPadding = vm.caretPadding;
var cornerRadius = vm.cornerRadius;
var xAlign = alignment.xAlign;
var yAlign = alignment.yAlign;
var paddingAndSize = caretSize + care... | javascript | function getBackgroundPoint(vm, size, alignment, chart) {
// Background Position
var x = vm.x;
var y = vm.y;
var caretSize = vm.caretSize;
var caretPadding = vm.caretPadding;
var cornerRadius = vm.cornerRadius;
var xAlign = alignment.xAlign;
var yAlign = alignment.yAlign;
var paddingAndSize = caretSize + care... | [
"function",
"getBackgroundPoint",
"(",
"vm",
",",
"size",
",",
"alignment",
",",
"chart",
")",
"{",
"// Background Position",
"var",
"x",
"=",
"vm",
".",
"x",
";",
"var",
"y",
"=",
"vm",
".",
"y",
";",
"var",
"caretSize",
"=",
"vm",
".",
"caretSize",
... | Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment | [
"Helper",
"to",
"get",
"the",
"location",
"a",
"tooltip",
"needs",
"to",
"be",
"placed",
"at",
"given",
"the",
"initial",
"position",
"(",
"via",
"the",
"vm",
")",
"and",
"the",
"size",
"and",
"alignment"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/core/core.tooltip.js#L427-L476 | train | Get background position | [
30522,
3853,
2131,
5963,
16365,
8400,
1006,
1058,
2213,
1010,
2946,
1010,
12139,
1010,
3673,
1007,
1063,
1013,
1013,
4281,
2597,
13075,
1060,
1027,
1058,
2213,
1012,
1060,
1025,
13075,
1061,
1027,
1058,
2213,
1012,
1061,
1025,
13075,
2729,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
juliangarnier/anime | lib/anime.js | steps | function steps(steps) {
if ( steps === void 0 ) steps = 10;
return function (t) { return Math.round(t * steps) * (1 / steps); };
} | javascript | function steps(steps) {
if ( steps === void 0 ) steps = 10;
return function (t) { return Math.round(t * steps) * (1 / steps); };
} | [
"function",
"steps",
"(",
"steps",
")",
"{",
"if",
"(",
"steps",
"===",
"void",
"0",
")",
"steps",
"=",
"10",
";",
"return",
"function",
"(",
"t",
")",
"{",
"return",
"Math",
".",
"round",
"(",
"t",
"*",
"steps",
")",
"*",
"(",
"1",
"/",
"steps... | Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function | [
"Basic",
"steps",
"easing",
"implementation",
"https",
":",
"//",
"developer",
".",
"mozilla",
".",
"org",
"/",
"fr",
"/",
"docs",
"/",
"Web",
"/",
"CSS",
"/",
"transition",
"-",
"timing",
"-",
"function"
] | 875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a | https://github.com/juliangarnier/anime/blob/875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a/lib/anime.js#L148-L152 | train | Returns a function that will return a function that will return a number of steps | [
30522,
3853,
4084,
1006,
4084,
1007,
1063,
2065,
1006,
4084,
1027,
1027,
1027,
11675,
1014,
1007,
4084,
1027,
2184,
1025,
2709,
3853,
1006,
1056,
1007,
1063,
2709,
8785,
1012,
2461,
1006,
1056,
1008,
4084,
1007,
1008,
1006,
1015,
1013,
40... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/interfaces/interfaces.js | showInterfaceJavaScriptMethod | function showInterfaceJavaScriptMethod(intf, method, html) {
var line = ""
line += "\n//-----------------------------------------------------------------------------"
line += "\n<span class='methodName'>method " + method.name + "</span>(" + getJavaScriptParameterListSimple(method.parameters, method.returns... | javascript | function showInterfaceJavaScriptMethod(intf, method, html) {
var line = ""
line += "\n//-----------------------------------------------------------------------------"
line += "\n<span class='methodName'>method " + method.name + "</span>(" + getJavaScriptParameterListSimple(method.parameters, method.returns... | [
"function",
"showInterfaceJavaScriptMethod",
"(",
"intf",
",",
"method",
",",
"html",
")",
"{",
"var",
"line",
"=",
"\"\"",
"line",
"+=",
"\"\\n//-----------------------------------------------------------------------------\"",
"line",
"+=",
"\"\\n<span class='methodName'>metho... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/interfaces/interfaces.js#L288-L297 | train | showInterfaceJavaScriptMethod - Show a method in the given interface | [
30522,
3853,
2265,
18447,
2121,
12172,
3900,
12044,
23235,
11368,
6806,
2094,
1006,
20014,
2546,
1010,
4118,
1010,
16129,
1007,
1063,
13075,
2240,
1027,
1000,
1000,
2240,
1009,
1027,
1000,
1032,
1050,
1013,
1013,
1011,
1011,
1011,
1011,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wangfupeng1988/wangEditor | src/js/menus/panel.js | function () {
if (!_isCreatedPanelMenus.length) {
return
}
_isCreatedPanelMenus.forEach(menu => {
const panel = menu.panel || {}
if (panel.hide) {
panel.hide()
}
})
} | javascript | function () {
if (!_isCreatedPanelMenus.length) {
return
}
_isCreatedPanelMenus.forEach(menu => {
const panel = menu.panel || {}
if (panel.hide) {
panel.hide()
}
})
} | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"_isCreatedPanelMenus",
".",
"length",
")",
"{",
"return",
"}",
"_isCreatedPanelMenus",
".",
"forEach",
"(",
"menu",
"=>",
"{",
"const",
"panel",
"=",
"menu",
".",
"panel",
"||",
"{",
"}",
"if",
"(",
"panel",
... | 一个 panel 展示时,隐藏其他 panel | [
"一个",
"panel",
"展示时,隐藏其他",
"panel"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/menus/panel.js#L182-L192 | train | hide all the pages | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
999,
1035,
2003,
16748,
4383,
9739,
2884,
3549,
2271,
1012,
3091,
1007,
1063,
2709,
1065,
1035,
2003,
16748,
4383,
9739,
2884,
3549,
2271,
1012,
18921,
6776,
1006,
12183,
1027,
1028,
1063,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js | function (oPathValue) {
var oRawValue = oPathValue.value,
oSubPathValue = oPathValue,
sType;
if (oRawValue === null) {
sType = "Null";
} else if (typeof oRawValue === "boolean") {
sType = "Bool";
} else if (typeof oRawValue === "number") {
sType = isFinite(oRawValue) && Math.floor(oRawV... | javascript | function (oPathValue) {
var oRawValue = oPathValue.value,
oSubPathValue = oPathValue,
sType;
if (oRawValue === null) {
sType = "Null";
} else if (typeof oRawValue === "boolean") {
sType = "Bool";
} else if (typeof oRawValue === "number") {
sType = isFinite(oRawValue) && Math.floor(oRawV... | [
"function",
"(",
"oPathValue",
")",
"{",
"var",
"oRawValue",
"=",
"oPathValue",
".",
"value",
",",
"oSubPathValue",
"=",
"oPathValue",
",",
"sType",
";",
"if",
"(",
"oRawValue",
"===",
"null",
")",
"{",
"sType",
"=",
"\"Null\"",
";",
"}",
"else",
"if",
... | Calculates an expression.
@param {object} oPathValue
path and value information pointing to the expression (see Expression object)
@returns {sap.ui.base.SyncPromise}
a sync promise which resolves with the result object or is rejected with an error | [
"Calculates",
"an",
"expression",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js#L336-L414 | train | Returns an object literal that represents the value of the node in the path. | [
30522,
3853,
1006,
6728,
8988,
10175,
5657,
1007,
1063,
13075,
2030,
10376,
10175,
5657,
1027,
6728,
8988,
10175,
5657,
1012,
3643,
1010,
9808,
12083,
15069,
10175,
5657,
1027,
6728,
8988,
10175,
5657,
1010,
2358,
18863,
1025,
2065,
1006,
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... | |
SeleniumHQ/selenium | javascript/node/selenium-webdriver/http/util.js | getStatus | function getStatus(url) {
var client = new HttpClient(url);
var executor = new Executor(client);
var command = new Command(CommandName.GET_SERVER_STATUS);
return executor.execute(command);
} | javascript | function getStatus(url) {
var client = new HttpClient(url);
var executor = new Executor(client);
var command = new Command(CommandName.GET_SERVER_STATUS);
return executor.execute(command);
} | [
"function",
"getStatus",
"(",
"url",
")",
"{",
"var",
"client",
"=",
"new",
"HttpClient",
"(",
"url",
")",
";",
"var",
"executor",
"=",
"new",
"Executor",
"(",
"client",
")",
";",
"var",
"command",
"=",
"new",
"Command",
"(",
"CommandName",
".",
"GET_S... | Queries a WebDriver server for its current status.
@param {string} url Base URL of the server to query.
@return {!Promise<!Object>} A promise that resolves with
a hash of the server status. | [
"Queries",
"a",
"WebDriver",
"server",
"for",
"its",
"current",
"status",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/http/util.js#L39-L44 | train | Get server status | [
30522,
3853,
4152,
29336,
2271,
1006,
24471,
2140,
1007,
1063,
13075,
7396,
30524,
18442,
1012,
2131,
1035,
8241,
1035,
3570,
1007,
1025,
2709,
4654,
8586,
16161,
2099,
1012,
15389,
1006,
3094,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/config/config-initializer.js | getLocalESLintVersion | function getLocalESLintVersion() {
try {
const eslintPath = relativeModuleResolver("eslint", path.join(process.cwd(), "__placeholder__.js"));
const eslint = require(eslintPath);
return eslint.linter.version || null;
} catch (_err) {
return null;
}
} | javascript | function getLocalESLintVersion() {
try {
const eslintPath = relativeModuleResolver("eslint", path.join(process.cwd(), "__placeholder__.js"));
const eslint = require(eslintPath);
return eslint.linter.version || null;
} catch (_err) {
return null;
}
} | [
"function",
"getLocalESLintVersion",
"(",
")",
"{",
"try",
"{",
"const",
"eslintPath",
"=",
"relativeModuleResolver",
"(",
"\"eslint\"",
",",
"path",
".",
"join",
"(",
"process",
".",
"cwd",
"(",
")",
",",
"\"__placeholder__.js\"",
")",
")",
";",
"const",
"e... | Get the version of the local ESLint.
@returns {string|null} The version. If the local ESLint was not found, returns null. | [
"Get",
"the",
"version",
"of",
"the",
"local",
"ESLint",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-initializer.js#L335-L344 | train | Get the local version of the eslint module | [
30522,
3853,
2131,
4135,
9289,
2229,
4115,
9189,
2545,
3258,
1006,
1007,
1063,
3046,
1063,
9530,
3367,
9686,
4115,
25856,
8988,
1027,
5816,
5302,
8566,
3917,
2229,
4747,
6299,
1006,
1000,
9686,
4115,
2102,
1000,
1010,
4130,
1012,
3693,
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... |
elastic/elasticsearch-js | api/api/tasks.list.js | buildTasksList | function buildTasksList (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [tasks.list](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
*
* @param {list} nodes - A comma-separat... | javascript | function buildTasksList (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [tasks.list](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
*
* @param {list} nodes - A comma-separat... | [
"function",
"buildTasksList",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [tasks.list](http://www.elastic.co/guide/e... | /* 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/tasks.list.js#L25-L115 | train | Build a task list | [
30522,
3853,
3857,
10230,
5705,
9863,
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,
29165... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hakimel/reveal.js | plugin/notes-server/client.js | post | function post() {
var slideElement = Reveal.getCurrentSlide(),
notesElement = slideElement.querySelector( 'aside.notes' );
var messageData = {
notes: '',
markdown: false,
socketId: socketId,
state: Reveal.getState()
};
// Look for notes defined in a slide attribute
if( slideElement.hasAttrib... | javascript | function post() {
var slideElement = Reveal.getCurrentSlide(),
notesElement = slideElement.querySelector( 'aside.notes' );
var messageData = {
notes: '',
markdown: false,
socketId: socketId,
state: Reveal.getState()
};
// Look for notes defined in a slide attribute
if( slideElement.hasAttrib... | [
"function",
"post",
"(",
")",
"{",
"var",
"slideElement",
"=",
"Reveal",
".",
"getCurrentSlide",
"(",
")",
",",
"notesElement",
"=",
"slideElement",
".",
"querySelector",
"(",
"'aside.notes'",
")",
";",
"var",
"messageData",
"=",
"{",
"notes",
":",
"''",
"... | Posts the current slide data to the notes window | [
"Posts",
"the",
"current",
"slide",
"data",
"to",
"the",
"notes",
"window"
] | 33bed47daca3f08c396215415e6ece005970734a | https://github.com/hakimel/reveal.js/blob/33bed47daca3f08c396215415e6ece005970734a/plugin/notes-server/client.js#L16-L41 | train | Post the notes to the server | [
30522,
3853,
2695,
1006,
1007,
1063,
13075,
7358,
12260,
3672,
1027,
30524,
4998,
1012,
3964,
1005,
1007,
1025,
13075,
4471,
2850,
2696,
1027,
1063,
3964,
1024,
1005,
1005,
1010,
2928,
7698,
1024,
6270,
1010,
22278,
3593,
1024,
22278,
3593,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FindUtils.js | parseDollars | function parseDollars(replaceWith, match) {
replaceWith = replaceWith.replace(/(\$+)(\d{1,2}|&)/g, function (whole, dollars, index) {
if (dollars.length % 2 === 1) { // make sure dollar signs don't escape themselves (like $$1, $$$$&)
if (index === "&") { // handle $&
... | javascript | function parseDollars(replaceWith, match) {
replaceWith = replaceWith.replace(/(\$+)(\d{1,2}|&)/g, function (whole, dollars, index) {
if (dollars.length % 2 === 1) { // make sure dollar signs don't escape themselves (like $$1, $$$$&)
if (index === "&") { // handle $&
... | [
"function",
"parseDollars",
"(",
"replaceWith",
",",
"match",
")",
"{",
"replaceWith",
"=",
"replaceWith",
".",
"replace",
"(",
"/",
"(\\$+)(\\d{1,2}|&)",
"/",
"g",
",",
"function",
"(",
"whole",
",",
"dollars",
",",
"index",
")",
"{",
"if",
"(",
"dollars"... | Given a replace string that contains $-expressions, replace them with data from the given
regexp match info.
NOTE: we can't just use the ordinary replace() function here because the string has been
extracted from the original text and so might be missing some context that the regexp matched.
@param {string} replaceWith... | [
"Given",
"a",
"replace",
"string",
"that",
"contains",
"$",
"-",
"expressions",
"replace",
"them",
"with",
"data",
"from",
"the",
"given",
"regexp",
"match",
"info",
".",
"NOTE",
":",
"we",
"can",
"t",
"just",
"use",
"the",
"ordinary",
"replace",
"()",
"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L80-L103 | train | parse the dollars | [
30522,
3853,
11968,
6924,
14511,
11650,
1006,
5672,
24415,
1010,
2674,
1007,
1063,
5672,
24415,
1027,
5672,
24415,
1012,
5672,
1006,
1013,
1006,
1032,
1002,
1009,
1007,
1006,
1032,
1040,
1063,
1015,
1010,
1016,
1065,
1064,
1004,
1007,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js | function(string) {
var translated = Documentation.TRANSLATIONS[string];
if (typeof translated == 'undefined')
return string;
return (typeof translated == 'string') ? translated : translated[0];
} | javascript | function(string) {
var translated = Documentation.TRANSLATIONS[string];
if (typeof translated == 'undefined')
return string;
return (typeof translated == 'string') ? translated : translated[0];
} | [
"function",
"(",
"string",
")",
"{",
"var",
"translated",
"=",
"Documentation",
".",
"TRANSLATIONS",
"[",
"string",
"]",
";",
"if",
"(",
"typeof",
"translated",
"==",
"'undefined'",
")",
"return",
"string",
";",
"return",
"(",
"typeof",
"translated",
"==",
... | gettext and ngettext don't access this so that the functions can safely bound to a different name (_ = Documentation.gettext) | [
"gettext",
"and",
"ngettext",
"don",
"t",
"access",
"this",
"so",
"that",
"the",
"functions",
"can",
"safely",
"bound",
"to",
"a",
"different",
"name",
"(",
"_",
"=",
"Documentation",
".",
"gettext",
")"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js#L126-L131 | train | Returns the first non - empty string in the sequence of words | [
30522,
3853,
1006,
5164,
1007,
1063,
13075,
5421,
1027,
12653,
1012,
11913,
1031,
5164,
1033,
1025,
2065,
1006,
2828,
11253,
5421,
1027,
1027,
1005,
6151,
28344,
1005,
1007,
2709,
5164,
1025,
2709,
1006,
2828,
11253,
5421,
1027,
1027,
1005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ColorlibHQ/AdminLTE | bower_components/ion.rangeSlider/js/ion.rangeSlider.js | function (right) {
var p = this.coords.p_pointer;
var p_step = (this.options.max - this.options.min) / 100;
p_step = this.options.step / p_step;
if (right) {
p += p_step;
} else {
p -= p_step;
}
this.co... | javascript | function (right) {
var p = this.coords.p_pointer;
var p_step = (this.options.max - this.options.min) / 100;
p_step = this.options.step / p_step;
if (right) {
p += p_step;
} else {
p -= p_step;
}
this.co... | [
"function",
"(",
"right",
")",
"{",
"var",
"p",
"=",
"this",
".",
"coords",
".",
"p_pointer",
";",
"var",
"p_step",
"=",
"(",
"this",
".",
"options",
".",
"max",
"-",
"this",
".",
"options",
".",
"min",
")",
"/",
"100",
";",
"p_step",
"=",
"this"... | Move by key
@param right {boolean} direction to move | [
"Move",
"by",
"key"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/ion.rangeSlider/js/ion.rangeSlider.js#L921-L935 | train | set right | [
30522,
3853,
1006,
2157,
1007,
1063,
13075,
1052,
1027,
2023,
1012,
2522,
8551,
2015,
1012,
1052,
1035,
20884,
1025,
13075,
1052,
1035,
3357,
1027,
1006,
2023,
1012,
7047,
1012,
4098,
1011,
2023,
1012,
7047,
1012,
8117,
1007,
1013,
2531,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
tgriesser/knex | src/query/joinclause.js | JoinClause | function JoinClause(table, type, schema) {
this.schema = schema;
this.table = table;
this.joinType = type;
this.and = this;
this.clauses = [];
} | javascript | function JoinClause(table, type, schema) {
this.schema = schema;
this.table = table;
this.joinType = type;
this.and = this;
this.clauses = [];
} | [
"function",
"JoinClause",
"(",
"table",
",",
"type",
",",
"schema",
")",
"{",
"this",
".",
"schema",
"=",
"schema",
";",
"this",
".",
"table",
"=",
"table",
";",
"this",
".",
"joinType",
"=",
"type",
";",
"this",
".",
"and",
"=",
"this",
";",
"this... | The "JoinClause" is an object holding any necessary info about a join, including the type, and any associated tables & columns being joined. | [
"The",
"JoinClause",
"is",
"an",
"object",
"holding",
"any",
"necessary",
"info",
"about",
"a",
"join",
"including",
"the",
"type",
"and",
"any",
"associated",
"tables",
"&",
"columns",
"being",
"joined",
"."
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/query/joinclause.js#L9-L15 | train | A join clause | [
30522,
3853,
3693,
20464,
20559,
2063,
1006,
2795,
1010,
2828,
1010,
8040,
28433,
1007,
1063,
2023,
1012,
8040,
28433,
1027,
8040,
28433,
1025,
2023,
1012,
2795,
1027,
2795,
1025,
2023,
1012,
4101,
18863,
1027,
2828,
1025,
2023,
1012,
1998,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
grpc/grpc-node | packages/grpc-native-core/src/client_interceptors.js | _buildChain | function _buildChain(interceptors, options) {
var next = function(interceptors) {
if (interceptors.length === 0) {
return function (options) {};
}
var head_interceptor = interceptors[0];
var rest_interceptors = interceptors.slice(1);
return function (options) {
return head_interceptor(... | javascript | function _buildChain(interceptors, options) {
var next = function(interceptors) {
if (interceptors.length === 0) {
return function (options) {};
}
var head_interceptor = interceptors[0];
var rest_interceptors = interceptors.slice(1);
return function (options) {
return head_interceptor(... | [
"function",
"_buildChain",
"(",
"interceptors",
",",
"options",
")",
"{",
"var",
"next",
"=",
"function",
"(",
"interceptors",
")",
"{",
"if",
"(",
"interceptors",
".",
"length",
"===",
"0",
")",
"{",
"return",
"function",
"(",
"options",
")",
"{",
"}",
... | Chain a list of interceptors together and return the first InterceptingCall.
@private
@param {Interceptor[]} interceptors An interceptor stack.
@param {grpc.Client~CallOptions} options Call options.
@return {InterceptingCall} | [
"Chain",
"a",
"list",
"of",
"interceptors",
"together",
"and",
"return",
"the",
"first",
"InterceptingCall",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/client_interceptors.js#L1389-L1402 | train | Build a chain of interceptors | [
30522,
3853,
1035,
3857,
24925,
2078,
1006,
24727,
2015,
1010,
7047,
1007,
1063,
13075,
2279,
1027,
3853,
1006,
24727,
2015,
1007,
1063,
2065,
1006,
24727,
2015,
1012,
3091,
1027,
1027,
1027,
1014,
1007,
1063,
2709,
3853,
1006,
7047,
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... |
jgraph/mxgraph | javascript/mxClient.js | function(element)
{
mxEvent.addListener(element, 'contextmenu', function(evt)
{
if (evt.preventDefault)
{
evt.preventDefault();
}
return false;
});
} | javascript | function(element)
{
mxEvent.addListener(element, 'contextmenu', function(evt)
{
if (evt.preventDefault)
{
evt.preventDefault();
}
return false;
});
} | [
"function",
"(",
"element",
")",
"{",
"mxEvent",
".",
"addListener",
"(",
"element",
",",
"'contextmenu'",
",",
"function",
"(",
"evt",
")",
"{",
"if",
"(",
"evt",
".",
"preventDefault",
")",
"{",
"evt",
".",
"preventDefault",
"(",
")",
";",
"}",
"retu... | Function: disableContextMenu
Disables the context menu for the given element. | [
"Function",
":",
"disableContextMenu"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L9785-L9796 | train | Add a contextmenu listener to the element | [
30522,
3853,
1006,
5783,
1007,
1063,
25630,
18697,
3372,
1012,
5587,
9863,
24454,
1006,
5783,
1010,
1005,
6123,
3549,
2226,
1005,
1010,
3853,
1006,
23408,
2102,
1007,
30524,
1065,
2709,
6270,
1025,
1065,
1007,
1025,
1065,
102,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
facebook/relay | packages/relay-compiler/util/areEqualOSS.js | areEqual | function areEqual(a: any, b: any): boolean {
const aStack = aStackPool.length ? aStackPool.pop() : [];
const bStack = bStackPool.length ? bStackPool.pop() : [];
const result = eq(a, b, aStack, bStack);
aStack.length = 0;
bStack.length = 0;
aStackPool.push(aStack);
bStackPool.push(bStack);
return result;... | javascript | function areEqual(a: any, b: any): boolean {
const aStack = aStackPool.length ? aStackPool.pop() : [];
const bStack = bStackPool.length ? bStackPool.pop() : [];
const result = eq(a, b, aStack, bStack);
aStack.length = 0;
bStack.length = 0;
aStackPool.push(aStack);
bStackPool.push(bStack);
return result;... | [
"function",
"areEqual",
"(",
"a",
":",
"any",
",",
"b",
":",
"any",
")",
":",
"boolean",
"{",
"const",
"aStack",
"=",
"aStackPool",
".",
"length",
"?",
"aStackPool",
".",
"pop",
"(",
")",
":",
"[",
"]",
";",
"const",
"bStack",
"=",
"bStackPool",
".... | Checks if two values are equal. Values may be primitives, arrays, or objects.
Returns true if both arguments have the same keys and values.
@see http://underscorejs.org
@copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
@license MIT | [
"Checks",
"if",
"two",
"values",
"are",
"equal",
".",
"Values",
"may",
"be",
"primitives",
"arrays",
"or",
"objects",
".",
"Returns",
"true",
"if",
"both",
"arguments",
"have",
"the",
"same",
"keys",
"and",
"values",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/util/areEqualOSS.js#L23-L32 | train | A is equal to b | [
30522,
3853,
2024,
2063,
26426,
1006,
1037,
1024,
2151,
1010,
1038,
1024,
2151,
1007,
1024,
22017,
20898,
1063,
9530,
3367,
2004,
2696,
3600,
1027,
2004,
2696,
3600,
16869,
1012,
3091,
1029,
2004,
2696,
3600,
16869,
1012,
3769,
1006,
30524,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
google/closure-library | closure/goog/html/sanitizer/noclobber.js | genericMethodCall | function genericMethodCall(fn, object, fallbackMethodName, args) {
if (fn) {
return fn.apply(object, args);
}
// IE8 and IE9 will return 'object' for
// CSSStyleDeclaration.(get|set)Attribute, so we can't use typeof.
if (userAgentProduct.IE && document.documentMode < 10) {
if (!object[fallbackMethodNa... | javascript | function genericMethodCall(fn, object, fallbackMethodName, args) {
if (fn) {
return fn.apply(object, args);
}
// IE8 and IE9 will return 'object' for
// CSSStyleDeclaration.(get|set)Attribute, so we can't use typeof.
if (userAgentProduct.IE && document.documentMode < 10) {
if (!object[fallbackMethodNa... | [
"function",
"genericMethodCall",
"(",
"fn",
",",
"object",
",",
"fallbackMethodName",
",",
"args",
")",
"{",
"if",
"(",
"fn",
")",
"{",
"return",
"fn",
".",
"apply",
"(",
"object",
",",
"args",
")",
";",
"}",
"// IE8 and IE9 will return 'object' for",
"// CS... | Calls the provided DOM prototype method and returns its result. If the
method is not available, use fallbackMethodName to call the method in a
clobber-vulnerable way, and use fallbackTest to check if the
method was clobbered, throwing an exception if so.
@param {?Function} fn
@param {*} object
@param {string} fallbackM... | [
"Calls",
"the",
"provided",
"DOM",
"prototype",
"method",
"and",
"returns",
"its",
"result",
".",
"If",
"the",
"method",
"is",
"not",
"available",
"use",
"fallbackMethodName",
"to",
"call",
"the",
"method",
"in",
"a",
"clobber",
"-",
"vulnerable",
"way",
"an... | 97390e9ca4483cebb9628e06026139fbb3023d65 | https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/closure/goog/html/sanitizer/noclobber.js#L145-L159 | train | Generic method call | [
30522,
3853,
12391,
11368,
6806,
16409,
8095,
1006,
1042,
2078,
1010,
4874,
1010,
2991,
5963,
11368,
6806,
28911,
4168,
1010,
12098,
5620,
1007,
1063,
2065,
1006,
1042,
2078,
1007,
1063,
2709,
1042,
2078,
1012,
6611,
1006,
4874,
1010,
12098... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/delegate/ScrollEnablement.js | initDelegateMembers | function initDelegateMembers(oScrollerInstance) {
var oDelegateMembers = {
_init : function(oControl, sScrollContentDom, oConfig) {
// default scroll supression threshold of jQuery mobile is too small and prevent native scrolling
if (jQuery.event && jQuery.event.special && jQuery.event.special.swipe &&... | javascript | function initDelegateMembers(oScrollerInstance) {
var oDelegateMembers = {
_init : function(oControl, sScrollContentDom, oConfig) {
// default scroll supression threshold of jQuery mobile is too small and prevent native scrolling
if (jQuery.event && jQuery.event.special && jQuery.event.special.swipe &&... | [
"function",
"initDelegateMembers",
"(",
"oScrollerInstance",
")",
"{",
"var",
"oDelegateMembers",
"=",
"{",
"_init",
":",
"function",
"(",
"oControl",
",",
"sScrollContentDom",
",",
"oConfig",
")",
"{",
"// default scroll supression threshold of jQuery mobile is too small a... | /*
Init delegator prototype according to various conditions. | [
"/",
"*",
"Init",
"delegator",
"prototype",
"according",
"to",
"various",
"conditions",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/delegate/ScrollEnablement.js#L718-L746 | train | Initializes the delegate members | [
30522,
3853,
1999,
4183,
9247,
29107,
18532,
6633,
17198,
1006,
9808,
26775,
14511,
23282,
12693,
3401,
1007,
1063,
13075,
24040,
23115,
3686,
4168,
21784,
2015,
1027,
1063,
1035,
1999,
4183,
1024,
3853,
1006,
1051,
8663,
13181,
2140,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/progressLinear/progress-linear.js | mode | function mode() {
var value = (attr.mdMode || "").trim();
if (value) {
switch (value) {
case MODE_DETERMINATE:
case MODE_INDETERMINATE:
case MODE_BUFFER:
case MODE_QUERY:
break;
default:
value = MODE_INDETERMINATE;
... | javascript | function mode() {
var value = (attr.mdMode || "").trim();
if (value) {
switch (value) {
case MODE_DETERMINATE:
case MODE_INDETERMINATE:
case MODE_BUFFER:
case MODE_QUERY:
break;
default:
value = MODE_INDETERMINATE;
... | [
"function",
"mode",
"(",
")",
"{",
"var",
"value",
"=",
"(",
"attr",
".",
"mdMode",
"||",
"\"\"",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"value",
")",
"{",
"switch",
"(",
"value",
")",
"{",
"case",
"MODE_DETERMINATE",
":",
"case",
"MODE_INDETE... | Is the md-mode a valid option? | [
"Is",
"the",
"md",
"-",
"mode",
"a",
"valid",
"option?"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/progressLinear/progress-linear.js#L160-L175 | train | Get the mode of the resource | [
30522,
3853,
5549,
1006,
1007,
1063,
13075,
3643,
1027,
1006,
2012,
16344,
1012,
9108,
5302,
3207,
1064,
1064,
1000,
1000,
1007,
1012,
12241,
1006,
1007,
1025,
2065,
1006,
3643,
1007,
1063,
6942,
1006,
3643,
1007,
1063,
2553,
5549,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/comma-dangle.js | getLastItem | function getLastItem(node) {
switch (node.type) {
case "ObjectExpression":
case "ObjectPattern":
return lodash.last(node.properties);
case "ArrayExpression":
case "ArrayPattern":
return lodash.last(node.e... | javascript | function getLastItem(node) {
switch (node.type) {
case "ObjectExpression":
case "ObjectPattern":
return lodash.last(node.properties);
case "ArrayExpression":
case "ArrayPattern":
return lodash.last(node.e... | [
"function",
"getLastItem",
"(",
"node",
")",
"{",
"switch",
"(",
"node",
".",
"type",
")",
"{",
"case",
"\"ObjectExpression\"",
":",
"case",
"\"ObjectPattern\"",
":",
"return",
"lodash",
".",
"last",
"(",
"node",
".",
"properties",
")",
";",
"case",
"\"Arr... | Gets the last item of the given node.
@param {ASTNode} node - The node to get.
@returns {ASTNode|null} The last node or null. | [
"Gets",
"the",
"last",
"item",
"of",
"the",
"given",
"node",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/comma-dangle.js#L148-L169 | train | Returns the last item in the tree | [
30522,
3853,
2131,
8523,
23096,
2213,
1006,
13045,
1007,
1063,
6942,
1006,
13045,
1012,
2828,
1007,
1063,
2553,
1000,
4874,
10288,
20110,
3258,
1000,
1024,
2553,
1000,
4874,
4502,
12079,
2078,
1000,
1024,
2709,
8840,
8883,
2232,
1012,
2197,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Select.js | fnHandleKeyboardNavigation | function fnHandleKeyboardNavigation(oItem) {
if (oItem) {
this.setSelection(oItem);
this.setValue(oItem.getText());
this.scrollToItem(oItem);
}
} | javascript | function fnHandleKeyboardNavigation(oItem) {
if (oItem) {
this.setSelection(oItem);
this.setValue(oItem.getText());
this.scrollToItem(oItem);
}
} | [
"function",
"fnHandleKeyboardNavigation",
"(",
"oItem",
")",
"{",
"if",
"(",
"oItem",
")",
"{",
"this",
".",
"setSelection",
"(",
"oItem",
")",
";",
"this",
".",
"setValue",
"(",
"oItem",
".",
"getText",
"(",
")",
")",
";",
"this",
".",
"scrollToItem",
... | /* ----------------------------------------------------------- /* Private methods /* ----------------------------------------------------------- | [
"/",
"*",
"-----------------------------------------------------------",
"/",
"*",
"Private",
"methods",
"/",
"*",
"-----------------------------------------------------------"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/Select.js#L422-L428 | train | Handles the keyboard navigation of an item. | [
30522,
3853,
1042,
25311,
5685,
2571,
14839,
6277,
2532,
5737,
12540,
1006,
1051,
4221,
2213,
1007,
1063,
2065,
1006,
1051,
4221,
2213,
1007,
1063,
2023,
1012,
4520,
12260,
7542,
1006,
1051,
4221,
2213,
1007,
1025,
2023,
1012,
2275,
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... |
eslint/eslint | lib/util/ast-utils.js | isMethodWhichHasThisArg | function isMethodWhichHasThisArg(node) {
for (
let currentNode = node;
currentNode.type === "MemberExpression" && !currentNode.computed;
currentNode = currentNode.property
) {
if (currentNode.property.type === "Identifier") {
return arrayMethodPattern.test(currentNode... | javascript | function isMethodWhichHasThisArg(node) {
for (
let currentNode = node;
currentNode.type === "MemberExpression" && !currentNode.computed;
currentNode = currentNode.property
) {
if (currentNode.property.type === "Identifier") {
return arrayMethodPattern.test(currentNode... | [
"function",
"isMethodWhichHasThisArg",
"(",
"node",
")",
"{",
"for",
"(",
"let",
"currentNode",
"=",
"node",
";",
"currentNode",
".",
"type",
"===",
"\"MemberExpression\"",
"&&",
"!",
"currentNode",
".",
"computed",
";",
"currentNode",
"=",
"currentNode",
".",
... | Checks whether or not a node is a method which has `thisArg`.
@param {ASTNode} node - A node to check.
@returns {boolean} Whether or not the node is a method which has `thisArg`. | [
"Checks",
"whether",
"or",
"not",
"a",
"node",
"is",
"a",
"method",
"which",
"has",
"thisArg",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/ast-utils.js#L204-L216 | train | Check if the node has a this arg | [
30522,
3853,
2003,
11368,
6806,
2094,
2860,
16066,
23644,
14083,
24158,
2906,
2290,
1006,
13045,
1007,
1063,
2005,
1006,
2292,
2783,
30524,
2783,
3630,
3207,
1012,
3200,
1007,
1063,
2065,
1006,
2783,
3630,
3207,
1012,
3200,
1012,
2828,
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... |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | function() {
scope_Handles[handleNumber].style[options.style] = toPct(to);
updateConnect(handleNumber);
updateConnect(handleNumber + 1);
} | javascript | function() {
scope_Handles[handleNumber].style[options.style] = toPct(to);
updateConnect(handleNumber);
updateConnect(handleNumber + 1);
} | [
"function",
"(",
")",
"{",
"scope_Handles",
"[",
"handleNumber",
"]",
".",
"style",
"[",
"options",
".",
"style",
"]",
"=",
"toPct",
"(",
"to",
")",
";",
"updateConnect",
"(",
"handleNumber",
")",
";",
"updateConnect",
"(",
"handleNumber",
"+",
"1",
")",... | Called synchronously or on the next animationFrame | [
"Called",
"synchronously",
"or",
"on",
"the",
"next",
"animationFrame"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L1788-L1792 | train | update style of handle | [
30522,
3853,
1006,
1007,
1063,
9531,
1035,
16024,
1031,
5047,
30524,
2638,
6593,
1006,
5047,
19172,
5677,
1009,
1015,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | getFunctionName | function getFunctionName(aFunction) {
var regexpResult = aFunction.toString().match(/function (\w*)/);
if (regexpResult && regexpResult[1]) {
return regexpResult[1];
}
return 'anonymous';
} | javascript | function getFunctionName(aFunction) {
var regexpResult = aFunction.toString().match(/function (\w*)/);
if (regexpResult && regexpResult[1]) {
return regexpResult[1];
}
return 'anonymous';
} | [
"function",
"getFunctionName",
"(",
"aFunction",
")",
"{",
"var",
"regexpResult",
"=",
"aFunction",
".",
"toString",
"(",
")",
".",
"match",
"(",
"/",
"function (\\w*)",
"/",
")",
";",
"if",
"(",
"regexpResult",
"&&",
"regexpResult",
"[",
"1",
"]",
")",
... | Override the broken getFunctionName() method from JsUnit
This file must be loaded _after_ the jsunitCore.js | [
"Override",
"the",
"broken",
"getFunctionName",
"()",
"method",
"from",
"JsUnit",
"This",
"file",
"must",
"be",
"loaded",
"_after_",
"the",
"jsunitCore",
".",
"js"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L365-L371 | train | Get the name of a function | [
30522,
3853,
2131,
11263,
27989,
18442,
1006,
21358,
4609,
7542,
1007,
1063,
13075,
19723,
10288,
28994,
11314,
1027,
21358,
4609,
7542,
1012,
2000,
3367,
4892,
1006,
1007,
1012,
2674,
1006,
1013,
3853,
1006,
1032,
1059,
1008,
1007,
1013,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/CodeFolding/foldhelpers/foldgutter.js | onViewportChange | function onViewportChange(cm) {
var state = cm.state.foldGutter;
window.clearTimeout(state.changeUpdate);
state.changeUpdate = window.setTimeout(function () {
var vp = cm.getViewport();
if (state.from === state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
... | javascript | function onViewportChange(cm) {
var state = cm.state.foldGutter;
window.clearTimeout(state.changeUpdate);
state.changeUpdate = window.setTimeout(function () {
var vp = cm.getViewport();
if (state.from === state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
... | [
"function",
"onViewportChange",
"(",
"cm",
")",
"{",
"var",
"state",
"=",
"cm",
".",
"state",
".",
"foldGutter",
";",
"window",
".",
"clearTimeout",
"(",
"state",
".",
"changeUpdate",
")",
";",
"state",
".",
"changeUpdate",
"=",
"window",
".",
"setTimeout"... | Triggered on viewport changes e.g., user scrolls or resizes the viewport.
@param {!CodeMirror} cm the CodeMirror instance for the active editor | [
"Triggered",
"on",
"viewport",
"changes",
"e",
".",
"g",
".",
"user",
"scrolls",
"or",
"resizes",
"the",
"viewport",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L296-L320 | train | onViewportChange - Update fold gutter | [
30522,
3853,
2006,
8584,
6442,
22305,
2063,
1006,
4642,
1007,
1063,
13075,
2110,
1027,
4642,
1012,
2110,
1012,
10671,
27920,
3334,
1025,
3332,
1012,
3154,
7292,
5833,
1006,
2110,
1012,
2689,
6279,
13701,
1007,
1025,
2110,
1012,
2689,
6279,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wangfupeng1988/wangEditor | src/js/menus/fontName/index.js | FontName | function FontName(editor) {
this.editor = editor
this.$elem = $('<div class="w-e-menu"><i class="w-e-icon-font"></i></div>')
this.type = 'droplist'
// 当前是否 active 状态
this._active = false
// 获取配置的字体
const config = editor.config
const fontNames = config.fontNames || []
// 初始化 dropli... | javascript | function FontName(editor) {
this.editor = editor
this.$elem = $('<div class="w-e-menu"><i class="w-e-icon-font"></i></div>')
this.type = 'droplist'
// 当前是否 active 状态
this._active = false
// 获取配置的字体
const config = editor.config
const fontNames = config.fontNames || []
// 初始化 dropli... | [
"function",
"FontName",
"(",
"editor",
")",
"{",
"this",
".",
"editor",
"=",
"editor",
"this",
".",
"$elem",
"=",
"$",
"(",
"'<div class=\"w-e-menu\"><i class=\"w-e-icon-font\"></i></div>'",
")",
"this",
".",
"type",
"=",
"'droplist'",
"// 当前是否 active 状态",
"this",
... | 构造函数 | [
"构造函数"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/menus/fontName/index.js#L9-L34 | train | FontName 字体前的字体前的字体前的字体前的字体前的字体前的字体前的字体前� | [
30522,
3853,
15489,
18442,
1006,
3559,
1007,
1063,
2023,
1012,
3559,
1027,
3559,
2023,
1012,
1002,
3449,
6633,
1027,
1002,
1006,
1005,
1026,
4487,
2615,
2465,
1027,
1000,
1059,
1011,
1041,
1011,
12183,
1000,
1028,
1026,
1045,
2465,
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/RequestRecorder.js | function(sUrl, aEntriesUrlFilter) {
if (this.bIsPaused) {
return true;
}
var that = this;
return aEntriesUrlFilter.every(function(regex) {
if (regex instanceof RegExp) {
return !regex.test(sUrl);
} else {
that.oLog.error(sModuleName + " - Invalid regular expression for filter.");
... | javascript | function(sUrl, aEntriesUrlFilter) {
if (this.bIsPaused) {
return true;
}
var that = this;
return aEntriesUrlFilter.every(function(regex) {
if (regex instanceof RegExp) {
return !regex.test(sUrl);
} else {
that.oLog.error(sModuleName + " - Invalid regular expression for filter.");
... | [
"function",
"(",
"sUrl",
",",
"aEntriesUrlFilter",
")",
"{",
"if",
"(",
"this",
".",
"bIsPaused",
")",
"{",
"return",
"true",
";",
"}",
"var",
"that",
"=",
"this",
";",
"return",
"aEntriesUrlFilter",
".",
"every",
"(",
"function",
"(",
"regex",
")",
"{... | Checks a URL against an array of regex if its filtered.
If the RequestRecorder is paused, the URL is filtered, too.
@param {string} sUrl URL to check.
@param {RegExp[]} aEntriesUrlFilter Array of regex filters.
@returns {boolean} If the URL is filterd true is returned. | [
"Checks",
"a",
"URL",
"against",
"an",
"array",
"of",
"regex",
"if",
"its",
"filtered",
".",
"If",
"the",
"RequestRecorder",
"is",
"paused",
"the",
"URL",
"is",
"filtered",
"too",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L406-L419 | train | Checks if the given URL matches the filter | [
30522,
3853,
1006,
7505,
2140,
1010,
29347,
3372,
5134,
3126,
10270,
4014,
3334,
1007,
1063,
2065,
1006,
2023,
1012,
20377,
4502,
13901,
1007,
1063,
2709,
2995,
1025,
1065,
13075,
2008,
1027,
2023,
1025,
2709,
29347,
3372,
5134,
3126,
10270... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
testing-library/dom-testing-library | src/query-helpers.js | getElementError | function getElementError(message, container) {
return new Error([message, debugDOM(container)].filter(Boolean).join('\n\n'))
} | javascript | function getElementError(message, container) {
return new Error([message, debugDOM(container)].filter(Boolean).join('\n\n'))
} | [
"function",
"getElementError",
"(",
"message",
",",
"container",
")",
"{",
"return",
"new",
"Error",
"(",
"[",
"message",
",",
"debugDOM",
"(",
"container",
")",
"]",
".",
"filter",
"(",
"Boolean",
")",
".",
"join",
"(",
"'\\n\\n'",
")",
")",
"}"
] | /* eslint-enable complexity | [
"/",
"*",
"eslint",
"-",
"enable",
"complexity"
] | fcb2cbcffb7aff6ecff3be8731168c86eee82ce1 | https://github.com/testing-library/dom-testing-library/blob/fcb2cbcffb7aff6ecff3be8731168c86eee82ce1/src/query-helpers.js#L30-L32 | train | Returns an error object for the given element | [
30522,
3853,
2131,
12260,
3672,
2121,
29165,
1006,
4471,
1010,
11661,
1007,
1063,
2709,
2047,
7561,
1006,
1031,
4471,
1010,
2139,
8569,
2290,
9527,
1006,
11661,
1007,
1033,
1012,
11307,
1006,
22017,
20898,
1007,
1012,
3693,
1006,
1005,
1032... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | logAtLevel_ | function logAtLevel_(message, level) {
if (message != null) {
var messageDiv = $('<div></div>');
messageDiv.addClass(level);
if (typeof message === 'object') {
messageDiv.text(JSON.stringify(message, null, ' '));
} else {
messageDiv.text(message);
}
$('.logs').append(messageDiv);
... | javascript | function logAtLevel_(message, level) {
if (message != null) {
var messageDiv = $('<div></div>');
messageDiv.addClass(level);
if (typeof message === 'object') {
messageDiv.text(JSON.stringify(message, null, ' '));
} else {
messageDiv.text(message);
}
$('.logs').append(messageDiv);
... | [
"function",
"logAtLevel_",
"(",
"message",
",",
"level",
")",
"{",
"if",
"(",
"message",
"!=",
"null",
")",
"{",
"var",
"messageDiv",
"=",
"$",
"(",
"'<div></div>'",
")",
";",
"messageDiv",
".",
"addClass",
"(",
"level",
")",
";",
"if",
"(",
"typeof",
... | Logs the message in the console and on the log window in the app
using the level given.
@param {?Object} message Object or message to log.
@param {string} level The level of log (log, error, debug).
@private | [
"Logs",
"the",
"message",
"in",
"the",
"console",
"and",
"on",
"the",
"log",
"window",
"in",
"the",
"app",
"using",
"the",
"level",
"given",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L56-L68 | train | Log at level | [
30522,
3853,
8833,
4017,
20414,
2884,
1035,
1006,
4471,
1010,
2504,
1007,
1063,
2065,
1006,
4471,
999,
1027,
19701,
1007,
1063,
13075,
4471,
4305,
2615,
1027,
1002,
1006,
1005,
1026,
4487,
2615,
1028,
1026,
1013,
4487,
2615,
1028,
1005,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.layout/src/sap/ui/layout/Splitter.js | _sizeArraysDiffer | function _sizeArraysDiffer(aSizes1, aSizes2) {
if (aSizes1 === aSizes2) {
// The same thing. No difference.
return false;
}
if (!aSizes1 || !aSizes2 || aSizes1.length === undefined || aSizes2.length === undefined) {
// At lease one of the two is not an array
return true;
}
if (aSizes1.length != ... | javascript | function _sizeArraysDiffer(aSizes1, aSizes2) {
if (aSizes1 === aSizes2) {
// The same thing. No difference.
return false;
}
if (!aSizes1 || !aSizes2 || aSizes1.length === undefined || aSizes2.length === undefined) {
// At lease one of the two is not an array
return true;
}
if (aSizes1.length != ... | [
"function",
"_sizeArraysDiffer",
"(",
"aSizes1",
",",
"aSizes2",
")",
"{",
"if",
"(",
"aSizes1",
"===",
"aSizes2",
")",
"{",
"// The same thing. No difference.",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"aSizes1",
"||",
"!",
"aSizes2",
"||",
"aSizes1",
"... | /////////////////////////////////////// Hidden Functions /////////////////////////////////////////
Compares two (simple, one-dimensional) arrays. If all values are the same, false is returned -
If values differ or at least one of the values is no array, true is returned.
@param {Number[]} [aSizes1] The array of numbe... | [
"///////////////////////////////////////",
"Hidden",
"Functions",
"/////////////////////////////////////////",
"Compares",
"two",
"(",
"simple",
"one",
"-",
"dimensional",
")",
"arrays",
".",
"If",
"all",
"values",
"are",
"the",
"same",
"false",
"is",
"returned",
"-",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.layout/src/sap/ui/layout/Splitter.js#L1047-L1069 | train | Returns true if the sizes of two arrays are different. | [
30522,
3853,
1035,
2946,
2906,
9447,
16150,
13355,
2121,
1006,
2004,
10057,
2487,
1010,
2004,
10057,
2475,
1007,
1063,
2065,
1006,
2004,
10057,
2487,
1027,
1027,
1027,
2004,
10057,
2475,
1007,
1063,
1013,
1013,
1996,
2168,
2518,
1012,
2053,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/document/DocumentManager.js | setCurrentDocument | function setCurrentDocument(doc) {
DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.CMD_OPEN) instead of DocumentManager.setCurrentDocument()", true);
CommandManager.execute(Commands.CMD_OPEN, {fullPath: doc.file.fullPath});
} | javascript | function setCurrentDocument(doc) {
DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.CMD_OPEN) instead of DocumentManager.setCurrentDocument()", true);
CommandManager.execute(Commands.CMD_OPEN, {fullPath: doc.file.fullPath});
} | [
"function",
"setCurrentDocument",
"(",
"doc",
")",
"{",
"DeprecationWarning",
".",
"deprecationWarning",
"(",
"\"Use CommandManager.execute(Commands.CMD_OPEN) instead of DocumentManager.setCurrentDocument()\"",
",",
"true",
")",
";",
"CommandManager",
".",
"execute",
"(",
"Comm... | opens the specified document for editing in the currently active pane
@deprecated use CommandManager.execute(Commands.CMD_OPEN, {fullPath: doc.file.fullPath}) instead
@param {!Document} document The Document to make current. | [
"opens",
"the",
"specified",
"document",
"for",
"editing",
"in",
"the",
"currently",
"active",
"pane"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L257-L260 | train | Sets the current document | [
30522,
3853,
2275,
10841,
14343,
3372,
3527,
24894,
4765,
1006,
9986,
1007,
1063,
2139,
28139,
10719,
9028,
5582,
1012,
2139,
28139,
10719,
9028,
5582,
1006,
1000,
2224,
3094,
24805,
4590,
1012,
15389,
1006,
10954,
1012,
4642,
2094,
1035,
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... |
dequelabs/axe-core | lib/commons/text/native-text-methods.js | descendantText | function descendantText(nodeName, { actualNode }, context) {
nodeName = nodeName.toLowerCase();
// Prevent accidently getting the nested element, like:
// fieldset > fielset > legend (1st fieldset has no legend)
const nodeNames = [nodeName, actualNode.nodeName.toLowerCase()].join(',');
const candidate = actualNode... | javascript | function descendantText(nodeName, { actualNode }, context) {
nodeName = nodeName.toLowerCase();
// Prevent accidently getting the nested element, like:
// fieldset > fielset > legend (1st fieldset has no legend)
const nodeNames = [nodeName, actualNode.nodeName.toLowerCase()].join(',');
const candidate = actualNode... | [
"function",
"descendantText",
"(",
"nodeName",
",",
"{",
"actualNode",
"}",
",",
"context",
")",
"{",
"nodeName",
"=",
"nodeName",
".",
"toLowerCase",
"(",
")",
";",
"// Prevent accidently getting the nested element, like:",
"// fieldset > fielset > legend (1st fieldset has... | Get the accessible text of first matching node
IMPORTANT: This method does not look at the composed tree
@private | [
"Get",
"the",
"accessible",
"text",
"of",
"first",
"matching",
"node",
"IMPORTANT",
":",
"This",
"method",
"does",
"not",
"look",
"at",
"the",
"composed",
"tree"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/commons/text/native-text-methods.js#L111-L122 | train | Returns the text of a descendant node | [
30522,
3853,
12608,
18209,
1006,
13045,
18442,
1010,
1063,
5025,
3630,
3207,
1065,
1010,
6123,
1007,
1063,
13045,
18442,
1027,
13045,
18442,
1012,
2000,
27663,
18992,
3366,
1006,
1007,
1025,
1013,
1013,
4652,
4926,
2135,
2893,
1996,
9089,
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... |
TryGhost/Ghost | core/server/data/importer/index.js | function (importData, importOptions) {
importOptions = importOptions || {};
var ops = [];
_.each(this.importers, function (importer) {
if (importData.hasOwnProperty(importer.type)) {
ops.push(function () {
return importer.doImport(importData[import... | javascript | function (importData, importOptions) {
importOptions = importOptions || {};
var ops = [];
_.each(this.importers, function (importer) {
if (importData.hasOwnProperty(importer.type)) {
ops.push(function () {
return importer.doImport(importData[import... | [
"function",
"(",
"importData",
",",
"importOptions",
")",
"{",
"importOptions",
"=",
"importOptions",
"||",
"{",
"}",
";",
"var",
"ops",
"=",
"[",
"]",
";",
"_",
".",
"each",
"(",
"this",
".",
"importers",
",",
"function",
"(",
"importer",
")",
"{",
... | Import Step 3:
Each importer gets passed the data from importData which has the key matching its type - i.e. it only gets the
data that it should import. Each importer then handles actually importing that data into Ghost
@param {ImportData} importData
@param {importOptions} importOptions to allow override of certain im... | [
"Import",
"Step",
"3",
":",
"Each",
"importer",
"gets",
"passed",
"the",
"data",
"from",
"importData",
"which",
"has",
"the",
"key",
"matching",
"its",
"type",
"-",
"i",
".",
"e",
".",
"it",
"only",
"gets",
"the",
"data",
"that",
"it",
"should",
"impor... | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/data/importer/index.js#L325-L339 | train | Import the given data into the database | [
30522,
3853,
1006,
12324,
2850,
2696,
1010,
12324,
7361,
9285,
1007,
1063,
12324,
7361,
9285,
1027,
12324,
7361,
9285,
1064,
1064,
1063,
1065,
1025,
13075,
23092,
1027,
1031,
1033,
1025,
1035,
1012,
2169,
1006,
2023,
1012,
12324,
2545,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/project/FileTreeViewModel.js | _setDirectoryOpen | function _setDirectoryOpen(treeData, path, open) {
var objectPath = _filePathToObjectPath(treeData, path),
directory = treeData.getIn(objectPath);
if (!objectPath) {
return {
needsLoading: true,
treeData: treeData
};
}
... | javascript | function _setDirectoryOpen(treeData, path, open) {
var objectPath = _filePathToObjectPath(treeData, path),
directory = treeData.getIn(objectPath);
if (!objectPath) {
return {
needsLoading: true,
treeData: treeData
};
}
... | [
"function",
"_setDirectoryOpen",
"(",
"treeData",
",",
"path",
",",
"open",
")",
"{",
"var",
"objectPath",
"=",
"_filePathToObjectPath",
"(",
"treeData",
",",
"path",
")",
",",
"directory",
"=",
"treeData",
".",
"getIn",
"(",
"objectPath",
")",
";",
"if",
... | @private
See `FileTreeViewModel.setDirectoryOpen` | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeViewModel.js#L520-L559 | train | Set directory open | [
30522,
3853,
1035,
2275,
4305,
2890,
16761,
7677,
11837,
1006,
3392,
2850,
2696,
1010,
4130,
1010,
2330,
1007,
1063,
13075,
4874,
15069,
1027,
1035,
5371,
15069,
3406,
16429,
20614,
15069,
1006,
3392,
2850,
2696,
1010,
4130,
1007,
1010,
141... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/data/helper/sourceHelper.js | doGuessOrdinal | function doGuessOrdinal(
data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex
) {
var result;
// Experience value.
var maxLoop = 5;
if (isTypedArray(data)) {
return false;
}
// When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine
// always e... | javascript | function doGuessOrdinal(
data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex
) {
var result;
// Experience value.
var maxLoop = 5;
if (isTypedArray(data)) {
return false;
}
// When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine
// always e... | [
"function",
"doGuessOrdinal",
"(",
"data",
",",
"sourceFormat",
",",
"seriesLayoutBy",
",",
"dimensionsDefine",
",",
"startIndex",
",",
"dimIndex",
")",
"{",
"var",
"result",
";",
"// Experience value.",
"var",
"maxLoop",
"=",
"5",
";",
"if",
"(",
"isTypedArray"... | dimIndex may be overflow source data. | [
"dimIndex",
"may",
"be",
"overflow",
"source",
"data",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/data/helper/sourceHelper.js#L500-L587 | train | Guess ordinal value from data | [
30522,
3853,
3899,
15808,
21748,
18979,
2140,
1006,
2951,
1010,
3120,
14192,
4017,
1010,
2186,
8485,
5833,
3762,
1010,
9646,
3207,
23460,
1010,
2707,
22254,
10288,
1010,
11737,
22254,
10288,
1007,
1063,
13075,
2765,
1025,
1013,
1013,
3325,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-arrow-callback.js | getCallbackInfo | function getCallbackInfo(node) {
const retv = { isCallback: false, isLexicalThis: false };
let currentNode = node;
let parent = node.parent;
while (currentNode) {
switch (parent.type) {
// Checks parents recursively.
case "LogicalExpression":
case "Conditio... | javascript | function getCallbackInfo(node) {
const retv = { isCallback: false, isLexicalThis: false };
let currentNode = node;
let parent = node.parent;
while (currentNode) {
switch (parent.type) {
// Checks parents recursively.
case "LogicalExpression":
case "Conditio... | [
"function",
"getCallbackInfo",
"(",
"node",
")",
"{",
"const",
"retv",
"=",
"{",
"isCallback",
":",
"false",
",",
"isLexicalThis",
":",
"false",
"}",
";",
"let",
"currentNode",
"=",
"node",
";",
"let",
"parent",
"=",
"node",
".",
"parent",
";",
"while",
... | Checkes whether or not a given node is a callback.
@param {ASTNode} node - A node to check.
@returns {Object}
{boolean} retv.isCallback - `true` if the node is a callback.
{boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`. | [
"Checkes",
"whether",
"or",
"not",
"a",
"given",
"node",
"is",
"a",
"callback",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-arrow-callback.js#L65-L116 | train | Returns the callback info for a node | [
30522,
3853,
2131,
9289,
20850,
8684,
2378,
14876,
1006,
13045,
1007,
1063,
9530,
3367,
2128,
9189,
1027,
1063,
2003,
9289,
20850,
8684,
1024,
6270,
1010,
8842,
9048,
9289,
15222,
2015,
1024,
6270,
1065,
1025,
2292,
2783,
3630,
3207,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/cli/server.js | redirect | function redirect() {
var resultURL = urlTransform(req.url, function(parsed) {
parsed.pathname += '/';
return parsed;
});
res.statusCode = 301;
res.setHeader('Location', resultURL);
res.end('Redirect... | javascript | function redirect() {
var resultURL = urlTransform(req.url, function(parsed) {
parsed.pathname += '/';
return parsed;
});
res.statusCode = 301;
res.setHeader('Location', resultURL);
res.end('Redirect... | [
"function",
"redirect",
"(",
")",
"{",
"var",
"resultURL",
"=",
"urlTransform",
"(",
"req",
".",
"url",
",",
"function",
"(",
"parsed",
")",
"{",
"parsed",
".",
"pathname",
"+=",
"'/'",
";",
"return",
"parsed",
";",
"}",
")",
";",
"res",
".",
"status... | Redirect to directory's index.html | [
"Redirect",
"to",
"directory",
"s",
"index",
".",
"html"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/cli/server.js#L73-L82 | train | Redirect to the next page | [
30522,
3853,
2417,
7442,
6593,
1006,
1007,
1063,
13075,
2765,
3126,
2140,
1027,
24471,
7096,
5521,
22747,
2953,
2213,
1006,
2128,
4160,
1012,
24471,
2140,
1010,
3853,
1006,
11968,
6924,
1007,
1063,
11968,
6924,
1012,
4130,
18442,
1009,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/FileTreeView.js | function (e) {
e.stopPropagation();
if (e.button === RIGHT_MOUSE_BUTTON ||
(this.props.platform === "mac" && e.button === LEFT_MOUSE_BUTTON && e.ctrlKey)) {
this.props.actions.setContext(this.myPath());
e.preventDefault();
retur... | javascript | function (e) {
e.stopPropagation();
if (e.button === RIGHT_MOUSE_BUTTON ||
(this.props.platform === "mac" && e.button === LEFT_MOUSE_BUTTON && e.ctrlKey)) {
this.props.actions.setContext(this.myPath());
e.preventDefault();
retur... | [
"function",
"(",
"e",
")",
"{",
"e",
".",
"stopPropagation",
"(",
")",
";",
"if",
"(",
"e",
".",
"button",
"===",
"RIGHT_MOUSE_BUTTON",
"||",
"(",
"this",
".",
"props",
".",
"platform",
"===",
"\"mac\"",
"&&",
"e",
".",
"button",
"===",
"LEFT_MOUSE_BUT... | Send matching mouseDown events to the action creator as a setContext action. | [
"Send",
"matching",
"mouseDown",
"events",
"to",
"the",
"action",
"creator",
"as",
"a",
"setContext",
"action",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L368-L380 | train | on mouse down | [
30522,
3853,
1006,
1041,
1007,
1063,
1041,
1012,
2644,
21572,
4502,
12540,
1006,
1007,
1025,
2065,
1006,
1041,
1012,
6462,
1027,
1027,
1027,
2157,
1035,
8000,
1035,
6462,
1064,
1064,
1006,
2023,
1012,
24387,
1012,
4132,
1027,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (elem, elemName, func)
{
var i, childNode;
for (i = 0; i < elem.childNodes.length; i++) {
childNode = elem.childNodes[i];
if (childNode.nodeType == Strophe.ElementType.NORMAL &&
(!elemName || this.isTagEqual(childNode, elemName))) {
... | javascript | function (elem, elemName, func)
{
var i, childNode;
for (i = 0; i < elem.childNodes.length; i++) {
childNode = elem.childNodes[i];
if (childNode.nodeType == Strophe.ElementType.NORMAL &&
(!elemName || this.isTagEqual(childNode, elemName))) {
... | [
"function",
"(",
"elem",
",",
"elemName",
",",
"func",
")",
"{",
"var",
"i",
",",
"childNode",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"elem",
".",
"childNodes",
".",
"length",
";",
"i",
"++",
")",
"{",
"childNode",
"=",
"elem",
".",
"ch... | Function: forEachChild
Map a function over some or all child elements of a given element.
This is a small convenience function for mapping a function over
some or all of the children of an element. If elemName is null, all
children will be passed to the function, otherwise only children
whose tag names match elemName... | [
"Function",
":",
"forEachChild",
"Map",
"a",
"function",
"over",
"some",
"or",
"all",
"child",
"elements",
"of",
"a",
"given",
"element",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L871-L882 | train | Private function to call func for each node in the tree | [
30522,
3853,
1006,
3449,
6633,
1010,
3449,
6633,
18442,
1010,
4569,
2278,
1007,
1063,
13075,
1045,
1010,
2775,
3630,
3207,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
3449,
6633,
1012,
2775,
3630,
6155,
1012,
3091,
1025,
1045,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
pagekit/vue-resource | dist/vue-resource.esm.js | Headers | function Headers(headers) {
var this$1 = this;
this.map = {};
each(headers, function (value, name) { return this$1.append(name, value); });
} | javascript | function Headers(headers) {
var this$1 = this;
this.map = {};
each(headers, function (value, name) { return this$1.append(name, value); });
} | [
"function",
"Headers",
"(",
"headers",
")",
"{",
"var",
"this$1",
"=",
"this",
";",
"this",
".",
"map",
"=",
"{",
"}",
";",
"each",
"(",
"headers",
",",
"function",
"(",
"value",
",",
"name",
")",
"{",
"return",
"this$1",
".",
"append",
"(",
"name"... | HTTP Headers. | [
"HTTP",
"Headers",
"."
] | fe268fa1d6053ede5f34aef9a11e1a424a70446c | https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1187-L1194 | train | Headers object | [
30522,
3853,
20346,
2015,
1006,
20346,
2015,
1007,
1063,
13075,
2023,
1002,
1015,
1027,
2023,
1025,
2023,
1012,
4949,
1027,
1063,
1065,
1025,
2169,
1006,
20346,
2015,
1010,
3853,
1006,
3643,
1010,
2171,
1007,
1063,
2709,
2023,
1002,
1015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ScopeManager.js | initTernServer | function initTernServer(dir, files) {
initTernModule();
numResolvedFiles = 0;
numAddedFiles = 0;
stopAddingFiles = false;
numInitialFiles = files.length;
ternPromise.done(function (ternModule) {
var msg = {
type... | javascript | function initTernServer(dir, files) {
initTernModule();
numResolvedFiles = 0;
numAddedFiles = 0;
stopAddingFiles = false;
numInitialFiles = files.length;
ternPromise.done(function (ternModule) {
var msg = {
type... | [
"function",
"initTernServer",
"(",
"dir",
",",
"files",
")",
"{",
"initTernModule",
"(",
")",
";",
"numResolvedFiles",
"=",
"0",
";",
"numAddedFiles",
"=",
"0",
";",
"stopAddingFiles",
"=",
"false",
";",
"numInitialFiles",
"=",
"files",
".",
"length",
";",
... | Create a new tern server. | [
"Create",
"a",
"new",
"tern",
"server",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1168-L1186 | train | initTernServer - init Tern server | [
30522,
3853,
1999,
27100,
6826,
8043,
6299,
1006,
16101,
1010,
6764,
1007,
1063,
1999,
27100,
6826,
5302,
8566,
2571,
1006,
1007,
1025,
16371,
2213,
6072,
16116,
8873,
4244,
1027,
1014,
1025,
16371,
25666,
5732,
8873,
4244,
1027,
1014,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ksky521/nodeppt | packages/nodeppt-parser/lib/markdown/attrs/index.js | get | function get(arr, n) {
return n >= 0 ? arr[n] : arr[arr.length + n];
} | javascript | function get(arr, n) {
return n >= 0 ? arr[n] : arr[arr.length + n];
} | [
"function",
"get",
"(",
"arr",
",",
"n",
")",
"{",
"return",
"n",
">=",
"0",
"?",
"arr",
"[",
"n",
"]",
":",
"arr",
"[",
"arr",
".",
"length",
"+",
"n",
"]",
";",
"}"
] | Get n item of array. Supports negative n, where -1 is last
element in array.
@param {array} arr
@param {number} n | [
"Get",
"n",
"item",
"of",
"array",
".",
"Supports",
"negative",
"n",
"where",
"-",
"1",
"is",
"last",
"element",
"in",
"array",
"."
] | ca77e29ef818c08b0522b31e3925b073cf159b9c | https://github.com/ksky521/nodeppt/blob/ca77e29ef818c08b0522b31e3925b073cf159b9c/packages/nodeppt-parser/lib/markdown/attrs/index.js#L158-L160 | train | Get the n - th item from an array of words | [
30522,
3853,
2131,
1006,
12098,
2099,
1010,
1050,
1007,
1063,
2709,
1050,
1028,
1027,
1014,
1029,
12098,
2099,
1031,
1050,
1033,
1024,
12098,
2099,
1031,
12098,
2099,
1012,
3091,
1009,
1050,
1033,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/extensibility/node/package-validator.js | parsePersonString | function parsePersonString(obj) {
if (typeof (obj) === "string") {
var parts = _personRegex.exec(obj);
// No regex match, so we just synthesize an object with an opaque name string
if (!parts) {
return {
name: obj
};
} else {
var r... | javascript | function parsePersonString(obj) {
if (typeof (obj) === "string") {
var parts = _personRegex.exec(obj);
// No regex match, so we just synthesize an object with an opaque name string
if (!parts) {
return {
name: obj
};
} else {
var r... | [
"function",
"parsePersonString",
"(",
"obj",
")",
"{",
"if",
"(",
"typeof",
"(",
"obj",
")",
"===",
"\"string\"",
")",
"{",
"var",
"parts",
"=",
"_personRegex",
".",
"exec",
"(",
"obj",
")",
";",
"// No regex match, so we just synthesize an object with an opaque n... | Normalizes person fields from package.json.
These fields can be an object with name, email and url properties or a
string of the form "name <email> <url>". This does a tolerant parsing of
the data to try to return an object with name and optional email and url.
If the string does not match the format, the string is re... | [
"Normalizes",
"person",
"fields",
"from",
"package",
".",
"json",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/package-validator.js#L97-L122 | train | Parse a person string into an object with name email and url properties | [
30522,
3853,
11968,
3366,
27576,
3367,
4892,
1006,
27885,
3501,
1007,
1063,
2065,
1006,
2828,
11253,
1006,
27885,
3501,
1007,
1027,
1027,
1027,
1000,
5164,
1000,
1007,
1063,
13075,
3033,
1027,
1035,
2711,
2890,
3351,
2595,
1012,
4654,
8586,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/yoda.js | getNormalizedLiteral | function getNormalizedLiteral(node, defaultValue) {
if (node.type === "Literal") {
return node;
}
if (looksLikeLiteral(node)) {
return {
type: "Literal",
value: -node.argument.value,
raw: `-${node.argument.value}`
};
}
if (defaultValue) {... | javascript | function getNormalizedLiteral(node, defaultValue) {
if (node.type === "Literal") {
return node;
}
if (looksLikeLiteral(node)) {
return {
type: "Literal",
value: -node.argument.value,
raw: `-${node.argument.value}`
};
}
if (defaultValue) {... | [
"function",
"getNormalizedLiteral",
"(",
"node",
",",
"defaultValue",
")",
"{",
"if",
"(",
"node",
".",
"type",
"===",
"\"Literal\"",
")",
"{",
"return",
"node",
";",
"}",
"if",
"(",
"looksLikeLiteral",
"(",
"node",
")",
")",
"{",
"return",
"{",
"type",
... | Attempts to derive a Literal node from nodes that are treated like literals.
@param {ASTNode} node Node to normalize.
@param {number} [defaultValue] The default value to be returned if the node
is not a Literal.
@returns {ASTNode} One of the following options.
1. The original node if the node is already a Literal
2. A ... | [
"Attempts",
"to",
"derive",
"a",
"Literal",
"node",
"from",
"nodes",
"that",
"are",
"treated",
"like",
"literals",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/yoda.js#L72-L94 | train | Get normalized literal | [
30522,
3853,
2131,
12131,
9067,
3550,
22779,
7941,
1006,
13045,
1010,
12398,
10175,
5657,
1007,
1063,
2065,
1006,
13045,
1012,
2828,
1027,
1027,
1027,
1000,
18204,
1000,
1007,
1063,
2709,
13045,
1025,
1065,
2065,
1006,
3504,
10359,
22779,
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... |
goldfire/howler.js | dist/howler.js | function() {
var self = this;
var args = arguments;
var vol, id;
// Determine the values based on arguments.
if (args.length === 0) {
// Return the value of the groups' volume.
return self._volume;
} else if (args.length === 1 || args.length === 2 && typeof args[1] =... | javascript | function() {
var self = this;
var args = arguments;
var vol, id;
// Determine the values based on arguments.
if (args.length === 0) {
// Return the value of the groups' volume.
return self._volume;
} else if (args.length === 1 || args.length === 2 && typeof args[1] =... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"args",
"=",
"arguments",
";",
"var",
"vol",
",",
"id",
";",
"// Determine the values based on arguments.",
"if",
"(",
"args",
".",
"length",
"===",
"0",
")",
"{",
"// Return the value of the... | Get/set the volume of this sound or of the Howl group. This method can optionally take 0, 1 or 2 arguments.
volume() -> Returns the group's volume value.
volume(id) -> Returns the sound id's current volume.
volume(vol) -> Sets the volume of all sounds in this Howl group.
volume(vol, id) -> Sets the volume of passed sou... | [
"Get",
"/",
"set",
"the",
"volume",
"of",
"this",
"sound",
"or",
"of",
"the",
"Howl",
"group",
".",
"This",
"method",
"can",
"optionally",
"take",
"0",
"1",
"or",
"2",
"arguments",
".",
"volume",
"()",
"-",
">",
"Returns",
"the",
"group",
"s",
"volum... | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L1179-L1251 | train | Update the volume of the group. | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
12098,
5620,
1027,
9918,
1025,
13075,
5285,
1010,
8909,
1025,
1013,
1013,
5646,
1996,
5300,
2241,
2006,
9918,
1012,
2065,
1006,
12098,
5620,
1012,
3091,
1027,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/features/ParameterHintsManager.js | popUpHint | function popUpHint(editor, explicit, onCursorActivity) {
var request = null;
var $deferredPopUp = $.Deferred();
var sessionProvider = null;
dismissHint(editor);
// Find a suitable provider, if any
var language = editor.getLanguageForSelection(),
enabledProvid... | javascript | function popUpHint(editor, explicit, onCursorActivity) {
var request = null;
var $deferredPopUp = $.Deferred();
var sessionProvider = null;
dismissHint(editor);
// Find a suitable provider, if any
var language = editor.getLanguageForSelection(),
enabledProvid... | [
"function",
"popUpHint",
"(",
"editor",
",",
"explicit",
",",
"onCursorActivity",
")",
"{",
"var",
"request",
"=",
"null",
";",
"var",
"$deferredPopUp",
"=",
"$",
".",
"Deferred",
"(",
")",
";",
"var",
"sessionProvider",
"=",
"null",
";",
"dismissHint",
"(... | Pop up a function hint on the line above the caret position.
@param {object=} editor - current Active Editor
@param {boolean} True if hints are invoked through cursor activity.
@return {jQuery.Promise} - The promise will not complete until the
hint has completed. Returns null, if the function hint is already
displayed... | [
"Pop",
"up",
"a",
"function",
"hint",
"on",
"the",
"line",
"above",
"the",
"caret",
"position",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/ParameterHintsManager.js#L256-L298 | train | Pop up a hint | [
30522,
3853,
3769,
6279,
10606,
2102,
1006,
3559,
1010,
13216,
1010,
2006,
10841,
25301,
22648,
29068,
3012,
1007,
1063,
13075,
5227,
1027,
19701,
1025,
13075,
1002,
13366,
28849,
18927,
7361,
6279,
1027,
1002,
1012,
13366,
28849,
2094,
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... |
NetEase/pomelo | lib/connectors/mqttconnector.js | function(port, host, opts) {
if (!(this instanceof Connector)) {
return new Connector(port, host, opts);
}
EventEmitter.call(this);
this.port = port;
this.host = host;
this.opts = opts || {};
this.adaptor = new Adaptor(this.opts);
} | javascript | function(port, host, opts) {
if (!(this instanceof Connector)) {
return new Connector(port, host, opts);
}
EventEmitter.call(this);
this.port = port;
this.host = host;
this.opts = opts || {};
this.adaptor = new Adaptor(this.opts);
} | [
"function",
"(",
"port",
",",
"host",
",",
"opts",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Connector",
")",
")",
"{",
"return",
"new",
"Connector",
"(",
"port",
",",
"host",
",",
"opts",
")",
";",
"}",
"EventEmitter",
".",
"call",
"("... | Connector that manager low level connection and protocol bewteen server and client.
Develper can provide their own connector to switch the low level prototol, such as tcp or probuf. | [
"Connector",
"that",
"manager",
"low",
"level",
"connection",
"and",
"protocol",
"bewteen",
"server",
"and",
"client",
".",
"Develper",
"can",
"provide",
"their",
"own",
"connector",
"to",
"switch",
"the",
"low",
"level",
"prototol",
"such",
"as",
"tcp",
"or",... | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/connectors/mqttconnector.js#L15-L26 | train | Encapsulates a connection to the
server. | [
30522,
3853,
1006,
3417,
1010,
3677,
1010,
23569,
2015,
1007,
1063,
2065,
1006,
999,
1006,
2023,
6013,
11253,
19400,
1007,
1007,
1063,
2709,
2047,
19400,
1006,
3417,
1010,
3677,
1010,
23569,
2015,
1007,
1025,
1065,
2724,
23238,
12079,
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/odata/v4/lib/_Cache.js | Cache | function Cache(oRequestor, sResourcePath, mQueryOptions, bSortExpandSelect,
fnGetOriginalResourcePath) {
this.bActive = true;
this.mChangeListeners = {}; // map from path to an array of change listeners
this.fnGetOriginalResourcePath = fnGetOriginalResourcePath;
this.sMetaPath = _Helper.getMetaPath("/" + sRe... | javascript | function Cache(oRequestor, sResourcePath, mQueryOptions, bSortExpandSelect,
fnGetOriginalResourcePath) {
this.bActive = true;
this.mChangeListeners = {}; // map from path to an array of change listeners
this.fnGetOriginalResourcePath = fnGetOriginalResourcePath;
this.sMetaPath = _Helper.getMetaPath("/" + sRe... | [
"function",
"Cache",
"(",
"oRequestor",
",",
"sResourcePath",
",",
"mQueryOptions",
",",
"bSortExpandSelect",
",",
"fnGetOriginalResourcePath",
")",
"{",
"this",
".",
"bActive",
"=",
"true",
";",
"this",
".",
"mChangeListeners",
"=",
"{",
"}",
";",
"// map from ... | ********************************************************************************************* Cache *********************************************************************************************
Base class for the various caches.
@param {sap.ui.model.odata.v4.lib._Requestor} oRequestor
The requestor
@param {string} sR... | [
"*********************************************************************************************",
"Cache",
"*********************************************************************************************",
"Base",
"class",
"for",
"the",
"various",
"caches",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js#L96-L112 | train | Creates a new cache instance. | [
30522,
3853,
17053,
1006,
10848,
15500,
2953,
1010,
5034,
2229,
8162,
3401,
15069,
1010,
1049,
4226,
2854,
7361,
9285,
1010,
18667,
11589,
10288,
9739,
5104,
12260,
6593,
1010,
1042,
15465,
29469,
24965,
6072,
8162,
3401,
15069,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/StringMatch.js | closeRangeGap | function closeRangeGap(c) {
// Close the current range
if (currentRange) {
currentRange.includesLastSegment = lastMatchIndex >= lastSegmentStart;
if (currentRange.matched && currentRange.includesLastSegment) {
if (DEBUG_SCORES) {
... | javascript | function closeRangeGap(c) {
// Close the current range
if (currentRange) {
currentRange.includesLastSegment = lastMatchIndex >= lastSegmentStart;
if (currentRange.matched && currentRange.includesLastSegment) {
if (DEBUG_SCORES) {
... | [
"function",
"closeRangeGap",
"(",
"c",
")",
"{",
"// Close the current range",
"if",
"(",
"currentRange",
")",
"{",
"currentRange",
".",
"includesLastSegment",
"=",
"lastMatchIndex",
">=",
"lastSegmentStart",
";",
"if",
"(",
"currentRange",
".",
"matched",
"&&",
"... | Records the current range and adds any additional ranges required to get to character index c. This function is called before starting a new range or returning from the function. | [
"Records",
"the",
"current",
"range",
"and",
"adds",
"any",
"additional",
"ranges",
"required",
"to",
"get",
"to",
"character",
"index",
"c",
".",
"This",
"function",
"is",
"called",
"before",
"starting",
"a",
"new",
"range",
"or",
"returning",
"from",
"the"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringMatch.js#L534-L565 | train | Close the gap between the current range and the new range | [
30522,
3853,
3553,
22043,
3654,
2361,
1006,
1039,
1007,
1063,
1013,
1013,
2485,
1996,
2783,
2846,
2065,
1006,
2783,
24388,
2063,
1007,
1063,
2783,
24388,
2063,
1012,
2950,
8523,
3215,
13910,
3672,
1027,
2197,
18900,
17231,
3207,
2595,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/api/v0.1/subscribers.js | exportSubscribers | function exportSubscribers() {
return models.Subscriber.findAll(options).then((data) => {
return formatCSV(data.toJSON(options));
}).catch((err) => {
return Promise.reject(new common.errors.GhostError({err: err}));
});
} | javascript | function exportSubscribers() {
return models.Subscriber.findAll(options).then((data) => {
return formatCSV(data.toJSON(options));
}).catch((err) => {
return Promise.reject(new common.errors.GhostError({err: err}));
});
} | [
"function",
"exportSubscribers",
"(",
")",
"{",
"return",
"models",
".",
"Subscriber",
".",
"findAll",
"(",
"options",
")",
".",
"then",
"(",
"(",
"data",
")",
"=>",
"{",
"return",
"formatCSV",
"(",
"data",
".",
"toJSON",
"(",
"options",
")",
")",
";",... | Export data, otherwise send error 500 | [
"Export",
"data",
"otherwise",
"send",
"error",
"500"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/subscribers.js#L285-L291 | train | export all the subscribers | [
30522,
3853,
14338,
12083,
29234,
2869,
1006,
1007,
1063,
2709,
4275,
1012,
4942,
29234,
2099,
1012,
2424,
8095,
1006,
7047,
1007,
1012,
2059,
1006,
1006,
2951,
1007,
1027,
1028,
1063,
2709,
4289,
6169,
2615,
1006,
2951,
1012,
2000,
22578,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js | collectBindingPaths | function collectBindingPaths(oElement, oModel){
var mBindingsCollection = {
bindingPaths: [],
bindingContextPaths: []
};
var sAggregationName = oElement.sParentAggregationName;
var oParent = oElement.getParent();
var aBindings = getBindings(oElement, oModel);
if (oParent) {
var oDefaultAggregation... | javascript | function collectBindingPaths(oElement, oModel){
var mBindingsCollection = {
bindingPaths: [],
bindingContextPaths: []
};
var sAggregationName = oElement.sParentAggregationName;
var oParent = oElement.getParent();
var aBindings = getBindings(oElement, oModel);
if (oParent) {
var oDefaultAggregation... | [
"function",
"collectBindingPaths",
"(",
"oElement",
",",
"oModel",
")",
"{",
"var",
"mBindingsCollection",
"=",
"{",
"bindingPaths",
":",
"[",
"]",
",",
"bindingContextPaths",
":",
"[",
"]",
"}",
";",
"var",
"sAggregationName",
"=",
"oElement",
".",
"sParentAg... | Get all relevant binding paths and binding context paths for the element (from all properties)
@param {sap.ui.core.Control} oElement - Starting point of the search
@param {sap.ui.model.Model} oModel - Model for filtering irrelevant binding paths
@returns {{bindingPaths: Array, bindingContextPaths: Array}}} - returns w... | [
"Get",
"all",
"relevant",
"binding",
"paths",
"and",
"binding",
"context",
"paths",
"for",
"the",
"element",
"(",
"from",
"all",
"properties",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js#L26-L76 | train | Collect all binding paths for the given element | [
30522,
3853,
8145,
8428,
4667,
15069,
2015,
1006,
1051,
12260,
3672,
1010,
18168,
10244,
2140,
1007,
1063,
13075,
16914,
22254,
8613,
26895,
18491,
1027,
1063,
8031,
15069,
2015,
1024,
1031,
1033,
1010,
8031,
8663,
18209,
15069,
2015,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/ScopeManager.js | handleScopeData | function handleScopeData(response) {
var file = response.file,
offset = response.offset;
var $deferredJump = getPendingRequest(file, offset, MessageIds.TERN_SCOPEDATA_MSG);
if ($deferredJump) {
$deferredJump.resolveWith(null, [response]);
}
} | javascript | function handleScopeData(response) {
var file = response.file,
offset = response.offset;
var $deferredJump = getPendingRequest(file, offset, MessageIds.TERN_SCOPEDATA_MSG);
if ($deferredJump) {
$deferredJump.resolveWith(null, [response]);
}
} | [
"function",
"handleScopeData",
"(",
"response",
")",
"{",
"var",
"file",
"=",
"response",
".",
"file",
",",
"offset",
"=",
"response",
".",
"offset",
";",
"var",
"$deferredJump",
"=",
"getPendingRequest",
"(",
"file",
",",
"offset",
",",
"MessageIds",
".",
... | Handle the response from the tern node domain when
it responds with the scope data
@param response - the response from the node domain | [
"Handle",
"the",
"response",
"from",
"the",
"tern",
"node",
"domain",
"when",
"it",
"responds",
"with",
"the",
"scope",
"data"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L451-L460 | train | Handle scope data | [
30522,
3853,
16024,
16186,
2850,
2696,
1006,
3433,
1007,
1063,
13075,
5371,
1027,
3433,
1012,
5371,
1010,
16396,
1027,
3433,
1012,
16396,
1025,
13075,
1002,
13366,
28849,
2094,
9103,
8737,
1027,
2131,
11837,
4667,
2890,
15500,
1006,
5371,
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/language/CodeInspection.js | updatePanelTitleAndStatusBar | function updatePanelTitleAndStatusBar(numProblems, providersReportingProblems, aborted) {
var message, tooltip;
if (providersReportingProblems.length === 1) {
// don't show a header if there is only one provider available for this file type
$problemsPanelTable.find(".inspector-s... | javascript | function updatePanelTitleAndStatusBar(numProblems, providersReportingProblems, aborted) {
var message, tooltip;
if (providersReportingProblems.length === 1) {
// don't show a header if there is only one provider available for this file type
$problemsPanelTable.find(".inspector-s... | [
"function",
"updatePanelTitleAndStatusBar",
"(",
"numProblems",
",",
"providersReportingProblems",
",",
"aborted",
")",
"{",
"var",
"message",
",",
"tooltip",
";",
"if",
"(",
"providersReportingProblems",
".",
"length",
"===",
"1",
")",
"{",
"// don't show a header if... | Update the title of the problem panel and the tooltip of the status bar icon. The title and the tooltip will
change based on the number of problems reported and how many provider reported problems.
@param {Number} numProblems - total number of problems across all providers
@param {Array.<{name:string, scanFileAsync:?f... | [
"Update",
"the",
"title",
"of",
"the",
"problem",
"panel",
"and",
"the",
"tooltip",
"of",
"the",
"status",
"bar",
"icon",
".",
"The",
"title",
"and",
"the",
"tooltip",
"will",
"change",
"based",
"on",
"the",
"number",
"of",
"problems",
"reported",
"and",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L315-L347 | train | update panel title and status bar | [
30522,
3853,
10651,
9739,
20042,
4183,
20898,
5104,
29336,
2271,
8237,
1006,
16371,
8737,
3217,
3468,
5244,
1010,
11670,
2890,
6442,
2075,
21572,
3468,
5244,
1010,
11113,
15613,
1007,
1063,
13075,
4471,
1010,
6994,
25101,
1025,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/tooltip/tooltip.js | deregister | function deregister(type, handler, useCapture) {
var handlers = listeners[type];
var index = handlers ? handlers.indexOf(handler) : -1;
if (index > -1) {
handlers.splice(index, 1);
if (handlers.length === 0) {
useCapture ? window.removeEventListener(type, globalEventHandler, true) :
... | javascript | function deregister(type, handler, useCapture) {
var handlers = listeners[type];
var index = handlers ? handlers.indexOf(handler) : -1;
if (index > -1) {
handlers.splice(index, 1);
if (handlers.length === 0) {
useCapture ? window.removeEventListener(type, globalEventHandler, true) :
... | [
"function",
"deregister",
"(",
"type",
",",
"handler",
",",
"useCapture",
")",
"{",
"var",
"handlers",
"=",
"listeners",
"[",
"type",
"]",
";",
"var",
"index",
"=",
"handlers",
"?",
"handlers",
".",
"indexOf",
"(",
"handler",
")",
":",
"-",
"1",
";",
... | Removes an event handler from the service.
@param {string} type Type of event handler.
@param {!Function} handler The event handler itself.
@param {boolean} useCapture Whether the event handler used event capturing. | [
"Removes",
"an",
"event",
"handler",
"from",
"the",
"service",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tooltip/tooltip.js#L470-L482 | train | Deregisters a listener for a specific event type | [
30522,
3853,
4315,
13910,
12911,
1006,
2828,
1010,
28213,
1010,
2224,
17695,
11244,
1007,
1063,
13075,
28213,
2015,
1027,
13810,
1031,
2828,
1033,
1025,
13075,
5950,
1027,
28213,
2015,
1029,
28213,
2015,
1012,
5950,
11253,
1006,
28213,
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... |
grpc/grpc | examples/node/static_codegen/route_guide/route_guide_server.js | checkFeature | function checkFeature(point) {
var feature;
// Check if there is already a feature object for the given point
for (var i = 0; i < feature_list.length; i++) {
feature = feature_list[i];
if (feature.getLocation().getLatitude() === point.getLatitude() &&
feature.getLocation().getLongitude() === point... | javascript | function checkFeature(point) {
var feature;
// Check if there is already a feature object for the given point
for (var i = 0; i < feature_list.length; i++) {
feature = feature_list[i];
if (feature.getLocation().getLatitude() === point.getLatitude() &&
feature.getLocation().getLongitude() === point... | [
"function",
"checkFeature",
"(",
"point",
")",
"{",
"var",
"feature",
";",
"// Check if there is already a feature object for the given point",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"feature_list",
".",
"length",
";",
"i",
"++",
")",
"{",
"feature",
... | Get a feature object at the given point, or creates one if it does not exist.
@param {point} point The point to check
@return {feature} The feature object at the point. Note that an empty name
indicates no feature | [
"Get",
"a",
"feature",
"object",
"at",
"the",
"given",
"point",
"or",
"creates",
"one",
"if",
"it",
"does",
"not",
"exist",
"."
] | cc75d93818410e2b0edd0fa3009a6def9ac403ca | https://github.com/grpc/grpc/blob/cc75d93818410e2b0edd0fa3009a6def9ac403ca/examples/node/static_codegen/route_guide/route_guide_server.js#L48-L63 | train | Check if a feature object exists for the given point | [
30522,
3853,
4638,
7959,
4017,
5397,
1006,
2391,
1007,
1063,
13075,
3444,
1025,
1013,
1013,
4638,
2065,
2045,
2003,
2525,
1037,
3444,
4874,
2005,
1996,
2445,
2391,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
3444,
1035,
2862,
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... |
vuejs/vue-cli | packages/@vue/cli-service-global/lib/util.js | fileExistsWithCaseSync | function fileExistsWithCaseSync (filepath) {
const { base, dir, root } = path.parse(filepath)
if (dir === root || dir === '.') {
return true
}
try {
const filenames = fs.readdirSync(dir)
if (!filenames.includes(base)) {
return false
}
} catch (e) {
// dir does not exist
return ... | javascript | function fileExistsWithCaseSync (filepath) {
const { base, dir, root } = path.parse(filepath)
if (dir === root || dir === '.') {
return true
}
try {
const filenames = fs.readdirSync(dir)
if (!filenames.includes(base)) {
return false
}
} catch (e) {
// dir does not exist
return ... | [
"function",
"fileExistsWithCaseSync",
"(",
"filepath",
")",
"{",
"const",
"{",
"base",
",",
"dir",
",",
"root",
"}",
"=",
"path",
".",
"parse",
"(",
"filepath",
")",
"if",
"(",
"dir",
"===",
"root",
"||",
"dir",
"===",
"'.'",
")",
"{",
"return",
"tru... | Based on https://stackoverflow.com/questions/27367261/check-if-file-exists-case-sensitive Case checking is required, to avoid errors raised by case-sensitive-paths-webpack-plugin | [
"Based",
"on",
"https",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"27367261",
"/",
"check",
"-",
"if",
"-",
"file",
"-",
"exists",
"-",
"case",
"-",
"sensitive",
"Case",
"checking",
"is",
"required",
"to",
"avoid",
"errors",
"raised"... | 206803cbefefdfbc7d8ed12440b0b751688b77b2 | https://github.com/vuejs/vue-cli/blob/206803cbefefdfbc7d8ed12440b0b751688b77b2/packages/@vue/cli-service-global/lib/util.js#L8-L26 | train | Check if filepath exists in the current directory | [
30522,
3853,
5371,
10288,
5130,
24415,
18382,
6508,
12273,
1006,
5371,
15069,
1007,
1063,
9530,
3367,
1063,
2918,
1010,
16101,
1010,
7117,
1065,
1027,
4130,
1012,
11968,
3366,
1006,
5371,
15069,
1007,
2065,
1006,
16101,
1027,
1027,
1027,
71... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | src/scales/scale.time.js | function(rawValue) {
if (rawValue && rawValue.t !== undefined) {
rawValue = rawValue.t;
}
return Scale.prototype.getRightValue.call(this, rawValue);
} | javascript | function(rawValue) {
if (rawValue && rawValue.t !== undefined) {
rawValue = rawValue.t;
}
return Scale.prototype.getRightValue.call(this, rawValue);
} | [
"function",
"(",
"rawValue",
")",
"{",
"if",
"(",
"rawValue",
"&&",
"rawValue",
".",
"t",
"!==",
"undefined",
")",
"{",
"rawValue",
"=",
"rawValue",
".",
"t",
";",
"}",
"return",
"Scale",
".",
"prototype",
".",
"getRightValue",
".",
"call",
"(",
"this"... | Allows data to be referenced via 't' attribute | [
"Allows",
"data",
"to",
"be",
"referenced",
"via",
"t",
"attribute"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/scales/scale.time.js#L507-L512 | train | Get the right value of the scale | [
30522,
3853,
1006,
6315,
10175,
5657,
1007,
1063,
2065,
1006,
6315,
10175,
5657,
1004,
1004,
6315,
10175,
5657,
1012,
1056,
999,
1027,
1027,
6151,
28344,
1007,
1063,
6315,
10175,
5657,
1027,
6315,
10175,
5657,
1012,
1056,
1025,
1065,
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... | |
angular/material | src/components/dialog/dialog.js | detachAndClean | function detachAndClean() {
angular.element($document[0].body).removeClass('md-dialog-is-showing');
// Reverse the container stretch if using a content element.
if (options.contentElement) {
options.reverseContainerStretch();
}
// Exposed cleanup function from the $md... | javascript | function detachAndClean() {
angular.element($document[0].body).removeClass('md-dialog-is-showing');
// Reverse the container stretch if using a content element.
if (options.contentElement) {
options.reverseContainerStretch();
}
// Exposed cleanup function from the $md... | [
"function",
"detachAndClean",
"(",
")",
"{",
"angular",
".",
"element",
"(",
"$document",
"[",
"0",
"]",
".",
"body",
")",
".",
"removeClass",
"(",
"'md-dialog-is-showing'",
")",
";",
"// Reverse the container stretch if using a content element.",
"if",
"(",
"option... | Detach the element | [
"Detach",
"the",
"element"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L835-L850 | train | Detaches the dialog element and cleans up the element | [
30522,
3853,
20010,
6776,
5685,
14321,
2319,
1006,
1007,
1063,
16108,
1012,
5783,
1006,
1002,
6254,
1031,
1014,
1033,
1012,
2303,
1007,
1012,
6366,
26266,
1006,
1005,
9108,
1011,
13764,
8649,
1011,
2003,
1011,
4760,
1005,
1007,
30524,
7047,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/api/deprecate.js | deprecateMethod | function deprecateMethod(book, key, fn, msg) {
return function() {
logNotice(book, key, msg);
return fn.apply(this, arguments);
};
} | javascript | function deprecateMethod(book, key, fn, msg) {
return function() {
logNotice(book, key, msg);
return fn.apply(this, arguments);
};
} | [
"function",
"deprecateMethod",
"(",
"book",
",",
"key",
",",
"fn",
",",
"msg",
")",
"{",
"return",
"function",
"(",
")",
"{",
"logNotice",
"(",
"book",
",",
"key",
",",
"msg",
")",
";",
"return",
"fn",
".",
"apply",
"(",
"this",
",",
"arguments",
"... | Deprecate a function
@param {Book|Output} book
@param {String} key: unique identitifer for the deprecated
@param {Function} fn
@param {String} msg: message to print when called
@return {Function} | [
"Deprecate",
"a",
"function"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/api/deprecate.js#L32-L38 | train | Deprecate a method | [
30522,
3853,
2139,
28139,
16280,
11368,
6806,
2094,
1006,
2338,
1010,
3145,
1010,
1042,
2078,
1010,
5796,
2290,
1007,
1063,
2709,
3853,
1006,
1007,
1063,
8833,
17048,
6610,
1006,
2338,
1010,
3145,
1010,
5796,
2290,
1007,
1025,
2709,
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... |
chriso/validator.js | lib/isCreditCard.js | isCreditCard | function isCreditCard(str) {
(0, _assertString.default)(str);
var sanitized = str.replace(/[- ]+/g, '');
if (!creditCard.test(sanitized)) {
return false;
}
var sum = 0;
var digit;
var tmpNum;
var shouldDouble;
for (var i = sanitized.length - 1; i >= 0; i--) {
digit = sanitized.substring(i, ... | javascript | function isCreditCard(str) {
(0, _assertString.default)(str);
var sanitized = str.replace(/[- ]+/g, '');
if (!creditCard.test(sanitized)) {
return false;
}
var sum = 0;
var digit;
var tmpNum;
var shouldDouble;
for (var i = sanitized.length - 1; i >= 0; i--) {
digit = sanitized.substring(i, ... | [
"function",
"isCreditCard",
"(",
"str",
")",
"{",
"(",
"0",
",",
"_assertString",
".",
"default",
")",
"(",
"str",
")",
";",
"var",
"sanitized",
"=",
"str",
".",
"replace",
"(",
"/",
"[- ]+",
"/",
"g",
",",
"''",
")",
";",
"if",
"(",
"!",
"credit... | /* eslint-enable max-len | [
"/",
"*",
"eslint",
"-",
"enable",
"max",
"-",
"len"
] | 63e4c78f07d08543af4be7b6c2c9cf24df009003 | https://github.com/chriso/validator.js/blob/63e4c78f07d08543af4be7b6c2c9cf24df009003/lib/isCreditCard.js#L16-L49 | train | Check if a string is a credit card | [
30522,
3853,
2003,
16748,
23194,
11522,
1006,
2358,
2099,
30524,
1005,
1005,
1007,
1025,
2065,
1006,
999,
4923,
11522,
1012,
3231,
1006,
2624,
25090,
5422,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
13075,
7680,
1027,
1014,
1025,
13075,
1534... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/mergeCell.js | _updateRowMergeWith | function _updateRowMergeWith(targetRows, startColIndex, endColIndex, rowMergeWith) {
const limitColIndex = endColIndex + 1;
targetRows.forEach(rowData => {
rowData.slice(startColIndex, limitColIndex).forEach(cellData => {
cellData.rowMergeWith = rowMergeWith;
});
});
} | javascript | function _updateRowMergeWith(targetRows, startColIndex, endColIndex, rowMergeWith) {
const limitColIndex = endColIndex + 1;
targetRows.forEach(rowData => {
rowData.slice(startColIndex, limitColIndex).forEach(cellData => {
cellData.rowMergeWith = rowMergeWith;
});
});
} | [
"function",
"_updateRowMergeWith",
"(",
"targetRows",
",",
"startColIndex",
",",
"endColIndex",
",",
"rowMergeWith",
")",
"{",
"const",
"limitColIndex",
"=",
"endColIndex",
"+",
"1",
";",
"targetRows",
".",
"forEach",
"(",
"rowData",
"=>",
"{",
"rowData",
".",
... | Update rowMergeWith property of target rows for row merge.
@param {Array.<Array.<object>>} targetRows - target rows
@param {number} startColIndex - start column index
@param {number} endColIndex - end column index
@param {number} rowMergeWith - index of row merger
@private | [
"Update",
"rowMergeWith",
"property",
"of",
"target",
"rows",
"for",
"row",
"merge",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/mergeCell.js#L99-L107 | train | Update the rowMergeWith property of the target rows | [
30522,
3853,
1035,
10651,
10524,
5017,
3351,
24415,
1006,
4539,
10524,
2015,
1010,
2707,
25778,
22254,
10288,
1010,
2203,
25778,
22254,
10288,
1010,
5216,
5017,
3351,
24415,
1007,
1063,
9530,
3367,
5787,
25778,
22254,
10288,
1027,
2203,
25778... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
pixijs/pixi.js | packages/prepare/src/BasePrepare.js | findTexture | function findTexture(item, queue)
{
if (item._texture && item._texture instanceof Texture)
{
const texture = item._texture.baseTexture;
if (queue.indexOf(texture) === -1)
{
queue.push(texture);
}
return true;
}
return false;
} | javascript | function findTexture(item, queue)
{
if (item._texture && item._texture instanceof Texture)
{
const texture = item._texture.baseTexture;
if (queue.indexOf(texture) === -1)
{
queue.push(texture);
}
return true;
}
return false;
} | [
"function",
"findTexture",
"(",
"item",
",",
"queue",
")",
"{",
"if",
"(",
"item",
".",
"_texture",
"&&",
"item",
".",
"_texture",
"instanceof",
"Texture",
")",
"{",
"const",
"texture",
"=",
"item",
".",
"_texture",
".",
"baseTexture",
";",
"if",
"(",
... | Built-in hook to find textures from objects.
@private
@param {PIXI.DisplayObject} item - Display object to check
@param {Array<*>} queue - Collection of items to upload
@return {boolean} if a PIXI.Texture object was found. | [
"Built",
"-",
"in",
"hook",
"to",
"find",
"textures",
"from",
"objects",
"."
] | 99ae03b7565ae7ca5a6de633b0a277f7128fa4d0 | https://github.com/pixijs/pixi.js/blob/99ae03b7565ae7ca5a6de633b0a277f7128fa4d0/packages/prepare/src/BasePrepare.js#L380-L395 | train | Find a texture in the queue | [
30522,
3853,
2424,
18209,
5397,
1006,
8875,
1010,
24240,
1007,
1063,
2065,
1006,
8875,
1012,
1035,
14902,
1004,
1004,
8875,
1012,
1035,
14902,
6013,
11253,
14902,
1007,
1063,
9530,
3367,
14902,
1027,
8875,
1012,
1035,
14902,
1012,
2918,
182... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | packages/vue-server-renderer/build.js | set | function set (target, key, val) {
if (Array.isArray(target) && typeof key === 'number') {
target.length = Math.max(target.length, key);
target.splice(key, 1, val);
return val
}
if (hasOwn(target, key)) {
target[key] = val;
return val
}
var ob = (target ).__ob__;
if (target._isVue || (ob ... | javascript | function set (target, key, val) {
if (Array.isArray(target) && typeof key === 'number') {
target.length = Math.max(target.length, key);
target.splice(key, 1, val);
return val
}
if (hasOwn(target, key)) {
target[key] = val;
return val
}
var ob = (target ).__ob__;
if (target._isVue || (ob ... | [
"function",
"set",
"(",
"target",
",",
"key",
",",
"val",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"target",
")",
"&&",
"typeof",
"key",
"===",
"'number'",
")",
"{",
"target",
".",
"length",
"=",
"Math",
".",
"max",
"(",
"target",
".",
... | Set a property on an object. Adds the new property and
triggers change notification if the property doesn't
already exist. | [
"Set",
"a",
"property",
"on",
"an",
"object",
".",
"Adds",
"the",
"new",
"property",
"and",
"triggers",
"change",
"notification",
"if",
"the",
"property",
"doesn",
"t",
"already",
"exist",
"."
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-server-renderer/build.js#L1104-L1129 | train | Set a value to a property in a target object. | [
30522,
3853,
2275,
1006,
4539,
1010,
3145,
1010,
11748,
1007,
1063,
2065,
1006,
9140,
1012,
18061,
11335,
2100,
1006,
4539,
1007,
1004,
1004,
2828,
11253,
3145,
1027,
1027,
1027,
1005,
2193,
1005,
1007,
1063,
4539,
1012,
3091,
1027,
8785,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/array-callback-return.js | checkLastSegment | function checkLastSegment(node) {
if (funcInfo.shouldCheck &&
funcInfo.codePath.currentSegments.some(isReachable)
) {
context.report({
node,
loc: getLocation(node, context.getSourceCode()).loc.start,
mess... | javascript | function checkLastSegment(node) {
if (funcInfo.shouldCheck &&
funcInfo.codePath.currentSegments.some(isReachable)
) {
context.report({
node,
loc: getLocation(node, context.getSourceCode()).loc.start,
mess... | [
"function",
"checkLastSegment",
"(",
"node",
")",
"{",
"if",
"(",
"funcInfo",
".",
"shouldCheck",
"&&",
"funcInfo",
".",
"codePath",
".",
"currentSegments",
".",
"some",
"(",
"isReachable",
")",
")",
"{",
"context",
".",
"report",
"(",
"{",
"node",
",",
... | Checks whether or not the last code path segment is reachable.
Then reports this function if the segment is reachable.
If the last code path segment is reachable, there are paths which are not
returned or thrown.
@param {ASTNode} node - A node to check.
@returns {void} | [
"Checks",
"whether",
"or",
"not",
"the",
"last",
"code",
"path",
"segment",
"is",
"reachable",
".",
"Then",
"reports",
"this",
"function",
"if",
"the",
"segment",
"is",
"reachable",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/array-callback-return.js#L195-L210 | train | Check last segment of function node | [
30522,
3853,
4638,
8523,
3215,
13910,
3672,
1006,
13045,
1007,
1063,
2065,
1006,
4569,
15459,
14876,
1012,
2323,
5403,
3600,
1004,
1004,
4569,
15459,
14876,
1012,
3642,
15069,
1012,
14731,
13910,
8163,
1012,
2070,
1006,
2003,
16416,
7507,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/atoms/events.js | createNativeTouchList | function createNativeTouchList(touchListArgs) {
var touches = goog.array.map(touchListArgs, function(touchArg) {
return doc.createTouch(view, target, touchArg.identifier,
touchArg.pageX, touchArg.pageY, touchArg.screenX, touchArg.screenY);
});
return doc.createTouchList.apply(doc, touches);... | javascript | function createNativeTouchList(touchListArgs) {
var touches = goog.array.map(touchListArgs, function(touchArg) {
return doc.createTouch(view, target, touchArg.identifier,
touchArg.pageX, touchArg.pageY, touchArg.screenX, touchArg.screenY);
});
return doc.createTouchList.apply(doc, touches);... | [
"function",
"createNativeTouchList",
"(",
"touchListArgs",
")",
"{",
"var",
"touches",
"=",
"goog",
".",
"array",
".",
"map",
"(",
"touchListArgs",
",",
"function",
"(",
"touchArg",
")",
"{",
"return",
"doc",
".",
"createTouch",
"(",
"view",
",",
"target",
... | Creates a TouchList, using native touch Api, for touch events. | [
"Creates",
"a",
"TouchList",
"using",
"native",
"touch",
"Api",
"for",
"touch",
"events",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/atoms/events.js#L493-L500 | train | Creates a native touch list. | [
30522,
3853,
3443,
19833,
3512,
24826,
2818,
9863,
1006,
3543,
9863,
2906,
5620,
1007,
1063,
13075,
12817,
1027,
27571,
2290,
1012,
9140,
1012,
4949,
1006,
3543,
9863,
2906,
5620,
1010,
3853,
1006,
3543,
2906,
2290,
1007,
1063,
2709,
9986,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
exceljs/exceljs | lib/utils/stream-buf.js | function(target, targetOffset, offset, length) {
return this.toBuffer().copy(target, targetOffset, offset, length);
} | javascript | function(target, targetOffset, offset, length) {
return this.toBuffer().copy(target, targetOffset, offset, length);
} | [
"function",
"(",
"target",
",",
"targetOffset",
",",
"offset",
",",
"length",
")",
"{",
"return",
"this",
".",
"toBuffer",
"(",
")",
".",
"copy",
"(",
"target",
",",
"targetOffset",
",",
"offset",
",",
"length",
")",
";",
"}"
] | copy to target buffer | [
"copy",
"to",
"target",
"buffer"
] | c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2 | https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/utils/stream-buf.js#L21-L23 | train | Copy the contents of the sequence to a buffer. | [
30522,
3853,
1006,
4539,
1010,
4539,
27475,
3388,
1010,
16396,
1010,
3091,
1007,
1063,
2709,
2023,
1012,
2000,
8569,
12494,
1006,
1007,
1012,
6100,
1006,
4539,
1010,
4539,
27475,
3388,
1010,
16396,
1010,
3091,
1007,
1025,
1065,
102,
30524,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
zeit/now-cli | src/commands/certs/ls.js | sortByCn | function sortByCn(certsList) {
return certsList.concat().sort((a, b) => {
const domainA = psl.get(a.cns[0].replace('*', 'wildcard'));
const domainB = psl.get(b.cns[0].replace('*', 'wildcard'));
if (!domainA || !domainB) return 0;
return domainA.localeCompare(domainB);
});
} | javascript | function sortByCn(certsList) {
return certsList.concat().sort((a, b) => {
const domainA = psl.get(a.cns[0].replace('*', 'wildcard'));
const domainB = psl.get(b.cns[0].replace('*', 'wildcard'));
if (!domainA || !domainB) return 0;
return domainA.localeCompare(domainB);
});
} | [
"function",
"sortByCn",
"(",
"certsList",
")",
"{",
"return",
"certsList",
".",
"concat",
"(",
")",
".",
"sort",
"(",
"(",
"a",
",",
"b",
")",
"=>",
"{",
"const",
"domainA",
"=",
"psl",
".",
"get",
"(",
"a",
".",
"cns",
"[",
"0",
"]",
".",
"rep... | This function sorts the list of certs by root domain changing *
to 'wildcard' since that will allow psl get the root domain
properly to make the comparison. | [
"This",
"function",
"sorts",
"the",
"list",
"of",
"certs",
"by",
"root",
"domain",
"changing",
"*",
"to",
"wildcard",
"since",
"that",
"will",
"allow",
"psl",
"get",
"the",
"root",
"domain",
"properly",
"to",
"make",
"the",
"comparison",
"."
] | b53d907b745126113bc3e251ac2451088026a363 | https://github.com/zeit/now-cli/blob/b53d907b745126113bc3e251ac2451088026a363/src/commands/certs/ls.js#L125-L132 | train | Sort by CN | [
30522,
3853,
4066,
3762,
2278,
2078,
1006,
8292,
21217,
9863,
1007,
1063,
2709,
8292,
21217,
9863,
1012,
9530,
11266,
1006,
1007,
1012,
4066,
1006,
1006,
1037,
1010,
1038,
1007,
1027,
1028,
1063,
9530,
3367,
5884,
2050,
1027,
8827,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/radioButton/radio-button.js | mdRadioGroupDirective | function mdRadioGroupDirective($mdUtil, $mdConstant, $mdTheming, $timeout) {
RadioGroupController.prototype = createRadioGroupControllerProto();
return {
restrict: 'E',
controller: ['$element', RadioGroupController],
require: ['mdRadioGroup', '?ngModel'],
link: { pre: linkRadioGroup }
};
funct... | javascript | function mdRadioGroupDirective($mdUtil, $mdConstant, $mdTheming, $timeout) {
RadioGroupController.prototype = createRadioGroupControllerProto();
return {
restrict: 'E',
controller: ['$element', RadioGroupController],
require: ['mdRadioGroup', '?ngModel'],
link: { pre: linkRadioGroup }
};
funct... | [
"function",
"mdRadioGroupDirective",
"(",
"$mdUtil",
",",
"$mdConstant",
",",
"$mdTheming",
",",
"$timeout",
")",
"{",
"RadioGroupController",
".",
"prototype",
"=",
"createRadioGroupControllerProto",
"(",
")",
";",
"return",
"{",
"restrict",
":",
"'E'",
",",
"con... | @ngdoc directive
@module material.components.radioButton
@name mdRadioGroup
@restrict E
@description
The `<md-radio-group>` directive identifies a grouping
container for the 1..n grouped radio buttons; specified using nested
`<md-radio-button>` elements.
The radio button uses the accent color by default. The primary... | [
"@ngdoc",
"directive",
"@module",
"material",
".",
"components",
".",
"radioButton",
"@name",
"mdRadioGroup"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/radioButton/radio-button.js#L47-L206 | train | Directive for RadioGroup | [
30522,
3853,
9108,
12173,
3695,
17058,
4305,
2890,
15277,
1006,
1002,
9108,
21823,
2140,
1010,
1002,
9108,
8663,
12693,
2102,
1010,
1002,
9108,
10760,
6562,
1010,
1002,
2051,
5833,
1007,
1063,
2557,
17058,
8663,
13181,
10820,
1012,
8773,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function (oInstance, sMetaPath, mTypeForMetaPath) {
var aFilters = [],
sKey,
mKey2Value = _Helper.getKeyProperties(oInstance, sMetaPath, mTypeForMetaPath);
if (!mKey2Value) {
return undefined;
}
for (sKey in mKey2Value) {
aFilters.push(sKey + " eq " + mKey2Value[sKey]);
}
return aFil... | javascript | function (oInstance, sMetaPath, mTypeForMetaPath) {
var aFilters = [],
sKey,
mKey2Value = _Helper.getKeyProperties(oInstance, sMetaPath, mTypeForMetaPath);
if (!mKey2Value) {
return undefined;
}
for (sKey in mKey2Value) {
aFilters.push(sKey + " eq " + mKey2Value[sKey]);
}
return aFil... | [
"function",
"(",
"oInstance",
",",
"sMetaPath",
",",
"mTypeForMetaPath",
")",
"{",
"var",
"aFilters",
"=",
"[",
"]",
",",
"sKey",
",",
"mKey2Value",
"=",
"_Helper",
".",
"getKeyProperties",
"(",
"oInstance",
",",
"sMetaPath",
",",
"mTypeForMetaPath",
")",
";... | Returns a filter identifying the given instance via its key properties.
@param {object} oInstance
Entity instance runtime data
@param {string} sMetaPath
The absolute meta path of the given instance
@param {object} mTypeForMetaPath
Maps meta paths to the corresponding entity or complex types
@returns {string}
A filter ... | [
"Returns",
"a",
"filter",
"identifying",
"the",
"given",
"instance",
"via",
"its",
"key",
"properties",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L501-L514 | train | Returns the filter string for the given key | [
30522,
3853,
1006,
1051,
7076,
26897,
1010,
15488,
12928,
15069,
1010,
11047,
18863,
14192,
12928,
15069,
1007,
1063,
13075,
28697,
21928,
2015,
1027,
1031,
1033,
1010,
15315,
3240,
1010,
12395,
3240,
2475,
10175,
5657,
1027,
1035,
2393,
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... | |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableUtils.js | function(oTable, iRowIdx, iColIdx, bIdxInColumnAgg) {
var oRow = iRowIdx >= 0 && iRowIdx < oTable.getRows().length ? oTable.getRows()[iRowIdx] : null;
var aColumns = bIdxInColumnAgg ? oTable.getColumns() : oTable._getVisibleColumns();
var oColumn = iColIdx >= 0 && iColIdx < aColumns.length ? aColumns[iColIdx] ... | javascript | function(oTable, iRowIdx, iColIdx, bIdxInColumnAgg) {
var oRow = iRowIdx >= 0 && iRowIdx < oTable.getRows().length ? oTable.getRows()[iRowIdx] : null;
var aColumns = bIdxInColumnAgg ? oTable.getColumns() : oTable._getVisibleColumns();
var oColumn = iColIdx >= 0 && iColIdx < aColumns.length ? aColumns[iColIdx] ... | [
"function",
"(",
"oTable",
",",
"iRowIdx",
",",
"iColIdx",
",",
"bIdxInColumnAgg",
")",
"{",
"var",
"oRow",
"=",
"iRowIdx",
">=",
"0",
"&&",
"iRowIdx",
"<",
"oTable",
".",
"getRows",
"(",
")",
".",
"length",
"?",
"oTable",
".",
"getRows",
"(",
")",
"... | Returns the Row, Column and Cell instances for the given row index (in the rows aggregation)
and column index (in the array of visible columns (see Table._getVisibleColumns()).
@param {sap.ui.table.Table} oTable Instance of the table.
@param {int} iRowIdx Index of row in the tables rows aggregation.
@param {int} iColI... | [
"Returns",
"the",
"Row",
"Column",
"and",
"Cell",
"instances",
"for",
"the",
"given",
"row",
"index",
"(",
"in",
"the",
"rows",
"aggregation",
")",
"and",
"column",
"index",
"(",
"in",
"the",
"array",
"of",
"visible",
"columns",
"(",
"see",
"Table",
".",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L828-L851 | train | Returns the cell for the given row and column. | [
30522,
3853,
1006,
27178,
3085,
1010,
20868,
5004,
3593,
2595,
1010,
24582,
10893,
2094,
2595,
30524,
3085,
1012,
2131,
10524,
2015,
1006,
1007,
1012,
3091,
1029,
27178,
3085,
1012,
2131,
10524,
2015,
1006,
1007,
1031,
20868,
5004,
3593,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/QuickOpenJavaScript/main.js | createFunctionList | function createFunctionList() {
var doc = DocumentManager.getCurrentDocument();
if (!doc) {
return;
}
var functionList = [];
var docText = doc.getText();
var lines = docText.split("\n");
var functions = JSUtils.findAllMatchingFunctionsInText(docText, ... | javascript | function createFunctionList() {
var doc = DocumentManager.getCurrentDocument();
if (!doc) {
return;
}
var functionList = [];
var docText = doc.getText();
var lines = docText.split("\n");
var functions = JSUtils.findAllMatchingFunctionsInText(docText, ... | [
"function",
"createFunctionList",
"(",
")",
"{",
"var",
"doc",
"=",
"DocumentManager",
".",
"getCurrentDocument",
"(",
")",
";",
"if",
"(",
"!",
"doc",
")",
"{",
"return",
";",
"}",
"var",
"functionList",
"=",
"[",
"]",
";",
"var",
"docText",
"=",
"doc... | Contains a list of information about functions for a single document.
@return {?Array.<FileLocation>} | [
"Contains",
"a",
"list",
"of",
"information",
"about",
"functions",
"for",
"a",
"single",
"document",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/QuickOpenJavaScript/main.js#L57-L71 | train | Create a list of file locations for functions | [
30522,
3853,
3443,
11263,
27989,
9863,
1006,
1007,
1063,
13075,
9986,
1027,
6254,
24805,
4590,
1012,
2131,
10841,
14343,
3372,
3527,
24894,
4765,
1006,
1007,
1025,
2065,
1006,
999,
9986,
1007,
1063,
2709,
1025,
1065,
13075,
3853,
9863,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/SubApiDetail.controller.js | function (oControlData, oEntityData) {
var FIRST_COLUMN = 0,
SECOND_COLUMN = 1,
THIRD_COLUMN = 2,
ENTITIES_PER_COLUMN = 3,
aHeaderControls = [[], [], []],
oHeaderLayoutUtil = this._getHeaderLayoutUtil(),
aSubClasses = oEntityData.extendedBy || oEntityData.implementedBy || [],
aHea... | javascript | function (oControlData, oEntityData) {
var FIRST_COLUMN = 0,
SECOND_COLUMN = 1,
THIRD_COLUMN = 2,
ENTITIES_PER_COLUMN = 3,
aHeaderControls = [[], [], []],
oHeaderLayoutUtil = this._getHeaderLayoutUtil(),
aSubClasses = oEntityData.extendedBy || oEntityData.implementedBy || [],
aHea... | [
"function",
"(",
"oControlData",
",",
"oEntityData",
")",
"{",
"var",
"FIRST_COLUMN",
"=",
"0",
",",
"SECOND_COLUMN",
"=",
"1",
",",
"THIRD_COLUMN",
"=",
"2",
",",
"ENTITIES_PER_COLUMN",
"=",
"3",
",",
"aHeaderControls",
"=",
"[",
"[",
"]",
",",
"[",
"]"... | Builds the header layout structure.
The header displays the entity data in 3 columns
and each column can consist of 3 key-value pairs at most.
@param {object} oControlData main control data object source
@param {object} oEntityData additional data object source | [
"Builds",
"the",
"header",
"layout",
"structure",
".",
"The",
"header",
"displays",
"the",
"entity",
"data",
"in",
"3",
"columns",
"and",
"each",
"column",
"can",
"consist",
"of",
"3",
"key",
"-",
"value",
"pairs",
"at",
"most",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/SubApiDetail.controller.js#L468-L526 | train | Creates a header control structure for the given control and entity data. | [
30522,
3853,
1006,
1051,
8663,
13181,
15150,
2696,
1010,
1051,
4765,
3012,
2850,
2696,
1007,
1063,
13075,
2034,
1035,
5930,
1027,
1014,
1010,
2117,
1035,
5930,
1027,
1015,
1010,
2353,
1035,
5930,
1027,
1016,
1010,
11422,
1035,
2566,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
NetEase/pomelo | lib/common/service/channelService.js | function(app, opts) {
opts = opts || {};
this.app = app;
this.channels = {};
this.prefix = opts.prefix;
this.store = opts.store;
this.broadcastFilter = opts.broadcastFilter;
this.channelRemote = new ChannelRemote(app);
} | javascript | function(app, opts) {
opts = opts || {};
this.app = app;
this.channels = {};
this.prefix = opts.prefix;
this.store = opts.store;
this.broadcastFilter = opts.broadcastFilter;
this.channelRemote = new ChannelRemote(app);
} | [
"function",
"(",
"app",
",",
"opts",
")",
"{",
"opts",
"=",
"opts",
"||",
"{",
"}",
";",
"this",
".",
"app",
"=",
"app",
";",
"this",
".",
"channels",
"=",
"{",
"}",
";",
"this",
".",
"prefix",
"=",
"opts",
".",
"prefix",
";",
"this",
".",
"s... | Create and maintain channels for server local.
ChannelService is created by channel component which is a default loaded
component of pomelo and channel service would be accessed by `app.get('channelService')`.
@class
@constructor | [
"Create",
"and",
"maintain",
"channels",
"for",
"server",
"local",
"."
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/common/service/channelService.js#L21-L29 | train | A class that represents a cluster of channels. | [
30522,
3853,
1006,
10439,
1010,
23569,
2015,
1007,
1063,
23569,
2015,
1027,
23569,
2015,
1064,
1064,
1063,
1065,
1025,
2023,
1012,
10439,
1027,
10439,
1025,
2023,
1012,
6833,
1027,
1063,
1065,
1025,
2023,
1012,
17576,
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/thirdparty/qunit.js | function( name, testEnvironment ) {
var currentModule = {
name: name,
testEnvironment: testEnvironment,
tests: []
};
// DEPRECATED: handles setup/teardown functions,
// beforeEach and afterEach should be used instead
if ( testEnvironment && testEnvironment.setup ) {
testEnvironment.beforeEach = t... | javascript | function( name, testEnvironment ) {
var currentModule = {
name: name,
testEnvironment: testEnvironment,
tests: []
};
// DEPRECATED: handles setup/teardown functions,
// beforeEach and afterEach should be used instead
if ( testEnvironment && testEnvironment.setup ) {
testEnvironment.beforeEach = t... | [
"function",
"(",
"name",
",",
"testEnvironment",
")",
"{",
"var",
"currentModule",
"=",
"{",
"name",
":",
"name",
",",
"testEnvironment",
":",
"testEnvironment",
",",
"tests",
":",
"[",
"]",
"}",
";",
"// DEPRECATED: handles setup/teardown functions,",
"// beforeE... | call on start of module test to prepend name to all tests | [
"call",
"on",
"start",
"of",
"module",
"test",
"to",
"prepend",
"name",
"to",
"all",
"tests"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/qunit.js#L230-L250 | train | Adds a module to the configuration | [
30522,
3853,
1006,
2171,
1010,
3231,
2368,
21663,
2239,
3672,
1007,
1063,
13075,
2783,
5302,
8566,
2571,
1027,
1063,
2171,
1024,
2171,
1010,
3231,
2368,
21663,
2239,
3672,
1024,
3231,
2368,
21663,
2239,
3672,
1010,
5852,
1024,
1031,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js | function(oList){
var oAtt = oList._getAtt();
if (oAtt && !oList._isTop()) {
oList.$("head-txt").html(encodeXML(oAtt.getText())
+ "<span class=\"sapUiUx3ExactLstHeadInfo\"> (" + oList._lb.getSelectedIndices().length + "/" + oList._lb.getItems().length + ")</span>");
}
} | javascript | function(oList){
var oAtt = oList._getAtt();
if (oAtt && !oList._isTop()) {
oList.$("head-txt").html(encodeXML(oAtt.getText())
+ "<span class=\"sapUiUx3ExactLstHeadInfo\"> (" + oList._lb.getSelectedIndices().length + "/" + oList._lb.getItems().length + ")</span>");
}
} | [
"function",
"(",
"oList",
")",
"{",
"var",
"oAtt",
"=",
"oList",
".",
"_getAtt",
"(",
")",
";",
"if",
"(",
"oAtt",
"&&",
"!",
"oList",
".",
"_isTop",
"(",
")",
")",
"{",
"oList",
".",
"$",
"(",
"\"head-txt\"",
")",
".",
"html",
"(",
"encodeXML",
... | Refresh the header text of the list | [
"Refresh",
"the",
"header",
"text",
"of",
"the",
"list"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1213-L1219 | train | Sets the head text of the list | [
30522,
3853,
1006,
19330,
2923,
1007,
1063,
13075,
1051,
19321,
1027,
19330,
2923,
1012,
1035,
2131,
19321,
1006,
1007,
1025,
2065,
1006,
1051,
19321,
1004,
1004,
999,
19330,
2923,
1012,
1035,
21541,
7361,
1006,
1007,
1007,
1063,
19330,
292... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/document/DocumentManager.js | closeFullEditor | function closeFullEditor(file) {
DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE, {File: file} instead of DocumentManager.closeFullEditor()", true);
CommandManager.execute(Commands.FILE_CLOSE, {File: file});
} | javascript | function closeFullEditor(file) {
DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE, {File: file} instead of DocumentManager.closeFullEditor()", true);
CommandManager.execute(Commands.FILE_CLOSE, {File: file});
} | [
"function",
"closeFullEditor",
"(",
"file",
")",
"{",
"DeprecationWarning",
".",
"deprecationWarning",
"(",
"\"Use CommandManager.execute(Commands.FILE_CLOSE, {File: file} instead of DocumentManager.closeFullEditor()\"",
",",
"true",
")",
";",
"CommandManager",
".",
"execute",
"(... | closes the specified file file
@deprecated use CommandManager.execute(Commands.FILE_CLOSE, {File: file}) instead
@param {!File} file - the file to close | [
"closes",
"the",
"specified",
"file",
"file"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L247-L250 | train | Closes the full editor | [
30522,
3853,
2485,
3993,
3709,
15660,
1006,
5371,
1007,
1063,
2139,
28139,
10719,
9028,
5582,
1012,
2139,
28139,
10719,
9028,
5582,
1006,
1000,
2224,
3094,
24805,
4590,
1012,
15389,
1006,
10954,
1012,
5371,
1035,
2485,
1010,
1063,
5371,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/util/util.js | getClosest | function getClosest(el, validateWith, onlyParent) {
if (angular.isString(validateWith)) {
var tagName = validateWith.toUpperCase();
validateWith = function(el) {
return el.nodeName.toUpperCase() === tagName;
};
}
if (el instanceof angular.element) el = el[0];
i... | javascript | function getClosest(el, validateWith, onlyParent) {
if (angular.isString(validateWith)) {
var tagName = validateWith.toUpperCase();
validateWith = function(el) {
return el.nodeName.toUpperCase() === tagName;
};
}
if (el instanceof angular.element) el = el[0];
i... | [
"function",
"getClosest",
"(",
"el",
",",
"validateWith",
",",
"onlyParent",
")",
"{",
"if",
"(",
"angular",
".",
"isString",
"(",
"validateWith",
")",
")",
"{",
"var",
"tagName",
"=",
"validateWith",
".",
"toUpperCase",
"(",
")",
";",
"validateWith",
"=",... | getClosest replicates jQuery.closest() to walk up the DOM tree until it finds a matching
nodeName.
@param {Node} el Element to start walking the DOM from
@param {string|function} validateWith If a string is passed, it will be evaluated against
each of the parent nodes' tag name. If a function is passed, the loop will ... | [
"getClosest",
"replicates",
"jQuery",
".",
"closest",
"()",
"to",
"walk",
"up",
"the",
"DOM",
"tree",
"until",
"it",
"finds",
"a",
"matching",
"nodeName",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L551-L570 | train | Returns closest ancestor element | [
30522,
3853,
2131,
20464,
27465,
2102,
1006,
3449,
1010,
9398,
3686,
24415,
1010,
2069,
19362,
4765,
1007,
1063,
2065,
1006,
16108,
1012,
26354,
18886,
3070,
1006,
9398,
3686,
24415,
1007,
1007,
1063,
13075,
6415,
18442,
1027,
9398,
3686,
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... |
swimlane/ngx-datatable | release/utils/math.js | getTotalFlexGrow | function getTotalFlexGrow(columns) {
var totalFlexGrow = 0;
for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
var c = columns_1[_i];
totalFlexGrow += c.flexGrow || 0;
}
return totalFlexGrow;
} | javascript | function getTotalFlexGrow(columns) {
var totalFlexGrow = 0;
for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
var c = columns_1[_i];
totalFlexGrow += c.flexGrow || 0;
}
return totalFlexGrow;
} | [
"function",
"getTotalFlexGrow",
"(",
"columns",
")",
"{",
"var",
"totalFlexGrow",
"=",
"0",
";",
"for",
"(",
"var",
"_i",
"=",
"0",
",",
"columns_1",
"=",
"columns",
";",
"_i",
"<",
"columns_1",
".",
"length",
";",
"_i",
"++",
")",
"{",
"var",
"c",
... | Calculates the Total Flex Grow | [
"Calculates",
"the",
"Total",
"Flex",
"Grow"
] | d7df15a070282a169524dba51d9572008b74804c | https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/math.js#L7-L14 | train | Get total flex grow | [
30522,
3853,
2131,
3406,
9080,
21031,
2595,
16523,
5004,
1006,
7753,
1007,
1063,
13075,
2561,
21031,
2595,
16523,
5004,
1027,
1014,
1025,
2005,
1006,
13075,
1035,
1045,
1027,
1014,
1010,
7753,
1035,
1015,
1027,
7753,
1025,
1035,
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... |
eslint/eslint | lib/rules/no-await-in-loop.js | isBoundary | function isBoundary(node) {
const t = node.type;
return (
t === "FunctionDeclaration" ||
t === "FunctionExpression" ||
t === "ArrowFunctionExpression" ||
/*
* Don't report the await expressions on for-await-of loop since it's
* asynchronous iteration intention... | javascript | function isBoundary(node) {
const t = node.type;
return (
t === "FunctionDeclaration" ||
t === "FunctionExpression" ||
t === "ArrowFunctionExpression" ||
/*
* Don't report the await expressions on for-await-of loop since it's
* asynchronous iteration intention... | [
"function",
"isBoundary",
"(",
"node",
")",
"{",
"const",
"t",
"=",
"node",
".",
"type",
";",
"return",
"(",
"t",
"===",
"\"FunctionDeclaration\"",
"||",
"t",
"===",
"\"FunctionExpression\"",
"||",
"t",
"===",
"\"ArrowFunctionExpression\"",
"||",
"/*\n *... | Check whether it should stop traversing ancestors at the given node.
@param {ASTNode} node A node to check.
@returns {boolean} `true` if it should stop traversing. | [
"Check",
"whether",
"it",
"should",
"stop",
"traversing",
"ancestors",
"at",
"the",
"given",
"node",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-await-in-loop.js#L12-L26 | train | Check if a node is a boundary | [
30522,
3853,
2003,
15494,
5649,
1006,
13045,
1007,
1063,
9530,
3367,
1056,
1027,
13045,
1012,
2828,
1025,
2709,
1006,
1056,
1027,
1027,
1027,
1000,
3853,
3207,
20464,
25879,
3258,
1000,
1064,
1064,
1056,
1027,
1027,
1027,
1000,
3853,
10288,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.unified/src/sap/ui/unified/CalendarTimeInterval.js | _hideYearPicker | function _hideYearPicker(bSkipFocus){
this._iMode = 0;
var oYearPicker = this.getAggregation("yearPicker");
oYearPicker.$().css("display", "none");
this._hideOverlay();
if (!bSkipFocus) {
_renderTimesRow.call(this); // to focus date
// restore tabindex because if date not changed in _renderTimesRow... | javascript | function _hideYearPicker(bSkipFocus){
this._iMode = 0;
var oYearPicker = this.getAggregation("yearPicker");
oYearPicker.$().css("display", "none");
this._hideOverlay();
if (!bSkipFocus) {
_renderTimesRow.call(this); // to focus date
// restore tabindex because if date not changed in _renderTimesRow... | [
"function",
"_hideYearPicker",
"(",
"bSkipFocus",
")",
"{",
"this",
".",
"_iMode",
"=",
"0",
";",
"var",
"oYearPicker",
"=",
"this",
".",
"getAggregation",
"(",
"\"yearPicker\"",
")",
";",
"oYearPicker",
".",
"$",
"(",
")",
".",
"css",
"(",
"\"display\"",
... | Hides an embedded year Picker.
This function assumes there is a "yearPicker" aggregation.
So callers must take care.
@return {void}
@private | [
"Hides",
"an",
"embedded",
"year",
"Picker",
".",
"This",
"function",
"assumes",
"there",
"is",
"a",
"yearPicker",
"aggregation",
".",
"So",
"callers",
"must",
"take",
"care",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.unified/src/sap/ui/unified/CalendarTimeInterval.js#L1573-L1590 | train | Hides the year picker | [
30522,
3853,
1035,
5342,
29100,
24330,
5484,
1006,
18667,
3211,
14376,
10085,
2271,
1007,
1063,
2023,
1012,
1035,
10047,
10244,
1027,
1014,
1025,
13075,
1051,
29100,
24330,
5484,
1027,
2023,
1012,
2131,
8490,
17603,
12540,
1006,
1000,
2095,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/XMLTemplateProcessor.js | createControls | function createControls(node) {
// differentiate between SAPUI5 and plain-HTML children
if (node.namespaceURI === "http://www.w3.org/1999/xhtml" || node.namespaceURI === "http://www.w3.org/2000/svg" ) {
var id = node.attributes['id'] ? node.attributes['id'].textContent || node.attributes['id'].text : null;
... | javascript | function createControls(node) {
// differentiate between SAPUI5 and plain-HTML children
if (node.namespaceURI === "http://www.w3.org/1999/xhtml" || node.namespaceURI === "http://www.w3.org/2000/svg" ) {
var id = node.attributes['id'] ? node.attributes['id'].textContent || node.attributes['id'].text : null;
... | [
"function",
"createControls",
"(",
"node",
")",
"{",
"// differentiate between SAPUI5 and plain-HTML children",
"if",
"(",
"node",
".",
"namespaceURI",
"===",
"\"http://www.w3.org/1999/xhtml\"",
"||",
"node",
".",
"namespaceURI",
"===",
"\"http://www.w3.org/2000/svg\"",
")",
... | Takes an arbitrary node (control or plain HTML) and creates zero or one or more SAPUI5 controls from it,
iterating over the attributes and child nodes.
@return {Promise} resolving to an array with 0..n controls
@private | [
"Takes",
"an",
"arbitrary",
"node",
"(",
"control",
"or",
"plain",
"HTML",
")",
"and",
"creates",
"zero",
"or",
"one",
"or",
"more",
"SAPUI5",
"controls",
"from",
"it",
"iterating",
"over",
"the",
"attributes",
"and",
"child",
"nodes",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/XMLTemplateProcessor.js#L519-L566 | train | Creates controls from the DOM node | [
30522,
3853,
3443,
8663,
13181,
4877,
1006,
13045,
1007,
1063,
1013,
1013,
21032,
2090,
20066,
10179,
2629,
1998,
5810,
1011,
16129,
2336,
2065,
1006,
13045,
1012,
3415,
15327,
9496,
1027,
1027,
1027,
1000,
8299,
1024,
1013,
1013,
7479,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.