repo stringclasses 195
values | path stringlengths 4 99 | func_name stringlengths 0 41 | original_string stringlengths 72 56.1k | language stringclasses 1
value | code stringlengths 72 56.1k | code_tokens listlengths 25 8.12k | docstring stringlengths 2 12.5k | docstring_tokens listlengths 1 449 | sha stringclasses 197
values | url stringlengths 88 186 | partition stringclasses 1
value | summary stringlengths 8 338 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jaywcjlove/linux-command | build/build.js | createStylToCss | function createStylToCss(stylPath) {
return new Promise((resolve, reject) => {
try {
const stylStr = FS.readFileSync(stylPath, 'utf8');
stylus(stylStr.toString())
.set('filename', stylPath)
.set('compress', true)
.render((err, css) => {
if (err) throw err;
r... | javascript | function createStylToCss(stylPath) {
return new Promise((resolve, reject) => {
try {
const stylStr = FS.readFileSync(stylPath, 'utf8');
stylus(stylStr.toString())
.set('filename', stylPath)
.set('compress', true)
.render((err, css) => {
if (err) throw err;
r... | [
"function",
"createStylToCss",
"(",
"stylPath",
")",
"{",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"try",
"{",
"const",
"stylStr",
"=",
"FS",
".",
"readFileSync",
"(",
"stylPath",
",",
"'utf8'",
")",
";",
"stylus",
... | [createStylToCss 生成CSS]
@param {[type]} stylPath stylus path
@param {[type]} cssPath css path | [
"[",
"createStylToCss",
"生成CSS",
"]"
] | 7d6c8c6b3468a0dd5311ee68934c9b8db64469f7 | https://github.com/jaywcjlove/linux-command/blob/7d6c8c6b3468a0dd5311ee68934c9b8db64469f7/build/build.js#L186-L201 | train | Create a stylus file and return it as a css string | [
30522,
3853,
9005,
3723,
23223,
6169,
2015,
1006,
2358,
8516,
15069,
1007,
1063,
2709,
2047,
4872,
1006,
1006,
10663,
1010,
15454,
1007,
1027,
1028,
1063,
3046,
1063,
9530,
3367,
2358,
8516,
3367,
2099,
1027,
1042,
2015,
1012,
3191,
8873,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/PerfUtils.js | getDelimitedPerfData | function getDelimitedPerfData() {
var result = "";
_.forEach(perfData, function (entry, testName) {
result += getValueAsString(entry) + "\t" + testName + "\n";
});
return result;
} | javascript | function getDelimitedPerfData() {
var result = "";
_.forEach(perfData, function (entry, testName) {
result += getValueAsString(entry) + "\t" + testName + "\n";
});
return result;
} | [
"function",
"getDelimitedPerfData",
"(",
")",
"{",
"var",
"result",
"=",
"\"\"",
";",
"_",
".",
"forEach",
"(",
"perfData",
",",
"function",
"(",
"entry",
",",
"testName",
")",
"{",
"result",
"+=",
"getValueAsString",
"(",
"entry",
")",
"+",
"\"\\t\"",
"... | Returns the performance data as a tab delimited string
@return {string} | [
"Returns",
"the",
"performance",
"data",
"as",
"a",
"tab",
"delimited",
"string"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/PerfUtils.js#L343-L350 | train | Returns a string with the data in the delimiter | [
30522,
3853,
2131,
9247,
27605,
3064,
4842,
2546,
2850,
2696,
1006,
1007,
1063,
13075,
2765,
1027,
1000,
1000,
1025,
1035,
1012,
18921,
6776,
1006,
2566,
2546,
2850,
2696,
1010,
3853,
1006,
4443,
1010,
3231,
18442,
1007,
1063,
2765,
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... |
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... |
caolan/async | lib/groupByLimit.js | groupByLimit | function groupByLimit(coll, limit, iteratee, callback) {
var _iteratee = wrapAsync(iteratee);
return mapLimit(coll, limit, (val, iterCb) => {
_iteratee(val, (err, key) => {
if (err) return iterCb(err);
return iterCb(err, {key, val});
});
}, (err, mapResults) => {
... | javascript | function groupByLimit(coll, limit, iteratee, callback) {
var _iteratee = wrapAsync(iteratee);
return mapLimit(coll, limit, (val, iterCb) => {
_iteratee(val, (err, key) => {
if (err) return iterCb(err);
return iterCb(err, {key, val});
});
}, (err, mapResults) => {
... | [
"function",
"groupByLimit",
"(",
"coll",
",",
"limit",
",",
"iteratee",
",",
"callback",
")",
"{",
"var",
"_iteratee",
"=",
"wrapAsync",
"(",
"iteratee",
")",
";",
"return",
"mapLimit",
"(",
"coll",
",",
"limit",
",",
"(",
"val",
",",
"iterCb",
")",
"=... | The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.
@name groupByLimit
@static
@memberOf module:Collections
@method
@see [async.groupBy]{@link module:Collections.groupBy}
@category Collection
@param {Array|Iterable|AsyncIterable|Object} coll - A collectio... | [
"The",
"same",
"as",
"[",
"groupBy",
"]",
"{",
"@link",
"module",
":",
"Collections",
".",
"groupBy",
"}",
"but",
"runs",
"a",
"maximum",
"of",
"limit",
"async",
"operations",
"at",
"a",
"time",
"."
] | 4330d536c106592139fa82062494c9dba0da1fdb | https://github.com/caolan/async/blob/4330d536c106592139fa82062494c9dba0da1fdb/lib/groupByLimit.js#L25-L52 | train | Aliquirer ausímero de código | [
30522,
3853,
2177,
3762,
17960,
4183,
1006,
8902,
2140,
1010,
5787,
1010,
2009,
22139,
2063,
1010,
2655,
5963,
1007,
1063,
13075,
1035,
2009,
22139,
2063,
1027,
10236,
3022,
6038,
2278,
1006,
2009,
22139,
2063,
1007,
1025,
2709,
4949,
17960... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | getConfigForStyleGuide | function getConfigForStyleGuide(guide) {
const guides = {
google: { extends: "google" },
airbnb: { extends: "airbnb" },
"airbnb-base": { extends: "airbnb-base" },
standard: { extends: "standard" }
};
if (!guides[guide]) {
throw new Error("You referenced an unsupporte... | javascript | function getConfigForStyleGuide(guide) {
const guides = {
google: { extends: "google" },
airbnb: { extends: "airbnb" },
"airbnb-base": { extends: "airbnb-base" },
standard: { extends: "standard" }
};
if (!guides[guide]) {
throw new Error("You referenced an unsupporte... | [
"function",
"getConfigForStyleGuide",
"(",
"guide",
")",
"{",
"const",
"guides",
"=",
"{",
"google",
":",
"{",
"extends",
":",
"\"google\"",
"}",
",",
"airbnb",
":",
"{",
"extends",
":",
"\"airbnb\"",
"}",
",",
"\"airbnb-base\"",
":",
"{",
"extends",
":",
... | process user's style guide of choice and return an appropriate config object.
@param {string} guide name of the chosen style guide
@returns {Object} config object | [
"process",
"user",
"s",
"style",
"guide",
"of",
"choice",
"and",
"return",
"an",
"appropriate",
"config",
"object",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-initializer.js#L316-L329 | train | Get the config for a style guide | [
30522,
3853,
2131,
8663,
8873,
25708,
5668,
27983,
28582,
1006,
5009,
1007,
1063,
9530,
3367,
12468,
1027,
1063,
8224,
1024,
1063,
8908,
1024,
1000,
8224,
1000,
1065,
1010,
2250,
24700,
2497,
1024,
1063,
8908,
1024,
1000,
2250,
24700,
2497,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(element) {
var textContent = wysihtml5.lang.string(dom.getTextContent(element)).trim();
if (textContent.substr(0, 4) === "www.") {
textContent = "http://" + textContent;
}
return textContent;
} | javascript | function(element) {
var textContent = wysihtml5.lang.string(dom.getTextContent(element)).trim();
if (textContent.substr(0, 4) === "www.") {
textContent = "http://" + textContent;
}
return textContent;
} | [
"function",
"(",
"element",
")",
"{",
"var",
"textContent",
"=",
"wysihtml5",
".",
"lang",
".",
"string",
"(",
"dom",
".",
"getTextContent",
"(",
"element",
")",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"textContent",
".",
"substr",
"(",
"0",
",",... | Assuming we have the following: <a href="http://www.google.de">http://www.google.de</a> If a user now changes the url in the innerHTML we want to make sure that it's synchronized with the href attribute (as long as the innerHTML is still a url) | [
"Assuming",
"we",
"have",
"the",
"following",
":",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"google",
".",
"de",
">",
"http",
":",
"//",
"www",
".",
"google",
".",
"de<",
"/",
"a",
">",
"If",
"a",
"user",
"now",
"changes",
"the",
"url",
... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L12316-L12322 | train | get the text content of an element | [
30522,
3853,
1006,
5783,
1007,
1063,
13075,
3793,
8663,
6528,
2102,
1027,
1059,
7274,
19190,
21246,
2140,
2629,
1012,
11374,
1012,
5164,
1006,
14383,
1012,
2131,
18209,
8663,
6528,
2102,
1006,
5783,
1007,
1007,
1012,
12241,
1006,
1007,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | bits/48_stybin.js | parse_BrtFmt | function parse_BrtFmt(data, length/*:number*/) {
var numFmtId = data.read_shift(2);
var stFmtCode = parse_XLWideString(data,length-2);
return [numFmtId, stFmtCode];
} | javascript | function parse_BrtFmt(data, length/*:number*/) {
var numFmtId = data.read_shift(2);
var stFmtCode = parse_XLWideString(data,length-2);
return [numFmtId, stFmtCode];
} | [
"function",
"parse_BrtFmt",
"(",
"data",
",",
"length",
"/*:number*/",
")",
"{",
"var",
"numFmtId",
"=",
"data",
".",
"read_shift",
"(",
"2",
")",
";",
"var",
"stFmtCode",
"=",
"parse_XLWideString",
"(",
"data",
",",
"length",
"-",
"2",
")",
";",
"return... | /* [MS-XLSB] 2.4.657 BrtFmt | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"4",
".",
"657",
"BrtFmt"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/48_stybin.js#L2-L6 | train | Parse BrtFmt | [
30522,
3853,
11968,
3366,
1035,
7987,
24475,
20492,
1006,
2951,
1010,
3091,
1013,
1008,
1024,
2193,
1008,
1013,
1007,
1063,
13075,
16371,
2213,
16715,
3775,
2094,
1027,
2951,
1012,
3191,
1035,
5670,
1006,
1016,
1007,
1025,
13075,
2358,
1671... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/keyword-spacing.js | checkSpacingBeforeFirstToken | function checkSpacingBeforeFirstToken(node) {
const firstToken = node && sourceCode.getFirstToken(node);
if (firstToken && firstToken.type === "Keyword") {
checkSpacingBefore(firstToken);
}
} | javascript | function checkSpacingBeforeFirstToken(node) {
const firstToken = node && sourceCode.getFirstToken(node);
if (firstToken && firstToken.type === "Keyword") {
checkSpacingBefore(firstToken);
}
} | [
"function",
"checkSpacingBeforeFirstToken",
"(",
"node",
")",
"{",
"const",
"firstToken",
"=",
"node",
"&&",
"sourceCode",
".",
"getFirstToken",
"(",
"node",
")",
";",
"if",
"(",
"firstToken",
"&&",
"firstToken",
".",
"type",
"===",
"\"Keyword\"",
")",
"{",
... | Reports the first token of a given node if the first token is a keyword
and usage of spacing followed by the token is invalid.
This is used for unary operators (e.g. `typeof`), `function`, and `super`.
Other rules are handling usage of spacing preceded by those keywords.
@param {ASTNode|null} node - A node to report.... | [
"Reports",
"the",
"first",
"token",
"of",
"a",
"given",
"node",
"if",
"the",
"first",
"token",
"is",
"a",
"keyword",
"and",
"usage",
"of",
"spacing",
"followed",
"by",
"the",
"token",
"is",
"invalid",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/keyword-spacing.js#L325-L331 | train | Check spacing before first token | [
30522,
3853,
14148,
19498,
2075,
4783,
29278,
12879,
18894,
9284,
7520,
1006,
13045,
1007,
1063,
9530,
3367,
2034,
18715,
2368,
1027,
13045,
1004,
1004,
3120,
16044,
1012,
2131,
8873,
12096,
18715,
2368,
1006,
13045,
1007,
1025,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
lovell/sharp | lib/colour.js | tint | function tint (rgb) {
const colour = color(rgb);
this.options.tintA = colour.a();
this.options.tintB = colour.b();
return this;
} | javascript | function tint (rgb) {
const colour = color(rgb);
this.options.tintA = colour.a();
this.options.tintB = colour.b();
return this;
} | [
"function",
"tint",
"(",
"rgb",
")",
"{",
"const",
"colour",
"=",
"color",
"(",
"rgb",
")",
";",
"this",
".",
"options",
".",
"tintA",
"=",
"colour",
".",
"a",
"(",
")",
";",
"this",
".",
"options",
".",
"tintB",
"=",
"colour",
".",
"b",
"(",
"... | Tint the image using the provided chroma while preserving the image luminance.
An alpha channel may be present and will be unchanged by the operation.
@param {String|Object} rgb - parsed by the [color](https://www.npmjs.org/package/color) module to extract chroma values.
@returns {Sharp}
@throws {Error} Invalid parame... | [
"Tint",
"the",
"image",
"using",
"the",
"provided",
"chroma",
"while",
"preserving",
"the",
"image",
"luminance",
".",
"An",
"alpha",
"channel",
"may",
"be",
"present",
"and",
"will",
"be",
"unchanged",
"by",
"the",
"operation",
"."
] | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/colour.js#L26-L31 | train | tint color | [
30522,
3853,
9543,
2102,
1006,
1054,
18259,
1007,
1063,
9530,
3367,
6120,
1027,
3609,
1006,
1054,
18259,
1007,
1025,
2023,
1012,
7047,
1012,
9543,
2696,
1027,
6120,
1012,
1037,
1006,
1007,
1025,
2023,
1012,
7047,
1012,
9543,
2102,
2497,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/routing/Router.js | function(mArguments) {
var sDirection = History.getInstance().getDirection(),
sHash = this.oHashChanger.getHash(),
HistoryDirection = library.routing.HistoryDirection,
oLastHistoryEntry = this._aHistory[this._aHistory.length - 1],
oNewHistoryEntry;
// when back navigation, the last history ... | javascript | function(mArguments) {
var sDirection = History.getInstance().getDirection(),
sHash = this.oHashChanger.getHash(),
HistoryDirection = library.routing.HistoryDirection,
oLastHistoryEntry = this._aHistory[this._aHistory.length - 1],
oNewHistoryEntry;
// when back navigation, the last history ... | [
"function",
"(",
"mArguments",
")",
"{",
"var",
"sDirection",
"=",
"History",
".",
"getInstance",
"(",
")",
".",
"getDirection",
"(",
")",
",",
"sHash",
"=",
"this",
".",
"oHashChanger",
".",
"getHash",
"(",
")",
",",
"HistoryDirection",
"=",
"library",
... | private | [
"private"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L1034-L1086 | train | Updates the history state of the current route | [
30522,
3853,
1006,
9388,
22850,
11187,
1007,
1063,
13075,
17371,
7442,
7542,
1027,
2381,
1012,
2131,
7076,
26897,
1006,
1007,
1012,
2131,
4305,
2890,
7542,
1006,
1007,
1010,
21146,
4095,
1027,
2023,
1012,
2821,
11823,
22305,
2121,
1012,
213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(evt)
{
var result = state;
if ((graph.dialect != mxConstants.DIALECT_SVG && mxEvent.getSource(evt).nodeName == 'IMG') || mxClient.IS_TOUCH)
{
var x = mxEvent.getClientX(evt);
var y = mxEvent.getClientY(evt);
// Dispatches the drop event to the graph which
// consumes and executes the ... | javascript | function(evt)
{
var result = state;
if ((graph.dialect != mxConstants.DIALECT_SVG && mxEvent.getSource(evt).nodeName == 'IMG') || mxClient.IS_TOUCH)
{
var x = mxEvent.getClientX(evt);
var y = mxEvent.getClientY(evt);
// Dispatches the drop event to the graph which
// consumes and executes the ... | [
"function",
"(",
"evt",
")",
"{",
"var",
"result",
"=",
"state",
";",
"if",
"(",
"(",
"graph",
".",
"dialect",
"!=",
"mxConstants",
".",
"DIALECT_SVG",
"&&",
"mxEvent",
".",
"getSource",
"(",
"evt",
")",
".",
"nodeName",
"==",
"'IMG'",
")",
"||",
"mx... | Workaround for touch devices routing all events for a mouse gesture (down, move, up) via the initial DOM node. Same for HTML images in all IE versions (VML images are working). | [
"Workaround",
"for",
"touch",
"devices",
"routing",
"all",
"events",
"for",
"a",
"mouse",
"gesture",
"(",
"down",
"move",
"up",
")",
"via",
"the",
"initial",
"DOM",
"node",
".",
"Same",
"for",
"HTML",
"images",
"in",
"all",
"IE",
"versions",
"(",
"VML",
... | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L48631-L48647 | train | Returns the state of the cell which contains the event | [
30522,
3853,
1006,
23408,
2102,
1007,
1063,
13075,
2765,
1027,
2110,
1025,
2065,
1006,
1006,
10629,
1012,
9329,
999,
1027,
25630,
8663,
12693,
3215,
1012,
9329,
1035,
17917,
2290,
1004,
1004,
25630,
18697,
3372,
1012,
4152,
8162,
3401,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ColorlibHQ/AdminLTE | bower_components/Flot/examples/axes-time-zones/date.js | function (opts) {
if ((!fleegix || typeof fleegix.xhr === 'undefined') && (!$ || typeof $.ajax === 'undefined')) {
throw new Error('Please use the Fleegix.js XHR module, jQuery ajax, Zepto ajax, or define your own transport mechanism for downloading zone files.');
}
if (!opts) return;
if (!opts.ur... | javascript | function (opts) {
if ((!fleegix || typeof fleegix.xhr === 'undefined') && (!$ || typeof $.ajax === 'undefined')) {
throw new Error('Please use the Fleegix.js XHR module, jQuery ajax, Zepto ajax, or define your own transport mechanism for downloading zone files.');
}
if (!opts) return;
if (!opts.ur... | [
"function",
"(",
"opts",
")",
"{",
"if",
"(",
"(",
"!",
"fleegix",
"||",
"typeof",
"fleegix",
".",
"xhr",
"===",
"'undefined'",
")",
"&&",
"(",
"!",
"$",
"||",
"typeof",
"$",
".",
"ajax",
"===",
"'undefined'",
")",
")",
"{",
"throw",
"new",
"Error"... | Abstraction layer for different transport layers, including fleegix/jQuery/Zepto Object `opts` include - `url`: url to ajax query - `async`: true for asynchronous, false otherwise. If false, return value will be response from URL. This is true by default - `success`: success callback function - `error`: error call... | [
"Abstraction",
"layer",
"for",
"different",
"transport",
"layers",
"including",
"fleegix",
"/",
"jQuery",
"/",
"Zepto",
"Object",
"opts",
"include",
"-",
"url",
":",
"url",
"to",
"ajax",
"query",
"-",
"async",
":",
"true",
"for",
"asynchronous",
"false",
"ot... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/Flot/examples/axes-time-zones/date.js#L116-L142 | train | Download a zone file from a specified URL | [
30522,
3853,
1006,
23569,
2015,
1007,
1063,
2065,
1006,
1006,
999,
10574,
5856,
2595,
1064,
1064,
2828,
11253,
10574,
5856,
2595,
1012,
1060,
8093,
1027,
1027,
1027,
1005,
6151,
28344,
1005,
1007,
1004,
1004,
1006,
999,
1002,
1064,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aframevr/aframe | src/core/a-register-element.js | wrapMethods | function wrapMethods (targetObj, methodList, derivedObj, baseObj) {
methodList.forEach(function (methodName) {
wrapMethod(targetObj, methodName, derivedObj, baseObj);
});
} | javascript | function wrapMethods (targetObj, methodList, derivedObj, baseObj) {
methodList.forEach(function (methodName) {
wrapMethod(targetObj, methodName, derivedObj, baseObj);
});
} | [
"function",
"wrapMethods",
"(",
"targetObj",
",",
"methodList",
",",
"derivedObj",
",",
"baseObj",
")",
"{",
"methodList",
".",
"forEach",
"(",
"function",
"(",
"methodName",
")",
"{",
"wrapMethod",
"(",
"targetObj",
",",
"methodName",
",",
"derivedObj",
",",
... | Wrap a list a methods to ensure that those in the base prototype are called
before the derived one.
@param {object} targetObj - Object that will contain the wrapped methods.
@param {array} methodList - List of methods from the derivedObj that will be wrapped.
@param {object} derivedObject - Object that inherits from t... | [
"Wrap",
"a",
"list",
"a",
"methods",
"to",
"ensure",
"that",
"those",
"in",
"the",
"base",
"prototype",
"are",
"called",
"before",
"the",
"derived",
"one",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/a-register-element.js#L130-L134 | train | Wrap methods in the base object | [
30522,
3853,
10236,
11368,
6806,
5104,
1006,
4539,
16429,
3501,
1010,
4118,
9863,
1010,
5173,
16429,
3501,
1010,
2918,
16429,
3501,
1007,
1063,
4118,
9863,
1012,
18921,
6776,
1006,
3853,
1006,
4118,
18442,
1007,
1063,
10236,
11368,
6806,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-implicit-coercion.js | isNumeric | function isNumeric(node) {
return (
node.type === "Literal" && typeof node.value === "number" ||
node.type === "CallExpression" && (
node.callee.name === "Number" ||
node.callee.name === "parseInt" ||
node.callee.name === "parseFloat"
)
);
} | javascript | function isNumeric(node) {
return (
node.type === "Literal" && typeof node.value === "number" ||
node.type === "CallExpression" && (
node.callee.name === "Number" ||
node.callee.name === "parseInt" ||
node.callee.name === "parseFloat"
)
);
} | [
"function",
"isNumeric",
"(",
"node",
")",
"{",
"return",
"(",
"node",
".",
"type",
"===",
"\"Literal\"",
"&&",
"typeof",
"node",
".",
"value",
"===",
"\"number\"",
"||",
"node",
".",
"type",
"===",
"\"CallExpression\"",
"&&",
"(",
"node",
".",
"callee",
... | Checks whether the result of a node is numeric or not
@param {ASTNode} node The node to test
@returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call | [
"Checks",
"whether",
"the",
"result",
"of",
"a",
"node",
"is",
"numeric",
"or",
"not"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-implicit-coercion.js#L76-L85 | train | Check if a node is a number | [
30522,
3853,
3475,
17897,
7277,
1006,
13045,
1007,
1063,
2709,
1006,
13045,
1012,
2828,
1027,
1027,
1027,
1000,
18204,
1000,
1004,
1004,
2828,
11253,
13045,
1012,
3643,
1027,
1027,
1027,
1000,
2193,
1000,
1064,
1064,
13045,
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... |
jgraph/mxgraph | javascript/mxClient.js | mxEllipse | function mxEllipse(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
} | javascript | function mxEllipse(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
} | [
"function",
"mxEllipse",
"(",
"bounds",
",",
"fill",
",",
"stroke",
",",
"strokewidth",
")",
"{",
"mxShape",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"bounds",
"=",
"bounds",
";",
"this",
".",
"fill",
"=",
"fill",
";",
"this",
".",
"stroke",
... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxEllipse
Extends <mxShape> to implement an ellipse shape.
This shape is registered under <mxConstants.SHAPE_ELLIPSE>
in <mxCellRenderer>.
Constructor: mxEllipse
Constructs a new ellipse shape.
Parameters:
bounds - <mxRectangle> th... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxEllipse"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L25104-L25111 | train | A wrapper around mxShape to create an ellipse | [
30522,
3853,
25630,
13348,
29251,
1006,
19202,
1010,
6039,
1010,
6909,
1010,
6909,
9148,
11927,
2232,
1007,
1063,
25630,
7377,
5051,
1012,
2655,
1006,
2023,
1007,
1025,
2023,
1012,
19202,
1027,
19202,
1025,
2023,
1012,
6039,
1027,
6039,
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... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/dom-utils.js | DOMWalker_walk | function DOMWalker_walk(ids, root, waitFunction) {
if (typeof waitFunction == 'function')
this._controller.waitFor(waitFunction());
if (!root)
root = this._controller.window.document.documentElement;
var resultsArray = this._walk(root);
if (typeof this._callbackResults == 'function')
... | javascript | function DOMWalker_walk(ids, root, waitFunction) {
if (typeof waitFunction == 'function')
this._controller.waitFor(waitFunction());
if (!root)
root = this._controller.window.document.documentElement;
var resultsArray = this._walk(root);
if (typeof this._callbackResults == 'function')
... | [
"function",
"DOMWalker_walk",
"(",
"ids",
",",
"root",
",",
"waitFunction",
")",
"{",
"if",
"(",
"typeof",
"waitFunction",
"==",
"'function'",
")",
"this",
".",
"_controller",
".",
"waitFor",
"(",
"waitFunction",
"(",
")",
")",
";",
"if",
"(",
"!",
"root... | The main DOMWalker function.
It start's the _walk-method for a given window or other dialog, runs
a callback to process the results for that window/dialog.
After that switches to provided new windows/dialogs.
@param {array of objects} ids
Contains informations on the elements to open while
Object-elements: getBy ... | [
"The",
"main",
"DOMWalker",
"function",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/dom-utils.js#L171-L185 | train | walks the DOM tree | [
30522,
3853,
14383,
26965,
1035,
3328,
1006,
8909,
2015,
1010,
7117,
1010,
3524,
11263,
27989,
1007,
1063,
2065,
1006,
2828,
11253,
3524,
11263,
27989,
1027,
1027,
1005,
3853,
1005,
1007,
2023,
1012,
1035,
11486,
1012,
3524,
29278,
1006,
35... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Manifest.js | function(oInstance) {
// ensure that the instance count is never negative
var iInstanceCount = Math.max(this._iInstanceCount - 1, 0);
// deactivate the instance customizing
if (oInstance) {
this.deactivateCustomizing(oInstance);
}
if (iInstanceCount === 0) {
// deactivcate the customizing
... | javascript | function(oInstance) {
// ensure that the instance count is never negative
var iInstanceCount = Math.max(this._iInstanceCount - 1, 0);
// deactivate the instance customizing
if (oInstance) {
this.deactivateCustomizing(oInstance);
}
if (iInstanceCount === 0) {
// deactivcate the customizing
... | [
"function",
"(",
"oInstance",
")",
"{",
"// ensure that the instance count is never negative",
"var",
"iInstanceCount",
"=",
"Math",
".",
"max",
"(",
"this",
".",
"_iInstanceCount",
"-",
"1",
",",
"0",
")",
";",
"// deactivate the instance customizing",
"if",
"(",
"... | Terminates the manifest and does some final clean-up.
@private | [
"Terminates",
"the",
"manifest",
"and",
"does",
"some",
"final",
"clean",
"-",
"up",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Manifest.js#L664-L686 | train | deactivates the customizing of the given instance | [
30522,
3853,
1006,
1051,
7076,
26897,
1007,
1063,
1013,
1013,
5676,
2008,
1996,
6013,
4175,
2003,
2196,
4997,
13075,
2462,
23808,
6651,
3597,
16671,
1027,
8785,
1012,
4098,
1006,
2023,
1012,
1035,
2462,
23808,
6651,
3597,
16671,
1011,
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... | |
juliangarnier/anime | lib/anime.js | stagger | function stagger(val, params) {
if ( params === void 0 ) params = {};
var direction = params.direction || 'normal';
var easing = params.easing ? parseEasings(params.easing) : null;
var grid = params.grid;
var axis = params.axis;
var fromIndex = params.from || 0;
var fromFirst = fromIndex === 'first';
v... | javascript | function stagger(val, params) {
if ( params === void 0 ) params = {};
var direction = params.direction || 'normal';
var easing = params.easing ? parseEasings(params.easing) : null;
var grid = params.grid;
var axis = params.axis;
var fromIndex = params.from || 0;
var fromFirst = fromIndex === 'first';
v... | [
"function",
"stagger",
"(",
"val",
",",
"params",
")",
"{",
"if",
"(",
"params",
"===",
"void",
"0",
")",
"params",
"=",
"{",
"}",
";",
"var",
"direction",
"=",
"params",
".",
"direction",
"||",
"'normal'",
";",
"var",
"easing",
"=",
"params",
".",
... | Stagger helpers | [
"Stagger",
"helpers"
] | 875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a | https://github.com/juliangarnier/anime/blob/875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a/lib/anime.js#L1199-L1245 | train | Returns a function that takes an array of values and returns a function that takes an array of values and returns an array of values. | [
30522,
3853,
2358,
27609,
1006,
11748,
1010,
11498,
5244,
1007,
1063,
2065,
1006,
11498,
5244,
1027,
1027,
1027,
11675,
1014,
1007,
11498,
5244,
1027,
1063,
1065,
1025,
13075,
3257,
1027,
11498,
5244,
1012,
3257,
1064,
1064,
1005,
3671,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
heyui/heyui | src/plugins/popper/index.js | getReferenceOffsets | function getReferenceOffsets(state, popper, reference) {
var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
return getOffsetRectRelativeToArbitrary... | javascript | function getReferenceOffsets(state, popper, reference) {
var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
return getOffsetRectRelativeToArbitrary... | [
"function",
"getReferenceOffsets",
"(",
"state",
",",
"popper",
",",
"reference",
")",
"{",
"var",
"fixedPosition",
"=",
"arguments",
".",
"length",
">",
"3",
"&&",
"arguments",
"[",
"3",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"3",
"]",
":",
"nu... | Get offsets to the reference element
@method
@memberof Popper.Utils
@param {Object} state
@param {Element} popper - the popper element
@param {Element} reference - the reference element (the popper will be relative to this)
@param {Element} fixedPosition - is in fixed position mode
@returns {Object} An object containin... | [
"Get",
"offsets",
"to",
"the",
"reference",
"element"
] | d5405d27d994151b676eb91c12b389316d7f6679 | https://github.com/heyui/heyui/blob/d5405d27d994151b676eb91c12b389316d7f6679/src/plugins/popper/index.js#L751-L756 | train | Get reference offsets relative to the popper | [
30522,
3853,
2131,
2890,
25523,
27475,
8454,
1006,
2110,
1010,
3769,
4842,
1010,
4431,
1007,
1063,
13075,
4964,
26994,
1027,
9918,
1012,
3091,
1028,
1017,
1004,
1004,
9918,
1031,
1017,
1033,
999,
1027,
1027,
6151,
28344,
1029,
9918,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mozilla-services/react-jsonschema-form | src/components/widgets/SelectWidget.js | processValue | function processValue(schema, value) {
// "enum" is a reserved word, so only "type" and "items" can be destructured
const { type, items } = schema;
if (value === "") {
return undefined;
} else if (type === "array" && items && nums.has(items.type)) {
return value.map(asNumber);
} else if (type === "boo... | javascript | function processValue(schema, value) {
// "enum" is a reserved word, so only "type" and "items" can be destructured
const { type, items } = schema;
if (value === "") {
return undefined;
} else if (type === "array" && items && nums.has(items.type)) {
return value.map(asNumber);
} else if (type === "boo... | [
"function",
"processValue",
"(",
"schema",
",",
"value",
")",
"{",
"// \"enum\" is a reserved word, so only \"type\" and \"items\" can be destructured",
"const",
"{",
"type",
",",
"items",
"}",
"=",
"schema",
";",
"if",
"(",
"value",
"===",
"\"\"",
")",
"{",
"return... | This is a silly limitation in the DOM where option change event values are
always retrieved as strings. | [
"This",
"is",
"a",
"silly",
"limitation",
"in",
"the",
"DOM",
"where",
"option",
"change",
"event",
"values",
"are",
"always",
"retrieved",
"as",
"strings",
"."
] | 1ee343d4654a6d98ac08ece97330ce2a3f9f1de3 | https://github.com/mozilla-services/react-jsonschema-form/blob/1ee343d4654a6d98ac08ece97330ce2a3f9f1de3/src/components/widgets/SelectWidget.js#L12-L36 | train | Process a value | [
30522,
3853,
2832,
10175,
5657,
1006,
8040,
28433,
1010,
3643,
1007,
1063,
1013,
1013,
1000,
4372,
2819,
1000,
2003,
1037,
9235,
2773,
1010,
2061,
2069,
1000,
2828,
1000,
1998,
1000,
5167,
1000,
2064,
2022,
4078,
18300,
12165,
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... |
ColorlibHQ/AdminLTE | bower_components/jvectormap/lib/data-series.js | function(values) {
var max = Number.MIN_VALUE,
min = Number.MAX_VALUE,
val,
cc,
attrs = {};
if (!(this.scale instanceof jvm.OrdinalScale) && !(this.scale instanceof jvm.SimpleScale)) {
if (!this.params.min || !this.params.max) {
for (cc in values) {
val =... | javascript | function(values) {
var max = Number.MIN_VALUE,
min = Number.MAX_VALUE,
val,
cc,
attrs = {};
if (!(this.scale instanceof jvm.OrdinalScale) && !(this.scale instanceof jvm.SimpleScale)) {
if (!this.params.min || !this.params.max) {
for (cc in values) {
val =... | [
"function",
"(",
"values",
")",
"{",
"var",
"max",
"=",
"Number",
".",
"MIN_VALUE",
",",
"min",
"=",
"Number",
".",
"MAX_VALUE",
",",
"val",
",",
"cc",
",",
"attrs",
"=",
"{",
"}",
";",
"if",
"(",
"!",
"(",
"this",
".",
"scale",
"instanceof",
"jv... | Set values for the data set.
@param {Object} values Object which maps codes of regions or markers to values. | [
"Set",
"values",
"for",
"the",
"data",
"set",
"."
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/jvectormap/lib/data-series.js#L60-L103 | train | Sets the values of the parameters | [
30522,
3853,
1006,
5300,
1007,
1063,
13075,
4098,
1027,
2193,
1012,
8117,
1035,
3643,
1010,
8117,
1027,
2193,
1012,
4098,
1035,
3643,
1010,
11748,
1010,
10507,
1010,
2012,
16344,
2015,
1027,
1063,
1065,
1025,
2065,
1006,
30524,
15782,
2571,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/view/WorkspaceManager.js | getAllPanelIDs | function getAllPanelIDs() {
var property, panelIDs = [];
for (property in panelIDMap) {
if (panelIDMap.hasOwnProperty(property)) {
panelIDs.push(property);
}
}
return panelIDs;
} | javascript | function getAllPanelIDs() {
var property, panelIDs = [];
for (property in panelIDMap) {
if (panelIDMap.hasOwnProperty(property)) {
panelIDs.push(property);
}
}
return panelIDs;
} | [
"function",
"getAllPanelIDs",
"(",
")",
"{",
"var",
"property",
",",
"panelIDs",
"=",
"[",
"]",
";",
"for",
"(",
"property",
"in",
"panelIDMap",
")",
"{",
"if",
"(",
"panelIDMap",
".",
"hasOwnProperty",
"(",
"property",
")",
")",
"{",
"panelIDs",
".",
... | Returns an array of all panel ID's
@returns {Array} List of ID's of all bottom panels | [
"Returns",
"an",
"array",
"of",
"all",
"panel",
"ID",
"s"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/WorkspaceManager.js#L242-L250 | train | Get all panelIDs | [
30522,
3853,
2131,
8095,
9739,
20806,
5104,
1006,
1007,
1063,
13075,
3200,
1010,
5997,
9821,
1027,
1031,
1033,
1025,
2005,
1006,
3200,
1999,
5997,
3593,
2863,
2361,
1007,
1063,
2065,
1006,
5997,
3593,
2863,
2361,
1012,
2038,
12384,
21572,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/editor/EditorManager.js | _createEditorForDocument | function _createEditorForDocument(doc, makeMasterEditor, container, range, editorOptions) {
var editor = new Editor(doc, makeMasterEditor, container, range, editorOptions);
editor.on("focus", function () {
_notifyActiveEditorChanged(editor);
});
editor.on("beforeDestroy", f... | javascript | function _createEditorForDocument(doc, makeMasterEditor, container, range, editorOptions) {
var editor = new Editor(doc, makeMasterEditor, container, range, editorOptions);
editor.on("focus", function () {
_notifyActiveEditorChanged(editor);
});
editor.on("beforeDestroy", f... | [
"function",
"_createEditorForDocument",
"(",
"doc",
",",
"makeMasterEditor",
",",
"container",
",",
"range",
",",
"editorOptions",
")",
"{",
"var",
"editor",
"=",
"new",
"Editor",
"(",
"doc",
",",
"makeMasterEditor",
",",
"container",
",",
"range",
",",
"edito... | Creates a new Editor bound to the given Document.
The editor is appended to the given container as a visible child.
@private
@param {!Document} doc Document for the Editor's content
@param {!boolean} makeMasterEditor If true, the Editor will set itself as the private "master"
Editor for the Document. If false, the Ed... | [
"Creates",
"a",
"new",
"Editor",
"bound",
"to",
"the",
"given",
"Document",
".",
"The",
"editor",
"is",
"appended",
"to",
"the",
"given",
"container",
"as",
"a",
"visible",
"child",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorManager.js#L185-L199 | train | Creates an editor for a document | [
30522,
3853,
1035,
3443,
2098,
15660,
3877,
10085,
27417,
2102,
1006,
9986,
1010,
2191,
8706,
2098,
15660,
1010,
11661,
1010,
2846,
1010,
3559,
7361,
9285,
1007,
1063,
13075,
3559,
1027,
2047,
3559,
1006,
9986,
1010,
2191,
8706,
2098,
15660... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/flow | packages/flow-remove-types/index.js | space | function space(size) {
var sp = ' ';
var result = '';
for (;;) {
if ((size & 1) === 1) {
result += sp;
}
size >>>= 1;
if (size === 0) {
break;
}
sp += sp;
}
return result;
} | javascript | function space(size) {
var sp = ' ';
var result = '';
for (;;) {
if ((size & 1) === 1) {
result += sp;
}
size >>>= 1;
if (size === 0) {
break;
}
sp += sp;
}
return result;
} | [
"function",
"space",
"(",
"size",
")",
"{",
"var",
"sp",
"=",
"' '",
";",
"var",
"result",
"=",
"''",
";",
"for",
"(",
";",
";",
")",
"{",
"if",
"(",
"(",
"size",
"&",
"1",
")",
"===",
"1",
")",
"{",
"result",
"+=",
"sp",
";",
"}",
"size",
... | Produce a string full of space characters of a given size. | [
"Produce",
"a",
"string",
"full",
"of",
"space",
"characters",
"of",
"a",
"given",
"size",
"."
] | 25bc6aba258658eaf21ccc4722ef7124724a1d2b | https://github.com/facebook/flow/blob/25bc6aba258658eaf21ccc4722ef7124724a1d2b/packages/flow-remove-types/index.js#L519-L534 | train | Returns a space for the specified size | [
30522,
3853,
2686,
1006,
2946,
1007,
1063,
13075,
11867,
1027,
1005,
1005,
1025,
13075,
2765,
1027,
1005,
1005,
1025,
2005,
1006,
1025,
1025,
1007,
1063,
2065,
1006,
1006,
2946,
1004,
1015,
1007,
1027,
1027,
1027,
1015,
1007,
1063,
2765,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-element-newline.js | normalizeOptionValue | function normalizeOptionValue(providedOption) {
let consistent = false;
let multiline = false;
let minItems;
const option = providedOption || "always";
if (!option || option === "always" || option.minItems === 0) {
minItems = 0;
}... | javascript | function normalizeOptionValue(providedOption) {
let consistent = false;
let multiline = false;
let minItems;
const option = providedOption || "always";
if (!option || option === "always" || option.minItems === 0) {
minItems = 0;
}... | [
"function",
"normalizeOptionValue",
"(",
"providedOption",
")",
"{",
"let",
"consistent",
"=",
"false",
";",
"let",
"multiline",
"=",
"false",
";",
"let",
"minItems",
";",
"const",
"option",
"=",
"providedOption",
"||",
"\"always\"",
";",
"if",
"(",
"!",
"op... | ---------------------------------------------------------------------- Helpers ----------------------------------------------------------------------
Normalizes a given option value.
@param {string|Object|undefined} providedOption - An option value to parse.
@returns {{multiline: boolean, minItems: number}} Normalize... | [
"----------------------------------------------------------------------",
"Helpers",
"----------------------------------------------------------------------",
"Normalizes",
"a",
"given",
"option",
"value",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/array-element-newline.js#L69-L89 | train | Normalizes the provided option value. | [
30522,
3853,
3671,
4697,
7361,
3508,
10175,
5657,
1006,
3024,
7361,
3508,
1007,
1063,
2292,
8335,
1027,
6270,
1025,
2292,
4800,
4179,
1027,
6270,
1025,
2292,
7163,
18532,
2015,
1025,
9530,
3367,
5724,
1027,
3024,
7361,
3508,
1064,
1064,
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... |
tgriesser/knex | src/query/builder.js | Builder | function Builder(client) {
this.client = client;
this.and = this;
this._single = {};
this._statements = [];
this._method = 'select';
if (client.config) {
saveAsyncStack(this, 5);
this._debug = client.config.debug;
}
// Internal flags used in the builder.
this._joinFlag = 'inner';
this._boolF... | javascript | function Builder(client) {
this.client = client;
this.and = this;
this._single = {};
this._statements = [];
this._method = 'select';
if (client.config) {
saveAsyncStack(this, 5);
this._debug = client.config.debug;
}
// Internal flags used in the builder.
this._joinFlag = 'inner';
this._boolF... | [
"function",
"Builder",
"(",
"client",
")",
"{",
"this",
".",
"client",
"=",
"client",
";",
"this",
".",
"and",
"=",
"this",
";",
"this",
".",
"_single",
"=",
"{",
"}",
";",
"this",
".",
"_statements",
"=",
"[",
"]",
";",
"this",
".",
"_method",
"... | Typically called from `knex.builder`, start a new query building chain. | [
"Typically",
"called",
"from",
"knex",
".",
"builder",
"start",
"a",
"new",
"query",
"building",
"chain",
"."
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/query/builder.js#L30-L45 | train | A builder for a query. | [
30522,
3853,
12508,
1006,
7396,
1007,
1063,
2023,
1012,
7396,
1027,
7396,
1025,
2023,
1012,
1998,
1027,
2023,
1025,
2023,
1012,
1035,
2309,
1027,
1063,
1065,
1025,
2023,
1012,
1035,
8635,
1027,
1031,
1033,
1025,
2023,
1012,
1035,
4118,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | function(doc, node, allChildren)
{
if (mxClient.IS_IE && (document.documentMode == null || document.documentMode < 10))
{
switch (node.nodeType)
{
case 1: /* element */
{
var newNode = doc.createElement(node.nodeName);
if (node.attributes && node.attributes.length > 0)
{
fo... | javascript | function(doc, node, allChildren)
{
if (mxClient.IS_IE && (document.documentMode == null || document.documentMode < 10))
{
switch (node.nodeType)
{
case 1: /* element */
{
var newNode = doc.createElement(node.nodeName);
if (node.attributes && node.attributes.length > 0)
{
fo... | [
"function",
"(",
"doc",
",",
"node",
",",
"allChildren",
")",
"{",
"if",
"(",
"mxClient",
".",
"IS_IE",
"&&",
"(",
"document",
".",
"documentMode",
"==",
"null",
"||",
"document",
".",
"documentMode",
"<",
"10",
")",
")",
"{",
"switch",
"(",
"node",
... | Function: importNode
Cross browser implementation for document.importNode. Uses document.importNode
in all browsers but IE, where the node is cloned by creating a new node and
copying all attributes and children into it using importNode, recursively.
Parameters:
doc - Document to import the node into.
node - Node to... | [
"Function",
":",
"importNode"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L2663-L2706 | train | Imports a node | [
30522,
3853,
1006,
9986,
1010,
13045,
1010,
2035,
19339,
7389,
1007,
1063,
2065,
1006,
25630,
20464,
11638,
1012,
2003,
1035,
29464,
1004,
1004,
1006,
6254,
1012,
6254,
5302,
3207,
1027,
1027,
19701,
1064,
1064,
6254,
1012,
6254,
5302,
3207... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aws/aws-sdk-js | lib/services/s3.js | function(buckets) {
var bucketRegionCache = this.bucketRegionCache;
if (!buckets) {
buckets = Object.keys(bucketRegionCache);
} else if (typeof buckets === 'string') {
buckets = [buckets];
}
for (var i = 0; i < buckets.length; i++) {
delete bucketRegionCache[buckets[i]];
}
... | javascript | function(buckets) {
var bucketRegionCache = this.bucketRegionCache;
if (!buckets) {
buckets = Object.keys(bucketRegionCache);
} else if (typeof buckets === 'string') {
buckets = [buckets];
}
for (var i = 0; i < buckets.length; i++) {
delete bucketRegionCache[buckets[i]];
}
... | [
"function",
"(",
"buckets",
")",
"{",
"var",
"bucketRegionCache",
"=",
"this",
".",
"bucketRegionCache",
";",
"if",
"(",
"!",
"buckets",
")",
"{",
"buckets",
"=",
"Object",
".",
"keys",
"(",
"bucketRegionCache",
")",
";",
"}",
"else",
"if",
"(",
"typeof"... | Clears bucket region cache.
@api private | [
"Clears",
"bucket",
"region",
"cache",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L685-L696 | train | Returns region cache for the given buckets | [
30522,
3853,
1006,
13610,
2015,
1007,
1063,
13075,
13610,
23784,
3540,
5403,
1027,
2023,
1012,
13610,
23784,
3540,
5403,
1025,
2065,
1006,
999,
13610,
2015,
1007,
1063,
13610,
2015,
1027,
4874,
1012,
6309,
1006,
13610,
23784,
3540,
5403,
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.codeeditor/src/sap/ui/codeeditor/js/ace/worker-javascript.js | each | function each(obj, cb) {
if (!obj)
return;
if (!Array.isArray(obj) && typeof obj === "object")
obj = Object.keys(obj);
obj.forEach(cb);
} | javascript | function each(obj, cb) {
if (!obj)
return;
if (!Array.isArray(obj) && typeof obj === "object")
obj = Object.keys(obj);
obj.forEach(cb);
} | [
"function",
"each",
"(",
"obj",
",",
"cb",
")",
"{",
"if",
"(",
"!",
"obj",
")",
"return",
";",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"obj",
")",
"&&",
"typeof",
"obj",
"===",
"\"object\"",
")",
"obj",
"=",
"Object",
".",
"keys",
"(",
"... | Variables that live outside the current file | [
"Variables",
"that",
"live",
"outside",
"the",
"current",
"file"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.codeeditor/src/sap/ui/codeeditor/js/ace/worker-javascript.js#L7837-L7845 | train | Iterate over the objects in the cache | [
30522,
3853,
2169,
1006,
27885,
3501,
1010,
17324,
1007,
1063,
2065,
1006,
999,
27885,
3501,
1007,
2709,
1025,
2065,
1006,
999,
9140,
1012,
18061,
11335,
2100,
1006,
27885,
3501,
1007,
1004,
1004,
2828,
11253,
27885,
3501,
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... |
goldfire/howler.js | dist/howler.js | function() {
var self = this;
var parent = self._parent;
var volume = (Howler._muted || self._muted || self._parent._muted) ? 0 : self._volume;
if (parent._webAudio) {
// Create the gain node for controlling volume (the source will connect to this).
self._node = (typeof Howler.c... | javascript | function() {
var self = this;
var parent = self._parent;
var volume = (Howler._muted || self._muted || self._parent._muted) ? 0 : self._volume;
if (parent._webAudio) {
// Create the gain node for controlling volume (the source will connect to this).
self._node = (typeof Howler.c... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"parent",
"=",
"self",
".",
"_parent",
";",
"var",
"volume",
"=",
"(",
"Howler",
".",
"_muted",
"||",
"self",
".",
"_muted",
"||",
"self",
".",
"_parent",
".",
"_muted",
")",
"?",
... | Create and setup a new sound object, whether HTML5 Audio or Web Audio.
@return {Sound} | [
"Create",
"and",
"setup",
"a",
"new",
"sound",
"object",
"whether",
"HTML5",
"Audio",
"or",
"Web",
"Audio",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L2194-L2227 | train | Sets the volume of the sound. | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
6687,
1027,
2969,
1012,
1035,
6687,
1025,
13075,
3872,
1027,
1006,
22912,
2121,
1012,
1035,
22124,
1064,
1064,
2969,
1012,
1035,
22124,
1064,
1064,
2969,
1012,
1035,
6687,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | mxSvgCanvas2D | function mxSvgCanvas2D(root, styleEnabled)
{
mxAbstractCanvas2D.call(this);
/**
* Variable: root
*
* Reference to the container for the SVG content.
*/
this.root = root;
/**
* Variable: gradients
*
* Local cache of gradients for quick lookups.
*/
this.gradients = [];
/**
* Variable: defs
... | javascript | function mxSvgCanvas2D(root, styleEnabled)
{
mxAbstractCanvas2D.call(this);
/**
* Variable: root
*
* Reference to the container for the SVG content.
*/
this.root = root;
/**
* Variable: gradients
*
* Local cache of gradients for quick lookups.
*/
this.gradients = [];
/**
* Variable: defs
... | [
"function",
"mxSvgCanvas2D",
"(",
"root",
",",
"styleEnabled",
")",
"{",
"mxAbstractCanvas2D",
".",
"call",
"(",
"this",
")",
";",
"/**\n\t * Variable: root\n\t * \n\t * Reference to the container for the SVG content.\n\t */",
"this",
".",
"root",
"=",
"root",
";",
"/**\n... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxSvgCanvas2D
Extends <mxAbstractCanvas2D> to implement a canvas for SVG. This canvas writes all
calls as SVG output to the given SVG root node.
(code)
var svgDoc = mxUtils.createXmlDocument();
var root = (svgDoc.createElementNS != nu... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxSvgCanvas2D"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L18459-L18538 | train | The SVG Canvas2D constructor. | [
30522,
3853,
25630,
2015,
2615,
18195,
2319,
12044,
2475,
2094,
1006,
7117,
1010,
2806,
8189,
23242,
1007,
1063,
25630,
30524,
2023,
1012,
7117,
1027,
7117,
1025,
1013,
1008,
1008,
1008,
8023,
1024,
17978,
2015,
1008,
1008,
2334,
17053,
199... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/map/mapDataStatistic.js | dataStatistics | function dataStatistics(datas, statisticType) {
var dataNameMap = {};
zrUtil.each(datas, function (data) {
data.each(data.mapDimension('value'), function (value, idx) {
// Add prefix to avoid conflict with Object.prototype.
var mapKey = 'ec-' + data.getName(idx);
dat... | javascript | function dataStatistics(datas, statisticType) {
var dataNameMap = {};
zrUtil.each(datas, function (data) {
data.each(data.mapDimension('value'), function (value, idx) {
// Add prefix to avoid conflict with Object.prototype.
var mapKey = 'ec-' + data.getName(idx);
dat... | [
"function",
"dataStatistics",
"(",
"datas",
",",
"statisticType",
")",
"{",
"var",
"dataNameMap",
"=",
"{",
"}",
";",
"zrUtil",
".",
"each",
"(",
"datas",
",",
"function",
"(",
"data",
")",
"{",
"data",
".",
"each",
"(",
"data",
".",
"mapDimension",
"(... | FIXME 公用?
@param {Array.<module:echarts/data/List>} datas
@param {string} statisticType 'average' 'sum'
@inner | [
"FIXME",
"公用?"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/map/mapDataStatistic.js#L28-L68 | train | Get statistics for data | [
30522,
3853,
2951,
9153,
16774,
6558,
1006,
2951,
2015,
1010,
28093,
6553,
13874,
1007,
1063,
13075,
2951,
18442,
2863,
2361,
1027,
1063,
1065,
1025,
1062,
22134,
4014,
1012,
2169,
1006,
2951,
2015,
1010,
3853,
1006,
2951,
1007,
1063,
2951,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/hyphenation/Hyphenation.js | checkCSSHyphensSupport | function checkCSSHyphensSupport(oElement) {
return (
oElement.style.hyphens === "auto" ||
oElement.style.webkitHyphens === "auto" ||
oElement.style.msHyphens === "auto" ||
oElement.style["-moz-hyphens"] === "auto"
);
} | javascript | function checkCSSHyphensSupport(oElement) {
return (
oElement.style.hyphens === "auto" ||
oElement.style.webkitHyphens === "auto" ||
oElement.style.msHyphens === "auto" ||
oElement.style["-moz-hyphens"] === "auto"
);
} | [
"function",
"checkCSSHyphensSupport",
"(",
"oElement",
")",
"{",
"return",
"(",
"oElement",
".",
"style",
".",
"hyphens",
"===",
"\"auto\"",
"||",
"oElement",
".",
"style",
".",
"webkitHyphens",
"===",
"\"auto\"",
"||",
"oElement",
".",
"style",
".",
"msHyphen... | Checks if hyphens (ev.prefixed) is set to auto for the element.
@param {Element} oElement The element with applied <code>hyphens=auto</code> styles
@returns {boolean} The result of the check
@private | [
"Checks",
"if",
"hyphens",
"(",
"ev",
".",
"prefixed",
")",
"is",
"set",
"to",
"auto",
"for",
"the",
"element",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/hyphenation/Hyphenation.js#L332-L339 | train | Checks if the element has a CSS hyphens property | [
30522,
3853,
4638,
6169,
4095,
22571,
10222,
4757,
6279,
6442,
1006,
1051,
12260,
3672,
1007,
1063,
2709,
1006,
1051,
12260,
3672,
1012,
2806,
1012,
1044,
22571,
10222,
2015,
1027,
1027,
1027,
1000,
8285,
1000,
1064,
1064,
1051,
12260,
3672... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/view/MainViewManager.js | _updateLayout | function _updateLayout(event, viewAreaHeight, forceRefresh) {
var available;
if (_orientation === VERTICAL) {
available = _$el.innerWidth();
} else {
available = _$el.innerHeight();
}
_.forEach(_panes, function (pane) {
// For VERTICAL orient... | javascript | function _updateLayout(event, viewAreaHeight, forceRefresh) {
var available;
if (_orientation === VERTICAL) {
available = _$el.innerWidth();
} else {
available = _$el.innerHeight();
}
_.forEach(_panes, function (pane) {
// For VERTICAL orient... | [
"function",
"_updateLayout",
"(",
"event",
",",
"viewAreaHeight",
",",
"forceRefresh",
")",
"{",
"var",
"available",
";",
"if",
"(",
"_orientation",
"===",
"VERTICAL",
")",
"{",
"available",
"=",
"_$el",
".",
"innerWidth",
"(",
")",
";",
"}",
"else",
"{",
... | Event handler for "workspaceUpdateLayout" to update the layout
@param {jQuery.Event} event - jQuery event object
@param {number} viewAreaHeight - unused
@param {boolean} forceRefresh - true to force a resize and refresh of the entire view
@private | [
"Event",
"handler",
"for",
"workspaceUpdateLayout",
"to",
"update",
"the",
"layout"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1020-L1041 | train | Update the layout of the pane | [
30522,
3853,
1035,
10651,
8485,
5833,
1006,
2724,
1010,
3193,
12069,
4430,
7416,
13900,
1010,
2486,
2890,
19699,
9953,
1007,
1063,
13075,
2800,
1025,
2065,
1006,
1035,
10296,
1027,
1027,
1027,
7471,
1007,
1063,
2800,
1027,
1035,
1002,
3449,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
juliangarnier/anime | src/index.js | removeTargetsFromAnimations | function removeTargetsFromAnimations(targetsArray, animations) {
for (let a = animations.length; a--;) {
if (arrayContains(targetsArray, animations[a].animatable.target)) {
animations.splice(a, 1);
}
}
} | javascript | function removeTargetsFromAnimations(targetsArray, animations) {
for (let a = animations.length; a--;) {
if (arrayContains(targetsArray, animations[a].animatable.target)) {
animations.splice(a, 1);
}
}
} | [
"function",
"removeTargetsFromAnimations",
"(",
"targetsArray",
",",
"animations",
")",
"{",
"for",
"(",
"let",
"a",
"=",
"animations",
".",
"length",
";",
"a",
"--",
";",
")",
"{",
"if",
"(",
"arrayContains",
"(",
"targetsArray",
",",
"animations",
"[",
"... | Remove targets from animation | [
"Remove",
"targets",
"from",
"animation"
] | 875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a | https://github.com/juliangarnier/anime/blob/875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a/src/index.js#L1150-L1156 | train | Remove targets from an array of animations | [
30522,
3853,
6366,
7559,
18150,
22747,
21716,
7088,
28649,
2015,
1006,
7889,
2906,
9447,
1010,
7284,
2015,
1007,
1063,
2005,
1006,
2292,
1037,
1027,
7284,
2015,
1012,
3091,
1025,
1037,
1011,
1011,
1025,
1007,
1063,
2065,
1006,
9140,
8663,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/api/v0.1/clients.js | doQuery | function doQuery(options) {
// only User Agent (type = `ua`) clients are available at the moment.
options.data = extend(options.data, {type: 'ua'});
return models.Client.findOne(options.data, omit(options, ['data']))
.then((model) => {
if (!model)... | javascript | function doQuery(options) {
// only User Agent (type = `ua`) clients are available at the moment.
options.data = extend(options.data, {type: 'ua'});
return models.Client.findOne(options.data, omit(options, ['data']))
.then((model) => {
if (!model)... | [
"function",
"doQuery",
"(",
"options",
")",
"{",
"// only User Agent (type = `ua`) clients are available at the moment.",
"options",
".",
"data",
"=",
"extend",
"(",
"options",
".",
"data",
",",
"{",
"type",
":",
"'ua'",
"}",
")",
";",
"return",
"models",
".",
"... | ### Model Query
Make the call to the Model layer
@param {Object} options
@returns {Object} options | [
"###",
"Model",
"Query",
"Make",
"the",
"call",
"to",
"the",
"Model",
"layer"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/clients.js#L35-L51 | train | Query for a client | [
30522,
3853,
2079,
4226,
2854,
1006,
7047,
1007,
1063,
1013,
1013,
2069,
5310,
4005,
1006,
2828,
1027,
1036,
25423,
1036,
1007,
7846,
2024,
2800,
2012,
1996,
2617,
1012,
7047,
1012,
2951,
1027,
7949,
1006,
7047,
1012,
2951,
1010,
1063,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | XPathEngine | function XPathEngine() {
// public
this.doc = null;
/**
* Returns whether the current runtime environment supports the use of this
* engine. Needs override.
*/
this.isAvailable = function() { return false; };
/**
* Sets the document to be used for evaluation. Always returns the cur... | javascript | function XPathEngine() {
// public
this.doc = null;
/**
* Returns whether the current runtime environment supports the use of this
* engine. Needs override.
*/
this.isAvailable = function() { return false; };
/**
* Sets the document to be used for evaluation. Always returns the cur... | [
"function",
"XPathEngine",
"(",
")",
"{",
"// public",
"this",
".",
"doc",
"=",
"null",
";",
"/**\n * Returns whether the current runtime environment supports the use of this\n * engine. Needs override.\n */",
"this",
".",
"isAvailable",
"=",
"function",
"(",
")",
... | An interface definition for XPath engine implementations; an instance of
XPathEngine should be their prototype. Sub-implementations need only define
overrides of the methods provided here. | [
"An",
"interface",
"definition",
"for",
"XPath",
"engine",
"implementations",
";",
"an",
"instance",
"of",
"XPathEngine",
"should",
"be",
"their",
"prototype",
".",
"Sub",
"-",
"implementations",
"need",
"only",
"define",
"overrides",
"of",
"the",
"methods",
"pr... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L1061-L1111 | train | The XPathEngine class | [
30522,
3853,
26726,
8988,
13159,
3170,
1006,
1007,
1063,
1013,
1013,
2270,
2023,
1012,
9986,
1027,
19701,
1025,
1013,
1008,
1008,
1008,
5651,
3251,
1996,
2783,
2448,
7292,
4044,
6753,
1996,
2224,
1997,
2023,
1008,
3194,
1012,
3791,
2058,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | updateVersionPicker.js | exec | function exec (cmd, userOptions) {
if (cmd instanceof Array) {
return cmd.map(function (cmd) { return exec(cmd, userOptions); });
}
try {
const options = Object.create(defaultOptions);
for (const key in userOptions) options[key] = userOptions[key];
console.log(`\n--------\n ${cmd}`);... | javascript | function exec (cmd, userOptions) {
if (cmd instanceof Array) {
return cmd.map(function (cmd) { return exec(cmd, userOptions); });
}
try {
const options = Object.create(defaultOptions);
for (const key in userOptions) options[key] = userOptions[key];
console.log(`\n--------\n ${cmd}`);... | [
"function",
"exec",
"(",
"cmd",
",",
"userOptions",
")",
"{",
"if",
"(",
"cmd",
"instanceof",
"Array",
")",
"{",
"return",
"cmd",
".",
"map",
"(",
"function",
"(",
"cmd",
")",
"{",
"return",
"exec",
"(",
"cmd",
",",
"userOptions",
")",
";",
"}",
")... | utility methods | [
"utility",
"methods"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/updateVersionPicker.js#L47-L59 | train | execs a command | [
30522,
3853,
4654,
8586,
1006,
4642,
2094,
1010,
5310,
7361,
9285,
1007,
1063,
2065,
1006,
4642,
2094,
6013,
11253,
9140,
1007,
1063,
2709,
4642,
2094,
1012,
4949,
1006,
3853,
1006,
4642,
2094,
1007,
1063,
2709,
4654,
8586,
1006,
4642,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ecomfe/zrender | src/core/PathProxy.js | function (ctx) {
var d = this.data;
var x0, y0;
var xi, yi;
var x, y;
var ux = this._ux;
var uy = this._uy;
var len = this._len;
for (var i = 0; i < len;) {
var cmd = d[i++];
if (i === 1) {
// 如果第一个命令是 L, C, Q
... | javascript | function (ctx) {
var d = this.data;
var x0, y0;
var xi, yi;
var x, y;
var ux = this._ux;
var uy = this._uy;
var len = this._len;
for (var i = 0; i < len;) {
var cmd = d[i++];
if (i === 1) {
// 如果第一个命令是 L, C, Q
... | [
"function",
"(",
"ctx",
")",
"{",
"var",
"d",
"=",
"this",
".",
"data",
";",
"var",
"x0",
",",
"y0",
";",
"var",
"xi",
",",
"yi",
";",
"var",
"x",
",",
"y",
";",
"var",
"ux",
"=",
"this",
".",
"_ux",
";",
"var",
"uy",
"=",
"this",
".",
"_... | Rebuild path from current data
Rebuild path will not consider javascript implemented line dash.
@param {CanvasRenderingContext2D} ctx | [
"Rebuild",
"path",
"from",
"current",
"data",
"Rebuild",
"path",
"will",
"not",
"consider",
"javascript",
"implemented",
"line",
"dash",
"."
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/core/PathProxy.js#L686-L783 | train | Draw the region region | [
30522,
3853,
1006,
14931,
2595,
1007,
1063,
13075,
1040,
1027,
2023,
1012,
2951,
1025,
13075,
1060,
2692,
1010,
1061,
2692,
1025,
13075,
8418,
1010,
12316,
1025,
13075,
1060,
1010,
1061,
1025,
13075,
1057,
2595,
1027,
2023,
1012,
1035,
1057... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.support/src/sap/ui/support/supportRules/Storage.js | function (rules) {
var stringifyRules = encode(JSON.stringify(rules));
localStorage.setItem(constants.LOCAL_STORAGE_TEMP_RULES_KEY, stringifyRules);
} | javascript | function (rules) {
var stringifyRules = encode(JSON.stringify(rules));
localStorage.setItem(constants.LOCAL_STORAGE_TEMP_RULES_KEY, stringifyRules);
} | [
"function",
"(",
"rules",
")",
"{",
"var",
"stringifyRules",
"=",
"encode",
"(",
"JSON",
".",
"stringify",
"(",
"rules",
")",
")",
";",
"localStorage",
".",
"setItem",
"(",
"constants",
".",
"LOCAL_STORAGE_TEMP_RULES_KEY",
",",
"stringifyRules",
")",
";",
"}... | Saves the temporary rules into the LocalStorage persistence layer.
@private
@name sap.ui.support.Storage.setRules
@method
@param {object[]} rules The temporary rules from the shared model. | [
"Saves",
"the",
"temporary",
"rules",
"into",
"the",
"LocalStorage",
"persistence",
"layer",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/Storage.js#L99-L102 | train | Save temporary rules to local storage | [
30522,
3853,
1006,
3513,
1007,
1063,
13075,
5164,
8757,
6820,
4244,
1027,
4372,
16044,
1006,
1046,
3385,
1012,
5164,
8757,
1006,
3513,
1007,
1007,
1025,
10575,
4263,
4270,
1012,
2275,
4221,
2213,
1006,
5377,
2015,
1012,
2334,
1035,
5527,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | common/src/web/jquery-1.3.2.js | function(){
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
this.options.show = true;
// Begin the animation
// Make sure that we start at a small width/height to avoid any
// flash of content
this.custom(this.prop... | javascript | function(){
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
this.options.show = true;
// Begin the animation
// Make sure that we start at a small width/height to avoid any
// flash of content
this.custom(this.prop... | [
"function",
"(",
")",
"{",
"// Remember where we started, so that we can go back to it later",
"this",
".",
"options",
".",
"orig",
"[",
"this",
".",
"prop",
"]",
"=",
"jQuery",
".",
"attr",
"(",
"this",
".",
"elem",
".",
"style",
",",
"this",
".",
"prop",
"... | Simple 'show' function | [
"Simple",
"show",
"function"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/common/src/web/jquery-1.3.2.js#L4069-L4081 | train | Show the element | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
3342,
2073,
2057,
2318,
1010,
2061,
2008,
2057,
2064,
2175,
2067,
2000,
2009,
2101,
2023,
1012,
7047,
1012,
2030,
8004,
1031,
2023,
1012,
17678,
1033,
1027,
1046,
4226,
2854,
1012,
2012,
16344,
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.fl/src/sap/ui/fl/Utils.js | function (oComponent, sParameterName) {
var startUpParameterContent = null;
if (sParameterName) {
if (oComponent && oComponent.getComponentData) {
startUpParameterContent = this._getStartUpParameter(oComponent.getComponentData(), sParameterName);
}
}
return startUpParameterContent;
} | javascript | function (oComponent, sParameterName) {
var startUpParameterContent = null;
if (sParameterName) {
if (oComponent && oComponent.getComponentData) {
startUpParameterContent = this._getStartUpParameter(oComponent.getComponentData(), sParameterName);
}
}
return startUpParameterContent;
} | [
"function",
"(",
"oComponent",
",",
"sParameterName",
")",
"{",
"var",
"startUpParameterContent",
"=",
"null",
";",
"if",
"(",
"sParameterName",
")",
"{",
"if",
"(",
"oComponent",
"&&",
"oComponent",
".",
"getComponentData",
")",
"{",
"startUpParameterContent",
... | Determines the content for a given startUpParameter name
@param {sap.ui.core.Component} oComponent - component instance
@param {String} sParameterName - startUpParameterName that shall be determined
@returns {String} content of found startUpParameter
@private | [
"Determines",
"the",
"content",
"for",
"a",
"given",
"startUpParameter",
"name"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L451-L461 | train | Returns the content of the start up parameter of the given component. | [
30522,
3853,
1006,
1051,
9006,
29513,
3372,
1010,
12403,
6444,
15141,
18442,
1007,
1063,
13075,
22752,
28689,
22828,
8663,
6528,
2102,
1027,
19701,
1025,
2065,
1006,
12403,
6444,
15141,
18442,
1007,
1063,
2065,
1006,
1051,
9006,
29513,
3372,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/BindingParser.js | resolveFilters | function resolveFilters(o, sProp) {
var v = o[sProp];
if ( Array.isArray(v) ) {
v.forEach(function(oObject, iIndex) {
resolveFilters(v, iIndex);
});
return;
}
if ( v && typeof v === 'object' ) {
resolveRef(v, 'test');
resolveFilters(v, 'filters');
resolveFilters(v, 'condition'... | javascript | function resolveFilters(o, sProp) {
var v = o[sProp];
if ( Array.isArray(v) ) {
v.forEach(function(oObject, iIndex) {
resolveFilters(v, iIndex);
});
return;
}
if ( v && typeof v === 'object' ) {
resolveRef(v, 'test');
resolveFilters(v, 'filters');
resolveFilters(v, 'condition'... | [
"function",
"resolveFilters",
"(",
"o",
",",
"sProp",
")",
"{",
"var",
"v",
"=",
"o",
"[",
"sProp",
"]",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"v",
")",
")",
"{",
"v",
".",
"forEach",
"(",
"function",
"(",
"oObject",
",",
"iIndex",
")",
... | /*
Converts filter definitions to sap.ui.model.Filter instances.
The value of the given property can either be a single filter definition object
which will be fed into the constructor of sap.ui.model.Filter.
Or it can be an array of such objects.
If any of the filter definition objects contains a property named 'filt... | [
"/",
"*",
"Converts",
"filter",
"definitions",
"to",
"sap",
".",
"ui",
".",
"model",
".",
"Filter",
"instances",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/BindingParser.js#L252-L268 | train | Resolves filters in the object | [
30522,
3853,
10663,
8873,
21928,
2015,
1006,
1051,
1010,
11867,
18981,
1007,
1063,
13075,
1058,
1027,
1051,
1031,
11867,
18981,
1033,
1025,
2065,
1006,
9140,
1012,
18061,
11335,
2100,
1006,
1058,
1007,
1007,
1063,
1058,
1012,
18921,
6776,
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/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js | _offsetPos | function _offsetPos(pos, offset) {
return {line: pos.line, ch: pos.ch + offset};
} | javascript | function _offsetPos(pos, offset) {
return {line: pos.line, ch: pos.ch + offset};
} | [
"function",
"_offsetPos",
"(",
"pos",
",",
"offset",
")",
"{",
"return",
"{",
"line",
":",
"pos",
".",
"line",
",",
"ch",
":",
"pos",
".",
"ch",
"+",
"offset",
"}",
";",
"}"
] | @private
Offsets the character offset of the given {line, ch} pos by the given amount and returns a new
pos. Not for general purpose use as it does not account for line boundaries. | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js#L221-L223 | train | offset the offset to the next line | [
30522,
3853,
1035,
16396,
6873,
2015,
1006,
13433,
2015,
1010,
16396,
1007,
1063,
2709,
1063,
2240,
1024,
13433,
2015,
1012,
2240,
1010,
10381,
1024,
13433,
2015,
1012,
10381,
1009,
16396,
1065,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
summernote/summernote | src/js/base/core/dom.js | listDescendant | function listDescendant(node, pred) {
const descendants = [];
pred = pred || func.ok;
// start DFS(depth first search) with node
(function fnWalk(current) {
if (node !== current && pred(current)) {
descendants.push(current);
}
for (let idx = 0, len = current.childNodes.length; idx < len; idx+... | javascript | function listDescendant(node, pred) {
const descendants = [];
pred = pred || func.ok;
// start DFS(depth first search) with node
(function fnWalk(current) {
if (node !== current && pred(current)) {
descendants.push(current);
}
for (let idx = 0, len = current.childNodes.length; idx < len; idx+... | [
"function",
"listDescendant",
"(",
"node",
",",
"pred",
")",
"{",
"const",
"descendants",
"=",
"[",
"]",
";",
"pred",
"=",
"pred",
"||",
"func",
".",
"ok",
";",
"// start DFS(depth first search) with node",
"(",
"function",
"fnWalk",
"(",
"current",
")",
"{"... | listing descendant nodes
@param {Node} node
@param {Function} [pred] - predicate function | [
"listing",
"descendant",
"nodes"
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L352-L367 | train | List descendant nodes of node | [
30522,
3853,
2862,
6155,
23865,
4630,
1006,
13045,
1010,
3653,
2094,
1007,
1063,
9530,
3367,
8481,
1027,
1031,
1033,
1025,
3653,
2094,
1027,
3653,
2094,
1064,
1064,
4569,
2278,
1012,
7929,
1025,
1013,
1013,
2707,
1040,
10343,
1006,
5995,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nodejs/node-gyp | lib/build.js | findMsbuild | function findMsbuild () {
log.verbose('could not find "msbuild.exe" in PATH - finding location in registry')
var notfoundErr = 'Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?'
var cmd = 'reg query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s'
if (process.ar... | javascript | function findMsbuild () {
log.verbose('could not find "msbuild.exe" in PATH - finding location in registry')
var notfoundErr = 'Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?'
var cmd = 'reg query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s'
if (process.ar... | [
"function",
"findMsbuild",
"(",
")",
"{",
"log",
".",
"verbose",
"(",
"'could not find \"msbuild.exe\" in PATH - finding location in registry'",
")",
"var",
"notfoundErr",
"=",
"'Can\\'t find \"msbuild.exe\". Do you have Microsoft Visual Studio C++ 2008+ installed?'",
"var",
"cmd",
... | Search for the location of "msbuild.exe" file on Windows. | [
"Search",
"for",
"the",
"location",
"of",
"msbuild",
".",
"exe",
"file",
"on",
"Windows",
"."
] | 721eb691cf15556cc2700eda0558d5bad5f84232 | https://github.com/nodejs/node-gyp/blob/721eb691cf15556cc2700eda0558d5bad5f84232/lib/build.js#L126-L180 | train | find msbuild. exe | [
30522,
3853,
2424,
5244,
8569,
4014,
2094,
1006,
1007,
1063,
8833,
1012,
12034,
9232,
1006,
1005,
2071,
2025,
2424,
1000,
5796,
8569,
4014,
2094,
1012,
4654,
2063,
1000,
1999,
4130,
1011,
4531,
3295,
1999,
15584,
1005,
1007,
13075,
2025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/AutoUpdate/main.js | initiateUpdateProcess | function initiateUpdateProcess(formattedInstallerPath, formattedLogFilePath, installStatusFilePath) {
// Get additional update parameters on Mac : installDir, appName, and updateDir
function getAdditionalParams() {
var retval = {};
var installDir = FileUtils.getNativeBracketsDir... | javascript | function initiateUpdateProcess(formattedInstallerPath, formattedLogFilePath, installStatusFilePath) {
// Get additional update parameters on Mac : installDir, appName, and updateDir
function getAdditionalParams() {
var retval = {};
var installDir = FileUtils.getNativeBracketsDir... | [
"function",
"initiateUpdateProcess",
"(",
"formattedInstallerPath",
",",
"formattedLogFilePath",
",",
"installStatusFilePath",
")",
"{",
"// Get additional update parameters on Mac : installDir, appName, and updateDir",
"function",
"getAdditionalParams",
"(",
")",
"{",
"var",
"retv... | Initiates the update process, when user clicks UpdateNow in the update popup
@param {string} formattedInstallerPath - formatted path to the latest installer
@param {string} formattedLogFilePath - formatted path to the installer log file
@param {string} installStatusFilePath - path to the install status log file | [
"Initiates",
"the",
"update",
"process",
"when",
"user",
"clicks",
"UpdateNow",
"in",
"the",
"update",
"popup"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L829-L885 | train | Initiates the update process | [
30522,
3853,
17820,
6279,
13701,
21572,
9623,
2015,
1006,
4289,
3064,
30524,
6097,
1024,
16500,
4305,
2099,
1010,
10439,
18442,
1010,
1998,
7172,
4313,
3853,
2131,
4215,
27064,
28689,
5244,
1006,
1007,
1063,
13075,
2128,
9189,
2389,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/less.js | colorBlend | function colorBlend(mode, color1, color2) {
var ab = color1.alpha, cb, // backdrop
as = color2.alpha, cs, // source
ar, cr, r = []; // result
ar = as + ab * (1 - as);
for (var i = 0; i < 3; i++) {
cb = color1.rgb[i] / 255;
cs = color2.rgb[i] / 255;
cr = mode(c... | javascript | function colorBlend(mode, color1, color2) {
var ab = color1.alpha, cb, // backdrop
as = color2.alpha, cs, // source
ar, cr, r = []; // result
ar = as + ab * (1 - as);
for (var i = 0; i < 3; i++) {
cb = color1.rgb[i] / 255;
cs = color2.rgb[i] / 255;
cr = mode(c... | [
"function",
"colorBlend",
"(",
"mode",
",",
"color1",
",",
"color2",
")",
"{",
"var",
"ab",
"=",
"color1",
".",
"alpha",
",",
"cb",
",",
"// backdrop",
"as",
"=",
"color2",
".",
"alpha",
",",
"cs",
",",
"// source",
"ar",
",",
"cr",
",",
"r",
"=",
... | Color Blending ref: http://www.w3.org/TR/compositing-1 | [
"Color",
"Blending",
"ref",
":",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/",
"compositing",
"-",
"1"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L2593-L2611 | train | Blends two colors | [
30522,
3853,
3609,
3468,
4859,
1006,
5549,
1010,
3609,
2487,
1010,
3609,
2475,
1007,
1063,
13075,
11113,
1027,
3609,
2487,
1012,
6541,
1010,
17324,
1010,
1013,
1013,
18876,
2004,
1027,
3609,
2475,
1012,
6541,
1010,
20116,
1010,
1013,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-extra-parens.js | checkUnaryUpdate | function checkUnaryUpdate(node) {
if (node.type === "UnaryExpression" && node.argument.type === "BinaryExpression" && node.argument.operator === "**") {
return;
}
if (hasExcessParens(node.argument) && precedence(node.argument) >= precedence(node)) {
r... | javascript | function checkUnaryUpdate(node) {
if (node.type === "UnaryExpression" && node.argument.type === "BinaryExpression" && node.argument.operator === "**") {
return;
}
if (hasExcessParens(node.argument) && precedence(node.argument) >= precedence(node)) {
r... | [
"function",
"checkUnaryUpdate",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"type",
"===",
"\"UnaryExpression\"",
"&&",
"node",
".",
"argument",
".",
"type",
"===",
"\"BinaryExpression\"",
"&&",
"node",
".",
"argument",
".",
"operator",
"===",
"\"**\"",
"... | Evaluate Unary update
@param {ASTNode} node node to evaluate
@returns {void}
@private | [
"Evaluate",
"Unary",
"update"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-extra-parens.js#L340-L348 | train | Check if Unary Update | [
30522,
3853,
4638,
9521,
2854,
6279,
13701,
1006,
13045,
1007,
1063,
2065,
1006,
13045,
1012,
2828,
1027,
1027,
1027,
1000,
14477,
2854,
10288,
20110,
3258,
1000,
1004,
1004,
13045,
1012,
6685,
1012,
2828,
1027,
1027,
1027,
1000,
12441,
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... |
facebook/relay | packages/relay-compiler/core/getIdentifierForArgumentValue.js | getIdentifierForArgumentValue | function getIdentifierForArgumentValue(value: ArgumentValue): mixed {
switch (value.kind) {
case 'Variable':
return {variable: value.variableName};
case 'Literal':
return {value: value.value};
case 'ListValue':
return {
list: value.items.map(item => getIdentifierForArgumentValue(... | javascript | function getIdentifierForArgumentValue(value: ArgumentValue): mixed {
switch (value.kind) {
case 'Variable':
return {variable: value.variableName};
case 'Literal':
return {value: value.value};
case 'ListValue':
return {
list: value.items.map(item => getIdentifierForArgumentValue(... | [
"function",
"getIdentifierForArgumentValue",
"(",
"value",
":",
"ArgumentValue",
")",
":",
"mixed",
"{",
"switch",
"(",
"value",
".",
"kind",
")",
"{",
"case",
"'Variable'",
":",
"return",
"{",
"variable",
":",
"value",
".",
"variableName",
"}",
";",
"case",... | Generates an identifier for an argument value. The identifier is based on the
structure/order of items and keys in the value. | [
"Generates",
"an",
"identifier",
"for",
"an",
"argument",
"value",
".",
"The",
"identifier",
"is",
"based",
"on",
"the",
"structure",
"/",
"order",
"of",
"items",
"and",
"keys",
"in",
"the",
"value",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/core/getIdentifierForArgumentValue.js#L21-L45 | train | Get identifier for an argument value | [
30522,
3853,
2131,
5178,
16778,
8873,
2121,
29278,
2906,
22850,
4765,
10175,
5657,
1006,
3643,
1024,
6685,
10175,
5657,
1007,
1024,
3816,
1063,
6942,
1006,
3643,
1012,
2785,
1007,
1063,
2553,
1005,
8023,
1005,
1024,
2709,
1063,
8023,
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... |
jgraph/mxgraph | javascript/mxClient.js | function(style)
{
if (style != null)
{
var pairs = style.split(';');
var stylename = pairs[0];
if (stylename.indexOf('=') < 0)
{
return stylename;
}
}
return '';
} | javascript | function(style)
{
if (style != null)
{
var pairs = style.split(';');
var stylename = pairs[0];
if (stylename.indexOf('=') < 0)
{
return stylename;
}
}
return '';
} | [
"function",
"(",
"style",
")",
"{",
"if",
"(",
"style",
"!=",
"null",
")",
"{",
"var",
"pairs",
"=",
"style",
".",
"split",
"(",
"';'",
")",
";",
"var",
"stylename",
"=",
"pairs",
"[",
"0",
"]",
";",
"if",
"(",
"stylename",
".",
"indexOf",
"(",
... | Function: getStylename
Returns the stylename in a style of the form [(stylename|key=value);] or
an empty string if the given style does not contain a stylename.
Parameters:
style - String of the form [(stylename|key=value);]. | [
"Function",
":",
"getStylename"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L5310-L5324 | train | Get the style name of the node | [
30522,
3853,
1006,
2806,
1007,
1063,
2065,
1006,
2806,
999,
1027,
19701,
1007,
1063,
13075,
7689,
1027,
2806,
1012,
3975,
1006,
1005,
1025,
1005,
1007,
1025,
13075,
2806,
18442,
1027,
7689,
1031,
1014,
1033,
1025,
2065,
1006,
2806,
18442,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
infinitered/ignite | src/cli/enforce-global.js | getVersion | function getVersion() {
// parse the version number
try {
// find the executable
var resolvedPath = which.sync(whichExec)
// grab the raw output
var result = shell.exec(`"${resolvedPath}" ${versionCommand}`, { silent: true })
var rawOut = ramda.trim(result.stdout || '')
var ... | javascript | function getVersion() {
// parse the version number
try {
// find the executable
var resolvedPath = which.sync(whichExec)
// grab the raw output
var result = shell.exec(`"${resolvedPath}" ${versionCommand}`, { silent: true })
var rawOut = ramda.trim(result.stdout || '')
var ... | [
"function",
"getVersion",
"(",
")",
"{",
"// parse the version number",
"try",
"{",
"// find the executable",
"var",
"resolvedPath",
"=",
"which",
".",
"sync",
"(",
"whichExec",
")",
"// grab the raw output",
"var",
"result",
"=",
"shell",
".",
"exec",
"(",
"`",
... | Gets the version from the global dependency.
@return {string} The version number or null. | [
"Gets",
"the",
"version",
"from",
"the",
"global",
"dependency",
"."
] | dca91da22f9ad9bab1eb9f43565689d563bd111d | https://github.com/infinitered/ignite/blob/dca91da22f9ad9bab1eb9f43565689d563bd111d/src/cli/enforce-global.js#L77-L102 | train | Get the version number from the executable | [
30522,
3853,
2131,
27774,
1006,
1007,
1063,
1013,
1013,
11968,
3366,
1996,
2544,
2193,
3046,
1063,
1013,
1013,
2424,
1996,
4654,
8586,
23056,
13075,
10395,
15069,
1027,
2029,
1012,
26351,
1006,
2029,
10288,
8586,
1007,
1013,
1013,
6723,
199... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.helpers.js | parseMaxStyle | function parseMaxStyle(styleValue, node, parentProperty) {
var valueInPixels;
if (typeof styleValue === 'string') {
valueInPixels = parseInt(styleValue, 10);
if (styleValue.indexOf('%') !== -1) {
// percentage * size in dimension
valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];
... | javascript | function parseMaxStyle(styleValue, node, parentProperty) {
var valueInPixels;
if (typeof styleValue === 'string') {
valueInPixels = parseInt(styleValue, 10);
if (styleValue.indexOf('%') !== -1) {
// percentage * size in dimension
valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];
... | [
"function",
"parseMaxStyle",
"(",
"styleValue",
",",
"node",
",",
"parentProperty",
")",
"{",
"var",
"valueInPixels",
";",
"if",
"(",
"typeof",
"styleValue",
"===",
"'string'",
")",
"{",
"valueInPixels",
"=",
"parseInt",
"(",
"styleValue",
",",
"10",
")",
";... | Private helper function to convert max-width/max-height values that may be percentages into a number | [
"Private",
"helper",
"function",
"to",
"convert",
"max",
"-",
"width",
"/",
"max",
"-",
"height",
"values",
"that",
"may",
"be",
"percentages",
"into",
"a",
"number"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/core/core.helpers.js#L410-L424 | train | Parse max style value | [
30522,
3853,
11968,
3366,
17848,
21756,
2571,
1006,
2806,
10175,
5657,
1010,
13045,
1010,
6687,
21572,
4842,
3723,
1007,
1063,
13075,
3643,
2378,
8197,
2595,
9050,
1025,
2065,
1006,
2828,
11253,
2806,
10175,
5657,
1027,
1027,
1027,
1005,
51... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/react-relay/isRelayEnvironment.js | isRelayEnvironment | function isRelayEnvironment(environment: mixed): boolean {
return (
typeof environment === 'object' &&
environment !== null &&
// TODO: add applyMutation/sendMutation once ready in both cores
typeof environment.check === 'function' &&
typeof environment.lookup === 'function' &&
typeof environm... | javascript | function isRelayEnvironment(environment: mixed): boolean {
return (
typeof environment === 'object' &&
environment !== null &&
// TODO: add applyMutation/sendMutation once ready in both cores
typeof environment.check === 'function' &&
typeof environment.lookup === 'function' &&
typeof environm... | [
"function",
"isRelayEnvironment",
"(",
"environment",
":",
"mixed",
")",
":",
"boolean",
"{",
"return",
"(",
"typeof",
"environment",
"===",
"'object'",
"&&",
"environment",
"!==",
"null",
"&&",
"// TODO: add applyMutation/sendMutation once ready in both cores",
"typeof",... | Determine if a given value is an object that implements the `Environment`
interface defined in `RelayEnvironmentTypes`. | [
"Determine",
"if",
"a",
"given",
"value",
"is",
"an",
"object",
"that",
"implements",
"the",
"Environment",
"interface",
"defined",
"in",
"RelayEnvironmentTypes",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/react-relay/isRelayEnvironment.js#L17-L29 | train | Check if the environment is a relay environment | [
30522,
3853,
2003,
16570,
4710,
2368,
21663,
2239,
3672,
1006,
4044,
1024,
3816,
1007,
1024,
22017,
20898,
1063,
2709,
1006,
2828,
11253,
4044,
1027,
1027,
1027,
1005,
4874,
1005,
1004,
1004,
4044,
999,
1027,
1027,
19701,
1004,
1004,
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... |
moleculerjs/moleculer | src/middlewares/metrics.js | metricFinish | function metricFinish(ctx, error) {
if (ctx.startHrTime) {
let diff = process.hrtime(ctx.startHrTime);
ctx.duration = (diff[0] * 1e3) + (diff[1] / 1e6); // milliseconds
}
ctx.stopTime = ctx.startTime + ctx.duration;
if (ctx.metrics) {
const payload = generateMetricPayload(ctx);
payload.endTime = ctx.stopTi... | javascript | function metricFinish(ctx, error) {
if (ctx.startHrTime) {
let diff = process.hrtime(ctx.startHrTime);
ctx.duration = (diff[0] * 1e3) + (diff[1] / 1e6); // milliseconds
}
ctx.stopTime = ctx.startTime + ctx.duration;
if (ctx.metrics) {
const payload = generateMetricPayload(ctx);
payload.endTime = ctx.stopTi... | [
"function",
"metricFinish",
"(",
"ctx",
",",
"error",
")",
"{",
"if",
"(",
"ctx",
".",
"startHrTime",
")",
"{",
"let",
"diff",
"=",
"process",
".",
"hrtime",
"(",
"ctx",
".",
"startHrTime",
")",
";",
"ctx",
".",
"duration",
"=",
"(",
"diff",
"[",
"... | Stop metrics & send finish metric event.
@param {Context} ctx
@param {Error} error
@private | [
"Stop",
"metrics",
"&",
"send",
"finish",
"metric",
"event",
"."
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/metrics.js#L99-L123 | train | Finishes the metric execution | [
30522,
3853,
12046,
16294,
4509,
1006,
14931,
2595,
1010,
7561,
1007,
1063,
2065,
1006,
14931,
2595,
1012,
2707,
8093,
7292,
1007,
1063,
2292,
4487,
4246,
1027,
2832,
1012,
17850,
7292,
1006,
14931,
2595,
1012,
2707,
8093,
7292,
1007,
1025,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
moleculerjs/moleculer | bin/moleculer-runner.js | startBroker | function startBroker() {
let worker = cluster.worker;
if (worker) {
Object.assign(config, {
nodeID: (config.nodeID || utils.getNodeID()) + "-" + worker.id
});
}
// Create service broker
broker = new Moleculer.ServiceBroker(Object.assign({}, config));
loadServices();
return broker.start()
.then(() =>... | javascript | function startBroker() {
let worker = cluster.worker;
if (worker) {
Object.assign(config, {
nodeID: (config.nodeID || utils.getNodeID()) + "-" + worker.id
});
}
// Create service broker
broker = new Moleculer.ServiceBroker(Object.assign({}, config));
loadServices();
return broker.start()
.then(() =>... | [
"function",
"startBroker",
"(",
")",
"{",
"let",
"worker",
"=",
"cluster",
".",
"worker",
";",
"if",
"(",
"worker",
")",
"{",
"Object",
".",
"assign",
"(",
"config",
",",
"{",
"nodeID",
":",
"(",
"config",
".",
"nodeID",
"||",
"utils",
".",
"getNodeI... | Start Moleculer broker | [
"Start",
"Moleculer",
"broker"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/bin/moleculer-runner.js#L410-L429 | train | Starts the broker | [
30522,
3853,
2707,
12618,
5484,
1006,
1007,
1063,
2292,
7309,
1027,
9324,
1012,
7309,
1025,
2065,
1006,
7309,
1007,
1063,
4874,
1012,
23911,
1006,
9530,
8873,
2290,
1010,
1063,
13045,
3593,
1024,
1006,
9530,
8873,
2290,
1012,
13045,
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... |
Microsoft/vscode | build/lib/treeshaking.js | shouldSkipAlias | function shouldSkipAlias(node, declaration) {
if (node.kind !== ts.SyntaxKind.Identifier) {
return false;
}
if (node.parent === declaration) {
return true;
}
switch (declaration.kind) {
case ts.SyntaxKind.ImportClause:
case ts.Synta... | javascript | function shouldSkipAlias(node, declaration) {
if (node.kind !== ts.SyntaxKind.Identifier) {
return false;
}
if (node.parent === declaration) {
return true;
}
switch (declaration.kind) {
case ts.SyntaxKind.ImportClause:
case ts.Synta... | [
"function",
"shouldSkipAlias",
"(",
"node",
",",
"declaration",
")",
"{",
"if",
"(",
"node",
".",
"kind",
"!==",
"ts",
".",
"SyntaxKind",
".",
"Identifier",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"node",
".",
"parent",
"===",
"declaration",
... | Go to the original declaration for cases: (1) when the aliased symbol was declared in the location(parent). (2) when the aliased symbol is originating from an import. | [
"Go",
"to",
"the",
"original",
"declaration",
"for",
"cases",
":",
"(",
"1",
")",
"when",
"the",
"aliased",
"symbol",
"was",
"declared",
"in",
"the",
"location",
"(",
"parent",
")",
".",
"(",
"2",
")",
"when",
"the",
"aliased",
"symbol",
"is",
"origina... | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/build/lib/treeshaking.js#L561-L577 | train | Check whether a node should be skipped by aliasing | [
30522,
3853,
2323,
5488,
12952,
7951,
1006,
13045,
1010,
8170,
1007,
1063,
2065,
1006,
13045,
1012,
2785,
999,
1027,
1027,
24529,
1012,
20231,
18824,
1012,
8909,
4765,
18095,
1007,
1063,
2709,
6270,
1025,
1065,
2065,
1006,
13045,
1012,
6687... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/services/url/utils.js | replacePermalink | function replacePermalink(permalink, resource) {
let output = permalink,
primaryTagFallback = 'all',
publishedAtMoment = moment.tz(resource.published_at || Date.now(), settingsCache.get('active_timezone')),
permalinkLookUp = {
year: function () {
return publishedA... | javascript | function replacePermalink(permalink, resource) {
let output = permalink,
primaryTagFallback = 'all',
publishedAtMoment = moment.tz(resource.published_at || Date.now(), settingsCache.get('active_timezone')),
permalinkLookUp = {
year: function () {
return publishedA... | [
"function",
"replacePermalink",
"(",
"permalink",
",",
"resource",
")",
"{",
"let",
"output",
"=",
"permalink",
",",
"primaryTagFallback",
"=",
"'all'",
",",
"publishedAtMoment",
"=",
"moment",
".",
"tz",
"(",
"resource",
".",
"published_at",
"||",
"Date",
"."... | creates the url path for a post based on blog timezone and permalink pattern | [
"creates",
"the",
"url",
"path",
"for",
"a",
"post",
"based",
"on",
"blog",
"timezone",
"and",
"permalink",
"pattern"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/services/url/utils.js#L204-L243 | train | replace permalink with the correct values | [
30522,
3853,
5672,
4842,
9067,
19839,
1006,
2566,
9067,
19839,
1010,
7692,
1007,
1063,
2292,
6434,
1027,
2566,
9067,
19839,
1010,
3078,
15900,
13976,
5963,
1027,
1005,
2035,
1005,
1010,
2405,
4017,
5302,
3672,
1027,
2617,
1012,
1056,
2480,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/node/selenium-webdriver/lib/by.js | check | function check(locator) {
if (locator instanceof By || typeof locator === 'function') {
return locator;
}
if (locator
&& typeof locator === 'object'
&& typeof locator.using === 'string'
&& typeof locator.value === 'string') {
return new By(locator.using, locator.value);
}
for (let ... | javascript | function check(locator) {
if (locator instanceof By || typeof locator === 'function') {
return locator;
}
if (locator
&& typeof locator === 'object'
&& typeof locator.using === 'string'
&& typeof locator.value === 'string') {
return new By(locator.using, locator.value);
}
for (let ... | [
"function",
"check",
"(",
"locator",
")",
"{",
"if",
"(",
"locator",
"instanceof",
"By",
"||",
"typeof",
"locator",
"===",
"'function'",
")",
"{",
"return",
"locator",
";",
"}",
"if",
"(",
"locator",
"&&",
"typeof",
"locator",
"===",
"'object'",
"&&",
"t... | Checks if a value is a valid locator.
@param {!(By|Function|ByHash)} locator The value to check.
@return {!(By|Function)} The valid locator.
@throws {TypeError} If the given value does not define a valid locator
strategy. | [
"Checks",
"if",
"a",
"value",
"is",
"a",
"valid",
"locator",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/lib/by.js#L258-L276 | train | Check if a locator is valid | [
30522,
3853,
4638,
1006,
8840,
11266,
2953,
1007,
1063,
2065,
1006,
8840,
11266,
2953,
6013,
11253,
2011,
1064,
1064,
2828,
11253,
8840,
11266,
2953,
1027,
1027,
1027,
1005,
3853,
1005,
1007,
1063,
2709,
8840,
11266,
2953,
1025,
1065,
2065,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
expressjs/express | lib/router/index.js | wrap | function wrap(old, fn) {
return function proxy() {
var args = new Array(arguments.length + 1);
args[0] = old;
for (var i = 0, len = arguments.length; i < len; i++) {
args[i + 1] = arguments[i];
}
fn.apply(this, args);
};
} | javascript | function wrap(old, fn) {
return function proxy() {
var args = new Array(arguments.length + 1);
args[0] = old;
for (var i = 0, len = arguments.length; i < len; i++) {
args[i + 1] = arguments[i];
}
fn.apply(this, args);
};
} | [
"function",
"wrap",
"(",
"old",
",",
"fn",
")",
"{",
"return",
"function",
"proxy",
"(",
")",
"{",
"var",
"args",
"=",
"new",
"Array",
"(",
"arguments",
".",
"length",
"+",
"1",
")",
";",
"args",
"[",
"0",
"]",
"=",
"old",
";",
"for",
"(",
"var... | wrap a function | [
"wrap",
"a",
"function"
] | dc538f6e810bd462c98ee7e6aae24c64d4b1da93 | https://github.com/expressjs/express/blob/dc538f6e810bd462c98ee7e6aae24c64d4b1da93/lib/router/index.js#L651-L662 | train | wrap a function | [
30522,
3853,
10236,
1006,
2214,
1010,
1042,
2078,
1007,
1063,
2709,
3853,
24540,
1006,
1007,
1063,
13075,
12098,
5620,
1027,
2047,
9140,
1006,
9918,
1012,
3091,
1009,
1015,
1007,
1025,
12098,
5620,
1031,
1014,
1033,
1027,
2214,
1025,
2005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
caolan/async | lib/rejectLimit.js | rejectLimit | function rejectLimit (coll, limit, iteratee, callback) {
return _reject(eachOfLimit(limit), coll, iteratee, callback)
} | javascript | function rejectLimit (coll, limit, iteratee, callback) {
return _reject(eachOfLimit(limit), coll, iteratee, callback)
} | [
"function",
"rejectLimit",
"(",
"coll",
",",
"limit",
",",
"iteratee",
",",
"callback",
")",
"{",
"return",
"_reject",
"(",
"eachOfLimit",
"(",
"limit",
")",
",",
"coll",
",",
"iteratee",
",",
"callback",
")",
"}"
] | The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a
time.
@name rejectLimit
@static
@memberOf module:Collections
@method
@see [async.reject]{@link module:Collections.reject}
@category Collection
@param {Array|Iterable|AsyncIterable|Object} coll - A collection to ... | [
"The",
"same",
"as",
"[",
"reject",
"]",
"{",
"@link",
"module",
":",
"Collections",
".",
"reject",
"}",
"but",
"runs",
"a",
"maximum",
"of",
"limit",
"async",
"operations",
"at",
"a",
"time",
"."
] | 4330d536c106592139fa82062494c9dba0da1fdb | https://github.com/caolan/async/blob/4330d536c106592139fa82062494c9dba0da1fdb/lib/rejectLimit.js#L24-L26 | train | rejects a collection of items up to a given limit | [
30522,
3853,
15454,
17960,
4183,
1006,
8902,
2140,
1010,
5787,
1010,
2009,
22139,
2063,
1010,
2655,
5963,
1007,
1063,
2709,
1035,
15454,
1006,
2169,
11253,
17960,
4183,
1006,
5787,
1007,
1010,
8902,
2140,
1010,
2009,
22139,
2063,
1010,
2655... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
styled-components/styled-components | packages/styled-components/src/vendor/postcss/postcss.js | postcss | function postcss(...plugins) {
if (plugins.length === 1 && Array.isArray(plugins[0])) {
plugins = plugins[0];
}
return new Processor(plugins);
} | javascript | function postcss(...plugins) {
if (plugins.length === 1 && Array.isArray(plugins[0])) {
plugins = plugins[0];
}
return new Processor(plugins);
} | [
"function",
"postcss",
"(",
"...",
"plugins",
")",
"{",
"if",
"(",
"plugins",
".",
"length",
"===",
"1",
"&&",
"Array",
".",
"isArray",
"(",
"plugins",
"[",
"0",
"]",
")",
")",
"{",
"plugins",
"=",
"plugins",
"[",
"0",
"]",
";",
"}",
"return",
"n... | Create a new {@link Processor} instance that will apply `plugins`
as CSS processors.
@param {Array.<Plugin|pluginFunction>|Processor} plugins - PostCSS
plugins. See {@link Processor#use} for plugin format.
@return {Processor} Processor to process multiple CSS
@example
import postcss from 'postcss';
postcss(plugins)... | [
"Create",
"a",
"new",
"{",
"@link",
"Processor",
"}",
"instance",
"that",
"will",
"apply",
"plugins",
"as",
"CSS",
"processors",
"."
] | 4115a1f8e4814b3843d781ce84d686c998ddfd3e | https://github.com/styled-components/styled-components/blob/4115a1f8e4814b3843d781ce84d686c998ddfd3e/packages/styled-components/src/vendor/postcss/postcss.js#L31-L36 | train | PostCSS Processor | [
30522,
3853,
2695,
6169,
2015,
1006,
1012,
1012,
1012,
13354,
7076,
1007,
1063,
2065,
1006,
13354,
7076,
1012,
3091,
1027,
1027,
1027,
1015,
1004,
1004,
9140,
1012,
18061,
11335,
2100,
1006,
13354,
7076,
1031,
1014,
1033,
1007,
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... |
fex-team/webuploader | src/widgets/widget.js | function( apiName, args ) {
/*
{
'make-thumb': 'makeThumb'
}
*/
var map = this.responseMap;
// 如果无API响应声明则忽略
if ( !map || !(apiName in map) || !(map[ apiName ] in this) ||
!$.isFunction... | javascript | function( apiName, args ) {
/*
{
'make-thumb': 'makeThumb'
}
*/
var map = this.responseMap;
// 如果无API响应声明则忽略
if ( !map || !(apiName in map) || !(map[ apiName ] in this) ||
!$.isFunction... | [
"function",
"(",
"apiName",
",",
"args",
")",
"{",
"/*\n {\n 'make-thumb': 'makeThumb'\n }\n */",
"var",
"map",
"=",
"this",
".",
"responseMap",
";",
"// 如果无API响应声明则忽略",
"if",
"(",
"!",
"map",
"||",
"!",
"(",
... | 类Backbone的事件监听声明,监听uploader实例上的事件 widget直接无法监听事件,事件只能通过uploader来传递 | [
"类Backbone的事件监听声明,监听uploader实例上的事件",
"widget直接无法监听事件,事件只能通过uploader来传递"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/src/widgets/widget.js#L43-L61 | train | call api function | [
30522,
3853,
1006,
17928,
18442,
1010,
12098,
5620,
1007,
1063,
1013,
1008,
1063,
1005,
2191,
1011,
7639,
1005,
1024,
1005,
2191,
2705,
25438,
1005,
1065,
1008,
1013,
13075,
4949,
1027,
2023,
1012,
3433,
2863,
2361,
1025,
1013,
1013,
100,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ant-design/ant-design | webpack.config.js | ignoreMomentLocale | function ignoreMomentLocale(webpackConfig) {
delete webpackConfig.module.noParse;
webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/));
} | javascript | function ignoreMomentLocale(webpackConfig) {
delete webpackConfig.module.noParse;
webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/));
} | [
"function",
"ignoreMomentLocale",
"(",
"webpackConfig",
")",
"{",
"delete",
"webpackConfig",
".",
"module",
".",
"noParse",
";",
"webpackConfig",
".",
"plugins",
".",
"push",
"(",
"new",
"webpack",
".",
"IgnorePlugin",
"(",
"/",
"^\\.\\/locale$",
"/",
",",
"/"... | noParse still leave `require('./locale' + name)` in dist files ignore is better: http://stackoverflow.com/q/25384360 | [
"noParse",
"still",
"leave",
"require",
"(",
".",
"/",
"locale",
"+",
"name",
")",
"in",
"dist",
"files",
"ignore",
"is",
"better",
":",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"q",
"/",
"25384360"
] | 6d845f60efe9bd50a25c0ce29eb1fee895b9c7b7 | https://github.com/ant-design/ant-design/blob/6d845f60efe9bd50a25c0ce29eb1fee895b9c7b7/webpack.config.js#L9-L12 | train | Ignore moment locale | [
30522,
3853,
8568,
5302,
3672,
4135,
9289,
2063,
1006,
4773,
23947,
8663,
8873,
2290,
1007,
1063,
3972,
12870,
4773,
23947,
8663,
8873,
2290,
1012,
11336,
1012,
2053,
19362,
3366,
1025,
4773,
23947,
8663,
8873,
2290,
1012,
13354,
7076,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/prefs.js | preferences_getPref | function preferences_getPref(prefName, defaultValue, defaultBranch,
interfaceType) {
try {
branch = defaultBranch ? this.defaultPrefBranch : this.prefBranch;
// If interfaceType has been set, handle it differently
if (interfaceType != undefined) {
... | javascript | function preferences_getPref(prefName, defaultValue, defaultBranch,
interfaceType) {
try {
branch = defaultBranch ? this.defaultPrefBranch : this.prefBranch;
// If interfaceType has been set, handle it differently
if (interfaceType != undefined) {
... | [
"function",
"preferences_getPref",
"(",
"prefName",
",",
"defaultValue",
",",
"defaultBranch",
",",
"interfaceType",
")",
"{",
"try",
"{",
"branch",
"=",
"defaultBranch",
"?",
"this",
".",
"defaultPrefBranch",
":",
"this",
".",
"prefBranch",
";",
"// If interfaceT... | Retrieve the value of an individual preference.
@param {string} prefName
The preference to get the value of.
@param {boolean/number/string} defaultValue
The default value if preference cannot be found.
@param {boolean/number/string} defaultBranch
If true the value will be read from the default branch (optional)
@param... | [
"Retrieve",
"the",
"value",
"of",
"an",
"individual",
"preference",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/prefs.js#L269-L292 | train | Get the value of a preference | [
30522,
3853,
18394,
1035,
2131,
28139,
2546,
1006,
3653,
2546,
18442,
1010,
12398,
10175,
5657,
1010,
12398,
10024,
12680,
1010,
8278,
13874,
1007,
1063,
3046,
1063,
3589,
1027,
12398,
10024,
12680,
1029,
2023,
1012,
12398,
28139,
26337,
5521... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/function-paren-newline.js | validateArguments | function validateArguments(parens, elements) {
const leftParen = parens.leftParen;
const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen);
const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen);
const needsNewlines = shouldHaveNewlines... | javascript | function validateArguments(parens, elements) {
const leftParen = parens.leftParen;
const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen);
const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen);
const needsNewlines = shouldHaveNewlines... | [
"function",
"validateArguments",
"(",
"parens",
",",
"elements",
")",
"{",
"const",
"leftParen",
"=",
"parens",
".",
"leftParen",
";",
"const",
"tokenAfterLeftParen",
"=",
"sourceCode",
".",
"getTokenAfter",
"(",
"leftParen",
")",
";",
"const",
"hasLeftNewline",
... | Validates a list of arguments or parameters
@param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token
@param {ASTNode[]} elements The arguments or parameters in the list
@returns {void} | [
"Validates",
"a",
"list",
"of",
"arguments",
"or",
"parameters"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/function-paren-newline.js#L162-L181 | train | Validate arguments | [
30522,
3853,
9398,
3686,
2906,
22850,
11187,
1006,
11968,
6132,
1010,
3787,
1007,
1063,
9530,
3367,
2187,
19362,
2368,
1027,
11968,
6132,
1012,
2187,
19362,
2368,
1025,
9530,
3367,
19204,
10354,
3334,
2571,
6199,
19362,
2368,
1027,
3120,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wuchangming/spy-debugger | buildin_modules/weinre/web/interfaces/interfaces.js | getIdlType | function getIdlType(type) {
var result
if (-1 == NativeTypes.indexOf(type.name)) {
result = "<a href='javascript:showInterface(\"" + type.name + "\"); void(0);'>" + type.name + "</a>"
}
else {
result = type.name
}
for (var i=0; i<type.rank; i++) {
result += "[]"
}
... | javascript | function getIdlType(type) {
var result
if (-1 == NativeTypes.indexOf(type.name)) {
result = "<a href='javascript:showInterface(\"" + type.name + "\"); void(0);'>" + type.name + "</a>"
}
else {
result = type.name
}
for (var i=0; i<type.rank; i++) {
result += "[]"
}
... | [
"function",
"getIdlType",
"(",
"type",
")",
"{",
"var",
"result",
"if",
"(",
"-",
"1",
"==",
"NativeTypes",
".",
"indexOf",
"(",
"type",
".",
"name",
")",
")",
"{",
"result",
"=",
"\"<a href='javascript:showInterface(\\\"\"",
"+",
"type",
".",
"name",
"+",... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/interfaces/interfaces.js#L209-L225 | train | Get IDL type | [
30522,
3853,
2131,
3593,
24228,
5051,
1006,
2828,
1007,
1063,
13075,
2765,
2065,
1006,
1011,
1015,
1027,
1027,
3128,
13874,
2015,
1012,
5950,
11253,
1006,
2828,
1012,
2171,
1007,
1007,
1063,
2765,
1027,
1000,
1026,
1037,
17850,
12879,
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... |
nodejs/node-gyp | lib/build.js | loadConfigGypi | function loadConfigGypi () {
var configPath = path.resolve('build', 'config.gypi')
fs.readFile(configPath, 'utf8', function (err, data) {
if (err) {
if (err.code == 'ENOENT') {
callback(new Error('You must run `node-gyp configure` first!'))
} else {
callback(err)
... | javascript | function loadConfigGypi () {
var configPath = path.resolve('build', 'config.gypi')
fs.readFile(configPath, 'utf8', function (err, data) {
if (err) {
if (err.code == 'ENOENT') {
callback(new Error('You must run `node-gyp configure` first!'))
} else {
callback(err)
... | [
"function",
"loadConfigGypi",
"(",
")",
"{",
"var",
"configPath",
"=",
"path",
".",
"resolve",
"(",
"'build'",
",",
"'config.gypi'",
")",
"fs",
".",
"readFile",
"(",
"configPath",
",",
"'utf8'",
",",
"function",
"(",
"err",
",",
"data",
")",
"{",
"if",
... | Load the "config.gypi" file that was generated during "configure". | [
"Load",
"the",
"config",
".",
"gypi",
"file",
"that",
"was",
"generated",
"during",
"configure",
"."
] | 721eb691cf15556cc2700eda0558d5bad5f84232 | https://github.com/nodejs/node-gyp/blob/721eb691cf15556cc2700eda0558d5bad5f84232/lib/build.js#L40-L75 | train | Load the gypi config file | [
30522,
3853,
7170,
8663,
8873,
22772,
8197,
1006,
1007,
1063,
13075,
9530,
8873,
21600,
8988,
1027,
4130,
1012,
10663,
1006,
1005,
3857,
1005,
1010,
1005,
9530,
8873,
2290,
1012,
1043,
22571,
2072,
1005,
1007,
1042,
2015,
1012,
3191,
8873,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/events/TouchToMouseMapping.js | function(sType, oEvent) {
if (!bHandleEvent) {
return;
}
// we need mapping of the different event types to get the correct target
var oMappedEvent = oEvent.type == "touchend" ? oEvent.changedTouches[0] : oEvent.touches[0];
// create the synthetic event
var newEvent = oDocument.createEvent('Mou... | javascript | function(sType, oEvent) {
if (!bHandleEvent) {
return;
}
// we need mapping of the different event types to get the correct target
var oMappedEvent = oEvent.type == "touchend" ? oEvent.changedTouches[0] : oEvent.touches[0];
// create the synthetic event
var newEvent = oDocument.createEvent('Mou... | [
"function",
"(",
"sType",
",",
"oEvent",
")",
"{",
"if",
"(",
"!",
"bHandleEvent",
")",
"{",
"return",
";",
"}",
"// we need mapping of the different event types to get the correct target",
"var",
"oMappedEvent",
"=",
"oEvent",
".",
"type",
"==",
"\"touchend\"",
"?"... | Fires a synthetic mouse event for a given type and native touch event.
@param {string} sType the type of the synthetic event to fire, e.g. "mousedown"
@param {jQuery.Event} oEvent the event object
@private | [
"Fires",
"a",
"synthetic",
"mouse",
"event",
"for",
"a",
"given",
"type",
"and",
"native",
"touch",
"event",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/TouchToMouseMapping.js#L36-L58 | train | This function is called by the event handler when the event is handled by the native event handler. | [
30522,
3853,
1006,
2358,
18863,
1010,
1051,
18697,
3372,
1007,
1063,
2065,
1006,
999,
1038,
11774,
10559,
15338,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
2057,
2342,
12375,
1997,
1996,
2367,
2724,
4127,
2000,
2131,
1996,
6149,
4539,
13075,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
necolas/react-native-web | packages/react-native-web/src/modules/normalizeNativeEvent/index.js | normalizeNativeEvent | function normalizeNativeEvent(nativeEvent: Object) {
if (!nativeEvent || nativeEvent._normalized) {
return nativeEvent;
}
const eventType = nativeEvent.type || '';
const mouse = eventType.indexOf('mouse') >= 0;
if (mouse) {
return normalizeMouseEvent(nativeEvent);
} else {
return normalizeTouchE... | javascript | function normalizeNativeEvent(nativeEvent: Object) {
if (!nativeEvent || nativeEvent._normalized) {
return nativeEvent;
}
const eventType = nativeEvent.type || '';
const mouse = eventType.indexOf('mouse') >= 0;
if (mouse) {
return normalizeMouseEvent(nativeEvent);
} else {
return normalizeTouchE... | [
"function",
"normalizeNativeEvent",
"(",
"nativeEvent",
":",
"Object",
")",
"{",
"if",
"(",
"!",
"nativeEvent",
"||",
"nativeEvent",
".",
"_normalized",
")",
"{",
"return",
"nativeEvent",
";",
"}",
"const",
"eventType",
"=",
"nativeEvent",
".",
"type",
"||",
... | TODO: how to best handle keyboard events? | [
"TODO",
":",
"how",
"to",
"best",
"handle",
"keyboard",
"events?"
] | 801937748b2f3c96284bee1881164ac0c62a9c6d | https://github.com/necolas/react-native-web/blob/801937748b2f3c96284bee1881164ac0c62a9c6d/packages/react-native-web/src/modules/normalizeNativeEvent/index.js#L177-L188 | train | Normalize a native event | [
30522,
3853,
3671,
4697,
19833,
3512,
18697,
3372,
1006,
3128,
18697,
3372,
1024,
4874,
1007,
1063,
2065,
1006,
999,
3128,
18697,
3372,
1064,
1064,
3128,
18697,
3372,
1012,
1035,
3671,
3550,
1007,
1063,
2709,
3128,
18697,
3372,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/space-unary-ops.js | verifyWordDoesntHaveSpaces | function verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word) {
if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) {
if (secondToken.range[0] > firstToken.range[1]) {
context.report({
node,
messageId: "une... | javascript | function verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word) {
if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) {
if (secondToken.range[0] > firstToken.range[1]) {
context.report({
node,
messageId: "une... | [
"function",
"verifyWordDoesntHaveSpaces",
"(",
"node",
",",
"firstToken",
",",
"secondToken",
",",
"word",
")",
"{",
"if",
"(",
"astUtils",
".",
"canTokensBeAdjacent",
"(",
"firstToken",
",",
"secondToken",
")",
")",
"{",
"if",
"(",
"secondToken",
".",
"range"... | Verify Unary Word Operator doesn't have spaces after the word operator
@param {ASTnode} node AST node
@param {Object} firstToken first token from the AST node
@param {Object} secondToken second token from the AST node
@param {string} word The word to be used for reporting
@returns {void} | [
"Verify",
"Unary",
"Word",
"Operator",
"doesn",
"t",
"have",
"spaces",
"after",
"the",
"word",
"operator"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/space-unary-ops.js#L130-L145 | train | Verify that word does not have spaces | [
30522,
3853,
20410,
18351,
3527,
2229,
3372,
3270,
6961,
15327,
2015,
1006,
13045,
1010,
2034,
18715,
2368,
1010,
2117,
18715,
2368,
1010,
2773,
1007,
1063,
2065,
1006,
2004,
8525,
3775,
4877,
1012,
2064,
18715,
6132,
4783,
4215,
3900,
1301... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/weex-vue-framework/index.js | init | function init (cfg) {
renderer.Document = cfg.Document;
renderer.Element = cfg.Element;
renderer.Comment = cfg.Comment;
renderer.sendTasks = cfg.sendTasks;
} | javascript | function init (cfg) {
renderer.Document = cfg.Document;
renderer.Element = cfg.Element;
renderer.Comment = cfg.Comment;
renderer.sendTasks = cfg.sendTasks;
} | [
"function",
"init",
"(",
"cfg",
")",
"{",
"renderer",
".",
"Document",
"=",
"cfg",
".",
"Document",
";",
"renderer",
".",
"Element",
"=",
"cfg",
".",
"Element",
";",
"renderer",
".",
"Comment",
"=",
"cfg",
".",
"Comment",
";",
"renderer",
".",
"sendTas... | Prepare framework config, basically about the virtual-DOM and JS bridge.
@param {object} cfg | [
"Prepare",
"framework",
"config",
"basically",
"about",
"the",
"virtual",
"-",
"DOM",
"and",
"JS",
"bridge",
"."
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/weex-vue-framework/index.js#L33-L38 | train | Initialize the ckey renderer | [
30522,
3853,
1999,
4183,
1006,
12935,
2290,
1007,
1063,
17552,
2121,
1012,
6254,
1027,
12935,
2290,
1012,
6254,
1025,
17552,
2121,
1012,
5783,
1027,
12935,
2290,
1012,
5783,
1025,
17552,
2121,
1012,
7615,
1027,
12935,
2290,
1012,
7615,
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... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | dispatch | function dispatch(methodName, inDocument, xpath, contextNode, namespaceResolver) {
xpath = preprocess(xpath);
if (! contextNode) {
contextNode = inDocument;
}
var result = getEngineFor(inDocument)
.setIgnoreAttributesWithoutValue(ignoreAttributesWithoutValue)
... | javascript | function dispatch(methodName, inDocument, xpath, contextNode, namespaceResolver) {
xpath = preprocess(xpath);
if (! contextNode) {
contextNode = inDocument;
}
var result = getEngineFor(inDocument)
.setIgnoreAttributesWithoutValue(ignoreAttributesWithoutValue)
... | [
"function",
"dispatch",
"(",
"methodName",
",",
"inDocument",
",",
"xpath",
",",
"contextNode",
",",
"namespaceResolver",
")",
"{",
"xpath",
"=",
"preprocess",
"(",
"xpath",
")",
";",
"if",
"(",
"!",
"contextNode",
")",
"{",
"contextNode",
"=",
"inDocument",... | Dispatches an XPath evaluation method on the relevant engine for the
given document, and returns the result | [
"Dispatches",
"an",
"XPath",
"evaluation",
"method",
"on",
"the",
"relevant",
"engine",
"for",
"the",
"given",
"document",
"and",
"returns",
"the",
"result"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L2001-L2013 | train | Dispatches a method to the engine for the given xpath. | [
30522,
3853,
18365,
1006,
4118,
18442,
1010,
11424,
24894,
4765,
1010,
26726,
8988,
1010,
6123,
3630,
3207,
1010,
3415,
15327,
6072,
4747,
6299,
1007,
1063,
26726,
8988,
1027,
17463,
3217,
9623,
2015,
1006,
26726,
8988,
1007,
1025,
2065,
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... |
GitbookIO/gitbook | lib/output/generateBook.js | generateBook | function generateBook(generator, book, options) {
options = generator.Options(options);
var state = generator.State? generator.State({}) : Immutable.Map();
var start = Date.now();
return Promise(
new Output({
book: book,
options: options,
state: state,
... | javascript | function generateBook(generator, book, options) {
options = generator.Options(options);
var state = generator.State? generator.State({}) : Immutable.Map();
var start = Date.now();
return Promise(
new Output({
book: book,
options: options,
state: state,
... | [
"function",
"generateBook",
"(",
"generator",
",",
"book",
",",
"options",
")",
"{",
"options",
"=",
"generator",
".",
"Options",
"(",
"options",
")",
";",
"var",
"state",
"=",
"generator",
".",
"State",
"?",
"generator",
".",
"State",
"(",
"{",
"}",
"... | Generate a book using a generator.
The overall process is:
1. List and load plugins for this book
2. Call hook "config"
3. Call hook "init"
4. Initialize generator
5. List all assets and pages
6. Copy all assets to output
7. Generate all pages
8. Call hook "finish:before"
9. Finish generation
10. Call hook "finish"
... | [
"Generate",
"a",
"book",
"using",
"a",
"generator",
"."
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/generateBook.js#L155-L191 | train | Generate a book | [
30522,
3853,
9699,
8654,
1006,
13103,
1010,
2338,
1010,
7047,
1007,
1063,
7047,
1027,
13103,
1012,
7047,
1006,
7047,
1007,
1025,
13075,
2110,
1027,
13103,
1012,
2110,
1029,
13103,
1012,
2110,
1006,
1063,
1065,
1007,
1024,
10047,
28120,
3085... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FindReplace.js | clearCurrentMatchHighlight | function clearCurrentMatchHighlight(cm, state) {
if (state.markedCurrent) {
state.markedCurrent.clear();
ScrollTrackMarkers.markCurrent(-1);
}
} | javascript | function clearCurrentMatchHighlight(cm, state) {
if (state.markedCurrent) {
state.markedCurrent.clear();
ScrollTrackMarkers.markCurrent(-1);
}
} | [
"function",
"clearCurrentMatchHighlight",
"(",
"cm",
",",
"state",
")",
"{",
"if",
"(",
"state",
".",
"markedCurrent",
")",
"{",
"state",
".",
"markedCurrent",
".",
"clear",
"(",
")",
";",
"ScrollTrackMarkers",
".",
"markCurrent",
"(",
"-",
"1",
")",
";",
... | Removes the current-match highlight, leaving all matches marked in the generic highlight style | [
"Removes",
"the",
"current",
"-",
"match",
"highlight",
"leaving",
"all",
"matches",
"marked",
"in",
"the",
"generic",
"highlight",
"style"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindReplace.js#L398-L403 | train | clear current match highlight | [
30522,
3853,
3154,
10841,
14343,
3372,
18900,
2818,
4048,
5603,
7138,
1006,
4642,
1010,
2110,
1007,
1063,
2065,
1006,
2110,
1012,
4417,
10841,
14343,
3372,
1007,
1063,
2110,
1012,
4417,
10841,
14343,
3372,
1012,
3154,
1006,
1007,
1025,
1718... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/table-resolver.js | getTable | function getTable(trxOrKnex, tableName, schemaName) {
return schemaName
? trxOrKnex(tableName).withSchema(schemaName)
: trxOrKnex(tableName);
} | javascript | function getTable(trxOrKnex, tableName, schemaName) {
return schemaName
? trxOrKnex(tableName).withSchema(schemaName)
: trxOrKnex(tableName);
} | [
"function",
"getTable",
"(",
"trxOrKnex",
",",
"tableName",
",",
"schemaName",
")",
"{",
"return",
"schemaName",
"?",
"trxOrKnex",
"(",
"tableName",
")",
".",
"withSchema",
"(",
"schemaName",
")",
":",
"trxOrKnex",
"(",
"tableName",
")",
";",
"}"
] | Get schema-aware query builder for a given table and schema name | [
"Get",
"schema",
"-",
"aware",
"query",
"builder",
"for",
"a",
"given",
"table",
"and",
"schema",
"name"
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/migrate/table-resolver.js#L7-L11 | train | Returns the table name | [
30522,
3853,
2131,
10880,
1006,
19817,
2595,
2953,
2243,
2638,
2595,
1010,
2795,
18442,
1010,
8040,
28433,
18442,
1007,
1063,
2709,
8040,
28433,
18442,
1029,
19817,
2595,
2953,
2243,
2638,
2595,
1006,
2795,
18442,
1007,
1012,
2007,
22842,
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... |
graphql/graphql-js | src/jsutils/suggestionList.js | lexicalDistance | function lexicalDistance(aStr, bStr) {
if (aStr === bStr) {
return 0;
}
let i;
let j;
const d = [];
const a = aStr.toLowerCase();
const b = bStr.toLowerCase();
const aLength = a.length;
const bLength = b.length;
// Any case change counts as a single edit
if (a === b) {
return 1;
}
f... | javascript | function lexicalDistance(aStr, bStr) {
if (aStr === bStr) {
return 0;
}
let i;
let j;
const d = [];
const a = aStr.toLowerCase();
const b = bStr.toLowerCase();
const aLength = a.length;
const bLength = b.length;
// Any case change counts as a single edit
if (a === b) {
return 1;
}
f... | [
"function",
"lexicalDistance",
"(",
"aStr",
",",
"bStr",
")",
"{",
"if",
"(",
"aStr",
"===",
"bStr",
")",
"{",
"return",
"0",
";",
"}",
"let",
"i",
";",
"let",
"j",
";",
"const",
"d",
"=",
"[",
"]",
";",
"const",
"a",
"=",
"aStr",
".",
"toLower... | Computes the lexical distance between strings A and B.
The "distance" between two strings is given by counting the minimum number
of edits needed to transform string A into string B. An edit can be an
insertion, deletion, or substitution of a single character, or a swap of two
adjacent characters.
Includes a custom a... | [
"Computes",
"the",
"lexical",
"distance",
"between",
"strings",
"A",
"and",
"B",
"."
] | b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef | https://github.com/graphql/graphql-js/blob/b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef/src/jsutils/suggestionList.js#L51-L94 | train | Returns the lexical distance between two strings | [
30522,
3853,
16105,
9289,
10521,
26897,
1006,
2004,
16344,
1010,
18667,
16344,
1007,
1063,
2065,
1006,
2004,
16344,
1027,
1027,
1027,
18667,
16344,
1007,
1063,
2709,
1014,
1025,
1065,
2292,
1045,
1025,
2292,
1046,
1025,
9530,
3367,
1040,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/util/report-translator.js | normalizeReportLoc | function normalizeReportLoc(descriptor) {
if (descriptor.loc) {
if (descriptor.loc.start) {
return descriptor.loc;
}
return { start: descriptor.loc, end: null };
}
return descriptor.node.loc;
} | javascript | function normalizeReportLoc(descriptor) {
if (descriptor.loc) {
if (descriptor.loc.start) {
return descriptor.loc;
}
return { start: descriptor.loc, end: null };
}
return descriptor.node.loc;
} | [
"function",
"normalizeReportLoc",
"(",
"descriptor",
")",
"{",
"if",
"(",
"descriptor",
".",
"loc",
")",
"{",
"if",
"(",
"descriptor",
".",
"loc",
".",
"start",
")",
"{",
"return",
"descriptor",
".",
"loc",
";",
"}",
"return",
"{",
"start",
":",
"descr... | Normalizes a MessageDescriptor to always have a `loc` with `start` and `end` properties
@param {MessageDescriptor} descriptor A descriptor for the report from a rule.
@returns {{start: Location, end: (Location|null)}} An updated location that infers the `start` and `end` properties
from the `node` of the original descr... | [
"Normalizes",
"a",
"MessageDescriptor",
"to",
"always",
"have",
"a",
"loc",
"with",
"start",
"and",
"end",
"properties"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/report-translator.js#L106-L114 | train | Normalize the loc of a report | [
30522,
3853,
3671,
17629,
13699,
11589,
4135,
2278,
1006,
4078,
23235,
2953,
1007,
1063,
2065,
1006,
4078,
23235,
2953,
1012,
8840,
2278,
1007,
1063,
2065,
1006,
4078,
23235,
2953,
1012,
8840,
2278,
1012,
2707,
1007,
1063,
2709,
4078,
23235... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | templateRepeat | function templateRepeat(oElement, oWithControl) {
var sList = oElement.getAttribute("list") || "",
oBindingInfo
= BindingParser.complexParser(sList, oScope, false, true, true, true),
aContexts,
oListBinding,
sModelName,
oNewWithControl,
oPromise,
sVar = oElement.getAttribute... | javascript | function templateRepeat(oElement, oWithControl) {
var sList = oElement.getAttribute("list") || "",
oBindingInfo
= BindingParser.complexParser(sList, oScope, false, true, true, true),
aContexts,
oListBinding,
sModelName,
oNewWithControl,
oPromise,
sVar = oElement.getAttribute... | [
"function",
"templateRepeat",
"(",
"oElement",
",",
"oWithControl",
")",
"{",
"var",
"sList",
"=",
"oElement",
".",
"getAttribute",
"(",
"\"list\"",
")",
"||",
"\"\"",
",",
"oBindingInfo",
"=",
"BindingParser",
".",
"complexParser",
"(",
"sList",
",",
"oScope"... | Processes a <template:repeat> instruction.
@param {Element} oElement
the <template:repeat> XML DOM element
@param {sap.ui.core.template._with} oWithControl
the parent's "with" control
@returns {sap.ui.base.SyncPromise}
A sync promise which resolves with <code>undefined</code> as soon as the loop is
done, or is rejecte... | [
"Processes",
"a",
"<template",
":",
"repeat",
">",
"instruction",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L1536-L1609 | train | This function is called when the template is being repeated. It will create a new instance of the Repeat class. | [
30522,
3853,
23561,
2890,
5051,
4017,
1006,
1051,
12260,
3672,
1010,
27593,
8939,
8663,
13181,
2140,
1007,
1063,
13075,
22889,
2923,
1027,
1051,
12260,
3672,
1012,
2131,
19321,
3089,
8569,
2618,
1006,
1000,
2862,
1000,
1007,
1064,
1064,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js | function(locationUrlOrEntriesArray, options) {
_private.oLog.info(sModuleName + " - Play");
if (_private.isPlayStarted()) {
_private.oLog.error(sModuleName + " - RequestRecorder is already playing, please stop first...");
return;
}
_private.init(options);
var sLocationUrl;
// Check if locatio... | javascript | function(locationUrlOrEntriesArray, options) {
_private.oLog.info(sModuleName + " - Play");
if (_private.isPlayStarted()) {
_private.oLog.error(sModuleName + " - RequestRecorder is already playing, please stop first...");
return;
}
_private.init(options);
var sLocationUrl;
// Check if locatio... | [
"function",
"(",
"locationUrlOrEntriesArray",
",",
"options",
")",
"{",
"_private",
".",
"oLog",
".",
"info",
"(",
"sModuleName",
"+",
"\" - Play\"",
")",
";",
"if",
"(",
"_private",
".",
"isPlayStarted",
"(",
")",
")",
"{",
"_private",
".",
"oLog",
".",
... | Start replay with a complete URL to the har file or with an entries array and the required options.
@param {string|Array} locationUrlOrEntriesArray Specifies from which location the file is loaded. This parameter is overloaded and can also be an entries array.
@param {object} [options] Contains optional parameters to ... | [
"Start",
"replay",
"with",
"a",
"complete",
"URL",
"to",
"the",
"har",
"file",
"or",
"with",
"an",
"entries",
"array",
"and",
"the",
"required",
"options",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L640-L728 | train | Play the request recorder | [
30522,
3853,
1006,
3295,
3126,
20186,
3372,
5134,
2906,
9447,
1010,
7047,
1007,
1063,
1035,
2797,
1012,
19330,
8649,
1012,
18558,
1006,
15488,
7716,
9307,
18442,
1009,
1000,
1011,
2377,
1000,
1007,
1025,
2065,
1006,
1035,
2797,
1012,
2003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Configuration.js | function (mCurrencies) {
// add custom units, or remove the existing ones if none are given
var mExistingCurrencies = this.getCustomCurrencies();
if (mExistingCurrencies){
mCurrencies = jQuery.extend({}, mExistingCurrencies, mCurrencies);
}
this.setCustomCurrencies(mCurrencies);
return this;
} | javascript | function (mCurrencies) {
// add custom units, or remove the existing ones if none are given
var mExistingCurrencies = this.getCustomCurrencies();
if (mExistingCurrencies){
mCurrencies = jQuery.extend({}, mExistingCurrencies, mCurrencies);
}
this.setCustomCurrencies(mCurrencies);
return this;
} | [
"function",
"(",
"mCurrencies",
")",
"{",
"// add custom units, or remove the existing ones if none are given",
"var",
"mExistingCurrencies",
"=",
"this",
".",
"getCustomCurrencies",
"(",
")",
";",
"if",
"(",
"mExistingCurrencies",
")",
"{",
"mCurrencies",
"=",
"jQuery",
... | Adds custom currencies to the existing entries.
E.g.
<code>
{
"KWD": {"digits": 3},
"TND" : {"digits": 3}
}
</code>
@public
@param {object} mCurrencies adds to the currency map
@returns {sap.ui.core.Configuration.FormatSettings}
@see sap.ui.core.Configuration.FormatSettings#setCustomCurrencies | [
"Adds",
"custom",
"currencies",
"to",
"the",
"existing",
"entries",
".",
"E",
".",
"g",
".",
"<code",
">",
"{",
"KWD",
":",
"{",
"digits",
":",
"3",
"}",
"TND",
":",
"{",
"digits",
":",
"3",
"}",
"}",
"<",
"/",
"code",
">"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Configuration.js#L1992-L2000 | train | Adds custom currencies to the currency list | [
30522,
3853,
1006,
11338,
3126,
7389,
9243,
1007,
1063,
1013,
1013,
5587,
7661,
3197,
1010,
2030,
6366,
1996,
4493,
3924,
2065,
3904,
2024,
2445,
13075,
2033,
9048,
16643,
3070,
10841,
14343,
14767,
1027,
2023,
1012,
2131,
7874,
20389,
1084... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/registry/Settings.js | function(oSettings) {
EventProvider.apply(this);
if (!oSettings) {
throw new Error("no flex settings provided");
}
// Defaults layers used for standard changes, such as 'move' or 'add'
if (!oSettings.defaultLayerPermissions) {
oSettings.defaultLayerPermissions = {
"VENDOR": true,
"CUSTOMER_BASE"... | javascript | function(oSettings) {
EventProvider.apply(this);
if (!oSettings) {
throw new Error("no flex settings provided");
}
// Defaults layers used for standard changes, such as 'move' or 'add'
if (!oSettings.defaultLayerPermissions) {
oSettings.defaultLayerPermissions = {
"VENDOR": true,
"CUSTOMER_BASE"... | [
"function",
"(",
"oSettings",
")",
"{",
"EventProvider",
".",
"apply",
"(",
"this",
")",
";",
"if",
"(",
"!",
"oSettings",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"no flex settings provided\"",
")",
";",
"}",
"// Defaults layers used for standard changes, such a... | FlexSettings access
@param {object} oSettings settings as JSON object
@constructor
@alias sap.ui.fl.registry.Settings
@author SAP SE
@experimental Since 1.27.0
@private | [
"FlexSettings",
"access"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/registry/Settings.js#L21-L53 | train | Creates a new instance of the FlexChange event provider. | [
30522,
3853,
1006,
9808,
18319,
3070,
2015,
1007,
1063,
2724,
21572,
17258,
2121,
1012,
6611,
1006,
2023,
1007,
1025,
2065,
1006,
999,
9808,
18319,
3070,
2015,
1007,
1063,
5466,
2047,
7561,
1006,
1000,
2053,
23951,
10906,
3024,
1000,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/file/FileUtils.js | translateLineEndings | function translateLineEndings(text, lineEndings) {
if (lineEndings !== LINE_ENDINGS_CRLF && lineEndings !== LINE_ENDINGS_LF) {
lineEndings = getPlatformLineEndings();
}
var eolStr = (lineEndings === LINE_ENDINGS_CRLF ? "\r\n" : "\n");
var findAnyEol = /\r\n|\r|\n/g;
... | javascript | function translateLineEndings(text, lineEndings) {
if (lineEndings !== LINE_ENDINGS_CRLF && lineEndings !== LINE_ENDINGS_LF) {
lineEndings = getPlatformLineEndings();
}
var eolStr = (lineEndings === LINE_ENDINGS_CRLF ? "\r\n" : "\n");
var findAnyEol = /\r\n|\r|\n/g;
... | [
"function",
"translateLineEndings",
"(",
"text",
",",
"lineEndings",
")",
"{",
"if",
"(",
"lineEndings",
"!==",
"LINE_ENDINGS_CRLF",
"&&",
"lineEndings",
"!==",
"LINE_ENDINGS_LF",
")",
"{",
"lineEndings",
"=",
"getPlatformLineEndings",
"(",
")",
";",
"}",
"var",
... | Translates any line ending types in the given text to the be the single form specified
@param {!string} text
@param {null|LINE_ENDINGS_CRLF|LINE_ENDINGS_LF} lineEndings
@return {string} | [
"Translates",
"any",
"line",
"ending",
"types",
"in",
"the",
"given",
"text",
"to",
"the",
"be",
"the",
"single",
"form",
"specified"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L159-L168 | train | Translate the line endings of a string to the correct format | [
30522,
3853,
17637,
4179,
18537,
2015,
1006,
3793,
1010,
2240,
18537,
2015,
1007,
1063,
2065,
1006,
2240,
18537,
2015,
999,
1027,
1027,
2240,
1035,
21306,
1035,
13675,
10270,
1004,
1004,
2240,
18537,
2015,
999,
1027,
1027,
2240,
1035,
21306... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/gesture/gesture.js | getEventPoint | function getEventPoint(ev) {
ev = ev.originalEvent || ev; // support jQuery events
return (ev.touches && ev.touches[0]) ||
(ev.changedTouches && ev.changedTouches[0]) ||
ev;
} | javascript | function getEventPoint(ev) {
ev = ev.originalEvent || ev; // support jQuery events
return (ev.touches && ev.touches[0]) ||
(ev.changedTouches && ev.changedTouches[0]) ||
ev;
} | [
"function",
"getEventPoint",
"(",
"ev",
")",
"{",
"ev",
"=",
"ev",
".",
"originalEvent",
"||",
"ev",
";",
"// support jQuery events",
"return",
"(",
"ev",
".",
"touches",
"&&",
"ev",
".",
"touches",
"[",
"0",
"]",
")",
"||",
"(",
"ev",
".",
"changedTou... | Normalize the point where the DOM event happened whether it's touch or mouse.
@returns point event obj with pageX and pageY on it. | [
"Normalize",
"the",
"point",
"where",
"the",
"DOM",
"event",
"happened",
"whether",
"it",
"s",
"touch",
"or",
"mouse",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/gesture/gesture.js#L774-L779 | train | get event point | [
30522,
3853,
2131,
18697,
3372,
8400,
1006,
23408,
1007,
1063,
23408,
1027,
23408,
1012,
2434,
18697,
3372,
1064,
1064,
23408,
1025,
1013,
1013,
2490,
1046,
4226,
2854,
2824,
2709,
1006,
23408,
1012,
12817,
1004,
1004,
23408,
1012,
12817,
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/LiveDevelopment/MultiBrowserImpl/protocol/LiveDevProtocol.js | _receive | function _receive(clientId, msgStr) {
var msg = JSON.parse(msgStr),
event = msg.method || "event",
deferred;
if (msg.id) {
deferred = _responseDeferreds[msg.id];
if (deferred) {
delete _responseDeferreds[msg.id];
if (msg.err... | javascript | function _receive(clientId, msgStr) {
var msg = JSON.parse(msgStr),
event = msg.method || "event",
deferred;
if (msg.id) {
deferred = _responseDeferreds[msg.id];
if (deferred) {
delete _responseDeferreds[msg.id];
if (msg.err... | [
"function",
"_receive",
"(",
"clientId",
",",
"msgStr",
")",
"{",
"var",
"msg",
"=",
"JSON",
".",
"parse",
"(",
"msgStr",
")",
",",
"event",
"=",
"msg",
".",
"method",
"||",
"\"event\"",
",",
"deferred",
";",
"if",
"(",
"msg",
".",
"id",
")",
"{",
... | @private
Handles a message received from the remote protocol handler via the transport.
If the message has an `id` field, it's assumed to be a response to a previous
request, and will be passed along to the original promise returned by `_send()`.
Otherwise, it's treated as an event and dispatched.
TODO: we should proba... | [
"@private",
"Handles",
"a",
"message",
"received",
"from",
"the",
"remote",
"protocol",
"handler",
"via",
"the",
"transport",
".",
"If",
"the",
"message",
"has",
"an",
"id",
"field",
"it",
"s",
"assumed",
"to",
"be",
"a",
"response",
"to",
"a",
"previous",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/LiveDevProtocol.js#L101-L126 | train | receive a message from the client | [
30522,
3853,
1035,
4374,
1006,
7396,
3593,
1010,
5796,
5620,
16344,
1007,
1063,
13075,
5796,
2290,
1027,
1046,
3385,
1012,
11968,
3366,
1006,
5796,
5620,
16344,
1007,
1010,
2724,
1027,
5796,
2290,
1012,
4118,
1064,
1064,
1000,
2724,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/prefer-template.js | getTemplateLiteral | function getTemplateLiteral(currentNode, textBeforeNode, textAfterNode) {
if (currentNode.type === "Literal" && typeof currentNode.value === "string") {
/*
* If the current node is a string literal, escape any instances of ${ or ` to prevent them from being interpreted
... | javascript | function getTemplateLiteral(currentNode, textBeforeNode, textAfterNode) {
if (currentNode.type === "Literal" && typeof currentNode.value === "string") {
/*
* If the current node is a string literal, escape any instances of ${ or ` to prevent them from being interpreted
... | [
"function",
"getTemplateLiteral",
"(",
"currentNode",
",",
"textBeforeNode",
",",
"textAfterNode",
")",
"{",
"if",
"(",
"currentNode",
".",
"type",
"===",
"\"Literal\"",
"&&",
"typeof",
"currentNode",
".",
"value",
"===",
"\"string\"",
")",
"{",
"/*\n ... | Returns a template literal form of the given node.
@param {ASTNode} currentNode A node that should be converted to a template literal
@param {string} textBeforeNode Text that should appear before the node
@param {string} textAfterNode Text that should appear after the node
@returns {string} A string form of this node, ... | [
"Returns",
"a",
"template",
"literal",
"form",
"of",
"the",
"given",
"node",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-template.js#L181-L234 | train | Get the template literal | [
30522,
30524,
3793,
4783,
29278,
16515,
3207,
1010,
3793,
10354,
16451,
10244,
1007,
1063,
2065,
1006,
2783,
3630,
3207,
1012,
2828,
1027,
1027,
1027,
1000,
18204,
1000,
1004,
1004,
2828,
11253,
2783,
3630,
3207,
1012,
3643,
1027,
1027,
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... |
Dogfalo/materialize | dist/js/materialize.js | Component | function Component(classDef, el, options) {
_classCallCheck(this, Component);
// Display error if el is valid HTML Element
if (!(el instanceof Element)) {
console.error(Error(el + ' is not an HTML Element'));
}
// If exists, destroy and reinitialize in child
var ins = classDef.getInstanc... | javascript | function Component(classDef, el, options) {
_classCallCheck(this, Component);
// Display error if el is valid HTML Element
if (!(el instanceof Element)) {
console.error(Error(el + ' is not an HTML Element'));
}
// If exists, destroy and reinitialize in child
var ins = classDef.getInstanc... | [
"function",
"Component",
"(",
"classDef",
",",
"el",
",",
"options",
")",
"{",
"_classCallCheck",
"(",
"this",
",",
"Component",
")",
";",
"// Display error if el is valid HTML Element",
"if",
"(",
"!",
"(",
"el",
"instanceof",
"Element",
")",
")",
"{",
"conso... | Generic constructor for all components
@constructor
@param {Element} el
@param {Object} options | [
"Generic",
"constructor",
"for",
"all",
"components"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/dist/js/materialize.js#L1014-L1030 | train | A component class that can be used to create a new node | [
30522,
3853,
6922,
1006,
2465,
3207,
2546,
1010,
3449,
1010,
7047,
1007,
1063,
1035,
2465,
9289,
29358,
11012,
1006,
2023,
1010,
6922,
1007,
1025,
1013,
1013,
4653,
7561,
2065,
3449,
2003,
9398,
16129,
5783,
2065,
1006,
999,
1006,
3449,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.f/src/sap/f/library.js | function(DataType) {
"use strict";
// delegate further initialization of this library to the Core
sap.ui.getCore().initLibrary({
name : "sap.f",
version: "${version}",
dependencies : ["sap.ui.core", "sap.m", "sap.ui.layout"],
designtime: "sap/f/designtime/library.designtime",
interfaces: [
"sap.f.card... | javascript | function(DataType) {
"use strict";
// delegate further initialization of this library to the Core
sap.ui.getCore().initLibrary({
name : "sap.f",
version: "${version}",
dependencies : ["sap.ui.core", "sap.m", "sap.ui.layout"],
designtime: "sap/f/designtime/library.designtime",
interfaces: [
"sap.f.card... | [
"function",
"(",
"DataType",
")",
"{",
"\"use strict\"",
";",
"// delegate further initialization of this library to the Core",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"initLibrary",
"(",
"{",
"name",
":",
"\"sap.f\"",
",",
"version",
":",
"\"${version}\"",... | library dependency | [
"library",
"dependency"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.f/src/sap/f/library.js#L13-L522 | train | The sap. f. sap. layout library | [
30522,
3853,
1006,
2951,
13874,
1007,
1063,
1000,
2224,
9384,
1000,
1025,
1013,
1013,
11849,
2582,
3988,
3989,
1997,
2023,
3075,
2000,
1996,
4563,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
1012,
1999,
4183,
29521,
19848,
2100,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/Context.js | function (oModel, oBinding, sPath) {
iReturnValueContextCount += 1;
return new Context(oModel, oBinding, sPath, undefined, undefined,
iReturnValueContextCount);
} | javascript | function (oModel, oBinding, sPath) {
iReturnValueContextCount += 1;
return new Context(oModel, oBinding, sPath, undefined, undefined,
iReturnValueContextCount);
} | [
"function",
"(",
"oModel",
",",
"oBinding",
",",
"sPath",
")",
"{",
"iReturnValueContextCount",
"+=",
"1",
";",
"return",
"new",
"Context",
"(",
"oModel",
",",
"oBinding",
",",
"sPath",
",",
"undefined",
",",
"undefined",
",",
"iReturnValueContextCount",
")",
... | Creates a return value context for an OData V4 model. A unique ID for this context is
generated and can be retrieved via {@link #getReturnValueContextId}.
@param {sap.ui.model.odata.v4.ODataModel} oModel
The model
@param {sap.ui.model.odata.v4.ODataContextBinding} oBinding
A binding that belongs to the model
@param {s... | [
"Creates",
"a",
"return",
"value",
"context",
"for",
"an",
"OData",
"V4",
"model",
".",
"A",
"unique",
"ID",
"for",
"this",
"context",
"is",
"generated",
"and",
"can",
"be",
"retrieved",
"via",
"{",
"@link",
"#getReturnValueContextId",
"}",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/Context.js#L889-L894 | train | Creates a context object that can be used to return a value to the next function call. | [
30522,
3853,
1006,
18168,
10244,
2140,
1010,
27885,
22254,
2075,
1010,
14690,
2232,
1007,
1063,
20868,
3388,
14287,
10175,
5657,
8663,
18209,
3597,
16671,
1009,
1027,
1015,
1025,
2709,
2047,
6123,
1006,
18168,
10244,
2140,
1010,
27885,
22254,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(node, nodeType)
{
nodeType = nodeType || mxConstants.NODETYPE_ELEMENT;
var children = [];
var tmp = node.firstChild;
while (tmp != null)
{
if (tmp.nodeType == nodeType)
{
children.push(tmp);
}
tmp = tmp.nextSibling;
}
return children;
} | javascript | function(node, nodeType)
{
nodeType = nodeType || mxConstants.NODETYPE_ELEMENT;
var children = [];
var tmp = node.firstChild;
while (tmp != null)
{
if (tmp.nodeType == nodeType)
{
children.push(tmp);
}
tmp = tmp.nextSibling;
}
return children;
} | [
"function",
"(",
"node",
",",
"nodeType",
")",
"{",
"nodeType",
"=",
"nodeType",
"||",
"mxConstants",
".",
"NODETYPE_ELEMENT",
";",
"var",
"children",
"=",
"[",
"]",
";",
"var",
"tmp",
"=",
"node",
".",
"firstChild",
";",
"while",
"(",
"tmp",
"!=",
"nu... | Function: getChildNodes
Returns an array of child nodes that are of the given node type.
Parameters:
node - Parent DOM node to return the children from.
nodeType - Optional node type to return. Default is
<mxConstants.NODETYPE_ELEMENT>. | [
"Function",
":",
"getChildNodes"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L2630-L2648 | train | Returns the children of node | [
30522,
3853,
1006,
13045,
1010,
13045,
13874,
1007,
1063,
13045,
13874,
1027,
13045,
13874,
1064,
1064,
25630,
8663,
12693,
3215,
1012,
13045,
13874,
1035,
5783,
1025,
13075,
2336,
1027,
1031,
1033,
1025,
13075,
1056,
8737,
1027,
13045,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | stripPredicate | function stripPredicate(sSegment) {
var i = sSegment.indexOf("(");
return i >= 0 ? sSegment.slice(0, i) : sSegment;
} | javascript | function stripPredicate(sSegment) {
var i = sSegment.indexOf("(");
return i >= 0 ? sSegment.slice(0, i) : sSegment;
} | [
"function",
"stripPredicate",
"(",
"sSegment",
")",
"{",
"var",
"i",
"=",
"sSegment",
".",
"indexOf",
"(",
"\"(\"",
")",
";",
"return",
"i",
">=",
"0",
"?",
"sSegment",
".",
"slice",
"(",
"0",
",",
"i",
")",
":",
"sSegment",
";",
"}"
] | Strips off the predicate from a segment | [
"Strips",
"off",
"the",
"predicate",
"from",
"a",
"segment"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L1562-L1565 | train | Removes predicate from segment | [
30522,
3853,
6167,
28139,
16467,
1006,
7020,
13910,
3672,
1007,
1063,
13075,
1045,
1027,
7020,
13910,
3672,
1012,
5950,
11253,
1006,
1000,
1006,
1000,
1007,
1025,
2709,
1045,
1028,
1027,
1014,
1029,
7020,
13910,
3672,
1012,
14704,
1006,
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... |
grpc/grpc-node | packages/grpc-native-core/src/server.js | handleServerStreaming | function handleServerStreaming(call, handler, metadata) {
var stream = new ServerWritableStream(call, metadata, handler.serialize);
stream.waitForCancel();
var batch = {};
batch[grpc.opType.RECV_MESSAGE] = true;
call.startBatch(batch, function(err, result) {
if (err) {
stream.emit('error', err);
... | javascript | function handleServerStreaming(call, handler, metadata) {
var stream = new ServerWritableStream(call, metadata, handler.serialize);
stream.waitForCancel();
var batch = {};
batch[grpc.opType.RECV_MESSAGE] = true;
call.startBatch(batch, function(err, result) {
if (err) {
stream.emit('error', err);
... | [
"function",
"handleServerStreaming",
"(",
"call",
",",
"handler",
",",
"metadata",
")",
"{",
"var",
"stream",
"=",
"new",
"ServerWritableStream",
"(",
"call",
",",
"metadata",
",",
"handler",
".",
"serialize",
")",
";",
"stream",
".",
"waitForCancel",
"(",
"... | User provided method to handle server streaming methods on the server.
@callback grpc.Server~handleServerStreamingCall
@param {grpc~ServerWritableStream} call The call object
Fully handle a server streaming call
@private
@param {grpc.internal~Call} call The call to handle
@param {Object} handler Request handler objec... | [
"User",
"provided",
"method",
"to",
"handle",
"server",
"streaming",
"methods",
"on",
"the",
"server",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/server.js#L622-L641 | train | Handle server streaming | [
30522,
3853,
16024,
2121,
14028,
25379,
2075,
1006,
2655,
1010,
28213,
1010,
27425,
1007,
1063,
13075,
5460,
1027,
2047,
8241,
13088,
6590,
13510,
25379,
1006,
2655,
1010,
27425,
1010,
28213,
1012,
7642,
4697,
1007,
1025,
5460,
1012,
3524,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-whitespace-before-property.js | reportError | function reportError(node, leftToken, rightToken) {
const replacementText = node.computed ? "" : ".";
context.report({
node,
message: "Unexpected whitespace before property {{propName}}.",
data: {
propName: sourceCode.getText(n... | javascript | function reportError(node, leftToken, rightToken) {
const replacementText = node.computed ? "" : ".";
context.report({
node,
message: "Unexpected whitespace before property {{propName}}.",
data: {
propName: sourceCode.getText(n... | [
"function",
"reportError",
"(",
"node",
",",
"leftToken",
",",
"rightToken",
")",
"{",
"const",
"replacementText",
"=",
"node",
".",
"computed",
"?",
"\"\"",
":",
"\".\"",
";",
"context",
".",
"report",
"(",
"{",
"node",
",",
"message",
":",
"\"Unexpected ... | -------------------------------------------------------------------------- Helpers --------------------------------------------------------------------------
Reports whitespace before property token
@param {ASTNode} node - the node to report in the event of an error
@param {Token} leftToken - the left token
@param {To... | [
"--------------------------------------------------------------------------",
"Helpers",
"--------------------------------------------------------------------------",
"Reports",
"whitespace",
"before",
"property",
"token"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-whitespace-before-property.js#L47-L68 | train | Reports an error with a given node. | [
30522,
3853,
6398,
29165,
1006,
13045,
1010,
2187,
18715,
2368,
1010,
2157,
18715,
2368,
1007,
1063,
9530,
3367,
6110,
18209,
1027,
13045,
1012,
24806,
1029,
1000,
1000,
1024,
1000,
1012,
1000,
1025,
6123,
1012,
3189,
1006,
1063,
13045,
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... |
fex-team/webuploader | _draft/music/webuploader.js | function( file, status ) {
file = this.request( 'get-file', file );
file.setStatus( status || Status.COMPLETE );
file.skipped = true;
// 如果正在上传。
file.blocks && $.each( file.blocks, function( _, v ) {
var _tr = ... | javascript | function( file, status ) {
file = this.request( 'get-file', file );
file.setStatus( status || Status.COMPLETE );
file.skipped = true;
// 如果正在上传。
file.blocks && $.each( file.blocks, function( _, v ) {
var _tr = ... | [
"function",
"(",
"file",
",",
"status",
")",
"{",
"file",
"=",
"this",
".",
"request",
"(",
"'get-file'",
",",
"file",
")",
";",
"file",
".",
"setStatus",
"(",
"status",
"||",
"Status",
".",
"COMPLETE",
")",
";",
"file",
".",
"skipped",
"=",
"true",
... | 掉过一个文件上传,直接标记指定文件为已上传状态。
@grammar skipFile( file ) => undefined
@method skipFile
@for Uploader | [
"掉过一个文件上传,直接标记指定文件为已上传状态。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/_draft/music/webuploader.js#L4851-L4869 | train | Upload file to the server | [
30522,
3853,
1006,
5371,
1010,
3570,
1007,
1063,
5371,
1027,
2023,
1012,
5227,
1006,
1005,
2131,
1011,
5371,
1005,
1010,
5371,
1007,
1025,
5371,
1012,
4520,
29336,
2271,
1006,
3570,
1064,
1064,
3570,
1012,
3143,
1007,
1025,
5371,
1012,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/no-extra-parens.js | doesMemberExpressionContainCallExpression | function doesMemberExpressionContainCallExpression(node) {
let currentNode = node.object;
let currentNodeType = node.object.type;
while (currentNodeType === "MemberExpression") {
currentNode = currentNode.object;
currentNodeType = currentNode.type;
... | javascript | function doesMemberExpressionContainCallExpression(node) {
let currentNode = node.object;
let currentNodeType = node.object.type;
while (currentNodeType === "MemberExpression") {
currentNode = currentNode.object;
currentNodeType = currentNode.type;
... | [
"function",
"doesMemberExpressionContainCallExpression",
"(",
"node",
")",
"{",
"let",
"currentNode",
"=",
"node",
".",
"object",
";",
"let",
"currentNodeType",
"=",
"node",
".",
"object",
".",
"type",
";",
"while",
"(",
"currentNodeType",
"===",
"\"MemberExpressi... | Check if a member expression contains a call expression
@param {ASTNode} node MemberExpression node to evaluate
@returns {boolean} true if found, false if not | [
"Check",
"if",
"a",
"member",
"expression",
"contains",
"a",
"call",
"expression"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-extra-parens.js#L355-L365 | train | Check if a MemberExpression contains a CallExpression | [
30522,
3853,
2515,
4168,
21784,
10288,
20110,
3258,
8663,
18249,
9289,
2571,
2595,
20110,
3258,
1006,
13045,
1007,
1063,
2292,
2783,
3630,
3207,
1027,
13045,
1012,
4874,
1025,
2292,
2783,
3630,
3207,
13874,
1027,
13045,
1012,
4874,
1012,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/TokenUtils.js | offsetInToken | function offsetInToken(ctx) {
var offset = ctx.pos.ch - ctx.token.start;
if (offset < 0) {
console.log("CodeHintUtils: _offsetInToken - Invalid context: pos not in the current token!");
}
return offset;
} | javascript | function offsetInToken(ctx) {
var offset = ctx.pos.ch - ctx.token.start;
if (offset < 0) {
console.log("CodeHintUtils: _offsetInToken - Invalid context: pos not in the current token!");
}
return offset;
} | [
"function",
"offsetInToken",
"(",
"ctx",
")",
"{",
"var",
"offset",
"=",
"ctx",
".",
"pos",
".",
"ch",
"-",
"ctx",
".",
"token",
".",
"start",
";",
"if",
"(",
"offset",
"<",
"0",
")",
"{",
"console",
".",
"log",
"(",
"\"CodeHintUtils: _offsetInToken - ... | In the given context, get the character offset of pos from the start of the token.
@param {!{editor:!CodeMirror, pos:!{ch:number, line:number}, token:Object}} context
@return {number} | [
"In",
"the",
"given",
"context",
"get",
"the",
"character",
"offset",
"of",
"pos",
"from",
"the",
"start",
"of",
"the",
"token",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/TokenUtils.js#L195-L201 | train | Get the offset in the token | [
30522,
3853,
16396,
18447,
11045,
2078,
1006,
14931,
2595,
1007,
1063,
13075,
16396,
1027,
14931,
2595,
1012,
13433,
2015,
1012,
10381,
1011,
14931,
2595,
1012,
19204,
1012,
2707,
1025,
2065,
1006,
16396,
1026,
1014,
1007,
1063,
10122,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/RecentProjects/main.js | handleKeyEvent | function handleKeyEvent() {
if (!$dropdown) {
if (!SidebarView.isVisible()) {
SidebarView.show();
}
$("#project-dropdown-toggle").trigger("click");
$dropdown.focus();
$links = $dropdown.find("a");
// By default, select the... | javascript | function handleKeyEvent() {
if (!$dropdown) {
if (!SidebarView.isVisible()) {
SidebarView.show();
}
$("#project-dropdown-toggle").trigger("click");
$dropdown.focus();
$links = $dropdown.find("a");
// By default, select the... | [
"function",
"handleKeyEvent",
"(",
")",
"{",
"if",
"(",
"!",
"$dropdown",
")",
"{",
"if",
"(",
"!",
"SidebarView",
".",
"isVisible",
"(",
")",
")",
"{",
"SidebarView",
".",
"show",
"(",
")",
";",
"}",
"$",
"(",
"\"#project-dropdown-toggle\"",
")",
".",... | Show or hide the recent projects dropdown from the toogle command. | [
"Show",
"or",
"hide",
"the",
"recent",
"projects",
"dropdown",
"from",
"the",
"toogle",
"command",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L420-L440 | train | Handle key events | [
30522,
3853,
5047,
14839,
18697,
3372,
1006,
1007,
1063,
2065,
1006,
999,
1002,
4530,
7698,
1007,
1063,
2065,
1006,
999,
2217,
8237,
8584,
1012,
2003,
11365,
7028,
1006,
1007,
1007,
1063,
2217,
8237,
8584,
1012,
2265,
1006,
1007,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js | processMinOrMax | function processMinOrMax(sName, sMinOrMax) {
var sAlias = "UI5" + sMinOrMax + "__" + sName;
aConcatAggregate.push(sName + " with " + sMinOrMax + " as " + sAlias);
if (mAlias2MeasureAndMethod) {
mAlias2MeasureAndMethod[sAlias] = {
measure : sName,
method : sMinOrMax
};
}
} | javascript | function processMinOrMax(sName, sMinOrMax) {
var sAlias = "UI5" + sMinOrMax + "__" + sName;
aConcatAggregate.push(sName + " with " + sMinOrMax + " as " + sAlias);
if (mAlias2MeasureAndMethod) {
mAlias2MeasureAndMethod[sAlias] = {
measure : sName,
method : sMinOrMax
};
}
} | [
"function",
"processMinOrMax",
"(",
"sName",
",",
"sMinOrMax",
")",
"{",
"var",
"sAlias",
"=",
"\"UI5\"",
"+",
"sMinOrMax",
"+",
"\"__\"",
"+",
"sName",
";",
"aConcatAggregate",
".",
"push",
"(",
"sName",
"+",
"\" with \"",
"+",
"sMinOrMax",
"+",
"\" as \"",... | /*
Builds the min/max expression for the "concat" term (for example
"AggregatableProperty with min as UI5min__AggregatableProperty") and adds a
corresponding entry to the optional alias map.
@param {string} sName - An aggregatable property name
@param {string} sMinOrMax - Either "min" or "max" | [
"/",
"*",
"Builds",
"the",
"min",
"/",
"max",
"expression",
"for",
"the",
"concat",
"term",
"(",
"for",
"example",
"AggregatableProperty",
"with",
"min",
"as",
"UI5min__AggregatableProperty",
")",
"and",
"adds",
"a",
"corresponding",
"entry",
"to",
"the",
"opt... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js#L245-L255 | train | Adds a new aggregate with the given name and a minimum or maximum value. | [
30522,
3853,
2832,
10020,
2953,
17848,
1006,
1055,
18442,
1010,
15488,
5740,
17830,
2595,
1007,
1063,
13075,
16183,
7951,
1027,
1000,
21318,
2629,
1000,
1009,
15488,
5740,
17830,
2595,
1009,
1000,
1035,
1035,
1000,
1009,
1055,
18442,
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... |
babel/babel | packages/babel-parser/src/plugins/jsx/index.js | getQualifiedJSXName | function getQualifiedJSXName(
object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression,
): string {
if (object.type === "JSXIdentifier") {
return object.name;
}
if (object.type === "JSXNamespacedName") {
return object.namespace.name + ":" + object.name.name;
}
if (object.type === "JSX... | javascript | function getQualifiedJSXName(
object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression,
): string {
if (object.type === "JSXIdentifier") {
return object.name;
}
if (object.type === "JSXNamespacedName") {
return object.namespace.name + ":" + object.name.name;
}
if (object.type === "JSX... | [
"function",
"getQualifiedJSXName",
"(",
"object",
":",
"N",
".",
"JSXIdentifier",
"|",
"N",
".",
"JSXNamespacedName",
"|",
"N",
".",
"JSXMemberExpression",
",",
")",
":",
"string",
"{",
"if",
"(",
"object",
".",
"type",
"===",
"\"JSXIdentifier\"",
")",
"{",
... | Transforms JSX element name to string. | [
"Transforms",
"JSX",
"element",
"name",
"to",
"string",
"."
] | 1969e6b6aa7d90be3fbb3aca98ea96849656a55a | https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-parser/src/plugins/jsx/index.js#L53-L74 | train | Get the qualified name of a JSX identifier or member expression | [
30522,
3853,
2131,
26426,
7810,
22578,
2595,
18442,
1006,
4874,
1024,
1050,
1012,
1046,
2015,
19491,
16778,
8873,
2121,
1064,
1050,
1012,
1046,
2015,
2595,
18442,
23058,
28911,
4168,
1064,
1050,
1012,
1046,
2015,
2595,
4168,
21784,
10288,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/format/DateFormat.js | function(oField, oDate, bUTC, oFormat) {
var iDay = bUTC ? oDate.getUTCDay() : oDate.getDay();
if (oField.digits < 4) {
return oFormat.aDaysAbbrev[iDay];
} else if (oField.digits == 4) {
return oFormat.aDaysWide[iDay];
} else if (oField.digits == 5) {
return oFormat.aDaysNarrow[iDay];
... | javascript | function(oField, oDate, bUTC, oFormat) {
var iDay = bUTC ? oDate.getUTCDay() : oDate.getDay();
if (oField.digits < 4) {
return oFormat.aDaysAbbrev[iDay];
} else if (oField.digits == 4) {
return oFormat.aDaysWide[iDay];
} else if (oField.digits == 5) {
return oFormat.aDaysNarrow[iDay];
... | [
"function",
"(",
"oField",
",",
"oDate",
",",
"bUTC",
",",
"oFormat",
")",
"{",
"var",
"iDay",
"=",
"bUTC",
"?",
"oDate",
".",
"getUTCDay",
"(",
")",
":",
"oDate",
".",
"getDay",
"(",
")",
";",
"if",
"(",
"oField",
".",
"digits",
"<",
"4",
")",
... | Day of week name, format style. | [
"Day",
"of",
"week",
"name",
"format",
"style",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/format/DateFormat.js#L996-L1007 | train | Returns the date format for a given field | [
30522,
3853,
1006,
1997,
12891,
1010,
1051,
13701,
1010,
2021,
2278,
1010,
1997,
2953,
18900,
1007,
1063,
13075,
16096,
2100,
1027,
2021,
2278,
1029,
1051,
13701,
1012,
2131,
4904,
19797,
4710,
1006,
1007,
1024,
1051,
13701,
1012,
2131,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.