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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/aws-sdk-js | lib/service.js | getSignerClass | function getSignerClass(request) {
var version;
// get operation authtype if present
var operation = null;
var authtype = '';
if (request) {
var operations = request.service.api.operations || {};
operation = operations[request.operation] || null;
authtype = operation ? operation.au... | javascript | function getSignerClass(request) {
var version;
// get operation authtype if present
var operation = null;
var authtype = '';
if (request) {
var operations = request.service.api.operations || {};
operation = operations[request.operation] || null;
authtype = operation ? operation.au... | [
"function",
"getSignerClass",
"(",
"request",
")",
"{",
"var",
"version",
";",
"// get operation authtype if present",
"var",
"operation",
"=",
"null",
";",
"var",
"authtype",
"=",
"''",
";",
"if",
"(",
"request",
")",
"{",
"var",
"operations",
"=",
"request",... | Gets the signer class for a given request
@api private | [
"Gets",
"the",
"signer",
"class",
"for",
"a",
"given",
"request"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L459-L477 | train | Get the signer class for the given request | [
30522,
3853,
4152,
23773,
2121,
26266,
1006,
5227,
1007,
1063,
13075,
2544,
1025,
1013,
1013,
2131,
3169,
8740,
2705,
13874,
2065,
2556,
13075,
3169,
1027,
19701,
1025,
13075,
8740,
2705,
13874,
1027,
1005,
1005,
1025,
2065,
1006,
5227,
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/LiveDevelopment/Agents/NetworkAgent.js | _onFrameNavigated | function _onFrameNavigated(event, res) {
// res = {frame}
// Clear log when navigating to a new page, but not if an iframe was loaded
if (!res.frame.parentId) {
_reset();
}
_logURL(res.frame.url);
} | javascript | function _onFrameNavigated(event, res) {
// res = {frame}
// Clear log when navigating to a new page, but not if an iframe was loaded
if (!res.frame.parentId) {
_reset();
}
_logURL(res.frame.url);
} | [
"function",
"_onFrameNavigated",
"(",
"event",
",",
"res",
")",
"{",
"// res = {frame}",
"// Clear log when navigating to a new page, but not if an iframe was loaded",
"if",
"(",
"!",
"res",
".",
"frame",
".",
"parentId",
")",
"{",
"_reset",
"(",
")",
";",
"}",
"_lo... | WebInspector Event: Page.frameNavigated | [
"WebInspector",
"Event",
":",
"Page",
".",
"frameNavigated"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/NetworkAgent.js#L68-L75 | train | Called when a frame is navigated | [
30522,
3853,
1035,
2006,
15643,
2532,
5737,
11644,
1006,
2724,
1010,
24501,
1007,
1063,
1013,
1013,
24501,
1027,
1063,
4853,
30524,
2019,
2065,
6444,
2063,
2001,
8209,
2065,
1006,
999,
24501,
1012,
4853,
1012,
6687,
3593,
1007,
1063,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/date/Persian.js | toGregorian | function toGregorian(oPersian) {
var iJulianDayNumber = j2d(oPersian.year, oPersian.month + 1, oPersian.day);
return d2g(iJulianDayNumber);
} | javascript | function toGregorian(oPersian) {
var iJulianDayNumber = j2d(oPersian.year, oPersian.month + 1, oPersian.day);
return d2g(iJulianDayNumber);
} | [
"function",
"toGregorian",
"(",
"oPersian",
")",
"{",
"var",
"iJulianDayNumber",
"=",
"j2d",
"(",
"oPersian",
".",
"year",
",",
"oPersian",
".",
"month",
"+",
"1",
",",
"oPersian",
".",
"day",
")",
";",
"return",
"d2g",
"(",
"iJulianDayNumber",
")",
";",... | Calculate gregorian date from Persian
@param {object} oPersian a JS object containing day, month and year in the Persian calendar
@private | [
"Calculate",
"gregorian",
"date",
"from",
"Persian"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/date/Persian.js#L61-L64 | train | Converts Persian to gregorian | [
30522,
3853,
2000,
17603,
20255,
2937,
1006,
6728,
2545,
2937,
1007,
1063,
13075,
1045,
9103,
15204,
10259,
19172,
5677,
1027,
1046,
2475,
2094,
1006,
6728,
2545,
2937,
1012,
2095,
1010,
6728,
2545,
2937,
1012,
3204,
1009,
1015,
1010,
6728,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/code-prettify | tasks/lib/lang-aliases.js | createSandbox | function createSandbox() {
// collect registered language extensions
var sandbox = {};
sandbox.extensions = [];
// mock prettify.js API
sandbox.window = {};
sandbox.window.PR = sandbox.PR = {
registerLangHandler: function (handler, exts) {
sandbox.extensions = sandbox.extensions.concat(exts);
... | javascript | function createSandbox() {
// collect registered language extensions
var sandbox = {};
sandbox.extensions = [];
// mock prettify.js API
sandbox.window = {};
sandbox.window.PR = sandbox.PR = {
registerLangHandler: function (handler, exts) {
sandbox.extensions = sandbox.extensions.concat(exts);
... | [
"function",
"createSandbox",
"(",
")",
"{",
"// collect registered language extensions",
"var",
"sandbox",
"=",
"{",
"}",
";",
"sandbox",
".",
"extensions",
"=",
"[",
"]",
";",
"// mock prettify.js API",
"sandbox",
".",
"window",
"=",
"{",
"}",
";",
"sandbox",
... | Returns a mock object PR of the prettify API. This is used to collect
registered language file extensions.
@return {Object} PR object with an additional `extensions` property. | [
"Returns",
"a",
"mock",
"object",
"PR",
"of",
"the",
"prettify",
"API",
".",
"This",
"is",
"used",
"to",
"collect",
"registered",
"language",
"file",
"extensions",
"."
] | e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc | https://github.com/google/code-prettify/blob/e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc/tasks/lib/lang-aliases.js#L19-L54 | train | Creates a sandbox object | [
30522,
3853,
9005,
5685,
8758,
1006,
1007,
1063,
1013,
1013,
8145,
5068,
2653,
14305,
13075,
5472,
8758,
1027,
1063,
1065,
1025,
5472,
8758,
1012,
14305,
1027,
1031,
1033,
1025,
1013,
1013,
12934,
3653,
6916,
12031,
1012,
1046,
2015,
17928,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-extra-parens.js | checkExpressionOrExportStatement | function checkExpressionOrExportStatement(node) {
const firstToken = isParenthesised(node) ? sourceCode.getTokenBefore(node) : sourceCode.getFirstToken(node);
const secondToken = sourceCode.getTokenAfter(firstToken, astUtils.isNotOpeningParenToken);
const thirdToken = secondToken ? s... | javascript | function checkExpressionOrExportStatement(node) {
const firstToken = isParenthesised(node) ? sourceCode.getTokenBefore(node) : sourceCode.getFirstToken(node);
const secondToken = sourceCode.getTokenAfter(firstToken, astUtils.isNotOpeningParenToken);
const thirdToken = secondToken ? s... | [
"function",
"checkExpressionOrExportStatement",
"(",
"node",
")",
"{",
"const",
"firstToken",
"=",
"isParenthesised",
"(",
"node",
")",
"?",
"sourceCode",
".",
"getTokenBefore",
"(",
"node",
")",
":",
"sourceCode",
".",
"getFirstToken",
"(",
"node",
")",
";",
... | Checks the parentheses for an ExpressionStatement or ExportDefaultDeclaration
@param {ASTNode} node The ExpressionStatement.expression or ExportDefaultDeclaration.declaration node
@returns {void} | [
"Checks",
"the",
"parentheses",
"for",
"an",
"ExpressionStatement",
"or",
"ExportDefaultDeclaration"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-extra-parens.js#L470-L499 | train | Check if the node is an expression or export statement | [
30522,
3853,
4638,
10288,
30524,
4783,
29278,
2063,
1006,
13045,
1007,
1024,
3120,
16044,
1012,
2131,
8873,
12096,
18715,
2368,
1006,
13045,
1007,
1025,
9530,
3367,
2117,
18715,
2368,
1027,
3120,
16044,
1012,
2131,
18715,
8189,
6199,
2121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/BlockLayerUtils.js | createTabbable | function createTabbable(fnRedirectFocus) {
var oBlockSpan = document.createElement("span");
oBlockSpan.setAttribute("tabindex", 0);
oBlockSpan.addEventListener('focusin', fnRedirectFocus);
return oBlockSpan;
} | javascript | function createTabbable(fnRedirectFocus) {
var oBlockSpan = document.createElement("span");
oBlockSpan.setAttribute("tabindex", 0);
oBlockSpan.addEventListener('focusin', fnRedirectFocus);
return oBlockSpan;
} | [
"function",
"createTabbable",
"(",
"fnRedirectFocus",
")",
"{",
"var",
"oBlockSpan",
"=",
"document",
".",
"createElement",
"(",
"\"span\"",
")",
";",
"oBlockSpan",
".",
"setAttribute",
"(",
"\"tabindex\"",
",",
"0",
")",
";",
"oBlockSpan",
".",
"addEventListene... | Create a tabbable span for the block section of the control with according focus handling.
@param {function} fnRedirectFocus Focus handling function
@returns {object} The span element's DOM node
@private | [
"Create",
"a",
"tabbable",
"span",
"for",
"the",
"block",
"section",
"of",
"the",
"control",
"with",
"according",
"focus",
"handling",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/BlockLayerUtils.js#L262-L269 | train | Creates a tabbable element. | [
30522,
3853,
3443,
2696,
22414,
3468,
1006,
1042,
16118,
2098,
7442,
6593,
14876,
7874,
1007,
1063,
13075,
27885,
7878,
13102,
2319,
1027,
6254,
1012,
3443,
12260,
3672,
1006,
1000,
8487,
1000,
1007,
1025,
27885,
7878,
13102,
2319,
1012,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/adapters/scheduling/SchedulingDefault.js | SchedulingDefault | function SchedulingDefault(options) {
SchedulingBase.call(this, options);
// NOTE: How often should the scheduler wake up?
this.runTimeoutInMs = 1000 * 60 * 5;
// NOTE: An offset between now and past, which helps us choosing jobs which need to be executed soon.
this.offsetInMinutes = 10;
this.... | javascript | function SchedulingDefault(options) {
SchedulingBase.call(this, options);
// NOTE: How often should the scheduler wake up?
this.runTimeoutInMs = 1000 * 60 * 5;
// NOTE: An offset between now and past, which helps us choosing jobs which need to be executed soon.
this.offsetInMinutes = 10;
this.... | [
"function",
"SchedulingDefault",
"(",
"options",
")",
"{",
"SchedulingBase",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"// NOTE: How often should the scheduler wake up?",
"this",
".",
"runTimeoutInMs",
"=",
"1000",
"*",
"60",
"*",
"5",
";",
"// NOTE: An ... | @description Default post scheduling implementation.
The default scheduler is used for all self-hosted blogs.
It is implemented with pure javascript (timers).
"node-cron" did not perform well enough and we really just needed a simple time management.
@param {Objec†} options
@constructor | [
"@description",
"Default",
"post",
"scheduling",
"implementation",
"."
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/adapters/scheduling/SchedulingDefault.js#L19-L38 | train | The scheduler implementation that does not run any scheduled jobs. | [
30522,
3853,
19940,
3207,
7011,
11314,
1006,
7047,
1007,
1063,
19940,
15058,
1012,
2655,
1006,
2023,
1010,
7047,
1007,
1025,
1013,
1013,
3602,
1024,
2129,
2411,
2323,
1996,
6134,
2099,
5256,
2039,
1029,
2023,
1012,
2448,
7292,
5833,
2378,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/_Batch.js | _deserializeBatchResponse | function _deserializeBatchResponse(sContentType, sResponseBody, bIsChangeSet) {
var aBatchParts = sResponseBody.split(getBoundaryRegExp(sContentType)),
aResponses = [];
// skip preamble and epilogue
aBatchParts = aBatchParts.slice(1, -1);
aBatchParts.forEach(function (sBatchPart) {
var sChangeSetContent... | javascript | function _deserializeBatchResponse(sContentType, sResponseBody, bIsChangeSet) {
var aBatchParts = sResponseBody.split(getBoundaryRegExp(sContentType)),
aResponses = [];
// skip preamble and epilogue
aBatchParts = aBatchParts.slice(1, -1);
aBatchParts.forEach(function (sBatchPart) {
var sChangeSetContent... | [
"function",
"_deserializeBatchResponse",
"(",
"sContentType",
",",
"sResponseBody",
",",
"bIsChangeSet",
")",
"{",
"var",
"aBatchParts",
"=",
"sResponseBody",
".",
"split",
"(",
"getBoundaryRegExp",
"(",
"sContentType",
")",
")",
",",
"aResponses",
"=",
"[",
"]",
... | /*
See JSDoc for oBatch.deserializeBatchResponse.
Additional parameter bIsChangeSet indicates whether sResponseBody represents a
change set. | [
"/",
"*",
"See",
"JSDoc",
"for",
"oBatch",
".",
"deserializeBatchResponse",
".",
"Additional",
"parameter",
"bIsChangeSet",
"indicates",
"whether",
"sResponseBody",
"represents",
"a",
"change",
"set",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Batch.js#L136-L209 | train | Deserialize a batch response | [
30522,
3853,
1035,
4078,
11610,
3669,
4371,
14479,
2818,
6072,
26029,
3366,
1006,
8040,
28040,
3372,
13874,
1010,
5034,
2229,
26029,
3366,
23684,
1010,
20377,
22305,
6810,
2102,
1007,
1063,
13075,
19557,
30524,
26950,
1012,
14704,
1006,
1015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/authentication.js | assertSetupCompleted | function assertSetupCompleted(status) {
return function checkPermission(__) {
return checkSetup().then((isSetup) => {
if (isSetup === status) {
return __;
}
const completed = common.i18n.t('errors.api.authentication.setupAlreadyCompleted'),
... | javascript | function assertSetupCompleted(status) {
return function checkPermission(__) {
return checkSetup().then((isSetup) => {
if (isSetup === status) {
return __;
}
const completed = common.i18n.t('errors.api.authentication.setupAlreadyCompleted'),
... | [
"function",
"assertSetupCompleted",
"(",
"status",
")",
"{",
"return",
"function",
"checkPermission",
"(",
"__",
")",
"{",
"return",
"checkSetup",
"(",
")",
".",
"then",
"(",
"(",
"isSetup",
")",
"=>",
"{",
"if",
"(",
"isSetup",
"===",
"status",
")",
"{"... | Allows an assertion to be made about setup status.
@param {Boolean} status True: setup must be complete. False: setup must not be complete.
@return {Function} returns a "task ready" function | [
"Allows",
"an",
"assertion",
"to",
"be",
"made",
"about",
"setup",
"status",
"."
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/authentication.js#L37-L58 | train | Assert setup is completed | [
30522,
3853,
19514,
3388,
6279,
9006,
10814,
3064,
1006,
3570,
1007,
1063,
2709,
3853,
4638,
4842,
25481,
1006,
1035,
1035,
1007,
1063,
2709,
14148,
3388,
6279,
1006,
1007,
1012,
2059,
1006,
1006,
26354,
3388,
6279,
1007,
1027,
1028,
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/view/ThemeView.js | updateThemes | function updateThemes(cm) {
var newTheme = prefs.get("theme"),
cmTheme = (cm.getOption("theme") || "").replace(/[\s]*/, ""); // Normalize themes string
// Check if the editor already has the theme applied...
if (cmTheme === newTheme) {
return;
}
// Setu... | javascript | function updateThemes(cm) {
var newTheme = prefs.get("theme"),
cmTheme = (cm.getOption("theme") || "").replace(/[\s]*/, ""); // Normalize themes string
// Check if the editor already has the theme applied...
if (cmTheme === newTheme) {
return;
}
// Setu... | [
"function",
"updateThemes",
"(",
"cm",
")",
"{",
"var",
"newTheme",
"=",
"prefs",
".",
"get",
"(",
"\"theme\"",
")",
",",
"cmTheme",
"=",
"(",
"cm",
".",
"getOption",
"(",
"\"theme\"",
")",
"||",
"\"\"",
")",
".",
"replace",
"(",
"/",
"[\\s]*",
"/",
... | Handles updating codemirror with the current selection of themes.
@param {CodeMirror} cm is the CodeMirror instance currently loaded | [
"Handles",
"updating",
"codemirror",
"with",
"the",
"current",
"selection",
"of",
"themes",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeView.js#L56-L68 | train | Update the theme of the codemirror editor | [
30522,
3853,
10651,
10760,
7834,
1006,
4642,
1007,
1063,
13075,
25597,
29122,
2063,
1027,
3653,
10343,
1012,
2131,
1006,
1000,
4323,
1000,
1007,
1010,
4642,
10760,
4168,
1027,
1006,
4642,
1012,
2131,
7361,
3508,
1006,
1000,
4323,
1000,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
thomaspark/bootswatch | docs/_vendor/popper.js/dist/popper.js | getOppositePlacement | function getOppositePlacement(placement) {
const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
return placement.replace(/left|right|bottom|top/g, matched => hash[matched]);
} | javascript | function getOppositePlacement(placement) {
const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
return placement.replace(/left|right|bottom|top/g, matched => hash[matched]);
} | [
"function",
"getOppositePlacement",
"(",
"placement",
")",
"{",
"const",
"hash",
"=",
"{",
"left",
":",
"'right'",
",",
"right",
":",
"'left'",
",",
"bottom",
":",
"'top'",
",",
"top",
":",
"'bottom'",
"}",
";",
"return",
"placement",
".",
"replace",
"("... | Get the opposite placement of the given one
@method
@memberof Popper.Utils
@argument {String} placement
@returns {String} flipped placement | [
"Get",
"the",
"opposite",
"placement",
"of",
"the",
"given",
"one"
] | a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd | https://github.com/thomaspark/bootswatch/blob/a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd/docs/_vendor/popper.js/dist/popper.js#L695-L698 | train | Get the opposite placement of a placement | [
30522,
3853,
2131,
7361,
6873,
28032,
13699,
19217,
3672,
1006,
11073,
1007,
1063,
9530,
3367,
23325,
1027,
1063,
2187,
1024,
1005,
2157,
1005,
1010,
2157,
1024,
1005,
2187,
1005,
1010,
3953,
1024,
1005,
2327,
1005,
1010,
2327,
1024,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tgriesser/knex | src/query/compiler.js | QueryCompiler | function QueryCompiler(client, builder) {
this.client = client;
this.method = builder._method || 'select';
this.options = builder._options;
this.single = builder._single;
this.timeout = builder._timeout || false;
this.cancelOnTimeout = builder._cancelOnTimeout || false;
this.grouped = groupBy(builder._sta... | javascript | function QueryCompiler(client, builder) {
this.client = client;
this.method = builder._method || 'select';
this.options = builder._options;
this.single = builder._single;
this.timeout = builder._timeout || false;
this.cancelOnTimeout = builder._cancelOnTimeout || false;
this.grouped = groupBy(builder._sta... | [
"function",
"QueryCompiler",
"(",
"client",
",",
"builder",
")",
"{",
"this",
".",
"client",
"=",
"client",
";",
"this",
".",
"method",
"=",
"builder",
".",
"_method",
"||",
"'select'",
";",
"this",
".",
"options",
"=",
"builder",
".",
"_options",
";",
... | The "QueryCompiler" takes all of the query statements which have been gathered in the "QueryBuilder" and turns them into a properly formatted / bound query string. | [
"The",
"QueryCompiler",
"takes",
"all",
"of",
"the",
"query",
"statements",
"which",
"have",
"been",
"gathered",
"in",
"the",
"QueryBuilder",
"and",
"turns",
"them",
"into",
"a",
"properly",
"formatted",
"/",
"bound",
"query",
"string",
"."
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/query/compiler.js#L29-L38 | train | A query compiler. | [
30522,
3853,
23032,
9006,
22090,
2099,
1006,
7396,
1010,
12508,
1007,
1063,
2023,
1012,
7396,
1027,
7396,
1025,
2023,
1012,
4118,
1027,
12508,
1012,
1035,
4118,
1064,
1064,
1005,
7276,
1005,
1025,
2023,
1012,
7047,
1027,
12508,
1012,
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... |
SAP/openui5 | src/sap.m/src/sap/m/TimePickerSlider.js | findIndexInArray | function findIndexInArray(aArray, fnPredicate) {
if (aArray == null) {
throw new TypeError('findIndex called with null or undefined array');
}
if (typeof fnPredicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var iLength = aArray.length;
var fnThisArg = arguments... | javascript | function findIndexInArray(aArray, fnPredicate) {
if (aArray == null) {
throw new TypeError('findIndex called with null or undefined array');
}
if (typeof fnPredicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var iLength = aArray.length;
var fnThisArg = arguments... | [
"function",
"findIndexInArray",
"(",
"aArray",
",",
"fnPredicate",
")",
"{",
"if",
"(",
"aArray",
"==",
"null",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"'findIndex called with null or undefined array'",
")",
";",
"}",
"if",
"(",
"typeof",
"fnPredicate",
"!==... | Finds the index of an element, satisfying provided predicate.
@param {array} aArray The array to be predicted
@param {function} fnPredicate Testing function
@returns {number} The index in the array, if an element in the array satisfies the provided testing function
@private | [
"Finds",
"the",
"index",
"of",
"an",
"element",
"satisfying",
"provided",
"predicate",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/TimePickerSlider.js#L1210-L1229 | train | Finds the index of the first element of an array that satisfies a predicate | [
30522,
3853,
2424,
22254,
10288,
3981,
11335,
2100,
1006,
9779,
11335,
2100,
1010,
1042,
16275,
5596,
24695,
1007,
1063,
2065,
1006,
9779,
11335,
2100,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
2828,
2121,
29165,
1006,
1005,
2424,
22254,
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... |
fengyuanchen/cropper | dist/cropper.common.js | setStyle | function setStyle(element, styles) {
var style = element.style;
forEach(styles, function (value, property) {
if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
value += 'px';
}
style[property] = value;
});
} | javascript | function setStyle(element, styles) {
var style = element.style;
forEach(styles, function (value, property) {
if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
value += 'px';
}
style[property] = value;
});
} | [
"function",
"setStyle",
"(",
"element",
",",
"styles",
")",
"{",
"var",
"style",
"=",
"element",
".",
"style",
";",
"forEach",
"(",
"styles",
",",
"function",
"(",
"value",
",",
"property",
")",
"{",
"if",
"(",
"REGEXP_SUFFIX",
".",
"test",
"(",
"prope... | Apply styles to the given element.
@param {Element} element - The target element.
@param {Object} styles - The styles for applying. | [
"Apply",
"styles",
"to",
"the",
"given",
"element",
"."
] | 6677332a6a375b647f58808dfc24ea09f5804041 | https://github.com/fengyuanchen/cropper/blob/6677332a6a375b647f58808dfc24ea09f5804041/dist/cropper.common.js#L351-L362 | train | Set style properties of an element | [
30522,
3853,
4520,
27983,
1006,
5783,
1010,
6782,
1007,
1063,
13075,
2806,
1027,
5783,
1012,
2806,
1025,
18921,
6776,
1006,
6782,
1010,
3853,
1006,
3643,
1010,
3200,
1007,
1063,
2065,
1006,
19723,
10288,
2361,
1035,
16809,
1012,
3231,
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... |
TryGhost/Ghost | core/server/lib/promise/sequence.js | sequence | function sequence(tasks /* Any Arguments */) {
const args = Array.prototype.slice.call(arguments, 1);
return Promise.reduce(tasks, function (results, task) {
const response = task.apply(this, args);
if (response && response.then) {
return response.then(function (result) {
... | javascript | function sequence(tasks /* Any Arguments */) {
const args = Array.prototype.slice.call(arguments, 1);
return Promise.reduce(tasks, function (results, task) {
const response = task.apply(this, args);
if (response && response.then) {
return response.then(function (result) {
... | [
"function",
"sequence",
"(",
"tasks",
"/* Any Arguments */",
")",
"{",
"const",
"args",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
";",
"return",
"Promise",
".",
"reduce",
"(",
"tasks",
",",
"function",
"(... | expects an array of functions returning a promise | [
"expects",
"an",
"array",
"of",
"functions",
"returning",
"a",
"promise"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/lib/promise/sequence.js#L6-L24 | train | A sequence of tasks | [
30522,
3853,
5537,
1006,
8518,
1013,
1008,
2151,
9918,
1008,
1013,
1007,
1063,
9530,
3367,
12098,
5620,
1027,
9140,
1012,
8773,
1012,
14704,
1012,
2655,
1006,
9918,
1010,
1015,
1007,
1025,
2709,
4872,
1012,
5547,
1006,
8518,
1010,
3853,
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/rules/no-eval.js | enterVarScope | function enterVarScope(node) {
const strict = context.getScope().isStrict;
funcInfo = {
upper: funcInfo,
node,
strict,
defaultThis: false,
initialized: strict
};
} | javascript | function enterVarScope(node) {
const strict = context.getScope().isStrict;
funcInfo = {
upper: funcInfo,
node,
strict,
defaultThis: false,
initialized: strict
};
} | [
"function",
"enterVarScope",
"(",
"node",
")",
"{",
"const",
"strict",
"=",
"context",
".",
"getScope",
"(",
")",
".",
"isStrict",
";",
"funcInfo",
"=",
"{",
"upper",
":",
"funcInfo",
",",
"node",
",",
"strict",
",",
"defaultThis",
":",
"false",
",",
"... | Pushs a variable scope (Program or Function) information to the stack.
This is used in order to check whether or not `this` binding is a
reference to the global object.
@param {ASTNode} node - A node of the scope. This is one of Program,
FunctionDeclaration, FunctionExpression, and ArrowFunctionExpression.
@returns {... | [
"Pushs",
"a",
"variable",
"scope",
"(",
"Program",
"or",
"Function",
")",
"information",
"to",
"the",
"stack",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-eval.js#L121-L131 | train | enter a variable scope | [
30522,
3853,
4607,
10755,
26127,
1006,
13045,
1007,
1063,
9530,
3367,
9384,
1027,
6123,
1012,
4152,
16186,
1006,
1007,
1012,
26354,
12412,
2102,
1025,
4569,
15459,
14876,
1027,
1063,
3356,
1024,
4569,
15459,
14876,
1010,
13045,
1010,
9384,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/support/apps/contentbrowser/utils/DataUtils.js | function (oData, sFileType) {
// code extension and properties files do not need formation
if ((sFileType === "js") || (sFileType === "properties")) {
return oData;
}
// other files should be formatted to JSON
try {
oData = JSON.parse(oData);
return JSON.stringify(oData, null, '\t');
... | javascript | function (oData, sFileType) {
// code extension and properties files do not need formation
if ((sFileType === "js") || (sFileType === "properties")) {
return oData;
}
// other files should be formatted to JSON
try {
oData = JSON.parse(oData);
return JSON.stringify(oData, null, '\t');
... | [
"function",
"(",
"oData",
",",
"sFileType",
")",
"{",
"// code extension and properties files do not need formation",
"if",
"(",
"(",
"sFileType",
"===",
"\"js\"",
")",
"||",
"(",
"sFileType",
"===",
"\"properties\"",
")",
")",
"{",
"return",
"oData",
";",
"}",
... | Pretty printer for specific file types.
@param {Object} oData - data to be formatted
@param {String} sFileType - file type of data
@returns {Object} oData - data after formatting
@public | [
"Pretty",
"printer",
"for",
"specific",
"file",
"types",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js#L38-L52 | train | format the data to JSON | [
30522,
3853,
1006,
1051,
2850,
2696,
1010,
16420,
9463,
13874,
1007,
1063,
1013,
1013,
3642,
5331,
1998,
5144,
6764,
2079,
2025,
2342,
4195,
2065,
1006,
1006,
16420,
9463,
13874,
1027,
1027,
1027,
1000,
1046,
2015,
1000,
1007,
1064,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/tabs.js | tabBrowser_getElement | function tabBrowser_getElement(spec) {
var document = this._controller.window.document;
var elem = null;
switch(spec.type) {
/**
* subtype: subtype to match
* value: value to match
*/
case "tabs":
elem = new elementslib.Lookup(this._controller.window.document,
... | javascript | function tabBrowser_getElement(spec) {
var document = this._controller.window.document;
var elem = null;
switch(spec.type) {
/**
* subtype: subtype to match
* value: value to match
*/
case "tabs":
elem = new elementslib.Lookup(this._controller.window.document,
... | [
"function",
"tabBrowser_getElement",
"(",
"spec",
")",
"{",
"var",
"document",
"=",
"this",
".",
"_controller",
".",
"window",
".",
"document",
";",
"var",
"elem",
"=",
"null",
";",
"switch",
"(",
"spec",
".",
"type",
")",
"{",
"/**\n * subtype: subtyp... | Retrieve an UI element based on the given spec
@param {object} spec
Information of the UI element which should be retrieved
type: General type information
subtype: Specific element or property
value: Value of the element or property
@returns Element which has been created
@type {ElemBase} | [
"Retrieve",
"an",
"UI",
"element",
"based",
"on",
"the",
"given",
"spec"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/tabs.js#L257-L325 | train | Returns the element that matches the spec | [
30522,
3853,
21628,
12618,
9333,
2121,
1035,
2131,
12260,
3672,
1006,
28699,
1007,
1063,
13075,
6254,
1027,
2023,
1012,
1035,
11486,
1012,
3332,
1012,
6254,
1025,
13075,
3449,
6633,
1027,
19701,
1025,
6942,
1006,
28699,
1012,
2828,
1007,
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... |
dequelabs/axe-core | lib/checks/label/label-content-name-mismatch.js | isStringContained | function isStringContained(compare, compareWith) {
const curatedCompareWith = curateString(compareWith);
const curatedCompare = curateString(compare);
if (!curatedCompareWith || !curatedCompare) {
return false;
}
return curatedCompareWith.includes(curatedCompare);
} | javascript | function isStringContained(compare, compareWith) {
const curatedCompareWith = curateString(compareWith);
const curatedCompare = curateString(compare);
if (!curatedCompareWith || !curatedCompare) {
return false;
}
return curatedCompareWith.includes(curatedCompare);
} | [
"function",
"isStringContained",
"(",
"compare",
",",
"compareWith",
")",
"{",
"const",
"curatedCompareWith",
"=",
"curateString",
"(",
"compareWith",
")",
";",
"const",
"curatedCompare",
"=",
"curateString",
"(",
"compare",
")",
";",
"if",
"(",
"!",
"curatedCom... | Check if a given text exists in another
@param {String} compare given text to check
@param {String} compareWith text against which to be compared
@returns {Boolean} | [
"Check",
"if",
"a",
"given",
"text",
"exists",
"in",
"another"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/checks/label/label-content-name-mismatch.js#L27-L34 | train | Checks if a string is contained in another string | [
30522,
3853,
26354,
18886,
3070,
8663,
28055,
1006,
12826,
1010,
12826,
24415,
1007,
1063,
9530,
3367,
17940,
9006,
19362,
7974,
8939,
1027,
27530,
3367,
4892,
1006,
12826,
24415,
1007,
1025,
9530,
3367,
17940,
9006,
19362,
2063,
1027,
27530,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
firebase/firebaseui-web | gulpfile.js | makeDefaultFile | function makeDefaultFile(fileName) {
const localeForFileName = getLocaleForFileName(DEFAULT_LOCALE);
const path = `${DEST_DIR}/${fileName}__${localeForFileName}.js`;
if (fse.existsSync(path)) {
return fse.copy(path, `${DEST_DIR}/${fileName}.js`);
}
} | javascript | function makeDefaultFile(fileName) {
const localeForFileName = getLocaleForFileName(DEFAULT_LOCALE);
const path = `${DEST_DIR}/${fileName}__${localeForFileName}.js`;
if (fse.existsSync(path)) {
return fse.copy(path, `${DEST_DIR}/${fileName}.js`);
}
} | [
"function",
"makeDefaultFile",
"(",
"fileName",
")",
"{",
"const",
"localeForFileName",
"=",
"getLocaleForFileName",
"(",
"DEFAULT_LOCALE",
")",
";",
"const",
"path",
"=",
"`",
"${",
"DEST_DIR",
"}",
"${",
"fileName",
"}",
"${",
"localeForFileName",
"}",
"`",
... | Creates the default FirebaseUI binaries for basic usage without
localization. For example, it copies firebaseui__en.js to firebaseui.js.
@param {string} fileName
@return {!Promise} A promise that resolves on completion. | [
"Creates",
"the",
"default",
"FirebaseUI",
"binaries",
"for",
"basic",
"usage",
"without",
"localization",
".",
"For",
"example",
"it",
"copies",
"firebaseui__en",
".",
"js",
"to",
"firebaseui",
".",
"js",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/gulpfile.js#L238-L244 | train | Creates a default file if it doesn t exist | [
30522,
3853,
2191,
3207,
7011,
11314,
8873,
2571,
1006,
5371,
18442,
1007,
1063,
9530,
3367,
2334,
12879,
16347,
9463,
18442,
1027,
2131,
4135,
9289,
12879,
16347,
9463,
18442,
1006,
12398,
1035,
2334,
2063,
1007,
1025,
9530,
3367,
4130,
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... |
aframevr/aframe | src/components/vive-controls.js | function (evt) {
var button = this.mapping.buttons[evt.detail.id];
var buttonMeshes = this.buttonMeshes;
var analogValue;
if (!button) { return; }
if (button === 'trigger') {
analogValue = evt.detail.state.value;
// Update trigger rotation depending on button value.
if (buttonMes... | javascript | function (evt) {
var button = this.mapping.buttons[evt.detail.id];
var buttonMeshes = this.buttonMeshes;
var analogValue;
if (!button) { return; }
if (button === 'trigger') {
analogValue = evt.detail.state.value;
// Update trigger rotation depending on button value.
if (buttonMes... | [
"function",
"(",
"evt",
")",
"{",
"var",
"button",
"=",
"this",
".",
"mapping",
".",
"buttons",
"[",
"evt",
".",
"detail",
".",
"id",
"]",
";",
"var",
"buttonMeshes",
"=",
"this",
".",
"buttonMeshes",
";",
"var",
"analogValue",
";",
"if",
"(",
"!",
... | Rotate the trigger button based on how hard the trigger is pressed. | [
"Rotate",
"the",
"trigger",
"button",
"based",
"on",
"how",
"hard",
"the",
"trigger",
"is",
"pressed",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/vive-controls.js#L146-L163 | train | Trigger button change event | [
30522,
3853,
1006,
23408,
2102,
1007,
1063,
13075,
6462,
1027,
2023,
1012,
12375,
1012,
11287,
1031,
23408,
2102,
1012,
6987,
1012,
8909,
1033,
1025,
13075,
6462,
7834,
15689,
1027,
2023,
1012,
6462,
7834,
15689,
1025,
13075,
11698,
10175,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
goldfire/howler.js | examples/player/player.js | function() {
var self = this;
var display = (volume.style.display === 'block') ? 'none' : 'block';
setTimeout(function() {
volume.style.display = display;
}, (display === 'block') ? 0 : 500);
volume.className = (display === 'block') ? 'fadein' : 'fadeout';
} | javascript | function() {
var self = this;
var display = (volume.style.display === 'block') ? 'none' : 'block';
setTimeout(function() {
volume.style.display = display;
}, (display === 'block') ? 0 : 500);
volume.className = (display === 'block') ? 'fadein' : 'fadeout';
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"display",
"=",
"(",
"volume",
".",
"style",
".",
"display",
"===",
"'block'",
")",
"?",
"'none'",
":",
"'block'",
";",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"volume",
".",
... | Toggle the volume display on/off. | [
"Toggle",
"the",
"volume",
"display",
"on",
"/",
"off",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/player/player.js#L249-L257 | train | Sets the display of the canton - sector volume | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
4653,
1027,
1006,
3872,
1012,
2806,
1012,
4653,
1027,
1027,
1027,
1005,
3796,
1005,
1007,
1029,
1005,
3904,
1005,
1024,
1005,
3796,
1005,
1025,
2275,
7292,
5833,
1006,
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... | |
eslint/eslint | lib/rules/comma-style.js | getFixerFunction | function getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) {
const text =
sourceCode.text.slice(previousItemToken.range[1], commaToken.range[0]) +
sourceCode.text.slice(commaToken.range[1], currentItemToken.range[0]);
const range = [prev... | javascript | function getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) {
const text =
sourceCode.text.slice(previousItemToken.range[1], commaToken.range[0]) +
sourceCode.text.slice(commaToken.range[1], currentItemToken.range[0]);
const range = [prev... | [
"function",
"getFixerFunction",
"(",
"styleType",
",",
"previousItemToken",
",",
"commaToken",
",",
"currentItemToken",
")",
"{",
"const",
"text",
"=",
"sourceCode",
".",
"text",
".",
"slice",
"(",
"previousItemToken",
".",
"range",
"[",
"1",
"]",
",",
"commaT... | Determines the fixer function for a given style.
@param {string} styleType comma style
@param {ASTNode} previousItemToken The token to check.
@param {ASTNode} commaToken The token to check.
@param {ASTNode} currentItemToken The token to check.
@returns {Function} Fixer function
@private | [
"Determines",
"the",
"fixer",
"function",
"for",
"a",
"given",
"style",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/comma-style.js#L110-L119 | train | Returns a function that replaces the given token with the given token. | [
30522,
3853,
2131,
8873,
2595,
2121,
11263,
27989,
1006,
2806,
13874,
1010,
3025,
4221,
20492,
11045,
2078,
1010,
4012,
18900,
11045,
2078,
1010,
2783,
4221,
20492,
11045,
2078,
1007,
1063,
9530,
3367,
3793,
1027,
3120,
16044,
1012,
3793,
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... |
electron/electron | lib/browser/chrome-extension.js | function (webContents) {
const tabId = webContents.id
sendToBackgroundPages('CHROME_TABS_ONCREATED')
webContents.on('will-navigate', (event, url) => {
sendToBackgroundPages('CHROME_WEBNAVIGATION_ONBEFORENAVIGATE', {
frameId: 0,
parentFrameId: -1,
processId: webContents.getProcessId(),
... | javascript | function (webContents) {
const tabId = webContents.id
sendToBackgroundPages('CHROME_TABS_ONCREATED')
webContents.on('will-navigate', (event, url) => {
sendToBackgroundPages('CHROME_WEBNAVIGATION_ONBEFORENAVIGATE', {
frameId: 0,
parentFrameId: -1,
processId: webContents.getProcessId(),
... | [
"function",
"(",
"webContents",
")",
"{",
"const",
"tabId",
"=",
"webContents",
".",
"id",
"sendToBackgroundPages",
"(",
"'CHROME_TABS_ONCREATED'",
")",
"webContents",
".",
"on",
"(",
"'will-navigate'",
",",
"(",
"event",
",",
"url",
")",
"=>",
"{",
"sendToBac... | Dispatch web contents events to Chrome APIs | [
"Dispatch",
"web",
"contents",
"events",
"to",
"Chrome",
"APIs"
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/chrome-extension.js#L123-L153 | train | This function is called by the main window when the window is created | [
30522,
3853,
1006,
4773,
8663,
6528,
3215,
1007,
1063,
9530,
3367,
21628,
3593,
1027,
4773,
8663,
6528,
3215,
1012,
8909,
4604,
3406,
5963,
16365,
13704,
2015,
1006,
1005,
18546,
1035,
21628,
2015,
1035,
2006,
16748,
4383,
1005,
1007,
4773,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
askmike/gekko | plugins/postgresql/util.js | function () {
return useSingleDatabase() ?
config.postgresql.database :
config.watch.exchange.toLowerCase().replace(/\-/g,'');
} | javascript | function () {
return useSingleDatabase() ?
config.postgresql.database :
config.watch.exchange.toLowerCase().replace(/\-/g,'');
} | [
"function",
"(",
")",
"{",
"return",
"useSingleDatabase",
"(",
")",
"?",
"config",
".",
"postgresql",
".",
"database",
":",
"config",
".",
"watch",
".",
"exchange",
".",
"toLowerCase",
"(",
")",
".",
"replace",
"(",
"/",
"\\-",
"/",
"g",
",",
"''",
"... | returns DB name (depends on single db setup) | [
"returns",
"DB",
"name",
"(",
"depends",
"on",
"single",
"db",
"setup",
")"
] | 0ce9ddd577fa8a22812c02331a494086758dfadf | https://github.com/askmike/gekko/blob/0ce9ddd577fa8a22812c02331a494086758dfadf/plugins/postgresql/util.js#L38-L42 | train | Returns the database name for the database | [
30522,
3853,
1006,
1007,
1063,
2709,
3594,
2075,
3709,
6790,
15058,
1006,
1007,
1029,
9530,
8873,
2290,
1012,
2695,
17603,
2015,
4160,
2140,
1012,
7809,
1024,
9530,
8873,
2290,
1012,
3422,
1012,
3863,
1012,
2000,
27663,
18992,
3366,
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... | |
mochajs/mocha | lib/errors.js | createInvalidInterfaceError | function createInvalidInterfaceError(message, ui) {
var err = new Error(message);
err.code = 'ERR_MOCHA_INVALID_INTERFACE';
err.interface = ui;
return err;
} | javascript | function createInvalidInterfaceError(message, ui) {
var err = new Error(message);
err.code = 'ERR_MOCHA_INVALID_INTERFACE';
err.interface = ui;
return err;
} | [
"function",
"createInvalidInterfaceError",
"(",
"message",
",",
"ui",
")",
"{",
"var",
"err",
"=",
"new",
"Error",
"(",
"message",
")",
";",
"err",
".",
"code",
"=",
"'ERR_MOCHA_INVALID_INTERFACE'",
";",
"err",
".",
"interface",
"=",
"ui",
";",
"return",
"... | Creates an error object to be thrown when the interface specified in the options was not found.
@public
@param {string} message - Error message to be displayed.
@param {string} ui - User-specified interface value.
@returns {Error} instance detailing the error condition | [
"Creates",
"an",
"error",
"object",
"to",
"be",
"thrown",
"when",
"the",
"interface",
"specified",
"in",
"the",
"options",
"was",
"not",
"found",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/errors.js#L47-L52 | train | Create an error object for an invalid interface | [
30522,
3853,
3443,
2378,
10175,
28173,
10111,
12881,
10732,
2121,
29165,
1006,
4471,
1010,
21318,
1007,
1063,
13075,
9413,
2099,
1027,
2047,
7561,
1006,
4471,
1007,
1025,
9413,
2099,
1012,
3642,
1027,
1005,
9413,
2099,
1035,
9587,
7507,
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... |
storybooks/storybook | lib/core/src/client/preview/start.js | showException | function showException(exception) {
addons.getChannel().emit(Events.STORY_THREW_EXCEPTION, exception);
showErrorDisplay(exception);
// Log the stack to the console. So, user could check the source code.
logger.error(exception.stack);
} | javascript | function showException(exception) {
addons.getChannel().emit(Events.STORY_THREW_EXCEPTION, exception);
showErrorDisplay(exception);
// Log the stack to the console. So, user could check the source code.
logger.error(exception.stack);
} | [
"function",
"showException",
"(",
"exception",
")",
"{",
"addons",
".",
"getChannel",
"(",
")",
".",
"emit",
"(",
"Events",
".",
"STORY_THREW_EXCEPTION",
",",
"exception",
")",
";",
"showErrorDisplay",
"(",
"exception",
")",
";",
"// Log the stack to the console. ... | showException is used if we fail to render the story and it is uncaught by the app layer | [
"showException",
"is",
"used",
"if",
"we",
"fail",
"to",
"render",
"the",
"story",
"and",
"it",
"is",
"uncaught",
"by",
"the",
"app",
"layer"
] | 9bff9271b7e163fb12b9ee0cf697c56f9d727b7b | https://github.com/storybooks/storybook/blob/9bff9271b7e163fb12b9ee0cf697c56f9d727b7b/lib/core/src/client/preview/start.js#L50-L56 | train | Show an exception | [
30522,
3853,
2265,
10288,
24422,
1006,
6453,
1007,
1063,
5587,
5644,
1012,
2131,
26058,
1006,
1007,
1012,
12495,
2102,
1006,
2824,
1012,
2466,
1035,
4711,
1035,
6453,
1010,
6453,
1007,
1025,
6457,
29165,
10521,
13068,
1006,
6453,
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... |
jquery/jquery | build/release/dist.js | clone | function clone() {
Release.chdir( Release.dir.base );
Release.dir.dist = Release.dir.base + "/dist";
console.log( "Using distribution repo: ", distRemote );
Release.exec( "git clone " + distRemote + " " + Release.dir.dist,
"Error cloning repo." );
// Distribution always works on master
Release.chdir( R... | javascript | function clone() {
Release.chdir( Release.dir.base );
Release.dir.dist = Release.dir.base + "/dist";
console.log( "Using distribution repo: ", distRemote );
Release.exec( "git clone " + distRemote + " " + Release.dir.dist,
"Error cloning repo." );
// Distribution always works on master
Release.chdir( R... | [
"function",
"clone",
"(",
")",
"{",
"Release",
".",
"chdir",
"(",
"Release",
".",
"dir",
".",
"base",
")",
";",
"Release",
".",
"dir",
".",
"dist",
"=",
"Release",
".",
"dir",
".",
"base",
"+",
"\"/dist\"",
";",
"console",
".",
"log",
"(",
"\"Using... | Clone the distribution repo | [
"Clone",
"the",
"distribution",
"repo"
] | ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3 | https://github.com/jquery/jquery/blob/ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3/build/release/dist.js#L23-L35 | train | Clones the distribution repo | [
30522,
3853,
17598,
1006,
1007,
1063,
2713,
1012,
10381,
4305,
2099,
1006,
2713,
1012,
16101,
1012,
2918,
1007,
1025,
2713,
1012,
16101,
1012,
4487,
3367,
1027,
2713,
1012,
16101,
1012,
2918,
1009,
1000,
1013,
4487,
3367,
1000,
1025,
10122,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/QuickOpen.js | addQuickOpenPlugin | function addQuickOpenPlugin(pluginDef) {
var quickOpenProvider = new QuickOpenPlugin(
pluginDef.name,
pluginDef.languageIds,
pluginDef.done,
pluginDef.search,
pluginDef.match,
pluginDef.itemFocus,
plu... | javascript | function addQuickOpenPlugin(pluginDef) {
var quickOpenProvider = new QuickOpenPlugin(
pluginDef.name,
pluginDef.languageIds,
pluginDef.done,
pluginDef.search,
pluginDef.match,
pluginDef.itemFocus,
plu... | [
"function",
"addQuickOpenPlugin",
"(",
"pluginDef",
")",
"{",
"var",
"quickOpenProvider",
"=",
"new",
"QuickOpenPlugin",
"(",
"pluginDef",
".",
"name",
",",
"pluginDef",
".",
"languageIds",
",",
"pluginDef",
".",
"done",
",",
"pluginDef",
".",
"search",
",",
"... | Creates and registers a new QuickOpenPlugin
@param { name: string,
languageIds: !Array.<string>,
done: ?function(),
search: function(string, !StringMatch.StringMatcher):(!Array.<SearchResult|string>|$.Promise),
match: function(string):boolean,
itemFocus: ?function(?SearchResult|string, string, boolean),
itemSelect: fu... | [
"Creates",
"and",
"registers",
"a",
"new",
"QuickOpenPlugin"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/QuickOpen.js#L176-L193 | train | Adds a QuickOpenPlugin to the cache | [
30522,
3853,
5587,
15549,
19665,
11837,
24759,
15916,
2378,
1006,
13354,
22254,
12879,
1007,
1063,
13075,
4248,
26915,
21572,
17258,
2121,
1027,
2047,
4248,
26915,
24759,
15916,
2378,
1006,
13354,
22254,
12879,
1012,
2171,
1010,
13354,
22254,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/node/optparse.js | formatOption | function formatOption(name, helpMsg) {
var result = [];
var options = IDENTATION + '--' + name;
if (options.length > MAX_HELP_POSITION) {
result.push(options);
result.push('\n');
result.push(wrapStr(helpMsg, TOTAL_WIDTH,
repeatStr(' ', HELP_TEXT_POSITION)).join('\n'));
} else {
var spac... | javascript | function formatOption(name, helpMsg) {
var result = [];
var options = IDENTATION + '--' + name;
if (options.length > MAX_HELP_POSITION) {
result.push(options);
result.push('\n');
result.push(wrapStr(helpMsg, TOTAL_WIDTH,
repeatStr(' ', HELP_TEXT_POSITION)).join('\n'));
} else {
var spac... | [
"function",
"formatOption",
"(",
"name",
",",
"helpMsg",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"var",
"options",
"=",
"IDENTATION",
"+",
"'--'",
"+",
"name",
";",
"if",
"(",
"options",
".",
"length",
">",
"MAX_HELP_POSITION",
")",
"{",
"result... | Formats the help message for a single option. Will place the option string
and help text on the same line whenever possible.
@param {string} name The name of the option.
@param {string} helpMsg The option's help message.
@return {string} The formatted option. | [
"Formats",
"the",
"help",
"message",
"for",
"a",
"single",
"option",
".",
"Will",
"place",
"the",
"option",
"string",
"and",
"help",
"text",
"on",
"the",
"same",
"line",
"whenever",
"possible",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/optparse.js#L150-L172 | train | Format an option | [
30522,
3853,
4289,
7361,
3508,
1006,
2171,
1010,
2393,
5244,
2290,
1007,
1063,
13075,
2765,
1027,
1031,
1033,
1025,
13075,
7047,
1027,
8909,
19304,
1009,
1005,
1011,
1011,
1005,
1009,
2171,
1025,
2065,
1006,
7047,
1012,
3091,
1028,
4098,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | getValueListQualifier | function getValueListQualifier(sTerm) {
var sQualifier = getQualifier(sTerm, sValueListMapping);
return sQualifier !== undefined ? sQualifier : getQualifier(sTerm, sValueList);
} | javascript | function getValueListQualifier(sTerm) {
var sQualifier = getQualifier(sTerm, sValueListMapping);
return sQualifier !== undefined ? sQualifier : getQualifier(sTerm, sValueList);
} | [
"function",
"getValueListQualifier",
"(",
"sTerm",
")",
"{",
"var",
"sQualifier",
"=",
"getQualifier",
"(",
"sTerm",
",",
"sValueListMapping",
")",
";",
"return",
"sQualifier",
"!==",
"undefined",
"?",
"sQualifier",
":",
"getQualifier",
"(",
"sTerm",
",",
"sValu... | Checks that the term is a ValueList or a ValueListMapping and determines the qualifier.
@param {string} sTerm
The term
@returns {string}
The qualifier or undefined, if the term is not as expected | [
"Checks",
"that",
"the",
"term",
"is",
"a",
"ValueList",
"or",
"a",
"ValueListMapping",
"and",
"determines",
"the",
"qualifier",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L239-L243 | train | Get the value list qualifier from the value list mapping | [
30522,
3853,
2131,
10175,
16284,
2923,
26426,
18095,
1006,
26261,
10867,
1007,
1063,
13075,
5490,
8787,
18095,
1027,
2131,
26426,
18095,
1006,
26261,
10867,
1010,
17917,
2389,
16284,
2923,
2863,
14853,
1007,
1025,
2709,
5490,
8787,
18095,
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.fl/src/sap/ui/fl/changeHandler/BaseRename.js | function(oChange, oControl, mPropertyBag) {
var oModifier = mPropertyBag.modifier;
var sPropertyName = mRenameSettings.propertyName;
var vOldValue = oChange.getRevertData();
if (vOldValue || vOldValue === "") {
oModifier.setPropertyBindingOrProperty(oControl, sPropertyName, vOldValue);
... | javascript | function(oChange, oControl, mPropertyBag) {
var oModifier = mPropertyBag.modifier;
var sPropertyName = mRenameSettings.propertyName;
var vOldValue = oChange.getRevertData();
if (vOldValue || vOldValue === "") {
oModifier.setPropertyBindingOrProperty(oControl, sPropertyName, vOldValue);
... | [
"function",
"(",
"oChange",
",",
"oControl",
",",
"mPropertyBag",
")",
"{",
"var",
"oModifier",
"=",
"mPropertyBag",
".",
"modifier",
";",
"var",
"sPropertyName",
"=",
"mRenameSettings",
".",
"propertyName",
";",
"var",
"vOldValue",
"=",
"oChange",
".",
"getRe... | Reverts a Rename Change
@param {sap.ui.fl.Change} oChange change wrapper object with instructions to be applied on the control map
@param {sap.ui.core.Control} oControl Control that matches the change selector for applying the change
@param {object} mPropertyBag property bag
@param {object} mPropertyBag.modifier modif... | [
"Reverts",
"a",
"Rename",
"Change"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/changeHandler/BaseRename.js#L73-L85 | train | This function is called when a change is reverted. | [
30522,
3853,
1006,
28166,
22043,
1010,
1051,
8663,
13181,
2140,
1010,
6131,
18981,
15010,
16078,
1007,
1063,
13075,
18168,
7716,
18095,
1027,
6131,
18981,
15010,
16078,
1012,
16913,
18095,
1025,
13075,
11867,
18981,
15010,
18442,
1027,
2720,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/routing/sync/Target.js | function (oParentInfo, bLog) {
var oOptions = this._oOptions,
oControl = oParentInfo && oParentInfo.oTargetControl,
bHasTargetControl = (oControl || oOptions.controlId),
bIsValid = true,
sLogMessage = "";
if (!bHasTargetControl) {
sLogMessage = "The target " + oOptions._name + " has no contro... | javascript | function (oParentInfo, bLog) {
var oOptions = this._oOptions,
oControl = oParentInfo && oParentInfo.oTargetControl,
bHasTargetControl = (oControl || oOptions.controlId),
bIsValid = true,
sLogMessage = "";
if (!bHasTargetControl) {
sLogMessage = "The target " + oOptions._name + " has no contro... | [
"function",
"(",
"oParentInfo",
",",
"bLog",
")",
"{",
"var",
"oOptions",
"=",
"this",
".",
"_oOptions",
",",
"oControl",
"=",
"oParentInfo",
"&&",
"oParentInfo",
".",
"oTargetControl",
",",
"bHasTargetControl",
"=",
"(",
"oControl",
"||",
"oOptions",
".",
"... | Validates the target options, will also be called from the route but route will not log errors
@param oParentInfo
@param {boolean} bLog
@returns {boolean}
@private | [
"Validates",
"the",
"target",
"options",
"will",
"also",
"be",
"called",
"from",
"the",
"route",
"but",
"route",
"will",
"not",
"log",
"errors"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/sync/Target.js#L137-L164 | train | Checks if the target is valid and if so logs an error. | [
30522,
3853,
1006,
6728,
12069,
16778,
2078,
14876,
1010,
9927,
1007,
1063,
13075,
1051,
7361,
9285,
1027,
2023,
1012,
1035,
1051,
7361,
9285,
1010,
1051,
8663,
13181,
2140,
1027,
6728,
12069,
16778,
2078,
14876,
1004,
1004,
6728,
12069,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jaredpalmer/razzle | packages/razzle/scripts/start.js | compile | function compile(config) {
let compiler;
try {
compiler = webpack(config);
} catch (e) {
printErrors('Failed to compile.', [e]);
process.exit(1);
}
return compiler;
} | javascript | function compile(config) {
let compiler;
try {
compiler = webpack(config);
} catch (e) {
printErrors('Failed to compile.', [e]);
process.exit(1);
}
return compiler;
} | [
"function",
"compile",
"(",
"config",
")",
"{",
"let",
"compiler",
";",
"try",
"{",
"compiler",
"=",
"webpack",
"(",
"config",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"printErrors",
"(",
"'Failed to compile.'",
",",
"[",
"e",
"]",
")",
";",
"proc... | Webpack compile in a try-catch | [
"Webpack",
"compile",
"in",
"a",
"try",
"-",
"catch"
] | 6f12cb8a84a1ef1b8491c36958a8797f97407312 | https://github.com/jaredpalmer/razzle/blob/6f12cb8a84a1ef1b8491c36958a8797f97407312/packages/razzle/scripts/start.js#L90-L99 | train | Compile the webpack module. | [
30522,
3853,
4012,
22090,
1006,
9530,
8873,
2290,
1007,
1063,
2292,
21624,
1025,
3046,
1063,
21624,
1027,
4773,
23947,
1006,
9530,
8873,
2290,
1007,
1025,
1065,
4608,
1006,
1041,
1007,
1063,
15041,
29165,
2015,
1006,
1005,
3478,
2000,
4012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ManagedObject.js | isInclusiveDescendantOf | function isInclusiveDescendantOf(a, b) {
while ( a && a !== b ) {
a = a.oParent;
}
return !!a;
} | javascript | function isInclusiveDescendantOf(a, b) {
while ( a && a !== b ) {
a = a.oParent;
}
return !!a;
} | [
"function",
"isInclusiveDescendantOf",
"(",
"a",
",",
"b",
")",
"{",
"while",
"(",
"a",
"&&",
"a",
"!==",
"b",
")",
"{",
"a",
"=",
"a",
".",
"oParent",
";",
"}",
"return",
"!",
"!",
"a",
";",
"}"
] | Checks whether object <code>a</code> is an inclusive descendant of object <code>b</code>.
@param {sap.ui.base.ManagedObject} a Object that should be checked for being a descendant
@param {sap.ui.base.ManagedObject} b Object that should be checked for having a descendant
@returns {boolean} Whether <code>a</code> is a d... | [
"Checks",
"whether",
"object",
"<code",
">",
"a<",
"/",
"code",
">",
"is",
"an",
"inclusive",
"descendant",
"of",
"object",
"<code",
">",
"b<",
"/",
"code",
">",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ManagedObject.js#L2520-L2525 | train | Determines whether a is a descendant of b. | [
30522,
3853,
2003,
2378,
23633,
6155,
23865,
21634,
2546,
1006,
1037,
1010,
1038,
1007,
1063,
2096,
1006,
1037,
1004,
1004,
1037,
999,
1027,
1027,
1038,
1007,
1063,
1037,
1027,
1037,
1012,
6728,
12069,
3372,
1025,
1065,
2709,
999,
999,
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... |
infinitered/ignite | src/cli/enforce-global.js | enforce | function enforce(opts = {}) {
// opts to pass in
var optional = opts.optional || false
var range = opts.range
var whichExec = opts.which
var packageName = opts.packageName || opts.which
var versionCommand = opts.versionCommand
var installMessage = opts.installMessage
var versionMatcher = opts.versionMat... | javascript | function enforce(opts = {}) {
// opts to pass in
var optional = opts.optional || false
var range = opts.range
var whichExec = opts.which
var packageName = opts.packageName || opts.which
var versionCommand = opts.versionCommand
var installMessage = opts.installMessage
var versionMatcher = opts.versionMat... | [
"function",
"enforce",
"(",
"opts",
"=",
"{",
"}",
")",
"{",
"// opts to pass in",
"var",
"optional",
"=",
"opts",
".",
"optional",
"||",
"false",
"var",
"range",
"=",
"opts",
".",
"range",
"var",
"whichExec",
"=",
"opts",
".",
"which",
"var",
"packageNa... | Verifies the dependency which is installed is compatible with ignite.
@param {any} opts The options to enforce.
@param {boolean} opts.optional Is this an optional dependency?
@param {string} opts.range The semver range to test against.
@param {string} opts.which The... | [
"Verifies",
"the",
"dependency",
"which",
"is",
"installed",
"is",
"compatible",
"with",
"ignite",
"."
] | dca91da22f9ad9bab1eb9f43565689d563bd111d | https://github.com/infinitered/ignite/blob/dca91da22f9ad9bab1eb9f43565689d563bd111d/src/cli/enforce-global.js#L47-L130 | train | Enforce the current version of the Ignite CLI | [
30522,
3853,
16306,
1006,
23569,
2015,
1027,
1063,
1065,
1007,
1063,
1013,
1013,
23569,
2015,
2000,
3413,
1999,
13075,
11887,
1027,
23569,
2015,
1012,
11887,
1064,
1064,
6270,
13075,
2846,
1027,
23569,
2015,
1012,
2846,
13075,
2029,
10288,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/chart/sankey/sankeyLayout.js | initializeNodeDepth | function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {
var minKy = Infinity;
zrUtil.each(nodesByBreadth, function (nodes) {
var n = nodes.length;
var sum = 0;
zrUtil.each(nodes, function (node) {
sum += node.getLayout().value;
});
... | javascript | function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {
var minKy = Infinity;
zrUtil.each(nodesByBreadth, function (nodes) {
var n = nodes.length;
var sum = 0;
zrUtil.each(nodes, function (node) {
sum += node.getLayout().value;
});
... | [
"function",
"initializeNodeDepth",
"(",
"nodesByBreadth",
",",
"edges",
",",
"height",
",",
"width",
",",
"nodeGap",
",",
"orient",
")",
"{",
"var",
"minKy",
"=",
"Infinity",
";",
"zrUtil",
".",
"each",
"(",
"nodesByBreadth",
",",
"function",
"(",
"nodes",
... | Compute the original y-position for each node
@param {module:echarts/data/Graph~Node} nodes node of sankey view
@param {Array.<Array.<module:echarts/data/Graph~Node>>} nodesByBreadth
group by the array of all sankey nodes based on the nodes x-position.
@param {module:echarts/data/Graph~Edge} edges edge of sankey vie... | [
"Compute",
"the",
"original",
"y",
"-",
"position",
"for",
"each",
"node"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sankey/sankeyLayout.js#L302-L337 | train | Initialize node depth | [
30522,
3853,
3988,
4697,
3630,
5732,
23606,
2232,
1006,
14164,
3762,
27035,
2705,
1010,
7926,
1010,
4578,
1010,
9381,
1010,
13045,
3654,
2361,
1010,
16865,
1007,
1063,
13075,
8117,
4801,
1027,
15579,
1025,
1062,
22134,
4014,
1012,
2169,
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... |
firebase/firebaseui-web | demo/public/app.js | function() {
document.getElementById('sign-in-with-redirect').addEventListener(
'click', signInWithRedirect);
document.getElementById('sign-in-with-popup').addEventListener(
'click', signInWithPopup);
document.getElementById('sign-out').addEventListener('click', function() {
firebase.auth().signOu... | javascript | function() {
document.getElementById('sign-in-with-redirect').addEventListener(
'click', signInWithRedirect);
document.getElementById('sign-in-with-popup').addEventListener(
'click', signInWithPopup);
document.getElementById('sign-out').addEventListener('click', function() {
firebase.auth().signOu... | [
"function",
"(",
")",
"{",
"document",
".",
"getElementById",
"(",
"'sign-in-with-redirect'",
")",
".",
"addEventListener",
"(",
"'click'",
",",
"signInWithRedirect",
")",
";",
"document",
".",
"getElementById",
"(",
"'sign-in-with-popup'",
")",
".",
"addEventListen... | Initializes the app. | [
"Initializes",
"the",
"app",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L208-L238 | train | Adds event listeners to the window | [
30522,
3853,
1006,
1007,
1063,
6254,
1012,
2131,
12260,
3672,
3762,
3593,
1006,
1005,
3696,
1011,
1999,
1011,
2007,
1011,
2417,
7442,
6593,
1005,
1007,
1012,
5587,
18697,
3372,
9863,
24454,
1006,
1005,
11562,
1005,
1010,
3696,
2378,
24415,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _navigateBack | function _navigateBack() {
if (!jumpForwardStack.length) {
if (activePosNotSynced) {
currentEditPos = new NavigationFrame(EditorManager.getCurrentFullEditor(), {ranges: EditorManager.getCurrentFullEditor()._codeMirror.listSelections()});
jumpForwardStack.push(currentE... | javascript | function _navigateBack() {
if (!jumpForwardStack.length) {
if (activePosNotSynced) {
currentEditPos = new NavigationFrame(EditorManager.getCurrentFullEditor(), {ranges: EditorManager.getCurrentFullEditor()._codeMirror.listSelections()});
jumpForwardStack.push(currentE... | [
"function",
"_navigateBack",
"(",
")",
"{",
"if",
"(",
"!",
"jumpForwardStack",
".",
"length",
")",
"{",
"if",
"(",
"activePosNotSynced",
")",
"{",
"currentEditPos",
"=",
"new",
"NavigationFrame",
"(",
"EditorManager",
".",
"getCurrentFullEditor",
"(",
")",
",... | Command handler to navigate backward | [
"Command",
"handler",
"to",
"navigate",
"backward"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L339-L371 | train | Navigates back to the previous frame | [
30522,
3853,
1035,
22149,
5963,
1006,
1007,
1063,
2065,
1006,
999,
5376,
29278,
7652,
9153,
3600,
1012,
3091,
1007,
1063,
2065,
1006,
3161,
6873,
2015,
17048,
6508,
5897,
2094,
1007,
1063,
2783,
2098,
4183,
6873,
2015,
1027,
2047,
9163,
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... |
apache/incubator-echarts | src/chart/sunburst/SunburstPiece.js | SunburstPiece | function SunburstPiece(node, seriesModel, ecModel) {
graphic.Group.call(this);
var sector = new graphic.Sector({
z2: DEFAULT_SECTOR_Z
});
sector.seriesIndex = seriesModel.seriesIndex;
var text = new graphic.Text({
z2: DEFAULT_TEXT_Z,
silent: node.getModel('label').get('sil... | javascript | function SunburstPiece(node, seriesModel, ecModel) {
graphic.Group.call(this);
var sector = new graphic.Sector({
z2: DEFAULT_SECTOR_Z
});
sector.seriesIndex = seriesModel.seriesIndex;
var text = new graphic.Text({
z2: DEFAULT_TEXT_Z,
silent: node.getModel('label').get('sil... | [
"function",
"SunburstPiece",
"(",
"node",
",",
"seriesModel",
",",
"ecModel",
")",
"{",
"graphic",
".",
"Group",
".",
"call",
"(",
"this",
")",
";",
"var",
"sector",
"=",
"new",
"graphic",
".",
"Sector",
"(",
"{",
"z2",
":",
"DEFAULT_SECTOR_Z",
"}",
")... | Sunburstce of Sunburst including Sector, Label, LabelLine
@constructor
@extends {module:zrender/graphic/Group} | [
"Sunburstce",
"of",
"Sunburst",
"including",
"Sector",
"Label",
"LabelLine"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sunburst/SunburstPiece.js#L38-L67 | train | Sunburst piece | [
30522,
3853,
3103,
8569,
12096,
11198,
1006,
13045,
1010,
2186,
5302,
9247,
1010,
14925,
5302,
9247,
1007,
1063,
8425,
1012,
2177,
1012,
2655,
1006,
2023,
1007,
1025,
13075,
4753,
1027,
2047,
8425,
1012,
4753,
1006,
1063,
1062,
2475,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/History.js | function (sFormat) {
var oFormattedHistory,
aHistory = this.getHistory();
switch (sFormat) {
case library.HistoryFormats.Abap:
oFormattedHistory = AbapHistoryFormatter.format(aHistory);
break;
default :
oFormattedHistory = StringHistoryFormatter.format(aHistory);
}
return oForma... | javascript | function (sFormat) {
var oFormattedHistory,
aHistory = this.getHistory();
switch (sFormat) {
case library.HistoryFormats.Abap:
oFormattedHistory = AbapHistoryFormatter.format(aHistory);
break;
default :
oFormattedHistory = StringHistoryFormatter.format(aHistory);
}
return oForma... | [
"function",
"(",
"sFormat",
")",
"{",
"var",
"oFormattedHistory",
",",
"aHistory",
"=",
"this",
".",
"getHistory",
"(",
")",
";",
"switch",
"(",
"sFormat",
")",
"{",
"case",
"library",
".",
"HistoryFormats",
".",
"Abap",
":",
"oFormattedHistory",
"=",
"Aba... | Returns the history into formatted output depending on the passed format.
@public
@method
@param {string} sFormat The format into which the history object will be converted. Possible values are listed in sap.ui.support.HistoryFormats.
@name sap.ui.support.History.getFormattedHistory
@returns {*} All analysis history o... | [
"Returns",
"the",
"history",
"into",
"formatted",
"output",
"depending",
"on",
"the",
"passed",
"format",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/History.js#L220-L233 | train | Returns the formatted history in the given format. | [
30522,
3853,
1006,
16420,
2953,
18900,
1007,
1063,
13075,
1997,
2953,
18900,
3064,
24158,
7062,
1010,
6289,
20483,
2854,
1027,
2023,
1012,
2131,
24158,
7062,
1006,
1007,
1025,
6942,
1006,
16420,
2953,
18900,
1007,
1063,
2553,
3075,
1012,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GitbookIO/gitbook | lib/output/ebook/getPDFTemplate.js | getPDFTemplate | function getPDFTemplate(output, type) {
var filePath = 'pdf_' + type + '.html';
var outputRoot = output.getRoot();
var engine = WebsiteGenerator.createTemplateEngine(output, filePath);
// Generate context
var context = JSONUtils.encodeOutput(output);
context.page = {
num: '_PAGENUM_',
... | javascript | function getPDFTemplate(output, type) {
var filePath = 'pdf_' + type + '.html';
var outputRoot = output.getRoot();
var engine = WebsiteGenerator.createTemplateEngine(output, filePath);
// Generate context
var context = JSONUtils.encodeOutput(output);
context.page = {
num: '_PAGENUM_',
... | [
"function",
"getPDFTemplate",
"(",
"output",
",",
"type",
")",
"{",
"var",
"filePath",
"=",
"'pdf_'",
"+",
"type",
"+",
"'.html'",
";",
"var",
"outputRoot",
"=",
"output",
".",
"getRoot",
"(",
")",
";",
"var",
"engine",
"=",
"WebsiteGenerator",
".",
"cre... | Generate PDF header/footer templates
@param {Output} output
@param {String} type
@return {String} | [
"Generate",
"PDF",
"header",
"/",
"footer",
"templates"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/ebook/getPDFTemplate.js#L16-L39 | train | Get the PDF template | [
30522,
3853,
2131,
17299,
6199,
6633,
15725,
1006,
6434,
1010,
2828,
1007,
1063,
13075,
5371,
15069,
1027,
1005,
11135,
1035,
1005,
1009,
2828,
1009,
1005,
1012,
16129,
1005,
1025,
13075,
6434,
3217,
4140,
1027,
6434,
1012,
2131,
3217,
4140... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
KaTeX/KaTeX | contrib/mhchem/mhchem.js | function (input, stateMachine) {
if (!input) { return []; }
if (stateMachine === undefined) { stateMachine = 'ce'; }
var state = '0';
//
// String buffers for parsing:
//
// buffer.a == amount
// buffer.o == element
// buffer.b == left-side superscript
// buf... | javascript | function (input, stateMachine) {
if (!input) { return []; }
if (stateMachine === undefined) { stateMachine = 'ce'; }
var state = '0';
//
// String buffers for parsing:
//
// buffer.a == amount
// buffer.o == element
// buffer.b == left-side superscript
// buf... | [
"function",
"(",
"input",
",",
"stateMachine",
")",
"{",
"if",
"(",
"!",
"input",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"stateMachine",
"===",
"undefined",
")",
"{",
"stateMachine",
"=",
"'ce'",
";",
"}",
"var",
"state",
"=",
"'0'",
";... | Parses mchem \ce syntax Call like go("H2O"); | [
"Parses",
"mchem",
"\\",
"ce",
"syntax",
"Call",
"like",
"go",
"(",
"H2O",
")",
";"
] | 17bfb247b88070267f3e5c7b21fe4a360fdf49d9 | https://github.com/KaTeX/KaTeX/blob/17bfb247b88070267f3e5c7b21fe4a360fdf49d9/contrib/mhchem/mhchem.js#L105-L222 | train | Parses a string into an array of parser output | [
30522,
3853,
1006,
7953,
1010,
2110,
22911,
14014,
1007,
1063,
2065,
1006,
999,
7953,
1007,
1063,
2709,
1031,
1033,
1025,
1065,
2065,
1006,
2110,
22911,
14014,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
2110,
22911,
14014,
1027,
1005,
8292,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/less.js | function () {
var value;
if (! $re(/^\(opacity=/i)) { return; }
value = $re(/^\d+/) || this.entities.variable();
if (value) {
expectChar(')');
return new(tree.Alpha)(value);
}
} | javascript | function () {
var value;
if (! $re(/^\(opacity=/i)) { return; }
value = $re(/^\d+/) || this.entities.variable();
if (value) {
expectChar(')');
return new(tree.Alpha)(value);
}
} | [
"function",
"(",
")",
"{",
"var",
"value",
";",
"if",
"(",
"!",
"$re",
"(",
"/",
"^\\(opacity=",
"/",
"i",
")",
")",
"{",
"return",
";",
"}",
"value",
"=",
"$re",
"(",
"/",
"^\\d+",
"/",
")",
"||",
"this",
".",
"entities",
".",
"variable",
"(",... | IE's alpha function alpha(opacity=88) | [
"IE",
"s",
"alpha",
"function",
"alpha",
"(",
"opacity",
"=",
"88",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L1333-L1342 | train | expectChar ( ) ; | [
30522,
3853,
1006,
1007,
1063,
13075,
3643,
1025,
2065,
1006,
999,
1002,
2128,
1006,
1013,
1034,
1032,
1006,
6728,
6305,
3012,
1027,
1013,
1045,
1007,
1007,
1063,
2709,
1025,
1065,
3643,
1027,
1002,
2128,
1006,
1013,
1034,
1032,
1040,
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... | |
googleapis/google-api-nodejs-client | samples/defaultauth.js | main | async function main() {
// The `getClient` method will choose a service based authentication model
const auth = await google.auth.getClient({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/compute'],
});
// Obtain the curr... | javascript | async function main() {
// The `getClient` method will choose a service based authentication model
const auth = await google.auth.getClient({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/compute'],
});
// Obtain the curr... | [
"async",
"function",
"main",
"(",
")",
"{",
"// The `getClient` method will choose a service based authentication model",
"const",
"auth",
"=",
"await",
"google",
".",
"auth",
".",
"getClient",
"(",
"{",
"// Scopes can be specified either as an array or as a single, space-delimit... | The google.auth.getClient method creates the appropriate type of credential client for you,
depending upon whether the client is running in Google App Engine, Google Compute Engine, a
Managed VM, or on a local developer machine. This allows you to write one set of auth code that
will work in all cases. It most situatio... | [
"The",
"google",
".",
"auth",
".",
"getClient",
"method",
"creates",
"the",
"appropriate",
"type",
"of",
"credential",
"client",
"for",
"you",
"depending",
"upon",
"whether",
"the",
"client",
"is",
"running",
"in",
"Google",
"App",
"Engine",
"Google",
"Compute... | e6e632a29d0b246d058e3067de3a5c3827e2b54e | https://github.com/googleapis/google-api-nodejs-client/blob/e6e632a29d0b246d058e3067de3a5c3827e2b54e/samples/defaultauth.js#L37-L50 | train | Main entry point for the cluster | [
30522,
2004,
6038,
2278,
3853,
2364,
1006,
1007,
1063,
1013,
1013,
1996,
1036,
2131,
20464,
11638,
1036,
4118,
2097,
5454,
1037,
2326,
2241,
27280,
2944,
9530,
3367,
8740,
2705,
1027,
26751,
8224,
1012,
8740,
2705,
1012,
2131,
20464,
11638,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mdn/browser-compat-data | scripts/render.js | writeSupportInfo | function writeSupportInfo(supportData, browserId, compatNotes) {
let output = '';
// browsers are optional in the data, display them as "?" in our table
if (!supportData) {
output += getVersionString(null);
// we have support data, lets go
} else {
output += getVersionString(supportData.version_added... | javascript | function writeSupportInfo(supportData, browserId, compatNotes) {
let output = '';
// browsers are optional in the data, display them as "?" in our table
if (!supportData) {
output += getVersionString(null);
// we have support data, lets go
} else {
output += getVersionString(supportData.version_added... | [
"function",
"writeSupportInfo",
"(",
"supportData",
",",
"browserId",
",",
"compatNotes",
")",
"{",
"let",
"output",
"=",
"''",
";",
"// browsers are optional in the data, display them as \"?\" in our table",
"if",
"(",
"!",
"supportData",
")",
"{",
"output",
"+=",
"g... | /*
Main function responsible for the contents of a support cell in the table.
`supportData` is a support_statement
`browserId` is a compat_block browser ID
`compatNotes` is collected Compatibility notes | [
"/",
"*",
"Main",
"function",
"responsible",
"for",
"the",
"contents",
"of",
"a",
"support",
"cell",
"in",
"the",
"table",
"."
] | 6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b | https://github.com/mdn/browser-compat-data/blob/6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b/scripts/render.js#L206-L273 | train | Write support info to the table | [
30522,
3853,
7009,
6279,
6442,
2378,
14876,
1006,
2490,
2850,
2696,
1010,
16602,
3593,
1010,
4012,
4502,
2102,
20564,
1007,
1063,
2292,
6434,
1027,
1005,
1005,
1025,
1013,
1013,
16602,
2015,
2024,
11887,
1999,
1996,
2951,
1010,
4653,
2068,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/gridList/grid-list.js | layoutDelegate | function layoutDelegate(tilesInvalidated) {
var tiles = getTileElements();
var props = {
tileSpans: getTileSpans(tiles),
colCount: getColumnCount(),
rowMode: getRowMode(),
rowHeight: getRowHeight(),
gutter: getGutter()
};
if (!tilesInvalidated && angular.... | javascript | function layoutDelegate(tilesInvalidated) {
var tiles = getTileElements();
var props = {
tileSpans: getTileSpans(tiles),
colCount: getColumnCount(),
rowMode: getRowMode(),
rowHeight: getRowHeight(),
gutter: getGutter()
};
if (!tilesInvalidated && angular.... | [
"function",
"layoutDelegate",
"(",
"tilesInvalidated",
")",
"{",
"var",
"tiles",
"=",
"getTileElements",
"(",
")",
";",
"var",
"props",
"=",
"{",
"tileSpans",
":",
"getTileSpans",
"(",
"tiles",
")",
",",
"colCount",
":",
"getColumnCount",
"(",
")",
",",
"r... | Invokes the layout engine, and uses its results to lay out our
tile elements.
@param {boolean} tilesInvalidated Whether tiles have been
added/removed/moved since the last layout. This is to avoid situations
where tiles are replaced with properties identical to their removed
counterparts. | [
"Invokes",
"the",
"layout",
"engine",
"and",
"uses",
"its",
"results",
"to",
"lay",
"out",
"our",
"tile",
"elements",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/gridList/grid-list.js#L167-L211 | train | This is the layout function that is called when the user has requested a new layout. | [
30522,
3853,
9621,
9247,
29107,
2618,
1006,
13262,
2378,
10175,
8524,
3064,
1007,
1063,
13075,
13262,
1027,
2131,
15286,
12260,
8163,
1006,
1007,
1025,
13075,
24387,
1027,
1063,
13262,
9739,
2015,
1024,
2131,
15286,
13102,
6962,
1006,
13262,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 () {
// Avoid parsing too large documents, as per configuration option
if (this._maxElemsToParse > 0) {
var numTags = this._doc.getElementsByTagName("*").length;
if (numTags > this._maxElemsToParse) {
throw new Error("Aborting parsing document; " + numTags + " elements found");
... | javascript | function () {
// Avoid parsing too large documents, as per configuration option
if (this._maxElemsToParse > 0) {
var numTags = this._doc.getElementsByTagName("*").length;
if (numTags > this._maxElemsToParse) {
throw new Error("Aborting parsing document; " + numTags + " elements found");
... | [
"function",
"(",
")",
"{",
"// Avoid parsing too large documents, as per configuration option",
"if",
"(",
"this",
".",
"_maxElemsToParse",
">",
"0",
")",
"{",
"var",
"numTags",
"=",
"this",
".",
"_doc",
".",
"getElementsByTagName",
"(",
"\"*\"",
")",
".",
"length... | Runs readability.
Workflow:
1. Prep the document by removing script tags, css, etc.
2. Build readability's DOM tree.
3. Grab the article content from the current dom tree.
4. Replace the current DOM tree with the new one.
5. Read peacefully.
@return void | [
"Runs",
"readability",
"."
] | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/Clipper/joplin-webclipper/content_scripts/Readability.js#L1768-L1816 | train | Returns the content of the article | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
4468,
11968,
7741,
2205,
2312,
5491,
1010,
2004,
2566,
9563,
5724,
2065,
1006,
2023,
1012,
1035,
4098,
12260,
5244,
14399,
11650,
2063,
1028,
1014,
1007,
1063,
13075,
16371,
20492,
26454,
1027,
202... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
dimsemenov/PhotoSwipe | src/js/gestures.js | function(p1, p2, pCenter) {
pCenter.x = (p1.x + p2.x) * 0.5;
pCenter.y = (p1.y + p2.y) * 0.5;
} | javascript | function(p1, p2, pCenter) {
pCenter.x = (p1.x + p2.x) * 0.5;
pCenter.y = (p1.y + p2.y) * 0.5;
} | [
"function",
"(",
"p1",
",",
"p2",
",",
"pCenter",
")",
"{",
"pCenter",
".",
"x",
"=",
"(",
"p1",
".",
"x",
"+",
"p2",
".",
"x",
")",
"*",
"0.5",
";",
"pCenter",
".",
"y",
"=",
"(",
"p1",
".",
"y",
"+",
"p2",
".",
"y",
")",
"*",
"0.5",
"... | 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#L112-L115 | train | Calculate the center of the line | [
30522,
3853,
1006,
1052,
2487,
1010,
1052,
2475,
1010,
7473,
29110,
1007,
1063,
7473,
29110,
1012,
1060,
1027,
1006,
1052,
2487,
1012,
1060,
1009,
1052,
2475,
1012,
1060,
1007,
1008,
1014,
1012,
1019,
1025,
7473,
29110,
1012,
1061,
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... | |
aframevr/aframe | src/core/component.js | function (newData, clobber, silent) {
var componentDefined;
var data;
var defaultValue;
var key;
var mixinData;
var nextData = this.nextData;
var schema = this.schema;
var i;
var mixinEls = this.el.mixinEls;
var previousData;
// Whether component has a defined value. For arr... | javascript | function (newData, clobber, silent) {
var componentDefined;
var data;
var defaultValue;
var key;
var mixinData;
var nextData = this.nextData;
var schema = this.schema;
var i;
var mixinEls = this.el.mixinEls;
var previousData;
// Whether component has a defined value. For arr... | [
"function",
"(",
"newData",
",",
"clobber",
",",
"silent",
")",
"{",
"var",
"componentDefined",
";",
"var",
"data",
";",
"var",
"defaultValue",
";",
"var",
"key",
";",
"var",
"mixinData",
";",
"var",
"nextData",
"=",
"this",
".",
"nextData",
";",
"var",
... | Build component data from the current state of the entity.data.
Precedence:
1. Defaults data
2. Mixin data.
3. Attribute data.
Finally coerce the data to the types of the defaults.
@param {object} newData - Element new data.
@param {boolean} clobber - The previous data is completely replaced by the new one.
@param {... | [
"Build",
"component",
"data",
"from",
"the",
"current",
"state",
"of",
"the",
"entity",
".",
"data",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/component.js#L479-L553 | train | Returns the data to be modified. | [
30522,
3853,
1006,
2047,
2850,
2696,
1010,
18856,
16429,
5677,
1010,
4333,
1007,
1063,
13075,
6922,
3207,
23460,
2094,
1025,
13075,
2951,
1025,
13075,
12398,
10175,
5657,
1025,
13075,
3145,
1025,
13075,
4666,
23938,
2696,
1025,
13075,
2279,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function (oInstance, sMetaPath, mTypeForMetaPath) {
var aKeyProperties = [],
mKey2Value = _Helper.getKeyProperties(oInstance, sMetaPath, mTypeForMetaPath, true);
if (!mKey2Value) {
return undefined;
}
aKeyProperties = Object.keys(mKey2Value).map(function (sAlias, iIndex, aKeys) {
var vValue = e... | javascript | function (oInstance, sMetaPath, mTypeForMetaPath) {
var aKeyProperties = [],
mKey2Value = _Helper.getKeyProperties(oInstance, sMetaPath, mTypeForMetaPath, true);
if (!mKey2Value) {
return undefined;
}
aKeyProperties = Object.keys(mKey2Value).map(function (sAlias, iIndex, aKeys) {
var vValue = e... | [
"function",
"(",
"oInstance",
",",
"sMetaPath",
",",
"mTypeForMetaPath",
")",
"{",
"var",
"aKeyProperties",
"=",
"[",
"]",
",",
"mKey2Value",
"=",
"_Helper",
".",
"getKeyProperties",
"(",
"oInstance",
",",
"sMetaPath",
",",
"mTypeForMetaPath",
",",
"true",
")"... | Returns the key predicate (see "4.3.1 Canonical URL") for the given entity using the
given meta data.
@param {object} oInstance
Entity instance runtime data
@param {string} sMetaPath
The absolute meta path of the given instance
@param {object} mTypeForMetaPath
Maps meta paths to the corresponding entity or complex typ... | [
"Returns",
"the",
"key",
"predicate",
"(",
"see",
"4",
".",
"3",
".",
"1",
"Canonical",
"URL",
")",
"for",
"the",
"given",
"entity",
"using",
"the",
"given",
"meta",
"data",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L532-L546 | train | Returns the key property string for the given instance | [
30522,
3853,
1006,
1051,
7076,
26897,
1010,
15488,
12928,
15069,
1010,
11047,
18863,
14192,
12928,
15069,
1007,
1063,
13075,
17712,
3240,
21572,
4842,
7368,
1027,
1031,
1033,
1010,
12395,
3240,
2475,
10175,
5657,
1027,
1035,
2393,
2121,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function(sParameterName, sValue, sToValue) {
var oParameter = this._oParameterization.findParameterByName(sParameterName);
if (!oParameter) {
throw "Invalid parameter name " + sParameterName; // TODO improve
}
// error handling
if (sToValue != null) {
if (!oParameter.isIntervalBoundary()) {
... | javascript | function(sParameterName, sValue, sToValue) {
var oParameter = this._oParameterization.findParameterByName(sParameterName);
if (!oParameter) {
throw "Invalid parameter name " + sParameterName; // TODO improve
}
// error handling
if (sToValue != null) {
if (!oParameter.isIntervalBoundary()) {
... | [
"function",
"(",
"sParameterName",
",",
"sValue",
",",
"sToValue",
")",
"{",
"var",
"oParameter",
"=",
"this",
".",
"_oParameterization",
".",
"findParameterByName",
"(",
"sParameterName",
")",
";",
"if",
"(",
"!",
"oParameter",
")",
"{",
"throw",
"\"Invalid p... | Assign a value to a parameter
@param {String}
sParameterName Name of the parameter. In case of a range
value, provide the name of the lower boundary parameter.
@param {String}
sValue Assigned value. Pass null to remove a value assignment.
@param {String}
sToValue Omit it or set it to null for single values. If set,
it... | [
"Assign",
"a",
"value",
"to",
"a",
"parameter"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3898-L3941 | train | Sets the value of a parameter | [
30522,
3853,
1006,
12403,
6444,
15141,
18442,
1010,
17917,
2389,
5657,
1010,
2358,
7103,
7630,
2063,
1007,
1063,
13075,
6728,
5400,
22828,
1027,
2023,
1012,
1035,
6728,
5400,
22828,
3989,
1012,
2424,
28689,
22828,
3762,
18442,
1006,
12403,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/utils/AppInit.js | _addListener | function _addListener(type, handler) {
if (_status[type]) {
_callHandler(handler);
} else {
_callbacks[type].push(handler);
}
} | javascript | function _addListener(type, handler) {
if (_status[type]) {
_callHandler(handler);
} else {
_callbacks[type].push(handler);
}
} | [
"function",
"_addListener",
"(",
"type",
",",
"handler",
")",
"{",
"if",
"(",
"_status",
"[",
"type",
"]",
")",
"{",
"_callHandler",
"(",
"handler",
")",
";",
"}",
"else",
"{",
"_callbacks",
"[",
"type",
"]",
".",
"push",
"(",
"handler",
")",
";",
... | /*
adds a callback to the list of functions to call for the specified event type
@param {string} type - the event type to dispatch (APP_READY, EXTENSIONS_READY, HTML_READY)
@param {function} handler - callback funciton to call when the event is triggered
@private | [
"/",
"*",
"adds",
"a",
"callback",
"to",
"the",
"list",
"of",
"functions",
"to",
"call",
"for",
"the",
"specified",
"event",
"type"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/AppInit.js#L122-L128 | train | Add a listener to the event queue | [
30522,
3853,
1035,
5587,
9863,
24454,
1006,
2828,
1010,
28213,
1007,
1063,
2065,
1006,
1035,
3570,
1031,
2828,
1033,
1007,
1063,
1035,
2655,
11774,
3917,
1006,
28213,
1007,
1025,
1065,
2842,
1063,
1035,
2655,
12221,
1031,
2828,
1033,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/input-mask/jquery.inputmask.date.extensions.js | function (chrs, buffer, pos, strict, opts) {
var isValid = opts.regex.val1.test(chrs);
if (!strict && !isValid) {
if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) {
isValid = opts.rege... | javascript | function (chrs, buffer, pos, strict, opts) {
var isValid = opts.regex.val1.test(chrs);
if (!strict && !isValid) {
if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) {
isValid = opts.rege... | [
"function",
"(",
"chrs",
",",
"buffer",
",",
"pos",
",",
"strict",
",",
"opts",
")",
"{",
"var",
"isValid",
"=",
"opts",
".",
"regex",
".",
"val1",
".",
"test",
"(",
"chrs",
")",
";",
"if",
"(",
"!",
"strict",
"&&",
"!",
"isValid",
")",
"{",
"i... | val1 ~ day or month | [
"val1",
"~",
"day",
"or",
"month"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/input-mask/jquery.inputmask.date.extensions.js#L86-L98 | train | Check if the character is valid | [
30522,
3853,
1006,
10381,
2869,
1010,
17698,
1010,
13433,
2015,
1010,
9384,
1010,
23569,
2015,
1007,
1063,
13075,
2003,
10175,
3593,
1027,
23569,
2015,
1012,
19723,
10288,
1012,
11748,
2487,
1012,
3231,
1006,
10381,
2869,
1007,
1025,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/slider/slider.js | percentToValue | function percentToValue(percent) {
var adjustedPercent = invert ? (1 - percent) : percent;
return (min + adjustedPercent * (max - min));
} | javascript | function percentToValue(percent) {
var adjustedPercent = invert ? (1 - percent) : percent;
return (min + adjustedPercent * (max - min));
} | [
"function",
"percentToValue",
"(",
"percent",
")",
"{",
"var",
"adjustedPercent",
"=",
"invert",
"?",
"(",
"1",
"-",
"percent",
")",
":",
"percent",
";",
"return",
"(",
"min",
"+",
"adjustedPercent",
"*",
"(",
"max",
"-",
"min",
")",
")",
";",
"}"
] | Convert percentage offset on slide to equivalent model value
@param percent
@returns {*} | [
"Convert",
"percentage",
"offset",
"on",
"slide",
"to",
"equivalent",
"model",
"value"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/slider/slider.js#L662-L665 | train | Converts a percent value to a number | [
30522,
3853,
3867,
26525,
2389,
5657,
1006,
3867,
1007,
1063,
13075,
10426,
4842,
13013,
1027,
1999,
16874,
1029,
1006,
1015,
1011,
3867,
1007,
1024,
3867,
1025,
2709,
1006,
8117,
1009,
10426,
4842,
13013,
1008,
1006,
4098,
1011,
8117,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/qunit/QUnitUtils.js | calcCost | function calcCost(a, va) {
var score = { va: va, pairs:0, redundant:0 };
for (var c = 0; c < N; c++) {
var count;
if ( c < a ) {
count = occurs[offset(c,a,value_index[c],va)];
} else if ( c > a ) {
var j = offset(a,c,va,0),
end = j + params[c].n;
for (count = occ... | javascript | function calcCost(a, va) {
var score = { va: va, pairs:0, redundant:0 };
for (var c = 0; c < N; c++) {
var count;
if ( c < a ) {
count = occurs[offset(c,a,value_index[c],va)];
} else if ( c > a ) {
var j = offset(a,c,va,0),
end = j + params[c].n;
for (count = occ... | [
"function",
"calcCost",
"(",
"a",
",",
"va",
")",
"{",
"var",
"score",
"=",
"{",
"va",
":",
"va",
",",
"pairs",
":",
"0",
",",
"redundant",
":",
"0",
"}",
";",
"for",
"(",
"var",
"c",
"=",
"0",
";",
"c",
"<",
"N",
";",
"c",
"++",
")",
"{"... | Calculates a cost function for the case where for
property 'a' the value 'va' is taken.
The calculated cost consists of two parts:
- pairs : number of newly addressed unique pairs
- redundant : number of redundantly added pairs
@param a
@param va
@return | [
"Calculates",
"a",
"cost",
"function",
"for",
"the",
"case",
"where",
"for",
"property",
"a",
"the",
"value",
"va",
"is",
"taken",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/QUnitUtils.js#L1001-L1022 | train | Calculate cost of a value | [
30522,
3853,
10250,
21408,
3367,
1006,
1037,
1010,
12436,
1007,
1063,
13075,
3556,
1027,
1063,
12436,
1024,
12436,
1010,
7689,
1024,
1014,
1010,
21707,
1024,
1014,
1065,
1025,
2005,
1006,
13075,
1039,
1027,
1014,
1025,
1039,
1026,
30524,
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/events/isSpecialKey.js | isArrowKey | function isArrowKey(oEvent) {
var sKey = oEvent.key; // based on KeyBoardEvent.key (https://www.w3.org/TR/uievents/) and (https://www.w3.org/TR/uievents-key/)
// MS special case: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/
return (sKey === 'ArrowLeft') ||
(sKey === 'Arrow... | javascript | function isArrowKey(oEvent) {
var sKey = oEvent.key; // based on KeyBoardEvent.key (https://www.w3.org/TR/uievents/) and (https://www.w3.org/TR/uievents-key/)
// MS special case: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/
return (sKey === 'ArrowLeft') ||
(sKey === 'Arrow... | [
"function",
"isArrowKey",
"(",
"oEvent",
")",
"{",
"var",
"sKey",
"=",
"oEvent",
".",
"key",
";",
"// based on KeyBoardEvent.key (https://www.w3.org/TR/uievents/) and (https://www.w3.org/TR/uievents-key/)",
"// MS special case: https://developer.microsoft.com/en-us/microsoft-edge/platfor... | Detect whether the pressed key is a navigation key.
Navigation keys are considered:
ARROW_LEFT, ARROW_UP, ARROW_RIGHT, ARROW_DOWN
@param {jQuery.Event} oEvent The event object of the <code>keydown</code>, <code>keyup</code> or <code>keypress</code> events.
@static
@returns {boolean} True if a arrow key was pressed | [
"Detect",
"whether",
"the",
"pressed",
"key",
"is",
"a",
"navigation",
"key",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/isSpecialKey.js#L60-L72 | train | Checks if the event is an arrow key | [
30522,
3853,
18061,
28597,
14839,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
15315,
3240,
1027,
1051,
18697,
3372,
1012,
3145,
1025,
1013,
1013,
2241,
2006,
9019,
18697,
3372,
1012,
3145,
1006,
16770,
1024,
1013,
1013,
7479,
1012,
1059,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | scripts/lib/translator.js | each | function each(obj, iter) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) iter(key, obj[key]);
}
} | javascript | function each(obj, iter) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) iter(key, obj[key]);
}
} | [
"function",
"each",
"(",
"obj",
",",
"iter",
")",
"{",
"for",
"(",
"var",
"key",
"in",
"obj",
")",
"{",
"if",
"(",
"obj",
".",
"hasOwnProperty",
"(",
"key",
")",
")",
"iter",
"(",
"key",
",",
"obj",
"[",
"key",
"]",
")",
";",
"}",
"}"
] | /* A couple of utility methods | [
"/",
"*",
"A",
"couple",
"of",
"utility",
"methods"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/scripts/lib/translator.js#L3-L7 | train | Iterate over an object. | [
30522,
3853,
2169,
1006,
27885,
3501,
1010,
2009,
2121,
1007,
1063,
2005,
1006,
13075,
3145,
1999,
27885,
3501,
1007,
1063,
2065,
1006,
27885,
3501,
1012,
2038,
12384,
21572,
4842,
3723,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js | function(val) {
return new Color(
val ? val : null,
this.options.colorSelectors,
this.options.fallbackColor ? this.options.fallbackColor : this.color,
this.options.fallbackFormat,
this.options.hexNumberSignPrefix
);
} | javascript | function(val) {
return new Color(
val ? val : null,
this.options.colorSelectors,
this.options.fallbackColor ? this.options.fallbackColor : this.color,
this.options.fallbackFormat,
this.options.hexNumberSignPrefix
);
} | [
"function",
"(",
"val",
")",
"{",
"return",
"new",
"Color",
"(",
"val",
"?",
"val",
":",
"null",
",",
"this",
".",
"options",
".",
"colorSelectors",
",",
"this",
".",
"options",
".",
"fallbackColor",
"?",
"this",
".",
"options",
".",
"fallbackColor",
"... | Creates a new color using the instance options
@protected
@param {String} val
@returns {Color} | [
"Creates",
"a",
"new",
"color",
"using",
"the",
"instance",
"options"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js#L1081-L1089 | train | Returns the color object for the current record | [
30522,
3853,
1006,
11748,
1007,
1063,
2709,
2047,
3609,
1006,
11748,
1029,
11748,
1024,
19701,
1010,
2023,
1012,
7047,
1012,
6087,
12260,
24817,
1010,
2023,
1012,
7047,
1012,
2991,
5963,
18717,
1029,
2023,
1012,
7047,
1012,
2991,
5963,
1871... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/sessionstore.js | aboutSessionRestore_getElement | function aboutSessionRestore_getElement(spec) {
var elem = null;
switch(spec.type) {
case "button_restoreSession":
elem = new elementslib.ID(this._controller.tabs.activeTab, "errorTryAgain");
break;
case "error_longDesc":
elem = new elementslib.ID(this._controller.tabs.activ... | javascript | function aboutSessionRestore_getElement(spec) {
var elem = null;
switch(spec.type) {
case "button_restoreSession":
elem = new elementslib.ID(this._controller.tabs.activeTab, "errorTryAgain");
break;
case "error_longDesc":
elem = new elementslib.ID(this._controller.tabs.activ... | [
"function",
"aboutSessionRestore_getElement",
"(",
"spec",
")",
"{",
"var",
"elem",
"=",
"null",
";",
"switch",
"(",
"spec",
".",
"type",
")",
"{",
"case",
"\"button_restoreSession\"",
":",
"elem",
"=",
"new",
"elementslib",
".",
"ID",
"(",
"this",
".",
"_... | Retrieve an UI element based on the given spec
@param {object} spec
Information of the UI element which should be retrieved
type: General type information
subtype: Specific element or property
value: Value of the element or property
@returns Element which has been created
@type {ElemBase} | [
"Retrieve",
"an",
"UI",
"element",
"based",
"on",
"the",
"given",
"spec"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/sessionstore.js#L117-L144 | train | Get the element that is used to restore the session | [
30522,
3853,
2055,
8583,
10992,
28533,
5686,
1035,
2131,
12260,
3672,
1006,
28699,
1007,
1063,
13075,
3449,
6633,
1027,
19701,
1025,
6942,
1006,
28699,
1012,
2828,
1007,
1063,
2553,
1000,
6462,
1035,
9239,
8583,
10992,
1000,
1024,
3449,
663... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
heyui/heyui | src/plugins/popper/index.js | Popper | function Popper(reference, popper) {
var _this = this;
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
classCallCheck(this, Popper);
this.scheduleUpdate = function () {
return requestAnimation(_this.update);
};
// make update() debounced, so that it... | javascript | function Popper(reference, popper) {
var _this = this;
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
classCallCheck(this, Popper);
this.scheduleUpdate = function () {
return requestAnimation(_this.update);
};
// make update() debounced, so that it... | [
"function",
"Popper",
"(",
"reference",
",",
"popper",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"var",
"options",
"=",
"arguments",
".",
"length",
">",
"2",
"&&",
"arguments",
"[",
"2",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"2",
"]",
":"... | Create a new Popper.js instance
@class Popper
@param {HTMLElement|referenceObject} reference - The reference element used to position the popper
@param {HTMLElement} popper - The HTML element used as popper.
@param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
@return {Obj... | [
"Create",
"a",
"new",
"Popper",
".",
"js",
"instance"
] | d5405d27d994151b676eb91c12b389316d7f6679 | https://github.com/heyui/heyui/blob/d5405d27d994151b676eb91c12b389316d7f6679/src/plugins/popper/index.js#L2433-L2473 | train | Construct a new Popper instance | [
30522,
3853,
3769,
4842,
1006,
4431,
1010,
3769,
4842,
1007,
1063,
13075,
1035,
2023,
1027,
2023,
1025,
13075,
7047,
1027,
9918,
1012,
3091,
1028,
1016,
1004,
1004,
9918,
1031,
1016,
1033,
999,
1027,
1027,
6151,
28344,
1029,
9918,
1031,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js | function (oInterface, oPathValue) {
var oName = Basics.descend(oPathValue, "Name", "string"),
oParameters = Basics.descend(oPathValue, "Parameters");
switch (oName.value) {
case "odata.concat": // 14.5.3.1.1 Function odata.concat
return Expression.concat(oInterface, oParameters);
case "odata.fil... | javascript | function (oInterface, oPathValue) {
var oName = Basics.descend(oPathValue, "Name", "string"),
oParameters = Basics.descend(oPathValue, "Parameters");
switch (oName.value) {
case "odata.concat": // 14.5.3.1.1 Function odata.concat
return Expression.concat(oInterface, oParameters);
case "odata.fil... | [
"function",
"(",
"oInterface",
",",
"oPathValue",
")",
"{",
"var",
"oName",
"=",
"Basics",
".",
"descend",
"(",
"oPathValue",
",",
"\"Name\"",
",",
"\"string\"",
")",
",",
"oParameters",
"=",
"Basics",
".",
"descend",
"(",
"oPathValue",
",",
"\"Parameters\""... | Handling of "14.5.3 Expression edm:Apply".
@param {sap.ui.core.util.XMLPreprocessor.IContext|sap.ui.model.Context} oInterface
the callback interface related to the current formatter call
@param {object} oPathValue
path and value information pointing to the apply (see Expression object)
@returns {object}
the result obj... | [
"Handling",
"of",
"14",
".",
"5",
".",
"3",
"Expression",
"edm",
":",
"Apply",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L164-L178 | train | returns the function that is defined in the path | [
30522,
3853,
1006,
1051,
18447,
2121,
12172,
1010,
6728,
8988,
10175,
5657,
1007,
1063,
13075,
2006,
14074,
1027,
24078,
1012,
18855,
1006,
6728,
8988,
10175,
5657,
1010,
1000,
2171,
1000,
1010,
1000,
5164,
1000,
1007,
1010,
6728,
5400,
228... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
keplergl/kepler.gl | scripts/documentation.js | _appendActionToUpdaters | function _appendActionToUpdaters(node, actionMap) {
if (node.members && node.members.static.length) {
node.members.static = node.members.static.map(nd => _appendActionToUpdaters(nd, actionMap));
}
const updater = node.name;
const action = Object.values(actionMap)
.find(action => action.updaters.find(u... | javascript | function _appendActionToUpdaters(node, actionMap) {
if (node.members && node.members.static.length) {
node.members.static = node.members.static.map(nd => _appendActionToUpdaters(nd, actionMap));
}
const updater = node.name;
const action = Object.values(actionMap)
.find(action => action.updaters.find(u... | [
"function",
"_appendActionToUpdaters",
"(",
"node",
",",
"actionMap",
")",
"{",
"if",
"(",
"node",
".",
"members",
"&&",
"node",
".",
"members",
".",
"static",
".",
"length",
")",
"{",
"node",
".",
"members",
".",
"static",
"=",
"node",
".",
"members",
... | Add action to linked updaters
@param {Object} node
@param {Object} actionMap | [
"Add",
"action",
"to",
"linked",
"updaters"
] | 779238435707cc54335c2d00001e4b9334b314aa | https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/scripts/documentation.js#L143-L163 | train | Append action to updater list | [
30522,
3853,
1035,
10439,
10497,
18908,
3258,
24826,
17299,
24932,
2015,
1006,
13045,
1010,
2895,
2863,
2361,
1007,
1063,
2065,
1006,
13045,
1012,
2372,
1004,
1004,
13045,
1012,
2372,
1012,
10763,
1012,
3091,
1007,
1063,
13045,
1012,
2372,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | handleRename | function handleRename(response) {
if (response.error) {
EditorManager.getActiveEditor().displayErrorMessageAtCursor(response.error);
return;
}
var file = response.file,
offset = response.offset;
var $deferredFindRefs = getPendingRequest(file, offset... | javascript | function handleRename(response) {
if (response.error) {
EditorManager.getActiveEditor().displayErrorMessageAtCursor(response.error);
return;
}
var file = response.file,
offset = response.offset;
var $deferredFindRefs = getPendingRequest(file, offset... | [
"function",
"handleRename",
"(",
"response",
")",
"{",
"if",
"(",
"response",
".",
"error",
")",
"{",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
".",
"displayErrorMessageAtCursor",
"(",
"response",
".",
"error",
")",
";",
"return",
";",
"}",
"var",
... | Handle the response from the tern node domain when
it responds with the references
@param response - the response from the node domain | [
"Handle",
"the",
"response",
"from",
"the",
"tern",
"node",
"domain",
"when",
"it",
"responds",
"with",
"the",
"references"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L386-L401 | train | Handle rename request | [
30522,
3853,
28213,
8189,
4168,
1006,
3433,
1007,
1063,
2065,
1006,
3433,
1012,
7561,
1007,
1063,
3559,
24805,
4590,
1012,
2131,
19620,
2098,
15660,
1006,
1007,
1012,
4653,
2121,
29165,
7834,
3736,
3351,
4017,
10841,
25301,
2099,
1006,
3433... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | _endDownload | function _endDownload(downloadId, error) {
var downloadInfo = pendingDownloads[downloadId];
delete pendingDownloads[downloadId];
if (error) {
// Abort the download if still pending
// Note that this will trigger response's "end" event
downloadInfo.request.abort();
// Clean ... | javascript | function _endDownload(downloadId, error) {
var downloadInfo = pendingDownloads[downloadId];
delete pendingDownloads[downloadId];
if (error) {
// Abort the download if still pending
// Note that this will trigger response's "end" event
downloadInfo.request.abort();
// Clean ... | [
"function",
"_endDownload",
"(",
"downloadId",
",",
"error",
")",
"{",
"var",
"downloadInfo",
"=",
"pendingDownloads",
"[",
"downloadId",
"]",
";",
"delete",
"pendingDownloads",
"[",
"downloadId",
"]",
";",
"if",
"(",
"error",
")",
"{",
"// Abort the download if... | Wrap up after the given download has terminated (successfully or not). Closes connections, calls back the
client's callback, and IF there was an error, delete any partially-downloaded file.
@param {string} downloadId Unique id originally passed to _cmdDownloadFile()
@param {?string} error If null, download was treated... | [
"Wrap",
"up",
"after",
"the",
"given",
"download",
"has",
"terminated",
"(",
"successfully",
"or",
"not",
")",
".",
"Closes",
"connections",
"calls",
"back",
"the",
"client",
"s",
"callback",
"and",
"IF",
"there",
"was",
"an",
"error",
"delete",
"any",
"pa... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L356-L381 | train | End the download | [
30522,
3853,
1035,
2203,
7698,
11066,
1006,
8816,
3593,
1010,
7561,
1007,
1063,
13075,
8816,
2378,
14876,
1027,
14223,
7698,
11066,
2015,
1031,
8816,
3593,
1033,
1025,
3972,
12870,
14223,
7698,
11066,
2015,
1031,
8816,
3593,
1033,
1025,
206... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.m/src/sap/m/GrowingEnablement.js | function(sChangeReason) {
this._bLoading = false;
this._updateTriggerDelayed(false);
this._oControl.onAfterPageLoaded(this.getInfo(), sChangeReason);
// After the data has been loaded, restore the busy indicator handling of the parent control.
if (this._oControl.setEnableBusyIndicator) {
this._oCont... | javascript | function(sChangeReason) {
this._bLoading = false;
this._updateTriggerDelayed(false);
this._oControl.onAfterPageLoaded(this.getInfo(), sChangeReason);
// After the data has been loaded, restore the busy indicator handling of the parent control.
if (this._oControl.setEnableBusyIndicator) {
this._oCont... | [
"function",
"(",
"sChangeReason",
")",
"{",
"this",
".",
"_bLoading",
"=",
"false",
";",
"this",
".",
"_updateTriggerDelayed",
"(",
"false",
")",
";",
"this",
".",
"_oControl",
".",
"onAfterPageLoaded",
"(",
"this",
".",
"getInfo",
"(",
")",
",",
"sChangeR... | called after new page loaded | [
"called",
"after",
"new",
"page",
"loaded"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/GrowingEnablement.js#L200-L209 | train | Called after the page has been loaded | [
30522,
3853,
1006,
8040,
18003,
7869,
3022,
2239,
1007,
1063,
2023,
1012,
1035,
1038,
18570,
1027,
6270,
1025,
2023,
1012,
1035,
10651,
18886,
13327,
9247,
4710,
2098,
1006,
6270,
1007,
1025,
2023,
1012,
1035,
1051,
8663,
13181,
2140,
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... | |
markdown-it/markdown-it | lib/index.js | MarkdownIt | function MarkdownIt(presetName, options) {
if (!(this instanceof MarkdownIt)) {
return new MarkdownIt(presetName, options);
}
if (!options) {
if (!utils.isString(presetName)) {
options = presetName || {};
presetName = 'default';
}
}
/**
* MarkdownIt#inline -> ParserInline
*
... | javascript | function MarkdownIt(presetName, options) {
if (!(this instanceof MarkdownIt)) {
return new MarkdownIt(presetName, options);
}
if (!options) {
if (!utils.isString(presetName)) {
options = presetName || {};
presetName = 'default';
}
}
/**
* MarkdownIt#inline -> ParserInline
*
... | [
"function",
"MarkdownIt",
"(",
"presetName",
",",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"MarkdownIt",
")",
")",
"{",
"return",
"new",
"MarkdownIt",
"(",
"presetName",
",",
"options",
")",
";",
"}",
"if",
"(",
"!",
"options",
"... | class MarkdownIt
Main parser/renderer class.
##### Usage
```javascript
// node.js, "classic" way:
var MarkdownIt = require('markdown-it'),
md = new MarkdownIt();
var result = md.render('# markdown-it rulezz!');
// node.js, the same, but with sugar:
var md = require('markdown-it')();
var result = md.render('# markdo... | [
"class",
"MarkdownIt"
] | ba6830ba13fb92953a91fb90318964ccd15b82c4 | https://github.com/markdown-it/markdown-it/blob/ba6830ba13fb92953a91fb90318964ccd15b82c4/lib/index.js#L221-L348 | train | MarkdownIt constructor. | [
30522,
3853,
2928,
7698,
4183,
1006,
3653,
13462,
18442,
1010,
7047,
1007,
1063,
30524,
1065,
2065,
1006,
999,
7047,
1007,
1063,
2065,
1006,
999,
21183,
12146,
1012,
26354,
18886,
3070,
1006,
3653,
13462,
18442,
1007,
1007,
1063,
7047,
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... |
MithrilJS/mithril.js | mithril.js | makeLisIndices | function makeLisIndices(a) {
var p = a.slice()
var result = []
result.push(0)
var u
var v
for (var i = 0, il = a.length; i < il; ++i) {
if (a[i] === -1) {
continue
}
var j = result[result.length - 1]
if (a[j] < a[i]) {
p[i] = j
result.push(i)
continue
}
u = 0
v = result.... | javascript | function makeLisIndices(a) {
var p = a.slice()
var result = []
result.push(0)
var u
var v
for (var i = 0, il = a.length; i < il; ++i) {
if (a[i] === -1) {
continue
}
var j = result[result.length - 1]
if (a[j] < a[i]) {
p[i] = j
result.push(i)
continue
}
u = 0
v = result.... | [
"function",
"makeLisIndices",
"(",
"a",
")",
"{",
"var",
"p",
"=",
"a",
".",
"slice",
"(",
")",
"var",
"result",
"=",
"[",
"]",
"result",
".",
"push",
"(",
"0",
")",
"var",
"u",
"var",
"v",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"il",
"=",
... | Lifted from ivi https://github.com/ivijs/ivi/ takes a list of unique numbers (-1 is special and can occur multiple times) and returns an array with the indices of the items that are part of the longest increasing subsequece | [
"Lifted",
"from",
"ivi",
"https",
":",
"//",
"github",
".",
"com",
"/",
"ivijs",
"/",
"ivi",
"/",
"takes",
"a",
"list",
"of",
"unique",
"numbers",
"(",
"-",
"1",
"is",
"special",
"and",
"can",
"occur",
"multiple",
"times",
")",
"and",
"returns",
"an"... | 6d36fe09d129928c6b460720e08d9ed321fcd62b | https://github.com/MithrilJS/mithril.js/blob/6d36fe09d129928c6b460720e08d9ed321fcd62b/mithril.js#L974-L1015 | train | Creates an array of indices for the given array. | [
30522,
3853,
2191,
6856,
22254,
23522,
1006,
1037,
1007,
1063,
13075,
1052,
1027,
1037,
1012,
14704,
1006,
1007,
13075,
2765,
1027,
1031,
1033,
2765,
1012,
5245,
1006,
1014,
1007,
13075,
1057,
13075,
1058,
2005,
1006,
13075,
1045,
1027,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
shipshapecode/shepherd | src/js/utils/dom.js | getElementForStep | function getElementForStep(step) {
const { options: { attachTo } } = step;
if (!attachTo) {
return null;
}
const type = typeof attachTo;
let element;
if (type === 'string') {
element = getElementFromString(attachTo);
} else if (type === 'object') {
element = getElementFromObject(attachTo);... | javascript | function getElementForStep(step) {
const { options: { attachTo } } = step;
if (!attachTo) {
return null;
}
const type = typeof attachTo;
let element;
if (type === 'string') {
element = getElementFromString(attachTo);
} else if (type === 'object') {
element = getElementFromObject(attachTo);... | [
"function",
"getElementForStep",
"(",
"step",
")",
"{",
"const",
"{",
"options",
":",
"{",
"attachTo",
"}",
"}",
"=",
"step",
";",
"if",
"(",
"!",
"attachTo",
")",
"{",
"return",
"null",
";",
"}",
"const",
"type",
"=",
"typeof",
"attachTo",
";",
"let... | Return the element for a step
@method getElementForStep
@param step step the step to get an element for
@returns {Element} the element for this step
@private | [
"Return",
"the",
"element",
"for",
"a",
"step"
] | 0cb1c63fb07b58796358f6d33da5f6405e2b05f4 | https://github.com/shipshapecode/shepherd/blob/0cb1c63fb07b58796358f6d33da5f6405e2b05f4/src/js/utils/dom.js#L40-L60 | train | Get element for step | [
30522,
3853,
2131,
12260,
3672,
29278,
13473,
2361,
1006,
3357,
1007,
1063,
9530,
3367,
1063,
7047,
1024,
1063,
22476,
3406,
1065,
1065,
1027,
3357,
1025,
2065,
1006,
999,
22476,
3406,
1007,
1063,
2709,
19701,
1025,
1065,
9530,
3367,
2828,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/node/FindInFilesDomain.js | init | function init(domainManager) {
if (!domainManager.hasDomain("FindInFiles")) {
domainManager.registerDomain("FindInFiles", {major: 0, minor: 1});
}
_domainManager = domainManager;
domainManager.registerCommand(
"FindInFiles", // domain name
"doSearch", // command name
... | javascript | function init(domainManager) {
if (!domainManager.hasDomain("FindInFiles")) {
domainManager.registerDomain("FindInFiles", {major: 0, minor: 1});
}
_domainManager = domainManager;
domainManager.registerCommand(
"FindInFiles", // domain name
"doSearch", // command name
... | [
"function",
"init",
"(",
"domainManager",
")",
"{",
"if",
"(",
"!",
"domainManager",
".",
"hasDomain",
"(",
"\"FindInFiles\"",
")",
")",
"{",
"domainManager",
".",
"registerDomain",
"(",
"\"FindInFiles\"",
",",
"{",
"major",
":",
"0",
",",
"minor",
":",
"1... | Initialize the test domain with commands and events related to find in files.
@param {DomainManager} domainManager The DomainManager for the find in files domain "FindInFiles" | [
"Initialize",
"the",
"test",
"domain",
"with",
"commands",
"and",
"events",
"related",
"to",
"find",
"in",
"files",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L571-L683 | train | Initializes the node domain manager | [
30522,
3853,
1999,
4183,
1006,
5884,
24805,
4590,
1007,
1063,
2065,
1006,
999,
5884,
24805,
4590,
1012,
2038,
9527,
8113,
1006,
1000,
2424,
2378,
8873,
4244,
1000,
1007,
1007,
1063,
5884,
24805,
4590,
1012,
4236,
9527,
8113,
1006,
1000,
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... |
eslint/eslint | lib/cli-engine.js | createRuleDeprecationWarnings | function createRuleDeprecationWarnings(usedRules, loadedRules) {
const usedDeprecatedRules = [];
usedRules.forEach(name => {
const loadedRule = loadedRules.get(name);
if (loadedRule && loadedRule.meta && loadedRule.meta.deprecated) {
const deprecatedRule = { ruleId: name };
... | javascript | function createRuleDeprecationWarnings(usedRules, loadedRules) {
const usedDeprecatedRules = [];
usedRules.forEach(name => {
const loadedRule = loadedRules.get(name);
if (loadedRule && loadedRule.meta && loadedRule.meta.deprecated) {
const deprecatedRule = { ruleId: name };
... | [
"function",
"createRuleDeprecationWarnings",
"(",
"usedRules",
",",
"loadedRules",
")",
"{",
"const",
"usedDeprecatedRules",
"=",
"[",
"]",
";",
"usedRules",
".",
"forEach",
"(",
"name",
"=>",
"{",
"const",
"loadedRule",
"=",
"loadedRules",
".",
"get",
"(",
"n... | Produces rule warnings (i.e. deprecation) from configured rules
@param {(Array<string>|Set<string>)} usedRules - Rules configured
@param {Map} loadedRules - Map of loaded rules
@returns {Array<Object>} Contains rule warnings
@private | [
"Produces",
"rule",
"warnings",
"(",
"i",
".",
"e",
".",
"deprecation",
")",
"from",
"configured",
"rules"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/cli-engine.js#L304-L323 | train | Create deprecated rules | [
30522,
3853,
3443,
6820,
3709,
13699,
2890,
10719,
9028,
5582,
2015,
1006,
2109,
6820,
4244,
1010,
8209,
6820,
4244,
1007,
1063,
9530,
3367,
2109,
3207,
28139,
12921,
6820,
4244,
1027,
1031,
1033,
1025,
2109,
6820,
4244,
1012,
18921,
6776,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
testing-library/dom-testing-library | src/query-helpers.js | makeSingleQuery | function makeSingleQuery(allQuery, getMultipleError) {
return (container, ...args) => {
const els = allQuery(container, ...args)
if (els.length > 1) {
throw getMultipleElementsFoundError(
getMultipleError(container, ...args),
container,
)
}
return els[0] || null
}
} | javascript | function makeSingleQuery(allQuery, getMultipleError) {
return (container, ...args) => {
const els = allQuery(container, ...args)
if (els.length > 1) {
throw getMultipleElementsFoundError(
getMultipleError(container, ...args),
container,
)
}
return els[0] || null
}
} | [
"function",
"makeSingleQuery",
"(",
"allQuery",
",",
"getMultipleError",
")",
"{",
"return",
"(",
"container",
",",
"...",
"args",
")",
"=>",
"{",
"const",
"els",
"=",
"allQuery",
"(",
"container",
",",
"...",
"args",
")",
"if",
"(",
"els",
".",
"length"... | this accepts a query function and returns a function which throws an error if more than one elements is returned, otherwise it returns the first element or null | [
"this",
"accepts",
"a",
"query",
"function",
"and",
"returns",
"a",
"function",
"which",
"throws",
"an",
"error",
"if",
"more",
"than",
"one",
"elements",
"is",
"returned",
"otherwise",
"it",
"returns",
"the",
"first",
"element",
"or",
"null"
] | fcb2cbcffb7aff6ecff3be8731168c86eee82ce1 | https://github.com/testing-library/dom-testing-library/blob/fcb2cbcffb7aff6ecff3be8731168c86eee82ce1/src/query-helpers.js#L68-L79 | train | Returns a function that returns a single element if there are multiple elements | [
30522,
3853,
3084,
2075,
2571,
4226,
2854,
1006,
2035,
4226,
2854,
1010,
2131,
12274,
7096,
11514,
10559,
18933,
2099,
1007,
1063,
2709,
1006,
11661,
1010,
1012,
1012,
1012,
12098,
5620,
1007,
1027,
1028,
1063,
9530,
3367,
3449,
2015,
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... |
SheetJS/js-xlsx | xlsx.js | write_Blxf | function write_Blxf(data, o) {
if(!o) o = new_buf(10);
o.write_shift(1, 0); /* dg */
o.write_shift(1, 0);
o.write_shift(4, 0); /* color */
o.write_shift(4, 0); /* color */
return o;
} | javascript | function write_Blxf(data, o) {
if(!o) o = new_buf(10);
o.write_shift(1, 0); /* dg */
o.write_shift(1, 0);
o.write_shift(4, 0); /* color */
o.write_shift(4, 0); /* color */
return o;
} | [
"function",
"write_Blxf",
"(",
"data",
",",
"o",
")",
"{",
"if",
"(",
"!",
"o",
")",
"o",
"=",
"new_buf",
"(",
"10",
")",
";",
"o",
".",
"write_shift",
"(",
"1",
",",
"0",
")",
";",
"/* dg */",
"o",
".",
"write_shift",
"(",
"1",
",",
"0",
")"... | /* [MS-XLSB] 2.5.4 Blxf TODO | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"5",
".",
"4",
"Blxf",
"TODO"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L9181-L9188 | train | write blxf | [
30522,
3853,
4339,
1035,
1038,
2140,
2595,
2546,
1006,
2951,
1010,
1051,
1007,
1063,
2065,
1006,
999,
1051,
1007,
1051,
1027,
2047,
1035,
20934,
2546,
1006,
2184,
1007,
1025,
1051,
1012,
4339,
1035,
5670,
1006,
1015,
1010,
1014,
1007,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js | findAllExpressions | function findAllExpressions(parentBlockStatement, expn, text) {
var doc = session.editor.document,
obj = {},
expns = [];
// find all references of the expression
obj[expn.type] = function(node) {
if (text === doc.getText().substr(node.start, node.end - no... | javascript | function findAllExpressions(parentBlockStatement, expn, text) {
var doc = session.editor.document,
obj = {},
expns = [];
// find all references of the expression
obj[expn.type] = function(node) {
if (text === doc.getText().substr(node.start, node.end - no... | [
"function",
"findAllExpressions",
"(",
"parentBlockStatement",
",",
"expn",
",",
"text",
")",
"{",
"var",
"doc",
"=",
"session",
".",
"editor",
".",
"document",
",",
"obj",
"=",
"{",
"}",
",",
"expns",
"=",
"[",
"]",
";",
"// find all references of the expre... | Find all expressions in the parentBlockStatement that are same as expn
@param {!ASTNode} parentBlockStatement
@param {!ASTNode} expn
@param {!string} text - text of the expression
@return {!Array.<ASTNode>} | [
"Find",
"all",
"expressions",
"in",
"the",
"parentBlockStatement",
"that",
"are",
"same",
"as",
"expn"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js#L106-L120 | train | find all expressions in the block | [
30522,
3853,
2424,
24164,
2595,
20110,
8496,
1006,
6687,
23467,
9153,
18532,
4765,
1010,
4654,
2361,
2078,
1010,
3793,
1007,
1063,
13075,
9986,
1027,
5219,
1012,
3559,
1012,
6254,
1010,
27885,
3501,
1027,
1063,
1065,
1010,
4654,
2361,
3619,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/PreferencesManager.js | _adjustScopeOrderForProject | function _adjustScopeOrderForProject(scopeOrder, includeProject) {
var hasProject = scopeOrder.indexOf("project") > -1;
if (hasProject === includeProject) {
return scopeOrder;
}
var newScopeOrder;
if (includeProject) {
var before = scopeOrder.indexOf("u... | javascript | function _adjustScopeOrderForProject(scopeOrder, includeProject) {
var hasProject = scopeOrder.indexOf("project") > -1;
if (hasProject === includeProject) {
return scopeOrder;
}
var newScopeOrder;
if (includeProject) {
var before = scopeOrder.indexOf("u... | [
"function",
"_adjustScopeOrderForProject",
"(",
"scopeOrder",
",",
"includeProject",
")",
"{",
"var",
"hasProject",
"=",
"scopeOrder",
".",
"indexOf",
"(",
"\"project\"",
")",
">",
"-",
"1",
";",
"if",
"(",
"hasProject",
"===",
"includeProject",
")",
"{",
"ret... | @private
Adjusts scopeOrder to have the project Scope if necessary.
Returns a new array if changes are needed, otherwise returns
the original array.
@param {Array.<string>} scopeOrder initial scopeOrder
@param {boolean} includeProject Whether the project Scope should be included
@return {Array.<string>} array with or... | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesManager.js#L157-L178 | train | Adjust scopeOrder for project | [
30522,
3853,
1035,
14171,
26127,
8551,
2121,
29278,
21572,
20614,
1006,
9531,
8551,
2121,
1010,
2421,
21572,
20614,
1007,
1063,
13075,
2038,
21572,
20614,
1027,
9531,
8551,
2121,
1012,
5950,
11253,
1006,
1000,
2622,
1000,
1007,
1028,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
vuejs/vuepress | packages/@vuepress/core/lib/node/dev/index.js | resolveHost | function resolveHost (host) {
const defaultHost = '0.0.0.0'
host = host || defaultHost
const displayHost = host === defaultHost
? 'localhost'
: host
return {
displayHost,
host
}
} | javascript | function resolveHost (host) {
const defaultHost = '0.0.0.0'
host = host || defaultHost
const displayHost = host === defaultHost
? 'localhost'
: host
return {
displayHost,
host
}
} | [
"function",
"resolveHost",
"(",
"host",
")",
"{",
"const",
"defaultHost",
"=",
"'0.0.0.0'",
"host",
"=",
"host",
"||",
"defaultHost",
"const",
"displayHost",
"=",
"host",
"===",
"defaultHost",
"?",
"'localhost'",
":",
"host",
"return",
"{",
"displayHost",
",",... | Resolve host.
@param {string} host user's host
@returns {{displayHost: string, host: string}} | [
"Resolve",
"host",
"."
] | 15784acc0cf2e87de3c147895b2c3977b0195d78 | https://github.com/vuejs/vuepress/blob/15784acc0cf2e87de3c147895b2c3977b0195d78/packages/@vuepress/core/lib/node/dev/index.js#L268-L278 | train | Resolve host to a node - network | [
30522,
3853,
10663,
15006,
2102,
1006,
3677,
1007,
1063,
9530,
3367,
12398,
15006,
2102,
1027,
1005,
1014,
1012,
1014,
1012,
1014,
1012,
1014,
1005,
3677,
1027,
3677,
1064,
1064,
12398,
15006,
2102,
9530,
3367,
4653,
15006,
2102,
1027,
3677... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | examples/player/player.js | function(per) {
var self = this;
// Get the Howl we want to manipulate.
var sound = self.playlist[self.index].howl;
// Convert the percent into a seek position.
if (sound.playing()) {
sound.seek(sound.duration() * per);
}
} | javascript | function(per) {
var self = this;
// Get the Howl we want to manipulate.
var sound = self.playlist[self.index].howl;
// Convert the percent into a seek position.
if (sound.playing()) {
sound.seek(sound.duration() * per);
}
} | [
"function",
"(",
"per",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Get the Howl we want to manipulate.",
"var",
"sound",
"=",
"self",
".",
"playlist",
"[",
"self",
".",
"index",
"]",
".",
"howl",
";",
"// Convert the percent into a seek position.",
"if",
"("... | Seek to a new position in the currently playing track.
@param {Number} per Percentage through the song to skip. | [
"Seek",
"to",
"a",
"new",
"position",
"in",
"the",
"currently",
"playing",
"track",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/player/player.js#L201-L211 | train | Set the current seek position | [
30522,
3853,
1006,
2566,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
1013,
1013,
2131,
1996,
22912,
2057,
2215,
2000,
17708,
1012,
13075,
2614,
1027,
2969,
1012,
2377,
9863,
1031,
2969,
1012,
5950,
1033,
1012,
22912,
1025,
1013,
1013,
10463,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ramda/ramda | source/internal/_objectIs.js | _objectIs | function _objectIs(a, b) {
// SameValue algorithm
if (a === b) { // Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return a !== 0 || 1 / a === 1 / b;
} else {
// Step 6.a: NaN == NaN
return a !== a && b !== b;
}
} | javascript | function _objectIs(a, b) {
// SameValue algorithm
if (a === b) { // Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return a !== 0 || 1 / a === 1 / b;
} else {
// Step 6.a: NaN == NaN
return a !== a && b !== b;
}
} | [
"function",
"_objectIs",
"(",
"a",
",",
"b",
")",
"{",
"// SameValue algorithm",
"if",
"(",
"a",
"===",
"b",
")",
"{",
"// Steps 1-5, 7-10",
"// Steps 6.b-6.e: +0 != -0",
"return",
"a",
"!==",
"0",
"||",
"1",
"/",
"a",
"===",
"1",
"/",
"b",
";",
"}",
"... | Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | [
"Based",
"on",
"https",
":",
"//",
"developer",
".",
"mozilla",
".",
"org",
"/",
"en",
"-",
"US",
"/",
"docs",
"/",
"Web",
"/",
"JavaScript",
"/",
"Reference",
"/",
"Global_Objects",
"/",
"Object",
"/",
"is"
] | 072d417a345e7087a95466a9825d43b6ca3a4941 | https://github.com/ramda/ramda/blob/072d417a345e7087a95466a9825d43b6ca3a4941/source/internal/_objectIs.js#L2-L11 | train | Check if an object is a object of the same type | [
30522,
3853,
1035,
4874,
2483,
1006,
1037,
1010,
1038,
1007,
1063,
1013,
1013,
2168,
10175,
5657,
9896,
2065,
1006,
1037,
1027,
1027,
1027,
1038,
1007,
1063,
1013,
1013,
4084,
1015,
1011,
1019,
1010,
1021,
1011,
2184,
1013,
1013,
4084,
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/ODataTreeBindingFlat.js | function (oNode, bIgnore, oParent, iPositionInParent, oIgnoreRemoveForNode) {
// ignore node if it was already mapped or is removed (except if it was reinserted, denoted by oIgnoreRemoveForNode)
if (!bIgnore) {
if (!oNode.nodeState.removed || oIgnoreRemoveForNode == oNode) {
fnMap(oNode, oRecursionBreake... | javascript | function (oNode, bIgnore, oParent, iPositionInParent, oIgnoreRemoveForNode) {
// ignore node if it was already mapped or is removed (except if it was reinserted, denoted by oIgnoreRemoveForNode)
if (!bIgnore) {
if (!oNode.nodeState.removed || oIgnoreRemoveForNode == oNode) {
fnMap(oNode, oRecursionBreake... | [
"function",
"(",
"oNode",
",",
"bIgnore",
",",
"oParent",
",",
"iPositionInParent",
",",
"oIgnoreRemoveForNode",
")",
"{",
"// ignore node if it was already mapped or is removed (except if it was reinserted, denoted by oIgnoreRemoveForNode)",
"if",
"(",
"!",
"bIgnore",
")",
"{"... | Recursive Tree Traversal
@param {object} oNode the current node
@param {boolean} bIgnore a flag to indicate if the node should be mapped
@param {object} oParent the parent node of oNode
@param {int} iPositionInParent the position of oNode in the children-array of oParent | [
"Recursive",
"Tree",
"Traversal"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/ODataTreeBindingFlat.js#L354-L391 | train | Traverse the tree | [
30522,
3853,
1006,
21058,
3207,
1010,
2502,
12131,
2063,
1010,
6728,
12069,
3372,
1010,
12997,
19234,
2378,
19362,
4765,
1010,
1051,
23773,
5686,
28578,
21818,
29278,
3630,
3207,
1007,
1063,
1013,
1013,
8568,
13045,
2065,
2009,
2001,
2525,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Manifest.js | processObject | function processObject(oObject, fnCallback) {
for (var sKey in oObject) {
if (!oObject.hasOwnProperty(sKey)) {
continue;
}
var vValue = oObject[sKey];
switch (typeof vValue) {
case "object":
// ignore null objects
if (vValue) {
processObject(vValue, fnCallback);
}
break;
... | javascript | function processObject(oObject, fnCallback) {
for (var sKey in oObject) {
if (!oObject.hasOwnProperty(sKey)) {
continue;
}
var vValue = oObject[sKey];
switch (typeof vValue) {
case "object":
// ignore null objects
if (vValue) {
processObject(vValue, fnCallback);
}
break;
... | [
"function",
"processObject",
"(",
"oObject",
",",
"fnCallback",
")",
"{",
"for",
"(",
"var",
"sKey",
"in",
"oObject",
")",
"{",
"if",
"(",
"!",
"oObject",
".",
"hasOwnProperty",
"(",
"sKey",
")",
")",
"{",
"continue",
";",
"}",
"var",
"vValue",
"=",
... | Utility function to process strings in an object/array recursively
@param {object/Array} oObject Object or array that will be processed
@param {function} fnCallback function(oObject, sKey, sValue) to call for all strings. Use "oObject[sKey] = X" to change the value. | [
"Utility",
"function",
"to",
"process",
"strings",
"in",
"an",
"object",
"/",
"array",
"recursively"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Manifest.js#L54-L74 | train | processObject - process an object | [
30522,
3853,
2832,
16429,
20614,
1006,
1051,
16429,
20614,
1010,
1042,
20909,
3363,
5963,
1007,
1063,
2005,
1006,
13075,
15315,
3240,
1999,
1051,
16429,
20614,
1007,
1063,
2065,
1006,
999,
1051,
16429,
20614,
1012,
2038,
12384,
21572,
4842,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
NervJS/taro | packages/taro-h5/src/api/createSelectorQuery/index.js | queryBat | function queryBat (queue, cb) {
const res = []
queue.forEach(item => {
const { selector, single, fields, component } = item
// selector 的容器节点
/* eslint-disable */
const container = (
component !== null ?
(Nerv.findDOMNode(component) || document) :
document
)
/* eslint-... | javascript | function queryBat (queue, cb) {
const res = []
queue.forEach(item => {
const { selector, single, fields, component } = item
// selector 的容器节点
/* eslint-disable */
const container = (
component !== null ?
(Nerv.findDOMNode(component) || document) :
document
)
/* eslint-... | [
"function",
"queryBat",
"(",
"queue",
",",
"cb",
")",
"{",
"const",
"res",
"=",
"[",
"]",
"queue",
".",
"forEach",
"(",
"item",
"=>",
"{",
"const",
"{",
"selector",
",",
"single",
",",
"fields",
",",
"component",
"}",
"=",
"item",
"// selector 的容器节点",
... | WXML节点信息API
@return {Object} SelectorQuery 对象实例 | [
"WXML节点信息API"
] | 274e76d731d7f158141287e31cbd51f092d472c5 | https://github.com/NervJS/taro/blob/274e76d731d7f158141287e31cbd51f092d472c5/packages/taro-h5/src/api/createSelectorQuery/index.js#L7-L47 | train | queryBat - query bat | [
30522,
3853,
23032,
14479,
1006,
24240,
1010,
17324,
1007,
1063,
9530,
3367,
24501,
1027,
1031,
1033,
24240,
1012,
18921,
6776,
1006,
8875,
1027,
1028,
1063,
9530,
3367,
1063,
27000,
1010,
2309,
1010,
4249,
1010,
6922,
1065,
1027,
8875,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/lines-around-comment.js | isCommentAtBlockEnd | function isCommentAtBlockEnd(token) {
return isCommentAtParentEnd(token, "ClassBody") || isCommentAtParentEnd(token, "BlockStatement") || isCommentAtParentEnd(token, "SwitchCase") || isCommentAtParentEnd(token, "SwitchStatement");
} | javascript | function isCommentAtBlockEnd(token) {
return isCommentAtParentEnd(token, "ClassBody") || isCommentAtParentEnd(token, "BlockStatement") || isCommentAtParentEnd(token, "SwitchCase") || isCommentAtParentEnd(token, "SwitchStatement");
} | [
"function",
"isCommentAtBlockEnd",
"(",
"token",
")",
"{",
"return",
"isCommentAtParentEnd",
"(",
"token",
",",
"\"ClassBody\"",
")",
"||",
"isCommentAtParentEnd",
"(",
"token",
",",
"\"BlockStatement\"",
")",
"||",
"isCommentAtParentEnd",
"(",
"token",
",",
"\"Swit... | Returns whether or not comments are at the block end or not.
@param {token} token The Comment token.
@returns {boolean} True if the comment is at block end. | [
"Returns",
"whether",
"or",
"not",
"comments",
"are",
"at",
"the",
"block",
"end",
"or",
"not",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/lines-around-comment.js#L236-L238 | train | Check if comment is at the end of block | [
30522,
3853,
2003,
9006,
3672,
4017,
23467,
10497,
1006,
19204,
1007,
1063,
2709,
2003,
9006,
3672,
4017,
19362,
15781,
4859,
1006,
19204,
1010,
1000,
2465,
23684,
1000,
1007,
1064,
1064,
2003,
9006,
3672,
4017,
19362,
15781,
4859,
1006,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
postcss/autoprefixer | lib/hacks/grid-utils.js | warnIfGridRowColumnExists | function warnIfGridRowColumnExists (decl, result) {
let rule = decl.parent
let decls = []
rule.walkDecls(/^grid-(row|column)/, d => {
if (!/-end$/.test(d.prop) && !/^span/.test(d.value)) {
decls.push(d)
}
})
if (decls.length > 0) {
decls.forEach(d => {
d.warn(result,
`You alrea... | javascript | function warnIfGridRowColumnExists (decl, result) {
let rule = decl.parent
let decls = []
rule.walkDecls(/^grid-(row|column)/, d => {
if (!/-end$/.test(d.prop) && !/^span/.test(d.value)) {
decls.push(d)
}
})
if (decls.length > 0) {
decls.forEach(d => {
d.warn(result,
`You alrea... | [
"function",
"warnIfGridRowColumnExists",
"(",
"decl",
",",
"result",
")",
"{",
"let",
"rule",
"=",
"decl",
".",
"parent",
"let",
"decls",
"=",
"[",
"]",
"rule",
".",
"walkDecls",
"(",
"/",
"^grid-(row|column)",
"/",
",",
"d",
"=>",
"{",
"if",
"(",
"!",... | warn user if both grid-area and grid-(row|column)
declarations are present in the same rule
@param {Declaration} decl
@param {Result} result
@return {void} | [
"warn",
"user",
"if",
"both",
"grid",
"-",
"area",
"and",
"grid",
"-",
"(",
"row|column",
")",
"declarations",
"are",
"present",
"in",
"the",
"same",
"rule"
] | 24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32 | https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L748-L765 | train | Warn if grid - row or grid - column declaration already present in the rule | [
30522,
3853,
11582,
10128,
16523,
3593,
10524,
25778,
2819,
2638,
9048,
12837,
1006,
11703,
2140,
1010,
2765,
1007,
1063,
2292,
3627,
1027,
11703,
2140,
1012,
6687,
2292,
11703,
4877,
1027,
1031,
1033,
3627,
1012,
3328,
3207,
20464,
2015,
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/rules/no-native-reassign.js | checkVariable | function checkVariable(variable) {
if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) {
variable.references.forEach(checkReference);
}
} | javascript | function checkVariable(variable) {
if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) {
variable.references.forEach(checkReference);
}
} | [
"function",
"checkVariable",
"(",
"variable",
")",
"{",
"if",
"(",
"variable",
".",
"writeable",
"===",
"false",
"&&",
"exceptions",
".",
"indexOf",
"(",
"variable",
".",
"name",
")",
"===",
"-",
"1",
")",
"{",
"variable",
".",
"references",
".",
"forEac... | Reports write references if a given variable is read-only builtin.
@param {Variable} variable - A variable to check.
@returns {void} | [
"Reports",
"write",
"references",
"if",
"a",
"given",
"variable",
"is",
"read",
"-",
"only",
"builtin",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-native-reassign.js#L79-L83 | train | Check if variable is writeable | [
30522,
3853,
4638,
10755,
19210,
1006,
8023,
1007,
1063,
2065,
1006,
8023,
1012,
4339,
3085,
1027,
1027,
1027,
6270,
1004,
1004,
11790,
1012,
5950,
11253,
1006,
8023,
1012,
2171,
1007,
1027,
1027,
1027,
1011,
1015,
1007,
1063,
8023,
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... |
getinsomnia/insomnia | packages/insomnia-importers/src/importers/openapi3.js | prepareBody | function prepareBody(endpointSchema) {
// request
const requestBody = endpointSchema.requestBody || {};
const content = requestBody.content || {};
const mimeTypes = Object.keys(content);
const isAvailable = m => mimeTypes.includes(m);
const supportedMimeType = SUPPORTED_MIME_TYPES.find(isAvailable);
if ... | javascript | function prepareBody(endpointSchema) {
// request
const requestBody = endpointSchema.requestBody || {};
const content = requestBody.content || {};
const mimeTypes = Object.keys(content);
const isAvailable = m => mimeTypes.includes(m);
const supportedMimeType = SUPPORTED_MIME_TYPES.find(isAvailable);
if ... | [
"function",
"prepareBody",
"(",
"endpointSchema",
")",
"{",
"// request",
"const",
"requestBody",
"=",
"endpointSchema",
".",
"requestBody",
"||",
"{",
"}",
";",
"const",
"content",
"=",
"requestBody",
".",
"content",
"||",
"{",
"}",
";",
"const",
"mimeTypes",... | Imports insomnia request body definitions, including data mock (if available)
If multiple types are available, the one for which an example can be generated will be selected first (i.e. application/json)
@param {Object} endpointSchema - OpenAPI 3 endpoint schema
@return {Object} insomnia request's body definition | [
"Imports",
"insomnia",
"request",
"body",
"definitions",
"including",
"data",
"mock",
"(",
"if",
"available",
")"
] | e24ce7f7b41246e700c4b9bdb6b34b6652ad589b | https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-importers/src/importers/openapi3.js#L225-L258 | train | Prepare the body of the request | [
30522,
3853,
7374,
23684,
1006,
2203,
26521,
5403,
2863,
1007,
1063,
1013,
1013,
5227,
9530,
3367,
5227,
23684,
1027,
2203,
26521,
5403,
2863,
1012,
5227,
23684,
1064,
1064,
1063,
1065,
1025,
9530,
3367,
4180,
1027,
5227,
23684,
1012,
4180,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onSendPasswordResetEmail | function onSendPasswordResetEmail() {
var email = $('#password-reset-email').val();
auth.sendPasswordResetEmail(email, getActionCodeSettings()).then(function() {
alertSuccess('Email sent!');
}, onAuthError);
} | javascript | function onSendPasswordResetEmail() {
var email = $('#password-reset-email').val();
auth.sendPasswordResetEmail(email, getActionCodeSettings()).then(function() {
alertSuccess('Email sent!');
}, onAuthError);
} | [
"function",
"onSendPasswordResetEmail",
"(",
")",
"{",
"var",
"email",
"=",
"$",
"(",
"'#password-reset-email'",
")",
".",
"val",
"(",
")",
";",
"auth",
".",
"sendPasswordResetEmail",
"(",
"email",
",",
"getActionCodeSettings",
"(",
")",
")",
".",
"then",
"(... | Sends password reset email to the user. | [
"Sends",
"password",
"reset",
"email",
"to",
"the",
"user",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L687-L692 | train | Send a password reset email | [
30522,
3853,
2006,
5054,
18927,
12054,
18351,
6072,
12870,
21397,
1006,
1007,
1063,
13075,
10373,
1027,
1002,
1006,
1005,
1001,
20786,
1011,
25141,
1011,
10373,
1005,
1007,
1012,
11748,
1006,
1007,
1025,
8740,
2705,
1012,
4604,
15194,
18351,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | getWorkingSet | function getWorkingSet(paneId) {
var result = [];
_forEachPaneOrPanes(paneId, function (pane) {
var viewList = pane.getViewList();
result = _.union(result, viewList);
});
return result;
} | javascript | function getWorkingSet(paneId) {
var result = [];
_forEachPaneOrPanes(paneId, function (pane) {
var viewList = pane.getViewList();
result = _.union(result, viewList);
});
return result;
} | [
"function",
"getWorkingSet",
"(",
"paneId",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"_forEachPaneOrPanes",
"(",
"paneId",
",",
"function",
"(",
"pane",
")",
"{",
"var",
"viewList",
"=",
"pane",
".",
"getViewList",
"(",
")",
";",
"result",
"=",
"... | Retrieves the WorkingSet for the given paneId not including temporary views
@param {!string} paneId - id of the pane in which to get the view list, ALL_PANES or ACTIVE_PANE
@return {Array.<File>} | [
"Retrieves",
"the",
"WorkingSet",
"for",
"the",
"given",
"paneId",
"not",
"including",
"temporary",
"views"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L530-L539 | train | Get working set for pane or panes | [
30522,
3853,
2131,
21398,
13462,
1006,
6090,
7416,
2094,
1007,
1063,
13075,
2765,
1027,
1031,
1033,
1025,
1035,
18921,
6776,
9739,
8780,
14536,
7231,
2015,
1006,
6090,
7416,
2094,
1010,
3853,
1006,
6090,
2063,
1007,
1063,
13075,
3193,
9863,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/editor/EditorManager.js | _insertProviderSorted | function _insertProviderSorted(array, provider, priority) {
var index,
prioritizedProvider = {
priority: priority,
provider: provider
};
for (index = 0; index < array.length; index++) {
if (array[index].priority < priority) {
... | javascript | function _insertProviderSorted(array, provider, priority) {
var index,
prioritizedProvider = {
priority: priority,
provider: provider
};
for (index = 0; index < array.length; index++) {
if (array[index].priority < priority) {
... | [
"function",
"_insertProviderSorted",
"(",
"array",
",",
"provider",
",",
"priority",
")",
"{",
"var",
"index",
",",
"prioritizedProvider",
"=",
"{",
"priority",
":",
"priority",
",",
"provider",
":",
"provider",
"}",
";",
"for",
"(",
"index",
"=",
"0",
";"... | Inserts a prioritized provider object into the array in sorted (descending) order.
@private
@param {Array.<{priority:number, provider:function(...)}>} array
@param {number} priority
@param {function(...)} provider | [
"Inserts",
"a",
"prioritized",
"provider",
"object",
"into",
"the",
"array",
"in",
"sorted",
"(",
"descending",
")",
"order",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorManager.js#L321-L335 | train | Insert a new provider into the array sorted by priority | [
30522,
3853,
1035,
19274,
21572,
17258,
2545,
15613,
1006,
9140,
1010,
10802,
1010,
9470,
1007,
1063,
13075,
5950,
1010,
3188,
25090,
5422,
21572,
17258,
2121,
1027,
1063,
9470,
1024,
9470,
1010,
10802,
1024,
10802,
1065,
1025,
2005,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sass/node-sass | lib/extensions.js | getHumanEnvironment | function getHumanEnvironment(env) {
var binding = env.replace(/_binding\.node$/, ''),
parts = binding.split('-'),
platform = getHumanPlatform(parts[0]),
arch = getHumanArchitecture(parts[1]),
runtime = getHumanNodeVersion(parts[2]);
if (parts.length !== 3) {
return 'Unknown environment (' + bin... | javascript | function getHumanEnvironment(env) {
var binding = env.replace(/_binding\.node$/, ''),
parts = binding.split('-'),
platform = getHumanPlatform(parts[0]),
arch = getHumanArchitecture(parts[1]),
runtime = getHumanNodeVersion(parts[2]);
if (parts.length !== 3) {
return 'Unknown environment (' + bin... | [
"function",
"getHumanEnvironment",
"(",
"env",
")",
"{",
"var",
"binding",
"=",
"env",
".",
"replace",
"(",
"/",
"_binding\\.node$",
"/",
",",
"''",
")",
",",
"parts",
"=",
"binding",
".",
"split",
"(",
"'-'",
")",
",",
"platform",
"=",
"getHumanPlatform... | Get a human readable description of where node-sass is running to support
user error reporting when something goes wrong
@param {string} env - The name of the native bindings that is to be parsed
@return {string} A description of what os, architecture, and Node version
that is being run
@api public | [
"Get",
"a",
"human",
"readable",
"description",
"of",
"where",
"node",
"-",
"sass",
"is",
"running",
"to",
"support",
"user",
"error",
"reporting",
"when",
"something",
"goes",
"wrong"
] | 0c1a49eefa37544d16041c5fe5b2e3d9168004b7 | https://github.com/sass/node-sass/blob/0c1a49eefa37544d16041c5fe5b2e3d9168004b7/lib/extensions.js#L95-L121 | train | Get a human readable environment | [
30522,
3853,
2131,
28600,
7231,
2078,
21663,
2239,
3672,
1006,
4372,
2615,
1007,
1063,
13075,
8031,
1027,
4372,
2615,
1012,
5672,
1006,
1013,
1035,
8031,
1032,
1012,
13045,
1002,
1013,
1010,
1005,
1005,
1007,
1010,
3033,
1027,
8031,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js | function (bCompact) {
if (sap.ui.Device.browser.internet_explorer || sap.ui.Device.browser.edge) {
return bCompact ? 0.5 : 0.5;
} else {
return bCompact ? 0.5625 : 0.5625;
}
} | javascript | function (bCompact) {
if (sap.ui.Device.browser.internet_explorer || sap.ui.Device.browser.edge) {
return bCompact ? 0.5 : 0.5;
} else {
return bCompact ? 0.5625 : 0.5625;
}
} | [
"function",
"(",
"bCompact",
")",
"{",
"if",
"(",
"sap",
".",
"ui",
".",
"Device",
".",
"browser",
".",
"internet_explorer",
"||",
"sap",
".",
"ui",
".",
"Device",
".",
"browser",
".",
"edge",
")",
"{",
"return",
"bCompact",
"?",
"0.5",
":",
"0.5",
... | Returns the height of a popover arrow
@param {boolean} bCompact wheter ContextMenu is compact
@return {float} the height of a popover arrow | [
"Returns",
"the",
"height",
"of",
"a",
"popover",
"arrow"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js#L497-L503 | train | Returns the number of nodes that are compact | [
30522,
3853,
1006,
4647,
25377,
18908,
1007,
1063,
2065,
1006,
20066,
1012,
21318,
1012,
5080,
1012,
16602,
1012,
4274,
1035,
10566,
1064,
1064,
20066,
1012,
21318,
1012,
5080,
1012,
16602,
1012,
3341,
1007,
1063,
2709,
4647,
25377,
18908,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
swimlane/ngx-datatable | release/utils/column-prop-getters.js | deepValueGetter | function deepValueGetter(obj, path) {
if (obj == null)
return '';
if (!obj || !path)
return obj;
// check if path matches a root-level field
// { "a.b.c": 123 }
var current = obj[path];
if (current !== undefined)
return current;
current = obj;
var split = path.spl... | javascript | function deepValueGetter(obj, path) {
if (obj == null)
return '';
if (!obj || !path)
return obj;
// check if path matches a root-level field
// { "a.b.c": 123 }
var current = obj[path];
if (current !== undefined)
return current;
current = obj;
var split = path.spl... | [
"function",
"deepValueGetter",
"(",
"obj",
",",
"path",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"return",
"''",
";",
"if",
"(",
"!",
"obj",
"||",
"!",
"path",
")",
"return",
"obj",
";",
"// check if path matches a root-level field",
"// { \"a.b.c\": 1... | Returns a deep object given a string. zoo['animal.type']
@param {object} obj
@param {string} path | [
"Returns",
"a",
"deep",
"object",
"given",
"a",
"string",
".",
"zoo",
"[",
"animal",
".",
"type",
"]"
] | d7df15a070282a169524dba51d9572008b74804c | https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column-prop-getters.js#L74-L95 | train | Get a value from an object by path | [
30522,
3853,
2784,
10175,
5657,
18150,
3334,
1006,
27885,
3501,
1010,
4130,
1007,
1063,
2065,
1006,
27885,
3501,
1027,
1027,
19701,
1007,
2709,
1005,
1005,
1025,
2065,
1006,
999,
27885,
3501,
1064,
1064,
999,
4130,
1007,
2709,
27885,
3501,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | function( elem, types, handler, data ) {
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// For whatever reason, IE has trouble passing the window object
// around, causing it to be cloned in the process
if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
elem = window;... | javascript | function( elem, types, handler, data ) {
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// For whatever reason, IE has trouble passing the window object
// around, causing it to be cloned in the process
if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
elem = window;... | [
"function",
"(",
"elem",
",",
"types",
",",
"handler",
",",
"data",
")",
"{",
"if",
"(",
"elem",
".",
"nodeType",
"===",
"3",
"||",
"elem",
".",
"nodeType",
"===",
"8",
")",
"{",
"return",
";",
"}",
"// For whatever reason, IE has trouble passing the window ... | Bind an event to an element Original by Dean Edwards | [
"Bind",
"an",
"event",
"to",
"an",
"element",
"Original",
"by",
"Dean",
"Edwards"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L4145-L4261 | train | The following functions are used to bind events to an element | [
30522,
3853,
1006,
3449,
6633,
1010,
4127,
1010,
28213,
1010,
2951,
1007,
1063,
2065,
1006,
3449,
6633,
1012,
13045,
13874,
1027,
1027,
1027,
1017,
1064,
1064,
3449,
6633,
1012,
13045,
13874,
1027,
1027,
1027,
1022,
1007,
1063,
2709,
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.ux3/src/sap/ui/ux3/NotificationBarRenderer.js | function(oRm, aNotifiers) {
for ( var i = 0; i < aNotifiers.length; i++) {
fnRenderNotifier(oRm, aNotifiers[i], false);
}
} | javascript | function(oRm, aNotifiers) {
for ( var i = 0; i < aNotifiers.length; i++) {
fnRenderNotifier(oRm, aNotifiers[i], false);
}
} | [
"function",
"(",
"oRm",
",",
"aNotifiers",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"aNotifiers",
".",
"length",
";",
"i",
"++",
")",
"{",
"fnRenderNotifier",
"(",
"oRm",
",",
"aNotifiers",
"[",
"i",
"]",
",",
"false",
")",
";",... | Renders given map of notifiers | [
"Renders",
"given",
"map",
"of",
"notifiers"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/NotificationBarRenderer.js#L420-L424 | train | Renders the given notifiers. | [
30522,
3853,
1006,
2030,
2213,
1010,
2019,
4140,
28295,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
2019,
4140,
28295,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
1042,
16118,
10497,
11795,
4140,
18095,
1006,
2030... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aws/aws-sdk-js | lib/discover_endpoint.js | isEndpointDiscoveryApplicable | function isEndpointDiscoveryApplicable(request) {
var service = request.service || {};
if (service.config.endpointDiscoveryEnabled === true) return true;
//shared ini file is only available in Node
//not to check env in browser
if (util.isBrowser()) return false;
for (var i = 0; i < endpointDiscoveryEnabl... | javascript | function isEndpointDiscoveryApplicable(request) {
var service = request.service || {};
if (service.config.endpointDiscoveryEnabled === true) return true;
//shared ini file is only available in Node
//not to check env in browser
if (util.isBrowser()) return false;
for (var i = 0; i < endpointDiscoveryEnabl... | [
"function",
"isEndpointDiscoveryApplicable",
"(",
"request",
")",
"{",
"var",
"service",
"=",
"request",
".",
"service",
"||",
"{",
"}",
";",
"if",
"(",
"service",
".",
"config",
".",
"endpointDiscoveryEnabled",
"===",
"true",
")",
"return",
"true",
";",
"//... | If endpoint discovery should perform for this request when endpoint discovery is optional.
SDK performs config resolution in order like below:
1. If turned on client configuration(default to off) then turn on endpoint discovery.
2. If turned on in env AWS_ENABLE_ENDPOINT_DISCOVERY then turn on endpoint discovery.
3. If... | [
"If",
"endpoint",
"discovery",
"should",
"perform",
"for",
"this",
"request",
"when",
"endpoint",
"discovery",
"is",
"optional",
".",
"SDK",
"performs",
"config",
"resolution",
"in",
"order",
"like",
"below",
":",
"1",
".",
"If",
"turned",
"on",
"client",
"c... | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L276-L317 | train | Check if endpoint discovery is applicable | [
30522,
3853,
2003,
10497,
8400,
10521,
3597,
27900,
29098,
19341,
3468,
1006,
5227,
1007,
1063,
13075,
2326,
1027,
5227,
1012,
2326,
1064,
1064,
1063,
1065,
1025,
2065,
1006,
2326,
1012,
9530,
8873,
2290,
1012,
2203,
8400,
10521,
3597,
2790... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/models/permission.js | permittedAttributes | function permittedAttributes() {
let filteredKeys = ghostBookshelf.Model.prototype.permittedAttributes.apply(this, arguments);
this.relationships.forEach((key) => {
filteredKeys.push(key);
});
return filteredKeys;
} | javascript | function permittedAttributes() {
let filteredKeys = ghostBookshelf.Model.prototype.permittedAttributes.apply(this, arguments);
this.relationships.forEach((key) => {
filteredKeys.push(key);
});
return filteredKeys;
} | [
"function",
"permittedAttributes",
"(",
")",
"{",
"let",
"filteredKeys",
"=",
"ghostBookshelf",
".",
"Model",
".",
"prototype",
".",
"permittedAttributes",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"this",
".",
"relationships",
".",
"forEach",
"("... | The base model keeps only the columns, which are defined in the schema.
We have to add the relations on top, otherwise bookshelf-relations
has no access to the nested relations, which should be updated. | [
"The",
"base",
"model",
"keeps",
"only",
"the",
"columns",
"which",
"are",
"defined",
"in",
"the",
"schema",
".",
"We",
"have",
"to",
"add",
"the",
"relations",
"on",
"top",
"otherwise",
"bookshelf",
"-",
"relations",
"has",
"no",
"access",
"to",
"the",
... | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/models/permission.js#L20-L28 | train | Returns an array of keys that are not permitted to the model | [
30522,
3853,
7936,
19321,
3089,
8569,
4570,
1006,
1007,
1063,
2292,
21839,
14839,
2015,
1027,
5745,
17470,
16001,
2546,
1012,
2944,
1012,
8773,
1012,
7936,
19321,
3089,
8569,
4570,
1012,
6611,
1006,
2023,
1010,
9918,
1007,
1025,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/BlockLayerUtils.js | removeTabbable | function removeTabbable(oBlockSpan, fnRedirectFocus) {
if (oBlockSpan.parentNode) {
oBlockSpan.parentNode.removeChild(oBlockSpan);
}
oBlockSpan.removeEventListener('focusin', fnRedirectFocus);
} | javascript | function removeTabbable(oBlockSpan, fnRedirectFocus) {
if (oBlockSpan.parentNode) {
oBlockSpan.parentNode.removeChild(oBlockSpan);
}
oBlockSpan.removeEventListener('focusin', fnRedirectFocus);
} | [
"function",
"removeTabbable",
"(",
"oBlockSpan",
",",
"fnRedirectFocus",
")",
"{",
"if",
"(",
"oBlockSpan",
".",
"parentNode",
")",
"{",
"oBlockSpan",
".",
"parentNode",
".",
"removeChild",
"(",
"oBlockSpan",
")",
";",
"}",
"oBlockSpan",
".",
"removeEventListene... | Create a tabbable span for the block section of the control with according focus handling.
@param {function} fnRedirectFocus Focus handling function
@returns {object} The span element's DOM node
@private | [
"Create",
"a",
"tabbable",
"span",
"for",
"the",
"block",
"section",
"of",
"the",
"control",
"with",
"according",
"focus",
"handling",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/BlockLayerUtils.js#L278-L283 | train | Removes a tabbable element from the DOM. | [
30522,
3853,
6366,
2696,
22414,
3468,
1006,
27885,
7878,
13102,
2319,
1010,
1042,
16118,
2098,
7442,
6593,
14876,
7874,
1007,
1063,
2065,
1006,
27885,
7878,
13102,
2319,
1012,
6687,
3630,
3207,
1007,
1063,
27885,
7878,
13102,
2319,
1012,
66... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/downloads.js | downloadManager_close | function downloadManager_close(force) {
var windowCount = mozmill.utils.getWindows().length;
if (this._controller) {
// Check if we should force the closing of the DM window
if (force) {
this._controller.window.close();
} else {
var cmdKey = utils.getEntity(this.getDtds(), "cm... | javascript | function downloadManager_close(force) {
var windowCount = mozmill.utils.getWindows().length;
if (this._controller) {
// Check if we should force the closing of the DM window
if (force) {
this._controller.window.close();
} else {
var cmdKey = utils.getEntity(this.getDtds(), "cm... | [
"function",
"downloadManager_close",
"(",
"force",
")",
"{",
"var",
"windowCount",
"=",
"mozmill",
".",
"utils",
".",
"getWindows",
"(",
")",
".",
"length",
";",
"if",
"(",
"this",
".",
"_controller",
")",
"{",
"// Check if we should force the closing of the DM wi... | Close the download manager
@param {boolean} force
Force the closing of the DM window | [
"Close",
"the",
"download",
"manager"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/downloads.js#L155-L171 | train | Close the download manager | [
30522,
3853,
8816,
24805,
4590,
1035,
2485,
1006,
2486,
1007,
1063,
13075,
3332,
3597,
16671,
1027,
9587,
2480,
19912,
1012,
21183,
12146,
1012,
2131,
11101,
15568,
1006,
1007,
1012,
3091,
1025,
2065,
1006,
2023,
1012,
1035,
11486,
1007,
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... |
muaz-khan/RTCMultiConnection | dev/ios-hacks.js | setCordovaAPIs | function setCordovaAPIs() {
// if (DetectRTC.osName !== 'iOS') return;
if (typeof cordova === 'undefined' || typeof cordova.plugins === 'undefined' || typeof cordova.plugins.iosrtc === 'undefined') return;
var iosrtc = cordova.plugins.iosrtc;
window.webkitRTCPeerConnection = iosrtc.RTCPeerConnection;
... | javascript | function setCordovaAPIs() {
// if (DetectRTC.osName !== 'iOS') return;
if (typeof cordova === 'undefined' || typeof cordova.plugins === 'undefined' || typeof cordova.plugins.iosrtc === 'undefined') return;
var iosrtc = cordova.plugins.iosrtc;
window.webkitRTCPeerConnection = iosrtc.RTCPeerConnection;
... | [
"function",
"setCordovaAPIs",
"(",
")",
"{",
"// if (DetectRTC.osName !== 'iOS') return;",
"if",
"(",
"typeof",
"cordova",
"===",
"'undefined'",
"||",
"typeof",
"cordova",
".",
"plugins",
"===",
"'undefined'",
"||",
"typeof",
"cordova",
".",
"plugins",
".",
"iosrtc"... | ios-hacks.js | [
"ios",
"-",
"hacks",
".",
"js"
] | 2032ce949bde30b43a3d2666e0f1e5afbf337f3d | https://github.com/muaz-khan/RTCMultiConnection/blob/2032ce949bde30b43a3d2666e0f1e5afbf337f3d/dev/ios-hacks.js#L3-L20 | train | set cordova APIs | [
30522,
3853,
2275,
27108,
3527,
3567,
9331,
2483,
1006,
1007,
1063,
1013,
1013,
2065,
1006,
11487,
5339,
2278,
1012,
9808,
18442,
999,
1027,
1027,
1005,
16380,
1005,
1007,
2709,
1025,
2065,
1006,
2828,
11253,
11601,
7103,
1027,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/BindingParser.js | expression | function expression(sInput, iStart, oBindingMode) {
var oBinding = ExpressionParser.parse(resolveEmbeddedBinding.bind(null, oEnv), sString,
iStart, null, bStaticContext ? oContext : null);
/**
* Recursively sets the mode <code>oBindingMode</code> on the given binding (or its
* parts).
*
* @p... | javascript | function expression(sInput, iStart, oBindingMode) {
var oBinding = ExpressionParser.parse(resolveEmbeddedBinding.bind(null, oEnv), sString,
iStart, null, bStaticContext ? oContext : null);
/**
* Recursively sets the mode <code>oBindingMode</code> on the given binding (or its
* parts).
*
* @p... | [
"function",
"expression",
"(",
"sInput",
",",
"iStart",
",",
"oBindingMode",
")",
"{",
"var",
"oBinding",
"=",
"ExpressionParser",
".",
"parse",
"(",
"resolveEmbeddedBinding",
".",
"bind",
"(",
"null",
",",
"oEnv",
")",
",",
"sString",
",",
"iStart",
",",
... | Parses an expression. Sets the flags accordingly.
@param {string} sInput The input string to parse from
@param {int} iStart The start index
@param {sap.ui.model.BindingMode} oBindingMode the binding mode
@returns {object} a result object with the binding in <code>result</code> and the index
after the last character be... | [
"Parses",
"an",
"expression",
".",
"Sets",
"the",
"flags",
"accordingly",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/BindingParser.js#L415-L458 | train | Parses an embedded expression and sets the mode of the binding. | [
30522,
3853,
3670,
1006,
8254,
18780,
1010,
21541,
8445,
1010,
27885,
22254,
2075,
5302,
3207,
1007,
1063,
13075,
27885,
22254,
2075,
1027,
3670,
19362,
8043,
1012,
11968,
3366,
1006,
10663,
6633,
8270,
5732,
8428,
4667,
1012,
14187,
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... |
aws/aws-sdk-js | lib/discover_endpoint.js | invalidateCachedEndpoints | function invalidateCachedEndpoints(response) {
var error = response.error;
var httpResponse = response.httpResponse;
if (error &&
(error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421)
) {
var request = response.request;
var operations = request.service.api.operations || {};
... | javascript | function invalidateCachedEndpoints(response) {
var error = response.error;
var httpResponse = response.httpResponse;
if (error &&
(error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421)
) {
var request = response.request;
var operations = request.service.api.operations || {};
... | [
"function",
"invalidateCachedEndpoints",
"(",
"response",
")",
"{",
"var",
"error",
"=",
"response",
".",
"error",
";",
"var",
"httpResponse",
"=",
"response",
".",
"httpResponse",
";",
"if",
"(",
"error",
"&&",
"(",
"error",
".",
"code",
"===",
"'InvalidEnd... | If api call gets invalid endpoint exception, SDK should attempt to remove the invalid
endpoint from cache.
@api private | [
"If",
"api",
"call",
"gets",
"invalid",
"endpoint",
"exception",
"SDK",
"should",
"attempt",
"to",
"remove",
"the",
"invalid",
"endpoint",
"from",
"cache",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L223-L240 | train | Invalidate the cached endpoints if any | [
30522,
3853,
19528,
3686,
3540,
7690,
10497,
26521,
1006,
3433,
1007,
1063,
13075,
7561,
1027,
3433,
1012,
7561,
1025,
13075,
8299,
6072,
26029,
3366,
1027,
3433,
1012,
8299,
6072,
26029,
3366,
1025,
2065,
1006,
7561,
1004,
1004,
1006,
7561... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.