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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SAP/openui5 | src/sap.ui.integration/src/sap/ui/integration/util/CardManifest.js | process | function process (oObject, oTranslator, iCurrentLevel, iMaxLevel, oParams) {
if (iCurrentLevel === iMaxLevel) {
return;
}
if (Array.isArray(oObject)) {
oObject.forEach(function (vItem, iIndex, aArray) {
if (typeof vItem === "object") {
process(vItem, oTranslator, iCurrentLevel + 1, iMaxLevel, oPar... | javascript | function process (oObject, oTranslator, iCurrentLevel, iMaxLevel, oParams) {
if (iCurrentLevel === iMaxLevel) {
return;
}
if (Array.isArray(oObject)) {
oObject.forEach(function (vItem, iIndex, aArray) {
if (typeof vItem === "object") {
process(vItem, oTranslator, iCurrentLevel + 1, iMaxLevel, oPar... | [
"function",
"process",
"(",
"oObject",
",",
"oTranslator",
",",
"iCurrentLevel",
",",
"iMaxLevel",
",",
"oParams",
")",
"{",
"if",
"(",
"iCurrentLevel",
"===",
"iMaxLevel",
")",
"{",
"return",
";",
"}",
"if",
"(",
"Array",
".",
"isArray",
"(",
"oObject",
... | Process a manifest.
@private
@param {Object} oObject The Manifest to process.
@param {Object} oTranslator The translator.
@param {number} iCurrentLevel The current level of recursion.
@param {number} iMaxLevel The maximum level of recursion.
@param {Object} oParams The parameters to be replaced in the manifest. | [
"Process",
"a",
"manifest",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.integration/src/sap/ui/integration/util/CardManifest.js#L235-L261 | train | Process an object | [
30522,
3853,
2832,
1006,
1051,
16429,
20614,
1010,
27178,
5521,
14540,
8844,
1010,
24582,
29264,
20414,
2884,
1010,
10047,
8528,
20414,
2884,
1010,
6728,
5400,
5244,
1007,
1063,
2065,
1006,
24582,
29264,
20414,
2884,
1027,
1027,
1027,
10047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/components/sound.js | function () {
var el = this.el;
var i;
var sceneEl = el.sceneEl;
var self = this;
var sound;
if (this.pool.children.length > 0) {
this.stopSound();
el.removeObject3D('sound');
}
// Only want one AudioListener. Cache it on the scene.
var listener = this.listener = sceneE... | javascript | function () {
var el = this.el;
var i;
var sceneEl = el.sceneEl;
var self = this;
var sound;
if (this.pool.children.length > 0) {
this.stopSound();
el.removeObject3D('sound');
}
// Only want one AudioListener. Cache it on the scene.
var listener = this.listener = sceneE... | [
"function",
"(",
")",
"{",
"var",
"el",
"=",
"this",
".",
"el",
";",
"var",
"i",
";",
"var",
"sceneEl",
"=",
"el",
".",
"sceneEl",
";",
"var",
"self",
"=",
"this",
";",
"var",
"sound",
";",
"if",
"(",
"this",
".",
"pool",
".",
"children",
".",
... | Removes current sound object, creates new sound object, adds to entity.
@returns {object} sound | [
"Removes",
"current",
"sound",
"object",
"creates",
"new",
"sound",
"object",
"adds",
"to",
"entity",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/sound.js#L138-L180 | train | Creates the sound and attaches it to the scene | [
30522,
3853,
1006,
1007,
1063,
13075,
3449,
1027,
2023,
1012,
3449,
1025,
13075,
1045,
1025,
13075,
3496,
2884,
1027,
3449,
1012,
3496,
2884,
1025,
13075,
2969,
1027,
2023,
1025,
13075,
2614,
1025,
2065,
1006,
2023,
1012,
4770,
1012,
2336,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(sStyle, sCalendarType) {
assert(sStyle == "short" || sStyle == "medium" || sStyle == "long" || sStyle == "full", "sStyle must be short, medium, long or full");
return this._get(getCLDRCalendarName(sCalendarType), "dateFormats", sStyle);
} | javascript | function(sStyle, sCalendarType) {
assert(sStyle == "short" || sStyle == "medium" || sStyle == "long" || sStyle == "full", "sStyle must be short, medium, long or full");
return this._get(getCLDRCalendarName(sCalendarType), "dateFormats", sStyle);
} | [
"function",
"(",
"sStyle",
",",
"sCalendarType",
")",
"{",
"assert",
"(",
"sStyle",
"==",
"\"short\"",
"||",
"sStyle",
"==",
"\"medium\"",
"||",
"sStyle",
"==",
"\"long\"",
"||",
"sStyle",
"==",
"\"full\"",
",",
"\"sStyle must be short, medium, long or full\"",
")... | Get date pattern in format "short", "medium", "long" or "full".
@param {string} sStyle the required style for the date pattern
@param {sap.ui.core.CalendarType} [sCalendarType] the type of calendar. If it's not set, it falls back to the calendar type either set in configuration or calculated from locale.
@returns {str... | [
"Get",
"date",
"pattern",
"in",
"format",
"short",
"medium",
"long",
"or",
"full",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L207-L210 | train | Get the date format for the specified calendar type | [
30522,
3853,
1006,
7020,
27983,
1010,
4094,
8943,
5339,
18863,
1007,
1063,
20865,
1006,
7020,
27983,
1027,
1027,
1000,
2460,
1000,
30524,
5396,
1000,
1064,
1064,
7020,
27983,
1027,
1027,
1000,
2146,
1000,
1064,
1064,
7020,
27983,
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... | |
naptha/tesseract.js | src/common/dump.js | deindent | function deindent(html){
var lines = html.split('\n')
if(lines[0].substring(0, 2) === " "){
for (var i = 0; i < lines.length; i++) {
if (lines[i].substring(0,2) === " ") {
lines[i] = lines[i].slice(2)
}
};
}
return lines.join('\n')
} | javascript | function deindent(html){
var lines = html.split('\n')
if(lines[0].substring(0, 2) === " "){
for (var i = 0; i < lines.length; i++) {
if (lines[i].substring(0,2) === " ") {
lines[i] = lines[i].slice(2)
}
};
}
return lines.join('\n')
} | [
"function",
"deindent",
"(",
"html",
")",
"{",
"var",
"lines",
"=",
"html",
".",
"split",
"(",
"'\\n'",
")",
"if",
"(",
"lines",
"[",
"0",
"]",
".",
"substring",
"(",
"0",
",",
"2",
")",
"===",
"\" \"",
")",
"{",
"for",
"(",
"var",
"i",
"=",
... | the generated HOCR is excessively indented, so we get rid of that indentation | [
"the",
"generated",
"HOCR",
"is",
"excessively",
"indented",
"so",
"we",
"get",
"rid",
"of",
"that",
"indentation"
] | 613a19c7e1b61f26014dd3310fca5391423dd65d | https://github.com/naptha/tesseract.js/blob/613a19c7e1b61f26014dd3310fca5391423dd65d/src/common/dump.js#L154-L164 | train | Deindent the given HTML | [
30522,
3853,
14866,
25915,
2102,
1006,
16129,
1007,
1063,
13075,
3210,
1027,
16129,
1012,
3975,
1006,
1005,
1032,
1050,
1005,
1007,
2065,
1006,
3210,
1031,
1014,
1033,
1012,
4942,
3367,
4892,
1006,
1014,
1010,
1016,
1007,
1027,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataModel.js | addMessage | function addMessage(oMessage) {
var oReportMessage = {
code : oMessage.code,
message : oMessage.message,
technical : oMessage.technical
};
Object.keys(oMessage).forEach(function (sProperty) {
if (sProperty[0] === '@') {
if (sProperty.endsWith(".numericSeverity")) {
oReportMessag... | javascript | function addMessage(oMessage) {
var oReportMessage = {
code : oMessage.code,
message : oMessage.message,
technical : oMessage.technical
};
Object.keys(oMessage).forEach(function (sProperty) {
if (sProperty[0] === '@') {
if (sProperty.endsWith(".numericSeverity")) {
oReportMessag... | [
"function",
"addMessage",
"(",
"oMessage",
")",
"{",
"var",
"oReportMessage",
"=",
"{",
"code",
":",
"oMessage",
".",
"code",
",",
"message",
":",
"oMessage",
".",
"message",
",",
"technical",
":",
"oMessage",
".",
"technical",
"}",
";",
"Object",
".",
"... | /*
Clones the message object taking all relevant properties, converts the annotations for
numeric severity and longtext to the corresponding properties and adds it to one of the
arrays to be reported later.
@param {object} oMessage The message | [
"/",
"*",
"Clones",
"the",
"message",
"object",
"taking",
"all",
"relevant",
"properties",
"converts",
"the",
"annotations",
"for",
"numeric",
"severity",
"and",
"longtext",
"to",
"the",
"corresponding",
"properties",
"and",
"adds",
"it",
"to",
"one",
"of",
"t... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataModel.js#L1410-L1440 | train | Adds a message to the report | [
30522,
3853,
5587,
7834,
3736,
3351,
1006,
18168,
7971,
4270,
1007,
1063,
13075,
10848,
6442,
7834,
3736,
3351,
1027,
1063,
3642,
1024,
18168,
7971,
4270,
1012,
3642,
1010,
4471,
1024,
18168,
7971,
4270,
1012,
4471,
1010,
4087,
1024,
18168,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/path.js | isInRoot | function isInRoot(root, filename) {
root = path.normalize(root);
filename = path.normalize(filename);
if (root === '.') {
return true;
}
if (root[root.length - 1] != path.sep) {
root = root + path.sep;
}
return (filename.substr(0, root.length) === root);
} | javascript | function isInRoot(root, filename) {
root = path.normalize(root);
filename = path.normalize(filename);
if (root === '.') {
return true;
}
if (root[root.length - 1] != path.sep) {
root = root + path.sep;
}
return (filename.substr(0, root.length) === root);
} | [
"function",
"isInRoot",
"(",
"root",
",",
"filename",
")",
"{",
"root",
"=",
"path",
".",
"normalize",
"(",
"root",
")",
";",
"filename",
"=",
"path",
".",
"normalize",
"(",
"filename",
")",
";",
"if",
"(",
"root",
"===",
"'.'",
")",
"{",
"return",
... | Return true if file path is inside a folder | [
"Return",
"true",
"if",
"file",
"path",
"is",
"inside",
"a",
"folder"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/path.js#L10-L22 | train | Check if the filename is in the root directory | [
30522,
3853,
2003,
2378,
3217,
4140,
1006,
7117,
1010,
5371,
18442,
1007,
1063,
7117,
1027,
4130,
1012,
3671,
4697,
1006,
7117,
1007,
1025,
5371,
18442,
1027,
4130,
1012,
3671,
4697,
1006,
5371,
18442,
1007,
1025,
2065,
1006,
7117,
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/core/services/layout/layout.js | validateAttributeValue | function validateAttributeValue(className, value, updateFn) {
var origValue;
if (!needsInterpolation(value)) {
switch (className.replace(SUFFIXES,"")) {
case 'layout' :
if (!findIn(value, LAYOUT_OPTIONS)) {
value = LAYOUT_OPTIONS[0]; // 'row';
}
... | javascript | function validateAttributeValue(className, value, updateFn) {
var origValue;
if (!needsInterpolation(value)) {
switch (className.replace(SUFFIXES,"")) {
case 'layout' :
if (!findIn(value, LAYOUT_OPTIONS)) {
value = LAYOUT_OPTIONS[0]; // 'row';
}
... | [
"function",
"validateAttributeValue",
"(",
"className",
",",
"value",
",",
"updateFn",
")",
"{",
"var",
"origValue",
";",
"if",
"(",
"!",
"needsInterpolation",
"(",
"value",
")",
")",
"{",
"switch",
"(",
"className",
".",
"replace",
"(",
"SUFFIXES",
",",
"... | For the Layout attribute value, validate or replace with default
fallback value | [
"For",
"the",
"Layout",
"attribute",
"value",
"validate",
"or",
"replace",
"with",
"default",
"fallback",
"value"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L409-L455 | train | Validate attribute value | [
30522,
3853,
9398,
3686,
19321,
3089,
8569,
2618,
10175,
5657,
1006,
2465,
18442,
1010,
3643,
1010,
10651,
2546,
2078,
1007,
1063,
13075,
2030,
8004,
10175,
5657,
1025,
2065,
1006,
999,
3791,
18447,
2121,
18155,
3370,
1006,
3643,
1007,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableUtils.js | function(oTable) {
var sSelectionMode = oTable ? oTable.getSelectionMode() : SelectionMode.None;
return sSelectionMode === SelectionMode.MultiToggle && oTable.getEnableSelectAll();
} | javascript | function(oTable) {
var sSelectionMode = oTable ? oTable.getSelectionMode() : SelectionMode.None;
return sSelectionMode === SelectionMode.MultiToggle && oTable.getEnableSelectAll();
} | [
"function",
"(",
"oTable",
")",
"{",
"var",
"sSelectionMode",
"=",
"oTable",
"?",
"oTable",
".",
"getSelectionMode",
"(",
")",
":",
"SelectionMode",
".",
"None",
";",
"return",
"sSelectionMode",
"===",
"SelectionMode",
".",
"MultiToggle",
"&&",
"oTable",
".",
... | Returns whether the table has a SelectAll checkbox.
@param {sap.ui.table.Table} oTable Instance of the table.
@returns {boolean} Whether the table has a SelectAll checkbox. | [
"Returns",
"whether",
"the",
"table",
"has",
"a",
"SelectAll",
"checkbox",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L246-L249 | train | Returns true if the table has a multi - toggle selection mode. | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
13075,
7020,
12260,
7542,
5302,
3207,
1027,
27178,
3085,
1029,
27178,
3085,
1012,
4152,
12260,
7542,
5302,
3207,
1006,
1007,
1024,
4989,
5302,
3207,
1012,
3904,
1025,
2709,
7020,
12260,
7542,
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... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/jszip.js | function(reader, from, length, compression, uncompressedSize) {
return function() {
var compressedFileData = utils.transformTo(compression.uncompressInputType, this.getCompressedContent());
var uncompressedFileData = compression.uncompress(compressedFileData);
if (uncompres... | javascript | function(reader, from, length, compression, uncompressedSize) {
return function() {
var compressedFileData = utils.transformTo(compression.uncompressInputType, this.getCompressedContent());
var uncompressedFileData = compression.uncompress(compressedFileData);
if (uncompres... | [
"function",
"(",
"reader",
",",
"from",
",",
"length",
",",
"compression",
",",
"uncompressedSize",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"compressedFileData",
"=",
"utils",
".",
"transformTo",
"(",
"compression",
".",
"uncompressInputType",
",... | Prepare the function used to generate the uncompressed content from this ZipFile.
@param {DataReader} reader the reader to use.
@param {number} from the offset from where we should read the data.
@param {number} length the length of the data to read.
@param {JSZip.compression} compression the compression used on this f... | [
"Prepare",
"the",
"function",
"used",
"to",
"generate",
"the",
"uncompressed",
"content",
"from",
"this",
"ZipFile",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jszip.js#L1942-L1954 | train | uncompress the file | [
30522,
3853,
1006,
8068,
1010,
2013,
1010,
3091,
1010,
13379,
1010,
4895,
9006,
19811,
5332,
4371,
1007,
1063,
2709,
3853,
1006,
1007,
1063,
13075,
16620,
8873,
3709,
6790,
1027,
21183,
12146,
1012,
10938,
3406,
1006,
13379,
1012,
4895,
900... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
summernote/summernote | src/js/base/core/dom.js | removeWhile | function removeWhile(node, pred) {
while (node) {
if (isEditable(node) || !pred(node)) {
break;
}
const parent = node.parentNode;
remove(node);
node = parent;
}
} | javascript | function removeWhile(node, pred) {
while (node) {
if (isEditable(node) || !pred(node)) {
break;
}
const parent = node.parentNode;
remove(node);
node = parent;
}
} | [
"function",
"removeWhile",
"(",
"node",
",",
"pred",
")",
"{",
"while",
"(",
"node",
")",
"{",
"if",
"(",
"isEditable",
"(",
"node",
")",
"||",
"!",
"pred",
"(",
"node",
")",
")",
"{",
"break",
";",
"}",
"const",
"parent",
"=",
"node",
".",
"pare... | @method removeWhile
@param {Node} node
@param {Function} pred | [
"@method",
"removeWhile"
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L900-L910 | train | Remove nodes from the tree while predicate returns true | [
30522,
3853,
6366,
19927,
1006,
13045,
1010,
3653,
2094,
1007,
1063,
2096,
1006,
13045,
1007,
1063,
2065,
1006,
2003,
2098,
6590,
3468,
1006,
13045,
1007,
1064,
1064,
999,
3653,
2094,
1006,
13045,
1007,
1007,
1063,
3338,
1025,
1065,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js | function (oTree) {
var oResult = {};
oTree.selected = this.isNodeSelected(oTree);
this.setHierarchyNode(oResult, oTree);
return oResult;
} | javascript | function (oTree) {
var oResult = {};
oTree.selected = this.isNodeSelected(oTree);
this.setHierarchyNode(oResult, oTree);
return oResult;
} | [
"function",
"(",
"oTree",
")",
"{",
"var",
"oResult",
"=",
"{",
"}",
";",
"oTree",
".",
"selected",
"=",
"this",
".",
"isNodeSelected",
"(",
"oTree",
")",
";",
"this",
".",
"setHierarchyNode",
"(",
"oResult",
",",
"oTree",
")",
";",
"return",
"oResult"... | Converts a bindable tree back to the module hierarchy structure
@param {object} oTree The tree to be converted
@return {object} The module hierarchy with the current selection state of the UI | [
"Converts",
"a",
"bindable",
"tree",
"back",
"to",
"the",
"module",
"hierarchy",
"structure"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L181-L186 | train | Returns an object with the selected state of the hierarchy node | [
30522,
3853,
1006,
27178,
9910,
1007,
1063,
13075,
10848,
23722,
2102,
1027,
1063,
1065,
1025,
27178,
9910,
1012,
3479,
1027,
2023,
1012,
3475,
19847,
12260,
10985,
1006,
27178,
9910,
1007,
1025,
2023,
1012,
6662,
3771,
2906,
11714,
3630,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js | function( elems, name, selector ) {
// Build a new jQuery matched element set
var ret = this.constructor();
if ( jQuery.isArray( elems ) ) {
push.apply( ret, elems );
} else {
jQuery.merge( ret, elems );
}
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context... | javascript | function( elems, name, selector ) {
// Build a new jQuery matched element set
var ret = this.constructor();
if ( jQuery.isArray( elems ) ) {
push.apply( ret, elems );
} else {
jQuery.merge( ret, elems );
}
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context... | [
"function",
"(",
"elems",
",",
"name",
",",
"selector",
")",
"{",
"// Build a new jQuery matched element set",
"var",
"ret",
"=",
"this",
".",
"constructor",
"(",
")",
";",
"if",
"(",
"jQuery",
".",
"isArray",
"(",
"elems",
")",
")",
"{",
"push",
".",
"a... | Take an array of elements and push it onto the stack (returning the new matched element set) | [
"Take",
"an",
"array",
"of",
"elements",
"and",
"push",
"it",
"onto",
"the",
"stack",
"(",
"returning",
"the",
"new",
"matched",
"element",
"set",
")"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js#L241-L265 | train | Creates a new jQuery matched element | [
30522,
3853,
1006,
3449,
6633,
2015,
1010,
2171,
1010,
27000,
1007,
1063,
1013,
1013,
3857,
1037,
2047,
1046,
4226,
2854,
10349,
5783,
2275,
13075,
2128,
2102,
1027,
2023,
1012,
9570,
2953,
1006,
1007,
1025,
2065,
1006,
1046,
4226,
2854,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
wangfupeng1988/wangEditor | src/js/editor/upload/upload-img.js | function (link) {
if (!link) {
return
}
const editor = this.editor
const config = editor.config
// 校验格式
const linkImgCheck = config.linkImgCheck
let checkResult
if (linkImgCheck && typeof linkImgCheck === 'function') {
checkResult ... | javascript | function (link) {
if (!link) {
return
}
const editor = this.editor
const config = editor.config
// 校验格式
const linkImgCheck = config.linkImgCheck
let checkResult
if (linkImgCheck && typeof linkImgCheck === 'function') {
checkResult ... | [
"function",
"(",
"link",
")",
"{",
"if",
"(",
"!",
"link",
")",
"{",
"return",
"}",
"const",
"editor",
"=",
"this",
".",
"editor",
"const",
"config",
"=",
"editor",
".",
"config",
"// 校验格式",
"const",
"linkImgCheck",
"=",
"config",
".",
"linkImgCheck",
... | 根据链接插入图片 | [
"根据链接插入图片"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/editor/upload/upload-img.js#L36-L77 | train | link 是否有效,无法成功下载图片 | [
30522,
3853,
1006,
4957,
1007,
1063,
2065,
1006,
999,
4957,
1007,
1063,
2709,
1065,
9530,
3367,
3559,
1027,
2023,
1012,
3559,
9530,
3367,
9530,
8873,
2290,
1027,
3559,
1012,
9530,
8873,
2290,
1013,
1013,
100,
100,
100,
100,
9530,
3367,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
TryGhost/Ghost | core/server/api/v0.1/users.js | doQuery | function doQuery(options) {
return models.User.findPage(options)
.then(({data, meta}) => {
return {
users: data.map(model => urlsForUser(model.id, model.toJSON(options), options)),
meta: meta
};
... | javascript | function doQuery(options) {
return models.User.findPage(options)
.then(({data, meta}) => {
return {
users: data.map(model => urlsForUser(model.id, model.toJSON(options), options)),
meta: meta
};
... | [
"function",
"doQuery",
"(",
"options",
")",
"{",
"return",
"models",
".",
"User",
".",
"findPage",
"(",
"options",
")",
".",
"then",
"(",
"(",
"{",
"data",
",",
"meta",
"}",
")",
"=>",
"{",
"return",
"{",
"users",
":",
"data",
".",
"map",
"(",
"m... | ### Model Query
Make the call to the Model layer
@param {Object} options
@returns {Object} options | [
"###",
"Model",
"Query",
"Make",
"the",
"call",
"to",
"the",
"Model",
"layer"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/users.js#L39-L47 | train | Query for users | [
30522,
3853,
2079,
4226,
2854,
1006,
7047,
1007,
1063,
2709,
4275,
1012,
5310,
1012,
2424,
13704,
1006,
7047,
1007,
1012,
2059,
1006,
1006,
1063,
30524,
20330,
1006,
2944,
1012,
8909,
1010,
2944,
1012,
2000,
22578,
2239,
1006,
7047,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
thomaspark/bootswatch | docs/_vendor/popper.js/dist/popper.js | applyStyleOnLoad | function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
// compute reference element offsets
const referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
// compute auto placement, store placement inside the data object,
// modifiers will be able to edi... | javascript | function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
// compute reference element offsets
const referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
// compute auto placement, store placement inside the data object,
// modifiers will be able to edi... | [
"function",
"applyStyleOnLoad",
"(",
"reference",
",",
"popper",
",",
"options",
",",
"modifierOptions",
",",
"state",
")",
"{",
"// compute reference element offsets",
"const",
"referenceOffsets",
"=",
"getReferenceOffsets",
"(",
"state",
",",
"popper",
",",
"referen... | Set the x-placement attribute before everything else because it could be used
to add margins to the popper margins needs to be calculated to get the
correct popper offsets.
@method
@memberof Popper.modifiers
@param {HTMLElement} reference - The reference element used to position the popper
@param {HTMLElement} popper -... | [
"Set",
"the",
"x",
"-",
"placement",
"attribute",
"before",
"everything",
"else",
"because",
"it",
"could",
"be",
"used",
"to",
"add",
"margins",
"to",
"the",
"popper",
"margins",
"needs",
"to",
"be",
"calculated",
"to",
"get",
"the",
"correct",
"popper",
... | a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd | https://github.com/thomaspark/bootswatch/blob/a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd/docs/_vendor/popper.js/dist/popper.js#L1102-L1118 | train | Apply the style on load to the popper element | [
30522,
3853,
6611,
21756,
2571,
2239,
11066,
1006,
4431,
1010,
3769,
4842,
1010,
7047,
1010,
16913,
18095,
7361,
9285,
1010,
2110,
1007,
1063,
1013,
1013,
24134,
4431,
5783,
16396,
2015,
9530,
3367,
4431,
27475,
8454,
1027,
2131,
2890,
2552... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/IconPool.js | getInfo | function getInfo() {
var collection = mRegistry[collectionName];
var info = collection && collection[iconName];
// convert raw data lazily to the icon info
if (typeof info === 'number') {
mRegistry[collectionName][iconName] = undefined; // avoid duplicate icon warning
info = IconPool.addIcon(... | javascript | function getInfo() {
var collection = mRegistry[collectionName];
var info = collection && collection[iconName];
// convert raw data lazily to the icon info
if (typeof info === 'number') {
mRegistry[collectionName][iconName] = undefined; // avoid duplicate icon warning
info = IconPool.addIcon(... | [
"function",
"getInfo",
"(",
")",
"{",
"var",
"collection",
"=",
"mRegistry",
"[",
"collectionName",
"]",
";",
"var",
"info",
"=",
"collection",
"&&",
"collection",
"[",
"iconName",
"]",
";",
"// convert raw data lazily to the icon info",
"if",
"(",
"typeof",
"in... | retrieves the icon info from the internal registry | [
"retrieves",
"the",
"icon",
"info",
"from",
"the",
"internal",
"registry"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/IconPool.js#L931-L947 | train | Get the icon info from the registry | [
30522,
3853,
2131,
2378,
14876,
1006,
1007,
1063,
13075,
3074,
1027,
2720,
13910,
2923,
2854,
1031,
3074,
18442,
1033,
1025,
13075,
18558,
1027,
3074,
1004,
1004,
3074,
1031,
12696,
18442,
1033,
1025,
1013,
1013,
10463,
6315,
2951,
2474,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/PerfUtils.js | addMeasurement | function addMeasurement(id) {
if (!enabled) {
return;
}
if (!(id instanceof PerfMeasurement)) {
id = new PerfMeasurement(id, id);
}
var elapsedTime = brackets.app.getElapsedMilliseconds();
if (activeTests[id.id]) {
elapsedTime -= act... | javascript | function addMeasurement(id) {
if (!enabled) {
return;
}
if (!(id instanceof PerfMeasurement)) {
id = new PerfMeasurement(id, id);
}
var elapsedTime = brackets.app.getElapsedMilliseconds();
if (activeTests[id.id]) {
elapsedTime -= act... | [
"function",
"addMeasurement",
"(",
"id",
")",
"{",
"if",
"(",
"!",
"enabled",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"(",
"id",
"instanceof",
"PerfMeasurement",
")",
")",
"{",
"id",
"=",
"new",
"PerfMeasurement",
"(",
"id",
",",
"id",
")",
"... | Stop a timer and add its measurements to the performance data.
Multiple measurements can be stored for any given name. If there are
multiple values for a name, they are stored in an Array.
If markStart() was not called for the specified timer, the
measured time is relative to app startup.
@param {Object} id Timer i... | [
"Stop",
"a",
"timer",
"and",
"add",
"its",
"measurements",
"to",
"the",
"performance",
"data",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/PerfUtils.js#L187-L223 | train | Add a measurement to the log | [
30522,
3853,
5587,
4168,
3022,
5397,
3672,
1006,
8909,
1007,
1063,
2065,
1006,
999,
9124,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
999,
1006,
8909,
6013,
11253,
2566,
16715,
5243,
28632,
3672,
1007,
1007,
1063,
8909,
1027,
2047,
2566,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ErrorHandler.js | function (sDetails) {
if (this._bMessageOpen) {
return;
}
this._bMessageOpen = true;
MessageBox.error(
this._sErrorText,
{
id : "serviceErrorMessageBox",
details : sDetails,
styleClass : this._oComponent.getContentDensityClass(),
actions : [MessageBox.Action.CLOSE]... | javascript | function (sDetails) {
if (this._bMessageOpen) {
return;
}
this._bMessageOpen = true;
MessageBox.error(
this._sErrorText,
{
id : "serviceErrorMessageBox",
details : sDetails,
styleClass : this._oComponent.getContentDensityClass(),
actions : [MessageBox.Action.CLOSE]... | [
"function",
"(",
"sDetails",
")",
"{",
"if",
"(",
"this",
".",
"_bMessageOpen",
")",
"{",
"return",
";",
"}",
"this",
".",
"_bMessageOpen",
"=",
"true",
";",
"MessageBox",
".",
"error",
"(",
"this",
".",
"_sErrorText",
",",
"{",
"id",
":",
"\"serviceEr... | Shows a {@link sap.m.MessageBox} when a service call has failed.
Only the first error message will be display.
@param {string} sDetails a technical error to be displayed on request
@private | [
"Shows",
"a",
"{"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ErrorHandler.js#L56-L73 | train | Show error message box | [
30522,
3853,
1006,
17371,
12928,
12146,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
1038,
7834,
3736,
3351,
26915,
1007,
1063,
2709,
1025,
1065,
2023,
1012,
1035,
1038,
7834,
3736,
3351,
26915,
1027,
2995,
1025,
4471,
8758,
1012,
7561,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.m/src/sap/m/MenuButton.js | isForbiddenType | function isForbiddenType(sType) {
var aTypes = [ButtonType.Up, ButtonType.Back, ButtonType.Unstyled];
return aTypes.indexOf(sType) !== -1;
} | javascript | function isForbiddenType(sType) {
var aTypes = [ButtonType.Up, ButtonType.Back, ButtonType.Unstyled];
return aTypes.indexOf(sType) !== -1;
} | [
"function",
"isForbiddenType",
"(",
"sType",
")",
"{",
"var",
"aTypes",
"=",
"[",
"ButtonType",
".",
"Up",
",",
"ButtonType",
".",
"Back",
",",
"ButtonType",
".",
"Unstyled",
"]",
";",
"return",
"aTypes",
".",
"indexOf",
"(",
"sType",
")",
"!==",
"-",
... | Several button type property values are not allowed | [
"Several",
"button",
"type",
"property",
"values",
"are",
"not",
"allowed"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/MenuButton.js#L528-L531 | train | Checks if the given type is forbidden | [
30522,
3853,
2003,
29278,
17062,
16454,
18863,
1006,
2358,
18863,
1007,
1063,
13075,
2012,
18863,
2015,
30524,
1006,
2358,
18863,
1007,
999,
1027,
1027,
1011,
1015,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | transitionOutAndRemove | function transitionOutAndRemove(response, isCancelled, opts) {
// abort if the show() and compile failed
if (!element) return $q.when(false);
options = angular.extend(options || {}, opts || {});
options.cancelAutoHide && options.cancelAutoHide();
options.element.trigg... | javascript | function transitionOutAndRemove(response, isCancelled, opts) {
// abort if the show() and compile failed
if (!element) return $q.when(false);
options = angular.extend(options || {}, opts || {});
options.cancelAutoHide && options.cancelAutoHide();
options.element.trigg... | [
"function",
"transitionOutAndRemove",
"(",
"response",
",",
"isCancelled",
",",
"opts",
")",
"{",
"// abort if the show() and compile failed",
"if",
"(",
"!",
"element",
")",
"return",
"$q",
".",
"when",
"(",
"false",
")",
";",
"options",
"=",
"angular",
".",
... | After the show process has finished/rejected:
- announce 'removing',
- perform the transition-out, and
- perform optional clean up scope. | [
"After",
"the",
"show",
"process",
"has",
"finished",
"/",
"rejected",
":",
"-",
"announce",
"removing",
"-",
"perform",
"the",
"transition",
"-",
"out",
"and",
"-",
"perform",
"optional",
"clean",
"up",
"scope",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/interimElement/interimElement.js#L526-L566 | train | transition out and remove | [
30522,
3853,
6653,
5833,
5685,
28578,
21818,
1006,
3433,
1010,
2003,
9336,
29109,
3709,
1010,
23569,
2015,
1007,
1063,
1013,
1013,
11113,
11589,
2065,
1996,
2265,
1006,
1007,
1998,
4012,
22090,
3478,
2065,
1006,
999,
5783,
1007,
2709,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/FileTreeViewModel.js | _markAsChanged | function _markAsChanged(treeData, changed) {
changed.forEach(function (filePath) {
var objectPath = _filePathToObjectPath(treeData, filePath);
if (objectPath) {
treeData = treeData.updateIn(objectPath, _addTimestamp);
}
});
return treeData;
... | javascript | function _markAsChanged(treeData, changed) {
changed.forEach(function (filePath) {
var objectPath = _filePathToObjectPath(treeData, filePath);
if (objectPath) {
treeData = treeData.updateIn(objectPath, _addTimestamp);
}
});
return treeData;
... | [
"function",
"_markAsChanged",
"(",
"treeData",
",",
"changed",
")",
"{",
"changed",
".",
"forEach",
"(",
"function",
"(",
"filePath",
")",
"{",
"var",
"objectPath",
"=",
"_filePathToObjectPath",
"(",
"treeData",
",",
"filePath",
")",
";",
"if",
"(",
"objectP... | @private
Sets/updates the timestamp on the file paths listed in the `changed` array.
@param {Immutable.Map} treeData
@param {Array.<string>} changed list of changed project-relative file paths
@return {Immutable.Map} revised treeData | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeViewModel.js#L987-L995 | train | Mark as changed | [
30522,
3853,
1035,
2928,
3022,
22305,
2098,
1006,
3392,
2850,
2696,
30524,
3392,
2850,
2696,
1010,
5371,
15069,
1007,
1025,
2065,
1006,
4874,
15069,
1007,
1063,
3392,
2850,
2696,
1027,
3392,
2850,
2696,
1012,
10651,
2378,
1006,
4874,
15069,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PrismJS/prism | components/prism-jsx.js | function (token) {
if (!token) {
return '';
}
if (typeof token === 'string') {
return token;
}
if (typeof token.content === 'string') {
return token.content;
}
return token.content.map(stringifyToken).join('');
} | javascript | function (token) {
if (!token) {
return '';
}
if (typeof token === 'string') {
return token;
}
if (typeof token.content === 'string') {
return token.content;
}
return token.content.map(stringifyToken).join('');
} | [
"function",
"(",
"token",
")",
"{",
"if",
"(",
"!",
"token",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"typeof",
"token",
"===",
"'string'",
")",
"{",
"return",
"token",
";",
"}",
"if",
"(",
"typeof",
"token",
".",
"content",
"===",
"'string'"... | The following will handle plain text inside tags | [
"The",
"following",
"will",
"handle",
"plain",
"text",
"inside",
"tags"
] | acceb3b56f0e8362a7ef274dbd85b17611df2ec4 | https://github.com/PrismJS/prism/blob/acceb3b56f0e8362a7ef274dbd85b17611df2ec4/components/prism-jsx.js#L38-L49 | train | Returns a string representation of a token | [
30522,
3853,
1006,
19204,
1007,
1063,
2065,
1006,
999,
19204,
1007,
1063,
2709,
1005,
1005,
1025,
1065,
2065,
1006,
2828,
11253,
19204,
1027,
1027,
1027,
1005,
5164,
1005,
1007,
1063,
2709,
19204,
1025,
1065,
2065,
1006,
2828,
11253,
19204,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(url, doc, onload)
{
if (mxClient.IS_IE)
{
doc.onreadystatechange = function ()
{
if (doc.readyState == 4)
{
onload();
}
};
}
else
{
doc.addEventListener('load', onload, false);
}
doc.load(url);
} | javascript | function(url, doc, onload)
{
if (mxClient.IS_IE)
{
doc.onreadystatechange = function ()
{
if (doc.readyState == 4)
{
onload();
}
};
}
else
{
doc.addEventListener('load', onload, false);
}
doc.load(url);
} | [
"function",
"(",
"url",
",",
"doc",
",",
"onload",
")",
"{",
"if",
"(",
"mxClient",
".",
"IS_IE",
")",
"{",
"doc",
".",
"onreadystatechange",
"=",
"function",
"(",
")",
"{",
"if",
"(",
"doc",
".",
"readyState",
"==",
"4",
")",
"{",
"onload",
"(",
... | Function: loadInto
Loads the specified URL *asynchronously* into the specified document,
invoking onload after the document has been loaded. This implementation
does not use <mxXmlRequest>, but the document.load method.
Parameters:
url - URL to get the data from.
doc - The document to load the URL into.
onload - Fun... | [
"Function",
":",
"loadInto"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L3741-L3759 | train | Load a file | [
30522,
3853,
1006,
24471,
2140,
1010,
9986,
1010,
2006,
11066,
1007,
1063,
2065,
1006,
25630,
20464,
11638,
1012,
2003,
1035,
29464,
1007,
1063,
9986,
1012,
2006,
16416,
5149,
9153,
15007,
22043,
1027,
3853,
1006,
1007,
1063,
2065,
1006,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | getDist | function getDist(type, node, centroid, attributes, mode) {
var getP = mode === 'kMedoids' ? function (i) {
return attributes[i](centroid);
} : function (i) {
return centroid[i];
};
var getQ = function getQ(i) {
return attributes[i](node);
};
return clusteringDistance(type, attributes.length, g... | javascript | function getDist(type, node, centroid, attributes, mode) {
var getP = mode === 'kMedoids' ? function (i) {
return attributes[i](centroid);
} : function (i) {
return centroid[i];
};
var getQ = function getQ(i) {
return attributes[i](node);
};
return clusteringDistance(type, attributes.length, g... | [
"function",
"getDist",
"(",
"type",
",",
"node",
",",
"centroid",
",",
"attributes",
",",
"mode",
")",
"{",
"var",
"getP",
"=",
"mode",
"===",
"'kMedoids'",
"?",
"function",
"(",
"i",
")",
"{",
"return",
"attributes",
"[",
"i",
"]",
"(",
"centroid",
... | /* eslint-enable | [
"/",
"*",
"eslint",
"-",
"enable"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L4107-L4119 | train | get dist of node | [
30522,
3853,
2131,
10521,
2102,
1006,
2828,
1010,
13045,
1010,
18120,
3593,
1010,
12332,
1010,
5549,
1007,
1063,
13075,
2131,
2361,
1027,
5549,
1027,
1027,
1027,
1005,
2463,
26010,
9821,
1005,
1029,
3853,
1006,
1045,
1007,
1063,
2709,
12332... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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, oElement, bIncludePseudoCells) {
bIncludePseudoCells = bIncludePseudoCells === true;
var $Element = jQuery(oElement);
var $Cell = TableUtils.getCell(oTable, oElement, bIncludePseudoCells);
if (!$Cell || $Cell[0] === $Element[0]) {
return null; // The element is not inside a table cell... | javascript | function(oTable, oElement, bIncludePseudoCells) {
bIncludePseudoCells = bIncludePseudoCells === true;
var $Element = jQuery(oElement);
var $Cell = TableUtils.getCell(oTable, oElement, bIncludePseudoCells);
if (!$Cell || $Cell[0] === $Element[0]) {
return null; // The element is not inside a table cell... | [
"function",
"(",
"oTable",
",",
"oElement",
",",
"bIncludePseudoCells",
")",
"{",
"bIncludePseudoCells",
"=",
"bIncludePseudoCells",
"===",
"true",
";",
"var",
"$Element",
"=",
"jQuery",
"(",
"oElement",
")",
";",
"var",
"$Cell",
"=",
"TableUtils",
".",
"getCe... | Returns the table cell which is the parent of an element.
@param {sap.ui.table.Table} oTable Instance of the table used as the context within which to search for the parent cell.
@param {jQuery | HTMLElement} oElement An element inside a table cell.
@param {jQuery | HTMLElement} [bIncludePseudoCells=false] Whether to ... | [
"Returns",
"the",
"table",
"cell",
"which",
"is",
"the",
"parent",
"of",
"an",
"element",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L893-L904 | train | Returns the cell of the given element. | [
30522,
3853,
1006,
27178,
3085,
1010,
1051,
12260,
3672,
1010,
8026,
20464,
12672,
29251,
6784,
10085,
5349,
2015,
1007,
1063,
8026,
20464,
12672,
29251,
6784,
10085,
5349,
2015,
1027,
8026,
20464,
12672,
29251,
6784,
10085,
5349,
2015,
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... | |
thomaspark/bootswatch | docs/3/bower_components/html5shiv/dist/html5shiv-printshiv.js | createElement | function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nod... | javascript | function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nod... | [
"function",
"createElement",
"(",
"nodeName",
",",
"ownerDocument",
",",
"data",
")",
"{",
"if",
"(",
"!",
"ownerDocument",
")",
"{",
"ownerDocument",
"=",
"document",
";",
"}",
"if",
"(",
"supportsUnknownElements",
")",
"{",
"return",
"ownerDocument",
".",
... | returns a shived element for the given nodeName and document
@memberOf html5
@param {String} nodeName name of the element
@param {Document} ownerDocument The context document.
@returns {Object} The shived element. | [
"returns",
"a",
"shived",
"element",
"for",
"the",
"given",
"nodeName",
"and",
"document"
] | a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd | https://github.com/thomaspark/bootswatch/blob/a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd/docs/3/bower_components/html5shiv/dist/html5shiv-printshiv.js#L127-L155 | train | Creates a new element | [
30522,
3853,
3443,
12260,
3672,
1006,
13045,
18442,
1010,
3954,
3527,
24894,
4765,
1010,
2951,
1007,
1063,
2065,
1006,
999,
3954,
3527,
24894,
4765,
1007,
1063,
3954,
3527,
24894,
4765,
1027,
6254,
1025,
1065,
2065,
1006,
6753,
16814,
19779... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(ctor, superCtor)
{
var f = function() {};
f.prototype = superCtor.prototype;
ctor.prototype = new f();
ctor.prototype.constructor = ctor;
} | javascript | function(ctor, superCtor)
{
var f = function() {};
f.prototype = superCtor.prototype;
ctor.prototype = new f();
ctor.prototype.constructor = ctor;
} | [
"function",
"(",
"ctor",
",",
"superCtor",
")",
"{",
"var",
"f",
"=",
"function",
"(",
")",
"{",
"}",
";",
"f",
".",
"prototype",
"=",
"superCtor",
".",
"prototype",
";",
"ctor",
".",
"prototype",
"=",
"new",
"f",
"(",
")",
";",
"ctor",
".",
"pro... | Function: extend
Assigns a copy of the superclass prototype to the subclass prototype.
Note that this does not call the constructor of the superclass at this
point, the superclass constructor should be called explicitely in the
subclass constructor. Below is an example.
(code)
MyGraph = function(container, model, ren... | [
"Function",
":",
"extend"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L4015-L4022 | train | A function that creates a new object that inherits from another object. | [
30522,
3853,
1006,
14931,
2953,
1010,
3565,
16761,
1007,
1063,
13075,
1042,
1027,
3853,
1006,
1007,
1063,
1065,
1025,
1042,
1012,
8773,
1027,
3565,
16761,
1012,
8773,
1025,
14931,
2953,
1012,
8773,
1027,
2047,
1042,
1006,
1007,
1025,
14931,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableColumnUtils.js | function(oTable, iColumnIndex, iWidth, bFireEvent, iColumnSpan) {
if (!oTable ||
iColumnIndex == null || iColumnIndex < 0 ||
iWidth == null || iWidth <= 0) {
return false;
}
if (iColumnSpan == null || iColumnSpan <= 0) {
iColumnSpan = 1;
}
if (bFireEvent == null) {
bFireEvent = true;
... | javascript | function(oTable, iColumnIndex, iWidth, bFireEvent, iColumnSpan) {
if (!oTable ||
iColumnIndex == null || iColumnIndex < 0 ||
iWidth == null || iWidth <= 0) {
return false;
}
if (iColumnSpan == null || iColumnSpan <= 0) {
iColumnSpan = 1;
}
if (bFireEvent == null) {
bFireEvent = true;
... | [
"function",
"(",
"oTable",
",",
"iColumnIndex",
",",
"iWidth",
",",
"bFireEvent",
",",
"iColumnSpan",
")",
"{",
"if",
"(",
"!",
"oTable",
"||",
"iColumnIndex",
"==",
"null",
"||",
"iColumnIndex",
"<",
"0",
"||",
"iWidth",
"==",
"null",
"||",
"iWidth",
"<... | Resizes one or more visible columns to the specified amount of pixels.
In case a column span is specified:
The span covers only visible columns. If columns directly after the column with index <code>iColumnIndex</code> are invisible they
will be skipped and not be considered for resizing.
The new width <code>iWidth</c... | [
"Resizes",
"one",
"or",
"more",
"visible",
"columns",
"to",
"the",
"specified",
"amount",
"of",
"pixels",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableColumnUtils.js#L569-L680 | train | Returns true if the column is visible and the width of the column is at least the specified amount of visible. | [
30522,
3853,
1006,
27178,
3085,
1010,
24582,
4747,
2819,
11483,
3207,
2595,
1010,
1045,
9148,
11927,
2232,
1010,
28939,
7442,
18697,
3372,
1010,
24582,
4747,
2819,
3619,
9739,
1007,
1063,
2065,
1006,
999,
27178,
3085,
1064,
1064,
24582,
474... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
electron/electron | lib/browser/guest-window-manager.js | function (sender, target) {
return (target.getLastWebPreferences().openerId === sender.id) ||
(sender.getLastWebPreferences().nodeIntegration === true) ||
isSameOrigin(sender.getURL(), target.getURL())
} | javascript | function (sender, target) {
return (target.getLastWebPreferences().openerId === sender.id) ||
(sender.getLastWebPreferences().nodeIntegration === true) ||
isSameOrigin(sender.getURL(), target.getURL())
} | [
"function",
"(",
"sender",
",",
"target",
")",
"{",
"return",
"(",
"target",
".",
"getLastWebPreferences",
"(",
")",
".",
"openerId",
"===",
"sender",
".",
"id",
")",
"||",
"(",
"sender",
".",
"getLastWebPreferences",
"(",
")",
".",
"nodeIntegration",
"===... | Checks whether |sender| can access the |target|: 1. Check whether |sender| is the parent of |target|. 2. Check whether |sender| has node integration, if so it is allowed to do anything it wants. 3. Check whether the origins match. However it allows a child window without node integration but with same origin to do any... | [
"Checks",
"whether",
"|sender|",
"can",
"access",
"the",
"|target|",
":",
"1",
".",
"Check",
"whether",
"|sender|",
"is",
"the",
"parent",
"of",
"|target|",
".",
"2",
".",
"Check",
"whether",
"|sender|",
"has",
"node",
"integration",
"if",
"so",
"it",
"is"... | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/guest-window-manager.js#L169-L173 | train | Returns true if the target is the same origin as the sender | [
30522,
3853,
1006,
4604,
2121,
1010,
4539,
1007,
1063,
2709,
1006,
4539,
1012,
2131,
8523,
2102,
8545,
2497,
28139,
25523,
2015,
1006,
1007,
1012,
16181,
3593,
1027,
1027,
1027,
4604,
2121,
1012,
8909,
1007,
1064,
1064,
1006,
4604,
2121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
TryGhost/Ghost | core/server/helpers/get.js | isBrowse | function isBrowse(options) {
var browse = true;
if (options.id || options.slug) {
browse = false;
}
return browse;
} | javascript | function isBrowse(options) {
var browse = true;
if (options.id || options.slug) {
browse = false;
}
return browse;
} | [
"function",
"isBrowse",
"(",
"options",
")",
"{",
"var",
"browse",
"=",
"true",
";",
"if",
"(",
"options",
".",
"id",
"||",
"options",
".",
"slug",
")",
"{",
"browse",
"=",
"false",
";",
"}",
"return",
"browse",
";",
"}"
] | ## Is Browse
Is this a Browse request or a Read request?
@param {Object} resource
@param {Object} options
@returns {boolean} | [
"##",
"Is",
"Browse",
"Is",
"this",
"a",
"Browse",
"request",
"or",
"a",
"Read",
"request?"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/helpers/get.js#L59-L67 | train | Returns true if the user is browse | [
30522,
3853,
2003,
12618,
9333,
2063,
1006,
7047,
1007,
1063,
13075,
11347,
2063,
1027,
2995,
1025,
2065,
1006,
7047,
1012,
8909,
1064,
1064,
7047,
1012,
23667,
1007,
1063,
11347,
2063,
1027,
6270,
1025,
1065,
2709,
11347,
2063,
1025,
1065,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/block-spacing.js | isValid | function isValid(left, right) {
return (
!util.isTokenOnSameLine(left, right) ||
sourceCode.isSpaceBetweenTokens(left, right) === always
);
} | javascript | function isValid(left, right) {
return (
!util.isTokenOnSameLine(left, right) ||
sourceCode.isSpaceBetweenTokens(left, right) === always
);
} | [
"function",
"isValid",
"(",
"left",
",",
"right",
")",
"{",
"return",
"(",
"!",
"util",
".",
"isTokenOnSameLine",
"(",
"left",
",",
"right",
")",
"||",
"sourceCode",
".",
"isSpaceBetweenTokens",
"(",
"left",
",",
"right",
")",
"===",
"always",
")",
";",
... | Checks whether or not:
- given tokens are on same line.
- there is/isn't a space between given tokens.
@param {Token} left - A token to check.
@param {Token} right - The token which is next to `left`.
@returns {boolean}
When the option is `"always"`, `true` if there are one or more spaces between given tokens.
When the... | [
"Checks",
"whether",
"or",
"not",
":",
"-",
"given",
"tokens",
"are",
"on",
"same",
"line",
".",
"-",
"there",
"is",
"/",
"isn",
"t",
"a",
"space",
"between",
"given",
"tokens",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/block-spacing.js#L68-L73 | train | Check if the given two tokens are valid | [
30522,
3853,
2003,
10175,
3593,
1006,
2187,
1010,
2157,
1007,
1063,
2709,
1006,
999,
21183,
4014,
1012,
21541,
11045,
8540,
21559,
18809,
2063,
1006,
2187,
1010,
2157,
1007,
1064,
1064,
3120,
16044,
1012,
26354,
15327,
20915,
28394,
13663,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Dogfalo/materialize | dist/js/materialize.js | Datepicker | function Datepicker(el, options) {
_classCallCheck(this, Datepicker);
var _this53 = _possibleConstructorReturn(this, (Datepicker.__proto__ || Object.getPrototypeOf(Datepicker)).call(this, Datepicker, el, options));
_this53.el.M_Datepicker = _this53;
_this53.options = $.extend({}, Datepicker.d... | javascript | function Datepicker(el, options) {
_classCallCheck(this, Datepicker);
var _this53 = _possibleConstructorReturn(this, (Datepicker.__proto__ || Object.getPrototypeOf(Datepicker)).call(this, Datepicker, el, options));
_this53.el.M_Datepicker = _this53;
_this53.options = $.extend({}, Datepicker.d... | [
"function",
"Datepicker",
"(",
"el",
",",
"options",
")",
"{",
"_classCallCheck",
"(",
"this",
",",
"Datepicker",
")",
";",
"var",
"_this53",
"=",
"_possibleConstructorReturn",
"(",
"this",
",",
"(",
"Datepicker",
".",
"__proto__",
"||",
"Object",
".",
"getP... | Construct Datepicker instance and set up overlay
@constructor
@param {Element} el
@param {Object} options | [
"Construct",
"Datepicker",
"instance",
"and",
"set",
"up",
"overlay"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/dist/js/materialize.js#L8821-L8869 | train | Construct Datepicker instance | [
30522,
3853,
3058,
24330,
5484,
1006,
3449,
1010,
7047,
1007,
1063,
1035,
2465,
9289,
29358,
11012,
1006,
2023,
1010,
3058,
24330,
5484,
1007,
1025,
13075,
1035,
2023,
22275,
1027,
1035,
2825,
8663,
3367,
6820,
16761,
13465,
14287,
1006,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/codemirror/fixOrderedListNumber.js | findFirstListItem | function findFirstListItem(lineNumber, cm) {
let nextLineNumber = lineNumber;
let lineText = cm.getLine(lineNumber);
while (listRE.test(lineText)) {
nextLineNumber -= 1;
lineText = cm.getLine(nextLineNumber);
}
if (lineNumber === nextLineNumber) {
nextLineNumber = -1;
} else {
nextLineNumb... | javascript | function findFirstListItem(lineNumber, cm) {
let nextLineNumber = lineNumber;
let lineText = cm.getLine(lineNumber);
while (listRE.test(lineText)) {
nextLineNumber -= 1;
lineText = cm.getLine(nextLineNumber);
}
if (lineNumber === nextLineNumber) {
nextLineNumber = -1;
} else {
nextLineNumb... | [
"function",
"findFirstListItem",
"(",
"lineNumber",
",",
"cm",
")",
"{",
"let",
"nextLineNumber",
"=",
"lineNumber",
";",
"let",
"lineText",
"=",
"cm",
".",
"getLine",
"(",
"lineNumber",
")",
";",
"while",
"(",
"listRE",
".",
"test",
"(",
"lineText",
")",
... | find line number of list item which contains given lineNumber
@param {number} lineNumber - line number of list item
@param {CodeMirror} cm - CodeMirror instance
@returns {number} - line number of first list item
@ignore | [
"find",
"line",
"number",
"of",
"list",
"item",
"which",
"contains",
"given",
"lineNumber"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/codemirror/fixOrderedListNumber.js#L103-L119 | train | Find the next list item | [
30522,
3853,
2424,
8873,
12096,
9863,
4221,
2213,
1006,
17517,
29440,
1010,
4642,
1007,
1063,
2292,
2279,
4179,
19172,
5677,
1027,
17517,
29440,
1025,
2292,
2240,
18209,
1027,
4642,
1012,
2131,
4179,
1006,
17517,
29440,
1007,
1025,
2096,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | function(cell)
{
var result = '';
if (cell != null)
{
var parent = cell.getParent();
while (parent != null)
{
var index = parent.getIndex(cell);
result = index + mxCellPath.PATH_SEPARATOR + result;
cell = parent;
parent = cell.getParent();
}
}
// Removes trailing se... | javascript | function(cell)
{
var result = '';
if (cell != null)
{
var parent = cell.getParent();
while (parent != null)
{
var index = parent.getIndex(cell);
result = index + mxCellPath.PATH_SEPARATOR + result;
cell = parent;
parent = cell.getParent();
}
}
// Removes trailing se... | [
"function",
"(",
"cell",
")",
"{",
"var",
"result",
"=",
"''",
";",
"if",
"(",
"cell",
"!=",
"null",
")",
"{",
"var",
"parent",
"=",
"cell",
".",
"getParent",
"(",
")",
";",
"while",
"(",
"parent",
"!=",
"null",
")",
"{",
"var",
"index",
"=",
"... | Function: create
Creates the cell path for the given cell. The cell path is a
concatenation of the indices of all ancestors on the (finite) path to
the root, eg. "0.0.0.1".
Parameters:
cell - Cell whose path should be returned. | [
"Function",
":",
"create"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L43235-L43262 | train | Returns the path of the cell | [
30522,
3853,
1006,
3526,
1007,
1063,
13075,
2765,
1027,
1005,
1005,
1025,
2065,
1006,
3526,
999,
1027,
19701,
1007,
1063,
13075,
6687,
1027,
3526,
1012,
2131,
19362,
4765,
1006,
1007,
30524,
1027,
6687,
1012,
2131,
22254,
10288,
1006,
3526,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/code-path-analysis/code-path-state.js | getThrowContext | function getThrowContext(state) {
let context = state.tryContext;
while (context) {
if (context.position === "try" ||
(context.hasFinalizer && context.position === "catch")
) {
return context;
}
context = context.upper;
}
return state;
} | javascript | function getThrowContext(state) {
let context = state.tryContext;
while (context) {
if (context.position === "try" ||
(context.hasFinalizer && context.position === "catch")
) {
return context;
}
context = context.upper;
}
return state;
} | [
"function",
"getThrowContext",
"(",
"state",
")",
"{",
"let",
"context",
"=",
"state",
".",
"tryContext",
";",
"while",
"(",
"context",
")",
"{",
"if",
"(",
"context",
".",
"position",
"===",
"\"try\"",
"||",
"(",
"context",
".",
"hasFinalizer",
"&&",
"c... | Gets a context for a `throw` statement.
@param {CodePathState} state - A state to get.
@returns {TryContext|CodePathState} A context for a `throw` statement. | [
"Gets",
"a",
"context",
"for",
"a",
"throw",
"statement",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/code-path-analysis/code-path-state.js#L114-L127 | train | Get the next try or catch context | [
30522,
3853,
2131,
2705,
10524,
8663,
18209,
1006,
2110,
1007,
1063,
2292,
6123,
1027,
2110,
1012,
3046,
8663,
18209,
1025,
2096,
1006,
6123,
1007,
1063,
2065,
1006,
6123,
1012,
2597,
1027,
1027,
1027,
1000,
3046,
1000,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/events/F6Navigation.js | isContained | function isContained(aContainers, oRef) {
for (var i = 0; i < aContainers.length; i++) {
if (aContainers[i] === oRef || jQuery.contains(aContainers[i], oRef)) {
return true;
}
}
return false;
} | javascript | function isContained(aContainers, oRef) {
for (var i = 0; i < aContainers.length; i++) {
if (aContainers[i] === oRef || jQuery.contains(aContainers[i], oRef)) {
return true;
}
}
return false;
} | [
"function",
"isContained",
"(",
"aContainers",
",",
"oRef",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"aContainers",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"aContainers",
"[",
"i",
"]",
"===",
"oRef",
"||",
"jQuery",
... | Checks whether the given DomRef is contained or equals (in) one of the given container | [
"Checks",
"whether",
"the",
"given",
"DomRef",
"is",
"contained",
"or",
"equals",
"(",
"in",
")",
"one",
"of",
"the",
"given",
"container"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/F6Navigation.js#L114-L121 | train | Returns true if the given container is contained in the given container | [
30522,
3853,
2003,
8663,
28055,
1006,
9353,
12162,
18175,
2869,
30524,
2869,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
2065,
1006,
9353,
12162,
18175,
2869,
1031,
1045,
1033,
1027,
1027,
1027,
10848,
2546,
1064,
1064,
1046,
4226,
2854... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/parse/parseBook.js | parseMultilingualBook | function parseMultilingualBook(book) {
var languages = book.getLanguages();
var langList = languages.getList();
return Promise.reduce(langList, function(currentBook, lang) {
var langID = lang.getID();
var child = Book.createFromParent(currentBook, langID);
var ignore = currentBook.g... | javascript | function parseMultilingualBook(book) {
var languages = book.getLanguages();
var langList = languages.getList();
return Promise.reduce(langList, function(currentBook, lang) {
var langID = lang.getID();
var child = Book.createFromParent(currentBook, langID);
var ignore = currentBook.g... | [
"function",
"parseMultilingualBook",
"(",
"book",
")",
"{",
"var",
"languages",
"=",
"book",
".",
"getLanguages",
"(",
")",
";",
"var",
"langList",
"=",
"languages",
".",
"getList",
"(",
")",
";",
"return",
"Promise",
".",
"reduce",
"(",
"langList",
",",
... | Parse a multilingual book
@param {Book} book
@return {Promise<Book>} | [
"Parse",
"a",
"multilingual",
"book"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/parse/parseBook.js#L31-L51 | train | Parse multilingual book | [
30522,
3853,
11968,
3366,
12274,
7096,
16281,
8787,
8654,
1006,
2338,
1007,
1063,
13075,
4155,
1027,
2338,
1012,
2131,
25023,
6692,
8449,
1006,
1007,
1025,
13075,
11374,
9863,
1027,
4155,
1012,
2131,
9863,
1006,
1007,
1025,
2709,
4872,
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... |
GeekyAnts/vue-native-core | dist/vue.runtime.common.js | normalizeChildren | function normalizeChildren (children) {
return isPrimitive(children)
? [createTextVNode(children)]
: Array.isArray(children)
? normalizeArrayChildren(children)
: undefined
} | javascript | function normalizeChildren (children) {
return isPrimitive(children)
? [createTextVNode(children)]
: Array.isArray(children)
? normalizeArrayChildren(children)
: undefined
} | [
"function",
"normalizeChildren",
"(",
"children",
")",
"{",
"return",
"isPrimitive",
"(",
"children",
")",
"?",
"[",
"createTextVNode",
"(",
"children",
")",
"]",
":",
"Array",
".",
"isArray",
"(",
"children",
")",
"?",
"normalizeArrayChildren",
"(",
"children... | 2. When the children contains constructs that always generated nested Arrays, e.g. <template>, <slot>, v-for, or when the children is provided by user with hand-written render functions / JSX. In such cases a full normalization is needed to cater to all possible types of children values. | [
"2",
".",
"When",
"the",
"children",
"contains",
"constructs",
"that",
"always",
"generated",
"nested",
"Arrays",
"e",
".",
"g",
".",
"<template",
">",
"<slot",
">",
"v",
"-",
"for",
"or",
"when",
"the",
"children",
"is",
"provided",
"by",
"user",
"with"... | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/dist/vue.runtime.common.js#L1784-L1790 | train | Normalizes children to a single node array | [
30522,
3853,
3671,
4697,
19339,
7389,
1006,
2336,
1007,
1063,
2709,
2003,
18098,
27605,
6024,
1006,
2336,
1007,
1029,
1031,
3443,
18209,
16022,
10244,
1006,
2336,
1007,
1033,
1024,
9140,
1012,
18061,
11335,
2100,
1006,
2336,
1007,
1029,
367... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/components/scene/vr-mode-ui.js | createEnterVRButton | function createEnterVRButton (onClick) {
var vrButton;
var wrapper;
// Create elements.
wrapper = document.createElement('div');
wrapper.classList.add(ENTER_VR_CLASS);
wrapper.setAttribute(constants.AFRAME_INJECTED, '');
vrButton = document.createElement('button');
vrButton.className = ENTER_VR_BTN_CLA... | javascript | function createEnterVRButton (onClick) {
var vrButton;
var wrapper;
// Create elements.
wrapper = document.createElement('div');
wrapper.classList.add(ENTER_VR_CLASS);
wrapper.setAttribute(constants.AFRAME_INJECTED, '');
vrButton = document.createElement('button');
vrButton.className = ENTER_VR_BTN_CLA... | [
"function",
"createEnterVRButton",
"(",
"onClick",
")",
"{",
"var",
"vrButton",
";",
"var",
"wrapper",
";",
"// Create elements.",
"wrapper",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"wrapper",
".",
"classList",
".",
"add",
"(",
"ENTER_VR... | Create a button that when clicked will enter into stereo-rendering mode for VR.
Structure: <div><button></div>
@param {function} onClick - click event handler
@returns {Element} Wrapper <div>. | [
"Create",
"a",
"button",
"that",
"when",
"clicked",
"will",
"enter",
"into",
"stereo",
"-",
"rendering",
"mode",
"for",
"VR",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/scene/vr-mode-ui.js#L138-L160 | train | Creates a button that will enter the VR mode. | [
30522,
3853,
3443,
29110,
19716,
8569,
15474,
1006,
2006,
20464,
6799,
1007,
1063,
13075,
27830,
8569,
15474,
1025,
13075,
10236,
4842,
1025,
1013,
1013,
3443,
3787,
1012,
10236,
4842,
1027,
6254,
1012,
3443,
12260,
3672,
1006,
1005,
4487,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | src/core/core.scale.js | function() {
var me = this;
if (me.margins) {
me.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0);
me.paddingTop = Math.max(me.paddingTop - me.margins.top, 0);
me.paddingRight = Math.max(me.paddingRight - me.margins.right, 0);
me.paddingBottom = Math.max(me.paddingBottom - me.margins.bottom, ... | javascript | function() {
var me = this;
if (me.margins) {
me.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0);
me.paddingTop = Math.max(me.paddingTop - me.margins.top, 0);
me.paddingRight = Math.max(me.paddingRight - me.margins.right, 0);
me.paddingBottom = Math.max(me.paddingBottom - me.margins.bottom, ... | [
"function",
"(",
")",
"{",
"var",
"me",
"=",
"this",
";",
"if",
"(",
"me",
".",
"margins",
")",
"{",
"me",
".",
"paddingLeft",
"=",
"Math",
".",
"max",
"(",
"me",
".",
"paddingLeft",
"-",
"me",
".",
"margins",
".",
"left",
",",
"0",
")",
";",
... | Handle margins and padding interactions
@private | [
"Handle",
"margins",
"and",
"padding",
"interactions"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/core/core.scale.js#L556-L564 | train | Set the padding to the right or bottom of the rectangle | [
30522,
3853,
1006,
1007,
1063,
13075,
2033,
1027,
2023,
1025,
2065,
1006,
2033,
1012,
17034,
1007,
1063,
2033,
1012,
11687,
4667,
2571,
6199,
1027,
8785,
1012,
4098,
1006,
2033,
1012,
11687,
4667,
2571,
6199,
1011,
2033,
1012,
17034,
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... | |
aws/aws-sdk-js | lib/response.js | nextPage | function nextPage(callback) {
var config;
var service = this.request.service;
var operation = this.request.operation;
try {
config = service.paginationConfig(operation, true);
} catch (e) { this.error = e; }
if (!this.hasNextPage()) {
if (callback) callback(this.error, null);
... | javascript | function nextPage(callback) {
var config;
var service = this.request.service;
var operation = this.request.operation;
try {
config = service.paginationConfig(operation, true);
} catch (e) { this.error = e; }
if (!this.hasNextPage()) {
if (callback) callback(this.error, null);
... | [
"function",
"nextPage",
"(",
"callback",
")",
"{",
"var",
"config",
";",
"var",
"service",
"=",
"this",
".",
"request",
".",
"service",
";",
"var",
"operation",
"=",
"this",
".",
"request",
".",
"operation",
";",
"try",
"{",
"config",
"=",
"service",
"... | Creates a new request for the next page of response data, calling the
callback with the page data if a callback is provided.
@callback callback function(err, data)
Called when a page of data is returned from the next request.
@param err [Error] an error object, if an error occurred in the request
@param data [Object]... | [
"Creates",
"a",
"new",
"request",
"for",
"the",
"next",
"page",
"of",
"response",
"data",
"calling",
"the",
"callback",
"with",
"the",
"page",
"data",
"if",
"a",
"callback",
"is",
"provided",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/response.js#L132-L157 | train | Get the next page of the next page | [
30522,
3853,
2279,
13704,
1006,
2655,
5963,
1007,
1063,
13075,
9530,
8873,
2290,
1025,
13075,
2326,
1027,
2023,
1012,
5227,
1012,
2326,
1025,
13075,
3169,
1027,
2023,
1012,
5227,
1012,
3169,
1025,
3046,
1063,
9530,
8873,
2290,
1027,
2326,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
uber/deck.gl | modules/layers/src/solid-polygon-layer/polygon.js | copyFlatRing | function copyFlatRing(target, targetStartIndex, positions, size, srcStartIndex = 0, srcEndIndex) {
srcEndIndex = srcEndIndex || positions.length;
const srcLength = srcEndIndex - srcStartIndex;
if (srcLength <= 0) {
return targetStartIndex;
}
let targetIndex = targetStartIndex;
for (let i = 0; i < srcLe... | javascript | function copyFlatRing(target, targetStartIndex, positions, size, srcStartIndex = 0, srcEndIndex) {
srcEndIndex = srcEndIndex || positions.length;
const srcLength = srcEndIndex - srcStartIndex;
if (srcLength <= 0) {
return targetStartIndex;
}
let targetIndex = targetStartIndex;
for (let i = 0; i < srcLe... | [
"function",
"copyFlatRing",
"(",
"target",
",",
"targetStartIndex",
",",
"positions",
",",
"size",
",",
"srcStartIndex",
"=",
"0",
",",
"srcEndIndex",
")",
"{",
"srcEndIndex",
"=",
"srcEndIndex",
"||",
"positions",
".",
"length",
";",
"const",
"srcLength",
"="... | Copy a simple flat array into another flat array, closes the ring if needed.
@param {Float64Array} target - destination
@param {Number} targetStartIndex - index in the destination to start copying into
@param {Array} positions - array of numbers
@param {Number} size - size of a position, 2 (xy) or 3 (xyz)
@param {Numbe... | [
"Copy",
"a",
"simple",
"flat",
"array",
"into",
"another",
"flat",
"array",
"closes",
"the",
"ring",
"if",
"needed",
"."
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/layers/src/solid-polygon-layer/polygon.js#L117-L135 | train | Copy a flat ring to a flat array | [
30522,
3853,
6100,
10258,
4017,
4892,
1006,
4539,
1010,
7889,
7559,
7629,
3207,
2595,
1010,
4460,
1010,
2946,
1010,
5034,
6169,
7559,
7629,
3207,
2595,
1027,
1014,
1010,
5034,
23865,
30524,
5034,
14321,
3070,
2705,
1027,
5034,
23865,
22254,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/LocaleData.js | function(sCurrency) {
// try to lookup currency digits from custom currencies
var mCustomCurrencies = this._get("currency");
if (mCustomCurrencies) {
if (mCustomCurrencies[sCurrency] && mCustomCurrencies[sCurrency].hasOwnProperty("digits")) {
return mCustomCurrencies[sCurrency].digits;
} else if ... | javascript | function(sCurrency) {
// try to lookup currency digits from custom currencies
var mCustomCurrencies = this._get("currency");
if (mCustomCurrencies) {
if (mCustomCurrencies[sCurrency] && mCustomCurrencies[sCurrency].hasOwnProperty("digits")) {
return mCustomCurrencies[sCurrency].digits;
} else if ... | [
"function",
"(",
"sCurrency",
")",
"{",
"// try to lookup currency digits from custom currencies",
"var",
"mCustomCurrencies",
"=",
"this",
".",
"_get",
"(",
"\"currency\"",
")",
";",
"if",
"(",
"mCustomCurrencies",
")",
"{",
"if",
"(",
"mCustomCurrencies",
"[",
"sC... | Returns the number of digits of the specified currency.
@param {string} sCurrency ISO 4217 currency code
@returns {int} digits of the currency
@public
@since 1.21.1 | [
"Returns",
"the",
"number",
"of",
"digits",
"of",
"the",
"specified",
"currency",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L963-L984 | train | Returns the number of digits for the given currency | [
30522,
3853,
1006,
8040,
3126,
7389,
5666,
1007,
1063,
1013,
1013,
3046,
2000,
2298,
6279,
9598,
16648,
2013,
7661,
12731,
14343,
14767,
13075,
11338,
19966,
5358,
10841,
14343,
14767,
1027,
2023,
1012,
1035,
2131,
1006,
1000,
9598,
1000,
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/model/odata/v4/_AnnotationHelperExpression.js | function (oPathValue, sType) {
var sExpectedEdmType = sType === "And" || sType === "Or" ? "Edm.Boolean" : undefined;
// Note: it is safe to modify the caller's object here
oPathValue.complexBinding = false;
return SyncPromise.all([
Expression.parameter(oPathValue, 0, sExpectedEdmType),
Expression.... | javascript | function (oPathValue, sType) {
var sExpectedEdmType = sType === "And" || sType === "Or" ? "Edm.Boolean" : undefined;
// Note: it is safe to modify the caller's object here
oPathValue.complexBinding = false;
return SyncPromise.all([
Expression.parameter(oPathValue, 0, sExpectedEdmType),
Expression.... | [
"function",
"(",
"oPathValue",
",",
"sType",
")",
"{",
"var",
"sExpectedEdmType",
"=",
"sType",
"===",
"\"And\"",
"||",
"sType",
"===",
"\"Or\"",
"?",
"\"Edm.Boolean\"",
":",
"undefined",
";",
"// Note: it is safe to modify the caller's object here",
"oPathValue",
"."... | Handling of "14.5.1 Comparison and Logical Operators" except <code>edm:Not</code>.
@param {object} oPathValue
path and value information pointing to the parameter array (see Expression object)
@param {string} sType
the operator as text (like "And" or "Or")
@returns {sap.ui.base.SyncPromise}
a sync promise which resolv... | [
"Handling",
"of",
"14",
".",
"5",
".",
"1",
"Comparison",
"and",
"Logical",
"Operators",
"except",
"<code",
">",
"edm",
":",
"Not<",
"/",
"code",
">",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js#L625-L674 | train | Returns an object with the parameters of the given type and the value of the given path. | [
30522,
3853,
1006,
6728,
8988,
10175,
5657,
1010,
2358,
18863,
1007,
1063,
13075,
3348,
5051,
10985,
2098,
20492,
18863,
1027,
2358,
30524,
2000,
19933,
1996,
20587,
1005,
1055,
4874,
2182,
6728,
8988,
10175,
5657,
1012,
3375,
8428,
4667,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | docs/app/js/codepen.js | processJs | function processJs(jsFiles) {
var mergedJs = mergeFiles(jsFiles).join(' ');
var script = replaceDemoModuleWithCodepenModule(mergedJs);
return script;
} | javascript | function processJs(jsFiles) {
var mergedJs = mergeFiles(jsFiles).join(' ');
var script = replaceDemoModuleWithCodepenModule(mergedJs);
return script;
} | [
"function",
"processJs",
"(",
"jsFiles",
")",
"{",
"var",
"mergedJs",
"=",
"mergeFiles",
"(",
"jsFiles",
")",
".",
"join",
"(",
"' '",
")",
";",
"var",
"script",
"=",
"replaceDemoModuleWithCodepenModule",
"(",
"mergedJs",
")",
";",
"return",
"script",
";",
... | Applies modifications the javascript prior to sending to codepen. Currently merges js files and replaces the module with the Codepen module. See documentation for replaceDemoModuleWithCodepenModule. | [
"Applies",
"modifications",
"the",
"javascript",
"prior",
"to",
"sending",
"to",
"codepen",
".",
"Currently",
"merges",
"js",
"files",
"and",
"replaces",
"the",
"module",
"with",
"the",
"Codepen",
"module",
".",
"See",
"documentation",
"for",
"replaceDemoModuleWit... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/app/js/codepen.js#L148-L152 | train | Process the JS files | [
30522,
3853,
2832,
22578,
1006,
1046,
22747,
9463,
2015,
1007,
1063,
13075,
5314,
22578,
1027,
13590,
8873,
4244,
1006,
1046,
22747,
9463,
2015,
1007,
1012,
3693,
1006,
1005,
1005,
1007,
1025,
13075,
5896,
1027,
2999,
6633,
19506,
8566,
257... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/_ODataMetaModelUtils.js | function (oAnnotations, sQualifiedName, bInContainer) {
var o = bInContainer
? oAnnotations.EntityContainer
: oAnnotations.propertyAnnotations;
return o && o[sQualifiedName] || {};
} | javascript | function (oAnnotations, sQualifiedName, bInContainer) {
var o = bInContainer
? oAnnotations.EntityContainer
: oAnnotations.propertyAnnotations;
return o && o[sQualifiedName] || {};
} | [
"function",
"(",
"oAnnotations",
",",
"sQualifiedName",
",",
"bInContainer",
")",
"{",
"var",
"o",
"=",
"bInContainer",
"?",
"oAnnotations",
".",
"EntityContainer",
":",
"oAnnotations",
".",
"propertyAnnotations",
";",
"return",
"o",
"&&",
"o",
"[",
"sQualifiedN... | Gets the map from child name to annotations for a parent with the given qualified
name which lives inside the entity container as indicated.
@param {sap.ui.model.odata.ODataAnnotations} oAnnotations
the OData annotations
@param {string} sQualifiedName
the parent's qualified name
@param {boolean} bInContainer
whether t... | [
"Gets",
"the",
"map",
"from",
"child",
"name",
"to",
"annotations",
"for",
"a",
"parent",
"with",
"the",
"given",
"qualified",
"name",
"which",
"lives",
"inside",
"the",
"entity",
"container",
"as",
"indicated",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L632-L637 | train | Returns the annotation for the given qualified name. | [
30522,
3853,
1006,
1051,
11639,
17287,
9285,
1010,
5490,
8787,
7810,
18442,
1010,
8026,
8663,
18249,
2121,
1007,
1063,
13075,
1051,
1027,
8026,
8663,
18249,
2121,
1029,
1051,
11639,
17287,
9285,
1012,
9178,
8663,
18249,
2121,
1024,
1051,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
facebook/watchman | node/bser/index.js | loadFromBuffer | function loadFromBuffer(input) {
var buf = new BunserBuf();
var result = buf.append(input, true);
if (buf.buf.readAvail()) {
throw Error(
'excess data found after input buffer, use BunserBuf instead');
}
if (typeof result === 'undefined') {
throw Error(
'no bser found in string and no ... | javascript | function loadFromBuffer(input) {
var buf = new BunserBuf();
var result = buf.append(input, true);
if (buf.buf.readAvail()) {
throw Error(
'excess data found after input buffer, use BunserBuf instead');
}
if (typeof result === 'undefined') {
throw Error(
'no bser found in string and no ... | [
"function",
"loadFromBuffer",
"(",
"input",
")",
"{",
"var",
"buf",
"=",
"new",
"BunserBuf",
"(",
")",
";",
"var",
"result",
"=",
"buf",
".",
"append",
"(",
"input",
",",
"true",
")",
";",
"if",
"(",
"buf",
".",
"buf",
".",
"readAvail",
"(",
")",
... | synchronously BSER decode a string and return the value | [
"synchronously",
"BSER",
"decode",
"a",
"string",
"and",
"return",
"the",
"value"
] | 8d576a2d3e1191c977f03f584993da63a3b8e5ec | https://github.com/facebook/watchman/blob/8d576a2d3e1191c977f03f584993da63a3b8e5ec/node/bser/index.js#L435-L447 | train | Load from buffer | [
30522,
3853,
7170,
19699,
5358,
8569,
12494,
1006,
7953,
1007,
1063,
13075,
20934,
2546,
1027,
2047,
21122,
8043,
8569,
2546,
1006,
1007,
1025,
13075,
2765,
1027,
20934,
2546,
1012,
10439,
10497,
1006,
7953,
1010,
2995,
1007,
1025,
2065,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/tooltip/tooltip.spec.js | buildTooltip | function buildTooltip(markup) {
element = $compile(markup)(parentScope);
parentScope.testModel = {};
parentScope.$apply();
$material.flushOutstandingAnimations();
return element;
} | javascript | function buildTooltip(markup) {
element = $compile(markup)(parentScope);
parentScope.testModel = {};
parentScope.$apply();
$material.flushOutstandingAnimations();
return element;
} | [
"function",
"buildTooltip",
"(",
"markup",
")",
"{",
"element",
"=",
"$compile",
"(",
"markup",
")",
"(",
"parentScope",
")",
";",
"parentScope",
".",
"testModel",
"=",
"{",
"}",
";",
"parentScope",
".",
"$apply",
"(",
")",
";",
"$material",
".",
"flushO... | ****************************************************** Internal Utility methods ****************************************************** | [
"******************************************************",
"Internal",
"Utility",
"methods",
"******************************************************"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tooltip/tooltip.spec.js#L537-L545 | train | Build tooltip element | [
30522,
3853,
3857,
3406,
27914,
11514,
1006,
2928,
6279,
1007,
1063,
5783,
1027,
1002,
4012,
22090,
1006,
2928,
6279,
1007,
1006,
3008,
16186,
1007,
1025,
3008,
16186,
1012,
3231,
5302,
9247,
1027,
1063,
1065,
1025,
3008,
16186,
1012,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.demokit/src/sap/ui/demokit/demoapps/controller/App.controller.js | function (sId, oBindingContext) {
var oBlockLayoutCell;
if (!oBindingContext.getObject().categoryId) { // demo app tile
if (oBindingContext.getObject().teaser) { // teaser cell (loads fragment from demo app)
try {
$.sap.registerResourcePath("test-resources","test-resources");
var sRelativePat... | javascript | function (sId, oBindingContext) {
var oBlockLayoutCell;
if (!oBindingContext.getObject().categoryId) { // demo app tile
if (oBindingContext.getObject().teaser) { // teaser cell (loads fragment from demo app)
try {
$.sap.registerResourcePath("test-resources","test-resources");
var sRelativePat... | [
"function",
"(",
"sId",
",",
"oBindingContext",
")",
"{",
"var",
"oBlockLayoutCell",
";",
"if",
"(",
"!",
"oBindingContext",
".",
"getObject",
"(",
")",
".",
"categoryId",
")",
"{",
"// demo app tile",
"if",
"(",
"oBindingContext",
".",
"getObject",
"(",
")"... | /* =========================================================== /* lifecycle methods /* ===========================================================
Factory function for creating the demo app cells
@param {string} sId the id for the current cell
@param {sap.ui.model.Context} oBindingContext the context for the current ... | [
"/",
"*",
"===========================================================",
"/",
"*",
"lifecycle",
"methods",
"/",
"*",
"===========================================================",
"Factory",
"function",
"for",
"creating",
"the",
"demo",
"app",
"cells"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/demoapps/controller/App.controller.js#L126-L150 | train | Creates a cell for the given id. | [
30522,
3853,
1006,
15765,
1010,
27885,
22254,
2075,
8663,
18209,
1007,
1063,
13075,
27885,
7878,
8485,
5833,
29109,
2140,
1025,
2065,
1006,
999,
27885,
22254,
2075,
8663,
18209,
1012,
2131,
16429,
20614,
1006,
1007,
1012,
4696,
3593,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jgraph/mxgraph | javascript/mxClient.js | function(obj, transients, shallow)
{
shallow = (shallow != null) ? shallow : false;
var clone = null;
if (obj != null && typeof(obj.constructor) == 'function')
{
clone = new obj.constructor();
for (var i in obj)
{
if (i != mxObjectIdentity.FIELD_NAME && (transients == null ||
... | javascript | function(obj, transients, shallow)
{
shallow = (shallow != null) ? shallow : false;
var clone = null;
if (obj != null && typeof(obj.constructor) == 'function')
{
clone = new obj.constructor();
for (var i in obj)
{
if (i != mxObjectIdentity.FIELD_NAME && (transients == null ||
... | [
"function",
"(",
"obj",
",",
"transients",
",",
"shallow",
")",
"{",
"shallow",
"=",
"(",
"shallow",
"!=",
"null",
")",
"?",
"shallow",
":",
"false",
";",
"var",
"clone",
"=",
"null",
";",
"if",
"(",
"obj",
"!=",
"null",
"&&",
"typeof",
"(",
"obj",... | Function: clone
Recursively clones the specified object ignoring all fieldnames in the
given array of transient fields. <mxObjectIdentity.FIELD_NAME> is always
ignored by this function.
Parameters:
obj - Object to be cloned.
transients - Optional array of strings representing the fieldname to be
ignored.
shallow - O... | [
"Function",
":",
"clone"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L3859-L3886 | train | Clones an object | [
30522,
3853,
1006,
27885,
3501,
1010,
25354,
2015,
1010,
8467,
1007,
1063,
8467,
1027,
1006,
8467,
999,
1027,
19701,
1007,
1029,
8467,
1024,
6270,
1025,
13075,
17598,
1027,
19701,
1025,
2065,
1006,
27885,
3501,
999,
1027,
19701,
1004,
1004,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ipfs/js-ipfs | src/core/components/pin.js | flushPins | function flushPins (callback) {
let dLink, rLink, root
series([
// create a DAGLink to the node with direct pins
cb => waterfall([
cb => pinset.storeSet(directKeys(), cb),
({ node, cid }, cb) => DAGLink.create(types.direct, node.size, cid, cb),
(link, cb) => { dLink = link; c... | javascript | function flushPins (callback) {
let dLink, rLink, root
series([
// create a DAGLink to the node with direct pins
cb => waterfall([
cb => pinset.storeSet(directKeys(), cb),
({ node, cid }, cb) => DAGLink.create(types.direct, node.size, cid, cb),
(link, cb) => { dLink = link; c... | [
"function",
"flushPins",
"(",
"callback",
")",
"{",
"let",
"dLink",
",",
"rLink",
",",
"root",
"series",
"(",
"[",
"// create a DAGLink to the node with direct pins",
"cb",
"=>",
"waterfall",
"(",
"[",
"cb",
"=>",
"pinset",
".",
"storeSet",
"(",
"directKeys",
... | Encode and write pin key sets to the datastore: a DAGLink for each of the recursive and direct pinsets a DAGNode holding those as DAGLinks, a kind of root pin | [
"Encode",
"and",
"write",
"pin",
"key",
"sets",
"to",
"the",
"datastore",
":",
"a",
"DAGLink",
"for",
"each",
"of",
"the",
"recursive",
"and",
"direct",
"pinsets",
"a",
"DAGNode",
"holding",
"those",
"as",
"DAGLinks",
"a",
"kind",
"of",
"root",
"pin"
] | 97e67601094acda3906549ecb0248fd09f1a8cc3 | https://github.com/ipfs/js-ipfs/blob/97e67601094acda3906549ecb0248fd09f1a8cc3/src/core/components/pin.js#L85-L140 | train | Flushes all pins to the datastore | [
30522,
3853,
13862,
27915,
1006,
2655,
5963,
1007,
1063,
2292,
21469,
19839,
1010,
1054,
13767,
1010,
7117,
2186,
1006,
1031,
1013,
1013,
3443,
1037,
4830,
25394,
8950,
2000,
1996,
13045,
2007,
3622,
16300,
17324,
1027,
1028,
14297,
1006,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Dogfalo/materialize | dist/js/materialize.js | destroy | function destroy() {
ScrollSpy._elements.splice(ScrollSpy._elements.indexOf(this), 1);
ScrollSpy._elementsInView.splice(ScrollSpy._elementsInView.indexOf(this), 1);
ScrollSpy._visibleElements.splice(ScrollSpy._visibleElements.indexOf(this.$el), 1);
ScrollSpy._count--;
this._remov... | javascript | function destroy() {
ScrollSpy._elements.splice(ScrollSpy._elements.indexOf(this), 1);
ScrollSpy._elementsInView.splice(ScrollSpy._elementsInView.indexOf(this), 1);
ScrollSpy._visibleElements.splice(ScrollSpy._visibleElements.indexOf(this.$el), 1);
ScrollSpy._count--;
this._remov... | [
"function",
"destroy",
"(",
")",
"{",
"ScrollSpy",
".",
"_elements",
".",
"splice",
"(",
"ScrollSpy",
".",
"_elements",
".",
"indexOf",
"(",
"this",
")",
",",
"1",
")",
";",
"ScrollSpy",
".",
"_elementsInView",
".",
"splice",
"(",
"ScrollSpy",
".",
"_ele... | Teardown component | [
"Teardown",
"component"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/dist/js/materialize.js#L6164-L6172 | train | Destroy the element | [
30522,
3853,
6033,
1006,
1007,
1063,
23074,
7685,
1012,
1035,
3787,
1012,
11867,
13231,
1006,
23074,
7685,
1012,
1035,
3787,
1012,
5950,
11253,
1006,
2023,
1007,
1010,
1015,
1007,
1025,
23074,
7685,
1012,
1035,
3787,
2378,
8584,
1012,
11867... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/table/wwMergedTableManager.js | any | function any(arr, contition) {
let result = false;
util.forEach(arr, item => {
result = contition(item);
return !result;
});
return result;
} | javascript | function any(arr, contition) {
let result = false;
util.forEach(arr, item => {
result = contition(item);
return !result;
});
return result;
} | [
"function",
"any",
"(",
"arr",
",",
"contition",
")",
"{",
"let",
"result",
"=",
"false",
";",
"util",
".",
"forEach",
"(",
"arr",
",",
"item",
"=>",
"{",
"result",
"=",
"contition",
"(",
"item",
")",
";",
"return",
"!",
"result",
";",
"}",
")",
... | Whether one of them is true or not.
@param {Array} arr - target array
@param {function} contition - condition function
@returns {boolean}
@ignore | [
"Whether",
"one",
"of",
"them",
"is",
"true",
"or",
"not",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/wwMergedTableManager.js#L543-L553 | train | Check if any item in an array is a non - empty | [
30522,
3853,
2151,
1006,
12098,
2099,
1010,
9530,
3775,
3508,
1007,
1063,
2292,
2765,
1027,
6270,
1025,
21183,
4014,
1012,
18921,
6776,
1006,
12098,
2099,
1010,
8875,
1027,
1028,
1063,
2765,
1027,
9530,
3775,
3508,
1006,
8875,
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... |
angular/material | src/components/tabs/js/tabsController.js | handleFocusIndexChange | function handleFocusIndexChange (newIndex, oldIndex) {
if (newIndex === oldIndex) return;
if (!getElements().tabs[ newIndex ]) return;
adjustOffset();
redirectFocus();
} | javascript | function handleFocusIndexChange (newIndex, oldIndex) {
if (newIndex === oldIndex) return;
if (!getElements().tabs[ newIndex ]) return;
adjustOffset();
redirectFocus();
} | [
"function",
"handleFocusIndexChange",
"(",
"newIndex",
",",
"oldIndex",
")",
"{",
"if",
"(",
"newIndex",
"===",
"oldIndex",
")",
"return",
";",
"if",
"(",
"!",
"getElements",
"(",
")",
".",
"tabs",
"[",
"newIndex",
"]",
")",
"return",
";",
"adjustOffset",
... | Update the UI whenever `ctrl.focusIndex` is updated
@param {number} newIndex
@param {number} oldIndex | [
"Update",
"the",
"UI",
"whenever",
"ctrl",
".",
"focusIndex",
"is",
"updated"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L248-L253 | train | Handle focus index change | [
30522,
3853,
5047,
14876,
7874,
22254,
10288,
22305,
2063,
1006,
2047,
22254,
10288,
1010,
2214,
22254,
10288,
1007,
1063,
2065,
1006,
2047,
22254,
10288,
1027,
1027,
1027,
2214,
22254,
10288,
1007,
2709,
1025,
2065,
1006,
999,
2131,
12260,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.demokit/src/sap/ui/demokit/explored/view/base.controller.js | function () {
var sJson = this._oStorage.get(this._sStorageKey);
if (!sJson) {
// local storage is empty, apply defaults
this._oViewSettings = this._oDefaultSettings;
} else {
// parse
this._oViewSettings = JSON.parse(sJson);
// clean filter and remove values that do not exist any longe... | javascript | function () {
var sJson = this._oStorage.get(this._sStorageKey);
if (!sJson) {
// local storage is empty, apply defaults
this._oViewSettings = this._oDefaultSettings;
} else {
// parse
this._oViewSettings = JSON.parse(sJson);
// clean filter and remove values that do not exist any longe... | [
"function",
"(",
")",
"{",
"var",
"sJson",
"=",
"this",
".",
"_oStorage",
".",
"get",
"(",
"this",
".",
"_sStorageKey",
")",
";",
"if",
"(",
"!",
"sJson",
")",
"{",
"// local storage is empty, apply defaults",
"this",
".",
"_oViewSettings",
"=",
"this",
".... | Inits the view settings. At first local storage is checked. If this is empty defaults are applied. | [
"Inits",
"the",
"view",
"settings",
".",
"At",
"first",
"local",
"storage",
"is",
"checked",
".",
"If",
"this",
"is",
"empty",
"defaults",
"are",
"applied",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/explored/view/base.controller.js#L56-L118 | train | This function is called when the view is being rendered | [
30522,
3853,
1006,
1007,
1063,
13075,
1055,
22578,
2239,
1027,
2023,
1012,
1035,
9808,
4263,
4270,
1012,
2131,
1006,
2023,
1012,
1035,
7020,
4263,
4270,
14839,
1007,
1025,
2065,
1006,
999,
1055,
22578,
2239,
1007,
1063,
1013,
1013,
2334,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | Block | function Block(htmlElement, canvas)
{
/*
* initialization
*/
this.canvas = canvas;
this.htmlElement = htmlElement;
this.id = htmlElement.id;
this.blocks = new Array();
this.moveListeners = new Array();
if(this.id == 'description2_out1')
var merda = 0;
this.currentTop = calculateOffsetTop(this.htmlEl... | javascript | function Block(htmlElement, canvas)
{
/*
* initialization
*/
this.canvas = canvas;
this.htmlElement = htmlElement;
this.id = htmlElement.id;
this.blocks = new Array();
this.moveListeners = new Array();
if(this.id == 'description2_out1')
var merda = 0;
this.currentTop = calculateOffsetTop(this.htmlEl... | [
"function",
"Block",
"(",
"htmlElement",
",",
"canvas",
")",
"{",
"/*\n\t * initialization\n\t */",
"this",
".",
"canvas",
"=",
"canvas",
";",
"this",
".",
"htmlElement",
"=",
"htmlElement",
";",
"this",
".",
"id",
"=",
"htmlElement",
".",
"id",
";",
"this",... | /*
Block class | [
"/",
"*",
"Block",
"class"
] | bf5e3028810a0ec7c267c6fe4bfad639b4819e35 | https://github.com/radare/radare2/blob/bf5e3028810a0ec7c267c6fe4bfad639b4819e35/shlr/www/graph/js-graph-it.js#L387-L505 | train | Block constructor. | [
30522,
3853,
3796,
1006,
16129,
12260,
3672,
1010,
10683,
1007,
1063,
1013,
1008,
1008,
3988,
3989,
1008,
1013,
2023,
1012,
10683,
1027,
10683,
1025,
2023,
1012,
16129,
12260,
3672,
1027,
16129,
12260,
3672,
1025,
2023,
1012,
8909,
1027,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.m/src/sap/m/MessageBox.js | button | function button(sAction) {
var sText;
// Don't check in ResourceBundle library if the button is with custom text
if (MessageBox.Action.hasOwnProperty(sAction)) {
sText = MessageBox._rb.getText("MSGBOX_" + sAction);
}
var oButton = new Button({
id: ElementMetadata.uid("mbox-... | javascript | function button(sAction) {
var sText;
// Don't check in ResourceBundle library if the button is with custom text
if (MessageBox.Action.hasOwnProperty(sAction)) {
sText = MessageBox._rb.getText("MSGBOX_" + sAction);
}
var oButton = new Button({
id: ElementMetadata.uid("mbox-... | [
"function",
"button",
"(",
"sAction",
")",
"{",
"var",
"sText",
";",
"// Don't check in ResourceBundle library if the button is with custom text",
"if",
"(",
"MessageBox",
".",
"Action",
".",
"hasOwnProperty",
"(",
"sAction",
")",
")",
"{",
"sText",
"=",
"MessageBox",... | creates a button for the given action | [
"creates",
"a",
"button",
"for",
"the",
"given",
"action"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/MessageBox.js#L324-L341 | train | Create a button | [
30522,
3853,
6462,
1006,
17266,
3508,
1007,
1063,
13075,
26261,
18413,
1025,
1013,
1013,
2123,
1005,
1056,
4638,
1999,
7692,
27265,
2571,
3075,
2065,
1996,
6462,
2003,
2007,
7661,
3793,
2065,
1006,
4471,
8758,
1012,
2895,
1012,
2038,
12384,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Microsoft/vscode | build/gulpfile.vscode.js | computeChecksum | function computeChecksum(filename) {
var contents = fs.readFileSync(filename);
var hash = crypto
.createHash('md5')
.update(contents)
.digest('base64')
.replace(/=+$/, '');
return hash;
} | javascript | function computeChecksum(filename) {
var contents = fs.readFileSync(filename);
var hash = crypto
.createHash('md5')
.update(contents)
.digest('base64')
.replace(/=+$/, '');
return hash;
} | [
"function",
"computeChecksum",
"(",
"filename",
")",
"{",
"var",
"contents",
"=",
"fs",
".",
"readFileSync",
"(",
"filename",
")",
";",
"var",
"hash",
"=",
"crypto",
".",
"createHash",
"(",
"'md5'",
")",
".",
"update",
"(",
"contents",
")",
".",
"digest"... | Compute checksum for a file.
@param {string} filename The absolute path to a filename.
@return {string} The checksum for `filename`. | [
"Compute",
"checksum",
"for",
"a",
"file",
"."
] | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/build/gulpfile.vscode.js#L245-L255 | train | Compute the checksum of a file | [
30522,
3853,
24134,
5403,
10603,
2819,
1006,
5371,
18442,
1007,
1063,
13075,
8417,
1027,
1042,
2015,
1012,
3191,
8873,
4244,
6038,
2278,
1006,
5371,
18442,
1007,
1025,
13075,
23325,
1027,
19888,
2080,
1012,
3443,
14949,
2232,
1006,
1005,
91... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/store/RelayModernRecord.js | create | function create(dataID: DataID, typeName: string): Record {
// See perf note above for why we aren't using computed property access.
const record = {};
record[ID_KEY] = dataID;
record[TYPENAME_KEY] = typeName;
return record;
} | javascript | function create(dataID: DataID, typeName: string): Record {
// See perf note above for why we aren't using computed property access.
const record = {};
record[ID_KEY] = dataID;
record[TYPENAME_KEY] = typeName;
return record;
} | [
"function",
"create",
"(",
"dataID",
":",
"DataID",
",",
"typeName",
":",
"string",
")",
":",
"Record",
"{",
"// See perf note above for why we aren't using computed property access.",
"const",
"record",
"=",
"{",
"}",
";",
"record",
"[",
"ID_KEY",
"]",
"=",
"data... | @public
Create a new record. | [
"@public"
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-runtime/store/RelayModernRecord.js#L110-L116 | train | Creates a new Record object. | [
30522,
3853,
3443,
1006,
2951,
3593,
1024,
2951,
3593,
1010,
2828,
18442,
1024,
5164,
1007,
1024,
2501,
1063,
1013,
1013,
2156,
2566,
2546,
3602,
2682,
2005,
2339,
2057,
4995,
1005,
1056,
2478,
24806,
3200,
3229,
1012,
9530,
3367,
2501,
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... |
mui-org/material-ui | packages/material-ui-styles/src/styled/styled.js | styled | function styled(Component) {
const componentCreator = (style, options = {}) => {
const { name, ...stylesOptions } = options;
if (process.env.NODE_ENV !== 'production' && Component === undefined) {
throw new Error(
[
'You are calling styled(Component)(style) with an undefined component... | javascript | function styled(Component) {
const componentCreator = (style, options = {}) => {
const { name, ...stylesOptions } = options;
if (process.env.NODE_ENV !== 'production' && Component === undefined) {
throw new Error(
[
'You are calling styled(Component)(style) with an undefined component... | [
"function",
"styled",
"(",
"Component",
")",
"{",
"const",
"componentCreator",
"=",
"(",
"style",
",",
"options",
"=",
"{",
"}",
")",
"=>",
"{",
"const",
"{",
"name",
",",
"...",
"stylesOptions",
"}",
"=",
"options",
";",
"if",
"(",
"process",
".",
"... | styled-components's API removes the mapping between components and styles. Using components as a low-level styling construct can be simpler. | [
"styled",
"-",
"components",
"s",
"API",
"removes",
"the",
"mapping",
"between",
"components",
"and",
"styles",
".",
"Using",
"components",
"as",
"a",
"low",
"-",
"level",
"styling",
"construct",
"can",
"be",
"simpler",
"."
] | 1555e52367835946382fbf2a8f681de71318915d | https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/packages/material-ui-styles/src/styled/styled.js#L23-L149 | train | Creates a styled component. | [
30522,
3853,
13650,
1006,
6922,
1007,
1063,
9530,
3367,
6922,
16748,
8844,
1027,
1006,
2806,
1010,
7047,
1027,
1063,
1065,
1007,
1027,
1028,
1063,
9530,
3367,
1063,
2171,
1010,
1012,
1012,
1012,
6782,
7361,
9285,
1065,
1027,
7047,
1025,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js | function (aChildren, mChildAnnotations, sTypeClass, aSchemas, fnCallback,
iStartIndex) {
if (!aChildren) {
return;
}
if (iStartIndex) {
aChildren = aChildren.slice(iStartIndex);
}
aChildren.forEach(function (oChild) {
// lift SAP data for easy access to SAP Annotations for OData V 2.0
... | javascript | function (aChildren, mChildAnnotations, sTypeClass, aSchemas, fnCallback,
iStartIndex) {
if (!aChildren) {
return;
}
if (iStartIndex) {
aChildren = aChildren.slice(iStartIndex);
}
aChildren.forEach(function (oChild) {
// lift SAP data for easy access to SAP Annotations for OData V 2.0
... | [
"function",
"(",
"aChildren",
",",
"mChildAnnotations",
",",
"sTypeClass",
",",
"aSchemas",
",",
"fnCallback",
",",
"iStartIndex",
")",
"{",
"if",
"(",
"!",
"aChildren",
")",
"{",
"return",
";",
"}",
"if",
"(",
"iStartIndex",
")",
"{",
"aChildren",
"=",
... | Visits all children inside the given array, lifts "SAPData" extensions and
inlines OData V4 annotations for each child.
@param {object[]} aChildren
any array of children
@param {object} mChildAnnotations
map from child name (or role) to annotations
@param {string} [sTypeClass]
the type class of the given children; sup... | [
"Visits",
"all",
"children",
"inside",
"the",
"given",
"array",
"lifts",
"SAPData",
"extensions",
"and",
"inlines",
"OData",
"V4",
"annotations",
"for",
"each",
"child",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L1023-L1051 | train | This function is called by the annotation processor to process the child annotations | [
30522,
3853,
1006,
9353,
19466,
16200,
2078,
1010,
11338,
19466,
7847,
17048,
10708,
1010,
2358,
18863,
26266,
1010,
2004,
5403,
9335,
1010,
1042,
20909,
3363,
5963,
1010,
21541,
8445,
22254,
10288,
1007,
1063,
2065,
1006,
999,
9353,
19466,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/lines-around-directive.js | hasNewlineBefore | function hasNewlineBefore(node) {
const tokenBefore = sourceCode.getTokenBefore(node, { includeComments: true });
const tokenLineBefore = tokenBefore ? tokenBefore.loc.end.line : 0;
return node.loc.start.line - tokenLineBefore >= 2;
} | javascript | function hasNewlineBefore(node) {
const tokenBefore = sourceCode.getTokenBefore(node, { includeComments: true });
const tokenLineBefore = tokenBefore ? tokenBefore.loc.end.line : 0;
return node.loc.start.line - tokenLineBefore >= 2;
} | [
"function",
"hasNewlineBefore",
"(",
"node",
")",
"{",
"const",
"tokenBefore",
"=",
"sourceCode",
".",
"getTokenBefore",
"(",
"node",
",",
"{",
"includeComments",
":",
"true",
"}",
")",
";",
"const",
"tokenLineBefore",
"=",
"tokenBefore",
"?",
"tokenBefore",
"... | -------------------------------------------------------------------------- Helpers --------------------------------------------------------------------------
Check if node is preceded by a blank newline.
@param {ASTNode} node Node to check.
@returns {boolean} Whether or not the passed in node is preceded by a blank ne... | [
"--------------------------------------------------------------------------",
"Helpers",
"--------------------------------------------------------------------------",
"Check",
"if",
"node",
"is",
"preceded",
"by",
"a",
"blank",
"newline",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/lines-around-directive.js#L71-L76 | train | Check if node has a newline before token | [
30522,
3853,
8440,
7974,
4179,
4783,
29278,
2063,
1006,
13045,
1007,
1063,
9530,
3367,
19204,
4783,
29278,
2063,
1027,
3120,
16044,
1012,
2131,
18715,
2368,
4783,
29278,
2063,
1006,
13045,
1010,
1063,
2421,
9006,
8163,
1024,
2995,
1065,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/type/Boolean.js | getMessage | function getMessage(sKey, aParameters) {
return sap.ui.getCore().getLibraryResourceBundle().getText(sKey, aParameters);
} | javascript | function getMessage(sKey, aParameters) {
return sap.ui.getCore().getLibraryResourceBundle().getText(sKey, aParameters);
} | [
"function",
"getMessage",
"(",
"sKey",
",",
"aParameters",
")",
"{",
"return",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getLibraryResourceBundle",
"(",
")",
".",
"getText",
"(",
"sKey",
",",
"aParameters",
")",
";",
"}"
] | Returns the locale-dependent text for the given key. Fetches the resource bundle
and stores it in the type if necessary.
@param {string} sKey
the key
@param {any[]} aParameters
the parameters
@returns {string}
the locale-dependent text for the key | [
"Returns",
"the",
"locale",
"-",
"dependent",
"text",
"for",
"the",
"given",
"key",
".",
"Fetches",
"the",
"resource",
"bundle",
"and",
"stores",
"it",
"in",
"the",
"type",
"if",
"necessary",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/Boolean.js#L36-L38 | train | Returns the localized message for the given key and parameters. | [
30522,
3853,
2131,
7834,
3736,
3351,
1006,
15315,
3240,
1010,
9706,
5400,
22828,
2015,
1007,
1063,
2709,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
1012,
2131,
29521,
19848,
16363,
6499,
3126,
3401,
27265,
2571,
1006,
1007,
1012,
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... |
nhn/tui.editor | src/js/extensions/uml.js | plantUMLReplacer | function plantUMLReplacer(umlCode) {
let renderedHTML;
try {
if (!plantumlEncoder) {
throw new Error('plantuml-encoder dependency required');
}
renderedHTML = `<img src="${rendererURL}${plantumlEncoder.encode(umlCode)}" />`;
} catch (err) {
renderedHTML = `Error occurred on ... | javascript | function plantUMLReplacer(umlCode) {
let renderedHTML;
try {
if (!plantumlEncoder) {
throw new Error('plantuml-encoder dependency required');
}
renderedHTML = `<img src="${rendererURL}${plantumlEncoder.encode(umlCode)}" />`;
} catch (err) {
renderedHTML = `Error occurred on ... | [
"function",
"plantUMLReplacer",
"(",
"umlCode",
")",
"{",
"let",
"renderedHTML",
";",
"try",
"{",
"if",
"(",
"!",
"plantumlEncoder",
")",
"{",
"throw",
"new",
"Error",
"(",
"'plantuml-encoder dependency required'",
")",
";",
"}",
"renderedHTML",
"=",
"`",
"${"... | render html from uml
@param {string} umlCode - plant uml code text
@returns {string} - rendered html | [
"render",
"html",
"from",
"uml"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/uml.js#L30-L43 | train | plantUMLReplacer - Placeholder for HTML | [
30522,
3853,
3269,
2819,
20974,
13699,
19217,
2099,
1006,
8529,
22499,
3207,
1007,
1063,
2292,
10155,
11039,
19968,
1025,
3046,
1063,
2065,
1006,
999,
3269,
2819,
7770,
16044,
2099,
1007,
1063,
5466,
2047,
7561,
1006,
1005,
3269,
2819,
2140... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (bodyWrap)
{
var typ = bodyWrap.getAttribute("type");
var cond, conflict;
if (typ !== null && typ == "terminate") {
// an error occurred
Strophe.error("BOSH-Connection failed: " + cond);
cond = bodyWrap.getAttribute("condition");
... | javascript | function (bodyWrap)
{
var typ = bodyWrap.getAttribute("type");
var cond, conflict;
if (typ !== null && typ == "terminate") {
// an error occurred
Strophe.error("BOSH-Connection failed: " + cond);
cond = bodyWrap.getAttribute("condition");
... | [
"function",
"(",
"bodyWrap",
")",
"{",
"var",
"typ",
"=",
"bodyWrap",
".",
"getAttribute",
"(",
"\"type\"",
")",
";",
"var",
"cond",
",",
"conflict",
";",
"if",
"(",
"typ",
"!==",
"null",
"&&",
"typ",
"==",
"\"terminate\"",
")",
"{",
"// an error occurre... | PrivateFunction: _connect_cb
_Private_ handler for initial connection request.
This handler is used to process the Bosh-part of the initial request.
Parameters:
(Strophe.Request) bodyWrap - The received stanza. | [
"PrivateFunction",
":",
"_connect_cb",
"_Private_",
"handler",
"for",
"initial",
"connection",
"request",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L4152-L4184 | train | Returns the status of the next session | [
30522,
3853,
1006,
2303,
13088,
9331,
1007,
1063,
13075,
5939,
2361,
1027,
2303,
13088,
9331,
1012,
2131,
19321,
3089,
8569,
2618,
1006,
1000,
2828,
1000,
1007,
1025,
13075,
9530,
2094,
1010,
4736,
1025,
2065,
1006,
5939,
2361,
999,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/project/FileTreeView.js | function (classes) {
var extensions = this.props.extensions;
if (extensions && extensions.get("addClass")) {
var data = this.getDataForExtension();
classes = classes + " " + extensions.get("addClass").map(function (callback) {
try {
... | javascript | function (classes) {
var extensions = this.props.extensions;
if (extensions && extensions.get("addClass")) {
var data = this.getDataForExtension();
classes = classes + " " + extensions.get("addClass").map(function (callback) {
try {
... | [
"function",
"(",
"classes",
")",
"{",
"var",
"extensions",
"=",
"this",
".",
"props",
".",
"extensions",
";",
"if",
"(",
"extensions",
"&&",
"extensions",
".",
"get",
"(",
"\"addClass\"",
")",
")",
"{",
"var",
"data",
"=",
"this",
".",
"getDataForExtensi... | Calls the addClass providers to get the classes (in string form) to add for the current
file or directory.
@param {string} classes Initial classes for this node
@return {string} classes for the current node | [
"Calls",
"the",
"addClass",
"providers",
"to",
"get",
"the",
"classes",
"(",
"in",
"string",
"form",
")",
"to",
"add",
"for",
"the",
"current",
"file",
"or",
"directory",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L445-L460 | train | addClass - add class | [
30522,
3853,
1006,
4280,
1007,
1063,
13075,
14305,
1027,
2023,
1012,
24387,
1012,
14305,
1025,
2065,
1006,
14305,
1004,
1004,
14305,
1012,
2131,
1006,
1000,
5587,
26266,
1000,
1007,
1007,
1063,
13075,
2951,
1027,
2023,
1012,
2131,
2850,
269... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/LanguageManager.js | _updateFromPrefs | function _updateFromPrefs(pref) {
var newMapping = PreferencesManager.get(pref),
newNames = Object.keys(newMapping),
state = _prefState[pref],
last = state.last,
overridden = state.overridden;
// Look for added and changed names (extensions or filenames)
... | javascript | function _updateFromPrefs(pref) {
var newMapping = PreferencesManager.get(pref),
newNames = Object.keys(newMapping),
state = _prefState[pref],
last = state.last,
overridden = state.overridden;
// Look for added and changed names (extensions or filenames)
... | [
"function",
"_updateFromPrefs",
"(",
"pref",
")",
"{",
"var",
"newMapping",
"=",
"PreferencesManager",
".",
"get",
"(",
"pref",
")",
",",
"newNames",
"=",
"Object",
".",
"keys",
"(",
"newMapping",
")",
",",
"state",
"=",
"_prefState",
"[",
"pref",
"]",
"... | @private
Updates extension and filename mappings from languages based on the current preferences values.
The preferences look like this in a prefs file:
Map *.foo to javascript, *.vm to html
"language.fileExtensions": {
"foo": "javascript",
"vm": "html"
}
Map "Gemfile" to ruby:
"language.fileNames": {
"Gemfile": ... | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/LanguageManager.js#L1051-L1108 | train | Update from preferences | [
30522,
3853,
1035,
10651,
19699,
25377,
2890,
10343,
1006,
3653,
2546,
1007,
1063,
13075,
2047,
2863,
14853,
1027,
18394,
24805,
4590,
1012,
2131,
1006,
3653,
2546,
1007,
1010,
2047,
18442,
2015,
1027,
4874,
1012,
6309,
1006,
2047,
2863,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/protractor | website/docgen/processors/tag-fixer.js | buildName | function buildName(obj) {
if (!obj) {
return parts.join('.');
}
if (obj.property && obj.property.name) {
parts.unshift(obj.property.name);
}
if (obj.object && obj.object.name) {
parts.unshift(obj.object.name);
}
return buildName(ob... | javascript | function buildName(obj) {
if (!obj) {
return parts.join('.');
}
if (obj.property && obj.property.name) {
parts.unshift(obj.property.name);
}
if (obj.object && obj.object.name) {
parts.unshift(obj.object.name);
}
return buildName(ob... | [
"function",
"buildName",
"(",
"obj",
")",
"{",
"if",
"(",
"!",
"obj",
")",
"{",
"return",
"parts",
".",
"join",
"(",
"'.'",
")",
";",
"}",
"if",
"(",
"obj",
".",
"property",
"&&",
"obj",
".",
"property",
".",
"name",
")",
"{",
"parts",
".",
"un... | Recursively create the function name by examining the object property.
@param obj Parsed object.
@return {string} The name of the function. | [
"Recursively",
"create",
"the",
"function",
"name",
"by",
"examining",
"the",
"object",
"property",
"."
] | 4f74a4ec753c97adfe955fe468a39286a0a55837 | https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/website/docgen/processors/tag-fixer.js#L39-L53 | train | Build the name of the object | [
30522,
3853,
3857,
18442,
1006,
27885,
3501,
1007,
1063,
2065,
1006,
999,
27885,
3501,
1007,
1063,
2709,
3033,
1012,
3693,
1006,
1005,
1012,
1005,
1007,
1025,
1065,
2065,
1006,
27885,
3501,
1012,
3200,
1004,
1004,
27885,
3501,
1012,
3200,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(sPropertyName) {
var oProperty = this._oEntityType.findPropertyByName(sPropertyName);
if (oProperty == null) {
throw "Cannot remove filter conditions for unknown property name " + sPropertyName; // TODO
}
for (var i = 0; i < this._aConditionUI5Filter.length; i++) {
var oUI5Filter = this._aC... | javascript | function(sPropertyName) {
var oProperty = this._oEntityType.findPropertyByName(sPropertyName);
if (oProperty == null) {
throw "Cannot remove filter conditions for unknown property name " + sPropertyName; // TODO
}
for (var i = 0; i < this._aConditionUI5Filter.length; i++) {
var oUI5Filter = this._aC... | [
"function",
"(",
"sPropertyName",
")",
"{",
"var",
"oProperty",
"=",
"this",
".",
"_oEntityType",
".",
"findPropertyByName",
"(",
"sPropertyName",
")",
";",
"if",
"(",
"oProperty",
"==",
"null",
")",
"{",
"throw",
"\"Cannot remove filter conditions for unknown prope... | Remove all conditions for some property from the filter expression.
All previously set conditions for some property are removed from the filter expression.
@param {string}
sPropertyName The name of the property bound in the condition
@throws Exception
if the property is unknown
@returns {sap.ui.model.analytics.odata4... | [
"Remove",
"all",
"conditions",
"for",
"some",
"property",
"from",
"the",
"filter",
"expression",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3180-L3192 | train | Removes conditions for the given property | [
30522,
3853,
1006,
11867,
18981,
15010,
18442,
1007,
1063,
13075,
6728,
18981,
15010,
1027,
2023,
1012,
1035,
1051,
4765,
3012,
13874,
1012,
2424,
21572,
4842,
3723,
3762,
18442,
1006,
11867,
18981,
15010,
18442,
1007,
1025,
2065,
1006,
6728,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 (oEvent) {
var sValue = oEvent.getParameter("selectedItem").getKey(),
oControl = oEvent.getSource();
this._storage.put(this._LOCAL_STORAGE_KEYS.STANDARD_URL, sValue);
this._resetValueState(oControl);
this._pingUrl(sValue, oControl)
.then(function success() {
oControl.setValueState("Suc... | javascript | function (oEvent) {
var sValue = oEvent.getParameter("selectedItem").getKey(),
oControl = oEvent.getSource();
this._storage.put(this._LOCAL_STORAGE_KEYS.STANDARD_URL, sValue);
this._resetValueState(oControl);
this._pingUrl(sValue, oControl)
.then(function success() {
oControl.setValueState("Suc... | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"sValue",
"=",
"oEvent",
".",
"getParameter",
"(",
"\"selectedItem\"",
")",
".",
"getKey",
"(",
")",
",",
"oControl",
"=",
"oEvent",
".",
"getSource",
"(",
")",
";",
"this",
".",
"_storage",
".",
"put",
"(",
... | Writes the custom bootstrap URL to local storage
@param {sap.ui.base.Event} oEvent The select change event | [
"Writes",
"the",
"custom",
"bootstrap",
"URL",
"to",
"local",
"storage"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L350-L363 | train | Handles the URL change event. | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
17917,
2389,
5657,
1027,
1051,
18697,
3372,
1012,
2131,
28689,
22828,
1006,
1000,
3479,
4221,
2213,
1000,
1007,
1012,
2131,
14839,
1006,
1007,
1010,
1051,
8663,
13181,
2140,
1027,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
wangfupeng1988/wangEditor | src/js/menus/italic/index.js | function (e) {
// 点击菜单将触发这里
const editor = this.editor
const isSeleEmpty = editor.selection.isSelectionEmpty()
if (isSeleEmpty) {
// 选区是空的,插入并选中一个“空白”
editor.selection.createEmptyRange()
}
// 执行 italic 命令
editor.cmd.do('italic')
... | javascript | function (e) {
// 点击菜单将触发这里
const editor = this.editor
const isSeleEmpty = editor.selection.isSelectionEmpty()
if (isSeleEmpty) {
// 选区是空的,插入并选中一个“空白”
editor.selection.createEmptyRange()
}
// 执行 italic 命令
editor.cmd.do('italic')
... | [
"function",
"(",
"e",
")",
"{",
"// 点击菜单将触发这里",
"const",
"editor",
"=",
"this",
".",
"editor",
"const",
"isSeleEmpty",
"=",
"editor",
".",
"selection",
".",
"isSelectionEmpty",
"(",
")",
"if",
"(",
"isSeleEmpty",
")",
"{",
"// 选区是空的,插入并选中一个“空白”",
"editor",
"... | 点击事件 | [
"点击事件"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/menus/italic/index.js#L25-L44 | train | on keydown | [
30522,
3853,
1006,
1041,
1007,
1063,
1013,
1013,
100,
100,
100,
100,
100,
100,
100,
100,
1962,
9530,
3367,
3559,
1027,
2023,
1012,
3559,
9530,
3367,
26354,
12260,
6633,
13876,
2100,
1027,
3559,
1012,
4989,
1012,
26354,
12260,
7542,
6633,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GitbookIO/gitbook | lib/utils/location.js | relative | function relative(dir, file) {
var isDirectory = file.slice(-1) === '/';
return normalize(path.relative(dir, file)) + (isDirectory? '/': '');
} | javascript | function relative(dir, file) {
var isDirectory = file.slice(-1) === '/';
return normalize(path.relative(dir, file)) + (isDirectory? '/': '');
} | [
"function",
"relative",
"(",
"dir",
",",
"file",
")",
"{",
"var",
"isDirectory",
"=",
"file",
".",
"slice",
"(",
"-",
"1",
")",
"===",
"'/'",
";",
"return",
"normalize",
"(",
"path",
".",
"relative",
"(",
"dir",
",",
"file",
")",
")",
"+",
"(",
"... | Convert an absolute path to a relative path for a specific folder (dir)
('test/', 'hello.md') -> '../hello.md'
@param {String} dir: current directory
@param {String} file: absolute path of file
@return {String} | [
"Convert",
"an",
"absolute",
"path",
"to",
"a",
"relative",
"path",
"for",
"a",
"specific",
"folder",
"(",
"dir",
")",
"(",
"test",
"/",
"hello",
".",
"md",
")",
"-",
">",
"..",
"/",
"hello",
".",
"md"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/location.js#L99-L102 | train | Returns the relative path of the file to the specified directory | [
30522,
3853,
5816,
1006,
16101,
1010,
5371,
1007,
1063,
13075,
2003,
4305,
2890,
16761,
2100,
1027,
5371,
1012,
14704,
1006,
1011,
1015,
1007,
1027,
1027,
1027,
1005,
1013,
1005,
1025,
2709,
3671,
4697,
1006,
4130,
1012,
5816,
1006,
16101,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/QuickOpen.js | highlightMatch | function highlightMatch(item, matchClass, rangeFilter) {
var label = item.label || item;
matchClass = matchClass || "quicksearch-namematch";
var stringRanges = item.stringRanges;
if (!stringRanges) {
// If result didn't come from stringMatch(), highlight nothing
... | javascript | function highlightMatch(item, matchClass, rangeFilter) {
var label = item.label || item;
matchClass = matchClass || "quicksearch-namematch";
var stringRanges = item.stringRanges;
if (!stringRanges) {
// If result didn't come from stringMatch(), highlight nothing
... | [
"function",
"highlightMatch",
"(",
"item",
",",
"matchClass",
",",
"rangeFilter",
")",
"{",
"var",
"label",
"=",
"item",
".",
"label",
"||",
"item",
";",
"matchClass",
"=",
"matchClass",
"||",
"\"quicksearch-namematch\"",
";",
"var",
"stringRanges",
"=",
"item... | Formats item's label as properly escaped HTML text, highlighting sections that match 'query'.
If item is a SearchResult generated by stringMatch(), uses its metadata about which string ranges
matched; else formats the label with no highlighting.
@param {!string|SearchResult} item
@param {?string} matchClass CSS class f... | [
"Formats",
"item",
"s",
"label",
"as",
"properly",
"escaped",
"HTML",
"text",
"highlighting",
"sections",
"that",
"match",
"query",
".",
"If",
"item",
"is",
"a",
"SearchResult",
"generated",
"by",
"stringMatch",
"()",
"uses",
"its",
"metadata",
"about",
"which... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/QuickOpen.js#L539-L576 | train | Highlights a match in the log | [
30522,
3853,
12944,
18900,
2818,
1006,
8875,
1010,
2674,
26266,
1010,
2846,
8873,
21928,
1007,
1063,
13075,
3830,
1027,
8875,
1012,
3830,
1064,
1064,
8875,
1025,
2674,
26266,
1027,
2674,
26266,
1064,
1064,
1000,
4248,
17310,
11140,
1011,
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... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/search.js | searchBar_openEngineManager | function searchBar_openEngineManager(handler)
{
this.enginesDropDownOpen = true;
var engineManager = this.getElement({type: "engine_manager"});
// Setup the modal dialog handler
md = new modalDialog.modalDialog(this._controller.window);
md.start(handler);
// XXX: Bug 555347 - Process any out... | javascript | function searchBar_openEngineManager(handler)
{
this.enginesDropDownOpen = true;
var engineManager = this.getElement({type: "engine_manager"});
// Setup the modal dialog handler
md = new modalDialog.modalDialog(this._controller.window);
md.start(handler);
// XXX: Bug 555347 - Process any out... | [
"function",
"searchBar_openEngineManager",
"(",
"handler",
")",
"{",
"this",
".",
"enginesDropDownOpen",
"=",
"true",
";",
"var",
"engineManager",
"=",
"this",
".",
"getElement",
"(",
"{",
"type",
":",
"\"engine_manager\"",
"}",
")",
";",
"// Setup the modal dialo... | Open the Engine Manager
@param {function} handler
Callback function for Engine Manager | [
"Open",
"the",
"Engine",
"Manager"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/search.js#L720-L737 | train | Open the engine manager | [
30522,
3853,
3945,
8237,
1035,
2330,
13159,
3170,
24805,
4590,
1006,
28213,
1007,
1063,
2023,
1012,
5209,
25711,
7698,
26915,
1027,
2995,
1025,
13075,
3194,
24805,
4590,
1027,
2023,
1012,
2131,
12260,
3672,
1006,
1063,
2828,
1024,
1000,
319... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/plugin/Plugin.js | _checkAggregationBindingTemplateID | function _checkAggregationBindingTemplateID(oOverlay, vStableElement){
var mAggregationInfo = OverlayUtil.getAggregationInformation(oOverlay, oOverlay.getElement().sParentAggregationName);
if (!mAggregationInfo.templateId) {
return true;
} else {
return !FlexUtils.checkControlId(mAggregationInfo.templateId,... | javascript | function _checkAggregationBindingTemplateID(oOverlay, vStableElement){
var mAggregationInfo = OverlayUtil.getAggregationInformation(oOverlay, oOverlay.getElement().sParentAggregationName);
if (!mAggregationInfo.templateId) {
return true;
} else {
return !FlexUtils.checkControlId(mAggregationInfo.templateId,... | [
"function",
"_checkAggregationBindingTemplateID",
"(",
"oOverlay",
",",
"vStableElement",
")",
"{",
"var",
"mAggregationInfo",
"=",
"OverlayUtil",
".",
"getAggregationInformation",
"(",
"oOverlay",
",",
"oOverlay",
".",
"getElement",
"(",
")",
".",
"sParentAggregationNa... | Check if related binding template has stable id | [
"Check",
"if",
"related",
"binding",
"template",
"has",
"stable",
"id"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/plugin/Plugin.js#L271-L278 | train | Checks if the binding template id is valid | [
30522,
3853,
1035,
4638,
8490,
17603,
12540,
8428,
4667,
18532,
15725,
3593,
1006,
1051,
7840,
8485,
1010,
5443,
10880,
12260,
3672,
1007,
1063,
13075,
23848,
17603,
12540,
2378,
14876,
1027,
2058,
8485,
21823,
2140,
1012,
2131,
8490,
17603,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/node/FindInFilesDomain.js | getFilesizeInBytes | function getFilesizeInBytes(fileName) {
try {
var stats = fs.statSync(fileName);
return stats.size || 0;
} catch (ex) {
console.log(ex);
return 0;
}
} | javascript | function getFilesizeInBytes(fileName) {
try {
var stats = fs.statSync(fileName);
return stats.size || 0;
} catch (ex) {
console.log(ex);
return 0;
}
} | [
"function",
"getFilesizeInBytes",
"(",
"fileName",
")",
"{",
"try",
"{",
"var",
"stats",
"=",
"fs",
".",
"statSync",
"(",
"fileName",
")",
";",
"return",
"stats",
".",
"size",
"||",
"0",
";",
"}",
"catch",
"(",
"ex",
")",
"{",
"console",
".",
"log",
... | Gets the file size in bytes.
@param {string} fileName The name of the file to get the size
@returns {Number} the file size in bytes | [
"Gets",
"the",
"file",
"size",
"in",
"bytes",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L195-L203 | train | Get size in bytes of a file | [
30522,
3853,
2131,
8873,
4244,
4697,
2378,
3762,
4570,
1006,
5371,
18442,
1007,
1063,
3046,
1063,
13075,
26319,
1027,
1042,
2015,
1012,
26319,
6038,
2278,
1006,
5371,
18442,
1007,
1025,
2709,
26319,
1012,
2946,
1064,
1064,
1014,
1025,
1065,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GeekyAnts/vue-native-core | packages/weex-vue-framework/index.js | reset | function reset () {
clear(instances);
clear(modules);
clear(components);
delete renderer.Document;
delete renderer.Element;
delete renderer.Comment;
delete renderer.sendTasks;
} | javascript | function reset () {
clear(instances);
clear(modules);
clear(components);
delete renderer.Document;
delete renderer.Element;
delete renderer.Comment;
delete renderer.sendTasks;
} | [
"function",
"reset",
"(",
")",
"{",
"clear",
"(",
"instances",
")",
";",
"clear",
"(",
"modules",
")",
";",
"clear",
"(",
"components",
")",
";",
"delete",
"renderer",
".",
"Document",
";",
"delete",
"renderer",
".",
"Element",
";",
"delete",
"renderer",... | Reset framework config and clear all registrations. | [
"Reset",
"framework",
"config",
"and",
"clear",
"all",
"registrations",
"."
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/weex-vue-framework/index.js#L43-L51 | train | Clear all the cache | [
30522,
3853,
25141,
1006,
1007,
1063,
3154,
1006,
12107,
1007,
1025,
3154,
1006,
14184,
1007,
1025,
3154,
1006,
6177,
1007,
1025,
3972,
12870,
17552,
2121,
1012,
6254,
1025,
3972,
12870,
17552,
2121,
1012,
5783,
1025,
3972,
12870,
17552,
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... |
jhipster/generator-jhipster | generators/utils.js | rewriteJSONFile | function rewriteJSONFile(filePath, rewriteFile, generator) {
const jsonObj = generator.fs.readJSON(filePath);
rewriteFile(jsonObj, generator);
generator.fs.writeJSON(filePath, jsonObj, null, 2);
} | javascript | function rewriteJSONFile(filePath, rewriteFile, generator) {
const jsonObj = generator.fs.readJSON(filePath);
rewriteFile(jsonObj, generator);
generator.fs.writeJSON(filePath, jsonObj, null, 2);
} | [
"function",
"rewriteJSONFile",
"(",
"filePath",
",",
"rewriteFile",
",",
"generator",
")",
"{",
"const",
"jsonObj",
"=",
"generator",
".",
"fs",
".",
"readJSON",
"(",
"filePath",
")",
";",
"rewriteFile",
"(",
"jsonObj",
",",
"generator",
")",
";",
"generator... | Rewrite JSON file
@param {string} filePath file path
@param {function} rewriteFile rewriteFile function
@param {object} generator reference to the generator | [
"Rewrite",
"JSON",
"file"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/utils.js#L152-L156 | train | Rewrite a JSON file | [
30522,
3853,
2128,
26373,
22578,
2239,
8873,
2571,
1006,
5371,
15069,
1010,
2128,
26373,
8873,
2571,
1010,
13103,
1007,
1063,
9530,
3367,
1046,
3385,
16429,
3501,
1027,
13103,
1012,
1042,
2015,
1012,
3191,
22578,
2239,
1006,
5371,
15069,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/padding-line-between-statements.js | verifyForNever | function verifyForNever(context, _, nextNode, paddingLines) {
if (paddingLines.length === 0) {
return;
}
context.report({
node: nextNode,
message: "Unexpected blank line before this statement.",
fix(fixer) {
if (paddingLines.length >= 2) {
return ... | javascript | function verifyForNever(context, _, nextNode, paddingLines) {
if (paddingLines.length === 0) {
return;
}
context.report({
node: nextNode,
message: "Unexpected blank line before this statement.",
fix(fixer) {
if (paddingLines.length >= 2) {
return ... | [
"function",
"verifyForNever",
"(",
"context",
",",
"_",
",",
"nextNode",
",",
"paddingLines",
")",
"{",
"if",
"(",
"paddingLines",
".",
"length",
"===",
"0",
")",
"{",
"return",
";",
"}",
"context",
".",
"report",
"(",
"{",
"node",
":",
"nextNode",
","... | Check and report statements for `never` configuration.
This autofix removes blank lines between the given 2 statements.
However, if comments exist between 2 blank lines, it does not remove those
blank lines automatically.
@param {RuleContext} context The rule context to report.
@param {ASTNode} _ Unused. The previous ... | [
"Check",
"and",
"report",
"statements",
"for",
"never",
"configuration",
".",
"This",
"autofix",
"removes",
"blank",
"lines",
"between",
"the",
"given",
"2",
"statements",
".",
"However",
"if",
"comments",
"exist",
"between",
"2",
"blank",
"lines",
"it",
"does... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/padding-line-between-statements.js#L248-L272 | train | Verify that the next line is not blank | [
30522,
3853,
20410,
29278,
2638,
6299,
30524,
4471,
1024,
1000,
9223,
8744,
2240,
2077,
2023,
4861,
1012,
1000,
1010,
8081,
1006,
8081,
2121,
1007,
1063,
2065,
1006,
11687,
4667,
12735,
1012,
3091,
1028,
1027,
1016,
1007,
1063,
2709,
19701,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wuchangming/spy-debugger | buildin_modules/weinre/web/client/inspector.js | logMessage | function logMessage(message)
{
var repeatCount = 1;
if (message == WebInspector.log.lastMessage)
repeatCount = WebInspector.log.repeatCount + 1;
WebInspector.log.lastMessage = message;
WebInspector.log.repeatCount = repeatCount;
// ConsoleMessage expects a proxy... | javascript | function logMessage(message)
{
var repeatCount = 1;
if (message == WebInspector.log.lastMessage)
repeatCount = WebInspector.log.repeatCount + 1;
WebInspector.log.lastMessage = message;
WebInspector.log.repeatCount = repeatCount;
// ConsoleMessage expects a proxy... | [
"function",
"logMessage",
"(",
"message",
")",
"{",
"var",
"repeatCount",
"=",
"1",
";",
"if",
"(",
"message",
"==",
"WebInspector",
".",
"log",
".",
"lastMessage",
")",
"repeatCount",
"=",
"WebInspector",
".",
"log",
".",
"repeatCount",
"+",
"1",
";",
"... | actually log the message | [
"actually",
"log",
"the",
"message"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/client/inspector.js#L1239-L1264 | train | Log a message to the console | [
30522,
3853,
8833,
7834,
3736,
3351,
1006,
4471,
1007,
1063,
13075,
9377,
3597,
16671,
1027,
1015,
1025,
2065,
1006,
4471,
1027,
1027,
4773,
7076,
5051,
16761,
1012,
8833,
1012,
2197,
7834,
3736,
3351,
1007,
9377,
3597,
16671,
1027,
4773,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FindReplace.js | clearHighlights | function clearHighlights(cm, state) {
cm.operation(function () {
state.marked.forEach(function (markedRange) {
markedRange.clear();
});
clearCurrentMatchHighlight(cm, state);
});
state.marked.length = 0;
state.markedCurrent = null;
... | javascript | function clearHighlights(cm, state) {
cm.operation(function () {
state.marked.forEach(function (markedRange) {
markedRange.clear();
});
clearCurrentMatchHighlight(cm, state);
});
state.marked.length = 0;
state.markedCurrent = null;
... | [
"function",
"clearHighlights",
"(",
"cm",
",",
"state",
")",
"{",
"cm",
".",
"operation",
"(",
"function",
"(",
")",
"{",
"state",
".",
"marked",
".",
"forEach",
"(",
"function",
"(",
"markedRange",
")",
"{",
"markedRange",
".",
"clear",
"(",
")",
";",... | Clears all match highlights, including the current match | [
"Clears",
"all",
"match",
"highlights",
"including",
"the",
"current",
"match"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindReplace.js#L451-L465 | train | Clear all highlights | [
30522,
3853,
3154,
4048,
5603,
15733,
1006,
4642,
1010,
2110,
1007,
1063,
4642,
1012,
3169,
1006,
3853,
1006,
1007,
1063,
2110,
1012,
4417,
1012,
18921,
6776,
1006,
3853,
1006,
4417,
24388,
2063,
1007,
1063,
4417,
24388,
2063,
1012,
3154,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/xml/escape-attribute.js | escapeAttribute | function escapeAttribute(value) {
return value.replace(/&/g, '&').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
} | javascript | function escapeAttribute(value) {
return value.replace(/&/g, '&').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
} | [
"function",
"escapeAttribute",
"(",
"value",
")",
"{",
"return",
"value",
".",
"replace",
"(",
"/",
"&",
"/",
"g",
",",
"'&'",
")",
".",
"replace",
"(",
"/",
"'",
"/",
"g",
",",
"'''",
")",
".",
"replace",
"(",
"/",
"<",
"/",
"g",
",",
... | Escapes characters that can not be in an XML attribute. | [
"Escapes",
"characters",
"that",
"can",
"not",
"be",
"in",
"an",
"XML",
"attribute",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/xml/escape-attribute.js#L4-L6 | train | Escape the given value. | [
30522,
3853,
4019,
19321,
3089,
8569,
2618,
1006,
3643,
1007,
1063,
2709,
3643,
1012,
5672,
1006,
1013,
1004,
1013,
1043,
1010,
1005,
1004,
23713,
1025,
1005,
1007,
1012,
5672,
1006,
1013,
1005,
1013,
1043,
1010,
1005,
1004,
9706,
2891,
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... |
SeleniumHQ/selenium | javascript/selenium-core/xpath/dom.js | xmlResolveEntities | function xmlResolveEntities(s) {
var parts = stringSplit(s, '&');
var ret = parts[0];
for (var i = 1; i < parts.length; ++i) {
var rp = parts[i].indexOf(';');
if (rp == -1) {
// no entity reference: just a & but no ;
ret += parts[i];
continue;
}
var entityName = parts[i].subst... | javascript | function xmlResolveEntities(s) {
var parts = stringSplit(s, '&');
var ret = parts[0];
for (var i = 1; i < parts.length; ++i) {
var rp = parts[i].indexOf(';');
if (rp == -1) {
// no entity reference: just a & but no ;
ret += parts[i];
continue;
}
var entityName = parts[i].subst... | [
"function",
"xmlResolveEntities",
"(",
"s",
")",
"{",
"var",
"parts",
"=",
"stringSplit",
"(",
"s",
",",
"'&'",
")",
";",
"var",
"ret",
"=",
"parts",
"[",
"0",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"1",
";",
"i",
"<",
"parts",
".",
"length",
"... | Resolve entities in XML text fragments. According to the DOM specification, the DOM is supposed to resolve entity references at the API level. I.e. no entity references are passed through the API. See "Entities and the DOM core", p.12, DOM 2 Core Spec. However, different browsers actually pass very different values at ... | [
"Resolve",
"entities",
"in",
"XML",
"text",
"fragments",
".",
"According",
"to",
"the",
"DOM",
"specification",
"the",
"DOM",
"is",
"supposed",
"to",
"resolve",
"entity",
"references",
"at",
"the",
"API",
"level",
".",
"I",
".",
"e",
".",
"no",
"entity",
... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/xpath/dom.js#L18-L67 | train | Resolves the XML entities in the specified string. | [
30522,
3853,
20950,
6072,
4747,
3726,
4765,
6447,
1006,
1055,
1007,
1063,
13075,
3033,
1027,
7817,
24759,
4183,
1006,
1055,
1010,
1005,
1004,
1005,
1007,
1025,
13075,
2128,
2102,
1027,
3033,
1031,
1014,
1033,
1025,
2005,
1006,
13075,
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... |
wangfupeng1988/wangEditor | src/js/menus/panel.js | function () {
const menu = this.menu
if (_isCreatedPanelMenus.indexOf(menu) >= 0) {
// 该菜单已经创建了 panel 不能再创建
return
}
const editor = menu.editor
const $body = $('body')
const $textContainerElem = editor.$textContainerElem
const opt = this.o... | javascript | function () {
const menu = this.menu
if (_isCreatedPanelMenus.indexOf(menu) >= 0) {
// 该菜单已经创建了 panel 不能再创建
return
}
const editor = menu.editor
const $body = $('body')
const $textContainerElem = editor.$textContainerElem
const opt = this.o... | [
"function",
"(",
")",
"{",
"const",
"menu",
"=",
"this",
".",
"menu",
"if",
"(",
"_isCreatedPanelMenus",
".",
"indexOf",
"(",
"menu",
")",
">=",
"0",
")",
"{",
"// 该菜单已经创建了 panel 不能再创建",
"return",
"}",
"const",
"editor",
"=",
"menu",
".",
"editor",
"cons... | 显示(插入DOM) | [
"显示(插入DOM)"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/menus/panel.js#L23-L161 | train | create the panel | [
30522,
3853,
1006,
1007,
1063,
9530,
3367,
12183,
1027,
2023,
1012,
12183,
30524,
100,
2709,
1065,
9530,
3367,
3559,
1027,
12183,
1012,
3559,
9530,
3367,
1002,
2303,
1027,
1002,
1006,
1005,
2303,
1005,
1007,
9530,
3367,
1002,
3793,
8663,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/angular | tools/gulp-tasks/cldr/extract.js | getWeekendRange | function getWeekendRange(localeData) {
const startDay =
localeData.get(`supplemental/weekData/weekendStart/${localeData.attributes.territory}`) ||
localeData.get('supplemental/weekData/weekendStart/001');
const endDay =
localeData.get(`supplemental/weekData/weekendEnd/${localeData.attributes.territory}`... | javascript | function getWeekendRange(localeData) {
const startDay =
localeData.get(`supplemental/weekData/weekendStart/${localeData.attributes.territory}`) ||
localeData.get('supplemental/weekData/weekendStart/001');
const endDay =
localeData.get(`supplemental/weekData/weekendEnd/${localeData.attributes.territory}`... | [
"function",
"getWeekendRange",
"(",
"localeData",
")",
"{",
"const",
"startDay",
"=",
"localeData",
".",
"get",
"(",
"`",
"${",
"localeData",
".",
"attributes",
".",
"territory",
"}",
"`",
")",
"||",
"localeData",
".",
"get",
"(",
"'supplemental/weekData/weeke... | Returns week-end range for a locale, based on US week days
@returns [number, number] | [
"Returns",
"week",
"-",
"end",
"range",
"for",
"a",
"locale",
"based",
"on",
"US",
"week",
"days"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/gulp-tasks/cldr/extract.js#L402-L410 | train | Get weekend range | [
30522,
3853,
2131,
28075,
19524,
15465,
1006,
2334,
11960,
2696,
1007,
1063,
9530,
3367,
2707,
10259,
1027,
2334,
11960,
2696,
1012,
2131,
1006,
1036,
27024,
1013,
2733,
2850,
2696,
1013,
13499,
7559,
2102,
1013,
1002,
1063,
2334,
11960,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/event.js | function() {
this.jsonInit({
"id": "event_whenbroadcastreceived",
"message0": Blockly.Msg.EVENT_WHENBROADCASTRECEIVED,
"args0": [
{
"type": "field_variable",
"name": "BROADCAST_OPTION",
"variableTypes": [Blockly.BROADCAST_MESSAGE_VARIABLE_TYPE],
"var... | javascript | function() {
this.jsonInit({
"id": "event_whenbroadcastreceived",
"message0": Blockly.Msg.EVENT_WHENBROADCASTRECEIVED,
"args0": [
{
"type": "field_variable",
"name": "BROADCAST_OPTION",
"variableTypes": [Blockly.BROADCAST_MESSAGE_VARIABLE_TYPE],
"var... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"id\"",
":",
"\"event_whenbroadcastreceived\"",
",",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"EVENT_WHENBROADCASTRECEIVED",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_variab... | Block for when broadcast received.
@this Blockly.Block | [
"Block",
"for",
"when",
"broadcast",
"received",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/event.js#L131-L146 | train | Block for broadcast broadcast. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
8909,
1000,
1024,
1000,
2724,
1035,
2043,
12618,
4215,
10526,
2890,
3401,
3512,
2094,
1000,
1010,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/HealthData/HealthDataManager.js | checkHealthDataSend | function checkHealthDataSend(forceSend) {
var result = new $.Deferred(),
isHDTracking = prefs.get("healthDataTracking"),
nextTimeToSend,
currentTime;
HealthLogger.setHealthLogsEnabled(isHDTracking);
window.clearTimeout(timeoutVar);
if (isHDT... | javascript | function checkHealthDataSend(forceSend) {
var result = new $.Deferred(),
isHDTracking = prefs.get("healthDataTracking"),
nextTimeToSend,
currentTime;
HealthLogger.setHealthLogsEnabled(isHDTracking);
window.clearTimeout(timeoutVar);
if (isHDT... | [
"function",
"checkHealthDataSend",
"(",
"forceSend",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"isHDTracking",
"=",
"prefs",
".",
"get",
"(",
"\"healthDataTracking\"",
")",
",",
"nextTimeToSend",
",",
"currentTime",
";",
"He... | /*
Check if the Health Data is to be sent to the server. If the user has enabled tracking, Health Data will be sent once every 24 hours.
Send Health Data to the server if the period is more than 24 hours.
We are sending the data as soon as the user launches brackets. The data will be sent to the server only after the n... | [
"/",
"*",
"Check",
"if",
"the",
"Health",
"Data",
"is",
"to",
"be",
"sent",
"to",
"the",
"server",
".",
"If",
"the",
"user",
"has",
"enabled",
"tracking",
"Health",
"Data",
"will",
"be",
"sent",
"once",
"every",
"24",
"hours",
".",
"Send",
"Health",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/HealthData/HealthDataManager.js#L246-L293 | train | Check if health data is being sent to the server | [
30522,
3853,
4638,
20192,
24658,
2850,
18260,
4859,
1006,
2749,
10497,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
2003,
14945,
6494,
23177,
1027,
3653,
10343,
1012,
2131,
1006,
1000,
2740,
2850,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/rules/Model.support.js | _fnFindBestMatch | function _fnFindBestMatch(aValues, sBindingPath) {
var iJsonModelMin = -1;
var sJsonModelBestMatch = false;
aValues.forEach(function(sKey) {
var iCurrDest = StringAnalyzer.calculateLevenshteinDistance(sBindingPath, sKey);
if (iJsonModelMin === -1 || iCurrDest < iJsonModelMin) {
iJsonModelMin = iCurrDest... | javascript | function _fnFindBestMatch(aValues, sBindingPath) {
var iJsonModelMin = -1;
var sJsonModelBestMatch = false;
aValues.forEach(function(sKey) {
var iCurrDest = StringAnalyzer.calculateLevenshteinDistance(sBindingPath, sKey);
if (iJsonModelMin === -1 || iCurrDest < iJsonModelMin) {
iJsonModelMin = iCurrDest... | [
"function",
"_fnFindBestMatch",
"(",
"aValues",
",",
"sBindingPath",
")",
"{",
"var",
"iJsonModelMin",
"=",
"-",
"1",
";",
"var",
"sJsonModelBestMatch",
"=",
"false",
";",
"aValues",
".",
"forEach",
"(",
"function",
"(",
"sKey",
")",
"{",
"var",
"iCurrDest",... | Control, Internal, Application | [
"Control",
"Internal",
"Application"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/rules/Model.support.js#L31-L42 | train | Find the best value in the given array of values | [
30522,
3853,
1035,
1042,
2078,
16294,
18939,
4355,
18900,
2818,
1006,
10927,
7630,
2229,
1010,
24829,
22254,
2075,
15069,
1007,
1063,
13075,
1045,
22578,
2239,
5302,
9247,
10020,
1027,
1011,
1015,
1025,
13075,
1055,
22578,
2239,
5302,
9247,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
MithrilJS/mithril.js | mithril.js | removeNodes | function removeNodes(vnodes, start, end) {
for (var i = start; i < end; i++) {
var vnode3 = vnodes[i]
if (vnode3 != null) removeNode(vnode3)
}
} | javascript | function removeNodes(vnodes, start, end) {
for (var i = start; i < end; i++) {
var vnode3 = vnodes[i]
if (vnode3 != null) removeNode(vnode3)
}
} | [
"function",
"removeNodes",
"(",
"vnodes",
",",
"start",
",",
"end",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"start",
";",
"i",
"<",
"end",
";",
"i",
"++",
")",
"{",
"var",
"vnode3",
"=",
"vnodes",
"[",
"i",
"]",
"if",
"(",
"vnode3",
"!=",
"null"... | remove | [
"remove"
] | 6d36fe09d129928c6b460720e08d9ed321fcd62b | https://github.com/MithrilJS/mithril.js/blob/6d36fe09d129928c6b460720e08d9ed321fcd62b/mithril.js#L1048-L1053 | train | Remove a range of nodes | [
30522,
3853,
6366,
3630,
6155,
1006,
1058,
3630,
6155,
1010,
2707,
1010,
2203,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
2707,
1025,
1045,
1026,
2203,
1025,
1045,
1009,
1009,
1007,
1063,
13075,
1058,
3630,
3207,
2509,
1027,
1058,
3630,
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... |
wuchangming/spy-debugger | buildin_modules/weinre/web/client/DataGrid.js | function()
{
var headerTableColumns = this._headerTableColumnGroup.children;
var tableWidth = this._dataTable.offsetWidth;
var numColumns = headerTableColumns.length;
// Do not attempt to use offsetes if we're not attached to the document tree yet.
if (!this... | javascript | function()
{
var headerTableColumns = this._headerTableColumnGroup.children;
var tableWidth = this._dataTable.offsetWidth;
var numColumns = headerTableColumns.length;
// Do not attempt to use offsetes if we're not attached to the document tree yet.
if (!this... | [
"function",
"(",
")",
"{",
"var",
"headerTableColumns",
"=",
"this",
".",
"_headerTableColumnGroup",
".",
"children",
";",
"var",
"tableWidth",
"=",
"this",
".",
"_dataTable",
".",
"offsetWidth",
";",
"var",
"numColumns",
"=",
"headerTableColumns",
".",
"length"... | Updates the widths of the table, including the positions of the column resizers. IMPORTANT: This function MUST be called once after the element of the DataGrid is attached to its parent element and every subsequent time the width of the parent element is changed in order to make it possible to resize the columns. If ... | [
"Updates",
"the",
"widths",
"of",
"the",
"table",
"including",
"the",
"positions",
"of",
"the",
"column",
"resizers",
".",
"IMPORTANT",
":",
"This",
"function",
"MUST",
"be",
"called",
"once",
"after",
"the",
"element",
"of",
"the",
"DataGrid",
"is",
"attach... | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/client/DataGrid.js#L404-L427 | train | This method is called when the width of the table is changed. | [
30522,
3853,
1006,
1007,
1063,
13075,
20346,
10880,
25778,
2819,
3619,
1027,
2023,
1012,
1035,
20346,
10880,
25778,
2819,
3070,
22107,
1012,
2336,
1025,
13075,
2795,
9148,
11927,
2232,
1027,
2023,
1012,
1035,
2951,
10880,
1012,
16396,
9148,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/LiveDevelopment/Agents/DOMHelpers.js | eachNode | function eachNode(src, callback) {
var index = 0;
var text, range, length, payload;
while (index < src.length) {
// find the next tag
range = _findTag(src, index);
if (!range) {
range = { from: src.length, length: 0 };
}
... | javascript | function eachNode(src, callback) {
var index = 0;
var text, range, length, payload;
while (index < src.length) {
// find the next tag
range = _findTag(src, index);
if (!range) {
range = { from: src.length, length: 0 };
}
... | [
"function",
"eachNode",
"(",
"src",
",",
"callback",
")",
"{",
"var",
"index",
"=",
"0",
";",
"var",
"text",
",",
"range",
",",
"length",
",",
"payload",
";",
"while",
"(",
"index",
"<",
"src",
".",
"length",
")",
"{",
"// find the next tag",
"range",
... | Split the source string into payloads representing individual nodes
@param {string} source
@param {function(payload)} callback
split a string into individual node contents | [
"Split",
"the",
"source",
"string",
"into",
"payloads",
"representing",
"individual",
"nodes"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMHelpers.js#L228-L262 | train | iterate over the nodes in the source string | [
30522,
3853,
2169,
3630,
3207,
1006,
5034,
2278,
1010,
2655,
5963,
1007,
1063,
13075,
5950,
1027,
1014,
1025,
13075,
3793,
1010,
2846,
1010,
3091,
1010,
18093,
1025,
2096,
1006,
5950,
1026,
5034,
2278,
1012,
3091,
1007,
1063,
1013,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-accessors.js | saveAccessorValue | function saveAccessorValue(model, property) {
// Don't read/store value for any native properties since they could throw
if (!nativeProperties[property]) {
let value = model[property];
if (value !== undefined) {
if (model.__data) {
// Adding accessor to instance; update the property
//... | javascript | function saveAccessorValue(model, property) {
// Don't read/store value for any native properties since they could throw
if (!nativeProperties[property]) {
let value = model[property];
if (value !== undefined) {
if (model.__data) {
// Adding accessor to instance; update the property
//... | [
"function",
"saveAccessorValue",
"(",
"model",
",",
"property",
")",
"{",
"// Don't read/store value for any native properties since they could throw",
"if",
"(",
"!",
"nativeProperties",
"[",
"property",
"]",
")",
"{",
"let",
"value",
"=",
"model",
"[",
"property",
"... | Used to save the value of a property that will be overridden with
an accessor. If the `model` is a prototype, the values will be saved
in `__dataProto`, and it's up to the user (or downstream mixin) to
decide how/when to set these values back into the accessors.
If `model` is already an instance (it has a `__data` prop... | [
"Used",
"to",
"save",
"the",
"value",
"of",
"a",
"property",
"that",
"will",
"be",
"overridden",
"with",
"an",
"accessor",
".",
"If",
"the",
"model",
"is",
"a",
"prototype",
"the",
"values",
"will",
"be",
"saved",
"in",
"__dataProto",
"and",
"it",
"s",
... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-accessors.js#L45-L65 | train | Save accessor value to the model | [
30522,
3853,
3828,
6305,
9623,
21748,
10175,
5657,
1006,
2944,
1010,
3200,
1007,
1063,
1013,
1013,
2123,
1005,
1056,
3191,
1013,
3573,
3643,
2005,
2151,
3128,
5144,
2144,
2027,
2071,
5466,
2065,
1006,
999,
3128,
21572,
4842,
7368,
1031,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | dist/howler.js | function() {
self._playLock = false;
setParams();
self._refreshBuffer(sound);
// Setup the playback params.
var vol = (sound._muted || self._muted) ? 0 : sound._volume;
node.gain.setValueAtTime(vol, Howler.ctx.currentTime);
sound._playStart = Howler... | javascript | function() {
self._playLock = false;
setParams();
self._refreshBuffer(sound);
// Setup the playback params.
var vol = (sound._muted || self._muted) ? 0 : sound._volume;
node.gain.setValueAtTime(vol, Howler.ctx.currentTime);
sound._playStart = Howler... | [
"function",
"(",
")",
"{",
"self",
".",
"_playLock",
"=",
"false",
";",
"setParams",
"(",
")",
";",
"self",
".",
"_refreshBuffer",
"(",
"sound",
")",
";",
"// Setup the playback params.",
"var",
"vol",
"=",
"(",
"sound",
".",
"_muted",
"||",
"self",
".",... | Fire this when the sound is ready to play to begin Web Audio playback. | [
"Fire",
"this",
"when",
"the",
"sound",
"is",
"ready",
"to",
"play",
"to",
"begin",
"Web",
"Audio",
"playback",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L825-L853 | train | Play the sound. | [
30522,
3853,
1006,
1007,
1063,
2969,
1012,
1035,
2377,
7878,
1027,
6270,
1025,
2275,
28689,
5244,
1006,
1007,
1025,
2969,
1012,
1035,
25416,
21898,
8569,
12494,
1006,
2614,
1007,
1025,
1013,
1013,
16437,
1996,
18245,
11498,
5244,
1012,
1307... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/JSUtils/ScopeManager.js | addFilesToTern | function addFilesToTern(files) {
// limit the number of files added to tern.
var maxFileCount = preferences.getMaxFileCount();
if (numResolvedFiles + numAddedFiles < maxFileCount) {
var available = maxFileCount - numResolvedFiles - numAddedFiles;
if (... | javascript | function addFilesToTern(files) {
// limit the number of files added to tern.
var maxFileCount = preferences.getMaxFileCount();
if (numResolvedFiles + numAddedFiles < maxFileCount) {
var available = maxFileCount - numResolvedFiles - numAddedFiles;
if (... | [
"function",
"addFilesToTern",
"(",
"files",
")",
"{",
"// limit the number of files added to tern.",
"var",
"maxFileCount",
"=",
"preferences",
".",
"getMaxFileCount",
"(",
")",
";",
"if",
"(",
"numResolvedFiles",
"+",
"numAddedFiles",
"<",
"maxFileCount",
")",
"{",
... | Add new files to tern, keeping any previous files.
The tern server must be initialized before making
this call.
@param {Array.<string>} files - array of file to add to tern.
@return {boolean} - true if more files may be added, false if maximum has been reached. | [
"Add",
"new",
"files",
"to",
"tern",
"keeping",
"any",
"previous",
"files",
".",
"The",
"tern",
"server",
"must",
"be",
"initialized",
"before",
"making",
"this",
"call",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1028-L1056 | train | Add files to tern. | [
30522,
3853,
5587,
8873,
4244,
3406,
16451,
1006,
6764,
1007,
1063,
1013,
1013,
5787,
1996,
2193,
1997,
6764,
2794,
2000,
28774,
2078,
1012,
13075,
4098,
8873,
2571,
3597,
16671,
1027,
18394,
1012,
2131,
17848,
8873,
2571,
3597,
16671,
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... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | AssertionArguments | function AssertionArguments(args) {
if (args.length == 2) {
this.comment = "";
this.expected = args[0];
this.actual = args[1];
} else {
this.comment = args[0] + "; ";
this.expected = args[1];
this.actual = args[2];
}
} | javascript | function AssertionArguments(args) {
if (args.length == 2) {
this.comment = "";
this.expected = args[0];
this.actual = args[1];
} else {
this.comment = args[0] + "; ";
this.expected = args[1];
this.actual = args[2];
}
} | [
"function",
"AssertionArguments",
"(",
"args",
")",
"{",
"if",
"(",
"args",
".",
"length",
"==",
"2",
")",
"{",
"this",
".",
"comment",
"=",
"\"\"",
";",
"this",
".",
"expected",
"=",
"args",
"[",
"0",
"]",
";",
"this",
".",
"actual",
"=",
"args",
... | Preprocess the arguments to allow for an optional comment. | [
"Preprocess",
"the",
"arguments",
"to",
"allow",
"for",
"an",
"optional",
"comment",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L758-L768 | train | Assertion arguments | [
30522,
3853,
23617,
2906,
22850,
11187,
1006,
12098,
5620,
1007,
1063,
2065,
1006,
12098,
5620,
1012,
3091,
1027,
1027,
1016,
1007,
1063,
2023,
1012,
7615,
1027,
1000,
1000,
1025,
2023,
1012,
3517,
1027,
12098,
5620,
1031,
1014,
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... |
angular/material | src/core/services/aria/aria.js | MdAriaProvider | function MdAriaProvider() {
var config = {
/** Whether we should show ARIA warnings in the console if labels are missing on the element */
showWarnings: true
};
return {
disableWarnings: disableWarnings,
$get: function($$rAF, $log, $window, $interpolate) {
return MdAriaService.apply(config... | javascript | function MdAriaProvider() {
var config = {
/** Whether we should show ARIA warnings in the console if labels are missing on the element */
showWarnings: true
};
return {
disableWarnings: disableWarnings,
$get: function($$rAF, $log, $window, $interpolate) {
return MdAriaService.apply(config... | [
"function",
"MdAriaProvider",
"(",
")",
"{",
"var",
"config",
"=",
"{",
"/** Whether we should show ARIA warnings in the console if labels are missing on the element */",
"showWarnings",
":",
"true",
"}",
";",
"return",
"{",
"disableWarnings",
":",
"disableWarnings",
",",
"... | @ngdoc service
@name $mdAriaProvider
@module material.core.aria
@description
Modify options of the `$mdAria` service, which will be used by most of the AngularJS Material
components.
You are able to disable `$mdAria` warnings, by using the following markup.
<hljs lang="js">
app.config(function($mdAriaProvider) {
//... | [
"@ngdoc",
"service",
"@name",
"$mdAriaProvider",
"@module",
"material",
".",
"core",
".",
"aria"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/aria/aria.js#L31-L53 | train | AriaProvider provides a provider to use the ARIA warnings. | [
30522,
3853,
9108,
10980,
21572,
17258,
2121,
1006,
1007,
1063,
13075,
9530,
8873,
2290,
1027,
1063,
1013,
1008,
1008,
3251,
2057,
2323,
2265,
9342,
16234,
1999,
1996,
10122,
2065,
10873,
2024,
4394,
2006,
1996,
5783,
1008,
1013,
2265,
9028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DebugCommands/NodeDebugUtils.js | logNodeState | function logNodeState() {
if (brackets.app && brackets.app.getNodeState) {
brackets.app.getNodeState(function (err, port) {
if (err) {
console.log("[NodeDebugUtils] Node is in error state " + err);
} else {
console.log("[NodeDeb... | javascript | function logNodeState() {
if (brackets.app && brackets.app.getNodeState) {
brackets.app.getNodeState(function (err, port) {
if (err) {
console.log("[NodeDebugUtils] Node is in error state " + err);
} else {
console.log("[NodeDeb... | [
"function",
"logNodeState",
"(",
")",
"{",
"if",
"(",
"brackets",
".",
"app",
"&&",
"brackets",
".",
"app",
".",
"getNodeState",
")",
"{",
"brackets",
".",
"app",
".",
"getNodeState",
"(",
"function",
"(",
"err",
",",
"port",
")",
"{",
"if",
"(",
"er... | Logs the state of the current node server to the console. | [
"Logs",
"the",
"state",
"of",
"the",
"current",
"node",
"server",
"to",
"the",
"console",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/DebugCommands/NodeDebugUtils.js#L47-L59 | train | This function is called by the node. js code to log the node state | [
30522,
3853,
8833,
3630,
6155,
12259,
1006,
1007,
1063,
2065,
1006,
19719,
1012,
10439,
1004,
1004,
19719,
1012,
10439,
1012,
2131,
3630,
6155,
12259,
1007,
1063,
19719,
1012,
10439,
1012,
2131,
3630,
6155,
12259,
1006,
3853,
1006,
9413,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mdn/browser-compat-data | scripts/render.js | collectCompatNotes | function collectCompatNotes() {
function pushNotes(supportEntry, browserName) {
// collect notes
if (supportEntry.hasOwnProperty('notes')) {
let notes = supportEntry['notes'];
if (Array.isArray(notes)) {
for (let note of notes) {
if (notesArray.indexOf(note) === -1) {
... | javascript | function collectCompatNotes() {
function pushNotes(supportEntry, browserName) {
// collect notes
if (supportEntry.hasOwnProperty('notes')) {
let notes = supportEntry['notes'];
if (Array.isArray(notes)) {
for (let note of notes) {
if (notesArray.indexOf(note) === -1) {
... | [
"function",
"collectCompatNotes",
"(",
")",
"{",
"function",
"pushNotes",
"(",
"supportEntry",
",",
"browserName",
")",
"{",
"// collect notes",
"if",
"(",
"supportEntry",
".",
"hasOwnProperty",
"(",
"'notes'",
")",
")",
"{",
"let",
"notes",
"=",
"supportEntry",... | /*
Iterate into all "support" objects, and all browsers under them,
and collect all notes in an array, without duplicates. | [
"/",
"*",
"Iterate",
"into",
"all",
"support",
"objects",
"and",
"all",
"browsers",
"under",
"them",
"and",
"collect",
"all",
"notes",
"in",
"an",
"array",
"without",
"duplicates",
"."
] | 6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b | https://github.com/mdn/browser-compat-data/blob/6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b/scripts/render.js#L279-L325 | train | collectCompatNotes - collect notes from supportEntry | [
30522,
3853,
8145,
9006,
4502,
2102,
20564,
1006,
1007,
1063,
3853,
5245,
20564,
1006,
2490,
4765,
2854,
1010,
16602,
18442,
1007,
1063,
1013,
1013,
8145,
3964,
2065,
1006,
2490,
4765,
2854,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
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... |
eslint/eslint | lib/token-store/index.js | getAdjacentCommentTokensFromCursor | function getAdjacentCommentTokensFromCursor(cursor) {
const tokens = [];
let currentToken = cursor.getOneToken();
while (currentToken && astUtils.isCommentToken(currentToken)) {
tokens.push(currentToken);
currentToken = cursor.getOneToken();
}
return tokens;
} | javascript | function getAdjacentCommentTokensFromCursor(cursor) {
const tokens = [];
let currentToken = cursor.getOneToken();
while (currentToken && astUtils.isCommentToken(currentToken)) {
tokens.push(currentToken);
currentToken = cursor.getOneToken();
}
return tokens;
} | [
"function",
"getAdjacentCommentTokensFromCursor",
"(",
"cursor",
")",
"{",
"const",
"tokens",
"=",
"[",
"]",
";",
"let",
"currentToken",
"=",
"cursor",
".",
"getOneToken",
"(",
")",
";",
"while",
"(",
"currentToken",
"&&",
"astUtils",
".",
"isCommentToken",
"(... | Gets comment tokens that are adjacent to the current cursor position.
@param {Cursor} cursor - A cursor instance.
@returns {Array} An array of comment tokens adjacent to the current cursor position.
@private | [
"Gets",
"comment",
"tokens",
"that",
"are",
"adjacent",
"to",
"the",
"current",
"cursor",
"position",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/token-store/index.js#L183-L193 | train | Get the adjacent comment tokens from the cursor | [
30522,
3853,
2131,
4215,
3900,
13013,
9006,
3672,
18715,
6132,
19699,
5358,
10841,
25301,
2099,
1006,
12731,
25301,
2099,
1007,
1063,
9530,
3367,
19204,
2015,
1027,
1031,
1033,
1025,
2292,
2783,
18715,
2368,
1027,
12731,
25301,
2099,
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/utils/AppInit.js | _dispatchReady | function _dispatchReady(type) {
var i,
myHandlers = _callbacks[type];
// mark this status complete
_status[type] = true;
for (i = 0; i < myHandlers.length; i++) {
_callHandler(myHandlers[i]);
}
// clear all callbacks after being called
_... | javascript | function _dispatchReady(type) {
var i,
myHandlers = _callbacks[type];
// mark this status complete
_status[type] = true;
for (i = 0; i < myHandlers.length; i++) {
_callHandler(myHandlers[i]);
}
// clear all callbacks after being called
_... | [
"function",
"_dispatchReady",
"(",
"type",
")",
"{",
"var",
"i",
",",
"myHandlers",
"=",
"_callbacks",
"[",
"type",
"]",
";",
"// mark this status complete",
"_status",
"[",
"type",
"]",
"=",
"true",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"myHa... | /*
dispatches the event by calling all handlers registered for that type
@param {string} type - the event type to dispatch (APP_READY, EXTENSIONS_READY, HTML_READY)
@private | [
"/",
"*",
"dispatches",
"the",
"event",
"by",
"calling",
"all",
"handlers",
"registered",
"for",
"that",
"type"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/AppInit.js#L101-L114 | train | dispatch ready event | [
30522,
3853,
1035,
18365,
16416,
5149,
1006,
2828,
1007,
1063,
13075,
1045,
1010,
2026,
11774,
12910,
1027,
1035,
2655,
12221,
30524,
1007,
1063,
1035,
2655,
11774,
3917,
1006,
2026,
11774,
12910,
1031,
1045,
1033,
1007,
1025,
1065,
1013,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.