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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jgraph/mxgraph | javascript/mxClient.js | mxGeometryChange | function mxGeometryChange(model, cell, geometry)
{
this.model = model;
this.cell = cell;
this.geometry = geometry;
this.previous = geometry;
} | javascript | function mxGeometryChange(model, cell, geometry)
{
this.model = model;
this.cell = cell;
this.geometry = geometry;
this.previous = geometry;
} | [
"function",
"mxGeometryChange",
"(",
"model",
",",
"cell",
",",
"geometry",
")",
"{",
"this",
".",
"model",
"=",
"model",
";",
"this",
".",
"cell",
"=",
"cell",
";",
"this",
".",
"geometry",
"=",
"geometry",
";",
"this",
".",
"previous",
"=",
"geometry... | Class: mxGeometryChange
Action to change a cell's geometry in a model.
Constructor: mxGeometryChange
Constructs a change of a geometry in the
specified model. | [
"Class",
":",
"mxGeometryChange"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L41810-L41816 | train | This is the callback function for the geometry change event | [
30522,
3853,
25630,
3351,
8462,
11129,
22305,
2063,
1006,
2944,
1010,
3526,
1010,
10988,
1007,
1063,
2023,
1012,
2944,
1027,
2944,
1025,
2023,
1012,
3526,
1027,
3526,
1025,
2023,
1012,
10988,
1027,
10988,
1025,
2023,
1012,
3025,
1027,
10988... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/ScopeManager.js | getTernFunctionType | function getTernFunctionType(fileInfo, offset) {
postMessage({
type: MessageIds.TERN_CALLED_FUNC_TYPE_MSG,
fileInfo: fileInfo,
offset: offset
});
return addPendingRequest(fileInfo.name, offset, MessageIds.TERN_CALLED_FUNC_TYPE_MSG);
} | javascript | function getTernFunctionType(fileInfo, offset) {
postMessage({
type: MessageIds.TERN_CALLED_FUNC_TYPE_MSG,
fileInfo: fileInfo,
offset: offset
});
return addPendingRequest(fileInfo.name, offset, MessageIds.TERN_CALLED_FUNC_TYPE_MSG);
} | [
"function",
"getTernFunctionType",
"(",
"fileInfo",
",",
"offset",
")",
"{",
"postMessage",
"(",
"{",
"type",
":",
"MessageIds",
".",
"TERN_CALLED_FUNC_TYPE_MSG",
",",
"fileInfo",
":",
"fileInfo",
",",
"offset",
":",
"offset",
"}",
")",
";",
"return",
"addPend... | Get a Promise for the function type from TernJS.
@param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
- type of update, name of file, and the text of the update.
For "full" updates, the whole text of the file is present. For "part" updates,
the changed portion of the text. For "empty" updat... | [
"Get",
"a",
"Promise",
"for",
"the",
"function",
"type",
"from",
"TernJS",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L502-L510 | train | Get tern function type | [
30522,
3853,
2131,
16451,
11263,
27989,
13874,
1006,
5371,
2378,
14876,
1010,
16396,
1007,
1063,
2695,
7834,
3736,
3351,
1006,
1063,
2828,
1024,
4471,
9821,
1012,
28774,
2078,
1035,
2170,
1035,
4569,
2278,
1035,
2828,
1035,
5796,
2290,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ksky521/nodeppt | packages/nodeppt-parser/lib/markdown/attrs/index.js | get | function get(arr, n) {
return n >= 0 ? arr[n] : arr[arr.length + n];
} | javascript | function get(arr, n) {
return n >= 0 ? arr[n] : arr[arr.length + n];
} | [
"function",
"get",
"(",
"arr",
",",
"n",
")",
"{",
"return",
"n",
">=",
"0",
"?",
"arr",
"[",
"n",
"]",
":",
"arr",
"[",
"arr",
".",
"length",
"+",
"n",
"]",
";",
"}"
] | Get n item of array. Supports negative n, where -1 is last
element in array.
@param {array} arr
@param {number} n | [
"Get",
"n",
"item",
"of",
"array",
".",
"Supports",
"negative",
"n",
"where",
"-",
"1",
"is",
"last",
"element",
"in",
"array",
"."
] | ca77e29ef818c08b0522b31e3925b073cf159b9c | https://github.com/ksky521/nodeppt/blob/ca77e29ef818c08b0522b31e3925b073cf159b9c/packages/nodeppt-parser/lib/markdown/attrs/index.js#L158-L160 | train | Get the n - th item from an array of words | [
30522,
3853,
2131,
1006,
12098,
2099,
1010,
1050,
1007,
1063,
2709,
1050,
1028,
1027,
1014,
1029,
12098,
2099,
1031,
1050,
1033,
1024,
12098,
2099,
1031,
12098,
2099,
1012,
3091,
1009,
1050,
1033,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | docs/app/js/codepen.js | translate | function translate(demo, externalScripts) {
var files = demo.files;
return appendLicenses({
title: demo.title,
html: processHtml(demo),
head: LINK_FONTS_ROBOTO,
js: processJs(files.js),
css: mergeFiles(files.css).join(' '),
js_external: externalScripts.conc... | javascript | function translate(demo, externalScripts) {
var files = demo.files;
return appendLicenses({
title: demo.title,
html: processHtml(demo),
head: LINK_FONTS_ROBOTO,
js: processJs(files.js),
css: mergeFiles(files.css).join(' '),
js_external: externalScripts.conc... | [
"function",
"translate",
"(",
"demo",
",",
"externalScripts",
")",
"{",
"var",
"files",
"=",
"demo",
".",
"files",
";",
"return",
"appendLicenses",
"(",
"{",
"title",
":",
"demo",
".",
"title",
",",
"html",
":",
"processHtml",
"(",
"demo",
")",
",",
"h... | Translates a demo model to match Codepen's post data See http://blog.codepen.io/documentation/api/prefill | [
"Translates",
"a",
"demo",
"model",
"to",
"match",
"Codepen",
"s",
"post",
"data",
"See",
"http",
":",
"//",
"blog",
".",
"codepen",
".",
"io",
"/",
"documentation",
"/",
"api",
"/",
"prefill"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/app/js/codepen.js#L80-L94 | train | Translate a demo to a language specific language | [
30522,
3853,
17637,
1006,
9703,
1010,
6327,
22483,
2015,
1007,
1063,
13075,
6764,
1027,
9703,
1012,
6764,
1025,
2709,
10439,
10497,
13231,
12325,
2015,
1006,
1063,
2516,
1024,
9703,
1012,
2516,
1010,
16129,
1024,
2832,
11039,
19968,
1006,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js | function(oTable) {
if (oTable._$colResize) {
oTable._$colResize.toggleClass("sapUiTableColRszActive", false);
oTable._$colResize = null;
}
oTable._iColumnResizeStart = null;
oTable._bIsColumnResizerMoving = false;
oTable.$().toggleClass("sapUiTableResizing", false);
oTable._enableTextSelection... | javascript | function(oTable) {
if (oTable._$colResize) {
oTable._$colResize.toggleClass("sapUiTableColRszActive", false);
oTable._$colResize = null;
}
oTable._iColumnResizeStart = null;
oTable._bIsColumnResizerMoving = false;
oTable.$().toggleClass("sapUiTableResizing", false);
oTable._enableTextSelection... | [
"function",
"(",
"oTable",
")",
"{",
"if",
"(",
"oTable",
".",
"_$colResize",
")",
"{",
"oTable",
".",
"_$colResize",
".",
"toggleClass",
"(",
"\"sapUiTableColRszActive\"",
",",
"false",
")",
";",
"oTable",
".",
"_$colResize",
"=",
"null",
";",
"}",
"oTabl... | /*
Cleans up the state which is created while resize a column via drag&drop. | [
"/",
"*",
"Cleans",
"up",
"the",
"state",
"which",
"is",
"created",
"while",
"resize",
"a",
"column",
"via",
"drag&drop",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js#L225-L240 | train | Removes the Column Resize event listeners. | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
2065,
1006,
27178,
3085,
1012,
1035,
1002,
8902,
6072,
4697,
1007,
1063,
27178,
3085,
1012,
1035,
1002,
8902,
6072,
4697,
1012,
2000,
24679,
26266,
1006,
1000,
20066,
14663,
3085,
25778,
2869,
414... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/angular | packages/bazel/src/protractor/protractor.conf.js | setConf | function setConf(conf, name, value, msg) {
if (conf[name] && conf[name] !== value) {
console.warn(
`Your protractor configuration specifies an option which is overwritten by Bazel: '${name}' ${msg}`);
}
conf[name] = value;
} | javascript | function setConf(conf, name, value, msg) {
if (conf[name] && conf[name] !== value) {
console.warn(
`Your protractor configuration specifies an option which is overwritten by Bazel: '${name}' ${msg}`);
}
conf[name] = value;
} | [
"function",
"setConf",
"(",
"conf",
",",
"name",
",",
"value",
",",
"msg",
")",
"{",
"if",
"(",
"conf",
"[",
"name",
"]",
"&&",
"conf",
"[",
"name",
"]",
"!==",
"value",
")",
"{",
"console",
".",
"warn",
"(",
"`",
"${",
"name",
"}",
"${",
"msg"... | Helper function to warn when a user specified value is being overwritten | [
"Helper",
"function",
"to",
"warn",
"when",
"a",
"user",
"specified",
"value",
"is",
"being",
"overwritten"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/packages/bazel/src/protractor/protractor.conf.js#L24-L30 | train | Set a protractor configuration option | [
30522,
3853,
2275,
8663,
2546,
1006,
9530,
2546,
1010,
2171,
1010,
3643,
1010,
5796,
2290,
1007,
1063,
2065,
1006,
9530,
2546,
1031,
2171,
1033,
1004,
1004,
9530,
2546,
1031,
2171,
1033,
999,
1027,
1027,
3643,
1007,
1063,
10122,
1012,
115... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FindUtils.js | performReplacements | function performReplacements(results, replaceText, options) {
return Async.doInParallel_aggregateErrors(Object.keys(results), function (fullPath) {
return _doReplaceInOneFile(fullPath, results[fullPath], replaceText, options);
}).done(function () {
if (options && options.forceFil... | javascript | function performReplacements(results, replaceText, options) {
return Async.doInParallel_aggregateErrors(Object.keys(results), function (fullPath) {
return _doReplaceInOneFile(fullPath, results[fullPath], replaceText, options);
}).done(function () {
if (options && options.forceFil... | [
"function",
"performReplacements",
"(",
"results",
",",
"replaceText",
",",
"options",
")",
"{",
"return",
"Async",
".",
"doInParallel_aggregateErrors",
"(",
"Object",
".",
"keys",
"(",
"results",
")",
",",
"function",
"(",
"fullPath",
")",
"{",
"return",
"_do... | Given a set of search results, replaces them with the given replaceText, either on disk or in memory.
Checks timestamps to ensure replacements are not performed in files that have changed on disk since
the original search results were generated. However, does *not* check whether edits have been performed
in in-memory d... | [
"Given",
"a",
"set",
"of",
"search",
"results",
"replaces",
"them",
"with",
"the",
"given",
"replaceText",
"either",
"on",
"disk",
"or",
"in",
"memory",
".",
"Checks",
"timestamps",
"to",
"ensure",
"replacements",
"are",
"not",
"performed",
"in",
"files",
"t... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L239-L279 | train | Perform a set of replacements in the search results. | [
30522,
3853,
4685,
2890,
24759,
10732,
8163,
1006,
3463,
1010,
5672,
18209,
1010,
7047,
1007,
1063,
2709,
2004,
6038,
2278,
1012,
24341,
28689,
6216,
2140,
1035,
9572,
2121,
29165,
2015,
1006,
4874,
1012,
6309,
1006,
3463,
1007,
1010,
3853,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js | createFlags | function createFlags( flags ) {
var object = flagsCache[ flags ] = {},
i, length;
flags = flags.split( /\s+/ );
for ( i = 0, length = flags.length; i < length; i++ ) {
object[ flags[i] ] = true;
}
return object;
} | javascript | function createFlags( flags ) {
var object = flagsCache[ flags ] = {},
i, length;
flags = flags.split( /\s+/ );
for ( i = 0, length = flags.length; i < length; i++ ) {
object[ flags[i] ] = true;
}
return object;
} | [
"function",
"createFlags",
"(",
"flags",
")",
"{",
"var",
"object",
"=",
"flagsCache",
"[",
"flags",
"]",
"=",
"{",
"}",
",",
"i",
",",
"length",
";",
"flags",
"=",
"flags",
".",
"split",
"(",
"/",
"\\s+",
"/",
")",
";",
"for",
"(",
"i",
"=",
"... | Convert String-formatted flags into Object-formatted ones and store in cache | [
"Convert",
"String",
"-",
"formatted",
"flags",
"into",
"Object",
"-",
"formatted",
"ones",
"and",
"store",
"in",
"cache"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js#L964-L972 | train | Create flags object | [
30522,
3853,
3443,
10258,
26454,
1006,
9245,
1007,
1063,
13075,
4874,
1027,
9245,
3540,
5403,
1031,
9245,
1033,
1027,
1063,
1065,
1010,
1045,
1010,
3091,
1025,
9245,
1027,
9245,
1012,
3975,
1006,
1013,
1032,
1055,
1009,
1013,
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... |
jgraph/mxgraph | javascript/mxClient.js | function(text, fontSize, fontFamily, textWidth)
{
fontSize = (fontSize != null) ? fontSize : mxConstants.DEFAULT_FONTSIZE;
fontFamily = (fontFamily != null) ? fontFamily : mxConstants.DEFAULT_FONTFAMILY;
var div = document.createElement('div');
// Sets the font size and family
div.style.fontFamily = fontF... | javascript | function(text, fontSize, fontFamily, textWidth)
{
fontSize = (fontSize != null) ? fontSize : mxConstants.DEFAULT_FONTSIZE;
fontFamily = (fontFamily != null) ? fontFamily : mxConstants.DEFAULT_FONTFAMILY;
var div = document.createElement('div');
// Sets the font size and family
div.style.fontFamily = fontF... | [
"function",
"(",
"text",
",",
"fontSize",
",",
"fontFamily",
",",
"textWidth",
")",
"{",
"fontSize",
"=",
"(",
"fontSize",
"!=",
"null",
")",
"?",
"fontSize",
":",
"mxConstants",
".",
"DEFAULT_FONTSIZE",
";",
"fontFamily",
"=",
"(",
"fontFamily",
"!=",
"nu... | Function: getSizeForString
Returns an <mxRectangle> with the size (width and height in pixels) of
the given string. The string may contain HTML markup. Newlines should be
converted to <br> before calling this method. The caller is responsible
for sanitizing the HTML markup.
Example:
(code)
var label = graph.getLabel... | [
"Function",
":",
"getSizeForString"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L5757-L5793 | train | Creates a div that will be used to display the text | [
30522,
3853,
1006,
3793,
1010,
15489,
5332,
4371,
1010,
15489,
7011,
4328,
2135,
1010,
3793,
9148,
11927,
2232,
1007,
1063,
15489,
5332,
4371,
1027,
1006,
15489,
5332,
4371,
999,
1027,
19701,
1007,
1029,
15489,
5332,
4371,
1024,
25630,
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... | |
vuejs/vuex | dist/vuex.esm.js | Module | function Module (rawModule, runtime) {
this.runtime = runtime;
// Store some children item
this._children = Object.create(null);
// Store the origin module object which passed by programmer
this._rawModule = rawModule;
var rawState = rawModule.state;
// Store the origin module's state
this.state = (typ... | javascript | function Module (rawModule, runtime) {
this.runtime = runtime;
// Store some children item
this._children = Object.create(null);
// Store the origin module object which passed by programmer
this._rawModule = rawModule;
var rawState = rawModule.state;
// Store the origin module's state
this.state = (typ... | [
"function",
"Module",
"(",
"rawModule",
",",
"runtime",
")",
"{",
"this",
".",
"runtime",
"=",
"runtime",
";",
"// Store some children item",
"this",
".",
"_children",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"// Store the origin module object which pa... | Base data struct for store's module, package with some attribute and method | [
"Base",
"data",
"struct",
"for",
"store",
"s",
"module",
"package",
"with",
"some",
"attribute",
"and",
"method"
] | d7c7f9844831f98c5c9aaca213746c4ccc5d6929 | https://github.com/vuejs/vuex/blob/d7c7f9844831f98c5c9aaca213746c4ccc5d6929/dist/vuex.esm.js#L91-L101 | train | The module object | [
30522,
3853,
11336,
1006,
6315,
5302,
8566,
2571,
1010,
2448,
7292,
1007,
1063,
2023,
1012,
2448,
7292,
1027,
2448,
7292,
1025,
1013,
1013,
3573,
2070,
2336,
8875,
2023,
1012,
1035,
2336,
1027,
4874,
1012,
3443,
1006,
19701,
1007,
1025,
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... |
facebook/flow | packages/flow-remove-types/index.js | isLastNodeRemovedFromLine | function isLastNodeRemovedFromLine(context, node) {
var tokens = context.ast.tokens;
var priorTokenIdx = findTokenIndex(tokens, startOf(node)) - 1;
var token = tokens[priorTokenIdx];
var line = node.loc.end.line;
// Find previous token that was not removed on the same line.
while (
priorTokenIdx >= 0 &... | javascript | function isLastNodeRemovedFromLine(context, node) {
var tokens = context.ast.tokens;
var priorTokenIdx = findTokenIndex(tokens, startOf(node)) - 1;
var token = tokens[priorTokenIdx];
var line = node.loc.end.line;
// Find previous token that was not removed on the same line.
while (
priorTokenIdx >= 0 &... | [
"function",
"isLastNodeRemovedFromLine",
"(",
"context",
",",
"node",
")",
"{",
"var",
"tokens",
"=",
"context",
".",
"ast",
".",
"tokens",
";",
"var",
"priorTokenIdx",
"=",
"findTokenIndex",
"(",
"tokens",
",",
"startOf",
"(",
"node",
")",
")",
"-",
"1",
... | Returns true if node is the last to be removed from a line. | [
"Returns",
"true",
"if",
"node",
"is",
"the",
"last",
"to",
"be",
"removed",
"from",
"a",
"line",
"."
] | 25bc6aba258658eaf21ccc4722ef7124724a1d2b | https://github.com/facebook/flow/blob/25bc6aba258658eaf21ccc4722ef7124724a1d2b/packages/flow-remove-types/index.js#L409-L427 | train | Checks if the node is the last node removed from the line. | [
30522,
3853,
25340,
3367,
3630,
4063,
6633,
21818,
20952,
21716,
4179,
1006,
6123,
1010,
13045,
1007,
1063,
13075,
19204,
2015,
1027,
6123,
1012,
2004,
2102,
1012,
19204,
2015,
1025,
13075,
3188,
18715,
18595,
2094,
2595,
1027,
2424,
18715,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/LiveDevelopment.js | _classForDocument | function _classForDocument(doc) {
switch (doc.getLanguage().getId()) {
case "less":
case "scss":
return CSSPreprocessorDocument;
case "css":
return CSSDocument;
case "javascript":
return exports.config.experimental ? JSDocument : null;
... | javascript | function _classForDocument(doc) {
switch (doc.getLanguage().getId()) {
case "less":
case "scss":
return CSSPreprocessorDocument;
case "css":
return CSSDocument;
case "javascript":
return exports.config.experimental ? JSDocument : null;
... | [
"function",
"_classForDocument",
"(",
"doc",
")",
"{",
"switch",
"(",
"doc",
".",
"getLanguage",
"(",
")",
".",
"getId",
"(",
")",
")",
"{",
"case",
"\"less\"",
":",
"case",
"\"scss\"",
":",
"return",
"CSSPreprocessorDocument",
";",
"case",
"\"css\"",
":",... | Determine which document class should be used for a given document
@param {Document} document | [
"Determine",
"which",
"document",
"class",
"should",
"be",
"used",
"for",
"a",
"given",
"document"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevelopment.js#L224-L240 | train | Returns the class for a given document | [
30522,
3853,
1035,
2465,
3877,
10085,
27417,
2102,
1006,
9986,
1007,
1063,
6942,
1006,
9986,
1012,
2131,
25023,
6692,
3351,
1006,
1007,
1012,
2131,
3593,
1006,
1007,
1007,
1063,
2553,
1000,
2625,
1000,
1024,
2553,
1000,
8040,
4757,
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... |
SeleniumHQ/selenium | javascript/node/selenium-webdriver/io/zip.js | load | function load(path) {
return io.read(path).then(data => {
let zip = new Zip;
return zip.z_.loadAsync(data).then(() => zip);
});
} | javascript | function load(path) {
return io.read(path).then(data => {
let zip = new Zip;
return zip.z_.loadAsync(data).then(() => zip);
});
} | [
"function",
"load",
"(",
"path",
")",
"{",
"return",
"io",
".",
"read",
"(",
"path",
")",
".",
"then",
"(",
"data",
"=>",
"{",
"let",
"zip",
"=",
"new",
"Zip",
";",
"return",
"zip",
".",
"z_",
".",
"loadAsync",
"(",
"data",
")",
".",
"then",
"(... | Asynchronously opens a zip archive.
@param {string} path to the zip archive to load.
@return {!Promise<!Zip>} a promise that will resolve with the opened
archive. | [
"Asynchronously",
"opens",
"a",
"zip",
"archive",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/io/zip.js#L154-L159 | train | Load a centric coding specification file | [
30522,
3853,
7170,
1006,
4130,
1007,
1063,
2709,
22834,
1012,
3191,
1006,
4130,
1007,
1012,
2059,
1006,
2951,
1027,
1028,
1063,
2292,
14101,
1027,
2047,
14101,
1025,
2709,
14101,
1012,
1062,
1035,
1012,
7170,
3022,
6038,
2278,
1006,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/blanket.js | parseStatement | function parseStatement() {
var type = lookahead.type,
expr,
labeledBody,
key,
startToken;
if (type === Token.EOF) {
throwUnexpected(lookahead);
}
if (type === Token.Punctuator && lookahead.value === '{') {
return ... | javascript | function parseStatement() {
var type = lookahead.type,
expr,
labeledBody,
key,
startToken;
if (type === Token.EOF) {
throwUnexpected(lookahead);
}
if (type === Token.Punctuator && lookahead.value === '{') {
return ... | [
"function",
"parseStatement",
"(",
")",
"{",
"var",
"type",
"=",
"lookahead",
".",
"type",
",",
"expr",
",",
"labeledBody",
",",
"key",
",",
"startToken",
";",
"if",
"(",
"type",
"===",
"Token",
".",
"EOF",
")",
"{",
"throwUnexpected",
"(",
"lookahead",
... | 12 Statements | [
"12",
"Statements"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L3189-L3272 | train | ECMA - 262 12. 2 Statement | [
30522,
3853,
11968,
8583,
12259,
30524,
1007,
1025,
1065,
2065,
1006,
2828,
1027,
1027,
1027,
19204,
1012,
26136,
6593,
6692,
4263,
1004,
1004,
2298,
4430,
13775,
1012,
3643,
1027,
1027,
1027,
1005,
1063,
1005,
1007,
1063,
2709,
11968,
3366... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/serializer/ViewSerializer.js | function (oEvent) {
// both xml and html view write this ui5 internal property for the serializer
if (oEvent.fFunction && oEvent.fFunction._sapui_handlerName) {
var sHandlerName = oEvent.fFunction._sapui_handlerName;
// double check that the function is on the controller
var oController = oView.getC... | javascript | function (oEvent) {
// both xml and html view write this ui5 internal property for the serializer
if (oEvent.fFunction && oEvent.fFunction._sapui_handlerName) {
var sHandlerName = oEvent.fFunction._sapui_handlerName;
// double check that the function is on the controller
var oController = oView.getC... | [
"function",
"(",
"oEvent",
")",
"{",
"// both xml and html view write this ui5 internal property for the serializer",
"if",
"(",
"oEvent",
".",
"fFunction",
"&&",
"oEvent",
".",
"fFunction",
".",
"_sapui_handlerName",
")",
"{",
"var",
"sHandlerName",
"=",
"oEvent",
".",... | a function to find the event handler name for an event | [
"a",
"function",
"to",
"find",
"the",
"event",
"handler",
"name",
"for",
"an",
"event"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/serializer/ViewSerializer.js#L142-L162 | train | Returns the name of the handler that the event is on. | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
1013,
1013,
2119,
20950,
1998,
16129,
3193,
4339,
2023,
21318,
2629,
4722,
3200,
2005,
1996,
7642,
17629,
30524,
1012,
21461,
4609,
7542,
1012,
1035,
20066,
10179,
1035,
28213,
18442,
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... | |
openlayers/openlayers | examples/wms-custom-proj.js | WGStoCHx | function WGStoCHx(lat, lng) {
// Converts degrees dec to sex
lat = DECtoSEX(lat);
lng = DECtoSEX(lng);
// Converts degrees to seconds (sex)
lat = DEGtoSEC(lat);
lng = DEGtoSEC(lng);
// Axiliary values (% Bern)
const lat_aux = (lat - 169028.66) / 10000;
const lng_aux = (lng - 26782.5) / 10000;
//... | javascript | function WGStoCHx(lat, lng) {
// Converts degrees dec to sex
lat = DECtoSEX(lat);
lng = DECtoSEX(lng);
// Converts degrees to seconds (sex)
lat = DEGtoSEC(lat);
lng = DEGtoSEC(lng);
// Axiliary values (% Bern)
const lat_aux = (lat - 169028.66) / 10000;
const lng_aux = (lng - 26782.5) / 10000;
//... | [
"function",
"WGStoCHx",
"(",
"lat",
",",
"lng",
")",
"{",
"// Converts degrees dec to sex",
"lat",
"=",
"DECtoSEX",
"(",
"lat",
")",
";",
"lng",
"=",
"DECtoSEX",
"(",
"lng",
")",
";",
"// Converts degrees to seconds (sex)",
"lat",
"=",
"DEGtoSEC",
"(",
"lat",
... | Convert WGS lat/long (° dec) to CH x | [
"Convert",
"WGS",
"lat",
"/",
"long",
"(",
"°",
"dec",
")",
"to",
"CH",
"x"
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/wms-custom-proj.js#L119-L143 | train | Calculate the WGStoCHx | [
30522,
3853,
1059,
5620,
3406,
2818,
2595,
1006,
2474,
2102,
1010,
1048,
3070,
1007,
1063,
1013,
1013,
19884,
5445,
11703,
2000,
3348,
2474,
2102,
1027,
11703,
22282,
2595,
1006,
2474,
2102,
1007,
1025,
1048,
3070,
1027,
11703,
22282,
2595,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
exceljs/exceljs | lib/xlsx/xlsx.js | function(filename, options) {
var self = this;
var stream;
return utils.fs.exists(filename)
.then(function(exists) {
if (!exists) {
throw new Error('File not found: ' + filename);
}
stream = fs.createReadStream(filename);
return self.read(stream, options)
... | javascript | function(filename, options) {
var self = this;
var stream;
return utils.fs.exists(filename)
.then(function(exists) {
if (!exists) {
throw new Error('File not found: ' + filename);
}
stream = fs.createReadStream(filename);
return self.read(stream, options)
... | [
"function",
"(",
"filename",
",",
"options",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"stream",
";",
"return",
"utils",
".",
"fs",
".",
"exists",
"(",
"filename",
")",
".",
"then",
"(",
"function",
"(",
"exists",
")",
"{",
"if",
"(",
"!",
... | =============================================================================== Workbook ========================================================================= Read | [
"===============================================================================",
"Workbook",
"=========================================================================",
"Read"
] | c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2 | https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/xlsx/xlsx.js#L48-L67 | train | Reads a file | [
30522,
3853,
1006,
5371,
18442,
1010,
7047,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
5460,
1025,
2709,
21183,
12146,
1012,
1042,
2015,
1012,
6526,
1006,
5371,
18442,
1007,
1012,
2059,
1006,
3853,
1006,
6526,
1007,
1063,
2065,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/cache/CacheManager.js | function (sMethodName, aArgs) {
var pCallInstance, sMsrCallInstance = "[sync ] _callInstanceMethod";
Measurement.start(sMsrCallInstance, "CM", S_MSR_CAT_CACHE_MANAGER);
if (this._instance) {
Log.debug("Cache Manager: calling instance...");
return this._instance[sMethodName].apply(this._instance, ... | javascript | function (sMethodName, aArgs) {
var pCallInstance, sMsrCallInstance = "[sync ] _callInstanceMethod";
Measurement.start(sMsrCallInstance, "CM", S_MSR_CAT_CACHE_MANAGER);
if (this._instance) {
Log.debug("Cache Manager: calling instance...");
return this._instance[sMethodName].apply(this._instance, ... | [
"function",
"(",
"sMethodName",
",",
"aArgs",
")",
"{",
"var",
"pCallInstance",
",",
"sMsrCallInstance",
"=",
"\"[sync ] _callInstanceMethod\"",
";",
"Measurement",
".",
"start",
"(",
"sMsrCallInstance",
",",
"\"CM\"",
",",
"S_MSR_CAT_CACHE_MANAGER",
")",
";",
"if",... | Forwards method's call to the underlying implementation
@param {string} sMethodName the name of the method to forward
@param {any[]} aArgs array of arguments
@returns {Promise}
@private | [
"Forwards",
"method",
"s",
"call",
"to",
"the",
"underlying",
"implementation"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/cache/CacheManager.js#L278-L294 | train | Calls the method s method with the given arguments | [
30522,
3853,
1006,
15488,
11031,
7716,
18442,
1010,
9779,
10623,
2015,
1007,
1063,
13075,
7473,
8095,
7076,
26897,
1010,
22434,
18992,
26655,
26897,
1027,
1000,
1031,
26351,
1033,
1035,
2655,
7076,
26897,
11368,
6806,
2094,
1000,
1025,
10903,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/fields/ArrayField.js | DefaultArrayItem | function DefaultArrayItem(props) {
const btnStyle = {
flex: 1,
paddingLeft: 6,
paddingRight: 6,
fontWeight: "bold",
};
return (
<div key={props.index} className={props.className}>
<div className={props.hasToolbar ? "col-xs-9" : "col-xs-12"}>
{props.children}
</div>
{... | javascript | function DefaultArrayItem(props) {
const btnStyle = {
flex: 1,
paddingLeft: 6,
paddingRight: 6,
fontWeight: "bold",
};
return (
<div key={props.index} className={props.className}>
<div className={props.hasToolbar ? "col-xs-9" : "col-xs-12"}>
{props.children}
</div>
{... | [
"function",
"DefaultArrayItem",
"(",
"props",
")",
"{",
"const",
"btnStyle",
"=",
"{",
"flex",
":",
"1",
",",
"paddingLeft",
":",
"6",
",",
"paddingRight",
":",
"6",
",",
"fontWeight",
":",
"\"bold\"",
",",
"}",
";",
"return",
"(",
"<",
"div",
"key",
... | Used in the two templates | [
"Used",
"in",
"the",
"two",
"templates"
] | 1ee343d4654a6d98ac08ece97330ce2a3f9f1de3 | https://github.com/mozilla-services/react-jsonschema-form/blob/1ee343d4654a6d98ac08ece97330ce2a3f9f1de3/src/components/fields/ArrayField.js#L39-L100 | train | Default array item | [
30522,
3853,
12398,
2906,
9447,
4221,
2213,
1006,
24387,
1007,
1063,
9530,
3367,
18411,
23808,
12844,
1027,
1063,
23951,
1024,
1015,
1010,
11687,
4667,
2571,
6199,
1024,
1020,
1010,
11687,
4667,
15950,
1024,
1020,
1010,
15489,
11179,
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... |
SheetJS/js-xlsx | bits/69_chartxml.js | parse_chart | function parse_chart(data/*:?string*/, name/*:string*/, opts, rels, wb, csheet) {
var cs/*:Worksheet*/ = ((csheet || {"!type":"chart"})/*:any*/);
if(!data) return csheet;
/* 21.2.2.27 chart CT_Chart */
var C = 0, R = 0, col = "A";
var refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };
/* 21.2.2.120 numCach... | javascript | function parse_chart(data/*:?string*/, name/*:string*/, opts, rels, wb, csheet) {
var cs/*:Worksheet*/ = ((csheet || {"!type":"chart"})/*:any*/);
if(!data) return csheet;
/* 21.2.2.27 chart CT_Chart */
var C = 0, R = 0, col = "A";
var refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };
/* 21.2.2.120 numCach... | [
"function",
"parse_chart",
"(",
"data",
"/*:?string*/",
",",
"name",
"/*:string*/",
",",
"opts",
",",
"rels",
",",
"wb",
",",
"csheet",
")",
"{",
"var",
"cs",
"/*:Worksheet*/",
"=",
"(",
"(",
"csheet",
"||",
"{",
"\"!type\"",
":",
"\"chart\"",
"}",
")",
... | /* 21.2 DrawingML - Charts | [
"/",
"*",
"21",
".",
"2",
"DrawingML",
"-",
"Charts"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/69_chartxml.js#L18-L41 | train | Parse chart data | [
30522,
3853,
11968,
3366,
1035,
3673,
1006,
2951,
1013,
1008,
1024,
1029,
5164,
1008,
1013,
1010,
2171,
1013,
1008,
1024,
5164,
1008,
1013,
1010,
23569,
2015,
1010,
2128,
4877,
1010,
25610,
1010,
20116,
21030,
2102,
1007,
1063,
13075,
20116... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | isInReturnStatement | function isInReturnStatement(node) {
for (let currentNode = node; currentNode; currentNode = currentNode.parent) {
if (
currentNode.type === "ReturnStatement" ||
(currentNode.type === "ArrowFunctionExpression" && currentNode.body.type !== "BlockStateme... | javascript | function isInReturnStatement(node) {
for (let currentNode = node; currentNode; currentNode = currentNode.parent) {
if (
currentNode.type === "ReturnStatement" ||
(currentNode.type === "ArrowFunctionExpression" && currentNode.body.type !== "BlockStateme... | [
"function",
"isInReturnStatement",
"(",
"node",
")",
"{",
"for",
"(",
"let",
"currentNode",
"=",
"node",
";",
"currentNode",
";",
"currentNode",
"=",
"currentNode",
".",
"parent",
")",
"{",
"if",
"(",
"currentNode",
".",
"type",
"===",
"\"ReturnStatement\"",
... | Determines if a node is in a return statement
@param {ASTNode} node - The node to be checked.
@returns {boolean} True if the node is in a return statement.
@private | [
"Determines",
"if",
"a",
"node",
"is",
"in",
"a",
"return",
"statement"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-extra-parens.js#L171-L182 | train | isInReturnStatement - check if node is in return statement | [
30522,
3853,
2003,
2378,
13465,
14287,
9153,
18532,
4765,
1006,
13045,
1007,
1063,
2005,
1006,
2292,
2783,
3630,
3207,
1027,
13045,
1025,
2783,
3630,
3207,
1025,
2783,
3630,
3207,
1027,
2783,
3630,
3207,
1012,
6687,
1007,
1063,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Core.js | preloadLibraryAsync | function preloadLibraryAsync(libConfig) {
var that = this;
libConfig = evalLibConfig(libConfig);
var lib = libConfig.name,
fileType = libConfig.fileType,
libPackage = lib.replace(/\./g, '/'),
http2 = this.oConfiguration.getDepCache();
if ( fileType === 'none' || !!sap.ui.loader._.getModuleState(lib... | javascript | function preloadLibraryAsync(libConfig) {
var that = this;
libConfig = evalLibConfig(libConfig);
var lib = libConfig.name,
fileType = libConfig.fileType,
libPackage = lib.replace(/\./g, '/'),
http2 = this.oConfiguration.getDepCache();
if ( fileType === 'none' || !!sap.ui.loader._.getModuleState(lib... | [
"function",
"preloadLibraryAsync",
"(",
"libConfig",
")",
"{",
"var",
"that",
"=",
"this",
";",
"libConfig",
"=",
"evalLibConfig",
"(",
"libConfig",
")",
";",
"var",
"lib",
"=",
"libConfig",
".",
"name",
",",
"fileType",
"=",
"libConfig",
".",
"fileType",
... | Preloads a library asynchronously.
@param {string|object} libConfig Name of the library to preload or settings object describing library
@param {string} [libConfig.name] Name of the library to preload
@param {boolean|undefined} [libConfig.json] Whether library supports only JSON (<code>true</code>) or only JS (<code>f... | [
"Preloads",
"a",
"library",
"asynchronously",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Core.js#L1599-L1669 | train | Load a library asynchronously | [
30522,
3853,
3653,
11066,
29521,
19848,
16303,
6038,
2278,
1006,
5622,
9818,
2239,
8873,
2290,
1007,
1063,
13075,
2008,
1027,
2023,
1025,
5622,
9818,
2239,
8873,
2290,
1027,
9345,
6894,
9818,
2239,
8873,
2290,
1006,
5622,
9818,
2239,
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... |
chriso/validator.js | lib/isCreditCard.js | isCreditCard | function isCreditCard(str) {
(0, _assertString.default)(str);
var sanitized = str.replace(/[- ]+/g, '');
if (!creditCard.test(sanitized)) {
return false;
}
var sum = 0;
var digit;
var tmpNum;
var shouldDouble;
for (var i = sanitized.length - 1; i >= 0; i--) {
digit = sanitized.substring(i, ... | javascript | function isCreditCard(str) {
(0, _assertString.default)(str);
var sanitized = str.replace(/[- ]+/g, '');
if (!creditCard.test(sanitized)) {
return false;
}
var sum = 0;
var digit;
var tmpNum;
var shouldDouble;
for (var i = sanitized.length - 1; i >= 0; i--) {
digit = sanitized.substring(i, ... | [
"function",
"isCreditCard",
"(",
"str",
")",
"{",
"(",
"0",
",",
"_assertString",
".",
"default",
")",
"(",
"str",
")",
";",
"var",
"sanitized",
"=",
"str",
".",
"replace",
"(",
"/",
"[- ]+",
"/",
"g",
",",
"''",
")",
";",
"if",
"(",
"!",
"credit... | /* eslint-enable max-len | [
"/",
"*",
"eslint",
"-",
"enable",
"max",
"-",
"len"
] | 63e4c78f07d08543af4be7b6c2c9cf24df009003 | https://github.com/chriso/validator.js/blob/63e4c78f07d08543af4be7b6c2c9cf24df009003/lib/isCreditCard.js#L16-L49 | train | Check if a string is a credit card | [
30522,
3853,
2003,
16748,
23194,
11522,
1006,
2358,
2099,
30524,
1005,
1005,
1007,
1025,
2065,
1006,
999,
4923,
11522,
1012,
3231,
1006,
2624,
25090,
5422,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
13075,
7680,
1027,
1014,
1025,
13075,
1534... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/LocaleData.js | function(sCurrencySymbol) {
var oCurrencySymbols = this._get("currencySymbols"), sCurrencyCode;
for (sCurrencyCode in oCurrencySymbols) {
if (oCurrencySymbols[sCurrencyCode] === sCurrencySymbol) {
return sCurrencyCode;
}
}
return sCurrencySymbol;
} | javascript | function(sCurrencySymbol) {
var oCurrencySymbols = this._get("currencySymbols"), sCurrencyCode;
for (sCurrencyCode in oCurrencySymbols) {
if (oCurrencySymbols[sCurrencyCode] === sCurrencySymbol) {
return sCurrencyCode;
}
}
return sCurrencySymbol;
} | [
"function",
"(",
"sCurrencySymbol",
")",
"{",
"var",
"oCurrencySymbols",
"=",
"this",
".",
"_get",
"(",
"\"currencySymbols\"",
")",
",",
"sCurrencyCode",
";",
"for",
"(",
"sCurrencyCode",
"in",
"oCurrencySymbols",
")",
"{",
"if",
"(",
"oCurrencySymbols",
"[",
... | Returns the currency code which is corresponded with the given currency symbol.
@param {string} sCurrencySymbol The currency symbol which needs to be converted to currency code
@return {string} The corresponded currency code defined for the given currency symbol. The given currency symbol is returned if no currency co... | [
"Returns",
"the",
"currency",
"code",
"which",
"is",
"corresponded",
"with",
"the",
"given",
"currency",
"symbol",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L1007-L1015 | train | Returns the currency symbol for the given currency symbol. | [
30522,
3853,
1006,
8040,
3126,
7389,
5666,
6508,
13344,
2140,
1007,
1063,
13075,
1051,
10841,
14343,
9407,
6508,
13344,
4877,
1027,
2023,
1012,
1035,
2131,
1006,
1000,
9598,
6508,
13344,
4877,
1000,
1007,
1010,
8040,
3126,
7389,
5666,
16044... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aframevr/aframe | src/components/light.js | function (data) {
var angle = data.angle;
var color = new THREE.Color(data.color);
this.rendererSystem.applyColorCorrection(color);
color = color.getHex();
var decay = data.decay;
var distance = data.distance;
var groundColor = new THREE.Color(data.groundColor);
this.rendererSystem.apply... | javascript | function (data) {
var angle = data.angle;
var color = new THREE.Color(data.color);
this.rendererSystem.applyColorCorrection(color);
color = color.getHex();
var decay = data.decay;
var distance = data.distance;
var groundColor = new THREE.Color(data.groundColor);
this.rendererSystem.apply... | [
"function",
"(",
"data",
")",
"{",
"var",
"angle",
"=",
"data",
".",
"angle",
";",
"var",
"color",
"=",
"new",
"THREE",
".",
"Color",
"(",
"data",
".",
"color",
")",
";",
"this",
".",
"rendererSystem",
".",
"applyColorCorrection",
"(",
"color",
")",
... | Creates a new three.js light object given data object defining the light.
@param {object} data | [
"Creates",
"a",
"new",
"three",
".",
"js",
"light",
"object",
"given",
"data",
"object",
"defining",
"the",
"light",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/light.js#L212-L271 | train | Creates a new light object | [
30522,
3853,
1006,
2951,
1007,
1063,
13075,
6466,
1027,
2951,
1012,
6466,
1025,
13075,
3609,
1027,
2047,
2093,
1012,
3609,
1006,
2951,
1012,
3609,
1007,
1025,
2023,
1012,
17552,
2545,
27268,
6633,
1012,
6611,
18717,
27108,
2890,
7542,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | lib/jsdoc/ui5/template/publish.js | createAPIJS | function createAPIJS(symbols, filename) {
var output = [];
var rkeywords = /^(?:abstract|as|boolean|break|byte|case|catch|char|class|continue|const|debugger|default|delete|do|double|else|enum|export|extends|false|final|finally|float|for|function|goto|if|implements|import|in|instanceof|int|interface|is|long|namespac... | javascript | function createAPIJS(symbols, filename) {
var output = [];
var rkeywords = /^(?:abstract|as|boolean|break|byte|case|catch|char|class|continue|const|debugger|default|delete|do|double|else|enum|export|extends|false|final|finally|float|for|function|goto|if|implements|import|in|instanceof|int|interface|is|long|namespac... | [
"function",
"createAPIJS",
"(",
"symbols",
",",
"filename",
")",
"{",
"var",
"output",
"=",
"[",
"]",
";",
"var",
"rkeywords",
"=",
"/",
"^(?:abstract|as|boolean|break|byte|case|catch|char|class|continue|const|debugger|default|delete|do|double|else|enum|export|extends|false|final... | ---- add on: API JS ----------------------------------------------------------------- | [
"----",
"add",
"on",
":",
"API",
"JS",
"-----------------------------------------------------------------"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/ui5/template/publish.js#L3877-L4090 | train | Create API JS | [
30522,
3853,
3443,
9331,
28418,
2015,
1006,
9255,
1010,
5371,
18442,
1007,
1063,
13075,
6434,
1027,
1031,
1033,
1025,
13075,
1054,
14839,
30524,
1064,
22017,
20898,
1064,
3338,
1064,
24880,
1064,
2553,
1064,
4608,
1064,
25869,
1064,
2465,
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.m/src/sap/m/IconTabBarDragAndDropUtil.js | function (iBeginDragIndex, iControlCount) {
if (iBeginDragIndex === iControlCount - 1) {
sInsertAfterBeforePosition = INSERT_BEFORE;
return iBeginDragIndex;
}
sInsertAfterBeforePosition = INSERT_AFTER;
return iBeginDragIndex + 1;
} | javascript | function (iBeginDragIndex, iControlCount) {
if (iBeginDragIndex === iControlCount - 1) {
sInsertAfterBeforePosition = INSERT_BEFORE;
return iBeginDragIndex;
}
sInsertAfterBeforePosition = INSERT_AFTER;
return iBeginDragIndex + 1;
} | [
"function",
"(",
"iBeginDragIndex",
",",
"iControlCount",
")",
"{",
"if",
"(",
"iBeginDragIndex",
"===",
"iControlCount",
"-",
"1",
")",
"{",
"sInsertAfterBeforePosition",
"=",
"INSERT_BEFORE",
";",
"return",
"iBeginDragIndex",
";",
"}",
"sInsertAfterBeforePosition",
... | Increases the drop index.
@param {number} iBeginDragIndex Index of dragged control
@param {number} iControlCount Number of controls
@private | [
"Increases",
"the",
"drop",
"index",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/IconTabBarDragAndDropUtil.js#L127-L134 | train | Returns the index of the drag element after the drag element | [
30522,
3853,
1006,
21307,
13910,
22254,
29181,
22254,
10288,
1010,
12696,
13181,
22499,
16671,
1007,
1063,
2065,
1006,
21307,
13910,
22254,
29181,
22254,
10288,
1027,
1027,
1027,
12696,
13181,
22499,
16671,
1011,
1015,
1007,
1063,
15516,
8743,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/model/Global.js | function (condition) {
var mainType = condition.mainType;
if (!mainType) {
return [];
}
var index = condition.index;
var id = condition.id;
var name = condition.name;
var cpts = this._componentsMap.get(mainType);
if (!cpts || !cpts.length) {... | javascript | function (condition) {
var mainType = condition.mainType;
if (!mainType) {
return [];
}
var index = condition.index;
var id = condition.id;
var name = condition.name;
var cpts = this._componentsMap.get(mainType);
if (!cpts || !cpts.length) {... | [
"function",
"(",
"condition",
")",
"{",
"var",
"mainType",
"=",
"condition",
".",
"mainType",
";",
"if",
"(",
"!",
"mainType",
")",
"{",
"return",
"[",
"]",
";",
"}",
"var",
"index",
"=",
"condition",
".",
"index",
";",
"var",
"id",
"=",
"condition",... | If none of index and id and name used, return all components with mainType.
@param {Object} condition
@param {string} condition.mainType
@param {string} [condition.subType] If ignore, only query by mainType
@param {number|Array.<number>} [condition.index] Either input index or id or name.
@param {string|Array.<string>}... | [
"If",
"none",
"of",
"index",
"and",
"id",
"and",
"name",
"used",
"return",
"all",
"components",
"with",
"mainType",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/model/Global.js#L314-L362 | train | Returns a list of all the pages that match the condition | [
30522,
3853,
1006,
4650,
1007,
1063,
13075,
2364,
13874,
1027,
4650,
1012,
2364,
13874,
1025,
2065,
1006,
999,
2364,
13874,
1007,
1063,
2709,
1031,
1033,
1025,
1065,
13075,
5950,
1027,
4650,
1012,
5950,
1025,
13075,
8909,
1027,
4650,
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.support/src/sap/ui/support/supportRules/IssueManager.js | function (oIssues) {
var viewModel = [];
for (var i = 0; i < oIssues.length; i++) {
viewModel.push(_convertIssueToViewModel(oIssues[i]));
}
return viewModel;
} | javascript | function (oIssues) {
var viewModel = [];
for (var i = 0; i < oIssues.length; i++) {
viewModel.push(_convertIssueToViewModel(oIssues[i]));
}
return viewModel;
} | [
"function",
"(",
"oIssues",
")",
"{",
"var",
"viewModel",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"oIssues",
".",
"length",
";",
"i",
"++",
")",
"{",
"viewModel",
".",
"push",
"(",
"_convertIssueToViewModel",
"(",
"oIss... | Converts issues to view model format.
@public
@method
@name sap.ui.support.IssueManager.convertToViewModel
@param {array} oIssues The issues to convert
@returns {array} viewModel Issues in ViewModel format | [
"Converts",
"issues",
"to",
"view",
"model",
"format",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/IssueManager.js#L398-L404 | train | Converts an array of issues to a view model | [
30522,
3853,
1006,
1051,
14643,
15808,
1007,
1063,
13075,
3193,
5302,
9247,
1027,
1031,
1033,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
1051,
14643,
15808,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
3193,
5302,
9247,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
markdown-it/markdown-it | lib/token.js | Token | function Token(type, tag, nesting) {
/**
* Token#type -> String
*
* Type of the token (string, e.g. "paragraph_open")
**/
this.type = type;
/**
* Token#tag -> String
*
* html tag name, e.g. "p"
**/
this.tag = tag;
/**
* Token#attrs -> Array
*
* Html attributes. Form... | javascript | function Token(type, tag, nesting) {
/**
* Token#type -> String
*
* Type of the token (string, e.g. "paragraph_open")
**/
this.type = type;
/**
* Token#tag -> String
*
* html tag name, e.g. "p"
**/
this.tag = tag;
/**
* Token#attrs -> Array
*
* Html attributes. Form... | [
"function",
"Token",
"(",
"type",
",",
"tag",
",",
"nesting",
")",
"{",
"/**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/",
"this",
".",
"type",
"=",
"type",
";",
"/**\n * Token#tag -> String\n *\n * html tag name, e.g. \"... | class Token
new Token(type, tag, nesting)
Create new token and fill passed properties. | [
"class",
"Token",
"new",
"Token",
"(",
"type",
"tag",
"nesting",
")"
] | ba6830ba13fb92953a91fb90318964ccd15b82c4 | https://github.com/markdown-it/markdown-it/blob/ba6830ba13fb92953a91fb90318964ccd15b82c4/lib/token.js#L15-L113 | train | A token object | [
30522,
3853,
19204,
1006,
2828,
1010,
6415,
1010,
21016,
1007,
1063,
1013,
1008,
1008,
1008,
19204,
1001,
2828,
1011,
1028,
5164,
1008,
1008,
2828,
1997,
1996,
19204,
1006,
5164,
1010,
1041,
1012,
1043,
1012,
1000,
20423,
1035,
2330,
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... |
fex-team/webuploader | dist/webuploader.withoutimage.js | function( files ) {
var me = this;
if ( !files.length ) {
files = [ files ];
}
files = $.map( files, function( file ) {
return me._addFile( file );
});
me.owner.trigger(... | javascript | function( files ) {
var me = this;
if ( !files.length ) {
files = [ files ];
}
files = $.map( files, function( file ) {
return me._addFile( file );
});
me.owner.trigger(... | [
"function",
"(",
"files",
")",
"{",
"var",
"me",
"=",
"this",
";",
"if",
"(",
"!",
"files",
".",
"length",
")",
"{",
"files",
"=",
"[",
"files",
"]",
";",
"}",
"files",
"=",
"$",
".",
"map",
"(",
"files",
",",
"function",
"(",
"file",
")",
"{... | @property {Boolean} [auto=false]
@namespace options
@for Uploader
@description 设置为 true 后,不需要手动调用上传,有文件选择即开始上传。
@method addFiles
@grammar addFiles( file ) => undefined
@grammar addFiles( [file1, file2 ...] ) => undefined
@param {Array of File or File} [files] Files 对象 数组
@description 添加文件到队列
@for Uploader | [
"@property",
"{",
"Boolean",
"}",
"[",
"auto",
"=",
"false",
"]",
"@namespace",
"options",
"@for",
"Uploader",
"@description",
"设置为",
"true",
"后,不需要手动调用上传,有文件选择即开始上传。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/dist/webuploader.withoutimage.js#L2541-L2559 | train | upload files to the server | [
30522,
3853,
1006,
6764,
1007,
1063,
13075,
2033,
1027,
2023,
1025,
2065,
1006,
999,
6764,
1012,
3091,
1007,
1063,
6764,
1027,
1031,
6764,
1033,
1025,
1065,
6764,
1027,
1002,
1012,
4949,
1006,
6764,
1010,
3853,
1006,
5371,
1007,
1063,
270... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-ex-assign.js | checkVariable | function checkVariable(variable) {
astUtils.getModifyingReferences(variable.references).forEach(reference => {
context.report({ node: reference.identifier, messageId: "unexpected" });
});
} | javascript | function checkVariable(variable) {
astUtils.getModifyingReferences(variable.references).forEach(reference => {
context.report({ node: reference.identifier, messageId: "unexpected" });
});
} | [
"function",
"checkVariable",
"(",
"variable",
")",
"{",
"astUtils",
".",
"getModifyingReferences",
"(",
"variable",
".",
"references",
")",
".",
"forEach",
"(",
"reference",
"=>",
"{",
"context",
".",
"report",
"(",
"{",
"node",
":",
"reference",
".",
"ident... | Finds and reports references that are non initializer and writable.
@param {Variable} variable - A variable to check.
@returns {void} | [
"Finds",
"and",
"reports",
"references",
"that",
"are",
"non",
"initializer",
"and",
"writable",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-ex-assign.js#L39-L43 | train | Check variable references | [
30522,
3853,
4638,
10755,
19210,
1006,
8023,
1007,
1063,
2004,
8525,
3775,
4877,
1012,
2131,
5302,
4305,
14116,
2890,
25523,
2015,
1006,
8023,
1012,
7604,
1007,
1012,
18921,
6776,
1006,
4431,
1027,
1028,
1063,
6123,
1012,
3189,
1006,
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... |
SAP/openui5 | src/sap.ui.unified/src/sap/ui/unified/CalendarRow.js | _positionAppointments | function _positionAppointments() {
if (this._isOneMonthIntervalOnSmallSizes()) {
return;
}
var $Apps = this.$("Apps");
var iRowWidth = $Apps.innerWidth();
if (iRowWidth <= 0) {
// if no size (invisible) do nothing
return;
}
var $DummyApp = this.$("DummyApp");
var iHeight = $DummyApp.outerHe... | javascript | function _positionAppointments() {
if (this._isOneMonthIntervalOnSmallSizes()) {
return;
}
var $Apps = this.$("Apps");
var iRowWidth = $Apps.innerWidth();
if (iRowWidth <= 0) {
// if no size (invisible) do nothing
return;
}
var $DummyApp = this.$("DummyApp");
var iHeight = $DummyApp.outerHe... | [
"function",
"_positionAppointments",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_isOneMonthIntervalOnSmallSizes",
"(",
")",
")",
"{",
"return",
";",
"}",
"var",
"$Apps",
"=",
"this",
".",
"$",
"(",
"\"Apps\"",
")",
";",
"var",
"iRowWidth",
"=",
"$Apps",
"."... | as the top position of the appointments depends on the rendered height it must be calculated after rendering | [
"as",
"the",
"top",
"position",
"of",
"the",
"appointments",
"depends",
"on",
"the",
"rendered",
"height",
"it",
"must",
"be",
"calculated",
"after",
"rendering"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.unified/src/sap/ui/unified/CalendarRow.js#L1482-L1617 | train | Position the app points in the app | [
30522,
3853,
1035,
2597,
29098,
25785,
8163,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
11163,
25832,
12162,
10606,
3334,
10175,
5644,
9067,
4877,
10057,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
13075,
1002,
18726,
1027,
2023,
1012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/FileTreeViewModel.js | _createNotFullyLoadedDirectory | function _createNotFullyLoadedDirectory(directory) {
if (!directory) {
return Immutable.Map({
notFullyLoaded: true,
children: Immutable.Map()
});
}
return directory.merge({
notFullyLoaded: true,
children: Immutable.M... | javascript | function _createNotFullyLoadedDirectory(directory) {
if (!directory) {
return Immutable.Map({
notFullyLoaded: true,
children: Immutable.Map()
});
}
return directory.merge({
notFullyLoaded: true,
children: Immutable.M... | [
"function",
"_createNotFullyLoadedDirectory",
"(",
"directory",
")",
"{",
"if",
"(",
"!",
"directory",
")",
"{",
"return",
"Immutable",
".",
"Map",
"(",
"{",
"notFullyLoaded",
":",
"true",
",",
"children",
":",
"Immutable",
".",
"Map",
"(",
")",
"}",
")",
... | @private
Creates a directory object (or updates an existing directory object) to look like one
that has not yet been loaded, but in which we want to start displaying entries.
@param {Immutable.Map=} directory Directory entry to update
@return {Immutable.Map} New or updated directory object | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeViewModel.js#L702-L713 | train | Create not fully loaded directory | [
30522,
3853,
1035,
3443,
17048,
7699,
17468,
4305,
2890,
16761,
2100,
1006,
14176,
1007,
1063,
2065,
1006,
999,
14176,
1007,
1063,
2709,
10047,
28120,
3085,
1012,
4949,
1006,
1063,
2025,
7699,
17468,
1024,
2995,
1010,
2336,
1024,
10047,
281... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js | function(fnCallback, oRootNode) {
function recurse(oParent, oCurrentNode, bIsAggregation) {
var oAggregations;
if (!bIsAggregation) {
var oMetadata = this._getControlMetadataInXml(oCurrentNode);
oAggregations = oMetadata.getAllAggregations();
}
var aChildren = this._getElementNodeChildren(o... | javascript | function(fnCallback, oRootNode) {
function recurse(oParent, oCurrentNode, bIsAggregation) {
var oAggregations;
if (!bIsAggregation) {
var oMetadata = this._getControlMetadataInXml(oCurrentNode);
oAggregations = oMetadata.getAllAggregations();
}
var aChildren = this._getElementNodeChildren(o... | [
"function",
"(",
"fnCallback",
",",
"oRootNode",
")",
"{",
"function",
"recurse",
"(",
"oParent",
",",
"oCurrentNode",
",",
"bIsAggregation",
")",
"{",
"var",
"oAggregations",
";",
"if",
"(",
"!",
"bIsAggregation",
")",
"{",
"var",
"oMetadata",
"=",
"this",
... | Recursively goes through an XML tree and calls a callback function for every control inside.
Does not call the callback function for aggregations.
@param {function} fnCallback - Function that will be called for every control with the following arguments: fnCallback(<Element>)
@param {Element} oRootNode - Root node fro... | [
"Recursively",
"goes",
"through",
"an",
"XML",
"tree",
"and",
"calls",
"a",
"callback",
"function",
"for",
"every",
"control",
"inside",
".",
"Does",
"not",
"call",
"the",
"callback",
"function",
"for",
"aggregations",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js#L321-L339 | train | Recursively traverses the control tree and calls the callback function | [
30522,
3853,
1006,
1042,
20909,
3363,
5963,
1010,
20298,
4140,
3630,
3207,
1007,
1063,
3853,
28667,
28393,
1006,
6728,
12069,
3372,
1010,
1051,
10841,
14343,
3372,
3630,
3207,
1010,
20377,
8490,
17603,
12540,
1007,
1063,
13075,
1051,
8490,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
electron/electron | lib/browser/api/auto-updater/squirrel-update-win.js | function (args, detached, callback) {
let error, errorEmitted, stderr, stdout
try {
// Ensure we don't spawn multiple squirrel processes
// Process spawned, same args: Attach events to alread running process
// Process spawned, different args: Return with error
// No process spawned: ... | javascript | function (args, detached, callback) {
let error, errorEmitted, stderr, stdout
try {
// Ensure we don't spawn multiple squirrel processes
// Process spawned, same args: Attach events to alread running process
// Process spawned, different args: Return with error
// No process spawned: ... | [
"function",
"(",
"args",
",",
"detached",
",",
"callback",
")",
"{",
"let",
"error",
",",
"errorEmitted",
",",
"stderr",
",",
"stdout",
"try",
"{",
"// Ensure we don't spawn multiple squirrel processes",
"// Process spawned, same args: Attach events to alread running p... | Spawn a command and invoke the callback when it completes with an error and the output from standard out. | [
"Spawn",
"a",
"command",
"and",
"invoke",
"the",
"callback",
"when",
"it",
"completes",
"with",
"an",
"error",
"and",
"the",
"output",
"from",
"standard",
"out",
"."
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/api/auto-updater/squirrel-update-win.js#L20-L79 | train | AutoUpdater process spawned | [
30522,
3853,
1006,
12098,
5620,
1010,
12230,
1010,
2655,
5963,
1007,
1063,
2292,
7561,
1010,
7561,
23238,
16190,
1010,
2358,
4063,
2099,
1010,
2358,
26797,
2102,
3046,
1063,
1013,
1013,
5676,
2057,
2123,
1005,
1056,
25645,
3674,
18197,
6194... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onSignUp | function onSignUp() {
var email = $('#signup-email').val();
var password = $('#signup-password').val();
auth.createUserWithEmailAndPassword(email, password)
.then(onAuthUserCredentialSuccess, onAuthError);
} | javascript | function onSignUp() {
var email = $('#signup-email').val();
var password = $('#signup-password').val();
auth.createUserWithEmailAndPassword(email, password)
.then(onAuthUserCredentialSuccess, onAuthError);
} | [
"function",
"onSignUp",
"(",
")",
"{",
"var",
"email",
"=",
"$",
"(",
"'#signup-email'",
")",
".",
"val",
"(",
")",
";",
"var",
"password",
"=",
"$",
"(",
"'#signup-password'",
")",
".",
"val",
"(",
")",
";",
"auth",
".",
"createUserWithEmailAndPassword"... | Signs up a new user with an email and a password. | [
"Signs",
"up",
"a",
"new",
"user",
"with",
"an",
"email",
"and",
"a",
"password",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L307-L312 | train | Sign up user | [
30522,
3853,
2006,
5332,
16206,
6279,
1006,
1007,
1063,
13075,
10373,
1027,
1002,
1006,
1005,
1001,
3696,
6279,
1011,
10373,
1005,
1007,
1012,
11748,
1006,
1007,
1025,
13075,
20786,
1027,
1002,
1006,
1005,
1001,
3696,
6279,
1011,
20786,
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.fl/src/sap/ui/fl/ChangePersistence.js | function(mComponent) {
this._mComponent = mComponent;
//_mChanges contains:
// - mChanges: map of changes (selector id)
// - mDependencies: map of changes (change key) that need to be applied before any change. Used to check if a change can be applied. Format:
// mDependencies: {
// "fileNameChange2USERn... | javascript | function(mComponent) {
this._mComponent = mComponent;
//_mChanges contains:
// - mChanges: map of changes (selector id)
// - mDependencies: map of changes (change key) that need to be applied before any change. Used to check if a change can be applied. Format:
// mDependencies: {
// "fileNameChange2USERn... | [
"function",
"(",
"mComponent",
")",
"{",
"this",
".",
"_mComponent",
"=",
"mComponent",
";",
"//_mChanges contains:",
"// - mChanges: map of changes (selector id)",
"// - mDependencies: map of changes (change key) that need to be applied before any change. Used to check if a change can be ... | Helper object to access a change from the back end. Access helper object for each change (and variant) which was fetched from the back end
@constructor
@author SAP SE
@version 1.37.0-SNAPSHOT
@experimental Since 1.25.0
@param {object} mComponent Component data to initiate <code>ChangePersistence</code> instance
@param... | [
"Helper",
"object",
"to",
"access",
"a",
"change",
"from",
"the",
"back",
"end",
".",
"Access",
"helper",
"object",
"for",
"each",
"change",
"(",
"and",
"variant",
")",
"which",
"was",
"fetched",
"from",
"the",
"back",
"end"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/ChangePersistence.js#L53-L100 | train | Creates a new control instance. | [
30522,
3853,
1006,
11338,
25377,
30524,
2023,
1012,
1035,
11338,
25377,
5643,
3372,
1027,
11338,
25377,
5643,
3372,
1025,
1013,
1013,
1035,
11338,
18003,
2229,
3397,
1024,
1013,
1013,
1011,
11338,
18003,
2229,
1024,
4949,
1997,
3431,
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... | |
chartjs/Chart.js | src/scales/scale.linear.js | function() {
var me = this;
var tickFont;
if (me.isHorizontal()) {
return Math.ceil(me.width / 40);
}
tickFont = helpers.options._parseFont(me.options.ticks);
return Math.ceil(me.height / tickFont.lineHeight);
} | javascript | function() {
var me = this;
var tickFont;
if (me.isHorizontal()) {
return Math.ceil(me.width / 40);
}
tickFont = helpers.options._parseFont(me.options.ticks);
return Math.ceil(me.height / tickFont.lineHeight);
} | [
"function",
"(",
")",
"{",
"var",
"me",
"=",
"this",
";",
"var",
"tickFont",
";",
"if",
"(",
"me",
".",
"isHorizontal",
"(",
")",
")",
"{",
"return",
"Math",
".",
"ceil",
"(",
"me",
".",
"width",
"/",
"40",
")",
";",
"}",
"tickFont",
"=",
"help... | Returns the maximum number of ticks based on the scale dimension | [
"Returns",
"the",
"maximum",
"number",
"of",
"ticks",
"based",
"on",
"the",
"scale",
"dimension"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/scales/scale.linear.js#L134-L143 | train | Returns the number of ticks per line | [
30522,
3853,
1006,
1007,
1063,
13075,
2033,
1027,
2023,
1025,
13075,
16356,
14876,
3372,
1025,
2065,
1006,
2033,
1012,
2003,
16368,
10993,
12162,
2389,
1006,
1007,
1007,
1063,
2709,
8785,
1012,
8292,
4014,
1006,
2033,
1012,
9381,
1013,
2871... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
sparksuite/simplemde-markdown-editor | src/js/simplemde.js | drawTable | function drawTable(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
_replaceSelection(cm, stat.table, options.insertTexts.table);
} | javascript | function drawTable(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
_replaceSelection(cm, stat.table, options.insertTexts.table);
} | [
"function",
"drawTable",
"(",
"editor",
")",
"{",
"var",
"cm",
"=",
"editor",
".",
"codemirror",
";",
"var",
"stat",
"=",
"getState",
"(",
"cm",
")",
";",
"var",
"options",
"=",
"editor",
".",
"options",
";",
"_replaceSelection",
"(",
"cm",
",",
"stat"... | Action for drawing a table. | [
"Action",
"for",
"drawing",
"a",
"table",
"."
] | 6abda7ab68cc20f4aca870eb243747951b90ab04 | https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js#L650-L655 | train | Draw the table | [
30522,
3853,
4009,
10880,
1006,
3559,
1007,
1063,
13075,
4642,
1027,
3559,
1012,
3642,
14503,
29165,
1025,
13075,
28093,
1027,
4152,
12259,
1006,
4642,
1007,
1025,
13075,
7047,
1027,
3559,
1012,
7047,
1025,
1035,
20736,
12260,
7542,
1006,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/prefer-template.js | hasNonStringLiteral | function hasNonStringLiteral(node) {
if (isConcatenation(node)) {
// `left` is deeper than `right` normally.
return hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left);
}
return !astUtils.isStringLiteral(node);
} | javascript | function hasNonStringLiteral(node) {
if (isConcatenation(node)) {
// `left` is deeper than `right` normally.
return hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left);
}
return !astUtils.isStringLiteral(node);
} | [
"function",
"hasNonStringLiteral",
"(",
"node",
")",
"{",
"if",
"(",
"isConcatenation",
"(",
"node",
")",
")",
"{",
"// `left` is deeper than `right` normally.",
"return",
"hasNonStringLiteral",
"(",
"node",
".",
"right",
")",
"||",
"hasNonStringLiteral",
"(",
"node... | Checks whether or not a given binary expression has non string literals.
@param {ASTNode} node - A node to check.
@returns {boolean} `true` if the node has non string literals. | [
"Checks",
"whether",
"or",
"not",
"a",
"given",
"binary",
"expression",
"has",
"non",
"string",
"literals",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-template.js#L99-L106 | train | Checks whether a node has a non string literal. | [
30522,
3853,
8440,
5644,
18886,
3070,
22779,
7941,
1006,
13045,
1007,
1063,
2065,
1006,
2003,
8663,
16280,
9323,
1006,
13045,
1007,
1007,
1063,
1013,
1013,
1036,
2187,
1036,
2003,
6748,
2084,
1036,
2157,
1036,
5373,
1012,
2709,
8440,
5644,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | mxImage | function mxImage(src, width, height)
{
this.src = src;
this.width = width;
this.height = height;
} | javascript | function mxImage(src, width, height)
{
this.src = src;
this.width = width;
this.height = height;
} | [
"function",
"mxImage",
"(",
"src",
",",
"width",
",",
"height",
")",
"{",
"this",
".",
"src",
"=",
"src",
";",
"this",
".",
"width",
"=",
"width",
";",
"this",
".",
"height",
"=",
"height",
";",
"}"
] | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxImage
Encapsulates the URL, width and height of an image.
Constructor: mxImage
Constructs a new image. | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxImage"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L12816-L12821 | train | This is the base class for the image objects | [
30522,
3853,
25630,
9581,
3351,
1006,
5034,
2278,
1010,
9381,
1010,
4578,
1007,
1063,
2023,
1012,
5034,
2278,
1027,
5034,
2278,
1025,
2023,
1012,
9381,
1027,
9381,
1025,
2023,
1012,
4578,
1027,
4578,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/prefer-const.js | groupByDestructuring | function groupByDestructuring(variables, ignoreReadBeforeAssign) {
const identifierMap = new Map();
for (let i = 0; i < variables.length; ++i) {
const variable = variables[i];
const references = variable.references;
const identifier = getIdentifierIfShouldBeConst(variable, ignoreReadBef... | javascript | function groupByDestructuring(variables, ignoreReadBeforeAssign) {
const identifierMap = new Map();
for (let i = 0; i < variables.length; ++i) {
const variable = variables[i];
const references = variable.references;
const identifier = getIdentifierIfShouldBeConst(variable, ignoreReadBef... | [
"function",
"groupByDestructuring",
"(",
"variables",
",",
"ignoreReadBeforeAssign",
")",
"{",
"const",
"identifierMap",
"=",
"new",
"Map",
"(",
")",
";",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"variables",
".",
"length",
";",
"++",
"i",
")",
... | Groups by the VariableDeclarator/AssignmentExpression node that each
reference of given variables belongs to.
This is used to detect a mix of reassigned and never reassigned in a
destructuring.
@param {eslint-scope.Variable[]} variables - Variables to group by destructuring.
@param {boolean} ignoreReadBeforeAssign -
T... | [
"Groups",
"by",
"the",
"VariableDeclarator",
"/",
"AssignmentExpression",
"node",
"that",
"each",
"reference",
"of",
"given",
"variables",
"belongs",
"to",
".",
"This",
"is",
"used",
"to",
"detect",
"a",
"mix",
"of",
"reassigned",
"and",
"never",
"reassigned",
... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-const.js#L271-L307 | train | Groups the references of a destructuring variable into a map of identifiers | [
30522,
3853,
2177,
3762,
6155,
18300,
12228,
1006,
10857,
1010,
8568,
16416,
18939,
12879,
5686,
12054,
23773,
1007,
1063,
9530,
3367,
8909,
4765,
18095,
2863,
2361,
1027,
2047,
4949,
1006,
1007,
1025,
2005,
1006,
2292,
1045,
1027,
1014,
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... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(options) {
var prevNode = node.previousSibling,
types = (options && options.nodeTypes) ? options.nodeTypes : defaultNodeTypes;
if (!prevNode) {
return null;
}
if (
(!wysihtml5.lang.array(types).contains(prevNode.nodeType)) || // nodeType... | javascript | function(options) {
var prevNode = node.previousSibling,
types = (options && options.nodeTypes) ? options.nodeTypes : defaultNodeTypes;
if (!prevNode) {
return null;
}
if (
(!wysihtml5.lang.array(types).contains(prevNode.nodeType)) || // nodeType... | [
"function",
"(",
"options",
")",
"{",
"var",
"prevNode",
"=",
"node",
".",
"previousSibling",
",",
"types",
"=",
"(",
"options",
"&&",
"options",
".",
"nodeTypes",
")",
"?",
"options",
".",
"nodeTypes",
":",
"defaultNodeTypes",
";",
"if",
"(",
"!",
"prev... | var node = wysihtml5.dom.domNode(element).prev({nodeTypes: [1,3], ignoreBlankTexts: true}); | [
"var",
"node",
"=",
"wysihtml5",
".",
"dom",
".",
"domNode",
"(",
"element",
")",
".",
"prev",
"(",
"{",
"nodeTypes",
":",
"[",
"1",
"3",
"]",
"ignoreBlankTexts",
":",
"true",
"}",
")",
";"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L5337-L5353 | train | Returns the previous sibling of node | [
30522,
3853,
1006,
7047,
1007,
1063,
13075,
3653,
16022,
10244,
1027,
13045,
1012,
3025,
5332,
9709,
1010,
4127,
1027,
1006,
7047,
1004,
1004,
7047,
1012,
13045,
13874,
2015,
1007,
1029,
7047,
1012,
13045,
13874,
2015,
1024,
12398,
3630,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/document/DocumentCommandHandlers.js | handleFileRename | function handleFileRename() {
// Prefer selected sidebar item (which could be a folder)
var entry = ProjectManager.getContext();
if (!entry) {
// Else use current file (not selected in ProjectManager if not visible in tree or workingset)
entry = MainViewManager.getCurrent... | javascript | function handleFileRename() {
// Prefer selected sidebar item (which could be a folder)
var entry = ProjectManager.getContext();
if (!entry) {
// Else use current file (not selected in ProjectManager if not visible in tree or workingset)
entry = MainViewManager.getCurrent... | [
"function",
"handleFileRename",
"(",
")",
"{",
"// Prefer selected sidebar item (which could be a folder)",
"var",
"entry",
"=",
"ProjectManager",
".",
"getContext",
"(",
")",
";",
"if",
"(",
"!",
"entry",
")",
"{",
"// Else use current file (not selected in ProjectManager ... | Show a textfield to rename whatever is currently selected in the sidebar (or current doc if nothing else selected) | [
"Show",
"a",
"textfield",
"to",
"rename",
"whatever",
"is",
"currently",
"selected",
"in",
"the",
"sidebar",
"(",
"or",
"current",
"doc",
"if",
"nothing",
"else",
"selected",
")"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentCommandHandlers.js#L1494-L1504 | train | Handle file renaming | [
30522,
3853,
5047,
8873,
3917,
8189,
4168,
1006,
1007,
1063,
1013,
1013,
9544,
3479,
2217,
8237,
8875,
1006,
2029,
2071,
2022,
1037,
19622,
1007,
13075,
4443,
1027,
2622,
24805,
4590,
1012,
2131,
8663,
18209,
1006,
1007,
1025,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/prefer-template.js | hasOctalEscapeSequence | function hasOctalEscapeSequence(node) {
if (isConcatenation(node)) {
return hasOctalEscapeSequence(node.left) || hasOctalEscapeSequence(node.right);
}
return isOctalEscapeSequence(node);
} | javascript | function hasOctalEscapeSequence(node) {
if (isConcatenation(node)) {
return hasOctalEscapeSequence(node.left) || hasOctalEscapeSequence(node.right);
}
return isOctalEscapeSequence(node);
} | [
"function",
"hasOctalEscapeSequence",
"(",
"node",
")",
"{",
"if",
"(",
"isConcatenation",
"(",
"node",
")",
")",
"{",
"return",
"hasOctalEscapeSequence",
"(",
"node",
".",
"left",
")",
"||",
"hasOctalEscapeSequence",
"(",
"node",
".",
"right",
")",
";",
"}"... | Checks whether or not a node contains a octal escape sequence
@param {ASTNode} node A node to check
@returns {boolean} `true` if the node contains an octal escape sequence | [
"Checks",
"whether",
"or",
"not",
"a",
"node",
"contains",
"a",
"octal",
"escape",
"sequence"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-template.js#L72-L78 | train | Check if a node has an octal escape sequence | [
30522,
3853,
2038,
10085,
22059,
15782,
10374,
2063,
4226,
5897,
1006,
13045,
1007,
1063,
2065,
1006,
2003,
8663,
16280,
9323,
1006,
13045,
1007,
1007,
1063,
2709,
2038,
10085,
22059,
15782,
10374,
2063,
4226,
5897,
1006,
13045,
1012,
2187,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | removeWhile | function removeWhile(node, pred) {
while (node) {
if (isEditable(node) || !pred(node)) {
break;
}
const parent = node.parentNode;
remove(node);
node = parent;
}
} | javascript | function removeWhile(node, pred) {
while (node) {
if (isEditable(node) || !pred(node)) {
break;
}
const parent = node.parentNode;
remove(node);
node = parent;
}
} | [
"function",
"removeWhile",
"(",
"node",
",",
"pred",
")",
"{",
"while",
"(",
"node",
")",
"{",
"if",
"(",
"isEditable",
"(",
"node",
")",
"||",
"!",
"pred",
"(",
"node",
")",
")",
"{",
"break",
";",
"}",
"const",
"parent",
"=",
"node",
".",
"pare... | @method removeWhile
@param {Node} node
@param {Function} pred | [
"@method",
"removeWhile"
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L900-L910 | train | Remove nodes from the tree while predicate returns true | [
30522,
3853,
6366,
19927,
1006,
13045,
1010,
3653,
2094,
1007,
1063,
2096,
1006,
13045,
1007,
1063,
2065,
1006,
2003,
2098,
6590,
3468,
1006,
13045,
1007,
1064,
1064,
999,
3653,
2094,
1006,
13045,
1007,
1007,
1063,
3338,
1025,
1065,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
google/closure-library | closure/goog/structs/avltree.js | function(opt_comparator) {
/**
* Comparison function used to compare values in the tree. This function
* should take two values, a and b, and return x where:
*
* <pre>
* x < 0 if a < b,
* x > 0 if a > b,
* x = 0 otherwise
* </pre>
*
* @private @const {!Function}
*/
this.comparato... | javascript | function(opt_comparator) {
/**
* Comparison function used to compare values in the tree. This function
* should take two values, a and b, and return x where:
*
* <pre>
* x < 0 if a < b,
* x > 0 if a > b,
* x = 0 otherwise
* </pre>
*
* @private @const {!Function}
*/
this.comparato... | [
"function",
"(",
"opt_comparator",
")",
"{",
"/**\n * Comparison function used to compare values in the tree. This function\n * should take two values, a and b, and return x where:\n *\n * <pre>\n * x < 0 if a < b,\n * x > 0 if a > b,\n * x = 0 otherwise\n * </pre>\n *\n * @private ... | Constructs an AVL-Tree, which uses the specified comparator to order its
values. The values can be accessed efficiently in their sorted order since
the tree enforces a O(logn) maximum height.
@param {?Function=} opt_comparator Function used to order the tree's nodes.
@constructor
@implements {Collection<T>}
@final
@te... | [
"Constructs",
"an",
"AVL",
"-",
"Tree",
"which",
"uses",
"the",
"specified",
"comparator",
"to",
"order",
"its",
"values",
".",
"The",
"values",
"can",
"be",
"accessed",
"efficiently",
"in",
"their",
"sorted",
"order",
"since",
"the",
"tree",
"enforces",
"a"... | 97390e9ca4483cebb9628e06026139fbb3023d65 | https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/closure/goog/structs/avltree.js#L65-L100 | train | A comparison function for the tree. | [
30522,
3853,
1006,
23569,
1035,
4012,
28689,
4263,
1007,
1063,
1013,
1008,
1008,
1008,
7831,
3853,
2109,
2000,
12826,
5300,
1999,
1996,
3392,
1012,
2023,
3853,
1008,
2323,
2202,
2048,
5300,
1010,
1037,
1998,
1038,
1010,
1998,
2709,
1060,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/EventDispatcher.js | splitNs | function splitNs(eventStr) {
var dot = eventStr.indexOf(".");
if (dot === -1) {
return { eventName: eventStr };
} else {
return { eventName: eventStr.substring(0, dot), ns: eventStr.substring(dot) };
}
} | javascript | function splitNs(eventStr) {
var dot = eventStr.indexOf(".");
if (dot === -1) {
return { eventName: eventStr };
} else {
return { eventName: eventStr.substring(0, dot), ns: eventStr.substring(dot) };
}
} | [
"function",
"splitNs",
"(",
"eventStr",
")",
"{",
"var",
"dot",
"=",
"eventStr",
".",
"indexOf",
"(",
"\".\"",
")",
";",
"if",
"(",
"dot",
"===",
"-",
"1",
")",
"{",
"return",
"{",
"eventName",
":",
"eventStr",
"}",
";",
"}",
"else",
"{",
"return",... | Split "event.namespace" string into its two parts; both parts are optional.
@param {string} eventName Event name and/or trailing ".namespace"
@return {!{event:string, ns:string}} Uses "" for missing parts. | [
"Split",
"event",
".",
"namespace",
"string",
"into",
"its",
"two",
"parts",
";",
"both",
"parts",
"are",
"optional",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/EventDispatcher.js#L66-L73 | train | Split event name into event name and namespace | [
30522,
3853,
3975,
3619,
1006,
2824,
16344,
1007,
1063,
13075,
11089,
1027,
2824,
16344,
1012,
5950,
11253,
1006,
1000,
1012,
1000,
1007,
1025,
2065,
1006,
11089,
1027,
1027,
1027,
1011,
1015,
1007,
1063,
2709,
1063,
2724,
18442,
1024,
2824... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/70_csheet.js | parse_BrtCsProp | function parse_BrtCsProp(data, length/*:number*/) {
data.l += 10;
var name = parse_XLWideString(data, length - 10);
return { name: name };
} | javascript | function parse_BrtCsProp(data, length/*:number*/) {
data.l += 10;
var name = parse_XLWideString(data, length - 10);
return { name: name };
} | [
"function",
"parse_BrtCsProp",
"(",
"data",
",",
"length",
"/*:number*/",
")",
"{",
"data",
".",
"l",
"+=",
"10",
";",
"var",
"name",
"=",
"parse_XLWideString",
"(",
"data",
",",
"length",
"-",
"10",
")",
";",
"return",
"{",
"name",
":",
"name",
"}",
... | /* [MS-XLSB] 2.4.331 BrtCsProp | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"4",
".",
"331",
"BrtCsProp"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/70_csheet.js#L35-L39 | train | Parse BrtCsProp | [
30522,
3853,
11968,
3366,
1035,
7987,
13535,
13102,
18981,
1006,
2951,
1010,
3091,
1013,
1008,
1024,
2193,
1008,
1013,
1007,
1063,
2951,
1012,
1048,
1009,
1027,
2184,
1025,
13075,
2171,
1027,
11968,
3366,
1035,
28712,
22517,
3367,
4892,
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... |
facebook/relay | packages/relay-compiler/util/areEqualOSS.js | areEqual | function areEqual(a: any, b: any): boolean {
const aStack = aStackPool.length ? aStackPool.pop() : [];
const bStack = bStackPool.length ? bStackPool.pop() : [];
const result = eq(a, b, aStack, bStack);
aStack.length = 0;
bStack.length = 0;
aStackPool.push(aStack);
bStackPool.push(bStack);
return result;... | javascript | function areEqual(a: any, b: any): boolean {
const aStack = aStackPool.length ? aStackPool.pop() : [];
const bStack = bStackPool.length ? bStackPool.pop() : [];
const result = eq(a, b, aStack, bStack);
aStack.length = 0;
bStack.length = 0;
aStackPool.push(aStack);
bStackPool.push(bStack);
return result;... | [
"function",
"areEqual",
"(",
"a",
":",
"any",
",",
"b",
":",
"any",
")",
":",
"boolean",
"{",
"const",
"aStack",
"=",
"aStackPool",
".",
"length",
"?",
"aStackPool",
".",
"pop",
"(",
")",
":",
"[",
"]",
";",
"const",
"bStack",
"=",
"bStackPool",
".... | Checks if two values are equal. Values may be primitives, arrays, or objects.
Returns true if both arguments have the same keys and values.
@see http://underscorejs.org
@copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
@license MIT | [
"Checks",
"if",
"two",
"values",
"are",
"equal",
".",
"Values",
"may",
"be",
"primitives",
"arrays",
"or",
"objects",
".",
"Returns",
"true",
"if",
"both",
"arguments",
"have",
"the",
"same",
"keys",
"and",
"values",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/util/areEqualOSS.js#L23-L32 | train | A is equal to b | [
30522,
3853,
2024,
2063,
26426,
1006,
1037,
1024,
2151,
1010,
1038,
1024,
2151,
1007,
1024,
22017,
20898,
1063,
9530,
3367,
2004,
2696,
3600,
1027,
2004,
2696,
3600,
16869,
1012,
3091,
1029,
2004,
2696,
3600,
16869,
1012,
3769,
1006,
30524,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/chart/treemap/treemapLayout.js | worst | function worst(row, rowFixedLength, ratio) {
var areaMax = 0;
var areaMin = Infinity;
for (var i = 0, area, len = row.length; i < len; i++) {
area = row[i].getLayout().area;
if (area) {
area < areaMin && (areaMin = area);
area > areaMax && (areaMax = area);
}... | javascript | function worst(row, rowFixedLength, ratio) {
var areaMax = 0;
var areaMin = Infinity;
for (var i = 0, area, len = row.length; i < len; i++) {
area = row[i].getLayout().area;
if (area) {
area < areaMin && (areaMin = area);
area > areaMax && (areaMax = area);
}... | [
"function",
"worst",
"(",
"row",
",",
"rowFixedLength",
",",
"ratio",
")",
"{",
"var",
"areaMax",
"=",
"0",
";",
"var",
"areaMin",
"=",
"Infinity",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"area",
",",
"len",
"=",
"row",
".",
"length",
";",
"i... | Computes the score for the specified row,
as the worst aspect ratio. | [
"Computes",
"the",
"score",
"for",
"the",
"specified",
"row",
"as",
"the",
"worst",
"aspect",
"ratio",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/treemap/treemapLayout.js#L405-L426 | train | Returns the worst area of a row | [
30522,
3853,
5409,
1006,
5216,
1010,
5216,
23901,
7770,
13512,
2232,
1010,
6463,
1007,
1063,
13075,
2181,
17848,
1027,
1014,
1025,
13075,
2181,
10020,
1027,
15579,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1010,
2181,
1010,
18798,
1027,
52... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
vuejs/vue-cli | packages/@vue/cli-service/lib/util/prepareProxy.js | mayProxy | function mayProxy (pathname) {
const maybePublicPath = path.resolve(appPublicFolder, pathname.slice(1))
return !fs.existsSync(maybePublicPath)
} | javascript | function mayProxy (pathname) {
const maybePublicPath = path.resolve(appPublicFolder, pathname.slice(1))
return !fs.existsSync(maybePublicPath)
} | [
"function",
"mayProxy",
"(",
"pathname",
")",
"{",
"const",
"maybePublicPath",
"=",
"path",
".",
"resolve",
"(",
"appPublicFolder",
",",
"pathname",
".",
"slice",
"(",
"1",
")",
")",
"return",
"!",
"fs",
".",
"existsSync",
"(",
"maybePublicPath",
")",
"}"
... | Otherwise, if proxy is specified, we will let it handle any request except for files in the public folder. | [
"Otherwise",
"if",
"proxy",
"is",
"specified",
"we",
"will",
"let",
"it",
"handle",
"any",
"request",
"except",
"for",
"files",
"in",
"the",
"public",
"folder",
"."
] | 206803cbefefdfbc7d8ed12440b0b751688b77b2 | https://github.com/vuejs/vue-cli/blob/206803cbefefdfbc7d8ed12440b0b751688b77b2/packages/@vue/cli-service/lib/util/prepareProxy.js#L48-L51 | train | Check if pathname is a public folder | [
30522,
3853,
2089,
21572,
18037,
1006,
4130,
18442,
1007,
1063,
9530,
3367,
2672,
14289,
16558,
2594,
15069,
1027,
4130,
1012,
10663,
1006,
10439,
14289,
16558,
2594,
10371,
2121,
1010,
4130,
18442,
1012,
14704,
1006,
1015,
1007,
1007,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/qunit.js | escapeText | function escapeText( s ) {
if ( !s ) {
return "";
}
s = s + "";
// Both single quotes and double quotes (for attributes)
return s.replace( /['"<>&]/g, function( s ) {
switch ( s ) {
case "'":
return "'";
case "\"":
return """;
case "<":
return "<";
case ">":
return ">";
c... | javascript | function escapeText( s ) {
if ( !s ) {
return "";
}
s = s + "";
// Both single quotes and double quotes (for attributes)
return s.replace( /['"<>&]/g, function( s ) {
switch ( s ) {
case "'":
return "'";
case "\"":
return """;
case "<":
return "<";
case ">":
return ">";
c... | [
"function",
"escapeText",
"(",
"s",
")",
"{",
"if",
"(",
"!",
"s",
")",
"{",
"return",
"\"\"",
";",
"}",
"s",
"=",
"s",
"+",
"\"\"",
";",
"// Both single quotes and double quotes (for attributes)",
"return",
"s",
".",
"replace",
"(",
"/",
"['\"<>&]",
"/",
... | Escape text for attribute or text content. | [
"Escape",
"text",
"for",
"attribute",
"or",
"text",
"content",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/qunit.js#L3162-L3183 | train | Escape text | [
30522,
3853,
4019,
18209,
1006,
1055,
1007,
1063,
2065,
1006,
999,
1055,
1007,
1063,
2709,
1000,
1000,
1025,
1065,
1055,
1027,
1055,
1009,
1000,
1000,
1025,
1013,
1013,
2119,
2309,
16614,
1998,
3313,
16614,
1006,
2005,
12332,
1007,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
googleapis/google-api-nodejs-client | samples/youtube/upload.js | runSample | async function runSample(fileName) {
const fileSize = fs.statSync(fileName).size;
const res = await youtube.videos.insert(
{
part: 'id,snippet,status',
notifySubscribers: false,
requestBody: {
snippet: {
title: 'Node.js YouTube Upload Test',
description: 'Testing Yo... | javascript | async function runSample(fileName) {
const fileSize = fs.statSync(fileName).size;
const res = await youtube.videos.insert(
{
part: 'id,snippet,status',
notifySubscribers: false,
requestBody: {
snippet: {
title: 'Node.js YouTube Upload Test',
description: 'Testing Yo... | [
"async",
"function",
"runSample",
"(",
"fileName",
")",
"{",
"const",
"fileSize",
"=",
"fs",
".",
"statSync",
"(",
"fileName",
")",
".",
"size",
";",
"const",
"res",
"=",
"await",
"youtube",
".",
"videos",
".",
"insert",
"(",
"{",
"part",
":",
"'id,sni... | very basic example of uploading a video to youtube | [
"very",
"basic",
"example",
"of",
"uploading",
"a",
"video",
"to",
"youtube"
] | e6e632a29d0b246d058e3067de3a5c3827e2b54e | https://github.com/googleapis/google-api-nodejs-client/blob/e6e632a29d0b246d058e3067de3a5c3827e2b54e/samples/youtube/upload.js#L33-L66 | train | Runs a sample of YouTube | [
30522,
2004,
6038,
2278,
3853,
3216,
16613,
2571,
1006,
5371,
18442,
1007,
1063,
9530,
3367,
6764,
4697,
1027,
1042,
2015,
1012,
26319,
6038,
2278,
1006,
5371,
18442,
1007,
1012,
2946,
1025,
9530,
3367,
24501,
1027,
26751,
7858,
1012,
6876,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ODataMetaModel.js | stripKeyPredicate | function stripKeyPredicate(sSegment) {
var iPos = sSegment.indexOf("(");
return iPos >= 0
? sSegment.slice(0, iPos)
: sSegment;
} | javascript | function stripKeyPredicate(sSegment) {
var iPos = sSegment.indexOf("(");
return iPos >= 0
? sSegment.slice(0, iPos)
: sSegment;
} | [
"function",
"stripKeyPredicate",
"(",
"sSegment",
")",
"{",
"var",
"iPos",
"=",
"sSegment",
".",
"indexOf",
"(",
"\"(\"",
")",
";",
"return",
"iPos",
">=",
"0",
"?",
"sSegment",
".",
"slice",
"(",
"0",
",",
"iPos",
")",
":",
"sSegment",
";",
"}"
] | qualified name of current (entity) type across navigations /*
Strips the OData key predicate from a resource path segment.
@param {string} sSegment
@returns {string} | [
"qualified",
"name",
"of",
"current",
"(",
"entity",
")",
"type",
"across",
"navigations",
"/",
"*",
"Strips",
"the",
"OData",
"key",
"predicate",
"from",
"a",
"resource",
"path",
"segment",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/ODataMetaModel.js#L549-L554 | train | Removes the key predicate from the segment if it exists | [
30522,
3853,
6167,
14839,
28139,
16467,
1006,
7020,
13910,
3672,
1007,
1063,
13075,
12997,
2891,
1027,
7020,
13910,
3672,
1012,
5950,
11253,
1006,
1000,
1006,
1000,
1007,
1025,
2709,
12997,
2891,
1028,
1027,
1014,
1029,
7020,
13910,
3672,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | shift_formula_str | function shift_formula_str(f, delta) {
return f.replace(crefregex, function($0, $1, $2, $3, $4, $5) {
return $1+($2=="$" ? $2+$3 : encode_col(decode_col($3)+delta.c))+($4=="$" ? $4+$5 : encode_row(decode_row($5) + delta.r));
});
} | javascript | function shift_formula_str(f, delta) {
return f.replace(crefregex, function($0, $1, $2, $3, $4, $5) {
return $1+($2=="$" ? $2+$3 : encode_col(decode_col($3)+delta.c))+($4=="$" ? $4+$5 : encode_row(decode_row($5) + delta.r));
});
} | [
"function",
"shift_formula_str",
"(",
"f",
",",
"delta",
")",
"{",
"return",
"f",
".",
"replace",
"(",
"crefregex",
",",
"function",
"(",
"$0",
",",
"$1",
",",
"$2",
",",
"$3",
",",
"$4",
",",
"$5",
")",
"{",
"return",
"$1",
"+",
"(",
"$2",
"==",... | /* no defined name can collide with a valid cell address A1:XFD1048576 ... except LOG10! | [
"/",
"*",
"no",
"defined",
"name",
"can",
"collide",
"with",
"a",
"valid",
"cell",
"address",
"A1",
":",
"XFD1048576",
"...",
"except",
"LOG10!"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L10204-L10208 | train | Shift formula string | [
30522,
3853,
5670,
1035,
5675,
1035,
2358,
2099,
1006,
1042,
1010,
7160,
1007,
1063,
2709,
1042,
1012,
5672,
1006,
13675,
12879,
2890,
3351,
2595,
1010,
3853,
1006,
1002,
1014,
1010,
1002,
1015,
1010,
1002,
1016,
1010,
1002,
1017,
1010,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/chart/treemap/treemapLayout.js | estimateRootSize | function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {
// If targetInfo.node exists, we zoom to the node,
// so estimate whold width and heigth by target node.
var currNode = (targetInfo || {}).node;
var defaultSize = [containerWidth, containerHeight];
if (!... | javascript | function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {
// If targetInfo.node exists, we zoom to the node,
// so estimate whold width and heigth by target node.
var currNode = (targetInfo || {}).node;
var defaultSize = [containerWidth, containerHeight];
if (!... | [
"function",
"estimateRootSize",
"(",
"seriesModel",
",",
"targetInfo",
",",
"viewRoot",
",",
"containerWidth",
",",
"containerHeight",
")",
"{",
"// If targetInfo.node exists, we zoom to the node,",
"// so estimate whold width and heigth by target node.",
"var",
"currNode",
"=",
... | Return [containerWidth, containerHeight] as defualt. | [
"Return",
"[",
"containerWidth",
"containerHeight",
"]",
"as",
"defualt",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/treemap/treemapLayout.js#L478-L521 | train | Estimate the root size of the container. | [
30522,
3853,
10197,
3217,
12868,
4697,
1006,
2186,
5302,
9247,
1010,
4539,
2378,
14876,
1010,
3193,
3217,
4140,
1010,
11661,
9148,
11927,
2232,
1010,
11661,
26036,
13900,
1007,
1063,
1013,
1013,
2065,
4539,
2378,
14876,
1012,
13045,
6526,
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... |
laurent22/joplin | ReactNativeClient/lib/import-enex-md-gen.js | drawTable | function drawTable(table) {
// | First Header | Second Header |
// | ------------- | ------------- |
// | Content Cell | Content Cell |
// | Content Cell | Content Cell |
// There must be at least 3 dashes separating each header cell.
// https://gist.github.com/IanWang/28965e13cdafdef4e11dc91f578d160d#table... | javascript | function drawTable(table) {
// | First Header | Second Header |
// | ------------- | ------------- |
// | Content Cell | Content Cell |
// | Content Cell | Content Cell |
// There must be at least 3 dashes separating each header cell.
// https://gist.github.com/IanWang/28965e13cdafdef4e11dc91f578d160d#table... | [
"function",
"drawTable",
"(",
"table",
")",
"{",
"// | First Header | Second Header |",
"// | ------------- | ------------- |",
"// | Content Cell | Content Cell |",
"// | Content Cell | Content Cell |",
"// There must be at least 3 dashes separating each header cell.",
"// https://gist.g... | Markdown tables don't support tables within tables, which is common in notes that are complete web pages, for example when imported via Web Clipper. So to handle this, we render all the outer tables as regular text (as if replacing all the <table>, <tr> and <td> elements by <div>) and only the inner ones, those that do... | [
"Markdown",
"tables",
"don",
"t",
"support",
"tables",
"within",
"tables",
"which",
"is",
"common",
"in",
"notes",
"that",
"are",
"complete",
"web",
"pages",
"for",
"example",
"when",
"imported",
"via",
"Web",
"Clipper",
".",
"So",
"to",
"handle",
"this",
... | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/ReactNativeClient/lib/import-enex-md-gen.js#L869-L972 | train | Draw the table | [
30522,
3853,
4009,
10880,
1006,
2795,
1007,
1063,
1013,
1013,
1064,
2034,
20346,
1064,
2117,
20346,
1064,
1013,
1013,
1064,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1064,
1011,
1011,
1011,
1011,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js | PropertyCache | function PropertyCache(oRequestor, sResourcePath, mQueryOptions) {
Cache.call(this, oRequestor, sResourcePath, mQueryOptions);
this.oPromise = null;
} | javascript | function PropertyCache(oRequestor, sResourcePath, mQueryOptions) {
Cache.call(this, oRequestor, sResourcePath, mQueryOptions);
this.oPromise = null;
} | [
"function",
"PropertyCache",
"(",
"oRequestor",
",",
"sResourcePath",
",",
"mQueryOptions",
")",
"{",
"Cache",
".",
"call",
"(",
"this",
",",
"oRequestor",
",",
"sResourcePath",
",",
"mQueryOptions",
")",
";",
"this",
".",
"oPromise",
"=",
"null",
";",
"}"
] | ********************************************************************************************* PropertyCache *********************************************************************************************
Creates a cache for a single property that performs requests using the given requestor.
@param {sap.ui.model.odata.v... | [
"*********************************************************************************************",
"PropertyCache",
"*********************************************************************************************",
"Creates",
"a",
"cache",
"for",
"a",
"single",
"property",
"that",
"performs",
"r... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js#L1926-L1930 | train | Creates a new cache object. | [
30522,
3853,
3200,
3540,
5403,
1006,
10848,
15500,
2953,
1010,
5034,
2229,
8162,
3401,
15069,
1010,
1049,
4226,
2854,
7361,
9285,
1007,
1063,
17053,
1012,
2655,
1006,
2023,
1010,
10848,
15500,
2953,
1010,
5034,
2229,
8162,
3401,
15069,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
NervJS/taro-ui | src/components/input-number/index.js | parseValue | function parseValue (num) {
if (num === '') return '0'
const numStr = _toString(num)
if (numStr.indexOf('0') === 0
&& numStr.indexOf('.') === -1) {
// 处理01变成1,并且不处理1.
return _toString(parseFloat(num))
}
return _toString(num)
} | javascript | function parseValue (num) {
if (num === '') return '0'
const numStr = _toString(num)
if (numStr.indexOf('0') === 0
&& numStr.indexOf('.') === -1) {
// 处理01变成1,并且不处理1.
return _toString(parseFloat(num))
}
return _toString(num)
} | [
"function",
"parseValue",
"(",
"num",
")",
"{",
"if",
"(",
"num",
"===",
"''",
")",
"return",
"'0'",
"const",
"numStr",
"=",
"_toString",
"(",
"num",
")",
"if",
"(",
"numStr",
".",
"indexOf",
"(",
"'0'",
")",
"===",
"0",
"&&",
"numStr",
".",
"index... | 格式化数字,处理01变成1,并且不处理1. 这种情况 | [
"格式化数字,处理01变成1",
"并且不处理1",
".",
"这种情况"
] | 9a761032b3663abf82dd4514ac29deec2eb13d2a | https://github.com/NervJS/taro-ui/blob/9a761032b3663abf82dd4514ac29deec2eb13d2a/src/components/input-number/index.js#L28-L38 | train | parse value | [
30522,
3853,
11968,
3366,
10175,
5657,
1006,
16371,
2213,
1007,
1063,
2065,
1006,
16371,
2213,
1027,
1027,
1027,
1005,
1005,
1007,
2709,
1005,
1014,
1005,
9530,
3367,
16371,
5244,
16344,
1027,
1035,
2000,
3367,
4892,
1006,
16371,
2213,
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... |
GitbookIO/gitbook | lib/plugins/validateConfig.js | validatePluginConfig | function validatePluginConfig(book, plugin) {
var config = book.getConfig();
var packageInfos = plugin.getPackage();
var configKey = [
'pluginsConfig',
plugin.getName()
].join('.');
var pluginConfig = config.getValue(configKey, {}).toJS();
var schema = (packageInfos.get('gitbo... | javascript | function validatePluginConfig(book, plugin) {
var config = book.getConfig();
var packageInfos = plugin.getPackage();
var configKey = [
'pluginsConfig',
plugin.getName()
].join('.');
var pluginConfig = config.getValue(configKey, {}).toJS();
var schema = (packageInfos.get('gitbo... | [
"function",
"validatePluginConfig",
"(",
"book",
",",
"plugin",
")",
"{",
"var",
"config",
"=",
"book",
".",
"getConfig",
"(",
")",
";",
"var",
"packageInfos",
"=",
"plugin",
".",
"getPackage",
"(",
")",
";",
"var",
"configKey",
"=",
"[",
"'pluginsConfig'"... | Validate one plugin for a book and update book's confiration
@param {Book}
@param {Plugin}
@return {Book} | [
"Validate",
"one",
"plugin",
"for",
"a",
"book",
"and",
"update",
"book",
"s",
"confiration"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/plugins/validateConfig.js#L16-L55 | train | Validate plugin config | [
30522,
3853,
9398,
3686,
24759,
15916,
2378,
8663,
8873,
2290,
1006,
2338,
1010,
13354,
2378,
1007,
1063,
13075,
9530,
8873,
2290,
1027,
2338,
1012,
2131,
8663,
8873,
2290,
1006,
1007,
1025,
13075,
7427,
2378,
14876,
2015,
1027,
13354,
2378... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/autocomplete/demoFloatingLabel/script.js | createFilterFor | function createFilterFor(query) {
var lowercaseQuery = query.toLowerCase();
return function filterFn(state) {
return (state.value.indexOf(lowercaseQuery) === 0);
};
} | javascript | function createFilterFor(query) {
var lowercaseQuery = query.toLowerCase();
return function filterFn(state) {
return (state.value.indexOf(lowercaseQuery) === 0);
};
} | [
"function",
"createFilterFor",
"(",
"query",
")",
"{",
"var",
"lowercaseQuery",
"=",
"query",
".",
"toLowerCase",
"(",
")",
";",
"return",
"function",
"filterFn",
"(",
"state",
")",
"{",
"return",
"(",
"state",
".",
"value",
".",
"indexOf",
"(",
"lowercase... | Create filter function for a query string | [
"Create",
"filter",
"function",
"for",
"a",
"query",
"string"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/autocomplete/demoFloatingLabel/script.js#L54-L61 | train | Create a filter function for a given query | [
30522,
3853,
3443,
8873,
21928,
29278,
1006,
23032,
1007,
1063,
13075,
2896,
18382,
4226,
2854,
1027,
23032,
1012,
2000,
27663,
18992,
3366,
1006,
1007,
1025,
2709,
3853,
11307,
2546,
2078,
1006,
2110,
1007,
1063,
2709,
1006,
2110,
1012,
36... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/colors/colors.js | parseColor | function parseColor(color, contrast) {
contrast = contrast || false;
var rgbValues = $mdTheming.PALETTES[color.palette][color.hue];
rgbValues = contrast ? rgbValues.contrast : rgbValues.value;
return $mdUtil.supplant('rgba({0}, {1}, {2}, {3})',
[rgbValues[0], rgbValues[1], rgbValues[2]... | javascript | function parseColor(color, contrast) {
contrast = contrast || false;
var rgbValues = $mdTheming.PALETTES[color.palette][color.hue];
rgbValues = contrast ? rgbValues.contrast : rgbValues.value;
return $mdUtil.supplant('rgba({0}, {1}, {2}, {3})',
[rgbValues[0], rgbValues[1], rgbValues[2]... | [
"function",
"parseColor",
"(",
"color",
",",
"contrast",
")",
"{",
"contrast",
"=",
"contrast",
"||",
"false",
";",
"var",
"rgbValues",
"=",
"$mdTheming",
".",
"PALETTES",
"[",
"color",
".",
"palette",
"]",
"[",
"color",
".",
"hue",
"]",
";",
"rgbValues"... | Return the parsed color
@param {{hue: *, theme: any, palette: *, opacity: (*|string|number)}} color hash map of color
definitions
@param {boolean=} contrast whether use contrast color for foreground. Defaults to false.
@returns {string} rgba color string | [
"Return",
"the",
"parsed",
"color"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/colors/colors.js#L120-L129 | train | Parse a color | [
30522,
3853,
11968,
3366,
18717,
1006,
3609,
1010,
5688,
1007,
1063,
5688,
1027,
5688,
1064,
1064,
6270,
1025,
13075,
1054,
18259,
10175,
15808,
1027,
1002,
9108,
10760,
6562,
1012,
27396,
2015,
1031,
3609,
1012,
27396,
1033,
1031,
3609,
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... |
thomaspark/bootswatch | docs/_vendor/popper.js/dist/popper.js | getPopperOffsets | function getPopperOffsets(popper, referenceOffsets, placement) {
placement = placement.split('-')[0];
// Get popper node sizes
const popperRect = getOuterSizes(popper);
// Add position, width and height to our offsets object
const popperOffsets = {
width: popperRect.width,
height: popperRect.height
... | javascript | function getPopperOffsets(popper, referenceOffsets, placement) {
placement = placement.split('-')[0];
// Get popper node sizes
const popperRect = getOuterSizes(popper);
// Add position, width and height to our offsets object
const popperOffsets = {
width: popperRect.width,
height: popperRect.height
... | [
"function",
"getPopperOffsets",
"(",
"popper",
",",
"referenceOffsets",
",",
"placement",
")",
"{",
"placement",
"=",
"placement",
".",
"split",
"(",
"'-'",
")",
"[",
"0",
"]",
";",
"// Get popper node sizes",
"const",
"popperRect",
"=",
"getOuterSizes",
"(",
... | Get offsets to the popper
@method
@memberof Popper.Utils
@param {Object} position - CSS position the Popper will get applied
@param {HTMLElement} popper - the popper element
@param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
@param {String} placement - one of the valid placem... | [
"Get",
"offsets",
"to",
"the",
"popper"
] | a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd | https://github.com/thomaspark/bootswatch/blob/a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd/docs/_vendor/popper.js/dist/popper.js#L710-L737 | train | Get offsets for a popper | [
30522,
3853,
2131,
16340,
4842,
27475,
8454,
1006,
3769,
4842,
1010,
4431,
27475,
8454,
1010,
11073,
1007,
1063,
11073,
1027,
11073,
1012,
3975,
1006,
1005,
1011,
1005,
1007,
1031,
1014,
1033,
1025,
1013,
1013,
2131,
3769,
4842,
13045,
1082... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/utils/templatize.js | createTemplatizerClass | function createTemplatizerClass(template, templateInfo, options) {
// Anonymous class created by the templatize
let base = options.mutableData ?
MutableTemplateInstanceBase : TemplateInstanceBase;
/**
* @constructor
* @extends {base}
* @private
*/
let klass = class extends base { };
klass.prot... | javascript | function createTemplatizerClass(template, templateInfo, options) {
// Anonymous class created by the templatize
let base = options.mutableData ?
MutableTemplateInstanceBase : TemplateInstanceBase;
/**
* @constructor
* @extends {base}
* @private
*/
let klass = class extends base { };
klass.prot... | [
"function",
"createTemplatizerClass",
"(",
"template",
",",
"templateInfo",
",",
"options",
")",
"{",
"// Anonymous class created by the templatize",
"let",
"base",
"=",
"options",
".",
"mutableData",
"?",
"MutableTemplateInstanceBase",
":",
"TemplateInstanceBase",
";",
"... | /* eslint-disable valid-jsdoc
@suppress {missingProperties} class.prototype is not defined for some reason | [
"/",
"*",
"eslint",
"-",
"disable",
"valid",
"-",
"jsdoc"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/utils/templatize.js#L284-L298 | train | Creates an anonymous templatizer class | [
30522,
3853,
3443,
18532,
24759,
10450,
6290,
26266,
1006,
23561,
1010,
23561,
2378,
14876,
1010,
7047,
1007,
1063,
1013,
1013,
10812,
2465,
2580,
2011,
1996,
8915,
8737,
20051,
4697,
2292,
2918,
1027,
7047,
1012,
14163,
10880,
2850,
2696,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | parse_numFmts | function parse_numFmts(t, styles, opts) {
styles.NumberFmt = [];
var k/*Array<number>*/ = (keys(SSF._table));
for(var i=0; i < k.length; ++i) styles.NumberFmt[k[i]] = SSF._table[k[i]];
var m = t[0].match(tagregex);
if(!m) return;
for(i=0; i < m.length; ++i) {
var y = parsexmltag(m[i]);
switch(strip_ns(y[0])) ... | javascript | function parse_numFmts(t, styles, opts) {
styles.NumberFmt = [];
var k/*Array<number>*/ = (keys(SSF._table));
for(var i=0; i < k.length; ++i) styles.NumberFmt[k[i]] = SSF._table[k[i]];
var m = t[0].match(tagregex);
if(!m) return;
for(i=0; i < m.length; ++i) {
var y = parsexmltag(m[i]);
switch(strip_ns(y[0])) ... | [
"function",
"parse_numFmts",
"(",
"t",
",",
"styles",
",",
"opts",
")",
"{",
"styles",
".",
"NumberFmt",
"=",
"[",
"]",
";",
"var",
"k",
"/*Array<number>*/",
"=",
"(",
"keys",
"(",
"SSF",
".",
"_table",
")",
")",
";",
"for",
"(",
"var",
"i",
"=",
... | /* 18.8.31 numFmts CT_NumFmts | [
"/",
"*",
"18",
".",
"8",
".",
"31",
"numFmts",
"CT_NumFmts"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L8856-L8881 | train | Parse number formats | [
30522,
3853,
11968,
3366,
1035,
16371,
2213,
16715,
3215,
1006,
1056,
1010,
6782,
1010,
23569,
2015,
1007,
1063,
6782,
1012,
2193,
16715,
2102,
1027,
1031,
1033,
1025,
13075,
1047,
1013,
1008,
9140,
1026,
2193,
1028,
1008,
1013,
1027,
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/AnnotationHelper.js | function (vRawValue, oDetails) {
var sPath = oDetails.context.getPath();
if (sPath.slice(-1) === "/") {
// cut off trailing slash, happens with computed annotations
sPath = sPath.slice(0, -1);
}
return Expression.getExpression({
asExpression : false,
complexBinding : false,
... | javascript | function (vRawValue, oDetails) {
var sPath = oDetails.context.getPath();
if (sPath.slice(-1) === "/") {
// cut off trailing slash, happens with computed annotations
sPath = sPath.slice(0, -1);
}
return Expression.getExpression({
asExpression : false,
complexBinding : false,
... | [
"function",
"(",
"vRawValue",
",",
"oDetails",
")",
"{",
"var",
"sPath",
"=",
"oDetails",
".",
"context",
".",
"getPath",
"(",
")",
";",
"if",
"(",
"sPath",
".",
"slice",
"(",
"-",
"1",
")",
"===",
"\"/\"",
")",
"{",
"// cut off trailing slash, happens w... | A function that helps to interpret OData V4 annotations. It knows about the following
expressions:
<ul>
<li>"14.4 Constant Expressions" for "edm:Bool", "edm:Date",
"edm:DateTimeOffset", "edm:Decimal", "edm:Float", "edm:Guid", "edm:Int",
"edm:TimeOfDay".
<li>constant "14.4.11 Expression edm:String": This is turned into ... | [
"A",
"function",
"that",
"helps",
"to",
"interpret",
"OData",
"V4",
"annotations",
".",
"It",
"knows",
"about",
"the",
"following",
"expressions",
":",
"<ul",
">",
"<li",
">",
"14",
".",
"4",
"Constant",
"Expressions",
"for",
"edm",
":",
"Bool",
"edm",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/AnnotationHelper.js#L582-L598 | train | Returns the value of the property in the context | [
30522,
3853,
1006,
27830,
10376,
10175,
5657,
1010,
24040,
22081,
1007,
1063,
13075,
14690,
2232,
1027,
24040,
22081,
1012,
6123,
1012,
2131,
15069,
1006,
1007,
1025,
2065,
1006,
14690,
2232,
1012,
14704,
1006,
1011,
1015,
1007,
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... | |
fex-team/webuploader | _draft/music/webuploader.js | function( block ) {
var me = this,
file = block.file,
promise;
me.pool.push( block );
me.remaning++;
// 如果没有分片,则直接使用原始的。
// 不会丢失content-type信息。
block.blob = block.chunks === ... | javascript | function( block ) {
var me = this,
file = block.file,
promise;
me.pool.push( block );
me.remaning++;
// 如果没有分片,则直接使用原始的。
// 不会丢失content-type信息。
block.blob = block.chunks === ... | [
"function",
"(",
"block",
")",
"{",
"var",
"me",
"=",
"this",
",",
"file",
"=",
"block",
".",
"file",
",",
"promise",
";",
"me",
".",
"pool",
".",
"push",
"(",
"block",
")",
";",
"me",
".",
"remaning",
"++",
";",
"// 如果没有分片,则直接使用原始的。",
"// 不会丢失conten... | 开始上传,可以被掉过。如果promise被reject了,则表示跳过此分片。 | [
"开始上传,可以被掉过。如果promise被reject了,则表示跳过此分片。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/_draft/music/webuploader.js#L5007-L5047 | train | send a file to the server | [
30522,
3853,
1006,
3796,
1007,
1063,
13075,
2033,
1027,
2023,
1010,
5371,
1027,
3796,
1012,
5371,
1010,
4872,
1025,
2033,
1012,
4770,
1012,
5245,
1006,
3796,
1007,
1025,
2033,
1012,
2128,
20799,
3070,
1009,
1009,
1025,
1013,
1013,
100,
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/website/listSearchPaths.js | listSearchPaths | function listSearchPaths(output) {
var book = output.getBook();
var plugins = output.getPlugins();
var searchPaths = plugins
.valueSeq()
.map(function(plugin) {
return plugin.getPath();
})
.toList();
return searchPaths.unshift(book.getContentRoot());
} | javascript | function listSearchPaths(output) {
var book = output.getBook();
var plugins = output.getPlugins();
var searchPaths = plugins
.valueSeq()
.map(function(plugin) {
return plugin.getPath();
})
.toList();
return searchPaths.unshift(book.getContentRoot());
} | [
"function",
"listSearchPaths",
"(",
"output",
")",
"{",
"var",
"book",
"=",
"output",
".",
"getBook",
"(",
")",
";",
"var",
"plugins",
"=",
"output",
".",
"getPlugins",
"(",
")",
";",
"var",
"searchPaths",
"=",
"plugins",
".",
"valueSeq",
"(",
")",
"."... | List search paths for templates / i18n, etc
@param {Output} output
@return {List<String>} | [
"List",
"search",
"paths",
"for",
"templates",
"/",
"i18n",
"etc"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/website/listSearchPaths.js#L8-L20 | train | List all search paths | [
30522,
3853,
7201,
14644,
2818,
15069,
2015,
1006,
6434,
1007,
1063,
13075,
2338,
1027,
6434,
1012,
2131,
8654,
1006,
1007,
1025,
13075,
13354,
7076,
1027,
6434,
1012,
2131,
24759,
15916,
7076,
1006,
1007,
1025,
13075,
3945,
15069,
2015,
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... |
mui-org/material-ui | packages/material-ui/src/CssBaseline/CssBaseline.js | CssBaseline | function CssBaseline(props) {
const { children = null } = props;
useStyles();
return <React.Fragment>{children}</React.Fragment>;
} | javascript | function CssBaseline(props) {
const { children = null } = props;
useStyles();
return <React.Fragment>{children}</React.Fragment>;
} | [
"function",
"CssBaseline",
"(",
"props",
")",
"{",
"const",
"{",
"children",
"=",
"null",
"}",
"=",
"props",
";",
"useStyles",
"(",
")",
";",
"return",
"<",
"React",
".",
"Fragment",
">",
"{",
"children",
"}",
"<",
"/",
"React",
".",
"Fragment",
">",... | Kickstart an elegant, consistent, and simple baseline to build upon. | [
"Kickstart",
"an",
"elegant",
"consistent",
"and",
"simple",
"baseline",
"to",
"build",
"upon",
"."
] | 1555e52367835946382fbf2a8f681de71318915d | https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/packages/material-ui/src/CssBaseline/CssBaseline.js#L37-L41 | train | A component that uses the CSS baseline. | [
30522,
3853,
20116,
19022,
11022,
4179,
1006,
24387,
1007,
1063,
9530,
3367,
1063,
2336,
1027,
19701,
1065,
1027,
24387,
1025,
3594,
27983,
2015,
1006,
1007,
1025,
2709,
1026,
10509,
1012,
15778,
1028,
1063,
2336,
1065,
1026,
1013,
10509,
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/preferences/PreferencesBase.js | function () {
var self = this;
if (this._dirty) {
self._dirty = false;
return this.storage.save(this.data);
} else {
return (new $.Deferred()).resolve().promise();
}
} | javascript | function () {
var self = this;
if (this._dirty) {
self._dirty = false;
return this.storage.save(this.data);
} else {
return (new $.Deferred()).resolve().promise();
}
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"this",
".",
"_dirty",
")",
"{",
"self",
".",
"_dirty",
"=",
"false",
";",
"return",
"this",
".",
"storage",
".",
"save",
"(",
"this",
".",
"data",
")",
";",
"}",
"else",
"{... | Saves the prefs for this `Scope`.
@return {Promise} promise resolved once the data is saved. | [
"Saves",
"the",
"prefs",
"for",
"this",
"Scope",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L338-L346 | train | Save the data to the database | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2065,
1006,
2023,
1012,
1035,
6530,
1007,
1063,
2969,
1012,
1035,
6530,
1027,
6270,
1025,
2709,
2023,
1012,
5527,
1012,
3828,
1006,
2023,
1012,
2951,
1007,
1025,
1065,
2842,
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... | |
google/material-design-lite | src/mdlComponentHandler.js | upgradeElementInternal | function upgradeElementInternal(element, optJsClass) {
// Verify argument type.
if (!(typeof element === 'object' && element instanceof Element)) {
throw new Error('Invalid argument provided to upgrade MDL element.');
}
// Allow upgrade to be canceled by canceling emitted event.
var upgradingE... | javascript | function upgradeElementInternal(element, optJsClass) {
// Verify argument type.
if (!(typeof element === 'object' && element instanceof Element)) {
throw new Error('Invalid argument provided to upgrade MDL element.');
}
// Allow upgrade to be canceled by canceling emitted event.
var upgradingE... | [
"function",
"upgradeElementInternal",
"(",
"element",
",",
"optJsClass",
")",
"{",
"// Verify argument type.",
"if",
"(",
"!",
"(",
"typeof",
"element",
"===",
"'object'",
"&&",
"element",
"instanceof",
"Element",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"... | Upgrades a specific element rather than all in the DOM.
@param {!Element} element The element we wish to upgrade.
@param {string=} optJsClass Optional name of the class we want to upgrade
the element to. | [
"Upgrades",
"a",
"specific",
"element",
"rather",
"than",
"all",
"in",
"the",
"DOM",
"."
] | 60f441a22ed98ed2c03f6179adf460d888bf459f | https://github.com/google/material-design-lite/blob/60f441a22ed98ed2c03f6179adf460d888bf459f/src/mdlComponentHandler.js#L203-L260 | train | Upgrade an element to a new class. | [
30522,
3853,
12200,
12260,
3672,
18447,
11795,
2389,
1006,
5783,
1010,
23569,
22578,
26266,
1007,
1063,
1013,
1013,
20410,
6685,
2828,
1012,
2065,
1006,
999,
1006,
2828,
11253,
5783,
1027,
1027,
1027,
1005,
4874,
1005,
1004,
1004,
5783,
601... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ipfs/js-ipfs | src/core/components/resolve.js | resolve | function resolve (cid, path, callback) {
let value, remainderPath
doUntil(
(cb) => {
self.block.get(cid, (err, block) => {
if (err) return cb(err)
const r = self._ipld.resolvers[cid.codec]
if (!r) {
return cb(new Error(`No resolver found for codec "${cid... | javascript | function resolve (cid, path, callback) {
let value, remainderPath
doUntil(
(cb) => {
self.block.get(cid, (err, block) => {
if (err) return cb(err)
const r = self._ipld.resolvers[cid.codec]
if (!r) {
return cb(new Error(`No resolver found for codec "${cid... | [
"function",
"resolve",
"(",
"cid",
",",
"path",
",",
"callback",
")",
"{",
"let",
"value",
",",
"remainderPath",
"doUntil",
"(",
"(",
"cb",
")",
"=>",
"{",
"self",
".",
"block",
".",
"get",
"(",
"cid",
",",
"(",
"err",
",",
"block",
")",
"=>",
"{... | Resolve the given CID + path to a CID. | [
"Resolve",
"the",
"given",
"CID",
"+",
"path",
"to",
"a",
"CID",
"."
] | 97e67601094acda3906549ecb0248fd09f1a8cc3 | https://github.com/ipfs/js-ipfs/blob/97e67601094acda3906549ecb0248fd09f1a8cc3/src/core/components/resolve.js#L45-L88 | train | Resolves the given CID and path. | [
30522,
3853,
10663,
1006,
28744,
1010,
4130,
1010,
2655,
5963,
1007,
1063,
2292,
3643,
1010,
6893,
15069,
2079,
16671,
4014,
1006,
1006,
17324,
1007,
1027,
1028,
1063,
2969,
1012,
3796,
1012,
2131,
1006,
28744,
1010,
1006,
9413,
2099,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Configuration.js | function (mUnitMappings) {
// add custom units, or remove the existing ones if none are given
var mExistingUnits = this.getUnitMappings();
if (mExistingUnits){
mUnitMappings = jQuery.extend({}, mExistingUnits, mUnitMappings);
}
this.setUnitMappings(mUnitMappings);
return this;
} | javascript | function (mUnitMappings) {
// add custom units, or remove the existing ones if none are given
var mExistingUnits = this.getUnitMappings();
if (mExistingUnits){
mUnitMappings = jQuery.extend({}, mExistingUnits, mUnitMappings);
}
this.setUnitMappings(mUnitMappings);
return this;
} | [
"function",
"(",
"mUnitMappings",
")",
"{",
"// add custom units, or remove the existing ones if none are given",
"var",
"mExistingUnits",
"=",
"this",
".",
"getUnitMappings",
"(",
")",
";",
"if",
"(",
"mExistingUnits",
")",
"{",
"mUnitMappings",
"=",
"jQuery",
".",
"... | Adds unit mappings.
Similar to {@link sap.ui.core.Configuration#setUnitMappings} but instead of setting the unit mappings, it will add additional ones.
@param mUnitMappings {object} unit mappings
@return {sap.ui.core.Configuration.FormatSettings}
@see sap.ui.core.Configuration#setUnitMappings | [
"Adds",
"unit",
"mappings",
".",
"Similar",
"to",
"{"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Configuration.js#L1798-L1806 | train | Adds custom units to the unit list | [
30522,
3853,
1006,
14163,
3490,
29418,
14853,
2015,
1007,
1063,
1013,
1013,
5587,
7661,
3197,
1010,
2030,
6366,
1996,
4493,
3924,
2065,
3904,
2024,
2445,
13075,
2033,
9048,
16643,
3070,
19496,
3215,
1027,
2023,
1012,
2131,
19496,
29418,
148... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/jquery.sap.history.js | getNextSuffix | function getNextSuffix(sHash){
var sPath = sHash ? sHash : "";
if (isVirtualHash(sPath)) {
var iIndex = sPath.lastIndexOf(skipSuffix);
sPath = sPath.slice(0, iIndex);
}
return sPath + skipSuffix + skipIndex++;
} | javascript | function getNextSuffix(sHash){
var sPath = sHash ? sHash : "";
if (isVirtualHash(sPath)) {
var iIndex = sPath.lastIndexOf(skipSuffix);
sPath = sPath.slice(0, iIndex);
}
return sPath + skipSuffix + skipIndex++;
} | [
"function",
"getNextSuffix",
"(",
"sHash",
")",
"{",
"var",
"sPath",
"=",
"sHash",
"?",
"sHash",
":",
"\"\"",
";",
"if",
"(",
"isVirtualHash",
"(",
"sPath",
")",
")",
"{",
"var",
"iIndex",
"=",
"sPath",
".",
"lastIndexOf",
"(",
"skipSuffix",
")",
";",
... | This function returns a hash with suffix added to the end based on the sHash parameter. It handles as well when the current
hash is already with suffix. It returns a new suffix with a unique number in the end.
@private | [
"This",
"function",
"returns",
"a",
"hash",
"with",
"suffix",
"added",
"to",
"the",
"end",
"based",
"on",
"the",
"sHash",
"parameter",
".",
"It",
"handles",
"as",
"well",
"when",
"the",
"current",
"hash",
"is",
"already",
"with",
"suffix",
".",
"It",
"re... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/jquery.sap.history.js#L478-L487 | train | Returns the next suffix for the given hash | [
30522,
3853,
2131,
2638,
18413,
6342,
26989,
2595,
1006,
21146,
4095,
1007,
1063,
13075,
14690,
2232,
1027,
21146,
4095,
1029,
21146,
4095,
1024,
1000,
1000,
1025,
2065,
1006,
2003,
21663,
26302,
2140,
14949,
2232,
1006,
14690,
2232,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
grpc/grpc-node | packages/grpc-native-core/src/client_interceptors.js | function(providers, method_definition) {
if (!Array.isArray(providers)) {
return null;
}
var interceptors = [];
for (var i = 0; i < providers.length; i++) {
var provider = providers[i];
var interceptor = provider(method_definition);
if (interceptor) {
interceptors.push(interceptor);
}
... | javascript | function(providers, method_definition) {
if (!Array.isArray(providers)) {
return null;
}
var interceptors = [];
for (var i = 0; i < providers.length; i++) {
var provider = providers[i];
var interceptor = provider(method_definition);
if (interceptor) {
interceptors.push(interceptor);
}
... | [
"function",
"(",
"providers",
",",
"method_definition",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"providers",
")",
")",
"{",
"return",
"null",
";",
"}",
"var",
"interceptors",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";"... | Transforms a list of interceptor providers into interceptors.
@param {InterceptorProvider[]} providers
@param {grpc~MethodDefinition} method_definition
@return {null|Interceptor[]} | [
"Transforms",
"a",
"list",
"of",
"interceptor",
"providers",
"into",
"interceptors",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/client_interceptors.js#L354-L367 | train | Returns an array of interceptor functions | [
30522,
3853,
1006,
11670,
1010,
4118,
1035,
6210,
1007,
1063,
2065,
1006,
999,
9140,
1012,
18061,
11335,
2100,
1006,
11670,
1007,
30524,
11670,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
13075,
10802,
1027,
11670,
1031,
1045,
1033,
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... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | maybeParameter | function maybeParameter(sName, aOverloads) {
return aOverloads.some(function (oOverload) {
return oOverload.$Parameter && oOverload.$Parameter.some(function (oParameter) {
return oParameter.$Name === sName;
});
});
} | javascript | function maybeParameter(sName, aOverloads) {
return aOverloads.some(function (oOverload) {
return oOverload.$Parameter && oOverload.$Parameter.some(function (oParameter) {
return oParameter.$Name === sName;
});
});
} | [
"function",
"maybeParameter",
"(",
"sName",
",",
"aOverloads",
")",
"{",
"return",
"aOverloads",
".",
"some",
"(",
"function",
"(",
"oOverload",
")",
"{",
"return",
"oOverload",
".",
"$Parameter",
"&&",
"oOverload",
".",
"$Parameter",
".",
"some",
"(",
"func... | Tells whether the given name matches a parameter of at least one of the given overloads.
@param {string} sName
A path segment which maybe is a parameter name
@param {object[]} aOverloads
Operation overload(s)
@returns {boolean}
<code>true</code> iff at least one of the given overloads has a parameter with the given
na... | [
"Tells",
"whether",
"the",
"given",
"name",
"matches",
"a",
"parameter",
"of",
"at",
"least",
"one",
"of",
"the",
"given",
"overloads",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L256-L262 | train | Checks if a parameter is present in an overloads array | [
30522,
3853,
2672,
28689,
22828,
1006,
1055,
18442,
1010,
20118,
6299,
11066,
2015,
1007,
1063,
2709,
20118,
6299,
11066,
2015,
1012,
2070,
1006,
3853,
1006,
1051,
7840,
11066,
1007,
1063,
2709,
1051,
7840,
11066,
1012,
1002,
16381,
1004,
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... |
angular/material | src/core/services/gesture/gesture.js | runHandlers | function runHandlers(handlerEvent, event) {
var handler;
for (var name in HANDLERS) {
handler = HANDLERS[name];
if (handler instanceof $$MdGestureHandler) {
if (handlerEvent === 'start') {
// Run cancel to reset any handlers' state
handler.cancel();
}
han... | javascript | function runHandlers(handlerEvent, event) {
var handler;
for (var name in HANDLERS) {
handler = HANDLERS[name];
if (handler instanceof $$MdGestureHandler) {
if (handlerEvent === 'start') {
// Run cancel to reset any handlers' state
handler.cancel();
}
han... | [
"function",
"runHandlers",
"(",
"handlerEvent",
",",
"event",
")",
"{",
"var",
"handler",
";",
"for",
"(",
"var",
"name",
"in",
"HANDLERS",
")",
"{",
"handler",
"=",
"HANDLERS",
"[",
"name",
"]",
";",
"if",
"(",
"handler",
"instanceof",
"$$MdGestureHandler... | /*
When a DOM event happens, run all registered gesture handlers' lifecycle
methods which match the DOM event.
Eg when a 'touchstart' event happens, runHandlers('start') will call and
run `handler.cancel()` and `handler.start()` on all registered handlers. | [
"/",
"*",
"When",
"a",
"DOM",
"event",
"happens",
"run",
"all",
"registered",
"gesture",
"handlers",
"lifecycle",
"methods",
"which",
"match",
"the",
"DOM",
"event",
".",
"Eg",
"when",
"a",
"touchstart",
"event",
"happens",
"runHandlers",
"(",
"start",
")",
... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/gesture/gesture.js#L630-L644 | train | Run all handlers | [
30522,
3853,
2448,
11774,
12910,
1006,
28213,
18697,
3372,
1010,
2724,
1007,
1063,
13075,
28213,
1025,
2005,
1006,
13075,
2171,
1999,
28213,
2015,
1007,
1063,
28213,
1027,
28213,
2015,
1031,
2171,
1033,
1025,
2065,
1006,
28213,
6013,
11253,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sass/node-sass | lib/index.js | tryCallback | function tryCallback(callback, args) {
try {
return callback.apply(this, args);
} catch (e) {
if (typeof e === 'string') {
return new binding.types.Error(e);
} else if (e instanceof Error) {
return new binding.types.Error(e.message);
} else {
return new binding.types.Error('An unex... | javascript | function tryCallback(callback, args) {
try {
return callback.apply(this, args);
} catch (e) {
if (typeof e === 'string') {
return new binding.types.Error(e);
} else if (e instanceof Error) {
return new binding.types.Error(e.message);
} else {
return new binding.types.Error('An unex... | [
"function",
"tryCallback",
"(",
"callback",
",",
"args",
")",
"{",
"try",
"{",
"return",
"callback",
".",
"apply",
"(",
"this",
",",
"args",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"if",
"(",
"typeof",
"e",
"===",
"'string'",
")",
"{",
"return"... | Executes a callback and transforms any exception raised into a sass error
@param {Function} callback
@param {Array} arguments
@api private | [
"Executes",
"a",
"callback",
"and",
"transforms",
"any",
"exception",
"raised",
"into",
"a",
"sass",
"error"
] | 0c1a49eefa37544d16041c5fe5b2e3d9168004b7 | https://github.com/sass/node-sass/blob/0c1a49eefa37544d16041c5fe5b2e3d9168004b7/lib/index.js#L226-L238 | train | Try a callback | [
30522,
3853,
3046,
9289,
20850,
8684,
1006,
2655,
5963,
1010,
12098,
5620,
1007,
1063,
3046,
1063,
2709,
2655,
5963,
1012,
6611,
1006,
2023,
1010,
12098,
5620,
1007,
1025,
1065,
4608,
1006,
1041,
1007,
1063,
2065,
1006,
2828,
11253,
1041,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/chips/js/chipRemoveDirective.js | MdChipRemove | function MdChipRemove ($timeout) {
return {
restrict: 'A',
require: '^mdChips',
scope: false,
link: postLink
};
function postLink(scope, element, attr, ctrl) {
element.on('click', function(event) {
scope.$apply(function() {
ctrl.removeChip(scope.$$replacedScope.$index);
})... | javascript | function MdChipRemove ($timeout) {
return {
restrict: 'A',
require: '^mdChips',
scope: false,
link: postLink
};
function postLink(scope, element, attr, ctrl) {
element.on('click', function(event) {
scope.$apply(function() {
ctrl.removeChip(scope.$$replacedScope.$index);
})... | [
"function",
"MdChipRemove",
"(",
"$timeout",
")",
"{",
"return",
"{",
"restrict",
":",
"'A'",
",",
"require",
":",
"'^mdChips'",
",",
"scope",
":",
"false",
",",
"link",
":",
"postLink",
"}",
";",
"function",
"postLink",
"(",
"scope",
",",
"element",
","... | @ngdoc directive
@name mdChipRemove
@restrict A
@module material.components.chips
@description
Indicates that the associated element should be used as the delete button template for all chips.
The associated element must be a child of `md-chips`.
The provided button template will be appended to each chip and will rem... | [
"@ngdoc",
"directive",
"@name",
"mdChipRemove",
"@restrict",
"A",
"@module",
"material",
".",
"components",
".",
"chips"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/chips/js/chipRemoveDirective.js#L51-L73 | train | A directive to remove a Chip | [
30522,
3853,
9108,
5428,
28139,
5302,
3726,
1006,
1002,
2051,
5833,
1007,
1063,
2709,
1063,
21573,
1024,
1005,
1037,
1005,
1010,
5478,
1024,
1005,
1034,
9108,
5428,
4523,
1005,
1010,
9531,
1024,
6270,
1010,
4957,
1024,
2695,
13767,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/ExtensionUtils.js | loadFile | function loadFile(module, path) {
var url = PathUtils.isAbsoluteUrl(path) ? path : getModuleUrl(module, path),
promise = $.get(url);
return promise;
} | javascript | function loadFile(module, path) {
var url = PathUtils.isAbsoluteUrl(path) ? path : getModuleUrl(module, path),
promise = $.get(url);
return promise;
} | [
"function",
"loadFile",
"(",
"module",
",",
"path",
")",
"{",
"var",
"url",
"=",
"PathUtils",
".",
"isAbsoluteUrl",
"(",
"path",
")",
"?",
"path",
":",
"getModuleUrl",
"(",
"module",
",",
"path",
")",
",",
"promise",
"=",
"$",
".",
"get",
"(",
"url",... | Performs a GET request using a path relative to an extension module.
The resulting URL can be retrieved in the resolve callback by accessing
@param {!module} module Module provided by RequireJS
@param {!string} path Relative path from the extension folder to a file
@return {!$.Promise} A promise object that is resolv... | [
"Performs",
"a",
"GET",
"request",
"using",
"a",
"path",
"relative",
"to",
"an",
"extension",
"module",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ExtensionUtils.js#L176-L181 | train | Load a file from the cache | [
30522,
3853,
7170,
8873,
2571,
1006,
11336,
1010,
4130,
1007,
1063,
13075,
24471,
2140,
1027,
4130,
21823,
4877,
1012,
18061,
5910,
4747,
10421,
3126,
2140,
1006,
4130,
1007,
1029,
4130,
1024,
2131,
5302,
8566,
2571,
3126,
2140,
1006,
11336... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
grpc/grpc | examples/node/static_codegen/route_guide/route_guide_server.js | routeChat | function routeChat(call) {
call.on('data', function(note) {
var key = pointKey(note.getLocation());
/* For each note sent, respond with all previous notes that correspond to
* the same point */
if (route_notes.hasOwnProperty(key)) {
_.each(route_notes[key], function(note) {
call.write(n... | javascript | function routeChat(call) {
call.on('data', function(note) {
var key = pointKey(note.getLocation());
/* For each note sent, respond with all previous notes that correspond to
* the same point */
if (route_notes.hasOwnProperty(key)) {
_.each(route_notes[key], function(note) {
call.write(n... | [
"function",
"routeChat",
"(",
"call",
")",
"{",
"call",
".",
"on",
"(",
"'data'",
",",
"function",
"(",
"note",
")",
"{",
"var",
"key",
"=",
"pointKey",
"(",
"note",
".",
"getLocation",
"(",
")",
")",
";",
"/* For each note sent, respond with all previous no... | routeChat handler. Receives a stream of message/location pairs, and responds
with a stream of all previous messages at each of those locations.
@param {Duplex} call The stream for incoming and outgoing messages | [
"routeChat",
"handler",
".",
"Receives",
"a",
"stream",
"of",
"message",
"/",
"location",
"pairs",
"and",
"responds",
"with",
"a",
"stream",
"of",
"all",
"previous",
"messages",
"at",
"each",
"of",
"those",
"locations",
"."
] | cc75d93818410e2b0edd0fa3009a6def9ac403ca | https://github.com/grpc/grpc/blob/cc75d93818410e2b0edd0fa3009a6def9ac403ca/examples/node/static_codegen/route_guide/route_guide_server.js#L184-L202 | train | routeChat - Sends all notes sent to the specified call | [
30522,
3853,
2799,
7507,
2102,
1006,
2655,
1007,
1063,
2655,
1012,
2006,
1006,
1005,
2951,
1005,
1010,
3853,
1006,
3602,
1007,
1063,
13075,
3145,
1027,
2391,
14839,
1006,
3602,
1012,
2131,
4135,
10719,
1006,
1007,
1007,
1025,
1013,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
typeorm/typeorm | extra/typeorm-class-transformer-shim.js | OneToMany | function OneToMany(typeFunction, inverseSideOrOptions, options) {
return function (object, propertyName) {
class_transformer_1.Type(typeFunction)(object, propertyName);
};
} | javascript | function OneToMany(typeFunction, inverseSideOrOptions, options) {
return function (object, propertyName) {
class_transformer_1.Type(typeFunction)(object, propertyName);
};
} | [
"function",
"OneToMany",
"(",
"typeFunction",
",",
"inverseSideOrOptions",
",",
"options",
")",
"{",
"return",
"function",
"(",
"object",
",",
"propertyName",
")",
"{",
"class_transformer_1",
".",
"Type",
"(",
"typeFunction",
")",
"(",
"object",
",",
"propertyNa... | /* export | [
"/",
"*",
"export"
] | 360468b7913db8d988346fba1ee2d3f323498eef | https://github.com/typeorm/typeorm/blob/360468b7913db8d988346fba1ee2d3f323498eef/extra/typeorm-class-transformer-shim.js#L154-L158 | train | OneToMany is a helper function for creating a new one - to - many relation. | [
30522,
3853,
2028,
20389,
19092,
1006,
2828,
11263,
27989,
1010,
19262,
7363,
14604,
16790,
2015,
1010,
7047,
1007,
1063,
2709,
3853,
1006,
4874,
1010,
3200,
18442,
1007,
1063,
2465,
1035,
10938,
2121,
1035,
1015,
1012,
2828,
1006,
2828,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
caolan/async | lib/detect.js | detect | function detect(coll, iteratee, callback) {
return createTester(bool => bool, (res, item) => item)(eachOf, coll, iteratee, callback)
} | javascript | function detect(coll, iteratee, callback) {
return createTester(bool => bool, (res, item) => item)(eachOf, coll, iteratee, callback)
} | [
"function",
"detect",
"(",
"coll",
",",
"iteratee",
",",
"callback",
")",
"{",
"return",
"createTester",
"(",
"bool",
"=>",
"bool",
",",
"(",
"res",
",",
"item",
")",
"=>",
"item",
")",
"(",
"eachOf",
",",
"coll",
",",
"iteratee",
",",
"callback",
")... | Returns the first value in `coll` that passes an async truth test. The
`iteratee` is applied in parallel, meaning the first iteratee to return
`true` will fire the detect `callback` with that result. That means the
result might not be the first item in the original `coll` (in terms of order)
that passes the test.
If o... | [
"Returns",
"the",
"first",
"value",
"in",
"coll",
"that",
"passes",
"an",
"async",
"truth",
"test",
".",
"The",
"iteratee",
"is",
"applied",
"in",
"parallel",
"meaning",
"the",
"first",
"iteratee",
"to",
"return",
"true",
"will",
"fire",
"the",
"detect",
"... | 4330d536c106592139fa82062494c9dba0da1fdb | https://github.com/caolan/async/blob/4330d536c106592139fa82062494c9dba0da1fdb/lib/detect.js#L41-L43 | train | Detects if a collection contains items. | [
30522,
3853,
11487,
1006,
8902,
2140,
1010,
2009,
22139,
2063,
1010,
2655,
5963,
1007,
1063,
2709,
3443,
22199,
2121,
1006,
22017,
2140,
1027,
1028,
22017,
2140,
1010,
1006,
24501,
1010,
8875,
1007,
1027,
1028,
8875,
1007,
1006,
2169,
11253... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-extra-boolean-cast.js | isInBooleanContext | function isInBooleanContext(node, parent) {
return (
(BOOLEAN_NODE_TYPES.indexOf(parent.type) !== -1 &&
node === parent.test) ||
// !<bool>
(parent.type === "UnaryExpression" &&
parent.operator === "!")
);
... | javascript | function isInBooleanContext(node, parent) {
return (
(BOOLEAN_NODE_TYPES.indexOf(parent.type) !== -1 &&
node === parent.test) ||
// !<bool>
(parent.type === "UnaryExpression" &&
parent.operator === "!")
);
... | [
"function",
"isInBooleanContext",
"(",
"node",
",",
"parent",
")",
"{",
"return",
"(",
"(",
"BOOLEAN_NODE_TYPES",
".",
"indexOf",
"(",
"parent",
".",
"type",
")",
"!==",
"-",
"1",
"&&",
"node",
"===",
"parent",
".",
"test",
")",
"||",
"// !<bool>",
"(",
... | Check if a node is in a context where its value would be coerced to a boolean at runtime.
@param {Object} node The node
@param {Object} parent Its parent
@returns {boolean} If it is in a boolean context | [
"Check",
"if",
"a",
"node",
"is",
"in",
"a",
"context",
"where",
"its",
"value",
"would",
"be",
"coerced",
"to",
"a",
"boolean",
"at",
"runtime",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-extra-boolean-cast.js#L57-L66 | train | Check if the node is in boolean context | [
30522,
3853,
2003,
2378,
5092,
9890,
2319,
8663,
18209,
1006,
13045,
1010,
6687,
1007,
1063,
2709,
1006,
1006,
22017,
20898,
1035,
13045,
1035,
4127,
1012,
5950,
11253,
1006,
6687,
1012,
2828,
1007,
999,
1027,
1027,
1011,
1015,
1004,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | parse_fonts | function parse_fonts(t, styles, themes, opts) {
styles.Fonts = [];
var font = {};
var pass = false;
t[0].match(tagregex).forEach(function(x) {
var y = parsexmltag(x);
switch(strip_ns(y[0])) {
case '<fonts': case '<fonts>': case '</fonts>': break;
/* 18.8.22 font CT_Font */
case '<font': case '<font>':... | javascript | function parse_fonts(t, styles, themes, opts) {
styles.Fonts = [];
var font = {};
var pass = false;
t[0].match(tagregex).forEach(function(x) {
var y = parsexmltag(x);
switch(strip_ns(y[0])) {
case '<fonts': case '<fonts>': case '</fonts>': break;
/* 18.8.22 font CT_Font */
case '<font': case '<font>':... | [
"function",
"parse_fonts",
"(",
"t",
",",
"styles",
",",
"themes",
",",
"opts",
")",
"{",
"styles",
".",
"Fonts",
"=",
"[",
"]",
";",
"var",
"font",
"=",
"{",
"}",
";",
"var",
"pass",
"=",
"false",
";",
"t",
"[",
"0",
"]",
".",
"match",
"(",
... | /* 18.8.23 fonts CT_Fonts | [
"/",
"*",
"18",
".",
"8",
".",
"23",
"fonts",
"CT_Fonts"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L8740-L8853 | train | Parse the XML fonts | [
30522,
3853,
11968,
3366,
1035,
15489,
2015,
1006,
1056,
1010,
6782,
1010,
6991,
1010,
23569,
2015,
1007,
1063,
6782,
1012,
15489,
2015,
1027,
1031,
1033,
1025,
13075,
15489,
1027,
1063,
1065,
1025,
13075,
3413,
1027,
6270,
1025,
1056,
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... |
goldfire/howler.js | dist/howler.js | function(event, id, msg) {
var self = this;
var events = self['_on' + event];
// Loop through event store and fire all functions.
for (var i=events.length-1; i>=0; i--) {
// Only fire the listener if the correct ID is used.
if (!events[i].id || events[i].id === id || event === '... | javascript | function(event, id, msg) {
var self = this;
var events = self['_on' + event];
// Loop through event store and fire all functions.
for (var i=events.length-1; i>=0; i--) {
// Only fire the listener if the correct ID is used.
if (!events[i].id || events[i].id === id || event === '... | [
"function",
"(",
"event",
",",
"id",
",",
"msg",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"events",
"=",
"self",
"[",
"'_on'",
"+",
"event",
"]",
";",
"// Loop through event store and fire all functions.",
"for",
"(",
"var",
"i",
"=",
"events",
... | Emit all events of a specific type and pass the sound id.
@param {String} event Event name.
@param {Number} id Sound ID.
@param {Number} msg Message to go with event.
@return {Howl} | [
"Emit",
"all",
"events",
"of",
"a",
"specific",
"type",
"and",
"pass",
"the",
"sound",
"id",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L1848-L1871 | train | Fires all functions for a specific event | [
30522,
3853,
1006,
2724,
1010,
8909,
1010,
5796,
2290,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
2824,
1027,
2969,
1031,
1005,
1035,
2006,
1005,
1009,
2724,
1033,
1025,
1013,
1013,
7077,
2083,
2724,
3573,
1998,
2543,
2035,
4972,
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... | |
angular/angular | tools/gulp-tasks/cldr/extract.js | generateLocaleExtra | function generateLocaleExtra(locale, localeData) {
const dayPeriods = getDayPeriodsNoAmPm(localeData);
const dayPeriodRules = getDayPeriodRules(localeData);
let dayPeriodsSupplemental = [];
if (Object.keys(dayPeriods.format.narrow).length) {
const keys = Object.keys(dayPeriods.format.narrow);
if (key... | javascript | function generateLocaleExtra(locale, localeData) {
const dayPeriods = getDayPeriodsNoAmPm(localeData);
const dayPeriodRules = getDayPeriodRules(localeData);
let dayPeriodsSupplemental = [];
if (Object.keys(dayPeriods.format.narrow).length) {
const keys = Object.keys(dayPeriods.format.narrow);
if (key... | [
"function",
"generateLocaleExtra",
"(",
"locale",
",",
"localeData",
")",
"{",
"const",
"dayPeriods",
"=",
"getDayPeriodsNoAmPm",
"(",
"localeData",
")",
";",
"const",
"dayPeriodRules",
"=",
"getDayPeriodRules",
"(",
"localeData",
")",
";",
"let",
"dayPeriodsSupplem... | Generate a file that contains extra data (for now: day period rules, and extended day period data) | [
"Generate",
"a",
"file",
"that",
"contains",
"extra",
"data",
"(",
"for",
"now",
":",
"day",
"period",
"rules",
"and",
"extended",
"day",
"period",
"data",
")"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/gulp-tasks/cldr/extract.js#L122-L157 | train | Generate extra information for a locale | [
30522,
3853,
9699,
4135,
9289,
4402,
18413,
2527,
1006,
2334,
2063,
1010,
2334,
11960,
2696,
1007,
1063,
9530,
3367,
2154,
4842,
3695,
5104,
1027,
2131,
10259,
4842,
3695,
5104,
3630,
16613,
2213,
1006,
2334,
11960,
30524,
2154,
4842,
3695,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | spring | function spring(tension, friction, duration) {
if (duration === 0) {
// can't get a spring w/ duration 0
return easings.linear; // duration 0 => jump to end so impl doesn't matter
}
var spring = generateSpringRK4(tension, friction, duration);
return function (start, end, percent) {
re... | javascript | function spring(tension, friction, duration) {
if (duration === 0) {
// can't get a spring w/ duration 0
return easings.linear; // duration 0 => jump to end so impl doesn't matter
}
var spring = generateSpringRK4(tension, friction, duration);
return function (start, end, percent) {
re... | [
"function",
"spring",
"(",
"tension",
",",
"friction",
",",
"duration",
")",
"{",
"if",
"(",
"duration",
"===",
"0",
")",
"{",
"// can't get a spring w/ duration 0",
"return",
"easings",
".",
"linear",
";",
"// duration 0 => jump to end so impl doesn't matter",
"}",
... | user param easings... | [
"user",
"param",
"easings",
"..."
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L12947-L12957 | train | Returns a function that will return a spring function that will return a number | [
30522,
3853,
3500,
1006,
6980,
1010,
15012,
1010,
9367,
1007,
1063,
2065,
1006,
9367,
1027,
1027,
1027,
1014,
1007,
1063,
1013,
1013,
2064,
1005,
1056,
2131,
1037,
3500,
1059,
1013,
9367,
1014,
2709,
24070,
2015,
1012,
7399,
1025,
1013,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-mixed-operators.js | shouldIgnore | function shouldIgnore(node) {
const a = node;
const b = node.parent;
return (
!includesBothInAGroup(options.groups, a.operator, b.operator) ||
(
options.allowSamePrecedence &&
astUtils.getPrecedence(a) === astUt... | javascript | function shouldIgnore(node) {
const a = node;
const b = node.parent;
return (
!includesBothInAGroup(options.groups, a.operator, b.operator) ||
(
options.allowSamePrecedence &&
astUtils.getPrecedence(a) === astUt... | [
"function",
"shouldIgnore",
"(",
"node",
")",
"{",
"const",
"a",
"=",
"node",
";",
"const",
"b",
"=",
"node",
".",
"parent",
";",
"return",
"(",
"!",
"includesBothInAGroup",
"(",
"options",
".",
"groups",
",",
"a",
".",
"operator",
",",
"b",
".",
"op... | Checks whether a given node should be ignored by options or not.
@param {ASTNode} node - A node to check. This is a BinaryExpression
node or a LogicalExpression node. This parent node is one of
them, too.
@returns {boolean} `true` if the node should be ignored. | [
"Checks",
"whether",
"a",
"given",
"node",
"should",
"be",
"ignored",
"by",
"options",
"or",
"not",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-mixed-operators.js#L119-L130 | train | Check if node should be ignored | [
30522,
3853,
2323,
23773,
5686,
1006,
13045,
1007,
1063,
9530,
3367,
1037,
1027,
13045,
1025,
9530,
3367,
1038,
1027,
13045,
1012,
6687,
1025,
2709,
1006,
999,
2950,
18384,
10606,
8490,
22107,
1006,
7047,
1012,
2967,
1010,
1037,
1012,
6872,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
uber/deck.gl | examples/experimental/bezier/src/bezier-graph-layer.js | layoutGraph | function layoutGraph(graph) {
// create a map for referencing node position by node id.
const nodePositionMap = graph.nodes.reduce((res, node) => {
res[node.id] = node.position;
return res;
}, {});
// bucket edges between the same source/target node pairs.
const nodePairs = graph.edges.reduce((res, ed... | javascript | function layoutGraph(graph) {
// create a map for referencing node position by node id.
const nodePositionMap = graph.nodes.reduce((res, node) => {
res[node.id] = node.position;
return res;
}, {});
// bucket edges between the same source/target node pairs.
const nodePairs = graph.edges.reduce((res, ed... | [
"function",
"layoutGraph",
"(",
"graph",
")",
"{",
"// create a map for referencing node position by node id.",
"const",
"nodePositionMap",
"=",
"graph",
".",
"nodes",
".",
"reduce",
"(",
"(",
"res",
",",
"node",
")",
"=>",
"{",
"res",
"[",
"node",
".",
"id",
... | A helper function to generate a graph with curved edges.
@param {Object} graph - {nodes: [], edges: []}
expected input format: {
nodes: [{id: 'a', position: [0, -100]}, {id: 'b', position: [0, 100]}, ...],
edges: [{id: '1', sourceId: 'a',, targetId: 'b',}, ...]
}
@return {Object} Return new graph with curved edges.
ex... | [
"A",
"helper",
"function",
"to",
"generate",
"a",
"graph",
"with",
"curved",
"edges",
"."
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/examples/experimental/bezier/src/bezier-graph-layer.js#L80-L133 | train | Layouts the graph. | [
30522,
3853,
9621,
14413,
1006,
10629,
1007,
1063,
1013,
1013,
3443,
1037,
4949,
2005,
28789,
13045,
2597,
2011,
13045,
8909,
1012,
9530,
3367,
13045,
26994,
2863,
2361,
1027,
10629,
1012,
14164,
1012,
5547,
1006,
1006,
24501,
1010,
13045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/radioButton/radio-button.js | mdRadioButtonDirective | function mdRadioButtonDirective($mdAria, $mdUtil, $mdTheming) {
var CHECKED_CSS = 'md-checked';
return {
restrict: 'E',
require: '^mdRadioGroup',
transclude: true,
template: '<div class="md-container" md-ink-ripple md-ink-ripple-checkbox>' +
'<div class="md-off"></div>' +
... | javascript | function mdRadioButtonDirective($mdAria, $mdUtil, $mdTheming) {
var CHECKED_CSS = 'md-checked';
return {
restrict: 'E',
require: '^mdRadioGroup',
transclude: true,
template: '<div class="md-container" md-ink-ripple md-ink-ripple-checkbox>' +
'<div class="md-off"></div>' +
... | [
"function",
"mdRadioButtonDirective",
"(",
"$mdAria",
",",
"$mdUtil",
",",
"$mdTheming",
")",
"{",
"var",
"CHECKED_CSS",
"=",
"'md-checked'",
";",
"return",
"{",
"restrict",
":",
"'E'",
",",
"require",
":",
"'^mdRadioGroup'",
",",
"transclude",
":",
"true",
",... | @ngdoc directive
@module material.components.radioButton
@name mdRadioButton
@restrict E
@description
The `<md-radio-button>`directive is the child directive required to be used within `<md-radio-group>` elements.
While similar to the `<input type="radio" ng-model="" value="">` directive,
the `<md-radio-button>` dir... | [
"@ngdoc",
"directive",
"@module",
"material",
".",
"components",
".",
"radioButton",
"@name",
"mdRadioButton"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/radioButton/radio-button.js#L246-L345 | train | A directive that can be used to create a radio button. | [
30522,
3853,
9108,
12173,
3695,
8569,
15474,
4305,
2890,
15277,
1006,
1002,
9108,
10980,
1010,
1002,
9108,
30524,
2709,
1063,
21573,
1024,
1005,
1041,
1005,
1010,
5478,
1024,
1005,
1034,
9108,
12173,
3695,
17058,
1005,
1010,
9099,
20464,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 (vControl, oAppComponent, bSuppressLogging) {
if (!oAppComponent) {
vControl = vControl instanceof ManagedObject ? vControl : sap.ui.getCore().byId(vControl);
oAppComponent = Utils.getAppComponentForControl(vControl);
}
return BaseTreeModifier.checkControlId(vControl, oAppComponent, bSuppressL... | javascript | function (vControl, oAppComponent, bSuppressLogging) {
if (!oAppComponent) {
vControl = vControl instanceof ManagedObject ? vControl : sap.ui.getCore().byId(vControl);
oAppComponent = Utils.getAppComponentForControl(vControl);
}
return BaseTreeModifier.checkControlId(vControl, oAppComponent, bSuppressL... | [
"function",
"(",
"vControl",
",",
"oAppComponent",
",",
"bSuppressLogging",
")",
"{",
"if",
"(",
"!",
"oAppComponent",
")",
"{",
"vControl",
"=",
"vControl",
"instanceof",
"ManagedObject",
"?",
"vControl",
":",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
"... | See {@link sap.ui.core.BaseTreeModifier#checkControlId} method | [
"See",
"{"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L850-L856 | train | Checks if the control is a child of an app component | [
30522,
3853,
1006,
18315,
12162,
13153,
1010,
1051,
29098,
9006,
29513,
3372,
1010,
18667,
6279,
20110,
21197,
4726,
1007,
1063,
2065,
1006,
999,
1051,
29098,
9006,
29513,
3372,
1007,
1063,
18315,
12162,
13153,
1027,
18315,
12162,
13153,
6013... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | wrapMethod | function wrapMethod (obj, methodName, derivedObj, baseObj) {
var derivedMethod = derivedObj[methodName];
var baseMethod = baseObj[methodName];
// Derived prototype does not define method, no need to wrap.
if (!derivedMethod || !baseMethod) { return; }
// Derived prototype doesn't override the one in the bas... | javascript | function wrapMethod (obj, methodName, derivedObj, baseObj) {
var derivedMethod = derivedObj[methodName];
var baseMethod = baseObj[methodName];
// Derived prototype does not define method, no need to wrap.
if (!derivedMethod || !baseMethod) { return; }
// Derived prototype doesn't override the one in the bas... | [
"function",
"wrapMethod",
"(",
"obj",
",",
"methodName",
",",
"derivedObj",
",",
"baseObj",
")",
"{",
"var",
"derivedMethod",
"=",
"derivedObj",
"[",
"methodName",
"]",
";",
"var",
"baseMethod",
"=",
"baseObj",
"[",
"methodName",
"]",
";",
"// Derived prototyp... | Wrap one method to ensure that the one in the base prototype is called before
the one in the derived one.
@param {object} obj - Object that will contain the wrapped method.
@param {string} methodName - The name of the method that will be wrapped.
@param {object} derivedObject - Object that inherits from the baseObj.
@... | [
"Wrap",
"one",
"method",
"to",
"ensure",
"that",
"the",
"one",
"in",
"the",
"base",
"prototype",
"is",
"called",
"before",
"the",
"one",
"in",
"the",
"derived",
"one",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/a-register-element.js#L146-L164 | train | Wrap a method in the derived prototype | [
30522,
3853,
10236,
11368,
6806,
2094,
1006,
27885,
3501,
1010,
4118,
18442,
1010,
5173,
16429,
3501,
1010,
2918,
16429,
3501,
1007,
1063,
30524,
1013,
5173,
8773,
2515,
2025,
9375,
4118,
1010,
2053,
2342,
2000,
10236,
1012,
2065,
1006,
999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
LLK/scratch-blocks | blocks_vertical/motion.js | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_dropdown",
"name": "TO",
"options": [
[Blockly.Msg.MOTION_GOTO_POINTER, '_mouse_'],
[Blockly.Msg.MOTION_GOTO_RANDOM, '_random_']
]
}
],
"... | javascript | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_dropdown",
"name": "TO",
"options": [
[Blockly.Msg.MOTION_GOTO_POINTER, '_mouse_'],
[Blockly.Msg.MOTION_GOTO_RANDOM, '_random_']
]
}
],
"... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"\"%1\"",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"TO\"",
",",
"\"options\"",
":",
"[",
"[",
"Blockly",
".",
"Msg",... | Go to drop-down menu.
@this Blockly.Block | [
"Go",
"to",
"drop",
"-",
"down",
"menu",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/motion.js#L174-L192 | train | Block for
. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
1000,
1003,
1015,
1000,
1010,
1000,
12098,
5620,
2692,
1000,
1024,
1031,
1063,
1000,
2828,
1000,
1024,
1000,
2492,
1035,
4530,
76... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
uber/deck.gl | modules/layers/src/icon-layer/icon-manager.js | buildRowMapping | function buildRowMapping(mapping, columns, yOffset) {
for (let i = 0; i < columns.length; i++) {
const {icon, xOffset} = columns[i];
const id = getIconId(icon);
mapping[id] = Object.assign({}, icon, {
x: xOffset,
y: yOffset
});
}
} | javascript | function buildRowMapping(mapping, columns, yOffset) {
for (let i = 0; i < columns.length; i++) {
const {icon, xOffset} = columns[i];
const id = getIconId(icon);
mapping[id] = Object.assign({}, icon, {
x: xOffset,
y: yOffset
});
}
} | [
"function",
"buildRowMapping",
"(",
"mapping",
",",
"columns",
",",
"yOffset",
")",
"{",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"columns",
".",
"length",
";",
"i",
"++",
")",
"{",
"const",
"{",
"icon",
",",
"xOffset",
"}",
"=",
"columns",... | traverse icons in a row of icon atlas extend each icon with left-top coordinates | [
"traverse",
"icons",
"in",
"a",
"row",
"of",
"icon",
"atlas",
"extend",
"each",
"icon",
"with",
"left",
"-",
"top",
"coordinates"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/layers/src/icon-layer/icon-manager.js#L46-L55 | train | Build a row mapping from a list of icons | [
30522,
3853,
3857,
10524,
2863,
14853,
1006,
12375,
1010,
7753,
1010,
10930,
21807,
3388,
1007,
1063,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026,
7753,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
9530,
3367,
1063,
12696,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/JavaScriptCodeHints/main.js | setCachedHintContext | function setCachedHintContext(hints, cursor, type, token) {
cachedHints = hints;
cachedCursor = cursor;
cachedType = type;
cachedToken = token;
} | javascript | function setCachedHintContext(hints, cursor, type, token) {
cachedHints = hints;
cachedCursor = cursor;
cachedType = type;
cachedToken = token;
} | [
"function",
"setCachedHintContext",
"(",
"hints",
",",
"cursor",
",",
"type",
",",
"token",
")",
"{",
"cachedHints",
"=",
"hints",
";",
"cachedCursor",
"=",
"cursor",
";",
"cachedType",
"=",
"type",
";",
"cachedToken",
"=",
"token",
";",
"}"
] | Cache the hints and the hint's context.
@param {Array.<string>} hints - array of hints
@param {{line:number, ch:number}} cursor - the location where the hints
were created.
@param {{property: boolean,
showFunctionType:boolean,
context: string,
functionCallPos: {line:number, ch:number}}} type -
type information about t... | [
"Cache",
"the",
"hints",
"and",
"the",
"hint",
"s",
"context",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptCodeHints/main.js#L325-L330 | train | Sets the context for the hint cache | [
30522,
3853,
2275,
3540,
7690,
10606,
13535,
28040,
18413,
1006,
20385,
1010,
12731,
25301,
2099,
1010,
2828,
1010,
19204,
1007,
1063,
17053,
19114,
7666,
1027,
20385,
1025,
17053,
16409,
9236,
2953,
1027,
12731,
25301,
2099,
1025,
17053,
119... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | matches | function matches(query, ele) {
return query.checks.every(function (chk) {
return match[chk.type](chk, ele);
});
} | javascript | function matches(query, ele) {
return query.checks.every(function (chk) {
return match[chk.type](chk, ele);
});
} | [
"function",
"matches",
"(",
"query",
",",
"ele",
")",
"{",
"return",
"query",
".",
"checks",
".",
"every",
"(",
"function",
"(",
"chk",
")",
"{",
"return",
"match",
"[",
"chk",
".",
"type",
"]",
"(",
"chk",
",",
"ele",
")",
";",
"}",
")",
";",
... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | [
"Returns",
"whether",
"the",
"query",
"matches",
"for",
"the",
"element"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L7460-L7464 | train | Check if the element matches the query | [
30522,
3853,
3503,
1006,
23032,
1010,
3449,
2063,
1007,
1063,
2709,
23032,
1012,
14148,
1012,
2296,
1006,
3853,
1006,
10381,
2243,
1007,
1063,
2709,
2674,
1031,
10381,
2243,
1012,
2828,
1033,
1006,
10381,
2243,
1010,
3449,
2063,
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... |
pixijs/pixi.js | packages/prepare/src/BasePrepare.js | findBaseTexture | function findBaseTexture(item, queue)
{
// Objects with textures, like Sprites/Text
if (item instanceof BaseTexture)
{
if (queue.indexOf(item) === -1)
{
queue.push(item);
}
return true;
}
return false;
} | javascript | function findBaseTexture(item, queue)
{
// Objects with textures, like Sprites/Text
if (item instanceof BaseTexture)
{
if (queue.indexOf(item) === -1)
{
queue.push(item);
}
return true;
}
return false;
} | [
"function",
"findBaseTexture",
"(",
"item",
",",
"queue",
")",
"{",
"// Objects with textures, like Sprites/Text",
"if",
"(",
"item",
"instanceof",
"BaseTexture",
")",
"{",
"if",
"(",
"queue",
".",
"indexOf",
"(",
"item",
")",
"===",
"-",
"1",
")",
"{",
"que... | Built-in hook to find BaseTextures from Sprites.
@private
@param {PIXI.DisplayObject} item - Display object to check
@param {Array<*>} queue - Collection of items to upload
@return {boolean} if a PIXI.Texture object was found. | [
"Built",
"-",
"in",
"hook",
"to",
"find",
"BaseTextures",
"from",
"Sprites",
"."
] | 99ae03b7565ae7ca5a6de633b0a277f7128fa4d0 | https://github.com/pixijs/pixi.js/blob/99ae03b7565ae7ca5a6de633b0a277f7128fa4d0/packages/prepare/src/BasePrepare.js#L356-L370 | train | Find BaseTexture in the queue | [
30522,
3853,
2424,
15058,
18209,
5397,
1006,
8875,
1010,
24240,
1007,
1063,
1013,
1013,
5200,
2007,
29343,
1010,
2066,
11867,
28884,
1013,
3793,
2065,
1006,
8875,
6013,
11253,
2918,
18209,
5397,
1007,
1063,
2065,
1006,
24240,
1012,
5950,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.