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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function(elem, callback, errback, timeout) {
var timeoutHandler = null;
var that = this;
if (typeof(elem.tree) === "function") {
elem = elem.tree();
}
var id = elem.getAttribute('id');
// inject id if not found
if (!id) {
id = ... | javascript | function(elem, callback, errback, timeout) {
var timeoutHandler = null;
var that = this;
if (typeof(elem.tree) === "function") {
elem = elem.tree();
}
var id = elem.getAttribute('id');
// inject id if not found
if (!id) {
id = ... | [
"function",
"(",
"elem",
",",
"callback",
",",
"errback",
",",
"timeout",
")",
"{",
"var",
"timeoutHandler",
"=",
"null",
";",
"var",
"that",
"=",
"this",
";",
"if",
"(",
"typeof",
"(",
"elem",
".",
"tree",
")",
"===",
"\"function\"",
")",
"{",
"elem... | Function: sendIQ
Helper function to send IQ stanzas.
Parameters:
(XMLElement) elem - The stanza to send.
(Function) callback - The callback function for a successful request.
(Function) errback - The callback function for a failed or timed
out request. On timeout, the stanza will be null.
(Integer) timeout - The time... | [
"Function",
":",
"sendIQ",
"Helper",
"function",
"to",
"send",
"IQ",
"stanzas",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L2460-L2533 | train | Send an IQ | [
30522,
3853,
1006,
3449,
6633,
1010,
2655,
5963,
1010,
30524,
2051,
17167,
5685,
3917,
1027,
19701,
1025,
13075,
2008,
1027,
2023,
1025,
2065,
1006,
2828,
11253,
1006,
3449,
6633,
1012,
3392,
1007,
1027,
1027,
1027,
1000,
3853,
1000,
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... | |
angular/material | src/core/services/registry/componentRegistry.js | resolveWhen | function resolveWhen() {
var dfd = pendings[handle];
if (dfd) {
dfd.forEach(function (promise) {
promise.resolve(instance);
});
delete pendings[handle];
}
} | javascript | function resolveWhen() {
var dfd = pendings[handle];
if (dfd) {
dfd.forEach(function (promise) {
promise.resolve(instance);
});
delete pendings[handle];
}
} | [
"function",
"resolveWhen",
"(",
")",
"{",
"var",
"dfd",
"=",
"pendings",
"[",
"handle",
"]",
";",
"if",
"(",
"dfd",
")",
"{",
"dfd",
".",
"forEach",
"(",
"function",
"(",
"promise",
")",
"{",
"promise",
".",
"resolve",
"(",
"instance",
")",
";",
"}... | Resolve any pending promises for this instance | [
"Resolve",
"any",
"pending",
"promises",
"for",
"this",
"instance"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/registry/componentRegistry.js#L83-L91 | train | resolve when the handle is not in pendings | [
30522,
3853,
10663,
2860,
10222,
1006,
1007,
1063,
13075,
1040,
2546,
2094,
1027,
14223,
2015,
1031,
5047,
1033,
1025,
2065,
1006,
1040,
2546,
2094,
1007,
1063,
1040,
2546,
2094,
1012,
18921,
6776,
1006,
3853,
1006,
4872,
1007,
1063,
4872,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | lib/jsdoc/transform-apijson-for-sdk.js | function (target) {
var result = "";
if (target) {
target.forEach(function (element) {
result += element + '<br>';
});
}
result = this._preProcessLinksInTextBlock(result);
return result;
} | javascript | function (target) {
var result = "";
if (target) {
target.forEach(function (element) {
result += element + '<br>';
});
}
result = this._preProcessLinksInTextBlock(result);
return result;
} | [
"function",
"(",
"target",
")",
"{",
"var",
"result",
"=",
"\"\"",
";",
"if",
"(",
"target",
")",
"{",
"target",
".",
"forEach",
"(",
"function",
"(",
"element",
")",
"{",
"result",
"+=",
"element",
"+",
"'<br>'",
";",
"}",
")",
";",
"}",
"result",... | Formats the target and applies to texts of annotations
@param target - the array of texts to be formatted
@returns string - the formatted text | [
"Formats",
"the",
"target",
"and",
"applies",
"to",
"texts",
"of",
"annotations"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/transform-apijson-for-sdk.js#L968-L979 | train | Returns a string containing the links in the target text block | [
30522,
3853,
1006,
4539,
1007,
1063,
13075,
2765,
1027,
1000,
1000,
1025,
2065,
1006,
4539,
1007,
1063,
4539,
1012,
18921,
6776,
1006,
3853,
1006,
5783,
1007,
1063,
2765,
1009,
1027,
5783,
1009,
1005,
1026,
7987,
1028,
1005,
1025,
1065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aframevr/aframe | src/components/animation.js | function () {
this.updateConfig();
this.animation.began = true;
this.time = 0;
this.animationIsPlaying = true;
this.stopRelatedAnimations();
this.el.emit('animationbegin', this.eventDetail, false);
} | javascript | function () {
this.updateConfig();
this.animation.began = true;
this.time = 0;
this.animationIsPlaying = true;
this.stopRelatedAnimations();
this.el.emit('animationbegin', this.eventDetail, false);
} | [
"function",
"(",
")",
"{",
"this",
".",
"updateConfig",
"(",
")",
";",
"this",
".",
"animation",
".",
"began",
"=",
"true",
";",
"this",
".",
"time",
"=",
"0",
";",
"this",
".",
"animationIsPlaying",
"=",
"true",
";",
"this",
".",
"stopRelatedAnimation... | This is before animation start (including from startEvents).
Set to initial state (config.from, time = 0, seekTime = 0). | [
"This",
"is",
"before",
"animation",
"start",
"(",
"including",
"from",
"startEvents",
")",
".",
"Set",
"to",
"initial",
"state",
"(",
"config",
".",
"from",
"time",
"=",
"0",
"seekTime",
"=",
"0",
")",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/animation.js#L190-L197 | train | Animation begin | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
10651,
8663,
8873,
2290,
1006,
1007,
1025,
2023,
1012,
7284,
1012,
2211,
1027,
2995,
1025,
2023,
1012,
2051,
1027,
1014,
1025,
2023,
1012,
7284,
2483,
13068,
2075,
1027,
2995,
1025,
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... | |
jgraph/mxgraph | javascript/mxClient.js | mxWindow | function mxWindow(title, content, x, y, width, height, minimizable, movable, replaceNode, style)
{
if (content != null)
{
minimizable = (minimizable != null) ? minimizable : true;
this.content = content;
this.init(x, y, width, height, style);
this.installMaximizeHandler();
this.installMinimizeHandler();
... | javascript | function mxWindow(title, content, x, y, width, height, minimizable, movable, replaceNode, style)
{
if (content != null)
{
minimizable = (minimizable != null) ? minimizable : true;
this.content = content;
this.init(x, y, width, height, style);
this.installMaximizeHandler();
this.installMinimizeHandler();
... | [
"function",
"mxWindow",
"(",
"title",
",",
"content",
",",
"x",
",",
"y",
",",
"width",
",",
"height",
",",
"minimizable",
",",
"movable",
",",
"replaceNode",
",",
"style",
")",
"{",
"if",
"(",
"content",
"!=",
"null",
")",
"{",
"minimizable",
"=",
"... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxWindow
Basic window inside a document.
Examples:
Creating a simple window.
(code)
var tb = document.createElement('div');
var wnd = new mxWindow('Title', tb, 100, 100, 200, 200, true, true);
wnd.setVisible(true);
(end)
Creating a... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxWindow"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L11657-L11685 | train | A wrapper around the window constructor. | [
30522,
3853,
25630,
11101,
5004,
1006,
2516,
1010,
4180,
1010,
1060,
1010,
1061,
1010,
9381,
1010,
4578,
1010,
7163,
4328,
4143,
3468,
1010,
9587,
12423,
1010,
5672,
3630,
3207,
1010,
2806,
1007,
1063,
2065,
1006,
4180,
999,
1027,
19701,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/type/UnitMixin.js | parseValue | function parseValue(vValue, sSourceType, aCurrentValues) {
var iDecimals, iFractionDigits, aMatches, sUnit, aValues;
if (this.mCustomUnits === undefined) {
throw new ParseException("Cannot parse value without customizing");
}
aValues = fnBaseType.prototype.parseValue.apply(this, arguments);
sUnit =... | javascript | function parseValue(vValue, sSourceType, aCurrentValues) {
var iDecimals, iFractionDigits, aMatches, sUnit, aValues;
if (this.mCustomUnits === undefined) {
throw new ParseException("Cannot parse value without customizing");
}
aValues = fnBaseType.prototype.parseValue.apply(this, arguments);
sUnit =... | [
"function",
"parseValue",
"(",
"vValue",
",",
"sSourceType",
",",
"aCurrentValues",
")",
"{",
"var",
"iDecimals",
",",
"iFractionDigits",
",",
"aMatches",
",",
"sUnit",
",",
"aValues",
";",
"if",
"(",
"this",
".",
"mCustomUnits",
"===",
"undefined",
")",
"{"... | Parses the given string value to an array containing measure or amount, and unit or
currency.
@param {string} vValue
The value to be parsed
@param {string} sSourceType
The source type (the expected type of <code>vValue</code>); must be "string", or a type
with "string" as its
{@link sap.ui.base.DataType#getPrimitiveTy... | [
"Parses",
"the",
"given",
"string",
"value",
"to",
"an",
"array",
"containing",
"measure",
"or",
"amount",
"and",
"unit",
"or",
"currency",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/UnitMixin.js#L181-L210 | train | Parse a value | [
30522,
3853,
11968,
3366,
10175,
5657,
1006,
1058,
10175,
5657,
1010,
7020,
8162,
3401,
13874,
1010,
9353,
29264,
10175,
15808,
1007,
1063,
13075,
8909,
8586,
9581,
4877,
1010,
2065,
25533,
4305,
23806,
2015,
1010,
25933,
10649,
2229,
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/model/odata/_ODataMetaModelUtils.js | function (oType) {
if (oType.property) {
oType.property.forEach(function (oProperty) {
var aAnnotationParts,
bIsCollection,
aMatches,
sSubStructure,
vTmp,
sV2Semantics = oProperty["sap:semantics"],
sV4Annotation,
sV4AnnotationPath,
oV4Annotation,
oV4Type... | javascript | function (oType) {
if (oType.property) {
oType.property.forEach(function (oProperty) {
var aAnnotationParts,
bIsCollection,
aMatches,
sSubStructure,
vTmp,
sV2Semantics = oProperty["sap:semantics"],
sV4Annotation,
sV4AnnotationPath,
oV4Annotation,
oV4Type... | [
"function",
"(",
"oType",
")",
"{",
"if",
"(",
"oType",
".",
"property",
")",
"{",
"oType",
".",
"property",
".",
"forEach",
"(",
"function",
"(",
"oProperty",
")",
"{",
"var",
"aAnnotationParts",
",",
"bIsCollection",
",",
"aMatches",
",",
"sSubStructure"... | Collects sap:semantics annotations of the given type's properties at the type.
@param {object} oType
the entity type or the complex type for which sap:semantics needs to be added | [
"Collects",
"sap",
":",
"semantics",
"annotations",
"of",
"the",
"given",
"type",
"s",
"properties",
"at",
"the",
"type",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L288-L369 | train | This function is called by the constructor to determine if the type is a valid Semantic Type | [
30522,
3853,
1006,
27178,
18863,
1007,
1063,
2065,
1006,
27178,
18863,
1012,
3200,
1007,
1063,
27178,
18863,
1012,
3200,
1012,
18921,
6776,
1006,
3853,
1006,
6728,
18981,
15010,
1007,
1063,
13075,
9779,
10695,
17287,
3508,
26950,
1010,
20377,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/filesystem/impls/appshell/node/FileWatcherManager.js | watchPath | function watchPath(path, ignored) {
if (_watcherMap.hasOwnProperty(path)) {
return;
}
return _watcherImpl.watchPath(path, ignored, _watcherMap, _domainManager);
} | javascript | function watchPath(path, ignored) {
if (_watcherMap.hasOwnProperty(path)) {
return;
}
return _watcherImpl.watchPath(path, ignored, _watcherMap, _domainManager);
} | [
"function",
"watchPath",
"(",
"path",
",",
"ignored",
")",
"{",
"if",
"(",
"_watcherMap",
".",
"hasOwnProperty",
"(",
"path",
")",
")",
"{",
"return",
";",
"}",
"return",
"_watcherImpl",
".",
"watchPath",
"(",
"path",
",",
"ignored",
",",
"_watcherMap",
... | Watch a file or directory.
@param {string} path File or directory to watch.
@param {Array<string>} ignored List of entries to ignore during watching. | [
"Watch",
"a",
"file",
"or",
"directory",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/node/FileWatcherManager.js#L101-L106 | train | Watches a path | [
30522,
3853,
3422,
15069,
1006,
4130,
1010,
6439,
1007,
1063,
2065,
1006,
1035,
3422,
2121,
2863,
2361,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
4130,
1007,
1007,
1063,
2709,
1025,
1065,
2709,
1035,
3422,
11124,
8737,
2140,
1012,
3422,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | createSearchConfig | function createSearchConfig(sFieldToSearch) {
var oConfig = {
fields: {},
expand: true
};
oConfig.fields[sFieldToSearch] = {};
return oConfig;
} | javascript | function createSearchConfig(sFieldToSearch) {
var oConfig = {
fields: {},
expand: true
};
oConfig.fields[sFieldToSearch] = {};
return oConfig;
} | [
"function",
"createSearchConfig",
"(",
"sFieldToSearch",
")",
"{",
"var",
"oConfig",
"=",
"{",
"fields",
":",
"{",
"}",
",",
"expand",
":",
"true",
"}",
";",
"oConfig",
".",
"fields",
"[",
"sFieldToSearch",
"]",
"=",
"{",
"}",
";",
"return",
"oConfig",
... | Create config for search of the lunr index
in the expected (by lunr lib) format
@param sFieldToSearch
@returns {{fields: {}, expand: boolean}} | [
"Create",
"config",
"for",
"search",
"of",
"the",
"lunr",
"index",
"in",
"the",
"expected",
"(",
"by",
"lunr",
"lib",
")",
"format"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/util/IndexWorker.js#L450-L458 | train | Creates a configuration object for a search query. | [
30522,
3853,
9005,
14644,
2818,
8663,
8873,
2290,
1006,
16420,
12891,
22282,
2906,
2818,
1007,
1063,
13075,
1051,
8663,
8873,
2290,
1027,
1063,
4249,
1024,
1063,
1065,
1010,
7818,
1024,
2995,
1065,
1025,
1051,
8663,
8873,
2290,
1012,
4249,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/jquery/src/css.js | finalPropName | function finalPropName( name ) {
var ret = jQuery.cssProps[ name ];
if ( !ret ) {
ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;
}
return ret;
} | javascript | function finalPropName( name ) {
var ret = jQuery.cssProps[ name ];
if ( !ret ) {
ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;
}
return ret;
} | [
"function",
"finalPropName",
"(",
"name",
")",
"{",
"var",
"ret",
"=",
"jQuery",
".",
"cssProps",
"[",
"name",
"]",
";",
"if",
"(",
"!",
"ret",
")",
"{",
"ret",
"=",
"jQuery",
".",
"cssProps",
"[",
"name",
"]",
"=",
"vendorPropName",
"(",
"name",
"... | Return a property mapped along what jQuery.cssProps suggests or to a vendor prefixed property. | [
"Return",
"a",
"property",
"mapped",
"along",
"what",
"jQuery",
".",
"cssProps",
"suggests",
"or",
"to",
"a",
"vendor",
"prefixed",
"property",
"."
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/jquery/src/css.js#L63-L69 | train | Returns the final CSS property name | [
30522,
3853,
2345,
21572,
2361,
18442,
1006,
2171,
1007,
1063,
13075,
2128,
2102,
1027,
1046,
4226,
2854,
1012,
20116,
13102,
18981,
2015,
1031,
2171,
1033,
1025,
2065,
1006,
999,
2128,
2102,
1007,
1063,
2128,
2102,
1027,
1046,
4226,
2854,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/FocusHandler.js | function(sControlId, sRelatedControlId, oCore){
var oControl = sControlId ? oCore && oCore.byId(sControlId) : null;
if (oControl) {
var oRelatedControl = sRelatedControlId ? oCore.byId(sRelatedControlId) : null;
var oEvent = jQuery.Event("sapfocusleave");
oEvent.target = oControl.getDomRef();
oEve... | javascript | function(sControlId, sRelatedControlId, oCore){
var oControl = sControlId ? oCore && oCore.byId(sControlId) : null;
if (oControl) {
var oRelatedControl = sRelatedControlId ? oCore.byId(sRelatedControlId) : null;
var oEvent = jQuery.Event("sapfocusleave");
oEvent.target = oControl.getDomRef();
oEve... | [
"function",
"(",
"sControlId",
",",
"sRelatedControlId",
",",
"oCore",
")",
"{",
"var",
"oControl",
"=",
"sControlId",
"?",
"oCore",
"&&",
"oCore",
".",
"byId",
"(",
"sControlId",
")",
":",
"null",
";",
"if",
"(",
"oControl",
")",
"{",
"var",
"oRelatedCo... | Calls the onsapfocusleave function on the control with id sControlId
with the information about the given related control.
@param {string} sControlId
@param {string} sRelatedControlId
@private | [
"Calls",
"the",
"onsapfocusleave",
"function",
"on",
"the",
"control",
"with",
"id",
"sControlId",
"with",
"the",
"information",
"about",
"the",
"given",
"related",
"control",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/FocusHandler.js#L302-L325 | train | Handles the sapfocusleave event. | [
30522,
3853,
1006,
8040,
12162,
13153,
3593,
1010,
5034,
10581,
3064,
8663,
13181,
21273,
1010,
1051,
17345,
1007,
1063,
13075,
1051,
8663,
13181,
2140,
1027,
8040,
12162,
13153,
3593,
1029,
1051,
17345,
1004,
1004,
1051,
17345,
1012,
2011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
vuejs/vue-cli | scripts/buildEditorConfig.js | convertRules | function convertRules (config) {
const result = {}
const eslintRules = new CLIEngine({
useEslintrc: false,
baseConfig: {
extends: [require.resolve(`@vue/eslint-config-${config}`)]
}
}).getConfigForFile().rules
const getRuleOptions = (ruleName, defaultOptions = []) => {
const ruleConfig =... | javascript | function convertRules (config) {
const result = {}
const eslintRules = new CLIEngine({
useEslintrc: false,
baseConfig: {
extends: [require.resolve(`@vue/eslint-config-${config}`)]
}
}).getConfigForFile().rules
const getRuleOptions = (ruleName, defaultOptions = []) => {
const ruleConfig =... | [
"function",
"convertRules",
"(",
"config",
")",
"{",
"const",
"result",
"=",
"{",
"}",
"const",
"eslintRules",
"=",
"new",
"CLIEngine",
"(",
"{",
"useEslintrc",
":",
"false",
",",
"baseConfig",
":",
"{",
"extends",
":",
"[",
"require",
".",
"resolve",
"(... | Convert eslint rules to editorconfig rules. | [
"Convert",
"eslint",
"rules",
"to",
"editorconfig",
"rules",
"."
] | 206803cbefefdfbc7d8ed12440b0b751688b77b2 | https://github.com/vuejs/vue-cli/blob/206803cbefefdfbc7d8ed12440b0b751688b77b2/scripts/buildEditorConfig.js#L16-L91 | train | Convert eslint rules to a spec | [
30522,
3853,
10463,
6820,
4244,
1006,
9530,
8873,
2290,
1007,
1063,
9530,
3367,
2765,
1027,
1063,
1065,
9530,
3367,
9686,
4115,
16344,
16308,
1027,
2047,
18856,
9013,
11528,
2063,
1006,
1063,
2224,
2229,
4115,
16344,
2278,
1024,
6270,
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... |
aframevr/aframe | src/core/a-entity.js | checkComponentDefined | function checkComponentDefined (el, name) {
// Check if element contains the component.
if (el.components[name] && el.components[name].attrValue) { return true; }
return isComponentMixedIn(name, el.mixinEls);
} | javascript | function checkComponentDefined (el, name) {
// Check if element contains the component.
if (el.components[name] && el.components[name].attrValue) { return true; }
return isComponentMixedIn(name, el.mixinEls);
} | [
"function",
"checkComponentDefined",
"(",
"el",
",",
"name",
")",
"{",
"// Check if element contains the component.",
"if",
"(",
"el",
".",
"components",
"[",
"name",
"]",
"&&",
"el",
".",
"components",
"[",
"name",
"]",
".",
"attrValue",
")",
"{",
"return",
... | Check if a component is *defined* for an entity, including defaults and mixins.
Does not check whether the component has been *initialized* for an entity.
@param {string} el - Entity.
@param {string} name - Component name.
@returns {boolean} | [
"Check",
"if",
"a",
"component",
"is",
"*",
"defined",
"*",
"for",
"an",
"entity",
"including",
"defaults",
"and",
"mixins",
".",
"Does",
"not",
"check",
"whether",
"the",
"component",
"has",
"been",
"*",
"initialized",
"*",
"for",
"an",
"entity",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/a-entity.js#L870-L875 | train | Check if component defined | [
30522,
3853,
4638,
9006,
29513,
3372,
3207,
23460,
2094,
1006,
3449,
1010,
2171,
1007,
1063,
1013,
1013,
4638,
2065,
5783,
3397,
1996,
6922,
1012,
2065,
1006,
3449,
1012,
6177,
1031,
2171,
1033,
1004,
1004,
3449,
1012,
6177,
1031,
2171,
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... |
cytoscape/cytoscape.js | documentation/docmaker.js | md2html | function md2html( file ){
file = file.substr( file.length - 3 ) === '.md' ? file : file + '.md'; // add extension if need be
let md;
try{
md = fs.readFileSync( path.join(__dirname, './md', file) , 'utf8');
} catch(e){
throw 'A markdown file named `' + file + '` was referenced but could not be read';
... | javascript | function md2html( file ){
file = file.substr( file.length - 3 ) === '.md' ? file : file + '.md'; // add extension if need be
let md;
try{
md = fs.readFileSync( path.join(__dirname, './md', file) , 'utf8');
} catch(e){
throw 'A markdown file named `' + file + '` was referenced but could not be read';
... | [
"function",
"md2html",
"(",
"file",
")",
"{",
"file",
"=",
"file",
".",
"substr",
"(",
"file",
".",
"length",
"-",
"3",
")",
"===",
"'.md'",
"?",
"file",
":",
"file",
"+",
"'.md'",
";",
"// add extension if need be",
"let",
"md",
";",
"try",
"{",
"md... | let html = converter.makeHtml("**I am bold!**"); let html = Handlebars.compile(); | [
"let",
"html",
"=",
"converter",
".",
"makeHtml",
"(",
"**",
"I",
"am",
"bold!",
"**",
")",
";",
"let",
"html",
"=",
"Handlebars",
".",
"compile",
"()",
";"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/documentation/docmaker.js#L48-L83 | train | converts a markdown file to html | [
30522,
3853,
9108,
2475,
11039,
19968,
1006,
5371,
1007,
1063,
5371,
1027,
5371,
1012,
4942,
3367,
2099,
1006,
5371,
1012,
3091,
1011,
1017,
1007,
1027,
1027,
1027,
1005,
1012,
9108,
1005,
1029,
5371,
1024,
5371,
1009,
1005,
1012,
9108,
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... |
GeekyAnts/vue-native-core | packages/vue-server-renderer/build.js | mergeHook | function mergeHook (
parentVal,
childVal
) {
return childVal
? parentVal
? parentVal.concat(childVal)
: Array.isArray(childVal)
? childVal
: [childVal]
: parentVal
} | javascript | function mergeHook (
parentVal,
childVal
) {
return childVal
? parentVal
? parentVal.concat(childVal)
: Array.isArray(childVal)
? childVal
: [childVal]
: parentVal
} | [
"function",
"mergeHook",
"(",
"parentVal",
",",
"childVal",
")",
"{",
"return",
"childVal",
"?",
"parentVal",
"?",
"parentVal",
".",
"concat",
"(",
"childVal",
")",
":",
"Array",
".",
"isArray",
"(",
"childVal",
")",
"?",
"childVal",
":",
"[",
"childVal",
... | Hooks and props are merged as arrays. | [
"Hooks",
"and",
"props",
"are",
"merged",
"as",
"arrays",
"."
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-server-renderer/build.js#L1251-L1262 | train | Merge the two values | [
30522,
3853,
13590,
6806,
6559,
1006,
6687,
10175,
1010,
2775,
10175,
1007,
1063,
2709,
2775,
10175,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/relay | packages/relay-compiler/util/dedupeJSONStringify.js | printJSCode | function printJSCode(isDupedVar, depth, value) {
if (value == null || typeof value !== 'object') {
return JSON.stringify(value);
}
// Only use variable references at depth beyond the top level.
if (depth !== '') {
const metadata = metadataForVal.get(value);
if (metadata && metadata.isD... | javascript | function printJSCode(isDupedVar, depth, value) {
if (value == null || typeof value !== 'object') {
return JSON.stringify(value);
}
// Only use variable references at depth beyond the top level.
if (depth !== '') {
const metadata = metadataForVal.get(value);
if (metadata && metadata.isD... | [
"function",
"printJSCode",
"(",
"isDupedVar",
",",
"depth",
",",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"typeof",
"value",
"!==",
"'object'",
")",
"{",
"return",
"JSON",
".",
"stringify",
"(",
"value",
")",
";",
"}",
"// Only use vari... | Stringify JS, replacing duplicates with variable references. | [
"Stringify",
"JS",
"replacing",
"duplicates",
"with",
"variable",
"references",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/util/dedupeJSONStringify.js#L90-L141 | train | Print JS code for a variable or array of variables. | [
30522,
3853,
6140,
22578,
16044,
1006,
2003,
8566,
5669,
10755,
1010,
5995,
1010,
3643,
1007,
1063,
2065,
1006,
3643,
1027,
1027,
19701,
1064,
1064,
2828,
11253,
3643,
999,
1027,
1027,
1005,
4874,
1005,
1007,
1063,
2709,
1046,
3385,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/document/DocumentCommandHandlers.js | handleDocumentOpen | function handleDocumentOpen(commandData) {
var result = new $.Deferred();
handleFileOpen(commandData)
.done(function (file) {
// if we succeeded with an open file
// then we need to resolve that to a document.
// getOpenDocumentForPath will r... | javascript | function handleDocumentOpen(commandData) {
var result = new $.Deferred();
handleFileOpen(commandData)
.done(function (file) {
// if we succeeded with an open file
// then we need to resolve that to a document.
// getOpenDocumentForPath will r... | [
"function",
"handleDocumentOpen",
"(",
"commandData",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"handleFileOpen",
"(",
"commandData",
")",
".",
"done",
"(",
"function",
"(",
"file",
")",
"{",
"// if we succeeded with an open f... | Opens the given file, makes it the current file, does NOT add it to the workingset
@param {FileCommandData} commandData
fullPath: File to open;
silent: optional flag to suppress error messages;
paneId: optional PaneId (defaults to active pane)
@return {$.Promise} a jQuery promise that will be resolved with @type {Docum... | [
"Opens",
"the",
"given",
"file",
"makes",
"it",
"the",
"current",
"file",
"does",
"NOT",
"add",
"it",
"to",
"the",
"workingset"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentCommandHandlers.js#L525-L542 | train | Handle a document open command | [
30522,
3853,
8971,
10085,
27417,
14399,
2368,
1006,
3094,
2850,
2696,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
5047,
8873,
2571,
26915,
1006,
3094,
2850,
2696,
1007,
1012,
2589,
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... |
adobe/brackets | src/view/MainViewManager.js | _removeDeletedFileFromMRU | function _removeDeletedFileFromMRU(e, fullPath) {
var index,
compare = function (record) {
return (record.file.fullPath === fullPath);
};
// find and remove all instances
do {
index = _.findIndex(_mruList, compare);
if (index !== -... | javascript | function _removeDeletedFileFromMRU(e, fullPath) {
var index,
compare = function (record) {
return (record.file.fullPath === fullPath);
};
// find and remove all instances
do {
index = _.findIndex(_mruList, compare);
if (index !== -... | [
"function",
"_removeDeletedFileFromMRU",
"(",
"e",
",",
"fullPath",
")",
"{",
"var",
"index",
",",
"compare",
"=",
"function",
"(",
"record",
")",
"{",
"return",
"(",
"record",
".",
"file",
".",
"fullPath",
"===",
"fullPath",
")",
";",
"}",
";",
"// find... | DocumentManager.pathDeleted Event handler to remove a file
from the MRU list
@param {!jQuery.event} e -
@param {!string} fullPath - path of the file to remove
@private | [
"DocumentManager",
".",
"pathDeleted",
"Event",
"handler",
"to",
"remove",
"a",
"file",
"from",
"the",
"MRU",
"list"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L866-L879 | train | Remove a deleted file from the MRU | [
30522,
3853,
1035,
3718,
12260,
3064,
8873,
2571,
19699,
5358,
2213,
6820,
1006,
1041,
1010,
2440,
15069,
1007,
1063,
13075,
5950,
1010,
12826,
1027,
3853,
1006,
2501,
1007,
1063,
2709,
1006,
2501,
1012,
5371,
1012,
2440,
15069,
1027,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/models/relations/authors.js | destroyByAuthor | function destroyByAuthor(unfilteredOptions) {
let options = this.filterOptions(unfilteredOptions, 'destroyByAuthor', {extraAllowedProperties: ['id']}),
postCollection = Posts.forge(),
authorId = options.id;
if (!authorId) {
return Promise.reject(n... | javascript | function destroyByAuthor(unfilteredOptions) {
let options = this.filterOptions(unfilteredOptions, 'destroyByAuthor', {extraAllowedProperties: ['id']}),
postCollection = Posts.forge(),
authorId = options.id;
if (!authorId) {
return Promise.reject(n... | [
"function",
"destroyByAuthor",
"(",
"unfilteredOptions",
")",
"{",
"let",
"options",
"=",
"this",
".",
"filterOptions",
"(",
"unfilteredOptions",
",",
"'destroyByAuthor'",
",",
"{",
"extraAllowedProperties",
":",
"[",
"'id'",
"]",
"}",
")",
",",
"postCollection",
... | ### destroyByAuthor
@param {[type]} options has context and id. Context is the user doing the destroy, id is the user to destroy | [
"###",
"destroyByAuthor"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/models/relations/authors.js#L293-L332 | train | Destroys a post by its author | [
30522,
3853,
6033,
3762,
4887,
27844,
1006,
4895,
8873,
21928,
26010,
16790,
2015,
1007,
1063,
2292,
7047,
1027,
2023,
1012,
11307,
7361,
9285,
1006,
4895,
8873,
21928,
26010,
16790,
2015,
1010,
1005,
6033,
3762,
4887,
27844,
1005,
1010,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | dist/howler.js | function() {
var self = this || Howler;
for (var i=self._howls.length-1; i>=0; i--) {
self._howls[i].unload();
}
// Create a new AudioContext to make sure it is fully reset.
if (self.usingWebAudio && self.ctx && typeof self.ctx.close !== 'undefined') {
self.ctx.close();
... | javascript | function() {
var self = this || Howler;
for (var i=self._howls.length-1; i>=0; i--) {
self._howls[i].unload();
}
// Create a new AudioContext to make sure it is fully reset.
if (self.usingWebAudio && self.ctx && typeof self.ctx.close !== 'undefined') {
self.ctx.close();
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
"||",
"Howler",
";",
"for",
"(",
"var",
"i",
"=",
"self",
".",
"_howls",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"self",
".",
"_howls",
"[",
"i",
"]",
".... | Unload and destroy all currently loaded Howl objects.
@return {Howler} | [
"Unload",
"and",
"destroy",
"all",
"currently",
"loaded",
"Howl",
"objects",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L157-L172 | train | Unload all the Howl objects | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1064,
1064,
22912,
2121,
1025,
2005,
1006,
13075,
1045,
1027,
2969,
1012,
1035,
22912,
2015,
1012,
3091,
1011,
1015,
1025,
1045,
1028,
1027,
1014,
1025,
1045,
1011,
1011,
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... | |
adobe/brackets | src/LiveDevelopment/Agents/ScriptAgent.js | load | function load() {
_reset();
_load = new $.Deferred();
var enableResult = new $.Deferred();
Inspector.Debugger.enable().done(function () {
Inspector.Debugger.setPauseOnExceptions("uncaught").done(function () {
enableResult.resolve();
});
}... | javascript | function load() {
_reset();
_load = new $.Deferred();
var enableResult = new $.Deferred();
Inspector.Debugger.enable().done(function () {
Inspector.Debugger.setPauseOnExceptions("uncaught").done(function () {
enableResult.resolve();
});
}... | [
"function",
"load",
"(",
")",
"{",
"_reset",
"(",
")",
";",
"_load",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"var",
"enableResult",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"Inspector",
".",
"Debugger",
".",
"enable",
"(",
")",
"... | Initialize the agent | [
"Initialize",
"the",
"agent"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/ScriptAgent.js#L126-L147 | train | Load the script | [
30522,
3853,
7170,
1006,
1007,
1063,
1035,
25141,
1006,
1007,
1025,
1035,
7170,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
13075,
9585,
6072,
11314,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
7742,
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... |
apache/incubator-echarts | src/chart/sankey/sankeyLayout.js | computeEdgeDepths | function computeEdgeDepths(nodes, orient) {
var keyAttr = orient === 'vertical' ? 'x' : 'y';
zrUtil.each(nodes, function (node) {
node.outEdges.sort(function (a, b) {
return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];
});
node.inEdges.sort(function (a, b) {
... | javascript | function computeEdgeDepths(nodes, orient) {
var keyAttr = orient === 'vertical' ? 'x' : 'y';
zrUtil.each(nodes, function (node) {
node.outEdges.sort(function (a, b) {
return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];
});
node.inEdges.sort(function (a, b) {
... | [
"function",
"computeEdgeDepths",
"(",
"nodes",
",",
"orient",
")",
"{",
"var",
"keyAttr",
"=",
"orient",
"===",
"'vertical'",
"?",
"'x'",
":",
"'y'",
";",
"zrUtil",
".",
"each",
"(",
"nodes",
",",
"function",
"(",
"node",
")",
"{",
"node",
".",
"outEdg... | Compute the depth(y-position) of each edge
@param {module:echarts/data/Graph~Node} nodes node of sankey view | [
"Compute",
"the",
"depth",
"(",
"y",
"-",
"position",
")",
"of",
"each",
"edge"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sankey/sankeyLayout.js#L483-L505 | train | Compute edge depths | [
30522,
3853,
24134,
24225,
3207,
13876,
7898,
1006,
14164,
1010,
16865,
1007,
1063,
13075,
3145,
19321,
2099,
1027,
16865,
1027,
1027,
1027,
1005,
7471,
1005,
1029,
1005,
1060,
1005,
1024,
1005,
1061,
1005,
1025,
1062,
22134,
4014,
1012,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/performance/trace/Interaction.js | function(oEvent) {
if (bInteractionActive) {
// notify for a newly started interaction, but not more often than every 250ms.
if (!iScrollEventDelayId) {
Interaction.notifyEventStart(oEvent);
} else {
clearTimeout(iScrollEventDelayId);
}
iScrollEventDelayId = setTimeout(function(){
... | javascript | function(oEvent) {
if (bInteractionActive) {
// notify for a newly started interaction, but not more often than every 250ms.
if (!iScrollEventDelayId) {
Interaction.notifyEventStart(oEvent);
} else {
clearTimeout(iScrollEventDelayId);
}
iScrollEventDelayId = setTimeout(function(){
... | [
"function",
"(",
"oEvent",
")",
"{",
"if",
"(",
"bInteractionActive",
")",
"{",
"// notify for a newly started interaction, but not more often than every 250ms.",
"if",
"(",
"!",
"iScrollEventDelayId",
")",
"{",
"Interaction",
".",
"notifyEventStart",
"(",
"oEvent",
")",
... | This method notifies if a scroll event has been triggered. Some controls require this special treatment,
as the generic detection process via notifyEventStart is not sufficient.
@param {Event} oEvent Scroll event whose processing has started
@static
@private | [
"This",
"method",
"notifies",
"if",
"a",
"scroll",
"event",
"has",
"been",
"triggered",
".",
"Some",
"controls",
"require",
"this",
"special",
"treatment",
"as",
"the",
"generic",
"detection",
"process",
"via",
"notifyEventStart",
"is",
"not",
"sufficient",
"."
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/performance/trace/Interaction.js#L493-L506 | train | Called when the user scrolls in the page | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
2065,
1006,
8026,
14621,
7542,
19620,
1007,
1063,
1013,
1013,
2025,
8757,
2005,
1037,
4397,
2318,
8290,
1010,
2021,
2025,
2062,
2411,
2084,
2296,
5539,
5244,
1012,
2065,
1006,
999,
2003,
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... | |
juliangarnier/anime | lib/anime.js | steps | function steps(steps) {
if ( steps === void 0 ) steps = 10;
return function (t) { return Math.round(t * steps) * (1 / steps); };
} | javascript | function steps(steps) {
if ( steps === void 0 ) steps = 10;
return function (t) { return Math.round(t * steps) * (1 / steps); };
} | [
"function",
"steps",
"(",
"steps",
")",
"{",
"if",
"(",
"steps",
"===",
"void",
"0",
")",
"steps",
"=",
"10",
";",
"return",
"function",
"(",
"t",
")",
"{",
"return",
"Math",
".",
"round",
"(",
"t",
"*",
"steps",
")",
"*",
"(",
"1",
"/",
"steps... | Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function | [
"Basic",
"steps",
"easing",
"implementation",
"https",
":",
"//",
"developer",
".",
"mozilla",
".",
"org",
"/",
"fr",
"/",
"docs",
"/",
"Web",
"/",
"CSS",
"/",
"transition",
"-",
"timing",
"-",
"function"
] | 875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a | https://github.com/juliangarnier/anime/blob/875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a/lib/anime.js#L148-L152 | train | Returns a function that will return a function that will return a number of steps | [
30522,
3853,
4084,
1006,
4084,
1007,
1063,
2065,
1006,
4084,
1027,
1027,
1027,
11675,
1014,
1007,
4084,
1027,
2184,
1025,
2709,
3853,
1006,
1056,
1007,
1063,
2709,
8785,
1012,
2461,
1006,
1056,
1008,
4084,
1007,
1008,
1006,
1015,
1013,
40... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/icon/js/iconService.js | MdIconService | function MdIconService(config, $templateRequest, $q, $log, $mdUtil, $sce) {
var iconCache = {};
var svgCache = {};
var urlRegex = /[-\w@:%+.~#?&//=]{2,}\.[a-z]{2,4}\b(\/[-\w@:%+.~#?&//=]*)?/i;
var dataUrlRegex = /^data:image\/svg\+xml[\s*;\w\-=]*?(base64)?,(.*)$/i;
Icon.prototype = {clone: cloneSVG, prepare:... | javascript | function MdIconService(config, $templateRequest, $q, $log, $mdUtil, $sce) {
var iconCache = {};
var svgCache = {};
var urlRegex = /[-\w@:%+.~#?&//=]{2,}\.[a-z]{2,4}\b(\/[-\w@:%+.~#?&//=]*)?/i;
var dataUrlRegex = /^data:image\/svg\+xml[\s*;\w\-=]*?(base64)?,(.*)$/i;
Icon.prototype = {clone: cloneSVG, prepare:... | [
"function",
"MdIconService",
"(",
"config",
",",
"$templateRequest",
",",
"$q",
",",
"$log",
",",
"$mdUtil",
",",
"$sce",
")",
"{",
"var",
"iconCache",
"=",
"{",
"}",
";",
"var",
"svgCache",
"=",
"{",
"}",
";",
"var",
"urlRegex",
"=",
"/",
"[-\\w@:%+.~... | @ngdoc service
@name $mdIcon
@module material.components.icon
@description
The `$mdIcon` service is a function used to lookup SVG icons.
@param {string} id Query value for a unique Id or URL. If the argument is a URL, then the service will retrieve the icon element
from its internal cache or load the icon and cache i... | [
"@ngdoc",
"service",
"@name",
"$mdIcon",
"@module",
"material",
".",
"components",
".",
"icon"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/icon/js/iconService.js#L406-L735 | train | The MdIconService constructor. | [
30522,
3853,
9108,
28524,
8043,
7903,
2063,
1006,
9530,
8873,
2290,
1010,
1002,
23561,
2890,
15500,
1010,
1002,
1053,
1010,
1002,
8833,
1010,
1002,
9108,
21823,
2140,
1010,
1002,
8040,
2063,
1007,
1063,
13075,
12696,
3540,
5403,
1027,
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/LiveDevelopment/LiveDevelopment.js | _getInitialDocFromCurrent | function _getInitialDocFromCurrent() {
var doc = _getCurrentDocument(),
refPath,
i;
// Is the currently opened document already a file we can use for Live Development?
if (doc) {
refPath = doc.file.fullPath;
if (LiveDevelopmentUtils.isStaticHtmlFi... | javascript | function _getInitialDocFromCurrent() {
var doc = _getCurrentDocument(),
refPath,
i;
// Is the currently opened document already a file we can use for Live Development?
if (doc) {
refPath = doc.file.fullPath;
if (LiveDevelopmentUtils.isStaticHtmlFi... | [
"function",
"_getInitialDocFromCurrent",
"(",
")",
"{",
"var",
"doc",
"=",
"_getCurrentDocument",
"(",
")",
",",
"refPath",
",",
"i",
";",
"// Is the currently opened document already a file we can use for Live Development?",
"if",
"(",
"doc",
")",
"{",
"refPath",
"=",
... | @private
Determine an index file that can be used to start Live Development.
This function will inspect all files in a project to find the closest index file
available for currently opened document. We are searching for these files:
- index.html
- index.htm
If the project is configured with a custom base url for live ... | [
"@private",
"Determine",
"an",
"index",
"file",
"that",
"can",
"be",
"used",
"to",
"start",
"Live",
"Development",
".",
"This",
"function",
"will",
"inspect",
"all",
"files",
"in",
"a",
"project",
"to",
"find",
"the",
"closest",
"index",
"file",
"available",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevelopment.js#L691-L769 | train | Get the initial document from the current file | [
30522,
3853,
1035,
2131,
5498,
20925,
3527,
2278,
19699,
5358,
10841,
14343,
3372,
1006,
1007,
1063,
13075,
9986,
1027,
1035,
2131,
10841,
14343,
3372,
3527,
24894,
4765,
1006,
1007,
1010,
25416,
15069,
1010,
1045,
1025,
1013,
1013,
2003,
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... |
BlackrockDigital/startbootstrap-sb-admin-2 | vendor/chart.js/Chart.js | function(options) {
var globalDefaults = core_defaults.global;
var size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize);
var font = {
family: valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily),
lineHeight: helpers_core.options.toLineHeight(valueOrDefault(options.lineHeig... | javascript | function(options) {
var globalDefaults = core_defaults.global;
var size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize);
var font = {
family: valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily),
lineHeight: helpers_core.options.toLineHeight(valueOrDefault(options.lineHeig... | [
"function",
"(",
"options",
")",
"{",
"var",
"globalDefaults",
"=",
"core_defaults",
".",
"global",
";",
"var",
"size",
"=",
"valueOrDefault",
"(",
"options",
".",
"fontSize",
",",
"globalDefaults",
".",
"defaultFontSize",
")",
";",
"var",
"font",
"=",
"{",
... | Parses font options and returns the font object.
@param {object} options - A object that contains font options to be parsed.
@return {object} The font object.
@todo Support font.* options and renamed to toFont().
@private | [
"Parses",
"font",
"options",
"and",
"returns",
"the",
"font",
"object",
"."
] | ddfaceb4a8e65a41f163e2fdc4eab49384b810a1 | https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/ddfaceb4a8e65a41f163e2fdc4eab49384b810a1/vendor/chart.js/Chart.js#L2642-L2656 | train | Creates a font object from the given options | [
30522,
3853,
1006,
7047,
1007,
1063,
13075,
3795,
3207,
7011,
11314,
2015,
1027,
4563,
1035,
12398,
2015,
1012,
3795,
1025,
13075,
2946,
1027,
3643,
8551,
12879,
23505,
1006,
7047,
1012,
15489,
5332,
4371,
1010,
3795,
3207,
7011,
11314,
201... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
facebook/relay | packages/relay-compiler/transforms/RelayMaskTransform.js | relayMaskTransform | function relayMaskTransform(context: CompilerContext): CompilerContext {
return IRTransformer.transform(
context,
{
FragmentSpread: visitFragmentSpread,
Fragment: visitFragment,
},
() => ({
reachableArguments: [],
}),
);
} | javascript | function relayMaskTransform(context: CompilerContext): CompilerContext {
return IRTransformer.transform(
context,
{
FragmentSpread: visitFragmentSpread,
Fragment: visitFragment,
},
() => ({
reachableArguments: [],
}),
);
} | [
"function",
"relayMaskTransform",
"(",
"context",
":",
"CompilerContext",
")",
":",
"CompilerContext",
"{",
"return",
"IRTransformer",
".",
"transform",
"(",
"context",
",",
"{",
"FragmentSpread",
":",
"visitFragmentSpread",
",",
"Fragment",
":",
"visitFragment",
",... | A transform that inlines fragment spreads with the @relay(mask: false)
directive. | [
"A",
"transform",
"that",
"inlines",
"fragment",
"spreads",
"with",
"the"
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/transforms/RelayMaskTransform.js#L40-L51 | train | relay mask transform | [
30522,
3853,
8846,
9335,
25509,
5521,
22747,
2953,
2213,
1006,
6123,
1024,
21624,
8663,
18209,
1007,
1024,
21624,
8663,
18209,
1063,
2709,
20868,
6494,
3619,
14192,
2121,
1012,
10938,
1006,
6123,
1010,
1063,
10341,
28139,
4215,
1024,
3942,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | unmergeOne | function unmergeOne(ele) {
ele = ele[0];
var _p = this._private;
var id = ele._private.data.id;
var map = _p.map;
var entry = map.get(id);
if (!entry) {
return this; // no need to remove
}
var i = entry.index;
this.unmergeAt(i);
return this;
} | javascript | function unmergeOne(ele) {
ele = ele[0];
var _p = this._private;
var id = ele._private.data.id;
var map = _p.map;
var entry = map.get(id);
if (!entry) {
return this; // no need to remove
}
var i = entry.index;
this.unmergeAt(i);
return this;
} | [
"function",
"unmergeOne",
"(",
"ele",
")",
"{",
"ele",
"=",
"ele",
"[",
"0",
"]",
";",
"var",
"_p",
"=",
"this",
".",
"_private",
";",
"var",
"id",
"=",
"ele",
".",
"_private",
".",
"data",
".",
"id",
";",
"var",
"map",
"=",
"_p",
".",
"map",
... | remove single ele in place in calling collection | [
"remove",
"single",
"ele",
"in",
"place",
"in",
"calling",
"collection"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L10300-L10314 | train | remove one node from the node | [
30522,
3853,
4895,
5017,
3351,
5643,
1006,
3449,
2063,
1007,
1063,
3449,
2063,
1027,
3449,
2063,
1031,
1014,
1033,
1025,
13075,
1035,
1052,
1027,
2023,
1012,
1035,
2797,
1025,
13075,
8909,
1027,
3449,
2063,
1012,
1035,
2797,
1012,
2951,
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 | lib/jsdoc/transform-apijson-for-sdk.js | getAPIJSONPromise | function getAPIJSONPromise(oChainObject) {
return new Promise(function(oResolve, oReject) {
fs.readFile(sInputFile, 'utf8', (oError, sFileData) => {
if (oError) {
oReject(oError);
} else {
oChainObject.fileData = JSON.parse(sFileData);
oResolve(oChainObject);
}
});
});
} | javascript | function getAPIJSONPromise(oChainObject) {
return new Promise(function(oResolve, oReject) {
fs.readFile(sInputFile, 'utf8', (oError, sFileData) => {
if (oError) {
oReject(oError);
} else {
oChainObject.fileData = JSON.parse(sFileData);
oResolve(oChainObject);
}
});
});
} | [
"function",
"getAPIJSONPromise",
"(",
"oChainObject",
")",
"{",
"return",
"new",
"Promise",
"(",
"function",
"(",
"oResolve",
",",
"oReject",
")",
"{",
"fs",
".",
"readFile",
"(",
"sInputFile",
",",
"'utf8'",
",",
"(",
"oError",
",",
"sFileData",
")",
"=>"... | Load api.json file
@param {object} oChainObject chain object
@returns {object} chain object | [
"Load",
"api",
".",
"json",
"file"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/transform-apijson-for-sdk.js#L880-L891 | train | Reads the API JSON file and parses it into an object | [
30522,
3853,
2131,
9331,
28418,
3385,
21572,
28732,
1006,
28166,
8113,
16429,
20614,
1007,
1063,
2709,
2047,
4872,
1006,
3853,
1006,
10848,
19454,
3726,
1010,
10848,
20614,
1007,
1063,
1042,
2015,
1012,
3191,
8873,
2571,
1006,
8254,
18780,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/WorkingSetView.js | _viewFromEl | function _viewFromEl($el) {
if (!$el.hasClass("working-set-view")) {
$el = $el.parents(".working-set-view");
}
var id = $el.attr("id").match(/working\-set\-list\-([\w]+[\w\d\-\.\:\_]*)/).pop();
return _views[id];
} | javascript | function _viewFromEl($el) {
if (!$el.hasClass("working-set-view")) {
$el = $el.parents(".working-set-view");
}
var id = $el.attr("id").match(/working\-set\-list\-([\w]+[\w\d\-\.\:\_]*)/).pop();
return _views[id];
} | [
"function",
"_viewFromEl",
"(",
"$el",
")",
"{",
"if",
"(",
"!",
"$el",
".",
"hasClass",
"(",
"\"working-set-view\"",
")",
")",
"{",
"$el",
"=",
"$el",
".",
"parents",
"(",
"\".working-set-view\"",
")",
";",
"}",
"var",
"id",
"=",
"$el",
".",
"attr",
... | Finds the WorkingSetView object for the specified element
@private
@param {jQuery} $el - the element to find the view for
@return {View} view object | [
"Finds",
"the",
"WorkingSetView",
"object",
"for",
"the",
"specified",
"element"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L226-L233 | train | Get the view from an element | [
30522,
3853,
1035,
3193,
19699,
8462,
2140,
1006,
1002,
3449,
1007,
1063,
2065,
1006,
999,
1002,
3449,
1012,
2038,
26266,
1006,
1000,
2551,
1011,
2275,
1011,
3193,
1000,
1007,
1007,
1063,
1002,
3449,
1027,
1002,
3449,
1012,
3008,
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... |
adobe/brackets | src/extensions/default/CodeFolding/Prefs.js | setFolds | function setFolds(path, folds) {
var context = getViewStateContext();
var allFolds = PreferencesManager.getViewState(FOLDS_PREF_KEY, context);
allFolds[path] = simplify(folds);
PreferencesManager.setViewState(FOLDS_PREF_KEY, allFolds, context);
} | javascript | function setFolds(path, folds) {
var context = getViewStateContext();
var allFolds = PreferencesManager.getViewState(FOLDS_PREF_KEY, context);
allFolds[path] = simplify(folds);
PreferencesManager.setViewState(FOLDS_PREF_KEY, allFolds, context);
} | [
"function",
"setFolds",
"(",
"path",
",",
"folds",
")",
"{",
"var",
"context",
"=",
"getViewStateContext",
"(",
")",
";",
"var",
"allFolds",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"FOLDS_PREF_KEY",
",",
"context",
")",
";",
"allFolds",
"[",
"pa... | Saves the line folds for the specified path
@param {!string} path the path to the document
@param {Object} folds the fold ranges to save for the current document | [
"Saves",
"the",
"line",
"folds",
"for",
"the",
"specified",
"path"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/Prefs.js#L108-L113 | train | Set the folds for a path | [
30522,
3853,
2275,
10371,
2015,
1006,
4130,
1010,
15439,
1007,
1063,
13075,
6123,
1027,
2131,
8584,
9153,
26557,
28040,
18413,
1006,
1007,
1025,
13075,
2035,
10371,
2015,
1027,
18394,
24805,
4590,
1012,
2131,
8584,
9153,
2618,
1006,
15439,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/AppCacheBuster.js | function() {
// activate the session (do not create the session for compatibility reasons with mIndex previously)
oSession.active = true;
// store the original function / property description to intercept
fnValidateProperty = ManagedObject.prototype.validateProperty;
descScriptSrc = Object.getOwnP... | javascript | function() {
// activate the session (do not create the session for compatibility reasons with mIndex previously)
oSession.active = true;
// store the original function / property description to intercept
fnValidateProperty = ManagedObject.prototype.validateProperty;
descScriptSrc = Object.getOwnP... | [
"function",
"(",
")",
"{",
"// activate the session (do not create the session for compatibility reasons with mIndex previously)",
"oSession",
".",
"active",
"=",
"true",
";",
"// store the original function / property description to intercept",
"fnValidateProperty",
"=",
"ManagedObject"... | Initializes the AppCacheBuster. Hooks into the relevant functions
in the Core to intercept the code which are dealing with URLs and
converts those URLs into cachebuster URLs.
The intercepted functions are:
<ul>
<li><code>XMLHttpRequest.prototype.open</code></li>
<li><code>HTMLScriptElement.prototype.src</code></li>
<l... | [
"Initializes",
"the",
"AppCacheBuster",
".",
"Hooks",
"into",
"the",
"relevant",
"functions",
"in",
"the",
"Core",
"to",
"intercept",
"the",
"code",
"which",
"are",
"dealing",
"with",
"URLs",
"and",
"converts",
"those",
"URLs",
"into",
"cachebuster",
"URLs",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/AppCacheBuster.js#L332-L425 | train | This function is called by the sap. ui. core. ObjectRegistry to create a new instance of the object | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
20544,
1996,
5219,
1006,
2079,
2025,
3443,
1996,
5219,
2005,
21778,
4436,
2007,
2568,
10288,
3130,
1007,
9808,
7971,
3258,
1012,
3161,
1027,
2995,
1025,
1013,
1013,
3573,
1996,
2434,
3853,
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... | |
goldfire/howler.js | dist/howler.js | function() {
// If we have already detected that Web Audio isn't supported, don't run this step again.
if (!Howler.usingWebAudio) {
return;
}
// Check if we are using Web Audio and setup the AudioContext if we are.
try {
if (typeof AudioContext !== 'undefined') {
Howler.ctx = ne... | javascript | function() {
// If we have already detected that Web Audio isn't supported, don't run this step again.
if (!Howler.usingWebAudio) {
return;
}
// Check if we are using Web Audio and setup the AudioContext if we are.
try {
if (typeof AudioContext !== 'undefined') {
Howler.ctx = ne... | [
"function",
"(",
")",
"{",
"// If we have already detected that Web Audio isn't supported, don't run this step again.",
"if",
"(",
"!",
"Howler",
".",
"usingWebAudio",
")",
"{",
"return",
";",
"}",
"// Check if we are using Web Audio and setup the AudioContext if we are.",
"try",
... | Setup the audio context when available, or switch to HTML5 Audio mode. | [
"Setup",
"the",
"audio",
"context",
"when",
"available",
"or",
"switch",
"to",
"HTML5",
"Audio",
"mode",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L2423-L2468 | train | This function is called by the initialization of the module. It is called by the initialization of the module and the module is not called directly. | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
2065,
2057,
2031,
2525,
11156,
2008,
4773,
5746,
3475,
1005,
1056,
3569,
1010,
2123,
1005,
1056,
2448,
2023,
3357,
2153,
1012,
2065,
1006,
999,
22912,
2121,
1012,
2478,
8545,
27773,
20617,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/less.js | function () {
var e, c, v, index = i;
c = this.combinator();
e = $re(/^(?:\d+\.\d+|\d+)%/) || $re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||
$char('*') || $char('&') || this.attribute() || $re(/^\([^()@]+\)/) || ... | javascript | function () {
var e, c, v, index = i;
c = this.combinator();
e = $re(/^(?:\d+\.\d+|\d+)%/) || $re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||
$char('*') || $char('&') || this.attribute() || $re(/^\([^()@]+\)/) || ... | [
"function",
"(",
")",
"{",
"var",
"e",
",",
"c",
",",
"v",
",",
"index",
"=",
"i",
";",
"c",
"=",
"this",
".",
"combinator",
"(",
")",
";",
"e",
"=",
"$re",
"(",
"/",
"^(?:\\d+\\.\\d+|\\d+)%",
"/",
")",
"||",
"$re",
"(",
"/",
"^(?:[.#]?|:*)(?:[\\... | A Selector Element div + h1 #socks input[type="text"] Elements are the building blocks for Selectors, they are made out of a `Combinator` (see combinator rule), and an element name, such as a tag a class, or `*`. | [
"A",
"Selector",
"Element",
"div",
"+",
"h1",
"#socks",
"input",
"[",
"type",
"=",
"text",
"]",
"Elements",
"are",
"the",
"building",
"blocks",
"for",
"Selectors",
"they",
"are",
"made",
"out",
"of",
"a",
"Combinator",
"(",
"see",
"combinator",
"rule",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L1356-L1374 | train | returns a node if it is an element | [
30522,
3853,
1006,
1007,
1063,
13075,
1041,
1010,
1039,
1010,
1058,
1010,
5950,
1027,
1045,
1025,
1039,
1027,
2023,
1012,
22863,
23207,
1006,
1007,
1025,
1041,
1027,
1002,
2128,
1006,
1013,
1034,
1006,
1029,
1024,
1032,
1040,
1009,
1032,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/LiveDevelopment/Agents/CSSAgent.js | load | function load() {
Inspector.Page.on("frameNavigated.CSSAgent", _onFrameNavigated);
Inspector.CSS.on("styleSheetAdded.CSSAgent", _styleSheetAdded);
Inspector.CSS.on("styleSheetRemoved.CSSAgent", _styleSheetRemoved);
// getAllStyleSheets was deleted beginning with Chrome 34
if (!_... | javascript | function load() {
Inspector.Page.on("frameNavigated.CSSAgent", _onFrameNavigated);
Inspector.CSS.on("styleSheetAdded.CSSAgent", _styleSheetAdded);
Inspector.CSS.on("styleSheetRemoved.CSSAgent", _styleSheetRemoved);
// getAllStyleSheets was deleted beginning with Chrome 34
if (!_... | [
"function",
"load",
"(",
")",
"{",
"Inspector",
".",
"Page",
".",
"on",
"(",
"\"frameNavigated.CSSAgent\"",
",",
"_onFrameNavigated",
")",
";",
"Inspector",
".",
"CSS",
".",
"on",
"(",
"\"styleSheetAdded.CSSAgent\"",
",",
"_styleSheetAdded",
")",
";",
"Inspector... | Initialize the agent | [
"Initialize",
"the",
"agent"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/CSSAgent.js#L210-L219 | train | Load all the styles | [
30522,
3853,
7170,
1006,
1007,
1063,
7742,
1012,
3931,
1012,
2006,
1006,
1000,
4853,
2532,
5737,
11644,
1012,
20116,
3736,
11461,
1000,
1010,
1035,
2006,
15643,
2532,
5737,
11644,
1007,
1025,
7742,
1012,
20116,
2015,
1012,
2006,
1006,
1000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/dom-utils.js | DOMWalker__walk | function DOMWalker__walk(root) {
if (!root.childNodes)
throw new Error("root.childNodes does not exist");
var collectedResults = [];
for (var i = 0; i < root.childNodes.length; i++) {
var nodeStatus = this._callbackFilter(root.childNodes[i]);
var nodeTestResults = [];
switch (nod... | javascript | function DOMWalker__walk(root) {
if (!root.childNodes)
throw new Error("root.childNodes does not exist");
var collectedResults = [];
for (var i = 0; i < root.childNodes.length; i++) {
var nodeStatus = this._callbackFilter(root.childNodes[i]);
var nodeTestResults = [];
switch (nod... | [
"function",
"DOMWalker__walk",
"(",
"root",
")",
"{",
"if",
"(",
"!",
"root",
".",
"childNodes",
")",
"throw",
"new",
"Error",
"(",
"\"root.childNodes does not exist\"",
")",
";",
"var",
"collectedResults",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
... | DOMWalker_walk goes recursively through the DOM, starting with a provided
root-node.
First, it filters nodes by submitting each node to the this._callbackFilter
method to decide, if a node should be submitted to a provided
this._callbackNodeTest method to test (that hapens in case of
FILTER_ACCEPT).
In case of FILTER_... | [
"DOMWalker_walk",
"goes",
"recursively",
"through",
"the",
"DOM",
"starting",
"with",
"a",
"provided",
"root",
"-",
"node",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/dom-utils.js#L423-L449 | train | Walks the DOM tree and returns an array of results | [
30522,
3853,
14383,
26965,
1035,
1035,
3328,
1006,
7117,
1007,
1063,
2065,
1006,
999,
7117,
1012,
2775,
3630,
6155,
1007,
5466,
2047,
7561,
1006,
1000,
7117,
1012,
2775,
3630,
6155,
2515,
2025,
4839,
1000,
1007,
1025,
13075,
5067,
6072,
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/panel/panel.spec.js | attachToBody | function attachToBody(el) {
var element = angular.element(el);
angular.element(document.body).append(element);
attachedElements.push(element);
} | javascript | function attachToBody(el) {
var element = angular.element(el);
angular.element(document.body).append(element);
attachedElements.push(element);
} | [
"function",
"attachToBody",
"(",
"el",
")",
"{",
"var",
"element",
"=",
"angular",
".",
"element",
"(",
"el",
")",
";",
"angular",
".",
"element",
"(",
"document",
".",
"body",
")",
".",
"append",
"(",
"element",
")",
";",
"attachedElements",
".",
"pus... | Attached an element to document.body. Keeps track of attached elements
so that they can be removed in an afterEach.
@param el | [
"Attached",
"an",
"element",
"to",
"document",
".",
"body",
".",
"Keeps",
"track",
"of",
"attached",
"elements",
"so",
"that",
"they",
"can",
"be",
"removed",
"in",
"an",
"afterEach",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/panel/panel.spec.js#L3366-L3370 | train | Attaches an element to the body | [
30522,
3853,
22476,
3406,
23684,
1006,
3449,
1007,
1063,
13075,
5783,
1027,
16108,
1012,
5783,
1006,
3449,
1007,
1025,
16108,
1012,
5783,
1006,
6254,
1012,
2303,
1007,
1012,
10439,
10497,
1006,
5783,
1007,
1025,
4987,
12260,
8163,
1012,
524... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/lines-around-directive.js | hasNewlineAfter | function hasNewlineAfter(node) {
const lastToken = getLastTokenOnLine(node);
const tokenAfter = sourceCode.getTokenAfter(lastToken, { includeComments: true });
return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2;
} | javascript | function hasNewlineAfter(node) {
const lastToken = getLastTokenOnLine(node);
const tokenAfter = sourceCode.getTokenAfter(lastToken, { includeComments: true });
return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2;
} | [
"function",
"hasNewlineAfter",
"(",
"node",
")",
"{",
"const",
"lastToken",
"=",
"getLastTokenOnLine",
"(",
"node",
")",
";",
"const",
"tokenAfter",
"=",
"sourceCode",
".",
"getTokenAfter",
"(",
"lastToken",
",",
"{",
"includeComments",
":",
"true",
"}",
")",
... | Check if node is followed by a blank newline.
@param {ASTNode} node Node to check.
@returns {boolean} Whether or not the passed in node is followed by a blank newline. | [
"Check",
"if",
"node",
"is",
"followed",
"by",
"a",
"blank",
"newline",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/lines-around-directive.js#L99-L104 | train | Check if node has a newline after the last token | [
30522,
3853,
8440,
7974,
4179,
10354,
3334,
1006,
13045,
1007,
1063,
9530,
3367,
2197,
18715,
2368,
1027,
2131,
8523,
9284,
7520,
2239,
4179,
1006,
13045,
1007,
1025,
9530,
3367,
19204,
10354,
3334,
1027,
3120,
16044,
1012,
2131,
18715,
818... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/main.js | _setupGoLiveButton | function _setupGoLiveButton() {
if (!_$btnGoLive) {
_$btnGoLive = $("#toolbar-go-live");
_$btnGoLive.click(function onGoLive() {
_handleGoLiveCommand();
});
}
LiveDevImpl.on("statusChange", function statusChange(event, status, reason) {
... | javascript | function _setupGoLiveButton() {
if (!_$btnGoLive) {
_$btnGoLive = $("#toolbar-go-live");
_$btnGoLive.click(function onGoLive() {
_handleGoLiveCommand();
});
}
LiveDevImpl.on("statusChange", function statusChange(event, status, reason) {
... | [
"function",
"_setupGoLiveButton",
"(",
")",
"{",
"if",
"(",
"!",
"_$btnGoLive",
")",
"{",
"_$btnGoLive",
"=",
"$",
"(",
"\"#toolbar-go-live\"",
")",
";",
"_$btnGoLive",
".",
"click",
"(",
"function",
"onGoLive",
"(",
")",
"{",
"_handleGoLiveCommand",
"(",
")... | Create the menu item "Go Live" | [
"Create",
"the",
"menu",
"item",
"Go",
"Live"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L227-L247 | train | Setup the button that will go live | [
30522,
3853,
1035,
16437,
24141,
3512,
8569,
15474,
1006,
1007,
1063,
2065,
1006,
999,
1035,
1002,
18411,
16656,
3669,
3726,
1007,
1063,
1035,
1002,
18411,
16656,
3669,
3726,
1027,
1002,
1006,
1000,
1001,
6994,
8237,
1011,
2175,
1011,
2444,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableUtils.js | function(oTable) {
var oBinding = oTable.getBinding("rows");
var iTotalRowCount = oTable._getTotalRowCount();
var bHasData = iTotalRowCount > 0;
if (oBinding && oBinding.providesGrandTotal) { // Analytical Binding
var bHasTotal = oBinding.providesGrandTotal() && oBinding.hasTotaledMeasures();
bHasD... | javascript | function(oTable) {
var oBinding = oTable.getBinding("rows");
var iTotalRowCount = oTable._getTotalRowCount();
var bHasData = iTotalRowCount > 0;
if (oBinding && oBinding.providesGrandTotal) { // Analytical Binding
var bHasTotal = oBinding.providesGrandTotal() && oBinding.hasTotaledMeasures();
bHasD... | [
"function",
"(",
"oTable",
")",
"{",
"var",
"oBinding",
"=",
"oTable",
".",
"getBinding",
"(",
"\"rows\"",
")",
";",
"var",
"iTotalRowCount",
"=",
"oTable",
".",
"_getTotalRowCount",
"(",
")",
";",
"var",
"bHasData",
"=",
"iTotalRowCount",
">",
"0",
";",
... | Returns whether the table currently has data.
@param {sap.ui.table.Table} oTable Instance of the table.
@returns {boolean} Whether the table has data. | [
"Returns",
"whether",
"the",
"table",
"currently",
"has",
"data",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L357-L368 | train | Returns true if the table has data. | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
13075,
27885,
22254,
2075,
1027,
27178,
3085,
1012,
2131,
8428,
4667,
1006,
1000,
10281,
1000,
1007,
1025,
13075,
23333,
9080,
10524,
3597,
16671,
1027,
27178,
3085,
1012,
1035,
2131,
3406,
9080,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | bits/19_fsutils.js | write_dl | function write_dl(fname/*:string*/, payload/*:any*/, enc/*:?string*/) {
/*global IE_SaveFile, Blob, navigator, saveAs, URL, document, File, chrome */
if(typeof _fs !== 'undefined' && _fs.writeFileSync) return enc ? _fs.writeFileSync(fname, payload, enc) : _fs.writeFileSync(fname, payload);
var data = (enc == "utf8")... | javascript | function write_dl(fname/*:string*/, payload/*:any*/, enc/*:?string*/) {
/*global IE_SaveFile, Blob, navigator, saveAs, URL, document, File, chrome */
if(typeof _fs !== 'undefined' && _fs.writeFileSync) return enc ? _fs.writeFileSync(fname, payload, enc) : _fs.writeFileSync(fname, payload);
var data = (enc == "utf8")... | [
"function",
"write_dl",
"(",
"fname",
"/*:string*/",
",",
"payload",
"/*:any*/",
",",
"enc",
"/*:?string*/",
")",
"{",
"/*global IE_SaveFile, Blob, navigator, saveAs, URL, document, File, chrome */",
"if",
"(",
"typeof",
"_fs",
"!==",
"'undefined'",
"&&",
"_fs",
".",
"w... | /* write or download file | [
"/",
"*",
"write",
"or",
"download",
"file"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/19_fsutils.js#L11-L48 | train | Writes a file to a local filesystem | [
30522,
3853,
4339,
1035,
21469,
1006,
1042,
18442,
1013,
1008,
1024,
5164,
1008,
1013,
1010,
18093,
1013,
1008,
1024,
2151,
1008,
1013,
1010,
4372,
2278,
1013,
1008,
1024,
1029,
5164,
1008,
1013,
1007,
1063,
1013,
1008,
3795,
29464,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/wysiwygCommands/table.js | focusToFirstTh | function focusToFirstTh(sq, $table) {
const range = sq.getSelection();
range.selectNodeContents($table.find('th')[0]);
range.collapse(true);
sq.setSelection(range);
} | javascript | function focusToFirstTh(sq, $table) {
const range = sq.getSelection();
range.selectNodeContents($table.find('th')[0]);
range.collapse(true);
sq.setSelection(range);
} | [
"function",
"focusToFirstTh",
"(",
"sq",
",",
"$table",
")",
"{",
"const",
"range",
"=",
"sq",
".",
"getSelection",
"(",
")",
";",
"range",
".",
"selectNodeContents",
"(",
"$table",
".",
"find",
"(",
"'th'",
")",
"[",
"0",
"]",
")",
";",
"range",
"."... | Focus to first th
@param {Squire} sq Squire instance
@param {jQuery} $table jQuery wrapped table element | [
"Focus",
"to",
"first",
"th"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/wysiwygCommands/table.js#L54-L60 | train | Focus to first th in table | [
30522,
3853,
3579,
3406,
8873,
12096,
2705,
1006,
5490,
1010,
1002,
2795,
1007,
1063,
9530,
3367,
2846,
1027,
5490,
1012,
4152,
12260,
7542,
1006,
1007,
1025,
2846,
1012,
7276,
3630,
3207,
8663,
6528,
3215,
1006,
1002,
2795,
1012,
2424,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | readFile | function readFile(path, options, callback) {
var encoding = options.encoding || "utf8";
// callback to be executed when the call to stat completes
// or immediately if a stat object was passed as an argument
function doReadFile(stat) {
if (stat.size > (FileUtils.MAX_FILE_SI... | javascript | function readFile(path, options, callback) {
var encoding = options.encoding || "utf8";
// callback to be executed when the call to stat completes
// or immediately if a stat object was passed as an argument
function doReadFile(stat) {
if (stat.size > (FileUtils.MAX_FILE_SI... | [
"function",
"readFile",
"(",
"path",
",",
"options",
",",
"callback",
")",
"{",
"var",
"encoding",
"=",
"options",
".",
"encoding",
"||",
"\"utf8\"",
";",
"// callback to be executed when the call to stat completes",
"// or immediately if a stat object was passed as an argum... | Read the contents of the file at the given path, calling back
asynchronously with either a FileSystemError string, or with the data and
the FileSystemStats object associated with the read file. The options
parameter can be used to specify an encoding (default "utf8"), and also
a cached stats object that the implementat... | [
"Read",
"the",
"contents",
"of",
"the",
"file",
"at",
"the",
"given",
"path",
"calling",
"back",
"asynchronously",
"with",
"either",
"a",
"FileSystemError",
"string",
"or",
"with",
"the",
"data",
"and",
"the",
"FileSystemStats",
"object",
"associated",
"with",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L363-L393 | train | readFile - Reads a file | [
30522,
3853,
3191,
8873,
2571,
1006,
4130,
1010,
7047,
1010,
2655,
5963,
1007,
1063,
13075,
17181,
1027,
7047,
1012,
17181,
1064,
1064,
1000,
21183,
2546,
2620,
1000,
1025,
1013,
1013,
2655,
5963,
2000,
2022,
6472,
2043,
1996,
2655,
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... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/App.controller.js | function() {
var oViewModel = this.getModel("appView"),
bPhoneSize = oViewModel.getProperty("/bPhoneSize");
// Version switch should not be shown on phone sizes or when no versions are found
oViewModel.setProperty("/bShowVersionSwitchInHeader", !bPhoneSize && !!this._aNeoAppVersions);
oViewModel.s... | javascript | function() {
var oViewModel = this.getModel("appView"),
bPhoneSize = oViewModel.getProperty("/bPhoneSize");
// Version switch should not be shown on phone sizes or when no versions are found
oViewModel.setProperty("/bShowVersionSwitchInHeader", !bPhoneSize && !!this._aNeoAppVersions);
oViewModel.s... | [
"function",
"(",
")",
"{",
"var",
"oViewModel",
"=",
"this",
".",
"getModel",
"(",
"\"appView\"",
")",
",",
"bPhoneSize",
"=",
"oViewModel",
".",
"getProperty",
"(",
"\"/bPhoneSize\"",
")",
";",
"// Version switch should not be shown on phone sizes or when no versions a... | Determines whether or not to show the version change button.
@private | [
"Determines",
"whether",
"or",
"not",
"to",
"show",
"the",
"version",
"change",
"button",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/App.controller.js#L414-L421 | train | Sets the version switch in header or menu depending on the phone size | [
30522,
3853,
1006,
1007,
1063,
13075,
1051,
8584,
5302,
9247,
1027,
2023,
1012,
2131,
5302,
9247,
1006,
1000,
10439,
8584,
1000,
1007,
1010,
17531,
27406,
5332,
4371,
1027,
1051,
8584,
5302,
9247,
1012,
2131,
21572,
4842,
3723,
1006,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/editor/InlineWidget.js | InlineWidget | function InlineWidget() {
var self = this;
// create the outer wrapper div
this.htmlContent = window.document.createElement("div");
this.$htmlContent = $(this.htmlContent).addClass("inline-widget").attr("tabindex", "-1");
this.$htmlContent.append("<div class='shadow top' />")
... | javascript | function InlineWidget() {
var self = this;
// create the outer wrapper div
this.htmlContent = window.document.createElement("div");
this.$htmlContent = $(this.htmlContent).addClass("inline-widget").attr("tabindex", "-1");
this.$htmlContent.append("<div class='shadow top' />")
... | [
"function",
"InlineWidget",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// create the outer wrapper div",
"this",
".",
"htmlContent",
"=",
"window",
".",
"document",
".",
"createElement",
"(",
"\"div\"",
")",
";",
"this",
".",
"$htmlContent",
"=",
"$",
... | @constructor | [
"@constructor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/InlineWidget.js#L36-L59 | train | Inline widget | [
30522,
3853,
23881,
9148,
24291,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
1013,
1013,
3443,
1996,
6058,
10236,
4842,
4487,
2615,
2023,
1012,
16129,
8663,
6528,
2102,
1027,
3332,
1012,
6254,
1012,
3443,
12260,
3672,
1006,
1000,
4487,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/tabs/js/tabsController.js | removeTab | function removeTab (tabData) {
if (destroyed) return;
var selectedIndex = ctrl.selectedIndex,
tab = ctrl.tabs.splice(tabData.getIndex(), 1)[ 0 ];
refreshIndex();
// when removing a tab, if the selected index did not change, we have to manually trigger the
// tab select/deselect e... | javascript | function removeTab (tabData) {
if (destroyed) return;
var selectedIndex = ctrl.selectedIndex,
tab = ctrl.tabs.splice(tabData.getIndex(), 1)[ 0 ];
refreshIndex();
// when removing a tab, if the selected index did not change, we have to manually trigger the
// tab select/deselect e... | [
"function",
"removeTab",
"(",
"tabData",
")",
"{",
"if",
"(",
"destroyed",
")",
"return",
";",
"var",
"selectedIndex",
"=",
"ctrl",
".",
"selectedIndex",
",",
"tab",
"=",
"ctrl",
".",
"tabs",
".",
"splice",
"(",
"tabData",
".",
"getIndex",
"(",
")",
",... | Remove a tab from the data and select the nearest valid tab.
@param {Object} tabData tab to remove | [
"Remove",
"a",
"tab",
"from",
"the",
"data",
"and",
"select",
"the",
"nearest",
"valid",
"tab",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L421-L436 | train | Removes a tab from the page | [
30522,
3853,
6366,
2696,
2497,
1006,
21628,
2850,
2696,
1007,
1063,
2065,
1006,
3908,
1007,
2709,
1025,
13075,
3479,
22254,
10288,
1027,
14931,
12190,
1012,
3479,
22254,
10288,
1010,
21628,
1027,
14931,
12190,
1012,
21628,
2015,
1012,
11867,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/jvectormap/lib/world-map.js | function(markers, seriesData){
var i;
seriesData = seriesData || [];
this.createMarkers(markers);
for (i = 0; i < seriesData.length; i++) {
this.series.markers[i].setValues(seriesData[i] || {});
};
} | javascript | function(markers, seriesData){
var i;
seriesData = seriesData || [];
this.createMarkers(markers);
for (i = 0; i < seriesData.length; i++) {
this.series.markers[i].setValues(seriesData[i] || {});
};
} | [
"function",
"(",
"markers",
",",
"seriesData",
")",
"{",
"var",
"i",
";",
"seriesData",
"=",
"seriesData",
"||",
"[",
"]",
";",
"this",
".",
"createMarkers",
"(",
"markers",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"seriesData",
".",
"le... | Add set of marker to the map.
@param {Object|Array} markers Markers to add to the map. In case of array is provided, codes of markers will be set as string representations of array indexes.
@param {Array} seriesData Values to add to the data series. | [
"Add",
"set",
"of",
"marker",
"to",
"the",
"map",
"."
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/jvectormap/lib/world-map.js#L777-L786 | train | set markers and series data | [
30522,
3853,
1006,
16387,
1010,
2186,
2850,
2696,
1007,
1063,
13075,
1045,
1025,
2186,
2850,
2696,
1027,
2186,
2850,
2696,
1064,
1064,
1031,
1033,
1025,
2023,
1012,
3443,
10665,
2545,
1006,
16387,
1007,
1025,
2005,
1006,
1045,
1027,
1014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/core/services/gesture/gesture.js | addHandler | function addHandler(name, definition) {
var handler = new $$MdGestureHandler(name);
angular.extend(handler, definition);
HANDLERS[name] = handler;
return self;
} | javascript | function addHandler(name, definition) {
var handler = new $$MdGestureHandler(name);
angular.extend(handler, definition);
HANDLERS[name] = handler;
return self;
} | [
"function",
"addHandler",
"(",
"name",
",",
"definition",
")",
"{",
"var",
"handler",
"=",
"new",
"$$MdGestureHandler",
"(",
"name",
")",
";",
"angular",
".",
"extend",
"(",
"handler",
",",
"definition",
")",
";",
"HANDLERS",
"[",
"name",
"]",
"=",
"hand... | /*
add a handler to $mdGesture. see below. | [
"/",
"*",
"add",
"a",
"handler",
"to",
"$mdGesture",
".",
"see",
"below",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/gesture/gesture.js#L191-L197 | train | Adds a new gesture handler to the current container. | [
30522,
3853,
5587,
11774,
3917,
1006,
2171,
1010,
6210,
1007,
1063,
13075,
28213,
1027,
2047,
1002,
1002,
9108,
8449,
11244,
11774,
3917,
1006,
2171,
1007,
1025,
16108,
1012,
7949,
1006,
28213,
1010,
6210,
1007,
1025,
28213,
2015,
1031,
217... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/animation.js | bounce | function bounce(t) {
const s = 7.5625;
const p = 2.75;
let l;
if (t < (1 / p)) {
l = s * t * t;
} else {
if (t < (2 / p)) {
t -= (1.5 / p);
l = s * t * t + 0.75;
} else {
if (t < (2.5 / p)) {
t -= (2.25 / p);
l = s * t * t + 0.9375;
} else {
t -= (2.... | javascript | function bounce(t) {
const s = 7.5625;
const p = 2.75;
let l;
if (t < (1 / p)) {
l = s * t * t;
} else {
if (t < (2 / p)) {
t -= (1.5 / p);
l = s * t * t + 0.75;
} else {
if (t < (2.5 / p)) {
t -= (2.25 / p);
l = s * t * t + 0.9375;
} else {
t -= (2.... | [
"function",
"bounce",
"(",
"t",
")",
"{",
"const",
"s",
"=",
"7.5625",
";",
"const",
"p",
"=",
"2.75",
";",
"let",
"l",
";",
"if",
"(",
"t",
"<",
"(",
"1",
"/",
"p",
")",
")",
"{",
"l",
"=",
"s",
"*",
"t",
"*",
"t",
";",
"}",
"else",
"{... | A bounce easing method (from https://github.com/DmitryBaranovskiy/raphael). | [
"A",
"bounce",
"easing",
"method",
"(",
"from",
"https",
":",
"//",
"github",
".",
"com",
"/",
"DmitryBaranovskiy",
"/",
"raphael",
")",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/animation.js#L31-L52 | train | bounce t | [
30522,
3853,
17523,
1006,
1056,
1007,
1063,
9530,
3367,
1055,
1027,
1021,
1012,
5179,
17788,
1025,
9530,
3367,
1052,
1027,
1016,
1012,
4293,
1025,
2292,
1048,
1025,
2065,
1006,
1056,
1026,
1006,
1015,
1013,
1052,
1007,
1007,
1063,
1048,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/ProjectManager.js | setBaseUrl | function setBaseUrl(projectBaseUrl) {
var context = _getProjectViewStateContext();
projectBaseUrl = model.setBaseUrl(projectBaseUrl);
PreferencesManager.setViewState("project.baseUrl", projectBaseUrl, context);
} | javascript | function setBaseUrl(projectBaseUrl) {
var context = _getProjectViewStateContext();
projectBaseUrl = model.setBaseUrl(projectBaseUrl);
PreferencesManager.setViewState("project.baseUrl", projectBaseUrl, context);
} | [
"function",
"setBaseUrl",
"(",
"projectBaseUrl",
")",
"{",
"var",
"context",
"=",
"_getProjectViewStateContext",
"(",
")",
";",
"projectBaseUrl",
"=",
"model",
".",
"setBaseUrl",
"(",
"projectBaseUrl",
")",
";",
"PreferencesManager",
".",
"setViewState",
"(",
"\"p... | Sets the encoded Base URL of the currently loaded project.
@param {String} | [
"Sets",
"the",
"encoded",
"Base",
"URL",
"of",
"the",
"currently",
"loaded",
"project",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L514-L520 | train | Sets the base URL of the project | [
30522,
3853,
2275,
15058,
3126,
2140,
1006,
2622,
15058,
3126,
2140,
1007,
1063,
13075,
6123,
1027,
1035,
2131,
21572,
20614,
8584,
9153,
26557,
28040,
18413,
1006,
1007,
1025,
2622,
15058,
3126,
2140,
1027,
2944,
1012,
2275,
15058,
3126,
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... |
getinsomnia/insomnia | packages/insomnia-app/app/account/crypt.js | _hkdfSalt | async function _hkdfSalt(rawSalt, rawEmail) {
return new Promise(resolve => {
const hkdf = new HKDF('sha256', rawSalt, rawEmail);
hkdf.derive('', DEFAULT_BYTE_LENGTH, buffer => resolve(buffer.toString('hex')));
});
} | javascript | async function _hkdfSalt(rawSalt, rawEmail) {
return new Promise(resolve => {
const hkdf = new HKDF('sha256', rawSalt, rawEmail);
hkdf.derive('', DEFAULT_BYTE_LENGTH, buffer => resolve(buffer.toString('hex')));
});
} | [
"async",
"function",
"_hkdfSalt",
"(",
"rawSalt",
",",
"rawEmail",
")",
"{",
"return",
"new",
"Promise",
"(",
"resolve",
"=>",
"{",
"const",
"hkdf",
"=",
"new",
"HKDF",
"(",
"'sha256'",
",",
"rawSalt",
",",
"rawEmail",
")",
";",
"hkdf",
".",
"derive",
... | ~~~~~~~~~~~~~~~~ // Helper Functions // ~~~~~~~~~~~~~~~~ //
Combine email and raw salt into usable salt
@param rawSalt
@param rawEmail
@returns {Promise} | [
"~~~~~~~~~~~~~~~~",
"//",
"Helper",
"Functions",
"//",
"~~~~~~~~~~~~~~~~",
"//",
"Combine",
"email",
"and",
"raw",
"salt",
"into",
"usable",
"salt"
] | e24ce7f7b41246e700c4b9bdb6b34b6652ad589b | https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/account/crypt.js#L304-L309 | train | HKDF the salt and email | [
30522,
2004,
6038,
2278,
3853,
1035,
22563,
20952,
12002,
2102,
1006,
6315,
12002,
2102,
1010,
6315,
14545,
4014,
1007,
1063,
2709,
2047,
4872,
1006,
10663,
1027,
1028,
1063,
9530,
3367,
22563,
20952,
1027,
2047,
22563,
20952,
1006,
1005,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js | getObject | function getObject(sName) {
// Note: ObjectPath.get("", ...) === undefined
return sName && sName.charAt(0) === "."
? ObjectPath.get(sName.slice(1), oScope)
: ObjectPath.get(sName || "", oScope) || ObjectPath.get(sName || "");
} | javascript | function getObject(sName) {
// Note: ObjectPath.get("", ...) === undefined
return sName && sName.charAt(0) === "."
? ObjectPath.get(sName.slice(1), oScope)
: ObjectPath.get(sName || "", oScope) || ObjectPath.get(sName || "");
} | [
"function",
"getObject",
"(",
"sName",
")",
"{",
"// Note: ObjectPath.get(\"\", ...) === undefined",
"return",
"sName",
"&&",
"sName",
".",
"charAt",
"(",
"0",
")",
"===",
"\".\"",
"?",
"ObjectPath",
".",
"get",
"(",
"sName",
".",
"slice",
"(",
"1",
")",
","... | Returns a JavaScript object which is identified by a dot-separated sequence of names.
If the given compound name starts with a dot, it is interpreted relative to
<code>oScope</code>.
@param {string} sName
a dot-separated sequence of names that identify the required object
@returns {object}
a JavaScript object which is... | [
"Returns",
"a",
"JavaScript",
"object",
"which",
"is",
"identified",
"by",
"a",
"dot",
"-",
"separated",
"sequence",
"of",
"names",
".",
"If",
"the",
"given",
"compound",
"name",
"starts",
"with",
"a",
"dot",
"it",
"is",
"interpreted",
"relative",
"to",
"<... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L1053-L1058 | train | Get the object from the ObjectPath | [
30522,
3853,
2131,
16429,
20614,
1006,
1055,
18442,
1007,
1063,
1013,
1013,
3602,
1024,
4874,
15069,
1012,
2131,
1006,
1000,
1000,
1010,
1012,
1012,
1012,
1007,
1027,
1027,
1027,
6151,
28344,
2709,
1055,
18442,
1004,
1004,
1055,
18442,
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... |
apache/incubator-echarts | dist/extension/dataTool.js | map | function map(obj, cb, context) {
if (!(obj && cb)) {
return;
}
if (obj.map && obj.map === nativeMap) {
return obj.map(cb, context);
}
else {
var result = [];
for (var i = 0, len = obj.length; i < len; i++) {
result.push(cb.call(context, obj[i], i, obj));
... | javascript | function map(obj, cb, context) {
if (!(obj && cb)) {
return;
}
if (obj.map && obj.map === nativeMap) {
return obj.map(cb, context);
}
else {
var result = [];
for (var i = 0, len = obj.length; i < len; i++) {
result.push(cb.call(context, obj[i], i, obj));
... | [
"function",
"map",
"(",
"obj",
",",
"cb",
",",
"context",
")",
"{",
"if",
"(",
"!",
"(",
"obj",
"&&",
"cb",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"obj",
".",
"map",
"&&",
"obj",
".",
"map",
"===",
"nativeMap",
")",
"{",
"return",
"obj... | 数组或对象遍历
@memberOf module:zrender/core/util
@param {Object|Array} obj
@param {Function} cb
@param {*} [context]
数组映射
@memberOf module:zrender/core/util
@param {Array} obj
@param {Function} cb
@param {*} [context]
@return {Array} | [
"数组或对象遍历"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/dist/extension/dataTool.js#L134-L148 | train | A function that returns an array of the result of calling a callback for each entry in the array. | [
30522,
3853,
4949,
1006,
27885,
3501,
1010,
17324,
1010,
6123,
1007,
1063,
2065,
1006,
999,
1006,
27885,
3501,
1004,
1004,
17324,
1007,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
27885,
3501,
1012,
4949,
1004,
1004,
27885,
3501,
1012,
4949,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/view/MainViewManager.js | endTraversal | function endTraversal() {
var pane = _getPane(ACTIVE_PANE);
if (_traversingFileList) {
_traversingFileList = false;
_makeFileMostRecent(pane.id, pane.getCurrentlyViewedFile());
}
} | javascript | function endTraversal() {
var pane = _getPane(ACTIVE_PANE);
if (_traversingFileList) {
_traversingFileList = false;
_makeFileMostRecent(pane.id, pane.getCurrentlyViewedFile());
}
} | [
"function",
"endTraversal",
"(",
")",
"{",
"var",
"pane",
"=",
"_getPane",
"(",
"ACTIVE_PANE",
")",
";",
"if",
"(",
"_traversingFileList",
")",
"{",
"_traversingFileList",
"=",
"false",
";",
"_makeFileMostRecent",
"(",
"pane",
".",
"id",
",",
"pane",
".",
... | Un-freezes the MRU list after one or more beginTraversal() calls.
Whatever file is current is bumped to the front of the MRU list. | [
"Un",
"-",
"freezes",
"the",
"MRU",
"list",
"after",
"one",
"or",
"more",
"beginTraversal",
"()",
"calls",
".",
"Whatever",
"file",
"is",
"current",
"is",
"bumped",
"to",
"the",
"front",
"of",
"the",
"MRU",
"list",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L981-L989 | train | End traversal | [
30522,
30524,
9739,
2063,
1006,
3161,
1035,
6090,
2063,
1007,
1025,
2065,
1006,
1035,
29053,
2075,
8873,
2571,
9863,
1007,
1063,
1035,
29053,
2075,
8873,
2571,
9863,
1027,
6270,
1025,
1035,
2191,
8873,
16930,
14122,
2890,
13013,
1006,
6090,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/document/DocumentCommandHandlers.js | detectDocumentNavEnd | function detectDocumentNavEnd(event) {
if (event.keyCode === KeyEvent.DOM_VK_CONTROL) { // Ctrl key
MainViewManager.endTraversal();
_addedNavKeyHandler = false;
$(window.document.body).off("keyup", detectDocumentNavEnd);
}
} | javascript | function detectDocumentNavEnd(event) {
if (event.keyCode === KeyEvent.DOM_VK_CONTROL) { // Ctrl key
MainViewManager.endTraversal();
_addedNavKeyHandler = false;
$(window.document.body).off("keyup", detectDocumentNavEnd);
}
} | [
"function",
"detectDocumentNavEnd",
"(",
"event",
")",
"{",
"if",
"(",
"event",
".",
"keyCode",
"===",
"KeyEvent",
".",
"DOM_VK_CONTROL",
")",
"{",
"// Ctrl key",
"MainViewManager",
".",
"endTraversal",
"(",
")",
";",
"_addedNavKeyHandler",
"=",
"false",
";",
... | When the Ctrl key is released, if we were in the middle of a next/prev document navigation
sequence, now is the time to end it and update the MRU order. If we allowed the order to update
on every next/prev increment, the 1st & 2nd entries would just switch places forever and we'd
never get further down the list.
@param... | [
"When",
"the",
"Ctrl",
"key",
"is",
"released",
"if",
"we",
"were",
"in",
"the",
"middle",
"of",
"a",
"next",
"/",
"prev",
"document",
"navigation",
"sequence",
"now",
"is",
"the",
"time",
"to",
"end",
"it",
"and",
"update",
"the",
"MRU",
"order",
".",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentCommandHandlers.js#L1531-L1537 | train | detect document navigation end | [
30522,
3853,
11487,
3527,
24894,
4765,
2532,
8159,
2094,
1006,
30524,
12190,
3145,
2364,
8584,
24805,
4590,
1012,
2203,
6494,
14028,
2389,
1006,
1007,
1025,
1035,
2794,
2532,
2615,
14839,
11774,
3917,
1027,
6270,
1025,
1002,
1006,
3332,
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... |
angular/material | release.js | writeScript | function writeScript (name, cmds) {
fs.writeFileSync(name, '#!/usr/bin/env bash\n\n' + cmds.join('\n'));
exec('chmod +x ' + name);
} | javascript | function writeScript (name, cmds) {
fs.writeFileSync(name, '#!/usr/bin/env bash\n\n' + cmds.join('\n'));
exec('chmod +x ' + name);
} | [
"function",
"writeScript",
"(",
"name",
",",
"cmds",
")",
"{",
"fs",
".",
"writeFileSync",
"(",
"name",
",",
"'#!/usr/bin/env bash\\n\\n'",
"+",
"cmds",
".",
"join",
"(",
"'\\n'",
")",
")",
";",
"exec",
"(",
"'chmod +x '",
"+",
"name",
")",
";",
"}"
] | writes an array of commands to a bash script | [
"writes",
"an",
"array",
"of",
"commands",
"to",
"a",
"bash",
"script"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/release.js#L208-L211 | train | Write a script to the file system | [
30522,
3853,
7009,
23235,
1006,
2171,
1010,
4642,
5104,
1007,
1063,
1042,
2015,
1012,
4339,
8873,
4244,
6038,
2278,
1006,
2171,
1010,
1005,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
4372,
2615,
24234,
1032,
1050,
1032,
1050,
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... |
eslint/eslint | lib/rules/key-spacing.js | verifyListSpacing | function verifyListSpacing(properties) {
const length = properties.length;
for (let i = 0; i < length; i++) {
verifySpacing(properties[i], singleLineOptions);
}
} | javascript | function verifyListSpacing(properties) {
const length = properties.length;
for (let i = 0; i < length; i++) {
verifySpacing(properties[i], singleLineOptions);
}
} | [
"function",
"verifyListSpacing",
"(",
"properties",
")",
"{",
"const",
"length",
"=",
"properties",
".",
"length",
";",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"{",
"verifySpacing",
"(",
"properties",
"[",
"i",
... | Verifies spacing of each property in a list.
@param {ASTNode[]} properties List of Property AST nodes.
@returns {void} | [
"Verifies",
"spacing",
"of",
"each",
"property",
"in",
"a",
"list",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/key-spacing.js#L617-L623 | train | verify spacing of list | [
30522,
3853,
20410,
27103,
19498,
2075,
1006,
5144,
1007,
1063,
9530,
3367,
3091,
1027,
5144,
1012,
3091,
1025,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
20410,
13102,
26217,
1006,
5144,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | src/core/core.controller.js | mergeScaleConfig | function mergeScaleConfig(/* config objects ... */) {
return helpers.merge({}, [].slice.call(arguments), {
merger: function(key, target, source, options) {
if (key === 'xAxes' || key === 'yAxes') {
var slen = source[key].length;
var i, type, scale;
if (!target[key]) {
target[key] = [];
}
... | javascript | function mergeScaleConfig(/* config objects ... */) {
return helpers.merge({}, [].slice.call(arguments), {
merger: function(key, target, source, options) {
if (key === 'xAxes' || key === 'yAxes') {
var slen = source[key].length;
var i, type, scale;
if (!target[key]) {
target[key] = [];
}
... | [
"function",
"mergeScaleConfig",
"(",
"/* config objects ... */",
")",
"{",
"return",
"helpers",
".",
"merge",
"(",
"{",
"}",
",",
"[",
"]",
".",
"slice",
".",
"call",
"(",
"arguments",
")",
",",
"{",
"merger",
":",
"function",
"(",
"key",
",",
"target",
... | Recursively merge the given config objects representing the `scales` option
by incorporating scale defaults in `xAxes` and `yAxes` array items, then
returns a deep copy of the result, thus doesn't alter inputs. | [
"Recursively",
"merge",
"the",
"given",
"config",
"objects",
"representing",
"the",
"scales",
"option",
"by",
"incorporating",
"scale",
"defaults",
"in",
"xAxes",
"and",
"yAxes",
"array",
"items",
"then",
"returns",
"a",
"deep",
"copy",
"of",
"the",
"result",
... | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/core/core.controller.js#L43-L76 | train | Merge scale config objects into target config object | [
30522,
3853,
13590,
15782,
2571,
8663,
8873,
2290,
1006,
1013,
1008,
9530,
8873,
2290,
5200,
1012,
1012,
1012,
1008,
1013,
1007,
1063,
2709,
2393,
2545,
1012,
13590,
1006,
1063,
1065,
1010,
1031,
1033,
1012,
14704,
1012,
2655,
1006,
9918,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-ide | packages/side-runtime/src/webdriver.js | async function(...args) {
try {
return await Executor.prototype[assertion].call(this, ...args)
} catch (err) {
if (err instanceof AssertionError) {
throw new VerificationError(err.message)
}
throw err
}
} | javascript | async function(...args) {
try {
return await Executor.prototype[assertion].call(this, ...args)
} catch (err) {
if (err instanceof AssertionError) {
throw new VerificationError(err.message)
}
throw err
}
} | [
"async",
"function",
"(",
"...",
"args",
")",
"{",
"try",
"{",
"return",
"await",
"Executor",
".",
"prototype",
"[",
"assertion",
"]",
".",
"call",
"(",
"this",
",",
"...",
"args",
")",
"}",
"catch",
"(",
"err",
")",
"{",
"if",
"(",
"err",
"instanc... | creating the function inside an object since function declared in an object are named after the property, thus creating dyanmic named funcs also in order to be able to call(this) the function has to be normal declaration rather than arrow, as arrow will be bound to createVerifyCommands context which is undefined | [
"creating",
"the",
"function",
"inside",
"an",
"object",
"since",
"function",
"declared",
"in",
"an",
"object",
"are",
"named",
"after",
"the",
"property",
"thus",
"creating",
"dyanmic",
"named",
"funcs",
"also",
"in",
"order",
"to",
"be",
"able",
"to",
"cal... | 2b7852d2bb0d19cf285bae30e7dce2d250bc54ae | https://github.com/SeleniumHQ/selenium-ide/blob/2b7852d2bb0d19cf285bae30e7dce2d250bc54ae/packages/side-runtime/src/webdriver.js#L1384-L1393 | train | Alerta Komponente | [
30522,
2004,
6038,
2278,
3853,
1006,
1012,
1012,
1012,
12098,
5620,
1007,
1063,
3046,
1063,
2709,
26751,
4654,
8586,
16161,
2099,
1012,
8773,
1031,
23617,
1033,
1012,
2655,
1006,
2023,
1010,
1012,
1012,
1012,
12098,
5620,
1007,
1065,
4608,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | Makefile.js | lintMarkdown | function lintMarkdown(files) {
const config = yaml.safeLoad(fs.readFileSync(path.join(__dirname, "./.markdownlint.yml"), "utf8")),
result = markdownlint.sync({
files,
config,
resultVersion: 1
}),
resultString = result.toString(),
returnCode = resul... | javascript | function lintMarkdown(files) {
const config = yaml.safeLoad(fs.readFileSync(path.join(__dirname, "./.markdownlint.yml"), "utf8")),
result = markdownlint.sync({
files,
config,
resultVersion: 1
}),
resultString = result.toString(),
returnCode = resul... | [
"function",
"lintMarkdown",
"(",
"files",
")",
"{",
"const",
"config",
"=",
"yaml",
".",
"safeLoad",
"(",
"fs",
".",
"readFileSync",
"(",
"path",
".",
"join",
"(",
"__dirname",
",",
"\"./.markdownlint.yml\"",
")",
",",
"\"utf8\"",
")",
")",
",",
"result",
... | Lints Markdown files.
@param {Array} files Array of file names to lint.
@returns {Object} exec-style exit code object.
@private | [
"Lints",
"Markdown",
"files",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/Makefile.js#L387-L401 | train | Lint Markdown files | [
30522,
3853,
11409,
29418,
8024,
7698,
1006,
6764,
1007,
1063,
9530,
3367,
9530,
8873,
2290,
1027,
8038,
19968,
1012,
3647,
11066,
1006,
1042,
2015,
1012,
3191,
8873,
4244,
6038,
2278,
1006,
4130,
1012,
3693,
1006,
1035,
1035,
16101,
18442,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/coord/polar/polarCreator.js | updatePolarScale | function updatePolarScale(ecModel, api) {
var polar = this;
var angleAxis = polar.getAngleAxis();
var radiusAxis = polar.getRadiusAxis();
// Reset scale
angleAxis.scale.setExtent(Infinity, -Infinity);
radiusAxis.scale.setExtent(Infinity, -Infinity);
ecModel.eachSeries(function (seriesModel)... | javascript | function updatePolarScale(ecModel, api) {
var polar = this;
var angleAxis = polar.getAngleAxis();
var radiusAxis = polar.getRadiusAxis();
// Reset scale
angleAxis.scale.setExtent(Infinity, -Infinity);
radiusAxis.scale.setExtent(Infinity, -Infinity);
ecModel.eachSeries(function (seriesModel)... | [
"function",
"updatePolarScale",
"(",
"ecModel",
",",
"api",
")",
"{",
"var",
"polar",
"=",
"this",
";",
"var",
"angleAxis",
"=",
"polar",
".",
"getAngleAxis",
"(",
")",
";",
"var",
"radiusAxis",
"=",
"polar",
".",
"getRadiusAxis",
"(",
")",
";",
"// Rese... | Update polar | [
"Update",
"polar"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/polar/polarCreator.js#L59-L93 | train | Update polar scale | [
30522,
3853,
10651,
18155,
11650,
9289,
2063,
1006,
14925,
5302,
9247,
1010,
17928,
1007,
1063,
13075,
11508,
1027,
2023,
1025,
13075,
6466,
8528,
2483,
1027,
11508,
1012,
2131,
5654,
19738,
9048,
2015,
1006,
1007,
1025,
30524,
1011,
15579,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Freeboard/freeboard | js/freeboard.thirdparty.js | function(inst) {
var altFormat, date, dateStr,
altField = this._get(inst, "altField");
if (altField) { // update alternate field too
altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
date = this._getDate(inst);
dateStr = this.formatDate(altFormat, date, this._getFormatConfig(in... | javascript | function(inst) {
var altFormat, date, dateStr,
altField = this._get(inst, "altField");
if (altField) { // update alternate field too
altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
date = this._getDate(inst);
dateStr = this.formatDate(altFormat, date, this._getFormatConfig(in... | [
"function",
"(",
"inst",
")",
"{",
"var",
"altFormat",
",",
"date",
",",
"dateStr",
",",
"altField",
"=",
"this",
".",
"_get",
"(",
"inst",
",",
"\"altField\"",
")",
";",
"if",
"(",
"altField",
")",
"{",
"// update alternate field too",
"altFormat",
"=",
... | /* Update any alternate field to synchronise with the main field. | [
"/",
"*",
"Update",
"any",
"alternate",
"field",
"to",
"synchronise",
"with",
"the",
"main",
"field",
"."
] | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L8634-L8644 | train | update the date field | [
30522,
3853,
1006,
16021,
2102,
1007,
1063,
13075,
12456,
14192,
4017,
1010,
3058,
1010,
5246,
16344,
1010,
12456,
3790,
1027,
2023,
1012,
1035,
2131,
1006,
16021,
2102,
1010,
1000,
12456,
3790,
1000,
1007,
1025,
2065,
1006,
12456,
3790,
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... | |
parcel-bundler/parcel | packages/core/parcel-bundler/src/transforms/babel/env.js | getEnvConfig | async function getEnvConfig(asset, isSourceModule) {
// Load the target engines for the app and generate a @babel/preset-env config
let targetEngines = await getTargetEngines(asset, true);
let targetEnv = await getEnvPlugins(targetEngines, true);
if (!targetEnv) {
return null;
}
// If this is the app m... | javascript | async function getEnvConfig(asset, isSourceModule) {
// Load the target engines for the app and generate a @babel/preset-env config
let targetEngines = await getTargetEngines(asset, true);
let targetEnv = await getEnvPlugins(targetEngines, true);
if (!targetEnv) {
return null;
}
// If this is the app m... | [
"async",
"function",
"getEnvConfig",
"(",
"asset",
",",
"isSourceModule",
")",
"{",
"// Load the target engines for the app and generate a @babel/preset-env config",
"let",
"targetEngines",
"=",
"await",
"getTargetEngines",
"(",
"asset",
",",
"true",
")",
";",
"let",
"tar... | Generates a @babel/preset-env config for an asset.
This is done by finding the source module's target engines, and the app's
target engines, and doing a diff to include only the necessary plugins. | [
"Generates",
"a"
] | 84b308511f87d4b69da62bcd352f0ff2f7bd4f1b | https://github.com/parcel-bundler/parcel/blob/84b308511f87d4b69da62bcd352f0ff2f7bd4f1b/packages/core/parcel-bundler/src/transforms/babel/env.js#L9-L37 | train | Get the env config for the app. | [
30522,
2004,
6038,
2278,
3853,
2131,
2368,
25465,
2239,
8873,
2290,
1006,
11412,
1010,
26354,
8162,
3401,
5302,
8566,
2571,
1007,
1063,
1013,
1013,
7170,
1996,
4539,
5209,
2005,
1996,
10439,
1998,
9699,
1037,
1030,
11561,
2140,
1013,
3653,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getsentry/sentry-javascript | packages/raven-js/scripts/generate-plugin-combinations.js | generate | function generate(plugins, dest) {
const pluginNames = plugins.map((plugin) => {
return path.basename(plugin, '.js');
});
const pluginCombinations = combine(pluginNames);
pluginCombinations.forEach((pluginCombination) => {
fs.writeFileSync(
path.resolve(dest, `${pluginCombination.join(',')}.js`)... | javascript | function generate(plugins, dest) {
const pluginNames = plugins.map((plugin) => {
return path.basename(plugin, '.js');
});
const pluginCombinations = combine(pluginNames);
pluginCombinations.forEach((pluginCombination) => {
fs.writeFileSync(
path.resolve(dest, `${pluginCombination.join(',')}.js`)... | [
"function",
"generate",
"(",
"plugins",
",",
"dest",
")",
"{",
"const",
"pluginNames",
"=",
"plugins",
".",
"map",
"(",
"(",
"plugin",
")",
"=>",
"{",
"return",
"path",
".",
"basename",
"(",
"plugin",
",",
"'.js'",
")",
";",
"}",
")",
";",
"const",
... | Generate all plugin combinations.
@param {array} plugins
@param {string} dest | [
"Generate",
"all",
"plugin",
"combinations",
"."
] | a872223343fecf7364473b78bede937f1eb57bd0 | https://github.com/getsentry/sentry-javascript/blob/a872223343fecf7364473b78bede937f1eb57bd0/packages/raven-js/scripts/generate-plugin-combinations.js#L46-L59 | train | Generate a bunch of plugin combinations | [
30522,
3853,
9699,
1006,
13354,
7076,
1010,
4078,
2102,
1007,
1063,
9530,
3367,
13354,
23111,
14074,
2015,
1027,
13354,
7076,
1012,
4949,
1006,
1006,
13354,
2378,
1007,
1027,
1028,
1063,
2709,
4130,
1012,
2918,
18442,
1006,
13354,
2378,
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... |
tensorflow/tfjs-models | knn-classifier/demo/camera.js | setupGui | function setupGui() {
// Create training buttons and info texts
for (let i = 0; i < NUM_CLASSES; i++) {
const div = document.createElement('div');
document.body.appendChild(div);
div.style.marginBottom = '10px';
// Create training button
const button = document.createElement('button');
butt... | javascript | function setupGui() {
// Create training buttons and info texts
for (let i = 0; i < NUM_CLASSES; i++) {
const div = document.createElement('div');
document.body.appendChild(div);
div.style.marginBottom = '10px';
// Create training button
const button = document.createElement('button');
butt... | [
"function",
"setupGui",
"(",
")",
"{",
"// Create training buttons and info texts",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"NUM_CLASSES",
";",
"i",
"++",
")",
"{",
"const",
"div",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"... | Setup training GUI. Adds a training button for each class,
and sets up mouse events. | [
"Setup",
"training",
"GUI",
".",
"Adds",
"a",
"training",
"button",
"for",
"each",
"class",
"and",
"sets",
"up",
"mouse",
"events",
"."
] | af194797c90cc5bcac1060d3cd41b0258a34c7dc | https://github.com/tensorflow/tfjs-models/blob/af194797c90cc5bcac1060d3cd41b0258a34c7dc/knn-classifier/demo/camera.js#L87-L111 | train | Creates the GUI for the training buttons | [
30522,
3853,
16437,
25698,
1006,
1007,
1063,
1013,
1013,
3443,
2731,
11287,
1998,
18558,
6981,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026,
16371,
2213,
1035,
4280,
1025,
1045,
1009,
1009,
1007,
1063,
9530,
3367,
4487,
2615,
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... |
serverless/serverless | lib/plugins/aws/package/compile/events/apiGateway/lib/resources.js | applyResource | function applyResource(resource, isMethod) {
let root;
let parent;
let currentPath;
const path = resource.path.replace(/^\//, '').replace(/\/$/, '');
const pathParts = path.split('/');
function applyNodeResource(node, parts, index) {
const n = node;
if (index === par... | javascript | function applyResource(resource, isMethod) {
let root;
let parent;
let currentPath;
const path = resource.path.replace(/^\//, '').replace(/\/$/, '');
const pathParts = path.split('/');
function applyNodeResource(node, parts, index) {
const n = node;
if (index === par... | [
"function",
"applyResource",
"(",
"resource",
",",
"isMethod",
")",
"{",
"let",
"root",
";",
"let",
"parent",
";",
"let",
"currentPath",
";",
"const",
"path",
"=",
"resource",
".",
"path",
".",
"replace",
"(",
"/",
"^\\/",
"/",
",",
"''",
")",
".",
"... | organize all resource paths into N-ary tree | [
"organize",
"all",
"resource",
"paths",
"into",
"N",
"-",
"ary",
"tree"
] | 0626d5b5df06e4ed68969e324f1cb6b1b499c443 | https://github.com/serverless/serverless/blob/0626d5b5df06e4ed68969e324f1cb6b1b499c443/lib/plugins/aws/package/compile/events/apiGateway/lib/resources.js#L81-L148 | train | Apply a resource to the tree | [
30522,
3853,
6611,
6072,
8162,
3401,
1006,
7692,
1010,
2003,
11368,
6806,
2094,
1007,
1063,
2292,
7117,
1025,
2292,
6687,
1025,
2292,
2783,
15069,
1025,
9530,
3367,
4130,
1027,
7692,
1012,
4130,
1012,
5672,
1006,
1013,
1034,
1032,
1013,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Requestor.js | getResponseHeader | function getResponseHeader(sHeaderName) {
var sResponseHeader;
sHeaderName = sHeaderName.toLowerCase();
for (sResponseHeader in this.headers) {
if (sResponseHeader.toLowerCase() === sHeaderName) {
return this.headers[sResponseHeader];
}
}
} | javascript | function getResponseHeader(sHeaderName) {
var sResponseHeader;
sHeaderName = sHeaderName.toLowerCase();
for (sResponseHeader in this.headers) {
if (sResponseHeader.toLowerCase() === sHeaderName) {
return this.headers[sResponseHeader];
}
}
} | [
"function",
"getResponseHeader",
"(",
"sHeaderName",
")",
"{",
"var",
"sResponseHeader",
";",
"sHeaderName",
"=",
"sHeaderName",
".",
"toLowerCase",
"(",
")",
";",
"for",
"(",
"sResponseHeader",
"in",
"this",
".",
"headers",
")",
"{",
"if",
"(",
"sResponseHead... | The getResponseHeader() method imitates the jqXHR.getResponseHeader() method for a $batch
error response.
@param {string} sHeaderName The header name
@returns {string} The response header value | [
"The",
"getResponseHeader",
"()",
"method",
"imitates",
"the",
"jqXHR",
".",
"getResponseHeader",
"()",
"method",
"for",
"a",
"$batch",
"error",
"response",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Requestor.js#L31-L41 | train | Returns the response header by name. | [
30522,
3853,
2131,
6072,
26029,
3366,
4974,
2121,
1006,
16994,
25888,
14074,
1007,
1063,
13075,
5034,
2229,
26029,
3366,
4974,
2121,
1025,
16994,
25888,
14074,
1027,
16994,
25888,
14074,
1012,
2000,
27663,
18992,
3366,
1006,
1007,
1025,
2005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
moleculerjs/moleculer | src/middlewares/circuit-breaker.js | halfOpen | function halfOpen(item) {
item.state = C.CIRCUIT_HALF_OPEN;
item.ep.state = true;
logger.debug(`Circuit breaker has been half-opened on '${item.ep.name}' endpoint.`, { nodeID: item.ep.id, action: item.ep.action.name });
broker.broadcast("$circuit-breaker.half-opened", { nodeID: item.ep.id, action: item.ep.act... | javascript | function halfOpen(item) {
item.state = C.CIRCUIT_HALF_OPEN;
item.ep.state = true;
logger.debug(`Circuit breaker has been half-opened on '${item.ep.name}' endpoint.`, { nodeID: item.ep.id, action: item.ep.action.name });
broker.broadcast("$circuit-breaker.half-opened", { nodeID: item.ep.id, action: item.ep.act... | [
"function",
"halfOpen",
"(",
"item",
")",
"{",
"item",
".",
"state",
"=",
"C",
".",
"CIRCUIT_HALF_OPEN",
";",
"item",
".",
"ep",
".",
"state",
"=",
"true",
";",
"logger",
".",
"debug",
"(",
"`",
"${",
"item",
".",
"ep",
".",
"name",
"}",
"`",
","... | Change circuit-breaker status to half-open
@param {Object} item
@param {Context} ctx | [
"Change",
"circuit",
"-",
"breaker",
"status",
"to",
"half",
"-",
"open"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/circuit-breaker.js#L145-L157 | train | Handle half - open circuit breaker | [
30522,
3853,
2431,
26915,
1006,
8875,
1007,
1063,
8875,
1012,
2110,
1027,
1039,
1012,
4984,
1035,
2431,
1035,
2330,
1025,
8875,
1012,
4958,
1012,
2110,
1027,
2995,
1025,
8833,
4590,
1012,
2139,
30524,
1012,
4958,
1012,
2171,
1065,
1005,
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/protocol/LiveDevProtocol.js | getRemoteFunctionsScript | function getRemoteFunctionsScript() {
var script = "";
// Inject DocumentObserver into the browser (tracks related documents)
script += DocumentObserver;
// Inject remote functions into the browser.
script += "window._LD=(" + RemoteFunctions + "(" + JSON.stringify(LiveDevMultiBro... | javascript | function getRemoteFunctionsScript() {
var script = "";
// Inject DocumentObserver into the browser (tracks related documents)
script += DocumentObserver;
// Inject remote functions into the browser.
script += "window._LD=(" + RemoteFunctions + "(" + JSON.stringify(LiveDevMultiBro... | [
"function",
"getRemoteFunctionsScript",
"(",
")",
"{",
"var",
"script",
"=",
"\"\"",
";",
"// Inject DocumentObserver into the browser (tracks related documents)",
"script",
"+=",
"DocumentObserver",
";",
"// Inject remote functions into the browser.",
"script",
"+=",
"\"window._... | Returns a script that should be injected into the HTML that's launched in the
browser in order to implement remote commands that handle protocol requests.
Includes the <script> tags.
@return {string} | [
"Returns",
"a",
"script",
"that",
"should",
"be",
"injected",
"into",
"the",
"HTML",
"that",
"s",
"launched",
"in",
"the",
"browser",
"in",
"order",
"to",
"implement",
"remote",
"commands",
"that",
"handle",
"protocol",
"requests",
".",
"Includes",
"the",
"<... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/LiveDevProtocol.js#L212-L219 | train | Get the script to be used to inject remote functions into the browser | [
30522,
3853,
2131,
28578,
12184,
11263,
27989,
4757,
23235,
1006,
1007,
1063,
13075,
5896,
1027,
1000,
1000,
1025,
1013,
1013,
1999,
20614,
6254,
16429,
8043,
6299,
2046,
1996,
16602,
1006,
3162,
3141,
5491,
1007,
5896,
1009,
1027,
6254,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/json/encodeOutput.js | encodeOutputToJson | function encodeOutputToJson(output) {
var book = output.getBook();
var generator = output.getGenerator();
var options = output.getOptions();
var result = encodeBook(book);
result.output = {
name: generator
};
result.options = options.toJS();
return result;
} | javascript | function encodeOutputToJson(output) {
var book = output.getBook();
var generator = output.getGenerator();
var options = output.getOptions();
var result = encodeBook(book);
result.output = {
name: generator
};
result.options = options.toJS();
return result;
} | [
"function",
"encodeOutputToJson",
"(",
"output",
")",
"{",
"var",
"book",
"=",
"output",
".",
"getBook",
"(",
")",
";",
"var",
"generator",
"=",
"output",
".",
"getGenerator",
"(",
")",
";",
"var",
"options",
"=",
"output",
".",
"getOptions",
"(",
")",
... | Encode an output to JSON
@param {Output}
@return {Object} | [
"Encode",
"an",
"output",
"to",
"JSON"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/json/encodeOutput.js#L9-L23 | train | Encode the output to JSON | [
30522,
3853,
4372,
16044,
5833,
18780,
3406,
22578,
2239,
1006,
6434,
1007,
1063,
13075,
2338,
1027,
6434,
1012,
2131,
8654,
1006,
1007,
1025,
13075,
13103,
1027,
6434,
1012,
2131,
6914,
6906,
4263,
1006,
1007,
1025,
13075,
7047,
1027,
6434... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ExtractToFunction.js | handleExtractToFunction | function handleExtractToFunction() {
var editor = EditorManager.getActiveEditor();
var result = new $.Deferred(); // used only for testing purpose
if (editor.getSelections().length > 1) {
editor.displayErrorMessageAtCursor(Strings.ERROR_EXTRACTTO_FUNCTION_MULTICURSORS);
... | javascript | function handleExtractToFunction() {
var editor = EditorManager.getActiveEditor();
var result = new $.Deferred(); // used only for testing purpose
if (editor.getSelections().length > 1) {
editor.displayErrorMessageAtCursor(Strings.ERROR_EXTRACTTO_FUNCTION_MULTICURSORS);
... | [
"function",
"handleExtractToFunction",
"(",
")",
"{",
"var",
"editor",
"=",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
";",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"// used only for testing purpose",
"if",
"(",
"editor",
".",
... | Main function that handles extract to function | [
"Main",
"function",
"that",
"handles",
"extract",
"to",
"function"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/ExtractToFunction.js#L265-L328 | train | handleExtractToFunction - Extracts to function | [
30522,
3853,
5047,
10288,
6494,
6593,
3406,
11263,
27989,
1006,
1007,
1063,
13075,
3559,
1027,
3559,
24805,
4590,
1012,
2131,
19620,
2098,
15660,
1006,
1007,
1025,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/ExtensionLoader.js | loadExtensionModule | function loadExtensionModule(name, config, entryPoint) {
var extensionConfig = {
context: name,
baseUrl: config.baseUrl,
paths: globalPaths,
locale: brackets.getLocale()
};
// Read optional requirejs-config.json
var promise = _mergeConfig(... | javascript | function loadExtensionModule(name, config, entryPoint) {
var extensionConfig = {
context: name,
baseUrl: config.baseUrl,
paths: globalPaths,
locale: brackets.getLocale()
};
// Read optional requirejs-config.json
var promise = _mergeConfig(... | [
"function",
"loadExtensionModule",
"(",
"name",
",",
"config",
",",
"entryPoint",
")",
"{",
"var",
"extensionConfig",
"=",
"{",
"context",
":",
"name",
",",
"baseUrl",
":",
"config",
".",
"baseUrl",
",",
"paths",
":",
"globalPaths",
",",
"locale",
":",
"br... | Loads the extension module that lives at baseUrl into its own Require.js context
@param {!string} name, used to identify the extension
@param {!{baseUrl: string}} config object with baseUrl property containing absolute path of extension
@param {!string} entryPoint, name of the main js file to load
@return {!$.Promise}... | [
"Loads",
"the",
"extension",
"module",
"that",
"lives",
"at",
"baseUrl",
"into",
"its",
"own",
"Require",
".",
"js",
"context"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ExtensionLoader.js#L168-L236 | train | Load extension module | [
30522,
3853,
7170,
10288,
29048,
5302,
8566,
2571,
1006,
2171,
1010,
9530,
8873,
2290,
1010,
4443,
8400,
1007,
1063,
13075,
5331,
8663,
8873,
2290,
1027,
1063,
6123,
1024,
2171,
1010,
2918,
3126,
2140,
1024,
9530,
8873,
2290,
1012,
2918,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/curly.js | isCollapsedOneLiner | function isCollapsedOneLiner(node) {
const before = sourceCode.getTokenBefore(node);
const last = sourceCode.getLastToken(node);
const lastExcludingSemicolon = astUtils.isSemicolonToken(last) ? sourceCode.getTokenBefore(last) : last;
return before.loc.start.line === last... | javascript | function isCollapsedOneLiner(node) {
const before = sourceCode.getTokenBefore(node);
const last = sourceCode.getLastToken(node);
const lastExcludingSemicolon = astUtils.isSemicolonToken(last) ? sourceCode.getTokenBefore(last) : last;
return before.loc.start.line === last... | [
"function",
"isCollapsedOneLiner",
"(",
"node",
")",
"{",
"const",
"before",
"=",
"sourceCode",
".",
"getTokenBefore",
"(",
"node",
")",
";",
"const",
"last",
"=",
"sourceCode",
".",
"getLastToken",
"(",
"node",
")",
";",
"const",
"lastExcludingSemicolon",
"="... | -------------------------------------------------------------------------- Helpers --------------------------------------------------------------------------
Determines if a given node is a one-liner that's on the same line as it's preceding code.
@param {ASTNode} node The node to check.
@returns {boolean} True if the... | [
"--------------------------------------------------------------------------",
"Helpers",
"--------------------------------------------------------------------------",
"Determines",
"if",
"a",
"given",
"node",
"is",
"a",
"one",
"-",
"liner",
"that",
"s",
"on",
"the",
"same",
"line... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/curly.js#L85-L91 | train | Check if node is collapsed by one liner | [
30522,
3853,
2003,
26895,
9331,
6924,
5643,
20660,
1006,
13045,
1007,
1063,
9530,
3367,
2077,
1027,
3120,
16044,
1012,
2131,
18715,
2368,
4783,
29278,
2063,
1006,
13045,
1007,
1025,
9530,
3367,
2197,
1027,
3120,
16044,
1012,
2131,
8523,
928... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TileContainer.js | handleAriaPositionInSet | function handleAriaPositionInSet(iStartIndex, iEndIndex, aVisibleTiles) {
var i,
oTile = null;
aVisibleTiles = aVisibleTiles || this._getVisibleTiles();
for (i = iStartIndex; i < iEndIndex; i++) {
oTile = aVisibleTiles[i];
if (oTile) {
oTile.$().attr('aria-posinset', this._indexOfVisibleTile(oTile,... | javascript | function handleAriaPositionInSet(iStartIndex, iEndIndex, aVisibleTiles) {
var i,
oTile = null;
aVisibleTiles = aVisibleTiles || this._getVisibleTiles();
for (i = iStartIndex; i < iEndIndex; i++) {
oTile = aVisibleTiles[i];
if (oTile) {
oTile.$().attr('aria-posinset', this._indexOfVisibleTile(oTile,... | [
"function",
"handleAriaPositionInSet",
"(",
"iStartIndex",
",",
"iEndIndex",
",",
"aVisibleTiles",
")",
"{",
"var",
"i",
",",
"oTile",
"=",
"null",
";",
"aVisibleTiles",
"=",
"aVisibleTiles",
"||",
"this",
".",
"_getVisibleTiles",
"(",
")",
";",
"for",
"(",
... | Handles the WAI ARIA property aria-posinset after a change in the TileContainer.
@param {int} iStartIndex The index of the Tile to start with
@param {int} iEndIndex The index of the Tile to complete with
@param {sap.m.Tile[]} [aVisibleTiles] optional list of visible tiles in order to avoid filtering them again.
@privat... | [
"Handles",
"the",
"WAI",
"ARIA",
"property",
"aria",
"-",
"posinset",
"after",
"a",
"change",
"in",
"the",
"TileContainer",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/TileContainer.js#L2163-L2175 | train | Handle ARIA position in set | [
30522,
3853,
5047,
10980,
26994,
7076,
3388,
1006,
21541,
8445,
22254,
10288,
1010,
29464,
16089,
13629,
2595,
1010,
20704,
17417,
3468,
15286,
2015,
1007,
1063,
13075,
1045,
1010,
27178,
9463,
1027,
19701,
1025,
20704,
17417,
3468,
15286,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/blanket.js | parseSwitchCase | function parseSwitchCase() {
var test, consequent = [], statement, startToken;
startToken = lookahead;
if (matchKeyword('default')) {
lex();
test = null;
} else {
expectKeyword('case');
test = parseExpression();
}
expect(':... | javascript | function parseSwitchCase() {
var test, consequent = [], statement, startToken;
startToken = lookahead;
if (matchKeyword('default')) {
lex();
test = null;
} else {
expectKeyword('case');
test = parseExpression();
}
expect(':... | [
"function",
"parseSwitchCase",
"(",
")",
"{",
"var",
"test",
",",
"consequent",
"=",
"[",
"]",
",",
"statement",
",",
"startToken",
";",
"startToken",
"=",
"lookahead",
";",
"if",
"(",
"matchKeyword",
"(",
"'default'",
")",
")",
"{",
"lex",
"(",
")",
"... | 12.10 The swith statement | [
"12",
".",
"10",
"The",
"swith",
"statement"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L3043-L3065 | train | ECMA - 262 13. 2 Switch Case | [
30522,
3853,
11968,
8583,
9148,
10649,
18382,
1006,
1007,
1063,
13075,
3231,
1010,
9530,
3366,
15417,
1027,
1031,
1033,
1010,
4861,
1010,
2707,
18715,
2368,
1025,
2707,
18715,
2368,
1027,
2298,
4430,
13775,
1025,
2065,
1006,
2674,
14839,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-irregular-whitespace.js | removeWhitespaceError | function removeWhitespaceError(node) {
const locStart = node.loc.start;
const locEnd = node.loc.end;
errors = errors.filter(({ loc: errorLoc }) => {
if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) {
if (errorLoc.column >= locSt... | javascript | function removeWhitespaceError(node) {
const locStart = node.loc.start;
const locEnd = node.loc.end;
errors = errors.filter(({ loc: errorLoc }) => {
if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) {
if (errorLoc.column >= locSt... | [
"function",
"removeWhitespaceError",
"(",
"node",
")",
"{",
"const",
"locStart",
"=",
"node",
".",
"loc",
".",
"start",
";",
"const",
"locEnd",
"=",
"node",
".",
"loc",
".",
"end",
";",
"errors",
"=",
"errors",
".",
"filter",
"(",
"(",
"{",
"loc",
":... | Removes errors that occur inside a string node
@param {ASTNode} node to check for matching errors.
@returns {void}
@private | [
"Removes",
"errors",
"that",
"occur",
"inside",
"a",
"string",
"node"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-irregular-whitespace.js#L86-L98 | train | Remove whitespace errors from the node | [
30522,
3853,
6366,
2860,
16584,
2229,
15327,
2121,
29165,
1006,
13045,
1007,
1063,
9530,
3367,
8840,
6169,
7559,
2102,
1027,
13045,
1012,
8840,
2278,
1012,
2707,
1025,
9530,
3367,
8840,
23865,
1027,
13045,
1012,
8840,
2278,
1012,
2203,
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... |
NervJS/taro | packages/taro/src/internal/_common.js | assocIndexOf | function assocIndexOf(array, key) {
var length = array.length
while (length--) {
if (eq(array[length][0], key)) {
return length
}
}
return -1
} | javascript | function assocIndexOf(array, key) {
var length = array.length
while (length--) {
if (eq(array[length][0], key)) {
return length
}
}
return -1
} | [
"function",
"assocIndexOf",
"(",
"array",
",",
"key",
")",
"{",
"var",
"length",
"=",
"array",
".",
"length",
"while",
"(",
"length",
"--",
")",
"{",
"if",
"(",
"eq",
"(",
"array",
"[",
"length",
"]",
"[",
"0",
"]",
",",
"key",
")",
")",
"{",
"... | Gets the index at which the `key` is found in `array` of key-value pairs.
@private
@param {Array} array The array to inspect.
@param {*} key The key to search for.
@returns {number} Returns the index of the matched value, else `-1`. | [
"Gets",
"the",
"index",
"at",
"which",
"the",
"key",
"is",
"found",
"in",
"array",
"of",
"key",
"-",
"value",
"pairs",
"."
] | 274e76d731d7f158141287e31cbd51f092d472c5 | https://github.com/NervJS/taro/blob/274e76d731d7f158141287e31cbd51f092d472c5/packages/taro/src/internal/_common.js#L449-L457 | train | Find index of key in array | [
30522,
3853,
4632,
10085,
22254,
10288,
11253,
1006,
9140,
1010,
3145,
1007,
1063,
13075,
3091,
1027,
9140,
1012,
3091,
2096,
1006,
3091,
1011,
1011,
1007,
1063,
2065,
1006,
1041,
4160,
1006,
9140,
1031,
3091,
1033,
1031,
1014,
1033,
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... |
GitbookIO/gitbook | lib/utils/mergeDefaults.js | mergeDefaults | function mergeDefaults(obj, src) {
var objValue = Immutable.fromJS(obj);
var srcValue = Immutable.fromJS(src);
return srcValue.mergeDeep(objValue).toJS();
} | javascript | function mergeDefaults(obj, src) {
var objValue = Immutable.fromJS(obj);
var srcValue = Immutable.fromJS(src);
return srcValue.mergeDeep(objValue).toJS();
} | [
"function",
"mergeDefaults",
"(",
"obj",
",",
"src",
")",
"{",
"var",
"objValue",
"=",
"Immutable",
".",
"fromJS",
"(",
"obj",
")",
";",
"var",
"srcValue",
"=",
"Immutable",
".",
"fromJS",
"(",
"src",
")",
";",
"return",
"srcValue",
".",
"mergeDeep",
"... | Merge
@param {Object|Map} obj
@param {Object|Map} src
@return {Object} | [
"Merge"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/mergeDefaults.js#L9-L14 | train | Merge the default values of obj and src | [
30522,
3853,
5314,
12879,
23505,
2015,
1006,
27885,
3501,
1010,
5034,
2278,
1007,
1063,
13075,
27885,
3501,
10175,
5657,
1027,
10047,
28120,
3085,
1012,
2013,
22578,
1006,
27885,
3501,
1007,
1025,
13075,
5034,
2278,
10175,
5657,
1027,
10047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/editor/ImageViewer.js | _createImageView | function _createImageView(file, pane) {
var view = pane.getViewForPath(file.fullPath);
if (view) {
pane.showView(view);
} else {
view = new ImageView(file, pane.$content);
pane.addView(view, true);
}
return new $.Deferred().resolve().promise()... | javascript | function _createImageView(file, pane) {
var view = pane.getViewForPath(file.fullPath);
if (view) {
pane.showView(view);
} else {
view = new ImageView(file, pane.$content);
pane.addView(view, true);
}
return new $.Deferred().resolve().promise()... | [
"function",
"_createImageView",
"(",
"file",
",",
"pane",
")",
"{",
"var",
"view",
"=",
"pane",
".",
"getViewForPath",
"(",
"file",
".",
"fullPath",
")",
";",
"if",
"(",
"view",
")",
"{",
"pane",
".",
"showView",
"(",
"view",
")",
";",
"}",
"else",
... | /*
Creates an image view object and adds it to the specified pane
@param {!File} file - the file to create an image of
@param {!Pane} pane - the pane in which to host the view
@return {jQuery.Promise} | [
"/",
"*",
"Creates",
"an",
"image",
"view",
"object",
"and",
"adds",
"it",
"to",
"the",
"specified",
"pane"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/ImageViewer.js#L417-L427 | train | Create ImageView | [
30522,
3853,
1035,
3443,
9581,
3351,
8584,
1006,
5371,
1010,
6090,
2063,
1007,
1063,
13075,
3193,
1027,
6090,
2063,
1012,
2131,
8584,
29278,
15069,
1006,
5371,
1012,
2440,
15069,
1007,
1025,
2065,
1006,
3193,
1007,
1063,
6090,
2063,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | getOrCreateHierarchy | function getOrCreateHierarchy(sKey) {
var oResult = oRecursiveHierarchies[sKey];
if (!oResult) {
oResult = oRecursiveHierarchies[sKey] = {};
}
return oResult;
} | javascript | function getOrCreateHierarchy(sKey) {
var oResult = oRecursiveHierarchies[sKey];
if (!oResult) {
oResult = oRecursiveHierarchies[sKey] = {};
}
return oResult;
} | [
"function",
"getOrCreateHierarchy",
"(",
"sKey",
")",
"{",
"var",
"oResult",
"=",
"oRecursiveHierarchies",
"[",
"sKey",
"]",
";",
"if",
"(",
"!",
"oResult",
")",
"{",
"oResult",
"=",
"oRecursiveHierarchies",
"[",
"sKey",
"]",
"=",
"{",
"}",
";",
"}",
"re... | temp for collecting all properties participating in hierarchies | [
"temp",
"for",
"collecting",
"all",
"properties",
"participating",
"in",
"hierarchies"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L2449-L2456 | train | Returns the hierarchy for the given key. | [
30522,
3853,
2131,
2953,
16748,
3686,
4048,
6906,
29389,
1006,
15315,
3240,
1007,
1063,
13075,
10848,
23722,
2102,
1027,
30524,
23722,
2102,
1027,
10848,
10841,
2869,
3512,
4048,
6906,
11140,
3111,
1031,
15315,
3240,
1033,
1027,
1063,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
grpc/grpc-node | packages/grpc-native-core/src/client_interceptors.js | _getLastInterceptor | function _getLastInterceptor(method_definition, channel, responder) {
var callback = (responder instanceof Function) ? responder : function() {};
var emitter = (responder instanceof EventEmitter) ? responder :
new EventEmitter();
var method_type = common.getMe... | javascript | function _getLastInterceptor(method_definition, channel, responder) {
var callback = (responder instanceof Function) ? responder : function() {};
var emitter = (responder instanceof EventEmitter) ? responder :
new EventEmitter();
var method_type = common.getMe... | [
"function",
"_getLastInterceptor",
"(",
"method_definition",
",",
"channel",
",",
"responder",
")",
"{",
"var",
"callback",
"=",
"(",
"responder",
"instanceof",
"Function",
")",
"?",
"responder",
":",
"function",
"(",
")",
"{",
"}",
";",
"var",
"emitter",
"=... | Creates the last interceptor in an interceptor stack.
@private
@param {grpc~MethodDefinition} method_definition
@param {grpc.Channel} channel
@param {function|EventEmitter} responder
@return {Interceptor} | [
"Creates",
"the",
"last",
"interceptor",
"in",
"an",
"interceptor",
"stack",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/client_interceptors.js#L1373-L1380 | train | Get last interceptor | [
30522,
3853,
1035,
2131,
8523,
7629,
3334,
3401,
13876,
2953,
1006,
4118,
1035,
6210,
1010,
3149,
1010,
6869,
2121,
1007,
1063,
13075,
2655,
5963,
1027,
1006,
6869,
2121,
6013,
11253,
3853,
1007,
1029,
6869,
2121,
1024,
3853,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | lib/jsdoc/create-api-index.js | collectLists | function collectLists(oSymbol) {
function addData(oDataType, oEntityObject, sObjectType, sSymbolName) {
let sSince = oDataType !== "since" ? oEntityObject[oDataType].since : oEntityObject.since,
oData = {
control: sSymbolName,
text: oEntityObject[oDataType].text || oEntityObject.description,
ty... | javascript | function collectLists(oSymbol) {
function addData(oDataType, oEntityObject, sObjectType, sSymbolName) {
let sSince = oDataType !== "since" ? oEntityObject[oDataType].since : oEntityObject.since,
oData = {
control: sSymbolName,
text: oEntityObject[oDataType].text || oEntityObject.description,
ty... | [
"function",
"collectLists",
"(",
"oSymbol",
")",
"{",
"function",
"addData",
"(",
"oDataType",
",",
"oEntityObject",
",",
"sObjectType",
",",
"sSymbolName",
")",
"{",
"let",
"sSince",
"=",
"oDataType",
"!==",
"\"since\"",
"?",
"oEntityObject",
"[",
"oDataType",
... | /*
Collects Deprecated, Experimental and Since data from passed symbol
including symbol itself, methods and events. | [
"/",
"*",
"Collects",
"Deprecated",
"Experimental",
"and",
"Since",
"data",
"from",
"passed",
"symbol",
"including",
"symbol",
"itself",
"methods",
"and",
"events",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/create-api-index.js#L135-L214 | train | collects all the lists | [
30522,
3853,
8145,
27103,
1006,
9808,
24335,
14956,
1007,
1063,
3853,
5587,
2850,
2696,
1006,
1051,
2850,
29336,
18863,
1010,
1051,
4765,
3012,
16429,
20614,
1010,
17540,
20614,
13874,
1010,
7020,
24335,
14956,
18442,
1007,
1063,
2292,
7020,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/HealthData/HealthDataManager.js | sendAnalyticsDataToServer | function sendAnalyticsDataToServer(eventParams) {
var result = new $.Deferred();
var analyticsData = getAnalyticsData(eventParams);
$.ajax({
url: brackets.config.analyticsDataServerURL,
type: "POST",
data: JSON.stringify({events: [analyticsData]}),
... | javascript | function sendAnalyticsDataToServer(eventParams) {
var result = new $.Deferred();
var analyticsData = getAnalyticsData(eventParams);
$.ajax({
url: brackets.config.analyticsDataServerURL,
type: "POST",
data: JSON.stringify({events: [analyticsData]}),
... | [
"function",
"sendAnalyticsDataToServer",
"(",
"eventParams",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"var",
"analyticsData",
"=",
"getAnalyticsData",
"(",
"eventParams",
")",
";",
"$",
".",
"ajax",
"(",
"{",
"url",
":",
... | Send Analytics data to Server | [
"Send",
"Analytics",
"data",
"to",
"Server"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/HealthData/HealthDataManager.js#L215-L237 | train | Send Adobe Analytics Data to the server | [
30522,
3853,
4604,
27953,
21252,
16150,
6790,
22282,
2099,
6299,
1006,
2724,
28689,
5244,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
13075,
25095,
2850,
2696,
1027,
2131,
27953,
21252,
16150,
6790,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/indent-legacy.js | checkLastNodeLineIndent | function checkLastNodeLineIndent(node, lastLineIndent) {
const lastToken = sourceCode.getLastToken(node);
const endIndent = getNodeIndent(lastToken, true);
if ((endIndent.goodChar !== lastLineIndent || endIndent.badChar !== 0) && isNodeFirstInLine(node, true)) {
repo... | javascript | function checkLastNodeLineIndent(node, lastLineIndent) {
const lastToken = sourceCode.getLastToken(node);
const endIndent = getNodeIndent(lastToken, true);
if ((endIndent.goodChar !== lastLineIndent || endIndent.badChar !== 0) && isNodeFirstInLine(node, true)) {
repo... | [
"function",
"checkLastNodeLineIndent",
"(",
"node",
",",
"lastLineIndent",
")",
"{",
"const",
"lastToken",
"=",
"sourceCode",
".",
"getLastToken",
"(",
"node",
")",
";",
"const",
"endIndent",
"=",
"getNodeIndent",
"(",
"lastToken",
",",
"true",
")",
";",
"if",... | Check last node line indent this detects, that block closed correctly
@param {ASTNode} node Node to examine
@param {int} lastLineIndent needed indent
@returns {void} | [
"Check",
"last",
"node",
"line",
"indent",
"this",
"detects",
"that",
"block",
"closed",
"correctly"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/indent-legacy.js#L432-L446 | train | Check last node line indent | [
30522,
3853,
4638,
8523,
2102,
3630,
9247,
3170,
22254,
4765,
1006,
13045,
1010,
2197,
4179,
22254,
4765,
1007,
1063,
9530,
3367,
2197,
18715,
2368,
1027,
3120,
16044,
1012,
2131,
8523,
9284,
7520,
1006,
13045,
1007,
1025,
9530,
3367,
2203,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/features/JumpToDefManager.js | _doJumpToDef | function _doJumpToDef() {
var request = null,
result = new $.Deferred(),
jumpToDefProvider = null,
editor = EditorManager.getActiveEditor();
if (editor) {
// Find a suitable provider, if any
var language = editor.getLanguageForSelection(),
... | javascript | function _doJumpToDef() {
var request = null,
result = new $.Deferred(),
jumpToDefProvider = null,
editor = EditorManager.getActiveEditor();
if (editor) {
// Find a suitable provider, if any
var language = editor.getLanguageForSelection(),
... | [
"function",
"_doJumpToDef",
"(",
")",
"{",
"var",
"request",
"=",
"null",
",",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"jumpToDefProvider",
"=",
"null",
",",
"editor",
"=",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
";",
"if",
... | Asynchronously asks providers to handle jump-to-definition.
@return {!Promise} Resolved when the provider signals that it's done; rejected if no
provider responded or the provider that responded failed. | [
"Asynchronously",
"asks",
"providers",
"to",
"handle",
"jump",
"-",
"to",
"-",
"definition",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/JumpToDefManager.js#L44-L83 | train | Do a jump to definition | [
30522,
3853,
1035,
2079,
9103,
27718,
10244,
2546,
1006,
1007,
1063,
13075,
5227,
1027,
19701,
1010,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
5376,
3406,
3207,
22540,
12298,
18688,
1027,
19701,
1010,
3559,
1027,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js | function (oPathValue) {
return Expression.parameter(oPathValue, 0).then(function (oResult) {
return {
result : "expression",
type : "Edm.String",
value : oResult.type === "Edm.String"
// Note: odata.uriEncode() is V2, but safe for Edm.String!
? 'odata.uriEncode(' + Basics.resultToStrin... | javascript | function (oPathValue) {
return Expression.parameter(oPathValue, 0).then(function (oResult) {
return {
result : "expression",
type : "Edm.String",
value : oResult.type === "Edm.String"
// Note: odata.uriEncode() is V2, but safe for Edm.String!
? 'odata.uriEncode(' + Basics.resultToStrin... | [
"function",
"(",
"oPathValue",
")",
"{",
"return",
"Expression",
".",
"parameter",
"(",
"oPathValue",
",",
"0",
")",
".",
"then",
"(",
"function",
"(",
"oResult",
")",
"{",
"return",
"{",
"result",
":",
"\"expression\"",
",",
"type",
":",
"\"Edm.String\"",... | Handling of "14.5.3.1.3 Function odata.uriEncode".
@param {object} oPathValue
path and value information pointing to the parameter array (see Expression object)
@returns {sap.ui.base.SyncPromise}
a sync promise which resolves with the result object or is rejected with an error | [
"Handling",
"of",
"14",
".",
"5",
".",
"3",
".",
"1",
".",
"3",
"Function",
"odata",
".",
"uriEncode",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js#L758-L771 | train | Returns an object with the parameters of the given path | [
30522,
3853,
1006,
6728,
8988,
10175,
5657,
1007,
1063,
2709,
3670,
1012,
16381,
1006,
6728,
8988,
10175,
5657,
1010,
1014,
1007,
1012,
2059,
1006,
3853,
1006,
10848,
23722,
2102,
1007,
1063,
2709,
1063,
2765,
1024,
1000,
3670,
1000,
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... | |
apache/incubator-echarts | dist/extension/dataTool.js | quantile | function quantile(ascArr, p) {
var H = (ascArr.length - 1) * p + 1;
var h = Math.floor(H);
var v = +ascArr[h - 1];
var e = H - h;
return e ? v + e * (ascArr[h] - v) : v;
} | javascript | function quantile(ascArr, p) {
var H = (ascArr.length - 1) * p + 1;
var h = Math.floor(H);
var v = +ascArr[h - 1];
var e = H - h;
return e ? v + e * (ascArr[h] - v) : v;
} | [
"function",
"quantile",
"(",
"ascArr",
",",
"p",
")",
"{",
"var",
"H",
"=",
"(",
"ascArr",
".",
"length",
"-",
"1",
")",
"*",
"p",
"+",
"1",
";",
"var",
"h",
"=",
"Math",
".",
"floor",
"(",
"H",
")",
";",
"var",
"v",
"=",
"+",
"ascArr",
"["... | find a “nice” number approximately equal to x. Round the number if round = true,
take ceiling if round = false. The primary observation is that the “nicest”
numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.
See "Nice Numbers for Graph Labels" of Graphic Gems.
@param {number} val No... | [
"find",
"a",
"“nice”",
"number",
"approximately",
"equal",
"to",
"x",
".",
"Round",
"the",
"number",
"if",
"round",
"=",
"true",
"take",
"ceiling",
"if",
"round",
"=",
"false",
".",
"The",
"primary",
"observation",
"is",
"that",
"the",
"“nicest”",
"numbers... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/dist/extension/dataTool.js#L684-L690 | train | returns the quantile of the array | [
30522,
3853,
24110,
15286,
1006,
2004,
10010,
2099,
1010,
1052,
1007,
1063,
13075,
1044,
1027,
1006,
2004,
10010,
2099,
1012,
3091,
1011,
1015,
1007,
1008,
1052,
1009,
1015,
1025,
13075,
1044,
1027,
8785,
1012,
2723,
1006,
1044,
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/mvc/Controller.js | instantiateController | function instantiateController(ControllerClass, sName) {
var oController;
if (mRegistry[sName]) {
oController = new ControllerClass(sName);
} else {
oController = new ControllerClass();
}
if (!oController) {
throw new Error("Controller " + sName + " couldn't be instantiated");
}
return ... | javascript | function instantiateController(ControllerClass, sName) {
var oController;
if (mRegistry[sName]) {
oController = new ControllerClass(sName);
} else {
oController = new ControllerClass();
}
if (!oController) {
throw new Error("Controller " + sName + " couldn't be instantiated");
}
return ... | [
"function",
"instantiateController",
"(",
"ControllerClass",
",",
"sName",
")",
"{",
"var",
"oController",
";",
"if",
"(",
"mRegistry",
"[",
"sName",
"]",
")",
"{",
"oController",
"=",
"new",
"ControllerClass",
"(",
"sName",
")",
";",
"}",
"else",
"{",
"oC... | /*
Instantiation of a controller
@param {function} ControllerClass The controller constructor
@param {string} sName the controller name
@param {boolean} bAsync Load async or not
@return {sap.ui.core.mvc.Controller|Promise} A <code>Promise</code> in case of asynchronous extend
or the <code>controller</code> in case of ... | [
"/",
"*",
"Instantiation",
"of",
"a",
"controller"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/mvc/Controller.js#L344-L355 | train | Instantiate a controller | [
30522,
3853,
7107,
13143,
8663,
13181,
10820,
1006,
11486,
26266,
1010,
1055,
18442,
1007,
1063,
13075,
1051,
8663,
13181,
10820,
1025,
2065,
1006,
2720,
13910,
2923,
2854,
1031,
1055,
18442,
1033,
1007,
1063,
1051,
8663,
13181,
10820,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableAccRenderExtension.js | function(oRm, oTable, oRow, iRowIndex) {
if (!oTable._getAccExtension().getAccMode()) {
return;
}
var oRowSettings = oRow.getAggregation("_settings");
var sHighlightText = oRowSettings._getHighlightText();
_writeAccText(oRm, oRow.getId(), "highlighttext", sHighlightText);
} | javascript | function(oRm, oTable, oRow, iRowIndex) {
if (!oTable._getAccExtension().getAccMode()) {
return;
}
var oRowSettings = oRow.getAggregation("_settings");
var sHighlightText = oRowSettings._getHighlightText();
_writeAccText(oRm, oRow.getId(), "highlighttext", sHighlightText);
} | [
"function",
"(",
"oRm",
",",
"oTable",
",",
"oRow",
",",
"iRowIndex",
")",
"{",
"if",
"(",
"!",
"oTable",
".",
"_getAccExtension",
"(",
")",
".",
"getAccMode",
"(",
")",
")",
"{",
"return",
";",
"}",
"var",
"oRowSettings",
"=",
"oRow",
".",
"getAggre... | Renders the default row highlight content.
@param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the Render-Output-Buffer.
@param {sap.ui.table.Table} oTable Instance of the table.
@param {sap.ui.table.Row} oRow Instance of the row.
@param {int} iRowIndex The index of the row.
@see s... | [
"Renders",
"the",
"default",
"row",
"highlight",
"content",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableAccRenderExtension.js#L203-L212 | train | Renders the highlight text of a row. | [
30522,
3853,
1006,
2030,
2213,
1010,
27178,
3085,
1010,
20298,
2860,
1010,
20868,
5004,
22254,
10288,
1007,
1063,
2065,
1006,
999,
27178,
3085,
1012,
1035,
2131,
6305,
3401,
18413,
6132,
3258,
1006,
1007,
1012,
2131,
6305,
27487,
10244,
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.m/src/sap/m/ViewSettingsDialog.js | restoreCustomTabContentAggregation | function restoreCustomTabContentAggregation(sAggregationName, oCustomTab) {
// Make sure page1 exists, as this method may be called on destroy(), after the page was destroyed
// Suppress creation of new page as the following logic is needed only when a page already exists
if (!this._getPage1(true)) {
return;
... | javascript | function restoreCustomTabContentAggregation(sAggregationName, oCustomTab) {
// Make sure page1 exists, as this method may be called on destroy(), after the page was destroyed
// Suppress creation of new page as the following logic is needed only when a page already exists
if (!this._getPage1(true)) {
return;
... | [
"function",
"restoreCustomTabContentAggregation",
"(",
"sAggregationName",
",",
"oCustomTab",
")",
"{",
"// Make sure page1 exists, as this method may be called on destroy(), after the page was destroyed",
"// Suppress creation of new page as the following logic is needed only when a page already ... | Handle the "content" aggregation of a custom tab, as the items in it might be transferred to the dialog page
instance.
@param {string} sAggregationName The string identifying the aggregation that the given object should be removed from
@param {object} oCustomTab Custom tab instance
@private | [
"Handle",
"the",
"content",
"aggregation",
"of",
"a",
"custom",
"tab",
"as",
"the",
"items",
"in",
"it",
"might",
"be",
"transferred",
"to",
"the",
"dialog",
"page",
"instance",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/ViewSettingsDialog.js#L3158-L3191 | train | Restores the content aggregation of a custom tab | [
30522,
3853,
9239,
7874,
20389,
2696,
9818,
28040,
12380,
13871,
2890,
12540,
1006,
7842,
13871,
2890,
12540,
18442,
1010,
1051,
7874,
20389,
2696,
2497,
1007,
1063,
1013,
1013,
2191,
2469,
3931,
2487,
6526,
1010,
2004,
2023,
4118,
2089,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
catapult-project/catapult | dashboard/dashboard/spa/alerts-section.js | loadMore | function loadMore(batches, alertGroups, nextRequests, triagedRequests,
triagedMaxStartRevision, started) {
const minStartRevision = tr.b.math.Statistics.min(
alertGroups, group => tr.b.math.Statistics.min(
group.alerts, a => a.startRevision));
if (!triagedMaxStartRevision ||
(minStartRevi... | javascript | function loadMore(batches, alertGroups, nextRequests, triagedRequests,
triagedMaxStartRevision, started) {
const minStartRevision = tr.b.math.Statistics.min(
alertGroups, group => tr.b.math.Statistics.min(
group.alerts, a => a.startRevision));
if (!triagedMaxStartRevision ||
(minStartRevi... | [
"function",
"loadMore",
"(",
"batches",
",",
"alertGroups",
",",
"nextRequests",
",",
"triagedRequests",
",",
"triagedMaxStartRevision",
",",
"started",
")",
"{",
"const",
"minStartRevision",
"=",
"tr",
".",
"b",
".",
"math",
".",
"Statistics",
".",
"min",
"("... | This function may add requests to `batches`. See handleBatch for `nextRequests` and `triagedRequests`. | [
"This",
"function",
"may",
"add",
"requests",
"to",
"batches",
".",
"See",
"handleBatch",
"for",
"nextRequests",
"and",
"triagedRequests",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/dashboard/dashboard/spa/alerts-section.js#L325-L353 | train | Load more requests from the nextRequests array. | [
30522,
3853,
7170,
5974,
1006,
14108,
2229,
1010,
9499,
17058,
2015,
1010,
2279,
2890,
15500,
2015,
1010,
13012,
18655,
2890,
15500,
2015,
1010,
13012,
18655,
17848,
14117,
7913,
17084,
1010,
2318,
1007,
1063,
9530,
3367,
8117,
14117,
7913,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/document/DocumentCommandHandlers.js | _doSaveAs | function _doSaveAs(doc, settings) {
var origPath,
saveAsDefaultPath,
defaultName,
result = new $.Deferred();
function _doSaveAfterSaveDialog(path) {
var newFile;
// Reconstruct old doc's editor's view state, & finally resolve overall promise
... | javascript | function _doSaveAs(doc, settings) {
var origPath,
saveAsDefaultPath,
defaultName,
result = new $.Deferred();
function _doSaveAfterSaveDialog(path) {
var newFile;
// Reconstruct old doc's editor's view state, & finally resolve overall promise
... | [
"function",
"_doSaveAs",
"(",
"doc",
",",
"settings",
")",
"{",
"var",
"origPath",
",",
"saveAsDefaultPath",
",",
"defaultName",
",",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"function",
"_doSaveAfterSaveDialog",
"(",
"path",
")",
"{",
"v... | Opens the native OS save as dialog and saves document.
The original document is reverted in case it was dirty.
Text selection and cursor position from the original document
are preserved in the new document.
When saving to the original document the document is saved as if save was called.
@param {Document} doc
@param {... | [
"Opens",
"the",
"native",
"OS",
"save",
"as",
"dialog",
"and",
"saves",
"document",
".",
"The",
"original",
"document",
"is",
"reverted",
"in",
"case",
"it",
"was",
"dirty",
".",
"Text",
"selection",
"and",
"cursor",
"position",
"from",
"the",
"original",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentCommandHandlers.js#L892-L1039 | train | Save a document as a file | [
30522,
3853,
1035,
9998,
10696,
3022,
1006,
9986,
1010,
10906,
1007,
1063,
13075,
2030,
8004,
15069,
1010,
3828,
3022,
3207,
7011,
11314,
15069,
1010,
12398,
18442,
1010,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/ExpressionParser.js | saveBindingAsPart | function saveBindingAsPart(oBinding, iStart, bTargetTypeAny) {
var bHasNonPrimitiveValue = false,
sKey,
oPrimitiveValueBinding,
i;
/*
* Sets the target type of the given binding to the default "any", if applicable.
*
* @param {object} oBinding
* A binding
*/
function setTarge... | javascript | function saveBindingAsPart(oBinding, iStart, bTargetTypeAny) {
var bHasNonPrimitiveValue = false,
sKey,
oPrimitiveValueBinding,
i;
/*
* Sets the target type of the given binding to the default "any", if applicable.
*
* @param {object} oBinding
* A binding
*/
function setTarge... | [
"function",
"saveBindingAsPart",
"(",
"oBinding",
",",
"iStart",
",",
"bTargetTypeAny",
")",
"{",
"var",
"bHasNonPrimitiveValue",
"=",
"false",
",",
"sKey",
",",
"oPrimitiveValueBinding",
",",
"i",
";",
"/*\n\t\t\t * Sets the target type of the given binding to the default ... | Saves the binding as a part. Reuses an existing part if the binding is identical.
@param {object} oBinding
the binding to save
@param {int} iStart
the binding's start index in the input string
@param {boolean} [bTargetTypeAny=false]
whether the binding's "targetType" should default to "any" (recursively, for all parts)... | [
"Saves",
"the",
"binding",
"as",
"a",
"part",
".",
"Reuses",
"an",
"existing",
"part",
"if",
"the",
"binding",
"is",
"identical",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ExpressionParser.js#L541-L595 | train | Saves the given binding as part of the given input string. | [
30522,
3853,
3828,
8428,
4667,
3022,
19362,
2102,
1006,
27885,
22254,
2075,
1010,
21541,
8445,
1010,
18411,
2906,
18150,
13874,
19092,
1007,
1063,
13075,
1038,
14949,
8540,
18098,
27605,
6024,
10175,
5657,
1027,
6270,
1010,
15315,
3240,
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... |
jhipster/generator-jhipster | generators/docker-prompts.js | askForAdminPassword | function askForAdminPassword() {
if (this.regenerate || this.serviceDiscoveryType !== 'eureka') return;
const done = this.async();
const prompts = [
{
type: 'input',
name: 'adminPassword',
message: 'Enter the admin password used to secure the JHipster Registry',... | javascript | function askForAdminPassword() {
if (this.regenerate || this.serviceDiscoveryType !== 'eureka') return;
const done = this.async();
const prompts = [
{
type: 'input',
name: 'adminPassword',
message: 'Enter the admin password used to secure the JHipster Registry',... | [
"function",
"askForAdminPassword",
"(",
")",
"{",
"if",
"(",
"this",
".",
"regenerate",
"||",
"this",
".",
"serviceDiscoveryType",
"!==",
"'eureka'",
")",
"return",
";",
"const",
"done",
"=",
"this",
".",
"async",
"(",
")",
";",
"const",
"prompts",
"=",
... | Ask For Admin Password | [
"Ask",
"For",
"Admin",
"Password"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/docker-prompts.js#L376-L396 | train | Ask For Admin Password | [
30522,
3853,
3198,
29278,
4215,
10020,
15194,
18351,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
19723,
24454,
3686,
1064,
1064,
2023,
1012,
22858,
2483,
3597,
27900,
13874,
999,
1027,
1027,
1005,
21142,
1005,
1007,
2709,
1025,
9530,
3367,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/view/MainViewManager.js | traverseToNextViewInListOrder | function traverseToNextViewInListOrder(direction) {
var file = getCurrentlyViewedFile(),
curPaneId = getActivePaneId(),
allFiles = [],
index;
getPaneIdList().forEach(function (paneId) {
var paneFiles = getWorkingSet(paneId).map(function (file) {
... | javascript | function traverseToNextViewInListOrder(direction) {
var file = getCurrentlyViewedFile(),
curPaneId = getActivePaneId(),
allFiles = [],
index;
getPaneIdList().forEach(function (paneId) {
var paneFiles = getWorkingSet(paneId).map(function (file) {
... | [
"function",
"traverseToNextViewInListOrder",
"(",
"direction",
")",
"{",
"var",
"file",
"=",
"getCurrentlyViewedFile",
"(",
")",
",",
"curPaneId",
"=",
"getActivePaneId",
"(",
")",
",",
"allFiles",
"=",
"[",
"]",
",",
"index",
";",
"getPaneIdList",
"(",
")",
... | Get the next or previous file in list order.
@param {!number} direction - Must be 1 or -1 to traverse forward or backward
@return {?{file:File, paneId:string}} The File object of the next item in the traversal order or null if there aren't any files to traverse.
May return current file if there are no other files to tr... | [
"Get",
"the",
"next",
"or",
"previous",
"file",
"in",
"list",
"order",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L949-L967 | train | traverseToNextViewInListOrder - Traverse to next view in list order | [
30522,
3853,
20811,
5524,
18413,
8584,
2378,
9863,
8551,
2121,
1006,
3257,
1007,
1063,
13075,
5371,
1027,
2131,
10841,
14343,
20630,
8584,
2098,
8873,
2571,
1006,
1007,
1010,
12731,
14536,
7231,
3593,
1027,
2131,
19620,
9739,
7416,
2094,
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... |
wuchangming/spy-debugger | buildin_modules/weinre/web/client/ProfileDataGridTree.js | function()
{
if (this._savedChildren)
return;
this._savedSelfTime = this.selfTime;
this._savedTotalTime = this.totalTime;
this._savedNumberOfCalls = this.numberOfCalls;
this._savedChildren = this.children.slice();
} | javascript | function()
{
if (this._savedChildren)
return;
this._savedSelfTime = this.selfTime;
this._savedTotalTime = this.totalTime;
this._savedNumberOfCalls = this.numberOfCalls;
this._savedChildren = this.children.slice();
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_savedChildren",
")",
"return",
";",
"this",
".",
"_savedSelfTime",
"=",
"this",
".",
"selfTime",
";",
"this",
".",
"_savedTotalTime",
"=",
"this",
".",
"totalTime",
";",
"this",
".",
"_savedNumberOfCalls... | When focusing and collapsing we modify lots of nodes in the tree. This allows us to restore them all to their original state when we revert. | [
"When",
"focusing",
"and",
"collapsing",
"we",
"modify",
"lots",
"of",
"nodes",
"in",
"the",
"tree",
".",
"This",
"allows",
"us",
"to",
"restore",
"them",
"all",
"to",
"their",
"original",
"state",
"when",
"we",
"revert",
"."
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/client/ProfileDataGridTree.js#L227-L237 | train | Save the parameters of the resource | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
5552,
19339,
7389,
1007,
2709,
1025,
2023,
1012,
1035,
5552,
11246,
6199,
14428,
1027,
2023,
1012,
2969,
7292,
1025,
2023,
1012,
1035,
5552,
3406,
9080,
7292,
1027,
2023,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
wuchangming/spy-debugger | buildin_modules/weinre/web/modjewel.js | modjewel_getModuleIdsRequired | function modjewel_getModuleIdsRequired(moduleId) {
var module = modjewel_getModule(moduleId)
if (null == module) return null
return module.moduleIdsRequired.slice()
} | javascript | function modjewel_getModuleIdsRequired(moduleId) {
var module = modjewel_getModule(moduleId)
if (null == module) return null
return module.moduleIdsRequired.slice()
} | [
"function",
"modjewel_getModuleIdsRequired",
"(",
"moduleId",
")",
"{",
"var",
"module",
"=",
"modjewel_getModule",
"(",
"moduleId",
")",
"if",
"(",
"null",
"==",
"module",
")",
"return",
"null",
"return",
"module",
".",
"moduleIdsRequired",
".",
"slice",
"(",
... | ---------------------------------------------------------------------------- get a list of module ids which have been required by the specified module id ---------------------------------------------------------------------------- | [
"----------------------------------------------------------------------------",
"get",
"a",
"list",
"of",
"module",
"ids",
"which",
"have",
"been",
"required",
"by",
"the",
"specified",
"module",
"id",
"----------------------------------------------------------------------------"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/modjewel.js#L318-L323 | train | Returns the moduleIdsRequired array for a module | [
30522,
3853,
16913,
6460,
8545,
2140,
1035,
2131,
5302,
8566,
23057,
5104,
2890,
15549,
5596,
1006,
11336,
3593,
1007,
1063,
13075,
11336,
1027,
16913,
6460,
8545,
2140,
1035,
2131,
5302,
8566,
2571,
1006,
11336,
3593,
1007,
2065,
1006,
197... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | tools/eslint-fuzzer.js | fuzz | function fuzz(options) {
assert.strictEqual(typeof options, "object", "An options object must be provided");
assert.strictEqual(typeof options.count, "number", "The number of iterations (options.count) must be provided");
assert.strictEqual(typeof options.linter, "object", "An linter object (options.linter)... | javascript | function fuzz(options) {
assert.strictEqual(typeof options, "object", "An options object must be provided");
assert.strictEqual(typeof options.count, "number", "The number of iterations (options.count) must be provided");
assert.strictEqual(typeof options.linter, "object", "An linter object (options.linter)... | [
"function",
"fuzz",
"(",
"options",
")",
"{",
"assert",
".",
"strictEqual",
"(",
"typeof",
"options",
",",
"\"object\"",
",",
"\"An options object must be provided\"",
")",
";",
"assert",
".",
"strictEqual",
"(",
"typeof",
"options",
".",
"count",
",",
"\"number... | ------------------------------------------------------------------------------ Public API ------------------------------------------------------------------------------
Generates random JS code, runs ESLint on it, and returns a list of detected crashes or autofix bugs
@param {Object} options Config options for fuzzing... | [
"------------------------------------------------------------------------------",
"Public",
"API",
"------------------------------------------------------------------------------",
"Generates",
"random",
"JS",
"code",
"runs",
"ESLint",
"on",
"it",
"and",
"returns",
"a",
"list",
"of",... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/tools/eslint-fuzzer.js#L41-L138 | train | Fuzzes a source code from a source text. | [
30522,
3853,
11865,
13213,
1006,
7047,
1007,
1063,
20865,
1012,
9384,
2063,
26426,
1006,
2828,
11253,
7047,
1010,
1000,
4874,
1000,
1010,
1000,
2019,
7047,
4874,
2442,
2022,
3024,
1000,
1007,
1025,
20865,
1012,
9384,
2063,
26426,
1006,
2828... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/CustomizingConfiguration.js | function(sControllerName, vObject) {
var oResultConfig;
findConfig(CONFIG_CONTROLLER_REPLACEMENTS, vObject, function(oConfig) {
oResultConfig = oConfig[sControllerName];
return !!oResultConfig;
});
return oResultConfig;
} | javascript | function(sControllerName, vObject) {
var oResultConfig;
findConfig(CONFIG_CONTROLLER_REPLACEMENTS, vObject, function(oConfig) {
oResultConfig = oConfig[sControllerName];
return !!oResultConfig;
});
return oResultConfig;
} | [
"function",
"(",
"sControllerName",
",",
"vObject",
")",
"{",
"var",
"oResultConfig",
";",
"findConfig",
"(",
"CONFIG_CONTROLLER_REPLACEMENTS",
",",
"vObject",
",",
"function",
"(",
"oConfig",
")",
"{",
"oResultConfig",
"=",
"oConfig",
"[",
"sControllerName",
"]",... | returns the configuration of the controller replacement for the given
controller name
@private | [
"returns",
"the",
"configuration",
"of",
"the",
"controller",
"replacement",
"for",
"the",
"given",
"controller",
"name"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/CustomizingConfiguration.js#L199-L206 | train | Returns the configuration for the controller replacement | [
30522,
3853,
1006,
8040,
12162,
26611,
18442,
1010,
30524,
8873,
2290,
1025,
2424,
8663,
8873,
2290,
1006,
9530,
8873,
2290,
1035,
11486,
1035,
23936,
1010,
29536,
2497,
20614,
1010,
3853,
1006,
1051,
8663,
8873,
2290,
1007,
1063,
10848,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.