repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
adobe/brackets | src/features/ParameterHintsManager.js | installListeners | function installListeners(editor) {
editor.on("keydown.ParameterHinting", function (event, editor, domEvent) {
if (domEvent.keyCode === KeyEvent.DOM_VK_ESCAPE) {
dismissHint(editor);
}
}).on("scroll.ParameterHinting", function () {
... | javascript | function installListeners(editor) {
editor.on("keydown.ParameterHinting", function (event, editor, domEvent) {
if (domEvent.keyCode === KeyEvent.DOM_VK_ESCAPE) {
dismissHint(editor);
}
}).on("scroll.ParameterHinting", function () {
... | [
"function",
"installListeners",
"(",
"editor",
")",
"{",
"editor",
".",
"on",
"(",
"\"keydown.ParameterHinting\"",
",",
"function",
"(",
"event",
",",
"editor",
",",
"domEvent",
")",
"{",
"if",
"(",
"domEvent",
".",
"keyCode",
"===",
"KeyEvent",
".",
"DOM_VK... | Install function hint listeners.
@param {Editor} editor - editor context on which to listen for
changes | [
"Install",
"function",
"hint",
"listeners",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/ParameterHintsManager.js#L318-L328 | train | installs listeners for parameter hinting | [
30522,
3853,
16500,
9863,
24454,
2015,
1006,
3559,
1007,
1063,
3559,
1012,
2006,
1006,
1000,
3145,
7698,
1012,
16381,
10606,
3436,
1000,
1010,
3853,
1006,
2724,
1010,
3559,
1010,
8514,
15338,
1007,
1063,
2065,
1006,
8514,
15338,
1012,
3145,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/tabs.js | tabBrowser_openTab | function tabBrowser_openTab(aEvent) {
var event = aEvent || { };
var type = (event.type == undefined) ? "menu" : event.type;
// Disable tab closing animation for default behavior
prefs.preferences.setPref(PREF_TABS_ANIMATE, false);
// Add event listener to wait until the tab has been opened
va... | javascript | function tabBrowser_openTab(aEvent) {
var event = aEvent || { };
var type = (event.type == undefined) ? "menu" : event.type;
// Disable tab closing animation for default behavior
prefs.preferences.setPref(PREF_TABS_ANIMATE, false);
// Add event listener to wait until the tab has been opened
va... | [
"function",
"tabBrowser_openTab",
"(",
"aEvent",
")",
"{",
"var",
"event",
"=",
"aEvent",
"||",
"{",
"}",
";",
"var",
"type",
"=",
"(",
"event",
".",
"type",
"==",
"undefined",
")",
"?",
"\"menu\"",
":",
"event",
".",
"type",
";",
"// Disable tab closing... | Open a new tab
@param {object} aEvent
The event specifies how to open a new tab (menu, shortcut,
Elements: type - Type of event (menu, newTabButton, shortcut, tabStrip)
[optional - default: menu] | [
"Open",
"a",
"new",
"tab"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/tabs.js#L416-L468 | train | Open a new tab | [
30522,
3853,
21628,
12618,
9333,
2121,
1035,
2330,
2696,
2497,
1006,
29347,
15338,
1007,
1063,
13075,
2724,
1027,
29347,
15338,
1064,
1064,
1063,
1065,
1025,
13075,
2828,
1027,
1006,
2724,
1012,
2828,
1027,
1027,
6151,
28344,
1007,
1029,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | write_dos_date | function write_dos_date(buf, date) {
if(typeof date === "string") date = new Date(date);
var hms = date.getHours();
hms = hms << 6 | date.getMinutes();
hms = hms << 5 | (date.getSeconds()>>>1);
buf.write_shift(2, hms);
var ymd = (date.getFullYear() - 1980);
ymd = ymd << 4 | (date.getMonth()+1);
ymd = ymd << 5 |... | javascript | function write_dos_date(buf, date) {
if(typeof date === "string") date = new Date(date);
var hms = date.getHours();
hms = hms << 6 | date.getMinutes();
hms = hms << 5 | (date.getSeconds()>>>1);
buf.write_shift(2, hms);
var ymd = (date.getFullYear() - 1980);
ymd = ymd << 4 | (date.getMonth()+1);
ymd = ymd << 5 |... | [
"function",
"write_dos_date",
"(",
"buf",
",",
"date",
")",
"{",
"if",
"(",
"typeof",
"date",
"===",
"\"string\"",
")",
"date",
"=",
"new",
"Date",
"(",
"date",
")",
";",
"var",
"hms",
"=",
"date",
".",
"getHours",
"(",
")",
";",
"hms",
"=",
"hms",... | /* -------------------------------------------------------------------------- /* DOS Date format:
high|YYYYYYYm.mmmddddd.HHHHHMMM.MMMSSSSS|low
add 1980 to stored year
stored second should be doubled
/* write JS date to buf as a DOS date | [
"/",
"*",
"--------------------------------------------------------------------------",
"/",
"*",
"DOS",
"Date",
"format",
":",
"high|YYYYYYYm",
".",
"mmmddddd",
".",
"HHHHHMMM",
".",
"MMMSSSSS|low",
"add",
"1980",
"to",
"stored",
"year",
"stored",
"second",
"should",
... | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L1278-L1288 | train | Writes a Date to a Buffer | [
30522,
3853,
4339,
1035,
9998,
1035,
3058,
1006,
20934,
2546,
1010,
3058,
1007,
1063,
2065,
1006,
2828,
11253,
3058,
1027,
1027,
1027,
1000,
5164,
1000,
1007,
3058,
1027,
2047,
3058,
1006,
3058,
1007,
1025,
13075,
7220,
1027,
3058,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.m/src/sap/m/GrowingEnablement.js | function(oContext, oBindingInfo) {
this._iRenderedDataItems++;
var oItem = oBindingInfo.factory(ManagedObjectMetadata.uid("clone"), oContext);
return oItem.setBindingContext(oContext, oBindingInfo.model);
} | javascript | function(oContext, oBindingInfo) {
this._iRenderedDataItems++;
var oItem = oBindingInfo.factory(ManagedObjectMetadata.uid("clone"), oContext);
return oItem.setBindingContext(oContext, oBindingInfo.model);
} | [
"function",
"(",
"oContext",
",",
"oBindingInfo",
")",
"{",
"this",
".",
"_iRenderedDataItems",
"++",
";",
"var",
"oItem",
"=",
"oBindingInfo",
".",
"factory",
"(",
"ManagedObjectMetadata",
".",
"uid",
"(",
"\"clone\"",
")",
",",
"oContext",
")",
";",
"retur... | creates list item from the factory | [
"creates",
"list",
"item",
"from",
"the",
"factory"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/GrowingEnablement.js#L361-L365 | train | Creates a new data item and sets the binding context | [
30522,
3853,
1006,
1051,
8663,
18209,
1010,
27885,
22254,
2075,
2378,
14876,
1007,
1063,
2023,
1012,
1035,
20868,
10497,
6850,
2850,
15444,
18532,
2015,
1009,
1009,
1025,
13075,
1051,
4221,
2213,
1027,
27885,
22254,
2075,
2378,
14876,
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... | |
google/closure-library | closure/goog/html/sanitizer/noclobber.js | getElementsByTagName | function getElementsByTagName(element, name) {
return Array.from(genericMethodCall(
Methods.GET_ELEMENTS_BY_TAG_NAME, element, 'getElementsByTagName',
[name]));
} | javascript | function getElementsByTagName(element, name) {
return Array.from(genericMethodCall(
Methods.GET_ELEMENTS_BY_TAG_NAME, element, 'getElementsByTagName',
[name]));
} | [
"function",
"getElementsByTagName",
"(",
"element",
",",
"name",
")",
"{",
"return",
"Array",
".",
"from",
"(",
"genericMethodCall",
"(",
"Methods",
".",
"GET_ELEMENTS_BY_TAG_NAME",
",",
"element",
",",
"'getElementsByTagName'",
",",
"[",
"name",
"]",
")",
")",
... | Get the children of a specific tag matching the provided tag name without
falling prey to things like <form><input name="getElementsByTagName"></form>.
Equivalent to {@code element.getElementsByTagName("foo")}.
@param {!Element} element
@param {string} name
@return {!Array<!Element>} | [
"Get",
"the",
"children",
"of",
"a",
"specific",
"tag",
"matching",
"the",
"provided",
"tag",
"name",
"without",
"falling",
"prey",
"to",
"things",
"like",
"<form",
">",
"<input",
"name",
"=",
"getElementsByTagName",
">",
"<",
"/",
"form",
">",
".",
"Equiv... | 97390e9ca4483cebb9628e06026139fbb3023d65 | https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/closure/goog/html/sanitizer/noclobber.js#L284-L288 | train | Get all elements by tag name | [
30522,
3853,
2131,
12260,
8163,
3762,
15900,
18442,
1006,
5783,
1010,
2171,
1007,
1063,
2709,
9140,
1012,
2013,
1006,
12391,
11368,
6806,
16409,
8095,
1006,
4725,
1012,
2131,
1035,
3787,
1035,
2011,
1035,
6415,
1035,
2171,
1010,
5783,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | logAdditionalUserInfo | function logAdditionalUserInfo(response) {
if (response.additionalUserInfo) {
if (response.additionalUserInfo.username) {
log(response.additionalUserInfo['providerId'] + ' username: ' +
response.additionalUserInfo.username);
}
if (response.additionalUserInfo.profile) {
log(response.a... | javascript | function logAdditionalUserInfo(response) {
if (response.additionalUserInfo) {
if (response.additionalUserInfo.username) {
log(response.additionalUserInfo['providerId'] + ' username: ' +
response.additionalUserInfo.username);
}
if (response.additionalUserInfo.profile) {
log(response.a... | [
"function",
"logAdditionalUserInfo",
"(",
"response",
")",
"{",
"if",
"(",
"response",
".",
"additionalUserInfo",
")",
"{",
"if",
"(",
"response",
".",
"additionalUserInfo",
".",
"username",
")",
"{",
"log",
"(",
"response",
".",
"additionalUserInfo",
"[",
"'p... | Logs additional user info returned by a sign-in event, if available.
@param {!Object} response | [
"Logs",
"additional",
"user",
"info",
"returned",
"by",
"a",
"sign",
"-",
"in",
"event",
"if",
"available",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L1077-L1092 | train | Log additional user information | [
30522,
3853,
8833,
4215,
27064,
20330,
2378,
14876,
1006,
3433,
1007,
1063,
2065,
1006,
3433,
1012,
3176,
20330,
2378,
14876,
1007,
1063,
2065,
1006,
3433,
1012,
3176,
20330,
2378,
14876,
1012,
5310,
18442,
1007,
1063,
8833,
1006,
3433,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/indent-legacy.js | checkFirstNodeLineIndent | function checkFirstNodeLineIndent(node, firstLineIndent) {
const startIndent = getNodeIndent(node, false);
if ((startIndent.goodChar !== firstLineIndent || startIndent.badChar !== 0) && isNodeFirstInLine(node)) {
report(
node,
firstLineInd... | javascript | function checkFirstNodeLineIndent(node, firstLineIndent) {
const startIndent = getNodeIndent(node, false);
if ((startIndent.goodChar !== firstLineIndent || startIndent.badChar !== 0) && isNodeFirstInLine(node)) {
report(
node,
firstLineInd... | [
"function",
"checkFirstNodeLineIndent",
"(",
"node",
",",
"firstLineIndent",
")",
"{",
"const",
"startIndent",
"=",
"getNodeIndent",
"(",
"node",
",",
"false",
")",
";",
"if",
"(",
"(",
"startIndent",
".",
"goodChar",
"!==",
"firstLineIndent",
"||",
"startIndent... | Check first node line indent is correct
@param {ASTNode} node Node to examine
@param {int} firstLineIndent needed indent
@returns {void} | [
"Check",
"first",
"node",
"line",
"indent",
"is",
"correct"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/indent-legacy.js#L490-L502 | train | Check first node line indent | [
30522,
3853,
4638,
8873,
12096,
3630,
9247,
3170,
22254,
4765,
1006,
13045,
1010,
2034,
4179,
22254,
4765,
1007,
1063,
9530,
3367,
2707,
22254,
4765,
1027,
2131,
3630,
3207,
22254,
4765,
1006,
13045,
1010,
6270,
1007,
1025,
2065,
1006,
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... |
NervJS/taro | packages/taro-components/src/components/slider/index.js | parseType | function parseType (props) {
const {
min,
max,
step,
disabled,
value,
backgroundColor,
activeColor,
blockSize,
blockColor,
showValue,
onChange,
onChanging
} = props
// 抛出错误信息
const throwErrorMsg = type => {
throw new TypeError(type)
}
if (min) isNumber(m... | javascript | function parseType (props) {
const {
min,
max,
step,
disabled,
value,
backgroundColor,
activeColor,
blockSize,
blockColor,
showValue,
onChange,
onChanging
} = props
// 抛出错误信息
const throwErrorMsg = type => {
throw new TypeError(type)
}
if (min) isNumber(m... | [
"function",
"parseType",
"(",
"props",
")",
"{",
"const",
"{",
"min",
",",
"max",
",",
"step",
",",
"disabled",
",",
"value",
",",
"backgroundColor",
",",
"activeColor",
",",
"blockSize",
",",
"blockColor",
",",
"showValue",
",",
"onChange",
",",
"onChangi... | props 类型检测
@param {Object} props | [
"props",
"类型检测"
] | 274e76d731d7f158141287e31cbd51f092d472c5 | https://github.com/NervJS/taro/blob/274e76d731d7f158141287e31cbd51f092d472c5/packages/taro-components/src/components/slider/index.js#L11-L50 | train | Parse type | [
30522,
3853,
11968,
13462,
18863,
1006,
24387,
1007,
1063,
9530,
3367,
1063,
8117,
1010,
4098,
1010,
3357,
1010,
9776,
1010,
3643,
1010,
4281,
18717,
1010,
3161,
18717,
1010,
5991,
4697,
1010,
3796,
18717,
1010,
2265,
10175,
5657,
1010,
200... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/data/importer/index.js | function (handler, directory) {
var globPattern = this.getExtensionGlob(handler.extensions, ALL_DIRS);
return _.map(glob.sync(globPattern, {cwd: directory}), function (file) {
return {name: file, path: path.join(directory, file)};
});
} | javascript | function (handler, directory) {
var globPattern = this.getExtensionGlob(handler.extensions, ALL_DIRS);
return _.map(glob.sync(globPattern, {cwd: directory}), function (file) {
return {name: file, path: path.join(directory, file)};
});
} | [
"function",
"(",
"handler",
",",
"directory",
")",
"{",
"var",
"globPattern",
"=",
"this",
".",
"getExtensionGlob",
"(",
"handler",
".",
"extensions",
",",
"ALL_DIRS",
")",
";",
"return",
"_",
".",
"map",
"(",
"glob",
".",
"sync",
"(",
"globPattern",
","... | Use the handler extensions to get a globbing pattern, then use that to fetch all the files from the zip which
are relevant to the given handler, and return them as a name and path combo
@param {Object} handler
@param {String} directory
@returns [] Files | [
"Use",
"the",
"handler",
"extensions",
"to",
"get",
"a",
"globbing",
"pattern",
"then",
"use",
"that",
"to",
"fetch",
"all",
"the",
"files",
"from",
"the",
"zip",
"which",
"are",
"relevant",
"to",
"the",
"given",
"handler",
"and",
"return",
"them",
"as",
... | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/data/importer/index.js#L186-L191 | train | Get the list of files in the given directory | [
30522,
3853,
1006,
28213,
1010,
14176,
1007,
1063,
13075,
1043,
4135,
2497,
4502,
12079,
2078,
1027,
2023,
1012,
2131,
10288,
29048,
23296,
16429,
1006,
28213,
1012,
14305,
1010,
2035,
1035,
16101,
2015,
1007,
1025,
2709,
1035,
1012,
4949,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/editor/EditorManager.js | _handleCurrentFileChange | function _handleCurrentFileChange(e, file) {
var doc = file && DocumentManager.getOpenDocumentForPath(file.fullPath);
_notifyActiveEditorChanged(doc && doc._masterEditor);
} | javascript | function _handleCurrentFileChange(e, file) {
var doc = file && DocumentManager.getOpenDocumentForPath(file.fullPath);
_notifyActiveEditorChanged(doc && doc._masterEditor);
} | [
"function",
"_handleCurrentFileChange",
"(",
"e",
",",
"file",
")",
"{",
"var",
"doc",
"=",
"file",
"&&",
"DocumentManager",
".",
"getOpenDocumentForPath",
"(",
"file",
".",
"fullPath",
")",
";",
"_notifyActiveEditorChanged",
"(",
"doc",
"&&",
"doc",
".",
"_ma... | Current File Changed handler
MainViewManager dispatches a "currentFileChange" event whenever the currently viewed
file changes. Which could mean that the previously viewed file has been closed or a
non-editor view (image) has been given focus. _notifyAcitveEditorChanged is also hooked
up to editor.focus to handle foc... | [
"Current",
"File",
"Changed",
"handler",
"MainViewManager",
"dispatches",
"a",
"currentFileChange",
"event",
"whenever",
"the",
"currently",
"viewed",
"file",
"changes",
".",
"Which",
"could",
"mean",
"that",
"the",
"previously",
"viewed",
"file",
"has",
"been",
"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorManager.js#L167-L170 | train | Handle current file change | [
30522,
3853,
1035,
5047,
10841,
14343,
3372,
8873,
2571,
22305,
2063,
1006,
1041,
1010,
5371,
1007,
1063,
13075,
9986,
1027,
5371,
1004,
1004,
6254,
24805,
4590,
1012,
2131,
26915,
3527,
24894,
4765,
29278,
15069,
1006,
5371,
1012,
2440,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sparksuite/simplemde-markdown-editor | src/js/simplemde.js | toggleCodeBlock | function toggleCodeBlock(editor) {
var fenceCharsToInsert = editor.options.blockStyles.code;
function fencing_line(line) {
/* return true, if this is a ``` or ~~~ line */
if(typeof line !== "object") {
throw "fencing_line() takes a 'line' object (not a line number, or line text). Got: " + typeof line + ": " ... | javascript | function toggleCodeBlock(editor) {
var fenceCharsToInsert = editor.options.blockStyles.code;
function fencing_line(line) {
/* return true, if this is a ``` or ~~~ line */
if(typeof line !== "object") {
throw "fencing_line() takes a 'line' object (not a line number, or line text). Got: " + typeof line + ": " ... | [
"function",
"toggleCodeBlock",
"(",
"editor",
")",
"{",
"var",
"fenceCharsToInsert",
"=",
"editor",
".",
"options",
".",
"blockStyles",
".",
"code",
";",
"function",
"fencing_line",
"(",
"line",
")",
"{",
"/* return true, if this is a ``` or ~~~ line */",
"if",
"(",... | Action for toggling code block. | [
"Action",
"for",
"toggling",
"code",
"block",
"."
] | 6abda7ab68cc20f4aca870eb243747951b90ab04 | https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js#L256-L537 | train | Toggle the code block | [
30522,
3853,
2000,
24679,
16044,
23467,
1006,
3559,
1007,
1063,
13075,
8638,
7507,
12096,
28765,
8043,
2102,
1027,
3559,
1012,
7047,
1012,
5991,
27983,
2015,
1012,
3642,
1025,
3853,
15962,
1035,
2240,
1006,
2240,
1007,
1063,
1013,
1008,
270... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/ProjectModel.js | _renameItem | function _renameItem(oldPath, newPath, newName, isFolder) {
var result = new $.Deferred();
if (oldPath === newPath) {
result.resolve();
} else if (!isValidFilename(newName)) {
result.reject(ERROR_INVALID_FILENAME);
} else {
var entry = isFolder ? File... | javascript | function _renameItem(oldPath, newPath, newName, isFolder) {
var result = new $.Deferred();
if (oldPath === newPath) {
result.resolve();
} else if (!isValidFilename(newName)) {
result.reject(ERROR_INVALID_FILENAME);
} else {
var entry = isFolder ? File... | [
"function",
"_renameItem",
"(",
"oldPath",
",",
"newPath",
",",
"newName",
",",
"isFolder",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"if",
"(",
"oldPath",
"===",
"newPath",
")",
"{",
"result",
".",
"resolve",
"(",
"... | Rename a file/folder. This will update the project tree data structures
and send notifications about the rename.
@param {string} oldPath Old name of the item with the path
@param {string} newPath New name of the item with the path
@param {string} newName New name of the item
@param {boolean} isFolder True if item is a... | [
"Rename",
"a",
"file",
"/",
"folder",
".",
"This",
"will",
"update",
"the",
"project",
"tree",
"data",
"structures",
"and",
"send",
"notifications",
"about",
"the",
"rename",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectModel.js#L920-L939 | train | rename an item | [
30522,
3853,
1035,
14916,
14074,
4221,
2213,
1006,
2214,
15069,
1010,
2047,
15069,
1010,
2047,
18442,
1010,
2003,
10371,
2121,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
30524,
10663,
1006,
1007,
1025,
1065,
2842,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
badges/shields | services/nuget/nuget-v3-service-family.js | createServiceFamily | function createServiceFamily({
defaultLabel,
serviceBaseUrl,
withTenant = true,
apiDomain,
apiBaseUrl,
withFeed = true,
}) {
class NugetVersionService extends BaseJsonService {
static get category() {
return 'version'
}
static get route() {
return buildRoute({ serviceBaseUrl, with... | javascript | function createServiceFamily({
defaultLabel,
serviceBaseUrl,
withTenant = true,
apiDomain,
apiBaseUrl,
withFeed = true,
}) {
class NugetVersionService extends BaseJsonService {
static get category() {
return 'version'
}
static get route() {
return buildRoute({ serviceBaseUrl, with... | [
"function",
"createServiceFamily",
"(",
"{",
"defaultLabel",
",",
"serviceBaseUrl",
",",
"withTenant",
"=",
"true",
",",
"apiDomain",
",",
"apiBaseUrl",
",",
"withFeed",
"=",
"true",
",",
"}",
")",
"{",
"class",
"NugetVersionService",
"extends",
"BaseJsonService",... | /*
Create a version and download service for a NuGet v2 API. Return an object
containing both services.
defaultLabel: The label for the left hand side of the badge.
serviceBaseUrl: The base URL for the Shields service, e.g. nuget
withTenant: When true, an optional `tenant` is extracted from the badge
URL, which repres... | [
"/",
"*",
"Create",
"a",
"version",
"and",
"download",
"service",
"for",
"a",
"NuGet",
"v2",
"API",
".",
"Return",
"an",
"object",
"containing",
"both",
"services",
"."
] | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/services/nuget/nuget-v3-service-family.js#L143-L246 | train | Creates a service family | [
30522,
3853,
9005,
2121,
7903,
12879,
10631,
2135,
1006,
1063,
12398,
20470,
2884,
1010,
2326,
15058,
3126,
2140,
1010,
2007,
6528,
4630,
1027,
2995,
1010,
17928,
9527,
8113,
1010,
17928,
15058,
3126,
2140,
1010,
2007,
7959,
2098,
1027,
299... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
swimlane/ngx-datatable | release/utils/column-prop-getters.js | numericIndexGetter | function numericIndexGetter(row, index) {
if (row == null)
return '';
// mimic behavior of deepValueGetter
if (!row || index == null)
return row;
var value = row[index];
if (value == null)
return '';
return value;
} | javascript | function numericIndexGetter(row, index) {
if (row == null)
return '';
// mimic behavior of deepValueGetter
if (!row || index == null)
return row;
var value = row[index];
if (value == null)
return '';
return value;
} | [
"function",
"numericIndexGetter",
"(",
"row",
",",
"index",
")",
"{",
"if",
"(",
"row",
"==",
"null",
")",
"return",
"''",
";",
"// mimic behavior of deepValueGetter",
"if",
"(",
"!",
"row",
"||",
"index",
"==",
"null",
")",
"return",
"row",
";",
"var",
... | Returns the value at this numeric index.
@param row array of values
@param index numeric index
@returns {any} or '' if invalid index | [
"Returns",
"the",
"value",
"at",
"this",
"numeric",
"index",
"."
] | d7df15a070282a169524dba51d9572008b74804c | https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column-prop-getters.js#L39-L49 | train | This function is a helper function to get numeric values from a row | [
30522,
3853,
16371,
25531,
22254,
10288,
18150,
3334,
1006,
5216,
1010,
5950,
1007,
1063,
2065,
1006,
5216,
1027,
1027,
19701,
1007,
2709,
1005,
1005,
1025,
1013,
1013,
23150,
5248,
1997,
2784,
10175,
5657,
18150,
3334,
2065,
1006,
999,
521... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ramda/ramda | source/applySpec.js | mapValues | function mapValues(fn, obj) {
return keys(obj).reduce(function(acc, key) {
acc[key] = fn(obj[key]);
return acc;
}, {});
} | javascript | function mapValues(fn, obj) {
return keys(obj).reduce(function(acc, key) {
acc[key] = fn(obj[key]);
return acc;
}, {});
} | [
"function",
"mapValues",
"(",
"fn",
",",
"obj",
")",
"{",
"return",
"keys",
"(",
"obj",
")",
".",
"reduce",
"(",
"function",
"(",
"acc",
",",
"key",
")",
"{",
"acc",
"[",
"key",
"]",
"=",
"fn",
"(",
"obj",
"[",
"key",
"]",
")",
";",
"return",
... | Use custom mapValues function to avoid issues with specs that include a "map" key and R.map delegating calls to .map | [
"Use",
"custom",
"mapValues",
"function",
"to",
"avoid",
"issues",
"with",
"specs",
"that",
"include",
"a",
"map",
"key",
"and",
"R",
".",
"map",
"delegating",
"calls",
"to",
".",
"map"
] | 072d417a345e7087a95466a9825d43b6ca3a4941 | https://github.com/ramda/ramda/blob/072d417a345e7087a95466a9825d43b6ca3a4941/source/applySpec.js#L12-L17 | train | Map values from obj to fn | [
30522,
3853,
4949,
10175,
15808,
1006,
1042,
2078,
1010,
27885,
3501,
1007,
1063,
2709,
6309,
1006,
27885,
3501,
1007,
1012,
5547,
1006,
3853,
1006,
16222,
1010,
3145,
1007,
1063,
16222,
1031,
3145,
1033,
1027,
1042,
2078,
1006,
27885,
3501... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js | function(oEvent) {
var iLocationY = ExtensionHelper._getEventPosition(oEvent, this).y;
var iMin = this.$().offset().top;
if (iLocationY > iMin) {
this.$("ghost").css("top", iLocationY + "px");
}
} | javascript | function(oEvent) {
var iLocationY = ExtensionHelper._getEventPosition(oEvent, this).y;
var iMin = this.$().offset().top;
if (iLocationY > iMin) {
this.$("ghost").css("top", iLocationY + "px");
}
} | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"iLocationY",
"=",
"ExtensionHelper",
".",
"_getEventPosition",
"(",
"oEvent",
",",
"this",
")",
".",
"y",
";",
"var",
"iMin",
"=",
"this",
".",
"$",
"(",
")",
".",
"offset",
"(",
")",
".",
"top",
";",
"i... | /*
Handler for the move events while dragging the horizontal resize bar. | [
"/",
"*",
"Handler",
"for",
"the",
"move",
"events",
"while",
"dragging",
"the",
"horizontal",
"resize",
"bar",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js#L436-L442 | train | This method is called when the event is triggered by the container | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
6335,
23909,
2100,
1027,
5331,
16001,
4842,
1012,
1035,
2131,
18697,
3372,
26994,
1006,
1051,
18697,
3372,
1010,
2023,
1007,
1012,
1061,
1025,
13075,
10047,
2378,
1027,
2023,
1012,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GitbookIO/gitbook | lib/utils/fs.js | ensureFile | function ensureFile(filename) {
var base = path.dirname(filename);
return Promise.nfcall(mkdirp, base);
} | javascript | function ensureFile(filename) {
var base = path.dirname(filename);
return Promise.nfcall(mkdirp, base);
} | [
"function",
"ensureFile",
"(",
"filename",
")",
"{",
"var",
"base",
"=",
"path",
".",
"dirname",
"(",
"filename",
")",
";",
"return",
"Promise",
".",
"nfcall",
"(",
"mkdirp",
",",
"base",
")",
";",
"}"
] | Create all required folder to create a file | [
"Create",
"all",
"required",
"folder",
"to",
"create",
"a",
"file"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/fs.js#L88-L91 | train | Ensure the specified file exists. | [
30522,
3853,
5676,
8873,
2571,
1006,
5371,
18442,
1007,
1063,
13075,
2918,
1027,
4130,
1012,
16101,
18442,
1006,
5371,
18442,
1007,
1025,
2709,
4872,
1012,
22309,
8095,
1006,
12395,
4305,
14536,
1010,
2918,
1007,
1025,
1065,
102,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/templating/replaceShortcuts.js | replaceShortcuts | function replaceShortcuts(blocks, filePath, content) {
var shortcuts = listShortcuts(blocks, filePath);
return shortcuts.reduce(applyShortcut, content);
} | javascript | function replaceShortcuts(blocks, filePath, content) {
var shortcuts = listShortcuts(blocks, filePath);
return shortcuts.reduce(applyShortcut, content);
} | [
"function",
"replaceShortcuts",
"(",
"blocks",
",",
"filePath",
",",
"content",
")",
"{",
"var",
"shortcuts",
"=",
"listShortcuts",
"(",
"blocks",
",",
"filePath",
")",
";",
"return",
"shortcuts",
".",
"reduce",
"(",
"applyShortcut",
",",
"content",
")",
";"... | Replace shortcuts from blocks in a string
@param {List<TemplateBlock>} engine
@param {String} filePath
@param {String} content
@return {String} | [
"Replace",
"shortcuts",
"from",
"blocks",
"in",
"a",
"string"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/templating/replaceShortcuts.js#L34-L37 | train | Replace all shortcuts in the given content with the content of the file | [
30522,
3853,
20736,
27794,
12690,
2015,
1006,
5991,
1010,
5371,
15069,
1010,
4180,
1007,
1063,
13075,
2460,
12690,
2015,
1027,
7201,
27794,
12690,
2015,
1006,
5991,
1010,
5371,
15069,
1007,
1025,
2709,
2460,
12690,
2015,
1012,
5547,
1006,
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... |
jgraph/mxgraph | javascript/mxClient.js | mxTemporaryCellStates | function mxTemporaryCellStates(view, scale, cells, isCellVisibleFn, getLinkForCellState)
{
scale = (scale != null) ? scale : 1;
this.view = view;
// Stores the previous state
this.oldValidateCellState = view.validateCellState;
this.oldBounds = view.getGraphBounds();
this.oldStates = view.getStates();
this.oldS... | javascript | function mxTemporaryCellStates(view, scale, cells, isCellVisibleFn, getLinkForCellState)
{
scale = (scale != null) ? scale : 1;
this.view = view;
// Stores the previous state
this.oldValidateCellState = view.validateCellState;
this.oldBounds = view.getGraphBounds();
this.oldStates = view.getStates();
this.oldS... | [
"function",
"mxTemporaryCellStates",
"(",
"view",
",",
"scale",
",",
"cells",
",",
"isCellVisibleFn",
",",
"getLinkForCellState",
")",
"{",
"scale",
"=",
"(",
"scale",
"!=",
"null",
")",
"?",
"scale",
":",
"1",
";",
"this",
".",
"view",
"=",
"view",
";",... | Copyright (c) 2006-2017, JGraph Ltd
Copyright (c) 2006-2017, Gaudenz Alder
Class: mxTemporaryCellStates
Creates a temporary set of cell states. | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2017",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2017",
"Gaudenz",
"Alder",
"Class",
":",
"mxTemporaryCellStates"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L69081-L69162 | train | Creates a temporary cell states | [
30522,
3853,
25630,
18532,
17822,
5649,
29109,
4877,
12259,
2015,
1006,
3193,
1010,
4094,
1010,
4442,
1010,
2003,
29109,
28530,
7028,
2546,
2078,
1010,
2131,
13767,
14821,
12718,
12259,
1007,
1063,
4094,
1027,
1006,
4094,
999,
1027,
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... |
SAP/openui5 | src/sap.uxap/src/sap/uxap/component/ObjectPageLayoutUXDrivenFactory.controller.js | function (sParentId, oBindingContext) {
var oControlInfo = oBindingContext.getProperty(""), oControl, oControlClass, oControlMetadata;
try {
//retrieve the block class
oControlClass = sap.ui.requireSync(oControlInfo.Type.replace(/\./g, "/"));
oControlMetadata = oControlClass.getMetadata();
//pre... | javascript | function (sParentId, oBindingContext) {
var oControlInfo = oBindingContext.getProperty(""), oControl, oControlClass, oControlMetadata;
try {
//retrieve the block class
oControlClass = sap.ui.requireSync(oControlInfo.Type.replace(/\./g, "/"));
oControlMetadata = oControlClass.getMetadata();
//pre... | [
"function",
"(",
"sParentId",
",",
"oBindingContext",
")",
"{",
"var",
"oControlInfo",
"=",
"oBindingContext",
".",
"getProperty",
"(",
"\"\"",
")",
",",
"oControl",
",",
"oControlClass",
",",
"oControlMetadata",
";",
"try",
"{",
"//retrieve the block class",
"oCo... | generates a control to be used in actions, blocks or moreBlocks aggregations
known issue: bindings are not applied, the control is built with data only
@param {string} sParentId the Id of the parent
@param {object} oBindingContext binding context
@returns {*} new control | [
"generates",
"a",
"control",
"to",
"be",
"used",
"in",
"actions",
"blocks",
"or",
"moreBlocks",
"aggregations",
"known",
"issue",
":",
"bindings",
"are",
"not",
"applied",
"the",
"control",
"is",
"built",
"with",
"data",
"only"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.uxap/src/sap/uxap/component/ObjectPageLayoutUXDrivenFactory.controller.js#L76-L105 | train | Creates a new control instance | [
30522,
3853,
1006,
8622,
16778,
2094,
1010,
27885,
22254,
2075,
8663,
18209,
1007,
1063,
13075,
1051,
8663,
13181,
4115,
14876,
1027,
27885,
22254,
2075,
8663,
18209,
1012,
2131,
21572,
4842,
3723,
1006,
1000,
1000,
1007,
1010,
1051,
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... | |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/MessageBox.js | cell | function cell(oContent) {
return new MatrixLayoutCell({
padding: Padding.None,
vAlign: VAlign.Top,
content: oContent
});
} | javascript | function cell(oContent) {
return new MatrixLayoutCell({
padding: Padding.None,
vAlign: VAlign.Top,
content: oContent
});
} | [
"function",
"cell",
"(",
"oContent",
")",
"{",
"return",
"new",
"MatrixLayoutCell",
"(",
"{",
"padding",
":",
"Padding",
".",
"None",
",",
"vAlign",
":",
"VAlign",
".",
"Top",
",",
"content",
":",
"oContent",
"}",
")",
";",
"}"
] | wraps the given control in a top aligned MatrixLayoutCell with no padding | [
"wraps",
"the",
"given",
"control",
"in",
"a",
"top",
"aligned",
"MatrixLayoutCell",
"with",
"no",
"padding"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/MessageBox.js#L234-L240 | train | Creates a cell for a given content | [
30522,
3853,
3526,
1006,
1051,
8663,
6528,
2102,
1007,
1063,
2709,
2047,
8185,
8485,
5833,
29109,
2140,
1006,
1063,
11687,
4667,
1024,
11687,
4667,
1012,
3904,
1010,
11748,
23773,
1024,
11748,
23773,
1012,
2327,
1010,
4180,
1024,
1051,
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... |
hinesboy/mavonEditor | src/lib/core/extra-function.js | judgeItalicAndBold | function judgeItalicAndBold(prefix, subfix, tmpStr, startPos, endPos) {
if (prefix === '*' && subfix === '*') {
if (tmpStr.substring(startPos - 2, startPos - 1) === '*' && tmpStr.substring(endPos + 1, endPos + 2) === '*') {
return false
}
}
return true
} | javascript | function judgeItalicAndBold(prefix, subfix, tmpStr, startPos, endPos) {
if (prefix === '*' && subfix === '*') {
if (tmpStr.substring(startPos - 2, startPos - 1) === '*' && tmpStr.substring(endPos + 1, endPos + 2) === '*') {
return false
}
}
return true
} | [
"function",
"judgeItalicAndBold",
"(",
"prefix",
",",
"subfix",
",",
"tmpStr",
",",
"startPos",
",",
"endPos",
")",
"{",
"if",
"(",
"prefix",
"===",
"'*'",
"&&",
"subfix",
"===",
"'*'",
")",
"{",
"if",
"(",
"tmpStr",
".",
"substring",
"(",
"startPos",
... | 处理粗体与斜体冲突问题 | [
"处理粗体与斜体冲突问题"
] | 7ef3db471d80c40c4e1d7a9e7ddb8400f3e4ab60 | https://github.com/hinesboy/mavonEditor/blob/7ef3db471d80c40c4e1d7a9e7ddb8400f3e4ab60/src/lib/core/extra-function.js#L52-L59 | train | Judge if it s italic and bold | [
30522,
3853,
3648,
18400,
5555,
4859,
27495,
1006,
17576,
1010,
4942,
8873,
2595,
1010,
1056,
25370,
16344,
1010,
2707,
6873,
2015,
1010,
2203,
6873,
2015,
1007,
1063,
2065,
1006,
17576,
1027,
1027,
1027,
1005,
1008,
1005,
1004,
1004,
4942,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/Toolbar.js | getLeftItemsWithVisibilityTrue | function getLeftItemsWithVisibilityTrue() {
var aItems = [];
this.getItems().forEach(function (item) {
if (item instanceof sap.ui.commons.ToolbarSeparator || item.getVisible()) {
aItems.push(item);
}
});
return aItems;
} | javascript | function getLeftItemsWithVisibilityTrue() {
var aItems = [];
this.getItems().forEach(function (item) {
if (item instanceof sap.ui.commons.ToolbarSeparator || item.getVisible()) {
aItems.push(item);
}
});
return aItems;
} | [
"function",
"getLeftItemsWithVisibilityTrue",
"(",
")",
"{",
"var",
"aItems",
"=",
"[",
"]",
";",
"this",
".",
"getItems",
"(",
")",
".",
"forEach",
"(",
"function",
"(",
"item",
")",
"{",
"if",
"(",
"item",
"instanceof",
"sap",
".",
"ui",
".",
"common... | **************************************************************** Private functions ****************************************************************
Returns all items with API property visibility = true, including toolbar separator(s)
@returns {Array} all items with API property visibility = true, including toolbar sep... | [
"****************************************************************",
"Private",
"functions",
"****************************************************************",
"Returns",
"all",
"items",
"with",
"API",
"property",
"visibility",
"=",
"true",
"including",
"toolbar",
"separator",
"(",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/Toolbar.js#L1000-L1008 | train | Returns an array of items with visibility true | [
30522,
3853,
2131,
2571,
6199,
4221,
5244,
24415,
11365,
13464,
16344,
5657,
1006,
1007,
1063,
13075,
9932,
18532,
2015,
1027,
1031,
1033,
1025,
2023,
1012,
2131,
4221,
5244,
1006,
1007,
1012,
18921,
6776,
1006,
3853,
1006,
8875,
1007,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | mxCoordinateAssignment | function mxCoordinateAssignment(layout, intraCellSpacing, interRankCellSpacing,
orientation, initialX, parallelEdgeSpacing)
{
this.layout = layout;
this.intraCellSpacing = intraCellSpacing;
this.interRankCellSpacing = interRankCellSpacing;
this.orientation = orientation;
this.initialX = initialX;
this.parallelEd... | javascript | function mxCoordinateAssignment(layout, intraCellSpacing, interRankCellSpacing,
orientation, initialX, parallelEdgeSpacing)
{
this.layout = layout;
this.intraCellSpacing = intraCellSpacing;
this.interRankCellSpacing = interRankCellSpacing;
this.orientation = orientation;
this.initialX = initialX;
this.parallelEd... | [
"function",
"mxCoordinateAssignment",
"(",
"layout",
",",
"intraCellSpacing",
",",
"interRankCellSpacing",
",",
"orientation",
",",
"initialX",
",",
"parallelEdgeSpacing",
")",
"{",
"this",
".",
"layout",
"=",
"layout",
";",
"this",
".",
"intraCellSpacing",
"=",
"... | Copyright (c) 2006-2018, JGraph Ltd
Copyright (c) 2006-2018, Gaudenz Alder
Class: mxCoordinateAssignment
Sets the horizontal locations of node and edge dummy nodes on each layer.
Uses median down and up weighings as well as heuristics to straighten edges as
far as possible.
Constructor: mxCoordinateAssignment
Crea... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2018",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2018",
"Gaudenz",
"Alder",
"Class",
":",
"mxCoordinateAssignment"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L35661-L35670 | train | This function is used to assign a coordinate to a cell | [
30522,
3853,
25630,
3597,
8551,
14776,
12054,
24838,
1006,
9621,
1010,
26721,
29109,
4877,
19498,
2075,
1010,
6970,
26763,
29109,
4877,
19498,
2075,
1010,
10296,
1010,
3988,
2595,
1010,
5903,
24225,
13102,
26217,
1007,
1063,
2023,
1012,
9621,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TopicDetailInitial.controller.js | function () {
jQuery0.ajax(this.getConfig().docuPath + "disclaimer.json", {dataType: "json"}).then(function (oData) {
var oView = this.getView();
if (oData.showDisclaimer && oData.message) {
oView.byId("disclaimerBlock").setVisible(true);
oView.byId("disclaimerMessage").setText(oData.message);... | javascript | function () {
jQuery0.ajax(this.getConfig().docuPath + "disclaimer.json", {dataType: "json"}).then(function (oData) {
var oView = this.getView();
if (oData.showDisclaimer && oData.message) {
oView.byId("disclaimerBlock").setVisible(true);
oView.byId("disclaimerMessage").setText(oData.message);... | [
"function",
"(",
")",
"{",
"jQuery0",
".",
"ajax",
"(",
"this",
".",
"getConfig",
"(",
")",
".",
"docuPath",
"+",
"\"disclaimer.json\"",
",",
"{",
"dataType",
":",
"\"json\"",
"}",
")",
".",
"then",
"(",
"function",
"(",
"oData",
")",
"{",
"var",
"oV... | Documentation disclaimer handler. This method fetches the disclaimer json file and modify's the view
to show disclaimer message if such is available in the loaded json file. | [
"Documentation",
"disclaimer",
"handler",
".",
"This",
"method",
"fetches",
"the",
"disclaimer",
"json",
"file",
"and",
"modify",
"s",
"the",
"view",
"to",
"show",
"disclaimer",
"message",
"if",
"such",
"is",
"available",
"in",
"the",
"loaded",
"json",
"file",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/TopicDetailInitial.controller.js#L34-L44 | train | Show disclaimer message | [
30522,
3853,
1006,
1007,
1063,
1046,
4226,
2854,
2692,
1012,
18176,
1006,
2023,
1012,
2131,
8663,
8873,
2290,
1006,
1007,
1012,
9986,
6279,
8988,
1009,
1000,
5860,
19771,
5017,
1012,
1046,
3385,
1000,
1010,
1063,
2951,
13874,
1024,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | CubicBezier | function CubicBezier(coordinates) {
if (typeof coordinates === "string") {
this.coordinates = coordinates.split(",");
} else {
this.coordinates = coordinates;
}
if (!this.coordinates) {
throw "No offsets were defined";
}
this.coordina... | javascript | function CubicBezier(coordinates) {
if (typeof coordinates === "string") {
this.coordinates = coordinates.split(",");
} else {
this.coordinates = coordinates;
}
if (!this.coordinates) {
throw "No offsets were defined";
}
this.coordina... | [
"function",
"CubicBezier",
"(",
"coordinates",
")",
"{",
"if",
"(",
"typeof",
"coordinates",
"===",
"\"string\"",
")",
"{",
"this",
".",
"coordinates",
"=",
"coordinates",
".",
"split",
"(",
"\",\"",
")",
";",
"}",
"else",
"{",
"this",
".",
"coordinates",
... | CubicBezier object constructor
@param {string|Array.number[4]} coordinates Four parameters passes to cubic-bezier()
either in string or array format. | [
"CubicBezier",
"object",
"constructor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L50-L70 | train | CubicBezier constructor. | [
30522,
3853,
11919,
4783,
21548,
1006,
12093,
1007,
1063,
2065,
1006,
2828,
11253,
12093,
1027,
1027,
1027,
1000,
5164,
1000,
1007,
1063,
2023,
1012,
12093,
1027,
12093,
1012,
3975,
1006,
1000,
1010,
1000,
1007,
1025,
1065,
2842,
1063,
2023... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/prefer-const.js | hasMemberExpressionAssignment | function hasMemberExpressionAssignment(node) {
switch (node.type) {
case "ObjectPattern":
return node.properties.some(prop => {
if (prop) {
/*
* Spread elements have an argument property while
* others have a value pr... | javascript | function hasMemberExpressionAssignment(node) {
switch (node.type) {
case "ObjectPattern":
return node.properties.some(prop => {
if (prop) {
/*
* Spread elements have an argument property while
* others have a value pr... | [
"function",
"hasMemberExpressionAssignment",
"(",
"node",
")",
"{",
"switch",
"(",
"node",
".",
"type",
")",
"{",
"case",
"\"ObjectPattern\"",
":",
"return",
"node",
".",
"properties",
".",
"some",
"(",
"prop",
"=>",
"{",
"if",
"(",
"prop",
")",
"{",
"/*... | Determines if a destructuring assignment node contains
any MemberExpression nodes. This is used to determine if a
variable that is only written once using destructuring can be
safely converted into a const declaration.
@param {ASTNode} node The ObjectPattern or ArrayPattern node to check.
@returns {boolean} True if the... | [
"Determines",
"if",
"a",
"destructuring",
"assignment",
"node",
"contains",
"any",
"MemberExpression",
"nodes",
".",
"This",
"is",
"used",
"to",
"determine",
"if",
"a",
"variable",
"that",
"is",
"only",
"written",
"once",
"using",
"destructuring",
"can",
"be",
... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-const.js#L109-L146 | train | Check if a node has an assignment to a member expression | [
30522,
3853,
2038,
4168,
21784,
10288,
20110,
3258,
12054,
24838,
1006,
13045,
1007,
1063,
6942,
1006,
13045,
1012,
2828,
1007,
1063,
2553,
1000,
4874,
4502,
12079,
2078,
1000,
1024,
2709,
13045,
1012,
5144,
1012,
2070,
1006,
17678,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sass/node-sass | lib/index.js | getStyle | function getStyle(options) {
var styles = {
nested: 0,
expanded: 1,
compact: 2,
compressed: 3
};
return styles[options.outputStyle] || 0;
} | javascript | function getStyle(options) {
var styles = {
nested: 0,
expanded: 1,
compact: 2,
compressed: 3
};
return styles[options.outputStyle] || 0;
} | [
"function",
"getStyle",
"(",
"options",
")",
"{",
"var",
"styles",
"=",
"{",
"nested",
":",
"0",
",",
"expanded",
":",
"1",
",",
"compact",
":",
"2",
",",
"compressed",
":",
"3",
"}",
";",
"return",
"styles",
"[",
"options",
".",
"outputStyle",
"]",
... | Get style
@param {Object} options
@api private | [
"Get",
"style"
] | 0c1a49eefa37544d16041c5fe5b2e3d9168004b7 | https://github.com/sass/node-sass/blob/0c1a49eefa37544d16041c5fe5b2e3d9168004b7/lib/index.js#L99-L108 | train | Get the style of the output | [
30522,
3853,
4152,
27983,
1006,
7047,
1007,
1063,
13075,
6782,
1027,
1063,
9089,
2098,
1024,
1014,
1010,
4423,
1024,
1015,
1010,
9233,
1024,
1016,
1010,
16620,
1024,
1017,
1065,
1025,
2709,
6782,
1031,
7047,
1012,
27852,
27983,
1033,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/max-nested-callbacks.js | checkFunction | function checkFunction(node) {
const parent = node.parent;
if (parent.type === "CallExpression") {
callbackStack.push(node);
}
if (callbackStack.length > THRESHOLD) {
const opts = { num: callbackStack.length, max: THRESHOLD };
... | javascript | function checkFunction(node) {
const parent = node.parent;
if (parent.type === "CallExpression") {
callbackStack.push(node);
}
if (callbackStack.length > THRESHOLD) {
const opts = { num: callbackStack.length, max: THRESHOLD };
... | [
"function",
"checkFunction",
"(",
"node",
")",
"{",
"const",
"parent",
"=",
"node",
".",
"parent",
";",
"if",
"(",
"parent",
".",
"type",
"===",
"\"CallExpression\"",
")",
"{",
"callbackStack",
".",
"push",
"(",
"node",
")",
";",
"}",
"if",
"(",
"callb... | Checks a given function node for too many callbacks.
@param {ASTNode} node The node to check.
@returns {void}
@private | [
"Checks",
"a",
"given",
"function",
"node",
"for",
"too",
"many",
"callbacks",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/max-nested-callbacks.js#L81-L93 | train | Check if a function is a call | [
30522,
3853,
4638,
11263,
27989,
1006,
13045,
1007,
1063,
9530,
3367,
6687,
1027,
13045,
1012,
6687,
1025,
2065,
1006,
6687,
1012,
2828,
1027,
1027,
1027,
1000,
2655,
10288,
20110,
3258,
1000,
1007,
1063,
2655,
12221,
2696,
3600,
1012,
5245... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
firebase/firebaseui-web | javascript/utils/acclient.js | function(resp, opt_error) {
if (resp && resp['account'] && opt_onAccountSelected) {
opt_onAccountSelected(
firebaseui.auth.Account.fromPlainObject(resp['account']));
} else if (opt_onAddAccount) {
// Check if accountchooser.com is available and pass to add account.
var isUnavailable ... | javascript | function(resp, opt_error) {
if (resp && resp['account'] && opt_onAccountSelected) {
opt_onAccountSelected(
firebaseui.auth.Account.fromPlainObject(resp['account']));
} else if (opt_onAddAccount) {
// Check if accountchooser.com is available and pass to add account.
var isUnavailable ... | [
"function",
"(",
"resp",
",",
"opt_error",
")",
"{",
"if",
"(",
"resp",
"&&",
"resp",
"[",
"'account'",
"]",
"&&",
"opt_onAccountSelected",
")",
"{",
"opt_onAccountSelected",
"(",
"firebaseui",
".",
"auth",
".",
"Account",
".",
"fromPlainObject",
"(",
"resp"... | Save the add account callback for later use. | [
"Save",
"the",
"add",
"account",
"callback",
"for",
"later",
"use",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/utils/acclient.js#L86-L96 | train | Handle accountchooser. com response. | [
30522,
3853,
1006,
24501,
2361,
1010,
23569,
1035,
7561,
1007,
1063,
2065,
1006,
24501,
2361,
1004,
1004,
24501,
2361,
1031,
1005,
4070,
1005,
1033,
1004,
1004,
23569,
1035,
2006,
6305,
3597,
16671,
11246,
22471,
2098,
1007,
1063,
23569,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.support/src/sap/ui/support/supportRules/ui/controllers/Analysis.controller.js | function () {
var tempRules = Storage.getRules(),
loadingFromAdditionalRuleSets = this.model.getProperty("/loadingAdditionalRuleSets");
if (tempRules && !loadingFromAdditionalRuleSets && !this.tempRulesLoaded) {
this.tempRulesFromStorage = tempRules;
this.tempRulesLoaded = true;
tempRules.forEac... | javascript | function () {
var tempRules = Storage.getRules(),
loadingFromAdditionalRuleSets = this.model.getProperty("/loadingAdditionalRuleSets");
if (tempRules && !loadingFromAdditionalRuleSets && !this.tempRulesLoaded) {
this.tempRulesFromStorage = tempRules;
this.tempRulesLoaded = true;
tempRules.forEac... | [
"function",
"(",
")",
"{",
"var",
"tempRules",
"=",
"Storage",
".",
"getRules",
"(",
")",
",",
"loadingFromAdditionalRuleSets",
"=",
"this",
".",
"model",
".",
"getProperty",
"(",
"\"/loadingAdditionalRuleSets\"",
")",
";",
"if",
"(",
"tempRules",
"&&",
"!",
... | Loads temporary rules from the local storage | [
"Loads",
"temporary",
"rules",
"from",
"the",
"local",
"storage"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/controllers/Analysis.controller.js#L725-L739 | train | This function is called when the model is loaded | [
30522,
3853,
1006,
1007,
1063,
13075,
8915,
8737,
6820,
4244,
1027,
5527,
1012,
2131,
6820,
4244,
1006,
1007,
1010,
10578,
19699,
9626,
14141,
22753,
2389,
6820,
24527,
3215,
1027,
2023,
1012,
2944,
1012,
2131,
21572,
4842,
3723,
1006,
1000... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/config/config-validator.js | formatErrors | function formatErrors(errors) {
return errors.map(error => {
if (error.keyword === "additionalProperties") {
const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;
return `Unexpected to... | javascript | function formatErrors(errors) {
return errors.map(error => {
if (error.keyword === "additionalProperties") {
const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;
return `Unexpected to... | [
"function",
"formatErrors",
"(",
"errors",
")",
"{",
"return",
"errors",
".",
"map",
"(",
"error",
"=>",
"{",
"if",
"(",
"error",
".",
"keyword",
"===",
"\"additionalProperties\"",
")",
"{",
"const",
"formattedPropertyPath",
"=",
"error",
".",
"dataPath",
".... | Formats an array of schema validation errors.
@param {Array} errors An array of error messages to format.
@returns {string} Formatted error message | [
"Formats",
"an",
"array",
"of",
"schema",
"validation",
"errors",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-validator.js#L207-L226 | train | Format an array of errors | [
30522,
3853,
4289,
2121,
29165,
2015,
1006,
10697,
1007,
1063,
2709,
10697,
1012,
4949,
1006,
7561,
1027,
1028,
1063,
2065,
1006,
7561,
1012,
3145,
18351,
1027,
1027,
1027,
1000,
3176,
21572,
4842,
7368,
1000,
1007,
1063,
9530,
3367,
30524,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ecomfe/zrender | src/Painter.js | function (opts) {
opts = opts || {};
if (this._singleCanvas && !this._compositeManually) {
return this._layers[CANVAS_ZLEVEL].dom;
}
var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);
imageLayer.initContext();
imageLayer.clear(false, opts... | javascript | function (opts) {
opts = opts || {};
if (this._singleCanvas && !this._compositeManually) {
return this._layers[CANVAS_ZLEVEL].dom;
}
var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);
imageLayer.initContext();
imageLayer.clear(false, opts... | [
"function",
"(",
"opts",
")",
"{",
"opts",
"=",
"opts",
"||",
"{",
"}",
";",
"if",
"(",
"this",
".",
"_singleCanvas",
"&&",
"!",
"this",
".",
"_compositeManually",
")",
"{",
"return",
"this",
".",
"_layers",
"[",
"CANVAS_ZLEVEL",
"]",
".",
"dom",
";"... | Get canvas which has all thing rendered
@param {Object} opts
@param {string} [opts.backgroundColor]
@param {number} [opts.pixelRatio] | [
"Get",
"canvas",
"which",
"has",
"all",
"thing",
"rendered"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/Painter.js#L913-L951 | train | Creates an image layer | [
30522,
3853,
1006,
23569,
2015,
1007,
1063,
23569,
2015,
1027,
23569,
2015,
1064,
1064,
1063,
1065,
1025,
2065,
1006,
2023,
1012,
1035,
2309,
9336,
12044,
1004,
1004,
999,
2023,
1012,
1035,
12490,
2386,
28488,
1007,
1063,
2709,
2023,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/addons.js | addonsManager_open | function addonsManager_open(aSpec) {
var spec = aSpec || { };
var type = (spec.type == undefined) ? "menu" : spec.type;
var waitFor = (spec.waitFor == undefined) ? true : spec.waitFor;
switch (type) {
case "menu":
var menuItem = new elementslib.Elem(this._controller.
... | javascript | function addonsManager_open(aSpec) {
var spec = aSpec || { };
var type = (spec.type == undefined) ? "menu" : spec.type;
var waitFor = (spec.waitFor == undefined) ? true : spec.waitFor;
switch (type) {
case "menu":
var menuItem = new elementslib.Elem(this._controller.
... | [
"function",
"addonsManager_open",
"(",
"aSpec",
")",
"{",
"var",
"spec",
"=",
"aSpec",
"||",
"{",
"}",
";",
"var",
"type",
"=",
"(",
"spec",
".",
"type",
"==",
"undefined",
")",
"?",
"\"menu\"",
":",
"spec",
".",
"type",
";",
"var",
"waitFor",
"=",
... | Open the Add-ons Manager
@param {object} aSpec
Information how to open the Add-ons Manager
Elements: type - Event, can be menu, or shortcut
[optional - default: menu]
waitFor - Wait until the Add-ons Manager has been opened
[optional - default: true]
@returns Reference the tab with the Add-ons Manager open
@type ... | [
"Open",
"the",
"Add",
"-",
"ons",
"Manager"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/addons.js#L131-L152 | train | Open the addons manager | [
30522,
3853,
5587,
5644,
24805,
4590,
1035,
2330,
1006,
2004,
5051,
2278,
1007,
1063,
13075,
28699,
1027,
2004,
5051,
2278,
1064,
1064,
1063,
1065,
1025,
13075,
2828,
1027,
1006,
28699,
1012,
2828,
1027,
1027,
6151,
28344,
1007,
1029,
1000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/syncXHRFix.js | wrapTimerHandler | function wrapTimerHandler(vHandler) {
var fnWrappedHandler = function() {
var aArgs, fnHandler;
if (bPromisesQueued) {
aArgs = [fnWrappedHandler, 0].concat(arguments);
_timeout.apply(window, aArgs);
} else {
fnHandler = typeof vHandler !== "function" ? new Function(vHandler) : vHand... | javascript | function wrapTimerHandler(vHandler) {
var fnWrappedHandler = function() {
var aArgs, fnHandler;
if (bPromisesQueued) {
aArgs = [fnWrappedHandler, 0].concat(arguments);
_timeout.apply(window, aArgs);
} else {
fnHandler = typeof vHandler !== "function" ? new Function(vHandler) : vHand... | [
"function",
"wrapTimerHandler",
"(",
"vHandler",
")",
"{",
"var",
"fnWrappedHandler",
"=",
"function",
"(",
")",
"{",
"var",
"aArgs",
",",
"fnHandler",
";",
"if",
"(",
"bPromisesQueued",
")",
"{",
"aArgs",
"=",
"[",
"fnWrappedHandler",
",",
"0",
"]",
".",
... | If there are promise handlers waiting for execution at the time the timeout fires, start another timeout to postpone timer execution after promise execution. | [
"If",
"there",
"are",
"promise",
"handlers",
"waiting",
"for",
"execution",
"at",
"the",
"time",
"the",
"timeout",
"fires",
"start",
"another",
"timeout",
"to",
"postpone",
"timer",
"execution",
"after",
"promise",
"execution",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/syncXHRFix.js#L94-L106 | train | wrap timer handler | [
30522,
3853,
10236,
7292,
25032,
5685,
3917,
1006,
1058,
11774,
3917,
1007,
1063,
13075,
1042,
2078,
13088,
29098,
2098,
11774,
3917,
1027,
3853,
1006,
1007,
1063,
13075,
9779,
10623,
2015,
1010,
1042,
25311,
5685,
3917,
1025,
2065,
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... |
LLK/scratch-blocks | blocks_vertical/looks.js | function() {
this.jsonInit({
"message0": Blockly.Msg.LOOKS_GOTOFRONTBACK,
"args0": [
{
"type": "field_dropdown",
"name": "FRONT_BACK",
"options": [
[Blockly.Msg.LOOKS_GOTOFRONTBACK_FRONT, 'front'],
[Blockly.Msg.LOOKS_GOTOFRONTBACK_BACK, 'back... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.LOOKS_GOTOFRONTBACK,
"args0": [
{
"type": "field_dropdown",
"name": "FRONT_BACK",
"options": [
[Blockly.Msg.LOOKS_GOTOFRONTBACK_FRONT, 'front'],
[Blockly.Msg.LOOKS_GOTOFRONTBACK_BACK, 'back... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"LOOKS_GOTOFRONTBACK",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"FRONT_BACK\"",
",",
"\"opti... | "Go to front/back" Block.
@this Blockly.Block | [
"Go",
"to",
"front",
"/",
"back",
"Block",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/looks.js#L460-L476 | train | Block for the goth of front back. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
3504,
1035,
30524,
1031,
3796,
2135,
1012,
5796,
2290,
1012,
3504,
1035,
2288,
11253,
4948,
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... | |
aws/aws-sdk-js | lib/service.js | attemptFailEvent | function attemptFailEvent(request) {
var monitoringEvent = this.apiAttemptEvent(request);
var response = request.response;
var error = response.error;
if (response.httpResponse.statusCode > 299 ) {
if (error.code) monitoringEvent.AwsException = error.code;
if (error.message) monitoringEvent.... | javascript | function attemptFailEvent(request) {
var monitoringEvent = this.apiAttemptEvent(request);
var response = request.response;
var error = response.error;
if (response.httpResponse.statusCode > 299 ) {
if (error.code) monitoringEvent.AwsException = error.code;
if (error.message) monitoringEvent.... | [
"function",
"attemptFailEvent",
"(",
"request",
")",
"{",
"var",
"monitoringEvent",
"=",
"this",
".",
"apiAttemptEvent",
"(",
"request",
")",
";",
"var",
"response",
"=",
"request",
".",
"response",
";",
"var",
"error",
"=",
"response",
".",
"error",
";",
... | Add metrics of failed request.
@api private | [
"Add",
"metrics",
"of",
"failed",
"request",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L367-L379 | train | Attempt to send an error to the service | [
30522,
3853,
3535,
7011,
9463,
15338,
1006,
5227,
1007,
1063,
13075,
8822,
18697,
3372,
1027,
2023,
1012,
17928,
19321,
6633,
13876,
18697,
3372,
1006,
5227,
1007,
1025,
13075,
3433,
1027,
5227,
1012,
3433,
1025,
13075,
7561,
1027,
3433,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.m/src/sap/m/HyphenationSupport.js | diffTexts | function diffTexts(mTextsMain, mTextsToDiff) {
var aDiffs = [];
Object.keys(mTextsMain).forEach(function(sKey) {
if (!(sKey in mTextsToDiff && mTextsMain[sKey] === mTextsToDiff[sKey])) {
aDiffs.push(sKey);
}
});
return aDiffs;
} | javascript | function diffTexts(mTextsMain, mTextsToDiff) {
var aDiffs = [];
Object.keys(mTextsMain).forEach(function(sKey) {
if (!(sKey in mTextsToDiff && mTextsMain[sKey] === mTextsToDiff[sKey])) {
aDiffs.push(sKey);
}
});
return aDiffs;
} | [
"function",
"diffTexts",
"(",
"mTextsMain",
",",
"mTextsToDiff",
")",
"{",
"var",
"aDiffs",
"=",
"[",
"]",
";",
"Object",
".",
"keys",
"(",
"mTextsMain",
")",
".",
"forEach",
"(",
"function",
"(",
"sKey",
")",
"{",
"if",
"(",
"!",
"(",
"sKey",
"in",
... | Checks which keys are not present in mTextsToDiff or their values are different
@param {map} mTextsMain The map of texts to compare
@param {map} mTextsToDiff The map of texts to compare against
@returns {Array} An array containing all keys for which there is difference
@private | [
"Checks",
"which",
"keys",
"are",
"not",
"present",
"in",
"mTextsToDiff",
"or",
"their",
"values",
"are",
"different"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/HyphenationSupport.js#L89-L97 | train | diff text objects | [
30522,
3853,
4487,
4246,
18209,
2015,
1006,
11047,
10288,
3215,
24238,
1010,
11047,
10288,
3215,
3406,
4305,
4246,
1007,
1063,
13075,
27133,
21807,
1027,
1031,
1033,
1025,
4874,
1012,
6309,
1006,
11047,
10288,
3215,
24238,
1007,
1012,
18921,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fex-team/webuploader | _draft/music/webuploader.js | function( block ) {
var me = this,
file = block.file,
promise;
me.pool.push( block );
me.remaning++;
// 如果没有分片,则直接使用原始的。
// 不会丢失content-type信息。
block.blob = block.chunks === ... | javascript | function( block ) {
var me = this,
file = block.file,
promise;
me.pool.push( block );
me.remaning++;
// 如果没有分片,则直接使用原始的。
// 不会丢失content-type信息。
block.blob = block.chunks === ... | [
"function",
"(",
"block",
")",
"{",
"var",
"me",
"=",
"this",
",",
"file",
"=",
"block",
".",
"file",
",",
"promise",
";",
"me",
".",
"pool",
".",
"push",
"(",
"block",
")",
";",
"me",
".",
"remaning",
"++",
";",
"// 如果没有分片,则直接使用原始的。",
"// 不会丢失conten... | 开始上传,可以被掉过。如果promise被reject了,则表示跳过此分片。 | [
"开始上传,可以被掉过。如果promise被reject了,则表示跳过此分片。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/_draft/music/webuploader.js#L5007-L5047 | train | send a file to the server | [
30522,
3853,
1006,
3796,
1007,
1063,
13075,
2033,
1027,
2023,
1010,
5371,
1027,
3796,
1012,
5371,
1010,
4872,
1025,
2033,
1012,
4770,
1012,
5245,
1006,
3796,
1007,
1025,
2033,
1012,
2128,
20799,
3070,
1009,
1009,
1025,
1013,
1013,
100,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/language/CSSUtils.js | extractAllNamedFlows | function extractAllNamedFlows(text) {
var namedFlowRegEx = /(?:flow\-(into|from)\:\s*)([\w\-]+)(?:\s*;)/gi,
result = [],
names = {},
thisMatch;
// Reduce the content so that matches
// inside strings and comments are ignored
text = reduceStyleSheetFor... | javascript | function extractAllNamedFlows(text) {
var namedFlowRegEx = /(?:flow\-(into|from)\:\s*)([\w\-]+)(?:\s*;)/gi,
result = [],
names = {},
thisMatch;
// Reduce the content so that matches
// inside strings and comments are ignored
text = reduceStyleSheetFor... | [
"function",
"extractAllNamedFlows",
"(",
"text",
")",
"{",
"var",
"namedFlowRegEx",
"=",
"/",
"(?:flow\\-(into|from)\\:\\s*)([\\w\\-]+)(?:\\s*;)",
"/",
"gi",
",",
"result",
"=",
"[",
"]",
",",
"names",
"=",
"{",
"}",
",",
"thisMatch",
";",
"// Reduce the content s... | Extracts all named flow instances
@param {!string} text to extract from
@return {Array.<string>} array of unique flow names found in the content (empty if none) | [
"Extracts",
"all",
"named",
"flow",
"instances"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L1729-L1753 | train | Extract all named flows from a text | [
30522,
3853,
14817,
8095,
18442,
20952,
8261,
2015,
1006,
3793,
1007,
1063,
13075,
2315,
12314,
2890,
3351,
2595,
1027,
1013,
1006,
1029,
1024,
4834,
1032,
1011,
1006,
2046,
1064,
2013,
1007,
1032,
1024,
1032,
1055,
1008,
1007,
1006,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ecomfe/zrender | src/core/util.js | function (cb, context) {
context !== void 0 && (cb = bind(cb, context));
for (var key in this.data) {
this.data.hasOwnProperty(key) && cb(this.data[key], key);
}
} | javascript | function (cb, context) {
context !== void 0 && (cb = bind(cb, context));
for (var key in this.data) {
this.data.hasOwnProperty(key) && cb(this.data[key], key);
}
} | [
"function",
"(",
"cb",
",",
"context",
")",
"{",
"context",
"!==",
"void",
"0",
"&&",
"(",
"cb",
"=",
"bind",
"(",
"cb",
",",
"context",
")",
")",
";",
"for",
"(",
"var",
"key",
"in",
"this",
".",
"data",
")",
"{",
"this",
".",
"data",
".",
"... | Although util.each can be performed on this hashMap directly, user should not use the exposed keys, who are prefixed. | [
"Although",
"util",
".",
"each",
"can",
"be",
"performed",
"on",
"this",
"hashMap",
"directly",
"user",
"should",
"not",
"use",
"the",
"exposed",
"keys",
"who",
"are",
"prefixed",
"."
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/core/util.js#L642-L647 | train | Returns the current language code | [
30522,
3853,
1006,
17324,
1010,
6123,
1007,
1063,
6123,
999,
1027,
1027,
11675,
1014,
1004,
1004,
1006,
17324,
1027,
14187,
1006,
17324,
1010,
6123,
1007,
1007,
1025,
2005,
1006,
13075,
3145,
1999,
2023,
1012,
2951,
1007,
1063,
2023,
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... | |
transloadit/uppy | packages/@uppy/companion/src/server/controllers/s3.js | completeMultipartUpload | function completeMultipartUpload (req, res, next) {
// @ts-ignore The `uppy` property is added by middleware before reaching here.
const client = req.uppy.s3Client
const { uploadId } = req.params
const { key } = req.query
const { parts } = req.body
if (typeof key !== 'string') {
return re... | javascript | function completeMultipartUpload (req, res, next) {
// @ts-ignore The `uppy` property is added by middleware before reaching here.
const client = req.uppy.s3Client
const { uploadId } = req.params
const { key } = req.query
const { parts } = req.body
if (typeof key !== 'string') {
return re... | [
"function",
"completeMultipartUpload",
"(",
"req",
",",
"res",
",",
"next",
")",
"{",
"// @ts-ignore The `uppy` property is added by middleware before reaching here.",
"const",
"client",
"=",
"req",
".",
"uppy",
".",
"s3Client",
"const",
"{",
"uploadId",
"}",
"=",
"re... | Complete a multipart upload, combining all the parts into a single object in the S3 bucket.
Expected URL parameters:
- uploadId - The uploadId returned from `createMultipartUpload`.
Expected query parameters:
- key - The object key in the S3 bucket.
Expected JSON body:
- parts - An array of parts, see the `getUploaded... | [
"Complete",
"a",
"multipart",
"upload",
"combining",
"all",
"the",
"parts",
"into",
"a",
"single",
"object",
"in",
"the",
"S3",
"bucket",
"."
] | 7ae18bf992d544a64da998f033258ec09a3de275 | https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/packages/@uppy/companion/src/server/controllers/s3.js#L239-L269 | train | Complete a multipart upload | [
30522,
3853,
3143,
12274,
7096,
11514,
8445,
6279,
11066,
1006,
2128,
4160,
1010,
24501,
1010,
2279,
1007,
1063,
1013,
1013,
1030,
24529,
1011,
8568,
1996,
1036,
2039,
7685,
1036,
3200,
2003,
2794,
2011,
2690,
8059,
2077,
4285,
2182,
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... |
GitbookIO/gitbook | lib/plugins/locateRootFolder.js | locateRootFolder | function locateRootFolder() {
var firstDefaultPlugin = DEFAULT_PLUGINS.first();
var pluginPath = resolve.sync(firstDefaultPlugin.getNpmID() + '/package.json', {
basedir: __dirname
});
var nodeModules = path.resolve(pluginPath, '../../..');
return nodeModules;
} | javascript | function locateRootFolder() {
var firstDefaultPlugin = DEFAULT_PLUGINS.first();
var pluginPath = resolve.sync(firstDefaultPlugin.getNpmID() + '/package.json', {
basedir: __dirname
});
var nodeModules = path.resolve(pluginPath, '../../..');
return nodeModules;
} | [
"function",
"locateRootFolder",
"(",
")",
"{",
"var",
"firstDefaultPlugin",
"=",
"DEFAULT_PLUGINS",
".",
"first",
"(",
")",
";",
"var",
"pluginPath",
"=",
"resolve",
".",
"sync",
"(",
"firstDefaultPlugin",
".",
"getNpmID",
"(",
")",
"+",
"'/package.json'",
","... | Resolve the root folder containing for node_modules
since gitbook can be used as a library and dependency can be flattened.
@return {String} folderPath | [
"Resolve",
"the",
"root",
"folder",
"containing",
"for",
"node_modules",
"since",
"gitbook",
"can",
"be",
"used",
"as",
"a",
"library",
"and",
"dependency",
"can",
"be",
"flattened",
"."
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/plugins/locateRootFolder.js#L12-L20 | train | Locates the root folder of the node_modules folder | [
30522,
3853,
12453,
3217,
4140,
10371,
2121,
1006,
1007,
1063,
13075,
2034,
3207,
7011,
11314,
24759,
15916,
2378,
1027,
12398,
1035,
13354,
7076,
1012,
2034,
1006,
1007,
1025,
13075,
13354,
2378,
15069,
1027,
10663,
1012,
26351,
1006,
2034,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(id) {
var self = this;
if (self._endTimers[id]) {
// Clear the timeout or remove the ended listener.
if (typeof self._endTimers[id] !== 'function') {
clearTimeout(self._endTimers[id]);
} else {
var sound = self._soundById(id);
if (sound && soun... | javascript | function(id) {
var self = this;
if (self._endTimers[id]) {
// Clear the timeout or remove the ended listener.
if (typeof self._endTimers[id] !== 'function') {
clearTimeout(self._endTimers[id]);
} else {
var sound = self._soundById(id);
if (sound && soun... | [
"function",
"(",
"id",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"self",
".",
"_endTimers",
"[",
"id",
"]",
")",
"{",
"// Clear the timeout or remove the ended listener.",
"if",
"(",
"typeof",
"self",
".",
"_endTimers",
"[",
"id",
"]",
"!==",
... | Clear the end timer for a sound playback.
@param {Number} id The sound ID.
@return {Howl} | [
"Clear",
"the",
"end",
"timer",
"for",
"a",
"sound",
"playback",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L1967-L1985 | train | Removes a timeout or a listener for a specific sound | [
30522,
3853,
1006,
8909,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2065,
1006,
2969,
1012,
1035,
2203,
7292,
2869,
1031,
8909,
1033,
1007,
1063,
1013,
1013,
3154,
1996,
2051,
5833,
2030,
6366,
1996,
3092,
19373,
1012,
2065,
1006,
2828,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aws/aws-sdk-js | features/extra/helpers.js | function(size) {
var match;
var buffer;
if (match = size.match(/(\d+)KB/)) {
buffer = new Buffer(parseInt(match[1]) * 1024);
} else if (match = size.match(/(\d+)MB/)) {
buffer = new Buffer(parseInt(match[1]) * 1024 * 1024);
} else {
switch (size) {
case 'empty': buffer = ne... | javascript | function(size) {
var match;
var buffer;
if (match = size.match(/(\d+)KB/)) {
buffer = new Buffer(parseInt(match[1]) * 1024);
} else if (match = size.match(/(\d+)MB/)) {
buffer = new Buffer(parseInt(match[1]) * 1024 * 1024);
} else {
switch (size) {
case 'empty': buffer = ne... | [
"function",
"(",
"size",
")",
"{",
"var",
"match",
";",
"var",
"buffer",
";",
"if",
"(",
"match",
"=",
"size",
".",
"match",
"(",
"/",
"(\\d+)KB",
"/",
")",
")",
"{",
"buffer",
"=",
"new",
"Buffer",
"(",
"parseInt",
"(",
"match",
"[",
"1",
"]",
... | Creates and returns a buffer of given size | [
"Creates",
"and",
"returns",
"a",
"buffer",
"of",
"given",
"size"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/helpers.js#L167-L184 | train | Returns a buffer of the specified size | [
30522,
3853,
1006,
2946,
1007,
1063,
13075,
2674,
1025,
13075,
17698,
1025,
2065,
1006,
2674,
1027,
2946,
1012,
2674,
1006,
1013,
1006,
1032,
1040,
1009,
1007,
21677,
1013,
1007,
1007,
1063,
17698,
1027,
2047,
17698,
1006,
11968,
20240,
337... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TableAccRenderExtension.js | function(oRm, oTable, oCreationRow) {
if (!oTable._getAccExtension().getAccMode()) {
return;
}
_writeAccText(oRm, oCreationRow.getId(), "label", TableUtils.getResourceText("TBL_CREATEROW_LABEL"));
} | javascript | function(oRm, oTable, oCreationRow) {
if (!oTable._getAccExtension().getAccMode()) {
return;
}
_writeAccText(oRm, oCreationRow.getId(), "label", TableUtils.getResourceText("TBL_CREATEROW_LABEL"));
} | [
"function",
"(",
"oRm",
",",
"oTable",
",",
"oCreationRow",
")",
"{",
"if",
"(",
"!",
"oTable",
".",
"_getAccExtension",
"(",
")",
".",
"getAccMode",
"(",
")",
")",
"{",
"return",
";",
"}",
"_writeAccText",
"(",
"oRm",
",",
"oCreationRow",
".",
"getId"... | Renders the hidden label for a creation row.
@param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the Render-Output-Buffer.
@param {sap.ui.table.Table} oTable Instance of the table.
@param {sap.ui.table.CreationRow} oCreationRow Instance of the creation row.
@see sap.ui.table.Creati... | [
"Renders",
"the",
"hidden",
"label",
"for",
"a",
"creation",
"row",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableAccRenderExtension.js#L223-L229 | train | Writes the label of the creation row. | [
30522,
3853,
1006,
2030,
2213,
1010,
27178,
3085,
1010,
1051,
16748,
3370,
10524,
1007,
1063,
2065,
1006,
999,
27178,
3085,
1012,
1035,
2131,
6305,
3401,
18413,
6132,
3258,
1006,
1007,
1012,
2131,
6305,
27487,
10244,
1006,
1007,
1007,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ColorlibHQ/AdminLTE | bower_components/jvectormap/lib/world-map.js | function(markers, seriesData){
var i;
seriesData = seriesData || [];
this.createMarkers(markers);
for (i = 0; i < seriesData.length; i++) {
this.series.markers[i].setValues(seriesData[i] || {});
};
} | javascript | function(markers, seriesData){
var i;
seriesData = seriesData || [];
this.createMarkers(markers);
for (i = 0; i < seriesData.length; i++) {
this.series.markers[i].setValues(seriesData[i] || {});
};
} | [
"function",
"(",
"markers",
",",
"seriesData",
")",
"{",
"var",
"i",
";",
"seriesData",
"=",
"seriesData",
"||",
"[",
"]",
";",
"this",
".",
"createMarkers",
"(",
"markers",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"seriesData",
".",
"le... | Add set of marker to the map.
@param {Object|Array} markers Markers to add to the map. In case of array is provided, codes of markers will be set as string representations of array indexes.
@param {Array} seriesData Values to add to the data series. | [
"Add",
"set",
"of",
"marker",
"to",
"the",
"map",
"."
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/jvectormap/lib/world-map.js#L777-L786 | train | set markers and series data | [
30522,
3853,
1006,
16387,
1010,
2186,
2850,
2696,
1007,
1063,
13075,
1045,
1025,
2186,
2850,
2696,
1027,
2186,
2850,
2696,
1064,
1064,
1031,
1033,
1025,
2023,
1012,
3443,
10665,
2545,
1006,
16387,
1007,
1025,
2005,
1006,
1045,
1027,
1014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
facebook/relay | packages/relay-compiler/core/isEquivalentType.js | isEquivalentType | function isEquivalentType(typeA: GraphQLType, typeB: GraphQLType): boolean {
// Easy short-circuit: equal types are equal.
if (typeA === typeB) {
return true;
}
// If either type is non-null, the other must also be non-null.
if (typeA instanceof GraphQLNonNull && typeB instanceof GraphQLNonNull) {
re... | javascript | function isEquivalentType(typeA: GraphQLType, typeB: GraphQLType): boolean {
// Easy short-circuit: equal types are equal.
if (typeA === typeB) {
return true;
}
// If either type is non-null, the other must also be non-null.
if (typeA instanceof GraphQLNonNull && typeB instanceof GraphQLNonNull) {
re... | [
"function",
"isEquivalentType",
"(",
"typeA",
":",
"GraphQLType",
",",
"typeB",
":",
"GraphQLType",
")",
":",
"boolean",
"{",
"// Easy short-circuit: equal types are equal.",
"if",
"(",
"typeA",
"===",
"typeB",
")",
"{",
"return",
"true",
";",
"}",
"// If either t... | Determine if a type is the same type (same name and class) as another type.
Needed if we're comparing IRs created at different times: we don't yet have
an IR schema, so the type we assign to an IR field could be !== than
what we assign to it after adding some schema definitions or extensions. | [
"Determine",
"if",
"a",
"type",
"is",
"the",
"same",
"type",
"(",
"same",
"name",
"and",
"class",
")",
"as",
"another",
"type",
".",
"Needed",
"if",
"we",
"re",
"comparing",
"IRs",
"created",
"at",
"different",
"times",
":",
"we",
"don",
"t",
"yet",
... | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/core/isEquivalentType.js#L24-L51 | train | Returns true if the two types are equivalent. | [
30522,
3853,
2003,
2063,
15549,
24879,
13874,
1006,
2828,
2050,
1024,
10629,
4160,
24228,
5051,
1010,
2828,
2497,
1024,
10629,
4160,
24228,
5051,
1007,
1024,
22017,
20898,
1063,
1013,
1013,
3733,
2460,
1011,
4984,
1024,
5020,
4127,
2024,
50... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 () {
var fullname = this.props.name;
var node = this.refs.name;
node.setSelectionRange(0, fullname.length);
node.focus(); // set focus on the rename input
ViewUtils.scrollElementIntoView($("#project-files-container"), $(node), true);
} | javascript | function () {
var fullname = this.props.name;
var node = this.refs.name;
node.setSelectionRange(0, fullname.length);
node.focus(); // set focus on the rename input
ViewUtils.scrollElementIntoView($("#project-files-container"), $(node), true);
} | [
"function",
"(",
")",
"{",
"var",
"fullname",
"=",
"this",
".",
"props",
".",
"name",
";",
"var",
"node",
"=",
"this",
".",
"refs",
".",
"name",
";",
"node",
".",
"setSelectionRange",
"(",
"0",
",",
"fullname",
".",
"length",
")",
";",
"node",
".",... | When this component is displayed, we scroll it into view and select the folder name. | [
"When",
"this",
"component",
"is",
"displayed",
"we",
"scroll",
"it",
"into",
"view",
"and",
"select",
"the",
"folder",
"name",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L717-L724 | train | renames the file | [
30522,
3853,
1006,
1007,
1063,
13075,
2440,
18442,
1027,
2023,
1012,
24387,
1012,
2171,
1025,
13075,
13045,
1027,
2023,
1012,
25416,
2015,
1012,
2171,
1025,
13045,
1012,
4520,
12260,
7542,
24388,
2063,
1006,
1014,
1010,
2440,
18442,
1012,
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... | |
angular/angular | aio/tools/transforms/angular-base-package/processors/generateKeywords.js | tokenize | function tokenize(text) {
const rawTokens = text.split(/[\s\/]+/mg);
const tokens = [];
rawTokens.forEach(token => {
// Strip off unwanted trivial characters
token = token
.trim()
.replace(/^[_\-"'`({[<$*)}\]>.]+/, '')
.replace(/[_\-"'`({[<$*)}\]>.]+$/, '');
// Ignore tokens th... | javascript | function tokenize(text) {
const rawTokens = text.split(/[\s\/]+/mg);
const tokens = [];
rawTokens.forEach(token => {
// Strip off unwanted trivial characters
token = token
.trim()
.replace(/^[_\-"'`({[<$*)}\]>.]+/, '')
.replace(/[_\-"'`({[<$*)}\]>.]+$/, '');
// Ignore tokens th... | [
"function",
"tokenize",
"(",
"text",
")",
"{",
"const",
"rawTokens",
"=",
"text",
".",
"split",
"(",
"/",
"[\\s\\/]+",
"/",
"mg",
")",
";",
"const",
"tokens",
"=",
"[",
"]",
";",
"rawTokens",
".",
"forEach",
"(",
"token",
"=>",
"{",
"// Strip off unwan... | If the heading contains a name starting with ng, e.g. "ngController", then add the name without the ng to the text, e.g. "controller". | [
"If",
"the",
"heading",
"contains",
"a",
"name",
"starting",
"with",
"ng",
"e",
".",
"g",
".",
"ngController",
"then",
"add",
"the",
"name",
"without",
"the",
"ng",
"to",
"the",
"text",
"e",
".",
"g",
".",
"controller",
"."
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/aio/tools/transforms/angular-base-package/processors/generateKeywords.js#L135-L154 | train | Split text into tokens | [
30522,
3853,
19204,
4697,
1006,
3793,
1007,
1063,
9530,
3367,
6315,
18715,
6132,
1027,
3793,
1012,
3975,
1006,
1013,
1031,
1032,
1055,
1032,
1013,
1033,
1009,
1013,
11460,
1007,
1025,
9530,
3367,
19204,
2015,
1027,
1031,
1033,
1025,
6315,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/delegate/ScrollEnablement.js | function(oIconTabBar, fnScrollEndCallback, fnScrollStartCallback) {
this._oIconTabBar = oIconTabBar;
this._fnScrollEndCallback = jQuery.proxy(fnScrollEndCallback, oIconTabBar);
this._fnScrollStartCallback = jQuery.proxy(fnScrollStartCallback, oIconTabBar);
return this;
} | javascript | function(oIconTabBar, fnScrollEndCallback, fnScrollStartCallback) {
this._oIconTabBar = oIconTabBar;
this._fnScrollEndCallback = jQuery.proxy(fnScrollEndCallback, oIconTabBar);
this._fnScrollStartCallback = jQuery.proxy(fnScrollStartCallback, oIconTabBar);
return this;
} | [
"function",
"(",
"oIconTabBar",
",",
"fnScrollEndCallback",
",",
"fnScrollStartCallback",
")",
"{",
"this",
".",
"_oIconTabBar",
"=",
"oIconTabBar",
";",
"this",
".",
"_fnScrollEndCallback",
"=",
"jQuery",
".",
"proxy",
"(",
"fnScrollEndCallback",
",",
"oIconTabBar"... | Sets IconTabBar control to scroll container
@param {sap.m.IconTabBar} oIconTabBar instance
@param {function} fnScrollEndCallback callback function for the scroll end event
@param {function} fnScrollStartCallback callback function for the scroll start event
@protected
@since 1.16.1 | [
"Sets",
"IconTabBar",
"control",
"to",
"scroll",
"container"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/delegate/ScrollEnablement.js#L174-L179 | train | Sets the IconTabBar instance and sets the scroll end and start callbacks | [
30522,
3853,
1006,
1051,
28524,
2696,
22414,
2099,
1010,
1042,
3619,
26775,
14511,
10497,
9289,
20850,
8684,
1010,
1042,
3619,
26775,
14511,
14117,
13535,
8095,
5963,
1007,
1063,
2023,
1012,
1035,
1051,
28524,
2696,
22414,
2099,
1027,
1051,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
openlayers/openlayers | src/ol/format/KML.js | writePlacemark | function writePlacemark(node, feature, objectStack) {
const /** @type {import("../xml.js").NodeStackItem} */ context = {node: node};
// set id
if (feature.getId()) {
node.setAttribute('id', /** @type {string} */ (feature.getId()));
}
// serialize properties (properties unknown to KML are not serialized)... | javascript | function writePlacemark(node, feature, objectStack) {
const /** @type {import("../xml.js").NodeStackItem} */ context = {node: node};
// set id
if (feature.getId()) {
node.setAttribute('id', /** @type {string} */ (feature.getId()));
}
// serialize properties (properties unknown to KML are not serialized)... | [
"function",
"writePlacemark",
"(",
"node",
",",
"feature",
",",
"objectStack",
")",
"{",
"const",
"/** @type {import(\"../xml.js\").NodeStackItem} */",
"context",
"=",
"{",
"node",
":",
"node",
"}",
";",
"// set id",
"if",
"(",
"feature",
".",
"getId",
"(",
")",... | FIXME currently we do serialize arbitrary/custom feature properties
(ExtendedData).
@param {Element} node Node.
@param {Feature} feature Feature.
@param {Array<*>} objectStack Object stack.
@this {KML} | [
"FIXME",
"currently",
"we",
"do",
"serialize",
"arbitrary",
"/",
"custom",
"feature",
"properties",
"(",
"ExtendedData",
")",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/format/KML.js#L2668-L2724 | train | Writes a placemark node | [
30522,
3853,
4339,
24759,
10732,
10665,
1006,
13045,
1010,
3444,
1010,
5200,
2696,
3600,
1007,
1063,
9530,
3367,
1013,
1008,
1008,
1030,
2828,
1063,
12324,
1006,
1000,
1012,
1012,
1013,
20950,
1012,
1046,
2015,
1000,
1007,
1012,
14164,
2696... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
elastic/elasticsearch-js | api/api/update.js | buildUpdate | function buildUpdate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [update](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html) request
*
* @param {string} id - Document ID
* ... | javascript | function buildUpdate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [update](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html) request
*
* @param {string} id - Document ID
* ... | [
"function",
"buildUpdate",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [update](http://www.elastic.co/guide/en/elast... | /* eslint camelcase: 0 /* eslint no-unused-vars: 0 | [
"/",
"*",
"eslint",
"camelcase",
":",
"0",
"/",
"*",
"eslint",
"no",
"-",
"unused",
"-",
"vars",
":",
"0"
] | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/api/update.js#L25-L144 | train | Build an update operation. | [
30522,
3853,
3857,
6279,
13701,
1006,
23569,
2015,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
30524,
1033,
1006,
8299,
1024,
1013,
1013,
7479,
1012,
21274,
1012,
2522,
1013,
5009,
1013,
4372,
1013,
21274,
17310,
1114... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
codemirror/CodeMirror | src/model/history.js | removeClearedSpans | function removeClearedSpans(spans) {
if (!spans) return null
let out
for (let i = 0; i < spans.length; ++i) {
if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i) }
else if (out) out.push(spans[i])
}
return !out ? spans : out.length ? out : null
} | javascript | function removeClearedSpans(spans) {
if (!spans) return null
let out
for (let i = 0; i < spans.length; ++i) {
if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i) }
else if (out) out.push(spans[i])
}
return !out ? spans : out.length ? out : null
} | [
"function",
"removeClearedSpans",
"(",
"spans",
")",
"{",
"if",
"(",
"!",
"spans",
")",
"return",
"null",
"let",
"out",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"spans",
".",
"length",
";",
"++",
"i",
")",
"{",
"if",
"(",
"spans",
"[",
... | When un/re-doing restores text containing marked spans, those that have been explicitly cleared should not be restored. | [
"When",
"un",
"/",
"re",
"-",
"doing",
"restores",
"text",
"containing",
"marked",
"spans",
"those",
"that",
"have",
"been",
"explicitly",
"cleared",
"should",
"not",
"be",
"restored",
"."
] | dab6f676107c10ba8d16c654a42f66cae3f27db1 | https://github.com/codemirror/CodeMirror/blob/dab6f676107c10ba8d16c654a42f66cae3f27db1/src/model/history.js#L158-L166 | train | Remove any previously cleared spans | [
30522,
3853,
6366,
14321,
12069,
5104,
9739,
2015,
1006,
14798,
1007,
1063,
2065,
1006,
999,
14798,
1007,
2709,
19701,
2292,
2041,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026,
14798,
1012,
3091,
1025,
1009,
1009,
1045,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/util/source-code.js | validate | function validate(ast) {
if (!ast.tokens) {
throw new Error("AST is missing the tokens array.");
}
if (!ast.comments) {
throw new Error("AST is missing the comments array.");
}
if (!ast.loc) {
throw new Error("AST is missing location information.");
}
if (!ast.rang... | javascript | function validate(ast) {
if (!ast.tokens) {
throw new Error("AST is missing the tokens array.");
}
if (!ast.comments) {
throw new Error("AST is missing the comments array.");
}
if (!ast.loc) {
throw new Error("AST is missing location information.");
}
if (!ast.rang... | [
"function",
"validate",
"(",
"ast",
")",
"{",
"if",
"(",
"!",
"ast",
".",
"tokens",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"AST is missing the tokens array.\"",
")",
";",
"}",
"if",
"(",
"!",
"ast",
".",
"comments",
")",
"{",
"throw",
"new",
"Error"... | ------------------------------------------------------------------------------ Private ------------------------------------------------------------------------------
Validates that the given AST has the required information.
@param {ASTNode} ast The Program node of the AST to check.
@throws {Error} If the AST doesn't ... | [
"------------------------------------------------------------------------------",
"Private",
"------------------------------------------------------------------------------",
"Validates",
"that",
"the",
"given",
"AST",
"has",
"the",
"required",
"information",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/source-code.js#L27-L43 | train | Validate the AST | [
30522,
3853,
9398,
3686,
1006,
2004,
2102,
1007,
1063,
2065,
1006,
999,
2004,
2102,
1012,
19204,
2015,
1007,
1063,
5466,
2047,
7561,
1006,
1000,
2004,
2102,
2003,
4394,
1996,
19204,
2015,
9140,
1012,
1000,
1007,
1025,
1065,
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... |
feathericons/feather | src/icon.js | attrsToString | function attrsToString(attrs) {
return Object.keys(attrs)
.map(key => `${key}="${attrs[key]}"`)
.join(' ');
} | javascript | function attrsToString(attrs) {
return Object.keys(attrs)
.map(key => `${key}="${attrs[key]}"`)
.join(' ');
} | [
"function",
"attrsToString",
"(",
"attrs",
")",
"{",
"return",
"Object",
".",
"keys",
"(",
"attrs",
")",
".",
"map",
"(",
"key",
"=>",
"`",
"${",
"key",
"}",
"${",
"attrs",
"[",
"key",
"]",
"}",
"`",
")",
".",
"join",
"(",
"' '",
")",
";",
"}"
... | Convert attributes object to string of HTML attributes.
@param {Object} attrs
@returns {string} | [
"Convert",
"attributes",
"object",
"to",
"string",
"of",
"HTML",
"attributes",
"."
] | 8f658193d25e943b196a2367319b5d9e85ee9f9f | https://github.com/feathericons/feather/blob/8f658193d25e943b196a2367319b5d9e85ee9f9f/src/icon.js#L49-L53 | train | Convert an object to a string | [
30522,
3853,
2012,
16344,
16033,
3367,
4892,
1006,
2012,
16344,
2015,
1007,
1063,
2709,
4874,
1012,
6309,
1006,
2012,
16344,
2015,
1007,
1012,
4949,
1006,
3145,
1027,
1028,
1036,
1002,
1063,
3145,
1065,
1027,
1000,
1002,
1063,
2012,
16344,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensibility/Package.js | install | function install(path, nameHint, _doUpdate) {
return _extensionManagerCall(function (extensionManager) {
var d = new $.Deferred(),
destinationDirectory = ExtensionLoader.getUserExtensionPath(),
disabledDirectory = destinationDirectory.re... | javascript | function install(path, nameHint, _doUpdate) {
return _extensionManagerCall(function (extensionManager) {
var d = new $.Deferred(),
destinationDirectory = ExtensionLoader.getUserExtensionPath(),
disabledDirectory = destinationDirectory.re... | [
"function",
"install",
"(",
"path",
",",
"nameHint",
",",
"_doUpdate",
")",
"{",
"return",
"_extensionManagerCall",
"(",
"function",
"(",
"extensionManager",
")",
"{",
"var",
"d",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"destinationDirectory",
"=",
... | Validates and installs the package at the given path. Validation and
installation is handled by the Node process.
The extension will be installed into the user's extensions directory.
If the user already has the extension installed, it will instead go
into their disabled extensions directory.
The promise is resolved ... | [
"Validates",
"and",
"installs",
"the",
"package",
"at",
"the",
"given",
"path",
".",
"Validation",
"and",
"installation",
"is",
"handled",
"by",
"the",
"Node",
"process",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/Package.js#L158-L198 | train | Installs the extension | [
30522,
3853,
16500,
1006,
4130,
1010,
2171,
10606,
2102,
1010,
1035,
2079,
6279,
13701,
1007,
1063,
2709,
1035,
5331,
24805,
4590,
9289,
2140,
1006,
3853,
1006,
5331,
24805,
4590,
1007,
1063,
13075,
1040,
1027,
2047,
1002,
1012,
13366,
2884... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/rpc-server.js | function (sender, frameId, contextId, args) {
const metaToValue = function (meta) {
switch (meta.type) {
case 'value':
return meta.value
case 'remote-object':
return objectsRegistry.get(meta.id)
case 'array':
return unwrapArgs(sender, frameId, contextId, meta.value)
... | javascript | function (sender, frameId, contextId, args) {
const metaToValue = function (meta) {
switch (meta.type) {
case 'value':
return meta.value
case 'remote-object':
return objectsRegistry.get(meta.id)
case 'array':
return unwrapArgs(sender, frameId, contextId, meta.value)
... | [
"function",
"(",
"sender",
",",
"frameId",
",",
"contextId",
",",
"args",
")",
"{",
"const",
"metaToValue",
"=",
"function",
"(",
"meta",
")",
"{",
"switch",
"(",
"meta",
".",
"type",
")",
"{",
"case",
"'value'",
":",
"return",
"meta",
".",
"value",
... | Convert array of meta data from renderer into array of real values. | [
"Convert",
"array",
"of",
"meta",
"data",
"from",
"renderer",
"into",
"array",
"of",
"real",
"values",
"."
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/rpc-server.js#L183-L245 | train | Returns the value of the given meta | [
30522,
3853,
1006,
4604,
2121,
1010,
4853,
3593,
1010,
6123,
3593,
1010,
12098,
5620,
1007,
30524,
1012,
3643,
2553,
1005,
6556,
1011,
4874,
1005,
1024,
2709,
5200,
2890,
24063,
2854,
1012,
2131,
1006,
18804,
1012,
8909,
1007,
2553,
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... | |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/Entity.controller.js | function (sId, oDoc, oEntity, oControlsData) {
// convert docu
var oData = this._convertEntityInfo(sId, oDoc, oControlsData),
bShouldShowSamplesSection = false,
iSamplesCount = 0;
oData.show.introLink = false;
if (oEntity) {
// show the description as intro text if the entity is not d... | javascript | function (sId, oDoc, oEntity, oControlsData) {
// convert docu
var oData = this._convertEntityInfo(sId, oDoc, oControlsData),
bShouldShowSamplesSection = false,
iSamplesCount = 0;
oData.show.introLink = false;
if (oEntity) {
// show the description as intro text if the entity is not d... | [
"function",
"(",
"sId",
",",
"oDoc",
",",
"oEntity",
",",
"oControlsData",
")",
"{",
"// convert docu",
"var",
"oData",
"=",
"this",
".",
"_convertEntityInfo",
"(",
"sId",
",",
"oDoc",
",",
"oControlsData",
")",
",",
"bShouldShowSamplesSection",
"=",
"false",
... | ========= internal =========================================================================== | [
"=========",
"internal",
"==========================================================================="
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/Entity.controller.js#L217-L267 | train | Converts the given entity to a data structure | [
30522,
3853,
1006,
15765,
1010,
1051,
3527,
2278,
1010,
1051,
4765,
3012,
1010,
1051,
8663,
13181,
4877,
2850,
2696,
1007,
1063,
1013,
1013,
10463,
9986,
2226,
13075,
1051,
2850,
2696,
1027,
2023,
1012,
1035,
10463,
4765,
3012,
2378,
14876,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ColorlibHQ/AdminLTE | bower_components/raphael/dev/raphael.core.js | function (items) {
this.items = [];
this.length = 0;
this.type = "set";
if (items) {
for (var i = 0, ii = items.length; i < ii; i++) {
if (items[i] && (items[i].constructor == elproto.constructor || items[i].constructor == Set)) {
this[this... | javascript | function (items) {
this.items = [];
this.length = 0;
this.type = "set";
if (items) {
for (var i = 0, ii = items.length; i < ii; i++) {
if (items[i] && (items[i].constructor == elproto.constructor || items[i].constructor == Set)) {
this[this... | [
"function",
"(",
"items",
")",
"{",
"this",
".",
"items",
"=",
"[",
"]",
";",
"this",
".",
"length",
"=",
"0",
";",
"this",
".",
"type",
"=",
"\"set\"",
";",
"if",
"(",
"items",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"ii",
"=",
"i... | Set | [
"Set"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/raphael/dev/raphael.core.js#L4806-L4818 | train | A set of | [
30522,
3853,
1006,
5167,
1007,
1063,
2023,
1012,
5167,
1027,
1031,
1033,
1025,
2023,
1012,
3091,
1027,
1014,
1025,
2023,
1012,
2828,
1027,
1000,
2275,
1000,
1025,
2065,
1006,
5167,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
1014,
1010,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | dangerfile.js | createComparisonFilter | function createComparisonFilter(parsedThreshold, gzipThreshold) {
return comparisonEntry => {
const [, snapshot] = comparisonEntry;
return (
Math.abs(snapshot.parsed.absoluteDiff) >= parsedThreshold ||
Math.abs(snapshot.gzip.absoluteDiff) >= gzipThreshold
);
};
} | javascript | function createComparisonFilter(parsedThreshold, gzipThreshold) {
return comparisonEntry => {
const [, snapshot] = comparisonEntry;
return (
Math.abs(snapshot.parsed.absoluteDiff) >= parsedThreshold ||
Math.abs(snapshot.gzip.absoluteDiff) >= gzipThreshold
);
};
} | [
"function",
"createComparisonFilter",
"(",
"parsedThreshold",
",",
"gzipThreshold",
")",
"{",
"return",
"comparisonEntry",
"=>",
"{",
"const",
"[",
",",
"snapshot",
"]",
"=",
"comparisonEntry",
";",
"return",
"(",
"Math",
".",
"abs",
"(",
"snapshot",
".",
"par... | creates a callback for Object.entries(comparison).filter that excludes every
entry that does not exceed the given threshold values for parsed and gzip size
@param {number} parsedThreshold
@param {number} gzipThreshold | [
"creates",
"a",
"callback",
"for",
"Object",
".",
"entries",
"(",
"comparison",
")",
".",
"filter",
"that",
"excludes",
"every",
"entry",
"that",
"does",
"not",
"exceed",
"the",
"given",
"threshold",
"values",
"for",
"parsed",
"and",
"gzip",
"size"
] | 1555e52367835946382fbf2a8f681de71318915d | https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/dangerfile.js#L45-L53 | train | Creates a filter function that checks if a file is compressed or not. | [
30522,
3853,
3443,
9006,
19362,
10929,
8873,
21928,
1006,
11968,
6924,
2705,
21898,
11614,
1010,
1043,
5831,
13876,
28362,
22231,
6392,
1007,
1063,
2709,
7831,
4765,
2854,
1027,
1028,
1063,
9530,
3367,
1031,
1010,
20057,
12326,
1033,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/dialog/dialog.js | lockScreenReader | function lockScreenReader(element, options) {
var isHidden = true;
// get raw DOM node
walkDOM(element[0]);
options.unlockScreenReader = function () {
isHidden = false;
walkDOM(element[0]);
options.unlockScreenReader = null;
};
/**
* Get all of an e... | javascript | function lockScreenReader(element, options) {
var isHidden = true;
// get raw DOM node
walkDOM(element[0]);
options.unlockScreenReader = function () {
isHidden = false;
walkDOM(element[0]);
options.unlockScreenReader = null;
};
/**
* Get all of an e... | [
"function",
"lockScreenReader",
"(",
"element",
",",
"options",
")",
"{",
"var",
"isHidden",
"=",
"true",
";",
"// get raw DOM node",
"walkDOM",
"(",
"element",
"[",
"0",
"]",
")",
";",
"options",
".",
"unlockScreenReader",
"=",
"function",
"(",
")",
"{",
... | Prevents screen reader interaction behind modal window
on swipe interfaces | [
"Prevents",
"screen",
"reader",
"interaction",
"behind",
"modal",
"window",
"on",
"swipe",
"interfaces"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1142-L1190 | train | Lock screen reader | [
30522,
3853,
11223,
24410,
16416,
4063,
1006,
5783,
1010,
7047,
1007,
1063,
13075,
2003,
27511,
4181,
1027,
2995,
1025,
1013,
1013,
2131,
6315,
14383,
13045,
3328,
9527,
1006,
5783,
1031,
1014,
1033,
1007,
1025,
7047,
1012,
19829,
18182,
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.fl/src/sap/ui/fl/variants/VariantManagement.js | function(oRm, oControl) {
oRm.write("<div ");
oRm.writeControlData(oControl);
oRm.addClass("sapUiFlVarMngmt");
oRm.writeClasses();
oRm.write(">");
oRm.renderControl(oControl.oVariantLayout);
oRm.write("</div>");
} | javascript | function(oRm, oControl) {
oRm.write("<div ");
oRm.writeControlData(oControl);
oRm.addClass("sapUiFlVarMngmt");
oRm.writeClasses();
oRm.write(">");
oRm.renderControl(oControl.oVariantLayout);
oRm.write("</div>");
} | [
"function",
"(",
"oRm",
",",
"oControl",
")",
"{",
"oRm",
".",
"write",
"(",
"\"<div \"",
")",
";",
"oRm",
".",
"writeControlData",
"(",
"oControl",
")",
";",
"oRm",
".",
"addClass",
"(",
"\"sapUiFlVarMngmt\"",
")",
";",
"oRm",
".",
"writeClasses",
"(",
... | Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
@param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the render output buffer
@param {sap.ui.core.Control} oControl an object representation of the control that should be rendered | [
"Renders",
"the",
"HTML",
"for",
"the",
"given",
"control",
"using",
"the",
"provided",
"{"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/variants/VariantManagement.js#L208-L218 | train | Renders the variant layout | [
30522,
3853,
1006,
2030,
2213,
1010,
1051,
8663,
13181,
2140,
1007,
1063,
2030,
2213,
1012,
4339,
1006,
1000,
1026,
4487,
2615,
1000,
1007,
1025,
2030,
2213,
1012,
4339,
8663,
13181,
15150,
2696,
1006,
1051,
8663,
13181,
2140,
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... | |
apache/incubator-echarts | src/chart/tree/layoutHelper.js | nextAncestor | function nextAncestor(nodeInLeft, node, ancestor) {
return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode
? nodeInLeft.hierNode.ancestor : ancestor;
} | javascript | function nextAncestor(nodeInLeft, node, ancestor) {
return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode
? nodeInLeft.hierNode.ancestor : ancestor;
} | [
"function",
"nextAncestor",
"(",
"nodeInLeft",
",",
"node",
",",
"ancestor",
")",
"{",
"return",
"nodeInLeft",
".",
"hierNode",
".",
"ancestor",
".",
"parentNode",
"===",
"node",
".",
"parentNode",
"?",
"nodeInLeft",
".",
"hierNode",
".",
"ancestor",
":",
"a... | If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor.
Otherwise, returns the specified ancestor.
@param {module:echarts/data/Tree~TreeNode} nodeInLeft
@param {module:echarts/data/Tree~TreeNode} node
@param {module:echarts/data/Tree~TreeNode} ancestor
@return {module:echarts/data/Tree~TreeNod... | [
"If",
"nodeInLeft’s",
"ancestor",
"is",
"a",
"sibling",
"of",
"node",
"returns",
"nodeInLeft’s",
"ancestor",
".",
"Otherwise",
"returns",
"the",
"specified",
"ancestor",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/tree/layoutHelper.js#L297-L300 | train | Returns the next ancestor of node in left | [
30522,
3853,
2279,
26755,
4263,
1006,
13045,
2378,
2571,
6199,
1010,
13045,
1010,
13032,
1007,
1063,
2709,
13045,
2378,
2571,
6199,
1012,
7632,
11795,
10244,
1012,
13032,
1012,
6687,
3630,
3207,
1027,
1027,
1027,
13045,
1012,
6687,
3630,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/context/ContextManager.js | function(aContextObjects, aDesignTimeContextIdsByUrl) {
var aActiveContexts = [];
aContextObjects.forEach(function (oContext) {
var bContextActive = ((aDesignTimeContextIdsByUrl ? Array.prototype.indexOf.call(aDesignTimeContextIdsByUrl, oContext.id) : -1)) !== -1;
if (bContextActive) {
aActiveConte... | javascript | function(aContextObjects, aDesignTimeContextIdsByUrl) {
var aActiveContexts = [];
aContextObjects.forEach(function (oContext) {
var bContextActive = ((aDesignTimeContextIdsByUrl ? Array.prototype.indexOf.call(aDesignTimeContextIdsByUrl, oContext.id) : -1)) !== -1;
if (bContextActive) {
aActiveConte... | [
"function",
"(",
"aContextObjects",
",",
"aDesignTimeContextIdsByUrl",
")",
"{",
"var",
"aActiveContexts",
"=",
"[",
"]",
";",
"aContextObjects",
".",
"forEach",
"(",
"function",
"(",
"oContext",
")",
"{",
"var",
"bContextActive",
"=",
"(",
"(",
"aDesignTimeCont... | Function to filter all contexts by the context URL parameters.
@param {string[]} aDesignTimeContextIdsByUrl - list of ids passed via URL
@param {object[]} aContextObjects - context objects within the application
@returns {string[]} aActiveContexts - id list of all active contexts | [
"Function",
"to",
"filter",
"all",
"contexts",
"by",
"the",
"context",
"URL",
"parameters",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/context/ContextManager.js#L120-L132 | train | Returns an array of context ids that are active in the given design time context objects | [
30522,
3853,
1006,
9353,
28040,
30524,
18209,
9821,
3762,
3126,
2140,
1007,
1063,
13075,
9779,
15277,
8663,
18209,
2015,
1027,
1031,
1033,
1025,
9353,
28040,
18413,
16429,
20614,
2015,
1012,
18921,
6776,
1006,
3853,
1006,
1051,
8663,
18209,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/command/KeyBindingManager.js | _quitAltGrMode | function _quitAltGrMode() {
_enabled = true;
_ctrlDown = CtrlDownStates.NOT_YET_DETECTED;
_altGrDown = false;
_lastTimeStamp = null;
_lastKeyIdentifier = null;
$(window).off("keyup", _onCtrlUp);
} | javascript | function _quitAltGrMode() {
_enabled = true;
_ctrlDown = CtrlDownStates.NOT_YET_DETECTED;
_altGrDown = false;
_lastTimeStamp = null;
_lastKeyIdentifier = null;
$(window).off("keyup", _onCtrlUp);
} | [
"function",
"_quitAltGrMode",
"(",
")",
"{",
"_enabled",
"=",
"true",
";",
"_ctrlDown",
"=",
"CtrlDownStates",
".",
"NOT_YET_DETECTED",
";",
"_altGrDown",
"=",
"false",
";",
"_lastTimeStamp",
"=",
"null",
";",
"_lastKeyIdentifier",
"=",
"null",
";",
"$",
"(",
... | @private
Resets all the flags and removes _onCtrlUp event listener. | [
"@private",
"Resets",
"all",
"the",
"flags",
"and",
"removes",
"_onCtrlUp",
"event",
"listener",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L200-L207 | train | Quit AltGr mode | [
30522,
3853,
1035,
8046,
2389,
2102,
16523,
5302,
3207,
1006,
1007,
1063,
1035,
9124,
1027,
2995,
1025,
1035,
14931,
12190,
7698,
1027,
14931,
12190,
7698,
9153,
4570,
1012,
2025,
1035,
2664,
1035,
11156,
1025,
1035,
12456,
16523,
7698,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/samples/InlineImageViewer/main.js | _getStringAtPos | function _getStringAtPos(hostEditor, pos) {
var token = hostEditor._codeMirror.getTokenAt(pos, true);
// If the pos is at the beginning of a name, token will be the
// preceding whitespace or dot. In that case, try the next pos.
if (!/\S/.test(token.string) || token.string === ".") {
... | javascript | function _getStringAtPos(hostEditor, pos) {
var token = hostEditor._codeMirror.getTokenAt(pos, true);
// If the pos is at the beginning of a name, token will be the
// preceding whitespace or dot. In that case, try the next pos.
if (!/\S/.test(token.string) || token.string === ".") {
... | [
"function",
"_getStringAtPos",
"(",
"hostEditor",
",",
"pos",
")",
"{",
"var",
"token",
"=",
"hostEditor",
".",
"_codeMirror",
".",
"getTokenAt",
"(",
"pos",
",",
"true",
")",
";",
"// If the pos is at the beginning of a name, token will be the",
"// preceding whitespac... | Return the token string that is at the specified position.
@param hostEditor {!Editor} editor
@param {!{line:Number, ch:Number}} pos
@return {String} token string at the specified position | [
"Return",
"the",
"token",
"string",
"that",
"is",
"at",
"the",
"specified",
"position",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/samples/InlineImageViewer/main.js#L44-L84 | train | Get the string at pos | [
30522,
3853,
1035,
4152,
18886,
13807,
25856,
2891,
1006,
4354,
15660,
1010,
13433,
2015,
1007,
1063,
13075,
19204,
1027,
4354,
15660,
1012,
1035,
3642,
14503,
29165,
1012,
2131,
18715,
8189,
2102,
1006,
13433,
2015,
1010,
2995,
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... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableKeyboardExtension.js | function(oExtension) {
var oTable = oExtension.getTable();
var $Table = oTable.$();
var iColumnCount = TableUtils.getVisibleColumnCount(oTable);
var iTotalColumnCount = iColumnCount;
var bHasRowHeader = TableUtils.hasRowHeader(oTable);
var bHasRowActions = TableUtils.hasRowActions(oTable);
var bHas... | javascript | function(oExtension) {
var oTable = oExtension.getTable();
var $Table = oTable.$();
var iColumnCount = TableUtils.getVisibleColumnCount(oTable);
var iTotalColumnCount = iColumnCount;
var bHasRowHeader = TableUtils.hasRowHeader(oTable);
var bHasRowActions = TableUtils.hasRowActions(oTable);
var bHas... | [
"function",
"(",
"oExtension",
")",
"{",
"var",
"oTable",
"=",
"oExtension",
".",
"getTable",
"(",
")",
";",
"var",
"$Table",
"=",
"oTable",
".",
"$",
"(",
")",
";",
"var",
"iColumnCount",
"=",
"TableUtils",
".",
"getVisibleColumnCount",
"(",
"oTable",
"... | /*
Initialize ItemNavigations (content and header) and transfer relevant dom elements.
TabIndexes are set by the ItemNavigation. | [
"/",
"*",
"Initialize",
"ItemNavigations",
"(",
"content",
"and",
"header",
")",
"and",
"transfer",
"relevant",
"dom",
"elements",
".",
"TabIndexes",
"are",
"set",
"by",
"the",
"ItemNavigation",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableKeyboardExtension.js#L153-L261 | train | Creates the dom refs for the items in the table that are not fixed | [
30522,
3853,
1006,
1051,
10288,
29048,
1007,
1063,
13075,
27178,
3085,
1027,
1051,
10288,
29048,
1012,
2131,
10880,
1006,
1007,
1025,
13075,
1002,
2795,
1027,
27178,
3085,
1012,
1002,
1006,
1007,
1025,
13075,
24582,
4747,
2819,
15305,
16671,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onChangeEmail | function onChangeEmail() {
var email = $('#changed-email').val();
activeUser().updateEmail(email).then(function() {
refreshUserData();
alertSuccess('Email changed!');
}, onAuthError);
} | javascript | function onChangeEmail() {
var email = $('#changed-email').val();
activeUser().updateEmail(email).then(function() {
refreshUserData();
alertSuccess('Email changed!');
}, onAuthError);
} | [
"function",
"onChangeEmail",
"(",
")",
"{",
"var",
"email",
"=",
"$",
"(",
"'#changed-email'",
")",
".",
"val",
"(",
")",
";",
"activeUser",
"(",
")",
".",
"updateEmail",
"(",
"email",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"refreshUserData"... | Changes the user's email. | [
"Changes",
"the",
"user",
"s",
"email",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L601-L607 | train | Change email | [
30522,
3853,
2006,
22305,
21564,
12502,
1006,
1007,
1063,
13075,
10373,
1027,
1002,
1006,
1005,
1001,
2904,
1011,
10373,
1005,
1007,
1012,
11748,
1006,
1007,
1025,
3161,
20330,
1006,
1007,
1012,
10651,
14545,
4014,
1006,
10373,
1007,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
grpc/grpc | examples/node/dynamic_codegen/route_guide/route_guide_client.js | runRecordRoute | function runRecordRoute(callback) {
var argv = parseArgs(process.argv, {
string: 'db_path'
});
fs.readFile(path.resolve(argv.db_path), function(err, data) {
if (err) {
callback(err);
return;
}
var feature_list = JSON.parse(data);
var num_points = 10;
var call = client.recordRo... | javascript | function runRecordRoute(callback) {
var argv = parseArgs(process.argv, {
string: 'db_path'
});
fs.readFile(path.resolve(argv.db_path), function(err, data) {
if (err) {
callback(err);
return;
}
var feature_list = JSON.parse(data);
var num_points = 10;
var call = client.recordRo... | [
"function",
"runRecordRoute",
"(",
"callback",
")",
"{",
"var",
"argv",
"=",
"parseArgs",
"(",
"process",
".",
"argv",
",",
"{",
"string",
":",
"'db_path'",
"}",
")",
";",
"fs",
".",
"readFile",
"(",
"path",
".",
"resolve",
"(",
"argv",
".",
"db_path",... | Run the recordRoute demo. Sends several randomly chosen points from the
pre-generated feature database with a variable delay in between. Prints the
statistics when they are sent from the server.
@param {function} callback Called when this demo is complete | [
"Run",
"the",
"recordRoute",
"demo",
".",
"Sends",
"several",
"randomly",
"chosen",
"points",
"from",
"the",
"pre",
"-",
"generated",
"feature",
"database",
"with",
"a",
"variable",
"delay",
"in",
"between",
".",
"Prints",
"the",
"statistics",
"when",
"they",
... | cc75d93818410e2b0edd0fa3009a6def9ac403ca | https://github.com/grpc/grpc/blob/cc75d93818410e2b0edd0fa3009a6def9ac403ca/examples/node/dynamic_codegen/route_guide/route_guide_client.js#L110-L165 | train | Runs the record route | [
30522,
3853,
2448,
2890,
27108,
22196,
10421,
1006,
2655,
5963,
1007,
1063,
13075,
12098,
2290,
2615,
1027,
11968,
17310,
10623,
2015,
1006,
2832,
1012,
12098,
2290,
2615,
1010,
1063,
5164,
1024,
1005,
16962,
1035,
4130,
1005,
1065,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | src/controllers/controller.bar.js | function(last) {
var me = this;
var chart = me.chart;
var scale = me._getIndexScale();
var stacked = scale.options.stacked;
var ilen = last === undefined ? chart.data.datasets.length : last + 1;
var stacks = [];
var i, meta;
for (i = 0; i < ilen; ++i) {
meta = chart.getDatasetMeta(i);
if (meta.ba... | javascript | function(last) {
var me = this;
var chart = me.chart;
var scale = me._getIndexScale();
var stacked = scale.options.stacked;
var ilen = last === undefined ? chart.data.datasets.length : last + 1;
var stacks = [];
var i, meta;
for (i = 0; i < ilen; ++i) {
meta = chart.getDatasetMeta(i);
if (meta.ba... | [
"function",
"(",
"last",
")",
"{",
"var",
"me",
"=",
"this",
";",
"var",
"chart",
"=",
"me",
".",
"chart",
";",
"var",
"scale",
"=",
"me",
".",
"_getIndexScale",
"(",
")",
";",
"var",
"stacked",
"=",
"scale",
".",
"options",
".",
"stacked",
";",
... | Returns the stacks based on groups and bar visibility.
@param {number} [last] - The dataset index
@returns {string[]} The list of stack IDs
@private | [
"Returns",
"the",
"stacks",
"based",
"on",
"groups",
"and",
"bar",
"visibility",
"."
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/controllers/controller.bar.js#L197-L217 | train | Returns the stack for the last dataset | [
30522,
3853,
1006,
2197,
1007,
1063,
13075,
2033,
1027,
2023,
1025,
13075,
3673,
1027,
2033,
1012,
3673,
1025,
13075,
4094,
1027,
2033,
1012,
1035,
2131,
22254,
10288,
15782,
2571,
1006,
1007,
1025,
13075,
16934,
1027,
4094,
1012,
7047,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function() {
if (this._bIsUpdatable != null) {
return this._bIsUpdatable;
}
var oUpdatablePropertyNameSet = this._oQueryResult.getEntitySet().getUpdatablePropertyNameSet();
return (oUpdatablePropertyNameSet[this.getName()] != undefined);
} | javascript | function() {
if (this._bIsUpdatable != null) {
return this._bIsUpdatable;
}
var oUpdatablePropertyNameSet = this._oQueryResult.getEntitySet().getUpdatablePropertyNameSet();
return (oUpdatablePropertyNameSet[this.getName()] != undefined);
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_bIsUpdatable",
"!=",
"null",
")",
"{",
"return",
"this",
".",
"_bIsUpdatable",
";",
"}",
"var",
"oUpdatablePropertyNameSet",
"=",
"this",
".",
"_oQueryResult",
".",
"getEntitySet",
"(",
")",
".",
"getUpd... | Get indicator whether or not the measure is updatable
@returns {boolean} True iff the measure is updatable
@public
@function
@name sap.ui.model.analytics.odata4analytics.Measure#isUpdatable | [
"Get",
"indicator",
"whether",
"or",
"not",
"the",
"measure",
"is",
"updatable"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L2211-L2218 | train | Returns true if the query result is updatable. | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
20377,
6279,
2850,
10880,
999,
1027,
19701,
1007,
1063,
2709,
2023,
1012,
1035,
20377,
6279,
2850,
10880,
1025,
1065,
13075,
15068,
17299,
27892,
21572,
4842,
25680,
14074,
13462,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.ux3/src/sap/ui/ux3/Exact.js | function(oThis, oEvent){
oThis.fireRefineSearch({
query: oThis._sSearchQuery,
changedAttribute: oEvent.getParameter("attribute"),
allSelectedAttributes: oEvent.getParameter("allAttributes")
});
} | javascript | function(oThis, oEvent){
oThis.fireRefineSearch({
query: oThis._sSearchQuery,
changedAttribute: oEvent.getParameter("attribute"),
allSelectedAttributes: oEvent.getParameter("allAttributes")
});
} | [
"function",
"(",
"oThis",
",",
"oEvent",
")",
"{",
"oThis",
".",
"fireRefineSearch",
"(",
"{",
"query",
":",
"oThis",
".",
"_sSearchQuery",
",",
"changedAttribute",
":",
"oEvent",
".",
"getParameter",
"(",
"\"attribute\"",
")",
",",
"allSelectedAttributes",
":... | Handles attribute selections | [
"Handles",
"attribute",
"selections"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/Exact.js#L229-L235 | train | Fires the refine search event | [
30522,
3853,
1006,
27178,
24158,
1010,
1051,
18697,
3372,
1007,
1063,
27178,
24158,
1012,
2543,
2890,
23460,
17310,
11140,
1006,
1063,
23032,
1024,
27178,
24158,
1012,
1035,
7020,
14644,
2818,
4226,
2854,
1010,
2904,
19321,
3089,
8569,
2618,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ccxt/ccxt | build/transpile.js | replaceInFile | function replaceInFile (filename, regex, replacement) {
let contents = fs.readFileSync (filename, 'utf8')
const parts = contents.split (regex)
const newContents = parts[0] + replacement + parts[1]
fs.truncateSync (filename)
fs.writeFileSync (filename, newContents)
} | javascript | function replaceInFile (filename, regex, replacement) {
let contents = fs.readFileSync (filename, 'utf8')
const parts = contents.split (regex)
const newContents = parts[0] + replacement + parts[1]
fs.truncateSync (filename)
fs.writeFileSync (filename, newContents)
} | [
"function",
"replaceInFile",
"(",
"filename",
",",
"regex",
",",
"replacement",
")",
"{",
"let",
"contents",
"=",
"fs",
".",
"readFileSync",
"(",
"filename",
",",
"'utf8'",
")",
"const",
"parts",
"=",
"contents",
".",
"split",
"(",
"regex",
")",
"const",
... | --------------------------------------------------------------------------- | [
"---------------------------------------------------------------------------"
] | 8168069b9180a465532905e225586215e115a565 | https://github.com/ccxt/ccxt/blob/8168069b9180a465532905e225586215e115a565/build/transpile.js#L23-L29 | train | Replace a string in a file | [
30522,
3853,
5672,
2378,
8873,
2571,
1006,
5371,
18442,
1010,
19723,
10288,
1010,
6110,
1007,
1063,
2292,
8417,
1027,
1042,
2015,
1012,
3191,
8873,
4244,
6038,
2278,
1006,
5371,
18442,
1010,
1005,
21183,
2546,
2620,
1005,
1007,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function (sHierarchyDimensionName, bIncludeExternalKey,
bIncludeText) {
var oDimension;
if (!sHierarchyDimensionName) {
return;
}
// sHierarchyDimensionName is the name of a dimension property (and not e.g. of a
// dimension's text property), findDimensionByName can be used instead of
// find... | javascript | function (sHierarchyDimensionName, bIncludeExternalKey,
bIncludeText) {
var oDimension;
if (!sHierarchyDimensionName) {
return;
}
// sHierarchyDimensionName is the name of a dimension property (and not e.g. of a
// dimension's text property), findDimensionByName can be used instead of
// find... | [
"function",
"(",
"sHierarchyDimensionName",
",",
"bIncludeExternalKey",
",",
"bIncludeText",
")",
"{",
"var",
"oDimension",
";",
"if",
"(",
"!",
"sHierarchyDimensionName",
")",
"{",
"return",
";",
"}",
"// sHierarchyDimensionName is the name of a dimension property (and not... | Adds a recursive hierarchy to the aggregation level.
@param {string} sHierarchyDimensionName
Name of dimension whose hierarchy shall be part of the aggregation level
@param {boolean} bIncludeExternalKey
Indicator whether or not to include the external node key (if available) in the query
result
@param {boolean} bInclu... | [
"Adds",
"a",
"recursive",
"hierarchy",
"to",
"the",
"aggregation",
"level",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4065-L4091 | train | Sets the hierarchy of the given dimension | [
30522,
3853,
1006,
11895,
6906,
29389,
22172,
6132,
3258,
18442,
1010,
8026,
20464,
12672,
10288,
16451,
2389,
14839,
1010,
8026,
20464,
12672,
18209,
1007,
1063,
13075,
21045,
3549,
10992,
1025,
2065,
1006,
999,
11895,
6906,
30524,
1998,
202... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/operator-linebreak.js | validateNode | function validateNode(node, leftSide) {
/*
* When the left part of a binary expression is a single expression wrapped in
* parentheses (ex: `(a) + b`), leftToken will be the last token of the expression
* and operatorToken will be the closing parenthesis.
... | javascript | function validateNode(node, leftSide) {
/*
* When the left part of a binary expression is a single expression wrapped in
* parentheses (ex: `(a) + b`), leftToken will be the last token of the expression
* and operatorToken will be the closing parenthesis.
... | [
"function",
"validateNode",
"(",
"node",
",",
"leftSide",
")",
"{",
"/*\n * When the left part of a binary expression is a single expression wrapped in\n * parentheses (ex: `(a) + b`), leftToken will be the last token of the expression\n * and operatorToken will b... | Checks the operator placement
@param {ASTNode} node The node to check
@param {ASTNode} leftSide The node that comes before the operator in `node`
@private
@returns {void} | [
"Checks",
"the",
"operator",
"placement"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/operator-linebreak.js#L139-L225 | train | Validate a binary expression node. | [
30522,
3853,
9398,
3686,
3630,
3207,
1006,
13045,
1010,
2187,
7363,
1007,
1063,
1013,
1008,
1008,
2043,
1996,
2187,
2112,
1997,
1037,
12441,
3670,
2003,
1037,
2309,
3670,
5058,
1999,
1008,
27393,
1006,
4654,
1024,
1036,
1006,
1037,
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.m/src/sap/m/GrowingEnablement.js | function(oContext, oBindingInfo, bSuppressInvalidate) {
var oControl = this._oControl,
oBinding = oBindingInfo.binding,
oItem = this.createListItem(oContext, oBindingInfo);
if (oBinding.isGrouped()) {
// creates group header if need
var aItems = oControl.getItems(true),
oLastItem = aItems[a... | javascript | function(oContext, oBindingInfo, bSuppressInvalidate) {
var oControl = this._oControl,
oBinding = oBindingInfo.binding,
oItem = this.createListItem(oContext, oBindingInfo);
if (oBinding.isGrouped()) {
// creates group header if need
var aItems = oControl.getItems(true),
oLastItem = aItems[a... | [
"function",
"(",
"oContext",
",",
"oBindingInfo",
",",
"bSuppressInvalidate",
")",
"{",
"var",
"oControl",
"=",
"this",
".",
"_oControl",
",",
"oBinding",
"=",
"oBindingInfo",
".",
"binding",
",",
"oItem",
"=",
"this",
".",
"createListItem",
"(",
"oContext",
... | appends single list item to the list | [
"appends",
"single",
"list",
"item",
"to",
"the",
"list"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/GrowingEnablement.js#L310-L344 | train | Creates an item in the list. | [
30522,
3853,
1006,
1051,
8663,
18209,
1010,
27885,
22254,
2075,
2378,
14876,
1010,
18667,
6279,
20110,
2378,
10175,
8524,
2618,
1007,
1063,
13075,
1051,
8663,
13181,
2140,
1027,
2023,
1012,
1035,
1051,
8663,
13181,
2140,
1010,
27885,
22254,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
fex-team/webuploader | build/tasks/concat.js | filesFilter | function filesFilter( f, files ) {
var cwd = f.cwd || '',
ret = [],
process = function( file ) {
var fileinfo = path.join( cwd, file ),
dirpath = path.dirname( fileinfo ),
depends = [],
str, matches, idx;
... | javascript | function filesFilter( f, files ) {
var cwd = f.cwd || '',
ret = [],
process = function( file ) {
var fileinfo = path.join( cwd, file ),
dirpath = path.dirname( fileinfo ),
depends = [],
str, matches, idx;
... | [
"function",
"filesFilter",
"(",
"f",
",",
"files",
")",
"{",
"var",
"cwd",
"=",
"f",
".",
"cwd",
"||",
"''",
",",
"ret",
"=",
"[",
"]",
",",
"process",
"=",
"function",
"(",
"file",
")",
"{",
"var",
"fileinfo",
"=",
"path",
".",
"join",
"(",
"c... | 排序,把依赖的文件移动到最上面。 | [
"排序,把依赖的文件移动到最上面。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/build/tasks/concat.js#L38-L103 | train | filter files | [
30522,
3853,
6764,
8873,
21928,
1006,
1042,
1010,
6764,
1007,
1063,
13075,
19296,
2094,
1027,
1042,
1012,
19296,
2094,
1064,
1064,
1005,
1005,
1010,
2128,
2102,
1027,
1031,
1033,
1010,
2832,
1027,
3853,
1006,
5371,
1007,
1063,
13075,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/ProjectManager.js | _watchProjectRoot | function _watchProjectRoot(rootPath) {
FileSystem.on("change", _fileSystemChange);
FileSystem.on("rename", _fileSystemRename);
FileSystem.watch(FileSystem.getDirectoryForPath(rootPath), ProjectModel._shouldShowName, ProjectModel.defaultIgnoreGlobs, function (err) {
if (err === FileS... | javascript | function _watchProjectRoot(rootPath) {
FileSystem.on("change", _fileSystemChange);
FileSystem.on("rename", _fileSystemRename);
FileSystem.watch(FileSystem.getDirectoryForPath(rootPath), ProjectModel._shouldShowName, ProjectModel.defaultIgnoreGlobs, function (err) {
if (err === FileS... | [
"function",
"_watchProjectRoot",
"(",
"rootPath",
")",
"{",
"FileSystem",
".",
"on",
"(",
"\"change\"",
",",
"_fileSystemChange",
")",
";",
"FileSystem",
".",
"on",
"(",
"\"rename\"",
",",
"_fileSystemRename",
")",
";",
"FileSystem",
".",
"watch",
"(",
"FileSy... | @private
Watches the project for filesystem changes so that the tree can be updated. | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L789-L806 | train | Watch project root | [
30522,
3853,
1035,
3422,
21572,
20614,
3217,
4140,
1006,
7117,
15069,
1007,
1063,
6764,
27268,
6633,
1012,
2006,
1006,
1000,
2689,
1000,
1010,
1035,
6764,
27268,
6633,
22305,
2063,
1007,
1025,
6764,
27268,
6633,
1012,
2006,
1006,
1000,
1491... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | disableTextSelectAndDrag | function disableTextSelectAndDrag(opt_allowSelectStart, opt_allowDragStart) {
// Disable text selection.
document.onselectstart = function(e) {
if (!(opt_allowSelectStart && opt_allowSelectStart.call(this, e)))
e.preventDefault();
};
// Disable dragging.
document.ondragstart = function(e) {
if ... | javascript | function disableTextSelectAndDrag(opt_allowSelectStart, opt_allowDragStart) {
// Disable text selection.
document.onselectstart = function(e) {
if (!(opt_allowSelectStart && opt_allowSelectStart.call(this, e)))
e.preventDefault();
};
// Disable dragging.
document.ondragstart = function(e) {
if ... | [
"function",
"disableTextSelectAndDrag",
"(",
"opt_allowSelectStart",
",",
"opt_allowDragStart",
")",
"{",
"// Disable text selection.",
"document",
".",
"onselectstart",
"=",
"function",
"(",
"e",
")",
"{",
"if",
"(",
"!",
"(",
"opt_allowSelectStart",
"&&",
"opt_allow... | Disables text selection and dragging, with optional whitelist callbacks.
@param {function(Event):boolean=} opt_allowSelectStart Unless this function
is defined and returns true, the onselectionstart event will be
surpressed.
@param {function(Event):boolean=} opt_allowDragStart Unless this function
is defined and return... | [
"Disables",
"text",
"selection",
"and",
"dragging",
"with",
"optional",
"whitelist",
"callbacks",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L148-L160 | train | Disable text selection and dragging | [
30522,
3853,
4487,
19150,
18209,
11246,
22471,
5685,
7265,
2290,
1006,
23569,
1035,
4473,
12260,
16649,
7559,
2102,
1010,
23569,
1035,
3499,
7265,
5620,
7559,
2102,
1007,
1063,
1013,
1013,
4487,
19150,
3793,
4989,
1012,
6254,
1012,
2006,
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... |
sparksuite/simplemde-markdown-editor | src/js/simplemde.js | wordCount | function wordCount(data) {
var pattern = /[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
var m = data.match(pattern);
var count = 0;
if(m === null) return count;
for(var i = 0; i < m.length; i++) {
if(m[i].charCodeAt(0) >= 0x4E00) {
count += m[i... | javascript | function wordCount(data) {
var pattern = /[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
var m = data.match(pattern);
var count = 0;
if(m === null) return count;
for(var i = 0; i < m.length; i++) {
if(m[i].charCodeAt(0) >= 0x4E00) {
count += m[i... | [
"function",
"wordCount",
"(",
"data",
")",
"{",
"var",
"pattern",
"=",
"/",
"[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+",
"/",
"g",
";",
"var",
"m",
"=",
"data",
".",
"match",
"(",
"pattern",
... | /* The right word count in respect for CJK. | [
"/",
"*",
"The",
"right",
"word",
"count",
"in",
"respect",
"for",
"CJK",
"."
] | 6abda7ab68cc20f4aca870eb243747951b90ab04 | https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js#L1054-L1067 | train | Count the number of words in the given string | [
30522,
3853,
2773,
3597,
16671,
1006,
2951,
1007,
1063,
13075,
5418,
1027,
1013,
1031,
1037,
1011,
23564,
1011,
1062,
2692,
1011,
1023,
1035,
1032,
1057,
2692,
23499,
2475,
1011,
1032,
1057,
2692,
2509,
2278,
2683,
1032,
1057,
2692,
23632,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | verifyForAlways | function verifyForAlways(context, prevNode, nextNode, paddingLines) {
if (paddingLines.length > 0) {
return;
}
context.report({
node: nextNode,
message: "Expected blank line before this statement.",
fix(fixer) {
const sourceCode = context.getSourceCode();
... | javascript | function verifyForAlways(context, prevNode, nextNode, paddingLines) {
if (paddingLines.length > 0) {
return;
}
context.report({
node: nextNode,
message: "Expected blank line before this statement.",
fix(fixer) {
const sourceCode = context.getSourceCode();
... | [
"function",
"verifyForAlways",
"(",
"context",
",",
"prevNode",
",",
"nextNode",
",",
"paddingLines",
")",
"{",
"if",
"(",
"paddingLines",
".",
"length",
">",
"0",
")",
"{",
"return",
";",
"}",
"context",
".",
"report",
"(",
"{",
"node",
":",
"nextNode",... | Check and report statements for `always` configuration.
This autofix inserts a blank line between the given 2 statements.
If the `prevNode` has trailing comments, it inserts a blank line after the
trailing comments.
@param {RuleContext} context The rule context to report.
@param {ASTNode} prevNode The previous node to... | [
"Check",
"and",
"report",
"statements",
"for",
"always",
"configuration",
".",
"This",
"autofix",
"inserts",
"a",
"blank",
"line",
"between",
"the",
"given",
"2",
"statements",
".",
"If",
"the",
"prevNode",
"has",
"trailing",
"comments",
"it",
"inserts",
"a",
... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/padding-line-between-statements.js#L288-L342 | train | Verifies that the next node is always. | [
30522,
3853,
20410,
29278,
2389,
14035,
1006,
6123,
1010,
3653,
16022,
10244,
1010,
2279,
3630,
3207,
1010,
11687,
4667,
12735,
1007,
1063,
2065,
1006,
11687,
4667,
12735,
1012,
3091,
1028,
1014,
1007,
1063,
2709,
1025,
1065,
6123,
1012,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ui5loader.js | Module | function Module(name) {
this.name = name;
this.state = INITIAL;
/*
* Whether processing of the module is complete.
* This is very similar to, but not the same as state >= READY because declareModule() sets state=READY very early.
* That state transition is 'legacy' from the library-all files; it needs to... | javascript | function Module(name) {
this.name = name;
this.state = INITIAL;
/*
* Whether processing of the module is complete.
* This is very similar to, but not the same as state >= READY because declareModule() sets state=READY very early.
* That state transition is 'legacy' from the library-all files; it needs to... | [
"function",
"Module",
"(",
"name",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"state",
"=",
"INITIAL",
";",
"/*\n\t\t * Whether processing of the module is complete.\n\t\t * This is very similar to, but not the same as state >= READY because declareModule() set... | A module/resource as managed by the module system.
Each module is an object with the following properties
<ul>
<li>{int} state one of the module states defined in this function</li>
<li>{string} url URL where the module has been loaded from</li>
<li>{any} data temp. raw content of the module (between loaded and ready ... | [
"A",
"module",
"/",
"resource",
"as",
"managed",
"by",
"the",
"module",
"system",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/ui5loader.js#L738-L754 | train | The module object | [
30522,
3853,
11336,
1006,
2171,
1007,
1063,
2023,
1012,
2171,
1027,
2171,
1025,
2023,
1012,
2110,
1027,
3988,
1025,
1013,
1008,
1008,
3251,
6364,
1997,
1996,
11336,
2003,
3143,
1012,
1008,
2023,
2003,
2200,
2714,
2000,
1010,
2021,
2025,
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... |
PrismJS/prism | plugins/line-numbers/prism-line-numbers.js | function (element) {
if (!element) {
return null;
}
return window.getComputedStyle ? getComputedStyle(element) : (element.currentStyle || null);
} | javascript | function (element) {
if (!element) {
return null;
}
return window.getComputedStyle ? getComputedStyle(element) : (element.currentStyle || null);
} | [
"function",
"(",
"element",
")",
"{",
"if",
"(",
"!",
"element",
")",
"{",
"return",
"null",
";",
"}",
"return",
"window",
".",
"getComputedStyle",
"?",
"getComputedStyle",
"(",
"element",
")",
":",
"(",
"element",
".",
"currentStyle",
"||",
"null",
")",... | Returns style declarations for the element
@param {Element} element | [
"Returns",
"style",
"declarations",
"for",
"the",
"element"
] | acceb3b56f0e8362a7ef274dbd85b17611df2ec4 | https://github.com/PrismJS/prism/blob/acceb3b56f0e8362a7ef274dbd85b17611df2ec4/plugins/line-numbers/prism-line-numbers.js#L57-L63 | train | Returns the current style of an element | [
30522,
3853,
1006,
5783,
1007,
1063,
2065,
1006,
999,
5783,
1007,
1063,
2709,
19701,
1025,
1065,
2709,
3332,
1012,
2131,
9006,
29462,
21756,
2571,
1029,
2131,
9006,
29462,
21756,
2571,
1006,
5783,
1007,
1024,
1006,
5783,
1012,
14731,
27983,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js | performCleanup | function performCleanup(requester, filesToCache, notifyBack) {
var currentRequester = requester || "";
function filterFilesAndNotify(files, filesToCacheArr, notifyBackToBrackets) {
files.forEach(function (file) {
var fileExt = path.extname(path.basename(file));
... | javascript | function performCleanup(requester, filesToCache, notifyBack) {
var currentRequester = requester || "";
function filterFilesAndNotify(files, filesToCacheArr, notifyBackToBrackets) {
files.forEach(function (file) {
var fileExt = path.extname(path.basename(file));
... | [
"function",
"performCleanup",
"(",
"requester",
",",
"filesToCache",
",",
"notifyBack",
")",
"{",
"var",
"currentRequester",
"=",
"requester",
"||",
"\"\"",
";",
"function",
"filterFilesAndNotify",
"(",
"files",
",",
"filesToCacheArr",
",",
"notifyBackToBrackets",
"... | Performs clean up for the contents in Update Directory in AppData
@param {Array} filesToCache - array of file types to cache
@param {boolean} notifyBack - true if Brackets needs to be
notified post cleanup, false otherwise | [
"Performs",
"clean",
"up",
"for",
"the",
"contents",
"in",
"Update",
"Directory",
"in",
"AppData"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L332-L382 | train | This function is called by the cleanup process to clean up the update directory | [
30522,
3853,
4685,
14321,
24076,
2361,
1006,
5227,
2121,
1010,
6764,
3406,
3540,
5403,
1010,
2025,
8757,
5963,
1007,
1063,
13075,
2783,
2890,
15500,
2121,
1027,
5227,
2121,
1064,
1064,
1000,
1000,
1025,
3853,
11307,
8873,
4244,
5685,
17048,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
LLK/scratch-blocks | blocks_vertical/event.js | function() {
this.jsonInit({
"message0": Blockly.Msg.EVENT_WHENGREATERTHAN,
"args0": [
{
"type": "field_dropdown",
"name": "WHENGREATERTHANMENU",
"options": [
[Blockly.Msg.EVENT_WHENGREATERTHAN_LOUDNESS, 'LOUDNESS'],
[Blockly.Msg.EVENT_WHENGR... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.EVENT_WHENGREATERTHAN,
"args0": [
{
"type": "field_dropdown",
"name": "WHENGREATERTHANMENU",
"options": [
[Blockly.Msg.EVENT_WHENGREATERTHAN_LOUDNESS, 'LOUDNESS'],
[Blockly.Msg.EVENT_WHENGR... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"EVENT_WHENGREATERTHAN",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"WHENGREATERTHANMENU\"",
","... | Block for when loudness/timer/video motion is greater than the value.
@this Blockly.Block | [
"Block",
"for",
"when",
"loudness",
"/",
"timer",
"/",
"video",
"motion",
"is",
"greater",
"than",
"the",
"value",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/event.js#L177-L197 | train | Block for whomerening between two terms. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
2724,
1035,
2043,
17603,
24932,
21604,
1010,
1000,
12098,
5620,
2692,
1000,
1024,
1031,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.support/src/sap/ui/support/supportRules/Storage.js | function () {
var tempRules = [],
rawLSData;
try {
rawLSData = localStorage.getItem(constants.LOCAL_STORAGE_TEMP_RULES_KEY);
if (!rawLSData) {
return null;
}
tempRules = JSON.parse(decode(rawLSData));
tempRules = tempRules.map(function (tempRule) {
return RuleSerializer.deser... | javascript | function () {
var tempRules = [],
rawLSData;
try {
rawLSData = localStorage.getItem(constants.LOCAL_STORAGE_TEMP_RULES_KEY);
if (!rawLSData) {
return null;
}
tempRules = JSON.parse(decode(rawLSData));
tempRules = tempRules.map(function (tempRule) {
return RuleSerializer.deser... | [
"function",
"(",
")",
"{",
"var",
"tempRules",
"=",
"[",
"]",
",",
"rawLSData",
";",
"try",
"{",
"rawLSData",
"=",
"localStorage",
".",
"getItem",
"(",
"constants",
".",
"LOCAL_STORAGE_TEMP_RULES_KEY",
")",
";",
"if",
"(",
"!",
"rawLSData",
")",
"{",
"re... | Returns all previously created temporary rules.
@private
@name sap.ui.support.Storage.getRules
@method
@returns {object[]} An array containing all the temporary rules. | [
"Returns",
"all",
"previously",
"created",
"temporary",
"rules",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/Storage.js#L69-L90 | train | Returns the list of temp rules | [
30522,
3853,
1006,
1007,
1063,
13075,
8915,
8737,
6820,
4244,
1027,
1031,
1033,
1010,
6315,
4877,
2850,
2696,
1025,
3046,
1063,
6315,
4877,
2850,
2696,
1027,
10575,
4263,
4270,
1012,
2131,
4221,
2213,
1006,
5377,
2015,
1012,
2334,
1035,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DOMAgent.js | _mapDocumentToSource | function _mapDocumentToSource(source) {
var node = exports.root;
DOMHelpers.eachNode(source, function each(payload) {
if (!node) {
return true;
}
if (payload.closing) {
var parent = node.findParentForNextNodeMatchingPayload(payload);
... | javascript | function _mapDocumentToSource(source) {
var node = exports.root;
DOMHelpers.eachNode(source, function each(payload) {
if (!node) {
return true;
}
if (payload.closing) {
var parent = node.findParentForNextNodeMatchingPayload(payload);
... | [
"function",
"_mapDocumentToSource",
"(",
"source",
")",
"{",
"var",
"node",
"=",
"exports",
".",
"root",
";",
"DOMHelpers",
".",
"eachNode",
"(",
"source",
",",
"function",
"each",
"(",
"payload",
")",
"{",
"if",
"(",
"!",
"node",
")",
"{",
"return",
"... | Map the DOM document to the source text
@param {string} source | [
"Map",
"the",
"DOM",
"document",
"to",
"the",
"source",
"text"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L134-L160 | train | map document to source | [
30522,
3853,
1035,
4949,
3527,
24894,
4765,
13122,
8162,
3401,
1006,
3120,
1007,
1063,
13075,
13045,
1027,
14338,
1012,
7117,
1025,
14383,
16001,
7347,
1012,
2169,
3630,
3207,
1006,
3120,
1010,
3853,
2169,
1006,
18093,
1007,
1063,
2065,
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... |
ecomfe/zrender | src/svg/graphic.js | pathDataToString | function pathDataToString(path) {
var str = [];
var data = path.data;
var dataLength = path.len();
for (var i = 0; i < dataLength;) {
var cmd = data[i++];
var cmdStr = '';
var nData = 0;
switch (cmd) {
case CMD.M:
cmdStr = 'M';
... | javascript | function pathDataToString(path) {
var str = [];
var data = path.data;
var dataLength = path.len();
for (var i = 0; i < dataLength;) {
var cmd = data[i++];
var cmdStr = '';
var nData = 0;
switch (cmd) {
case CMD.M:
cmdStr = 'M';
... | [
"function",
"pathDataToString",
"(",
"path",
")",
"{",
"var",
"str",
"=",
"[",
"]",
";",
"var",
"data",
"=",
"path",
".",
"data",
";",
"var",
"dataLength",
"=",
"path",
".",
"len",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",... | *************************************************
PATH
************************************************ | [
"*************************************************",
"PATH",
"************************************************"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/svg/graphic.js#L108-L216 | train | Converts a path to a string | [
30522,
3853,
4130,
2850,
29336,
14122,
4892,
1006,
4130,
1007,
1063,
13075,
2358,
2099,
1027,
1031,
1033,
1025,
13075,
2951,
1027,
4130,
1012,
2951,
1025,
13075,
2951,
7770,
13512,
2232,
1027,
4130,
1012,
18798,
1006,
1007,
1025,
2005,
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... |
swimlane/ngx-datatable | release/utils/math.js | removeProcessedColumns | function removeProcessedColumns(columnsToResize, columnsProcessed) {
for (var _i = 0, columnsProcessed_1 = columnsProcessed; _i < columnsProcessed_1.length; _i++) {
var column = columnsProcessed_1[_i];
var index = columnsToResize.indexOf(column);
columnsToResize.splice(index, 1);
}
} | javascript | function removeProcessedColumns(columnsToResize, columnsProcessed) {
for (var _i = 0, columnsProcessed_1 = columnsProcessed; _i < columnsProcessed_1.length; _i++) {
var column = columnsProcessed_1[_i];
var index = columnsToResize.indexOf(column);
columnsToResize.splice(index, 1);
}
} | [
"function",
"removeProcessedColumns",
"(",
"columnsToResize",
",",
"columnsProcessed",
")",
"{",
"for",
"(",
"var",
"_i",
"=",
"0",
",",
"columnsProcessed_1",
"=",
"columnsProcessed",
";",
"_i",
"<",
"columnsProcessed_1",
".",
"length",
";",
"_i",
"++",
")",
"... | Remove the processed columns from the current active columns. | [
"Remove",
"the",
"processed",
"columns",
"from",
"the",
"current",
"active",
"columns",
"."
] | d7df15a070282a169524dba51d9572008b74804c | https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/math.js#L142-L148 | train | Remove processed columns from the columnsToResize array | [
30522,
3853,
6366,
21572,
9623,
6924,
25778,
2819,
3619,
1006,
7753,
19277,
5332,
4371,
1010,
7753,
21572,
9623,
6924,
1007,
1063,
2005,
1006,
13075,
1035,
1045,
1027,
1014,
1010,
7753,
21572,
9623,
6924,
1035,
1015,
1027,
7753,
21572,
9623... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/chart/line/poly.js | drawMono | function drawMono(
ctx, points, start, segLen, allLen,
dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls
) {
var prevIdx = 0;
var idx = start;
for (var k = 0; k < segLen; k++) {
var p = points[idx];
if (idx >= allLen || idx < 0) {
break;
}
if... | javascript | function drawMono(
ctx, points, start, segLen, allLen,
dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls
) {
var prevIdx = 0;
var idx = start;
for (var k = 0; k < segLen; k++) {
var p = points[idx];
if (idx >= allLen || idx < 0) {
break;
}
if... | [
"function",
"drawMono",
"(",
"ctx",
",",
"points",
",",
"start",
",",
"segLen",
",",
"allLen",
",",
"dir",
",",
"smoothMin",
",",
"smoothMax",
",",
"smooth",
",",
"smoothMonotone",
",",
"connectNulls",
")",
"{",
"var",
"prevIdx",
"=",
"0",
";",
"var",
... | var dim = smoothMonotone === 'x' ? 0 : 1; var last = points[0][dim]; var lastDiff = 0; for (var i = 1; i < points.length; ++i) { var diff = points[i][dim] - last; if (!isNaN(diff) && !isNaN(lastDiff) && diff !== 0 && lastDiff !== 0 && ((diff >= 0) !== (lastDiff >= 0)) ) { return false; } if (!isNaN(diff) && diff !== 0)... | [
"var",
"dim",
"=",
"smoothMonotone",
"===",
"x",
"?",
"0",
":",
"1",
";",
"var",
"last",
"=",
"points",
"[",
"0",
"]",
"[",
"dim",
"]",
";",
"var",
"lastDiff",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"1",
";",
"i",
"<",
"points",
".",
"... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/line/poly.js#L112-L164 | train | Draws a monotone line | [
30522,
3853,
4009,
8202,
2080,
1006,
14931,
2595,
1010,
2685,
1010,
2707,
1010,
7367,
9354,
2078,
1010,
2035,
7770,
1010,
16101,
1010,
5744,
10020,
1010,
5744,
17848,
1010,
5744,
1010,
5744,
8202,
25862,
2063,
1010,
7532,
11231,
12718,
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... |
mochajs/mocha | lib/errors.js | createInvalidReporterError | function createInvalidReporterError(message, reporter) {
var err = new TypeError(message);
err.code = 'ERR_MOCHA_INVALID_REPORTER';
err.reporter = reporter;
return err;
} | javascript | function createInvalidReporterError(message, reporter) {
var err = new TypeError(message);
err.code = 'ERR_MOCHA_INVALID_REPORTER';
err.reporter = reporter;
return err;
} | [
"function",
"createInvalidReporterError",
"(",
"message",
",",
"reporter",
")",
"{",
"var",
"err",
"=",
"new",
"TypeError",
"(",
"message",
")",
";",
"err",
".",
"code",
"=",
"'ERR_MOCHA_INVALID_REPORTER'",
";",
"err",
".",
"reporter",
"=",
"reporter",
";",
... | Creates an error object to be thrown when the reporter specified in the options was not found.
@public
@param {string} message - Error message to be displayed.
@param {string} reporter - User-specified reporter value.
@returns {Error} instance detailing the error condition | [
"Creates",
"an",
"error",
"object",
"to",
"be",
"thrown",
"when",
"the",
"reporter",
"specified",
"in",
"the",
"options",
"was",
"not",
"found",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/errors.js#L32-L37 | train | Create an error object that can t be thrown when a reporter is not supported. | [
30522,
3853,
3443,
2378,
10175,
3593,
2890,
6442,
7869,
18933,
2099,
1006,
4471,
1010,
6398,
1007,
1063,
13075,
9413,
2099,
1027,
2047,
2828,
2121,
29165,
1006,
4471,
1007,
1025,
9413,
2099,
1012,
3642,
1027,
1005,
9413,
2099,
1035,
9587,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
grpc/grpc-node | packages/grpc-native-core/src/server.js | ServerUnaryCall | function ServerUnaryCall(call, metadata) {
EventEmitter.call(this);
this.call = call;
/**
* Indicates if the call has been cancelled
* @member {boolean} grpc~ServerUnaryCall#cancelled
*/
this.cancelled = false;
/**
* The request metadata from the client
* @member {grpc.Metadata} grpc~ServerUnar... | javascript | function ServerUnaryCall(call, metadata) {
EventEmitter.call(this);
this.call = call;
/**
* Indicates if the call has been cancelled
* @member {boolean} grpc~ServerUnaryCall#cancelled
*/
this.cancelled = false;
/**
* The request metadata from the client
* @member {grpc.Metadata} grpc~ServerUnar... | [
"function",
"ServerUnaryCall",
"(",
"call",
",",
"metadata",
")",
"{",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"call",
"=",
"call",
";",
"/**\n * Indicates if the call has been cancelled\n * @member {boolean} grpc~ServerUnaryCall#cancelled\n *... | An EventEmitter. Used for unary calls.
@constructor grpc~ServerUnaryCall
@extends external:EventEmitter
@param {grpc.internal~Call} call The call object associated with the request
@param {grpc.Metadata} metadata The request metadata from the client | [
"An",
"EventEmitter",
".",
"Used",
"for",
"unary",
"calls",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/server.js#L230-L248 | train | ServerUnaryCall constructor. | [
30522,
3853,
8241,
9521,
2854,
9289,
2140,
1006,
2655,
1010,
27425,
1007,
1063,
2724,
23238,
12079,
1012,
2655,
1006,
2023,
1007,
1025,
2023,
1012,
2655,
1027,
2655,
1025,
1013,
1008,
1008,
1008,
7127,
2065,
1996,
2655,
2038,
2042,
8014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/output/website/createTemplateEngine.js | getPageByPath | function getPageByPath(filePath) {
var page = output.getPage(filePath);
if (!page) return undefined;
return JSONUtils.encodePage(page, summary);
} | javascript | function getPageByPath(filePath) {
var page = output.getPage(filePath);
if (!page) return undefined;
return JSONUtils.encodePage(page, summary);
} | [
"function",
"getPageByPath",
"(",
"filePath",
")",
"{",
"var",
"page",
"=",
"output",
".",
"getPage",
"(",
"filePath",
")",
";",
"if",
"(",
"!",
"page",
")",
"return",
"undefined",
";",
"return",
"JSONUtils",
".",
"encodePage",
"(",
"page",
",",
"summary... | Return a page by its path
@param {String} filePath
@return {Object|undefined} | [
"Return",
"a",
"page",
"by",
"its",
"path"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/website/createTemplateEngine.js#L87-L92 | train | Get a page by path | [
30522,
3853,
2131,
13704,
3762,
15069,
1006,
5371,
15069,
1007,
1063,
13075,
3931,
1027,
6434,
1012,
2131,
13704,
1006,
5371,
15069,
1007,
1025,
2065,
1006,
999,
3931,
1007,
2709,
6151,
28344,
1025,
2709,
1046,
3385,
21823,
4877,
1012,
4372... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/variants/util/VariantUtil.js | function(oComponent) {
var aTechnicalParameters = flUtils.getTechnicalParametersForComponent(oComponent);
return aTechnicalParameters
&& aTechnicalParameters[VariantUtil.variantTechnicalParameterName]
&& Array.isArray(aTechnicalParameters[VariantUtil.variantTechnicalParameterName])
&& aTechnicalParame... | javascript | function(oComponent) {
var aTechnicalParameters = flUtils.getTechnicalParametersForComponent(oComponent);
return aTechnicalParameters
&& aTechnicalParameters[VariantUtil.variantTechnicalParameterName]
&& Array.isArray(aTechnicalParameters[VariantUtil.variantTechnicalParameterName])
&& aTechnicalParame... | [
"function",
"(",
"oComponent",
")",
"{",
"var",
"aTechnicalParameters",
"=",
"flUtils",
".",
"getTechnicalParametersForComponent",
"(",
"oComponent",
")",
";",
"return",
"aTechnicalParameters",
"&&",
"aTechnicalParameters",
"[",
"VariantUtil",
".",
"variantTechnicalParame... | Returns control variant technical parameter for the passed component.
@param {object} oComponent - Component instance used to get the technical parameters
@returns {string|undefined} Returns the control variant technical parameter | [
"Returns",
"control",
"variant",
"technical",
"parameter",
"for",
"the",
"passed",
"component",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/variants/util/VariantUtil.js#L118-L124 | train | Returns the index of the highest priority parameter for a component | [
30522,
3853,
1006,
1051,
9006,
29513,
3372,
1007,
1063,
13075,
8823,
2818,
20913,
28689,
22828,
2015,
1027,
19857,
3775,
4877,
1012,
2131,
15007,
20913,
28689,
22828,
22747,
2953,
9006,
29513,
3372,
1006,
1051,
9006,
29513,
3372,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
moleculerjs/moleculer | src/strategies/index.js | resolve | function resolve(opt) {
if (Strategies.Base.isPrototypeOf(opt)) {
return opt;
} else if (_.isString(opt)) {
let SerializerClass = getByName(opt);
if (SerializerClass)
return SerializerClass;
else
throw new BrokerOptionsError(`Invalid strategy type '${opt}'.`, { type: opt });
} else if (_.isObject(opt)... | javascript | function resolve(opt) {
if (Strategies.Base.isPrototypeOf(opt)) {
return opt;
} else if (_.isString(opt)) {
let SerializerClass = getByName(opt);
if (SerializerClass)
return SerializerClass;
else
throw new BrokerOptionsError(`Invalid strategy type '${opt}'.`, { type: opt });
} else if (_.isObject(opt)... | [
"function",
"resolve",
"(",
"opt",
")",
"{",
"if",
"(",
"Strategies",
".",
"Base",
".",
"isPrototypeOf",
"(",
"opt",
")",
")",
"{",
"return",
"opt",
";",
"}",
"else",
"if",
"(",
"_",
".",
"isString",
"(",
"opt",
")",
")",
"{",
"let",
"SerializerCla... | Resolve strategy by name
@param {object|string} opt
@returns {Strategy}
@memberof ServiceBroker | [
"Resolve",
"strategy",
"by",
"name"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/strategies/index.js#L37-L56 | train | Resolve a strategy | [
30522,
3853,
10663,
1006,
23569,
1007,
1063,
2065,
1006,
9942,
1012,
2918,
1012,
2003,
21572,
3406,
13874,
11253,
1006,
23569,
1007,
1007,
1063,
2709,
23569,
1025,
1065,
2842,
2065,
1006,
1035,
1012,
26354,
18886,
3070,
1006,
23569,
1007,
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... |
google/closure-library | closure/goog/html/cssspecificity.js | calculateSpecificity | function calculateSpecificity(selector) {
var specificity = [0, 0, 0, 0];
// Cannot use RegExp literals for all regular expressions, IE does not accept
// the syntax.
// Matches a backslash followed by six hexadecimal digits followed by an
// optional single whitespace character.
var escapeHexadecimalRege... | javascript | function calculateSpecificity(selector) {
var specificity = [0, 0, 0, 0];
// Cannot use RegExp literals for all regular expressions, IE does not accept
// the syntax.
// Matches a backslash followed by six hexadecimal digits followed by an
// optional single whitespace character.
var escapeHexadecimalRege... | [
"function",
"calculateSpecificity",
"(",
"selector",
")",
"{",
"var",
"specificity",
"=",
"[",
"0",
",",
"0",
",",
"0",
",",
"0",
"]",
";",
"// Cannot use RegExp literals for all regular expressions, IE does not accept",
"// the syntax.",
"// Matches a backslash followed by... | Calculates the specificity of CSS selectors
@see http://www.w3.org/TR/css3-selectors/#specificity
@see https://github.com/keeganstreet/specificity
@see https://specificity.keegan.st/
@param {string} selector
@return {!Array<number>} The CSS specificity. | [
"Calculates",
"the",
"specificity",
"of",
"CSS",
"selectors"
] | 97390e9ca4483cebb9628e06026139fbb3023d65 | https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/closure/goog/html/cssspecificity.js#L98-L172 | train | Calculates the specificity of a selector. | [
30522,
3853,
18422,
13102,
8586,
18513,
3012,
1006,
27000,
1007,
1063,
13075,
3563,
3012,
1027,
1031,
1014,
1010,
1014,
1010,
1014,
1010,
1014,
1033,
1025,
1013,
1013,
3685,
2224,
19723,
10288,
2361,
18204,
2015,
2005,
2035,
3180,
11423,
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... |
Microsoft/vscode | src/vs/code/electron-browser/workbench/workbench.js | showPartsSplash | function showPartsSplash(configuration) {
perf.mark('willShowPartsSplash');
let data;
if (typeof configuration.partsSplashPath === 'string') {
try {
data = JSON.parse(require('fs').readFileSync(configuration.partsSplashPath, 'utf8'));
} catch (e) {
// ignore
}
}
// high contrast mode has been turned ... | javascript | function showPartsSplash(configuration) {
perf.mark('willShowPartsSplash');
let data;
if (typeof configuration.partsSplashPath === 'string') {
try {
data = JSON.parse(require('fs').readFileSync(configuration.partsSplashPath, 'utf8'));
} catch (e) {
// ignore
}
}
// high contrast mode has been turned ... | [
"function",
"showPartsSplash",
"(",
"configuration",
")",
"{",
"perf",
".",
"mark",
"(",
"'willShowPartsSplash'",
")",
";",
"let",
"data",
";",
"if",
"(",
"typeof",
"configuration",
".",
"partsSplashPath",
"===",
"'string'",
")",
"{",
"try",
"{",
"data",
"="... | // configuration: IWindowConfiguration
@param {{
partsSplashPath?: string,
highContrast?: boolean,
extensionDevelopmentPath?: string | string[],
folderUri?: object,
workspace?: object
}} configuration | [
"//",
"configuration",
":",
"IWindowConfiguration"
] | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/src/vs/code/electron-browser/workbench/workbench.js#L61-L122 | train | Show the splash of the parts | [
30522,
3853,
2265,
26950,
13102,
27067,
1006,
9563,
1007,
1063,
2566,
2546,
1012,
2928,
1006,
1005,
17234,
14406,
26950,
13102,
27067,
1005,
1007,
1025,
2292,
2951,
1025,
2065,
1006,
2828,
11253,
9563,
1012,
3033,
13102,
27067,
15069,
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/core/mvc/Controller.js | instantiateController | function instantiateController(ControllerClass, sName) {
var oController;
if (mRegistry[sName]) {
oController = new ControllerClass(sName);
} else {
oController = new ControllerClass();
}
if (!oController) {
throw new Error("Controller " + sName + " couldn't be instantiated");
}
return ... | javascript | function instantiateController(ControllerClass, sName) {
var oController;
if (mRegistry[sName]) {
oController = new ControllerClass(sName);
} else {
oController = new ControllerClass();
}
if (!oController) {
throw new Error("Controller " + sName + " couldn't be instantiated");
}
return ... | [
"function",
"instantiateController",
"(",
"ControllerClass",
",",
"sName",
")",
"{",
"var",
"oController",
";",
"if",
"(",
"mRegistry",
"[",
"sName",
"]",
")",
"{",
"oController",
"=",
"new",
"ControllerClass",
"(",
"sName",
")",
";",
"}",
"else",
"{",
"oC... | /*
Instantiation of a controller
@param {function} ControllerClass The controller constructor
@param {string} sName the controller name
@param {boolean} bAsync Load async or not
@return {sap.ui.core.mvc.Controller|Promise} A <code>Promise</code> in case of asynchronous extend
or the <code>controller</code> in case of ... | [
"/",
"*",
"Instantiation",
"of",
"a",
"controller"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/mvc/Controller.js#L344-L355 | train | Instantiate a controller | [
30522,
3853,
7107,
13143,
8663,
13181,
10820,
1006,
11486,
26266,
1010,
1055,
18442,
1007,
1063,
13075,
1051,
8663,
13181,
10820,
1025,
2065,
1006,
2720,
13910,
2923,
2854,
1031,
1055,
18442,
1033,
1007,
1063,
1051,
8663,
13181,
10820,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/modifiers/summary/mergeAtLevel.js | editArticleInList | function editArticleInList(articles, level, newArticle) {
return articles.map(function(article) {
var articleLevel = article.getLevel();
if (articleLevel === level) {
// it is the article to edit
return article.merge(newArticle);
} else if (level.indexOf(articleLevel... | javascript | function editArticleInList(articles, level, newArticle) {
return articles.map(function(article) {
var articleLevel = article.getLevel();
if (articleLevel === level) {
// it is the article to edit
return article.merge(newArticle);
} else if (level.indexOf(articleLevel... | [
"function",
"editArticleInList",
"(",
"articles",
",",
"level",
",",
"newArticle",
")",
"{",
"return",
"articles",
".",
"map",
"(",
"function",
"(",
"article",
")",
"{",
"var",
"articleLevel",
"=",
"article",
".",
"getLevel",
"(",
")",
";",
"if",
"(",
"a... | Edit a list of articles
@param {List<Article>} articles
@param {String} level
@param {Article} newArticle
@return {List<Article>} | [
"Edit",
"a",
"list",
"of",
"articles"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/modifiers/summary/mergeAtLevel.js#L10-L26 | train | editArticleInList - edit article in list | [
30522,
3853,
10086,
8445,
25128,
2378,
9863,
1006,
4790,
1010,
2504,
1010,
2047,
8445,
25128,
1007,
1063,
2709,
4790,
1012,
4949,
1006,
3853,
1006,
3720,
1007,
1063,
13075,
3720,
20414,
2884,
1027,
3720,
1012,
2131,
20414,
2884,
1006,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.