repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
grpc/grpc-node | packages/grpc-native-core/src/server.js | waitForCancel | function waitForCancel() {
/* jshint validthis: true */
var self = this;
var cancel_batch = {};
cancel_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
self.call.startBatch(cancel_batch, function(err, result) {
if (err) {
self.emit('error', err);
}
if (result.cancelled) {
self.cancelled... | javascript | function waitForCancel() {
/* jshint validthis: true */
var self = this;
var cancel_batch = {};
cancel_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
self.call.startBatch(cancel_batch, function(err, result) {
if (err) {
self.emit('error', err);
}
if (result.cancelled) {
self.cancelled... | [
"function",
"waitForCancel",
"(",
")",
"{",
"/* jshint validthis: true */",
"var",
"self",
"=",
"this",
";",
"var",
"cancel_batch",
"=",
"{",
"}",
";",
"cancel_batch",
"[",
"grpc",
".",
"opType",
".",
"RECV_CLOSE_ON_SERVER",
"]",
"=",
"true",
";",
"self",
".... | Wait for the client to close, then emit a cancelled event if the client
cancelled.
@private | [
"Wait",
"for",
"the",
"client",
"to",
"close",
"then",
"emit",
"a",
"cancelled",
"event",
"if",
"the",
"client",
"cancelled",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/server.js#L515-L529 | train | Wait for the client to close | [
30522,
30524,
24665,
15042,
1012,
23569,
18863,
1012,
28667,
2615,
1035,
2485,
1035,
2006,
1035,
8241,
1033,
1027,
2995,
1025,
2969,
1012,
2655,
1012,
2707,
14479,
2818,
1006,
17542,
1035,
14108,
1010,
3853,
1006,
9413,
2099,
1010,
2765,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js | function (oControl, bStashed) {
var bOldValue;
var vControlId = oControl.getId();
if (oControl.getVisible){
bOldValue = !oControl.getVisible();
} else {
bOldValue = oControl.getStashed();
}
JsControlTreeModifier.setStashed.apply(this, arguments);
var oSetControl = sap.ui.getCore().byId(vC... | javascript | function (oControl, bStashed) {
var bOldValue;
var vControlId = oControl.getId();
if (oControl.getVisible){
bOldValue = !oControl.getVisible();
} else {
bOldValue = oControl.getStashed();
}
JsControlTreeModifier.setStashed.apply(this, arguments);
var oSetControl = sap.ui.getCore().byId(vC... | [
"function",
"(",
"oControl",
",",
"bStashed",
")",
"{",
"var",
"bOldValue",
";",
"var",
"vControlId",
"=",
"oControl",
".",
"getId",
"(",
")",
";",
"if",
"(",
"oControl",
".",
"getVisible",
")",
"{",
"bOldValue",
"=",
"!",
"oControl",
".",
"getVisible",
... | Execute the setStashed method and record the opposite value for the undo operation
The control can be a StashedControl ("placeholder") or a "real" control
After the setStashed operation, the placeholder can create a real control with same ID
Therefore we must save the previous ID in order to perform setStashed on this ... | [
"Execute",
"the",
"setStashed",
"method",
"and",
"record",
"the",
"opposite",
"value",
"for",
"the",
"undo",
"operation",
"The",
"control",
"can",
"be",
"a",
"StashedControl",
"(",
"placeholder",
")",
"or",
"a",
"real",
"control",
"After",
"the",
"setStashed",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L99-L115 | train | Sets the stashed state of the control. | [
30522,
3853,
1006,
1051,
8663,
13181,
2140,
1010,
18667,
10230,
9072,
1007,
1063,
13075,
7782,
10175,
5657,
1025,
13075,
18315,
12162,
13153,
3593,
1027,
1051,
8663,
13181,
2140,
1012,
2131,
3593,
1006,
1007,
1025,
2065,
1006,
1051,
8663,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js | warn | function warn(oElement) {
if (bWarning) {
if (!bCallerLoggedForWarnings) {
bCallerLoggedForWarnings = true;
Log.warning("Warning(s) during processing of " + sCaller, null,
sXMLPreprocessor);
}
Log.warning(
getNestingLevel() + Array.prototype.slice.call(arguments, 1).join(" ")... | javascript | function warn(oElement) {
if (bWarning) {
if (!bCallerLoggedForWarnings) {
bCallerLoggedForWarnings = true;
Log.warning("Warning(s) during processing of " + sCaller, null,
sXMLPreprocessor);
}
Log.warning(
getNestingLevel() + Array.prototype.slice.call(arguments, 1).join(" ")... | [
"function",
"warn",
"(",
"oElement",
")",
"{",
"if",
"(",
"bWarning",
")",
"{",
"if",
"(",
"!",
"bCallerLoggedForWarnings",
")",
"{",
"bCallerLoggedForWarnings",
"=",
"true",
";",
"Log",
".",
"warning",
"(",
"\"Warning(s) during processing of \"",
"+",
"sCaller"... | /*
Outputs a warning message with the current nesting level; takes care not to
construct the message or serialize XML in vain.
@param {Element} [oElement]
any XML DOM element which is serialized to the details
@param {...string} aTexts
the main text of the message is constructed from the rest of the arguments by
joini... | [
"/",
"*",
"Outputs",
"a",
"warning",
"message",
"with",
"the",
"current",
"nesting",
"level",
";",
"takes",
"care",
"not",
"to",
"construct",
"the",
"message",
"or",
"serialize",
"XML",
"in",
"vain",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L1885-L1896 | train | Log warning for the given element | [
30522,
3853,
11582,
1006,
1051,
12260,
3672,
1007,
1063,
2065,
1006,
1038,
9028,
5582,
1007,
1063,
2065,
1006,
999,
4647,
24164,
12190,
8649,
5999,
29278,
9028,
5582,
2015,
1007,
1063,
4647,
24164,
12190,
8649,
5999,
29278,
9028,
5582,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laurent22/joplin | ReactNativeClient/lib/import-enex-md-gen.js | function(lines) {
let firstBracketIndex = 0;
let foundFirstNonWhite = false;
for (let i = lines.length - 1; i >= 0; i--) {
const l = lines[i];
if (!foundFirstNonWhite && (l === SPACE || l === ' ' || !l)) {
lines.pop();
} else {
foundFirstNonWhite = true;
... | javascript | function(lines) {
let firstBracketIndex = 0;
let foundFirstNonWhite = false;
for (let i = lines.length - 1; i >= 0; i--) {
const l = lines[i];
if (!foundFirstNonWhite && (l === SPACE || l === ' ' || !l)) {
lines.pop();
} else {
foundFirstNonWhite = true;
... | [
"function",
"(",
"lines",
")",
"{",
"let",
"firstBracketIndex",
"=",
"0",
";",
"let",
"foundFirstNonWhite",
"=",
"false",
";",
"for",
"(",
"let",
"i",
"=",
"lines",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"const",
... | Eg. converts: [ Sign in ](https://example.com) to: [Sign in](https://example.com) | [
"Eg",
".",
"converts",
":",
"[",
"Sign",
"in",
"]",
"(",
"https",
":",
"//",
"example",
".",
"com",
")",
"to",
":",
"[",
"Sign",
"in",
"]",
"(",
"https",
":",
"//",
"example",
".",
"com",
")"
] | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/ReactNativeClient/lib/import-enex-md-gen.js#L788-L815 | train | Remove the last non - white space and whitespace characters from the lines | [
30522,
3853,
1006,
3210,
1007,
1063,
2292,
2034,
10024,
19869,
7629,
3207,
2595,
1027,
1014,
1025,
2292,
2179,
8873,
12096,
8540,
2860,
16584,
2063,
1027,
6270,
1025,
2005,
1006,
2292,
1045,
1027,
3210,
1012,
3091,
1011,
1015,
1025,
1045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensibility/node/package-validator.js | findCommonPrefix | function findCommonPrefix(extractDir, callback) {
fs.readdir(extractDir, function (err, files) {
ignoredFolders.forEach(function (folder) {
var index = files.indexOf(folder);
if (index !== -1) {
files.splice(index, 1);
}
});
if (err) {
... | javascript | function findCommonPrefix(extractDir, callback) {
fs.readdir(extractDir, function (err, files) {
ignoredFolders.forEach(function (folder) {
var index = files.indexOf(folder);
if (index !== -1) {
files.splice(index, 1);
}
});
if (err) {
... | [
"function",
"findCommonPrefix",
"(",
"extractDir",
",",
"callback",
")",
"{",
"fs",
".",
"readdir",
"(",
"extractDir",
",",
"function",
"(",
"err",
",",
"files",
")",
"{",
"ignoredFolders",
".",
"forEach",
"(",
"function",
"(",
"folder",
")",
"{",
"var",
... | Finds the common prefix, if any, for the files in a package file.
In some package files, all of the files are contained in a subdirectory, and this function
will identify that directory if it exists.
@param {string} extractDir directory into which the package was extracted
@param {function(Error, string)} callback fu... | [
"Finds",
"the",
"common",
"prefix",
"if",
"any",
"for",
"the",
"files",
"in",
"a",
"package",
"file",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/package-validator.js#L152-L173 | train | find common prefix | [
30522,
3853,
2424,
9006,
8202,
28139,
8873,
2595,
1006,
14817,
4305,
2099,
1010,
2655,
5963,
1007,
1063,
1042,
2015,
1012,
3191,
4305,
2099,
1006,
14817,
4305,
2099,
1010,
3853,
1006,
9413,
2099,
1010,
6764,
1007,
1063,
6439,
10371,
2545,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-unused-labels.js | exitLabeledScope | function exitLabeledScope(node) {
if (!scopeInfo.used) {
context.report({
node: node.label,
messageId: "unused",
data: node.label,
fix(fixer) {
/*
* Only perform ... | javascript | function exitLabeledScope(node) {
if (!scopeInfo.used) {
context.report({
node: node.label,
messageId: "unused",
data: node.label,
fix(fixer) {
/*
* Only perform ... | [
"function",
"exitLabeledScope",
"(",
"node",
")",
"{",
"if",
"(",
"!",
"scopeInfo",
".",
"used",
")",
"{",
"context",
".",
"report",
"(",
"{",
"node",
":",
"node",
".",
"label",
",",
"messageId",
":",
"\"unused\"",
",",
"data",
":",
"node",
".",
"lab... | Removes the top of the stack.
At the same time, this reports the label if it's never used.
@param {ASTNode} node - A node to report. This is a LabeledStatement.
@returns {void} | [
"Removes",
"the",
"top",
"of",
"the",
"stack",
".",
"At",
"the",
"same",
"time",
"this",
"reports",
"the",
"label",
"if",
"it",
"s",
"never",
"used",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-unused-labels.js#L57-L80 | train | Exit a labeled scope | [
30522,
3853,
6164,
20470,
12260,
5104,
16186,
1006,
13045,
1007,
1063,
2065,
1006,
999,
9531,
2378,
14876,
1012,
2109,
1007,
1063,
6123,
1012,
3189,
1006,
1063,
13045,
1024,
13045,
1012,
3830,
1010,
4471,
3593,
1024,
1000,
15171,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/blanket.js | parseUnaryExpression | function parseUnaryExpression() {
var token, expr, startToken;
if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
expr = parsePostfixExpression();
} else if (match('++') || match('--')) {
startToken = lookahead;
token = lex();
... | javascript | function parseUnaryExpression() {
var token, expr, startToken;
if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
expr = parsePostfixExpression();
} else if (match('++') || match('--')) {
startToken = lookahead;
token = lex();
... | [
"function",
"parseUnaryExpression",
"(",
")",
"{",
"var",
"token",
",",
"expr",
",",
"startToken",
";",
"if",
"(",
"lookahead",
".",
"type",
"!==",
"Token",
".",
"Punctuator",
"&&",
"lookahead",
".",
"type",
"!==",
"Token",
".",
"Keyword",
")",
"{",
"exp... | 11.4 Unary Operators | [
"11",
".",
"4",
"Unary",
"Operators"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L2352-L2392 | train | ECMA - 262 12. 2 Unary Operators | [
30522,
3853,
11968,
3366,
9521,
2854,
10288,
20110,
3258,
1006,
1007,
1063,
13075,
19204,
1010,
4654,
18098,
1010,
2707,
18715,
2368,
1025,
2065,
1006,
2298,
4430,
13775,
1012,
2828,
999,
1027,
1027,
19204,
1012,
26136,
6593,
6692,
4263,
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/RecentProjects/main.js | _handleListEvents | function _handleListEvents() {
$dropdown
.on("click", "a", function () {
var $link = $(this),
id = $link.attr("id"),
path = $link.data("path");
if (path) {
ProjectManager.openProject(path)
... | javascript | function _handleListEvents() {
$dropdown
.on("click", "a", function () {
var $link = $(this),
id = $link.attr("id"),
path = $link.data("path");
if (path) {
ProjectManager.openProject(path)
... | [
"function",
"_handleListEvents",
"(",
")",
"{",
"$dropdown",
".",
"on",
"(",
"\"click\"",
",",
"\"a\"",
",",
"function",
"(",
")",
"{",
"var",
"$link",
"=",
"$",
"(",
"this",
")",
",",
"id",
"=",
"$link",
".",
"attr",
"(",
"\"id\"",
")",
",",
"path... | Adds the click and mouse enter/leave events to the dropdown | [
"Adds",
"the",
"click",
"and",
"mouse",
"enter",
"/",
"leave",
"events",
"to",
"the",
"dropdown"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L277-L327 | train | Handle list events | [
30522,
3853,
1035,
5047,
9863,
18697,
7666,
1006,
1007,
1063,
1002,
4530,
7698,
1012,
2006,
1006,
1000,
11562,
1000,
1010,
1000,
1037,
1000,
1010,
3853,
1006,
1007,
1063,
13075,
1002,
4957,
1027,
1002,
1006,
2023,
1007,
1010,
8909,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/Agents/DOMHelpers.js | _extractAttributes | function _extractAttributes(content) {
// remove the node name and the closing bracket and optional slash
content = content.replace(/^<\S+\s*/, "");
content = content.replace(/\s*\/?>$/, "");
if (content.length === 0) {
return;
}
// go through the items and ... | javascript | function _extractAttributes(content) {
// remove the node name and the closing bracket and optional slash
content = content.replace(/^<\S+\s*/, "");
content = content.replace(/\s*\/?>$/, "");
if (content.length === 0) {
return;
}
// go through the items and ... | [
"function",
"_extractAttributes",
"(",
"content",
")",
"{",
"// remove the node name and the closing bracket and optional slash",
"content",
"=",
"content",
".",
"replace",
"(",
"/",
"^<\\S+\\s*",
"/",
",",
"\"\"",
")",
";",
"content",
"=",
"content",
".",
"replace",
... | Extract tag attributes from the given source of a single tag
@param {string} source content | [
"Extract",
"tag",
"attributes",
"from",
"the",
"given",
"source",
"of",
"a",
"single",
"tag"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMHelpers.js#L147-L178 | train | Extract the attributes from the content | [
30522,
3853,
1035,
14817,
19321,
3089,
8569,
4570,
1006,
4180,
1007,
1063,
1013,
1013,
6366,
1996,
13045,
2171,
1998,
1996,
5494,
21605,
1998,
11887,
18296,
4180,
1027,
4180,
1012,
5672,
1006,
1013,
1034,
1026,
1032,
1055,
1009,
1032,
1055,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
postmanlabs/newman | lib/run/options.js | function (err, collection) {
if (err) {
return callback(err);
}
// ensure that the collection option is present before starting a run
if (!_.isObject(collection)) {
return callback(new Error(COLLECTION_LOAD_ERROR_ME... | javascript | function (err, collection) {
if (err) {
return callback(err);
}
// ensure that the collection option is present before starting a run
if (!_.isObject(collection)) {
return callback(new Error(COLLECTION_LOAD_ERROR_ME... | [
"function",
"(",
"err",
",",
"collection",
")",
"{",
"if",
"(",
"err",
")",
"{",
"return",
"callback",
"(",
"err",
")",
";",
"}",
"// ensure that the collection option is present before starting a run",
"if",
"(",
"!",
"_",
".",
"isObject",
"(",
"collection",
... | The post collection load handler.
@param {?Error} err - An Error instance / null, passed from the collection loader.
@param {Object} collection - The collection / raw JSON object, passed from the collection loader.
@returns {*} | [
"The",
"post",
"collection",
"load",
"handler",
"."
] | c05a5a1e82aa3c2021e94ba09e627ba4718af69e | https://github.com/postmanlabs/newman/blob/c05a5a1e82aa3c2021e94ba09e627ba4718af69e/lib/run/options.js#L180-L199 | train | Load the cache | [
30522,
3853,
1006,
9413,
2099,
1010,
3074,
1007,
1063,
2065,
1006,
9413,
2099,
1007,
1063,
2709,
2655,
5963,
1006,
9413,
2099,
1007,
30524,
1012,
11163,
2497,
20614,
1006,
3074,
1007,
1007,
1063,
2709,
2655,
5963,
1006,
2047,
7561,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/LiveDevelopment/LiveDevelopment.js | pollInterstitialPage | function pollInterstitialPage() {
if (keepPolling && Inspector.connected()) {
Inspector.Runtime.evaluate("window.isBracketsLiveDevelopmentInterstitialPageLoaded", function (response) {
var result = response.result;
if (result.type === "boolean" && res... | javascript | function pollInterstitialPage() {
if (keepPolling && Inspector.connected()) {
Inspector.Runtime.evaluate("window.isBracketsLiveDevelopmentInterstitialPageLoaded", function (response) {
var result = response.result;
if (result.type === "boolean" && res... | [
"function",
"pollInterstitialPage",
"(",
")",
"{",
"if",
"(",
"keepPolling",
"&&",
"Inspector",
".",
"connected",
"(",
")",
")",
"{",
"Inspector",
".",
"Runtime",
".",
"evaluate",
"(",
"\"window.isBracketsLiveDevelopmentInterstitialPageLoaded\"",
",",
"function",
"(... | 10 seconds /*
Asynchronously check to see if the interstitial page has
finished loading; if not, check again until timing out. | [
"10",
"seconds",
"/",
"*",
"Asynchronously",
"check",
"to",
"see",
"if",
"the",
"interstitial",
"page",
"has",
"finished",
"loading",
";",
"if",
"not",
"check",
"again",
"until",
"timing",
"out",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevelopment.js#L1031-L1046 | train | pollInterstitialPage - Polls the Interstitial Page | [
30522,
3853,
8554,
18447,
2545,
3775,
20925,
13704,
1006,
1007,
1063,
2065,
1006,
2562,
18155,
2989,
1004,
1004,
7742,
1012,
4198,
1006,
1007,
1007,
1063,
7742,
1012,
2448,
7292,
1012,
16157,
1006,
1000,
3332,
1012,
2003,
10024,
19869,
3215... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/relay | packages/relay-compiler/core/RelayCompilerError.js | createCombinedError | function createCombinedError(
errors: $ReadOnlyArray<UserError>,
maybePrefix?: ?string,
): CombinedUserError {
const prefix = maybePrefix != null ? `${maybePrefix}: ` : '';
return new Error(
`${prefix}Encountered ${errors.length} error(s):\n` +
errors
.map(error =>
String(error)
... | javascript | function createCombinedError(
errors: $ReadOnlyArray<UserError>,
maybePrefix?: ?string,
): CombinedUserError {
const prefix = maybePrefix != null ? `${maybePrefix}: ` : '';
return new Error(
`${prefix}Encountered ${errors.length} error(s):\n` +
errors
.map(error =>
String(error)
... | [
"function",
"createCombinedError",
"(",
"errors",
":",
"$ReadOnlyArray",
"<",
"UserError",
">",
",",
"maybePrefix",
"?",
":",
"?",
"string",
",",
")",
":",
"CombinedUserError",
"{",
"const",
"prefix",
"=",
"maybePrefix",
"!=",
"null",
"?",
"`",
"${",
"maybeP... | Merges the results of multiple user errors into one so that they
can be reported in bulk. | [
"Merges",
"the",
"results",
"of",
"multiple",
"user",
"errors",
"into",
"one",
"so",
"that",
"they",
"can",
"be",
"reported",
"in",
"bulk",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/core/RelayCompilerError.js#L104-L120 | train | Creates a combined error from an array of user errors. | [
30522,
3853,
3443,
18274,
21280,
2121,
29165,
1006,
10697,
1024,
1002,
3191,
2239,
2135,
2906,
9447,
1026,
5310,
2121,
29165,
1028,
1010,
2672,
28139,
8873,
2595,
1029,
1024,
1029,
5164,
1010,
1007,
1024,
4117,
20330,
2121,
29165,
1063,
953... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | updateVersion | function updateVersion () {
start(`Updating ${"package.json".cyan} version from ${oldVersion.cyan} to ${newVersion.cyan}...`);
pkg.version = newVersion;
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
done();
abortCmds.push('git checkout package.json');
pushCmds.push('git add p... | javascript | function updateVersion () {
start(`Updating ${"package.json".cyan} version from ${oldVersion.cyan} to ${newVersion.cyan}...`);
pkg.version = newVersion;
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
done();
abortCmds.push('git checkout package.json');
pushCmds.push('git add p... | [
"function",
"updateVersion",
"(",
")",
"{",
"start",
"(",
"`",
"${",
"\"package.json\"",
".",
"cyan",
"}",
"${",
"oldVersion",
".",
"cyan",
"}",
"${",
"newVersion",
".",
"cyan",
"}",
"`",
")",
";",
"pkg",
".",
"version",
"=",
"newVersion",
";",
"fs",
... | writes the new version to package.json | [
"writes",
"the",
"new",
"version",
"to",
"package",
".",
"json"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/release.js#L85-L92 | train | Updates the package. json version to the new version | [
30522,
3853,
10651,
27774,
1006,
1007,
1063,
2707,
1006,
1036,
2039,
16616,
1002,
1063,
1000,
7427,
1012,
1046,
3385,
1000,
1012,
22330,
2319,
1065,
2544,
2013,
1002,
1063,
2214,
27774,
1012,
22330,
2319,
1065,
2000,
1002,
1063,
2047,
27774... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/ElementTree.js | ElementTree | function ElementTree(id, instantiationOptions) {
var areInstantiationOptionsAnObject = _isObject(instantiationOptions);
var options;
/**
* Make sure that the options parameter is Object and
* that the ElementTree can be instantiate without initial options.
*/
if (areInstantiationOptionsAnObject... | javascript | function ElementTree(id, instantiationOptions) {
var areInstantiationOptionsAnObject = _isObject(instantiationOptions);
var options;
/**
* Make sure that the options parameter is Object and
* that the ElementTree can be instantiate without initial options.
*/
if (areInstantiationOptionsAnObject... | [
"function",
"ElementTree",
"(",
"id",
",",
"instantiationOptions",
")",
"{",
"var",
"areInstantiationOptionsAnObject",
"=",
"_isObject",
"(",
"instantiationOptions",
")",
";",
"var",
"options",
";",
"/**\n\t\t\t * Make sure that the options parameter is Object and\n\t\t\t * tha... | ElementTree constructor.
@param {string} id - The id of the DOM container
@param {ElementTree} instantiationOptions
@constructor | [
"ElementTree",
"constructor",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/ElementTree.js#L119-L165 | train | The ElementTree constructor. | [
30522,
3853,
5783,
13334,
1006,
8909,
1010,
7107,
18963,
7361,
9285,
1007,
1063,
13075,
2024,
7076,
5794,
10711,
3508,
7361,
9285,
6761,
2497,
20614,
1027,
1035,
11163,
2497,
20614,
1006,
7107,
18963,
7361,
9285,
1007,
1025,
13075,
7047,
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... |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onSignInWithEmailLink | function onSignInWithEmailLink() {
var email = $('#sign-in-with-email-link-email').val();
var link = $('#sign-in-with-email-link-link').val() || undefined;
if (auth.isSignInWithEmailLink(link)) {
auth.signInWithEmailLink(email, link).then(onAuthSuccess, onAuthError);
} else {
alertError('Sign in link is... | javascript | function onSignInWithEmailLink() {
var email = $('#sign-in-with-email-link-email').val();
var link = $('#sign-in-with-email-link-link').val() || undefined;
if (auth.isSignInWithEmailLink(link)) {
auth.signInWithEmailLink(email, link).then(onAuthSuccess, onAuthError);
} else {
alertError('Sign in link is... | [
"function",
"onSignInWithEmailLink",
"(",
")",
"{",
"var",
"email",
"=",
"$",
"(",
"'#sign-in-with-email-link-email'",
")",
".",
"val",
"(",
")",
";",
"var",
"link",
"=",
"$",
"(",
"'#sign-in-with-email-link-link'",
")",
".",
"val",
"(",
")",
"||",
"undefine... | Signs in a user with an email link. | [
"Signs",
"in",
"a",
"user",
"with",
"an",
"email",
"link",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L329-L337 | train | Sign in with email link | [
30522,
3853,
2006,
5332,
29076,
2078,
24415,
14545,
8591,
19839,
1006,
1007,
1063,
13075,
10373,
1027,
1002,
1006,
1005,
1001,
3696,
1011,
1999,
1011,
2007,
1011,
10373,
1011,
4957,
1011,
10373,
1005,
1007,
1012,
11748,
1006,
1007,
1025,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/AppCacheBuster.js | function() {
// remove the function interceptions
ManagedObject.prototype.validateProperty = fnValidateProperty;
// only remove xhr interception if xhr#open was not modified meanwhile
if (XMLHttpRequest.prototype.open === fnEnhancedXhrOpen) {
XMLHttpRequest.prototype.open = fnXhrOpenOrig;
}
... | javascript | function() {
// remove the function interceptions
ManagedObject.prototype.validateProperty = fnValidateProperty;
// only remove xhr interception if xhr#open was not modified meanwhile
if (XMLHttpRequest.prototype.open === fnEnhancedXhrOpen) {
XMLHttpRequest.prototype.open = fnXhrOpenOrig;
}
... | [
"function",
"(",
")",
"{",
"// remove the function interceptions",
"ManagedObject",
".",
"prototype",
".",
"validateProperty",
"=",
"fnValidateProperty",
";",
"// only remove xhr interception if xhr#open was not modified meanwhile",
"if",
"(",
"XMLHttpRequest",
".",
"prototype",
... | Terminates the AppCacheBuster and removes the hooks from the URL
specific functions. This will also clear the index which is used
to prefix matching URLs.
@private | [
"Terminates",
"the",
"AppCacheBuster",
"and",
"removes",
"the",
"hooks",
"from",
"the",
"URL",
"specific",
"functions",
".",
"This",
"will",
"also",
"clear",
"the",
"index",
"which",
"is",
"used",
"to",
"prefix",
"matching",
"URLs",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/AppCacheBuster.js#L434-L463 | train | Removes the function interceptions from the object | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
6366,
1996,
3853,
18387,
3266,
16429,
20614,
1012,
8773,
1012,
9398,
3686,
21572,
4842,
3723,
1027,
1042,
2078,
10175,
8524,
2618,
21572,
4842,
3723,
1025,
1013,
1013,
2069,
6366,
1060,
8093,
17385... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function () {
var data = this._conn._data;
// if no requests are in progress, poll
if (this._conn.authenticated && this._requests.length === 0 &&
data.length === 0 && !this._conn.disconnecting) {
Strophe.info("no requests during idle cycle, sending " +
... | javascript | function () {
var data = this._conn._data;
// if no requests are in progress, poll
if (this._conn.authenticated && this._requests.length === 0 &&
data.length === 0 && !this._conn.disconnecting) {
Strophe.info("no requests during idle cycle, sending " +
... | [
"function",
"(",
")",
"{",
"var",
"data",
"=",
"this",
".",
"_conn",
".",
"_data",
";",
"// if no requests are in progress, poll\r",
"if",
"(",
"this",
".",
"_conn",
".",
"authenticated",
"&&",
"this",
".",
"_requests",
".",
"length",
"===",
"0",
"&&",
"da... | PrivateFunction: _onIdle
_Private_ handler called by Strophe.Connection._onIdle
Sends all queued Requests or polls with empty Request if there are none. | [
"PrivateFunction",
":",
"_onIdle",
"_Private_",
"handler",
"called",
"by",
"Strophe",
".",
"Connection",
".",
"_onIdle"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L4289-L4347 | train | End of method
| [
30522,
3853,
1006,
1007,
1063,
13075,
2951,
1027,
2023,
1012,
1035,
9530,
2078,
1012,
1035,
2951,
1025,
1013,
1013,
2065,
2053,
11186,
2024,
1999,
5082,
1010,
8554,
2065,
1006,
2023,
1012,
1035,
9530,
2078,
1012,
14469,
4383,
1004,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
Dogfalo/materialize | dist/js/materialize.js | function (elements) {
for (var a = 0; a < elements.length; a++) {
var el = elements[a];
if (el.tagName.toLowerCase() === 'input') {
var parent = el.parentNode;
// If input already have parent just pass through
if (parent.tagName.toLowerCase() === 'i' && parent.class... | javascript | function (elements) {
for (var a = 0; a < elements.length; a++) {
var el = elements[a];
if (el.tagName.toLowerCase() === 'input') {
var parent = el.parentNode;
// If input already have parent just pass through
if (parent.tagName.toLowerCase() === 'i' && parent.class... | [
"function",
"(",
"elements",
")",
"{",
"for",
"(",
"var",
"a",
"=",
"0",
";",
"a",
"<",
"elements",
".",
"length",
";",
"a",
"++",
")",
"{",
"var",
"el",
"=",
"elements",
"[",
"a",
"]",
";",
"if",
"(",
"el",
".",
"tagName",
".",
"toLowerCase",
... | Little hack to make <input> can perform waves effect | [
"Little",
"hack",
"to",
"make",
"<input",
">",
"can",
"perform",
"waves",
"effect"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/dist/js/materialize.js#L4955-L4987 | train | This function is called by the waves - button - input. js | [
30522,
3853,
1006,
3787,
1007,
1063,
2005,
1006,
13075,
1037,
1027,
1014,
1025,
1037,
1026,
3787,
1012,
3091,
1025,
1037,
1009,
1009,
1007,
1063,
13075,
3449,
1027,
3787,
1031,
1037,
1033,
1025,
2065,
1006,
3449,
1012,
6415,
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... | |
adobe/brackets | src/project/ProjectManager.js | addWelcomeProjectPath | function addWelcomeProjectPath(path) {
var welcomeProjects = ProjectModel._addWelcomeProjectPath(path,
PreferencesManager.getViewState("welcomeProjects"));
PreferencesManager.setViewState("welcomeProjects", welcomeProjects);
} | javascript | function addWelcomeProjectPath(path) {
var welcomeProjects = ProjectModel._addWelcomeProjectPath(path,
PreferencesManager.getViewState("welcomeProjects"));
PreferencesManager.setViewState("welcomeProjects", welcomeProjects);
} | [
"function",
"addWelcomeProjectPath",
"(",
"path",
")",
"{",
"var",
"welcomeProjects",
"=",
"ProjectModel",
".",
"_addWelcomeProjectPath",
"(",
"path",
",",
"PreferencesManager",
".",
"getViewState",
"(",
"\"welcomeProjects\"",
")",
")",
";",
"PreferencesManager",
".",... | Adds the path to the list of welcome projects we've ever seen, if not on the list already.
@param {string} path Path to possibly add | [
"Adds",
"the",
"path",
"to",
"the",
"list",
"of",
"welcome",
"projects",
"we",
"ve",
"ever",
"seen",
"if",
"not",
"on",
"the",
"list",
"already",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L700-L704 | train | Add a path to the project model | [
30522,
3853,
5587,
8545,
22499,
4168,
21572,
20614,
15069,
1006,
4130,
1007,
1063,
13075,
6160,
21572,
20614,
2015,
1027,
2622,
5302,
9247,
1012,
1035,
5587,
8545,
22499,
4168,
21572,
20614,
15069,
1006,
4130,
1010,
18394,
24805,
4590,
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... |
necolas/react-native-web | packages/react-native-web/src/vendor/react-native/emitter/mixInEventEmitter.js | mixInEventEmitter | function mixInEventEmitter(cls: Function | Object, types: Object) {
invariant(types, 'Must supply set of valid event types');
// If this is a constructor, write to the prototype, otherwise write to the
// singleton object.
const target = cls.prototype || cls;
invariant(!target.__eventEmitter, 'An active emi... | javascript | function mixInEventEmitter(cls: Function | Object, types: Object) {
invariant(types, 'Must supply set of valid event types');
// If this is a constructor, write to the prototype, otherwise write to the
// singleton object.
const target = cls.prototype || cls;
invariant(!target.__eventEmitter, 'An active emi... | [
"function",
"mixInEventEmitter",
"(",
"cls",
":",
"Function",
"|",
"Object",
",",
"types",
":",
"Object",
")",
"{",
"invariant",
"(",
"types",
",",
"'Must supply set of valid event types'",
")",
";",
"// If this is a constructor, write to the prototype, otherwise write to t... | API to setup an object or constructor to be able to emit data events.
@example
function Dog() { ...dog stuff... }
mixInEventEmitter(Dog, {bark: true});
var puppy = new Dog();
puppy.addListener('bark', function (volume) {
console.log('Puppy', this, 'barked at volume:', volume);
});
puppy.emit('bark', 'quiet');
// Pupp... | [
"API",
"to",
"setup",
"an",
"object",
"or",
"constructor",
"to",
"be",
"able",
"to",
"emit",
"data",
"events",
"."
] | 801937748b2f3c96284bee1881164ac0c62a9c6d | https://github.com/necolas/react-native-web/blob/801937748b2f3c96284bee1881164ac0c62a9c6d/packages/react-native-web/src/vendor/react-native/emitter/mixInEventEmitter.js#L49-L76 | train | Mix in an EventEmitter into a class. | [
30522,
3853,
4666,
3170,
15338,
23238,
12079,
1006,
18856,
2015,
1024,
3853,
1064,
4874,
1010,
4127,
1024,
4874,
1007,
1063,
23915,
1006,
4127,
1010,
1005,
2442,
4425,
2275,
1997,
9398,
2724,
4127,
1005,
1007,
1025,
1013,
1013,
2065,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | grunt/config/aliases.js | function(mode) {
if (!mode || (mode !== 'src' && mode !== 'target')) {
mode = 'src';
}
grunt.option('port', 0); // use random port
// listen to the connect server startup
grunt.event.on('connect.*.listening', function(hostname, port) {
// 0.0.0.0 does not work in windows
if (hostname === ... | javascript | function(mode) {
if (!mode || (mode !== 'src' && mode !== 'target')) {
mode = 'src';
}
grunt.option('port', 0); // use random port
// listen to the connect server startup
grunt.event.on('connect.*.listening', function(hostname, port) {
// 0.0.0.0 does not work in windows
if (hostname === ... | [
"function",
"(",
"mode",
")",
"{",
"if",
"(",
"!",
"mode",
"||",
"(",
"mode",
"!==",
"'src'",
"&&",
"mode",
"!==",
"'target'",
")",
")",
"{",
"mode",
"=",
"'src'",
";",
"}",
"grunt",
".",
"option",
"(",
"'port'",
",",
"0",
")",
";",
"// use rando... | QUnit test task | [
"QUnit",
"test",
"task"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/grunt/config/aliases.js#L41-L69 | train | set the mode of the connect server | [
30522,
3853,
1006,
5549,
1007,
1063,
2065,
1006,
999,
5549,
1064,
1064,
1006,
5549,
999,
1027,
1027,
30524,
999,
1027,
1027,
1005,
4539,
1005,
1007,
1007,
1063,
5549,
1027,
1005,
5034,
2278,
1005,
1025,
1065,
20696,
1012,
5724,
1006,
1005... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jquery/jquery | build/release/cdn.js | makeReleaseCopies | function makeReleaseCopies( Release ) {
shell.mkdir( "-p", cdnFolder );
Object.keys( releaseFiles ).forEach( function( key ) {
var text,
builtFile = releaseFiles[ key ],
unpathedFile = key.replace( /VER/g, Release.newVersion ),
releaseFile = cdnFolder + "/" + unpathedFile;
if ( /\.map$/.test( releaseFi... | javascript | function makeReleaseCopies( Release ) {
shell.mkdir( "-p", cdnFolder );
Object.keys( releaseFiles ).forEach( function( key ) {
var text,
builtFile = releaseFiles[ key ],
unpathedFile = key.replace( /VER/g, Release.newVersion ),
releaseFile = cdnFolder + "/" + unpathedFile;
if ( /\.map$/.test( releaseFi... | [
"function",
"makeReleaseCopies",
"(",
"Release",
")",
"{",
"shell",
".",
"mkdir",
"(",
"\"-p\"",
",",
"cdnFolder",
")",
";",
"Object",
".",
"keys",
"(",
"releaseFiles",
")",
".",
"forEach",
"(",
"function",
"(",
"key",
")",
"{",
"var",
"text",
",",
"bu... | Generates copies for the CDNs | [
"Generates",
"copies",
"for",
"the",
"CDNs"
] | ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3 | https://github.com/jquery/jquery/blob/ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3/build/release/cdn.js#L30-L54 | train | Copies the files from the built file to the new release file | [
30522,
3853,
9338,
12260,
11022,
3597,
13046,
1006,
2713,
1007,
1063,
5806,
1012,
12395,
4305,
2099,
1006,
1000,
1011,
1052,
1000,
1010,
3729,
2078,
10371,
2121,
1007,
1025,
4874,
1012,
6309,
1006,
2713,
8873,
4244,
1007,
1012,
18921,
6776,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
google/material-design-lite | src/mdlComponentHandler.js | upgradeAllRegisteredInternal | function upgradeAllRegisteredInternal() {
for (var n = 0; n < registeredComponents_.length; n++) {
upgradeDomInternal(registeredComponents_[n].className);
}
} | javascript | function upgradeAllRegisteredInternal() {
for (var n = 0; n < registeredComponents_.length; n++) {
upgradeDomInternal(registeredComponents_[n].className);
}
} | [
"function",
"upgradeAllRegisteredInternal",
"(",
")",
"{",
"for",
"(",
"var",
"n",
"=",
"0",
";",
"n",
"<",
"registeredComponents_",
".",
"length",
";",
"n",
"++",
")",
"{",
"upgradeDomInternal",
"(",
"registeredComponents_",
"[",
"n",
"]",
".",
"className",... | Upgrades all registered components found in the current DOM. This is
automatically called on window load. | [
"Upgrades",
"all",
"registered",
"components",
"found",
"in",
"the",
"current",
"DOM",
".",
"This",
"is",
"automatically",
"called",
"on",
"window",
"load",
"."
] | 60f441a22ed98ed2c03f6179adf460d888bf459f | https://github.com/google/material-design-lite/blob/60f441a22ed98ed2c03f6179adf460d888bf459f/src/mdlComponentHandler.js#L357-L361 | train | Upgrades all registered components | [
30522,
3853,
12200,
8095,
2890,
24063,
6850,
18447,
11795,
2389,
1006,
1007,
1063,
2005,
1006,
13075,
1050,
1027,
1014,
1025,
1050,
1026,
5068,
9006,
29513,
7666,
1035,
1012,
3091,
1025,
1050,
1009,
1009,
1007,
1063,
9725,
20936,
10111,
127... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | defineDagExtremity | function defineDagExtremity(params) {
return function dagExtremityImpl(selector) {
var eles = this;
var ret = [];
for (var i = 0; i < eles.length; i++) {
var ele = eles[i];
if (!ele.isNode()) {
continue;
}
var disqualified = false;
var edges = ele.connectedEdges();... | javascript | function defineDagExtremity(params) {
return function dagExtremityImpl(selector) {
var eles = this;
var ret = [];
for (var i = 0; i < eles.length; i++) {
var ele = eles[i];
if (!ele.isNode()) {
continue;
}
var disqualified = false;
var edges = ele.connectedEdges();... | [
"function",
"defineDagExtremity",
"(",
"params",
")",
"{",
"return",
"function",
"dagExtremityImpl",
"(",
"selector",
")",
"{",
"var",
"eles",
"=",
"this",
";",
"var",
"ret",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"eles"... | DAG functions ////////////// | [
"DAG",
"functions",
"//////////////"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L11359-L11394 | train | defineDagExtremity - Returns a function that will return an array of nodes that are not connected to the nodes in the graph. | [
30522,
3853,
4225,
4270,
18413,
28578,
3012,
1006,
11498,
5244,
1007,
1063,
2709,
3853,
4830,
3351,
18413,
28578,
3012,
5714,
24759,
1006,
27000,
1007,
1063,
13075,
3449,
2229,
1027,
2023,
1025,
13075,
2128,
2102,
1027,
1031,
1033,
1025,
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... |
BrainJS/brain.js | dist/recurrent/matrix/multiply-b.js | multiplyB | function multiplyB(product, left, right) {
var leftRows = left.rows;
var leftColumns = left.columns;
var rightColumns = right.columns;
// loop over rows of left
for (var leftRow = 0; leftRow < leftRows; leftRow++) {
var leftRowBase = leftColumns * leftRow;
var rightRowBase = rightColumns * leftRow;
... | javascript | function multiplyB(product, left, right) {
var leftRows = left.rows;
var leftColumns = left.columns;
var rightColumns = right.columns;
// loop over rows of left
for (var leftRow = 0; leftRow < leftRows; leftRow++) {
var leftRowBase = leftColumns * leftRow;
var rightRowBase = rightColumns * leftRow;
... | [
"function",
"multiplyB",
"(",
"product",
",",
"left",
",",
"right",
")",
"{",
"var",
"leftRows",
"=",
"left",
".",
"rows",
";",
"var",
"leftColumns",
"=",
"left",
".",
"columns",
";",
"var",
"rightColumns",
"=",
"right",
".",
"columns",
";",
"// loop ove... | multiplies {from} deltas to {left} and {right}
@param {Matrix} product
@param {Matrix} left
@param {Matrix} right | [
"multiplies",
"{",
"from",
"}",
"deltas",
"to",
"{",
"left",
"}",
"and",
"{",
"right",
"}"
] | ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef | https://github.com/BrainJS/brain.js/blob/ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef/dist/recurrent/matrix/multiply-b.js#L13-L36 | train | multiply B product | [
30522,
3853,
4800,
22086,
2497,
1006,
4031,
1010,
2187,
1010,
2157,
1007,
1063,
13075,
2187,
10524,
2015,
1027,
2187,
1012,
10281,
1025,
13075,
2187,
25778,
2819,
3619,
1027,
2187,
1012,
7753,
1025,
13075,
2157,
25778,
2819,
3619,
1027,
215... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/array-element-newline.js | check | function check(node) {
const elements = node.elements;
const normalizedOptions = normalizeOptions(context.options[0]);
const options = normalizedOptions[node.type];
let elementBreak = false;
/*
* MULTILINE: true
* loop through every... | javascript | function check(node) {
const elements = node.elements;
const normalizedOptions = normalizeOptions(context.options[0]);
const options = normalizedOptions[node.type];
let elementBreak = false;
/*
* MULTILINE: true
* loop through every... | [
"function",
"check",
"(",
"node",
")",
"{",
"const",
"elements",
"=",
"node",
".",
"elements",
";",
"const",
"normalizedOptions",
"=",
"normalizeOptions",
"(",
"context",
".",
"options",
"[",
"0",
"]",
")",
";",
"const",
"options",
"=",
"normalizedOptions",
... | Reports a given node if it violated this rule.
@param {ASTNode} node - A node to check. This is an ObjectExpression node or an ObjectPattern node.
@returns {void} | [
"Reports",
"a",
"given",
"node",
"if",
"it",
"violated",
"this",
"rule",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/array-element-newline.js#L178-L251 | train | Check if node has linebreaks | [
30522,
3853,
4638,
1006,
13045,
1007,
1063,
9530,
3367,
3787,
1027,
13045,
1012,
3787,
1025,
9530,
3367,
3671,
3550,
7361,
9285,
1027,
3671,
4697,
7361,
9285,
1006,
6123,
1012,
7047,
1031,
1014,
1033,
1007,
1025,
9530,
3367,
7047,
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... |
openlayers/openlayers | src/ol/interaction/Modify.js | closestOnSegmentData | function closestOnSegmentData(pointCoordinates, segmentData) {
const geometry = segmentData.geometry;
if (geometry.getType() === GeometryType.CIRCLE &&
segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {
return geometry.getClosestPoint(pointCoordinates);
}
return closestOnSegment(pointCoordinates, segmen... | javascript | function closestOnSegmentData(pointCoordinates, segmentData) {
const geometry = segmentData.geometry;
if (geometry.getType() === GeometryType.CIRCLE &&
segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {
return geometry.getClosestPoint(pointCoordinates);
}
return closestOnSegment(pointCoordinates, segmen... | [
"function",
"closestOnSegmentData",
"(",
"pointCoordinates",
",",
"segmentData",
")",
"{",
"const",
"geometry",
"=",
"segmentData",
".",
"geometry",
";",
"if",
"(",
"geometry",
".",
"getType",
"(",
")",
"===",
"GeometryType",
".",
"CIRCLE",
"&&",
"segmentData",
... | Returns the point closest to a given line segment.
@param {import("../coordinate.js").Coordinate} pointCoordinates The point to which a closest point
should be found.
@param {SegmentData} segmentData The object describing the line
segment which should contain the closest point.
@return {import("../coordinate.js").Coor... | [
"Returns",
"the",
"point",
"closest",
"to",
"a",
"given",
"line",
"segment",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/interaction/Modify.js#L1228-L1236 | train | Returns the closest point on the given segmentData | [
30522,
3853,
7541,
5644,
13910,
3672,
2850,
2696,
1006,
2391,
3597,
8551,
28184,
1010,
6903,
2850,
2696,
1007,
1063,
9530,
3367,
10988,
1027,
6903,
2850,
2696,
1012,
10988,
1025,
2065,
1006,
10988,
1012,
2131,
13874,
1006,
1007,
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... |
grpc/grpc-node | packages/grpc-native-core/src/client.js | Client | function Client(address, credentials, options) {
var self = this;
if (!options) {
options = {};
}
// Resolve interceptor options and assign interceptors to each method
if (Array.isArray(options.interceptor_providers) && Array.isArray(options.interceptors)) {
throw new client_interceptors.InterceptorC... | javascript | function Client(address, credentials, options) {
var self = this;
if (!options) {
options = {};
}
// Resolve interceptor options and assign interceptors to each method
if (Array.isArray(options.interceptor_providers) && Array.isArray(options.interceptors)) {
throw new client_interceptors.InterceptorC... | [
"function",
"Client",
"(",
"address",
",",
"credentials",
",",
"options",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"options",
")",
"{",
"options",
"=",
"{",
"}",
";",
"}",
"// Resolve interceptor options and assign interceptors to each method",... | Options that can be set on a call.
@typedef {Object} grpc.Client~CallOptions
@property {grpc~Deadline} deadline The deadline for the entire call to
complete.
@property {string} host Server hostname to set on the call. Only meaningful
if different from the server address used to construct the client.
@property {grpc.Cli... | [
"Options",
"that",
"can",
"be",
"set",
"on",
"a",
"call",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/client.js#L365-L415 | train | Creates a new client | [
30522,
3853,
7396,
1006,
4769,
1010,
22496,
1010,
7047,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2065,
1006,
999,
7047,
1007,
1063,
7047,
1027,
1063,
1065,
1025,
1065,
1013,
1013,
10663,
24727,
7047,
1998,
23911,
24727,
2015,
2000,
2169,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/relay | packages/relay-runtime/network/ConvertToExecuteFunction.js | convertSubscribe | function convertSubscribe(fn: SubscribeFunction): ExecuteFunction {
return function subscribe(operation, variables, cacheConfig) {
return RelayObservable.fromLegacy(observer =>
fn(operation, variables, cacheConfig, observer),
);
};
} | javascript | function convertSubscribe(fn: SubscribeFunction): ExecuteFunction {
return function subscribe(operation, variables, cacheConfig) {
return RelayObservable.fromLegacy(observer =>
fn(operation, variables, cacheConfig, observer),
);
};
} | [
"function",
"convertSubscribe",
"(",
"fn",
":",
"SubscribeFunction",
")",
":",
"ExecuteFunction",
"{",
"return",
"function",
"subscribe",
"(",
"operation",
",",
"variables",
",",
"cacheConfig",
")",
"{",
"return",
"RelayObservable",
".",
"fromLegacy",
"(",
"observ... | Converts a SubscribeFunction into an ExecuteFunction for use by RelayNetwork. | [
"Converts",
"a",
"SubscribeFunction",
"into",
"an",
"ExecuteFunction",
"for",
"use",
"by",
"RelayNetwork",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-runtime/network/ConvertToExecuteFunction.js#L40-L46 | train | Convert SubscribeFunction to RelayObservable | [
30522,
3853,
19884,
12083,
29234,
1006,
1042,
2078,
1024,
4942,
29234,
11263,
27989,
1007,
1024,
15389,
11263,
27989,
1063,
2709,
3853,
4942,
29234,
1006,
3169,
1010,
10857,
1010,
17053,
8663,
8873,
2290,
1007,
1063,
2709,
8846,
16429,
8043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/core/utils/rule-should-run.js | matchTags | function matchTags(rule, runOnly) {
'use strict';
var include, exclude, matching;
var defaultExclude =
axe._audit && axe._audit.tagExclude ? axe._audit.tagExclude : [];
// normalize include/exclude
if (runOnly.hasOwnProperty('include') || runOnly.hasOwnProperty('exclude')) {
// Wrap include and exclude if it'... | javascript | function matchTags(rule, runOnly) {
'use strict';
var include, exclude, matching;
var defaultExclude =
axe._audit && axe._audit.tagExclude ? axe._audit.tagExclude : [];
// normalize include/exclude
if (runOnly.hasOwnProperty('include') || runOnly.hasOwnProperty('exclude')) {
// Wrap include and exclude if it'... | [
"function",
"matchTags",
"(",
"rule",
",",
"runOnly",
")",
"{",
"'use strict'",
";",
"var",
"include",
",",
"exclude",
",",
"matching",
";",
"var",
"defaultExclude",
"=",
"axe",
".",
"_audit",
"&&",
"axe",
".",
"_audit",
".",
"tagExclude",
"?",
"axe",
".... | Check if a rule matches the value of runOnly type=tag
@private
@param {object} rule
@param {object} runOnly Value of runOnly with type=tags
@return {bool} | [
"Check",
"if",
"a",
"rule",
"matches",
"the",
"value",
"of",
"runOnly",
"type",
"=",
"tag"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/rule-should-run.js#L8-L48 | train | Match the tags in the rule | [
30522,
3853,
2674,
15900,
2015,
1006,
3627,
1010,
2448,
2239,
2135,
1007,
1063,
1005,
2224,
9384,
1005,
1025,
13075,
2421,
1010,
23329,
1010,
9844,
1025,
13075,
12398,
10288,
20464,
12672,
1027,
12946,
1012,
1035,
15727,
1004,
1004,
12946,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/core/utils/preload-cssom.js | getCssomForAllRootNodes | function getCssomForAllRootNodes(rootNodes, convertDataToStylesheet, timeout) {
const q = axe.utils.queue();
rootNodes.forEach(({ rootNode, shadowId }, index) =>
q.defer((resolve, reject) =>
loadCssom({
rootNode,
shadowId,
timeout,
convertDataToStylesheet,
rootIndex: index + 1
})
.the... | javascript | function getCssomForAllRootNodes(rootNodes, convertDataToStylesheet, timeout) {
const q = axe.utils.queue();
rootNodes.forEach(({ rootNode, shadowId }, index) =>
q.defer((resolve, reject) =>
loadCssom({
rootNode,
shadowId,
timeout,
convertDataToStylesheet,
rootIndex: index + 1
})
.the... | [
"function",
"getCssomForAllRootNodes",
"(",
"rootNodes",
",",
"convertDataToStylesheet",
",",
"timeout",
")",
"{",
"const",
"q",
"=",
"axe",
".",
"utils",
".",
"queue",
"(",
")",
";",
"rootNodes",
".",
"forEach",
"(",
"(",
"{",
"rootNode",
",",
"shadowId",
... | Deferred function for CSSOM queue processing on all root nodes
@param {Array<Object>} rootNodes array of root nodes, where node is an enhanced `document` or `documentFragment` object returned from `getAllRootNodesInTree`
@param {Function} convertDataToStylesheet fn to convert given data to Stylesheet object
@returns ... | [
"Deferred",
"function",
"for",
"CSSOM",
"queue",
"processing",
"on",
"all",
"root",
"nodes"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/preload-cssom.js#L123-L141 | train | Get the cssom for all root nodes | [
30522,
3853,
2131,
6169,
25426,
29278,
8095,
3217,
4140,
3630,
6155,
1006,
7117,
3630,
6155,
1010,
10463,
2850,
29336,
14122,
26274,
21030,
2102,
1010,
2051,
5833,
1007,
1063,
9530,
3367,
1053,
1027,
12946,
1012,
21183,
12146,
1012,
24240,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wuchangming/spy-debugger | buildin_modules/weinre/web/interfaces/interfaces.js | getJavaParameterListSimple | function getJavaParameterListSimple(parameters, returnType) {
var result = []
result.push("<span class='type'>Channel</span> <span class='parameterName'>channel</span>")
parameters.forEach(function(parameter){
if (parameter.out) return
result.push("<span class='type'>" + getJavaType(parame... | javascript | function getJavaParameterListSimple(parameters, returnType) {
var result = []
result.push("<span class='type'>Channel</span> <span class='parameterName'>channel</span>")
parameters.forEach(function(parameter){
if (parameter.out) return
result.push("<span class='type'>" + getJavaType(parame... | [
"function",
"getJavaParameterListSimple",
"(",
"parameters",
",",
"returnType",
")",
"{",
"var",
"result",
"=",
"[",
"]",
"result",
".",
"push",
"(",
"\"<span class='type'>Channel</span> <span class='parameterName'>channel</span>\"",
")",
"parameters",
".",
"forEach",
"("... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/interfaces/interfaces.js#L390-L402 | train | getJavaParameterListSimple - returns a list of parameters | [
30522,
3853,
2131,
3900,
3567,
28689,
22828,
27103,
5714,
10814,
1006,
11709,
1010,
2709,
13874,
1007,
1063,
13075,
2765,
1027,
1031,
1033,
2765,
1012,
5245,
1006,
1000,
1026,
8487,
2465,
1027,
1005,
2828,
1005,
1028,
3149,
1026,
1013,
8487... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.unified/src/sap/ui/unified/CalendarRow.js | _calculateStartDate | function _calculateStartDate(oDate) {
var sIntervalType = this.getIntervalType();
var oUTCStartDate = CalendarUtils._createUniversalUTCDate(oDate, undefined, true);
switch (sIntervalType) {
case CalendarIntervalType.Hour:
oUTCStartDate.setUTCMinutes(0);
oUTCStartDate.setUTCSeconds(0);
oUTCStartDate.s... | javascript | function _calculateStartDate(oDate) {
var sIntervalType = this.getIntervalType();
var oUTCStartDate = CalendarUtils._createUniversalUTCDate(oDate, undefined, true);
switch (sIntervalType) {
case CalendarIntervalType.Hour:
oUTCStartDate.setUTCMinutes(0);
oUTCStartDate.setUTCSeconds(0);
oUTCStartDate.s... | [
"function",
"_calculateStartDate",
"(",
"oDate",
")",
"{",
"var",
"sIntervalType",
"=",
"this",
".",
"getIntervalType",
"(",
")",
";",
"var",
"oUTCStartDate",
"=",
"CalendarUtils",
".",
"_createUniversalUTCDate",
"(",
"oDate",
",",
"undefined",
",",
"true",
")",... | /*
@param {object} oDate JavaScript date object
@returns {UniversalDate} Start date for date object | [
"/",
"*"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.unified/src/sap/ui/unified/CalendarRow.js#L1039-L1074 | train | Calculates the start date of the specified date. | [
30522,
3853,
1035,
18422,
14117,
2102,
13701,
1006,
1051,
13701,
1007,
1063,
13075,
8254,
3334,
10175,
13874,
1027,
2023,
1012,
2131,
18447,
2121,
10175,
13874,
1006,
1007,
1025,
13075,
2041,
6169,
7559,
2102,
13701,
1027,
8094,
21823,
4877,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Component.js | addSapParams | function addSapParams(oUri) {
['sap-client', 'sap-server'].forEach(function(sName) {
if (!oUri.hasSearch(sName)) {
var sValue = sap.ui.getCore().getConfiguration().getSAPParam(sName);
if (sValue) {
oUri.addSearch(sName, sValue);
}
}
});
} | javascript | function addSapParams(oUri) {
['sap-client', 'sap-server'].forEach(function(sName) {
if (!oUri.hasSearch(sName)) {
var sValue = sap.ui.getCore().getConfiguration().getSAPParam(sName);
if (sValue) {
oUri.addSearch(sName, sValue);
}
}
});
} | [
"function",
"addSapParams",
"(",
"oUri",
")",
"{",
"[",
"'sap-client'",
",",
"'sap-server'",
"]",
".",
"forEach",
"(",
"function",
"(",
"sName",
")",
"{",
"if",
"(",
"!",
"oUri",
".",
"hasSearch",
"(",
"sName",
")",
")",
"{",
"var",
"sValue",
"=",
"s... | Utility function which adds SAP-specific parameters to a URI instance
@param {URI} oUri URI.js instance
@private | [
"Utility",
"function",
"which",
"adds",
"SAP",
"-",
"specific",
"parameters",
"to",
"a",
"URI",
"instance"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Component.js#L56-L65 | train | Adds the parameters of the sap - client sap - server to the URI | [
30522,
3853,
9909,
29098,
5400,
5244,
1006,
2256,
2072,
1007,
1063,
1031,
1005,
20066,
1011,
7396,
1005,
1010,
1005,
20066,
1011,
8241,
1005,
1033,
1012,
18921,
6776,
1006,
3853,
1006,
1055,
18442,
1007,
1063,
2065,
1006,
999,
2256,
2072,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/MDNDocs/main.js | inlineProvider | function inlineProvider(hostEditor, pos) {
var jsonFile, propInfo,
propQueue = [], // priority queue of propNames to try
langId = hostEditor.getLanguageForSelection().getId(),
supportedLangs = {
"css": true,
"scss": true,
"less"... | javascript | function inlineProvider(hostEditor, pos) {
var jsonFile, propInfo,
propQueue = [], // priority queue of propNames to try
langId = hostEditor.getLanguageForSelection().getId(),
supportedLangs = {
"css": true,
"scss": true,
"less"... | [
"function",
"inlineProvider",
"(",
"hostEditor",
",",
"pos",
")",
"{",
"var",
"jsonFile",
",",
"propInfo",
",",
"propQueue",
"=",
"[",
"]",
",",
"// priority queue of propNames to try",
"langId",
"=",
"hostEditor",
".",
"getLanguageForSelection",
"(",
")",
".",
... | Inline docs provider.
@param {!Editor} editor
@param {!{line:Number, ch:Number}} pos
@return {?$.Promise} resolved with an InlineWidget; null if we're not going to provide anything | [
"Inline",
"docs",
"provider",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/MDNDocs/main.js#L89-L176 | train | inlineProvider - Function to provide inline docs | [
30522,
3853,
23881,
21572,
17258,
2121,
1006,
4354,
15660,
1010,
13433,
2015,
1007,
1063,
13075,
1046,
3385,
8873,
2571,
1010,
17678,
2378,
14876,
1010,
17678,
4226,
5657,
1027,
1031,
1033,
1010,
1013,
1013,
9470,
24240,
1997,
17678,
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... |
adobe/brackets | src/project/SidebarView.js | _updateWorkingSetState | function _updateWorkingSetState() {
if (MainViewManager.getPaneCount() === 1 &&
MainViewManager.getWorkingSetSize(MainViewManager.ACTIVE_PANE) === 0) {
$workingSetViewsContainer.hide();
$gearMenu.hide();
} else {
$workingSetViewsContainer.show();
... | javascript | function _updateWorkingSetState() {
if (MainViewManager.getPaneCount() === 1 &&
MainViewManager.getWorkingSetSize(MainViewManager.ACTIVE_PANE) === 0) {
$workingSetViewsContainer.hide();
$gearMenu.hide();
} else {
$workingSetViewsContainer.show();
... | [
"function",
"_updateWorkingSetState",
"(",
")",
"{",
"if",
"(",
"MainViewManager",
".",
"getPaneCount",
"(",
")",
"===",
"1",
"&&",
"MainViewManager",
".",
"getWorkingSetSize",
"(",
"MainViewManager",
".",
"ACTIVE_PANE",
")",
"===",
"0",
")",
"{",
"$workingSetVi... | Update state of working set
@private | [
"Update",
"state",
"of",
"working",
"set"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/SidebarView.js#L115-L124 | train | update working set state | [
30522,
3853,
1035,
10651,
21398,
13462,
9153,
2618,
1006,
1007,
1063,
2065,
1006,
2364,
8584,
24805,
4590,
1012,
2131,
9739,
8586,
21723,
1006,
1007,
1027,
1027,
1027,
1015,
1004,
1004,
2364,
8584,
24805,
4590,
1012,
2131,
21398,
13462,
533... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
elastic/elasticsearch-js | api/api/cat.tasks.js | buildCatTasks | function buildCatTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [cat.tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
*
* @param {string} format - a short versio... | javascript | function buildCatTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [cat.tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
*
* @param {string} format - a short versio... | [
"function",
"buildCatTasks",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [cat.tasks](http://www.elastic.co/guide/en/... | /* eslint camelcase: 0 /* eslint no-unused-vars: 0 | [
"/",
"*",
"eslint",
"camelcase",
":",
"0",
"/",
"*",
"eslint",
"no",
"-",
"unused",
"-",
"vars",
":",
"0"
] | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/api/cat.tasks.js#L25-L118 | train | Build a function that can be used to get task information from the cluster | [
30522,
3853,
3857,
11266,
10230,
5705,
1006,
23569,
2015,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2279,
1011,
2240,
2053,
1011,
15171,
1011,
13075,
2015,
9530,
3367,
1063,
9338,
2063,
15500,
1010,
9563,
2121,
2916... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cypress-io/cypress | cli/lib/errors.js | formErrorText | function formErrorText (info, msg) {
const hr = '----------'
return addPlatformInformation(info)
.then((obj) => {
const formatted = []
function add (msg) {
formatted.push(
stripIndents(msg)
)
}
add(`
${obj.description}
${obj.solution}
`)
if (msg) {
... | javascript | function formErrorText (info, msg) {
const hr = '----------'
return addPlatformInformation(info)
.then((obj) => {
const formatted = []
function add (msg) {
formatted.push(
stripIndents(msg)
)
}
add(`
${obj.description}
${obj.solution}
`)
if (msg) {
... | [
"function",
"formErrorText",
"(",
"info",
",",
"msg",
")",
"{",
"const",
"hr",
"=",
"'----------'",
"return",
"addPlatformInformation",
"(",
"info",
")",
".",
"then",
"(",
"(",
"obj",
")",
"=>",
"{",
"const",
"formatted",
"=",
"[",
"]",
"function",
"add"... | Forms nice error message with error and platform information,
and if possible a way to solve it. Resolves with a string. | [
"Forms",
"nice",
"error",
"message",
"with",
"error",
"and",
"platform",
"information",
"and",
"if",
"possible",
"a",
"way",
"to",
"solve",
"it",
".",
"Resolves",
"with",
"a",
"string",
"."
] | bf1a942944f0e99684ff7fe0e18314332e46f83e | https://github.com/cypress-io/cypress/blob/bf1a942944f0e99684ff7fe0e18314332e46f83e/cli/lib/errors.js#L195-L241 | train | Form error text | [
30522,
3853,
2280,
29165,
18209,
1006,
18558,
1010,
5796,
2290,
1007,
1063,
9530,
3367,
17850,
1027,
1005,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1005,
2709,
5587,
24759,
4017,
14192,
2378,
14192,
3370,
1006,
18558,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/type/TimeOfDay.js | setConstraints | function setConstraints(oType, oConstraints) {
var vNullable,
vPrecision;
oType.oConstraints = undefined;
if (oConstraints) {
vNullable = oConstraints.nullable;
vPrecision = oConstraints.precision;
// "true" and "false" not allowed here, because in V4 they are never sent as string
if (vNullable ==... | javascript | function setConstraints(oType, oConstraints) {
var vNullable,
vPrecision;
oType.oConstraints = undefined;
if (oConstraints) {
vNullable = oConstraints.nullable;
vPrecision = oConstraints.precision;
// "true" and "false" not allowed here, because in V4 they are never sent as string
if (vNullable ==... | [
"function",
"setConstraints",
"(",
"oType",
",",
"oConstraints",
")",
"{",
"var",
"vNullable",
",",
"vPrecision",
";",
"oType",
".",
"oConstraints",
"=",
"undefined",
";",
"if",
"(",
"oConstraints",
")",
"{",
"vNullable",
"=",
"oConstraints",
".",
"nullable",
... | /*
Sets the constraints. Logs a warning and uses the constraint's default value, if an invalid
value is given.
@param {sap.ui.model.odata.type.TimeOfDay} oType
The type
@param {object} [oConstraints]
The constraints
@param {boolean} [oConstraints.nullable=true]
If <code>true</code>, the value <code>null</code> is vali... | [
"/",
"*",
"Sets",
"the",
"constraints",
".",
"Logs",
"a",
"warning",
"and",
"uses",
"the",
"constraint",
"s",
"default",
"value",
"if",
"an",
"invalid",
"value",
"is",
"given",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/TimeOfDay.js#L86-L107 | train | Sets constraints for the given type | [
30522,
3853,
2275,
8663,
20528,
18447,
2015,
1006,
27178,
18863,
1010,
1051,
8663,
20528,
18447,
2015,
1007,
1063,
13075,
1058,
11231,
4571,
3468,
1010,
21210,
2890,
28472,
1025,
27178,
18863,
1012,
1051,
8663,
20528,
18447,
2015,
1027,
6151,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GeekyAnts/vue-native-core | dist/vue.runtime.common.js | setScope | function setScope (vnode) {
var i;
var ancestor = vnode;
while (ancestor) {
if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
nodeOps.setAttribute(vnode.elm, i, '');
}
ancestor = ancestor.parent;
}
// for slot content they should also get the scopeId from... | javascript | function setScope (vnode) {
var i;
var ancestor = vnode;
while (ancestor) {
if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
nodeOps.setAttribute(vnode.elm, i, '');
}
ancestor = ancestor.parent;
}
// for slot content they should also get the scopeId from... | [
"function",
"setScope",
"(",
"vnode",
")",
"{",
"var",
"i",
";",
"var",
"ancestor",
"=",
"vnode",
";",
"while",
"(",
"ancestor",
")",
"{",
"if",
"(",
"isDef",
"(",
"i",
"=",
"ancestor",
".",
"context",
")",
"&&",
"isDef",
"(",
"i",
"=",
"i",
".",... | set scope id attribute for scoped CSS. this is implemented as a special case to avoid the overhead of going through the normal attribute patching process. | [
"set",
"scope",
"id",
"attribute",
"for",
"scoped",
"CSS",
".",
"this",
"is",
"implemented",
"as",
"a",
"special",
"case",
"to",
"avoid",
"the",
"overhead",
"of",
"going",
"through",
"the",
"normal",
"attribute",
"patching",
"process",
"."
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/dist/vue.runtime.common.js#L4519-L4534 | train | set the scope of the vnode | [
30522,
3853,
4520,
16186,
1006,
1058,
3630,
3207,
1007,
1063,
13075,
1045,
1025,
13075,
13032,
1027,
1058,
3630,
3207,
1025,
2096,
1006,
13032,
1007,
1063,
2065,
1006,
2003,
3207,
2546,
1006,
1045,
1027,
13032,
1012,
6123,
1007,
1004,
1004,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tgriesser/knex | src/query/builder.js | Builder | function Builder(client) {
this.client = client;
this.and = this;
this._single = {};
this._statements = [];
this._method = 'select';
if (client.config) {
saveAsyncStack(this, 5);
this._debug = client.config.debug;
}
// Internal flags used in the builder.
this._joinFlag = 'inner';
this._boolF... | javascript | function Builder(client) {
this.client = client;
this.and = this;
this._single = {};
this._statements = [];
this._method = 'select';
if (client.config) {
saveAsyncStack(this, 5);
this._debug = client.config.debug;
}
// Internal flags used in the builder.
this._joinFlag = 'inner';
this._boolF... | [
"function",
"Builder",
"(",
"client",
")",
"{",
"this",
".",
"client",
"=",
"client",
";",
"this",
".",
"and",
"=",
"this",
";",
"this",
".",
"_single",
"=",
"{",
"}",
";",
"this",
".",
"_statements",
"=",
"[",
"]",
";",
"this",
".",
"_method",
"... | Typically called from `knex.builder`, start a new query building chain. | [
"Typically",
"called",
"from",
"knex",
".",
"builder",
"start",
"a",
"new",
"query",
"building",
"chain",
"."
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/query/builder.js#L30-L45 | train | A builder for a query. | [
30522,
3853,
12508,
1006,
7396,
1007,
1063,
2023,
1012,
7396,
1027,
7396,
1025,
2023,
1012,
1998,
1027,
2023,
1025,
2023,
1012,
1035,
2309,
1027,
1063,
1065,
1025,
2023,
1012,
1035,
8635,
1027,
1031,
1033,
1025,
2023,
1012,
1035,
4118,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/DemoApps.controller.js | function (oEvent) {
var oSelectedItem = oEvent.getParameters().selectedItem,
oListItem = oSelectedItem ? oSelectedItem : oEvent.getSource().getParent();
this._oDownloadButton.setBusy(true);
sap.ui.require([
"sap/ui/core/util/File",
"sap/ui/thirdparty/jszip"
], function (File, JSZip) {
... | javascript | function (oEvent) {
var oSelectedItem = oEvent.getParameters().selectedItem,
oListItem = oSelectedItem ? oSelectedItem : oEvent.getSource().getParent();
this._oDownloadButton.setBusy(true);
sap.ui.require([
"sap/ui/core/util/File",
"sap/ui/thirdparty/jszip"
], function (File, JSZip) {
... | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"oSelectedItem",
"=",
"oEvent",
".",
"getParameters",
"(",
")",
".",
"selectedItem",
",",
"oListItem",
"=",
"oSelectedItem",
"?",
"oSelectedItem",
":",
"oEvent",
".",
"getSource",
"(",
")",
".",
"getParent",
"(",
... | Downloads a demo app
@param {sap.ui.base.Event} oEvent the Button press event
@public | [
"Downloads",
"a",
"demo",
"app"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/DemoApps.controller.js#L193-L259 | train | Downloads the file from the list item | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
9808,
12260,
10985,
4221,
2213,
1027,
1051,
18697,
3372,
1012,
2131,
28689,
22828,
2015,
1006,
1007,
1012,
3479,
4221,
2213,
1010,
19330,
2923,
4221,
2213,
1027,
9808,
12260,
10985,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
shipshapecode/shepherd | src/js/utils/bind.js | _setupAdvanceOnHandler | function _setupAdvanceOnHandler(selector) {
return (event) => {
if (this.isOpen()) {
const targetIsEl = this.el && event.target === this.el;
const targetIsSelector = !isUndefined(selector) && event.target.matches(selector);
if (targetIsSelector || targetIsEl) {
this.tour.next();
}... | javascript | function _setupAdvanceOnHandler(selector) {
return (event) => {
if (this.isOpen()) {
const targetIsEl = this.el && event.target === this.el;
const targetIsSelector = !isUndefined(selector) && event.target.matches(selector);
if (targetIsSelector || targetIsEl) {
this.tour.next();
}... | [
"function",
"_setupAdvanceOnHandler",
"(",
"selector",
")",
"{",
"return",
"(",
"event",
")",
"=>",
"{",
"if",
"(",
"this",
".",
"isOpen",
"(",
")",
")",
"{",
"const",
"targetIsEl",
"=",
"this",
".",
"el",
"&&",
"event",
".",
"target",
"===",
"this",
... | Sets up the handler to determine if we should advance the tour
@private | [
"Sets",
"up",
"the",
"handler",
"to",
"determine",
"if",
"we",
"should",
"advance",
"the",
"tour"
] | 0cb1c63fb07b58796358f6d33da5f6405e2b05f4 | https://github.com/shipshapecode/shepherd/blob/0cb1c63fb07b58796358f6d33da5f6405e2b05f4/src/js/utils/bind.js#L8-L19 | train | Setup the next event handler | [
30522,
3853,
1035,
16437,
4215,
21789,
2239,
11774,
3917,
1006,
27000,
1007,
1063,
2709,
1006,
2724,
1007,
1027,
1028,
1063,
2065,
1006,
2023,
1012,
11163,
11837,
1006,
1007,
1007,
1063,
9530,
3367,
4539,
5562,
2140,
1027,
2023,
1012,
3449,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/dot-location.js | checkDotLocation | function checkDotLocation(obj, prop, node) {
const dot = sourceCode.getTokenBefore(prop);
const textBeforeDot = sourceCode.getText().slice(obj.range[1], dot.range[0]);
const textAfterDot = sourceCode.getText().slice(dot.range[1], prop.range[0]);
if (dot.type === "Punctua... | javascript | function checkDotLocation(obj, prop, node) {
const dot = sourceCode.getTokenBefore(prop);
const textBeforeDot = sourceCode.getText().slice(obj.range[1], dot.range[0]);
const textAfterDot = sourceCode.getText().slice(dot.range[1], prop.range[0]);
if (dot.type === "Punctua... | [
"function",
"checkDotLocation",
"(",
"obj",
",",
"prop",
",",
"node",
")",
"{",
"const",
"dot",
"=",
"sourceCode",
".",
"getTokenBefore",
"(",
"prop",
")",
";",
"const",
"textBeforeDot",
"=",
"sourceCode",
".",
"getText",
"(",
")",
".",
"slice",
"(",
"ob... | Reports if the dot between object and property is on the correct loccation.
@param {ASTNode} obj The object owning the property.
@param {ASTNode} prop The property of the object.
@param {ASTNode} node The corresponding node of the token.
@returns {void} | [
"Reports",
"if",
"the",
"dot",
"between",
"object",
"and",
"property",
"is",
"on",
"the",
"correct",
"loccation",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/dot-location.js#L55-L81 | train | Check dot location | [
30522,
3853,
4638,
27364,
4135,
10719,
1006,
27885,
3501,
1010,
17678,
1010,
13045,
1007,
1063,
9530,
3367,
11089,
1027,
3120,
16044,
1012,
2131,
18715,
2368,
4783,
29278,
2063,
1006,
17678,
1007,
1025,
9530,
3367,
3793,
4783,
29278,
26010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/FileTreeView.js | function () {
var result,
extensions = this.props.extensions;
if (extensions && extensions.get("icons")) {
var data = this.getDataForExtension();
result = extensions.get("icons").map(function (callback) {
try {
... | javascript | function () {
var result,
extensions = this.props.extensions;
if (extensions && extensions.get("icons")) {
var data = this.getDataForExtension();
result = extensions.get("icons").map(function (callback) {
try {
... | [
"function",
"(",
")",
"{",
"var",
"result",
",",
"extensions",
"=",
"this",
".",
"props",
".",
"extensions",
";",
"if",
"(",
"extensions",
"&&",
"extensions",
".",
"get",
"(",
"\"icons\"",
")",
")",
"{",
"var",
"data",
"=",
"this",
".",
"getDataForExte... | Calls the icon providers to get the collection of icons (most likely just one) for
the current file or directory.
@return {Array.<PreactComponent>} icon components to render | [
"Calls",
"the",
"icon",
"providers",
"to",
"get",
"the",
"collection",
"of",
"icons",
"(",
"most",
"likely",
"just",
"one",
")",
"for",
"the",
"current",
"file",
"or",
"directory",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L407-L436 | train | Get the list of icons | [
30522,
3853,
1006,
1007,
1063,
13075,
2765,
1010,
14305,
1027,
2023,
1012,
24387,
1012,
14305,
1025,
2065,
1006,
14305,
1004,
1004,
14305,
1012,
2131,
1006,
1000,
18407,
1000,
1007,
1007,
1063,
13075,
2951,
1027,
2023,
1012,
2131,
2850,
269... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
TryGhost/Ghost | core/server/services/url/utils.js | getSubdir | function getSubdir() {
// Parse local path location
var localPath = url.parse(config.get('url')).path,
subdir;
// Remove trailing slash
if (localPath !== '/') {
localPath = localPath.replace(/\/$/, '');
}
subdir = localPath === '/' ? '' : localPath;
return subdir;
} | javascript | function getSubdir() {
// Parse local path location
var localPath = url.parse(config.get('url')).path,
subdir;
// Remove trailing slash
if (localPath !== '/') {
localPath = localPath.replace(/\/$/, '');
}
subdir = localPath === '/' ? '' : localPath;
return subdir;
} | [
"function",
"getSubdir",
"(",
")",
"{",
"// Parse local path location",
"var",
"localPath",
"=",
"url",
".",
"parse",
"(",
"config",
".",
"get",
"(",
"'url'",
")",
")",
".",
"path",
",",
"subdir",
";",
"// Remove trailing slash",
"if",
"(",
"localPath",
"!==... | Returns a subdirectory URL, if defined so in the config.
@return {string} URL a subdirectory if configured. | [
"Returns",
"a",
"subdirectory",
"URL",
"if",
"defined",
"so",
"in",
"the",
"config",
"."
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/services/url/utils.js#L71-L83 | train | Get the subdir of the current resource | [
30522,
3853,
4152,
12083,
4305,
2099,
1006,
1007,
1063,
1013,
1013,
11968,
3366,
2334,
4130,
3295,
13075,
2334,
15069,
1027,
24471,
2140,
1012,
11968,
3366,
1006,
9530,
8873,
2290,
1012,
2131,
1006,
1005,
24471,
2140,
1005,
1007,
1007,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
vuejs/vue-devtools | shells/chrome/src/devtools-background.js | panelAction | function panelAction (cb, message = null) {
if (created && panelLoaded && panelShown) {
cb()
} else {
pendingAction = cb
message && toast(message)
}
} | javascript | function panelAction (cb, message = null) {
if (created && panelLoaded && panelShown) {
cb()
} else {
pendingAction = cb
message && toast(message)
}
} | [
"function",
"panelAction",
"(",
"cb",
",",
"message",
"=",
"null",
")",
"{",
"if",
"(",
"created",
"&&",
"panelLoaded",
"&&",
"panelShown",
")",
"{",
"cb",
"(",
")",
"}",
"else",
"{",
"pendingAction",
"=",
"cb",
"message",
"&&",
"toast",
"(",
"message"... | Action that may execute immediatly or later when the Vue panel is ready | [
"Action",
"that",
"may",
"execute",
"immediatly",
"or",
"later",
"when",
"the",
"Vue",
"panel",
"is",
"ready"
] | 4de4b86388453cd07f0c1bf967d43a4dd4b011c9 | https://github.com/vuejs/vue-devtools/blob/4de4b86388453cd07f0c1bf967d43a4dd4b011c9/shells/chrome/src/devtools-background.js#L79-L86 | train | panelAction - callback | [
30522,
3853,
5997,
18908,
3258,
1006,
17324,
1010,
4471,
1027,
19701,
1007,
1063,
2065,
1006,
2580,
1004,
1004,
5997,
17468,
1004,
1004,
9320,
14406,
2078,
1007,
1063,
17324,
1006,
1007,
1065,
2842,
1063,
14223,
18908,
3258,
1027,
17324,
44... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laurent22/joplin | Clipper/joplin-webclipper/content_scripts/Readability.js | function(nodeList, newTagName) {
for (var i = nodeList.length - 1; i >= 0; i--) {
var node = nodeList[i];
this._setNodeTag(node, newTagName);
}
} | javascript | function(nodeList, newTagName) {
for (var i = nodeList.length - 1; i >= 0; i--) {
var node = nodeList[i];
this._setNodeTag(node, newTagName);
}
} | [
"function",
"(",
"nodeList",
",",
"newTagName",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"nodeList",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"var",
"node",
"=",
"nodeList",
"[",
"i",
"]",
";",
"this",
".",
"_setNod... | Iterates over a NodeList, and calls _setNodeTag for each node.
@param NodeList nodeList The nodes to operate on
@param String newTagName the new tag name to use
@return void | [
"Iterates",
"over",
"a",
"NodeList",
"and",
"calls",
"_setNodeTag",
"for",
"each",
"node",
"."
] | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/Clipper/joplin-webclipper/content_scripts/Readability.js#L194-L199 | train | Sets the tag name of the last node in the list | [
30522,
3853,
1006,
13045,
9863,
1010,
25597,
8490,
18442,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
13045,
9863,
1012,
3091,
1011,
1015,
1025,
1045,
1028,
1027,
1014,
1025,
1045,
1011,
1011,
1007,
1063,
13075,
13045,
1027,
13045,
9863,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
Microsoft/vscode | build/lib/bundle.js | bundle | function bundle(entryPoints, config, callback) {
const entryPointsMap = {};
entryPoints.forEach((module) => {
entryPointsMap[module.name] = module;
});
const allMentionedModulesMap = {};
entryPoints.forEach((module) => {
allMentionedModulesMap[module.name] = true;
(module.inc... | javascript | function bundle(entryPoints, config, callback) {
const entryPointsMap = {};
entryPoints.forEach((module) => {
entryPointsMap[module.name] = module;
});
const allMentionedModulesMap = {};
entryPoints.forEach((module) => {
allMentionedModulesMap[module.name] = true;
(module.inc... | [
"function",
"bundle",
"(",
"entryPoints",
",",
"config",
",",
"callback",
")",
"{",
"const",
"entryPointsMap",
"=",
"{",
"}",
";",
"entryPoints",
".",
"forEach",
"(",
"(",
"module",
")",
"=>",
"{",
"entryPointsMap",
"[",
"module",
".",
"name",
"]",
"=",
... | Bundle `entryPoints` given config `config`. | [
"Bundle",
"entryPoints",
"given",
"config",
"config",
"."
] | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/build/lib/bundle.js#L13-L70 | train | Bundle the modules | [
30522,
3853,
14012,
1006,
4443,
26521,
1010,
9530,
8873,
2290,
1010,
2655,
5963,
1007,
1063,
9530,
3367,
4443,
26521,
2863,
2361,
1027,
1063,
1065,
1025,
4443,
26521,
1012,
18921,
6776,
1006,
1006,
11336,
1007,
1027,
1028,
1063,
4443,
26521... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
google/material-design-icons | gulpfile.babel.js | getSvgSpriteConfig | function getSvgSpriteConfig(category) {
return {
shape: {
dimension: {
maxWidth: 24,
maxHeight: 24
},
},
mode: {
css : {
bust: false,
dest: './',
sprite: `./svg-sprite-${ category }.svg`,
example: {
dest: `./svg-sprite-${ category... | javascript | function getSvgSpriteConfig(category) {
return {
shape: {
dimension: {
maxWidth: 24,
maxHeight: 24
},
},
mode: {
css : {
bust: false,
dest: './',
sprite: `./svg-sprite-${ category }.svg`,
example: {
dest: `./svg-sprite-${ category... | [
"function",
"getSvgSpriteConfig",
"(",
"category",
")",
"{",
"return",
"{",
"shape",
":",
"{",
"dimension",
":",
"{",
"maxWidth",
":",
"24",
",",
"maxHeight",
":",
"24",
"}",
",",
"}",
",",
"mode",
":",
"{",
"css",
":",
"{",
"bust",
":",
"false",
"... | Returns the SVG sprite configuration for the specified category. | [
"Returns",
"the",
"SVG",
"sprite",
"configuration",
"for",
"the",
"specified",
"category",
"."
] | 224895a86501195e7a7ff3dde18e39f00b8e3d5a | https://github.com/google/material-design-icons/blob/224895a86501195e7a7ff3dde18e39f00b8e3d5a/gulpfile.babel.js#L122-L154 | train | Get the svg sprite config for a given category | [
30522,
3853,
4152,
2615,
5620,
18098,
4221,
8663,
8873,
2290,
1006,
4696,
1007,
1063,
2709,
1063,
4338,
1024,
1063,
9812,
1024,
1063,
4098,
9148,
11927,
2232,
1024,
2484,
1010,
4098,
26036,
13900,
1024,
2484,
1065,
1010,
1065,
1010,
5549,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
grpc/grpc-node | packages/grpc-native-core/src/server.js | handleClientStreaming | function handleClientStreaming(call, handler, metadata) {
var stream = new ServerReadableStream(call, metadata, handler.deserialize);
stream.on('error', function(error) {
handleError(call, error);
});
stream.waitForCancel();
handler.func(stream, function(err, value, trailer, flags) {
stream.terminate(... | javascript | function handleClientStreaming(call, handler, metadata) {
var stream = new ServerReadableStream(call, metadata, handler.deserialize);
stream.on('error', function(error) {
handleError(call, error);
});
stream.waitForCancel();
handler.func(stream, function(err, value, trailer, flags) {
stream.terminate(... | [
"function",
"handleClientStreaming",
"(",
"call",
",",
"handler",
",",
"metadata",
")",
"{",
"var",
"stream",
"=",
"new",
"ServerReadableStream",
"(",
"call",
",",
"metadata",
",",
"handler",
".",
"deserialize",
")",
";",
"stream",
".",
"on",
"(",
"'error'",... | User provided method to handle client streaming methods on the server.
@callback grpc.Server~handleClientStreamingCall
@param {grpc~ServerReadableStream} call The call object
@param {grpc.Server~sendUnaryData} callback The callback to call to respond
to the request
Fully handle a client streaming call
@access private... | [
"User",
"provided",
"method",
"to",
"handle",
"client",
"streaming",
"methods",
"on",
"the",
"server",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/server.js#L664-L681 | train | Handle client streaming | [
30522,
3853,
5047,
20464,
11638,
21422,
2075,
1006,
2655,
1010,
28213,
1010,
27425,
1007,
1063,
13075,
5460,
1027,
2047,
8241,
16416,
20782,
21422,
1006,
2655,
1010,
27425,
1010,
28213,
1012,
4078,
11610,
3669,
4371,
1007,
1025,
5460,
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... |
keplergl/kepler.gl | src/schemas/vis-state-schema.js | geojsonSizeFieldV0ToV1 | function geojsonSizeFieldV0ToV1(config) {
const defaultRaiuds = 10;
const defaultRadiusRange = [0, 50];
// if extruded, sizeField is most likely used for height
if (config.visConfig.extruded) {
return 'heightField';
}
// if show stroke enabled, sizeField is most likely used for stroke
if (config.vis... | javascript | function geojsonSizeFieldV0ToV1(config) {
const defaultRaiuds = 10;
const defaultRadiusRange = [0, 50];
// if extruded, sizeField is most likely used for height
if (config.visConfig.extruded) {
return 'heightField';
}
// if show stroke enabled, sizeField is most likely used for stroke
if (config.vis... | [
"function",
"geojsonSizeFieldV0ToV1",
"(",
"config",
")",
"{",
"const",
"defaultRaiuds",
"=",
"10",
";",
"const",
"defaultRadiusRange",
"=",
"[",
"0",
",",
"50",
"]",
";",
"// if extruded, sizeField is most likely used for height",
"if",
"(",
"config",
".",
"visConf... | in v1 geojson stroke base on -> sizeField height based on -> heightField radius based on -> radiusField here we make our wiredst guess on which channel sizeField belongs to | [
"in",
"v1",
"geojson",
"stroke",
"base",
"on",
"-",
">",
"sizeField",
"height",
"based",
"on",
"-",
">",
"heightField",
"radius",
"based",
"on",
"-",
">",
"radiusField",
"here",
"we",
"make",
"our",
"wiredst",
"guess",
"on",
"which",
"channel",
"sizeField"... | 779238435707cc54335c2d00001e4b9334b314aa | https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/src/schemas/vis-state-schema.js#L40-L64 | train | Convert sizeField from V0 to V1 | [
30522,
3853,
20248,
22578,
5644,
4697,
3790,
2615,
2692,
26525,
2487,
1006,
9530,
8873,
2290,
1007,
1063,
9530,
3367,
12398,
14995,
6784,
2015,
1027,
2184,
1025,
9530,
3367,
12398,
12173,
4173,
24388,
2063,
1027,
1031,
1014,
1010,
2753,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
askmike/gekko | strategies/indicators/LRC.js | linreg | function linreg(values_x, values_y) {
var sum_x = 0;
var sum_y = 0;
var sum_xy = 0;
var sum_xx = 0;
var count = 0;
/*
* We'll use those variables for faster read/write access.
*/
var x = 0;
var y = 0;
var values_length = values_x.length;
if (values_length != values_y.... | javascript | function linreg(values_x, values_y) {
var sum_x = 0;
var sum_y = 0;
var sum_xy = 0;
var sum_xx = 0;
var count = 0;
/*
* We'll use those variables for faster read/write access.
*/
var x = 0;
var y = 0;
var values_length = values_x.length;
if (values_length != values_y.... | [
"function",
"linreg",
"(",
"values_x",
",",
"values_y",
")",
"{",
"var",
"sum_x",
"=",
"0",
";",
"var",
"sum_y",
"=",
"0",
";",
"var",
"sum_xy",
"=",
"0",
";",
"var",
"sum_xx",
"=",
"0",
";",
"var",
"count",
"=",
"0",
";",
"/*\n * We'll use those... | /*
Least squares linear regression fitting. | [
"/",
"*",
"Least",
"squares",
"linear",
"regression",
"fitting",
"."
] | 0ce9ddd577fa8a22812c02331a494086758dfadf | https://github.com/askmike/gekko/blob/0ce9ddd577fa8a22812c02331a494086758dfadf/strategies/indicators/LRC.js#L54-L100 | train | Calculate the linreg | [
30522,
3853,
11409,
2890,
2290,
1006,
5300,
1035,
1060,
1010,
5300,
1035,
1061,
1007,
1063,
13075,
7680,
1035,
1060,
1027,
1014,
1025,
13075,
7680,
1035,
1061,
1027,
1014,
1025,
13075,
7680,
1035,
1060,
2100,
1027,
1014,
1025,
13075,
7680,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/BarInPageEnabler.js | function (sContext) {
var oOptions = this._getContextOptions(sContext);
if (!oOptions) {
return this;
}
if (!this.isContextSensitive) {
Log.error("The bar control you are using does not implement all the members of the IBar interface", this);
return this;
}
//If this class does not gets... | javascript | function (sContext) {
var oOptions = this._getContextOptions(sContext);
if (!oOptions) {
return this;
}
if (!this.isContextSensitive) {
Log.error("The bar control you are using does not implement all the members of the IBar interface", this);
return this;
}
//If this class does not gets... | [
"function",
"(",
"sContext",
")",
"{",
"var",
"oOptions",
"=",
"this",
".",
"_getContextOptions",
"(",
"sContext",
")",
";",
"if",
"(",
"!",
"oOptions",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"!",
"this",
".",
"isContextSensitive",
")",
"{",
... | Sets classes according to the context of the page.
Possible contexts are header, footer, subheader.
@param {string} sContext allowed values are header, footer, subheader.
@returns {sap.m.IBar} <code>this</code> for chaining
@sap-restricted
@private | [
"Sets",
"classes",
"according",
"to",
"the",
"context",
"of",
"the",
"page",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/BarInPageEnabler.js#L138-L160 | train | Adds the context class to the control | [
30522,
3853,
1006,
8040,
28040,
18413,
1007,
1063,
13075,
1051,
7361,
9285,
1027,
2023,
1012,
1035,
2131,
8663,
18209,
7361,
9285,
1006,
8040,
28040,
18413,
1007,
1025,
2065,
1006,
999,
1051,
7361,
9285,
1007,
1063,
2709,
2023,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
grpc/grpc-node | packages/grpc-native-core/src/server.js | setUpReadable | function setUpReadable(stream, deserialize) {
stream.deserialize = common.wrapIgnoreNull(deserialize);
stream.finished = false;
stream.reading = false;
stream.terminate = function() {
stream.finished = true;
stream.on('data', function() {});
};
stream.on('cancelled', function() {
stream.termin... | javascript | function setUpReadable(stream, deserialize) {
stream.deserialize = common.wrapIgnoreNull(deserialize);
stream.finished = false;
stream.reading = false;
stream.terminate = function() {
stream.finished = true;
stream.on('data', function() {});
};
stream.on('cancelled', function() {
stream.termin... | [
"function",
"setUpReadable",
"(",
"stream",
",",
"deserialize",
")",
"{",
"stream",
".",
"deserialize",
"=",
"common",
".",
"wrapIgnoreNull",
"(",
"deserialize",
")",
";",
"stream",
".",
"finished",
"=",
"false",
";",
"stream",
".",
"reading",
"=",
"false",
... | Initialize a readable stream. This is used for both the readable and duplex
stream constructors.
@private
@param {Readable} stream The stream to initialize
@param {grpc~deserialize} deserialize Deserialization function for
incoming data. | [
"Initialize",
"a",
"readable",
"stream",
".",
"This",
"is",
"used",
"for",
"both",
"the",
"readable",
"and",
"duplex",
"stream",
"constructors",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/server.js#L200-L213 | train | Set up the readable stream | [
30522,
3853,
16437,
16416,
20782,
1006,
5460,
1010,
4078,
11610,
3669,
4371,
1007,
1063,
5460,
1012,
4078,
11610,
3669,
4371,
1027,
2691,
1012,
10236,
23773,
5686,
11231,
3363,
1006,
4078,
11610,
3669,
4371,
1007,
1025,
5460,
1012,
2736,
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... |
firebase/firebase-js-sdk | scripts/docgen/generate-docs.js | checkForMissingFilesAndFixFilenameCase | function checkForMissingFilesAndFixFilenameCase() {
// Get filenames from toc.yaml.
const filenames = tocText
.split('\n')
.filter(line => line.includes('path:'))
.map(line => line.split(devsitePath)[1]);
// Logs warning to console if a file from TOC is not found.
const fileCheckPromises = filenames... | javascript | function checkForMissingFilesAndFixFilenameCase() {
// Get filenames from toc.yaml.
const filenames = tocText
.split('\n')
.filter(line => line.includes('path:'))
.map(line => line.split(devsitePath)[1]);
// Logs warning to console if a file from TOC is not found.
const fileCheckPromises = filenames... | [
"function",
"checkForMissingFilesAndFixFilenameCase",
"(",
")",
"{",
"// Get filenames from toc.yaml.",
"const",
"filenames",
"=",
"tocText",
".",
"split",
"(",
"'\\n'",
")",
".",
"filter",
"(",
"line",
"=>",
"line",
".",
"includes",
"(",
"'path:'",
")",
")",
".... | Checks to see if any files listed in toc.yaml were not generated.
If files exist, fixes filename case to match toc.yaml version. | [
"Checks",
"to",
"see",
"if",
"any",
"files",
"listed",
"in",
"toc",
".",
"yaml",
"were",
"not",
"generated",
".",
"If",
"files",
"exist",
"fixes",
"filename",
"case",
"to",
"match",
"toc",
".",
"yaml",
"version",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/scripts/docgen/generate-docs.js#L135-L165 | train | Checks if a file from toc. yaml is missing and fixes filename case if it does. | [
30522,
3853,
4638,
14192,
14643,
2075,
8873,
4244,
5685,
8873,
2595,
8873,
20844,
4168,
18382,
1006,
1007,
1063,
1013,
1013,
2131,
5371,
18442,
2015,
2013,
2000,
2278,
1012,
8038,
19968,
1012,
9530,
3367,
5371,
18442,
2015,
1027,
2000,
6593... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mescroll/mescroll | mescroll.js/html-demo/dotJump/option/mescroll-option.js | function(mescroll, downwarp) {
//初始化完毕的回调,可缓存dom
mescroll.downCircleDom = downwarp.getElementsByClassName("downwarp-circle")[0];
mescroll.downBallDom = downwarp.getElementsByClassName("downwarp-ball")[0];
} | javascript | function(mescroll, downwarp) {
//初始化完毕的回调,可缓存dom
mescroll.downCircleDom = downwarp.getElementsByClassName("downwarp-circle")[0];
mescroll.downBallDom = downwarp.getElementsByClassName("downwarp-ball")[0];
} | [
"function",
"(",
"mescroll",
",",
"downwarp",
")",
"{",
"//初始化完毕的回调,可缓存dom",
"mescroll",
".",
"downCircleDom",
"=",
"downwarp",
".",
"getElementsByClassName",
"(",
"\"downwarp-circle\"",
")",
"[",
"0",
"]",
";",
"mescroll",
".",
"downBallDom",
"=",
"downwarp",
"... | 布局内容 | [
"布局内容"
] | 43d3dcf3062da0fe95995ddcb5e93f5725792c98 | https://github.com/mescroll/mescroll/blob/43d3dcf3062da0fe95995ddcb5e93f5725792c98/mescroll.js/html-demo/dotJump/option/mescroll-option.js#L67-L71 | train | init downwarp dom | [
30522,
3853,
1006,
2033,
11020,
28402,
1010,
2091,
9028,
2361,
1007,
1063,
1013,
1013,
100,
100,
100,
100,
100,
1916,
100,
100,
1010,
100,
100,
100,
14383,
2033,
11020,
28402,
1012,
2091,
6895,
21769,
9527,
1027,
2091,
9028,
2361,
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/odata/ODataModel.js | _submit | function _submit(){
// execute the request and use the metadata if available
if (that.bUseBatch) {
that.updateSecurityToken();
// batch requests only need the path without the service URL
// extract query of url and combine it with the path...
var sUriQuery = URI.parse(oRequest.requestUri).query;... | javascript | function _submit(){
// execute the request and use the metadata if available
if (that.bUseBatch) {
that.updateSecurityToken();
// batch requests only need the path without the service URL
// extract query of url and combine it with the path...
var sUriQuery = URI.parse(oRequest.requestUri).query;... | [
"function",
"_submit",
"(",
")",
"{",
"// execute the request and use the metadata if available",
"if",
"(",
"that",
".",
"bUseBatch",
")",
"{",
"that",
".",
"updateSecurityToken",
"(",
")",
";",
"// batch requests only need the path without the service URL",
"// extract quer... | this method is used to retrieve all desired data. It triggers additional read requests if the server paging size
permits to return all the requested data. This could only happen for servers with support for oData > 2.0. | [
"this",
"method",
"is",
"used",
"to",
"retrieve",
"all",
"desired",
"data",
".",
"It",
"triggers",
"additional",
"read",
"requests",
"if",
"the",
"server",
"paging",
"size",
"permits",
"to",
"return",
"all",
"the",
"requested",
"data",
".",
"This",
"could",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/ODataModel.js#L831-L860 | train | submit the request | [
30522,
3853,
1035,
12040,
1006,
1007,
1063,
1013,
1013,
15389,
1996,
5227,
1998,
2224,
1996,
27425,
2065,
2800,
2065,
1006,
2008,
1012,
3902,
15878,
4017,
2818,
1007,
1063,
2008,
1012,
14409,
8586,
25137,
18715,
2368,
1006,
1007,
1025,
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... |
jhipster/generator-jhipster | generators/docker-cli.js | command | function command(cmd, cb, opts = {}) {
const options = {
silent: false,
maxBuffer: 10240000,
...opts
};
const command = exec(`${cmd}`, { maxBuffer: options.maxBuffer }, cb);
if (!options.silent) {
command.stdout.on('data', stdOut);
command.stderr.on('data', stdEr... | javascript | function command(cmd, cb, opts = {}) {
const options = {
silent: false,
maxBuffer: 10240000,
...opts
};
const command = exec(`${cmd}`, { maxBuffer: options.maxBuffer }, cb);
if (!options.silent) {
command.stdout.on('data', stdOut);
command.stderr.on('data', stdEr... | [
"function",
"command",
"(",
"cmd",
",",
"cb",
",",
"opts",
"=",
"{",
"}",
")",
"{",
"const",
"options",
"=",
"{",
"silent",
":",
"false",
",",
"maxBuffer",
":",
"10240000",
",",
"...",
"opts",
"}",
";",
"const",
"command",
"=",
"exec",
"(",
"`",
... | Execute the shell command given as a parameter and execute the callback at the end. Callback has profile:
`function(err, stdout, stderr)`
@param cmd the command to execute
@param cb the callback that will be called after the function is executed.
@param opts additional options
@attr silent flag to deactivate the live s... | [
"Execute",
"the",
"shell",
"command",
"given",
"as",
"a",
"parameter",
"and",
"execute",
"the",
"callback",
"at",
"the",
"end",
".",
"Callback",
"has",
"profile",
":",
"function",
"(",
"err",
"stdout",
"stderr",
")"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/docker-cli.js#L51-L63 | train | Execute a command | [
30522,
3853,
3094,
1006,
4642,
2094,
1010,
17324,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
1063,
9530,
3367,
7047,
1027,
1063,
4333,
1024,
6270,
1010,
4098,
8569,
12494,
1024,
9402,
29537,
8889,
1010,
1012,
1012,
1012,
23569,
2015,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/indent-legacy.js | report | function report(node, needed, gottenSpaces, gottenTabs, loc, isLastNodeCheck) {
if (gottenSpaces && gottenTabs) {
// To avoid conflicts with `no-mixed-spaces-and-tabs`, don't report lines that have both spaces and tabs.
return;
}
const desiredIndent ... | javascript | function report(node, needed, gottenSpaces, gottenTabs, loc, isLastNodeCheck) {
if (gottenSpaces && gottenTabs) {
// To avoid conflicts with `no-mixed-spaces-and-tabs`, don't report lines that have both spaces and tabs.
return;
}
const desiredIndent ... | [
"function",
"report",
"(",
"node",
",",
"needed",
",",
"gottenSpaces",
",",
"gottenTabs",
",",
"loc",
",",
"isLastNodeCheck",
")",
"{",
"if",
"(",
"gottenSpaces",
"&&",
"gottenTabs",
")",
"{",
"// To avoid conflicts with `no-mixed-spaces-and-tabs`, don't report lines th... | Reports a given indent violation
@param {ASTNode} node Node violating the indent rule
@param {int} needed Expected indentation character count
@param {int} gottenSpaces Indentation space count in the actual node/code
@param {int} gottenTabs Indentation tab count in the actual node/code
@param {Object=} loc Error line a... | [
"Reports",
"a",
"given",
"indent",
"violation"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/indent-legacy.js#L310-L330 | train | Reports a node with the given number of spaces and tabs. | [
30522,
3853,
3189,
1006,
13045,
1010,
2734,
1010,
5407,
23058,
2015,
1010,
5407,
2696,
5910,
1010,
8840,
2278,
1010,
25340,
3367,
3630,
3207,
5403,
3600,
1007,
1063,
2065,
1006,
5407,
23058,
2015,
1004,
1004,
5407,
2696,
5910,
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... |
fengyuanchen/cropper | dist/cropper.common.js | getData | function getData(element, name) {
if (isObject(element[name])) {
return element[name];
} else if (element.dataset) {
return element.dataset[name];
}
return element.getAttribute('data-' + hyphenate(name));
} | javascript | function getData(element, name) {
if (isObject(element[name])) {
return element[name];
} else if (element.dataset) {
return element.dataset[name];
}
return element.getAttribute('data-' + hyphenate(name));
} | [
"function",
"getData",
"(",
"element",
",",
"name",
")",
"{",
"if",
"(",
"isObject",
"(",
"element",
"[",
"name",
"]",
")",
")",
"{",
"return",
"element",
"[",
"name",
"]",
";",
"}",
"else",
"if",
"(",
"element",
".",
"dataset",
")",
"{",
"return",... | Get data from the given element.
@param {Element} element - The target element.
@param {string} name - The data key to get.
@returns {string} The data value. | [
"Get",
"data",
"from",
"the",
"given",
"element",
"."
] | 6677332a6a375b647f58808dfc24ea09f5804041 | https://github.com/fengyuanchen/cropper/blob/6677332a6a375b647f58808dfc24ea09f5804041/dist/cropper.common.js#L475-L483 | train | Get data from element | [
30522,
3853,
2131,
2850,
2696,
1006,
5783,
1010,
2171,
1007,
1063,
2065,
1006,
11163,
2497,
20614,
1006,
5783,
1031,
2171,
1033,
1007,
1007,
1063,
2709,
5783,
1031,
2171,
1033,
1025,
1065,
2842,
2065,
1006,
5783,
1012,
2951,
13462,
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... |
aframevr/aframe | src/utils/coordinates.js | stringify | function stringify (data) {
var str;
if (typeof data !== OBJECT) { return data; }
str = data.x + ' ' + data.y;
if (data.z != null) { str += ' ' + data.z; }
if (data.w != null) { str += ' ' + data.w; }
return str;
} | javascript | function stringify (data) {
var str;
if (typeof data !== OBJECT) { return data; }
str = data.x + ' ' + data.y;
if (data.z != null) { str += ' ' + data.z; }
if (data.w != null) { str += ' ' + data.w; }
return str;
} | [
"function",
"stringify",
"(",
"data",
")",
"{",
"var",
"str",
";",
"if",
"(",
"typeof",
"data",
"!==",
"OBJECT",
")",
"{",
"return",
"data",
";",
"}",
"str",
"=",
"data",
".",
"x",
"+",
"' '",
"+",
"data",
".",
"y",
";",
"if",
"(",
"data",
".",... | Stringify coordinates from an object with keys [x y z].
Example: {x: 3, y: 10, z: -5} to "3 10 -5".
@param {object|string} data - An object with keys [x y z].
@returns {string} An "x y z" string. | [
"Stringify",
"coordinates",
"from",
"an",
"object",
"with",
"keys",
"[",
"x",
"y",
"z",
"]",
".",
"Example",
":",
"{",
"x",
":",
"3",
"y",
":",
"10",
"z",
":",
"-",
"5",
"}",
"to",
"3",
"10",
"-",
"5",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/utils/coordinates.js#L75-L82 | train | Stringify a data object | [
30522,
3853,
5164,
8757,
1006,
2951,
1007,
1063,
13075,
2358,
2099,
1025,
2065,
1006,
2828,
11253,
2951,
999,
1027,
1027,
4874,
1007,
1063,
2709,
2951,
1025,
1065,
2358,
2099,
1027,
2951,
1012,
1060,
1009,
1005,
1005,
1009,
2951,
1012,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/filesystem/impls/appshell/node/FileWatcherManager.js | normalizeStats | function normalizeStats(nodeFsStats) {
// current shell's stat method floors the mtime to the nearest thousand
// which causes problems when comparing timestamps
// so we have to round mtime to the nearest thousand too
var mtime = Math.floor(nodeFsStats.mtime.getTime() / 1000) * 1000;
// from shell... | javascript | function normalizeStats(nodeFsStats) {
// current shell's stat method floors the mtime to the nearest thousand
// which causes problems when comparing timestamps
// so we have to round mtime to the nearest thousand too
var mtime = Math.floor(nodeFsStats.mtime.getTime() / 1000) * 1000;
// from shell... | [
"function",
"normalizeStats",
"(",
"nodeFsStats",
")",
"{",
"// current shell's stat method floors the mtime to the nearest thousand",
"// which causes problems when comparing timestamps",
"// so we have to round mtime to the nearest thousand too",
"var",
"mtime",
"=",
"Math",
".",
"floo... | Transform Node's native fs.stats to a format that can be sent through domain
@param {stats} nodeFsStats Node's fs.stats result
@return {object} Can be consumed by new FileSystemStats(object); in Brackets | [
"Transform",
"Node",
"s",
"native",
"fs",
".",
"stats",
"to",
"a",
"format",
"that",
"can",
"be",
"sent",
"through",
"domain"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/node/FileWatcherManager.js#L46-L63 | train | normalize stats from node fs | [
30522,
3853,
3671,
10057,
29336,
2015,
1006,
13045,
10343,
9153,
3215,
1007,
1063,
1013,
1013,
2783,
5806,
1005,
1055,
28093,
4118,
8158,
1996,
11047,
14428,
2000,
1996,
7205,
4595,
1013,
1013,
2029,
5320,
3471,
2043,
13599,
2335,
15464,
45... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FindReplace.js | findNext | function findNext(editor, searchBackwards, preferNoScroll, pos) {
var cm = editor._codeMirror;
cm.operation(function () {
var state = getSearchState(cm);
clearCurrentMatchHighlight(cm, state);
var nextMatch = _getNextMatch(editor, searchBackwards, pos);
i... | javascript | function findNext(editor, searchBackwards, preferNoScroll, pos) {
var cm = editor._codeMirror;
cm.operation(function () {
var state = getSearchState(cm);
clearCurrentMatchHighlight(cm, state);
var nextMatch = _getNextMatch(editor, searchBackwards, pos);
i... | [
"function",
"findNext",
"(",
"editor",
",",
"searchBackwards",
",",
"preferNoScroll",
",",
"pos",
")",
"{",
"var",
"cm",
"=",
"editor",
".",
"_codeMirror",
";",
"cm",
".",
"operation",
"(",
"function",
"(",
")",
"{",
"var",
"state",
"=",
"getSearchState",
... | Selects the next match (or prev match, if searchBackwards==true) starting from either the current position
(if pos unspecified) or the given position (if pos specified explicitly). The starting position
need not be an existing match. If a new match is found, sets to state.lastMatch either the regex
match result, or sim... | [
"Selects",
"the",
"next",
"match",
"(",
"or",
"prev",
"match",
"if",
"searchBackwards",
"==",
"true",
")",
"starting",
"from",
"either",
"the",
"current",
"position",
"(",
"if",
"pos",
"unspecified",
")",
"or",
"the",
"given",
"position",
"(",
"if",
"pos",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindReplace.js#L416-L448 | train | Find next match in the search list | [
30522,
3853,
2424,
2638,
18413,
1006,
3559,
1010,
3945,
5963,
7652,
2015,
1010,
9544,
15460,
26775,
14511,
1010,
13433,
2015,
1007,
1063,
13075,
4642,
1027,
3559,
1012,
1035,
3642,
14503,
29165,
1025,
4642,
1012,
3169,
1006,
3853,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/sidenav/sidenav.js | addLegacyAPI | function addLegacyAPI(service, handle) {
var falseFn = function() {
return false;
};
var rejectFn = function() {
return $q.when($mdUtil.supplant(errorMsg, [handle || ""]));
};
return angular.extend({
isLockedOpen: falseFn,
isOpen: falseFn,
toggle: rejectFn,
open:... | javascript | function addLegacyAPI(service, handle) {
var falseFn = function() {
return false;
};
var rejectFn = function() {
return $q.when($mdUtil.supplant(errorMsg, [handle || ""]));
};
return angular.extend({
isLockedOpen: falseFn,
isOpen: falseFn,
toggle: rejectFn,
open:... | [
"function",
"addLegacyAPI",
"(",
"service",
",",
"handle",
")",
"{",
"var",
"falseFn",
"=",
"function",
"(",
")",
"{",
"return",
"false",
";",
"}",
";",
"var",
"rejectFn",
"=",
"function",
"(",
")",
"{",
"return",
"$q",
".",
"when",
"(",
"$mdUtil",
"... | For failed instance/handle lookups, older-clients expect an response object with noops
that include `rejected promise APIs`
@param service
@param handle
@returns {Object} | [
"For",
"failed",
"instance",
"/",
"handle",
"lookups",
"older",
"-",
"clients",
"expect",
"an",
"response",
"object",
"with",
"noops",
"that",
"include",
"rejected",
"promise",
"APIs"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/sidenav/sidenav.js#L106-L125 | train | Adds a legacy API to the specified service | [
30522,
3853,
5587,
23115,
15719,
9331,
2072,
1006,
2326,
1010,
5047,
1007,
1063,
13075,
6270,
2546,
2078,
1027,
3853,
1006,
1007,
1063,
2709,
6270,
1025,
1065,
1025,
13075,
15454,
2546,
2078,
1027,
3853,
1006,
1007,
1063,
2709,
1002,
1053,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
electron/electron | script/bump-version.js | main | async function main () {
const opts = parseCommandLine()
const currentVersion = await utils.getElectronVersion()
const version = await nextVersion(opts.bump, currentVersion)
const parsed = semver.parse(version)
const components = {
major: parsed.major,
minor: parsed.minor,
patch: parsed.patch,
... | javascript | async function main () {
const opts = parseCommandLine()
const currentVersion = await utils.getElectronVersion()
const version = await nextVersion(opts.bump, currentVersion)
const parsed = semver.parse(version)
const components = {
major: parsed.major,
minor: parsed.minor,
patch: parsed.patch,
... | [
"async",
"function",
"main",
"(",
")",
"{",
"const",
"opts",
"=",
"parseCommandLine",
"(",
")",
"const",
"currentVersion",
"=",
"await",
"utils",
".",
"getElectronVersion",
"(",
")",
"const",
"version",
"=",
"await",
"nextVersion",
"(",
"opts",
".",
"bump",
... | run the script | [
"run",
"the",
"script"
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/script/bump-version.js#L37-L69 | train | Main entry point | [
30522,
2004,
6038,
2278,
3853,
2364,
1006,
1007,
1063,
9530,
3367,
23569,
2015,
1027,
11968,
3366,
9006,
2386,
19422,
3170,
1006,
1007,
9530,
3367,
2783,
27774,
1027,
26751,
21183,
12146,
1012,
2131,
12260,
6593,
4948,
27774,
1006,
1007,
95... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tgriesser/knex | src/transaction.js | makeTransactor | function makeTransactor(trx, connection, trxClient) {
const transactor = makeKnex(trxClient);
transactor.withUserParams = () => {
throw new Error(
'Cannot set user params on a transaction - it can only inherit params from main knex instance'
);
};
transactor.isTransaction = true;
transactor.us... | javascript | function makeTransactor(trx, connection, trxClient) {
const transactor = makeKnex(trxClient);
transactor.withUserParams = () => {
throw new Error(
'Cannot set user params on a transaction - it can only inherit params from main knex instance'
);
};
transactor.isTransaction = true;
transactor.us... | [
"function",
"makeTransactor",
"(",
"trx",
",",
"connection",
",",
"trxClient",
")",
"{",
"const",
"transactor",
"=",
"makeKnex",
"(",
"trxClient",
")",
";",
"transactor",
".",
"withUserParams",
"=",
"(",
")",
"=>",
"{",
"throw",
"new",
"Error",
"(",
"'Cann... | The transactor is a full featured knex object, with a "commit", a "rollback" and a "savepoint" function. The "savepoint" is just sugar for creating a new transaction. If the rollback is run inside a savepoint, it rolls back to the last savepoint - otherwise it rolls back the transaction. | [
"The",
"transactor",
"is",
"a",
"full",
"featured",
"knex",
"object",
"with",
"a",
"commit",
"a",
"rollback",
"and",
"a",
"savepoint",
"function",
".",
"The",
"savepoint",
"is",
"just",
"sugar",
"for",
"creating",
"a",
"new",
"transaction",
".",
"If",
"the... | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/transaction.js#L187-L215 | train | Creates a transaction | [
30522,
3853,
2191,
6494,
3619,
18908,
2953,
1006,
19817,
2595,
1010,
4434,
1010,
19817,
2595,
20464,
11638,
1007,
1063,
9530,
3367,
9099,
18908,
2953,
1027,
2191,
2243,
2638,
2595,
1006,
19817,
2595,
20464,
11638,
1007,
1025,
9099,
18908,
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/thirdparty/zyngascroll.js | function(zoomLevel) {
var self = this;
if (zoomLevel == null) {
zoomLevel = self.__zoomLevel;
}
self.__maxScrollLeft = Math.max((self.__contentWidth * zoomLevel) - self.__clientWidth, 0);
self.__maxScrollTop = Math.max((self.__contentHeight * zoomLevel) - self.__clientHeight, 0);
} | javascript | function(zoomLevel) {
var self = this;
if (zoomLevel == null) {
zoomLevel = self.__zoomLevel;
}
self.__maxScrollLeft = Math.max((self.__contentWidth * zoomLevel) - self.__clientWidth, 0);
self.__maxScrollTop = Math.max((self.__contentHeight * zoomLevel) - self.__clientHeight, 0);
} | [
"function",
"(",
"zoomLevel",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"zoomLevel",
"==",
"null",
")",
"{",
"zoomLevel",
"=",
"self",
".",
"__zoomLevel",
";",
"}",
"self",
".",
"__maxScrollLeft",
"=",
"Math",
".",
"max",
"(",
"(",
"self"... | Recomputes scroll minimum values based on client dimensions and content dimensions. | [
"Recomputes",
"scroll",
"minimum",
"values",
"based",
"on",
"client",
"dimensions",
"and",
"content",
"dimensions",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/zyngascroll.js#L1375-L1386 | train | Sets the max scroll position to the specified zoom level | [
30522,
3853,
1006,
24095,
20414,
2884,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2065,
1006,
24095,
20414,
2884,
1027,
1027,
19701,
1007,
1063,
24095,
20414,
2884,
1027,
2969,
1012,
1035,
1035,
24095,
20414,
2884,
1025,
1065,
2969,
1012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/debugReboot.js | function(oScript, rRegex) {
if (oScript && oScript.getAttribute("src") && rRegex.exec(oScript.getAttribute("src"))) {
return oScript;
}
} | javascript | function(oScript, rRegex) {
if (oScript && oScript.getAttribute("src") && rRegex.exec(oScript.getAttribute("src"))) {
return oScript;
}
} | [
"function",
"(",
"oScript",
",",
"rRegex",
")",
"{",
"if",
"(",
"oScript",
"&&",
"oScript",
".",
"getAttribute",
"(",
"\"src\"",
")",
"&&",
"rRegex",
".",
"exec",
"(",
"oScript",
".",
"getAttribute",
"(",
"\"src\"",
")",
")",
")",
"{",
"return",
"oScri... | replace the bootstrap tag with a newly created script tag to enable restarting the core from a different server | [
"replace",
"the",
"bootstrap",
"tag",
"with",
"a",
"newly",
"created",
"script",
"tag",
"to",
"enable",
"restarting",
"the",
"core",
"from",
"a",
"different",
"server"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/debugReboot.js#L56-L60 | train | Returns the script element if the src attribute is a regex | [
30522,
3853,
1006,
9808,
23235,
1010,
25269,
24746,
2595,
1007,
1063,
2065,
1006,
9808,
23235,
1004,
1004,
9808,
23235,
1012,
2131,
19321,
3089,
8569,
2618,
1006,
1000,
5034,
2278,
1000,
1007,
1004,
1004,
25269,
24746,
2595,
1012,
4654,
858... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function(oModelReference, mParameter) {
if (typeof mParameter == "string") {
throw "Deprecated second argument: Adjust your invocation by passing an object with a property sAnnotationJSONDoc as a second argument instead";
}
this._mParameter = mParameter;
var that = this;
/*
* get access to OData... | javascript | function(oModelReference, mParameter) {
if (typeof mParameter == "string") {
throw "Deprecated second argument: Adjust your invocation by passing an object with a property sAnnotationJSONDoc as a second argument instead";
}
this._mParameter = mParameter;
var that = this;
/*
* get access to OData... | [
"function",
"(",
"oModelReference",
",",
"mParameter",
")",
"{",
"if",
"(",
"typeof",
"mParameter",
"==",
"\"string\"",
")",
"{",
"throw",
"\"Deprecated second argument: Adjust your invocation by passing an object with a property sAnnotationJSONDoc as a second argument instead\"",
... | initialize a new object
@private | [
"initialize",
"a",
"new",
"object"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L245-L333 | train | Initializes the model | [
30522,
3853,
1006,
18168,
10244,
20974,
27235,
24413,
1010,
6131,
5400,
22828,
1007,
1063,
2065,
1006,
2828,
11253,
6131,
5400,
22828,
1027,
1027,
1000,
5164,
1000,
1007,
1063,
5466,
1000,
2139,
28139,
12921,
2117,
6685,
1024,
14171,
2115,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | examples/player/player.js | function() {
var self = this;
var display = (playlist.style.display === 'block') ? 'none' : 'block';
setTimeout(function() {
playlist.style.display = display;
}, (display === 'block') ? 0 : 500);
playlist.className = (display === 'block') ? 'fadein' : 'fadeout';
} | javascript | function() {
var self = this;
var display = (playlist.style.display === 'block') ? 'none' : 'block';
setTimeout(function() {
playlist.style.display = display;
}, (display === 'block') ? 0 : 500);
playlist.className = (display === 'block') ? 'fadein' : 'fadeout';
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"display",
"=",
"(",
"playlist",
".",
"style",
".",
"display",
"===",
"'block'",
")",
"?",
"'none'",
":",
"'block'",
";",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"playlist",
"."... | Toggle the playlist display on/off. | [
"Toggle",
"the",
"playlist",
"display",
"on",
"/",
"off",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/player/player.js#L236-L244 | train | Set the display of the cubemap | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
4653,
1027,
1006,
2377,
9863,
1012,
2806,
1012,
4653,
1027,
1027,
1027,
1005,
3796,
1005,
1007,
1029,
1005,
3904,
1005,
1024,
1005,
3796,
1005,
1025,
2275,
7292,
5833,
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... | |
heyui/heyui | src/plugins/popper/index.js | removeEventListeners | function removeEventListeners(reference, state) {
// Remove resize event listener on window
getWindow(reference).removeEventListener('resize', state.updateBound);
// Remove scroll event listener on scroll parents
state.scrollParents.forEach(function (target) {
target.removeEventListener('scroll', state.upd... | javascript | function removeEventListeners(reference, state) {
// Remove resize event listener on window
getWindow(reference).removeEventListener('resize', state.updateBound);
// Remove scroll event listener on scroll parents
state.scrollParents.forEach(function (target) {
target.removeEventListener('scroll', state.upd... | [
"function",
"removeEventListeners",
"(",
"reference",
",",
"state",
")",
"{",
"// Remove resize event listener on window",
"getWindow",
"(",
"reference",
")",
".",
"removeEventListener",
"(",
"'resize'",
",",
"state",
".",
"updateBound",
")",
";",
"// Remove scroll even... | Remove event listeners used to update the popper position
@method
@memberof Popper.Utils
@private | [
"Remove",
"event",
"listeners",
"used",
"to",
"update",
"the",
"popper",
"position"
] | d5405d27d994151b676eb91c12b389316d7f6679 | https://github.com/heyui/heyui/blob/d5405d27d994151b676eb91c12b389316d7f6679/src/plugins/popper/index.js#L1121-L1136 | train | Remove event listeners on the window and scroll parents | [
30522,
3853,
6366,
18697,
3372,
9863,
24454,
2015,
1006,
4431,
1010,
2110,
1007,
1063,
1013,
1013,
6366,
24501,
4697,
2724,
19373,
2006,
3332,
2131,
11101,
5004,
1006,
4431,
1007,
1012,
6366,
18697,
3372,
9863,
24454,
1006,
1005,
24501,
469... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.uxap/src/sap/uxap/ThrottledTaskHelper.js | function(oOldOptions, oNewOptions) {
var oMergedOptions = jQuery.extend({}, oOldOptions, oNewOptions);
jQuery.each(oMergedOptions, function(key) {
oMergedOptions[key] = oOldOptions[key] || oNewOptions[key]; // default merge strategy is inclusive OR
});
return oMergedOptions;
} | javascript | function(oOldOptions, oNewOptions) {
var oMergedOptions = jQuery.extend({}, oOldOptions, oNewOptions);
jQuery.each(oMergedOptions, function(key) {
oMergedOptions[key] = oOldOptions[key] || oNewOptions[key]; // default merge strategy is inclusive OR
});
return oMergedOptions;
} | [
"function",
"(",
"oOldOptions",
",",
"oNewOptions",
")",
"{",
"var",
"oMergedOptions",
"=",
"jQuery",
".",
"extend",
"(",
"{",
"}",
",",
"oOldOptions",
",",
"oNewOptions",
")",
";",
"jQuery",
".",
"each",
"(",
"oMergedOptions",
",",
"function",
"(",
"key",... | Updates the task arguments
Default merge strategy is inclusive OR
@private | [
"Updates",
"the",
"task",
"arguments",
"Default",
"merge",
"strategy",
"is",
"inclusive",
"OR"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.uxap/src/sap/uxap/ThrottledTaskHelper.js#L95-L103 | train | merges the given options with the old options | [
30522,
3853,
1006,
1051,
11614,
7361,
9285,
1010,
2028,
12155,
16790,
2015,
1007,
1063,
13075,
18168,
2121,
5999,
7361,
9285,
1027,
1046,
4226,
2854,
1012,
7949,
1006,
1063,
1065,
1010,
1051,
11614,
7361,
9285,
1010,
2028,
12155,
16790,
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... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Component.js | loadComponent | function loadComponent(oConfig, mOptions) {
var sName = oConfig.name,
sUrl = oConfig.url,
oConfiguration = sap.ui.getCore().getConfiguration(),
bComponentPreload = /^(sync|async)$/.test(oConfiguration.getComponentPreload()),
vManifest = oConfig.manifest,
bManifestFirst,
sManifestUrl,
oManifest,
... | javascript | function loadComponent(oConfig, mOptions) {
var sName = oConfig.name,
sUrl = oConfig.url,
oConfiguration = sap.ui.getCore().getConfiguration(),
bComponentPreload = /^(sync|async)$/.test(oConfiguration.getComponentPreload()),
vManifest = oConfig.manifest,
bManifestFirst,
sManifestUrl,
oManifest,
... | [
"function",
"loadComponent",
"(",
"oConfig",
",",
"mOptions",
")",
"{",
"var",
"sName",
"=",
"oConfig",
".",
"name",
",",
"sUrl",
"=",
"oConfig",
".",
"url",
",",
"oConfiguration",
"=",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getConfiguration",... | Internal loading method to decouple "sap.ui.component" / "sap.ui.component.load".
@param {object} oConfig see <code>sap.ui.component</code> / <code>sap.ui.component.load</code>
@param {object} mOptions internal loading configurations
@param {boolean} mOptions.failOnError see <code>sap.ui.component.load</code>
@param {... | [
"Internal",
"loading",
"method",
"to",
"decouple",
"sap",
".",
"ui",
".",
"component",
"/",
"sap",
".",
"ui",
".",
"component",
".",
"load",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Component.js#L2378-L3046 | train | Loads a component from the given manifest | [
30522,
3853,
7170,
9006,
29513,
3372,
1006,
1051,
8663,
8873,
2290,
1010,
9587,
16790,
2015,
1007,
1063,
13075,
1055,
18442,
1027,
1051,
8663,
8873,
2290,
1012,
2171,
1010,
7505,
2140,
1027,
1051,
8663,
8873,
2290,
1012,
24471,
2140,
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 | src/chart/parallel/ParallelSeries.js | function (activeState) {
var coordSys = this.coordinateSystem;
var data = this.getData();
var indices = [];
coordSys.eachActiveState(data, function (theActiveState, dataIndex) {
if (activeState === theActiveState) {
indices.push(data.getRawIndex(dataIndex));
... | javascript | function (activeState) {
var coordSys = this.coordinateSystem;
var data = this.getData();
var indices = [];
coordSys.eachActiveState(data, function (theActiveState, dataIndex) {
if (activeState === theActiveState) {
indices.push(data.getRawIndex(dataIndex));
... | [
"function",
"(",
"activeState",
")",
"{",
"var",
"coordSys",
"=",
"this",
".",
"coordinateSystem",
";",
"var",
"data",
"=",
"this",
".",
"getData",
"(",
")",
";",
"var",
"indices",
"=",
"[",
"]",
";",
"coordSys",
".",
"eachActiveState",
"(",
"data",
",... | User can get data raw indices on 'axisAreaSelected' event received.
@public
@param {string} activeState 'active' or 'inactive' or 'normal'
@return {Array.<number>} Raw indices | [
"User",
"can",
"get",
"data",
"raw",
"indices",
"on",
"axisAreaSelected",
"event",
"received",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/parallel/ParallelSeries.js#L47-L59 | train | Get the active index of the record | [
30522,
3853,
1006,
3161,
9153,
2618,
1007,
1063,
13075,
2522,
8551,
6508,
2015,
1027,
2023,
1012,
12093,
27268,
6633,
1025,
13075,
2951,
1027,
2023,
1012,
2131,
2850,
2696,
1006,
1007,
1025,
13075,
29299,
1027,
1031,
1033,
1025,
2522,
8551,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/util/ast-utils.js | hasJSDocThisTag | function hasJSDocThisTag(node, sourceCode) {
const jsdocComment = sourceCode.getJSDocComment(node);
if (jsdocComment && thisTagPattern.test(jsdocComment.value)) {
return true;
}
// Checks `@this` in its leading comments for callbacks,
// because callbacks don't have its JSDoc comment.
... | javascript | function hasJSDocThisTag(node, sourceCode) {
const jsdocComment = sourceCode.getJSDocComment(node);
if (jsdocComment && thisTagPattern.test(jsdocComment.value)) {
return true;
}
// Checks `@this` in its leading comments for callbacks,
// because callbacks don't have its JSDoc comment.
... | [
"function",
"hasJSDocThisTag",
"(",
"node",
",",
"sourceCode",
")",
"{",
"const",
"jsdocComment",
"=",
"sourceCode",
".",
"getJSDocComment",
"(",
"node",
")",
";",
"if",
"(",
"jsdocComment",
"&&",
"thisTagPattern",
".",
"test",
"(",
"jsdocComment",
".",
"value... | Checks whether or not a node has a `@this` tag in its comments.
@param {ASTNode} node - A node to check.
@param {SourceCode} sourceCode - A SourceCode instance to get comments.
@returns {boolean} Whether or not the node has a `@this` tag in its comments. | [
"Checks",
"whether",
"or",
"not",
"a",
"node",
"has",
"a"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/ast-utils.js#L233-L245 | train | Checks if a node has a JSDoc This tag | [
30522,
3853,
2038,
22578,
3527,
6593,
24158,
15900,
1006,
13045,
1010,
3120,
16044,
1007,
1063,
9530,
3367,
1046,
16150,
10085,
9006,
3672,
1027,
3120,
16044,
1012,
2131,
22578,
3527,
21408,
20058,
3372,
1006,
13045,
1007,
30524,
1004,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
googleapis/google-api-nodejs-client | samples/jwt.js | runSample | async function runSample() {
// Create a new JWT client using the key file downloaded from the Google Developer Console
const client = await google.auth.getClient({
keyFile: path.join(__dirname, 'jwt.keys.json'),
scopes: 'https://www.googleapis.com/auth/drive.readonly',
});
// Obtain a new drive client... | javascript | async function runSample() {
// Create a new JWT client using the key file downloaded from the Google Developer Console
const client = await google.auth.getClient({
keyFile: path.join(__dirname, 'jwt.keys.json'),
scopes: 'https://www.googleapis.com/auth/drive.readonly',
});
// Obtain a new drive client... | [
"async",
"function",
"runSample",
"(",
")",
"{",
"// Create a new JWT client using the key file downloaded from the Google Developer Console",
"const",
"client",
"=",
"await",
"google",
".",
"auth",
".",
"getClient",
"(",
"{",
"keyFile",
":",
"path",
".",
"join",
"(",
... | The JWT authorization is ideal for performing server-to-server
communication without asking for user consent.
Suggested reading for Admin SDK users using service accounts:
https://developers.google.com/admin-sdk/directory/v1/guides/delegation
See the defaultauth.js sample for an alternate way of fetching compute cred... | [
"The",
"JWT",
"authorization",
"is",
"ideal",
"for",
"performing",
"server",
"-",
"to",
"-",
"server",
"communication",
"without",
"asking",
"for",
"user",
"consent",
"."
] | e6e632a29d0b246d058e3067de3a5c3827e2b54e | https://github.com/googleapis/google-api-nodejs-client/blob/e6e632a29d0b246d058e3067de3a5c3827e2b54e/samples/jwt.js#L28-L46 | train | This sample is a sample of the sample code. | [
30522,
2004,
6038,
2278,
3853,
3216,
16613,
2571,
1006,
1007,
1063,
1013,
1013,
3443,
1037,
2047,
1046,
26677,
7396,
2478,
1996,
3145,
5371,
22817,
2013,
1996,
8224,
9722,
10122,
9530,
3367,
7396,
1027,
26751,
8224,
1012,
8740,
2705,
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 | lib/jsdoc/transform-apijson-for-sdk.js | function ({name, type, className, text=name, local=false, hrefAppend=""}) {
let sLink;
// handling module's
if (className !== undefined && (/^module:/.test(name) || /^module:/.test(className))) {
name = name.replace(/^module:/, "");
}
name = encodeURIComponent(name);
className = encodeURIComponent(clas... | javascript | function ({name, type, className, text=name, local=false, hrefAppend=""}) {
let sLink;
// handling module's
if (className !== undefined && (/^module:/.test(name) || /^module:/.test(className))) {
name = name.replace(/^module:/, "");
}
name = encodeURIComponent(name);
className = encodeURIComponent(clas... | [
"function",
"(",
"{",
"name",
",",
"type",
",",
"className",
",",
"text",
"=",
"name",
",",
"local",
"=",
"false",
",",
"hrefAppend",
"=",
"\"\"",
"}",
")",
"{",
"let",
"sLink",
";",
"// handling module's",
"if",
"(",
"className",
"!==",
"undefined",
"... | Creates a html link
@param {string} name
@param {string} type
@param {string} className
@param {string} [text=name] by default if no text is provided the name will be used
@param {boolean} [local=false]
@param {string} [hrefAppend=""]
@returns {string} link | [
"Creates",
"a",
"html",
"link"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/transform-apijson-for-sdk.js#L1394-L1417 | train | Build the link to the api | [
30522,
30524,
2465,
18442,
999,
1027,
1027,
6151,
28344,
1004,
1004,
1006,
1013,
1034,
11336,
1024,
1013,
1012,
3231,
1006,
2171,
1007,
1064,
1064,
1013,
1034,
11336,
1024,
1013,
1012,
3231,
1006,
2465,
18442,
1007,
1007,
1007,
1063,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
facebook/relay | packages/babel-plugin-relay/createModernNode.js | createModernNode | function createModernNode(
t: $FlowFixMe,
graphqlDefinition: OperationDefinitionNode | FragmentDefinitionNode,
state: BabelState,
options: {
// If an output directory is specified when running relay-compiler this should point to that directory
artifactDirectory: ?string,
// The command to run to com... | javascript | function createModernNode(
t: $FlowFixMe,
graphqlDefinition: OperationDefinitionNode | FragmentDefinitionNode,
state: BabelState,
options: {
// If an output directory is specified when running relay-compiler this should point to that directory
artifactDirectory: ?string,
// The command to run to com... | [
"function",
"createModernNode",
"(",
"t",
":",
"$FlowFixMe",
",",
"graphqlDefinition",
":",
"OperationDefinitionNode",
"|",
"FragmentDefinitionNode",
",",
"state",
":",
"BabelState",
",",
"options",
":",
"{",
"// If an output directory is specified when running relay-compiler... | Relay Modern creates separate generated files, so Babel transforms graphql
definitions to lazy require function calls. | [
"Relay",
"Modern",
"creates",
"separate",
"generated",
"files",
"so",
"Babel",
"transforms",
"graphql",
"definitions",
"to",
"lazy",
"require",
"function",
"calls",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/babel-plugin-relay/createModernNode.js#L28-L97 | train | Creates a node that can be used to compile the graphql. | [
30522,
3853,
3443,
5302,
25888,
3630,
3207,
1006,
1056,
1024,
1002,
4834,
8873,
2595,
4168,
1010,
10629,
4160,
17920,
16294,
22753,
1024,
3169,
3207,
16294,
22753,
3630,
3207,
1064,
15778,
3207,
16294,
22753,
3630,
3207,
1010,
2110,
1024,
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 | dist/react.vue.compiler.js | parseComponent | function parseComponent (
content,
options
) {
if ( options === void 0 ) options = {};
var sfc = {
template: null,
script: null,
styles: [],
customBlocks: []
};
var depth = 0;
var currentBlock = null;
function start (
tag,
attrs,
unary,
start,
end
) {
if (dep... | javascript | function parseComponent (
content,
options
) {
if ( options === void 0 ) options = {};
var sfc = {
template: null,
script: null,
styles: [],
customBlocks: []
};
var depth = 0;
var currentBlock = null;
function start (
tag,
attrs,
unary,
start,
end
) {
if (dep... | [
"function",
"parseComponent",
"(",
"content",
",",
"options",
")",
"{",
"if",
"(",
"options",
"===",
"void",
"0",
")",
"options",
"=",
"{",
"}",
";",
"var",
"sfc",
"=",
"{",
"template",
":",
"null",
",",
"script",
":",
"null",
",",
"styles",
":",
"... | Parse a single-file component (*.vue) file into an SFC Descriptor Object. | [
"Parse",
"a",
"single",
"-",
"file",
"component",
"(",
"*",
".",
"vue",
")",
"file",
"into",
"an",
"SFC",
"Descriptor",
"Object",
"."
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/dist/react.vue.compiler.js#L509-L611 | train | Parse a component | [
30522,
3853,
11968,
3366,
9006,
29513,
3372,
1006,
4180,
1010,
7047,
1007,
1063,
2065,
1006,
7047,
1027,
1027,
1027,
11675,
1014,
1007,
7047,
1027,
1063,
1065,
1025,
13075,
16420,
2278,
1027,
1063,
23561,
1024,
19701,
1010,
5896,
1024,
1970... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/vuepress | packages/vuepress/lib/handleUnknownCommand.js | registerUnknownCommands | function registerUnknownCommands (cli, options) {
cli.on('command:*', async () => {
const { args, options: commandoptions } = cli
logger.debug('global_options', options)
logger.debug('cli_options', commandoptions)
logger.debug('cli_args', args)
const [commandName] = args
const sourceDir = ar... | javascript | function registerUnknownCommands (cli, options) {
cli.on('command:*', async () => {
const { args, options: commandoptions } = cli
logger.debug('global_options', options)
logger.debug('cli_options', commandoptions)
logger.debug('cli_args', args)
const [commandName] = args
const sourceDir = ar... | [
"function",
"registerUnknownCommands",
"(",
"cli",
",",
"options",
")",
"{",
"cli",
".",
"on",
"(",
"'command:*'",
",",
"async",
"(",
")",
"=>",
"{",
"const",
"{",
"args",
",",
"options",
":",
"commandoptions",
"}",
"=",
"cli",
"logger",
".",
"debug",
... | Register a command to match all unmatched commands
@param {CAC} cli | [
"Register",
"a",
"command",
"to",
"match",
"all",
"unmatched",
"commands"
] | 15784acc0cf2e87de3c147895b2c3977b0195d78 | https://github.com/vuejs/vuepress/blob/15784acc0cf2e87de3c147895b2c3977b0195d78/packages/vuepress/lib/handleUnknownCommand.js#L76-L124 | train | Register unknown commands | [
30522,
3853,
4236,
16814,
19779,
15305,
14760,
18376,
1006,
18856,
2072,
1010,
7047,
1007,
1063,
18856,
2072,
1012,
2006,
1006,
1005,
3094,
1024,
1008,
1005,
1010,
2004,
6038,
2278,
1006,
1007,
1027,
1028,
1063,
9530,
3367,
1063,
12098,
562... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js | postMessageToBrackets | function postMessageToBrackets(messageId, requester) {
if(!requesters[requester]) {
for (var key in requesters) {
requester = key;
break;
}
}
var msgObj = {
fn: messageId,
args: getFunctionArgs(arguments),
... | javascript | function postMessageToBrackets(messageId, requester) {
if(!requesters[requester]) {
for (var key in requesters) {
requester = key;
break;
}
}
var msgObj = {
fn: messageId,
args: getFunctionArgs(arguments),
... | [
"function",
"postMessageToBrackets",
"(",
"messageId",
",",
"requester",
")",
"{",
"if",
"(",
"!",
"requesters",
"[",
"requester",
"]",
")",
"{",
"for",
"(",
"var",
"key",
"in",
"requesters",
")",
"{",
"requester",
"=",
"key",
";",
"break",
";",
"}",
"... | Posts messages to brackets
@param {string} messageId - Message to be passed | [
"Posts",
"messages",
"to",
"brackets"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L92-L106 | train | Post a message to brackets | [
30522,
3853,
2695,
7834,
3736,
18150,
16429,
22648,
3489,
3215,
1006,
4471,
3593,
1010,
5227,
2121,
1007,
1063,
2065,
1006,
999,
5227,
2545,
1031,
5227,
2121,
1033,
1007,
1063,
2005,
1006,
13075,
3145,
1999,
5227,
2545,
1007,
1063,
5227,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-unused-vars.js | hasRestSpreadSibling | function hasRestSpreadSibling(variable) {
if (config.ignoreRestSiblings) {
return variable.defs.some(def => {
const propertyNode = def.name.parent;
const patternNode = propertyNode.parent;
return (
propertyN... | javascript | function hasRestSpreadSibling(variable) {
if (config.ignoreRestSiblings) {
return variable.defs.some(def => {
const propertyNode = def.name.parent;
const patternNode = propertyNode.parent;
return (
propertyN... | [
"function",
"hasRestSpreadSibling",
"(",
"variable",
")",
"{",
"if",
"(",
"config",
".",
"ignoreRestSiblings",
")",
"{",
"return",
"variable",
".",
"defs",
".",
"some",
"(",
"def",
"=>",
"{",
"const",
"propertyNode",
"=",
"def",
".",
"name",
".",
"parent",... | Determines if a variable has a sibling rest property
@param {Variable} variable - eslint-scope variable object.
@returns {boolean} True if the variable is exported, false if not.
@private | [
"Determines",
"if",
"a",
"variable",
"has",
"a",
"sibling",
"rest",
"property"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-unused-vars.js#L179-L194 | train | returns true if variable has a rest sibling | [
30522,
3853,
2038,
28533,
13102,
16416,
5104,
12322,
2989,
1006,
8023,
1007,
1063,
2065,
1006,
9530,
8873,
2290,
1012,
8568,
28533,
5332,
9709,
2015,
1007,
1063,
2709,
8023,
1012,
13366,
2015,
1012,
2070,
1006,
13366,
1027,
1028,
1063,
9530... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/gesture/gesture.js | makeStartPointer | function makeStartPointer(ev) {
var point = getEventPoint(ev);
var startPointer = {
startTime: +Date.now(),
target: ev.target,
// 'p' for pointer events, 'm' for mouse, 't' for touch
type: ev.type.charAt(0)
};
startPointer.startX = startPointer.x = point.pageX;
startPointer.startY = startPoint... | javascript | function makeStartPointer(ev) {
var point = getEventPoint(ev);
var startPointer = {
startTime: +Date.now(),
target: ev.target,
// 'p' for pointer events, 'm' for mouse, 't' for touch
type: ev.type.charAt(0)
};
startPointer.startX = startPointer.x = point.pageX;
startPointer.startY = startPoint... | [
"function",
"makeStartPointer",
"(",
"ev",
")",
"{",
"var",
"point",
"=",
"getEventPoint",
"(",
"ev",
")",
";",
"var",
"startPointer",
"=",
"{",
"startTime",
":",
"+",
"Date",
".",
"now",
"(",
")",
",",
"target",
":",
"ev",
".",
"target",
",",
"// 'p... | ******************** Module Functions ******************** /*
Initiate the pointer. x, y, and the pointer's type. | [
"********************",
"Module",
"Functions",
"********************",
"/",
"*",
"Initiate",
"the",
"pointer",
".",
"x",
"y",
"and",
"the",
"pointer",
"s",
"type",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/gesture/gesture.js#L704-L715 | train | Creates a start pointer object | [
30522,
3853,
3084,
7559,
25856,
25785,
2121,
1006,
23408,
1007,
1063,
13075,
2391,
1027,
2131,
18697,
3372,
8400,
1006,
23408,
1007,
1025,
13075,
2707,
8400,
2121,
1027,
1063,
2707,
7292,
1024,
1009,
3058,
1012,
2085,
1006,
1007,
1010,
4539... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/semi.js | isOnSameLineWithNextToken | function isOnSameLineWithNextToken(node) {
const prevToken = sourceCode.getLastToken(node, 1);
const nextToken = sourceCode.getTokenAfter(node);
return !!nextToken && astUtils.isTokenOnSameLine(prevToken, nextToken);
} | javascript | function isOnSameLineWithNextToken(node) {
const prevToken = sourceCode.getLastToken(node, 1);
const nextToken = sourceCode.getTokenAfter(node);
return !!nextToken && astUtils.isTokenOnSameLine(prevToken, nextToken);
} | [
"function",
"isOnSameLineWithNextToken",
"(",
"node",
")",
"{",
"const",
"prevToken",
"=",
"sourceCode",
".",
"getLastToken",
"(",
"node",
",",
"1",
")",
";",
"const",
"nextToken",
"=",
"sourceCode",
".",
"getTokenAfter",
"(",
"node",
")",
";",
"return",
"!"... | Check whether a given node is on the same line with the next token.
@param {Node} node A statement node to check.
@returns {boolean} `true` if the node is on the same line with the next token. | [
"Check",
"whether",
"a",
"given",
"node",
"is",
"on",
"the",
"same",
"line",
"with",
"the",
"next",
"token",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/semi.js#L166-L171 | train | Check if node is on same line with the next token | [
30522,
3853,
11163,
3619,
14074,
4179,
24415,
2638,
18413,
18715,
2368,
1006,
13045,
1007,
1063,
9530,
3367,
3653,
2615,
18715,
2368,
1027,
3120,
16044,
1012,
2131,
8523,
9284,
7520,
1006,
13045,
1010,
1015,
1007,
1025,
9530,
3367,
2279,
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... |
aframevr/aframe | src/systems/material.js | fixVideoAttributes | function fixVideoAttributes (videoEl) {
videoEl.autoplay = videoEl.hasAttribute('autoplay') && videoEl.getAttribute('autoplay') !== 'false';
videoEl.controls = videoEl.hasAttribute('controls') && videoEl.getAttribute('controls') !== 'false';
if (videoEl.getAttribute('loop') === 'false') {
videoEl.removeAttrib... | javascript | function fixVideoAttributes (videoEl) {
videoEl.autoplay = videoEl.hasAttribute('autoplay') && videoEl.getAttribute('autoplay') !== 'false';
videoEl.controls = videoEl.hasAttribute('controls') && videoEl.getAttribute('controls') !== 'false';
if (videoEl.getAttribute('loop') === 'false') {
videoEl.removeAttrib... | [
"function",
"fixVideoAttributes",
"(",
"videoEl",
")",
"{",
"videoEl",
".",
"autoplay",
"=",
"videoEl",
".",
"hasAttribute",
"(",
"'autoplay'",
")",
"&&",
"videoEl",
".",
"getAttribute",
"(",
"'autoplay'",
")",
"!==",
"'false'",
";",
"videoEl",
".",
"controls"... | Fixes a video element's attributes to prevent developers from accidentally passing the
wrong attribute values to commonly misused video attributes.
<video> does not treat `autoplay`, `controls`, `crossorigin`, `loop`, and `preload` as
as booleans. Existence of those attributes will mean truthy.
For example, translate... | [
"Fixes",
"a",
"video",
"element",
"s",
"attributes",
"to",
"prevent",
"developers",
"from",
"accidentally",
"passing",
"the",
"wrong",
"attribute",
"values",
"to",
"commonly",
"misused",
"video",
"attributes",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/systems/material.js#L389-L403 | train | Fixes the video attributes | [
30522,
3853,
8081,
17258,
8780,
19321,
30524,
2618,
1006,
1005,
8285,
13068,
1005,
1007,
1004,
1004,
2678,
2884,
1012,
2131,
19321,
3089,
8569,
2618,
1006,
1005,
8285,
13068,
1005,
1007,
999,
1027,
1027,
1005,
6270,
1005,
1025,
2678,
2884,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/node/selenium-webdriver/lib/logging.js | getLevel | function getLevel(nameOrValue) {
if (typeof nameOrValue === 'string') {
return LEVELS_BY_NAME.get(nameOrValue) || Level.ALL;
}
if (typeof nameOrValue !== 'number') {
throw new TypeError('not a string or number');
}
for (let level of ALL_LEVELS) {
if (nameOrValue >= level.value) {
return leve... | javascript | function getLevel(nameOrValue) {
if (typeof nameOrValue === 'string') {
return LEVELS_BY_NAME.get(nameOrValue) || Level.ALL;
}
if (typeof nameOrValue !== 'number') {
throw new TypeError('not a string or number');
}
for (let level of ALL_LEVELS) {
if (nameOrValue >= level.value) {
return leve... | [
"function",
"getLevel",
"(",
"nameOrValue",
")",
"{",
"if",
"(",
"typeof",
"nameOrValue",
"===",
"'string'",
")",
"{",
"return",
"LEVELS_BY_NAME",
".",
"get",
"(",
"nameOrValue",
")",
"||",
"Level",
".",
"ALL",
";",
"}",
"if",
"(",
"typeof",
"nameOrValue",... | Converts a level name or value to a {@link Level} value. If the name/value
is not recognized, {@link Level.ALL} will be returned.
@param {(number|string)} nameOrValue The log level name, or value, to
convert.
@return {!Level} The converted level. | [
"Converts",
"a",
"level",
"name",
"or",
"value",
"to",
"a",
"{",
"@link",
"Level",
"}",
"value",
".",
"If",
"the",
"name",
"/",
"value",
"is",
"not",
"recognized",
"{",
"@link",
"Level",
".",
"ALL",
"}",
"will",
"be",
"returned",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/lib/logging.js#L202-L215 | train | Get the level of a given name or value | [
30522,
3853,
2131,
20414,
2884,
1006,
2171,
2953,
10175,
5657,
1007,
1063,
2065,
1006,
2828,
11253,
2171,
2953,
10175,
5657,
1027,
1027,
1027,
1005,
5164,
1005,
1007,
1063,
2709,
3798,
1035,
2011,
1035,
2171,
1012,
2131,
1006,
2171,
2953,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
catapult-project/catapult | tracing/third_party/oboe/src/lists.js | foldR | function foldR(fn, startValue, list) {
return list
? fn(foldR(fn, startValue, tail(list)), head(list))
: startValue
;
} | javascript | function foldR(fn, startValue, list) {
return list
? fn(foldR(fn, startValue, tail(list)), head(list))
: startValue
;
} | [
"function",
"foldR",
"(",
"fn",
",",
"startValue",
",",
"list",
")",
"{",
"return",
"list",
"?",
"fn",
"(",
"foldR",
"(",
"fn",
",",
"startValue",
",",
"tail",
"(",
"list",
")",
")",
",",
"head",
"(",
"list",
")",
")",
":",
"startValue",
";",
"}"... | foldR implementation. Reduce a list down to a single value.
@pram {Function} fn (rightEval, curVal) -> result | [
"foldR",
"implementation",
".",
"Reduce",
"a",
"list",
"down",
"to",
"a",
"single",
"value",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L102-L108 | train | Augmented function over the list of items in the list. | [
30522,
3853,
10671,
2099,
1006,
1042,
2078,
1010,
2707,
10175,
5657,
1010,
2862,
1007,
1063,
2709,
2862,
1029,
1042,
2078,
1006,
10671,
2099,
1006,
1042,
2078,
1010,
2707,
10175,
5657,
1010,
5725,
1006,
2862,
1007,
1007,
1010,
2132,
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/extensions/default/JavaScriptCodeHints/main.js | getSessionHints | function getSessionHints(query, cursor, type, token, $deferredHints) {
var hintResults = session.getHints(query, getStringMatcher());
if (hintResults.needGuesses) {
var guessesResponse = ScopeManager.requestGuesses(session,
session.editor.document);
if (!$deferr... | javascript | function getSessionHints(query, cursor, type, token, $deferredHints) {
var hintResults = session.getHints(query, getStringMatcher());
if (hintResults.needGuesses) {
var guessesResponse = ScopeManager.requestGuesses(session,
session.editor.document);
if (!$deferr... | [
"function",
"getSessionHints",
"(",
"query",
",",
"cursor",
",",
"type",
",",
"token",
",",
"$deferredHints",
")",
"{",
"var",
"hintResults",
"=",
"session",
".",
"getHints",
"(",
"query",
",",
"getStringMatcher",
"(",
")",
")",
";",
"if",
"(",
"hintResult... | Common code to get the session hints. Will get guesses if there were
no completions for the query.
@param {string} query - user text to search hints with
@param {{line:number, ch:number}} cursor - the location where the hints
were created.
@param {{property: boolean,
showFunctionType:boolean,
context: string,
function... | [
"Common",
"code",
"to",
"get",
"the",
"session",
"hints",
".",
"Will",
"get",
"guesses",
"if",
"there",
"were",
"no",
"completions",
"for",
"the",
"query",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptCodeHints/main.js#L442-L476 | train | Get session hints | [
30522,
3853,
4152,
7971,
3258,
10606,
3215,
1006,
23032,
1010,
12731,
25301,
2099,
1010,
2828,
1010,
19204,
1010,
1002,
13366,
28849,
19114,
7666,
1007,
1063,
13075,
9374,
6072,
11314,
2015,
1027,
5219,
1012,
2131,
10606,
3215,
1006,
23032,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ghost-server.js | GhostServer | function GhostServer(rootApp) {
this.rootApp = rootApp;
this.httpServer = null;
this.connections = {};
this.connectionId = 0;
// Expose config module for use externally.
this.config = config;
} | javascript | function GhostServer(rootApp) {
this.rootApp = rootApp;
this.httpServer = null;
this.connections = {};
this.connectionId = 0;
// Expose config module for use externally.
this.config = config;
} | [
"function",
"GhostServer",
"(",
"rootApp",
")",
"{",
"this",
".",
"rootApp",
"=",
"rootApp",
";",
"this",
".",
"httpServer",
"=",
"null",
";",
"this",
".",
"connections",
"=",
"{",
"}",
";",
"this",
".",
"connectionId",
"=",
"0",
";",
"// Expose config m... | ## GhostServer
@constructor
@param {Object} rootApp - parent express instance | [
"##",
"GhostServer"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/ghost-server.js#L18-L26 | train | GhostServer constructor. | [
30522,
3853,
11277,
2121,
6299,
1006,
7117,
29098,
1007,
1063,
2023,
1012,
7117,
29098,
1027,
7117,
29098,
1025,
2023,
1012,
16770,
2121,
6299,
1027,
19701,
1025,
2023,
1012,
7264,
1027,
1063,
1065,
1025,
2023,
1012,
4434,
3593,
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... |
elastic/elasticsearch-js | api/api/update_by_query.js | buildUpdateByQuery | function buildUpdateByQuery (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [update_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html) request
*
* @param {list... | javascript | function buildUpdateByQuery (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [update_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html) request
*
* @param {list... | [
"function",
"buildUpdateByQuery",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [update_by_query](https://www.elastic.... | /* eslint camelcase: 0 /* eslint no-unused-vars: 0 | [
"/",
"*",
"eslint",
"camelcase",
":",
"0",
"/",
"*",
"eslint",
"no",
"-",
"unused",
"-",
"vars",
":",
"0"
] | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/api/update_by_query.js#L25-L195 | train | Build an update by query | [
30522,
3853,
3857,
6279,
13701,
3762,
4226,
2854,
1006,
23569,
2015,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2279,
1011,
2240,
2053,
1011,
15171,
1011,
13075,
2015,
9530,
3367,
1063,
9338,
2063,
15500,
1010,
9563,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | scripts/changelog/util.js | addVersionJSONToChangelog | function addVersionJSONToChangelog(version, changes) {
if (!changelog) readChangelog();
var entry = '\n\n## ' + version;
changes.forEach(function(change) {
entry += '\n* ' + change.type + ': ' + change.category + ': ' +
change.description;
});
var logParts = changelog.split(insertMarker);
logParts[0] = log... | javascript | function addVersionJSONToChangelog(version, changes) {
if (!changelog) readChangelog();
var entry = '\n\n## ' + version;
changes.forEach(function(change) {
entry += '\n* ' + change.type + ': ' + change.category + ': ' +
change.description;
});
var logParts = changelog.split(insertMarker);
logParts[0] = log... | [
"function",
"addVersionJSONToChangelog",
"(",
"version",
",",
"changes",
")",
"{",
"if",
"(",
"!",
"changelog",
")",
"readChangelog",
"(",
")",
";",
"var",
"entry",
"=",
"'\\n\\n## '",
"+",
"version",
";",
"changes",
".",
"forEach",
"(",
"function",
"(",
"... | This will not to write to file writeToChangelog must be called after | [
"This",
"will",
"not",
"to",
"write",
"to",
"file",
"writeToChangelog",
"must",
"be",
"called",
"after"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/scripts/changelog/util.js#L137-L150 | train | Add version to changelog | [
30522,
3853,
5587,
27774,
22578,
12162,
11663,
22043,
21197,
1006,
2544,
1010,
3431,
1007,
1063,
2065,
1006,
999,
2689,
21197,
1007,
3191,
22305,
18349,
2290,
1006,
1007,
1025,
13075,
4443,
1027,
1005,
1032,
1050,
1032,
1050,
1001,
1001,
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... |
jiahaog/nativefier | src/helpers/convertToIcns.js | convertToIcnsTmp | function convertToIcnsTmp(pngSrc, callback) {
const tempIconDirObj = tmp.dirSync({ unsafeCleanup: true });
const tempIconDirPath = tempIconDirObj.name;
convertToIcns(pngSrc, `${tempIconDirPath}/icon.icns`, callback);
} | javascript | function convertToIcnsTmp(pngSrc, callback) {
const tempIconDirObj = tmp.dirSync({ unsafeCleanup: true });
const tempIconDirPath = tempIconDirObj.name;
convertToIcns(pngSrc, `${tempIconDirPath}/icon.icns`, callback);
} | [
"function",
"convertToIcnsTmp",
"(",
"pngSrc",
",",
"callback",
")",
"{",
"const",
"tempIconDirObj",
"=",
"tmp",
".",
"dirSync",
"(",
"{",
"unsafeCleanup",
":",
"true",
"}",
")",
";",
"const",
"tempIconDirPath",
"=",
"tempIconDirObj",
".",
"name",
";",
"conv... | Converts the png to a temporary directory which will be cleaned up on process exit
@param {string} pngSrc
@param {pngToIcnsCallback} callback | [
"Converts",
"the",
"png",
"to",
"a",
"temporary",
"directory",
"which",
"will",
"be",
"cleaned",
"up",
"on",
"process",
"exit"
] | b959956a38ce51a9dd95d42308f0a6c66489b624 | https://github.com/jiahaog/nativefier/blob/b959956a38ce51a9dd95d42308f0a6c66489b624/src/helpers/convertToIcns.js#L59-L63 | train | Convert image to Icns | [
30522,
3853,
10463,
3406,
2594,
23808,
8737,
1006,
1052,
3070,
21338,
2278,
1010,
2655,
5963,
1007,
1063,
9530,
3367,
8915,
8737,
28524,
4305,
3217,
2497,
3501,
1027,
1056,
8737,
1012,
16101,
6508,
12273,
1006,
1063,
25135,
14321,
24076,
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... |
openlayers/openlayers | src/ol/geom/flat/closest.js | assignClosest | function assignClosest(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) {
const x1 = flatCoordinates[offset1];
const y1 = flatCoordinates[offset1 + 1];
const dx = flatCoordinates[offset2] - x1;
const dy = flatCoordinates[offset2 + 1] - y1;
let offset;
if (dx === 0 && dy === 0) {
offset = o... | javascript | function assignClosest(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) {
const x1 = flatCoordinates[offset1];
const y1 = flatCoordinates[offset1 + 1];
const dx = flatCoordinates[offset2] - x1;
const dy = flatCoordinates[offset2 + 1] - y1;
let offset;
if (dx === 0 && dy === 0) {
offset = o... | [
"function",
"assignClosest",
"(",
"flatCoordinates",
",",
"offset1",
",",
"offset2",
",",
"stride",
",",
"x",
",",
"y",
",",
"closestPoint",
")",
"{",
"const",
"x1",
"=",
"flatCoordinates",
"[",
"offset1",
"]",
";",
"const",
"y1",
"=",
"flatCoordinates",
"... | Returns the point on the 2D line segment flatCoordinates[offset1] to
flatCoordinates[offset2] that is closest to the point (x, y). Extra
dimensions are linearly interpolated.
@param {Array<number>} flatCoordinates Flat coordinates.
@param {number} offset1 Offset 1.
@param {number} offset2 Offset 2.
@param {number} str... | [
"Returns",
"the",
"point",
"on",
"the",
"2D",
"line",
"segment",
"flatCoordinates",
"[",
"offset1",
"]",
"to",
"flatCoordinates",
"[",
"offset2",
"]",
"that",
"is",
"closest",
"to",
"the",
"point",
"(",
"x",
"y",
")",
".",
"Extra",
"dimensions",
"are",
"... | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/geom/flat/closest.js#L19-L46 | train | assigns the closest point to the given coordinates | [
30522,
3853,
23911,
20464,
27465,
2102,
1006,
4257,
3597,
8551,
28184,
1010,
16396,
2487,
1010,
16396,
2475,
1010,
18045,
1010,
1060,
1010,
1061,
1010,
7541,
8400,
1007,
1063,
9530,
3367,
1060,
2487,
1027,
4257,
3597,
8551,
28184,
1031,
163... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | lib/credentials/cognito_identity_credentials.js | clearCache | function clearCache() {
this._identityId = null;
delete this.params.IdentityId;
var poolId = this.params.IdentityPoolId;
var loginId = this.params.LoginId || '';
delete this.storage[this.localStorageKey.id + poolId + loginId];
delete this.storage[this.localStorageKey.providers + poolId + loginI... | javascript | function clearCache() {
this._identityId = null;
delete this.params.IdentityId;
var poolId = this.params.IdentityPoolId;
var loginId = this.params.LoginId || '';
delete this.storage[this.localStorageKey.id + poolId + loginId];
delete this.storage[this.localStorageKey.providers + poolId + loginI... | [
"function",
"clearCache",
"(",
")",
"{",
"this",
".",
"_identityId",
"=",
"null",
";",
"delete",
"this",
".",
"params",
".",
"IdentityId",
";",
"var",
"poolId",
"=",
"this",
".",
"params",
".",
"IdentityPoolId",
";",
"var",
"loginId",
"=",
"this",
".",
... | Clears the cached Cognito ID associated with the currently configured
identity pool ID. Use this to manually invalidate your cache if
the identity pool ID was deleted. | [
"Clears",
"the",
"cached",
"Cognito",
"ID",
"associated",
"with",
"the",
"currently",
"configured",
"identity",
"pool",
"ID",
".",
"Use",
"this",
"to",
"manually",
"invalidate",
"your",
"cache",
"if",
"the",
"identity",
"pool",
"ID",
"was",
"deleted",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/credentials/cognito_identity_credentials.js#L191-L199 | train | Clear the cache | [
30522,
3853,
3154,
3540,
5403,
1006,
1007,
1063,
2023,
1012,
1035,
4767,
3593,
1027,
19701,
1025,
3972,
12870,
2023,
1012,
11498,
5244,
1012,
4767,
3593,
1025,
13075,
4770,
3593,
1027,
2023,
1012,
11498,
5244,
1012,
4767,
16869,
3593,
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... |
electron/electron | lib/browser/chrome-extension.js | function (srcDirectory) {
let manifest
let manifestContent
try {
manifestContent = fs.readFileSync(path.join(srcDirectory, 'manifest.json'))
} catch (readError) {
console.warn(`Reading ${path.join(srcDirectory, 'manifest.json')} failed.`)
console.warn(readError.stack || readError)
throw readErr... | javascript | function (srcDirectory) {
let manifest
let manifestContent
try {
manifestContent = fs.readFileSync(path.join(srcDirectory, 'manifest.json'))
} catch (readError) {
console.warn(`Reading ${path.join(srcDirectory, 'manifest.json')} failed.`)
console.warn(readError.stack || readError)
throw readErr... | [
"function",
"(",
"srcDirectory",
")",
"{",
"let",
"manifest",
"let",
"manifestContent",
"try",
"{",
"manifestContent",
"=",
"fs",
".",
"readFileSync",
"(",
"path",
".",
"join",
"(",
"srcDirectory",
",",
"'manifest.json'",
")",
")",
"}",
"catch",
"(",
"readEr... | Create or get manifest object from |srcDirectory|. | [
"Create",
"or",
"get",
"manifest",
"object",
"from",
"|srcDirectory|",
"."
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/chrome-extension.js#L33-L73 | train | Load extension from a directory | [
30522,
3853,
1006,
5034,
19797,
7442,
16761,
2100,
1007,
1063,
2292,
19676,
2292,
19676,
8663,
6528,
2102,
3046,
1063,
19676,
8663,
6528,
2102,
1027,
1042,
2015,
1012,
3191,
8873,
4244,
6038,
2278,
1006,
4130,
1012,
3693,
1006,
5034,
19797,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jgraph/mxgraph | javascript/mxClient.js | function(expr)
{
var result = null;
if (expr.indexOf('function') >= 0)
{
try
{
eval('var _mxJavaScriptExpression='+expr);
result = _mxJavaScriptExpression;
// TODO: Use delete here?
_mxJavaScriptExpression = null;
}
catch (e)
{
mxLog.warn(e.message + ' while evaluating ' + exp... | javascript | function(expr)
{
var result = null;
if (expr.indexOf('function') >= 0)
{
try
{
eval('var _mxJavaScriptExpression='+expr);
result = _mxJavaScriptExpression;
// TODO: Use delete here?
_mxJavaScriptExpression = null;
}
catch (e)
{
mxLog.warn(e.message + ' while evaluating ' + exp... | [
"function",
"(",
"expr",
")",
"{",
"var",
"result",
"=",
"null",
";",
"if",
"(",
"expr",
".",
"indexOf",
"(",
"'function'",
")",
">=",
"0",
")",
"{",
"try",
"{",
"eval",
"(",
"'var _mxJavaScriptExpression='",
"+",
"expr",
")",
";",
"result",
"=",
"_m... | Function: eval
Evaluates the given expression using eval and returns the JavaScript
object that represents the expression result. Supports evaluation of
expressions that define functions and returns the function object for
these expressions.
Parameters:
expr - A string that represents a JavaScript expression. | [
"Function",
":",
"eval"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L2358-L2389 | train | eval the expression | [
30522,
3853,
1006,
4654,
18098,
1007,
1063,
13075,
2765,
1027,
19701,
1025,
2065,
1006,
4654,
18098,
1012,
5950,
11253,
1006,
1005,
3853,
1005,
1007,
1028,
1027,
1014,
1007,
1063,
3046,
1063,
9345,
2140,
1006,
1005,
13075,
1035,
25630,
3900... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/preferences/PreferencesBase.js | FileStorage | function FileStorage(path, createIfMissing, recreateIfInvalid) {
this.path = path;
this.createIfMissing = createIfMissing;
this.recreateIfInvalid = recreateIfInvalid;
this._lineEndings = FileUtils.getPlatformLineEndings();
} | javascript | function FileStorage(path, createIfMissing, recreateIfInvalid) {
this.path = path;
this.createIfMissing = createIfMissing;
this.recreateIfInvalid = recreateIfInvalid;
this._lineEndings = FileUtils.getPlatformLineEndings();
} | [
"function",
"FileStorage",
"(",
"path",
",",
"createIfMissing",
",",
"recreateIfInvalid",
")",
"{",
"this",
".",
"path",
"=",
"path",
";",
"this",
".",
"createIfMissing",
"=",
"createIfMissing",
";",
"this",
".",
"recreateIfInvalid",
"=",
"recreateIfInvalid",
";... | Loads/saves preferences from a JSON file on disk.
@constructor
@param {string} path Path to the preferences file
@param {boolean} createIfMissing True if the file should be created if it doesn't exist.
If this is not true, an exception will be thrown if the
file does not exist.
@param {boolean} recreateIfInval... | [
"Loads",
"/",
"saves",
"preferences",
"from",
"a",
"JSON",
"file",
"on",
"disk",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L155-L160 | train | FileStorage constructor. | [
30522,
3853,
6764,
4263,
4270,
1006,
4130,
1010,
3443,
10128,
15630,
7741,
1010,
28667,
29313,
10128,
2378,
10175,
3593,
1007,
1063,
2023,
1012,
4130,
1027,
4130,
1025,
2023,
1012,
3443,
10128,
15630,
7741,
1027,
3443,
10128,
15630,
7741,
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... |
SheetJS/js-xlsx | xlsx.js | parse_BoolErr | function parse_BoolErr(blob, length, opts) {
var cell = parse_XLSCell(blob, 6);
if(opts.biff == 2) ++blob.l;
var val = parse_Bes(blob, 2);
cell.val = val;
cell.t = (val === true || val === false) ? 'b' : 'e';
return cell;
} | javascript | function parse_BoolErr(blob, length, opts) {
var cell = parse_XLSCell(blob, 6);
if(opts.biff == 2) ++blob.l;
var val = parse_Bes(blob, 2);
cell.val = val;
cell.t = (val === true || val === false) ? 'b' : 'e';
return cell;
} | [
"function",
"parse_BoolErr",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"var",
"cell",
"=",
"parse_XLSCell",
"(",
"blob",
",",
"6",
")",
";",
"if",
"(",
"opts",
".",
"biff",
"==",
"2",
")",
"++",
"blob",
".",
"l",
";",
"var",
"val",
"=",
... | /* [MS-XLS] 2.4.24 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"4",
".",
"24"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L6151-L6158 | train | Parse bool error cell | [
30522,
3853,
11968,
3366,
1035,
22017,
3917,
2099,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
13075,
3526,
1027,
11968,
3366,
1035,
28712,
11020,
5349,
1006,
1038,
4135,
2497,
1010,
1020,
1007,
1025,
2065,
1006,
2356... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.