repo stringclasses 195
values | path stringlengths 4 99 | func_name stringlengths 0 41 | original_string stringlengths 72 56.1k | language stringclasses 1
value | code stringlengths 72 56.1k | code_tokens listlengths 25 8.12k | docstring stringlengths 2 12.5k | docstring_tokens listlengths 1 449 | sha stringclasses 197
values | url stringlengths 88 186 | partition stringclasses 1
value | summary stringlengths 8 338 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SAP/openui5 | src/sap.ui.unified/src/sap/ui/unified/calendar/Month.js | _updateSelection | function _updateSelection(aStartDate, oEndDate){
if (!Array.isArray(aStartDate)) {
aStartDate = [aStartDate];
}
var aDomRefs = this._oItemNavigation.getItemDomRefs();
var $DomRef;
var i = 0;
var bStart = false;
var bEnd = false;
if (!oEndDate) {
// start of interval, single date or multiple date... | javascript | function _updateSelection(aStartDate, oEndDate){
if (!Array.isArray(aStartDate)) {
aStartDate = [aStartDate];
}
var aDomRefs = this._oItemNavigation.getItemDomRefs();
var $DomRef;
var i = 0;
var bStart = false;
var bEnd = false;
if (!oEndDate) {
// start of interval, single date or multiple date... | [
"function",
"_updateSelection",
"(",
"aStartDate",
",",
"oEndDate",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"aStartDate",
")",
")",
"{",
"aStartDate",
"=",
"[",
"aStartDate",
"]",
";",
"}",
"var",
"aDomRefs",
"=",
"this",
".",
"_oItemNavi... | /*
Toggles the selected class for the currently selected date.
@param {sap.ui.unified.calendar.CalendarDate[]} aStartDate multiple selected dates or a single start date of a range
@param {sap.ui.unified.calendar.CalendarDate} oEndDate end of a range
@private | [
"/",
"*",
"Toggles",
"the",
"selected",
"class",
"for",
"the",
"currently",
"selected",
"date",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.unified/src/sap/ui/unified/calendar/Month.js#L2180-L2265 | train | Updates the aria - selected class of the selected item | [
30522,
3853,
1035,
14409,
12260,
7542,
1006,
2004,
7559,
2102,
13701,
1010,
1051,
10497,
13701,
1007,
1063,
2065,
1006,
999,
9140,
1012,
18061,
11335,
2100,
1006,
2004,
7559,
2102,
13701,
1007,
1007,
1063,
2004,
7559,
2102,
13701,
1027,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/spaced-comment.js | reportEnd | function reportEnd(node, message, match) {
context.report({
node,
fix(fixer) {
if (requireSpace) {
return fixer.insertTextAfterRange([node.range[0], node.range[1] - 2], " ");
}
const end = nod... | javascript | function reportEnd(node, message, match) {
context.report({
node,
fix(fixer) {
if (requireSpace) {
return fixer.insertTextAfterRange([node.range[0], node.range[1] - 2], " ");
}
const end = nod... | [
"function",
"reportEnd",
"(",
"node",
",",
"message",
",",
"match",
")",
"{",
"context",
".",
"report",
"(",
"{",
"node",
",",
"fix",
"(",
"fixer",
")",
"{",
"if",
"(",
"requireSpace",
")",
"{",
"return",
"fixer",
".",
"insertTextAfterRange",
"(",
"[",... | Reports an ending spacing error with an appropriate message.
@param {ASTNode} node - A comment node to check.
@param {string} message - An error message to report.
@param {string} match - An array of the matched whitespace characters.
@returns {void} | [
"Reports",
"an",
"ending",
"spacing",
"error",
"with",
"an",
"appropriate",
"message",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/spaced-comment.js#L301-L316 | train | Reports the end of a match | [
30522,
3853,
3189,
10497,
1006,
13045,
1010,
4471,
1010,
2674,
1007,
1063,
6123,
1012,
3189,
1006,
1063,
13045,
1010,
8081,
1006,
30524,
1012,
2846,
1031,
1015,
1033,
1011,
1016,
1010,
2707,
1027,
2203,
1011,
2674,
1031,
1014,
1033,
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... |
openlayers/openlayers | src/ol/format/TopoJSON.js | transformArcs | function transformArcs(arcs, scale, translate) {
for (let i = 0, ii = arcs.length; i < ii; ++i) {
transformArc(arcs[i], scale, translate);
}
} | javascript | function transformArcs(arcs, scale, translate) {
for (let i = 0, ii = arcs.length; i < ii; ++i) {
transformArc(arcs[i], scale, translate);
}
} | [
"function",
"transformArcs",
"(",
"arcs",
",",
"scale",
",",
"translate",
")",
"{",
"for",
"(",
"let",
"i",
"=",
"0",
",",
"ii",
"=",
"arcs",
".",
"length",
";",
"i",
"<",
"ii",
";",
"++",
"i",
")",
"{",
"transformArc",
"(",
"arcs",
"[",
"i",
"... | Apply a linear transform to array of arcs. The provided array of arcs is
modified in place.
@param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
@param {Array<number>} scale Scale for each dimension.
@param {Array<number>} translate Translation for each dimension. | [
"Apply",
"a",
"linear",
"transform",
"to",
"array",
"of",
"arcs",
".",
"The",
"provided",
"array",
"of",
"arcs",
"is",
"modified",
"in",
"place",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/format/TopoJSON.js#L367-L371 | train | Transform an array of arcs | [
30522,
3853,
10938,
2906,
6169,
1006,
29137,
1010,
4094,
1010,
17637,
1007,
1063,
2005,
1006,
2292,
1045,
1027,
1014,
1010,
2462,
1027,
29137,
1012,
3091,
1025,
1045,
1026,
2462,
1025,
1009,
1009,
1045,
1007,
1063,
10938,
2906,
2278,
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... |
adobe/brackets | src/search/FindInFilesUI.js | searchAndShowResults | function searchAndShowResults(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
return FindInFiles.doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise)
.done(function (zeroFilesToken) {
// Done searching all files: show results
i... | javascript | function searchAndShowResults(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
return FindInFiles.doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise)
.done(function (zeroFilesToken) {
// Done searching all files: show results
i... | [
"function",
"searchAndShowResults",
"(",
"queryInfo",
",",
"scope",
",",
"filter",
",",
"replaceText",
",",
"candidateFilesPromise",
")",
"{",
"return",
"FindInFiles",
".",
"doSearchInScope",
"(",
"queryInfo",
",",
"scope",
",",
"filter",
",",
"replaceText",
",",
... | Does a search in the given scope with the given filter. Shows the result list once the search is complete.
@param {{query: string, caseSensitive: boolean, isRegexp: boolean}} queryInfo Query info object
@param {?Entry} scope Project file/subfolder to search within; else searches whole project.
@param {?string} filter A... | [
"Does",
"a",
"search",
"in",
"the",
"given",
"scope",
"with",
"the",
"given",
"filter",
".",
"Shows",
"the",
"result",
"list",
"once",
"the",
"search",
"is",
"complete",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFilesUI.js#L81-L115 | train | Search and show results | [
30522,
3853,
3945,
29560,
14406,
6072,
11314,
2015,
1006,
23032,
2378,
14876,
1010,
9531,
1010,
11307,
1010,
5672,
18209,
1010,
4018,
8873,
4244,
21572,
28732,
1007,
1063,
2709,
2424,
2378,
8873,
4244,
1012,
13004,
2906,
17231,
26127,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/CreationRow.js | createDefaultToolbar | function createDefaultToolbar(oCreationRow) {
return new OverflowToolbar({
content: [
new ToolbarSpacer(),
new Button({
text: TableUtils.getResourceText("TBL_CREATIONROW_APPLY"),
type: MLibrary.ButtonType.Emphasized,
enabled: oCreationRow.getApplyEnabled(),
press: function() {
oCr... | javascript | function createDefaultToolbar(oCreationRow) {
return new OverflowToolbar({
content: [
new ToolbarSpacer(),
new Button({
text: TableUtils.getResourceText("TBL_CREATIONROW_APPLY"),
type: MLibrary.ButtonType.Emphasized,
enabled: oCreationRow.getApplyEnabled(),
press: function() {
oCr... | [
"function",
"createDefaultToolbar",
"(",
"oCreationRow",
")",
"{",
"return",
"new",
"OverflowToolbar",
"(",
"{",
"content",
":",
"[",
"new",
"ToolbarSpacer",
"(",
")",
",",
"new",
"Button",
"(",
"{",
"text",
":",
"TableUtils",
".",
"getResourceText",
"(",
"\... | Creates a default toolbar providing basic buttons and functionality.
@param {sap.ui.table.CreationRow} oCreationRow The creation row to get the settings for the toolbar creation from.
@returns {sap.m.OverflowToolbar} The default toolbar. | [
"Creates",
"a",
"default",
"toolbar",
"providing",
"basic",
"buttons",
"and",
"functionality",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/CreationRow.js#L165-L181 | train | Creates a toolbar for the given creation row. | [
30522,
3853,
2580,
12879,
23505,
3406,
4747,
8237,
1006,
1051,
16748,
3370,
10524,
1007,
1063,
2709,
2047,
2058,
12314,
3406,
4747,
8237,
1006,
1063,
4180,
1024,
1031,
2047,
6994,
8237,
23058,
2099,
1006,
1007,
1010,
2047,
6462,
1006,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/CodeFolding/main.js | onGutterClick | function onGutterClick(cm, line, gutter, event) {
var opts = cm.state.foldGutter.options, pos = CodeMirror.Pos(line);
if (gutter !== opts.gutter) { return; }
var range;
var _lineFolds = cm._lineFolds;
if (cm.isFolded(line)) {
if (event.altKey) { // unfold code includi... | javascript | function onGutterClick(cm, line, gutter, event) {
var opts = cm.state.foldGutter.options, pos = CodeMirror.Pos(line);
if (gutter !== opts.gutter) { return; }
var range;
var _lineFolds = cm._lineFolds;
if (cm.isFolded(line)) {
if (event.altKey) { // unfold code includi... | [
"function",
"onGutterClick",
"(",
"cm",
",",
"line",
",",
"gutter",
",",
"event",
")",
"{",
"var",
"opts",
"=",
"cm",
".",
"state",
".",
"foldGutter",
".",
"options",
",",
"pos",
"=",
"CodeMirror",
".",
"Pos",
"(",
"line",
")",
";",
"if",
"(",
"gut... | Event handler for gutter click. Manages folding and unfolding code regions. If the Alt key
is pressed while clicking the fold gutter, child code fragments are also folded/unfolded
up to a level defined in the `maxFoldLevel' preference.
@param {!CodeMirror} cm the CodeMirror object
@param {number} line the line number f... | [
"Event",
"handler",
"for",
"gutter",
"click",
".",
"Manages",
"folding",
"and",
"unfolding",
"code",
"regions",
".",
"If",
"the",
"Alt",
"key",
"is",
"pressed",
"while",
"clicking",
"the",
"fold",
"gutter",
"child",
"code",
"fragments",
"are",
"also",
"folde... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L182-L204 | train | On gutter click | [
30522,
3853,
2006,
27920,
3334,
20464,
6799,
1006,
4642,
1010,
2240,
1010,
9535,
3334,
1010,
2724,
1007,
1063,
13075,
23569,
2015,
1027,
4642,
1012,
2110,
1012,
10671,
27920,
3334,
1012,
7047,
1010,
13433,
2015,
1027,
3642,
14503,
29165,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/LocaleData.js | function(sPattern, sCalendarType) {
var oIntervalFormats = this._get(getCLDRCalendarName(sCalendarType), "dateTimeFormats", "intervalFormats"),
sFallbackPattern = oIntervalFormats.intervalFormatFallback;
return sFallbackPattern.replace(/\{(0|1)\}/g, sPattern);
} | javascript | function(sPattern, sCalendarType) {
var oIntervalFormats = this._get(getCLDRCalendarName(sCalendarType), "dateTimeFormats", "intervalFormats"),
sFallbackPattern = oIntervalFormats.intervalFormatFallback;
return sFallbackPattern.replace(/\{(0|1)\}/g, sPattern);
} | [
"function",
"(",
"sPattern",
",",
"sCalendarType",
")",
"{",
"var",
"oIntervalFormats",
"=",
"this",
".",
"_get",
"(",
"getCLDRCalendarName",
"(",
"sCalendarType",
")",
",",
"\"dateTimeFormats\"",
",",
"\"intervalFormats\"",
")",
",",
"sFallbackPattern",
"=",
"oIn... | Get combined interval pattern using a given pattern and the fallback interval pattern.
If a skeleton based pattern is not available or not wanted, this method can be used to create an interval
pattern based on a given pattern, using the fallback interval pattern.
@param {string} sPattern the single date pattern to us... | [
"Get",
"combined",
"interval",
"pattern",
"using",
"a",
"given",
"pattern",
"and",
"the",
"fallback",
"interval",
"pattern",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L319-L323 | train | Returns the pattern to be used for the interval format | [
30522,
3853,
1006,
14690,
16451,
1010,
4094,
8943,
5339,
18863,
1007,
1063,
13075,
1051,
18447,
2121,
10175,
14192,
11149,
1027,
2023,
1012,
1035,
2131,
1006,
2131,
20464,
13626,
9289,
10497,
2906,
18442,
1006,
4094,
8943,
5339,
18863,
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... | |
apache/incubator-echarts | src/chart/helper/Symbol.js | getLabelDefaultText | function getLabelDefaultText(idx, opt) {
return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);
} | javascript | function getLabelDefaultText(idx, opt) {
return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);
} | [
"function",
"getLabelDefaultText",
"(",
"idx",
",",
"opt",
")",
"{",
"return",
"useNameLabel",
"?",
"data",
".",
"getName",
"(",
"idx",
")",
":",
"getDefaultLabel",
"(",
"data",
",",
"idx",
")",
";",
"}"
] | Do not execute util needed. | [
"Do",
"not",
"execute",
"util",
"needed",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/helper/Symbol.js#L320-L322 | train | Get the default text for a given index | [
30522,
3853,
2131,
20470,
14273,
12879,
23505,
18209,
1006,
8909,
2595,
1010,
23569,
1007,
1063,
2709,
2224,
18442,
20470,
2884,
1029,
2951,
1012,
2131,
18442,
1006,
8909,
2595,
1007,
1024,
2131,
3207,
7011,
11314,
20470,
2884,
1006,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/require-atomic-updates.js | isLocalVariableWithoutEscape | function isLocalVariableWithoutEscape(expression, surroundingFunction) {
if (expression.type !== "Identifier") {
return false;
}
const variable = resolveVariable(expression);
if (!variable) {
return false;
}
retur... | javascript | function isLocalVariableWithoutEscape(expression, surroundingFunction) {
if (expression.type !== "Identifier") {
return false;
}
const variable = resolveVariable(expression);
if (!variable) {
return false;
}
retur... | [
"function",
"isLocalVariableWithoutEscape",
"(",
"expression",
",",
"surroundingFunction",
")",
"{",
"if",
"(",
"expression",
".",
"type",
"!==",
"\"Identifier\"",
")",
"{",
"return",
"false",
";",
"}",
"const",
"variable",
"=",
"resolveVariable",
"(",
"expression... | Checks if an expression is a variable that can only be observed within the given function.
@param {ASTNode} expression The expression to check
@param {ASTNode} surroundingFunction The function node
@returns {boolean} `true` if the expression is a variable which is local to the given function, and is never
referenced in... | [
"Checks",
"if",
"an",
"expression",
"is",
"a",
"variable",
"that",
"can",
"only",
"be",
"observed",
"within",
"the",
"given",
"function",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/require-atomic-updates.js#L96-L109 | train | Check if expression is local variable without escaping | [
30522,
3853,
2003,
4135,
9289,
10755,
19210,
24415,
5833,
2229,
19464,
1006,
3670,
1010,
4193,
11263,
27989,
1007,
1063,
2065,
1006,
3670,
1012,
2828,
999,
1027,
1027,
1000,
8909,
4765,
18095,
1000,
1007,
1063,
2709,
6270,
1025,
1065,
9530,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/Inspector/Inspector.js | connectToURL | function connectToURL(url) {
if (_connectDeferred) {
// reject an existing connection attempt
_connectDeferred.reject("CANCEL");
}
var deferred = new $.Deferred();
_connectDeferred = deferred;
var promise = getDebuggableWindows();
promise.done(func... | javascript | function connectToURL(url) {
if (_connectDeferred) {
// reject an existing connection attempt
_connectDeferred.reject("CANCEL");
}
var deferred = new $.Deferred();
_connectDeferred = deferred;
var promise = getDebuggableWindows();
promise.done(func... | [
"function",
"connectToURL",
"(",
"url",
")",
"{",
"if",
"(",
"_connectDeferred",
")",
"{",
"// reject an existing connection attempt",
"_connectDeferred",
".",
"reject",
"(",
"\"CANCEL\"",
")",
";",
"}",
"var",
"deferred",
"=",
"new",
"$",
".",
"Deferred",
"(",
... | Connect to the remote debugger of the page that is at the given URL
@param {string} url | [
"Connect",
"to",
"the",
"remote",
"debugger",
"of",
"the",
"page",
"that",
"is",
"at",
"the",
"given",
"URL"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Inspector/Inspector.js#L321-L345 | train | Connect to a remote URL | [
30522,
3853,
7532,
21163,
2140,
1006,
24471,
2140,
1007,
1063,
2065,
1006,
1035,
7532,
3207,
7512,
5596,
1007,
1063,
1013,
1013,
15454,
2019,
4493,
4434,
3535,
1035,
7532,
3207,
7512,
5596,
1012,
15454,
1006,
1000,
17542,
1000,
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... |
aws-amplify/amplify-js | packages/amazon-cognito-identity-js/src/BigInteger.js | montMulTo | function montMulTo(x, y, r) {
x.multiplyTo(y, r);
this.reduce(r);
} | javascript | function montMulTo(x, y, r) {
x.multiplyTo(y, r);
this.reduce(r);
} | [
"function",
"montMulTo",
"(",
"x",
",",
"y",
",",
"r",
")",
"{",
"x",
".",
"multiplyTo",
"(",
"y",
",",
"r",
")",
";",
"this",
".",
"reduce",
"(",
"r",
")",
";",
"}"
] | r = "xy/R mod m"; x,y != r | [
"r",
"=",
"xy",
"/",
"R",
"mod",
"m",
";",
"x",
"y",
"!",
"=",
"r"
] | db55ff3dff31c64a246180f39eb0a04a89fd16e1 | https://github.com/aws-amplify/amplify-js/blob/db55ff3dff31c64a246180f39eb0a04a89fd16e1/packages/amazon-cognito-identity-js/src/BigInteger.js#L672-L676 | train | multiply x by y and return the result | [
30522,
3853,
18318,
12274,
23223,
1006,
1060,
1010,
1061,
1010,
1054,
1007,
1063,
1060,
1012,
4800,
22086,
3406,
1006,
1061,
1010,
1054,
1007,
1025,
2023,
1012,
5547,
1006,
1054,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-var.js | hasSelfReferenceInTDZ | function hasSelfReferenceInTDZ(declarator) {
if (!declarator.init) {
return false;
}
const variables = context.getDeclaredVariables(declarator);
return variables.some(hasReferenceInTDZ(declarator.init));
} | javascript | function hasSelfReferenceInTDZ(declarator) {
if (!declarator.init) {
return false;
}
const variables = context.getDeclaredVariables(declarator);
return variables.some(hasReferenceInTDZ(declarator.init));
} | [
"function",
"hasSelfReferenceInTDZ",
"(",
"declarator",
")",
"{",
"if",
"(",
"!",
"declarator",
".",
"init",
")",
"{",
"return",
"false",
";",
"}",
"const",
"variables",
"=",
"context",
".",
"getDeclaredVariables",
"(",
"declarator",
")",
";",
"return",
"var... | Checks whether the variables which are defined by the given declarator node have their references in TDZ.
@param {ASTNode} declarator - The VariableDeclarator node to check.
@returns {boolean} `true` if one of the variables which are defined by the given declarator node have their references in TDZ. | [
"Checks",
"whether",
"the",
"variables",
"which",
"are",
"defined",
"by",
"the",
"given",
"declarator",
"node",
"have",
"their",
"references",
"in",
"TDZ",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-var.js#L205-L212 | train | hasSelfReferenceInTDZ - Check if self reference in TDZ | [
30522,
3853,
2038,
11246,
19699,
27235,
24413,
18447,
2094,
2480,
1006,
11703,
8017,
8844,
1007,
1063,
2065,
1006,
999,
11703,
8017,
8844,
1012,
1999,
4183,
1007,
1063,
2709,
6270,
1025,
1065,
9530,
3367,
10857,
1027,
6123,
1012,
2131,
3207... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ecomfe/zrender | src/graphic/IncrementalDisplayable.js | IncrementalDisplayble | function IncrementalDisplayble(opts) {
Displayble.call(this, opts);
this._displayables = [];
this._temporaryDisplayables = [];
this._cursor = 0;
this.notClear = true;
} | javascript | function IncrementalDisplayble(opts) {
Displayble.call(this, opts);
this._displayables = [];
this._temporaryDisplayables = [];
this._cursor = 0;
this.notClear = true;
} | [
"function",
"IncrementalDisplayble",
"(",
"opts",
")",
"{",
"Displayble",
".",
"call",
"(",
"this",
",",
"opts",
")",
";",
"this",
".",
"_displayables",
"=",
"[",
"]",
";",
"this",
".",
"_temporaryDisplayables",
"=",
"[",
"]",
";",
"this",
".",
"_cursor"... | TODO Style override ? | [
"TODO",
"Style",
"override",
"?"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/graphic/IncrementalDisplayable.js#L13-L24 | train | A displayble that is a temporary displayble. | [
30522,
3853,
4297,
28578,
21050,
10521,
13068,
3468,
1006,
23569,
2015,
1007,
1063,
4653,
3468,
1012,
2655,
1006,
2023,
1010,
23569,
2015,
1007,
1025,
2023,
1012,
1035,
4653,
3085,
2015,
1027,
1031,
1033,
1025,
2023,
1012,
1035,
5741,
10521... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/dom/jquery/selectText.js | selectText | function selectText(iStart, iEnd) {
var oDomRef = this.get(0);
try {
// In Chrome 58 and above selection start is set to selection end when the first parameter of a setSelectionRange call is negative.
if (typeof (oDomRef.selectionStart) === "number") {
oDomRef.setSelectionRange(iStart > 0 ? iStart : 0, i... | javascript | function selectText(iStart, iEnd) {
var oDomRef = this.get(0);
try {
// In Chrome 58 and above selection start is set to selection end when the first parameter of a setSelectionRange call is negative.
if (typeof (oDomRef.selectionStart) === "number") {
oDomRef.setSelectionRange(iStart > 0 ? iStart : 0, i... | [
"function",
"selectText",
"(",
"iStart",
",",
"iEnd",
")",
"{",
"var",
"oDomRef",
"=",
"this",
".",
"get",
"(",
"0",
")",
";",
"try",
"{",
"// In Chrome 58 and above selection start is set to selection end when the first parameter of a setSelectionRange call is negative.",
... | This module provides the {@link jQuery#selectText} API.
@namespace
@name module:sap/ui/dom/jquery/selectText
@public
@since 1.58
Sets the text selection in the first element of the collection.
<b>Note</b>: This feature is only supported for input element’s type of text, search, url, tel and password.
@param {int} ... | [
"This",
"module",
"provides",
"the",
"{",
"@link",
"jQuery#selectText",
"}",
"API",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/dom/jquery/selectText.js#L31-L44 | train | Selects the text in the current selection range. | [
30522,
3853,
7276,
18209,
1006,
21541,
8445,
1010,
29464,
4859,
1007,
1063,
13075,
1051,
9527,
2890,
2546,
1027,
2023,
1012,
2131,
1006,
1014,
1007,
1025,
3046,
1063,
1013,
1013,
1999,
18546,
5388,
1998,
2682,
4989,
2707,
2003,
2275,
2000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | updateCollapsedAndCommonAncestor | function updateCollapsedAndCommonAncestor(range) {
range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);
range.commonAncestorContainer = range.collapsed ?
range.startContainer : dom.getCommonAncestor(range.startContainer, range.... | javascript | function updateCollapsedAndCommonAncestor(range) {
range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);
range.commonAncestorContainer = range.collapsed ?
range.startContainer : dom.getCommonAncestor(range.startContainer, range.... | [
"function",
"updateCollapsedAndCommonAncestor",
"(",
"range",
")",
"{",
"range",
".",
"collapsed",
"=",
"(",
"range",
".",
"startContainer",
"===",
"range",
".",
"endContainer",
"&&",
"range",
".",
"startOffset",
"===",
"range",
".",
"endOffset",
")",
";",
"ra... | /*---------------------------------------------------------------------------------------------------------------- Updates commonAncestorContainer and collapsed after boundary change | [
"/",
"*",
"----------------------------------------------------------------------------------------------------------------",
"Updates",
"commonAncestorContainer",
"and",
"collapsed",
"after",
"boundary",
"change"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L2131-L2135 | train | Update collapsed and common ancestor | [
30522,
3853,
10651,
26895,
9331,
6924,
5685,
9006,
21781,
5897,
23809,
1006,
2846,
1007,
1063,
2846,
1012,
7798,
1027,
1006,
2846,
1012,
2707,
8663,
18249,
2121,
1027,
1027,
1027,
2846,
1012,
2203,
8663,
18249,
2121,
1004,
1004,
2846,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | lib/discover_endpoint.js | marshallCustomIdentifiers | function marshallCustomIdentifiers(request, shape) {
var identifiers = {};
marshallCustomIdentifiersHelper(identifiers, request.params, shape);
return identifiers;
} | javascript | function marshallCustomIdentifiers(request, shape) {
var identifiers = {};
marshallCustomIdentifiersHelper(identifiers, request.params, shape);
return identifiers;
} | [
"function",
"marshallCustomIdentifiers",
"(",
"request",
",",
"shape",
")",
"{",
"var",
"identifiers",
"=",
"{",
"}",
";",
"marshallCustomIdentifiersHelper",
"(",
"identifiers",
",",
"request",
".",
"params",
",",
"shape",
")",
";",
"return",
"identifiers",
";",... | Get custom identifiers for cache key.
Identifies custom identifiers by checking each shape's `endpointDiscoveryId` trait.
@param [object] request object
@param [object] input shape of the given operation's api
@api private | [
"Get",
"custom",
"identifiers",
"for",
"cache",
"key",
".",
"Identifies",
"custom",
"identifiers",
"by",
"checking",
"each",
"shape",
"s",
"endpointDiscoveryId",
"trait",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L58-L62 | train | Marshalls custom identifiers from the request. params object. | [
30522,
3853,
5832,
7874,
20389,
5178,
16778,
8873,
2545,
1006,
5227,
1010,
4338,
1007,
1063,
13075,
8909,
4765,
28295,
1027,
1063,
1065,
1025,
5832,
7874,
20389,
5178,
16778,
8873,
2545,
16001,
4842,
1006,
8909,
4765,
28295,
1010,
5227,
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... |
google/closure-library | protractor_spec.js | function(testPath) {
return browser.navigate()
.to(TEST_SERVER + '/' + testPath)
.then(function() {
return waitForTestSuiteCompletion(testPath);
})
.then(function(status) {
if (!status.isSuccess) {
failureReports.push(status.report);
... | javascript | function(testPath) {
return browser.navigate()
.to(TEST_SERVER + '/' + testPath)
.then(function() {
return waitForTestSuiteCompletion(testPath);
})
.then(function(status) {
if (!status.isSuccess) {
failureReports.push(status.report);
... | [
"function",
"(",
"testPath",
")",
"{",
"return",
"browser",
".",
"navigate",
"(",
")",
".",
"to",
"(",
"TEST_SERVER",
"+",
"'/'",
"+",
"testPath",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"return",
"waitForTestSuiteCompletion",
"(",
"testPath",
... | Navigates to testPath to invoke tests. Upon completion inspects returned test status and keeps track of the total number failed tests. | [
"Navigates",
"to",
"testPath",
"to",
"invoke",
"tests",
".",
"Upon",
"completion",
"inspects",
"returned",
"test",
"status",
"and",
"keeps",
"track",
"of",
"the",
"total",
"number",
"failed",
"tests",
"."
] | 97390e9ca4483cebb9628e06026139fbb3023d65 | https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/protractor_spec.js#L119-L132 | train | Aliquivo test | [
30522,
3853,
1006,
3231,
15069,
1007,
1063,
2709,
16602,
1012,
22149,
1006,
1007,
1012,
2000,
1006,
3231,
1035,
8241,
1009,
1005,
1013,
1005,
1009,
3231,
15069,
1007,
1012,
2059,
1006,
3853,
1006,
1007,
1063,
2709,
3524,
13028,
4355,
28880,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SeleniumHQ/selenium | javascript/node/selenium-webdriver/lib/http.js | parseHttpResponse | function parseHttpResponse(command, httpResponse) {
if (httpResponse.status < 200) {
// This should never happen, but throw the raw response so users report it.
throw new error.WebDriverError(
`Unexpected HTTP response:\n${httpResponse}`);
}
let parsed = tryParse(httpResponse.body);
if (parsed ... | javascript | function parseHttpResponse(command, httpResponse) {
if (httpResponse.status < 200) {
// This should never happen, but throw the raw response so users report it.
throw new error.WebDriverError(
`Unexpected HTTP response:\n${httpResponse}`);
}
let parsed = tryParse(httpResponse.body);
if (parsed ... | [
"function",
"parseHttpResponse",
"(",
"command",
",",
"httpResponse",
")",
"{",
"if",
"(",
"httpResponse",
".",
"status",
"<",
"200",
")",
"{",
"// This should never happen, but throw the raw response so users report it.",
"throw",
"new",
"error",
".",
"WebDriverError",
... | Callback used to parse {@link Response} objects from a
{@link HttpClient}.
@param {!cmd.Command} command The command the response is for.
@param {!Response} httpResponse The HTTP response to parse.
@return {{isW3C: boolean, value: ?}} An object describing the parsed
response. This object will have two fields: `isW3C` ... | [
"Callback",
"used",
"to",
"parse",
"{",
"@link",
"Response",
"}",
"objects",
"from",
"a",
"{",
"@link",
"HttpClient",
"}",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/lib/http.js#L536-L581 | train | Parses the HTTP response from the specified command. | [
30522,
3853,
11968,
3366,
11039,
25856,
6072,
26029,
3366,
1006,
3094,
1010,
8299,
6072,
26029,
3366,
1007,
1063,
2065,
1006,
8299,
6072,
26029,
3366,
1012,
3570,
1026,
3263,
1007,
1063,
1013,
1013,
2023,
2323,
2196,
4148,
1010,
2021,
5466,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | onChangePassword | function onChangePassword() {
var password = $('#changed-password').val();
activeUser().updatePassword(password).then(function() {
refreshUserData();
alertSuccess('Password changed!');
}, onAuthError);
} | javascript | function onChangePassword() {
var password = $('#changed-password').val();
activeUser().updatePassword(password).then(function() {
refreshUserData();
alertSuccess('Password changed!');
}, onAuthError);
} | [
"function",
"onChangePassword",
"(",
")",
"{",
"var",
"password",
"=",
"$",
"(",
"'#changed-password'",
")",
".",
"val",
"(",
")",
";",
"activeUser",
"(",
")",
".",
"updatePassword",
"(",
"password",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"r... | Changes the user's password. | [
"Changes",
"the",
"user",
"s",
"password",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L613-L619 | train | Change the password of the user | [
30522,
3853,
2006,
22305,
13699,
12054,
18351,
1006,
1007,
1063,
13075,
20786,
1027,
1002,
1006,
1005,
1001,
2904,
1011,
20786,
1005,
1007,
1012,
11748,
1006,
1007,
1025,
3161,
20330,
1006,
1007,
1012,
10651,
15194,
18351,
1006,
20786,
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... |
fex-team/webuploader | src/uploader.js | function() {
// return this._mgr.getStats.apply( this._mgr, arguments );
var stats = this.request('get-stats');
return stats ? {
successNum: stats.numOfSuccess,
progressNum: stats.numOfProgress,
// who care?
// queueFa... | javascript | function() {
// return this._mgr.getStats.apply( this._mgr, arguments );
var stats = this.request('get-stats');
return stats ? {
successNum: stats.numOfSuccess,
progressNum: stats.numOfProgress,
// who care?
// queueFa... | [
"function",
"(",
")",
"{",
"// return this._mgr.getStats.apply( this._mgr, arguments );",
"var",
"stats",
"=",
"this",
".",
"request",
"(",
"'get-stats'",
")",
";",
"return",
"stats",
"?",
"{",
"successNum",
":",
"stats",
".",
"numOfSuccess",
",",
"progressNum",
"... | 获取文件统计信息。返回一个包含一下信息的对象。
* `successNum` 上传成功的文件数
* `progressNum` 上传中的文件数
* `cancelNum` 被删除的文件数
* `invalidNum` 无效的文件数
* `uploadFailNum` 上传失败的文件数
* `queueNum` 还在队列中的文件数
* `interruptNum` 被暂停的文件数
@method getStats
@grammar getStats() => Object | [
"获取文件统计信息。返回一个包含一下信息的对象。",
"*",
"successNum",
"上传成功的文件数",
"*",
"progressNum",
"上传中的文件数",
"*",
"cancelNum",
"被删除的文件数",
"*",
"invalidNum",
"无效的文件数",
"*",
"uploadFailNum",
"上传失败的文件数",
"*",
"queueNum",
"还在队列中的文件数",
"*",
"interruptNum",
"被暂停的文件数"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/src/uploader.js#L123-L139 | train | Get stats from the cisco | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
2709,
2023,
1012,
1035,
11460,
2099,
1012,
4152,
29336,
2015,
1012,
6611,
1006,
2023,
1012,
1035,
11460,
2099,
1010,
9918,
1007,
1025,
13075,
26319,
1027,
2023,
1012,
5227,
1006,
1005,
2131,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/util/IndexWorker.js | preprocessQuery | function preprocessQuery(sQuery) {
var base;
for (var i = 0; i < AUTO_GENERATED_METHOD_PREFIXES.length; i++) {
var sPrefix = AUTO_GENERATED_METHOD_PREFIXES[i];
if (sQuery.indexOf(sPrefix) === 0) {
base = sQuery.substring(sPrefix.length);
}
}
if (base && WORD_REGEX.test(base)) {
sQuery += OR_se... | javascript | function preprocessQuery(sQuery) {
var base;
for (var i = 0; i < AUTO_GENERATED_METHOD_PREFIXES.length; i++) {
var sPrefix = AUTO_GENERATED_METHOD_PREFIXES[i];
if (sQuery.indexOf(sPrefix) === 0) {
base = sQuery.substring(sPrefix.length);
}
}
if (base && WORD_REGEX.test(base)) {
sQuery += OR_se... | [
"function",
"preprocessQuery",
"(",
"sQuery",
")",
"{",
"var",
"base",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"AUTO_GENERATED_METHOD_PREFIXES",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"sPrefix",
"=",
"AUTO_GENERATED_METHOD_PREFIXES",
... | Extends the search string to increase the chance to find *metadata*-specific terms
e.g. when user searched for 'attachPress'
=> modify into 'attachPress OR press'
@param sQuery
@returns {*} | [
"Extends",
"the",
"search",
"string",
"to",
"increase",
"the",
"chance",
"to",
"find",
"*",
"metadata",
"*",
"-",
"specific",
"terms"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/util/IndexWorker.js#L211-L225 | train | Pre - processes a query string to be used in the search string | [
30522,
3853,
17463,
3217,
9623,
17729,
2854,
1006,
5490,
13094,
2100,
1007,
1063,
13075,
2918,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
8285,
1035,
7013,
1035,
4118,
1035,
17576,
2229,
1012,
3091,
1025,
1045,
1009,
1009,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js | function () {
var attributeString = JSON.stringify(this.attributes);
this.attributeSignature = MurmurHash3.hashString(attributeString, attributeString.length, seed);
} | javascript | function () {
var attributeString = JSON.stringify(this.attributes);
this.attributeSignature = MurmurHash3.hashString(attributeString, attributeString.length, seed);
} | [
"function",
"(",
")",
"{",
"var",
"attributeString",
"=",
"JSON",
".",
"stringify",
"(",
"this",
".",
"attributes",
")",
";",
"this",
".",
"attributeSignature",
"=",
"MurmurHash3",
".",
"hashString",
"(",
"attributeString",
",",
"attributeString",
".",
"length... | Updates the signature of this node's attributes. Call this after making attribute changes. | [
"Updates",
"the",
"signature",
"of",
"this",
"node",
"s",
"attributes",
".",
"Call",
"this",
"after",
"making",
"attribute",
"changes",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js#L165-L168 | train | Generate signature for the attribute | [
30522,
3853,
1006,
1007,
1063,
13075,
12332,
18886,
3070,
1027,
1046,
3385,
1012,
5164,
8757,
1006,
2023,
1012,
12332,
1007,
1025,
2023,
1012,
12332,
23773,
4017,
5397,
1027,
20227,
14949,
2232,
2509,
1012,
23325,
3367,
4892,
1006,
12332,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js | function(oControl, sDim){
var oProp = getPropertyInfo(oControl, sDim);
if (oProp) {
var val = oControl[oProp._sGetter]();
if (val && val.endsWith("%")) {
return val;
}
}
return null;
} | javascript | function(oControl, sDim){
var oProp = getPropertyInfo(oControl, sDim);
if (oProp) {
var val = oControl[oProp._sGetter]();
if (val && val.endsWith("%")) {
return val;
}
}
return null;
} | [
"function",
"(",
"oControl",
",",
"sDim",
")",
"{",
"var",
"oProp",
"=",
"getPropertyInfo",
"(",
"oControl",
",",
"sDim",
")",
";",
"if",
"(",
"oProp",
")",
"{",
"var",
"val",
"=",
"oControl",
"[",
"oProp",
".",
"_sGetter",
"]",
"(",
")",
";",
"if"... | Returns the value width or height property (depending of <code>sDim</code>) of the given
control if the width or height is specified in %.
@private | [
"Returns",
"the",
"value",
"width",
"or",
"height",
"property",
"(",
"depending",
"of",
"<code",
">",
"sDim<",
"/",
"code",
">",
")",
"of",
"the",
"given",
"control",
"if",
"the",
"width",
"or",
"height",
"is",
"specified",
"in",
"%",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js#L420-L429 | train | Returns the value of the property of the given control. | [
30522,
3853,
1006,
1051,
8663,
13181,
2140,
1010,
17371,
5714,
1007,
1063,
13075,
6728,
18981,
1027,
2131,
21572,
4842,
3723,
2378,
14876,
1006,
1051,
8663,
13181,
2140,
1010,
17371,
5714,
1007,
1025,
2065,
1006,
6728,
18981,
1007,
1063,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aframevr/aframe | src/extras/primitives/primitives.js | definePrimitive | function definePrimitive (tagName, defaultComponents, mappings) {
// If no initial mappings provided, start from empty map.
mappings = mappings || {};
// From the default components, add mapping automagically.
Object.keys(defaultComponents).map(function buildMappings (componentName) {
addComponentMapping(c... | javascript | function definePrimitive (tagName, defaultComponents, mappings) {
// If no initial mappings provided, start from empty map.
mappings = mappings || {};
// From the default components, add mapping automagically.
Object.keys(defaultComponents).map(function buildMappings (componentName) {
addComponentMapping(c... | [
"function",
"definePrimitive",
"(",
"tagName",
",",
"defaultComponents",
",",
"mappings",
")",
"{",
"// If no initial mappings provided, start from empty map.",
"mappings",
"=",
"mappings",
"||",
"{",
"}",
";",
"// From the default components, add mapping automagically.",
"Obje... | Helper to define a primitive, building mappings using a component schema. | [
"Helper",
"to",
"define",
"a",
"primitive",
"building",
"mappings",
"using",
"a",
"component",
"schema",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/extras/primitives/primitives.js#L182-L196 | train | Define a primitive. | [
30522,
3853,
9375,
18098,
27605,
6024,
1006,
6415,
18442,
1010,
12398,
9006,
29513,
7666,
1010,
12375,
2015,
1007,
1063,
1013,
1013,
2065,
2053,
3988,
12375,
2015,
3024,
1010,
2707,
2013,
4064,
4949,
1012,
12375,
2015,
1027,
12375,
2015,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mattdesl/canvas-sketch | examples/shader.js | createDrawQuad | function createDrawQuad () {
return regl({
// Pass down props from javascript
uniforms: uniforms,
// Fall back to a simple fragment shader
frag: opt.frag || [
'precision highp float;',
'',
'void main () {',
' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
... | javascript | function createDrawQuad () {
return regl({
// Pass down props from javascript
uniforms: uniforms,
// Fall back to a simple fragment shader
frag: opt.frag || [
'precision highp float;',
'',
'void main () {',
' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
... | [
"function",
"createDrawQuad",
"(",
")",
"{",
"return",
"regl",
"(",
"{",
"// Pass down props from javascript",
"uniforms",
":",
"uniforms",
",",
"// Fall back to a simple fragment shader",
"frag",
":",
"opt",
".",
"frag",
"||",
"[",
"'precision highp float;'",
",",
"'... | Draw command | [
"Draw",
"command"
] | 4addd0fe3fc053065ca8597ab204e43587c52879 | https://github.com/mattdesl/canvas-sketch/blob/4addd0fe3fc053065ca8597ab204e43587c52879/examples/shader.js#L102-L142 | train | Create a draw quad shader | [
30522,
3853,
2580,
2527,
2860,
16211,
2094,
1006,
1007,
1063,
2709,
19723,
2140,
1006,
1063,
1013,
1013,
3413,
2091,
24387,
2013,
9262,
22483,
11408,
1024,
11408,
1010,
1013,
1013,
2991,
2067,
2000,
1037,
3722,
15778,
8703,
2099,
25312,
229... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Microsoft/vscode | build/gulpfile.vscode.js | computeChecksums | function computeChecksums(out, filenames) {
var result = {};
filenames.forEach(function (filename) {
var fullPath = path.join(process.cwd(), out, filename);
result[filename] = computeChecksum(fullPath);
});
return result;
} | javascript | function computeChecksums(out, filenames) {
var result = {};
filenames.forEach(function (filename) {
var fullPath = path.join(process.cwd(), out, filename);
result[filename] = computeChecksum(fullPath);
});
return result;
} | [
"function",
"computeChecksums",
"(",
"out",
",",
"filenames",
")",
"{",
"var",
"result",
"=",
"{",
"}",
";",
"filenames",
".",
"forEach",
"(",
"function",
"(",
"filename",
")",
"{",
"var",
"fullPath",
"=",
"path",
".",
"join",
"(",
"process",
".",
"cwd... | Compute checksums for some files.
@param {string} out The out folder to read the file from.
@param {string[]} filenames The paths to compute a checksum for.
@return {Object} A map of paths to checksums. | [
"Compute",
"checksums",
"for",
"some",
"files",
"."
] | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/build/gulpfile.vscode.js#L230-L237 | train | Compute checksums for a list of filenames | [
30522,
3853,
24134,
5403,
10603,
18163,
1006,
2041,
1010,
5371,
18442,
2015,
1007,
1063,
13075,
2765,
1027,
1063,
1065,
1025,
5371,
18442,
2015,
1012,
18921,
6776,
1006,
3853,
1006,
5371,
18442,
1007,
1063,
13075,
2440,
15069,
1027,
4130,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/toast/toast.js | toastDefaultOptions | function toastDefaultOptions($animate, $mdToast, $mdUtil, $mdMedia, $document) {
var SWIPE_EVENTS = '$md.swipeleft $md.swiperight $md.swipeup $md.swipedown';
return {
onShow: onShow,
onRemove: onRemove,
toastClass: '',
position: 'bottom left',
themable: true,
hideDelay: 3000,... | javascript | function toastDefaultOptions($animate, $mdToast, $mdUtil, $mdMedia, $document) {
var SWIPE_EVENTS = '$md.swipeleft $md.swiperight $md.swipeup $md.swipedown';
return {
onShow: onShow,
onRemove: onRemove,
toastClass: '',
position: 'bottom left',
themable: true,
hideDelay: 3000,... | [
"function",
"toastDefaultOptions",
"(",
"$animate",
",",
"$mdToast",
",",
"$mdUtil",
",",
"$mdMedia",
",",
"$document",
")",
"{",
"var",
"SWIPE_EVENTS",
"=",
"'$md.swipeleft $md.swiperight $md.swipeup $md.swipedown'",
";",
"return",
"{",
"onShow",
":",
"onShow",
",",
... | /* @ngInject | [
"/",
"*"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/toast/toast.js#L419-L565 | train | The default options for the toast | [
30522,
3853,
15174,
3207,
7011,
11314,
7361,
9285,
1006,
1002,
2019,
21499,
1010,
1002,
9108,
3406,
14083,
1010,
1002,
9108,
21823,
2140,
1010,
1002,
9108,
16969,
1010,
1002,
6254,
1007,
1063,
13075,
25430,
15457,
1035,
2824,
1027,
1005,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/XMLTemplateProcessor.js | createControlOrExtension | function createControlOrExtension(node) { // this will also be extended for Fragments with multiple roots
if (localName(node) === "ExtensionPoint" && node.namespaceURI === "sap.ui.core" ) {
if (bEnrichFullIds) {
// Processing the different types of ExtensionPoints (XML, JS...) is not possible, hence
... | javascript | function createControlOrExtension(node) { // this will also be extended for Fragments with multiple roots
if (localName(node) === "ExtensionPoint" && node.namespaceURI === "sap.ui.core" ) {
if (bEnrichFullIds) {
// Processing the different types of ExtensionPoints (XML, JS...) is not possible, hence
... | [
"function",
"createControlOrExtension",
"(",
"node",
")",
"{",
"// this will also be extended for Fragments with multiple roots",
"if",
"(",
"localName",
"(",
"node",
")",
"===",
"\"ExtensionPoint\"",
"&&",
"node",
".",
"namespaceURI",
"===",
"\"sap.ui.core\"",
")",
"{",
... | Creates 0..n UI5 controls from an XML node which is not plain HTML, but a UI5 node (either control or
ExtensionPoint). One control for regular controls, zero for ExtensionPoints without configured extension
and n controls for multi-root Fragments.
@return {Promise} resolving to an array with 0..n controls created from... | [
"Creates",
"0",
"..",
"n",
"UI5",
"controls",
"from",
"an",
"XML",
"node",
"which",
"is",
"not",
"plain",
"HTML",
"but",
"a",
"UI5",
"node",
"(",
"either",
"control",
"or",
"ExtensionPoint",
")",
".",
"One",
"control",
"for",
"regular",
"controls",
"zero... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/XMLTemplateProcessor.js#L576-L631 | train | Creates a control or extension point | [
30522,
3853,
3443,
8663,
13181,
20186,
18413,
6132,
3258,
1006,
13045,
1007,
1063,
1013,
1013,
2023,
2097,
2036,
2022,
3668,
2005,
10341,
2007,
3674,
6147,
2065,
1006,
2334,
18442,
1006,
13045,
1007,
1027,
1027,
1027,
1000,
5331,
8400,
1000... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-useless-concat.js | getLeft | function getLeft(node) {
let left = node.left;
while (isConcatenation(left)) {
left = left.right;
}
return left;
} | javascript | function getLeft(node) {
let left = node.left;
while (isConcatenation(left)) {
left = left.right;
}
return left;
} | [
"function",
"getLeft",
"(",
"node",
")",
"{",
"let",
"left",
"=",
"node",
".",
"left",
";",
"while",
"(",
"isConcatenation",
"(",
"left",
")",
")",
"{",
"left",
"=",
"left",
".",
"right",
";",
"}",
"return",
"left",
";",
"}"
] | Get's the right most node on the left side of a BinaryExpression with + operator.
@param {ASTNode} node - A BinaryExpression node to check.
@returns {ASTNode} node | [
"Get",
"s",
"the",
"right",
"most",
"node",
"on",
"the",
"left",
"side",
"of",
"a",
"BinaryExpression",
"with",
"+",
"operator",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-useless-concat.js#L40-L47 | train | Returns the left node of a node | [
30522,
3853,
2131,
2571,
6199,
1006,
13045,
1007,
1063,
2292,
2187,
1027,
13045,
1012,
2187,
1025,
2096,
1006,
2003,
8663,
16280,
9323,
1006,
2187,
1007,
1007,
1063,
2187,
1027,
2187,
1012,
2157,
1025,
1065,
2709,
2187,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/space-infix-ops.js | checkBinary | function checkBinary(node) {
const leftNode = (node.left.typeAnnotation) ? node.left.typeAnnotation : node.left;
const rightNode = node.right;
// search for = in AssignmentPattern nodes
const operator = node.operator || "=";
const nonSpacedNode = getFirstNon... | javascript | function checkBinary(node) {
const leftNode = (node.left.typeAnnotation) ? node.left.typeAnnotation : node.left;
const rightNode = node.right;
// search for = in AssignmentPattern nodes
const operator = node.operator || "=";
const nonSpacedNode = getFirstNon... | [
"function",
"checkBinary",
"(",
"node",
")",
"{",
"const",
"leftNode",
"=",
"(",
"node",
".",
"left",
".",
"typeAnnotation",
")",
"?",
"node",
".",
"left",
".",
"typeAnnotation",
":",
"node",
".",
"left",
";",
"const",
"rightNode",
"=",
"node",
".",
"r... | Check if the node is binary then report
@param {ASTNode} node node to evaluate
@returns {void}
@private | [
"Check",
"if",
"the",
"node",
"is",
"binary",
"then",
"report"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/space-infix-ops.js#L103-L117 | train | Check if BinaryExpression is valid | [
30522,
3853,
4638,
21114,
2854,
1006,
13045,
1007,
1063,
9530,
3367,
2187,
3630,
3207,
1027,
1006,
13045,
1012,
2187,
1012,
2828,
11639,
17287,
3508,
1007,
1029,
13045,
1012,
2187,
1012,
2828,
11639,
17287,
3508,
1024,
13045,
1012,
2187,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/datepicker/js/calendarMonthBody.js | CalendarMonthBodyCtrl | function CalendarMonthBodyCtrl($element, $$mdDateUtil, $mdDateLocale) {
/** @final {!angular.JQLite} */
this.$element = $element;
/** @final */
this.dateUtil = $$mdDateUtil;
/** @final */
this.dateLocale = $mdDateLocale;
/** @type {Object} Reference to the month view. */
this.monthCtr... | javascript | function CalendarMonthBodyCtrl($element, $$mdDateUtil, $mdDateLocale) {
/** @final {!angular.JQLite} */
this.$element = $element;
/** @final */
this.dateUtil = $$mdDateUtil;
/** @final */
this.dateLocale = $mdDateLocale;
/** @type {Object} Reference to the month view. */
this.monthCtr... | [
"function",
"CalendarMonthBodyCtrl",
"(",
"$element",
",",
"$$mdDateUtil",
",",
"$mdDateLocale",
")",
"{",
"/** @final {!angular.JQLite} */",
"this",
".",
"$element",
"=",
"$element",
";",
"/** @final */",
"this",
".",
"dateUtil",
"=",
"$$mdDateUtil",
";",
"/** @final... | Controller for a single calendar month.
@ngInject @constructor | [
"Controller",
"for",
"a",
"single",
"calendar",
"month",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendarMonthBody.js#L49-L77 | train | The CalendarMonthBodyCtrl constructor. | [
30522,
3853,
8094,
9629,
2232,
23684,
6593,
12190,
1006,
1002,
5783,
1010,
1002,
1002,
9108,
13701,
21823,
2140,
1010,
1002,
9108,
13701,
4135,
9289,
2063,
1007,
1063,
1013,
1008,
1008,
1030,
2345,
1063,
999,
16108,
1012,
1046,
4160,
22779,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jhipster/generator-jhipster | generators/utils.js | buildEnumInfo | function buildEnumInfo(field, angularAppName, packageName, clientRootFolder) {
const fieldType = field.fieldType;
field.enumInstance = _.lowerFirst(fieldType);
const enumInfo = {
enumName: fieldType,
enumValues: field.fieldValues.split(',').join(', '),
enumInstance: field.enumInstanc... | javascript | function buildEnumInfo(field, angularAppName, packageName, clientRootFolder) {
const fieldType = field.fieldType;
field.enumInstance = _.lowerFirst(fieldType);
const enumInfo = {
enumName: fieldType,
enumValues: field.fieldValues.split(',').join(', '),
enumInstance: field.enumInstanc... | [
"function",
"buildEnumInfo",
"(",
"field",
",",
"angularAppName",
",",
"packageName",
",",
"clientRootFolder",
")",
"{",
"const",
"fieldType",
"=",
"field",
".",
"fieldType",
";",
"field",
".",
"enumInstance",
"=",
"_",
".",
"lowerFirst",
"(",
"fieldType",
")"... | Build an enum object
@param {any} field : entity field
@param {string} angularAppName
@param {string} packageName | [
"Build",
"an",
"enum",
"object"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/utils.js#L378-L391 | train | Build an enum info object | [
30522,
3853,
3857,
2368,
12717,
2078,
14876,
1006,
2492,
1010,
16108,
29098,
18442,
1010,
7427,
18442,
1010,
7396,
3217,
4140,
10371,
2121,
1007,
1063,
9530,
3367,
2492,
13874,
1027,
2492,
1012,
2492,
13874,
1025,
2492,
1012,
4372,
12717,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/ScopeManager.js | addPendingRequest | function addPendingRequest(file, offset, type) {
var requests,
key = file + "@" + offset.line + "@" + offset.ch,
$deferredRequest;
// Reject detected exclusions
if (isFileExcludedInternal(file)) {
return (new $.Deferred()).reject().promise();
}
... | javascript | function addPendingRequest(file, offset, type) {
var requests,
key = file + "@" + offset.line + "@" + offset.ch,
$deferredRequest;
// Reject detected exclusions
if (isFileExcludedInternal(file)) {
return (new $.Deferred()).reject().promise();
}
... | [
"function",
"addPendingRequest",
"(",
"file",
",",
"offset",
",",
"type",
")",
"{",
"var",
"requests",
",",
"key",
"=",
"file",
"+",
"\"@\"",
"+",
"offset",
".",
"line",
"+",
"\"@\"",
"+",
"offset",
".",
"ch",
",",
"$deferredRequest",
";",
"// Reject det... | Add a pending request waiting for the tern-module to complete.
If file is a detected exclusion, then reject request.
@param {string} file - the name of the file
@param {{line: number, ch: number}} offset - the offset into the file the request is for
@param {string} type - the type of request
@return {jQuery.Promise} -... | [
"Add",
"a",
"pending",
"request",
"waiting",
"for",
"the",
"tern",
"-",
"module",
"to",
"complete",
".",
"If",
"file",
"is",
"a",
"detected",
"exclusion",
"then",
"reject",
"request",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L278-L301 | train | Add a pending request to the tern process | [
30522,
3853,
5587,
11837,
4667,
2890,
15500,
1006,
5371,
1010,
16396,
1010,
2828,
1007,
1063,
13075,
11186,
1010,
3145,
1027,
5371,
1009,
1000,
1030,
1000,
1009,
16396,
1012,
2240,
1009,
1000,
1030,
1000,
1009,
16396,
1012,
10381,
1010,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/appVariant/Feature.js | processArray | function processArray(aPromises) {
return aPromises.reduce(function(pacc, fn) {
return pacc.then(fn);
}, Promise.resolve())
.catch(function() {
return Promise.resolve(false);
});
} | javascript | function processArray(aPromises) {
return aPromises.reduce(function(pacc, fn) {
return pacc.then(fn);
}, Promise.resolve())
.catch(function() {
return Promise.resolve(false);
});
} | [
"function",
"processArray",
"(",
"aPromises",
")",
"{",
"return",
"aPromises",
".",
"reduce",
"(",
"function",
"(",
"pacc",
",",
"fn",
")",
"{",
"return",
"pacc",
".",
"then",
"(",
"fn",
")",
";",
"}",
",",
"Promise",
".",
"resolve",
"(",
")",
")",
... | Execute a list of Promises | [
"Execute",
"a",
"list",
"of",
"Promises"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/appVariant/Feature.js#L263-L270 | train | Process an array of promises | [
30522,
3853,
2832,
2906,
9447,
1006,
19804,
20936,
8583,
1007,
1063,
2709,
19804,
20936,
8583,
1012,
5547,
1006,
3853,
1006,
14397,
2278,
1010,
1042,
2078,
1007,
1063,
2709,
14397,
2278,
1012,
2059,
1006,
1042,
2078,
1007,
1025,
1065,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/qunit/QUnitUtils.js | mapKeyCodeToKey | function mapKeyCodeToKey(sKeyCode) {
// look up number in KeyCodes enum to get the string
if (!isNaN(sKeyCode)) {
sKeyCode = getKeyCodeStringFromNumber(sKeyCode);
}
if (!sKeyCode) {
return undefined;
}
sKeyCode = sKeyCode.toLowerCase();
// replace underscores with dash character such as 'ARROW_LEFT... | javascript | function mapKeyCodeToKey(sKeyCode) {
// look up number in KeyCodes enum to get the string
if (!isNaN(sKeyCode)) {
sKeyCode = getKeyCodeStringFromNumber(sKeyCode);
}
if (!sKeyCode) {
return undefined;
}
sKeyCode = sKeyCode.toLowerCase();
// replace underscores with dash character such as 'ARROW_LEFT... | [
"function",
"mapKeyCodeToKey",
"(",
"sKeyCode",
")",
"{",
"// look up number in KeyCodes enum to get the string",
"if",
"(",
"!",
"isNaN",
"(",
"sKeyCode",
")",
")",
"{",
"sKeyCode",
"=",
"getKeyCodeStringFromNumber",
"(",
"sKeyCode",
")",
";",
"}",
"if",
"(",
"!"... | Maps the input keyCode to key property
@param sKeyCode {string|Integer} keyCode number or string, e.g. 27 or ESCAPE
@returns {*} the key property of KeyBoardEvent, e.g. Escape | [
"Maps",
"the",
"input",
"keyCode",
"to",
"key",
"property"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/QUnitUtils.js#L356-L404 | train | Converts a key code to a key string | [
30522,
3853,
4949,
14839,
16044,
18715,
3240,
1006,
15315,
3240,
16044,
1007,
1063,
1013,
1013,
2298,
2039,
2193,
1999,
3145,
23237,
4372,
2819,
2000,
2131,
1996,
5164,
2065,
1006,
999,
3475,
2319,
1006,
15315,
3240,
16044,
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... |
aws/aws-sdk-js | lib/service.js | addDefaultMonitoringListeners | function addDefaultMonitoringListeners(attachOn) {
attachOn.addNamedListener('MONITOR_EVENTS_BUBBLE', 'apiCallAttempt', function EVENTS_BUBBLE(event) {
var baseClass = Object.getPrototypeOf(attachOn);
if (baseClass._events) baseClass.emit('apiCallAttempt', [event]);
});
attachOn.addNamedListener... | javascript | function addDefaultMonitoringListeners(attachOn) {
attachOn.addNamedListener('MONITOR_EVENTS_BUBBLE', 'apiCallAttempt', function EVENTS_BUBBLE(event) {
var baseClass = Object.getPrototypeOf(attachOn);
if (baseClass._events) baseClass.emit('apiCallAttempt', [event]);
});
attachOn.addNamedListener... | [
"function",
"addDefaultMonitoringListeners",
"(",
"attachOn",
")",
"{",
"attachOn",
".",
"addNamedListener",
"(",
"'MONITOR_EVENTS_BUBBLE'",
",",
"'apiCallAttempt'",
",",
"function",
"EVENTS_BUBBLE",
"(",
"event",
")",
"{",
"var",
"baseClass",
"=",
"Object",
".",
"g... | @param attachOn attach default monitoring listeners to object
Each monitoring event should be emitted from service client to service constructor prototype and then
to global service prototype like bubbling up. These default monitoring events listener will transfer
the monitoring events to the upper layer.
@api private | [
"@param",
"attachOn",
"attach",
"default",
"monitoring",
"listeners",
"to",
"object"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L797-L806 | train | Add default listeners to the attachOn object | [
30522,
3853,
5587,
3207,
7011,
11314,
8202,
15660,
2075,
9863,
24454,
2015,
1006,
22476,
2239,
1007,
1063,
22476,
2239,
1012,
5587,
18442,
19422,
27870,
3678,
1006,
1005,
8080,
1035,
2824,
1035,
11957,
1005,
1010,
1005,
29197,
20051,
18532,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/EditorCommandHandlers.js | _isPrevTokenABlockComment | function _isPrevTokenABlockComment(ctx, prefix, suffix, prefixExp, suffixExp, lineExp) {
// Start searching from the previous token
var result = TokenUtils.moveSkippingWhitespace(TokenUtils.movePrevToken, ctx);
// Look backwards until we find a none line comment token
while (result && _... | javascript | function _isPrevTokenABlockComment(ctx, prefix, suffix, prefixExp, suffixExp, lineExp) {
// Start searching from the previous token
var result = TokenUtils.moveSkippingWhitespace(TokenUtils.movePrevToken, ctx);
// Look backwards until we find a none line comment token
while (result && _... | [
"function",
"_isPrevTokenABlockComment",
"(",
"ctx",
",",
"prefix",
",",
"suffix",
",",
"prefixExp",
",",
"suffixExp",
",",
"lineExp",
")",
"{",
"// Start searching from the previous token",
"var",
"result",
"=",
"TokenUtils",
".",
"moveSkippingWhitespace",
"(",
"Toke... | @private
Given a token context it will search backwards to determine if the given token is part of a block comment
that doesn't start at the initial token. This is used to know if a line comment is part of a block comment
or if a block delimiter is the prefix or suffix, by passing a token context at that position. Sinc... | [
"@private",
"Given",
"a",
"token",
"context",
"it",
"will",
"search",
"backwards",
"to",
"determine",
"if",
"the",
"given",
"token",
"is",
"part",
"of",
"a",
"block",
"comment",
"that",
"doesn",
"t",
"start",
"at",
"the",
"initial",
"token",
".",
"This",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorCommandHandlers.js#L274-L298 | train | Check if the previous token is a block comment | [
30522,
3853,
1035,
2003,
30524,
23467,
9006,
3672,
1006,
14931,
2595,
1010,
17576,
1010,
16809,
1010,
17576,
10288,
2361,
1010,
16809,
10288,
2361,
1010,
2240,
10288,
2361,
1007,
1063,
1013,
1013,
2707,
6575,
2013,
1996,
3025,
19204,
13075,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | bindSliderEvents | function bindSliderEvents ( behaviour ) {
// Attach the standard drag event to the handles.
if ( !behaviour.fixed ) {
scope_Handles.forEach(function( handle, index ){
// These events are only bound to the visual handle
// element, not th... | javascript | function bindSliderEvents ( behaviour ) {
// Attach the standard drag event to the handles.
if ( !behaviour.fixed ) {
scope_Handles.forEach(function( handle, index ){
// These events are only bound to the visual handle
// element, not th... | [
"function",
"bindSliderEvents",
"(",
"behaviour",
")",
"{",
"// Attach the standard drag event to the handles.",
"if",
"(",
"!",
"behaviour",
".",
"fixed",
")",
"{",
"scope_Handles",
".",
"forEach",
"(",
"function",
"(",
"handle",
",",
"index",
")",
"{",
"// These... | Attach events to several slider parts. | [
"Attach",
"events",
"to",
"several",
"slider",
"parts",
"."
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L1658-L1715 | train | Binds the events to the slider base. | [
30522,
3853,
20817,
24198,
2890,
15338,
2015,
1006,
9164,
1007,
1063,
1013,
1013,
22476,
1996,
3115,
8011,
2724,
2000,
1996,
16024,
1012,
2065,
1006,
999,
9164,
1012,
4964,
1007,
1063,
9531,
1035,
16024,
1012,
18921,
6776,
1006,
3853,
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... |
aframevr/aframe | examples/showcase/link-traversal/js/components/aframe-tooltip-component.js | function () {
var el = this.el;
var data = this.data;
var quad = this.quad = document.createElement('a-entity');
var self = this;
quad.setAttribute('rotation', data.rotation);
quad.setAttribute('text', {width: .25, color: '#fff', value: data.text, align: 'center'});
el.append... | javascript | function () {
var el = this.el;
var data = this.data;
var quad = this.quad = document.createElement('a-entity');
var self = this;
quad.setAttribute('rotation', data.rotation);
quad.setAttribute('text', {width: .25, color: '#fff', value: data.text, align: 'center'});
el.append... | [
"function",
"(",
")",
"{",
"var",
"el",
"=",
"this",
".",
"el",
";",
"var",
"data",
"=",
"this",
".",
"data",
";",
"var",
"quad",
"=",
"this",
".",
"quad",
"=",
"document",
".",
"createElement",
"(",
"'a-entity'",
")",
";",
"var",
"self",
"=",
"t... | Called once when component is attached. Generally for initial setup. | [
"Called",
"once",
"when",
"component",
"is",
"attached",
".",
"Generally",
"for",
"initial",
"setup",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/examples/showcase/link-traversal/js/components/aframe-tooltip-component.js#L80-L99 | train | Create the tooltip | [
30522,
3853,
1006,
1007,
1063,
13075,
3449,
1027,
2023,
1012,
3449,
1025,
13075,
2951,
1027,
2023,
1012,
2951,
1025,
13075,
17718,
1027,
2023,
1012,
17718,
1027,
6254,
1012,
3443,
12260,
3672,
1006,
1005,
1037,
1011,
9178,
1005,
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... | |
swimlane/ngx-datatable | release/utils/column.js | columnTotalWidth | function columnTotalWidth(columns, prop) {
var totalWidth = 0;
if (columns) {
for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
var c = columns_1[_i];
var has = prop && c[prop];
var width = has ? c[prop] : c.width;
totalWidth = totalWidt... | javascript | function columnTotalWidth(columns, prop) {
var totalWidth = 0;
if (columns) {
for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
var c = columns_1[_i];
var has = prop && c[prop];
var width = has ? c[prop] : c.width;
totalWidth = totalWidt... | [
"function",
"columnTotalWidth",
"(",
"columns",
",",
"prop",
")",
"{",
"var",
"totalWidth",
"=",
"0",
";",
"if",
"(",
"columns",
")",
"{",
"for",
"(",
"var",
"_i",
"=",
"0",
",",
"columns_1",
"=",
"columns",
";",
"_i",
"<",
"columns_1",
".",
"length"... | Calculates the total width of all columns and their groups | [
"Calculates",
"the",
"total",
"width",
"of",
"all",
"columns",
"and",
"their",
"groups"
] | d7df15a070282a169524dba51d9572008b74804c | https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column.js#L44-L55 | train | Get total width of a column | [
30522,
3853,
5930,
3406,
9080,
9148,
11927,
2232,
1006,
7753,
1010,
17678,
1007,
1063,
13075,
2561,
9148,
11927,
2232,
1027,
1014,
1025,
2065,
1006,
7753,
1007,
1063,
2005,
1006,
13075,
1035,
1045,
1027,
1014,
1010,
7753,
1035,
1015,
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... |
tensorflow/tfjs-models | posenet/demos/camera.js | setupGui | function setupGui(cameras, net) {
guiState.net = net;
if (cameras.length > 0) {
guiState.camera = cameras[0].deviceId;
}
const gui = new dat.GUI({width: 300});
// The single-pose algorithm is faster and simpler but requires only one
// person to be in the frame or results will be innaccurate. Multi-p... | javascript | function setupGui(cameras, net) {
guiState.net = net;
if (cameras.length > 0) {
guiState.camera = cameras[0].deviceId;
}
const gui = new dat.GUI({width: 300});
// The single-pose algorithm is faster and simpler but requires only one
// person to be in the frame or results will be innaccurate. Multi-p... | [
"function",
"setupGui",
"(",
"cameras",
",",
"net",
")",
"{",
"guiState",
".",
"net",
"=",
"net",
";",
"if",
"(",
"cameras",
".",
"length",
">",
"0",
")",
"{",
"guiState",
".",
"camera",
"=",
"cameras",
"[",
"0",
"]",
".",
"deviceId",
";",
"}",
"... | Sets up dat.gui controller on the top-right of the window | [
"Sets",
"up",
"dat",
".",
"gui",
"controller",
"on",
"the",
"top",
"-",
"right",
"of",
"the",
"window"
] | af194797c90cc5bcac1060d3cd41b0258a34c7dc | https://github.com/tensorflow/tfjs-models/blob/af194797c90cc5bcac1060d3cd41b0258a34c7dc/posenet/demos/camera.js#L107-L185 | train | Setup the GUI for the neural network | [
30522,
3853,
16437,
25698,
1006,
8629,
1010,
5658,
1007,
1063,
26458,
9153,
2618,
1012,
5658,
1027,
5658,
1025,
2065,
1006,
8629,
1012,
3091,
1028,
1014,
1007,
1063,
26458,
9153,
2618,
1012,
4950,
1027,
8629,
1031,
1014,
1033,
1012,
5080,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
openlayers/openlayers | examples/vector-labels.js | lineStyleFunction | function lineStyleFunction(feature, resolution) {
return new Style({
stroke: new Stroke({
color: 'green',
width: 2
}),
text: createTextStyle(feature, resolution, myDom.lines)
});
} | javascript | function lineStyleFunction(feature, resolution) {
return new Style({
stroke: new Stroke({
color: 'green',
width: 2
}),
text: createTextStyle(feature, resolution, myDom.lines)
});
} | [
"function",
"lineStyleFunction",
"(",
"feature",
",",
"resolution",
")",
"{",
"return",
"new",
"Style",
"(",
"{",
"stroke",
":",
"new",
"Stroke",
"(",
"{",
"color",
":",
"'green'",
",",
"width",
":",
"2",
"}",
")",
",",
"text",
":",
"createTextStyle",
... | Lines | [
"Lines"
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/vector-labels.js#L151-L159 | train | Creates a style object for a line | [
30522,
3853,
3210,
27983,
11263,
27989,
1006,
3444,
1010,
5813,
1007,
1063,
2709,
2047,
2806,
1006,
1063,
6909,
1024,
2047,
6909,
1006,
1063,
3609,
1024,
1005,
2665,
1005,
1010,
9381,
1024,
1016,
1065,
1007,
1010,
3793,
1024,
3443,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js | function(mOptions) {
mOptions = mOptions || {};
if (typeof mOptions !== "object") {
throw new Error("Parameter object isn't a valid object");
}
// Reset all parameters to default
this.mHarFileContent = null;
this.aRequests = [];
this.sFilename = "";
this.bIsRecording = false;
this.bIsPau... | javascript | function(mOptions) {
mOptions = mOptions || {};
if (typeof mOptions !== "object") {
throw new Error("Parameter object isn't a valid object");
}
// Reset all parameters to default
this.mHarFileContent = null;
this.aRequests = [];
this.sFilename = "";
this.bIsRecording = false;
this.bIsPau... | [
"function",
"(",
"mOptions",
")",
"{",
"mOptions",
"=",
"mOptions",
"||",
"{",
"}",
";",
"if",
"(",
"typeof",
"mOptions",
"!==",
"\"object\"",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Parameter object isn't a valid object\"",
")",
";",
"}",
"// Reset all par... | Initilizes the RequestRecorder with the provided options, otherwise all default options will be set.
This method is used to init and also to RESET the needed paramters before replay and recording.
It restores sinon and the native XHR functions which are overwritten during the recording.
@param {object} mOptions The o... | [
"Initilizes",
"the",
"RequestRecorder",
"with",
"the",
"provided",
"options",
"otherwise",
"all",
"default",
"options",
"will",
"be",
"set",
".",
"This",
"method",
"is",
"used",
"to",
"init",
"and",
"also",
"to",
"RESET",
"the",
"needed",
"paramters",
"before"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L429-L494 | train | Resets all parameters to default values | [
30522,
3853,
1006,
9587,
16790,
2015,
1007,
1063,
9587,
16790,
2015,
1027,
9587,
16790,
2015,
1064,
1064,
1063,
1065,
1025,
2065,
1006,
2828,
11253,
9587,
16790,
2015,
999,
1027,
1027,
1000,
4874,
1000,
1007,
1063,
5466,
2047,
7561,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/Table.js | setMinColWidths | function setMinColWidths(oTable) {
var oTableRef = oTable.getDomRef();
var iAbsoluteMinWidth = TableUtils.Column.getMinColumnWidth();
var aNotFixedVariableColumns = [];
var bColumnHeaderVisible = oTable.getColumnHeaderVisible();
function calcNewWidth(iDomWidth, iMinWidth) {
if (iDomWidth <= iMinWidt... | javascript | function setMinColWidths(oTable) {
var oTableRef = oTable.getDomRef();
var iAbsoluteMinWidth = TableUtils.Column.getMinColumnWidth();
var aNotFixedVariableColumns = [];
var bColumnHeaderVisible = oTable.getColumnHeaderVisible();
function calcNewWidth(iDomWidth, iMinWidth) {
if (iDomWidth <= iMinWidt... | [
"function",
"setMinColWidths",
"(",
"oTable",
")",
"{",
"var",
"oTableRef",
"=",
"oTable",
".",
"getDomRef",
"(",
")",
";",
"var",
"iAbsoluteMinWidth",
"=",
"TableUtils",
".",
"Column",
".",
"getMinColumnWidth",
"(",
")",
";",
"var",
"aNotFixedVariableColumns",
... | the only place to fix the minimum column width | [
"the",
"only",
"place",
"to",
"fix",
"the",
"minimum",
"column",
"width"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/Table.js#L1564-L1628 | train | Sets the minimum width of the columns | [
30522,
3853,
2275,
10020,
25778,
9148,
11927,
7898,
1006,
27178,
3085,
1007,
1063,
13075,
27178,
3085,
2890,
2546,
1027,
27178,
3085,
1012,
2131,
9527,
2890,
2546,
1006,
1007,
1025,
13075,
24264,
5910,
4747,
10421,
10020,
9148,
11927,
2232,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Component.js | function() {
// Prerequisite: sap-context-token must not be set in the model URI
if (oUri.hasQuery("sap-context-token")) {
Log.warning("Component Manifest: Ignoring provided \"sap-context-token=" + sCacheToken + "\" for model \"" + sModelName + "\" (" + oUri.toString() + "). " +
... | javascript | function() {
// Prerequisite: sap-context-token must not be set in the model URI
if (oUri.hasQuery("sap-context-token")) {
Log.warning("Component Manifest: Ignoring provided \"sap-context-token=" + sCacheToken + "\" for model \"" + sModelName + "\" (" + oUri.toString() + "). " +
... | [
"function",
"(",
")",
"{",
"// Prerequisite: sap-context-token must not be set in the model URI",
"if",
"(",
"oUri",
".",
"hasQuery",
"(",
"\"sap-context-token\"",
")",
")",
"{",
"Log",
".",
"warning",
"(",
"\"Component Manifest: Ignoring provided \\\"sap-context-token=\"",
"... | /* eslint-disable no-loop-func | [
"/",
"*",
"eslint",
"-",
"disable",
"no",
"-",
"loop",
"-",
"func"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Component.js#L1465-L1527 | train | Checks if the model URI has already been set | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
3653,
2890,
24871,
1024,
20066,
1011,
6123,
1011,
19204,
2442,
2025,
2022,
2275,
1999,
1996,
2944,
24471,
2072,
2065,
1006,
2256,
2072,
1012,
2038,
4226,
2854,
1006,
1000,
20066,
1011,
6123,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/Entity.controller.js | function (oData) {
var FIRST_COLUMN = 0,
SECOND_COLUMN = 1,
THIRD_COLUMN = 2,
ENTITIES_PER_COLUMN = 3,
aHeaderControls = [[], [], []],
oHeaderLayoutUtil = this._getHeaderLayoutUtil(),
aHeaderBlocksInfo = [
{creator: "_getApiReferenceBlock", exists: oData.bHasAPIReference},
... | javascript | function (oData) {
var FIRST_COLUMN = 0,
SECOND_COLUMN = 1,
THIRD_COLUMN = 2,
ENTITIES_PER_COLUMN = 3,
aHeaderControls = [[], [], []],
oHeaderLayoutUtil = this._getHeaderLayoutUtil(),
aHeaderBlocksInfo = [
{creator: "_getApiReferenceBlock", exists: oData.bHasAPIReference},
... | [
"function",
"(",
"oData",
")",
"{",
"var",
"FIRST_COLUMN",
"=",
"0",
",",
"SECOND_COLUMN",
"=",
"1",
",",
"THIRD_COLUMN",
"=",
"2",
",",
"ENTITIES_PER_COLUMN",
"=",
"3",
",",
"aHeaderControls",
"=",
"[",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
"]",
... | Builds the header layout structure.
The header displays the entity data in 3 columns
and each column can consist of 3 key-value pairs at most.
@param {object} oData main control data object source | [
"Builds",
"the",
"header",
"layout",
"structure",
".",
"The",
"header",
"displays",
"the",
"entity",
"data",
"in",
"3",
"columns",
"and",
"each",
"column",
"can",
"consist",
"of",
"3",
"key",
"-",
"value",
"pairs",
"at",
"most",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/Entity.controller.js#L477-L531 | train | Creates a structure of the header controls. | [
30522,
3853,
1006,
1051,
2850,
2696,
1007,
1063,
13075,
2034,
1035,
5930,
1027,
1014,
1010,
2117,
1035,
5930,
1027,
1015,
1010,
2353,
1035,
5930,
1027,
1016,
1010,
11422,
1035,
2566,
1035,
5930,
1027,
1017,
1010,
3805,
2121,
8663,
13181,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js | function (oSelector, oAppComponent) {
if (!oSelector){
return undefined;
}
if (typeof oSelector === "string") {
oSelector = {
id: oSelector
};
}
var sControlId = oSelector.id;
if (oSelector.idIsLocal) {
if (oAppComponent) {
sControlId = oAppComponent.createId(sControlId);
... | javascript | function (oSelector, oAppComponent) {
if (!oSelector){
return undefined;
}
if (typeof oSelector === "string") {
oSelector = {
id: oSelector
};
}
var sControlId = oSelector.id;
if (oSelector.idIsLocal) {
if (oAppComponent) {
sControlId = oAppComponent.createId(sControlId);
... | [
"function",
"(",
"oSelector",
",",
"oAppComponent",
")",
"{",
"if",
"(",
"!",
"oSelector",
")",
"{",
"return",
"undefined",
";",
"}",
"if",
"(",
"typeof",
"oSelector",
"===",
"\"string\"",
")",
"{",
"oSelector",
"=",
"{",
"id",
":",
"oSelector",
"}",
"... | Function determining the control ID from the selector.
The function distinguishes between local IDs generated starting with 1.40 and the global IDs generated in previous versions.
@param {object} oSelector - Target of a flexiblity change
@param {string} oSelector.id - ID of the control targeted by the change
@param {bo... | [
"Function",
"determining",
"the",
"control",
"ID",
"from",
"the",
"selector",
".",
"The",
"function",
"distinguishes",
"between",
"local",
"IDs",
"generated",
"starting",
"with",
"1",
".",
"40",
"and",
"the",
"global",
"IDs",
"generated",
"in",
"previous",
"ve... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js#L65-L99 | train | Returns the control ID of the control | [
30522,
3853,
1006,
9808,
12260,
16761,
1010,
1051,
29098,
9006,
29513,
3372,
1007,
1063,
2065,
1006,
999,
9808,
12260,
16761,
1007,
1063,
2709,
6151,
28344,
1025,
1065,
2065,
1006,
2828,
11253,
9808,
12260,
16761,
1027,
1027,
1027,
1000,
51... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
socketio/socket.io | lib/socket.js | Socket | function Socket(nsp, client, query){
this.nsp = nsp;
this.server = nsp.server;
this.adapter = this.nsp.adapter;
this.id = nsp.name !== '/' ? nsp.name + '#' + client.id : client.id;
this.client = client;
this.conn = client.conn;
this.rooms = {};
this.acks = {};
this.connected = true;
this.disconnecte... | javascript | function Socket(nsp, client, query){
this.nsp = nsp;
this.server = nsp.server;
this.adapter = this.nsp.adapter;
this.id = nsp.name !== '/' ? nsp.name + '#' + client.id : client.id;
this.client = client;
this.conn = client.conn;
this.rooms = {};
this.acks = {};
this.connected = true;
this.disconnecte... | [
"function",
"Socket",
"(",
"nsp",
",",
"client",
",",
"query",
")",
"{",
"this",
".",
"nsp",
"=",
"nsp",
";",
"this",
".",
"server",
"=",
"nsp",
".",
"server",
";",
"this",
".",
"adapter",
"=",
"this",
".",
"nsp",
".",
"adapter",
";",
"this",
"."... | Interface to a `Client` for a given `Namespace`.
@param {Namespace} nsp
@param {Client} client
@api public | [
"Interface",
"to",
"a",
"Client",
"for",
"a",
"given",
"Namespace",
"."
] | 9c1e73c752aec63f48b511330a506d037783d897 | https://github.com/socketio/socket.io/blob/9c1e73c752aec63f48b511330a506d037783d897/lib/socket.js#L60-L75 | train | Socket constructor. | [
30522,
3853,
22278,
1006,
24978,
2361,
1010,
7396,
1010,
23032,
1007,
1063,
2023,
1012,
24978,
2361,
1027,
24978,
2361,
1025,
2023,
1012,
8241,
1027,
24978,
2361,
1012,
8241,
1025,
2023,
1012,
15581,
2121,
1027,
2023,
1012,
24978,
2361,
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... |
adobe/brackets | src/LiveDevelopment/LiveDevMultiBrowser.js | getCurrentProjectServerConfig | function getCurrentProjectServerConfig() {
return {
baseUrl: ProjectManager.getBaseUrl(),
pathResolver: ProjectManager.makeProjectRelativeIfPossible,
root: ProjectManager.getProjectRoot().fullPath
};
} | javascript | function getCurrentProjectServerConfig() {
return {
baseUrl: ProjectManager.getBaseUrl(),
pathResolver: ProjectManager.makeProjectRelativeIfPossible,
root: ProjectManager.getProjectRoot().fullPath
};
} | [
"function",
"getCurrentProjectServerConfig",
"(",
")",
"{",
"return",
"{",
"baseUrl",
":",
"ProjectManager",
".",
"getBaseUrl",
"(",
")",
",",
"pathResolver",
":",
"ProjectManager",
".",
"makeProjectRelativeIfPossible",
",",
"root",
":",
"ProjectManager",
".",
"getP... | Returns current project server config. Copied from original LiveDevelopment. | [
"Returns",
"current",
"project",
"server",
"config",
".",
"Copied",
"from",
"original",
"LiveDevelopment",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L894-L900 | train | Get current project server config | [
30522,
3853,
2131,
10841,
14343,
3372,
21572,
20614,
8043,
6299,
8663,
8873,
2290,
1006,
1007,
1063,
2709,
1063,
2918,
3126,
2140,
1024,
2622,
24805,
4590,
1012,
2131,
15058,
3126,
2140,
1006,
1007,
1010,
4130,
6072,
4747,
6299,
1024,
2622,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/base/strings/NormalizePolyfill.js | nfcQuickCheck | function nfcQuickCheck(s) {
// check for only ascii characters first to avoid unnecessary processing
if (!/^[\u0001-\u00ff]*$/.test(s)) {
var lastCanonicalClass = 0;
for (var i = 0; i < s.length; ++i) {
var cp = s.charCodeAt(i);
// check for supplementary characters, complex, as charCodeAt returns onl... | javascript | function nfcQuickCheck(s) {
// check for only ascii characters first to avoid unnecessary processing
if (!/^[\u0001-\u00ff]*$/.test(s)) {
var lastCanonicalClass = 0;
for (var i = 0; i < s.length; ++i) {
var cp = s.charCodeAt(i);
// check for supplementary characters, complex, as charCodeAt returns onl... | [
"function",
"nfcQuickCheck",
"(",
"s",
")",
"{",
"// check for only ascii characters first to avoid unnecessary processing",
"if",
"(",
"!",
"/",
"^[\\u0001-\\u00ff]*$",
"/",
".",
"test",
"(",
"s",
")",
")",
"{",
"var",
"lastCanonicalClass",
"=",
"0",
";",
"for",
... | quickcheck implementations | [
"quickcheck",
"implementations"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/strings/NormalizePolyfill.js#L96-L124 | train | Quick check for a string | [
30522,
3853,
22309,
15549,
3600,
5403,
3600,
1006,
1055,
1007,
1063,
1013,
1013,
4638,
2005,
2069,
2004,
6895,
2072,
3494,
2034,
2000,
4468,
14203,
6364,
2065,
1006,
999,
1013,
1034,
1031,
1032,
1057,
8889,
24096,
1011,
1032,
1057,
8889,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/interimElement/interimElement.js | findParent | function findParent(element, options) {
var parent = options.parent;
// Search for parent at insertion time, if not specified
if (angular.isFunction(parent)) {
parent = parent(options.scope, element, options);
} else if (angular.isString(parent)) {
parent... | javascript | function findParent(element, options) {
var parent = options.parent;
// Search for parent at insertion time, if not specified
if (angular.isFunction(parent)) {
parent = parent(options.scope, element, options);
} else if (angular.isString(parent)) {
parent... | [
"function",
"findParent",
"(",
"element",
",",
"options",
")",
"{",
"var",
"parent",
"=",
"options",
".",
"parent",
";",
"// Search for parent at insertion time, if not specified",
"if",
"(",
"angular",
".",
"isFunction",
"(",
"parent",
")",
")",
"{",
"parent",
... | Search for parent at insertion time, if not specified | [
"Search",
"for",
"parent",
"at",
"insertion",
"time",
"if",
"not",
"specified"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/interimElement/interimElement.js#L638-L665 | train | Find parent element | [
30522,
3853,
2424,
19362,
4765,
1006,
5783,
1010,
7047,
1007,
1063,
13075,
6687,
1027,
7047,
1012,
6687,
1025,
1013,
1013,
3945,
2005,
6687,
2012,
23851,
2051,
1010,
2065,
2025,
9675,
2065,
1006,
16108,
1012,
2003,
11263,
27989,
1006,
6687,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GeekyAnts/vue-native-core | packages/vue-native-core/build.js | initRender | function initRender (vm) {
vm._vnode = null; // the root of the child tree
vm._staticTrees = null;
var parentVnode = vm.$vnode = vm.$options._parentVnode; // the placeholder node in parent tree
var renderContext = parentVnode && parentVnode.context;
/**
* react-vue change
*/
// vm.$slots = resolveSlot... | javascript | function initRender (vm) {
vm._vnode = null; // the root of the child tree
vm._staticTrees = null;
var parentVnode = vm.$vnode = vm.$options._parentVnode; // the placeholder node in parent tree
var renderContext = parentVnode && parentVnode.context;
/**
* react-vue change
*/
// vm.$slots = resolveSlot... | [
"function",
"initRender",
"(",
"vm",
")",
"{",
"vm",
".",
"_vnode",
"=",
"null",
";",
"// the root of the child tree",
"vm",
".",
"_staticTrees",
"=",
"null",
";",
"var",
"parentVnode",
"=",
"vm",
".",
"$vnode",
"=",
"vm",
".",
"$options",
".",
"_parentVno... | Runtime helper for v-once.
Effectively it means marking the node as static with a unique key.
/* | [
"Runtime",
"helper",
"for",
"v",
"-",
"once",
".",
"Effectively",
"it",
"means",
"marking",
"the",
"node",
"as",
"static",
"with",
"a",
"unique",
"key",
".",
"/",
"*"
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-native-core/build.js#L3430-L3448 | train | Initialize the render function | [
30522,
3853,
1999,
4183,
7389,
4063,
1006,
1058,
2213,
1007,
1063,
1058,
2213,
1012,
1035,
1058,
3630,
3207,
1027,
19701,
1025,
1013,
1013,
1996,
7117,
1997,
1996,
2775,
3392,
1058,
2213,
1012,
1035,
10763,
13334,
2015,
1027,
19701,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/preferences/PreferencesDialogs.js | _validateBaseUrl | function _validateBaseUrl(url) {
var result = "";
// Empty url means "no server mapping; use file directly"
if (url === "") {
return result;
}
var obj = PathUtils.parseUrl(url);
if (!obj) {
result = Strings.BASEURL_ERROR_UNKNOWN_ERROR;
} e... | javascript | function _validateBaseUrl(url) {
var result = "";
// Empty url means "no server mapping; use file directly"
if (url === "") {
return result;
}
var obj = PathUtils.parseUrl(url);
if (!obj) {
result = Strings.BASEURL_ERROR_UNKNOWN_ERROR;
} e... | [
"function",
"_validateBaseUrl",
"(",
"url",
")",
"{",
"var",
"result",
"=",
"\"\"",
";",
"// Empty url means \"no server mapping; use file directly\"",
"if",
"(",
"url",
"===",
"\"\"",
")",
"{",
"return",
"result",
";",
"}",
"var",
"obj",
"=",
"PathUtils",
".",
... | Validate that text string is a valid base url which should map to a server folder
@param {string} url
@return {string} Empty string if valid, otherwise error string | [
"Validate",
"that",
"text",
"string",
"is",
"a",
"valid",
"base",
"url",
"which",
"should",
"map",
"to",
"a",
"server",
"folder"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesDialogs.js#L45-L69 | train | Validate a base url | [
30522,
3853,
1035,
9398,
3686,
15058,
3126,
2140,
1006,
24471,
2140,
1007,
1063,
13075,
2765,
1027,
1000,
1000,
1025,
1013,
1013,
4064,
24471,
2140,
2965,
1000,
2053,
8241,
12375,
1025,
2224,
5371,
3495,
1000,
2065,
1006,
24471,
2140,
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.m/src/sap/m/NotificationListBase.js | isIcon | function isIcon(source) {
if (!source) {
return false;
}
var result = window.URI.parse(source);
return (result.protocol && result.protocol == 'sap-icon');
} | javascript | function isIcon(source) {
if (!source) {
return false;
}
var result = window.URI.parse(source);
return (result.protocol && result.protocol == 'sap-icon');
} | [
"function",
"isIcon",
"(",
"source",
")",
"{",
"if",
"(",
"!",
"source",
")",
"{",
"return",
"false",
";",
"}",
"var",
"result",
"=",
"window",
".",
"URI",
".",
"parse",
"(",
"source",
")",
";",
"return",
"(",
"result",
".",
"protocol",
"&&",
"resu... | ================================================================================ Helper methods ================================================================================
Checks if an sap.ui.core.URI parameter is an icon src or not.
@protected
@param {string} source The source to be checked.
@returns {boolean} ... | [
"================================================================================",
"Helper",
"methods",
"================================================================================",
"Checks",
"if",
"an",
"sap",
".",
"ui",
".",
"core",
".",
"URI",
"parameter",
"is",
"an",
"ic... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/NotificationListBase.js#L396-L403 | train | Check if source is an icon | [
30522,
3853,
2003,
28524,
1006,
3120,
1007,
1063,
2065,
1006,
999,
3120,
1007,
1063,
2709,
6270,
1025,
1065,
13075,
2765,
1027,
3332,
1012,
24471,
2072,
1012,
11968,
3366,
1006,
3120,
1007,
1025,
2709,
1006,
2765,
1012,
8778,
1004,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wuchangming/spy-debugger | buildin_modules/weinre/web/interfaces/interfaces.js | el_showCheckBoxClicked | function el_showCheckBoxClicked(event) {
var element = event.target
localStorage.setItem(element.storageKey, element.checked)
reapplyDisplayStyle("." + element.storageKey, element.checked)
} | javascript | function el_showCheckBoxClicked(event) {
var element = event.target
localStorage.setItem(element.storageKey, element.checked)
reapplyDisplayStyle("." + element.storageKey, element.checked)
} | [
"function",
"el_showCheckBoxClicked",
"(",
"event",
")",
"{",
"var",
"element",
"=",
"event",
".",
"target",
"localStorage",
".",
"setItem",
"(",
"element",
".",
"storageKey",
",",
"element",
".",
"checked",
")",
"reapplyDisplayStyle",
"(",
"\".\"",
"+",
"elem... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/interfaces/interfaces.js#L81-L87 | train | Show the checkbox | [
30522,
3853,
3449,
1035,
2265,
5403,
3600,
8758,
20464,
6799,
2098,
1006,
2724,
1007,
1063,
13075,
5783,
1027,
2724,
1012,
4539,
10575,
4263,
4270,
1012,
2275,
4221,
2213,
1006,
5783,
1012,
5527,
14839,
1010,
5783,
1012,
7039,
1007,
2128,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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... |
adobe/brackets | src/view/ThemeView.js | updateScrollbars | function updateScrollbars(theme) {
theme = theme || {};
if (prefs.get("themeScrollbars")) {
var scrollbar = (theme.scrollbar || []).join(" ");
$scrollbars.text(scrollbar || "");
} else {
$scrollbars.text("");
}
} | javascript | function updateScrollbars(theme) {
theme = theme || {};
if (prefs.get("themeScrollbars")) {
var scrollbar = (theme.scrollbar || []).join(" ");
$scrollbars.text(scrollbar || "");
} else {
$scrollbars.text("");
}
} | [
"function",
"updateScrollbars",
"(",
"theme",
")",
"{",
"theme",
"=",
"theme",
"||",
"{",
"}",
";",
"if",
"(",
"prefs",
".",
"get",
"(",
"\"themeScrollbars\"",
")",
")",
"{",
"var",
"scrollbar",
"=",
"(",
"theme",
".",
"scrollbar",
"||",
"[",
"]",
")... | Load scrollbar styling based on whether or not theme scrollbars are enabled.
@param {ThemeManager.Theme} theme Is the theme object with the corresponding scrollbar style
to be updated | [
"Load",
"scrollbar",
"styling",
"based",
"on",
"whether",
"or",
"not",
"theme",
"scrollbars",
"are",
"enabled",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeView.js#L40-L48 | train | Update scrollbar text | [
30522,
3853,
14409,
26775,
14511,
8237,
2015,
1006,
4323,
1007,
1063,
4323,
1027,
4323,
1064,
1064,
1063,
1065,
1025,
2065,
1006,
3653,
10343,
1012,
2131,
1006,
1000,
6991,
26775,
14511,
8237,
2015,
1000,
1007,
1007,
1063,
13075,
17186,
823... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/NotificationBarRenderer.js | function(oRm, oNotifier, oNotiBar) {
fnRenderNotifier(oRm, oNotifier, true);
fnRenderMessageNotifierMessageArea(oRm, oNotifier, oNotiBar);
} | javascript | function(oRm, oNotifier, oNotiBar) {
fnRenderNotifier(oRm, oNotifier, true);
fnRenderMessageNotifierMessageArea(oRm, oNotifier, oNotiBar);
} | [
"function",
"(",
"oRm",
",",
"oNotifier",
",",
"oNotiBar",
")",
"{",
"fnRenderNotifier",
"(",
"oRm",
",",
"oNotifier",
",",
"true",
")",
";",
"fnRenderMessageNotifierMessageArea",
"(",
"oRm",
",",
"oNotifier",
",",
"oNotiBar",
")",
";",
"}"
] | This renders a given message notifier and its message area next to the
notifier icon | [
"This",
"renders",
"a",
"given",
"message",
"notifier",
"and",
"its",
"message",
"area",
"next",
"to",
"the",
"notifier",
"icon"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/NotificationBarRenderer.js#L458-L461 | train | Renders a message notifier | [
30522,
3853,
1006,
2030,
2213,
1010,
21058,
3775,
8873,
2121,
1010,
21058,
3775,
8237,
1007,
1063,
1042,
16118,
10497,
11795,
4140,
18095,
1006,
2030,
2213,
1010,
21058,
3775,
8873,
2121,
1010,
2995,
1007,
1025,
1042,
16118,
10497,
2121,
78... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/runnable.js | multiple | function multiple(err) {
if (emitted) {
return;
}
emitted = true;
var msg = 'done() called multiple times';
if (err && err.message) {
err.message += " (and Mocha's " + msg + ')';
self.emit('error', err);
} else {
self.emit('error', new Error(msg));
}
} | javascript | function multiple(err) {
if (emitted) {
return;
}
emitted = true;
var msg = 'done() called multiple times';
if (err && err.message) {
err.message += " (and Mocha's " + msg + ')';
self.emit('error', err);
} else {
self.emit('error', new Error(msg));
}
} | [
"function",
"multiple",
"(",
"err",
")",
"{",
"if",
"(",
"emitted",
")",
"{",
"return",
";",
"}",
"emitted",
"=",
"true",
";",
"var",
"msg",
"=",
"'done() called multiple times'",
";",
"if",
"(",
"err",
"&&",
"err",
".",
"message",
")",
"{",
"err",
"... | called multiple times | [
"called",
"multiple",
"times"
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/runnable.js#L303-L315 | train | Called when a single task is called | [
30522,
3853,
3674,
1006,
9413,
2099,
1007,
1063,
2065,
1006,
22627,
1007,
1063,
2709,
1025,
1065,
22627,
1027,
2995,
1025,
13075,
5796,
2290,
1027,
1005,
2589,
1006,
1007,
2170,
3674,
2335,
1005,
1025,
2065,
1006,
9413,
2099,
1004,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
askmike/gekko | plugins/postgresql/util.js | function (name) {
if (useSingleDatabase()) {
name = watch.exchange.replace(/\-/g,'') + '_' + name;
}
var fullName = [name, settings.pair.join('_')].join('_');
return useLowerCaseTableNames() ? fullName.toLowerCase() : fullName;
} | javascript | function (name) {
if (useSingleDatabase()) {
name = watch.exchange.replace(/\-/g,'') + '_' + name;
}
var fullName = [name, settings.pair.join('_')].join('_');
return useLowerCaseTableNames() ? fullName.toLowerCase() : fullName;
} | [
"function",
"(",
"name",
")",
"{",
"if",
"(",
"useSingleDatabase",
"(",
")",
")",
"{",
"name",
"=",
"watch",
".",
"exchange",
".",
"replace",
"(",
"/",
"\\-",
"/",
"g",
",",
"''",
")",
"+",
"'_'",
"+",
"name",
";",
"}",
"var",
"fullName",
"=",
... | returns table name which can be different if we use single or multiple db setup. | [
"returns",
"table",
"name",
"which",
"can",
"be",
"different",
"if",
"we",
"use",
"single",
"or",
"multiple",
"db",
"setup",
"."
] | 0ce9ddd577fa8a22812c02331a494086758dfadf | https://github.com/askmike/gekko/blob/0ce9ddd577fa8a22812c02331a494086758dfadf/plugins/postgresql/util.js#L46-L52 | train | Returns the full name of the table | [
30522,
3853,
1006,
2171,
1007,
1063,
2065,
1006,
3594,
2075,
3709,
6790,
15058,
1006,
1007,
1007,
1063,
2171,
1027,
3422,
1012,
3863,
1012,
5672,
1006,
1013,
1032,
1011,
1013,
1043,
1010,
1005,
1005,
1007,
1009,
1005,
1035,
1005,
1009,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GeekyAnts/vue-native-core | packages/vue-server-renderer/build.js | normalizeStyleBinding | function normalizeStyleBinding (bindingStyle) {
if (Array.isArray(bindingStyle)) {
return toObject(bindingStyle)
}
if (typeof bindingStyle === 'string') {
return parseStyleText(bindingStyle)
}
return bindingStyle
} | javascript | function normalizeStyleBinding (bindingStyle) {
if (Array.isArray(bindingStyle)) {
return toObject(bindingStyle)
}
if (typeof bindingStyle === 'string') {
return parseStyleText(bindingStyle)
}
return bindingStyle
} | [
"function",
"normalizeStyleBinding",
"(",
"bindingStyle",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"bindingStyle",
")",
")",
"{",
"return",
"toObject",
"(",
"bindingStyle",
")",
"}",
"if",
"(",
"typeof",
"bindingStyle",
"===",
"'string'",
")",
"{",... | normalize possible array / string values into Object | [
"normalize",
"possible",
"array",
"/",
"string",
"values",
"into",
"Object"
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-server-renderer/build.js#L1505-L1513 | train | Normalize binding style | [
30522,
3853,
3671,
10057,
27983,
8428,
4667,
1006,
8031,
21756,
2571,
1007,
1063,
2065,
1006,
9140,
1012,
18061,
11335,
2100,
1006,
8031,
21756,
2571,
1007,
1007,
1063,
2709,
2205,
2497,
20614,
1006,
8031,
21756,
2571,
1007,
1065,
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... |
uber/deck.gl | modules/core/src/utils/flatten.js | flattenArray | function flattenArray(array, filter, map, result) {
let index = -1;
while (++index < array.length) {
const value = array[index];
if (Array.isArray(value)) {
flattenArray(value, filter, map, result);
} else if (filter(value)) {
result.push(map(value));
}
}
return result;
} | javascript | function flattenArray(array, filter, map, result) {
let index = -1;
while (++index < array.length) {
const value = array[index];
if (Array.isArray(value)) {
flattenArray(value, filter, map, result);
} else if (filter(value)) {
result.push(map(value));
}
}
return result;
} | [
"function",
"flattenArray",
"(",
"array",
",",
"filter",
",",
"map",
",",
"result",
")",
"{",
"let",
"index",
"=",
"-",
"1",
";",
"while",
"(",
"++",
"index",
"<",
"array",
".",
"length",
")",
"{",
"const",
"value",
"=",
"array",
"[",
"index",
"]",... | Deep flattens an array. Helper to `flatten`, see its parameters | [
"Deep",
"flattens",
"an",
"array",
".",
"Helper",
"to",
"flatten",
"see",
"its",
"parameters"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/core/src/utils/flatten.js#L43-L54 | train | flatten array | [
30522,
3853,
4257,
6528,
2906,
9447,
1006,
9140,
1010,
11307,
1010,
4949,
1010,
2765,
1007,
1063,
2292,
5950,
1027,
1011,
1015,
1025,
2096,
1006,
1009,
1009,
5950,
1026,
9140,
1012,
3091,
1007,
1063,
9530,
3367,
3643,
1027,
9140,
1031,
59... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Component.js | collectLoadManifestPromises | function collectLoadManifestPromises(oMetadata, oManifest) {
// ComponentMetadata classes with a static manifest or with legacy metadata
// do already have a manifest, so no action required
if (!oMetadata._oManifest) {
// TODO: If the "manifest" property is set, the code to load the manifest.json could be ... | javascript | function collectLoadManifestPromises(oMetadata, oManifest) {
// ComponentMetadata classes with a static manifest or with legacy metadata
// do already have a manifest, so no action required
if (!oMetadata._oManifest) {
// TODO: If the "manifest" property is set, the code to load the manifest.json could be ... | [
"function",
"collectLoadManifestPromises",
"(",
"oMetadata",
",",
"oManifest",
")",
"{",
"// ComponentMetadata classes with a static manifest or with legacy metadata",
"// do already have a manifest, so no action required",
"if",
"(",
"!",
"oMetadata",
".",
"_oManifest",
")",
"{",
... | Collects the promises to load the manifest content and all of its parents manifest files.
Gathers promises within aManifestsToLoad.
Gathers associates meta data objects within aMetadataObjects.
@param {object} oMetadata The metadata object
@param {sap.ui.core.Manifest} [oManifest] root manifest, which is possibly alre... | [
"Collects",
"the",
"promises",
"to",
"load",
"the",
"manifest",
"content",
"and",
"all",
"of",
"its",
"parents",
"manifest",
"files",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Component.js#L1821-L1862 | train | Loads the manifest. json from the component s manifest. json file. | [
30522,
3853,
8145,
11066,
20799,
14081,
21572,
28732,
2015,
1006,
18168,
12928,
2850,
2696,
1010,
16640,
29323,
3367,
1007,
1063,
1013,
1013,
6922,
11368,
8447,
2696,
4280,
2007,
1037,
10763,
19676,
2030,
2007,
8027,
27425,
1013,
1013,
2079,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mattdesl/canvas-sketch | examples/experimental/webgl-2d.js | getNormalizedPrimitive2D | function getNormalizedPrimitive2D ({ positions, cells, normals, uvs }, opt = {}) {
// Default to assuming the positions are a unit circle/box/etc
normals = normals ? expandVectorList(normals) : positions.map(p => vec3.normalize([], expandVector(p)));
// Planar UV across bounding box of mesh
uvs = uvs ||... | javascript | function getNormalizedPrimitive2D ({ positions, cells, normals, uvs }, opt = {}) {
// Default to assuming the positions are a unit circle/box/etc
normals = normals ? expandVectorList(normals) : positions.map(p => vec3.normalize([], expandVector(p)));
// Planar UV across bounding box of mesh
uvs = uvs ||... | [
"function",
"getNormalizedPrimitive2D",
"(",
"{",
"positions",
",",
"cells",
",",
"normals",
",",
"uvs",
"}",
",",
"opt",
"=",
"{",
"}",
")",
"{",
"// Default to assuming the positions are a unit circle/box/etc",
"normals",
"=",
"normals",
"?",
"expandVectorList",
"... | A unit 2D rectangle, circle, etc | [
"A",
"unit",
"2D",
"rectangle",
"circle",
"etc"
] | 4addd0fe3fc053065ca8597ab204e43587c52879 | https://github.com/mattdesl/canvas-sketch/blob/4addd0fe3fc053065ca8597ab204e43587c52879/examples/experimental/webgl-2d.js#L177-L192 | train | Returns a 2D array of normals and uvs | [
30522,
3853,
2131,
12131,
9067,
3550,
18098,
27605,
6024,
2475,
2094,
1006,
1063,
4460,
1010,
4442,
1010,
3671,
2015,
1010,
23068,
2015,
1065,
1010,
23569,
1027,
1063,
1065,
1007,
1063,
1013,
1013,
12398,
2000,
10262,
1996,
4460,
2024,
1037... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/JavaScriptRefactoring/RenameIdentifier.js | requestFindReferences | function requestFindReferences(session, offset) {
var response = requestFindRefs(session, session.editor.document, offset);
if (response && response.hasOwnProperty("promise")) {
response.promise.done(handleFindRefs).fail(function () {
result.reject();
... | javascript | function requestFindReferences(session, offset) {
var response = requestFindRefs(session, session.editor.document, offset);
if (response && response.hasOwnProperty("promise")) {
response.promise.done(handleFindRefs).fail(function () {
result.reject();
... | [
"function",
"requestFindReferences",
"(",
"session",
",",
"offset",
")",
"{",
"var",
"response",
"=",
"requestFindRefs",
"(",
"session",
",",
"session",
".",
"editor",
".",
"document",
",",
"offset",
")",
";",
"if",
"(",
"response",
"&&",
"response",
".",
... | Make a find ref request.
@param {Session} session - the session
@param {number} offset - the offset of where to jump from | [
"Make",
"a",
"find",
"ref",
"request",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/RenameIdentifier.js#L169-L177 | train | Request find references | [
30522,
3853,
5227,
16294,
16200,
25523,
2015,
1006,
5219,
1010,
16396,
1007,
1063,
13075,
3433,
1027,
5227,
16294,
16200,
10343,
1006,
5219,
1010,
5219,
1012,
3559,
1012,
6254,
1010,
16396,
1007,
1025,
2065,
1006,
3433,
1004,
1004,
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... |
SeleniumHQ/selenium | javascript/selenium-core/lib/prototype.js | function(event, tagName) {
var element = Event.element(event);
while (element.parentNode && (!element.tagName ||
(element.tagName.toUpperCase() != tagName.toUpperCase())))
element = element.parentNode;
return element;
} | javascript | function(event, tagName) {
var element = Event.element(event);
while (element.parentNode && (!element.tagName ||
(element.tagName.toUpperCase() != tagName.toUpperCase())))
element = element.parentNode;
return element;
} | [
"function",
"(",
"event",
",",
"tagName",
")",
"{",
"var",
"element",
"=",
"Event",
".",
"element",
"(",
"event",
")",
";",
"while",
"(",
"element",
".",
"parentNode",
"&&",
"(",
"!",
"element",
".",
"tagName",
"||",
"(",
"element",
".",
"tagName",
"... | find the first node with the given tagName, starting from the node the event was triggered on; traverses the DOM upwards | [
"find",
"the",
"first",
"node",
"with",
"the",
"given",
"tagName",
"starting",
"from",
"the",
"node",
"the",
"event",
"was",
"triggered",
"on",
";",
"traverses",
"the",
"DOM",
"upwards"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/lib/prototype.js#L1714-L1720 | train | Returns the parent element of the given event | [
30522,
3853,
1006,
2724,
1010,
6415,
18442,
1007,
1063,
13075,
5783,
1027,
2724,
1012,
5783,
1006,
2724,
1007,
1025,
2096,
1006,
5783,
1012,
6687,
3630,
3207,
1004,
1004,
1006,
999,
5783,
1012,
6415,
18442,
1064,
1064,
1006,
5783,
1012,
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... | |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | updateOptions | function updateOptions ( optionsToUpdate, fireSetEvent ) {
// Spectrum is created using the range, snap, direction and step options.
// 'snap' and 'step' can be updated, 'direction' cannot, due to event binding.
// If 'snap' and 'step' are not passed, they should remain unchanged.
... | javascript | function updateOptions ( optionsToUpdate, fireSetEvent ) {
// Spectrum is created using the range, snap, direction and step options.
// 'snap' and 'step' can be updated, 'direction' cannot, due to event binding.
// If 'snap' and 'step' are not passed, they should remain unchanged.
... | [
"function",
"updateOptions",
"(",
"optionsToUpdate",
",",
"fireSetEvent",
")",
"{",
"// Spectrum is created using the range, snap, direction and step options.",
"// 'snap' and 'step' can be updated, 'direction' cannot, due to event binding.",
"// If 'snap' and 'step' are not passed, they should ... | Updateable: margin, limit, padding, step, range, animate, snap | [
"Updateable",
":",
"margin",
"limit",
"padding",
"step",
"range",
"animate",
"snap"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L2037-L2075 | train | Updates the options of the slider. | [
30522,
3853,
10651,
7361,
9285,
1006,
7047,
24826,
17299,
3686,
1010,
8769,
12870,
15338,
1007,
1063,
1013,
1013,
8674,
2003,
2580,
2478,
1996,
2846,
1010,
10245,
1010,
3257,
1998,
3357,
7047,
1012,
1013,
1013,
1005,
10245,
1005,
1998,
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... |
babel/babel | packages/babel-traverse/src/path/conversion.js | hoistFunctionEnvironment | function hoistFunctionEnvironment(
fnPath,
specCompliant = false,
allowInsertArrow = true,
) {
const thisEnvFn = fnPath.findParent(p => {
return (
(p.isFunction() && !p.isArrowFunctionExpression()) ||
p.isProgram() ||
p.isClassProperty({ static: false })
);
});
const inConstructor ... | javascript | function hoistFunctionEnvironment(
fnPath,
specCompliant = false,
allowInsertArrow = true,
) {
const thisEnvFn = fnPath.findParent(p => {
return (
(p.isFunction() && !p.isArrowFunctionExpression()) ||
p.isProgram() ||
p.isClassProperty({ static: false })
);
});
const inConstructor ... | [
"function",
"hoistFunctionEnvironment",
"(",
"fnPath",
",",
"specCompliant",
"=",
"false",
",",
"allowInsertArrow",
"=",
"true",
",",
")",
"{",
"const",
"thisEnvFn",
"=",
"fnPath",
".",
"findParent",
"(",
"p",
"=>",
"{",
"return",
"(",
"(",
"p",
".",
"isFu... | Given a function, traverse its contents, and if there are references to "this", "arguments", "super",
or "new.target", ensure that these references reference the parent environment around this function. | [
"Given",
"a",
"function",
"traverse",
"its",
"contents",
"and",
"if",
"there",
"are",
"references",
"to",
"this",
"arguments",
"super",
"or",
"new",
".",
"target",
"ensure",
"that",
"these",
"references",
"reference",
"the",
"parent",
"environment",
"around",
... | 1969e6b6aa7d90be3fbb3aca98ea96849656a55a | https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-traverse/src/path/conversion.js#L161-L326 | train | Hoist function environment | [
30522,
3853,
7570,
2923,
11263,
27989,
2368,
21663,
2239,
3672,
1006,
1042,
16275,
8988,
1010,
28699,
9006,
24759,
2937,
2102,
1027,
6270,
1010,
3499,
7076,
8743,
2906,
10524,
1027,
2995,
1010,
1007,
1063,
9530,
3367,
2023,
2368,
2615,
2546... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TopoJSON.js | concatenateArcs | function concatenateArcs(indices, arcs) {
/** @type {Array<import("../coordinate.js").Coordinate>} */
const coordinates = [];
let index, arc;
for (let i = 0, ii = indices.length; i < ii; ++i) {
index = indices[i];
if (i > 0) {
// splicing together arcs, discard last point
coordinates.pop();
... | javascript | function concatenateArcs(indices, arcs) {
/** @type {Array<import("../coordinate.js").Coordinate>} */
const coordinates = [];
let index, arc;
for (let i = 0, ii = indices.length; i < ii; ++i) {
index = indices[i];
if (i > 0) {
// splicing together arcs, discard last point
coordinates.pop();
... | [
"function",
"concatenateArcs",
"(",
"indices",
",",
"arcs",
")",
"{",
"/** @type {Array<import(\"../coordinate.js\").Coordinate>} */",
"const",
"coordinates",
"=",
"[",
"]",
";",
"let",
"index",
",",
"arc",
";",
"for",
"(",
"let",
"i",
"=",
"0",
",",
"ii",
"="... | Concatenate arcs into a coordinate array.
@param {Array<number>} indices Indices of arcs to concatenate. Negative
values indicate arcs need to be reversed.
@param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs (already
transformed).
@return {Array<import("../coordinate.js").Coordinate>} Coord... | [
"Concatenate",
"arcs",
"into",
"a",
"coordinate",
"array",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/format/TopoJSON.js#L162-L186 | train | Concatenates the arcs at the given indices. | [
30522,
3853,
9530,
16280,
12556,
2906,
6169,
1006,
29299,
1010,
29137,
1007,
1063,
1013,
1008,
1008,
1030,
2828,
1063,
9140,
1026,
12324,
1006,
1000,
1012,
1012,
1013,
13530,
1012,
1046,
2015,
1000,
1007,
1012,
13530,
1028,
1065,
1008,
1013... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js | function (vControl, oAppComponent) {
var sControlId = (vControl instanceof ManagedObject) ? vControl.getId() : vControl;
if (!oAppComponent) {
Log.error("Determination of a local ID suffix failed due to missing app component for " + sControlId);
return false;
}
return !!oAppComponent.getLocalId(sC... | javascript | function (vControl, oAppComponent) {
var sControlId = (vControl instanceof ManagedObject) ? vControl.getId() : vControl;
if (!oAppComponent) {
Log.error("Determination of a local ID suffix failed due to missing app component for " + sControlId);
return false;
}
return !!oAppComponent.getLocalId(sC... | [
"function",
"(",
"vControl",
",",
"oAppComponent",
")",
"{",
"var",
"sControlId",
"=",
"(",
"vControl",
"instanceof",
"ManagedObject",
")",
"?",
"vControl",
".",
"getId",
"(",
")",
":",
"vControl",
";",
"if",
"(",
"!",
"oAppComponent",
")",
"{",
"Log",
"... | Checks if a control ID has a prefix matching the application component.
If this prefix exists, the suffix after the component ID is called the local ID.
@param {sap.ui.core.Control|string} vControl - Control or ID to be checked if it is within the generic application
@param {sap.ui.core.UIComponent} oAppComponent - Ap... | [
"Checks",
"if",
"a",
"control",
"ID",
"has",
"a",
"prefix",
"matching",
"the",
"application",
"component",
".",
"If",
"this",
"prefix",
"exists",
"the",
"suffix",
"after",
"the",
"component",
"ID",
"is",
"called",
"the",
"local",
"ID",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js#L184-L193 | train | Returns true if the control has a local ID suffix | [
30522,
3853,
1006,
18315,
12162,
13153,
1010,
1051,
29098,
9006,
29513,
3372,
1007,
1063,
13075,
8040,
12162,
13153,
3593,
1027,
1006,
18315,
12162,
13153,
6013,
11253,
3266,
16429,
20614,
1007,
1029,
18315,
12162,
13153,
1012,
2131,
3593,
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.integration/src/sap/ui/integration/library.js | function (DataType) {
"use strict";
// delegate further initialization of this library to the Core
sap.ui.getCore().initLibrary({
name: "sap.ui.integration",
version: "${version}",
dependencies: ["sap.ui.core", "sap.f"],
types: [
"sap.ui.integration.CardActionType",
"sap.ui.integration.CardD... | javascript | function (DataType) {
"use strict";
// delegate further initialization of this library to the Core
sap.ui.getCore().initLibrary({
name: "sap.ui.integration",
version: "${version}",
dependencies: ["sap.ui.core", "sap.f"],
types: [
"sap.ui.integration.CardActionType",
"sap.ui.integration.CardD... | [
"function",
"(",
"DataType",
")",
"{",
"\"use strict\"",
";",
"// delegate further initialization of this library to the Core",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"initLibrary",
"(",
"{",
"name",
":",
"\"sap.ui.integration\"",
",",
"version",
":",
"\"$... | library dependency | [
"library",
"dependency"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.integration/src/sap/ui/integration/library.js#L13-L93 | train | The sap. ui. integration. Core Core | [
30522,
3853,
1006,
2951,
13874,
1007,
1063,
1000,
2224,
9384,
1000,
1025,
1013,
1013,
11849,
2582,
3988,
3989,
1997,
2023,
3075,
2000,
1996,
4563,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
1012,
1999,
4183,
29521,
19848,
2100,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
goldfire/howler.js | dist/howler.js | function() {
var self = this || Howler;
// Only run this if Web Audio is supported and it hasn't already been unlocked.
if (self._audioUnlocked || !self.ctx) {
return;
}
self._audioUnlocked = false;
self.autoUnlock = false;
// Some mobile devices/platforms have disto... | javascript | function() {
var self = this || Howler;
// Only run this if Web Audio is supported and it hasn't already been unlocked.
if (self._audioUnlocked || !self.ctx) {
return;
}
self._audioUnlocked = false;
self.autoUnlock = false;
// Some mobile devices/platforms have disto... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
"||",
"Howler",
";",
"// Only run this if Web Audio is supported and it hasn't already been unlocked.",
"if",
"(",
"self",
".",
"_audioUnlocked",
"||",
"!",
"self",
".",
"ctx",
")",
"{",
"return",
";",
"}",
... | Some browsers/devices will only allow audio to be played after a user interaction.
Attempt to automatically unlock audio on the first user interaction.
Concept from: http://paulbakaus.com/tutorials/html5/web-audio-on-ios/
@return {Howler} | [
"Some",
"browsers",
"/",
"devices",
"will",
"only",
"allow",
"audio",
"to",
"be",
"played",
"after",
"a",
"user",
"interaction",
".",
"Attempt",
"to",
"automatically",
"unlock",
"audio",
"on",
"the",
"first",
"user",
"interaction",
".",
"Concept",
"from",
":... | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L282-L393 | train | The main method of the AudioSource class. | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1064,
1064,
22912,
2121,
1025,
1013,
1013,
2069,
2448,
2023,
2065,
4773,
5746,
2003,
3569,
1998,
2009,
8440,
1005,
1056,
2525,
2042,
14058,
1012,
2065,
1006,
2969,
1012,
1035,
5746,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
zloirock/core-js | packages/core-js/modules/web.url-search-params.js | URLSearchParams | function URLSearchParams(/* init */) {
anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
var init = arguments.length > 0 ? arguments[0] : undefined;
var that = this;
var entries = [];
var iteratorMethod, iterator, step, entryIterator, first, second, key;
setInternalState(that, {
type: UR... | javascript | function URLSearchParams(/* init */) {
anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
var init = arguments.length > 0 ? arguments[0] : undefined;
var that = this;
var entries = [];
var iteratorMethod, iterator, step, entryIterator, first, second, key;
setInternalState(that, {
type: UR... | [
"function",
"URLSearchParams",
"(",
"/* init */",
")",
"{",
"anInstance",
"(",
"this",
",",
"URLSearchParamsConstructor",
",",
"URL_SEARCH_PARAMS",
")",
";",
"var",
"init",
"=",
"arguments",
".",
"length",
">",
"0",
"?",
"arguments",
"[",
"0",
"]",
":",
"und... | `URLSearchParams` constructor https://url.spec.whatwg.org/#interface-urlsearchparams | [
"URLSearchParams",
"constructor",
"https",
":",
"//",
"url",
".",
"spec",
".",
"whatwg",
".",
"org",
"/",
"#interface",
"-",
"urlsearchparams"
] | fe7c8511a6d27d03a9b8e075b3351416aae95c58 | https://github.com/zloirock/core-js/blob/fe7c8511a6d27d03a9b8e075b3351416aae95c58/packages/core-js/modules/web.url-search-params.js#L110-L143 | train | The URLSearchParams constructor. | [
30522,
3853,
24471,
4877,
14644,
2818,
28689,
5244,
1006,
1013,
1008,
1999,
4183,
1008,
1013,
1007,
1063,
2019,
7076,
26897,
1006,
2023,
1010,
24471,
4877,
14644,
2818,
28689,
5244,
8663,
3367,
6820,
16761,
1010,
24471,
2140,
1035,
3945,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/raphael/dev/raphael.core.js | R | function R(first) {
if (R.is(first, "function")) {
return loaded ? first() : eve.on("raphael.DOMload", first);
} else if (R.is(first, array)) {
return R._engine.create[apply](R, first.splice(0, 3 + R.is(first[0], nu))).add(first);
} else {
var args = Array.pro... | javascript | function R(first) {
if (R.is(first, "function")) {
return loaded ? first() : eve.on("raphael.DOMload", first);
} else if (R.is(first, array)) {
return R._engine.create[apply](R, first.splice(0, 3 + R.is(first[0], nu))).add(first);
} else {
var args = Array.pro... | [
"function",
"R",
"(",
"first",
")",
"{",
"if",
"(",
"R",
".",
"is",
"(",
"first",
",",
"\"function\"",
")",
")",
"{",
"return",
"loaded",
"?",
"first",
"(",
")",
":",
"eve",
".",
"on",
"(",
"\"raphael.DOMload\"",
",",
"first",
")",
";",
"}",
"els... | /*\
Raphael
[ method ]
*
Creates a canvas object on which to draw.
You must do this first, as all future calls to drawing methods
from this instance will be bound to this canvas.
> Parameters
*
- container (HTMLElement|string) DOM element or its ID which is going to be a parent for drawing surface
- width (number)
- he... | [
"/",
"*",
"\\",
"Raphael",
"[",
"method",
"]",
"*",
"Creates",
"a",
"canvas",
"object",
"on",
"which",
"to",
"draw",
".",
"You",
"must",
"do",
"this",
"first",
"as",
"all",
"future",
"calls",
"to",
"drawing",
"methods",
"from",
"this",
"instance",
"wil... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/raphael/dev/raphael.core.js#L53-L69 | train | R. create | [
30522,
3853,
1054,
1006,
2034,
1007,
1063,
2065,
1006,
1054,
1012,
2003,
30524,
1025,
1065,
2842,
2065,
1006,
1054,
1012,
2003,
1006,
2034,
1010,
9140,
1007,
1007,
1063,
2709,
1054,
1012,
1035,
3194,
1012,
3443,
1031,
6611,
1033,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Component.js | function() {
// create a copy of arguments for local modification
// and later handover to Component constructor
var args = Array.prototype.slice.call(arguments);
// inject the manifest to the settings object
var mSettings;
if (args.length === 0 || typeof args[0] === "object") {
mS... | javascript | function() {
// create a copy of arguments for local modification
// and later handover to Component constructor
var args = Array.prototype.slice.call(arguments);
// inject the manifest to the settings object
var mSettings;
if (args.length === 0 || typeof args[0] === "object") {
mS... | [
"function",
"(",
")",
"{",
"// create a copy of arguments for local modification",
"// and later handover to Component constructor",
"var",
"args",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
")",
";",
"// inject the manifest to the settings o... | create the proxy class for passing the manifest | [
"create",
"the",
"proxy",
"class",
"for",
"passing",
"the",
"manifest"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Component.js#L2496-L2521 | train | This function is called by the constructor of the component class. It is called by the constructor to create a new instance of the component class. | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
3443,
1037,
6100,
1997,
9918,
2005,
2334,
14080,
1013,
1013,
1998,
2101,
2192,
7840,
2000,
6922,
9570,
2953,
13075,
12098,
5620,
1027,
9140,
1012,
8773,
1012,
14704,
1012,
2655,
1006,
9918,
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... | |
aws/aws-sdk-js | lib/publisher/string-to-buffer.js | stringToBuffer | function stringToBuffer(data) {
return (typeof Buffer.from === 'function' && Buffer.from !== Uint8Array.from) ?
Buffer.from(data) : new Buffer(data);
} | javascript | function stringToBuffer(data) {
return (typeof Buffer.from === 'function' && Buffer.from !== Uint8Array.from) ?
Buffer.from(data) : new Buffer(data);
} | [
"function",
"stringToBuffer",
"(",
"data",
")",
"{",
"return",
"(",
"typeof",
"Buffer",
".",
"from",
"===",
"'function'",
"&&",
"Buffer",
".",
"from",
"!==",
"Uint8Array",
".",
"from",
")",
"?",
"Buffer",
".",
"from",
"(",
"data",
")",
":",
"new",
"Buf... | Converts a UTF8 string into a Buffer.
@param {string} data Some string to convert to a Buffer
@returns {Buffer} | [
"Converts",
"a",
"UTF8",
"string",
"into",
"a",
"Buffer",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/publisher/string-to-buffer.js#L6-L9 | train | Converts a string to a Buffer | [
30522,
3853,
5164,
3406,
8569,
12494,
1006,
2951,
1007,
1063,
2709,
1006,
2828,
11253,
17698,
1012,
2013,
1027,
1027,
1027,
1005,
3853,
1005,
1004,
1004,
17698,
1012,
2013,
999,
1027,
1027,
21318,
3372,
2620,
2906,
9447,
1012,
2013,
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... |
radare/radare2 | shlr/www/graph/js-graph-it.js | getStyle | function getStyle(node, styleProp) {
// if not an element
if( node.nodeType != 1)
return;
var value;
if (node.currentStyle) {
// ie case
styleProp = replaceDashWithCamelNotation(styleProp);
value = node.currentStyle[styleProp];
} else if (window.getComputedStyle) {
// mozilla case
value = document.d... | javascript | function getStyle(node, styleProp) {
// if not an element
if( node.nodeType != 1)
return;
var value;
if (node.currentStyle) {
// ie case
styleProp = replaceDashWithCamelNotation(styleProp);
value = node.currentStyle[styleProp];
} else if (window.getComputedStyle) {
// mozilla case
value = document.d... | [
"function",
"getStyle",
"(",
"node",
",",
"styleProp",
")",
"{",
"// if not an element",
"if",
"(",
"node",
".",
"nodeType",
"!=",
"1",
")",
"return",
";",
"var",
"value",
";",
"if",
"(",
"node",
".",
"currentStyle",
")",
"{",
"// ie case",
"styleProp",
... | This function retrieves the actual value of a style property even if it is set via css. | [
"This",
"function",
"retrieves",
"the",
"actual",
"value",
"of",
"a",
"style",
"property",
"even",
"if",
"it",
"is",
"set",
"via",
"css",
"."
] | bf5e3028810a0ec7c267c6fe4bfad639b4819e35 | https://github.com/radare/radare2/blob/bf5e3028810a0ec7c267c6fe4bfad639b4819e35/shlr/www/graph/js-graph-it.js#L1262-L1278 | train | Get the value of a style property of a node | [
30522,
3853,
4152,
27983,
1006,
13045,
1010,
2806,
21572,
2361,
1007,
1063,
1013,
1013,
2065,
2025,
2019,
5783,
2065,
1006,
13045,
1012,
13045,
13874,
999,
1027,
1015,
1007,
2709,
1025,
13075,
3643,
1025,
2065,
1006,
13045,
1012,
14731,
279... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/sensing.js | function() {
this.jsonInit({
"message0": Blockly.Msg.SENSING_OF,
"args0": [
{
"type": "field_dropdown",
"name": "PROPERTY",
"options": [
[Blockly.Msg.SENSING_OF_XPOSITION, 'x position'],
[Blockly.Msg.SENSING_OF_YPOSITION, 'y position'],
... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.SENSING_OF,
"args0": [
{
"type": "field_dropdown",
"name": "PROPERTY",
"options": [
[Blockly.Msg.SENSING_OF_XPOSITION, 'x position'],
[Blockly.Msg.SENSING_OF_YPOSITION, 'y position'],
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"SENSING_OF",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"PROPERTY\"",
",",
"\"options\"",
"... | Block to report properties of sprites.
@this Blockly.Block | [
"Block",
"to",
"report",
"properties",
"of",
"sprites",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/sensing.js#L434-L463 | train | Block for the ambient object. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
13851,
1035,
1997,
1010,
1000,
12098,
5620,
2692,
1000,
1024,
1031,
1063,
1000,
2828,
1000,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
showdownjs/showdown | dist/showdown.js | _constructor | function _constructor () {
converterOptions = converterOptions || {};
for (var gOpt in globalOptions) {
if (globalOptions.hasOwnProperty(gOpt)) {
options[gOpt] = globalOptions[gOpt];
}
}
// Merge options
if (typeof converterOptions === 'object') {
for (var opt in converte... | javascript | function _constructor () {
converterOptions = converterOptions || {};
for (var gOpt in globalOptions) {
if (globalOptions.hasOwnProperty(gOpt)) {
options[gOpt] = globalOptions[gOpt];
}
}
// Merge options
if (typeof converterOptions === 'object') {
for (var opt in converte... | [
"function",
"_constructor",
"(",
")",
"{",
"converterOptions",
"=",
"converterOptions",
"||",
"{",
"}",
";",
"for",
"(",
"var",
"gOpt",
"in",
"globalOptions",
")",
"{",
"if",
"(",
"globalOptions",
".",
"hasOwnProperty",
"(",
"gOpt",
")",
")",
"{",
"options... | Converter constructor
@private | [
"Converter",
"constructor"
] | 33bba54535d6fcdde5c82d2ec4d7a3bd951b5bb9 | https://github.com/showdownjs/showdown/blob/33bba54535d6fcdde5c82d2ec4d7a3bd951b5bb9/dist/showdown.js#L4901-L4925 | train | Constructor for the class | [
30522,
3853,
1035,
9570,
2953,
1006,
1007,
1063,
10463,
10624,
16790,
2015,
1027,
10463,
10624,
16790,
2015,
1064,
1064,
1063,
1065,
1025,
2005,
1006,
13075,
2175,
13876,
1999,
3795,
7361,
9285,
1007,
1063,
2065,
1006,
3795,
7361,
9285,
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... |
nhn/tui.editor | src/js/extensions/colorSyntax.js | wrapTextAndGetRange | function wrapTextAndGetRange(pre, text, post) {
return {
result: `${pre}${text}${post}`,
from: pre.length,
to: pre.length + text.length
};
} | javascript | function wrapTextAndGetRange(pre, text, post) {
return {
result: `${pre}${text}${post}`,
from: pre.length,
to: pre.length + text.length
};
} | [
"function",
"wrapTextAndGetRange",
"(",
"pre",
",",
"text",
",",
"post",
")",
"{",
"return",
"{",
"result",
":",
"`",
"${",
"pre",
"}",
"${",
"text",
"}",
"${",
"post",
"}",
"`",
",",
"from",
":",
"pre",
".",
"length",
",",
"to",
":",
"pre",
".",... | wrap text with pre & post and return with text range
@param {string} pre - text pre
@param {string} text - text
@param {string} post - text post
@returns {object} - wrapped text and range(from, to)
@ignore | [
"wrap",
"text",
"with",
"pre",
"&",
"post",
"and",
"return",
"with",
"text",
"range"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/colorSyntax.js#L276-L282 | train | Wrap text with a range of words | [
30522,
3853,
10236,
18209,
5685,
18150,
24388,
2063,
1006,
3653,
1010,
3793,
1010,
2695,
1007,
1063,
2709,
1063,
2765,
1024,
1036,
1002,
1063,
3653,
1065,
1002,
1063,
3793,
1065,
1002,
1063,
2695,
1065,
1036,
1010,
2013,
1024,
3653,
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... |
muaz-khan/RecordRTC | WebGL-Recording/vendor/glge-compiled.js | getChildElementById | function getChildElementById( dNode, id ) {
var dResult = null;
if ( dNode.getAttribute('id') == id )
return dNode;
for ( var i = 0; i < dNode.childNodes.length; i++ ) {
if ( dNode.childNodes[i].nodeType == 1 ) {
dResult = getChildElementById( dNode.childNodes[i], id ); //note: 1-level... | javascript | function getChildElementById( dNode, id ) {
var dResult = null;
if ( dNode.getAttribute('id') == id )
return dNode;
for ( var i = 0; i < dNode.childNodes.length; i++ ) {
if ( dNode.childNodes[i].nodeType == 1 ) {
dResult = getChildElementById( dNode.childNodes[i], id ); //note: 1-level... | [
"function",
"getChildElementById",
"(",
"dNode",
",",
"id",
")",
"{",
"var",
"dResult",
"=",
"null",
";",
"if",
"(",
"dNode",
".",
"getAttribute",
"(",
"'id'",
")",
"==",
"id",
")",
"return",
"dNode",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i"... | Function will get element by id starting from specified node.
Author: Renato Bebić <renato.bebic@gmail.com>
The material getter below borked if there is e.g. a scene node with the same name as the material.
This is used to fix that by only looking for materials in the library_materials element. | [
"Function",
"will",
"get",
"element",
"by",
"id",
"starting",
"from",
"specified",
"node",
".",
"Author",
":",
"Renato",
"Bebić",
"<renato",
".",
"bebic@gmail",
".",
"com",
">"
] | 3c6bad427b9da35c1cf617199ed13dda056c38ba | https://github.com/muaz-khan/RecordRTC/blob/3c6bad427b9da35c1cf617199ed13dda056c38ba/WebGL-Recording/vendor/glge-compiled.js#L17785-L17801 | train | Returns the child element of the specified node by its id | [
30522,
3853,
2131,
19339,
12260,
3672,
3762,
3593,
1006,
1040,
3630,
3207,
1010,
8909,
1007,
1063,
13075,
2852,
2229,
11314,
1027,
19701,
1025,
2065,
1006,
1040,
3630,
3207,
1012,
2131,
19321,
3089,
8569,
2618,
1006,
1005,
8909,
1005,
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... |
uber/deck.gl | examples/website/plot/plot-layer/utils.js | setTextStyle | function setTextStyle(ctx, fontSize) {
ctx.font = `${fontSize}px Helvetica,Arial,sans-serif`;
ctx.fillStyle = '#000';
ctx.textBaseline = 'top';
ctx.textAlign = 'center';
} | javascript | function setTextStyle(ctx, fontSize) {
ctx.font = `${fontSize}px Helvetica,Arial,sans-serif`;
ctx.fillStyle = '#000';
ctx.textBaseline = 'top';
ctx.textAlign = 'center';
} | [
"function",
"setTextStyle",
"(",
"ctx",
",",
"fontSize",
")",
"{",
"ctx",
".",
"font",
"=",
"`",
"${",
"fontSize",
"}",
"`",
";",
"ctx",
".",
"fillStyle",
"=",
"'#000'",
";",
"ctx",
".",
"textBaseline",
"=",
"'top'",
";",
"ctx",
".",
"textAlign",
"="... | helper for textMatrixToTexture | [
"helper",
"for",
"textMatrixToTexture"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/examples/website/plot/plot-layer/utils.js#L6-L11 | train | Set text style | [
30522,
30524,
15489,
5332,
4371,
1065,
1052,
2595,
2002,
2140,
19510,
5555,
1010,
9342,
2140,
1010,
20344,
1011,
14262,
10128,
1036,
1025,
14931,
2595,
1012,
17469,
27983,
1027,
1005,
1001,
2199,
1005,
1025,
14931,
2595,
1012,
3793,
15058,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | parseInstallerLog | function parseInstallerLog(filepath, searchstring, encoding, callback) {
var line = "";
var searchFn = function searchFn(str) {
var arr = str.split('\n'),
lineNum,
pos;
for (lineNum = arr.length - 1; lineNum >= 0; lineNum--) {
var s... | javascript | function parseInstallerLog(filepath, searchstring, encoding, callback) {
var line = "";
var searchFn = function searchFn(str) {
var arr = str.split('\n'),
lineNum,
pos;
for (lineNum = arr.length - 1; lineNum >= 0; lineNum--) {
var s... | [
"function",
"parseInstallerLog",
"(",
"filepath",
",",
"searchstring",
",",
"encoding",
",",
"callback",
")",
"{",
"var",
"line",
"=",
"\"\"",
";",
"var",
"searchFn",
"=",
"function",
"searchFn",
"(",
"str",
")",
"{",
"var",
"arr",
"=",
"str",
".",
"spli... | Parse the Installer log and search for a error strings
one it finds the line which has any of error String
it return that line and exit | [
"Parse",
"the",
"Installer",
"log",
"and",
"search",
"for",
"a",
"error",
"strings",
"one",
"it",
"finds",
"the",
"line",
"which",
"has",
"any",
"of",
"error",
"String",
"it",
"return",
"that",
"line",
"and",
"exit"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L187-L215 | train | Parses installer log | [
30522,
3853,
11968,
20240,
23808,
24164,
12190,
8649,
1006,
5371,
15069,
1010,
3945,
3367,
4892,
1010,
17181,
1010,
2655,
5963,
1007,
1063,
13075,
2240,
1027,
1000,
1000,
1025,
13075,
3945,
2546,
2078,
1027,
3853,
3945,
2546,
2078,
1006,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/NavigationAndHistory/main.js | _moveNext | function _moveNext() {
var $context, $next;
$context = $currentContext || $("#mrof-container #mrof-list > li.highlight");
if ($context.length > 0) {
$next = $context.next();
if ($next.length === 0) {
$next = $("#mrof-container #mrof-list > li").first();
... | javascript | function _moveNext() {
var $context, $next;
$context = $currentContext || $("#mrof-container #mrof-list > li.highlight");
if ($context.length > 0) {
$next = $context.next();
if ($next.length === 0) {
$next = $("#mrof-container #mrof-list > li").first();
... | [
"function",
"_moveNext",
"(",
")",
"{",
"var",
"$context",
",",
"$next",
";",
"$context",
"=",
"$currentContext",
"||",
"$",
"(",
"\"#mrof-container #mrof-list > li.highlight\"",
")",
";",
"if",
"(",
"$context",
".",
"length",
">",
"0",
")",
"{",
"$next",
"=... | Opens the next item in MROF list if pop over is visible else displays the pop over
@private | [
"Opens",
"the",
"next",
"item",
"in",
"MROF",
"list",
"if",
"pop",
"over",
"is",
"visible",
"else",
"displays",
"the",
"pop",
"over"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L479-L496 | train | Move the next item in the list | [
30522,
3853,
1035,
2693,
2638,
18413,
1006,
1007,
1063,
13075,
1002,
6123,
1010,
1002,
2279,
1025,
1002,
6123,
1027,
1002,
2783,
8663,
18209,
1064,
1064,
1002,
1006,
1000,
1001,
2720,
11253,
1011,
11661,
1001,
2720,
11253,
1011,
2862,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function (sBaseMetaPath, sChildMetaPath, mChildQueryOptions,
fnFetchMetadata) {
var sExpandSelectPath = "",
i,
aMetaPathSegments = sChildMetaPath.split("/"),
oProperty,
sPropertyMetaPath = sBaseMetaPath,
mQueryOptions = {},
mQueryOptionsForPathPrefix = mQueryOptions;
if (sChildMetaPat... | javascript | function (sBaseMetaPath, sChildMetaPath, mChildQueryOptions,
fnFetchMetadata) {
var sExpandSelectPath = "",
i,
aMetaPathSegments = sChildMetaPath.split("/"),
oProperty,
sPropertyMetaPath = sBaseMetaPath,
mQueryOptions = {},
mQueryOptionsForPathPrefix = mQueryOptions;
if (sChildMetaPat... | [
"function",
"(",
"sBaseMetaPath",
",",
"sChildMetaPath",
",",
"mChildQueryOptions",
",",
"fnFetchMetadata",
")",
"{",
"var",
"sExpandSelectPath",
"=",
"\"\"",
",",
"i",
",",
"aMetaPathSegments",
"=",
"sChildMetaPath",
".",
"split",
"(",
"\"/\"",
")",
",",
"oProp... | Creates the query options for a child binding with the meta path given by its base
meta path and relative meta path. Adds the key properties to $select of all expanded
navigation properties. Requires that meta data for the meta path is already loaded so
that synchronous access to all prefixes of the relative meta path ... | [
"Creates",
"the",
"query",
"options",
"for",
"a",
"child",
"binding",
"with",
"the",
"meta",
"path",
"given",
"by",
"its",
"base",
"meta",
"path",
"and",
"relative",
"meta",
"path",
".",
"Adds",
"the",
"key",
"properties",
"to",
"$select",
"of",
"all",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L1329-L1377 | train | Creates an object that can be used to select the child bindings | [
30522,
3853,
1006,
24829,
11022,
11368,
22068,
2705,
1010,
8040,
19466,
22117,
12928,
15069,
1010,
11338,
19466,
2094,
4226,
2854,
7361,
9285,
1010,
1042,
2078,
7959,
10649,
11368,
8447,
2696,
1007,
1063,
13075,
3348,
9739,
5104,
12260,
6593,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/select/select.js | showDropDown | function showDropDown(scope, element, opts) {
if (opts.parent !== element.parent()) {
element.parent().attr('aria-owns', element.attr('id'));
}
element.parent().find('md-select-value').attr('aria-hidden', 'true');
opts.parent.append(element);
return $q(function(resolv... | javascript | function showDropDown(scope, element, opts) {
if (opts.parent !== element.parent()) {
element.parent().attr('aria-owns', element.attr('id'));
}
element.parent().find('md-select-value').attr('aria-hidden', 'true');
opts.parent.append(element);
return $q(function(resolv... | [
"function",
"showDropDown",
"(",
"scope",
",",
"element",
",",
"opts",
")",
"{",
"if",
"(",
"opts",
".",
"parent",
"!==",
"element",
".",
"parent",
"(",
")",
")",
"{",
"element",
".",
"parent",
"(",
")",
".",
"attr",
"(",
"'aria-owns'",
",",
"element... | ************************************ Closure Functions ************************************
Attach the select DOM element(s) and animate to the correct positions
and scalings... | [
"************************************",
"Closure",
"Functions",
"************************************",
"Attach",
"the",
"select",
"DOM",
"element",
"(",
"s",
")",
"and",
"animate",
"to",
"the",
"correct",
"positions",
"and",
"scalings",
"..."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/select/select.js#L1309-L1331 | train | show drop down | [
30522,
3853,
2265,
25711,
7698,
1006,
9531,
1010,
5783,
1010,
23569,
2015,
1007,
1063,
2065,
1006,
23569,
2015,
1012,
6687,
999,
1027,
1027,
5783,
1012,
6687,
1006,
1007,
1007,
1063,
5783,
1012,
6687,
1006,
1007,
1012,
2012,
16344,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/plugins/Performance.js | _applyFilters | function _applyFilters(rawdata, filterOptions) {
var dataToWorkOn = (JSON.parse(JSON.stringify(rawdata)));
var containerWidth = document.querySelector('#sapUiSupportPerfHeaderTimeline').offsetWidth - document.querySelector('#sapUiSupportPerfHeaderTimelineBarInfoWrapper').offsetWidth;
var scrollWidth = 20;
v... | javascript | function _applyFilters(rawdata, filterOptions) {
var dataToWorkOn = (JSON.parse(JSON.stringify(rawdata)));
var containerWidth = document.querySelector('#sapUiSupportPerfHeaderTimeline').offsetWidth - document.querySelector('#sapUiSupportPerfHeaderTimelineBarInfoWrapper').offsetWidth;
var scrollWidth = 20;
v... | [
"function",
"_applyFilters",
"(",
"rawdata",
",",
"filterOptions",
")",
"{",
"var",
"dataToWorkOn",
"=",
"(",
"JSON",
".",
"parse",
"(",
"JSON",
".",
"stringify",
"(",
"rawdata",
")",
")",
")",
";",
"var",
"containerWidth",
"=",
"document",
".",
"querySele... | /* =============================================================================================================
Filters
============================================================================================================= | [
"/",
"*",
"=============================================================================================================",
"Filters",
"============================================================================================================="
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/plugins/Performance.js#L690-L707 | train | Apply filters to the given data | [
30522,
3853,
1035,
6611,
8873,
21928,
2015,
1006,
6315,
2850,
2696,
1010,
11307,
7361,
9285,
1007,
1063,
13075,
2951,
18790,
2953,
19648,
1027,
1006,
1046,
3385,
1012,
11968,
3366,
1006,
1046,
3385,
1012,
5164,
8757,
1006,
6315,
2850,
2696,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
keplergl/kepler.gl | src/utils/filter-utils.js | getHistogram | function getHistogram(domain, mappedValue) {
const histogram = histogramConstruct(domain, mappedValue, histogramBins);
const enlargedHistogram = histogramConstruct(
domain,
mappedValue,
enlargedHistogramBins
);
return {histogram, enlargedHistogram};
} | javascript | function getHistogram(domain, mappedValue) {
const histogram = histogramConstruct(domain, mappedValue, histogramBins);
const enlargedHistogram = histogramConstruct(
domain,
mappedValue,
enlargedHistogramBins
);
return {histogram, enlargedHistogram};
} | [
"function",
"getHistogram",
"(",
"domain",
",",
"mappedValue",
")",
"{",
"const",
"histogram",
"=",
"histogramConstruct",
"(",
"domain",
",",
"mappedValue",
",",
"histogramBins",
")",
";",
"const",
"enlargedHistogram",
"=",
"histogramConstruct",
"(",
"domain",
","... | Calculate histogram from domain and array of values
@param {number[]} domain
@param {Object[]} mappedValue
@returns {Array[]} histogram | [
"Calculate",
"histogram",
"from",
"domain",
"and",
"array",
"of",
"values"
] | 779238435707cc54335c2d00001e4b9334b314aa | https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/src/utils/filter-utils.js#L457-L466 | train | Get the histogram and enlarged histogram | [
30522,
3853,
2131,
24158,
3406,
13113,
1006,
5884,
1010,
17715,
10175,
5657,
1007,
30524,
1027,
2010,
3406,
13113,
8663,
3367,
6820,
6593,
1006,
5884,
1010,
17715,
10175,
5657,
1010,
11792,
24158,
3406,
13113,
8428,
2015,
1007,
1025,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/uml.js | plantUMLReplacer | function plantUMLReplacer(umlCode) {
let renderedHTML;
try {
if (!plantumlEncoder) {
throw new Error('plantuml-encoder dependency required');
}
renderedHTML = `<img src="${rendererURL}${plantumlEncoder.encode(umlCode)}" />`;
} catch (err) {
renderedHTML = `Error occurred on ... | javascript | function plantUMLReplacer(umlCode) {
let renderedHTML;
try {
if (!plantumlEncoder) {
throw new Error('plantuml-encoder dependency required');
}
renderedHTML = `<img src="${rendererURL}${plantumlEncoder.encode(umlCode)}" />`;
} catch (err) {
renderedHTML = `Error occurred on ... | [
"function",
"plantUMLReplacer",
"(",
"umlCode",
")",
"{",
"let",
"renderedHTML",
";",
"try",
"{",
"if",
"(",
"!",
"plantumlEncoder",
")",
"{",
"throw",
"new",
"Error",
"(",
"'plantuml-encoder dependency required'",
")",
";",
"}",
"renderedHTML",
"=",
"`",
"${"... | render html from uml
@param {string} umlCode - plant uml code text
@returns {string} - rendered html | [
"render",
"html",
"from",
"uml"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/uml.js#L30-L43 | train | plantUMLReplacer - Placeholder for HTML | [
30522,
3853,
3269,
2819,
20974,
13699,
19217,
2099,
1006,
8529,
22499,
3207,
1007,
1063,
2292,
10155,
11039,
19968,
1025,
3046,
1063,
2065,
1006,
999,
3269,
2819,
7770,
16044,
2099,
1007,
1063,
5466,
2047,
7561,
1006,
1005,
3269,
2819,
2140... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
codemirror/CodeMirror | src/model/Doc.js | function(from, to, op) {
if (op) this.iterN(from - this.first, to - from, op)
else this.iterN(this.first, this.first + this.size, from)
} | javascript | function(from, to, op) {
if (op) this.iterN(from - this.first, to - from, op)
else this.iterN(this.first, this.first + this.size, from)
} | [
"function",
"(",
"from",
",",
"to",
",",
"op",
")",
"{",
"if",
"(",
"op",
")",
"this",
".",
"iterN",
"(",
"from",
"-",
"this",
".",
"first",
",",
"to",
"-",
"from",
",",
"op",
")",
"else",
"this",
".",
"iterN",
"(",
"this",
".",
"first",
",",... | Iterate over the document. Supports two forms -- with only one argument, it calls that for each line in the document. With three, it iterates over the range given by the first two (with the second being non-inclusive). | [
"Iterate",
"over",
"the",
"document",
".",
"Supports",
"two",
"forms",
"--",
"with",
"only",
"one",
"argument",
"it",
"calls",
"that",
"for",
"each",
"line",
"in",
"the",
"document",
".",
"With",
"three",
"it",
"iterates",
"over",
"the",
"range",
"given",
... | dab6f676107c10ba8d16c654a42f66cae3f27db1 | https://github.com/codemirror/CodeMirror/blob/dab6f676107c10ba8d16c654a42f66cae3f27db1/src/model/Doc.js#L53-L56 | train | Iterates over the sequence | [
30522,
3853,
1006,
2013,
1010,
2000,
1010,
6728,
1007,
1063,
2065,
1006,
6728,
1007,
2023,
1012,
2009,
11795,
1006,
2013,
1011,
2023,
1012,
2034,
1010,
2000,
1011,
2013,
1010,
6728,
1007,
2842,
2023,
1012,
2009,
11795,
1006,
2023,
1012,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/launchers/node/LauncherDomain.js | init | function init(domainManager) {
_domainManager = domainManager;
if (!domainManager.hasDomain("launcher")) {
domainManager.registerDomain("launcher", {major: 0, minor: 1});
}
domainManager.registerCommand(
"launcher", // domain name
"launch", // command name
_cmd... | javascript | function init(domainManager) {
_domainManager = domainManager;
if (!domainManager.hasDomain("launcher")) {
domainManager.registerDomain("launcher", {major: 0, minor: 1});
}
domainManager.registerCommand(
"launcher", // domain name
"launch", // command name
_cmd... | [
"function",
"init",
"(",
"domainManager",
")",
"{",
"_domainManager",
"=",
"domainManager",
";",
"if",
"(",
"!",
"domainManager",
".",
"hasDomain",
"(",
"\"launcher\"",
")",
")",
"{",
"domainManager",
".",
"registerDomain",
"(",
"\"launcher\"",
",",
"{",
"majo... | Initializes the domain and registers commands.
@param {DomainManager} domainManager The DomainManager for the server | [
"Initializes",
"the",
"domain",
"and",
"registers",
"commands",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/launchers/node/LauncherDomain.js#L51-L68 | train | Initializes the node domain manager | [
30522,
3853,
1999,
4183,
1006,
5884,
24805,
4590,
1007,
1063,
1035,
5884,
24805,
4590,
1027,
5884,
24805,
4590,
1025,
2065,
1006,
999,
5884,
24805,
4590,
1012,
2038,
9527,
8113,
1006,
1000,
22742,
1000,
1007,
1007,
1063,
5884,
24805,
4590,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.dt/src/sap/ui/dt/util/ZIndexManager.js | function () {
var aOpenPopups = fnGetPopups();
var iLowestPopupZIndex;
if (aOpenPopups.length > 0) {
iLowestPopupZIndex = Math.min.apply(null, fnGetZIndexFromPopups(aOpenPopups));
}
// if no open popups
if (!Util.isInteger(iLowestPopupZIndex)) {
return Popup.getNextZIndex();
}
// get ... | javascript | function () {
var aOpenPopups = fnGetPopups();
var iLowestPopupZIndex;
if (aOpenPopups.length > 0) {
iLowestPopupZIndex = Math.min.apply(null, fnGetZIndexFromPopups(aOpenPopups));
}
// if no open popups
if (!Util.isInteger(iLowestPopupZIndex)) {
return Popup.getNextZIndex();
}
// get ... | [
"function",
"(",
")",
"{",
"var",
"aOpenPopups",
"=",
"fnGetPopups",
"(",
")",
";",
"var",
"iLowestPopupZIndex",
";",
"if",
"(",
"aOpenPopups",
".",
"length",
">",
"0",
")",
"{",
"iLowestPopupZIndex",
"=",
"Math",
".",
"min",
".",
"apply",
"(",
"null",
... | Calculates the z-index value below open popups.
If there are no open popups it returns the value from sap.ui.core.Popup.getNextZIndex()
@returns {int} z-index below open popups
@public | [
"Calculates",
"the",
"z",
"-",
"index",
"value",
"below",
"open",
"popups",
".",
"If",
"there",
"are",
"no",
"open",
"popups",
"it",
"returns",
"the",
"value",
"from",
"sap",
".",
"ui",
".",
"core",
".",
"Popup",
".",
"getNextZIndex",
"()"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/util/ZIndexManager.js#L137-L152 | train | Returns the z - index of the first popup that is not open | [
30522,
3853,
1006,
1007,
1063,
13075,
20118,
11837,
16340,
22264,
1027,
1042,
15465,
25856,
7361,
22264,
1006,
1007,
1025,
13075,
6335,
29385,
3367,
16340,
6279,
17168,
3207,
2595,
1025,
2065,
1006,
20118,
11837,
16340,
22264,
1012,
3091,
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/view/MainViewManager.js | _findFileInMRUList | function _findFileInMRUList(paneId, file) {
return _.findIndex(_mruList, function (record) {
return (record.file.fullPath === file.fullPath && record.paneId === paneId);
});
} | javascript | function _findFileInMRUList(paneId, file) {
return _.findIndex(_mruList, function (record) {
return (record.file.fullPath === file.fullPath && record.paneId === paneId);
});
} | [
"function",
"_findFileInMRUList",
"(",
"paneId",
",",
"file",
")",
"{",
"return",
"_",
".",
"findIndex",
"(",
"_mruList",
",",
"function",
"(",
"record",
")",
"{",
"return",
"(",
"record",
".",
"file",
".",
"fullPath",
"===",
"file",
".",
"fullPath",
"&&... | Locates the first MRU entry of a file for the requested pane
@param {!string} paneId - the paneId
@param {!File} File - the file
@return {{file:File, paneId:string}}
@private | [
"Locates",
"the",
"first",
"MRU",
"entry",
"of",
"a",
"file",
"for",
"the",
"requested",
"pane"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L260-L264 | train | Find the file in the MRU list | [
30522,
3853,
1035,
2424,
8873,
19856,
2213,
6820,
9863,
1006,
6090,
7416,
2094,
1010,
5371,
1007,
1063,
2709,
1035,
1012,
2424,
22254,
10288,
1006,
1035,
2720,
15859,
3367,
1010,
3853,
1006,
2501,
30524,
2094,
1027,
1027,
1027,
6090,
7416,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | mouseMoveRedraw | function mouseMoveRedraw() {
if (!bezierEditor.dragElement) {
animationRequest = null;
return;
}
// Update code
bezierEditor._commitTimingFunction();
bezierEditor._updateCanvas();
animationRequest = window.requestA... | javascript | function mouseMoveRedraw() {
if (!bezierEditor.dragElement) {
animationRequest = null;
return;
}
// Update code
bezierEditor._commitTimingFunction();
bezierEditor._updateCanvas();
animationRequest = window.requestA... | [
"function",
"mouseMoveRedraw",
"(",
")",
"{",
"if",
"(",
"!",
"bezierEditor",
".",
"dragElement",
")",
"{",
"animationRequest",
"=",
"null",
";",
"return",
";",
"}",
"// Update code",
"bezierEditor",
".",
"_commitTimingFunction",
"(",
")",
";",
"bezierEditor",
... | Helper function to redraw curve | [
"Helper",
"function",
"to",
"redraw",
"curve"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L291-L302 | train | Redraws the mouse to the right | [
30522,
3853,
8000,
5302,
25896,
2527,
2860,
1006,
1007,
1063,
2065,
1006,
999,
2022,
21548,
2098,
15660,
1012,
8011,
12260,
3672,
1007,
1063,
7284,
2890,
15500,
1027,
19701,
1025,
2709,
1025,
1065,
1013,
1013,
10651,
3642,
2022,
21548,
2098... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | shouldUseThirdParty | function shouldUseThirdParty() {
var sHyphenationConfig = Core.getConfiguration().getHyphenation(),
oHyphenationInstance = Hyphenation.getInstance();
if (sHyphenationConfig === "native" || sHyphenationConfig === "disable") {
return false;
}
if (sHyphenationConfig === "thirdparty") {
return tru... | javascript | function shouldUseThirdParty() {
var sHyphenationConfig = Core.getConfiguration().getHyphenation(),
oHyphenationInstance = Hyphenation.getInstance();
if (sHyphenationConfig === "native" || sHyphenationConfig === "disable") {
return false;
}
if (sHyphenationConfig === "thirdparty") {
return tru... | [
"function",
"shouldUseThirdParty",
"(",
")",
"{",
"var",
"sHyphenationConfig",
"=",
"Core",
".",
"getConfiguration",
"(",
")",
".",
"getHyphenation",
"(",
")",
",",
"oHyphenationInstance",
"=",
"Hyphenation",
".",
"getInstance",
"(",
")",
";",
"if",
"(",
"sHyp... | Checks if the third-party hyphenation is required.
@returns {boolean} True if third-party hyphenation is required. False if native hyphenation is available or required
@private | [
"Checks",
"if",
"the",
"third",
"-",
"party",
"hyphenation",
"is",
"required",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/HyphenationSupport.js#L105-L120 | train | Returns true if the hyphenation is supported. | [
30522,
3853,
2323,
8557,
15222,
4103,
19362,
3723,
1006,
1007,
1063,
13075,
11004,
8458,
8189,
3508,
8663,
8873,
2290,
1027,
4563,
1012,
2131,
8663,
8873,
27390,
3370,
1006,
1007,
1012,
2131,
10536,
8458,
8189,
3508,
1006,
1007,
1010,
2821,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/config.js | getCredentials | function getCredentials(callback) {
var self = this;
function finish(err) {
callback(err, err ? null : self.credentials);
}
function credError(msg, err) {
return new AWS.util.error(err || new Error(), {
code: 'CredentialsError',
message: msg,
name: 'CredentialsError... | javascript | function getCredentials(callback) {
var self = this;
function finish(err) {
callback(err, err ? null : self.credentials);
}
function credError(msg, err) {
return new AWS.util.error(err || new Error(), {
code: 'CredentialsError',
message: msg,
name: 'CredentialsError... | [
"function",
"getCredentials",
"(",
"callback",
")",
"{",
"var",
"self",
"=",
"this",
";",
"function",
"finish",
"(",
"err",
")",
"{",
"callback",
"(",
"err",
",",
"err",
"?",
"null",
":",
"self",
".",
"credentials",
")",
";",
"}",
"function",
"credErro... | @!group Managing Credentials
Loads credentials from the configuration object. This is used internally
by the SDK to ensure that refreshable {Credentials} objects are properly
refreshed and loaded when sending a request. If you want to ensure that
your credentials are loaded prior to a request, you can use this method... | [
"@!group",
"Managing",
"Credentials",
"Loads",
"credentials",
"from",
"the",
"configuration",
"object",
".",
"This",
"is",
"used",
"internally",
"by",
"the",
"SDK",
"to",
"ensure",
"that",
"refreshable",
"{",
"Credentials",
"}",
"objects",
"are",
"properly",
"re... | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/config.js#L346-L397 | train | Get the credentials from the service | [
30522,
3853,
2131,
16748,
16454,
26340,
1006,
2655,
5963,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
3853,
3926,
1006,
9413,
2099,
1007,
1063,
2655,
5963,
1006,
9413,
2099,
1010,
9413,
2099,
1029,
19701,
1024,
2969,
1012,
22496,
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.core/src/sap/ui/core/Configuration.js | function(sFormatId) {
check(!sFormatId || M_ABAP_TIME_FORMAT_PATTERN.hasOwnProperty(sFormatId), "sFormatId must be one of ['0','1','2','3','4'] or empty");
var mChanges = this.oConfiguration._collect();
this.sLegacyTimeFormat = mChanges.legacyTimeFormat = sFormatId = sFormatId || "";
this.setTimePattern("sh... | javascript | function(sFormatId) {
check(!sFormatId || M_ABAP_TIME_FORMAT_PATTERN.hasOwnProperty(sFormatId), "sFormatId must be one of ['0','1','2','3','4'] or empty");
var mChanges = this.oConfiguration._collect();
this.sLegacyTimeFormat = mChanges.legacyTimeFormat = sFormatId = sFormatId || "";
this.setTimePattern("sh... | [
"function",
"(",
"sFormatId",
")",
"{",
"check",
"(",
"!",
"sFormatId",
"||",
"M_ABAP_TIME_FORMAT_PATTERN",
".",
"hasOwnProperty",
"(",
"sFormatId",
")",
",",
"\"sFormatId must be one of ['0','1','2','3','4'] or empty\"",
")",
";",
"var",
"mChanges",
"=",
"this",
".",... | Allows to specify one of the legacy ABAP time formats.
This method sets the time patterns for 'short' and 'medium' style to the corresponding ABAP
formats and sets the day period texts to "AM"/"PM" or "am"/"pm" respectively. When called
with a null or undefined format id, any previously applied format will be removed.... | [
"Allows",
"to",
"specify",
"one",
"of",
"the",
"legacy",
"ABAP",
"time",
"formats",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Configuration.js#L2092-L2101 | train | Sets the legacy time format | [
30522,
3853,
1006,
16420,
2953,
18900,
3593,
1007,
1063,
4638,
1006,
999,
16420,
2953,
18900,
3593,
1064,
1064,
1049,
1035,
19557,
2361,
1035,
2051,
1035,
4289,
1035,
5418,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
16420,
2953,
18900,
359... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/search/FindInFiles.js | _addListeners | function _addListeners() {
// Avoid adding duplicate listeners - e.g. if a 2nd search is run without closing the old results panel first
_removeListeners();
DocumentModule.on("documentChange", _documentChangeHandler);
FileSystem.on("change", _debouncedFileSystemChangeHandler);
D... | javascript | function _addListeners() {
// Avoid adding duplicate listeners - e.g. if a 2nd search is run without closing the old results panel first
_removeListeners();
DocumentModule.on("documentChange", _documentChangeHandler);
FileSystem.on("change", _debouncedFileSystemChangeHandler);
D... | [
"function",
"_addListeners",
"(",
")",
"{",
"// Avoid adding duplicate listeners - e.g. if a 2nd search is run without closing the old results panel first",
"_removeListeners",
"(",
")",
";",
"DocumentModule",
".",
"on",
"(",
"\"documentChange\"",
",",
"_documentChangeHandler",
")"... | Add listeners to track events that might change the search result set | [
"Add",
"listeners",
"to",
"track",
"events",
"that",
"might",
"change",
"the",
"search",
"result",
"set"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L98-L105 | train | Add listeners to the results panel | [
30522,
3853,
1035,
5587,
9863,
24454,
2015,
1006,
1007,
1063,
1013,
1013,
4468,
5815,
24473,
13810,
1011,
1041,
1012,
1043,
1012,
2065,
1037,
3416,
3945,
2003,
2448,
2302,
5494,
1996,
2214,
3463,
5997,
2034,
1035,
6366,
9863,
24454,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | elementMatches | function elementMatches(element, selector) {
return genericMethodCall(
Methods.MATCHES, element,
element.matches ? 'matches' : 'msMatchesSelector', [selector]);
} | javascript | function elementMatches(element, selector) {
return genericMethodCall(
Methods.MATCHES, element,
element.matches ? 'matches' : 'msMatchesSelector', [selector]);
} | [
"function",
"elementMatches",
"(",
"element",
",",
"selector",
")",
"{",
"return",
"genericMethodCall",
"(",
"Methods",
".",
"MATCHES",
",",
"element",
",",
"element",
".",
"matches",
"?",
"'matches'",
":",
"'msMatchesSelector'",
",",
"[",
"selector",
"]",
")"... | Returns true if the element would be selected by the provided selector,
without falling prey to things like <form><input name="setAttribute"></form>.
Equivalent to {@code element.matches("foo")}.
@param {!Element} element
@param {string} selector
@return {boolean} | [
"Returns",
"true",
"if",
"the",
"element",
"would",
"be",
"selected",
"by",
"the",
"provided",
"selector",
"without",
"falling",
"prey",
"to",
"things",
"like",
"<form",
">",
"<input",
"name",
"=",
"setAttribute",
">",
"<",
"/",
"form",
">",
".",
"Equivale... | 97390e9ca4483cebb9628e06026139fbb3023d65 | https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/closure/goog/html/sanitizer/noclobber.js#L312-L316 | train | Matches an element with a selector | [
30522,
3853,
5783,
18900,
8376,
1006,
5783,
1010,
27000,
1007,
1063,
2709,
12391,
11368,
6806,
16409,
8095,
1006,
4725,
1012,
3503,
1010,
5783,
1010,
5783,
1012,
3503,
1029,
1005,
3503,
1005,
1024,
1005,
5796,
18900,
8376,
11246,
22471,
295... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/api/v0.1/users.js | handlePermissions | function handlePermissions(options) {
return models.Role.findOne({name: 'Owner'}).then((ownerRole) => {
return canThis(options.context).assign.role(ownerRole);
}).then(() => {
return options;
});
} | javascript | function handlePermissions(options) {
return models.Role.findOne({name: 'Owner'}).then((ownerRole) => {
return canThis(options.context).assign.role(ownerRole);
}).then(() => {
return options;
});
} | [
"function",
"handlePermissions",
"(",
"options",
")",
"{",
"return",
"models",
".",
"Role",
".",
"findOne",
"(",
"{",
"name",
":",
"'Owner'",
"}",
")",
".",
"then",
"(",
"(",
"ownerRole",
")",
"=>",
"{",
"return",
"canThis",
"(",
"options",
".",
"conte... | ### Handle Permissions
We need to be an authorised user to perform this action
@param {Object} options
@returns {Object} options | [
"###",
"Handle",
"Permissions",
"We",
"need",
"to",
"be",
"an",
"authorised",
"user",
"to",
"perform",
"this",
"action"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/users.js#L316-L322 | train | Check if user has the right permissions | [
30522,
3853,
5047,
4842,
25481,
2015,
1006,
7047,
1007,
1063,
2709,
4275,
1012,
2535,
1012,
2424,
5643,
1006,
1063,
2171,
1024,
1005,
3954,
1005,
1065,
1007,
1012,
2059,
1006,
1006,
3954,
13153,
2063,
1007,
1027,
1028,
1063,
2709,
2064,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.