repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
adobe/brackets | src/language/HTMLTokenizer.js | Tokenizer | function Tokenizer(text) {
this._state = TEXT;
this._buffer = text;
this._sectionStart = 0;
this._sectionStartPos = {line: 0, ch: 0};
this._index = 0;
this._indexPos = {line: 0, ch: 0};
this._special = 0; // 1 for script, 2 for style
this._token = null;
... | javascript | function Tokenizer(text) {
this._state = TEXT;
this._buffer = text;
this._sectionStart = 0;
this._sectionStartPos = {line: 0, ch: 0};
this._index = 0;
this._indexPos = {line: 0, ch: 0};
this._special = 0; // 1 for script, 2 for style
this._token = null;
... | [
"function",
"Tokenizer",
"(",
"text",
")",
"{",
"this",
".",
"_state",
"=",
"TEXT",
";",
"this",
".",
"_buffer",
"=",
"text",
";",
"this",
".",
"_sectionStart",
"=",
"0",
";",
"this",
".",
"_sectionStartPos",
"=",
"{",
"line",
":",
"0",
",",
"ch",
... | A simple HTML tokenizer. See the description of nextToken() for usage details.
@constructor
@param {string} text The HTML document to tokenize. | [
"A",
"simple",
"HTML",
"tokenizer",
".",
"See",
"the",
"description",
"of",
"nextToken",
"()",
"for",
"usage",
"details",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLTokenizer.js#L149-L159 | train | A tokenizer that can be used to parse a text | [
30522,
3853,
19204,
17629,
1006,
3793,
1007,
1063,
2023,
1012,
1035,
2110,
1027,
3793,
1025,
2023,
1012,
1035,
17698,
1027,
3793,
1025,
2023,
1012,
1035,
5433,
7559,
2102,
1027,
1014,
1025,
2023,
1012,
1035,
5433,
7559,
25856,
2891,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableAccExtension.js | function(oInfo) {
var sDesc = oInfo.type + " " + oInfo.description;
if (oInfo.enabled === false) {
sDesc = sDesc + " " + TableUtils.getResourceText("TBL_CTRL_STATE_DISABLED");
} else if (oInfo.editable === false) {
sDesc = sDesc + " " + TableUtils.getResourceText("TBL_CTRL_STATE_READONLY");
}
ret... | javascript | function(oInfo) {
var sDesc = oInfo.type + " " + oInfo.description;
if (oInfo.enabled === false) {
sDesc = sDesc + " " + TableUtils.getResourceText("TBL_CTRL_STATE_DISABLED");
} else if (oInfo.editable === false) {
sDesc = sDesc + " " + TableUtils.getResourceText("TBL_CTRL_STATE_READONLY");
}
ret... | [
"function",
"(",
"oInfo",
")",
"{",
"var",
"sDesc",
"=",
"oInfo",
".",
"type",
"+",
"\" \"",
"+",
"oInfo",
".",
"description",
";",
"if",
"(",
"oInfo",
".",
"enabled",
"===",
"false",
")",
"{",
"sDesc",
"=",
"sDesc",
"+",
"\" \"",
"+",
"TableUtils",
... | /*
Returns the full control description incl. control type and enabled/editable state based
on the information of the given acc info object
Note: The description does not include the description of the children (if available). | [
"/",
"*",
"Returns",
"the",
"full",
"control",
"description",
"incl",
".",
"control",
"type",
"and",
"enabled",
"/",
"editable",
"state",
"based",
"on",
"the",
"information",
"of",
"the",
"given",
"acc",
"info",
"object",
"Note",
":",
"The",
"description",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableAccExtension.js#L107-L115 | train | Returns the description of the control | [
30522,
3853,
1006,
1051,
2378,
14876,
1007,
1063,
13075,
17371,
2229,
2278,
1027,
1051,
2378,
14876,
1012,
2828,
1009,
1000,
1000,
1009,
1051,
2378,
14876,
1012,
6412,
1025,
2065,
1006,
1051,
2378,
14876,
1012,
9124,
1027,
1027,
1027,
6270,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/search/FindInFiles.js | function () {
function filter(file) {
return _subtreeFilter(file, null) && _isReadableText(file.fullPath);
}
FindUtils.setInstantSearchDisabled(true);
//we always listen for filesytem changes.
_addListeners();
if (!PreferencesManager.get("findInFiles.nodeSea... | javascript | function () {
function filter(file) {
return _subtreeFilter(file, null) && _isReadableText(file.fullPath);
}
FindUtils.setInstantSearchDisabled(true);
//we always listen for filesytem changes.
_addListeners();
if (!PreferencesManager.get("findInFiles.nodeSea... | [
"function",
"(",
")",
"{",
"function",
"filter",
"(",
"file",
")",
"{",
"return",
"_subtreeFilter",
"(",
"file",
",",
"null",
")",
"&&",
"_isReadableText",
"(",
"file",
".",
"fullPath",
")",
";",
"}",
"FindUtils",
".",
"setInstantSearchDisabled",
"(",
"tru... | On project change, inform node about the new list of files that needs to be crawled.
Instant search is also disabled for the time being till the crawl is complete in node. | [
"On",
"project",
"change",
"inform",
"node",
"about",
"the",
"new",
"list",
"of",
"files",
"that",
"needs",
"to",
"be",
"crawled",
".",
"Instant",
"search",
"is",
"also",
"disabled",
"for",
"the",
"time",
"being",
"till",
"the",
"crawl",
"is",
"complete",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L916-L944 | train | Find in files. nodeSearch is not disabled. | [
30522,
3853,
1006,
1007,
1063,
3853,
11307,
1006,
5371,
1007,
1063,
2709,
1035,
4942,
13334,
8873,
21928,
1006,
5371,
1010,
19701,
1007,
1004,
1004,
1035,
2003,
16416,
20782,
18209,
1006,
5371,
1012,
2440,
15069,
1007,
1025,
1065,
2424,
218... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
nhn/tui.editor | src/js/extensions/chart/chart.js | parseCode2ChartOption | function parseCode2ChartOption(optionCode) {
const reservedKeys = ['type', 'url'];
let options = {};
if (util.isUndefined(optionCode)) {
return options;
}
const optionLines = optionCode.split(REGEX_LINE_ENDING);
optionLines.forEach(line => {
let [keyString, ...values] = line.split(OPTION_DELIMITER)... | javascript | function parseCode2ChartOption(optionCode) {
const reservedKeys = ['type', 'url'];
let options = {};
if (util.isUndefined(optionCode)) {
return options;
}
const optionLines = optionCode.split(REGEX_LINE_ENDING);
optionLines.forEach(line => {
let [keyString, ...values] = line.split(OPTION_DELIMITER)... | [
"function",
"parseCode2ChartOption",
"(",
"optionCode",
")",
"{",
"const",
"reservedKeys",
"=",
"[",
"'type'",
",",
"'url'",
"]",
";",
"let",
"options",
"=",
"{",
"}",
";",
"if",
"(",
"util",
".",
"isUndefined",
"(",
"optionCode",
")",
")",
"{",
"return"... | parse option code
@param {string} optionCode - option code
@returns {Object} - tui.chart option string
@see https://nhn.github.io/tui.chart/latest/tui.chart.html
@ignore | [
"parse",
"option",
"code"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/chart/chart.js#L242-L287 | train | Parse chart option code | [
30522,
3853,
11968,
3366,
16044,
2475,
7507,
5339,
7361,
3508,
1006,
5724,
16044,
1007,
1063,
9530,
3367,
9235,
14839,
2015,
1027,
1031,
1005,
2828,
1005,
1010,
1005,
24471,
2140,
1005,
1033,
1025,
2292,
7047,
1027,
1063,
1065,
1025,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
uber/deck.gl | modules/jupyter-widget/src/plugin.js | activateWidgetExtension | function activateWidgetExtension(app, registry) {
registry.registerWidget({
name: MODULE_NAME,
version: MODULE_VERSION,
exports: {
DeckGLModel,
DeckGLView
}
});
} | javascript | function activateWidgetExtension(app, registry) {
registry.registerWidget({
name: MODULE_NAME,
version: MODULE_VERSION,
exports: {
DeckGLModel,
DeckGLView
}
});
} | [
"function",
"activateWidgetExtension",
"(",
"app",
",",
"registry",
")",
"{",
"registry",
".",
"registerWidget",
"(",
"{",
"name",
":",
"MODULE_NAME",
",",
"version",
":",
"MODULE_VERSION",
",",
"exports",
":",
"{",
"DeckGLModel",
",",
"DeckGLView",
"}",
"}",
... | Registers the widget with the Jupyter notebook | [
"Registers",
"the",
"widget",
"with",
"the",
"Jupyter",
"notebook"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/jupyter-widget/src/plugin.js#L21-L30 | train | Activate the widget extension | [
30522,
3853,
20544,
9148,
24291,
10288,
29048,
1006,
10439,
1010,
15584,
1007,
1063,
15584,
1012,
4236,
9148,
24291,
1006,
1063,
2171,
1024,
11336,
1035,
2171,
1010,
2544,
1024,
11336,
1035,
2544,
1010,
14338,
1024,
1063,
5877,
23296,
5302,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/dialog/dialog.js | stretchDialogContainerToViewport | function stretchDialogContainerToViewport(container, options) {
var isFixed = $window.getComputedStyle($document[0].body).position == 'fixed';
var backdrop = options.backdrop ? $window.getComputedStyle(options.backdrop[0]) : null;
var height = backdrop ? Math.min($document[0].body.clientHeight, Math.c... | javascript | function stretchDialogContainerToViewport(container, options) {
var isFixed = $window.getComputedStyle($document[0].body).position == 'fixed';
var backdrop = options.backdrop ? $window.getComputedStyle(options.backdrop[0]) : null;
var height = backdrop ? Math.min($document[0].body.clientHeight, Math.c... | [
"function",
"stretchDialogContainerToViewport",
"(",
"container",
",",
"options",
")",
"{",
"var",
"isFixed",
"=",
"$window",
".",
"getComputedStyle",
"(",
"$document",
"[",
"0",
"]",
".",
"body",
")",
".",
"position",
"==",
"'fixed'",
";",
"var",
"backdrop",
... | Ensure the dialog container fill-stretches to the viewport | [
"Ensure",
"the",
"dialog",
"container",
"fill",
"-",
"stretches",
"to",
"the",
"viewport"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1195-L1219 | train | Stretch the dialog container to the viewport | [
30522,
3853,
7683,
27184,
8649,
8663,
18249,
8743,
4492,
2666,
2860,
6442,
1006,
11661,
1010,
7047,
1007,
1063,
13075,
2003,
23901,
1027,
1002,
3332,
1012,
2131,
9006,
29462,
21756,
2571,
1006,
1002,
6254,
1031,
1014,
1033,
1012,
2303,
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... |
graphql/graphql-js | resources/benchmark.js | prepareAndRunBenchmarks | function prepareAndRunBenchmarks(benchmarkPatterns, revisions) {
// Find all benchmark tests to be run.
let benchmarks = findFiles(LOCAL_DIR('src'), '*/__tests__/*-benchmark.js');
if (benchmarkPatterns.length !== 0) {
benchmarks = benchmarks.filter(benchmark =>
benchmarkPatterns.some(pattern =>
... | javascript | function prepareAndRunBenchmarks(benchmarkPatterns, revisions) {
// Find all benchmark tests to be run.
let benchmarks = findFiles(LOCAL_DIR('src'), '*/__tests__/*-benchmark.js');
if (benchmarkPatterns.length !== 0) {
benchmarks = benchmarks.filter(benchmark =>
benchmarkPatterns.some(pattern =>
... | [
"function",
"prepareAndRunBenchmarks",
"(",
"benchmarkPatterns",
",",
"revisions",
")",
"{",
"// Find all benchmark tests to be run.",
"let",
"benchmarks",
"=",
"findFiles",
"(",
"LOCAL_DIR",
"(",
"'src'",
")",
",",
"'*/__tests__/*-benchmark.js'",
")",
";",
"if",
"(",
... | Prepare all revisions and run benchmarks matching a pattern against them. | [
"Prepare",
"all",
"revisions",
"and",
"run",
"benchmarks",
"matching",
"a",
"pattern",
"against",
"them",
"."
] | b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef | https://github.com/graphql/graphql-js/blob/b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef/resources/benchmark.js#L187-L211 | train | Run benchmarks matching the given benchmark patterns | [
30522,
3853,
7374,
5685,
15532,
10609,
2818,
27373,
1006,
6847,
10665,
4502,
12079,
3619,
1010,
24699,
1007,
1063,
1013,
1013,
2424,
2035,
6847,
10665,
5852,
2000,
2022,
2448,
1012,
2292,
6847,
27373,
1027,
2424,
8873,
4244,
1006,
2334,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nfarina/homebridge | example-plugins/homebridge-samplePlatform/index.js | SamplePlatform | function SamplePlatform(log, config, api) {
log("SamplePlatform Init");
var platform = this;
this.log = log;
this.config = config;
this.accessories = [];
this.requestServer = http.createServer(function(request, response) {
if (request.url === "/add") {
this.addAccessory(new Date().toISOString());... | javascript | function SamplePlatform(log, config, api) {
log("SamplePlatform Init");
var platform = this;
this.log = log;
this.config = config;
this.accessories = [];
this.requestServer = http.createServer(function(request, response) {
if (request.url === "/add") {
this.addAccessory(new Date().toISOString());... | [
"function",
"SamplePlatform",
"(",
"log",
",",
"config",
",",
"api",
")",
"{",
"log",
"(",
"\"SamplePlatform Init\"",
")",
";",
"var",
"platform",
"=",
"this",
";",
"this",
".",
"log",
"=",
"log",
";",
"this",
".",
"config",
"=",
"config",
";",
"this",... | Platform constructor config may be null api may be null if launched from old homebridge version | [
"Platform",
"constructor",
"config",
"may",
"be",
"null",
"api",
"may",
"be",
"null",
"if",
"launched",
"from",
"old",
"homebridge",
"version"
] | 724125dc1b500dfd81048a30a1e3229ff122189a | https://github.com/nfarina/homebridge/blob/724125dc1b500dfd81048a30a1e3229ff122189a/example-plugins/homebridge-samplePlatform/index.js#L23-L65 | train | SamplePlatform constructor. | [
30522,
3853,
7099,
24759,
4017,
14192,
1006,
8833,
1010,
9530,
8873,
2290,
1010,
17928,
1007,
1063,
8833,
1006,
1000,
7099,
24759,
4017,
14192,
1999,
4183,
1000,
1007,
1025,
13075,
4132,
1027,
2023,
1025,
2023,
1012,
8833,
1027,
8833,
1025,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.f/src/sap/f/shellBar/ResponsiveHandler.js | function (oContext) {
oControl = oContext;
// Get and calculate padding's
this._iREMSize = parseInt(jQuery("body").css("font-size"));
this._iChildControlMargin = parseInt(Parameters.get("_sap_f_ShellBar_ChildMargin"));
this._iDoubleChildControlMargin = this._iChildControlMargin * 2;
this._iCoPilotWidth = p... | javascript | function (oContext) {
oControl = oContext;
// Get and calculate padding's
this._iREMSize = parseInt(jQuery("body").css("font-size"));
this._iChildControlMargin = parseInt(Parameters.get("_sap_f_ShellBar_ChildMargin"));
this._iDoubleChildControlMargin = this._iChildControlMargin * 2;
this._iCoPilotWidth = p... | [
"function",
"(",
"oContext",
")",
"{",
"oControl",
"=",
"oContext",
";",
"// Get and calculate padding's",
"this",
".",
"_iREMSize",
"=",
"parseInt",
"(",
"jQuery",
"(",
"\"body\"",
")",
".",
"css",
"(",
"\"font-size\"",
")",
")",
";",
"this",
".",
"_iChildC... | Class taking care of the control responsive behaviour.
@alias sap/f/shellBar/ResponsiveHandler
@since 1.63
@private
@property {object} oContext the context of the ShellBar control instance | [
"Class",
"taking",
"care",
"of",
"the",
"control",
"responsive",
"behaviour",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.f/src/sap/f/shellBar/ResponsiveHandler.js#L29-L53 | train | Initializes the ShellBar | [
30522,
3853,
1006,
1051,
8663,
18209,
1007,
1063,
1051,
8663,
13181,
2140,
1027,
1051,
8663,
18209,
1025,
1013,
1013,
2131,
1998,
18422,
11687,
4667,
1005,
1055,
2023,
1012,
1035,
20868,
6633,
5332,
4371,
1027,
11968,
20240,
3372,
1006,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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() {
var sCalendarPreference = this._get("calendarPreference"),
aCalendars = sCalendarPreference ? sCalendarPreference.split(" ") : [],
sCalendarName, sType, i;
for ( i = 0 ; i < aCalendars.length ; i++ ) {
// No support for calendar subtypes (islamic) yet, so ignore part after -
sCalenda... | javascript | function() {
var sCalendarPreference = this._get("calendarPreference"),
aCalendars = sCalendarPreference ? sCalendarPreference.split(" ") : [],
sCalendarName, sType, i;
for ( i = 0 ; i < aCalendars.length ; i++ ) {
// No support for calendar subtypes (islamic) yet, so ignore part after -
sCalenda... | [
"function",
"(",
")",
"{",
"var",
"sCalendarPreference",
"=",
"this",
".",
"_get",
"(",
"\"calendarPreference\"",
")",
",",
"aCalendars",
"=",
"sCalendarPreference",
"?",
"sCalendarPreference",
".",
"split",
"(",
"\" \"",
")",
":",
"[",
"]",
",",
"sCalendarNam... | Returns the preferred calendar type for the current locale which exists in {@link sap.ui.core.CalendarType}
@returns {sap.ui.core.CalendarType} the preferred calendar type
@public
@since 1.28.6 | [
"Returns",
"the",
"preferred",
"calendar",
"type",
"for",
"the",
"current",
"locale",
"which",
"exists",
"in",
"{",
"@link",
"sap",
".",
"ui",
".",
"core",
".",
"CalendarType",
"}"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L1522-L1538 | train | Returns the calendar type for the current calendar | [
30522,
3853,
1006,
1007,
1063,
13075,
4094,
8943,
14536,
2890,
25523,
1027,
2023,
1012,
1035,
2131,
1006,
1000,
8094,
28139,
25523,
1000,
1007,
1010,
9353,
9453,
8943,
2869,
1027,
4094,
8943,
14536,
2890,
25523,
1029,
4094,
8943,
14536,
289... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/43_sstbin.js | parse_sst_bin | function parse_sst_bin(data, opts)/*:SST*/ {
var s/*:SST*/ = ([]/*:any*/);
var pass = false;
recordhopper(data, function hopper_sst(val, R_n, RT) {
switch(RT) {
case 0x009F: /* 'BrtBeginSst' */
s.Count = val[0]; s.Unique = val[1]; break;
case 0x0013: /* 'BrtSSTItem' */
s.push(val); break;
case 0x0... | javascript | function parse_sst_bin(data, opts)/*:SST*/ {
var s/*:SST*/ = ([]/*:any*/);
var pass = false;
recordhopper(data, function hopper_sst(val, R_n, RT) {
switch(RT) {
case 0x009F: /* 'BrtBeginSst' */
s.Count = val[0]; s.Unique = val[1]; break;
case 0x0013: /* 'BrtSSTItem' */
s.push(val); break;
case 0x0... | [
"function",
"parse_sst_bin",
"(",
"data",
",",
"opts",
")",
"/*:SST*/",
"{",
"var",
"s",
"/*:SST*/",
"=",
"(",
"[",
"]",
"/*:any*/",
")",
";",
"var",
"pass",
"=",
"false",
";",
"recordhopper",
"(",
"data",
",",
"function",
"hopper_sst",
"(",
"val",
","... | /* [MS-XLSB] 2.1.7.45 Shared Strings | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"1",
".",
"7",
".",
"45",
"Shared",
"Strings"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/43_sstbin.js#L7-L31 | train | Parse SST record | [
30522,
3853,
11968,
3366,
1035,
7020,
2102,
1035,
8026,
1006,
2951,
1010,
23569,
2015,
1007,
1013,
1008,
1024,
7020,
2102,
1008,
1013,
1063,
13075,
1055,
1013,
1008,
1024,
7020,
2102,
1008,
1013,
1027,
1006,
1031,
1033,
1013,
1008,
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... |
caolan/async | lib/each.js | eachLimit | function eachLimit(coll, iteratee, callback) {
return eachOf(coll, withoutIndex(wrapAsync(iteratee)), callback);
} | javascript | function eachLimit(coll, iteratee, callback) {
return eachOf(coll, withoutIndex(wrapAsync(iteratee)), callback);
} | [
"function",
"eachLimit",
"(",
"coll",
",",
"iteratee",
",",
"callback",
")",
"{",
"return",
"eachOf",
"(",
"coll",
",",
"withoutIndex",
"(",
"wrapAsync",
"(",
"iteratee",
")",
")",
",",
"callback",
")",
";",
"}"
] | Applies the function `iteratee` to each item in `coll`, in parallel.
The `iteratee` is called with an item from the list, and a callback for when
it has finished. If the `iteratee` passes an error to its `callback`, the
main `callback` (for the `each` function) is immediately called with the
error.
Note, that since th... | [
"Applies",
"the",
"function",
"iteratee",
"to",
"each",
"item",
"in",
"coll",
"in",
"parallel",
".",
"The",
"iteratee",
"is",
"called",
"with",
"an",
"item",
"from",
"the",
"list",
"and",
"a",
"callback",
"for",
"when",
"it",
"has",
"finished",
".",
"If"... | 4330d536c106592139fa82062494c9dba0da1fdb | https://github.com/caolan/async/blob/4330d536c106592139fa82062494c9dba0da1fdb/lib/each.js#L64-L66 | train | Iterates over collection and returns an array of items. | [
30522,
3853,
2169,
17960,
4183,
1006,
8902,
2140,
1010,
2009,
22139,
2063,
1010,
2655,
5963,
1007,
1063,
2709,
2169,
11253,
1006,
8902,
2140,
1010,
2302,
22254,
10288,
1006,
10236,
3022,
6038,
2278,
1006,
2009,
22139,
2063,
1007,
1007,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
summernote/summernote | src/js/base/core/lists.js | next | function next(array, item) {
if (array && array.length && item) {
const idx = array.indexOf(item);
return idx === -1 ? null : array[idx + 1];
}
return null;
} | javascript | function next(array, item) {
if (array && array.length && item) {
const idx = array.indexOf(item);
return idx === -1 ? null : array[idx + 1];
}
return null;
} | [
"function",
"next",
"(",
"array",
",",
"item",
")",
"{",
"if",
"(",
"array",
"&&",
"array",
".",
"length",
"&&",
"item",
")",
"{",
"const",
"idx",
"=",
"array",
".",
"indexOf",
"(",
"item",
")",
";",
"return",
"idx",
"===",
"-",
"1",
"?",
"null",... | returns next item.
@param {Array} array | [
"returns",
"next",
"item",
"."
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/lists.js#L163-L169 | train | Returns the next item in an array of | [
30522,
3853,
2279,
1006,
9140,
1010,
8875,
1007,
1063,
2065,
1006,
9140,
1004,
1004,
9140,
1012,
3091,
1004,
1004,
8875,
1007,
1063,
9530,
3367,
8909,
2595,
1027,
9140,
1012,
5950,
11253,
1006,
8875,
1007,
1025,
2709,
8909,
2595,
1027,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/InAppNotifications/main.js | _getNotificationInformation | function _getNotificationInformation(_notificationInfoUrl) {
// Last time the versionInfoURL was fetched
var lastInfoURLFetchTime = PreferencesManager.getViewState("lastNotificationURLFetchTime");
var result = new $.Deferred();
var fetchData = false;
var data;
// If we ... | javascript | function _getNotificationInformation(_notificationInfoUrl) {
// Last time the versionInfoURL was fetched
var lastInfoURLFetchTime = PreferencesManager.getViewState("lastNotificationURLFetchTime");
var result = new $.Deferred();
var fetchData = false;
var data;
// If we ... | [
"function",
"_getNotificationInformation",
"(",
"_notificationInfoUrl",
")",
"{",
"// Last time the versionInfoURL was fetched",
"var",
"lastInfoURLFetchTime",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"\"lastNotificationURLFetchTime\"",
")",
";",
"var",
"result",
"=... | Get a data structure that has information for all Brackets targeted notifications.
_notificationInfoUrl is used for unit testing. | [
"Get",
"a",
"data",
"structure",
"that",
"has",
"information",
"for",
"all",
"Brackets",
"targeted",
"notifications",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InAppNotifications/main.js#L71-L149 | train | Get the notification information from the remote server | [
30522,
3853,
1035,
2131,
17048,
9031,
2378,
14192,
3370,
1006,
1035,
26828,
2378,
14876,
3126,
2140,
1007,
1063,
1013,
1013,
2197,
2051,
1996,
2544,
2378,
14876,
3126,
2140,
2001,
18584,
2098,
30524,
10270,
3388,
10143,
14428,
1027,
18394,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/node/selenium-webdriver/lib/http.js | buildPath | function buildPath(path, parameters) {
let pathParameters = path.match(/\/:(\w+)\b/g);
if (pathParameters) {
for (let i = 0; i < pathParameters.length; ++i) {
let key = pathParameters[i].substring(2); // Trim the /:
if (key in parameters) {
let value = parameters[key];
if (WebElemen... | javascript | function buildPath(path, parameters) {
let pathParameters = path.match(/\/:(\w+)\b/g);
if (pathParameters) {
for (let i = 0; i < pathParameters.length; ++i) {
let key = pathParameters[i].substring(2); // Trim the /:
if (key in parameters) {
let value = parameters[key];
if (WebElemen... | [
"function",
"buildPath",
"(",
"path",
",",
"parameters",
")",
"{",
"let",
"pathParameters",
"=",
"path",
".",
"match",
"(",
"/",
"\\/:(\\w+)\\b",
"/",
"g",
")",
";",
"if",
"(",
"pathParameters",
")",
"{",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
... | Builds a fully qualified path using the given set of command parameters. Each
path segment prefixed with ':' will be replaced by the value of the
corresponding parameter. All parameters spliced into the path will be
removed from the parameter map.
@param {string} path The original resource path.
@param {!Object<*>} par... | [
"Builds",
"a",
"fully",
"qualified",
"path",
"using",
"the",
"given",
"set",
"of",
"command",
"parameters",
".",
"Each",
"path",
"segment",
"prefixed",
"with",
":",
"will",
"be",
"replaced",
"by",
"the",
"value",
"of",
"the",
"corresponding",
"parameter",
".... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/lib/http.js#L593-L614 | train | Build a path from the parameters | [
30522,
3853,
3857,
15069,
1006,
4130,
1010,
11709,
1007,
1063,
2292,
4130,
28689,
22828,
2015,
1027,
4130,
1012,
2674,
1006,
1013,
1032,
1013,
1024,
1006,
1032,
1059,
1009,
1007,
1032,
1038,
1013,
1043,
1007,
1025,
2065,
1006,
4130,
28689,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function(sName) {
var sLabel = "";
// remove leading 'P_' often used for parameter properties on HANA
sLabel = sName.replace(/^P_(.*)/, "$1");
// split UpperCamelCase in words (treat numbers and _ as upper case)
sLabel = sLabel.replace(/([^A-Z0-9_]+)([A-Z0-9_])/g, "$1 $2");
// split acronyms in words... | javascript | function(sName) {
var sLabel = "";
// remove leading 'P_' often used for parameter properties on HANA
sLabel = sName.replace(/^P_(.*)/, "$1");
// split UpperCamelCase in words (treat numbers and _ as upper case)
sLabel = sLabel.replace(/([^A-Z0-9_]+)([A-Z0-9_])/g, "$1 $2");
// split acronyms in words... | [
"function",
"(",
"sName",
")",
"{",
"var",
"sLabel",
"=",
"\"\"",
";",
"// remove leading 'P_' often used for parameter properties on HANA",
"sLabel",
"=",
"sName",
".",
"replace",
"(",
"/",
"^P_(.*)",
"/",
",",
"\"$1\"",
")",
";",
"// split UpperCamelCase in words (t... | /*
Old helpers that got replaced by robust functions provided by the UI5 ODataModel
/*
renderPropertyKeyValue : function(sKeyValue, sPropertyEDMTypeName) {
if (typeof sKeyValue == "string" && sKeyValue.charAt(0) == "'")
throw "Illegal property value starting with a quote";
switch (sPropertyEDMTypeName) {
case 'Edm.Str... | [
"/",
"*",
"Old",
"helpers",
"that",
"got",
"replaced",
"by",
"robust",
"functions",
"provided",
"by",
"the",
"UI5",
"ODataModel",
"/",
"*",
"renderPropertyKeyValue",
":",
"function",
"(",
"sKeyValue",
"sPropertyEDMTypeName",
")",
"{",
"if",
"(",
"typeof",
"sKe... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L127-L141 | train | returns the label of the given name | [
30522,
3853,
1006,
1055,
18442,
1007,
1063,
13075,
17584,
2884,
1027,
1000,
1000,
1025,
1013,
1013,
6366,
2877,
1005,
1052,
1035,
1005,
2411,
2109,
2005,
16381,
5144,
2006,
26048,
17584,
2884,
1027,
1055,
18442,
1012,
5672,
1006,
1013,
1034... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | read_bits_n | function read_bits_n(buf, bl, n) {
var w = (bl&7), h = (bl>>>3), f = ((1<<n)-1);
var v = buf[h] >>> w;
if(n < 8 - w) return v & f;
v |= buf[h+1]<<(8-w);
if(n < 16 - w) return v & f;
v |= buf[h+2]<<(16-w);
if(n < 24 - w) return v & f;
v |= buf[h+3]<<(24-w);
return v & f;
} | javascript | function read_bits_n(buf, bl, n) {
var w = (bl&7), h = (bl>>>3), f = ((1<<n)-1);
var v = buf[h] >>> w;
if(n < 8 - w) return v & f;
v |= buf[h+1]<<(8-w);
if(n < 16 - w) return v & f;
v |= buf[h+2]<<(16-w);
if(n < 24 - w) return v & f;
v |= buf[h+3]<<(24-w);
return v & f;
} | [
"function",
"read_bits_n",
"(",
"buf",
",",
"bl",
",",
"n",
")",
"{",
"var",
"w",
"=",
"(",
"bl",
"&",
"7",
")",
",",
"h",
"=",
"(",
"bl",
">>>",
"3",
")",
",",
"f",
"=",
"(",
"(",
"1",
"<<",
"n",
")",
"-",
"1",
")",
";",
"var",
"v",
... | /* works up to n = 3 * 8 + 1 = 25 | [
"/",
"*",
"works",
"up",
"to",
"n",
"=",
"3",
"*",
"8",
"+",
"1",
"=",
"25"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L2006-L2016 | train | read n bits from buffer | [
30522,
3853,
3191,
1035,
9017,
1035,
1050,
1006,
20934,
2546,
1010,
1038,
2140,
1010,
1050,
1007,
1063,
13075,
1059,
1027,
1006,
1038,
2140,
1004,
1021,
1007,
1010,
1044,
1027,
1006,
1038,
2140,
1028,
1028,
1028,
1017,
1007,
1010,
1042,
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... |
aframevr/aframe | src/systems/material.js | function (src, data, cb) {
var texture;
texture = new THREE.CanvasTexture(src);
setTextureProperties(texture, data);
cb(texture);
} | javascript | function (src, data, cb) {
var texture;
texture = new THREE.CanvasTexture(src);
setTextureProperties(texture, data);
cb(texture);
} | [
"function",
"(",
"src",
",",
"data",
",",
"cb",
")",
"{",
"var",
"texture",
";",
"texture",
"=",
"new",
"THREE",
".",
"CanvasTexture",
"(",
"src",
")",
";",
"setTextureProperties",
"(",
"texture",
",",
"data",
")",
";",
"cb",
"(",
"texture",
")",
";"... | High-level function for loading canvas textures (THREE.Texture).
@param {Element|string} src - Texture source.
@param {object} data - Texture data.
@param {function} cb - Callback to pass texture to. | [
"High",
"-",
"level",
"function",
"for",
"loading",
"canvas",
"textures",
"(",
"THREE",
".",
"Texture",
")",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/systems/material.js#L101-L106 | train | Create a texture from a canvas | [
30522,
3853,
1006,
5034,
2278,
1010,
2951,
1010,
17324,
1007,
1063,
13075,
14902,
1025,
14902,
1027,
2047,
2093,
1012,
10683,
18209,
5397,
1006,
5034,
2278,
1007,
1025,
2275,
18209,
5397,
21572,
4842,
7368,
1006,
14902,
1010,
2951,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/gridList/grid-list.js | function() {
return {
tileCount: tileSpans.length,
layoutTime: layoutTime,
mapTime: mapTime,
reflowTime: reflowTime,
totalTime: layoutTime + mapTime + reflowTime
};
} | javascript | function() {
return {
tileCount: tileSpans.length,
layoutTime: layoutTime,
mapTime: mapTime,
reflowTime: reflowTime,
totalTime: layoutTime + mapTime + reflowTime
};
} | [
"function",
"(",
")",
"{",
"return",
"{",
"tileCount",
":",
"tileSpans",
".",
"length",
",",
"layoutTime",
":",
"layoutTime",
",",
"mapTime",
":",
"mapTime",
",",
"reflowTime",
":",
"reflowTime",
",",
"totalTime",
":",
"layoutTime",
"+",
"mapTime",
"+",
"r... | Timing for the most recent layout run. | [
"Timing",
"for",
"the",
"most",
"recent",
"layout",
"run",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/gridList/grid-list.js#L527-L535 | train | get
| [
30522,
3853,
1006,
1007,
1063,
2709,
1063,
14090,
3597,
16671,
1024,
13262,
9739,
2015,
1012,
3091,
1010,
9621,
7292,
1024,
9621,
7292,
1010,
4949,
7292,
1024,
4949,
7292,
1010,
25416,
8261,
7292,
1024,
25416,
8261,
7292,
1010,
2561,
7292,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
facebook/relay | packages/relay-compiler/core/GraphQLSchemaUtils.js | hasID | function hasID(schema: GraphQLSchema, type: GraphQLCompositeType): boolean {
const unmodifiedType = getRawType(type);
invariant(
unmodifiedType instanceof GraphQLObjectType ||
unmodifiedType instanceof GraphQLInterfaceType,
'GraphQLSchemaUtils.hasID(): Expected a concrete type or interface, ' +
... | javascript | function hasID(schema: GraphQLSchema, type: GraphQLCompositeType): boolean {
const unmodifiedType = getRawType(type);
invariant(
unmodifiedType instanceof GraphQLObjectType ||
unmodifiedType instanceof GraphQLInterfaceType,
'GraphQLSchemaUtils.hasID(): Expected a concrete type or interface, ' +
... | [
"function",
"hasID",
"(",
"schema",
":",
"GraphQLSchema",
",",
"type",
":",
"GraphQLCompositeType",
")",
":",
"boolean",
"{",
"const",
"unmodifiedType",
"=",
"getRawType",
"(",
"type",
")",
";",
"invariant",
"(",
"unmodifiedType",
"instanceof",
"GraphQLObjectType"... | Implements duck typing that checks whether a type has an id field of the ID
type. This is approximating what we can hopefully do with the __id proposal
a bit more cleanly. | [
"Implements",
"duck",
"typing",
"that",
"checks",
"whether",
"a",
"type",
"has",
"an",
"id",
"field",
"of",
"the",
"ID",
"type",
".",
"This",
"is",
"approximating",
"what",
"we",
"can",
"hopefully",
"do",
"with",
"the",
"__id",
"proposal",
"a",
"bit",
"m... | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/core/GraphQLSchemaUtils.js#L87-L99 | train | Returns true if the given type has an ID field. | [
30522,
3853,
2038,
3593,
1006,
8040,
28433,
1024,
10629,
4160,
4877,
5403,
2863,
1010,
2828,
1024,
10629,
4160,
22499,
8737,
20049,
22513,
18863,
1007,
1024,
22017,
20898,
1063,
9530,
3367,
4895,
5302,
4305,
10451,
13874,
1027,
2131,
2527,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/interimElement/interimElement.js | startAutoHide | function startAutoHide() {
var autoHideTimer, cancelAutoHide = angular.noop;
if (options.hideDelay) {
autoHideTimer = $timeout(service.hide, options.hideDelay) ;
cancelAutoHide = function() {
$timeout.cancel(autoHideTimer);
};
}
... | javascript | function startAutoHide() {
var autoHideTimer, cancelAutoHide = angular.noop;
if (options.hideDelay) {
autoHideTimer = $timeout(service.hide, options.hideDelay) ;
cancelAutoHide = function() {
$timeout.cancel(autoHideTimer);
};
}
... | [
"function",
"startAutoHide",
"(",
")",
"{",
"var",
"autoHideTimer",
",",
"cancelAutoHide",
"=",
"angular",
".",
"noop",
";",
"if",
"(",
"options",
".",
"hideDelay",
")",
"{",
"autoHideTimer",
"=",
"$timeout",
"(",
"service",
".",
"hide",
",",
"options",
".... | If auto-hide is enabled, start timer and prepare cancel function | [
"If",
"auto",
"-",
"hide",
"is",
"enabled",
"start",
"timer",
"and",
"prepare",
"cancel",
"function"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/interimElement/interimElement.js#L670-L685 | train | Starts auto - hiding the image | [
30522,
3853,
2707,
4887,
3406,
26100,
1006,
1007,
1063,
13075,
8285,
26100,
7292,
2099,
1010,
17542,
4887,
3406,
26100,
1027,
16108,
1012,
2053,
7361,
1025,
2065,
1006,
7047,
1012,
5342,
9247,
4710,
1007,
1063,
8285,
26100,
7292,
2099,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/coord/View.js | function () {
// Rect before any transform
var rawRect = this.getBoundingRect();
var cx = rawRect.x + rawRect.width / 2;
var cy = rawRect.y + rawRect.height / 2;
return [cx, cy];
} | javascript | function () {
// Rect before any transform
var rawRect = this.getBoundingRect();
var cx = rawRect.x + rawRect.width / 2;
var cy = rawRect.y + rawRect.height / 2;
return [cx, cy];
} | [
"function",
"(",
")",
"{",
"// Rect before any transform",
"var",
"rawRect",
"=",
"this",
".",
"getBoundingRect",
"(",
")",
";",
"var",
"cx",
"=",
"rawRect",
".",
"x",
"+",
"rawRect",
".",
"width",
"/",
"2",
";",
"var",
"cy",
"=",
"rawRect",
".",
"y",
... | Get default center without roam | [
"Get",
"default",
"center",
"without",
"roam"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/View.js#L161-L168 | train | Returns the center of the image | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
28667,
2102,
2077,
2151,
10938,
13075,
6315,
2890,
6593,
1027,
2023,
1012,
2131,
15494,
2075,
2890,
6593,
1006,
1007,
1025,
13075,
1039,
2595,
1027,
6315,
2890,
6593,
1012,
1060,
1009,
6315,
2890,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
Freeboard/freeboard | js/freeboard.thirdparty.js | Collision | function Collision(el, colliders, options)
{
this.options = $.extend(defaults, options);
this.$element = el;
this.last_colliders = [];
this.last_colliders_coords = [];
if(typeof colliders === 'string' || colliders instanceof jQuery)
{
this.$colliders = $(colliders, this.options.colliders_context).not(th... | javascript | function Collision(el, colliders, options)
{
this.options = $.extend(defaults, options);
this.$element = el;
this.last_colliders = [];
this.last_colliders_coords = [];
if(typeof colliders === 'string' || colliders instanceof jQuery)
{
this.$colliders = $(colliders, this.options.colliders_context).not(th... | [
"function",
"Collision",
"(",
"el",
",",
"colliders",
",",
"options",
")",
"{",
"this",
".",
"options",
"=",
"$",
".",
"extend",
"(",
"defaults",
",",
"options",
")",
";",
"this",
".",
"$element",
"=",
"el",
";",
"this",
".",
"last_colliders",
"=",
"... | Detects collisions between a DOM element against other DOM elements or
Coords objects.
@class Collision
@uses Coords
@param {HTMLElement} el The jQuery wrapped HTMLElement.
@param {HTMLElement|Array} colliders Can be a jQuery collection
of HTMLElements or an Array of Coords instances.
@param {Object} [options] An Obje... | [
"Detects",
"collisions",
"between",
"a",
"DOM",
"element",
"against",
"other",
"DOM",
"elements",
"or",
"Coords",
"objects",
"."
] | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L15273-L15289 | train | collision constructor | [
30522,
3853,
12365,
1006,
3449,
1010,
8902,
24198,
2869,
1010,
7047,
1007,
1063,
2023,
1012,
7047,
1027,
1002,
1012,
7949,
1006,
12398,
2015,
1010,
7047,
1007,
1025,
2023,
1012,
1002,
5783,
1027,
3449,
1025,
2023,
1012,
2197,
1035,
8902,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/model/formatter.js | function (sLink) {
if (sLink[0] === "#") {
sLink = document.location.href.substring(0,document.location.href.search("demoapps\.html")) + sLink;
}
return sLink;
} | javascript | function (sLink) {
if (sLink[0] === "#") {
sLink = document.location.href.substring(0,document.location.href.search("demoapps\.html")) + sLink;
}
return sLink;
} | [
"function",
"(",
"sLink",
")",
"{",
"if",
"(",
"sLink",
"[",
"0",
"]",
"===",
"\"#\"",
")",
"{",
"sLink",
"=",
"document",
".",
"location",
".",
"href",
".",
"substring",
"(",
"0",
",",
"document",
".",
"location",
".",
"href",
".",
"search",
"(",
... | Formats a library namespace to link to the API reference if it starts with sap.
@public
@param {string} sNamespace value to be formatted
@returns {string} formatted link | [
"Formats",
"a",
"library",
"namespace",
"to",
"link",
"to",
"the",
"API",
"reference",
"if",
"it",
"starts",
"with",
"sap",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/model/formatter.js#L16-L21 | train | Add a link to the index page | [
30522,
3853,
1006,
22889,
19839,
1007,
1063,
2065,
1006,
22889,
19839,
1031,
1014,
1033,
1027,
1027,
1027,
1000,
1001,
1000,
1007,
1063,
22889,
19839,
1027,
6254,
1012,
3295,
1012,
17850,
12879,
1012,
4942,
3367,
4892,
1006,
1014,
1010,
625... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (handler, ns, name, type, id)
{
var hand = new Strophe.Handler(handler, ns, name, type, id);
hand.user = false;
this.addHandlers.push(hand);
return hand;
} | javascript | function (handler, ns, name, type, id)
{
var hand = new Strophe.Handler(handler, ns, name, type, id);
hand.user = false;
this.addHandlers.push(hand);
return hand;
} | [
"function",
"(",
"handler",
",",
"ns",
",",
"name",
",",
"type",
",",
"id",
")",
"{",
"var",
"hand",
"=",
"new",
"Strophe",
".",
"Handler",
"(",
"handler",
",",
"ns",
",",
"name",
",",
"type",
",",
"id",
")",
";",
"hand",
".",
"user",
"=",
"fal... | PrivateFunction: _addSysHandler
_Private_ function to add a system level stanza handler.
This function is used to add a Strophe.Handler for the
library code. System stanza handlers are allowed to run before
authentication is complete.
Parameters:
(Function) handler - The callback function.
(String) ns - The namespac... | [
"PrivateFunction",
":",
"_addSysHandler",
"_Private_",
"function",
"to",
"add",
"a",
"system",
"level",
"stanza",
"handler",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L3405-L3411 | train | Add a new handler to the end of the list of handlers | [
30522,
3853,
1006,
28213,
1010,
24978,
1010,
2171,
1010,
2828,
1010,
8909,
1007,
1063,
13075,
2192,
1027,
2047,
2358,
18981,
5369,
1012,
28213,
1006,
28213,
1010,
24978,
1010,
2171,
1010,
2828,
1010,
8909,
1007,
1025,
2192,
1012,
5310,
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... | |
angular/material | src/components/tabs/js/tabsController.js | attachRipple | function attachRipple (scope, element) {
var elements = getElements();
var options = { colorElement: angular.element(elements.inkBar) };
$mdTabInkRipple.attach(scope, element, options);
} | javascript | function attachRipple (scope, element) {
var elements = getElements();
var options = { colorElement: angular.element(elements.inkBar) };
$mdTabInkRipple.attach(scope, element, options);
} | [
"function",
"attachRipple",
"(",
"scope",
",",
"element",
")",
"{",
"var",
"elements",
"=",
"getElements",
"(",
")",
";",
"var",
"options",
"=",
"{",
"colorElement",
":",
"angular",
".",
"element",
"(",
"elements",
".",
"inkBar",
")",
"}",
";",
"$mdTabIn... | Attaches a ripple to the tab item element.
@param scope
@param element | [
"Attaches",
"a",
"ripple",
"to",
"the",
"tab",
"item",
"element",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L947-L951 | train | Attach a ripple to the tab | [
30522,
3853,
22476,
29443,
10814,
1006,
9531,
1010,
5783,
1007,
1063,
13075,
3787,
1027,
2131,
12260,
8163,
1006,
1007,
1025,
13075,
7047,
1027,
1063,
3609,
12260,
3672,
1024,
16108,
1012,
5783,
1006,
3787,
1012,
10710,
8237,
1007,
1065,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js | function () {
var oEntityModel, oDeviceModel, oFilterModel,
fnOnDataReady = function (oControlsData) {
this._oView.getModel().setData({
entityCount : oControlsData.entityCount,
entities : oControlsData.entities
});
this.getModel("filter").setData(oControlsData.filter);
thi... | javascript | function () {
var oEntityModel, oDeviceModel, oFilterModel,
fnOnDataReady = function (oControlsData) {
this._oView.getModel().setData({
entityCount : oControlsData.entityCount,
entities : oControlsData.entities
});
this.getModel("filter").setData(oControlsData.filter);
thi... | [
"function",
"(",
")",
"{",
"var",
"oEntityModel",
",",
"oDeviceModel",
",",
"oFilterModel",
",",
"fnOnDataReady",
"=",
"function",
"(",
"oControlsData",
")",
"{",
"this",
".",
"_oView",
".",
"getModel",
"(",
")",
".",
"setData",
"(",
"{",
"entityCount",
":... | /* =========================================================== /* lifecycle methods /* ===========================================================
Called when the master list controller is instantiated.
It sets up the event handling for the master/detail communication and other lifecycle tasks.
@public | [
"/",
"*",
"===========================================================",
"/",
"*",
"lifecycle",
"methods",
"/",
"*",
"===========================================================",
"Called",
"when",
"the",
"master",
"list",
"controller",
"is",
"instantiated",
".",
"It",
"sets"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js#L82-L171 | train | Initializes the controls model | [
30522,
3853,
1006,
1007,
1063,
13075,
1051,
4765,
3012,
5302,
9247,
1010,
24040,
7903,
6633,
10244,
2140,
1010,
1997,
4014,
3334,
5302,
9247,
1010,
1042,
8540,
2850,
7559,
13775,
2100,
1027,
3853,
1006,
1051,
8663,
13181,
4877,
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... | |
facebook/relay | packages/babel-plugin-relay/getDocumentName.js | getDocumentName | function getDocumentName(path: any, state: BabelState): string {
let topPath = path;
while (topPath.parentPath) {
topPath = topPath.parentPath;
}
// Cache the document name onto this top level path.
let documentName = topPath.documentName;
if (!documentName) {
const parent = topPath.parent;
if (... | javascript | function getDocumentName(path: any, state: BabelState): string {
let topPath = path;
while (topPath.parentPath) {
topPath = topPath.parentPath;
}
// Cache the document name onto this top level path.
let documentName = topPath.documentName;
if (!documentName) {
const parent = topPath.parent;
if (... | [
"function",
"getDocumentName",
"(",
"path",
":",
"any",
",",
"state",
":",
"BabelState",
")",
":",
"string",
"{",
"let",
"topPath",
"=",
"path",
";",
"while",
"(",
"topPath",
".",
"parentPath",
")",
"{",
"topPath",
"=",
"topPath",
".",
"parentPath",
";",... | Given a path anywhere in a document, produce the name of that document. | [
"Given",
"a",
"path",
"anywhere",
"in",
"a",
"document",
"produce",
"the",
"name",
"of",
"that",
"document",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/babel-plugin-relay/getDocumentName.js#L22-L59 | train | Get the document name from the top level path. | [
30522,
3853,
2131,
3527,
24894,
4765,
18442,
1006,
4130,
1024,
2151,
1010,
2110,
1024,
11561,
4877,
12259,
1007,
1024,
5164,
1063,
2292,
2327,
15069,
1027,
4130,
1025,
2096,
1006,
2327,
15069,
1012,
6687,
15069,
1007,
1063,
2327,
15069,
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.documentation/src/sap/ui/documentation/sdk/controller/Welcome.controller.js | function (oEvent) {
var isOpenUI5 = this.getView().getModel("welcomeView").getProperty("/isOpenUI5"),
sUrl = isOpenUI5 ? "http://openui5.org/download.html" : "https://tools.hana.ondemand.com/#sapui5";
window.open(sUrl, "_blank");
} | javascript | function (oEvent) {
var isOpenUI5 = this.getView().getModel("welcomeView").getProperty("/isOpenUI5"),
sUrl = isOpenUI5 ? "http://openui5.org/download.html" : "https://tools.hana.ondemand.com/#sapui5";
window.open(sUrl, "_blank");
} | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"isOpenUI5",
"=",
"this",
".",
"getView",
"(",
")",
".",
"getModel",
"(",
"\"welcomeView\"",
")",
".",
"getProperty",
"(",
"\"/isOpenUI5\"",
")",
",",
"sUrl",
"=",
"isOpenUI5",
"?",
"\"http://openui5.org/download.htm... | Redirects to the UI5 download page
@param {sap.ui.base.Event} oEvent the Button press event
@public | [
"Redirects",
"to",
"the",
"UI5",
"download",
"page"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/Welcome.controller.js#L97-L101 | train | Open the UI5 download page | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
11163,
11837,
10179,
2629,
1027,
2023,
1012,
2131,
8584,
1006,
1007,
1012,
2131,
5302,
9247,
1006,
1000,
6160,
8584,
1000,
1007,
1012,
2131,
21572,
4842,
3723,
1006,
1000,
1013,
11163... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableUtils.js | function(oTable) {
if (!oTable) {
return false;
}
var oRowSettingsTemplate = oTable.getRowSettingsTemplate();
if (!oRowSettingsTemplate) {
return false;
}
var sHighlight = oRowSettingsTemplate.getHighlight();
return oRowSettingsTemplate.isBound("highlight")
|| (sHighlight != null... | javascript | function(oTable) {
if (!oTable) {
return false;
}
var oRowSettingsTemplate = oTable.getRowSettingsTemplate();
if (!oRowSettingsTemplate) {
return false;
}
var sHighlight = oRowSettingsTemplate.getHighlight();
return oRowSettingsTemplate.isBound("highlight")
|| (sHighlight != null... | [
"function",
"(",
"oTable",
")",
"{",
"if",
"(",
"!",
"oTable",
")",
"{",
"return",
"false",
";",
"}",
"var",
"oRowSettingsTemplate",
"=",
"oTable",
".",
"getRowSettingsTemplate",
"(",
")",
";",
"if",
"(",
"!",
"oRowSettingsTemplate",
")",
"{",
"return",
... | Returns whether the table has row highlights.
@param {sap.ui.table.Table} oTable Instance of the table.
@returns {boolean} Whether the table has row highlights. | [
"Returns",
"whether",
"the",
"table",
"has",
"row",
"highlights",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L257-L272 | train | Returns true if the table has a row highlight property | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
2065,
1006,
999,
27178,
3085,
1007,
1063,
2709,
6270,
1025,
1065,
13075,
20298,
9333,
18319,
3070,
13473,
8737,
13806,
1027,
27178,
3085,
1012,
2131,
10524,
21678,
30524,
13473,
8737,
13806,
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... | |
angular/material | src/components/colors/colors.js | interpolateColors | function interpolateColors(themeColors) {
var rgbColors = {};
var hasColorProperty = themeColors.hasOwnProperty('color');
angular.forEach(themeColors, function (value, key) {
var color = extractColorOptions(value);
var hasBackground = key.indexOf('background') > -1;
rgbColor... | javascript | function interpolateColors(themeColors) {
var rgbColors = {};
var hasColorProperty = themeColors.hasOwnProperty('color');
angular.forEach(themeColors, function (value, key) {
var color = extractColorOptions(value);
var hasBackground = key.indexOf('background') > -1;
rgbColor... | [
"function",
"interpolateColors",
"(",
"themeColors",
")",
"{",
"var",
"rgbColors",
"=",
"{",
"}",
";",
"var",
"hasColorProperty",
"=",
"themeColors",
".",
"hasOwnProperty",
"(",
"'color'",
")",
";",
"angular",
".",
"forEach",
"(",
"themeColors",
",",
"function... | Convert the color expression into an object with scope-interpolated values
Then calculate the rgba() values based on the theme color parts
@param {Object} themeColors json object, keys are css properties and values are string of
the wanted color, for example: `{color: 'red-A200-0.3'}`.
@return {Object} Hashmap of CSS p... | [
"Convert",
"the",
"color",
"expression",
"into",
"an",
"object",
"with",
"scope",
"-",
"interpolated",
"values",
"Then",
"calculate",
"the",
"rgba",
"()",
"values",
"based",
"on",
"the",
"theme",
"color",
"parts"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/colors/colors.js#L138-L154 | train | Interpolates colors in themeColors | [
30522,
3853,
6970,
18155,
3686,
18717,
2015,
1006,
4323,
18717,
2015,
1007,
1063,
13075,
1054,
18259,
18717,
2015,
1027,
1063,
1065,
1025,
13075,
2038,
18717,
21572,
4842,
3723,
1027,
4323,
18717,
2015,
1012,
2038,
12384,
21572,
4842,
3723,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/cli-engine.js | processFile | function processFile(filename, configHelper, options, linter) {
const text = fs.readFileSync(path.resolve(filename), "utf8");
return processText(
text,
configHelper,
filename,
options.fix,
options.allowInlineConfig,
options.reportUnusedDisableDirectives,
... | javascript | function processFile(filename, configHelper, options, linter) {
const text = fs.readFileSync(path.resolve(filename), "utf8");
return processText(
text,
configHelper,
filename,
options.fix,
options.allowInlineConfig,
options.reportUnusedDisableDirectives,
... | [
"function",
"processFile",
"(",
"filename",
",",
"configHelper",
",",
"options",
",",
"linter",
")",
"{",
"const",
"text",
"=",
"fs",
".",
"readFileSync",
"(",
"path",
".",
"resolve",
"(",
"filename",
")",
",",
"\"utf8\"",
")",
";",
"return",
"processText"... | Processes an individual file using ESLint. Files used here are known to
exist, so no need to check that here.
@param {string} filename The filename of the file being checked.
@param {Object} configHelper The configuration options for ESLint.
@param {Object} options The CLIEngine options object.
@param {Linter} linter L... | [
"Processes",
"an",
"individual",
"file",
"using",
"ESLint",
".",
"Files",
"used",
"here",
"are",
"known",
"to",
"exist",
"so",
"no",
"need",
"to",
"check",
"that",
"here",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/cli-engine.js#L243-L256 | train | Process a single file | [
30522,
3853,
2832,
8873,
2571,
1006,
5371,
18442,
1010,
9530,
8873,
5603,
2884,
4842,
1010,
7047,
1010,
11409,
3334,
1007,
1063,
9530,
3367,
3793,
1027,
1042,
2015,
1012,
3191,
8873,
4244,
6038,
2278,
1006,
4130,
1012,
10663,
1006,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
grpc/grpc-node | packages/grpc-native-core/src/server.js | _write | function _write(chunk, encoding, callback) {
/* jshint validthis: true */
var batch = {};
var self = this;
var message;
try {
message = this.serialize(chunk);
} catch (e) {
e.code = constants.status.INTERNAL;
callback(e);
return;
}
if (!this.call.metadataSent) {
batch[grpc.opType.SEN... | javascript | function _write(chunk, encoding, callback) {
/* jshint validthis: true */
var batch = {};
var self = this;
var message;
try {
message = this.serialize(chunk);
} catch (e) {
e.code = constants.status.INTERNAL;
callback(e);
return;
}
if (!this.call.metadataSent) {
batch[grpc.opType.SEN... | [
"function",
"_write",
"(",
"chunk",
",",
"encoding",
",",
"callback",
")",
"{",
"/* jshint validthis: true */",
"var",
"batch",
"=",
"{",
"}",
";",
"var",
"self",
"=",
"this",
";",
"var",
"message",
";",
"try",
"{",
"message",
"=",
"this",
".",
"serializ... | Start writing a chunk of data. This is an implementation of a method required
for implementing stream.Writable.
@private
@param {Buffer} chunk The chunk of data to write
@param {string} encoding Used to pass write flags
@param {function(Error=)} callback Callback to indicate that the write is
complete | [
"Start",
"writing",
"a",
"chunk",
"of",
"data",
".",
"This",
"is",
"an",
"implementation",
"of",
"a",
"method",
"required",
"for",
"implementing",
"stream",
".",
"Writable",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/server.js#L302-L332 | train | Writes a chunk to the client | [
30522,
3853,
1035,
4339,
1006,
20000,
1010,
17181,
1010,
2655,
5963,
1007,
1063,
1013,
1008,
1046,
17426,
2102,
9398,
15222,
2015,
1024,
2995,
1008,
1013,
13075,
14108,
1027,
1063,
1065,
1025,
13075,
2969,
1027,
2023,
1025,
13075,
4471,
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.documentation/src/sap/ui/documentation/sdk/controller/BaseController.js | function (sControlName) {
return APIInfo.getIndexJsonPromise().then(function (aData) {
function findSymbol (a) {
return a.some(function (o) {
var bFound = o.name === sControlName;
if (!bFound && o.nodes) {
return findSymbol(o.nodes);
}
return bFound;
});
}
... | javascript | function (sControlName) {
return APIInfo.getIndexJsonPromise().then(function (aData) {
function findSymbol (a) {
return a.some(function (o) {
var bFound = o.name === sControlName;
if (!bFound && o.nodes) {
return findSymbol(o.nodes);
}
return bFound;
});
}
... | [
"function",
"(",
"sControlName",
")",
"{",
"return",
"APIInfo",
".",
"getIndexJsonPromise",
"(",
")",
".",
"then",
"(",
"function",
"(",
"aData",
")",
"{",
"function",
"findSymbol",
"(",
"a",
")",
"{",
"return",
"a",
".",
"some",
"(",
"function",
"(",
... | Checks if a control has API Reference
@param {string} sControlName
@return {Promise} A promise that resolves to {boolean} | [
"Checks",
"if",
"a",
"control",
"has",
"API",
"Reference"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/BaseController.js#L206-L219 | train | Find the symbol in the index | [
30522,
3853,
1006,
8040,
12162,
13153,
18442,
1007,
1063,
2709,
17928,
2378,
14876,
1012,
2131,
22254,
10288,
22578,
2239,
21572,
28732,
1006,
1007,
1012,
2059,
1006,
3853,
1006,
15262,
2696,
1007,
1063,
3853,
4858,
24335,
14956,
1006,
1037,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-constant-condition.js | isConstant | function isConstant(node, inBooleanPosition) {
switch (node.type) {
case "Literal":
case "ArrowFunctionExpression":
case "FunctionExpression":
case "ObjectExpression":
case "ArrayExpression":
return true;
... | javascript | function isConstant(node, inBooleanPosition) {
switch (node.type) {
case "Literal":
case "ArrowFunctionExpression":
case "FunctionExpression":
case "ObjectExpression":
case "ArrayExpression":
return true;
... | [
"function",
"isConstant",
"(",
"node",
",",
"inBooleanPosition",
")",
"{",
"switch",
"(",
"node",
".",
"type",
")",
"{",
"case",
"\"Literal\"",
":",
"case",
"\"ArrowFunctionExpression\"",
":",
"case",
"\"FunctionExpression\"",
":",
"case",
"\"ObjectExpression\"",
... | Checks if a node has a constant truthiness value.
@param {ASTNode} node The AST node to check.
@param {boolean} inBooleanPosition `false` if checking branch of a condition.
`true` in all other cases
@returns {Bool} true when node's truthiness is constant
@private | [
"Checks",
"if",
"a",
"node",
"has",
"a",
"constant",
"truthiness",
"value",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-constant-condition.js#L92-L146 | train | Determines if a node is a constant value. | [
30522,
3853,
2003,
8663,
12693,
2102,
1006,
13045,
1010,
1999,
5092,
9890,
2319,
26994,
1007,
1063,
6942,
1006,
13045,
1012,
2828,
1007,
1063,
2553,
1000,
18204,
1000,
1024,
2553,
1000,
8612,
11263,
27989,
10288,
20110,
3258,
1000,
1024,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/json/encodeGlossary.js | encodeGlossary | function encodeGlossary(glossary) {
var file = glossary.getFile();
var entries = glossary.getEntries();
return {
file: encodeFile(file),
entries: entries
.map(encodeGlossaryEntry).toJS()
};
} | javascript | function encodeGlossary(glossary) {
var file = glossary.getFile();
var entries = glossary.getEntries();
return {
file: encodeFile(file),
entries: entries
.map(encodeGlossaryEntry).toJS()
};
} | [
"function",
"encodeGlossary",
"(",
"glossary",
")",
"{",
"var",
"file",
"=",
"glossary",
".",
"getFile",
"(",
")",
";",
"var",
"entries",
"=",
"glossary",
".",
"getEntries",
"(",
")",
";",
"return",
"{",
"file",
":",
"encodeFile",
"(",
"file",
")",
","... | Encode a glossary to JSON
@param {Glossary}
@return {Object} | [
"Encode",
"a",
"glossary",
"to",
"JSON"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/json/encodeGlossary.js#L10-L19 | train | Encode a glossary | [
30522,
3853,
4372,
16044,
23296,
21842,
2854,
1006,
27068,
5649,
1007,
1063,
13075,
5371,
1027,
27068,
5649,
1012,
2131,
8873,
2571,
1006,
1007,
1025,
13075,
10445,
1027,
27068,
5649,
1012,
2131,
4765,
5134,
1006,
1007,
1025,
2709,
1063,
53... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | parsedStyle | function parsedStyle(property) {
var includeNonDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var ele = this[0];
var cy = ele.cy();
if (!cy.styleEnabled()) {
return;
}
if (ele) {
var overriddenStyle = ele._private.style[property];
if (ove... | javascript | function parsedStyle(property) {
var includeNonDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var ele = this[0];
var cy = ele.cy();
if (!cy.styleEnabled()) {
return;
}
if (ele) {
var overriddenStyle = ele._private.style[property];
if (ove... | [
"function",
"parsedStyle",
"(",
"property",
")",
"{",
"var",
"includeNonDefault",
"=",
"arguments",
".",
"length",
">",
"1",
"&&",
"arguments",
"[",
"1",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"1",
"]",
":",
"true",
";",
"var",
"ele",
"=",
"th... | get the internal parsed style object for the specified property | [
"get",
"the",
"internal",
"parsed",
"style",
"object",
"for",
"the",
"specified",
"property"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L10903-L10923 | train | Get the parsed style for the specified property | [
30522,
3853,
11968,
6924,
21756,
2571,
1006,
3200,
1007,
1063,
13075,
2421,
8540,
3207,
7011,
11314,
1027,
9918,
1012,
3091,
1028,
1015,
1004,
1004,
9918,
1031,
1015,
1033,
999,
1027,
1027,
6151,
28344,
1029,
9918,
1031,
1015,
1033,
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... |
badges/shields | services/luarocks/luarocks-version-helpers.js | compareVersionLists | function compareVersionLists(v1, v2) {
const maxLength = Math.max(v1.length, v2.length)
let p1, p2
for (let i = 0; i < maxLength; i++) {
p1 = v1[i] || 0
p2 = v2[i] || 0
if (p1 > p2) return 1
if (p1 < p2) return -1
}
return 0
} | javascript | function compareVersionLists(v1, v2) {
const maxLength = Math.max(v1.length, v2.length)
let p1, p2
for (let i = 0; i < maxLength; i++) {
p1 = v1[i] || 0
p2 = v2[i] || 0
if (p1 > p2) return 1
if (p1 < p2) return -1
}
return 0
} | [
"function",
"compareVersionLists",
"(",
"v1",
",",
"v2",
")",
"{",
"const",
"maxLength",
"=",
"Math",
".",
"max",
"(",
"v1",
".",
"length",
",",
"v2",
".",
"length",
")",
"let",
"p1",
",",
"p2",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
... | Compare two arrays containing split and transformed to positive/negative numbers parts of version strings, respecting negative/missing values: [1, 2, 1] > [1, 2], but [1, 2, -1] < [1, 2] ([1, 2] is aligned to [1, 2, 0]) Return a negative value if v1 < v2, zero if v1 = v2, a positive value otherwise. | [
"Compare",
"two",
"arrays",
"containing",
"split",
"and",
"transformed",
"to",
"positive",
"/",
"negative",
"numbers",
"parts",
"of",
"version",
"strings",
"respecting",
"negative",
"/",
"missing",
"values",
":",
"[",
"1",
"2",
"1",
"]",
">",
"[",
"1",
"2"... | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/services/luarocks/luarocks-version-helpers.js#L17-L27 | train | Compare two version lists | [
30522,
3853,
12826,
27774,
27103,
1006,
1058,
2487,
1010,
1058,
2475,
1007,
1063,
9530,
3367,
4098,
7770,
13512,
2232,
1027,
8785,
1012,
4098,
1006,
1058,
2487,
1012,
3091,
1010,
1058,
2475,
1012,
3091,
1007,
2292,
1052,
2487,
1010,
1052,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/transforms/RelayRefetchableFragmentTransform.js | buildRefetchMap | function buildRefetchMap(
context: GraphQLCompilerContext,
): Map<string, Fragment> {
const refetchOperations = new Map();
const errors = eachWithErrors(context.documents(), node => {
if (node.kind !== 'Fragment') {
return;
}
const refetchName = getRefetchQueryName(node);
if (refetchName ===... | javascript | function buildRefetchMap(
context: GraphQLCompilerContext,
): Map<string, Fragment> {
const refetchOperations = new Map();
const errors = eachWithErrors(context.documents(), node => {
if (node.kind !== 'Fragment') {
return;
}
const refetchName = getRefetchQueryName(node);
if (refetchName ===... | [
"function",
"buildRefetchMap",
"(",
"context",
":",
"GraphQLCompilerContext",
",",
")",
":",
"Map",
"<",
"string",
",",
"Fragment",
">",
"{",
"const",
"refetchOperations",
"=",
"new",
"Map",
"(",
")",
";",
"const",
"errors",
"=",
"eachWithErrors",
"(",
"cont... | Walk the documents of a compiler context and create a mapping of
refetch operation names to the source fragment from which the refetch
operation should be derived. | [
"Walk",
"the",
"documents",
"of",
"a",
"compiler",
"context",
"and",
"create",
"a",
"mapping",
"of",
"refetch",
"operation",
"names",
"to",
"the",
"source",
"fragment",
"from",
"which",
"the",
"refetch",
"operation",
"should",
"be",
"derived",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/transforms/RelayRefetchableFragmentTransform.js#L169-L201 | train | Build a refetch map from a GraphQL CompilerContext | [
30522,
3853,
3857,
2890,
7959,
10649,
2863,
2361,
1006,
6123,
1024,
10629,
4160,
22499,
8737,
9463,
29566,
10111,
18413,
1010,
1007,
1024,
4949,
1026,
5164,
1010,
15778,
1028,
1063,
9530,
3367,
25416,
3388,
9905,
29487,
2015,
1027,
2047,
49... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/wysiwygCommands/tableRemoveRow.js | getSelectedRows | function getSelectedRows(firstSelectedCell, rangeInformation, $table) {
const tbodyRowLength = $table.find('tbody tr').length;
const isStartContainerInThead = $(firstSelectedCell).parents('thead').length;
let startRowIndex = rangeInformation.from.row;
let endRowIndex = rangeInformation.to.row;
if (isStartCon... | javascript | function getSelectedRows(firstSelectedCell, rangeInformation, $table) {
const tbodyRowLength = $table.find('tbody tr').length;
const isStartContainerInThead = $(firstSelectedCell).parents('thead').length;
let startRowIndex = rangeInformation.from.row;
let endRowIndex = rangeInformation.to.row;
if (isStartCon... | [
"function",
"getSelectedRows",
"(",
"firstSelectedCell",
",",
"rangeInformation",
",",
"$table",
")",
"{",
"const",
"tbodyRowLength",
"=",
"$table",
".",
"find",
"(",
"'tbody tr'",
")",
".",
"length",
";",
"const",
"isStartContainerInThead",
"=",
"$",
"(",
"firs... | Get start, end row index from current range
@param {HTMLElement} firstSelectedCell Range object
@param {object} rangeInformation Range information object
@param {jQuery} $table jquery wrapped TABLE
@returns {jQuery} | [
"Get",
"start",
"end",
"row",
"index",
"from",
"current",
"range"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/wysiwygCommands/tableRemoveRow.js#L69-L86 | train | Get selected rows | [
30522,
3853,
4152,
12260,
10985,
10524,
2015,
1006,
2034,
11246,
22471,
2098,
29109,
2140,
1010,
2846,
2378,
14192,
3370,
1010,
1002,
2795,
1007,
1063,
9530,
3367,
26419,
7716,
12541,
5004,
7770,
13512,
2232,
1027,
1002,
2795,
1012,
2424,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js | function () {
var oBinding = this.byId("tree").getBinding("items");
if (this._sFilter) {
oBinding.filter(new Filter({
path: "name",
operator: FilterOperator.Contains,
value1: this._sFilter
}));
return true;
} else {
oBinding.filter();
return false;
}
} | javascript | function () {
var oBinding = this.byId("tree").getBinding("items");
if (this._sFilter) {
oBinding.filter(new Filter({
path: "name",
operator: FilterOperator.Contains,
value1: this._sFilter
}));
return true;
} else {
oBinding.filter();
return false;
}
} | [
"function",
"(",
")",
"{",
"var",
"oBinding",
"=",
"this",
".",
"byId",
"(",
"\"tree\"",
")",
".",
"getBinding",
"(",
"\"items\"",
")",
";",
"if",
"(",
"this",
".",
"_sFilter",
")",
"{",
"oBinding",
".",
"filter",
"(",
"new",
"Filter",
"(",
"{",
"p... | Build and apply filters to the tree model.
@returns {boolean} if search filter is applied | [
"Build",
"and",
"apply",
"filters",
"to",
"the",
"tree",
"model",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js#L123-L136 | train | Returns true if the filter is set to true | [
30522,
3853,
1006,
1007,
1063,
13075,
27885,
22254,
2075,
1027,
2023,
1012,
2011,
3593,
1006,
1000,
3392,
1000,
1007,
1012,
2131,
8428,
4667,
1006,
1000,
5167,
1000,
1007,
1025,
2065,
1006,
2023,
1012,
1035,
16420,
4014,
3334,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js | function(oTable, oPos, bShow) {
if (!oPos || !oTable._$ReorderIndicator) {
return;
}
var iLeft = oPos.left - oTable.getDomRef().getBoundingClientRect().left;
if (oTable._bRtlMode && oPos.before || !oTable._bRtlMode && oPos.after) {
iLeft = iLeft + oPos.width;
}
jQuery(oTable._$ReorderIndicat... | javascript | function(oTable, oPos, bShow) {
if (!oPos || !oTable._$ReorderIndicator) {
return;
}
var iLeft = oPos.left - oTable.getDomRef().getBoundingClientRect().left;
if (oTable._bRtlMode && oPos.before || !oTable._bRtlMode && oPos.after) {
iLeft = iLeft + oPos.width;
}
jQuery(oTable._$ReorderIndicat... | [
"function",
"(",
"oTable",
",",
"oPos",
",",
"bShow",
")",
"{",
"if",
"(",
"!",
"oPos",
"||",
"!",
"oTable",
".",
"_$ReorderIndicator",
")",
"{",
"return",
";",
"}",
"var",
"iLeft",
"=",
"oPos",
".",
"left",
"-",
"oTable",
".",
"getDomRef",
"(",
")... | /*
Positions the reorder marker on the column (given by the position information).
@see findColumnForPosition | [
"/",
"*",
"Positions",
"the",
"reorder",
"marker",
"on",
"the",
"column",
"(",
"given",
"by",
"the",
"position",
"information",
")",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js#L666-L679 | train | Sets the active state of the reorder indicator | [
30522,
3853,
1006,
27178,
3085,
1010,
6728,
2891,
1010,
18667,
14406,
1007,
1063,
2065,
1006,
999,
6728,
2891,
1064,
1064,
999,
27178,
3085,
1012,
1035,
1002,
2128,
8551,
23282,
14808,
8844,
1007,
1063,
2709,
1025,
1065,
13075,
17869,
6199,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aws/aws-sdk-js | lib/services/apigateway.js | setAcceptHeader | function setAcceptHeader(req) {
var httpRequest = req.httpRequest;
if (!httpRequest.headers.Accept) {
httpRequest.headers['Accept'] = 'application/json';
}
} | javascript | function setAcceptHeader(req) {
var httpRequest = req.httpRequest;
if (!httpRequest.headers.Accept) {
httpRequest.headers['Accept'] = 'application/json';
}
} | [
"function",
"setAcceptHeader",
"(",
"req",
")",
"{",
"var",
"httpRequest",
"=",
"req",
".",
"httpRequest",
";",
"if",
"(",
"!",
"httpRequest",
".",
"headers",
".",
"Accept",
")",
"{",
"httpRequest",
".",
"headers",
"[",
"'Accept'",
"]",
"=",
"'application/... | Sets the Accept header to application/json.
@api private | [
"Sets",
"the",
"Accept",
"header",
"to",
"application",
"/",
"json",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/apigateway.js#L9-L14 | train | Set the Accept header | [
30522,
3853,
2275,
6305,
3401,
13876,
4974,
2121,
1006,
2128,
4160,
1007,
1063,
13075,
8299,
2890,
15500,
1027,
2128,
4160,
1012,
8299,
2890,
15500,
1025,
2065,
1006,
999,
8299,
2890,
15500,
1012,
20346,
2015,
1012,
5138,
1007,
1063,
8299,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tgriesser/knex | src/dialects/oracledb/index.js | readStream | function readStream(stream, cb) {
const oracledb = require('oracledb');
let data = '';
if (stream.iLob.type === oracledb.CLOB) {
stream.setEncoding('utf-8');
} else {
data = Buffer.alloc(0);
}
stream.on('error', function(err) {
cb(err);
});
stream.on('data', function(chunk) {
if (stream... | javascript | function readStream(stream, cb) {
const oracledb = require('oracledb');
let data = '';
if (stream.iLob.type === oracledb.CLOB) {
stream.setEncoding('utf-8');
} else {
data = Buffer.alloc(0);
}
stream.on('error', function(err) {
cb(err);
});
stream.on('data', function(chunk) {
if (stream... | [
"function",
"readStream",
"(",
"stream",
",",
"cb",
")",
"{",
"const",
"oracledb",
"=",
"require",
"(",
"'oracledb'",
")",
";",
"let",
"data",
"=",
"''",
";",
"if",
"(",
"stream",
".",
"iLob",
".",
"type",
"===",
"oracledb",
".",
"CLOB",
")",
"{",
... | Handle clob | [
"Handle",
"clob"
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/dialects/oracledb/index.js#L337-L359 | train | read stream data | [
30522,
3853,
9631,
25379,
1006,
5460,
1010,
17324,
1007,
1063,
9530,
3367,
14721,
18939,
1027,
5478,
1006,
1005,
14721,
18939,
1005,
1007,
1025,
2292,
2951,
1027,
1005,
1005,
1025,
2065,
1006,
5460,
1012,
6335,
16429,
1012,
2828,
1027,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (handRef)
{
// this must be done in the Idle loop so that we don't change
// the handlers during iteration
this.removeHandlers.push(handRef);
// If a handler is being deleted while it is being added,
// prevent it from getting added
var i = this.addHan... | javascript | function (handRef)
{
// this must be done in the Idle loop so that we don't change
// the handlers during iteration
this.removeHandlers.push(handRef);
// If a handler is being deleted while it is being added,
// prevent it from getting added
var i = this.addHan... | [
"function",
"(",
"handRef",
")",
"{",
"// this must be done in the Idle loop so that we don't change\r",
"// the handlers during iteration\r",
"this",
".",
"removeHandlers",
".",
"push",
"(",
"handRef",
")",
";",
"// If a handler is being deleted while it is being added,\r",
"// pr... | Function: deleteHandler
Delete a stanza handler for a connection.
This function removes a stanza handler from the connection. The
handRef parameter is *not* the function passed to addHandler(),
but is the reference returned from addHandler().
Parameters:
(Strophe.Handler) handRef - The handler reference. | [
"Function",
":",
"deleteHandler",
"Delete",
"a",
"stanza",
"handler",
"for",
"a",
"connection",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L2665-L2676 | train | Remove a handler from the list of handlers | [
30522,
3853,
1006,
2192,
2890,
2546,
1007,
1063,
1013,
1013,
2023,
2442,
2022,
2589,
1999,
1996,
18373,
7077,
2061,
2008,
2057,
2123,
1005,
1056,
2689,
1013,
1013,
1996,
28213,
2015,
2076,
27758,
2023,
1012,
6366,
11774,
12910,
1012,
5245,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/json/encodeGlossaryEntry.js | encodeGlossaryEntry | function encodeGlossaryEntry(entry) {
return {
id: entry.getID(),
name: entry.getName(),
description: entry.getDescription()
};
} | javascript | function encodeGlossaryEntry(entry) {
return {
id: entry.getID(),
name: entry.getName(),
description: entry.getDescription()
};
} | [
"function",
"encodeGlossaryEntry",
"(",
"entry",
")",
"{",
"return",
"{",
"id",
":",
"entry",
".",
"getID",
"(",
")",
",",
"name",
":",
"entry",
".",
"getName",
"(",
")",
",",
"description",
":",
"entry",
".",
"getDescription",
"(",
")",
"}",
";",
"}... | Encode a SummaryArticle to JSON
@param {GlossaryEntry}
@return {Object} | [
"Encode",
"a",
"SummaryArticle",
"to",
"JSON"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/json/encodeGlossaryEntry.js#L8-L14 | train | Encode a glossary entry | [
30522,
3853,
4372,
16044,
23296,
21842,
2854,
4765,
2854,
1006,
4443,
1007,
1063,
2709,
1063,
8909,
1024,
4443,
1012,
2131,
3593,
1006,
1007,
1010,
2171,
1024,
4443,
1012,
2131,
18442,
1006,
1007,
1010,
6412,
1024,
4443,
1012,
2131,
6155,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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... |
SheetJS/js-xlsx | xlsx.js | parse_borders | function parse_borders(t, styles, themes, opts) {
styles.Borders = [];
var border = {}/*, sub_border = {}*/;
var pass = false;
t[0].match(tagregex).forEach(function(x) {
var y = parsexmltag(x);
switch(strip_ns(y[0])) {
case '<borders': case '<borders>': case '</borders>': break;
/* 18.8.4 border CT_Borde... | javascript | function parse_borders(t, styles, themes, opts) {
styles.Borders = [];
var border = {}/*, sub_border = {}*/;
var pass = false;
t[0].match(tagregex).forEach(function(x) {
var y = parsexmltag(x);
switch(strip_ns(y[0])) {
case '<borders': case '<borders>': case '</borders>': break;
/* 18.8.4 border CT_Borde... | [
"function",
"parse_borders",
"(",
"t",
",",
"styles",
",",
"themes",
",",
"opts",
")",
"{",
"styles",
".",
"Borders",
"=",
"[",
"]",
";",
"var",
"border",
"=",
"{",
"}",
"/*, sub_border = {}*/",
";",
"var",
"pass",
"=",
"false",
";",
"t",
"[",
"0",
... | /* 18.8.5 borders CT_Borders | [
"/",
"*",
"18",
".",
"8",
".",
"5",
"borders",
"CT_Borders"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L8600-L8671 | train | Parse the borders of an XML element | [
30522,
3853,
11968,
3366,
1035,
6645,
1006,
1056,
1010,
6782,
1010,
6991,
1010,
23569,
2015,
1007,
1063,
6782,
1012,
6645,
1027,
1031,
1033,
1025,
13075,
3675,
1027,
1063,
1065,
1013,
1008,
1010,
4942,
1035,
3675,
1027,
1063,
1065,
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... |
jiahaog/nativefier | src/options/fields/index.js | wrap | function wrap(fieldName, promise, args) {
return promise(args).then((result) => ({
[fieldName]: result,
}));
} | javascript | function wrap(fieldName, promise, args) {
return promise(args).then((result) => ({
[fieldName]: result,
}));
} | [
"function",
"wrap",
"(",
"fieldName",
",",
"promise",
",",
"args",
")",
"{",
"return",
"promise",
"(",
"args",
")",
".",
"then",
"(",
"(",
"result",
")",
"=>",
"(",
"{",
"[",
"fieldName",
"]",
":",
"result",
",",
"}",
")",
")",
";",
"}"
] | Modifies the result of each promise from a scalar value to a object containing its fieldname | [
"Modifies",
"the",
"result",
"of",
"each",
"promise",
"from",
"a",
"scalar",
"value",
"to",
"a",
"object",
"containing",
"its",
"fieldname"
] | b959956a38ce51a9dd95d42308f0a6c66489b624 | https://github.com/jiahaog/nativefier/blob/b959956a38ce51a9dd95d42308f0a6c66489b624/src/options/fields/index.js#L22-L26 | train | Wrap a promise with an object | [
30522,
3853,
10236,
1006,
2492,
18442,
1010,
4872,
1010,
12098,
5620,
1007,
1063,
2709,
4872,
1006,
12098,
5620,
1007,
1012,
2059,
1006,
1006,
2765,
1007,
1027,
1028,
1006,
1063,
1031,
2492,
18442,
1033,
1024,
2765,
1010,
1065,
1007,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
30-seconds/30-seconds-of-code | scripts/module.js | build | async function build() {
console.time('Packager');
let requires = [];
let esmExportString = '';
let cjsExportString = '';
try {
if (!fs.existsSync(DIST_PATH)) fs.mkdirSync(DIST_PATH);
fs.writeFileSync(ROLLUP_INPUT_FILE, '');
fs.writeFileSync(TEST_MODULE_FILE, '');
// All the snippets that a... | javascript | async function build() {
console.time('Packager');
let requires = [];
let esmExportString = '';
let cjsExportString = '';
try {
if (!fs.existsSync(DIST_PATH)) fs.mkdirSync(DIST_PATH);
fs.writeFileSync(ROLLUP_INPUT_FILE, '');
fs.writeFileSync(TEST_MODULE_FILE, '');
// All the snippets that a... | [
"async",
"function",
"build",
"(",
")",
"{",
"console",
".",
"time",
"(",
"'Packager'",
")",
";",
"let",
"requires",
"=",
"[",
"]",
";",
"let",
"esmExportString",
"=",
"''",
";",
"let",
"cjsExportString",
"=",
"''",
";",
"try",
"{",
"if",
"(",
"!",
... | Starts the build process. | [
"Starts",
"the",
"build",
"process",
"."
] | 5ef18713903aaaa5ff5409ef3a6de31dbd878d0c | https://github.com/30-seconds/30-seconds-of-code/blob/5ef18713903aaaa5ff5409ef3a6de31dbd878d0c/scripts/module.js#L74-L165 | train | Build the project | [
30522,
2004,
6038,
2278,
3853,
3857,
1006,
1007,
1063,
10122,
1012,
2051,
1006,
1005,
7427,
2099,
1005,
1007,
1025,
2292,
5942,
1027,
1031,
1033,
1025,
2292,
9686,
4168,
2595,
25378,
18886,
3070,
1027,
1005,
1005,
1025,
2292,
1039,
22578,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/cli.js | printResults | function printResults(engine, results, format, outputFile) {
let formatter;
let rules;
try {
formatter = engine.getFormatter(format);
rules = engine.getRules();
} catch (e) {
log.error(e.message);
return false;
}
const rulesMeta = {};
rules.forEach((rule, r... | javascript | function printResults(engine, results, format, outputFile) {
let formatter;
let rules;
try {
formatter = engine.getFormatter(format);
rules = engine.getRules();
} catch (e) {
log.error(e.message);
return false;
}
const rulesMeta = {};
rules.forEach((rule, r... | [
"function",
"printResults",
"(",
"engine",
",",
"results",
",",
"format",
",",
"outputFile",
")",
"{",
"let",
"formatter",
";",
"let",
"rules",
";",
"try",
"{",
"formatter",
"=",
"engine",
".",
"getFormatter",
"(",
"format",
")",
";",
"rules",
"=",
"engi... | Outputs the results of the linting.
@param {CLIEngine} engine The CLIEngine to use.
@param {LintResult[]} results The results to print.
@param {string} format The name of the formatter to use or the path to the formatter.
@param {string} outputFile The path for the output file.
@returns {boolean} True if the printing s... | [
"Outputs",
"the",
"results",
"of",
"the",
"linting",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/cli.js#L82-L125 | train | Print the results to the specified file | [
30522,
3853,
6140,
6072,
11314,
2015,
1006,
3194,
1010,
3463,
1010,
4289,
1010,
6434,
8873,
2571,
1007,
1063,
2292,
4289,
3334,
1025,
2292,
3513,
1025,
3046,
1063,
4289,
3334,
1027,
3194,
1012,
2131,
14192,
20097,
1006,
4289,
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... |
adobe/brackets | src/extensions/default/JavaScriptCodeHints/main.js | setConfig | function setConfig(configUpdate) {
var config = setConfig.config;
Object.keys(configUpdate).forEach(function (key) {
config[key] = configUpdate[key];
});
ScopeManager._setConfig(configUpdate);
} | javascript | function setConfig(configUpdate) {
var config = setConfig.config;
Object.keys(configUpdate).forEach(function (key) {
config[key] = configUpdate[key];
});
ScopeManager._setConfig(configUpdate);
} | [
"function",
"setConfig",
"(",
"configUpdate",
")",
"{",
"var",
"config",
"=",
"setConfig",
".",
"config",
";",
"Object",
".",
"keys",
"(",
"configUpdate",
")",
".",
"forEach",
"(",
"function",
"(",
"key",
")",
"{",
"config",
"[",
"key",
"]",
"=",
"conf... | Sets the configuration, generally for testing/debugging use.
Configuration keys are merged into the current configuration.
The Tern worker is automatically updated to the new config as well.
* debug: Set to true if you want verbose logging
* noReset: Set to true if you don't want the worker to restart periodically
@p... | [
"Sets",
"the",
"configuration",
"generally",
"for",
"testing",
"/",
"debugging",
"use",
".",
"Configuration",
"keys",
"are",
"merged",
"into",
"the",
"current",
"configuration",
".",
"The",
"Tern",
"worker",
"is",
"automatically",
"updated",
"to",
"the",
"new",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptCodeHints/main.js#L123-L130 | train | Sets the config object | [
30522,
3853,
2275,
8663,
8873,
2290,
1006,
9530,
8873,
12193,
17299,
3686,
1007,
1063,
13075,
9530,
8873,
2290,
1027,
2275,
8663,
8873,
2290,
1012,
9530,
8873,
2290,
1025,
4874,
1012,
6309,
1006,
9530,
8873,
12193,
17299,
3686,
1007,
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.table/src/sap/ui/table/TableUtils.js | function(oCell) {
if (!oCell) {
return null;
}
var $Cell = jQuery(oCell);
var oCellInfo = TableUtils.getCellInfo($Cell);
if (oCellInfo.isOfType(CELLTYPE.ANY | CELLTYPE.PSEUDO)) {
var $InteractiveElements = $Cell.find(INTERACTIVE_ELEMENT_SELECTORS);
if ($InteractiveElements.length > 0) {
... | javascript | function(oCell) {
if (!oCell) {
return null;
}
var $Cell = jQuery(oCell);
var oCellInfo = TableUtils.getCellInfo($Cell);
if (oCellInfo.isOfType(CELLTYPE.ANY | CELLTYPE.PSEUDO)) {
var $InteractiveElements = $Cell.find(INTERACTIVE_ELEMENT_SELECTORS);
if ($InteractiveElements.length > 0) {
... | [
"function",
"(",
"oCell",
")",
"{",
"if",
"(",
"!",
"oCell",
")",
"{",
"return",
"null",
";",
"}",
"var",
"$Cell",
"=",
"jQuery",
"(",
"oCell",
")",
";",
"var",
"oCellInfo",
"=",
"TableUtils",
".",
"getCellInfo",
"(",
"$Cell",
")",
";",
"if",
"(",
... | Returns all interactive elements in a cell.
@param {jQuery | HTMLElement} oCell The cell from which to get the interactive elements.
@returns {jQuery | null} Returns <code>null</code>, if the passed cell is not a cell or does not contain any interactive elements. | [
"Returns",
"all",
"interactive",
"elements",
"in",
"a",
"cell",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L1430-L1446 | train | Returns the interactive elements of the given cell | [
30522,
3853,
1006,
1051,
29109,
2140,
1007,
1063,
2065,
1006,
999,
1051,
29109,
2140,
1007,
1063,
2709,
19701,
1025,
1065,
13075,
1002,
3526,
1027,
1046,
4226,
2854,
1006,
1051,
29109,
2140,
1007,
1025,
13075,
1051,
29109,
4115,
14876,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
apache/incubator-echarts | src/chart/sankey/sankeyLayout.js | relaxRightToLeft | function relaxRightToLeft(nodesByBreadth, alpha, orient) {
zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {
zrUtil.each(nodes, function (node) {
if (node.outEdges.length) {
var y = sum(node.outEdges, weightedTarget, orient)
/ sum(node.outEd... | javascript | function relaxRightToLeft(nodesByBreadth, alpha, orient) {
zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {
zrUtil.each(nodes, function (node) {
if (node.outEdges.length) {
var y = sum(node.outEdges, weightedTarget, orient)
/ sum(node.outEd... | [
"function",
"relaxRightToLeft",
"(",
"nodesByBreadth",
",",
"alpha",
",",
"orient",
")",
"{",
"zrUtil",
".",
"each",
"(",
"nodesByBreadth",
".",
"slice",
"(",
")",
".",
"reverse",
"(",
")",
",",
"function",
"(",
"nodes",
")",
"{",
"zrUtil",
".",
"each",
... | Change the y-position of the nodes, except most the right side nodes
@param {Array.<Array.<module:echarts/data/Graph~Node>>} nodesByBreadth
group by the array of all sankey nodes based on the node x-position.
@param {number} alpha parameter used to adjust the nodes y-position | [
"Change",
"the",
"y",
"-",
"position",
"of",
"the",
"nodes",
"except",
"most",
"the",
"right",
"side",
"nodes"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sankey/sankeyLayout.js#L402-L419 | train | RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - RelaxRightToLeft - Relax | [
30522,
3853,
9483,
15950,
3406,
2571,
6199,
1006,
14164,
3762,
27035,
2705,
1010,
6541,
1010,
16865,
1007,
1063,
1062,
22134,
4014,
1012,
2169,
1006,
14164,
3762,
27035,
2705,
1012,
14704,
1006,
1007,
1012,
7901,
1006,
1007,
1010,
3853,
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... |
angular/material | src/components/subheader/subheader.js | MdSubheaderDirective | function MdSubheaderDirective($mdSticky, $compile, $mdTheming, $mdUtil, $mdAria) {
return {
restrict: 'E',
replace: true,
transclude: true,
template: (
'<div class="md-subheader _md">' +
' <div class="md-subheader-inner">' +
' <div class="md-subheader-content"></div>' +
' </div>' ... | javascript | function MdSubheaderDirective($mdSticky, $compile, $mdTheming, $mdUtil, $mdAria) {
return {
restrict: 'E',
replace: true,
transclude: true,
template: (
'<div class="md-subheader _md">' +
' <div class="md-subheader-inner">' +
' <div class="md-subheader-content"></div>' +
' </div>' ... | [
"function",
"MdSubheaderDirective",
"(",
"$mdSticky",
",",
"$compile",
",",
"$mdTheming",
",",
"$mdUtil",
",",
"$mdAria",
")",
"{",
"return",
"{",
"restrict",
":",
"'E'",
",",
"replace",
":",
"true",
",",
"transclude",
":",
"true",
",",
"template",
":",
"(... | @ngdoc directive
@name mdSubheader
@module material.components.subheader
@restrict E
@description
The `md-subheader` directive creates a sticky subheader for a section.
Developers are able to disable the stickiness of the subheader by using the following markup
<hljs lang="html">
<md-subheader class="md-no-sticky">... | [
"@ngdoc",
"directive",
"@name",
"mdSubheader",
"@module",
"material",
".",
"components",
".",
"subheader"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/subheader/subheader.js#L55-L120 | train | The md - subheader directive is a directive that can be used to create a clone of the subheader. | [
30522,
3853,
9108,
6342,
23706,
13775,
2121,
4305,
2890,
15277,
1006,
1002,
9108,
21354,
2100,
1010,
1002,
4012,
22090,
1010,
1002,
9108,
10760,
6562,
1010,
1002,
9108,
21823,
2140,
1010,
1002,
9108,
10980,
1007,
1063,
2709,
1063,
21573,
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... |
uber/deck.gl | modules/core/src/utils/old-log.js | checkForAssertionErrors | function checkForAssertionErrors(args) {
const isAssertion =
args &&
args.length > 0 &&
typeof args[0] === 'object' &&
args[0] !== null &&
args[0].name === 'AssertionError';
if (isAssertion) {
args = Array.prototype.slice.call(args);
args.unshift(`assert(${args[0].message})`);
}
ret... | javascript | function checkForAssertionErrors(args) {
const isAssertion =
args &&
args.length > 0 &&
typeof args[0] === 'object' &&
args[0] !== null &&
args[0].name === 'AssertionError';
if (isAssertion) {
args = Array.prototype.slice.call(args);
args.unshift(`assert(${args[0].message})`);
}
ret... | [
"function",
"checkForAssertionErrors",
"(",
"args",
")",
"{",
"const",
"isAssertion",
"=",
"args",
"&&",
"args",
".",
"length",
">",
"0",
"&&",
"typeof",
"args",
"[",
"0",
"]",
"===",
"'object'",
"&&",
"args",
"[",
"0",
"]",
"!==",
"null",
"&&",
"args"... | Assertions don't generate standard exceptions and don't print nicely | [
"Assertions",
"don",
"t",
"generate",
"standard",
"exceptions",
"and",
"don",
"t",
"print",
"nicely"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/core/src/utils/old-log.js#L127-L140 | train | Check if an error is thrown | [
30522,
3853,
4638,
29278,
27241,
28228,
5643,
18933,
2869,
1006,
12098,
5620,
1007,
1063,
9530,
3367,
18061,
18116,
3508,
1027,
12098,
5620,
1004,
1004,
12098,
5620,
1012,
3091,
1028,
1014,
1004,
1004,
2828,
11253,
12098,
5620,
1031,
1014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | vuexInit | function vuexInit () {
var options = this.$options;
// store injection
if (options.store) {
this.$store = typeof options.store === 'function'
? options.store()
: options.store;
} else if (options.parent && options.parent.$store) {
this.$store = options.parent.$store;
}
... | javascript | function vuexInit () {
var options = this.$options;
// store injection
if (options.store) {
this.$store = typeof options.store === 'function'
? options.store()
: options.store;
} else if (options.parent && options.parent.$store) {
this.$store = options.parent.$store;
}
... | [
"function",
"vuexInit",
"(",
")",
"{",
"var",
"options",
"=",
"this",
".",
"$options",
";",
"// store injection",
"if",
"(",
"options",
".",
"store",
")",
"{",
"this",
".",
"$store",
"=",
"typeof",
"options",
".",
"store",
"===",
"'function'",
"?",
"opti... | Vuex init hook, injected into each instances init hooks list. | [
"Vuex",
"init",
"hook",
"injected",
"into",
"each",
"instances",
"init",
"hooks",
"list",
"."
] | d7c7f9844831f98c5c9aaca213746c4ccc5d6929 | https://github.com/vuejs/vuex/blob/d7c7f9844831f98c5c9aaca213746c4ccc5d6929/dist/vuex.esm.js#L29-L39 | train | vuexInit - Initialize the injection | [
30522,
3853,
24728,
10288,
5498,
2102,
1006,
1007,
1063,
13075,
7047,
1027,
2023,
1012,
1002,
7047,
1025,
1013,
1013,
3573,
13341,
2065,
30524,
1012,
1002,
3573,
1007,
1063,
2023,
1012,
1002,
3573,
1027,
7047,
1012,
6687,
1012,
1002,
3573,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Dialog.js | isHeaderClicked | function isHeaderClicked(eventTarget) {
var $target = jQuery(eventTarget);
var oControl = $target.control(0);
if (!oControl || oControl.getMetadata().getInterfaces().indexOf("sap.m.IBar") > -1) {
return true;
}
return $target.hasClass('sapMDialogTitle');
} | javascript | function isHeaderClicked(eventTarget) {
var $target = jQuery(eventTarget);
var oControl = $target.control(0);
if (!oControl || oControl.getMetadata().getInterfaces().indexOf("sap.m.IBar") > -1) {
return true;
}
return $target.hasClass('sapMDialogTitle');
} | [
"function",
"isHeaderClicked",
"(",
"eventTarget",
")",
"{",
"var",
"$target",
"=",
"jQuery",
"(",
"eventTarget",
")",
";",
"var",
"oControl",
"=",
"$target",
".",
"control",
"(",
"0",
")",
";",
"if",
"(",
"!",
"oControl",
"||",
"oControl",
".",
"getMeta... | /* =========================================================== /* Resize & Drag logic /* ===========================================================
@param {Object} eventTarget
@returns {boolean} | [
"/",
"*",
"===========================================================",
"/",
"*",
"Resize",
"&",
"Drag",
"logic",
"/",
"*",
"==========================================================="
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/Dialog.js#L1779-L1787 | train | Returns true if the header is clicked | [
30522,
3853,
2003,
4974,
2121,
20464,
6799,
2098,
1006,
2724,
7559,
18150,
1007,
1063,
13075,
1002,
4539,
1027,
1046,
4226,
2854,
1006,
2724,
7559,
18150,
1007,
1025,
13075,
1051,
8663,
13181,
2140,
1027,
1002,
4539,
1012,
2491,
1006,
1014,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
radare/radare2 | shlr/www/graph/js-graph-it.js | initPageObjects | function initPageObjects()
{
if(isCanvas(document.body))
{
var newCanvas = new Canvas(document.body);
newCanvas.initCanvas();
canvases.push(newCanvas);
}
else
{
var divs = document.getElementsByTagName('div');
var i;
for(i = 0; i < divs.length; i++)
{
if(isCanvas(divs[i]) && !findCanvas(divs[i].i... | javascript | function initPageObjects()
{
if(isCanvas(document.body))
{
var newCanvas = new Canvas(document.body);
newCanvas.initCanvas();
canvases.push(newCanvas);
}
else
{
var divs = document.getElementsByTagName('div');
var i;
for(i = 0; i < divs.length; i++)
{
if(isCanvas(divs[i]) && !findCanvas(divs[i].i... | [
"function",
"initPageObjects",
"(",
")",
"{",
"if",
"(",
"isCanvas",
"(",
"document",
".",
"body",
")",
")",
"{",
"var",
"newCanvas",
"=",
"new",
"Canvas",
"(",
"document",
".",
"body",
")",
";",
"newCanvas",
".",
"initCanvas",
"(",
")",
";",
"canvases... | /*
This function initializes the js_graph objects inspecting the html document | [
"/",
"*",
"This",
"function",
"initializes",
"the",
"js_graph",
"objects",
"inspecting",
"the",
"html",
"document"
] | bf5e3028810a0ec7c267c6fe4bfad639b4819e35 | https://github.com/radare/radare2/blob/bf5e3028810a0ec7c267c6fe4bfad639b4819e35/shlr/www/graph/js-graph-it.js#L1142-L1166 | train | initPageObjects - Init page objects | [
30522,
3853,
1999,
4183,
13704,
16429,
20614,
2015,
1006,
1007,
1063,
2065,
1006,
2003,
9336,
12044,
1006,
6254,
1012,
2303,
1007,
1007,
1063,
13075,
2047,
9336,
12044,
1027,
2047,
10683,
1006,
6254,
1012,
2303,
1007,
1025,
2047,
9336,
1204... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
vuejs/vue-devtools | src/backend/highlighter.js | getFragmentRect | function getFragmentRect ({ _fragmentStart, _fragmentEnd }) {
let top, bottom, left, right
util().mapNodeRange(_fragmentStart, _fragmentEnd, function (node) {
let rect
if (node.nodeType === 1 || node.getBoundingClientRect) {
rect = node.getBoundingClientRect()
} else if (node.nodeType === 3 && nod... | javascript | function getFragmentRect ({ _fragmentStart, _fragmentEnd }) {
let top, bottom, left, right
util().mapNodeRange(_fragmentStart, _fragmentEnd, function (node) {
let rect
if (node.nodeType === 1 || node.getBoundingClientRect) {
rect = node.getBoundingClientRect()
} else if (node.nodeType === 3 && nod... | [
"function",
"getFragmentRect",
"(",
"{",
"_fragmentStart",
",",
"_fragmentEnd",
"}",
")",
"{",
"let",
"top",
",",
"bottom",
",",
"left",
",",
"right",
"util",
"(",
")",
".",
"mapNodeRange",
"(",
"_fragmentStart",
",",
"_fragmentEnd",
",",
"function",
"(",
... | Highlight a fragment instance.
Loop over its node range and determine its bounding box.
@param {Vue} instance
@return {Object} | [
"Highlight",
"a",
"fragment",
"instance",
".",
"Loop",
"over",
"its",
"node",
"range",
"and",
"determine",
"its",
"bounding",
"box",
"."
] | 4de4b86388453cd07f0c1bf967d43a4dd4b011c9 | https://github.com/vuejs/vue-devtools/blob/4de4b86388453cd07f0c1bf967d43a4dd4b011c9/src/backend/highlighter.js#L106-L136 | train | Get the bounding rect of a fragment | [
30522,
3853,
2131,
27843,
21693,
4765,
30524,
1063,
2292,
28667,
2102,
2065,
1006,
13045,
1012,
13045,
13874,
1027,
1027,
1027,
1015,
1064,
1064,
13045,
1012,
2131,
15494,
2075,
20464,
11638,
2890,
6593,
1007,
1063,
28667,
2102,
1027,
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 | release.js | updateBowerVersion | function updateBowerVersion () {
start('Updating bower version...');
const options = { cwd: './bower-material' };
const bower = require(options.cwd + '/bower.json'),
pkg = require(options.cwd + '/package.json');
// update versions in config files
bower.version = pkg.version = newVers... | javascript | function updateBowerVersion () {
start('Updating bower version...');
const options = { cwd: './bower-material' };
const bower = require(options.cwd + '/bower.json'),
pkg = require(options.cwd + '/package.json');
// update versions in config files
bower.version = pkg.version = newVers... | [
"function",
"updateBowerVersion",
"(",
")",
"{",
"start",
"(",
"'Updating bower version...'",
")",
";",
"const",
"options",
"=",
"{",
"cwd",
":",
"'./bower-material'",
"}",
";",
"const",
"bower",
"=",
"require",
"(",
"options",
".",
"cwd",
"+",
"'/bower.json'"... | updates the version for bower-material in package.json and bower.json | [
"updates",
"the",
"version",
"for",
"bower",
"-",
"material",
"in",
"package",
".",
"json",
"and",
"bower",
".",
"json"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/release.js#L214-L258 | train | Update bower version | [
30522,
3853,
10651,
18912,
2121,
27774,
1006,
1007,
1063,
2707,
1006,
1005,
2039,
16616,
6812,
2121,
2544,
1012,
1012,
1012,
1005,
1007,
1025,
9530,
3367,
7047,
1027,
1063,
19296,
2094,
1024,
1005,
1012,
1013,
6812,
2121,
1011,
3430,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/flow | packages/flow-remove-types/index.js | getSpliceNodeAtPos | function getSpliceNodeAtPos(context, pos, loc, value) {
return createNode({
start: pos,
end: pos,
loc: {start: loc, end: loc},
__spliceValue: value,
});
} | javascript | function getSpliceNodeAtPos(context, pos, loc, value) {
return createNode({
start: pos,
end: pos,
loc: {start: loc, end: loc},
__spliceValue: value,
});
} | [
"function",
"getSpliceNodeAtPos",
"(",
"context",
",",
"pos",
",",
"loc",
",",
"value",
")",
"{",
"return",
"createNode",
"(",
"{",
"start",
":",
"pos",
",",
"end",
":",
"pos",
",",
"loc",
":",
"{",
"start",
":",
"loc",
",",
"end",
":",
"loc",
"}",... | Creates a zero-width "node" with a value to splice at that position. WARNING: This is only safe to use when source maps are off! | [
"Creates",
"a",
"zero",
"-",
"width",
"node",
"with",
"a",
"value",
"to",
"splice",
"at",
"that",
"position",
".",
"WARNING",
":",
"This",
"is",
"only",
"safe",
"to",
"use",
"when",
"source",
"maps",
"are",
"off!"
] | 25bc6aba258658eaf21ccc4722ef7124724a1d2b | https://github.com/facebook/flow/blob/25bc6aba258658eaf21ccc4722ef7124724a1d2b/packages/flow-remove-types/index.js#L399-L406 | train | Get a node at pos with splice value | [
30522,
3853,
4152,
24759,
6610,
3630,
3207,
4017,
6873,
2015,
1006,
6123,
1010,
13433,
2015,
1010,
8840,
2278,
1010,
3643,
1007,
1063,
2709,
3443,
3630,
3207,
1006,
1063,
2707,
1024,
13433,
2015,
1010,
2203,
1024,
13433,
2015,
1010,
8840,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
catapult-project/catapult | tracing/third_party/oboe/src/instanceApi.js | addNodeOrPathListenerApi | function addNodeOrPathListenerApi( eventId, jsonPathOrListenerMap, callback ){
if( isString(jsonPathOrListenerMap) ) {
addSingleNodeOrPathListener(eventId, jsonPathOrListenerMap, callback);
} else {
addMultipleNodeOrPathListeners(eventId, jsonPathOrListenerMap);
}
return oboeApi; // chain... | javascript | function addNodeOrPathListenerApi( eventId, jsonPathOrListenerMap, callback ){
if( isString(jsonPathOrListenerMap) ) {
addSingleNodeOrPathListener(eventId, jsonPathOrListenerMap, callback);
} else {
addMultipleNodeOrPathListeners(eventId, jsonPathOrListenerMap);
}
return oboeApi; // chain... | [
"function",
"addNodeOrPathListenerApi",
"(",
"eventId",
",",
"jsonPathOrListenerMap",
",",
"callback",
")",
"{",
"if",
"(",
"isString",
"(",
"jsonPathOrListenerMap",
")",
")",
"{",
"addSingleNodeOrPathListener",
"(",
"eventId",
",",
"jsonPathOrListenerMap",
",",
"call... | implementation behind .onPath() and .onNode() | [
"implementation",
"behind",
".",
"onPath",
"()",
"and",
".",
"onNode",
"()"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/instanceApi.js#L193-L203 | train | Add a node or multiple listeners | [
30522,
3853,
5587,
3630,
3207,
2953,
15069,
9863,
24454,
9331,
2072,
1006,
2724,
3593,
1010,
1046,
3385,
15069,
2953,
9863,
24454,
2863,
2361,
1010,
2655,
5963,
1007,
1063,
2065,
1006,
26354,
18886,
3070,
1006,
1046,
3385,
15069,
2953,
9863... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
pagekit/vue-resource | dist/vue-resource.esm.js | Request | function Request(options$$1) {
this.body = null;
this.params = {};
assign(this, options$$1, {
method: toUpper(options$$1.method || 'GET')
});
if (!(this.headers instanceof Headers)) {
this.headers = new Headers(this.headers);
}
} | javascript | function Request(options$$1) {
this.body = null;
this.params = {};
assign(this, options$$1, {
method: toUpper(options$$1.method || 'GET')
});
if (!(this.headers instanceof Headers)) {
this.headers = new Headers(this.headers);
}
} | [
"function",
"Request",
"(",
"options$$1",
")",
"{",
"this",
".",
"body",
"=",
"null",
";",
"this",
".",
"params",
"=",
"{",
"}",
";",
"assign",
"(",
"this",
",",
"options$$1",
",",
"{",
"method",
":",
"toUpper",
"(",
"options$$1",
".",
"method",
"||"... | HTTP Request. | [
"HTTP",
"Request",
"."
] | fe268fa1d6053ede5f34aef9a11e1a424a70446c | https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1334-L1346 | train | Construct a new Request | [
30522,
3853,
5227,
1006,
7047,
1002,
1002,
1015,
1007,
1063,
2023,
1012,
2303,
1027,
19701,
1025,
2023,
1012,
11498,
5244,
1027,
1063,
1065,
1025,
23911,
1006,
2023,
1010,
7047,
1002,
1002,
1015,
1010,
1063,
4118,
1024,
2000,
29547,
2099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | eval_locator | function eval_locator(locator, inDocument, opt_contextNode)
{
locator = parse_locator(locator);
var pageBot;
if (typeof(selenium) != 'undefined' && selenium != undefined) {
if (typeof(editor) == 'undefined' || editor.state == 'playing') {
safe_log('info', 'Trying [' + locator.type + ']:... | javascript | function eval_locator(locator, inDocument, opt_contextNode)
{
locator = parse_locator(locator);
var pageBot;
if (typeof(selenium) != 'undefined' && selenium != undefined) {
if (typeof(editor) == 'undefined' || editor.state == 'playing') {
safe_log('info', 'Trying [' + locator.type + ']:... | [
"function",
"eval_locator",
"(",
"locator",
",",
"inDocument",
",",
"opt_contextNode",
")",
"{",
"locator",
"=",
"parse_locator",
"(",
"locator",
")",
";",
"var",
"pageBot",
";",
"if",
"(",
"typeof",
"(",
"selenium",
")",
"!=",
"'undefined'",
"&&",
"selenium... | This function duplicates part of BrowserBot.findElement() to open up locator
evaluation on arbitrary documents. It returns a plain old array of located
elements found by using a Selenium locator.
Multiple results may be generated for xpath and CSS locators. Even though a
list could potentially be generated for other l... | [
"This",
"function",
"duplicates",
"part",
"of",
"BrowserBot",
".",
"findElement",
"()",
"to",
"open",
"up",
"locator",
"evaluation",
"on",
"arbitrary",
"documents",
".",
"It",
"returns",
"a",
"plain",
"old",
"array",
"of",
"located",
"elements",
"found",
"by",... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L2214-L2258 | train | eval locator inDocument | [
30522,
3853,
9345,
2140,
1035,
8840,
11266,
2953,
1006,
8840,
11266,
2953,
1010,
11424,
24894,
4765,
1010,
23569,
1035,
6123,
3630,
3207,
1007,
1063,
8840,
11266,
2953,
1027,
11968,
3366,
1035,
8840,
11266,
2953,
1006,
8840,
11266,
2953,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/toast/toast.js | MdToastDirective | function MdToastDirective($mdToast) {
return {
restrict: 'E',
link: function postLink(scope, element) {
element.addClass('_md'); // private md component indicator for styling
// When navigation force destroys an interimElement, then
// listen and $destroy() that interim instance...
... | javascript | function MdToastDirective($mdToast) {
return {
restrict: 'E',
link: function postLink(scope, element) {
element.addClass('_md'); // private md component indicator for styling
// When navigation force destroys an interimElement, then
// listen and $destroy() that interim instance...
... | [
"function",
"MdToastDirective",
"(",
"$mdToast",
")",
"{",
"return",
"{",
"restrict",
":",
"'E'",
",",
"link",
":",
"function",
"postLink",
"(",
"scope",
",",
"element",
")",
"{",
"element",
".",
"addClass",
"(",
"'_md'",
")",
";",
"// private md component i... | /* @ngInject | [
"/",
"*"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/toast/toast.js#L15-L28 | train | Directive to show a md toast | [
30522,
3853,
9108,
3406,
14083,
4305,
2890,
15277,
1006,
1002,
9108,
3406,
14083,
1007,
1063,
2709,
1063,
21573,
1024,
1005,
1041,
1005,
1010,
4957,
1024,
3853,
2695,
13767,
1006,
9531,
1010,
5783,
1007,
1063,
5783,
1012,
5587,
26266,
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... |
dcloudio/mui | examples/hello-mui/js/mui.picker.all.js | function() {
var self = this;
var items = [];
for (var i in self.pickers) {
var picker = self.pickers[i];
items.push(picker.getSelectedItem() || {});
}
return items;
} | javascript | function() {
var self = this;
var items = [];
for (var i in self.pickers) {
var picker = self.pickers[i];
items.push(picker.getSelectedItem() || {});
}
return items;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"items",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"in",
"self",
".",
"pickers",
")",
"{",
"var",
"picker",
"=",
"self",
".",
"pickers",
"[",
"i",
"]",
";",
"items",
".",
"p... | 获取选中的项(数组) | [
"获取选中的项(数组)"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/hello-mui/js/mui.picker.all.js#L501-L509 | train | Returns an array of items from the selected items | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
5167,
1027,
1031,
1033,
1025,
2005,
1006,
13075,
1045,
1999,
2969,
1012,
4060,
2545,
1007,
1063,
13075,
4060,
2121,
1027,
2969,
1012,
4060,
2545,
1031,
1045,
1033,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/utils/Async.js | promisify | function promisify(obj, method) {
var result = new $.Deferred(),
args = Array.prototype.slice.call(arguments, 2);
args.push(function (err) {
if (err) {
result.reject(err);
} else {
result.resolve.apply(result, Array.prototype.slice.call... | javascript | function promisify(obj, method) {
var result = new $.Deferred(),
args = Array.prototype.slice.call(arguments, 2);
args.push(function (err) {
if (err) {
result.reject(err);
} else {
result.resolve.apply(result, Array.prototype.slice.call... | [
"function",
"promisify",
"(",
"obj",
",",
"method",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"args",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"2",
")",
";",
"args",
".",
... | Utility for converting a method that takes (error, callback) to one that returns a promise;
useful for using FileSystem methods (or other Node-style API methods) in a promise-oriented
workflow. For example, instead of
var deferred = new $.Deferred();
file.read(function (err, contents) {
if (err) {
deferred.reject(err)... | [
"Utility",
"for",
"converting",
"a",
"method",
"that",
"takes",
"(",
"error",
"callback",
")",
"to",
"one",
"that",
"returns",
"a",
"promise",
";",
"useful",
"for",
"using",
"FileSystem",
"methods",
"(",
"or",
"other",
"Node",
"-",
"style",
"API",
"methods... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/Async.js#L493-L505 | train | promisify method | [
30522,
3853,
30524,
3501,
1010,
4118,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
12098,
5620,
1027,
9140,
1012,
8773,
1012,
14704,
1012,
2655,
1006,
9918,
1010,
1016,
1007,
1025,
12098,
5620,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/language/XMLUtils.js | getTagInfo | function getTagInfo(editor, pos) {
var ctx, offset, tagAttrs, tagAttrValue;
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
offset = TokenUtils.offsetInToken(ctx);
if (ctx.token && ctx.token.type === "tag bracket" && ctx.token.string === "<") {
// Returns tagIn... | javascript | function getTagInfo(editor, pos) {
var ctx, offset, tagAttrs, tagAttrValue;
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
offset = TokenUtils.offsetInToken(ctx);
if (ctx.token && ctx.token.type === "tag bracket" && ctx.token.string === "<") {
// Returns tagIn... | [
"function",
"getTagInfo",
"(",
"editor",
",",
"pos",
")",
"{",
"var",
"ctx",
",",
"offset",
",",
"tagAttrs",
",",
"tagAttrValue",
";",
"ctx",
"=",
"TokenUtils",
".",
"getInitialContext",
"(",
"editor",
".",
"_codeMirror",
",",
"pos",
")",
";",
"offset",
... | Return the tag info at a given position in the active editor
@param {!Editor} editor Instance of active editor
@param {!{line: number, ch: number}} pos Position of cursor in the editor
@return {!{token: Object, tokenType: number, offset: number, exclusionList: Array.<string>, tagName: string, attrName: string, shouldR... | [
"Return",
"the",
"tag",
"info",
"at",
"a",
"given",
"position",
"in",
"the",
"active",
"editor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/XMLUtils.js#L229-L270 | train | Returns tagInfo when a tag is created. | [
30522,
3853,
2131,
15900,
2378,
14876,
1006,
3559,
1010,
13433,
2015,
1007,
1063,
13075,
14931,
2595,
1010,
16396,
1010,
6415,
19321,
2869,
1010,
6415,
19321,
26585,
5657,
1025,
14931,
2595,
1027,
19204,
21823,
4877,
1012,
2131,
5498,
20925,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/language/CodeInspection.js | toggleCollapsed | function toggleCollapsed(collapsed, doNotSave) {
if (collapsed === undefined) {
collapsed = !_collapsed;
}
if (collapsed === _collapsed) {
return;
}
_collapsed = collapsed;
if (!doNotSave) {
prefs.set(PREF_COLLAPSED, _collapsed);
... | javascript | function toggleCollapsed(collapsed, doNotSave) {
if (collapsed === undefined) {
collapsed = !_collapsed;
}
if (collapsed === _collapsed) {
return;
}
_collapsed = collapsed;
if (!doNotSave) {
prefs.set(PREF_COLLAPSED, _collapsed);
... | [
"function",
"toggleCollapsed",
"(",
"collapsed",
",",
"doNotSave",
")",
"{",
"if",
"(",
"collapsed",
"===",
"undefined",
")",
"{",
"collapsed",
"=",
"!",
"_collapsed",
";",
"}",
"if",
"(",
"collapsed",
"===",
"_collapsed",
")",
"{",
"return",
";",
"}",
"... | Toggle the collapsed state for the panel. This explicitly collapses the panel (as opposed to
the auto collapse due to files with no errors & filetypes with no provider). When explicitly
collapsed, the panel will not reopen automatically on switch files or save.
@param {?boolean} collapsed Collapsed state. If omitted, ... | [
"Toggle",
"the",
"collapsed",
"state",
"for",
"the",
"panel",
".",
"This",
"explicitly",
"collapses",
"the",
"panel",
"(",
"as",
"opposed",
"to",
"the",
"auto",
"collapse",
"due",
"to",
"files",
"with",
"no",
"errors",
"&",
"filetypes",
"with",
"no",
"prov... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L591-L613 | train | Toggle Collapsed | [
30522,
3853,
2000,
24679,
26895,
9331,
6924,
1006,
7798,
1010,
2123,
12868,
10696,
1007,
1063,
2065,
1006,
7798,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
7798,
1027,
999,
1035,
7798,
1025,
1065,
2065,
1006,
7798,
1027,
1027,
1027,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | function(pt, cos, sin, c)
{
c = (c != null) ? c : new mxPoint();
var x = pt.x - c.x;
var y = pt.y - c.y;
var x1 = x * cos - y * sin;
var y1 = y * cos + x * sin;
return new mxPoint(x1 + c.x, y1 + c.y);
} | javascript | function(pt, cos, sin, c)
{
c = (c != null) ? c : new mxPoint();
var x = pt.x - c.x;
var y = pt.y - c.y;
var x1 = x * cos - y * sin;
var y1 = y * cos + x * sin;
return new mxPoint(x1 + c.x, y1 + c.y);
} | [
"function",
"(",
"pt",
",",
"cos",
",",
"sin",
",",
"c",
")",
"{",
"c",
"=",
"(",
"c",
"!=",
"null",
")",
"?",
"c",
":",
"new",
"mxPoint",
"(",
")",
";",
"var",
"x",
"=",
"pt",
".",
"x",
"-",
"c",
".",
"x",
";",
"var",
"y",
"=",
"pt",
... | Function: getRotatedPoint
Rotates the given point by the given cos and sin. | [
"Function",
":",
"getRotatedPoint"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L4248-L4258 | train | Returns the point at which the given point is in the clipped region | [
30522,
3853,
1006,
13866,
1010,
2522,
2015,
1010,
8254,
1010,
1039,
1007,
1063,
1039,
1027,
1006,
1039,
999,
1027,
19701,
1007,
1029,
1039,
1024,
2047,
25630,
8400,
1006,
1007,
1025,
13075,
1060,
1027,
13866,
1012,
1060,
1011,
1039,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function(array, from, to) {
var rest = array.slice((to || from) + 1 || array.length);
array.length = from < 0 ? array.length + from : from;
return array.push.apply(array, rest);
} | javascript | function(array, from, to) {
var rest = array.slice((to || from) + 1 || array.length);
array.length = from < 0 ? array.length + from : from;
return array.push.apply(array, rest);
} | [
"function",
"(",
"array",
",",
"from",
",",
"to",
")",
"{",
"var",
"rest",
"=",
"array",
".",
"slice",
"(",
"(",
"to",
"||",
"from",
")",
"+",
"1",
"||",
"array",
".",
"length",
")",
";",
"array",
".",
"length",
"=",
"from",
"<",
"0",
"?",
"a... | TODO helper method to remove elements from array
@private | [
"TODO",
"helper",
"method",
"to",
"remove",
"elements",
"from",
"array"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3654-L3658 | train | Add a range of items to an array | [
30522,
3853,
1006,
9140,
1010,
2013,
1010,
2000,
1007,
1063,
13075,
2717,
1027,
9140,
1012,
14704,
1006,
1006,
2000,
1064,
1064,
2013,
1007,
1009,
1015,
1064,
1064,
9140,
1012,
3091,
1007,
1025,
9140,
1012,
3091,
1027,
2013,
1026,
1014,
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... | |
quasarframework/quasar | cli/lib/generate.js | filterFiles | function filterFiles (filters) {
return (files, metalsmith, done) => {
filter(files, filters, metalsmith.metadata(), done)
}
} | javascript | function filterFiles (filters) {
return (files, metalsmith, done) => {
filter(files, filters, metalsmith.metadata(), done)
}
} | [
"function",
"filterFiles",
"(",
"filters",
")",
"{",
"return",
"(",
"files",
",",
"metalsmith",
",",
"done",
")",
"=>",
"{",
"filter",
"(",
"files",
",",
"filters",
",",
"metalsmith",
".",
"metadata",
"(",
")",
",",
"done",
")",
"}",
"}"
] | Create a middleware for filtering files.
@param {Object} filters
@return {Function} | [
"Create",
"a",
"middleware",
"for",
"filtering",
"files",
"."
] | 5d2fb6c96bff6095236f8ca6fe07a037e32e06b3 | https://github.com/quasarframework/quasar/blob/5d2fb6c96bff6095236f8ca6fe07a037e32e06b3/cli/lib/generate.js#L106-L110 | train | filter files by filter | [
30522,
3853,
11307,
8873,
4244,
1006,
17736,
1007,
1063,
2709,
1006,
6764,
1010,
11970,
19864,
1010,
2589,
1007,
1027,
1028,
1063,
11307,
1006,
6764,
1010,
17736,
1010,
11970,
19864,
1012,
27425,
1006,
1007,
1010,
2589,
1007,
1065,
1065,
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... |
SheetJS/js-xlsx | bits/62_fxls.js | parse_PtgExtraArray | function parse_PtgExtraArray(blob, length, opts) {
var rows = 0, cols = 0;
if(opts.biff == 12) {
rows = blob.read_shift(4); // DRw
cols = blob.read_shift(4); // DCol
} else {
cols = 1 + blob.read_shift(1); //DColByteU
rows = 1 + blob.read_shift(2); //DRw
}
if(opts.biff >= 2 && opts.biff < 8) { --rows; if(-... | javascript | function parse_PtgExtraArray(blob, length, opts) {
var rows = 0, cols = 0;
if(opts.biff == 12) {
rows = blob.read_shift(4); // DRw
cols = blob.read_shift(4); // DCol
} else {
cols = 1 + blob.read_shift(1); //DColByteU
rows = 1 + blob.read_shift(2); //DRw
}
if(opts.biff >= 2 && opts.biff < 8) { --rows; if(-... | [
"function",
"parse_PtgExtraArray",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"var",
"rows",
"=",
"0",
",",
"cols",
"=",
"0",
";",
"if",
"(",
"opts",
".",
"biff",
"==",
"12",
")",
"{",
"rows",
"=",
"blob",
".",
"read_shift",
"(",
"4",
")"... | /* [MS-XLS] 2.5.198.59 ; [MS-XLSB] 2.5.97.41 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"5",
".",
"198",
".",
"59",
";",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"5",
".",
"97",
".",
"41"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/62_fxls.js#L311-L325 | train | Parse an extra array | [
30522,
3853,
11968,
3366,
1035,
13866,
3351,
18413,
2527,
2906,
9447,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
13075,
10281,
1027,
1014,
1010,
8902,
2015,
1027,
1014,
1025,
2065,
1006,
23569,
2015,
1012,
12170,
424... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-named-capture-group.js | checkRegex | function checkRegex(regex, node, uFlag) {
let ast;
try {
ast = parser.parsePattern(regex, 0, regex.length, uFlag);
} catch (_) {
// ignore regex syntax errors
return;
}
regexpp.visitRegExpAST(ast, {
... | javascript | function checkRegex(regex, node, uFlag) {
let ast;
try {
ast = parser.parsePattern(regex, 0, regex.length, uFlag);
} catch (_) {
// ignore regex syntax errors
return;
}
regexpp.visitRegExpAST(ast, {
... | [
"function",
"checkRegex",
"(",
"regex",
",",
"node",
",",
"uFlag",
")",
"{",
"let",
"ast",
";",
"try",
"{",
"ast",
"=",
"parser",
".",
"parsePattern",
"(",
"regex",
",",
"0",
",",
"regex",
".",
"length",
",",
"uFlag",
")",
";",
"}",
"catch",
"(",
... | Function to check regular expression.
@param {string} regex The regular expression to be check.
@param {ASTNode} node AST node which contains regular expression.
@param {boolean} uFlag Flag indicates whether unicode mode is enabled or not.
@returns {void} | [
"Function",
"to",
"check",
"regular",
"expression",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-named-capture-group.js#L58-L94 | train | Check if a regular expression is valid | [
30522,
3853,
4638,
2890,
3351,
2595,
1006,
19723,
10288,
1010,
13045,
1010,
1057,
10258,
8490,
1007,
1063,
2292,
2004,
2102,
1025,
3046,
1063,
2004,
2102,
1027,
11968,
8043,
1012,
11968,
3366,
4502,
12079,
2078,
1006,
19723,
10288,
1010,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Batch.js | getHeaderParameterValue | function getHeaderParameterValue(sHeaderValue, sParameterName) {
var iParamIndex,
aHeaderParts = sHeaderValue.split(";"),
aMatches;
sParameterName = sParameterName.toLowerCase();
for (iParamIndex = 1; iParamIndex < aHeaderParts.length; iParamIndex += 1) {
// remove possible quotes via reg exp
// RFC7... | javascript | function getHeaderParameterValue(sHeaderValue, sParameterName) {
var iParamIndex,
aHeaderParts = sHeaderValue.split(";"),
aMatches;
sParameterName = sParameterName.toLowerCase();
for (iParamIndex = 1; iParamIndex < aHeaderParts.length; iParamIndex += 1) {
// remove possible quotes via reg exp
// RFC7... | [
"function",
"getHeaderParameterValue",
"(",
"sHeaderValue",
",",
"sParameterName",
")",
"{",
"var",
"iParamIndex",
",",
"aHeaderParts",
"=",
"sHeaderValue",
".",
"split",
"(",
"\";\"",
")",
",",
"aMatches",
";",
"sParameterName",
"=",
"sParameterName",
".",
"toLow... | Extracts value of the parameter with the specified <code>sParameterName</code>
from the specified <code>sHeaderValue</code>.
@param {string} sHeaderValue
HTTP header value e.g. "application/json;charset=utf-8"
@param {string} sParameterName
Name of HTTP header parameter e.g. "charset"
@returns {string} The HTTP header... | [
"Extracts",
"value",
"of",
"the",
"parameter",
"with",
"the",
"specified",
"<code",
">",
"sParameterName<",
"/",
"code",
">",
"from",
"the",
"specified",
"<code",
">",
"sHeaderValue<",
"/",
"code",
">",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Batch.js#L50-L64 | train | Get the value of a header parameter | [
30522,
3853,
2131,
4974,
2121,
28689,
22828,
10175,
5657,
1006,
16994,
4063,
10175,
5657,
1010,
12403,
6444,
15141,
18442,
30524,
26950,
1027,
16994,
4063,
10175,
5657,
1012,
3975,
1006,
1000,
1025,
1000,
1007,
1010,
25933,
10649,
2229,
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... |
goldfire/howler.js | dist/howler.js | function(o) {
var self = this;
// Throw an error if no source is provided.
if (!o.src || o.src.length === 0) {
console.error('An array of source files must be passed with any new Howl.');
return;
}
self.init(o);
} | javascript | function(o) {
var self = this;
// Throw an error if no source is provided.
if (!o.src || o.src.length === 0) {
console.error('An array of source files must be passed with any new Howl.');
return;
}
self.init(o);
} | [
"function",
"(",
"o",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Throw an error if no source is provided.",
"if",
"(",
"!",
"o",
".",
"src",
"||",
"o",
".",
"src",
".",
"length",
"===",
"0",
")",
"{",
"console",
".",
"error",
"(",
"'An array of sourc... | Group Methods * ************************************************************************
Create an audio group controller.
@param {Object} o Passed in properties for this group. | [
"Group",
"Methods",
"*",
"************************************************************************",
"Create",
"an",
"audio",
"group",
"controller",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L528-L538 | train | This function is called by the howl constructor to create a new Howl object. | [
30522,
3853,
1006,
1051,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
1013,
1013,
5466,
2019,
7561,
2065,
2053,
3120,
2003,
3024,
1012,
2065,
1006,
999,
1051,
1012,
5034,
2278,
1064,
1064,
1051,
1012,
5034,
2278,
1012,
3091,
1027,
1027,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/DraftEnabledMockServer.js | function(oAnnotations, oMockServer) {
// callback function to update draft specific properties post creation
var fnNewDraftPost = function(oEvent) {
var oNewEntity = oEvent.getParameter("oEntity");
oNewEntity.IsActiveEntity = false;
oNewEntity.HasActiveEntity = false;
oNewEntity.HasDraftEntity = f... | javascript | function(oAnnotations, oMockServer) {
// callback function to update draft specific properties post creation
var fnNewDraftPost = function(oEvent) {
var oNewEntity = oEvent.getParameter("oEntity");
oNewEntity.IsActiveEntity = false;
oNewEntity.HasActiveEntity = false;
oNewEntity.HasDraftEntity = f... | [
"function",
"(",
"oAnnotations",
",",
"oMockServer",
")",
"{",
"// callback function to update draft specific properties post creation",
"var",
"fnNewDraftPost",
"=",
"function",
"(",
"oEvent",
")",
"{",
"var",
"oNewEntity",
"=",
"oEvent",
".",
"getParameter",
"(",
"\"o... | Enriches MockServer with draft capabilities based on the given OData service annotations.
@param {object} oAnnotations annotation object of sap.ui.model.odata.ODataModel
@param {object} oMockServer | [
"Enriches",
"MockServer",
"with",
"draft",
"capabilities",
"based",
"on",
"the",
"given",
"OData",
"service",
"annotations",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/DraftEnabledMockServer.js#L28-L124 | train | Updates the draft specific properties | [
30522,
3853,
1006,
1051,
11639,
17287,
9285,
1010,
18168,
25384,
2121,
6299,
1007,
1063,
1013,
1013,
2655,
5963,
3853,
2000,
10651,
4433,
3563,
5144,
2695,
4325,
13075,
1042,
10087,
21724,
27528,
25856,
14122,
1027,
3853,
1006,
1051,
18697,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
pagekit/vue-resource | dist/vue-resource.esm.js | json | function json (request) {
var type = request.headers.get('Content-Type') || '';
if (isObject(request.body) && type.indexOf('application/json') === 0) {
request.body = JSON.stringify(request.body);
}
return function (response) {
return response.bodyText ? when(response.text(), functio... | javascript | function json (request) {
var type = request.headers.get('Content-Type') || '';
if (isObject(request.body) && type.indexOf('application/json') === 0) {
request.body = JSON.stringify(request.body);
}
return function (response) {
return response.bodyText ? when(response.text(), functio... | [
"function",
"json",
"(",
"request",
")",
"{",
"var",
"type",
"=",
"request",
".",
"headers",
".",
"get",
"(",
"'Content-Type'",
")",
"||",
"''",
";",
"if",
"(",
"isObject",
"(",
"request",
".",
"body",
")",
"&&",
"type",
".",
"indexOf",
"(",
"'applic... | JSON Interceptor. | [
"JSON",
"Interceptor",
"."
] | fe268fa1d6053ede5f34aef9a11e1a424a70446c | https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L863-L894 | train | json - json | [
30522,
3853,
1046,
3385,
1006,
5227,
1007,
1063,
13075,
2828,
1027,
5227,
1012,
20346,
2015,
1012,
2131,
1006,
1005,
4180,
1011,
2828,
1005,
1007,
1064,
1064,
1005,
1005,
1025,
2065,
1006,
11163,
2497,
20614,
1006,
5227,
1012,
2303,
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... |
facebook/relay | packages/relay-runtime/handlers/connection/RelayConnectionHandler.js | getConnection | function getConnection(
record: ReadOnlyRecordProxy,
key: string,
filters?: ?Variables,
): ?RecordProxy {
const handleKey = getRelayHandleKey(CONNECTION, key, null);
return record.getLinkedRecord(handleKey, filters);
} | javascript | function getConnection(
record: ReadOnlyRecordProxy,
key: string,
filters?: ?Variables,
): ?RecordProxy {
const handleKey = getRelayHandleKey(CONNECTION, key, null);
return record.getLinkedRecord(handleKey, filters);
} | [
"function",
"getConnection",
"(",
"record",
":",
"ReadOnlyRecordProxy",
",",
"key",
":",
"string",
",",
"filters",
"?",
":",
"?",
"Variables",
",",
")",
":",
"?",
"RecordProxy",
"{",
"const",
"handleKey",
"=",
"getRelayHandleKey",
"(",
"CONNECTION",
",",
"ke... | @public
Given a record and the name of the schema field for which a connection was
fetched, returns the linked connection record.
Example:
Given that data has already been fetched on some user `<id>` on the `friends`
field:
```
fragment FriendsFragment on User {
friends(first: 10) @connection(key: "FriendsFragment_... | [
"@public"
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-runtime/handlers/connection/RelayConnectionHandler.js#L248-L255 | train | Get a connection to a connection | [
30522,
3853,
2131,
8663,
2638,
7542,
1006,
2501,
1024,
3191,
2239,
2135,
2890,
27108,
18927,
3217,
18037,
1010,
3145,
1024,
5164,
1010,
17736,
1029,
1024,
1029,
10857,
1010,
1007,
1024,
1029,
2501,
21572,
18037,
1063,
9530,
3367,
5047,
1483... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function(sName) {
if (this._oMeasureSet[sName]) { // the easy case
return this._oMeasureSet[sName];
}
for ( var sMeasureName in this._oMeasureSet) {
var oMeasure = this._oMeasureSet[sMeasureName];
var oFormattedValueProperty = oMeasure.getFormattedValueProperty();
if (oFormattedValueProperty &... | javascript | function(sName) {
if (this._oMeasureSet[sName]) { // the easy case
return this._oMeasureSet[sName];
}
for ( var sMeasureName in this._oMeasureSet) {
var oMeasure = this._oMeasureSet[sMeasureName];
var oFormattedValueProperty = oMeasure.getFormattedValueProperty();
if (oFormattedValueProperty &... | [
"function",
"(",
"sName",
")",
"{",
"if",
"(",
"this",
".",
"_oMeasureSet",
"[",
"sName",
"]",
")",
"{",
"// the easy case",
"return",
"this",
".",
"_oMeasureSet",
"[",
"sName",
"]",
";",
"}",
"for",
"(",
"var",
"sMeasureName",
"in",
"this",
".",
"_oMe... | Find measure by property name
@param {string}
sName Property name
@returns {sap.ui.model.analytics.odata4analytics.Measure} The measure object to which
the given property name is related, because the property holds
the raw measure value or its formatted value. If no such measure
exists, null is returned.
@public
@func... | [
"Find",
"measure",
"by",
"property",
"name"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1163-L1176 | train | Returns the measure with the given name | [
30522,
3853,
1006,
1055,
18442,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
18168,
5243,
28632,
13462,
1031,
1055,
18442,
1033,
1007,
1063,
1013,
1013,
1996,
3733,
2553,
2709,
2023,
1012,
1035,
18168,
5243,
28632,
13462,
1031,
1055,
18442,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/jszip.js | function(options) {
options = extend(options || {}, {
base64: true,
compression: "STORE",
type: "base64"
});
utils.checkSupport(options.type);
var zipData = [],
localDirLength = 0,
centralDirLength = 0,
writer, i;
... | javascript | function(options) {
options = extend(options || {}, {
base64: true,
compression: "STORE",
type: "base64"
});
utils.checkSupport(options.type);
var zipData = [],
localDirLength = 0,
centralDirLength = 0,
writer, i;
... | [
"function",
"(",
"options",
")",
"{",
"options",
"=",
"extend",
"(",
"options",
"||",
"{",
"}",
",",
"{",
"base64",
":",
"true",
",",
"compression",
":",
"\"STORE\"",
",",
"type",
":",
"\"base64\"",
"}",
")",
";",
"utils",
".",
"checkSupport",
"(",
"... | Generate the complete zip file
@param {Object} options the options to generate the zip file :
- base64, (deprecated, use type instead) true to generate base64.
- compression, "STORE" by default.
- type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob.
@return {String|Uint8Array|ArrayBuff... | [
"Generate",
"the",
"complete",
"zip",
"file"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jszip.js#L1022-L1116 | train | Generate central directory | [
30522,
3853,
1006,
7047,
1007,
1063,
7047,
1027,
7949,
1006,
7047,
1064,
1064,
1063,
1065,
1010,
1063,
2918,
21084,
1024,
2995,
1010,
13379,
1024,
1000,
3573,
1000,
1010,
2828,
1024,
1000,
2918,
21084,
1000,
1065,
1007,
1025,
21183,
12146,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
moleculerjs/moleculer | src/middlewares/circuit-breaker.js | success | function success(item, ctx) {
item.count++;
if (item.state === C.CIRCUIT_HALF_OPEN_WAIT)
circuitClose(item, ctx);
else
checkThreshold(item, ctx);
} | javascript | function success(item, ctx) {
item.count++;
if (item.state === C.CIRCUIT_HALF_OPEN_WAIT)
circuitClose(item, ctx);
else
checkThreshold(item, ctx);
} | [
"function",
"success",
"(",
"item",
",",
"ctx",
")",
"{",
"item",
".",
"count",
"++",
";",
"if",
"(",
"item",
".",
"state",
"===",
"C",
".",
"CIRCUIT_HALF_OPEN_WAIT",
")",
"circuitClose",
"(",
"item",
",",
"ctx",
")",
";",
"else",
"checkThreshold",
"("... | Increment request counter and switch CB to CLOSE if it is on HALF_OPEN_WAIT.
@param {Object} item
@param {Context} ctx | [
"Increment",
"request",
"counter",
"and",
"switch",
"CB",
"to",
"CLOSE",
"if",
"it",
"is",
"on",
"HALF_OPEN_WAIT",
"."
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/circuit-breaker.js#L93-L100 | train | Called when a success event is received from the network. | [
30522,
3853,
3112,
1006,
8875,
1010,
14931,
2595,
1007,
1063,
8875,
1012,
4175,
1009,
1009,
1025,
2065,
1006,
8875,
1012,
2110,
1027,
1027,
1027,
1039,
1012,
4984,
1035,
2431,
1035,
2330,
1035,
3524,
1007,
4984,
20464,
9232,
1006,
8875,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js | function () {
var oModel = this._oDialog.getModel("view"),
sSelectedLocation = oModel.getProperty("/SelectedLocation"),
sStandardUrl = oModel.getProperty("/StandardBootstrapURL"),
sCustomUrl = oModel.getProperty("/CustomBootstrapURL"),
aSupportedUrls = [],
sBootstrapURL;
oModel.getProperty("/... | javascript | function () {
var oModel = this._oDialog.getModel("view"),
sSelectedLocation = oModel.getProperty("/SelectedLocation"),
sStandardUrl = oModel.getProperty("/StandardBootstrapURL"),
sCustomUrl = oModel.getProperty("/CustomBootstrapURL"),
aSupportedUrls = [],
sBootstrapURL;
oModel.getProperty("/... | [
"function",
"(",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"sSelectedLocation",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/SelectedLocation\"",
")",
",",
"sStandardUrl",
"=",
"oModel",
".",
"getProp... | Opens the support assistant with the given configuration | [
"Opens",
"the",
"support",
"assistant",
"with",
"the",
"given",
"configuration"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L302-L335 | train | Sets the selected location and the default bootstrap URL | [
30522,
3853,
1006,
1007,
1063,
13075,
18168,
10244,
2140,
1027,
2023,
1012,
1035,
21045,
23067,
2290,
1012,
2131,
5302,
9247,
1006,
1000,
3193,
1000,
1007,
1010,
7020,
12260,
10985,
4135,
10719,
1027,
18168,
10244,
2140,
1012,
2131,
21572,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
LLK/scratch-blocks | blocks_vertical/data.js | function() {
this.jsonInit({
"message0": Blockly.Msg.DATA_ITEMOFLIST,
"args0": [
{
"type": "input_value",
"name": "INDEX"
},
{
"type": "field_variable",
"name": "LIST",
"variableTypes": [Blockly.LIST_VARIABLE_TYPE]
}
... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.DATA_ITEMOFLIST,
"args0": [
{
"type": "input_value",
"name": "INDEX"
},
{
"type": "field_variable",
"name": "LIST",
"variableTypes": [Blockly.LIST_VARIABLE_TYPE]
}
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"DATA_ITEMOFLIST",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"input_value\"",
",",
"\"name\"",
":",
"\"INDEX\"",
"}",
",",
"{",
"\"ty... | Block for reporting item of list.
@this Blockly.Block | [
"Block",
"for",
"reporting",
"item",
"of",
"list",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/data.js#L365-L384 | train | Block for the
. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
2951,
1035,
8875,
11253,
9863,
1010,
1000,
12098,
5620,
2692,
1000,
1024,
1031,
1063,
1000,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | xlsx.js | parse_XTI | function parse_XTI(blob, length, opts) {
var w = opts.biff > 8 ? 4 : 2;
var iSupBook = blob.read_shift(w), itabFirst = blob.read_shift(w,'i'), itabLast = blob.read_shift(w,'i');
return [iSupBook, itabFirst, itabLast];
} | javascript | function parse_XTI(blob, length, opts) {
var w = opts.biff > 8 ? 4 : 2;
var iSupBook = blob.read_shift(w), itabFirst = blob.read_shift(w,'i'), itabLast = blob.read_shift(w,'i');
return [iSupBook, itabFirst, itabLast];
} | [
"function",
"parse_XTI",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"var",
"w",
"=",
"opts",
".",
"biff",
">",
"8",
"?",
"4",
":",
"2",
";",
"var",
"iSupBook",
"=",
"blob",
".",
"read_shift",
"(",
"w",
")",
",",
"itabFirst",
"=",
"blob",
... | /* [MS-XLS] 2.5.344 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"5",
".",
"344"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L5599-L5603 | train | XTI - 2. 5 | [
30522,
3853,
11968,
3366,
1035,
1060,
3775,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
13075,
1059,
1027,
23569,
2015,
1012,
12170,
4246,
1028,
1022,
1029,
1018,
1024,
1016,
1025,
13075,
2003,
6279,
8654,
1027,
1038,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/FileViewController.js | addToWorkingSetAndSelect | function addToWorkingSetAndSelect(fullPath) {
DeprecationWarning.deprecationWarning("Use FileViewController.openFileAndAddToWorkingSet() instead of FileViewController.addToWorkingSetAndSelect().", true);
var result = new $.Deferred();
openFileAndAddToWorkingSet(fullPath)
.done(functi... | javascript | function addToWorkingSetAndSelect(fullPath) {
DeprecationWarning.deprecationWarning("Use FileViewController.openFileAndAddToWorkingSet() instead of FileViewController.addToWorkingSetAndSelect().", true);
var result = new $.Deferred();
openFileAndAddToWorkingSet(fullPath)
.done(functi... | [
"function",
"addToWorkingSetAndSelect",
"(",
"fullPath",
")",
"{",
"DeprecationWarning",
".",
"deprecationWarning",
"(",
"\"Use FileViewController.openFileAndAddToWorkingSet() instead of FileViewController.addToWorkingSetAndSelect().\"",
",",
"true",
")",
";",
"var",
"result",
"=",... | Opens the specified document if it's not already open, adds it to the working set,
and selects it in the WorkingSetView
@deprecated use FileViewController.openFileAndAddToWorkingSet() instead
@param {!fullPath}
@return {!$.Promise} | [
"Opens",
"the",
"specified",
"document",
"if",
"it",
"s",
"not",
"already",
"open",
"adds",
"it",
"to",
"the",
"working",
"set",
"and",
"selects",
"it",
"in",
"the",
"WorkingSetView"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileViewController.js#L236-L253 | train | Add a file to the working set and select it | [
30522,
3853,
5587,
18790,
2953,
6834,
13462,
29560,
12260,
6593,
1006,
2440,
15069,
1007,
1063,
2139,
28139,
10719,
9028,
5582,
1012,
2139,
28139,
10719,
9028,
5582,
1006,
1000,
2224,
5371,
8584,
8663,
13181,
10820,
1012,
2330,
8873,
20898,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/format/NumberFormat.js | findLongestMatch | function findLongestMatch(sValue, mCollection) {
var sSymbol = "", sCode, sCurSymbol;
for (var sCurCode in mCollection) {
sCurSymbol = mCollection[sCurCode];
if (sValue.indexOf(sCurSymbol) >= 0 && sSymbol.length < sCurSymbol.length) {
sSymbol = sCurSymbol;
sCode = sCurCode;
}
}
return {
sy... | javascript | function findLongestMatch(sValue, mCollection) {
var sSymbol = "", sCode, sCurSymbol;
for (var sCurCode in mCollection) {
sCurSymbol = mCollection[sCurCode];
if (sValue.indexOf(sCurSymbol) >= 0 && sSymbol.length < sCurSymbol.length) {
sSymbol = sCurSymbol;
sCode = sCurCode;
}
}
return {
sy... | [
"function",
"findLongestMatch",
"(",
"sValue",
",",
"mCollection",
")",
"{",
"var",
"sSymbol",
"=",
"\"\"",
",",
"sCode",
",",
"sCurSymbol",
";",
"for",
"(",
"var",
"sCurCode",
"in",
"mCollection",
")",
"{",
"sCurSymbol",
"=",
"mCollection",
"[",
"sCurCode",... | Identify the longest match between a sub string of <code>sValue</code>
and one of the values of the <code>mCollection</code> map.
@param {string} sValue the string value which is checked for all currency codes/symbols during a parse call
@param {object} mCollection a collection of currency codes or symbols
@return {o... | [
"Identify",
"the",
"longest",
"match",
"between",
"a",
"sub",
"string",
"of",
"<code",
">",
"sValue<",
"/",
"code",
">",
"and",
"one",
"of",
"the",
"values",
"of",
"the",
"<code",
">",
"mCollection<",
"/",
"code",
">",
"map",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/format/NumberFormat.js#L1966-L1981 | train | Find the longest match in the given value | [
30522,
3853,
2424,
10052,
4355,
18900,
2818,
1006,
17917,
2389,
5657,
1010,
11338,
14511,
18491,
1007,
1063,
13075,
7020,
24335,
14956,
1027,
1000,
1000,
1010,
8040,
10244,
1010,
8040,
9236,
24335,
14956,
1025,
2005,
1006,
13075,
8040,
3126,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
keplergl/kepler.gl | examples/demo-app/src/utils/cloud-providers/dropbox.js | authLink | function authLink(path = 'auth') {
return dropbox.getAuthenticationUrl(
`${window.location.origin}/${path}`,
btoa(JSON.stringify({handler: 'dropbox', origin: window.location.origin}))
)
} | javascript | function authLink(path = 'auth') {
return dropbox.getAuthenticationUrl(
`${window.location.origin}/${path}`,
btoa(JSON.stringify({handler: 'dropbox', origin: window.location.origin}))
)
} | [
"function",
"authLink",
"(",
"path",
"=",
"'auth'",
")",
"{",
"return",
"dropbox",
".",
"getAuthenticationUrl",
"(",
"`",
"${",
"window",
".",
"location",
".",
"origin",
"}",
"${",
"path",
"}",
"`",
",",
"btoa",
"(",
"JSON",
".",
"stringify",
"(",
"{",... | Generate auth link url to open to be used to handle OAuth2
@param {string} path | [
"Generate",
"auth",
"link",
"url",
"to",
"open",
"to",
"be",
"used",
"to",
"handle",
"OAuth2"
] | 779238435707cc54335c2d00001e4b9334b314aa | https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/examples/demo-app/src/utils/cloud-providers/dropbox.js#L49-L54 | train | Get the link to the auth page | [
30522,
3853,
8740,
2705,
13767,
1006,
4130,
1027,
1005,
8740,
2705,
1005,
1007,
1063,
2709,
30524,
3332,
1012,
3295,
1012,
4761,
1065,
1007,
1007,
1007,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | init | function init() {
if (api.initialized) {
return;
}
var testRange;
var implementsDomRange = false, implementsTextRange = false;
// First, perform basic feature tests
if (isHostMethod(document, "createRange")) {
testRange = document.createRange();
... | javascript | function init() {
if (api.initialized) {
return;
}
var testRange;
var implementsDomRange = false, implementsTextRange = false;
// First, perform basic feature tests
if (isHostMethod(document, "createRange")) {
testRange = document.createRange();
... | [
"function",
"init",
"(",
")",
"{",
"if",
"(",
"api",
".",
"initialized",
")",
"{",
"return",
";",
"}",
"var",
"testRange",
";",
"var",
"implementsDomRange",
"=",
"false",
",",
"implementsTextRange",
"=",
"false",
";",
"// First, perform basic feature tests",
"... | Initialization | [
"Initialization"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L284-L341 | train | Initialize the Rangy API | [
30522,
3853,
1999,
4183,
1006,
1007,
1063,
2065,
1006,
17928,
1012,
3988,
3550,
1007,
1063,
2709,
1025,
1065,
13075,
3231,
24388,
2063,
1025,
13075,
22164,
9527,
24388,
2063,
1027,
6270,
1010,
22164,
18209,
24388,
2063,
1027,
6270,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (reason)
{
this._changeConnectStatus(Strophe.Status.DISCONNECTING, reason);
Strophe.info("Disconnect was called because: " + reason);
if (this.connected) {
var pres = false;
this.disconnecting = true;
if (this.authenticated) {
... | javascript | function (reason)
{
this._changeConnectStatus(Strophe.Status.DISCONNECTING, reason);
Strophe.info("Disconnect was called because: " + reason);
if (this.connected) {
var pres = false;
this.disconnecting = true;
if (this.authenticated) {
... | [
"function",
"(",
"reason",
")",
"{",
"this",
".",
"_changeConnectStatus",
"(",
"Strophe",
".",
"Status",
".",
"DISCONNECTING",
",",
"reason",
")",
";",
"Strophe",
".",
"info",
"(",
"\"Disconnect was called because: \"",
"+",
"reason",
")",
";",
"if",
"(",
"t... | Function: disconnect
Start the graceful disconnection process.
This function starts the disconnection process. This process starts
by sending unavailable presence and sending BOSH body of type
terminate. A timeout handler makes sure that disconnection happens
even if the BOSH server does not respond.
If the Connecti... | [
"Function",
":",
"disconnect",
"Start",
"the",
"graceful",
"disconnection",
"process",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L2694-L2716 | train | Disconnects from the server | [
30522,
3853,
1006,
3114,
1007,
1063,
2023,
1012,
1035,
2689,
8663,
2638,
16649,
29336,
2271,
1006,
2358,
18981,
5369,
1012,
3570,
1012,
12532,
10087,
11873,
1010,
3114,
1007,
1025,
2358,
18981,
5369,
1012,
18558,
1006,
1000,
12532,
10087,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/no-else-return.js | alwaysReturns | function alwaysReturns(node) {
if (node.type === "BlockStatement") {
// If we have a BlockStatement, check each consequent body node.
return node.body.some(checkForReturnOrIf);
}
/*
* If not a block statement, make sure the consequent is... | javascript | function alwaysReturns(node) {
if (node.type === "BlockStatement") {
// If we have a BlockStatement, check each consequent body node.
return node.body.some(checkForReturnOrIf);
}
/*
* If not a block statement, make sure the consequent is... | [
"function",
"alwaysReturns",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"type",
"===",
"\"BlockStatement\"",
")",
"{",
"// If we have a BlockStatement, check each consequent body node.",
"return",
"node",
".",
"body",
".",
"some",
"(",
"checkForReturnOrIf",
")",
... | Check whether a node returns in every codepath.
@param {Node} node The node to be checked
@returns {boolean} `true` if it returns on every codepath. | [
"Check",
"whether",
"a",
"node",
"returns",
"in",
"every",
"codepath",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-else-return.js#L199-L211 | train | Check if a node is always returns | [
30522,
3853,
2467,
13465,
14287,
2015,
1006,
13045,
1007,
1063,
2065,
1006,
13045,
1012,
2828,
1027,
1027,
1027,
1000,
5991,
12259,
3672,
1000,
1007,
1063,
1013,
1013,
2065,
2057,
2031,
1037,
5991,
12259,
3672,
1010,
4638,
2169,
9530,
3366,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/preferences/PreferencesBase.js | _addEventDispatcherImpl | function _addEventDispatcherImpl(proto) {
var temp = {};
EventDispatcher.makeEventDispatcher(temp);
proto._on_internal = temp.on;
proto._off_internal = temp.off;
proto.trigger = temp.trigger;
} | javascript | function _addEventDispatcherImpl(proto) {
var temp = {};
EventDispatcher.makeEventDispatcher(temp);
proto._on_internal = temp.on;
proto._off_internal = temp.off;
proto.trigger = temp.trigger;
} | [
"function",
"_addEventDispatcherImpl",
"(",
"proto",
")",
"{",
"var",
"temp",
"=",
"{",
"}",
";",
"EventDispatcher",
".",
"makeEventDispatcher",
"(",
"temp",
")",
";",
"proto",
".",
"_on_internal",
"=",
"temp",
".",
"on",
";",
"proto",
".",
"_off_internal",
... | Utility for PreferencesSystem & PrefixedPreferencesSystem -- attach EventDispatcher's on()/off()
implementation as private _on_internal()/_off_internal() methods, so the custom on()/off() APIs
these classes use can leverage EventDispatcher code internally. Also attach the regular public trigger(). | [
"Utility",
"for",
"PreferencesSystem",
"&",
"PrefixedPreferencesSystem",
"--",
"attach",
"EventDispatcher",
"s",
"on",
"()",
"/",
"off",
"()",
"implementation",
"as",
"private",
"_on_internal",
"()",
"/",
"_off_internal",
"()",
"methods",
"so",
"the",
"custom",
"o... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1040-L1046 | train | Add an event dispatcher implementation to the given proto | [
30522,
3853,
1035,
5587,
18697,
3372,
10521,
4502,
10649,
11124,
8737,
2140,
1006,
15053,
1007,
1063,
13075,
8915,
8737,
1027,
1063,
1065,
1025,
30524,
8737,
1007,
1025,
15053,
1012,
1035,
2006,
1035,
4722,
1027,
8915,
8737,
1012,
2006,
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.commons/src/sap/ui/commons/MenuButton.js | function(oThis, oNewMenu){
var oMenu = oThis.getMenu();
if (oMenu) {
oMenu.detachItemSelect(oThis._fItemSelectHandler);
}
oThis._fItemSelectHandler = onItemSelected.bind(oThis);
if (oNewMenu) {
oNewMenu.attachItemSelect(oThis._fItemSelectHandler);
}
} | javascript | function(oThis, oNewMenu){
var oMenu = oThis.getMenu();
if (oMenu) {
oMenu.detachItemSelect(oThis._fItemSelectHandler);
}
oThis._fItemSelectHandler = onItemSelected.bind(oThis);
if (oNewMenu) {
oNewMenu.attachItemSelect(oThis._fItemSelectHandler);
}
} | [
"function",
"(",
"oThis",
",",
"oNewMenu",
")",
"{",
"var",
"oMenu",
"=",
"oThis",
".",
"getMenu",
"(",
")",
";",
"if",
"(",
"oMenu",
")",
"{",
"oMenu",
".",
"detachItemSelect",
"(",
"oThis",
".",
"_fItemSelectHandler",
")",
";",
"}",
"oThis",
".",
"... | ********** Private ********** Detaches the select event handler from the current menu and attaches it to the new menu | [
"**********",
"Private",
"**********",
"Detaches",
"the",
"select",
"event",
"handler",
"from",
"the",
"current",
"menu",
"and",
"attaches",
"it",
"to",
"the",
"new",
"menu"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/MenuButton.js#L212-L221 | train | Sets the handler to be called when the item is selected | [
30522,
3853,
1006,
27178,
24158,
1010,
2028,
2860,
3549,
2226,
1007,
1063,
13075,
18168,
2368,
2226,
1027,
27178,
24158,
1012,
2131,
3549,
2226,
1006,
1007,
1025,
2065,
1006,
18168,
2368,
2226,
1007,
1063,
18168,
2368,
2226,
1012,
20010,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ccxt/ccxt | build/transpile.js | createFolderRecursively | function createFolderRecursively (folder) {
const parts = folder.split (path.sep)
for (let i = 1; i <= parts.length; i++) {
createFolder (path.join.apply (null, parts.slice (0, i)))
}
} | javascript | function createFolderRecursively (folder) {
const parts = folder.split (path.sep)
for (let i = 1; i <= parts.length; i++) {
createFolder (path.join.apply (null, parts.slice (0, i)))
}
} | [
"function",
"createFolderRecursively",
"(",
"folder",
")",
"{",
"const",
"parts",
"=",
"folder",
".",
"split",
"(",
"path",
".",
"sep",
")",
"for",
"(",
"let",
"i",
"=",
"1",
";",
"i",
"<=",
"parts",
".",
"length",
";",
"i",
"++",
")",
"{",
"create... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 8168069b9180a465532905e225586215e115a565 | https://github.com/ccxt/ccxt/blob/8168069b9180a465532905e225586215e115a565/build/transpile.js#L779-L786 | train | Create a folder recursively | [
30522,
3853,
3443,
10371,
28849,
10841,
2869,
14547,
1006,
19622,
1007,
1063,
9530,
3367,
3033,
1027,
19622,
1012,
3975,
1006,
4130,
1012,
19802,
1007,
2005,
1006,
2292,
1045,
1027,
1015,
1025,
1045,
1026,
1027,
3033,
1012,
3091,
1025,
1045... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/InlineTimingFunctionEditor/StepEditor.js | StepCanvas | function StepCanvas(canvas, stepParams, padding) {
this.canvas = canvas;
this.stepParams = stepParams;
this.padding = this.getPadding(padding);
// Convert to a cartesian coordinate system with axes from 0 to 1
var ctx = this.canvas.getContext("2d"),
p = this.p... | javascript | function StepCanvas(canvas, stepParams, padding) {
this.canvas = canvas;
this.stepParams = stepParams;
this.padding = this.getPadding(padding);
// Convert to a cartesian coordinate system with axes from 0 to 1
var ctx = this.canvas.getContext("2d"),
p = this.p... | [
"function",
"StepCanvas",
"(",
"canvas",
",",
"stepParams",
",",
"padding",
")",
"{",
"this",
".",
"canvas",
"=",
"canvas",
";",
"this",
".",
"stepParams",
"=",
"stepParams",
";",
"this",
".",
"padding",
"=",
"this",
".",
"getPadding",
"(",
"padding",
")... | StepCanvas object constructor
@param {Element} canvas Inline editor <canvas> element
@param {StepParameters} stepParams Associated StepParameters object
@param {number|Array.number} padding Element padding | [
"StepCanvas",
"object",
"constructor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/StepEditor.js#L62-L73 | train | StepCanvas constructor. | [
30522,
3853,
3357,
9336,
12044,
1006,
10683,
1010,
3357,
28689,
5244,
1010,
11687,
4667,
1007,
1063,
2023,
1012,
10683,
1027,
10683,
1025,
2023,
1012,
3357,
28689,
5244,
1027,
3357,
28689,
5244,
1025,
2023,
1012,
11687,
4667,
1027,
2023,
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... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/addons.js | addonsManager_getViews | function addonsManager_getViews(aSpec) {
var spec = aSpec || { };
var attribute = spec.attribute;
var value = spec.value;
return this.getElements({type: "views", subtype: attribute, value: value});
} | javascript | function addonsManager_getViews(aSpec) {
var spec = aSpec || { };
var attribute = spec.attribute;
var value = spec.value;
return this.getElements({type: "views", subtype: attribute, value: value});
} | [
"function",
"addonsManager_getViews",
"(",
"aSpec",
")",
"{",
"var",
"spec",
"=",
"aSpec",
"||",
"{",
"}",
";",
"var",
"attribute",
"=",
"spec",
".",
"attribute",
";",
"var",
"value",
"=",
"spec",
".",
"value",
";",
"return",
"this",
".",
"getElements",
... | ///////////////////////////// View section /////////////////////////////
Returns the views which match the filter criteria
@param {object} aSpec
Information for getting the views matched by the criteria
Elements: attribute - DOM attribute of the node
[optional - default: ""]
value - Value of the DOM attribute
[op... | [
"/////////////////////////////",
"View",
"section",
"/////////////////////////////",
"Returns",
"the",
"views",
"which",
"match",
"the",
"filter",
"criteria"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/addons.js#L1007-L1013 | train | Get all the views | [
30522,
3853,
5587,
5644,
24805,
4590,
1035,
2131,
8584,
2015,
1006,
2004,
5051,
2278,
1007,
1063,
13075,
28699,
1027,
2004,
5051,
2278,
1064,
1064,
1063,
1065,
1025,
13075,
17961,
1027,
28699,
1012,
17961,
1025,
13075,
3643,
1027,
28699,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/editor/CodeHintManager.js | _inSession | function _inSession(editor) {
if (sessionEditor) {
if (sessionEditor === editor &&
(hintList.isOpen() ||
(deferredHints && deferredHints.state() === "pending"))) {
return true;
} else {
// the editor has changed
... | javascript | function _inSession(editor) {
if (sessionEditor) {
if (sessionEditor === editor &&
(hintList.isOpen() ||
(deferredHints && deferredHints.state() === "pending"))) {
return true;
} else {
// the editor has changed
... | [
"function",
"_inSession",
"(",
"editor",
")",
"{",
"if",
"(",
"sessionEditor",
")",
"{",
"if",
"(",
"sessionEditor",
"===",
"editor",
"&&",
"(",
"hintList",
".",
"isOpen",
"(",
")",
"||",
"(",
"deferredHints",
"&&",
"deferredHints",
".",
"state",
"(",
")... | Is there a hinting session active for a given editor?
NOTE: the sessionEditor, sessionProvider and hintList objects are
only guaranteed to be initialized during an active session.
@param {Editor} editor
@return boolean | [
"Is",
"there",
"a",
"hinting",
"session",
"active",
"for",
"a",
"given",
"editor?"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L398-L410 | train | check if the session editor is in the session | [
30522,
3853,
1035,
16021,
7971,
3258,
1006,
3559,
1007,
1063,
2065,
1006,
5219,
2098,
15660,
1007,
1063,
2065,
1006,
5219,
2098,
15660,
1027,
1027,
1027,
3559,
1004,
1004,
1006,
9374,
9863,
1012,
11163,
11837,
1006,
1007,
1064,
1064,
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... |
GitbookIO/gitbook | lib/utils/images.js | convertSVGToPNG | function convertSVGToPNG(source, dest, options) {
if (!fs.existsSync(source)) return Promise.reject(new error.FileNotFoundError({ filename: source }));
return command.spawn('svgexport', [source, dest])
.fail(function(err) {
if (err.code == 'ENOENT') {
err = error.RequireInstallError({
... | javascript | function convertSVGToPNG(source, dest, options) {
if (!fs.existsSync(source)) return Promise.reject(new error.FileNotFoundError({ filename: source }));
return command.spawn('svgexport', [source, dest])
.fail(function(err) {
if (err.code == 'ENOENT') {
err = error.RequireInstallError({
... | [
"function",
"convertSVGToPNG",
"(",
"source",
",",
"dest",
",",
"options",
")",
"{",
"if",
"(",
"!",
"fs",
".",
"existsSync",
"(",
"source",
")",
")",
"return",
"Promise",
".",
"reject",
"(",
"new",
"error",
".",
"FileNotFoundError",
"(",
"{",
"filename"... | Convert a svg file to a pmg | [
"Convert",
"a",
"svg",
"file",
"to",
"a",
"pmg"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/images.js#L7-L25 | train | Convert SVG to PNG | [
30522,
3853,
19884,
2615,
13512,
7361,
3070,
1006,
3120,
1010,
4078,
2102,
1010,
7047,
1007,
1063,
2065,
1006,
999,
1042,
2015,
1012,
6526,
6508,
12273,
1006,
3120,
1007,
1007,
2709,
4872,
1012,
15454,
1006,
2047,
7561,
1012,
5371,
17048,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | common/src/web/jquery-1.3.2.js | function( event, data, elem, bubbling ) {
// Event object or event type
var type = event.type || event;
if( !bubbling ){
event = typeof event === "object" ?
// jQuery.Event object
event[expando] ? event :
// Object literal
jQuery.extend( jQuery.Event(type), event ) :
// Just the event type... | javascript | function( event, data, elem, bubbling ) {
// Event object or event type
var type = event.type || event;
if( !bubbling ){
event = typeof event === "object" ?
// jQuery.Event object
event[expando] ? event :
// Object literal
jQuery.extend( jQuery.Event(type), event ) :
// Just the event type... | [
"function",
"(",
"event",
",",
"data",
",",
"elem",
",",
"bubbling",
")",
"{",
"// Event object or event type",
"var",
"type",
"=",
"event",
".",
"type",
"||",
"event",
";",
"if",
"(",
"!",
"bubbling",
")",
"{",
"event",
"=",
"typeof",
"event",
"===",
... | bubbling is internal | [
"bubbling",
"is",
"internal"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/common/src/web/jquery-1.3.2.js#L2591-L2663 | train | trigger an event on an element | [
30522,
3853,
1006,
2724,
1010,
2951,
1010,
3449,
6633,
1010,
25054,
1007,
1063,
1013,
1013,
2724,
4874,
2030,
2724,
2828,
13075,
2828,
1027,
2724,
1012,
2828,
1064,
1064,
2724,
1025,
2065,
1006,
999,
25054,
1007,
1063,
2724,
1027,
2828,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.