repo stringclasses 195
values | path stringlengths 4 99 | func_name stringlengths 0 41 | original_string stringlengths 72 56.1k | language stringclasses 1
value | code stringlengths 72 56.1k | code_tokens listlengths 25 8.12k | docstring stringlengths 2 12.5k | docstring_tokens listlengths 1 449 | sha stringclasses 197
values | url stringlengths 88 186 | partition stringclasses 1
value | summary stringlengths 8 338 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
adobe/brackets | src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js | checkInstallerStatus | function checkInstallerStatus(requester, searchParams) {
var installErrorStr = searchParams.installErrorStr,
bracketsErrorStr = searchParams.bracketsErrorStr,
updateDirectory = searchParams.updateDir,
encoding = searchParams.encoding || "utf8",
statusObj = ... | javascript | function checkInstallerStatus(requester, searchParams) {
var installErrorStr = searchParams.installErrorStr,
bracketsErrorStr = searchParams.bracketsErrorStr,
updateDirectory = searchParams.updateDir,
encoding = searchParams.encoding || "utf8",
statusObj = ... | [
"function",
"checkInstallerStatus",
"(",
"requester",
",",
"searchParams",
")",
"{",
"var",
"installErrorStr",
"=",
"searchParams",
".",
"installErrorStr",
",",
"bracketsErrorStr",
"=",
"searchParams",
".",
"bracketsErrorStr",
",",
"updateDirectory",
"=",
"searchParams"... | one it finds the line which has any of error String
after parsing the Log
it notifies the bracket.
@param{Object} searchParams is object contains Information Error String
Encoding of Log File Update Diectory Path. | [
"one",
"it",
"finds",
"the",
"line",
"which",
"has",
"any",
"of",
"error",
"String",
"after",
"parsing",
"the",
"Log",
"it",
"notifies",
"the",
"bracket",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L224-L264 | train | check installer status | [
30522,
3853,
4638,
7076,
9080,
12910,
29336,
2271,
1006,
5227,
2121,
1010,
3945,
28689,
5244,
1007,
1063,
13075,
16500,
2121,
29165,
3367,
2099,
1027,
3945,
28689,
5244,
1012,
16500,
2121,
29165,
3367,
2099,
1010,
19719,
2121,
29165,
3367,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/model/formatter.js | function (sText) {
return JSDocUtil.formatTextBlock(sText, {
linkFormatter: function (target, text) {
var iHashIndex;
// If the link has a protocol, do not modify, but open in a new window
if (target.match("://")) {
return '<a target="_blank" href="' + target + '">' + (text || target) + '<... | javascript | function (sText) {
return JSDocUtil.formatTextBlock(sText, {
linkFormatter: function (target, text) {
var iHashIndex;
// If the link has a protocol, do not modify, but open in a new window
if (target.match("://")) {
return '<a target="_blank" href="' + target + '">' + (text || target) + '<... | [
"function",
"(",
"sText",
")",
"{",
"return",
"JSDocUtil",
".",
"formatTextBlock",
"(",
"sText",
",",
"{",
"linkFormatter",
":",
"function",
"(",
"target",
",",
"text",
")",
"{",
"var",
"iHashIndex",
";",
"// If the link has a protocol, do not modify, but open in a ... | This function wraps a text in a span tag so that it can be represented in an HTML control.
@param {string} sText
@returns {string}
@private | [
"This",
"function",
"wraps",
"a",
"text",
"in",
"a",
"span",
"tag",
"so",
"that",
"it",
"can",
"be",
"represented",
"in",
"an",
"HTML",
"control",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/model/formatter.js#L134-L178 | train | Format the text of a link | [
30522,
3853,
1006,
26261,
18413,
1007,
1063,
2709,
1046,
16150,
10085,
21823,
2140,
1012,
4289,
18209,
23467,
1006,
26261,
18413,
1010,
1063,
4957,
14192,
20097,
1024,
3853,
1006,
4539,
1010,
3793,
1007,
1063,
13075,
1045,
14949,
10606,
3207,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
Shopify/draggable | src/Plugins/SwapAnimation/SwapAnimation.js | animate | function animate(from, to, {duration, easingFunction, horizontal}) {
for (const element of [from, to]) {
element.style.pointerEvents = 'none';
}
if (horizontal) {
const width = from.offsetWidth;
from.style.transform = `translate3d(${width}px, 0, 0)`;
to.style.transform = `translate3d(-${width}px,... | javascript | function animate(from, to, {duration, easingFunction, horizontal}) {
for (const element of [from, to]) {
element.style.pointerEvents = 'none';
}
if (horizontal) {
const width = from.offsetWidth;
from.style.transform = `translate3d(${width}px, 0, 0)`;
to.style.transform = `translate3d(-${width}px,... | [
"function",
"animate",
"(",
"from",
",",
"to",
",",
"{",
"duration",
",",
"easingFunction",
",",
"horizontal",
"}",
")",
"{",
"for",
"(",
"const",
"element",
"of",
"[",
"from",
",",
"to",
"]",
")",
"{",
"element",
".",
"style",
".",
"pointerEvents",
... | Animates two elements
@param {HTMLElement} from
@param {HTMLElement} to
@param {Object} options
@param {Number} options.duration
@param {String} options.easingFunction
@param {String} options.horizontal
@private | [
"Animates",
"two",
"elements"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Plugins/SwapAnimation/SwapAnimation.js#L109-L131 | train | Animate from element to element | [
30522,
3853,
2019,
21499,
1006,
2013,
1010,
2000,
1010,
1063,
9367,
1010,
24070,
11263,
27989,
1010,
9876,
1065,
1007,
1063,
2005,
1006,
9530,
3367,
5783,
1997,
1031,
2013,
1010,
2000,
1033,
1007,
1063,
5783,
1012,
2806,
1012,
20884,
18697,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws-amplify/amplify-js | packages/amazon-cognito-identity-js/src/BigInteger.js | bnpLShiftTo | function bnpLShiftTo(n, r) {
var bs = n % this.DB;
var cbs = this.DB - bs;
var bm = (1 << cbs) - 1;
var ds = Math.floor(n / this.DB), c = this.s << bs & this.DM, i;
for (i = this.t - 1; i >= 0; --i) {
r[i + ds + 1] = this[i] >> cbs | c;
c = (this[i] & bm) << bs;
}
for (i = ds - 1; i >= 0; --i)
... | javascript | function bnpLShiftTo(n, r) {
var bs = n % this.DB;
var cbs = this.DB - bs;
var bm = (1 << cbs) - 1;
var ds = Math.floor(n / this.DB), c = this.s << bs & this.DM, i;
for (i = this.t - 1; i >= 0; --i) {
r[i + ds + 1] = this[i] >> cbs | c;
c = (this[i] & bm) << bs;
}
for (i = ds - 1; i >= 0; --i)
... | [
"function",
"bnpLShiftTo",
"(",
"n",
",",
"r",
")",
"{",
"var",
"bs",
"=",
"n",
"%",
"this",
".",
"DB",
";",
"var",
"cbs",
"=",
"this",
".",
"DB",
"-",
"bs",
";",
"var",
"bm",
"=",
"(",
"1",
"<<",
"cbs",
")",
"-",
"1",
";",
"var",
"ds",
"... | (protected) r = this << n | [
"(",
"protected",
")",
"r",
"=",
"this",
"<<",
"n"
] | db55ff3dff31c64a246180f39eb0a04a89fd16e1 | https://github.com/aws-amplify/amplify-js/blob/db55ff3dff31c64a246180f39eb0a04a89fd16e1/packages/amazon-cognito-identity-js/src/BigInteger.js#L335-L350 | train | Shifts this sequence by n to the right of the given sequence. | [
30522,
3853,
24869,
24759,
6182,
6199,
3406,
1006,
1050,
1010,
1054,
1007,
1063,
13075,
18667,
1027,
1050,
1003,
2023,
1012,
16962,
1025,
13075,
6568,
1027,
2023,
1012,
16962,
1011,
18667,
1025,
13075,
1038,
2213,
1027,
1006,
1015,
1026,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js | checkKeys | function checkKeys(oDetails, mAllowedKeys2Type, sName) {
var sKey;
function error(sMessage) {
if (sName) {
sMessage += " at property: " + sName;
}
throw new Error(sMessage);
}
function typeOf(vValue) {
return Array.isArray(vValue) ? "array" : typeof vValue;
}
for (sKey in oDetails) {
i... | javascript | function checkKeys(oDetails, mAllowedKeys2Type, sName) {
var sKey;
function error(sMessage) {
if (sName) {
sMessage += " at property: " + sName;
}
throw new Error(sMessage);
}
function typeOf(vValue) {
return Array.isArray(vValue) ? "array" : typeof vValue;
}
for (sKey in oDetails) {
i... | [
"function",
"checkKeys",
"(",
"oDetails",
",",
"mAllowedKeys2Type",
",",
"sName",
")",
"{",
"var",
"sKey",
";",
"function",
"error",
"(",
"sMessage",
")",
"{",
"if",
"(",
"sName",
")",
"{",
"sMessage",
"+=",
"\" at property: \"",
"+",
"sName",
";",
"}",
... | /*
Checks that the given details object has only allowed keys.
@param {object} oDetails
The details object
@param {string[]} [mAllowedKeys2Type]
Maps keys which are allowed for the details objects to the expected type name
@param {string} [sName]
The name of the property to which the details object belongs
@throws {Er... | [
"/",
"*",
"Checks",
"that",
"the",
"given",
"details",
"object",
"has",
"only",
"allowed",
"keys",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js#L36-L57 | train | Checks that the keys are valid | [
30522,
3853,
4638,
14839,
2015,
1006,
24040,
22081,
1010,
6670,
15096,
14839,
2015,
2475,
13874,
1010,
1055,
18442,
1007,
1063,
13075,
15315,
3240,
1025,
3853,
7561,
1006,
15488,
7971,
4270,
1007,
1063,
2065,
1006,
1055,
18442,
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... |
TryGhost/Ghost | core/server/services/routing/helpers/secure.js | setRequestIsSecure | function setRequestIsSecure(req, data) {
(Array.isArray(data) ? data : [data]).forEach(function forEach(d) {
d.secure = req.secure;
});
} | javascript | function setRequestIsSecure(req, data) {
(Array.isArray(data) ? data : [data]).forEach(function forEach(d) {
d.secure = req.secure;
});
} | [
"function",
"setRequestIsSecure",
"(",
"req",
",",
"data",
")",
"{",
"(",
"Array",
".",
"isArray",
"(",
"data",
")",
"?",
"data",
":",
"[",
"data",
"]",
")",
".",
"forEach",
"(",
"function",
"forEach",
"(",
"d",
")",
"{",
"d",
".",
"secure",
"=",
... | @description Tiny/Weird helper to attach the information if the request is HTTPS or HTTP.
It's used in services/url/utils (search for ".secure").
We forward the resource into handlebars and if you use the URL helper, we want to know if the original request
was https or not to generate the correct URL...but that is on... | [
"@description",
"Tiny",
"/",
"Weird",
"helper",
"to",
"attach",
"the",
"information",
"if",
"the",
"request",
"is",
"HTTPS",
"or",
"HTTP",
"."
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/services/routing/helpers/secure.js#L13-L17 | train | Set req. secure to true if request is secure | [
30522,
3853,
2275,
2890,
15500,
23491,
23887,
1006,
2128,
4160,
1010,
2951,
1007,
1063,
1006,
9140,
1012,
18061,
11335,
2100,
1006,
2951,
1007,
1029,
2951,
1024,
1031,
2951,
1033,
1007,
1012,
18921,
6776,
1006,
3853,
18921,
6776,
1006,
1040... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-empty-function.js | reportIfEmpty | function reportIfEmpty(node) {
const kind = getKind(node);
const name = astUtils.getFunctionNameWithKind(node);
const innerComments = sourceCode.getTokens(node.body, {
includeComments: true,
filter: astUtils.isCommentToken
});
... | javascript | function reportIfEmpty(node) {
const kind = getKind(node);
const name = astUtils.getFunctionNameWithKind(node);
const innerComments = sourceCode.getTokens(node.body, {
includeComments: true,
filter: astUtils.isCommentToken
});
... | [
"function",
"reportIfEmpty",
"(",
"node",
")",
"{",
"const",
"kind",
"=",
"getKind",
"(",
"node",
")",
";",
"const",
"name",
"=",
"astUtils",
".",
"getFunctionNameWithKind",
"(",
"node",
")",
";",
"const",
"innerComments",
"=",
"sourceCode",
".",
"getTokens"... | Reports a given function node if the node matches the following patterns.
- Not allowed by options.
- The body is empty.
- The body doesn't have any comments.
@param {ASTNode} node - A function node to report. This is one of
an ArrowFunctionExpression, a FunctionDeclaration, or a
FunctionExpression.
@returns {void} | [
"Reports",
"a",
"given",
"function",
"node",
"if",
"the",
"node",
"matches",
"the",
"following",
"patterns",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-empty-function.js#L139-L159 | train | Reports if a node is empty | [
30522,
3853,
3189,
29323,
27718,
2100,
1006,
13045,
1007,
1063,
9530,
3367,
2785,
1027,
2131,
18824,
1006,
13045,
1007,
1025,
9530,
3367,
2171,
1027,
2004,
8525,
3775,
4877,
1012,
2131,
11263,
27989,
18442,
24415,
18824,
1006,
13045,
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... |
ecomfe/zrender | src/core/PathProxy.js | function (x1, y1, x2, y2, radius) {
if (this._ctx) {
this._ctx.arcTo(x1, y1, x2, y2, radius);
}
return this;
} | javascript | function (x1, y1, x2, y2, radius) {
if (this._ctx) {
this._ctx.arcTo(x1, y1, x2, y2, radius);
}
return this;
} | [
"function",
"(",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
",",
"radius",
")",
"{",
"if",
"(",
"this",
".",
"_ctx",
")",
"{",
"this",
".",
"_ctx",
".",
"arcTo",
"(",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
",",
"radius",
")",
";",
"}",
"return"... | TODO | [
"TODO"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/core/PathProxy.js#L243-L248 | train | arcTo - Arc to the current arc | [
30522,
3853,
1006,
1060,
2487,
1010,
1061,
2487,
1010,
1060,
2475,
1010,
1061,
2475,
1010,
12177,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
14931,
2595,
1007,
1063,
2023,
1012,
1035,
14931,
2595,
1012,
8115,
3406,
1006,
1060,
2487,
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... | |
eslint/eslint | lib/rules/keyword-spacing.js | checkSpacingForModuleDeclaration | function checkSpacingForModuleDeclaration(node) {
const firstToken = sourceCode.getFirstToken(node);
checkSpacingBefore(firstToken, PREV_TOKEN_M);
checkSpacingAfter(firstToken, NEXT_TOKEN_M);
if (node.type === "ExportDefaultDeclaration") {
checkSpacingAr... | javascript | function checkSpacingForModuleDeclaration(node) {
const firstToken = sourceCode.getFirstToken(node);
checkSpacingBefore(firstToken, PREV_TOKEN_M);
checkSpacingAfter(firstToken, NEXT_TOKEN_M);
if (node.type === "ExportDefaultDeclaration") {
checkSpacingAr... | [
"function",
"checkSpacingForModuleDeclaration",
"(",
"node",
")",
"{",
"const",
"firstToken",
"=",
"sourceCode",
".",
"getFirstToken",
"(",
"node",
")",
";",
"checkSpacingBefore",
"(",
"firstToken",
",",
"PREV_TOKEN_M",
")",
";",
"checkSpacingAfter",
"(",
"firstToke... | Reports `import`, `export`, `as`, and `from` keywords of a given node if
usage of spacing around those keywords is invalid.
This rule handles the `*` token in module declarations.
import*as A from "./a"; /*error Expected space(s) after "import".
error Expected space(s) before "as".
@param {ASTNode} node - A node to ... | [
"Reports",
"import",
"export",
"as",
"and",
"from",
"keywords",
"of",
"a",
"given",
"node",
"if",
"usage",
"of",
"spacing",
"around",
"those",
"keywords",
"is",
"invalid",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/keyword-spacing.js#L456-L472 | train | Check spacing for module declaration | [
30522,
3853,
14148,
19498,
2075,
14192,
7716,
18696,
8586,
8017,
3370,
1006,
13045,
1007,
1063,
9530,
3367,
2034,
18715,
2368,
1027,
3120,
16044,
1012,
2131,
8873,
12096,
18715,
2368,
1006,
13045,
1007,
1025,
14148,
19498,
2075,
4783,
29278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/core/schema.js | stringifyProperty | function stringifyProperty (value, propDefinition) {
// This function stringifies but it's used in a context where
// there's always second stringification pass. By returning the original
// value when it's not an object we save one unnecessary call
// to JSON.stringify.
if (typeof value !== 'object') { retur... | javascript | function stringifyProperty (value, propDefinition) {
// This function stringifies but it's used in a context where
// there's always second stringification pass. By returning the original
// value when it's not an object we save one unnecessary call
// to JSON.stringify.
if (typeof value !== 'object') { retur... | [
"function",
"stringifyProperty",
"(",
"value",
",",
"propDefinition",
")",
"{",
"// This function stringifies but it's used in a context where",
"// there's always second stringification pass. By returning the original",
"// value when it's not an object we save one unnecessary call",
"// to J... | Serialize a single property. | [
"Serialize",
"a",
"single",
"property",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/schema.js#L192-L201 | train | Stringifies a property value. | [
30522,
3853,
5164,
8757,
21572,
4842,
3723,
1006,
3643,
1010,
17678,
3207,
16294,
22753,
1007,
1063,
1013,
1013,
2023,
3853,
5164,
14144,
2021,
2009,
1005,
1055,
2109,
1999,
1037,
6123,
2073,
1013,
1013,
2045,
1005,
1055,
2467,
2117,
5164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/CodeFolding/main.js | expandAll | function expandAll() {
var editor = EditorManager.getFocusedEditor();
if (editor) {
var cm = editor._codeMirror;
CodeMirror.commands.unfoldAll(cm);
}
} | javascript | function expandAll() {
var editor = EditorManager.getFocusedEditor();
if (editor) {
var cm = editor._codeMirror;
CodeMirror.commands.unfoldAll(cm);
}
} | [
"function",
"expandAll",
"(",
")",
"{",
"var",
"editor",
"=",
"EditorManager",
".",
"getFocusedEditor",
"(",
")",
";",
"if",
"(",
"editor",
")",
"{",
"var",
"cm",
"=",
"editor",
".",
"_codeMirror",
";",
"CodeMirror",
".",
"commands",
".",
"unfoldAll",
"(... | Expands all folded regions in the current document | [
"Expands",
"all",
"folded",
"regions",
"in",
"the",
"current",
"document"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L262-L268 | train | Expand all the lang files | [
30522,
3853,
7818,
8095,
1006,
1007,
1063,
13075,
3559,
1027,
3559,
24805,
4590,
1012,
2131,
14876,
7874,
19082,
15660,
1006,
1007,
1025,
2065,
1006,
3559,
1007,
1063,
13075,
4642,
1027,
3559,
1012,
1035,
3642,
14503,
29165,
1025,
3642,
145... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | logWithLocation | function logWithLocation() {
vLocation = vLocation
|| sTarget && sPropertyName && sTarget + "/" + sPropertyName;
return log.apply(this, arguments);
} | javascript | function logWithLocation() {
vLocation = vLocation
|| sTarget && sPropertyName && sTarget + "/" + sPropertyName;
return log.apply(this, arguments);
} | [
"function",
"logWithLocation",
"(",
")",
"{",
"vLocation",
"=",
"vLocation",
"||",
"sTarget",
"&&",
"sPropertyName",
"&&",
"sTarget",
"+",
"\"/\"",
"+",
"sPropertyName",
";",
"return",
"log",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"}"
] | /*
Sets <code>vLocation</code> and delegates to {@link log}. | [
"/",
"*",
"Sets",
"<code",
">",
"vLocation<",
"/",
"code",
">",
"and",
"delegates",
"to",
"{"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L1174-L1178 | train | Log with a location | [
30522,
3853,
8833,
24415,
4135,
10719,
1006,
1007,
1063,
1058,
4135,
10719,
1027,
1058,
4135,
10719,
1064,
1064,
2732,
18150,
1004,
1004,
11867,
18981,
15010,
18442,
1004,
1004,
2732,
18150,
1009,
1000,
1013,
1000,
1009,
11867,
18981,
15010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/tabs.js | tabBrowser_waitForTabPanel | function tabBrowser_waitForTabPanel(tabIndex, elemString) {
// Get the specified tab panel element
var tabPanel = this.getTabPanelElement(tabIndex, elemString);
// Get the style information for the tab panel element
var style = this._controller.window.getComputedStyle(tabPanel.getNode(), null);
... | javascript | function tabBrowser_waitForTabPanel(tabIndex, elemString) {
// Get the specified tab panel element
var tabPanel = this.getTabPanelElement(tabIndex, elemString);
// Get the style information for the tab panel element
var style = this._controller.window.getComputedStyle(tabPanel.getNode(), null);
... | [
"function",
"tabBrowser_waitForTabPanel",
"(",
"tabIndex",
",",
"elemString",
")",
"{",
"// Get the specified tab panel element",
"var",
"tabPanel",
"=",
"this",
".",
"getTabPanelElement",
"(",
"tabIndex",
",",
"elemString",
")",
";",
"// Get the style information for the t... | Waits for a particular tab panel element to display and stop animating
@param {number} tabIndex
Index of the tab to check
@param {string} elemString
Lookup string of the tab panel element | [
"Waits",
"for",
"a",
"particular",
"tab",
"panel",
"element",
"to",
"display",
"and",
"stop",
"animating"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/tabs.js#L478-L492 | train | Wait for a tab panel to be visible | [
30522,
3853,
21628,
12618,
9333,
2121,
1035,
3524,
13028,
7875,
9739,
2884,
1006,
21628,
22254,
10288,
1010,
3449,
6633,
3367,
4892,
1007,
1063,
1013,
1013,
2131,
1996,
9675,
21628,
5997,
5783,
13075,
21628,
9739,
2884,
1027,
2023,
1012,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/plugins/Performance.js | _render | function _render() {
var HTML = '<ol>';
var barInfoHTML = '<ol>';
//get all data from the filter ui elements
var filterOptions = _getFilterOptions();
//filtered and modified data
var data = _applyFilters(_rawdata, filterOptions);
//no data bar
if (data.length === 0) {
HTML += '<li class="l... | javascript | function _render() {
var HTML = '<ol>';
var barInfoHTML = '<ol>';
//get all data from the filter ui elements
var filterOptions = _getFilterOptions();
//filtered and modified data
var data = _applyFilters(_rawdata, filterOptions);
//no data bar
if (data.length === 0) {
HTML += '<li class="l... | [
"function",
"_render",
"(",
")",
"{",
"var",
"HTML",
"=",
"'<ol>'",
";",
"var",
"barInfoHTML",
"=",
"'<ol>'",
";",
"//get all data from the filter ui elements",
"var",
"filterOptions",
"=",
"_getFilterOptions",
"(",
")",
";",
"//filtered and modified data",
"var",
"... | /* =============================================================================================================
Render and render helpers
============================================================================================================= | [
"/",
"*",
"=============================================================================================================",
"Render",
"and",
"render",
"helpers",
"============================================================================================================="
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/plugins/Performance.js#L526-L563 | train | Render the data bar | [
30522,
3853,
1035,
17552,
1006,
1007,
1063,
13075,
16129,
1027,
1005,
1026,
19330,
1028,
1005,
1025,
13075,
22466,
2078,
14876,
11039,
19968,
1027,
1005,
1026,
19330,
1028,
1005,
1025,
1013,
1013,
2131,
2035,
2951,
30524,
2053,
2951,
3347,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/view/MainViewManager.js | cacheScrollState | function cacheScrollState(paneId) {
_forEachPaneOrPanes(paneId, function (pane) {
_paneScrollStates[pane.id] = pane.getScrollState();
});
} | javascript | function cacheScrollState(paneId) {
_forEachPaneOrPanes(paneId, function (pane) {
_paneScrollStates[pane.id] = pane.getScrollState();
});
} | [
"function",
"cacheScrollState",
"(",
"paneId",
")",
"{",
"_forEachPaneOrPanes",
"(",
"paneId",
",",
"function",
"(",
"pane",
")",
"{",
"_paneScrollStates",
"[",
"pane",
".",
"id",
"]",
"=",
"pane",
".",
"getScrollState",
"(",
")",
";",
"}",
")",
";",
"}"... | Caches the specified pane's current scroll state
If there was already cached state for the specified pane, it is discarded and overwritten
@param {!string} paneId - id of the pane in which to cache the scroll state,
ALL_PANES or ACTIVE_PANE | [
"Caches",
"the",
"specified",
"pane",
"s",
"current",
"scroll",
"state",
"If",
"there",
"was",
"already",
"cached",
"state",
"for",
"the",
"specified",
"pane",
"it",
"is",
"discarded",
"and",
"overwritten"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L500-L504 | train | Cache the scroll state of a pane or panes | [
30522,
3853,
17053,
11020,
28402,
9153,
2618,
1006,
6090,
7416,
2094,
1007,
1063,
1035,
18921,
6776,
9739,
8780,
14536,
7231,
2015,
1006,
6090,
7416,
2094,
1010,
3853,
1006,
6090,
2063,
1007,
1063,
1035,
6090,
2229,
26775,
14511,
9153,
4570... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/MessageItem.js | function (sName, oItem) {
if (oItem._oMessagePopoverItem.getId() === this.getId() && oItem.getMetadata().getProperty(sName)) {
oItem.setProperty(sName, oValue);
}
} | javascript | function (sName, oItem) {
if (oItem._oMessagePopoverItem.getId() === this.getId() && oItem.getMetadata().getProperty(sName)) {
oItem.setProperty(sName, oValue);
}
} | [
"function",
"(",
"sName",
",",
"oItem",
")",
"{",
"if",
"(",
"oItem",
".",
"_oMessagePopoverItem",
".",
"getId",
"(",
")",
"===",
"this",
".",
"getId",
"(",
")",
"&&",
"oItem",
".",
"getMetadata",
"(",
")",
".",
"getProperty",
"(",
"sName",
")",
")",... | BCP: 1670235674 MessageItem acts as a proxy to StandardListItem So, we should ensure if something is changed in MessageItem, it would be propagated to the StandardListItem | [
"BCP",
":",
"1670235674",
"MessageItem",
"acts",
"as",
"a",
"proxy",
"to",
"StandardListItem",
"So",
"we",
"should",
"ensure",
"if",
"something",
"is",
"changed",
"in",
"MessageItem",
"it",
"would",
"be",
"propagated",
"to",
"the",
"StandardListItem"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/MessageItem.js#L117-L121 | train | Sets the property of the given item. | [
30522,
3853,
1006,
1055,
18442,
1010,
1051,
4221,
2213,
1007,
1063,
2065,
1006,
1051,
4221,
2213,
1012,
1035,
18168,
7971,
4270,
16340,
7840,
4221,
2213,
1012,
2131,
3593,
1006,
1007,
1027,
1027,
1027,
2023,
1012,
2131,
3593,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | relativePosition | function relativePosition(dim, val) {
var ele = this[0];
var cy = this.cy();
var ppos = plainObject(dim) ? dim : undefined;
var setting = ppos !== undefined || val !== undefined && string(dim);
var hasCompoundNodes = cy.hasCompoundNodes();
if (ele && ele.isNode()) {
// must have an elemen... | javascript | function relativePosition(dim, val) {
var ele = this[0];
var cy = this.cy();
var ppos = plainObject(dim) ? dim : undefined;
var setting = ppos !== undefined || val !== undefined && string(dim);
var hasCompoundNodes = cy.hasCompoundNodes();
if (ele && ele.isNode()) {
// must have an elemen... | [
"function",
"relativePosition",
"(",
"dim",
",",
"val",
")",
"{",
"var",
"ele",
"=",
"this",
"[",
"0",
"]",
";",
"var",
"cy",
"=",
"this",
".",
"cy",
"(",
")",
";",
"var",
"ppos",
"=",
"plainObject",
"(",
"dim",
")",
"?",
"dim",
":",
"undefined",... | get/set the position relative to the parent | [
"get",
"/",
"set",
"the",
"position",
"relative",
"to",
"the",
"parent"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L8382-L8455 | train | Returns the relative position of an element to a specified dimension | [
30522,
3853,
5816,
26994,
1006,
11737,
1010,
11748,
1007,
1063,
13075,
3449,
2063,
1027,
2023,
1031,
1014,
1033,
1025,
13075,
22330,
1027,
2023,
1012,
22330,
1006,
1007,
1025,
13075,
4903,
2891,
1027,
5810,
16429,
20614,
1006,
11737,
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... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/addons.js | addonsManager_handleUtilsButton | function addonsManager_handleUtilsButton(aSpec) {
var spec = aSpec || { };
var item = spec.item;
if (!item)
throw new Error(arguments.callee.name + ": Menu item not specified.");
var button = this.getElement({type: "utilsButton"});
var menu = this.getElement({type: "utilsButton_menu"});
... | javascript | function addonsManager_handleUtilsButton(aSpec) {
var spec = aSpec || { };
var item = spec.item;
if (!item)
throw new Error(arguments.callee.name + ": Menu item not specified.");
var button = this.getElement({type: "utilsButton"});
var menu = this.getElement({type: "utilsButton_menu"});
... | [
"function",
"addonsManager_handleUtilsButton",
"(",
"aSpec",
")",
"{",
"var",
"spec",
"=",
"aSpec",
"||",
"{",
"}",
";",
"var",
"item",
"=",
"spec",
".",
"item",
";",
"if",
"(",
"!",
"item",
")",
"throw",
"new",
"Error",
"(",
"arguments",
".",
"callee"... | Opens the utils button menu and clicks the specified menu entry
@param {object} aSpec
Information about the menu
Elements: item - menu item to click (updateNow, viewUpdates,
installFromFile, autoUpdateDefault,
resetAddonUpdatesToAutomatic,
resetAddonUpdatesToManual) | [
"Opens",
"the",
"utils",
"button",
"menu",
"and",
"clicks",
"the",
"specified",
"menu",
"entry"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/addons.js#L227-L269 | train | Handles the utils button | [
30522,
3853,
5587,
5644,
24805,
4590,
1035,
5047,
21823,
4877,
8569,
15474,
1006,
2004,
5051,
2278,
1007,
1063,
13075,
28699,
1027,
2004,
5051,
2278,
1064,
1064,
1063,
1065,
1025,
13075,
8875,
1027,
28699,
1012,
8875,
1025,
2065,
1006,
999,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function() {
if (this._oSortExpression == null) {
this._oSortExpression = new odata4analytics.SortExpression(this._oEntityType.getModel(), this._oEntityType
.getSchema(), this._oEntityType);
}
return this._oSortExpression;
} | javascript | function() {
if (this._oSortExpression == null) {
this._oSortExpression = new odata4analytics.SortExpression(this._oEntityType.getModel(), this._oEntityType
.getSchema(), this._oEntityType);
}
return this._oSortExpression;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_oSortExpression",
"==",
"null",
")",
"{",
"this",
".",
"_oSortExpression",
"=",
"new",
"odata4analytics",
".",
"SortExpression",
"(",
"this",
".",
"_oEntityType",
".",
"getModel",
"(",
")",
",",
"this",
... | Get the sort expression for this request.
Expressions are represented by separate objects. If none exists so far, a
new expression object gets created.
@returns {sap.ui.model.analytics.odata4analytics.SortExpression} The sort object
associated to this request.
@public
@function
@name sap.ui.model.analytics.odata4anal... | [
"Get",
"the",
"sort",
"expression",
"for",
"this",
"request",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L5301-L5307 | train | Returns the sort expression for this entity type | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
9808,
11589,
10288,
20110,
3258,
1027,
1027,
19701,
1007,
1063,
2023,
1012,
1035,
9808,
11589,
10288,
20110,
3258,
1027,
2047,
1051,
2850,
2696,
2549,
27953,
21252,
2015,
1012,
40... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GitbookIO/gitbook | lib/output/createTemplateEngine.js | createTemplateEngine | function createTemplateEngine(output) {
var plugins = output.getPlugins();
var book = output.getBook();
var rootFolder = book.getContentRoot();
var logger = book.getLogger();
var filters = Plugins.listFilters(plugins);
var blocks = Plugins.listBlocks(plugins);
// Extend with default
bl... | javascript | function createTemplateEngine(output) {
var plugins = output.getPlugins();
var book = output.getBook();
var rootFolder = book.getContentRoot();
var logger = book.getLogger();
var filters = Plugins.listFilters(plugins);
var blocks = Plugins.listBlocks(plugins);
// Extend with default
bl... | [
"function",
"createTemplateEngine",
"(",
"output",
")",
"{",
"var",
"plugins",
"=",
"output",
".",
"getPlugins",
"(",
")",
";",
"var",
"book",
"=",
"output",
".",
"getBook",
"(",
")",
";",
"var",
"rootFolder",
"=",
"book",
".",
"getContentRoot",
"(",
")"... | Create template engine for an output.
It adds default filters/blocks, then add the ones from plugins
@param {Output} output
@return {TemplateEngine} | [
"Create",
"template",
"engine",
"for",
"an",
"output",
".",
"It",
"adds",
"default",
"filters",
"/",
"blocks",
"then",
"add",
"the",
"ones",
"from",
"plugins"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/createTemplateEngine.js#L17-L43 | train | Create a TemplateEngine | [
30522,
3853,
3443,
18532,
15725,
13159,
3170,
1006,
6434,
1007,
1063,
13075,
13354,
7076,
1027,
6434,
1012,
2131,
24759,
15916,
7076,
1006,
1007,
1025,
13075,
2338,
1027,
6434,
1012,
2131,
8654,
1006,
1007,
1025,
13075,
7117,
10371,
2121,
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... |
GitbookIO/gitbook | lib/gitbook.js | satisfies | function satisfies(condition) {
// Test with real version
if (semver.satisfies(VERSION, condition)) return true;
// Test with future stable release
return semver.satisfies(VERSION_STABLE, condition);
} | javascript | function satisfies(condition) {
// Test with real version
if (semver.satisfies(VERSION, condition)) return true;
// Test with future stable release
return semver.satisfies(VERSION_STABLE, condition);
} | [
"function",
"satisfies",
"(",
"condition",
")",
"{",
"// Test with real version",
"if",
"(",
"semver",
".",
"satisfies",
"(",
"VERSION",
",",
"condition",
")",
")",
"return",
"true",
";",
"// Test with future stable release",
"return",
"semver",
".",
"satisfies",
... | Verify that this gitbook version satisfies a requirement
We can't directly use samver.satisfies since it will break all plugins when gitbook version is a prerelease (beta, alpha)
@param {String} condition
@return {Boolean} | [
"Verify",
"that",
"this",
"gitbook",
"version",
"satisfies",
"a",
"requirement",
"We",
"can",
"t",
"directly",
"use",
"samver",
".",
"satisfies",
"since",
"it",
"will",
"break",
"all",
"plugins",
"when",
"gitbook",
"version",
"is",
"a",
"prerelease",
"(",
"b... | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/gitbook.js#L16-L22 | train | Test if the version satisfies the condition | [
30522,
3853,
2938,
2483,
14213,
1006,
4650,
1007,
1063,
1013,
1013,
3231,
2007,
2613,
2544,
2065,
1006,
7367,
2213,
6299,
1012,
2938,
2483,
14213,
1006,
2544,
1010,
4650,
1007,
1007,
2709,
2995,
1025,
1013,
1013,
3231,
2007,
2925,
6540,
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/qunit/utils/ControlIterator.js | function(sControlName, aControlsToTest, aExcludedControls, bIncludeNonRenderable, bIncludeNonInstantiable) {
if (!sControlName) {
return false;
}
if (aControlsToTest.length) { // only test specific controls
if (aControlsToTest.indexOf(sControlName) === -1) { // not one of the chosen ones
return false;
... | javascript | function(sControlName, aControlsToTest, aExcludedControls, bIncludeNonRenderable, bIncludeNonInstantiable) {
if (!sControlName) {
return false;
}
if (aControlsToTest.length) { // only test specific controls
if (aControlsToTest.indexOf(sControlName) === -1) { // not one of the chosen ones
return false;
... | [
"function",
"(",
"sControlName",
",",
"aControlsToTest",
",",
"aExcludedControls",
",",
"bIncludeNonRenderable",
",",
"bIncludeNonInstantiable",
")",
"{",
"if",
"(",
"!",
"sControlName",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"aControlsToTest",
".",
"... | Returns true if the control is not among the explicitly excluded controls and is not excluded due to its rendering/instantiation capabilities. | [
"Returns",
"true",
"if",
"the",
"control",
"is",
"not",
"among",
"the",
"explicitly",
"excluded",
"controls",
"and",
"is",
"not",
"excluded",
"due",
"to",
"its",
"rendering",
"/",
"instantiation",
"capabilities",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/utils/ControlIterator.js#L353-L375 | train | Test if a control is not in the list of excluded controls | [
30522,
3853,
1006,
8040,
12162,
13153,
18442,
1010,
9353,
12162,
13153,
16033,
22199,
1010,
29347,
2595,
20464,
13936,
8663,
13181,
4877,
1010,
8026,
20464,
12672,
8540,
7389,
4063,
3085,
1010,
8026,
20464,
12672,
8540,
7076,
5794,
10711,
346... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
MithrilJS/mithril.js | docs/lint.js | lint | function lint(file, data) {
ensureCodeIsHighlightable(file, data)
ensureCodeIsSyntaticallyValid(file, data)
ensureCodeIsRunnable(file, data)
ensureCommentStyle(file, data)
ensureLinkIsValid(file, data)
} | javascript | function lint(file, data) {
ensureCodeIsHighlightable(file, data)
ensureCodeIsSyntaticallyValid(file, data)
ensureCodeIsRunnable(file, data)
ensureCommentStyle(file, data)
ensureLinkIsValid(file, data)
} | [
"function",
"lint",
"(",
"file",
",",
"data",
")",
"{",
"ensureCodeIsHighlightable",
"(",
"file",
",",
"data",
")",
"ensureCodeIsSyntaticallyValid",
"(",
"file",
",",
"data",
")",
"ensureCodeIsRunnable",
"(",
"file",
",",
"data",
")",
"ensureCommentStyle",
"(",
... | lint rules | [
"lint",
"rules"
] | 6d36fe09d129928c6b460720e08d9ed321fcd62b | https://github.com/MithrilJS/mithril.js/blob/6d36fe09d129928c6b460720e08d9ed321fcd62b/docs/lint.js#L10-L16 | train | Lint a file. | [
30522,
3853,
11409,
2102,
1006,
5371,
1010,
2951,
1007,
1063,
5676,
16044,
4509,
18377,
7138,
3085,
1006,
5371,
1010,
2951,
1007,
5676,
16044,
14643,
6038,
29336,
15004,
10175,
3593,
1006,
5371,
1010,
2951,
1007,
5676,
16044,
2483,
15532,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js | Annotatable | function Annotatable(oConverter, sTarget) {
var oParent = oConverter.oAnnotatable;
if (oParent) {
sTarget = _Helper.buildPath(oParent.sPath, sTarget);
}
this.oConverter = oConverter;
this.sPath = sTarget;
this.oParent = oParent;
this.mSapAttributes = oConverter.mSapAttributes;
this.mAnnotationsForTa... | javascript | function Annotatable(oConverter, sTarget) {
var oParent = oConverter.oAnnotatable;
if (oParent) {
sTarget = _Helper.buildPath(oParent.sPath, sTarget);
}
this.oConverter = oConverter;
this.sPath = sTarget;
this.oParent = oParent;
this.mSapAttributes = oConverter.mSapAttributes;
this.mAnnotationsForTa... | [
"function",
"Annotatable",
"(",
"oConverter",
",",
"sTarget",
")",
"{",
"var",
"oParent",
"=",
"oConverter",
".",
"oAnnotatable",
";",
"if",
"(",
"oParent",
")",
"{",
"sTarget",
"=",
"_Helper",
".",
"buildPath",
"(",
"oParent",
".",
"sPath",
",",
"sTarget"... | ********************************************************************************************* Annotatable *********************************************************************************************
Creates an annotatable that is able to consume V2 annotations and set V4 annotations for the
correct target. It ensures... | [
"*********************************************************************************************",
"Annotatable",
"*********************************************************************************************",
"Creates",
"an",
"annotatable",
"that",
"is",
"able",
"to",
"consume",
"V2",
"annot... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js#L270-L281 | train | Creates an annotation object for the given target. | [
30522,
3853,
5754,
17287,
10880,
1006,
1051,
8663,
16874,
2121,
1010,
2732,
18150,
1007,
1063,
13075,
6728,
12069,
3372,
1027,
1051,
8663,
16874,
2121,
1012,
1051,
11639,
17287,
10880,
1025,
2065,
1006,
6728,
12069,
3372,
1007,
1063,
2732,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | function (shadowEntry) {
var shadowScopeOrder = this._defaults._shadowScopeOrder,
index = _.findIndex(shadowScopeOrder, function (entry) {
return entry === shadowEntry;
}),
i = index + 1;
// Find an appropriate scope of lower p... | javascript | function (shadowEntry) {
var shadowScopeOrder = this._defaults._shadowScopeOrder,
index = _.findIndex(shadowScopeOrder, function (entry) {
return entry === shadowEntry;
}),
i = index + 1;
// Find an appropriate scope of lower p... | [
"function",
"(",
"shadowEntry",
")",
"{",
"var",
"shadowScopeOrder",
"=",
"this",
".",
"_defaults",
".",
"_shadowScopeOrder",
",",
"index",
"=",
"_",
".",
"findIndex",
"(",
"shadowScopeOrder",
",",
"function",
"(",
"entry",
")",
"{",
"return",
"entry",
"==="... | @private
Tries to add scope to the scopeOrder once it's resolved. It looks up
context's _shadowScopeOrder to find an appropriate context to add it
before.
@param {Object} shadowEntry Shadow entry of the resolved scope | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1386-L1422 | train | Add shadow entry to the scope order | [
30522,
3853,
1006,
5192,
4765,
2854,
1007,
1063,
13075,
6281,
16186,
8551,
2121,
1027,
2023,
1012,
1035,
12398,
2015,
1012,
1035,
6281,
16186,
8551,
2121,
1010,
5950,
1027,
1035,
1012,
2424,
22254,
10288,
1006,
30524,
1006,
4443,
1007,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/search/FindReplace.js | _findAllAndSelect | function _findAllAndSelect(editor) {
editor = editor || EditorManager.getActiveEditor();
if (!editor) {
return;
}
var sel = editor.getSelection(),
newSelections = [];
if (CodeMirror.cmpPos(sel.start, sel.end) === 0) {
sel = _getWordAt(editor, ... | javascript | function _findAllAndSelect(editor) {
editor = editor || EditorManager.getActiveEditor();
if (!editor) {
return;
}
var sel = editor.getSelection(),
newSelections = [];
if (CodeMirror.cmpPos(sel.start, sel.end) === 0) {
sel = _getWordAt(editor, ... | [
"function",
"_findAllAndSelect",
"(",
"editor",
")",
"{",
"editor",
"=",
"editor",
"||",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
";",
"if",
"(",
"!",
"editor",
")",
"{",
"return",
";",
"}",
"var",
"sel",
"=",
"editor",
".",
"getSelection",
"("... | Takes the primary selection, expands it to a word range if necessary, then sets the selection to
include all instances of that range. Removes all other selections. Does nothing if the selection
is not a range after expansion. | [
"Takes",
"the",
"primary",
"selection",
"expands",
"it",
"to",
"a",
"word",
"range",
"if",
"necessary",
"then",
"sets",
"the",
"selection",
"to",
"include",
"all",
"instances",
"of",
"that",
"range",
".",
"Removes",
"all",
"other",
"selections",
".",
"Does",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindReplace.js#L364-L395 | train | Find all the words that match the selection | [
30522,
3853,
1035,
2424,
25425,
18376,
12260,
6593,
1006,
3559,
1007,
1063,
3559,
1027,
3559,
1064,
1064,
3559,
24805,
4590,
1012,
2131,
19620,
2098,
15660,
1006,
1007,
1025,
2065,
1006,
999,
3559,
1007,
1063,
2709,
1025,
1065,
13075,
7367,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableGrouping.js | function(oTable, iLevel, bChildren, bSum) {
var iIndent = 0;
var i;
if (oTable.isA("sap.ui.table.TreeTable")) {
for (i = 0; i < iLevel; i++) {
iIndent = iIndent + (i < 2 ? 12 : 8);
}
} else if (oTable.isA("sap.ui.table.AnalyticalTable")) {
iLevel = iLevel - 1;
iLevel = !bChildren && !b... | javascript | function(oTable, iLevel, bChildren, bSum) {
var iIndent = 0;
var i;
if (oTable.isA("sap.ui.table.TreeTable")) {
for (i = 0; i < iLevel; i++) {
iIndent = iIndent + (i < 2 ? 12 : 8);
}
} else if (oTable.isA("sap.ui.table.AnalyticalTable")) {
iLevel = iLevel - 1;
iLevel = !bChildren && !b... | [
"function",
"(",
"oTable",
",",
"iLevel",
",",
"bChildren",
",",
"bSum",
")",
"{",
"var",
"iIndent",
"=",
"0",
";",
"var",
"i",
";",
"if",
"(",
"oTable",
".",
"isA",
"(",
"\"sap.ui.table.TreeTable\"",
")",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
... | Computes the indents of the rows.
@param {sap.ui.table.Table} oTable Instance of the table.
@param {number} iLevel The hierarchy level.
@param {boolean} bChildren Whether the row is a group (has children).
@param {boolean} bSum Whether the row is a summary row.
@returns {int} The indentation level.
@private | [
"Computes",
"the",
"indents",
"of",
"the",
"rows",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableGrouping.js#L284-L311 | train | Returns indent of the table | [
30522,
3853,
1006,
27178,
3085,
1010,
17869,
15985,
1010,
4647,
19466,
16200,
2078,
1010,
18667,
2819,
1007,
1063,
13075,
2462,
25915,
2102,
1027,
1014,
1025,
13075,
1045,
1025,
2065,
1006,
27178,
3085,
1012,
18061,
1006,
1000,
20066,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
transloadit/uppy | packages/@uppy/aws-s3-multipart/src/index.js | createEventTracker | function createEventTracker (emitter) {
const events = []
return {
on (event, fn) {
events.push([ event, fn ])
return emitter.on(event, fn)
},
remove () {
events.forEach(([ event, fn ]) => {
emitter.off(event, fn)
})
}
}
} | javascript | function createEventTracker (emitter) {
const events = []
return {
on (event, fn) {
events.push([ event, fn ])
return emitter.on(event, fn)
},
remove () {
events.forEach(([ event, fn ]) => {
emitter.off(event, fn)
})
}
}
} | [
"function",
"createEventTracker",
"(",
"emitter",
")",
"{",
"const",
"events",
"=",
"[",
"]",
"return",
"{",
"on",
"(",
"event",
",",
"fn",
")",
"{",
"events",
".",
"push",
"(",
"[",
"event",
",",
"fn",
"]",
")",
"return",
"emitter",
".",
"on",
"("... | Create a wrapper around an event emitter with a `remove` method to remove
all events that were added using the wrapped emitter. | [
"Create",
"a",
"wrapper",
"around",
"an",
"event",
"emitter",
"with",
"a",
"remove",
"method",
"to",
"remove",
"all",
"events",
"that",
"were",
"added",
"using",
"the",
"wrapped",
"emitter",
"."
] | 7ae18bf992d544a64da998f033258ec09a3de275 | https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/packages/@uppy/aws-s3-multipart/src/index.js#L12-L25 | train | Create an event tracker | [
30522,
3853,
3443,
18697,
3372,
6494,
9102,
1006,
12495,
12079,
1007,
1063,
9530,
3367,
2824,
1027,
1031,
1033,
2709,
1063,
2006,
1006,
2724,
1010,
1042,
2078,
1007,
1063,
2824,
1012,
5245,
1006,
1031,
2724,
1010,
1042,
2078,
1033,
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... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (q, a, b, x, s, t) {
return safe_add(bit_rol(safe_add(safe_add(a, q),safe_add(x, t)), s),b);
} | javascript | function (q, a, b, x, s, t) {
return safe_add(bit_rol(safe_add(safe_add(a, q),safe_add(x, t)), s),b);
} | [
"function",
"(",
"q",
",",
"a",
",",
"b",
",",
"x",
",",
"s",
",",
"t",
")",
"{",
"return",
"safe_add",
"(",
"bit_rol",
"(",
"safe_add",
"(",
"safe_add",
"(",
"a",
",",
"q",
")",
",",
"safe_add",
"(",
"x",
",",
"t",
")",
")",
",",
"s",
")",... | /*
These functions implement the four basic operations the algorithm uses. | [
"/",
"*",
"These",
"functions",
"implement",
"the",
"four",
"basic",
"operations",
"the",
"algorithm",
"uses",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L342-L344 | train | A function that adds two terms of the terms | [
30522,
3853,
1006,
1053,
1010,
1037,
1010,
1038,
1010,
1060,
1010,
1055,
1010,
1056,
1007,
1063,
2709,
3647,
1035,
5587,
1006,
2978,
1035,
20996,
2140,
1006,
3647,
1035,
5587,
1006,
3647,
1035,
5587,
1006,
1037,
1010,
1053,
1007,
1010,
36... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(needle) {
if (Array.isArray(needle)) {
for (var i = needle.length; i--;) {
if (wysihtml5.lang.array(arr).indexOf(needle[i]) !== -1) {
return true;
}
}
return false;
} else {
return wysihtml5.lang.array(arr).indexOf(needle) !== -1;
... | javascript | function(needle) {
if (Array.isArray(needle)) {
for (var i = needle.length; i--;) {
if (wysihtml5.lang.array(arr).indexOf(needle[i]) !== -1) {
return true;
}
}
return false;
} else {
return wysihtml5.lang.array(arr).indexOf(needle) !== -1;
... | [
"function",
"(",
"needle",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"needle",
")",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"needle",
".",
"length",
";",
"i",
"--",
";",
")",
"{",
"if",
"(",
"wysihtml5",
".",
"lang",
".",
"array",
"(",
... | Check whether a given object exists in an array
@example
wysihtml5.lang.array([1, 2]).contains(1);
// => true
Can be used to match array with array. If intersection is found true is returned | [
"Check",
"whether",
"a",
"given",
"object",
"exists",
"in",
"an",
"array"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L4588-L4599 | train | returns true if the array contains the given element | [
30522,
3853,
1006,
12201,
1007,
1063,
2065,
1006,
9140,
1012,
18061,
11335,
2100,
1006,
12201,
1007,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
12201,
1012,
3091,
1025,
1045,
1011,
1011,
1025,
1007,
1063,
2065,
1006,
1059,
7274,
19190,
2124... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 ()
{
if (typeof this._idleTimeout == "number") {
clearTimeout(this._idleTimeout);
}
// Cancel Disconnect Timeout
if (this._disconnectTimeout !== null) {
this.deleteTimedHandler(this._disconnectTimeout);
this._disconnectTimeout = ... | javascript | function ()
{
if (typeof this._idleTimeout == "number") {
clearTimeout(this._idleTimeout);
}
// Cancel Disconnect Timeout
if (this._disconnectTimeout !== null) {
this.deleteTimedHandler(this._disconnectTimeout);
this._disconnectTimeout = ... | [
"function",
"(",
")",
"{",
"if",
"(",
"typeof",
"this",
".",
"_idleTimeout",
"==",
"\"number\"",
")",
"{",
"clearTimeout",
"(",
"this",
".",
"_idleTimeout",
")",
";",
"}",
"// Cancel Disconnect Timeout\r",
"if",
"(",
"this",
".",
"_disconnectTimeout",
"!==",
... | PrivateFunction: _doDisconnect
_Private_ function to disconnect.
This is the last piece of the disconnection logic. This resets the
connection and alerts the user's connection callback. | [
"PrivateFunction",
":",
"_doDisconnect",
"_Private_",
"function",
"to",
"disconnect",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L2761-L2790 | train | Disconnects from the device | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
2828,
11253,
2023,
1012,
1035,
18373,
7292,
5833,
1027,
1027,
1000,
2193,
1000,
1007,
1063,
3154,
7292,
5833,
1006,
2023,
1012,
1035,
18373,
7292,
5833,
1007,
1025,
1065,
1013,
1013,
17542,
12532,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
exceljs/exceljs | lib/doc/worksheet.js | function(options) {
options = options || {};
// in a workbook, each sheet will have a number
this.id = options.id;
this.orderNo = options.orderNo;
// and a name
this.name = options.name || `Sheet${this.id}`;
// add a state
this.state = options.state || 'visible';
// rows allows access organised by... | javascript | function(options) {
options = options || {};
// in a workbook, each sheet will have a number
this.id = options.id;
this.orderNo = options.orderNo;
// and a name
this.name = options.name || `Sheet${this.id}`;
// add a state
this.state = options.state || 'visible';
// rows allows access organised by... | [
"function",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"// in a workbook, each sheet will have a number",
"this",
".",
"id",
"=",
"options",
".",
"id",
";",
"this",
".",
"orderNo",
"=",
"options",
".",
"orderNo",
";",
"// and a... | Worksheet requirements Operate as sheet inside workbook or standalone Load and Save from file and stream Access/Add/Delete individual cells Manage column widths and row heights | [
"Worksheet",
"requirements",
"Operate",
"as",
"sheet",
"inside",
"workbook",
"or",
"standalone",
"Load",
"and",
"Save",
"from",
"file",
"and",
"stream",
"Access",
"/",
"Add",
"/",
"Delete",
"individual",
"cells",
"Manage",
"column",
"widths",
"and",
"row",
"he... | c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2 | https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/doc/worksheet.js#L19-L100 | train | A sheet is a cell with a single row | [
30522,
3853,
1006,
7047,
1007,
1063,
7047,
1027,
7047,
1064,
1064,
1063,
1065,
1025,
1013,
1013,
1999,
1037,
2147,
8654,
1010,
2169,
7123,
2097,
2031,
1037,
2193,
2023,
1012,
8909,
1027,
7047,
1012,
8909,
1025,
2023,
1012,
2344,
3630,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
dimsemenov/PhotoSwipe | src/js/gestures.js | function(e) {
// clean up previous points, without recreating array
while(_tempPointsArr.length > 0) {
_tempPointsArr.pop();
}
if(!_pointerEventEnabled) {
if(e.type.indexOf('touch') > -1) {
if(e.touches && e.touches.length > 0) {
_tempPointsArr[0] = _convertTouchToPoint(e.touches[0], _ePoint1);... | javascript | function(e) {
// clean up previous points, without recreating array
while(_tempPointsArr.length > 0) {
_tempPointsArr.pop();
}
if(!_pointerEventEnabled) {
if(e.type.indexOf('touch') > -1) {
if(e.touches && e.touches.length > 0) {
_tempPointsArr[0] = _convertTouchToPoint(e.touches[0], _ePoint1);... | [
"function",
"(",
"e",
")",
"{",
"// clean up previous points, without recreating array",
"while",
"(",
"_tempPointsArr",
".",
"length",
">",
"0",
")",
"{",
"_tempPointsArr",
".",
"pop",
"(",
")",
";",
"}",
"if",
"(",
"!",
"_pointerEventEnabled",
")",
"{",
"if"... | amount of pixels to drag to determine direction of swipe | [
"amount",
"of",
"pixels",
"to",
"drag",
"to",
"determine",
"direction",
"of",
"swipe"
] | 80607e12542a1a54ecefa837649e862b35dffd25 | https://github.com/dimsemenov/PhotoSwipe/blob/80607e12542a1a54ecefa837649e862b35dffd25/src/js/gestures.js#L137-L173 | train | convert touch events to points | [
30522,
3853,
1006,
1041,
1007,
1063,
1013,
1013,
4550,
2039,
3025,
2685,
1010,
2302,
28667,
16416,
3436,
9140,
2096,
1006,
1035,
8915,
8737,
26521,
2906,
2099,
1012,
3091,
1028,
1014,
1007,
1063,
1035,
8915,
8737,
26521,
2906,
2099,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/cli.js | translateOptions | function translateOptions(cliOptions) {
return {
envs: cliOptions.env,
extensions: cliOptions.ext,
rules: cliOptions.rule,
plugins: cliOptions.plugin,
globals: cliOptions.global,
ignore: cliOptions.ignore,
ignorePath: cliOptions.ignorePath,
ignorePatte... | javascript | function translateOptions(cliOptions) {
return {
envs: cliOptions.env,
extensions: cliOptions.ext,
rules: cliOptions.rule,
plugins: cliOptions.plugin,
globals: cliOptions.global,
ignore: cliOptions.ignore,
ignorePath: cliOptions.ignorePath,
ignorePatte... | [
"function",
"translateOptions",
"(",
"cliOptions",
")",
"{",
"return",
"{",
"envs",
":",
"cliOptions",
".",
"env",
",",
"extensions",
":",
"cliOptions",
".",
"ext",
",",
"rules",
":",
"cliOptions",
".",
"rule",
",",
"plugins",
":",
"cliOptions",
".",
"plug... | Translates the CLI options into the options expected by the CLIEngine.
@param {Object} cliOptions The CLI options to translate.
@returns {CLIEngineOptions} The options object for the CLIEngine.
@private | [
"Translates",
"the",
"CLI",
"options",
"into",
"the",
"options",
"expected",
"by",
"the",
"CLIEngine",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/cli.js#L48-L71 | train | Translate CLI options into a object that can be passed to the command line. | [
30522,
3853,
17637,
7361,
9285,
1006,
18856,
3695,
16790,
2015,
1007,
1063,
2709,
1063,
4372,
15088,
1024,
18856,
3695,
16790,
2015,
1012,
4372,
2615,
1010,
14305,
1024,
18856,
3695,
16790,
2015,
1012,
4654,
2102,
1010,
3513,
1024,
18856,
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... |
SeleniumHQ/selenium | javascript/node/selenium-webdriver/chrome.js | createExecutor | function createExecutor(url) {
let agent = new http.Agent({ keepAlive: true });
let client = url.then(url => new http.HttpClient(url, agent));
let executor = new http.Executor(client);
configureExecutor(executor);
return executor;
} | javascript | function createExecutor(url) {
let agent = new http.Agent({ keepAlive: true });
let client = url.then(url => new http.HttpClient(url, agent));
let executor = new http.Executor(client);
configureExecutor(executor);
return executor;
} | [
"function",
"createExecutor",
"(",
"url",
")",
"{",
"let",
"agent",
"=",
"new",
"http",
".",
"Agent",
"(",
"{",
"keepAlive",
":",
"true",
"}",
")",
";",
"let",
"client",
"=",
"url",
".",
"then",
"(",
"url",
"=>",
"new",
"http",
".",
"HttpClient",
"... | Creates a command executor with support for ChromeDriver's custom commands.
@param {!Promise<string>} url The server's URL.
@return {!command.Executor} The new command executor. | [
"Creates",
"a",
"command",
"executor",
"with",
"support",
"for",
"ChromeDriver",
"s",
"custom",
"commands",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/chrome.js#L172-L178 | train | Creates an executor | [
30522,
3853,
3443,
10288,
8586,
16161,
2099,
1006,
24471,
2140,
1007,
1063,
2292,
4005,
1027,
2047,
8299,
1012,
4005,
1006,
1063,
2562,
11475,
3726,
1024,
2995,
1065,
1007,
1025,
2292,
7396,
1027,
24471,
2140,
1012,
2059,
1006,
24471,
2140,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | setQueryParam | function setQueryParam(location, key, value) {
var query = parseQueryParams(location);
query[encodeURIComponent(key)] = encodeURIComponent(value);
var newQuery = '';
for (var q in query) {
newQuery += (newQuery ? '&' : '?') + q + '=' + query[q];
}
return location.origin + location.pathname + newQuery ... | javascript | function setQueryParam(location, key, value) {
var query = parseQueryParams(location);
query[encodeURIComponent(key)] = encodeURIComponent(value);
var newQuery = '';
for (var q in query) {
newQuery += (newQuery ? '&' : '?') + q + '=' + query[q];
}
return location.origin + location.pathname + newQuery ... | [
"function",
"setQueryParam",
"(",
"location",
",",
"key",
",",
"value",
")",
"{",
"var",
"query",
"=",
"parseQueryParams",
"(",
"location",
")",
";",
"query",
"[",
"encodeURIComponent",
"(",
"key",
")",
"]",
"=",
"encodeURIComponent",
"(",
"value",
")",
";... | Creates a new URL by appending or replacing the given query key and value.
Not supporting URL with username and password.
@param {Location} location The original URL.
@param {string} key The query parameter name.
@param {string} value The query parameter value.
@return {string} The constructed new URL. | [
"Creates",
"a",
"new",
"URL",
"by",
"appending",
"or",
"replacing",
"the",
"given",
"query",
"key",
"and",
"value",
".",
"Not",
"supporting",
"URL",
"with",
"username",
"and",
"password",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L91-L101 | train | Sets a query param | [
30522,
3853,
2275,
4226,
2854,
30524,
23032,
1027,
11968,
3366,
4226,
2854,
28689,
5244,
1006,
3295,
1007,
1025,
23032,
1031,
4372,
16044,
9496,
9006,
29513,
3372,
1006,
3145,
1007,
1033,
1027,
4372,
16044,
9496,
9006,
29513,
3372,
1006,
36... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
airyland/vux | src/libs/eventor.js | triggerEvents | function triggerEvents (list, args, context) {
var pass = true
if (list) {
var i = 0
var l = list.length
var a1 = args[0]
var a2 = args[1]
var a3 = args[2]
// call is faster than apply, optimize less than 3 argu
// http://blog.csdn.net/zhengyinhui100/article/details/7837127
switch (... | javascript | function triggerEvents (list, args, context) {
var pass = true
if (list) {
var i = 0
var l = list.length
var a1 = args[0]
var a2 = args[1]
var a3 = args[2]
// call is faster than apply, optimize less than 3 argu
// http://blog.csdn.net/zhengyinhui100/article/details/7837127
switch (... | [
"function",
"triggerEvents",
"(",
"list",
",",
"args",
",",
"context",
")",
"{",
"var",
"pass",
"=",
"true",
"if",
"(",
"list",
")",
"{",
"var",
"i",
"=",
"0",
"var",
"l",
"=",
"list",
".",
"length",
"var",
"a1",
"=",
"args",
"[",
"0",
"]",
"va... | Execute callbacks | [
"Execute",
"callbacks"
] | 484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6 | https://github.com/airyland/vux/blob/484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6/src/libs/eventor.js#L168-L189 | train | trigger events in order to avoid the race condition | [
30522,
3853,
9495,
18697,
7666,
1006,
2862,
1010,
12098,
5620,
1010,
6123,
1007,
1063,
13075,
3413,
1027,
2995,
2065,
1006,
2862,
1007,
1063,
13075,
1045,
1027,
1014,
13075,
1048,
1027,
2862,
1012,
3091,
13075,
17350,
1027,
12098,
5620,
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... |
jaywcjlove/linux-command | template/js/index.js | function (islist) {
var arr = this.commands, self = this, i = 0,
page_size = arr.length,
arrResultHTML = [],
resultData = [],
show_list_count = islist ? this.page_size : this.query_size;
if (arr && arr.length && toString.call(arr).indexOf('Array') > -1) {
for (; i < p... | javascript | function (islist) {
var arr = this.commands, self = this, i = 0,
page_size = arr.length,
arrResultHTML = [],
resultData = [],
show_list_count = islist ? this.page_size : this.query_size;
if (arr && arr.length && toString.call(arr).indexOf('Array') > -1) {
for (; i < p... | [
"function",
"(",
"islist",
")",
"{",
"var",
"arr",
"=",
"this",
".",
"commands",
",",
"self",
"=",
"this",
",",
"i",
"=",
"0",
",",
"page_size",
"=",
"arr",
".",
"length",
",",
"arrResultHTML",
"=",
"[",
"]",
",",
"resultData",
"=",
"[",
"]",
","... | [searchResult ]
@param {[type]} islist [是否为列表] | [
"[",
"searchResult",
"]"
] | 7d6c8c6b3468a0dd5311ee68934c9b8db64469f7 | https://github.com/jaywcjlove/linux-command/blob/7d6c8c6b3468a0dd5311ee68934c9b8db64469f7/template/js/index.js#L85-L131 | train | Create the result HTML | [
30522,
3853,
1006,
2003,
9863,
1007,
1063,
13075,
12098,
2099,
1027,
2023,
30524,
1010,
2265,
1035,
2862,
1035,
4175,
1027,
2003,
9863,
1029,
2023,
1012,
3931,
1035,
2946,
1024,
2023,
1012,
23032,
1035,
2946,
1025,
2065,
1006,
12098,
2099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SeleniumHQ/selenium | javascript/selenium-core/scripts/xmlextras.js | getDomDocumentPrefix | function getDomDocumentPrefix() {
if (getDomDocumentPrefix.prefix)
return getDomDocumentPrefix.prefix;
var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
var o;
for (var i = 0; i < prefixes.length; i++) {
try {
// try to create the objects
o = new ActiveXObject(prefixes[i] + ".DomDocument");
... | javascript | function getDomDocumentPrefix() {
if (getDomDocumentPrefix.prefix)
return getDomDocumentPrefix.prefix;
var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
var o;
for (var i = 0; i < prefixes.length; i++) {
try {
// try to create the objects
o = new ActiveXObject(prefixes[i] + ".DomDocument");
... | [
"function",
"getDomDocumentPrefix",
"(",
")",
"{",
"if",
"(",
"getDomDocumentPrefix",
".",
"prefix",
")",
"return",
"getDomDocumentPrefix",
".",
"prefix",
";",
"var",
"prefixes",
"=",
"[",
"\"MSXML2\"",
",",
"\"Microsoft\"",
",",
"\"MSXML\"",
",",
"\"MSXML3\"",
... | <script> //////////////// Helper Stuff // //////////////// used to find the Automation server name | [
"<script",
">",
"////////////////",
"Helper",
"Stuff",
"//",
"////////////////",
"used",
"to",
"find",
"the",
"Automation",
"server",
"name"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/xmlextras.js#L11-L27 | train | Returns the prefix of the DOM document. | [
30522,
3853,
2131,
9527,
3527,
24894,
4765,
28139,
8873,
2595,
1006,
1007,
1063,
2065,
1006,
2131,
9527,
3527,
24894,
4765,
28139,
8873,
2595,
1012,
17576,
1007,
2709,
2131,
9527,
3527,
24894,
4765,
28139,
8873,
2595,
1012,
17576,
1025,
130... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
moleculerjs/moleculer | bin/moleculer-runner.js | run | function run() {
return Promise.resolve()
.then(loadEnvFile)
.then(loadConfigFile)
.then(mergeOptions)
.then(startBroker)
.catch(err => {
logger.error(err);
process.exit(1);
});
} | javascript | function run() {
return Promise.resolve()
.then(loadEnvFile)
.then(loadConfigFile)
.then(mergeOptions)
.then(startBroker)
.catch(err => {
logger.error(err);
process.exit(1);
});
} | [
"function",
"run",
"(",
")",
"{",
"return",
"Promise",
".",
"resolve",
"(",
")",
".",
"then",
"(",
"loadEnvFile",
")",
".",
"then",
"(",
"loadConfigFile",
")",
".",
"then",
"(",
"mergeOptions",
")",
".",
"then",
"(",
"startBroker",
")",
".",
"catch",
... | Running | [
"Running"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/bin/moleculer-runner.js#L434-L444 | train | This function is called by the broker to start the broker | [
30522,
3853,
2448,
1006,
1007,
1063,
2709,
4872,
1012,
10663,
1006,
1007,
1012,
2059,
1006,
7170,
2368,
2615,
8873,
2571,
1007,
1012,
2059,
1006,
7170,
8663,
8873,
25708,
9463,
1007,
1012,
2059,
1006,
13590,
7361,
9285,
1007,
1012,
2059,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/boxplot/boxplotLayout.js | calculateBase | function calculateBase(groupItem) {
var extent;
var baseAxis = groupItem.axis;
var seriesModels = groupItem.seriesModels;
var seriesCount = seriesModels.length;
var boxWidthList = groupItem.boxWidthList = [];
var boxOffsetList = groupItem.boxOffsetList = [];
var boundList = [];
var ban... | javascript | function calculateBase(groupItem) {
var extent;
var baseAxis = groupItem.axis;
var seriesModels = groupItem.seriesModels;
var seriesCount = seriesModels.length;
var boxWidthList = groupItem.boxWidthList = [];
var boxOffsetList = groupItem.boxOffsetList = [];
var boundList = [];
var ban... | [
"function",
"calculateBase",
"(",
"groupItem",
")",
"{",
"var",
"extent",
";",
"var",
"baseAxis",
"=",
"groupItem",
".",
"axis",
";",
"var",
"seriesModels",
"=",
"groupItem",
".",
"seriesModels",
";",
"var",
"seriesCount",
"=",
"seriesModels",
".",
"length",
... | Calculate offset and box width for each series. | [
"Calculate",
"offset",
"and",
"box",
"width",
"for",
"each",
"series",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/boxplot/boxplotLayout.js#L74-L121 | train | Calculate base of the series | [
30522,
3853,
18422,
15058,
1006,
2177,
4221,
2213,
1007,
1063,
13075,
6698,
1025,
13075,
2918,
8528,
2483,
1027,
2177,
4221,
2213,
1012,
8123,
1025,
13075,
2186,
5302,
9247,
2015,
1027,
2177,
4221,
2213,
1012,
2186,
5302,
9247,
2015,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/angular | gulpfile.js | loadTask | function loadTask(fileName, taskName) {
const taskModule = require('./tools/gulp-tasks/' + fileName);
const task = taskName ? taskModule[taskName] : taskModule;
return task(gulp);
} | javascript | function loadTask(fileName, taskName) {
const taskModule = require('./tools/gulp-tasks/' + fileName);
const task = taskName ? taskModule[taskName] : taskModule;
return task(gulp);
} | [
"function",
"loadTask",
"(",
"fileName",
",",
"taskName",
")",
"{",
"const",
"taskModule",
"=",
"require",
"(",
"'./tools/gulp-tasks/'",
"+",
"fileName",
")",
";",
"const",
"task",
"=",
"taskName",
"?",
"taskModule",
"[",
"taskName",
"]",
":",
"taskModule",
... | See `tools/gulp-tasks/README.md` for information about task loading. | [
"See",
"tools",
"/",
"gulp",
"-",
"tasks",
"/",
"README",
".",
"md",
"for",
"information",
"about",
"task",
"loading",
"."
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/gulpfile.js#L23-L27 | train | Load task from file | [
30522,
3853,
7170,
10230,
2243,
1006,
5371,
18442,
1010,
4708,
18442,
1007,
1063,
9530,
3367,
4708,
5302,
8566,
2571,
1027,
5478,
1006,
1005,
1012,
1013,
5906,
1013,
26546,
1011,
8518,
1013,
1005,
1009,
5371,
18442,
1007,
1025,
9530,
3367,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensibility/node/ExtensionManagerDomain.js | legacyPackageCheck | function legacyPackageCheck(legacyDirectory) {
return fs.existsSync(legacyDirectory) && !fs.existsSync(path.join(legacyDirectory, "package.json"));
} | javascript | function legacyPackageCheck(legacyDirectory) {
return fs.existsSync(legacyDirectory) && !fs.existsSync(path.join(legacyDirectory, "package.json"));
} | [
"function",
"legacyPackageCheck",
"(",
"legacyDirectory",
")",
"{",
"return",
"fs",
".",
"existsSync",
"(",
"legacyDirectory",
")",
"&&",
"!",
"fs",
".",
"existsSync",
"(",
"path",
".",
"join",
"(",
"legacyDirectory",
",",
"\"package.json\"",
")",
")",
";",
... | A "legacy package" is an extension that was installed based on the GitHub name without
a package.json file. Checking for the presence of these legacy extensions will help
users upgrade if the extension developer puts a different name in package.json than
the name of the GitHub project.
@param {string} legacyDirectory ... | [
"A",
"legacy",
"package",
"is",
"an",
"extension",
"that",
"was",
"installed",
"based",
"on",
"the",
"GitHub",
"name",
"without",
"a",
"package",
".",
"json",
"file",
".",
"Checking",
"for",
"the",
"presence",
"of",
"these",
"legacy",
"extensions",
"will",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L185-L187 | train | Check if the legacy package. json exists and is a non - empty version of the legacy package. json | [
30522,
3853,
8027,
23947,
4270,
5403,
3600,
1006,
8027,
4305,
2890,
16761,
2100,
1007,
1063,
2709,
1042,
2015,
1012,
6526,
6508,
12273,
1006,
8027,
4305,
2890,
16761,
2100,
1007,
1004,
1004,
999,
1042,
2015,
1012,
6526,
6508,
12273,
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... |
zeit/now-cli | src/util/hash.js | hashes | async function hashes(files) {
const map = new Map();
await Promise.all(
files.map(async name => {
const data = await fs.promises.readFile(name);
const h = hash(data);
const entry = map.get(h);
if (entry) {
entry.names.push(name);
} else {
map.set(hash(data), { na... | javascript | async function hashes(files) {
const map = new Map();
await Promise.all(
files.map(async name => {
const data = await fs.promises.readFile(name);
const h = hash(data);
const entry = map.get(h);
if (entry) {
entry.names.push(name);
} else {
map.set(hash(data), { na... | [
"async",
"function",
"hashes",
"(",
"files",
")",
"{",
"const",
"map",
"=",
"new",
"Map",
"(",
")",
";",
"await",
"Promise",
".",
"all",
"(",
"files",
".",
"map",
"(",
"async",
"name",
"=>",
"{",
"const",
"data",
"=",
"await",
"fs",
".",
"promises"... | Computes hashes for the contents of each file given.
@param {Array} of {String} full paths
@return {Map} | [
"Computes",
"hashes",
"for",
"the",
"contents",
"of",
"each",
"file",
"given",
"."
] | b53d907b745126113bc3e251ac2451088026a363 | https://github.com/zeit/now-cli/blob/b53d907b745126113bc3e251ac2451088026a363/src/util/hash.js#L14-L31 | train | Returns a map of hashes for the given files | [
30522,
2004,
6038,
2278,
3853,
23325,
2229,
1006,
6764,
1007,
1063,
9530,
3367,
4949,
1027,
2047,
4949,
1006,
1007,
1025,
26751,
4872,
1012,
2035,
1006,
6764,
1012,
4949,
1006,
2004,
6038,
2278,
2171,
1027,
1028,
1063,
9530,
3367,
2951,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | release.js | center | function center (msg) {
msg = ' ' + msg.trim() + ' ';
const length = msg.length;
const spaces = Math.floor((lineWidth - length) / 2);
return Array(spaces + 1).join('-') + msg.green + Array(lineWidth - msg.length - spaces + 1).join('-');
} | javascript | function center (msg) {
msg = ' ' + msg.trim() + ' ';
const length = msg.length;
const spaces = Math.floor((lineWidth - length) / 2);
return Array(spaces + 1).join('-') + msg.green + Array(lineWidth - msg.length - spaces + 1).join('-');
} | [
"function",
"center",
"(",
"msg",
")",
"{",
"msg",
"=",
"' '",
"+",
"msg",
".",
"trim",
"(",
")",
"+",
"' '",
";",
"const",
"length",
"=",
"msg",
".",
"length",
";",
"const",
"spaces",
"=",
"Math",
".",
"floor",
"(",
"(",
"lineWidth",
"-",
"lengt... | outputs a centered message in the terminal | [
"outputs",
"a",
"centered",
"message",
"in",
"the",
"terminal"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/release.js#L396-L401 | train | center the message | [
30522,
3853,
2415,
1006,
5796,
2290,
1007,
1063,
5796,
2290,
1027,
1005,
1005,
1009,
5796,
2290,
1012,
12241,
1006,
1007,
1009,
1005,
1005,
1025,
9530,
3367,
3091,
1027,
5796,
2290,
1012,
3091,
1025,
9530,
3367,
7258,
1027,
8785,
1012,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/BindingParser.js | makeFormatter | function makeFormatter(aFragments) {
var fnFormatter = function() {
var aResult = [],
l = aFragments.length,
i;
for (i = 0; i < l; i++) {
if ( typeof aFragments[i] === "number" ) {
// a numerical fragment references the part with the same number
aResult.push(arguments[aFragments[i]... | javascript | function makeFormatter(aFragments) {
var fnFormatter = function() {
var aResult = [],
l = aFragments.length,
i;
for (i = 0; i < l; i++) {
if ( typeof aFragments[i] === "number" ) {
// a numerical fragment references the part with the same number
aResult.push(arguments[aFragments[i]... | [
"function",
"makeFormatter",
"(",
"aFragments",
")",
"{",
"var",
"fnFormatter",
"=",
"function",
"(",
")",
"{",
"var",
"aResult",
"=",
"[",
"]",
",",
"l",
"=",
"aFragments",
".",
"length",
",",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
... | Helper to create a formatter function. Only used to reduce the closure size of the formatter
@param {number[]|string[]} aFragments
array of fragments, either a literal text or the index of the binding's part
@returns {function}
a formatter function | [
"Helper",
"to",
"create",
"a",
"formatter",
"function",
".",
"Only",
"used",
"to",
"reduce",
"the",
"closure",
"size",
"of",
"the",
"formatter"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/BindingParser.js#L94-L113 | train | Creates a formatter function that can be used to format text fragments | [
30522,
3853,
2191,
14192,
20097,
1006,
21358,
29181,
8163,
1007,
1063,
13075,
1042,
2078,
14192,
20097,
1027,
3853,
1006,
1007,
1063,
13075,
23631,
11314,
1027,
1031,
1033,
1010,
1048,
1027,
21358,
29181,
8163,
1012,
3091,
1010,
1045,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/performance/trace/Interaction.js | isValidRoundtrip | function isValidRoundtrip(oRequestTiming) {
var bComplete, bEmpty, bCached;
// if the request has been completed it has complete timing figures)
bComplete = oRequestTiming.startTime > 0 &&
oRequestTiming.startTime <= oRequestTiming.requestStart &&
oRequestTiming.requestStart <= oRequestTiming.responseEnd;
... | javascript | function isValidRoundtrip(oRequestTiming) {
var bComplete, bEmpty, bCached;
// if the request has been completed it has complete timing figures)
bComplete = oRequestTiming.startTime > 0 &&
oRequestTiming.startTime <= oRequestTiming.requestStart &&
oRequestTiming.requestStart <= oRequestTiming.responseEnd;
... | [
"function",
"isValidRoundtrip",
"(",
"oRequestTiming",
")",
"{",
"var",
"bComplete",
",",
"bEmpty",
",",
"bCached",
";",
"// if the request has been completed it has complete timing figures)",
"bComplete",
"=",
"oRequestTiming",
".",
"startTime",
">",
"0",
"&&",
"oRequest... | Valid timings are all timings which are completed, not empty and not responded from browser cache.
Note: Currently only Chrome and FF support size related properties (body size and transfer size),
hence the requests of others not supporting them are counted as complete (in dubio pro reo), as
before.
@param {object} o... | [
"Valid",
"timings",
"are",
"all",
"timings",
"which",
"are",
"completed",
"not",
"empty",
"and",
"not",
"responded",
"from",
"browser",
"cache",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/performance/trace/Interaction.js#L70-L87 | train | Checks if the request has been completed and if so checks if the request has been cached | [
30522,
3853,
2003,
10175,
3593,
22494,
26379,
29443,
1006,
10848,
15500,
3775,
6562,
1007,
1063,
13075,
30524,
2065,
1996,
5227,
2038,
2042,
2949,
2009,
2038,
3143,
10984,
4481,
1007,
4647,
25377,
25890,
1027,
10848,
15500,
3775,
6562,
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... |
wangfupeng1988/wangEditor | src/js/menus/img/index.js | Image | function Image(editor) {
this.editor = editor
const imgMenuId = getRandom('w-e-img')
this.$elem = $('<div class="w-e-menu" id="' + imgMenuId + '"><i class="w-e-icon-image"></i></div>')
editor.imgMenuId = imgMenuId
this.type = 'panel'
// 当前是否 active 状态
this._active = false
} | javascript | function Image(editor) {
this.editor = editor
const imgMenuId = getRandom('w-e-img')
this.$elem = $('<div class="w-e-menu" id="' + imgMenuId + '"><i class="w-e-icon-image"></i></div>')
editor.imgMenuId = imgMenuId
this.type = 'panel'
// 当前是否 active 状态
this._active = false
} | [
"function",
"Image",
"(",
"editor",
")",
"{",
"this",
".",
"editor",
"=",
"editor",
"const",
"imgMenuId",
"=",
"getRandom",
"(",
"'w-e-img'",
")",
"this",
".",
"$elem",
"=",
"$",
"(",
"'<div class=\"w-e-menu\" id=\"'",
"+",
"imgMenuId",
"+",
"'\"><i class=\"w-... | 构造函数 | [
"构造函数"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/menus/img/index.js#L9-L18 | train | Image 文件 | [
30522,
3853,
3746,
1006,
3559,
1007,
1063,
2023,
1012,
3559,
1027,
3559,
9530,
3367,
10047,
21693,
2368,
21272,
1027,
2131,
13033,
5358,
1006,
1005,
1059,
1011,
1041,
1011,
10047,
2290,
1005,
1007,
2023,
1012,
1002,
3449,
6633,
1027,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/components/scene/screenshot.js | function (projection) {
var params = this.setCapture(projection);
this.renderCapture(params.camera, params.size, params.projection);
return this.canvas;
} | javascript | function (projection) {
var params = this.setCapture(projection);
this.renderCapture(params.camera, params.size, params.projection);
return this.canvas;
} | [
"function",
"(",
"projection",
")",
"{",
"var",
"params",
"=",
"this",
".",
"setCapture",
"(",
"projection",
")",
";",
"this",
".",
"renderCapture",
"(",
"params",
".",
"camera",
",",
"params",
".",
"size",
",",
"params",
".",
"projection",
")",
";",
"... | Return canvas instead of triggering download (e.g., for uploading blob to server). | [
"Return",
"canvas",
"instead",
"of",
"triggering",
"download",
"(",
"e",
".",
"g",
".",
"for",
"uploading",
"blob",
"to",
"server",
")",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/scene/screenshot.js#L188-L192 | train | Render the image with the given projection | [
30522,
3853,
1006,
13996,
1007,
1063,
13075,
11498,
5244,
1027,
2023,
1012,
2275,
17695,
11244,
1006,
13996,
1007,
1025,
2023,
1012,
17552,
17695,
11244,
1006,
11498,
5244,
1012,
4950,
1010,
11498,
5244,
1012,
2946,
1010,
11498,
5244,
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... | |
pixijs/pixi.js | packages/runner/benchmark/index.js | doBench | function doBench(name, fn)
{
timings[name] = {
runs: [],
total: 0,
avg: 0,
};
console.log(`\nbenchmarking ${name}...`);
for (let r = 0; r < numRuns; ++r)
{
const start = performance.now();
for (let i = 0; i < numCycles; i++)
{
fn();
... | javascript | function doBench(name, fn)
{
timings[name] = {
runs: [],
total: 0,
avg: 0,
};
console.log(`\nbenchmarking ${name}...`);
for (let r = 0; r < numRuns; ++r)
{
const start = performance.now();
for (let i = 0; i < numCycles; i++)
{
fn();
... | [
"function",
"doBench",
"(",
"name",
",",
"fn",
")",
"{",
"timings",
"[",
"name",
"]",
"=",
"{",
"runs",
":",
"[",
"]",
",",
"total",
":",
"0",
",",
"avg",
":",
"0",
",",
"}",
";",
"console",
".",
"log",
"(",
"`",
"\\n",
"${",
"name",
"}",
"... | bench helper | [
"bench",
"helper"
] | 99ae03b7565ae7ca5a6de633b0a277f7128fa4d0 | https://github.com/pixijs/pixi.js/blob/99ae03b7565ae7ca5a6de633b0a277f7128fa4d0/packages/runner/benchmark/index.js#L40-L69 | train | Runs the benchmarks for the specified name | [
30522,
3853,
2079,
10609,
2818,
1006,
2171,
1010,
1042,
2078,
1007,
1063,
10984,
2015,
1031,
2171,
1033,
1027,
1063,
3216,
1024,
1031,
1033,
1010,
2561,
1024,
1014,
1010,
20704,
2290,
1024,
1014,
1010,
1065,
1025,
10122,
1012,
8833,
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... |
getinsomnia/insomnia | packages/insomnia-app/app/ui/redux/modules/index.js | getAllDocs | async function getAllDocs() {
// Restore docs in parent->child->grandchild order
const allDocs = [
...(await models.settings.all()),
...(await models.workspace.all()),
...(await models.workspaceMeta.all()),
...(await models.environment.all()),
...(await models.cookieJar.all()),
...(await mod... | javascript | async function getAllDocs() {
// Restore docs in parent->child->grandchild order
const allDocs = [
...(await models.settings.all()),
...(await models.workspace.all()),
...(await models.workspaceMeta.all()),
...(await models.environment.all()),
...(await models.cookieJar.all()),
...(await mod... | [
"async",
"function",
"getAllDocs",
"(",
")",
"{",
"// Restore docs in parent->child->grandchild order",
"const",
"allDocs",
"=",
"[",
"...",
"(",
"await",
"models",
".",
"settings",
".",
"all",
"(",
")",
")",
",",
"...",
"(",
"await",
"models",
".",
"workspace... | Async function to get all docs concurrently | [
"Async",
"function",
"to",
"get",
"all",
"docs",
"concurrently"
] | e24ce7f7b41246e700c4b9bdb6b34b6652ad589b | https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/ui/redux/modules/index.js#L48-L66 | train | Get all docs | [
30522,
2004,
6038,
2278,
3853,
2131,
8095,
3527,
6169,
1006,
1007,
1063,
1013,
1013,
9239,
9986,
2015,
1999,
6687,
1011,
1028,
2775,
1011,
1028,
2882,
19339,
2344,
9530,
3367,
2035,
3527,
6169,
1027,
1031,
1012,
1012,
1012,
1006,
26751,
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... |
adobe/brackets | src/search/node/FindInFilesDomain.js | fileCrawler | function fileCrawler() {
if (!files || (files && files.length === 0)) {
setTimeout(fileCrawler, 1000);
return;
}
var contents = "";
if (currentCrawlIndex < files.length) {
contents = getFileContentsForFile(files[currentCrawlIndex]);
if (contents) {
cacheSize +... | javascript | function fileCrawler() {
if (!files || (files && files.length === 0)) {
setTimeout(fileCrawler, 1000);
return;
}
var contents = "";
if (currentCrawlIndex < files.length) {
contents = getFileContentsForFile(files[currentCrawlIndex]);
if (contents) {
cacheSize +... | [
"function",
"fileCrawler",
"(",
")",
"{",
"if",
"(",
"!",
"files",
"||",
"(",
"files",
"&&",
"files",
".",
"length",
"===",
"0",
")",
")",
"{",
"setTimeout",
"(",
"fileCrawler",
",",
"1000",
")",
";",
"return",
";",
"}",
"var",
"contents",
"=",
"\"... | Crawls through the files in the project ans stores them in cache. Since that could take a while
we do it in batches so that node wont be blocked. | [
"Crawls",
"through",
"the",
"files",
"in",
"the",
"project",
"ans",
"stores",
"them",
"in",
"cache",
".",
"Since",
"that",
"could",
"take",
"a",
"while",
"we",
"do",
"it",
"in",
"batches",
"so",
"that",
"node",
"wont",
"be",
"blocked",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L343-L367 | train | Crawls the files | [
30522,
3853,
5371,
26775,
10376,
3917,
1006,
1007,
1063,
2065,
1006,
999,
6764,
1064,
1064,
1006,
6764,
1004,
1004,
6764,
1012,
3091,
1027,
1027,
1027,
1014,
1007,
1007,
1063,
2275,
7292,
5833,
1006,
5371,
26775,
10376,
3917,
1010,
6694,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/prefer-object-spread.js | getParenTokens | function getParenTokens(node, leftArgumentListParen, sourceCode) {
const parens = [sourceCode.getFirstToken(node), sourceCode.getLastToken(node)];
let leftNext = sourceCode.getTokenBefore(node);
let rightNext = sourceCode.getTokenAfter(node);
// Note: don't include the parens of the argument list.
... | javascript | function getParenTokens(node, leftArgumentListParen, sourceCode) {
const parens = [sourceCode.getFirstToken(node), sourceCode.getLastToken(node)];
let leftNext = sourceCode.getTokenBefore(node);
let rightNext = sourceCode.getTokenAfter(node);
// Note: don't include the parens of the argument list.
... | [
"function",
"getParenTokens",
"(",
"node",
",",
"leftArgumentListParen",
",",
"sourceCode",
")",
"{",
"const",
"parens",
"=",
"[",
"sourceCode",
".",
"getFirstToken",
"(",
"node",
")",
",",
"sourceCode",
".",
"getLastToken",
"(",
"node",
")",
"]",
";",
"let"... | Get the parenthesis tokens of a given ObjectExpression node.
This incldues the braces of the object literal and enclosing parentheses.
@param {ASTNode} node The node to get.
@param {Token} leftArgumentListParen The opening paren token of the argument list.
@param {SourceCode} sourceCode The source code object to get to... | [
"Get",
"the",
"parenthesis",
"tokens",
"of",
"a",
"given",
"ObjectExpression",
"node",
".",
"This",
"incldues",
"the",
"braces",
"of",
"the",
"object",
"literal",
"and",
"enclosing",
"parentheses",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-object-spread.js#L77-L96 | train | Get the parens of a node | [
30522,
3853,
2131,
19362,
4765,
11045,
3619,
1006,
13045,
1010,
2187,
2906,
22850,
4765,
9863,
19362,
2368,
1010,
3120,
16044,
1007,
1063,
9530,
3367,
11968,
6132,
1027,
1031,
3120,
16044,
1012,
2131,
8873,
12096,
18715,
2368,
1006,
13045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | deleteItem | function deleteItem(entry) {
var result = new $.Deferred();
entry.moveToTrash(function (err) {
if (!err) {
DocumentManager.notifyPathDeleted(entry.fullPath);
result.resolve();
} else {
_showErrorDialog(ERR_TYPE_DELETE, entry.isDire... | javascript | function deleteItem(entry) {
var result = new $.Deferred();
entry.moveToTrash(function (err) {
if (!err) {
DocumentManager.notifyPathDeleted(entry.fullPath);
result.resolve();
} else {
_showErrorDialog(ERR_TYPE_DELETE, entry.isDire... | [
"function",
"deleteItem",
"(",
"entry",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"entry",
".",
"moveToTrash",
"(",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"!",
"err",
")",
"{",
"DocumentManager",
".",
"notifyPa... | Delete file or directore from project
@param {!(File|Directory)} entry File or Directory to delete | [
"Delete",
"file",
"or",
"directore",
"from",
"project"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L1130-L1145 | train | Delete an item from the database | [
30522,
3853,
3972,
12870,
4221,
2213,
1006,
4443,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
4443,
1012,
2693,
3406,
6494,
4095,
1006,
3853,
1006,
9413,
2099,
1007,
1063,
2065,
1006,
999,
9413,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | bits/73_wbbin.js | write_BrtFileVersion | function write_BrtFileVersion(data, o) {
if(!o) o = new_buf(127);
for(var i = 0; i != 4; ++i) o.write_shift(4, 0);
write_XLWideString("SheetJS", o);
write_XLWideString(XLSX.version, o);
write_XLWideString(XLSX.version, o);
write_XLWideString("7262", o);
o.length = o.l;
return o.length > o.l ? o.slice(0, o.l) : ... | javascript | function write_BrtFileVersion(data, o) {
if(!o) o = new_buf(127);
for(var i = 0; i != 4; ++i) o.write_shift(4, 0);
write_XLWideString("SheetJS", o);
write_XLWideString(XLSX.version, o);
write_XLWideString(XLSX.version, o);
write_XLWideString("7262", o);
o.length = o.l;
return o.length > o.l ? o.slice(0, o.l) : ... | [
"function",
"write_BrtFileVersion",
"(",
"data",
",",
"o",
")",
"{",
"if",
"(",
"!",
"o",
")",
"o",
"=",
"new_buf",
"(",
"127",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"!=",
"4",
";",
"++",
"i",
")",
"o",
".",
"write_shift",
"("... | /* [MS-XLSB] 2.4.649 BrtFileVersion | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"4",
".",
"649",
"BrtFileVersion"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/73_wbbin.js#L202-L211 | train | write BrtFileVersion - Write BrtFile version | [
30522,
3853,
4339,
1035,
7987,
24475,
9463,
27774,
1006,
2951,
1010,
1051,
1007,
1063,
2065,
1006,
999,
1051,
1007,
1051,
1027,
2047,
1035,
20934,
2546,
1006,
13029,
1007,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
999,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-alert.js | findReference | function findReference(scope, node) {
const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] &&
reference.identifier.range[1] === node.range[1]);
if (references.length === 1) {
return references[0];
}
return null;
} | javascript | function findReference(scope, node) {
const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] &&
reference.identifier.range[1] === node.range[1]);
if (references.length === 1) {
return references[0];
}
return null;
} | [
"function",
"findReference",
"(",
"scope",
",",
"node",
")",
"{",
"const",
"references",
"=",
"scope",
".",
"references",
".",
"filter",
"(",
"reference",
"=>",
"reference",
".",
"identifier",
".",
"range",
"[",
"0",
"]",
"===",
"node",
".",
"range",
"["... | Finds the eslint-scope reference in the given scope.
@param {Object} scope The scope to search.
@param {ASTNode} node The identifier node.
@returns {Reference|null} Returns the found reference or null if none were found. | [
"Finds",
"the",
"eslint",
"-",
"scope",
"reference",
"in",
"the",
"given",
"scope",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-alert.js#L32-L40 | train | Find a reference in the given scope | [
30522,
3853,
2424,
2890,
25523,
1006,
9531,
1010,
13045,
1007,
1063,
9530,
3367,
7604,
1027,
9531,
1012,
7604,
1012,
11307,
1006,
4431,
1027,
1028,
4431,
1012,
8909,
4765,
18095,
1012,
2846,
1031,
1014,
1033,
1027,
1027,
1027,
13045,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
google/material-design-lite | src/mdlComponentHandler.js | findRegisteredClass_ | function findRegisteredClass_(name, optReplace) {
for (var i = 0; i < registeredComponents_.length; i++) {
if (registeredComponents_[i].className === name) {
if (typeof optReplace !== 'undefined') {
registeredComponents_[i] = optReplace;
}
return registeredComponents_[i];
... | javascript | function findRegisteredClass_(name, optReplace) {
for (var i = 0; i < registeredComponents_.length; i++) {
if (registeredComponents_[i].className === name) {
if (typeof optReplace !== 'undefined') {
registeredComponents_[i] = optReplace;
}
return registeredComponents_[i];
... | [
"function",
"findRegisteredClass_",
"(",
"name",
",",
"optReplace",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"registeredComponents_",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"registeredComponents_",
"[",
"i",
"]",
".",
"cl... | Searches registered components for a class we are interested in using.
Optionally replaces a match with passed object if specified.
@param {string} name The name of a class we want to use.
@param {componentHandler.ComponentConfig=} optReplace Optional object to replace match with.
@return {!Object|boolean}
@private | [
"Searches",
"registered",
"components",
"for",
"a",
"class",
"we",
"are",
"interested",
"in",
"using",
".",
"Optionally",
"replaces",
"a",
"match",
"with",
"passed",
"object",
"if",
"specified",
"."
] | 60f441a22ed98ed2c03f6179adf460d888bf459f | https://github.com/google/material-design-lite/blob/60f441a22ed98ed2c03f6179adf460d888bf459f/src/mdlComponentHandler.js#L104-L114 | train | Find a class in the list of registered components | [
30522,
3853,
2424,
2890,
24063,
6850,
26266,
1035,
1006,
2171,
1010,
23569,
2890,
24759,
10732,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
5068,
9006,
29513,
7666,
1035,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/CodeFolding/foldhelpers/foldcode.js | init | function init() {
CodeMirror.defineExtension("foldCode", function (pos, options, force) {
return doFold(this, pos, options, force);
});
CodeMirror.defineExtension("unfoldCode", function (pos, options) {
return doFold(this, pos, options, "unfold");
});
Co... | javascript | function init() {
CodeMirror.defineExtension("foldCode", function (pos, options, force) {
return doFold(this, pos, options, force);
});
CodeMirror.defineExtension("unfoldCode", function (pos, options) {
return doFold(this, pos, options, "unfold");
});
Co... | [
"function",
"init",
"(",
")",
"{",
"CodeMirror",
".",
"defineExtension",
"(",
"\"foldCode\"",
",",
"function",
"(",
"pos",
",",
"options",
",",
"force",
")",
"{",
"return",
"doFold",
"(",
"this",
",",
"pos",
",",
"options",
",",
"force",
")",
";",
"}",... | Initialises extensions and helpers on the CodeMirror object | [
"Initialises",
"extensions",
"and",
"helpers",
"on",
"the",
"CodeMirror",
"object"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldcode.js#L117-L271 | train | Initializes the CodeMirror instance | [
30522,
3853,
1999,
4183,
1006,
1007,
1063,
3642,
14503,
29165,
1012,
9375,
10288,
29048,
1006,
1000,
10671,
16044,
1000,
1010,
3853,
1006,
13433,
2015,
1010,
7047,
1010,
2486,
1007,
1063,
2709,
2079,
10371,
1006,
2023,
1010,
13433,
2015,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/Utils.js | function (oControl) {
var sComponentId = Utils._getOwnerIdForControl(oControl);
if (!sComponentId) {
if (oControl && typeof oControl.getParent === "function") {
var oParent = oControl.getParent();
if (oParent) {
return Utils._getComponentIdForControl(oParent);
}
}
}
return sComp... | javascript | function (oControl) {
var sComponentId = Utils._getOwnerIdForControl(oControl);
if (!sComponentId) {
if (oControl && typeof oControl.getParent === "function") {
var oParent = oControl.getParent();
if (oParent) {
return Utils._getComponentIdForControl(oParent);
}
}
}
return sComp... | [
"function",
"(",
"oControl",
")",
"{",
"var",
"sComponentId",
"=",
"Utils",
".",
"_getOwnerIdForControl",
"(",
"oControl",
")",
";",
"if",
"(",
"!",
"sComponentId",
")",
"{",
"if",
"(",
"oControl",
"&&",
"typeof",
"oControl",
".",
"getParent",
"===",
"\"fu... | Returns ComponentId of the control. If the control has no component, it walks up the control tree in order to find a control having one
@param {sap.ui.core.Control} oControl - SAPUI5 control
@returns {String} The component id or empty string if component id couldn't be found
@see sap.ui.core.Component.getOwnerIdFor
@p... | [
"Returns",
"ComponentId",
"of",
"the",
"control",
".",
"If",
"the",
"control",
"has",
"no",
"component",
"it",
"walks",
"up",
"the",
"control",
"tree",
"in",
"order",
"to",
"find",
"a",
"control",
"having",
"one"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L512-L523 | train | Returns the component id for the control | [
30522,
3853,
1006,
1051,
8663,
13181,
2140,
1007,
1063,
13075,
8040,
25377,
5643,
16778,
2094,
1027,
21183,
12146,
1012,
1035,
2131,
12384,
11124,
20952,
2953,
8663,
13181,
2140,
1006,
1051,
8663,
13181,
2140,
1007,
1025,
2065,
1006,
999,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/dialog/dialog.js | getBoundingClientRect | function getBoundingClientRect (element, orig) {
var source = angular.element((element || {}));
if (source && source.length) {
// Compute and save the target element's bounding rect, so that if the
// element is hidden when the dialog closes, we can shrink the dialog
... | javascript | function getBoundingClientRect (element, orig) {
var source = angular.element((element || {}));
if (source && source.length) {
// Compute and save the target element's bounding rect, so that if the
// element is hidden when the dialog closes, we can shrink the dialog
... | [
"function",
"getBoundingClientRect",
"(",
"element",
",",
"orig",
")",
"{",
"var",
"source",
"=",
"angular",
".",
"element",
"(",
"(",
"element",
"||",
"{",
"}",
")",
")",
";",
"if",
"(",
"source",
"&&",
"source",
".",
"length",
")",
"{",
"// Compute a... | Identify the bounding RECT for the target element | [
"Identify",
"the",
"bounding",
"RECT",
"for",
"the",
"target",
"element"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L912-L929 | train | Get the bounding rect of the given element | [
30522,
3853,
2131,
15494,
2075,
20464,
11638,
2890,
6593,
1006,
5783,
1010,
2030,
8004,
1007,
1063,
13075,
3120,
1027,
16108,
1012,
5783,
1006,
1006,
5783,
1064,
1064,
1063,
1065,
1007,
1007,
1025,
2065,
1006,
3120,
1004,
1004,
3120,
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... |
TryGhost/Ghost | core/server/api/v0.1/subscribers.js | getSubscriberByEmail | function getSubscriberByEmail(options) {
if (options.email) {
return models.Subscriber.getByEmail(options.email, options)
.then((subscriber) => {
if (!subscriber) {
return Promise.reject(new common.errors.NotFoundError({... | javascript | function getSubscriberByEmail(options) {
if (options.email) {
return models.Subscriber.getByEmail(options.email, options)
.then((subscriber) => {
if (!subscriber) {
return Promise.reject(new common.errors.NotFoundError({... | [
"function",
"getSubscriberByEmail",
"(",
"options",
")",
"{",
"if",
"(",
"options",
".",
"email",
")",
"{",
"return",
"models",
".",
"Subscriber",
".",
"getByEmail",
"(",
"options",
".",
"email",
",",
"options",
")",
".",
"then",
"(",
"(",
"subscriber",
... | ### Delete Subscriber
If we have an email param, check the subscriber exists
@type {[type]} | [
"###",
"Delete",
"Subscriber",
"If",
"we",
"have",
"an",
"email",
"param",
"check",
"the",
"subscriber",
"exists"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/subscribers.js#L208-L224 | train | Get a subscriber by email | [
30522,
3853,
4152,
12083,
29234,
15185,
6672,
21397,
1006,
7047,
1007,
1063,
2065,
1006,
7047,
1012,
10373,
1007,
1063,
2709,
4275,
1012,
4942,
29234,
2099,
1012,
2131,
3762,
14545,
4014,
1006,
7047,
1012,
10373,
1010,
7047,
1007,
1012,
205... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-prototype-builtins.js | disallowBuiltIns | function disallowBuiltIns(node) {
if (node.callee.type !== "MemberExpression" || node.callee.computed) {
return;
}
const propName = node.callee.property.name;
if (DISALLOWED_PROPS.indexOf(propName) > -1) {
context.report({
... | javascript | function disallowBuiltIns(node) {
if (node.callee.type !== "MemberExpression" || node.callee.computed) {
return;
}
const propName = node.callee.property.name;
if (DISALLOWED_PROPS.indexOf(propName) > -1) {
context.report({
... | [
"function",
"disallowBuiltIns",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"callee",
".",
"type",
"!==",
"\"MemberExpression\"",
"||",
"node",
".",
"callee",
".",
"computed",
")",
"{",
"return",
";",
"}",
"const",
"propName",
"=",
"node",
".",
"calle... | Reports if a disallowed property is used in a CallExpression
@param {ASTNode} node The CallExpression node.
@returns {void} | [
"Reports",
"if",
"a",
"disallowed",
"property",
"is",
"used",
"in",
"a",
"CallExpression"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-prototype-builtins.js#L37-L51 | train | Check if a node is a MemberExpression that is not a MemberExpression | [
30522,
3853,
4487,
12002,
8261,
8569,
4014,
7629,
2015,
1006,
13045,
1007,
1063,
2065,
1006,
13045,
1012,
2655,
4402,
1012,
2828,
999,
1027,
1027,
1000,
2266,
10288,
20110,
3258,
1000,
1064,
1064,
13045,
1012,
2655,
4402,
1012,
24806,
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... |
nhn/tui.editor | src/js/extensions/chart/chart.js | chartReplacer | function chartReplacer(codeBlockChartDataAndOptions, extensionOptions) {
const randomId = `chart-${Math.random().toString(36).substr(2, 10)}`;
let renderedHTML = `<div id="${randomId}" class="chart" />`;
setTimeout(() => {
const chartContainer = document.querySelector(`#${randomId}`);
try {
parseCo... | javascript | function chartReplacer(codeBlockChartDataAndOptions, extensionOptions) {
const randomId = `chart-${Math.random().toString(36).substr(2, 10)}`;
let renderedHTML = `<div id="${randomId}" class="chart" />`;
setTimeout(() => {
const chartContainer = document.querySelector(`#${randomId}`);
try {
parseCo... | [
"function",
"chartReplacer",
"(",
"codeBlockChartDataAndOptions",
",",
"extensionOptions",
")",
"{",
"const",
"randomId",
"=",
"`",
"${",
"Math",
".",
"random",
"(",
")",
".",
"toString",
"(",
"36",
")",
".",
"substr",
"(",
"2",
",",
"10",
")",
"}",
"`",... | replace html from chart data
@param {string} codeBlockChartDataAndOptions - chart data text
@param {Object} extensionOptions - chart extension options
@returns {string} - rendered html
@ignore | [
"replace",
"html",
"from",
"chart",
"data"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/chart/chart.js#L366-L392 | train | Replace chart with chart data | [
30522,
3853,
3673,
2890,
24759,
10732,
2099,
1006,
3642,
23467,
7507,
5339,
2850,
2696,
28574,
16790,
2015,
1010,
5331,
7361,
9285,
1007,
1063,
9530,
3367,
6721,
3593,
1027,
1036,
3673,
1011,
1002,
1063,
8785,
1012,
6721,
1006,
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... |
openlayers/openlayers | src/ol/interaction/KeyboardZoom.js | handleEvent | function handleEvent(mapBrowserEvent) {
let stopEvent = false;
if (mapBrowserEvent.type == EventType.KEYDOWN ||
mapBrowserEvent.type == EventType.KEYPRESS) {
const keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);
const charCode = keyEvent.charCode;
if (this.condition_(mapBr... | javascript | function handleEvent(mapBrowserEvent) {
let stopEvent = false;
if (mapBrowserEvent.type == EventType.KEYDOWN ||
mapBrowserEvent.type == EventType.KEYPRESS) {
const keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);
const charCode = keyEvent.charCode;
if (this.condition_(mapBr... | [
"function",
"handleEvent",
"(",
"mapBrowserEvent",
")",
"{",
"let",
"stopEvent",
"=",
"false",
";",
"if",
"(",
"mapBrowserEvent",
".",
"type",
"==",
"EventType",
".",
"KEYDOWN",
"||",
"mapBrowserEvent",
".",
"type",
"==",
"EventType",
".",
"KEYPRESS",
")",
"... | Handles the {@link module:ol/MapBrowserEvent map browser event} if it was a
`KeyEvent`, and decides whether to zoom in or out (depending on whether the
key pressed was '+' or '-').
@param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
@return {boolean} `false` to stop event propagation.
@t... | [
"Handles",
"the",
"{"
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/interaction/KeyboardZoom.js#L76-L93 | train | Handle a map event | [
30522,
3853,
5047,
18697,
3372,
1006,
4949,
12618,
9333,
7869,
15338,
1007,
1063,
2292,
2644,
18697,
3372,
1027,
6270,
1025,
2065,
1006,
4949,
12618,
9333,
7869,
15338,
1012,
2828,
1027,
1027,
2724,
13874,
1012,
3145,
7698,
1064,
1064,
4949... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/ScopeManager.js | requestParameterHint | function requestParameterHint(session, functionOffset) {
var $deferredHints = $.Deferred(),
fileInfo = getFileInfo(session, true),
offset = getOffset(session, fileInfo, functionOffset),
fnTypePromise = getTernFunctionType(fileInfo, offset);
$.when(fnTypePromise).done... | javascript | function requestParameterHint(session, functionOffset) {
var $deferredHints = $.Deferred(),
fileInfo = getFileInfo(session, true),
offset = getOffset(session, fileInfo, functionOffset),
fnTypePromise = getTernFunctionType(fileInfo, offset);
$.when(fnTypePromise).done... | [
"function",
"requestParameterHint",
"(",
"session",
",",
"functionOffset",
")",
"{",
"var",
"$deferredHints",
"=",
"$",
".",
"Deferred",
"(",
")",
",",
"fileInfo",
"=",
"getFileInfo",
"(",
"session",
",",
"true",
")",
",",
"offset",
"=",
"getOffset",
"(",
... | Request a parameter hint from Tern.
@param {Session} session - the active hinting session
@param {{line: number, ch: number}} functionOffset - the offset of the function call.
@return {jQuery.Promise} - The promise will not complete until the
hint has completed. | [
"Request",
"a",
"parameter",
"hint",
"from",
"Tern",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1428-L1445 | train | Request parameter hint | [
30522,
3853,
5227,
28689,
22828,
10606,
2102,
1006,
5219,
1010,
3853,
27475,
3388,
1007,
1063,
13075,
1002,
13366,
28849,
19114,
7666,
1027,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
5371,
2378,
14876,
1027,
2131,
8873,
19856,
14876,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/table/tableRangeHandler.js | getTableSelectionRange | function getTableSelectionRange(tableData, $selectedCells, $startContainer) {
const cellIndexData = tableDataHandler.createCellIndexData(tableData);
const tableRange = {};
if ($selectedCells.length) {
const startRange = tableDataHandler.findCellIndex(cellIndexData, $selectedCells.first());
const endRange... | javascript | function getTableSelectionRange(tableData, $selectedCells, $startContainer) {
const cellIndexData = tableDataHandler.createCellIndexData(tableData);
const tableRange = {};
if ($selectedCells.length) {
const startRange = tableDataHandler.findCellIndex(cellIndexData, $selectedCells.first());
const endRange... | [
"function",
"getTableSelectionRange",
"(",
"tableData",
",",
"$selectedCells",
",",
"$startContainer",
")",
"{",
"const",
"cellIndexData",
"=",
"tableDataHandler",
".",
"createCellIndexData",
"(",
"tableData",
")",
";",
"const",
"tableRange",
"=",
"{",
"}",
";",
"... | Get table selection range.
@param {Array.<Array.<object>>} tableData - table data
@param {jQuery} $selectedCells - selected cells jQuery elements
@param {jQuery} $startContainer - start container jQuery element of text range
@returns {{
start: {rowIndex: number, colIndex: number},
end: {rowIndex: number, colIndex: numb... | [
"Get",
"table",
"selection",
"range",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/tableRangeHandler.js#L181-L209 | train | Get table selection range | [
30522,
3853,
2131,
10880,
11246,
18491,
24388,
2063,
1006,
2795,
2850,
2696,
1010,
1002,
3479,
29109,
4877,
1010,
1002,
2707,
8663,
18249,
2121,
1007,
1063,
9530,
3367,
3526,
22254,
10288,
2850,
2696,
1027,
2795,
2850,
2696,
11774,
3917,
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... |
netlify/netlify-cms | packages/netlify-cms-media-library-uploadcare/src/index.js | getFileGroup | function getFileGroup(files) {
/**
* Capture the group id from the first file in the files array.
*/
const groupId = new RegExp(`^.+/([^/]+~${files.length})/nth/`).exec(files[0])[1];
/**
* The `openDialog` method handles the jQuery promise object returned by
* `fileFrom`, but requires the promise ret... | javascript | function getFileGroup(files) {
/**
* Capture the group id from the first file in the files array.
*/
const groupId = new RegExp(`^.+/([^/]+~${files.length})/nth/`).exec(files[0])[1];
/**
* The `openDialog` method handles the jQuery promise object returned by
* `fileFrom`, but requires the promise ret... | [
"function",
"getFileGroup",
"(",
"files",
")",
"{",
"/**\n * Capture the group id from the first file in the files array.\n */",
"const",
"groupId",
"=",
"new",
"RegExp",
"(",
"`",
"${",
"files",
".",
"length",
"}",
"`",
")",
".",
"exec",
"(",
"files",
"[",
"0... | Returns a fileGroupInfo object wrapped in a promise-like object. | [
"Returns",
"a",
"fileGroupInfo",
"object",
"wrapped",
"in",
"a",
"promise",
"-",
"like",
"object",
"."
] | 2488556590cbfdcefa626f2f2de01e7a160cf6ee | https://github.com/netlify/netlify-cms/blob/2488556590cbfdcefa626f2f2de01e7a160cf6ee/packages/netlify-cms-media-library-uploadcare/src/index.js#L34-L46 | train | Get the file group from an array of files | [
30522,
3853,
2131,
8873,
23115,
22107,
1006,
6764,
1007,
1063,
1013,
1008,
1008,
1008,
5425,
1996,
2177,
8909,
2013,
1996,
2034,
5371,
1999,
1996,
6764,
9140,
1012,
1008,
1013,
9530,
3367,
2177,
3593,
1027,
2047,
19723,
10288,
2361,
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... |
Freeboard/freeboard | js/freeboard.thirdparty.js | function(input, inst) {
var showOn, buttonText, buttonImage,
appendText = this._get(inst, "appendText"),
isRTL = this._get(inst, "isRTL");
if (inst.append) {
inst.append.remove();
}
if (appendText) {
inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
input[isRT... | javascript | function(input, inst) {
var showOn, buttonText, buttonImage,
appendText = this._get(inst, "appendText"),
isRTL = this._get(inst, "isRTL");
if (inst.append) {
inst.append.remove();
}
if (appendText) {
inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
input[isRT... | [
"function",
"(",
"input",
",",
"inst",
")",
"{",
"var",
"showOn",
",",
"buttonText",
",",
"buttonImage",
",",
"appendText",
"=",
"this",
".",
"_get",
"(",
"inst",
",",
"\"appendText\"",
")",
",",
"isRTL",
"=",
"this",
".",
"_get",
"(",
"inst",
",",
"... | /* Make attachments based on settings. | [
"/",
"*",
"Make",
"attachments",
"based",
"on",
"settings",
"."
] | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L7802-L7847 | train | Show the date picker when the datepicker is clicked | [
30522,
3853,
1006,
7953,
1010,
16021,
2102,
1007,
1063,
13075,
2265,
2239,
1010,
6462,
18209,
1010,
6462,
9581,
3351,
1010,
10439,
10497,
18209,
1027,
2023,
1012,
1035,
2131,
1006,
16021,
2102,
1010,
1000,
10439,
10497,
18209,
1000,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | renderedPosition | function renderedPosition(dim, val) {
var ele = this[0];
var cy = this.cy();
var zoom = cy.zoom();
var pan = cy.pan();
var rpos = plainObject(dim) ? dim : undefined;
var setting = rpos !== undefined || val !== undefined && string(dim);
if (ele && ele.isNode()) {
// must have an elemen... | javascript | function renderedPosition(dim, val) {
var ele = this[0];
var cy = this.cy();
var zoom = cy.zoom();
var pan = cy.pan();
var rpos = plainObject(dim) ? dim : undefined;
var setting = rpos !== undefined || val !== undefined && string(dim);
if (ele && ele.isNode()) {
// must have an elemen... | [
"function",
"renderedPosition",
"(",
"dim",
",",
"val",
")",
"{",
"var",
"ele",
"=",
"this",
"[",
"0",
"]",
";",
"var",
"cy",
"=",
"this",
".",
"cy",
"(",
")",
";",
"var",
"zoom",
"=",
"cy",
".",
"zoom",
"(",
")",
";",
"var",
"pan",
"=",
"cy"... | get/set the rendered (i.e. on screen) positon of the element | [
"get",
"/",
"set",
"the",
"rendered",
"(",
"i",
".",
"e",
".",
"on",
"screen",
")",
"positon",
"of",
"the",
"element"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L8340-L8380 | train | Returns the rendered position of an element in the specified dimension. | [
30522,
3853,
10155,
26994,
1006,
11737,
1010,
11748,
1007,
1063,
13075,
3449,
2063,
1027,
2023,
1031,
1014,
1033,
1025,
13075,
22330,
1027,
2023,
1012,
22330,
1006,
1007,
1025,
13075,
24095,
1027,
22330,
1012,
24095,
1006,
1007,
1025,
13075,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/table/table.js | _changeHtml | function _changeHtml(html, onChangeTable) {
const $tempDiv = $(`<div>${html}</div>`);
const $tables = $tempDiv.find('table');
if ($tables.length) {
$tables.get().forEach(tableElement => {
const changedTableElement = onChangeTable(tableElement);
$(tableElement).replaceWith(changedTableElement);
... | javascript | function _changeHtml(html, onChangeTable) {
const $tempDiv = $(`<div>${html}</div>`);
const $tables = $tempDiv.find('table');
if ($tables.length) {
$tables.get().forEach(tableElement => {
const changedTableElement = onChangeTable(tableElement);
$(tableElement).replaceWith(changedTableElement);
... | [
"function",
"_changeHtml",
"(",
"html",
",",
"onChangeTable",
")",
"{",
"const",
"$tempDiv",
"=",
"$",
"(",
"`",
"${",
"html",
"}",
"`",
")",
";",
"const",
"$tables",
"=",
"$tempDiv",
".",
"find",
"(",
"'table'",
")",
";",
"if",
"(",
"$tables",
".",
... | Change html by onChangeTable function.
@param {string} html - original html
@param {function} onChangeTable - function for changing html
@returns {string}
@private | [
"Change",
"html",
"by",
"onChangeTable",
"function",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/table.js#L80-L95 | train | Change html to table elements | [
30522,
3853,
1035,
2689,
11039,
19968,
1006,
16129,
1010,
2006,
22305,
12928,
3468,
1007,
1063,
9530,
3367,
1002,
8915,
8737,
4305,
2615,
1027,
1002,
1006,
1036,
1026,
4487,
2615,
1028,
1002,
1063,
16129,
1065,
1026,
1013,
4487,
2615,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/comma-dangle.js | forbidTrailingComma | function forbidTrailingComma(node) {
const lastItem = getLastItem(node);
if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) {
return;
}
const trailingToken = getTrailingToken(node, lastItem);
if (ast... | javascript | function forbidTrailingComma(node) {
const lastItem = getLastItem(node);
if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) {
return;
}
const trailingToken = getTrailingToken(node, lastItem);
if (ast... | [
"function",
"forbidTrailingComma",
"(",
"node",
")",
"{",
"const",
"lastItem",
"=",
"getLastItem",
"(",
"node",
")",
";",
"if",
"(",
"!",
"lastItem",
"||",
"(",
"node",
".",
"type",
"===",
"\"ImportDeclaration\"",
"&&",
"lastItem",
".",
"type",
"!==",
"\"I... | Reports a trailing comma if it exists.
@param {ASTNode} node - A node to check. Its type is one of
ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
ImportDeclaration, and ExportNamedDeclaration.
@returns {void} | [
"Reports",
"a",
"trailing",
"comma",
"if",
"it",
"exists",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/comma-dangle.js#L227-L246 | train | Check if trailing comma is present | [
30522,
3853,
27206,
6494,
16281,
9006,
2863,
1006,
13045,
1007,
1063,
9530,
3367,
2197,
4221,
2213,
1027,
2131,
8523,
23096,
2213,
1006,
13045,
1007,
1025,
2065,
1006,
999,
2197,
4221,
2213,
1064,
1064,
1006,
13045,
1012,
2828,
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... |
angular/material | src/components/datepicker/js/datepickerDirective.js | datePickerDirective | function datePickerDirective($$mdSvgRegistry, $mdUtil, $mdAria, inputDirective) {
return {
template: function(tElement, tAttrs) {
// Buttons are not in the tab order because users can open the calendar via keyboard
// interaction on the text input, and multiple tab stops for one component (pic... | javascript | function datePickerDirective($$mdSvgRegistry, $mdUtil, $mdAria, inputDirective) {
return {
template: function(tElement, tAttrs) {
// Buttons are not in the tab order because users can open the calendar via keyboard
// interaction on the text input, and multiple tab stops for one component (pic... | [
"function",
"datePickerDirective",
"(",
"$$mdSvgRegistry",
",",
"$mdUtil",
",",
"$mdAria",
",",
"inputDirective",
")",
"{",
"return",
"{",
"template",
":",
"function",
"(",
"tElement",
",",
"tAttrs",
")",
"{",
"// Buttons are not in the tab order because users can open ... | @ngdoc directive
@name mdDatepicker
@module material.components.datepicker
@param {Date} ng-model The component's model. Expects either a JavaScript Date object or a
value that can be parsed into one (e.g. a ISO 8601 string).
@param {Object=} ng-model-options Allows tuning of the way in which `ng-model` is being
updat... | [
"@ngdoc",
"directive",
"@name",
"mdDatepicker",
"@module",
"material",
".",
"components",
".",
"datepicker"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/datepickerDirective.js#L76-L204 | train | Directive to create a date picker | [
30522,
3853,
3058,
24330,
5484,
4305,
2890,
15277,
1006,
1002,
1002,
9108,
2015,
2615,
17603,
24063,
2854,
1010,
1002,
9108,
21823,
2140,
1010,
1002,
9108,
10980,
1010,
7953,
4305,
2890,
15277,
1007,
1063,
2709,
1063,
23561,
1024,
3853,
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... |
adobe/brackets | src/extensions/default/QuickOpenCSS/main.js | itemFocus | function itemFocus(selectedItem, query, explicit) {
if (!selectedItem || (query.length < 2 && !explicit)) {
return;
}
var selectorInfo = selectedItem.selectorInfo;
var from = {line: selectorInfo.selectorStartLine, ch: selectorInfo.selectorStartChar};
var to = {line: ... | javascript | function itemFocus(selectedItem, query, explicit) {
if (!selectedItem || (query.length < 2 && !explicit)) {
return;
}
var selectorInfo = selectedItem.selectorInfo;
var from = {line: selectorInfo.selectorStartLine, ch: selectorInfo.selectorStartChar};
var to = {line: ... | [
"function",
"itemFocus",
"(",
"selectedItem",
",",
"query",
",",
"explicit",
")",
"{",
"if",
"(",
"!",
"selectedItem",
"||",
"(",
"query",
".",
"length",
"<",
"2",
"&&",
"!",
"explicit",
")",
")",
"{",
"return",
";",
"}",
"var",
"selectorInfo",
"=",
... | Scroll to the selected item in the current document (unless no query string entered yet,
in which case the topmost list item is irrelevant)
@param {?SearchResult} selectedItem
@param {string} query
@param {boolean} explicit False if this is only highlighted due to being at top of list after search() | [
"Scroll",
"to",
"the",
"selected",
"item",
"in",
"the",
"current",
"document",
"(",
"unless",
"no",
"query",
"string",
"entered",
"yet",
"in",
"which",
"case",
"the",
"topmost",
"list",
"item",
"is",
"irrelevant",
")"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/QuickOpenCSS/main.js#L85-L94 | train | Focuses the current item | [
30522,
3853,
8875,
14876,
7874,
1006,
3479,
4221,
2213,
1010,
23032,
1010,
13216,
1007,
1063,
2065,
1006,
999,
3479,
4221,
2213,
1064,
1064,
1006,
23032,
1012,
3091,
1026,
1016,
1004,
1004,
999,
13216,
1007,
1007,
1063,
2709,
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... |
SheetJS/js-xlsx | xlsx.js | sheet_to_rtf | function sheet_to_rtf(ws) {
var o = ["{\\rtf1\\ansi"];
var r = safe_decode_range(ws['!ref']), cell;
var dense = Array.isArray(ws);
for(var R = r.s.r; R <= r.e.r; ++R) {
o.push("\\trowd\\trautofit1");
for(var C = r.s.c; C <= r.e.c; ++C) o.push("\\cellx" + (C+1));
o.push("\\pard\\intbl");
for(C = r.s.... | javascript | function sheet_to_rtf(ws) {
var o = ["{\\rtf1\\ansi"];
var r = safe_decode_range(ws['!ref']), cell;
var dense = Array.isArray(ws);
for(var R = r.s.r; R <= r.e.r; ++R) {
o.push("\\trowd\\trautofit1");
for(var C = r.s.c; C <= r.e.c; ++C) o.push("\\cellx" + (C+1));
o.push("\\pard\\intbl");
for(C = r.s.... | [
"function",
"sheet_to_rtf",
"(",
"ws",
")",
"{",
"var",
"o",
"=",
"[",
"\"{\\\\rtf1\\\\ansi\"",
"]",
";",
"var",
"r",
"=",
"safe_decode_range",
"(",
"ws",
"[",
"'!ref'",
"]",
")",
",",
"cell",
";",
"var",
"dense",
"=",
"Array",
".",
"isArray",
"(",
"... | /* TODO: this is a stub | [
"/",
"*",
"TODO",
":",
"this",
"is",
"a",
"stub"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L8455-L8473 | train | Converts a sheet to RTF format | [
30522,
3853,
7123,
1035,
2000,
1035,
19387,
2546,
1006,
1059,
2015,
1007,
1063,
13075,
1051,
1027,
1031,
1000,
1063,
1032,
1032,
19387,
2546,
2487,
1032,
1032,
2019,
5332,
1000,
1033,
1025,
13075,
1054,
1027,
3647,
1035,
21933,
3207,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/api/v0.1/mail.js | generateContent | function generateContent(result) {
return mail.utils.generateContent({template: 'test'}).then((content) => {
const payload = {
mail: [{
message: {
to: result.get('email'),
subject: common.i18n... | javascript | function generateContent(result) {
return mail.utils.generateContent({template: 'test'}).then((content) => {
const payload = {
mail: [{
message: {
to: result.get('email'),
subject: common.i18n... | [
"function",
"generateContent",
"(",
"result",
")",
"{",
"return",
"mail",
".",
"utils",
".",
"generateContent",
"(",
"{",
"template",
":",
"'test'",
"}",
")",
".",
"then",
"(",
"(",
"content",
")",
"=>",
"{",
"const",
"payload",
"=",
"{",
"mail",
":",
... | ### Generate content | [
"###",
"Generate",
"content"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/mail.js#L118-L133 | train | Generate the content for the test | [
30522,
3853,
9699,
8663,
6528,
2102,
1006,
2765,
1007,
1063,
2709,
5653,
1012,
21183,
12146,
1012,
9699,
8663,
6528,
2102,
1006,
1063,
23561,
1024,
1005,
3231,
1005,
1065,
1007,
1012,
2059,
1006,
1006,
4180,
1007,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/XMLTemplateProcessor.js | findControlClass | function findControlClass(sNamespaceURI, sLocalName) {
var sClassName;
var mLibraries = sap.ui.getCore().getLoadedLibraries();
jQuery.each(mLibraries, function(sLibName, oLibrary) {
if ( sNamespaceURI === oLibrary.namespace || sNamespaceURI === oLibrary.name ) {
sClassName = oLibrary.name + "." + ((oL... | javascript | function findControlClass(sNamespaceURI, sLocalName) {
var sClassName;
var mLibraries = sap.ui.getCore().getLoadedLibraries();
jQuery.each(mLibraries, function(sLibName, oLibrary) {
if ( sNamespaceURI === oLibrary.namespace || sNamespaceURI === oLibrary.name ) {
sClassName = oLibrary.name + "." + ((oL... | [
"function",
"findControlClass",
"(",
"sNamespaceURI",
",",
"sLocalName",
")",
"{",
"var",
"sClassName",
";",
"var",
"mLibraries",
"=",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getLoadedLibraries",
"(",
")",
";",
"jQuery",
".",
"each",
"(",
"mLibra... | Requests the control class if not loaded yet.
If the View is set to async=true, an async XHR is sent, otherwise a sync XHR.
@param {string} sNamespaceURI
@param {string} sLocalName
@returns {function|Promise|undefined} the loaded ControlClass plain or resolved from a Promise | [
"Requests",
"the",
"control",
"class",
"if",
"not",
"loaded",
"yet",
".",
"If",
"the",
"View",
"is",
"set",
"to",
"async",
"=",
"true",
"an",
"async",
"XHR",
"is",
"sent",
"otherwise",
"a",
"sync",
"XHR",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/XMLTemplateProcessor.js#L469-L510 | train | Finds the control class from the library | [
30522,
3853,
2424,
8663,
13181,
15472,
27102,
1006,
1055,
18442,
23058,
9496,
1010,
22889,
24755,
19666,
14074,
1007,
1063,
13075,
8040,
27102,
18442,
1025,
13075,
19875,
12322,
19848,
3111,
1027,
20066,
1012,
21318,
1012,
2131,
17345,
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/preferences/PreferencesBase.js | function (id, context) {
var layerCounter,
layers = this._layers,
layer,
data = this.data,
result;
context = context || {};
for (layerCounter = 0; layerCounter < layers.length; layerCounter++) {
layer =... | javascript | function (id, context) {
var layerCounter,
layers = this._layers,
layer,
data = this.data,
result;
context = context || {};
for (layerCounter = 0; layerCounter < layers.length; layerCounter++) {
layer =... | [
"function",
"(",
"id",
",",
"context",
")",
"{",
"var",
"layerCounter",
",",
"layers",
"=",
"this",
".",
"_layers",
",",
"layer",
",",
"data",
"=",
"this",
".",
"data",
",",
"result",
";",
"context",
"=",
"context",
"||",
"{",
"}",
";",
"for",
"(",... | Get the value for id, given the context. The context is provided to layers
which may override the value from the main data of the Scope. Note that
layers will often exclude values from consideration.
@param {string} id Preference to retrieve
@param {?Object} context Optional additional information about the request
@r... | [
"Get",
"the",
"value",
"for",
"id",
"given",
"the",
"context",
".",
"The",
"context",
"is",
"provided",
"to",
"layers",
"which",
"may",
"override",
"the",
"value",
"from",
"the",
"main",
"data",
"of",
"the",
"Scope",
".",
"Note",
"that",
"layers",
"will"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L415-L435 | train | Get a record from the cache | [
30522,
3853,
1006,
8909,
1010,
6123,
1007,
1063,
13075,
6741,
3597,
16671,
2121,
1010,
9014,
1027,
2023,
1012,
1035,
9014,
1010,
6741,
1010,
2951,
1027,
2023,
1012,
2951,
1010,
2765,
1025,
6123,
1027,
6123,
1064,
1064,
1063,
1065,
1025,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | function(globString) {
this.regexp = new RegExp(PatternMatcher.regexpFromGlobContains(globString));
this.matches = function(actual) {
return this.regexp.test(actual);
};
} | javascript | function(globString) {
this.regexp = new RegExp(PatternMatcher.regexpFromGlobContains(globString));
this.matches = function(actual) {
return this.regexp.test(actual);
};
} | [
"function",
"(",
"globString",
")",
"{",
"this",
".",
"regexp",
"=",
"new",
"RegExp",
"(",
"PatternMatcher",
".",
"regexpFromGlobContains",
"(",
"globString",
")",
")",
";",
"this",
".",
"matches",
"=",
"function",
"(",
"actual",
")",
"{",
"return",
"this"... | "globContains" (aka "wildmat") patterns, e.g. "glob:one,two,*",
but don't require a perfect match; instead succeed if actual
contains something that matches globString.
Making this distinction is motivated by a bug in IE6 which
leads to the browser hanging if we implement *TextPresent tests
by just matching against a r... | [
"globContains",
"(",
"aka",
"wildmat",
")",
"patterns",
"e",
".",
"g",
".",
"glob",
":",
"one",
"two",
"*",
"but",
"don",
"t",
"require",
"a",
"perfect",
"match",
";",
"instead",
"succeed",
"if",
"actual",
"contains",
"something",
"that",
"matches",
"glo... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L672-L677 | train | A class that matches a glob string | [
30522,
3853,
1006,
1043,
4135,
5910,
18886,
3070,
1007,
1063,
2023,
1012,
19723,
10288,
2361,
1027,
2047,
19723,
10288,
2361,
1006,
5418,
18900,
7474,
1012,
19723,
10288,
14376,
21716,
23296,
16429,
8663,
18249,
2015,
1006,
1043,
4135,
5910,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/models/CustomListSelection.js | function() {
if (!this.selectionmodel) {
this.selectionmodel = new SelectionModel(SelectionModel.MULTI_SELECTION);
} else {
this.selectionmodel.clearSelection();
}
var aIndices = this._getSelectedIndicesFromModel();
for (var i = 0; i < aIndices.length; i++) {
this.selectionmodel.addSelection... | javascript | function() {
if (!this.selectionmodel) {
this.selectionmodel = new SelectionModel(SelectionModel.MULTI_SELECTION);
} else {
this.selectionmodel.clearSelection();
}
var aIndices = this._getSelectedIndicesFromModel();
for (var i = 0; i < aIndices.length; i++) {
this.selectionmodel.addSelection... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"selectionmodel",
")",
"{",
"this",
".",
"selectionmodel",
"=",
"new",
"SelectionModel",
"(",
"SelectionModel",
".",
"MULTI_SELECTION",
")",
";",
"}",
"else",
"{",
"this",
".",
"selectionmodel",
".",
... | Private | [
"Private"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/models/CustomListSelection.js#L336-L351 | train | Initializes the selection model | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
999,
2023,
1012,
4989,
5302,
9247,
1007,
1063,
2023,
1012,
4989,
5302,
9247,
1027,
2047,
4989,
5302,
9247,
1006,
4989,
5302,
9247,
1012,
4800,
1035,
4989,
1007,
1025,
1065,
2842,
1063,
2023,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
TryGhost/Ghost | core/server/services/url/utils.js | urlFor | function urlFor(context, data, absolute) {
var urlPath = '/',
secure, imagePathRe,
knownObjects = ['image', 'nav'], baseUrl,
hostname,
// this will become really big
knownPaths = {
home: '/',
sitemap_xsl: '/sitemap.xsl'
};
// Make data pr... | javascript | function urlFor(context, data, absolute) {
var urlPath = '/',
secure, imagePathRe,
knownObjects = ['image', 'nav'], baseUrl,
hostname,
// this will become really big
knownPaths = {
home: '/',
sitemap_xsl: '/sitemap.xsl'
};
// Make data pr... | [
"function",
"urlFor",
"(",
"context",
",",
"data",
",",
"absolute",
")",
"{",
"var",
"urlPath",
"=",
"'/'",
",",
"secure",
",",
"imagePathRe",
",",
"knownObjects",
"=",
"[",
"'image'",
",",
"'nav'",
"]",
",",
"baseUrl",
",",
"hostname",
",",
"// this wil... | ## urlFor Synchronous url creation for a given context Can generate a url for a named path and given path. Determines what sort of context it has been given, and delegates to the correct generation method, Finally passing to createUrl, to ensure any subdirectory is honoured, and the url is absolute if needed Usage: url... | [
"##",
"urlFor",
"Synchronous",
"url",
"creation",
"for",
"a",
"given",
"context",
"Can",
"generate",
"a",
"url",
"for",
"a",
"named",
"path",
"and",
"given",
"path",
".",
"Determines",
"what",
"sort",
"of",
"context",
"it",
"has",
"been",
"given",
"and",
... | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/services/url/utils.js#L260-L364 | train | Get the URL for a specific context | [
30522,
3853,
24471,
10270,
2953,
1006,
6123,
1010,
2951,
1010,
7619,
1007,
1063,
13075,
24471,
14277,
8988,
1027,
1005,
1013,
1005,
1010,
5851,
1010,
3746,
15069,
2890,
1010,
2124,
16429,
20614,
2015,
1027,
1031,
1005,
3746,
1005,
1010,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/components/material.js | parseBlending | function parseBlending (blending) {
switch (blending) {
case 'none': {
return THREE.NoBlending;
}
case 'additive': {
return THREE.AdditiveBlending;
}
case 'subtractive': {
return THREE.SubtractiveBlending;
}
case 'multiply': {
return THREE.MultiplyBlending;
}
... | javascript | function parseBlending (blending) {
switch (blending) {
case 'none': {
return THREE.NoBlending;
}
case 'additive': {
return THREE.AdditiveBlending;
}
case 'subtractive': {
return THREE.SubtractiveBlending;
}
case 'multiply': {
return THREE.MultiplyBlending;
}
... | [
"function",
"parseBlending",
"(",
"blending",
")",
"{",
"switch",
"(",
"blending",
")",
"{",
"case",
"'none'",
":",
"{",
"return",
"THREE",
".",
"NoBlending",
";",
"}",
"case",
"'additive'",
":",
"{",
"return",
"THREE",
".",
"AdditiveBlending",
";",
"}",
... | Return a three.js constant determining blending
@param {string} [blending=normal]
- `none`, additive`, `subtractive`,`multiply` or `normal`.
@returns {number} | [
"Return",
"a",
"three",
".",
"js",
"constant",
"determining",
"blending"
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/material.js#L241-L259 | train | Parse a single blending | [
30522,
3853,
11968,
3366,
3468,
15683,
1006,
23293,
1007,
1063,
6942,
1006,
23293,
1007,
1063,
2553,
1005,
3904,
1005,
1024,
1063,
2709,
2093,
1012,
7015,
15683,
1025,
1065,
2553,
1005,
29167,
1005,
1024,
1063,
2709,
2093,
1012,
29167,
3468... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/chart.js/Chart.js | function(data){
//Declare segments as a static property to prevent inheriting across the Chart type prototype
this.segments = [];
this.outerRadius = (helpers.min([this.chart.width,this.chart.height]) - this.options.segmentStrokeWidth/2)/2;
this.SegmentArc = Chart.Arc.extend({
ctx : this.chart.ctx,
... | javascript | function(data){
//Declare segments as a static property to prevent inheriting across the Chart type prototype
this.segments = [];
this.outerRadius = (helpers.min([this.chart.width,this.chart.height]) - this.options.segmentStrokeWidth/2)/2;
this.SegmentArc = Chart.Arc.extend({
ctx : this.chart.ctx,
... | [
"function",
"(",
"data",
")",
"{",
"//Declare segments as a static property to prevent inheriting across the Chart type prototype",
"this",
".",
"segments",
"=",
"[",
"]",
";",
"this",
".",
"outerRadius",
"=",
"(",
"helpers",
".",
"min",
"(",
"[",
"this",
".",
"char... | Initialize is fired when the chart is initialized - Data is passed in as a parameter Config is automatically merged by the core of Chart.js, and is available at this.options | [
"Initialize",
"is",
"fired",
"when",
"the",
"chart",
"is",
"initialized",
"-",
"Data",
"is",
"passed",
"in",
"as",
"a",
"parameter",
"Config",
"is",
"automatically",
"merged",
"by",
"the",
"core",
"of",
"Chart",
".",
"js",
"and",
"is",
"available",
"at",
... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/chart.js/Chart.js#L2372-L2405 | train | Initialize the chart with the given data | [
30522,
3853,
1006,
2951,
1007,
1063,
1013,
1013,
13520,
9214,
2004,
1037,
10763,
3200,
2000,
4652,
22490,
2075,
2408,
1996,
3673,
2828,
8773,
2023,
1012,
9214,
1027,
1031,
1033,
1025,
2023,
1012,
6058,
12173,
4173,
1027,
1006,
2393,
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... | |
vuejs/vue-devtools | src/backend/index.js | processComputed | function processComputed (instance) {
const computed = []
const defs = instance.$options.computed || {}
// use for...in here because if 'computed' is not defined
// on component, computed properties will be placed in prototype
// and Object.keys does not include
// properties from object's prototype
for (... | javascript | function processComputed (instance) {
const computed = []
const defs = instance.$options.computed || {}
// use for...in here because if 'computed' is not defined
// on component, computed properties will be placed in prototype
// and Object.keys does not include
// properties from object's prototype
for (... | [
"function",
"processComputed",
"(",
"instance",
")",
"{",
"const",
"computed",
"=",
"[",
"]",
"const",
"defs",
"=",
"instance",
".",
"$options",
".",
"computed",
"||",
"{",
"}",
"// use for...in here because if 'computed' is not defined",
"// on component, computed prop... | Process the computed properties of an instance.
@param {Vue} instance
@return {Array} | [
"Process",
"the",
"computed",
"properties",
"of",
"an",
"instance",
"."
] | 4de4b86388453cd07f0c1bf967d43a4dd4b011c9 | https://github.com/vuejs/vue-devtools/blob/4de4b86388453cd07f0c1bf967d43a4dd4b011c9/src/backend/index.js#L719-L752 | train | Process computed properties from component | [
30522,
3853,
2832,
9006,
29462,
1006,
6013,
1007,
1063,
9530,
3367,
24806,
1027,
1031,
1033,
9530,
3367,
13366,
2015,
1027,
6013,
1012,
1002,
7047,
1012,
24806,
1064,
1064,
1063,
1065,
1013,
1013,
2224,
2005,
1012,
1012,
1012,
1999,
2182,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/search.js | searchBar_search | function searchBar_search(data)
{
var searchBar = this.getElement({type: "searchBar"});
this.type(data.text);
switch (data.action) {
case "returnKey":
this._controller.keypress(searchBar, 'VK_RETURN', {});
break;
case "goButton":
default:
this._controller.click(t... | javascript | function searchBar_search(data)
{
var searchBar = this.getElement({type: "searchBar"});
this.type(data.text);
switch (data.action) {
case "returnKey":
this._controller.keypress(searchBar, 'VK_RETURN', {});
break;
case "goButton":
default:
this._controller.click(t... | [
"function",
"searchBar_search",
"(",
"data",
")",
"{",
"var",
"searchBar",
"=",
"this",
".",
"getElement",
"(",
"{",
"type",
":",
"\"searchBar\"",
"}",
")",
";",
"this",
".",
"type",
"(",
"data",
".",
"text",
")",
";",
"switch",
"(",
"data",
".",
"ac... | Start a search with the given search term and check if the resulting URL
contains the search term.
@param {object} data
Object which contains the search term and the action type | [
"Start",
"a",
"search",
"with",
"the",
"given",
"search",
"term",
"and",
"check",
"if",
"the",
"resulting",
"URL",
"contains",
"the",
"search",
"term",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/search.js#L783-L800 | train | search bar search | [
30522,
3853,
3945,
8237,
1035,
3945,
1006,
2951,
1007,
1063,
13075,
3945,
8237,
1027,
2023,
1012,
2131,
12260,
3672,
1006,
1063,
2828,
1024,
1000,
3945,
8237,
1000,
1065,
1007,
1025,
2023,
1012,
2828,
1006,
2951,
1012,
3793,
1007,
1025,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sass/node-sass | lib/extensions.js | getBinaryCachePath | function getBinaryCachePath() {
var i,
cachePath,
cachePathCandidates = getCachePathCandidates();
for (i = 0; i < cachePathCandidates.length; i++) {
cachePath = path.join(cachePathCandidates[i], pkg.name, pkg.version);
try {
mkdir.sync(cachePath);
return cachePath;
} catch (e) {
... | javascript | function getBinaryCachePath() {
var i,
cachePath,
cachePathCandidates = getCachePathCandidates();
for (i = 0; i < cachePathCandidates.length; i++) {
cachePath = path.join(cachePathCandidates[i], pkg.name, pkg.version);
try {
mkdir.sync(cachePath);
return cachePath;
} catch (e) {
... | [
"function",
"getBinaryCachePath",
"(",
")",
"{",
"var",
"i",
",",
"cachePath",
",",
"cachePathCandidates",
"=",
"getCachePathCandidates",
"(",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"cachePathCandidates",
".",
"length",
";",
"i",
"++",
")",
... | The most suitable location for caching the binding on disk.
Given the candidates directories provided by `getCachePathCandidates()` this
returns the first writable directory. By treating the candidate directories
as a prioritised list this method is deterministic, assuming no change to the
local environment.
@return ... | [
"The",
"most",
"suitable",
"location",
"for",
"caching",
"the",
"binding",
"on",
"disk",
"."
] | 0c1a49eefa37544d16041c5fe5b2e3d9168004b7 | https://github.com/sass/node-sass/blob/0c1a49eefa37544d16041c5fe5b2e3d9168004b7/lib/extensions.js#L346-L363 | train | Get the binary cache path | [
30522,
3853,
2131,
21114,
2854,
3540,
5403,
15069,
1006,
1007,
1063,
13075,
1045,
1010,
17053,
15069,
1010,
17053,
15069,
9336,
4305,
27122,
1027,
2131,
3540,
5403,
15069,
9336,
4305,
27122,
1006,
1007,
1025,
2005,
1006,
1045,
1027,
1014,
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... |
pixijs/pixi.js | packages/text/src/TextStyle.js | areArraysEqual | function areArraysEqual(array1, array2)
{
if (!Array.isArray(array1) || !Array.isArray(array2))
{
return false;
}
if (array1.length !== array2.length)
{
return false;
}
for (let i = 0; i < array1.length; ++i)
{
if (array1[i] !== array2[i])
{
... | javascript | function areArraysEqual(array1, array2)
{
if (!Array.isArray(array1) || !Array.isArray(array2))
{
return false;
}
if (array1.length !== array2.length)
{
return false;
}
for (let i = 0; i < array1.length; ++i)
{
if (array1[i] !== array2[i])
{
... | [
"function",
"areArraysEqual",
"(",
"array1",
",",
"array2",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"array1",
")",
"||",
"!",
"Array",
".",
"isArray",
"(",
"array2",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"array1",
"... | Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.
This version can also convert array of colors
@private
@param {Array} array1 First array to compare
@param {Array} array2 Second array to compare
@return {boolean} Do the arrays contain the same values in the same o... | [
"Utility",
"function",
"to",
"convert",
"hexadecimal",
"colors",
"to",
"strings",
"and",
"simply",
"return",
"the",
"color",
"if",
"it",
"s",
"a",
"string",
".",
"This",
"version",
"can",
"also",
"convert",
"array",
"of",
"colors"
] | 99ae03b7565ae7ca5a6de633b0a277f7128fa4d0 | https://github.com/pixijs/pixi.js/blob/99ae03b7565ae7ca5a6de633b0a277f7128fa4d0/packages/text/src/TextStyle.js#L776-L797 | train | Check if two arrays are equal | [
30522,
3853,
2181,
11335,
23274,
26426,
1006,
9140,
2487,
1010,
9140,
2475,
1007,
1063,
2065,
1006,
999,
9140,
1012,
18061,
11335,
2100,
1006,
9140,
2487,
1007,
1064,
1064,
999,
9140,
1012,
18061,
11335,
2100,
1006,
9140,
2475,
1007,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/gesture/gesture.js | register | function register(element, handlerName, options) {
var handler = HANDLERS[handlerName.replace(/^\$md./, '')];
if (!handler) {
throw new Error('Failed to register element with handler ' + handlerName + '. ' +
'Available handlers: ' + Object.keys(HANDLERS).join(', '));
}
return handler.registe... | javascript | function register(element, handlerName, options) {
var handler = HANDLERS[handlerName.replace(/^\$md./, '')];
if (!handler) {
throw new Error('Failed to register element with handler ' + handlerName + '. ' +
'Available handlers: ' + Object.keys(HANDLERS).join(', '));
}
return handler.registe... | [
"function",
"register",
"(",
"element",
",",
"handlerName",
",",
"options",
")",
"{",
"var",
"handler",
"=",
"HANDLERS",
"[",
"handlerName",
".",
"replace",
"(",
"/",
"^\\$md.",
"/",
",",
"''",
")",
"]",
";",
"if",
"(",
"!",
"handler",
")",
"{",
"thr... | Register an element to listen for a handler.
This allows an element to override the default options for a handler.
Additionally, some handlers like drag and hold only dispatch events if
the domEvent happens inside an element that's registered to listen for these events.
@see GestureHandler for how overriding of defaul... | [
"Register",
"an",
"element",
"to",
"listen",
"for",
"a",
"handler",
".",
"This",
"allows",
"an",
"element",
"to",
"override",
"the",
"default",
"options",
"for",
"a",
"handler",
".",
"Additionally",
"some",
"handlers",
"like",
"drag",
"and",
"hold",
"only",
... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/gesture/gesture.js#L179-L186 | train | Register an element with a handler | [
30522,
3853,
4236,
1006,
5783,
1010,
28213,
18442,
1010,
7047,
1007,
1063,
13075,
28213,
1027,
28213,
2015,
1031,
28213,
18442,
1012,
5672,
1006,
1013,
1034,
1032,
1002,
9108,
1012,
1013,
1010,
1005,
1005,
1007,
1033,
1025,
2065,
1006,
999,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/autocomplete/js/autocompleteController.js | isSearchable | function isSearchable() {
if (ctrl.loading && !hasMatches()) {
// No query when query is in progress.
return false;
} else if (hasSelection()) {
// No query if there is already a selection
return false;
}
else if (!hasFocus) {
// No query if the input does not have focus
... | javascript | function isSearchable() {
if (ctrl.loading && !hasMatches()) {
// No query when query is in progress.
return false;
} else if (hasSelection()) {
// No query if there is already a selection
return false;
}
else if (!hasFocus) {
// No query if the input does not have focus
... | [
"function",
"isSearchable",
"(",
")",
"{",
"if",
"(",
"ctrl",
".",
"loading",
"&&",
"!",
"hasMatches",
"(",
")",
")",
"{",
"// No query when query is in progress.",
"return",
"false",
";",
"}",
"else",
"if",
"(",
"hasSelection",
"(",
")",
")",
"{",
"// No ... | Determines whether the autocomplete is able to query within the current state.
@returns {boolean} true if the query can be run | [
"Determines",
"whether",
"the",
"autocomplete",
"is",
"able",
"to",
"query",
"within",
"the",
"current",
"state",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/autocomplete/js/autocompleteController.js#L713-L726 | train | Check if the search is able to be performed | [
30522,
3853,
26354,
14644,
7507,
3468,
1006,
1007,
1063,
2065,
1006,
14931,
12190,
1012,
10578,
1004,
1004,
999,
2038,
18900,
8376,
1006,
1007,
1007,
1063,
1013,
1013,
2053,
23032,
2043,
23032,
2003,
1999,
5082,
1012,
2709,
6270,
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... |
laurent22/joplin | Clipper/joplin-webclipper/content_scripts/Readability.js | function(helperIsVisible) {
var nodes = this._getAllNodesWithTag(this._doc, ["p", "pre"]);
// Get <div> nodes which have <br> node(s) and append them into the `nodes` variable.
// Some articles' DOM structures might look like
// <div>
// Sentences<br>
// <br>
// Sentences<br>
// <... | javascript | function(helperIsVisible) {
var nodes = this._getAllNodesWithTag(this._doc, ["p", "pre"]);
// Get <div> nodes which have <br> node(s) and append them into the `nodes` variable.
// Some articles' DOM structures might look like
// <div>
// Sentences<br>
// <br>
// Sentences<br>
// <... | [
"function",
"(",
"helperIsVisible",
")",
"{",
"var",
"nodes",
"=",
"this",
".",
"_getAllNodesWithTag",
"(",
"this",
".",
"_doc",
",",
"[",
"\"p\"",
",",
"\"pre\"",
"]",
")",
";",
"// Get <div> nodes which have <br> node(s) and append them into the `nodes` variable.",
... | Decides whether or not the document is reader-able without parsing the whole thing.
@return boolean Whether or not we suspect parse() will suceeed at returning an article object. | [
"Decides",
"whether",
"or",
"not",
"the",
"document",
"is",
"reader",
"-",
"able",
"without",
"parsing",
"the",
"whole",
"thing",
"."
] | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/Clipper/joplin-webclipper/content_scripts/Readability.js#L1702-L1754 | train | Returns true if the article is visible | [
30522,
3853,
1006,
2393,
11124,
2015,
11365,
7028,
1007,
1063,
13075,
14164,
1027,
2023,
1012,
1035,
2131,
8095,
3630,
6155,
24415,
15900,
1006,
2023,
1012,
1035,
9986,
1010,
1031,
1000,
1052,
1000,
1010,
1000,
3653,
1000,
1033,
1007,
1025,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
mochajs/mocha | lib/growl.js | onCompletion | function onCompletion(err) {
if (err) {
// As notifications are tangential to our purpose, just log the error.
const message =
err.code === 'ENOENT' ? 'prerequisite software not found' : err.message;
console.error('notification error:', message);
}
} | javascript | function onCompletion(err) {
if (err) {
// As notifications are tangential to our purpose, just log the error.
const message =
err.code === 'ENOENT' ? 'prerequisite software not found' : err.message;
console.error('notification error:', message);
}
} | [
"function",
"onCompletion",
"(",
"err",
")",
"{",
"if",
"(",
"err",
")",
"{",
"// As notifications are tangential to our purpose, just log the error.",
"const",
"message",
"=",
"err",
".",
"code",
"===",
"'ENOENT'",
"?",
"'prerequisite software not found'",
":",
"err",
... | @summary
Callback for result of attempted Growl notification.
@description
Despite its appearance, this is <strong>not</strong> an Error-first
callback -- all parameters are populated regardless of success.
@private
@callback Growl~growlCB
@param {*} err - Error object, or <code>null</code> if successful. | [
"@summary",
"Callback",
"for",
"result",
"of",
"attempted",
"Growl",
"notification",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/growl.js#L98-L105 | train | Called when the process has completed | [
30522,
3853,
2006,
9006,
10814,
3508,
1006,
9413,
2099,
1007,
1063,
2065,
1006,
9413,
2099,
1007,
1063,
1013,
1013,
2004,
26828,
2015,
2024,
27250,
4818,
2000,
2256,
3800,
1010,
2074,
8833,
1996,
7561,
1012,
9530,
3367,
4471,
1027,
9413,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | extend | function extend(oTarget, oSource) {
var sName;
for (sName in oSource) {
if (bPrivileged || !(sName in oTarget)) {
oTarget[sName] = oSource[sName];
}
}
} | javascript | function extend(oTarget, oSource) {
var sName;
for (sName in oSource) {
if (bPrivileged || !(sName in oTarget)) {
oTarget[sName] = oSource[sName];
}
}
} | [
"function",
"extend",
"(",
"oTarget",
",",
"oSource",
")",
"{",
"var",
"sName",
";",
"for",
"(",
"sName",
"in",
"oSource",
")",
"{",
"if",
"(",
"bPrivileged",
"||",
"!",
"(",
"sName",
"in",
"oTarget",
")",
")",
"{",
"oTarget",
"[",
"sName",
"]",
"=... | /*
"PUT" semantics on term/qualifier level, only privileged sources may overwrite.
@param {object} oTarget
The target object (which is modified)
@param {object} oSource
The source object | [
"/",
"*",
"PUT",
"semantics",
"on",
"term",
"/",
"qualifier",
"level",
"only",
"privileged",
"sources",
"may",
"overwrite",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L286-L294 | train | Extend the target object with the source object. | [
30522,
3853,
7949,
1006,
27178,
2906,
18150,
1010,
9808,
8162,
3401,
1007,
1063,
13075,
1055,
18442,
1025,
2005,
1006,
1055,
18442,
1999,
9808,
8162,
3401,
1007,
1063,
2065,
1006,
17531,
3089,
14762,
24746,
2094,
1064,
1064,
999,
1006,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js | parseTagAndAttrs | function parseTagAndAttrs(parts, pos) {
var m = /^(\w+)/.exec(parts[pos]);
var tag = { name: lcase(m[1]) };
if (html4.ELEMENTS.hasOwnProperty(tag.name)) {
tag.eflags = html4.ELEMENTS[tag.name];
} else {
tag.eflags = void 0;
}
var buf = parts[pos].substr(m[0].length);
// Find the ... | javascript | function parseTagAndAttrs(parts, pos) {
var m = /^(\w+)/.exec(parts[pos]);
var tag = { name: lcase(m[1]) };
if (html4.ELEMENTS.hasOwnProperty(tag.name)) {
tag.eflags = html4.ELEMENTS[tag.name];
} else {
tag.eflags = void 0;
}
var buf = parts[pos].substr(m[0].length);
// Find the ... | [
"function",
"parseTagAndAttrs",
"(",
"parts",
",",
"pos",
")",
"{",
"var",
"m",
"=",
"/",
"^(\\w+)",
"/",
".",
"exec",
"(",
"parts",
"[",
"pos",
"]",
")",
";",
"var",
"tag",
"=",
"{",
"name",
":",
"lcase",
"(",
"m",
"[",
"1",
"]",
")",
"}",
"... | at this point, parts[pos-1] is either "<" or "<\/". | [
"at",
"this",
"point",
"parts",
"[",
"pos",
"-",
"1",
"]",
"is",
"either",
"<",
"or",
"<",
"\\",
"/",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js#L3236-L3292 | train | Parses a tag and its attributes. | [
30522,
3853,
11968,
13462,
16098,
8943,
4779,
2869,
1006,
3033,
1010,
13433,
2015,
1007,
1063,
13075,
1049,
1027,
1013,
1034,
1006,
1032,
1059,
1009,
1007,
1013,
1012,
4654,
8586,
1006,
3033,
1031,
13433,
2015,
1033,
1007,
1025,
13075,
6415... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/tabs/tabsPaginationService.js | decreasePageOffset | function decreasePageOffset(elements, currentOffset) {
var canvas = elements.canvas,
tabOffsets = getTabOffsets(elements),
i, firstVisibleTabOffset;
// Find the first fully visible tab in offset range
for (i = 0; i < tabOffsets.length; i++) {
if (tabOffsets[i] >= currentOffset... | javascript | function decreasePageOffset(elements, currentOffset) {
var canvas = elements.canvas,
tabOffsets = getTabOffsets(elements),
i, firstVisibleTabOffset;
// Find the first fully visible tab in offset range
for (i = 0; i < tabOffsets.length; i++) {
if (tabOffsets[i] >= currentOffset... | [
"function",
"decreasePageOffset",
"(",
"elements",
",",
"currentOffset",
")",
"{",
"var",
"canvas",
"=",
"elements",
".",
"canvas",
",",
"tabOffsets",
"=",
"getTabOffsets",
"(",
"elements",
")",
",",
"i",
",",
"firstVisibleTabOffset",
";",
"// Find the first fully... | Returns the offset for the next decreasing page.
@param elements
@param currentOffset
@returns {number} | [
"Returns",
"the",
"offset",
"for",
"the",
"next",
"decreasing",
"page",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/tabsPaginationService.js#L38-L53 | train | Increase the page offset of the tabs container | [
30522,
3853,
9885,
13704,
27475,
3388,
1006,
3787,
1010,
2783,
27475,
3388,
1007,
1063,
13075,
10683,
1027,
3787,
1012,
10683,
1010,
21628,
27475,
8454,
1027,
2131,
2696,
5092,
21807,
8454,
1006,
3787,
1007,
1010,
1045,
1010,
2034,
11365,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/checks/navigation/region.js | isRegion | function isRegion(virtualNode) {
const node = virtualNode.actualNode;
const explicitRole = axe.commons.aria.getRole(node, { noImplicit: true });
const ariaLive = (node.getAttribute('aria-live') || '').toLowerCase().trim();
if (explicitRole) {
return explicitRole === 'dialog' || landmarkRoles.includes(explicitRol... | javascript | function isRegion(virtualNode) {
const node = virtualNode.actualNode;
const explicitRole = axe.commons.aria.getRole(node, { noImplicit: true });
const ariaLive = (node.getAttribute('aria-live') || '').toLowerCase().trim();
if (explicitRole) {
return explicitRole === 'dialog' || landmarkRoles.includes(explicitRol... | [
"function",
"isRegion",
"(",
"virtualNode",
")",
"{",
"const",
"node",
"=",
"virtualNode",
".",
"actualNode",
";",
"const",
"explicitRole",
"=",
"axe",
".",
"commons",
".",
"aria",
".",
"getRole",
"(",
"node",
",",
"{",
"noImplicit",
":",
"true",
"}",
")... | Check if the current element is a landmark | [
"Check",
"if",
"the",
"current",
"element",
"is",
"a",
"landmark"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/checks/navigation/region.js#L10-L36 | train | Determines if the node is a region | [
30522,
3853,
2003,
23784,
1006,
7484,
3630,
3207,
1007,
1063,
9530,
3367,
13045,
1027,
7484,
3630,
3207,
1012,
5025,
3630,
3207,
1025,
9530,
3367,
13216,
13153,
2063,
1027,
12946,
1012,
7674,
1012,
9342,
1012,
2131,
13153,
2063,
1006,
13045... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
MoePlayer/DPlayer | demo/modernizr.js | createElement | function createElement() {
if (typeof document.createElement !== 'function') {
// This is the case in IE7, where the type of createElement is "object".
// For this reason, we cannot call apply() as Object is not a Function.
return document.createElement(arguments[0]);
} else if (isSVG) {
... | javascript | function createElement() {
if (typeof document.createElement !== 'function') {
// This is the case in IE7, where the type of createElement is "object".
// For this reason, we cannot call apply() as Object is not a Function.
return document.createElement(arguments[0]);
} else if (isSVG) {
... | [
"function",
"createElement",
"(",
")",
"{",
"if",
"(",
"typeof",
"document",
".",
"createElement",
"!==",
"'function'",
")",
"{",
"// This is the case in IE7, where the type of createElement is \"object\".",
"// For this reason, we cannot call apply() as Object is not a Function.",
... | createElement is a convenience wrapper around document.createElement. Since we
use createElement all over the place, this allows for (slightly) smaller code
as well as abstracting away issues with creating elements in contexts other than
HTML documents (e.g. SVG documents).
@access private
@function createElement
@ret... | [
"createElement",
"is",
"a",
"convenience",
"wrapper",
"around",
"document",
".",
"createElement",
".",
"Since",
"we",
"use",
"createElement",
"all",
"over",
"the",
"place",
"this",
"allows",
"for",
"(",
"slightly",
")",
"smaller",
"code",
"as",
"well",
"as",
... | f5c53f082634a6e5af56cfc72978ad7bad49b989 | https://github.com/MoePlayer/DPlayer/blob/f5c53f082634a6e5af56cfc72978ad7bad49b989/demo/modernizr.js#L382-L392 | train | Creates an element | [
30522,
3853,
3443,
12260,
3672,
1006,
1007,
1063,
2065,
1006,
2828,
11253,
6254,
1012,
3443,
12260,
3672,
999,
1027,
1027,
1005,
3853,
1005,
1007,
1063,
1013,
1013,
2023,
2003,
1996,
2553,
1999,
29464,
2581,
1010,
2073,
1996,
2828,
1997,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GeekyAnts/vue-native-core | packages/vue-server-renderer/build.js | cached | function cached (fn) {
var cache = Object.create(null);
return (function cachedFn (str) {
var hit = cache[str];
return hit || (cache[str] = fn(str))
})
} | javascript | function cached (fn) {
var cache = Object.create(null);
return (function cachedFn (str) {
var hit = cache[str];
return hit || (cache[str] = fn(str))
})
} | [
"function",
"cached",
"(",
"fn",
")",
"{",
"var",
"cache",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"return",
"(",
"function",
"cachedFn",
"(",
"str",
")",
"{",
"var",
"hit",
"=",
"cache",
"[",
"str",
"]",
";",
"return",
"hit",
"||",
... | Create a cached version of a pure function. | [
"Create",
"a",
"cached",
"version",
"of",
"a",
"pure",
"function",
"."
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-server-renderer/build.js#L104-L110 | train | Returns a function that caches the result of the given function. | [
30522,
3853,
17053,
2094,
1006,
1042,
2078,
1007,
1063,
13075,
17053,
1027,
4874,
1012,
3443,
1006,
19701,
1007,
1025,
2709,
1006,
3853,
17053,
20952,
2078,
1006,
2358,
2099,
1007,
1063,
13075,
2718,
1027,
17053,
1031,
2358,
2099,
1033,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
showdownjs/showdown | dist/showdown.js | writeAnchorTag | function writeAnchorTag (evt, options, globals, emptyCase) {
var wholeMatch = evt.getMatches().wholeMatch;
var text = evt.getMatches().text;
var id = evt.getMatches().id;
var url = evt.getMatches().url;
var title = evt.getMatches().title;
var target = '';
if (!title) {
title = '';
... | javascript | function writeAnchorTag (evt, options, globals, emptyCase) {
var wholeMatch = evt.getMatches().wholeMatch;
var text = evt.getMatches().text;
var id = evt.getMatches().id;
var url = evt.getMatches().url;
var title = evt.getMatches().title;
var target = '';
if (!title) {
title = '';
... | [
"function",
"writeAnchorTag",
"(",
"evt",
",",
"options",
",",
"globals",
",",
"emptyCase",
")",
"{",
"var",
"wholeMatch",
"=",
"evt",
".",
"getMatches",
"(",
")",
".",
"wholeMatch",
";",
"var",
"text",
"=",
"evt",
".",
"getMatches",
"(",
")",
".",
"te... | Helper Function: Normalize and write an anchor tag based on passed parameters
@param evt
@param options
@param globals
@param {boolean} emptyCase
@returns {string} | [
"Helper",
"Function",
":",
"Normalize",
"and",
"write",
"an",
"anchor",
"tag",
"based",
"on",
"passed",
"parameters"
] | 33bba54535d6fcdde5c82d2ec4d7a3bd951b5bb9 | https://github.com/showdownjs/showdown/blob/33bba54535d6fcdde5c82d2ec4d7a3bd951b5bb9/dist/showdown.js#L3320-L3387 | train | Write anchor tag | [
30522,
3853,
4339,
2319,
9905,
13320,
2290,
1006,
23408,
30524,
8376,
1006,
1007,
1012,
2878,
18900,
2818,
1025,
13075,
3793,
1027,
23408,
2102,
1012,
2131,
18900,
8376,
1006,
1007,
1012,
3793,
1025,
13075,
8909,
1027,
23408,
2102,
1012,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/key-spacing.js | initOptions | function initOptions(toOptions, fromOptions) {
if (typeof fromOptions.align === "object") {
// Initialize the alignment configuration
toOptions.align = initOptionProperty({}, fromOptions.align);
toOptions.align.on = fromOptions.align.on || "colon";
toOptions.align.mode = fromOptions... | javascript | function initOptions(toOptions, fromOptions) {
if (typeof fromOptions.align === "object") {
// Initialize the alignment configuration
toOptions.align = initOptionProperty({}, fromOptions.align);
toOptions.align.on = fromOptions.align.on || "colon";
toOptions.align.mode = fromOptions... | [
"function",
"initOptions",
"(",
"toOptions",
",",
"fromOptions",
")",
"{",
"if",
"(",
"typeof",
"fromOptions",
".",
"align",
"===",
"\"object\"",
")",
"{",
"// Initialize the alignment configuration",
"toOptions",
".",
"align",
"=",
"initOptionProperty",
"(",
"{",
... | Initializes all the option values (singleLine, multiLine and align) from the configuration with defaults for undefined values
@param {Object} toOptions Object to be initialized
@param {Object} fromOptions Object to be initialized from
@returns {Object} The object with correctly initialized options and values | [
"Initializes",
"all",
"the",
"option",
"values",
"(",
"singleLine",
"multiLine",
"and",
"align",
")",
"from",
"the",
"configuration",
"with",
"defaults",
"for",
"undefined",
"values"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/key-spacing.js#L91-L118 | train | Initialize the options object | [
30522,
3853,
1999,
9956,
16790,
2015,
1006,
2205,
16790,
2015,
1010,
2013,
7361,
9285,
1007,
1063,
2065,
1006,
2828,
11253,
2013,
7361,
9285,
1012,
25705,
1027,
1027,
1027,
1000,
4874,
1000,
1007,
1063,
1013,
1013,
3988,
4697,
1996,
12139,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/ion.rangeSlider/js/ion.rangeSlider.js | function () {
if (!this.coords.w_rs) {
return;
}
this.labels.p_min = this.labels.w_min / this.coords.w_rs * 100;
this.labels.p_max = this.labels.w_max / this.coords.w_rs * 100;
} | javascript | function () {
if (!this.coords.w_rs) {
return;
}
this.labels.p_min = this.labels.w_min / this.coords.w_rs * 100;
this.labels.p_max = this.labels.w_max / this.coords.w_rs * 100;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"coords",
".",
"w_rs",
")",
"{",
"return",
";",
"}",
"this",
".",
"labels",
".",
"p_min",
"=",
"this",
".",
"labels",
".",
"w_min",
"/",
"this",
".",
"coords",
".",
"w_rs",
"*",
"100",
";"... | Measure Min and Max labels width in percent | [
"Measure",
"Min",
"and",
"Max",
"labels",
"width",
"in",
"percent"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/ion.rangeSlider/js/ion.rangeSlider.js#L1274-L1281 | train | cisco cisco cisco | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
999,
2023,
1012,
2522,
8551,
2015,
1012,
1059,
1035,
12667,
1007,
1063,
2709,
1025,
1065,
2023,
1012,
10873,
1012,
1052,
1035,
8117,
1027,
2023,
1012,
10873,
1012,
1059,
1035,
8117,
1013,
2023,
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... | |
eslint/eslint | lib/config/config-file.js | load | function load(extendedConfigReference, configContext, referencedFromPath) {
const resolvedPath = resolve(extendedConfigReference, referencedFromPath, configContext.getPluginRootPath());
const cachedConfig = configContext.configCache.getConfig(resolvedPath.configFullName);
if (cachedConfig) {
retur... | javascript | function load(extendedConfigReference, configContext, referencedFromPath) {
const resolvedPath = resolve(extendedConfigReference, referencedFromPath, configContext.getPluginRootPath());
const cachedConfig = configContext.configCache.getConfig(resolvedPath.configFullName);
if (cachedConfig) {
retur... | [
"function",
"load",
"(",
"extendedConfigReference",
",",
"configContext",
",",
"referencedFromPath",
")",
"{",
"const",
"resolvedPath",
"=",
"resolve",
"(",
"extendedConfigReference",
",",
"referencedFromPath",
",",
"configContext",
".",
"getPluginRootPath",
"(",
")",
... | Loads a config object from the config cache based on its filename, falling back to the disk if the file is not yet
cached.
@param {string} extendedConfigReference The config to extend, as it appears in a config file
@param {Config} configContext Context for the config instance
@param {string} referencedFromPath The pat... | [
"Loads",
"a",
"config",
"object",
"from",
"the",
"config",
"cache",
"based",
"on",
"its",
"filename",
"falling",
"back",
"to",
"the",
"disk",
"if",
"the",
"file",
"is",
"not",
"yet",
"cached",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-file.js#L545-L561 | train | Load the config from disk | [
30522,
3853,
7170,
1006,
3668,
8663,
8873,
17603,
25523,
1010,
9530,
8873,
18195,
28040,
18413,
1010,
14964,
19699,
25377,
8988,
1007,
1063,
9530,
3367,
10395,
15069,
1027,
10663,
1006,
3668,
8663,
8873,
17603,
25523,
1010,
14964,
19699,
2537... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.