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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PrismJS/prism | plugins/previewers/prism-previewers.js | function(prefix, func, values) {
// Default value for angle
var angle = '180deg';
if (/^(?:-?\d*\.?\d+(?:deg|rad)|to\b|top|right|bottom|left)/.test(values[0])) {
angle = values.shift();
if (angle.indexOf('to ') < 0) {
// Angle uses old keywords
// W3C syntax uses "to" + opposit... | javascript | function(prefix, func, values) {
// Default value for angle
var angle = '180deg';
if (/^(?:-?\d*\.?\d+(?:deg|rad)|to\b|top|right|bottom|left)/.test(values[0])) {
angle = values.shift();
if (angle.indexOf('to ') < 0) {
// Angle uses old keywords
// W3C syntax uses "to" + opposit... | [
"function",
"(",
"prefix",
",",
"func",
",",
"values",
")",
"{",
"// Default value for angle",
"var",
"angle",
"=",
"'180deg'",
";",
"if",
"(",
"/",
"^(?:-?\\d*\\.?\\d+(?:deg|rad)|to\\b|top|right|bottom|left)",
"/",
".",
"test",
"(",
"values",
"[",
"0",
"]",
")"... | Returns a W3C-valid linear gradient
@param {string} prefix Vendor prefix if any ("-moz-", "-webkit-", etc.)
@param {string} func Gradient function name ("linear-gradient")
@param {string[]} values Array of the gradient function parameters (["0deg", "red 0%", "blue 100%"]) | [
"Returns",
"a",
"W3C",
"-",
"valid",
"linear",
"gradient"
] | acceb3b56f0e8362a7ef274dbd85b17611df2ec4 | https://github.com/PrismJS/prism/blob/acceb3b56f0e8362a7ef274dbd85b17611df2ec4/plugins/previewers/prism-previewers.js#L25-L66 | train | Returns a function that takes an array of values and returns the result | [
30522,
3853,
1006,
17576,
1010,
4569,
2278,
1010,
5300,
1007,
1063,
1013,
1013,
12398,
3643,
2005,
6466,
13075,
6466,
1027,
1005,
8380,
3207,
2290,
1005,
1025,
2065,
1006,
1013,
1034,
1006,
1029,
1024,
1011,
1029,
1032,
1040,
1008,
1032,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (str) {
var bin = [];
for(var i = 0; i < str.length * 8; i += 8)
{
bin[i>>5] |= (str.charCodeAt(i / 8) & 255) << (i%32);
}
return bin;
} | javascript | function (str) {
var bin = [];
for(var i = 0; i < str.length * 8; i += 8)
{
bin[i>>5] |= (str.charCodeAt(i / 8) & 255) << (i%32);
}
return bin;
} | [
"function",
"(",
"str",
")",
"{",
"var",
"bin",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"str",
".",
"length",
"*",
"8",
";",
"i",
"+=",
"8",
")",
"{",
"bin",
"[",
"i",
">>",
"5",
"]",
"|=",
"(",
"str",
".",
... | /*
Convert a string to an array of little-endian words | [
"/",
"*",
"Convert",
"a",
"string",
"to",
"an",
"array",
"of",
"little",
"-",
"endian",
"words"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L304-L311 | train | Returns an array of the words of the specified string | [
30522,
3853,
1006,
2358,
2099,
1007,
1063,
13075,
8026,
1027,
1031,
1033,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
2358,
2099,
1012,
3091,
1008,
1022,
1025,
1045,
1009,
1027,
1022,
1007,
1063,
8026,
1031,
1045,
1028,
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 | grunt/config/aliases.js | function(library, glob) {
var aTasks = [];
if (arguments.length > 0) {
Array.prototype.forEach.call(arguments, function(path) {
grunt.config(['eslint', path], path);
aTasks.push('eslint:' + path);
});
} else {
aTasks.push('eslint');
}
grunt.task.run(aTasks);
} | javascript | function(library, glob) {
var aTasks = [];
if (arguments.length > 0) {
Array.prototype.forEach.call(arguments, function(path) {
grunt.config(['eslint', path], path);
aTasks.push('eslint:' + path);
});
} else {
aTasks.push('eslint');
}
grunt.task.run(aTasks);
} | [
"function",
"(",
"library",
",",
"glob",
")",
"{",
"var",
"aTasks",
"=",
"[",
"]",
";",
"if",
"(",
"arguments",
".",
"length",
">",
"0",
")",
"{",
"Array",
".",
"prototype",
".",
"forEach",
".",
"call",
"(",
"arguments",
",",
"function",
"(",
"path... | Lint task | [
"Lint",
"task"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/grunt/config/aliases.js#L27-L38 | train | Run the linters | [
30522,
3853,
1006,
3075,
1010,
1043,
4135,
2497,
1007,
1063,
13075,
29533,
6711,
2015,
1027,
1031,
1033,
1025,
2065,
1006,
9918,
1012,
3091,
1028,
1014,
1007,
1063,
9140,
1012,
8773,
1012,
18921,
6776,
1012,
2655,
1006,
9918,
1010,
3853,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/mvc/View.js | initPreprocessor | function initPreprocessor(oPreprocessor, bAsync) {
var oPreprocessorImpl;
if (typeof oPreprocessor.preprocessor === "string") {
var sPreprocessorName = oPreprocessor.preprocessor.replace(/\./g, "/");
// module string given, resolve and retrieve object
if (bAsync) {
return new Promise(function(resolve... | javascript | function initPreprocessor(oPreprocessor, bAsync) {
var oPreprocessorImpl;
if (typeof oPreprocessor.preprocessor === "string") {
var sPreprocessorName = oPreprocessor.preprocessor.replace(/\./g, "/");
// module string given, resolve and retrieve object
if (bAsync) {
return new Promise(function(resolve... | [
"function",
"initPreprocessor",
"(",
"oPreprocessor",
",",
"bAsync",
")",
"{",
"var",
"oPreprocessorImpl",
";",
"if",
"(",
"typeof",
"oPreprocessor",
".",
"preprocessor",
"===",
"\"string\"",
")",
"{",
"var",
"sPreprocessorName",
"=",
"oPreprocessor",
".",
"prepro... | resolves either the module dependency or the function which was passed to settings to the internal
preprocessor config object
@param {object} oPreprocessor Preprocessor config object
@param {boolean} bAsync Whether processing is async or not
@return {object} oPreprocessorImpl
@private | [
"resolves",
"either",
"the",
"module",
"dependency",
"or",
"the",
"function",
"which",
"was",
"passed",
"to",
"settings",
"to",
"the",
"internal",
"preprocessor",
"config",
"object"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/mvc/View.js#L231-L259 | train | Initializes the preprocessor | [
30522,
3853,
1999,
4183,
28139,
21572,
9623,
21748,
1006,
6728,
2890,
21572,
9623,
21748,
30524,
1006,
2828,
11253,
6728,
2890,
21572,
9623,
21748,
1012,
17463,
3217,
9623,
21748,
1027,
1027,
1027,
1000,
5164,
1000,
1007,
1063,
13075,
11867,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-useless-escape.js | check | function check(node) {
const isTemplateElement = node.type === "TemplateElement";
if (
isTemplateElement &&
node.parent &&
node.parent.parent &&
node.parent.parent.type === "TaggedTemplateExpression" &&
node.parent ... | javascript | function check(node) {
const isTemplateElement = node.type === "TemplateElement";
if (
isTemplateElement &&
node.parent &&
node.parent.parent &&
node.parent.parent.type === "TaggedTemplateExpression" &&
node.parent ... | [
"function",
"check",
"(",
"node",
")",
"{",
"const",
"isTemplateElement",
"=",
"node",
".",
"type",
"===",
"\"TemplateElement\"",
";",
"if",
"(",
"isTemplateElement",
"&&",
"node",
".",
"parent",
"&&",
"node",
".",
"parent",
".",
"parent",
"&&",
"node",
".... | Checks if a node has an escape.
@param {ASTNode} node - node to check.
@returns {void} | [
"Checks",
"if",
"a",
"node",
"has",
"an",
"escape",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-useless-escape.js#L158-L219 | train | Check if node is valid | [
30522,
3853,
4638,
1006,
13045,
1007,
1063,
9530,
3367,
21541,
6633,
15725,
12260,
3672,
1027,
13045,
1012,
2828,
1027,
1027,
1027,
1000,
23561,
12260,
3672,
1000,
1025,
2065,
1006,
21541,
6633,
15725,
12260,
3672,
1004,
1004,
13045,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/require-atomic-updates.js | resolveVariableInScope | function resolveVariableInScope(identifier, scope) {
return scope.variables.find(variable => variable.name === identifier.name) ||
(scope.upper ? resolveVariableInScope(identifier, scope.upper) : null);
} | javascript | function resolveVariableInScope(identifier, scope) {
return scope.variables.find(variable => variable.name === identifier.name) ||
(scope.upper ? resolveVariableInScope(identifier, scope.upper) : null);
} | [
"function",
"resolveVariableInScope",
"(",
"identifier",
",",
"scope",
")",
"{",
"return",
"scope",
".",
"variables",
".",
"find",
"(",
"variable",
"=>",
"variable",
".",
"name",
"===",
"identifier",
".",
"name",
")",
"||",
"(",
"scope",
".",
"upper",
"?",... | Resolves a given identifier to a given scope
@param {ASTNode} identifier An `Identifier` AST node
@param {Scope} scope An escope Scope
@returns {Variable|null} An escope Variable corresponding to the given identifier | [
"Resolves",
"a",
"given",
"identifier",
"to",
"a",
"given",
"scope"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/require-atomic-updates.js#L65-L68 | train | Resolves a variable in a given scope | [
30522,
3853,
10663,
10755,
19210,
7076,
16186,
1006,
8909,
4765,
18095,
1010,
9531,
1007,
1063,
2709,
9531,
1012,
10857,
1012,
2424,
1006,
8023,
1027,
1028,
8023,
1012,
2171,
1027,
1027,
1027,
8909,
4765,
18095,
1012,
2171,
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/modal-dialog.js | mdObserver_observe | function mdObserver_observe(aSubject, aTopic, aData) {
// Once the window has been found and loaded we can execute the callback
var window = this.findWindow();
if (window && ("documentLoaded" in window)) {
try {
this._callback(new mozmill.controller.MozMillController(window));
}
ca... | javascript | function mdObserver_observe(aSubject, aTopic, aData) {
// Once the window has been found and loaded we can execute the callback
var window = this.findWindow();
if (window && ("documentLoaded" in window)) {
try {
this._callback(new mozmill.controller.MozMillController(window));
}
ca... | [
"function",
"mdObserver_observe",
"(",
"aSubject",
",",
"aTopic",
",",
"aData",
")",
"{",
"// Once the window has been found and loaded we can execute the callback",
"var",
"window",
"=",
"this",
".",
"findWindow",
"(",
")",
";",
"if",
"(",
"window",
"&&",
"(",
"\"d... | Called by the timer in the given interval to check if the modal dialog has
been opened. Once it has been found the callback gets executed
@param {object} aSubject Not used.
@param {string} aTopic Not used.
@param {string} aData Not used. | [
"Called",
"by",
"the",
"timer",
"in",
"the",
"given",
"interval",
"to",
"check",
"if",
"the",
"modal",
"dialog",
"has",
"been",
"opened",
".",
"Once",
"it",
"has",
"been",
"found",
"the",
"callback",
"gets",
"executed"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/modal-dialog.js#L112-L136 | train | This function is called by the MIDI controller when the MIDI controller is ready | [
30522,
3853,
9108,
16429,
8043,
6299,
1035,
11949,
1006,
2004,
12083,
20614,
1010,
10234,
2594,
1010,
15262,
2696,
1007,
1063,
1013,
1013,
2320,
1996,
3332,
2038,
2042,
2179,
1998,
8209,
2057,
2064,
15389,
1996,
2655,
5963,
13075,
3332,
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... |
GitbookIO/gitbook | lib/plugins/validatePlugin.js | validatePlugin | function validatePlugin(plugin) {
var packageInfos = plugin.getPackage();
var isValid = (
plugin.isLoaded() &&
packageInfos &&
packageInfos.get('name') &&
packageInfos.get('engines') &&
packageInfos.get('engines').get('gitbook')
);
if (!isValid) {
return... | javascript | function validatePlugin(plugin) {
var packageInfos = plugin.getPackage();
var isValid = (
plugin.isLoaded() &&
packageInfos &&
packageInfos.get('name') &&
packageInfos.get('engines') &&
packageInfos.get('engines').get('gitbook')
);
if (!isValid) {
return... | [
"function",
"validatePlugin",
"(",
"plugin",
")",
"{",
"var",
"packageInfos",
"=",
"plugin",
".",
"getPackage",
"(",
")",
";",
"var",
"isValid",
"=",
"(",
"plugin",
".",
"isLoaded",
"(",
")",
"&&",
"packageInfos",
"&&",
"packageInfos",
".",
"get",
"(",
"... | Validate a plugin
@param {Plugin}
@return {Promise<Plugin>} | [
"Validate",
"a",
"plugin"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/plugins/validatePlugin.js#L11-L32 | train | Validate a plugin | [
30522,
3853,
9398,
3686,
24759,
15916,
2378,
1006,
13354,
2378,
1007,
1063,
13075,
7427,
2378,
14876,
2015,
1027,
13354,
2378,
1012,
2131,
23947,
4270,
1006,
1007,
1025,
13075,
2003,
10175,
3593,
1027,
1006,
13354,
2378,
1012,
2003,
17468,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Freeboard/freeboard | js/freeboard.thirdparty.js | bindHover | function bindHover(dpDiv) {
var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
return dpDiv.delegate(selector, "mouseout", function() {
$(this).removeClass("ui-state-hover");
if (this.className.indexOf("ui-datepicker-prev") !== -1) {
$(this).removeClass("ui-date... | javascript | function bindHover(dpDiv) {
var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
return dpDiv.delegate(selector, "mouseout", function() {
$(this).removeClass("ui-state-hover");
if (this.className.indexOf("ui-datepicker-prev") !== -1) {
$(this).removeClass("ui-date... | [
"function",
"bindHover",
"(",
"dpDiv",
")",
"{",
"var",
"selector",
"=",
"\"button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a\"",
";",
"return",
"dpDiv",
".",
"delegate",
"(",
"selector",
",",
"\"mouseout\"",
",",
"function",
"(",
")",
"{",
... | /*
Bind hover events for datepicker elements.
Done via delegate so the binding only occurs once in the lifetime of the parent div.
Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. | [
"/",
"*",
"Bind",
"hover",
"events",
"for",
"datepicker",
"elements",
".",
"Done",
"via",
"delegate",
"so",
"the",
"binding",
"only",
"occurs",
"once",
"in",
"the",
"lifetime",
"of",
"the",
"parent",
"div",
".",
"Global",
"instActive",
"set",
"by",
"_updat... | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L9573-L9596 | train | binds mouseover mouseout mouseover mouseout mouseover mouseout mouseover mouseout mouseover mouseout mouseover mouseout | [
30522,
3853,
14187,
6806,
6299,
1006,
1040,
17299,
12848,
1007,
1063,
13075,
27000,
1027,
1000,
6462,
1010,
1012,
21318,
1011,
3058,
24330,
5484,
1011,
3653,
2615,
1010,
1012,
21318,
1011,
3058,
24330,
5484,
1011,
2279,
1010,
1012,
21318,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | parse_xlsxcfb | function parse_xlsxcfb(cfb, _opts) {
var opts = _opts || {};
var f = 'Workbook', data = CFB.find(cfb, f);
try {
f = '/!DataSpaces/Version';
data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
/*var version = */parse_DataSpaceVersionInfo(data.content);
/* ... | javascript | function parse_xlsxcfb(cfb, _opts) {
var opts = _opts || {};
var f = 'Workbook', data = CFB.find(cfb, f);
try {
f = '/!DataSpaces/Version';
data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
/*var version = */parse_DataSpaceVersionInfo(data.content);
/* ... | [
"function",
"parse_xlsxcfb",
"(",
"cfb",
",",
"_opts",
")",
"{",
"var",
"opts",
"=",
"_opts",
"||",
"{",
"}",
";",
"var",
"f",
"=",
"'Workbook'",
",",
"data",
"=",
"CFB",
".",
"find",
"(",
"cfb",
",",
"f",
")",
";",
"try",
"{",
"f",
"=",
"'/!Da... | /* [MS-OFFCRYPTO] 2.1.1 | [
"/",
"*",
"[",
"MS",
"-",
"OFFCRYPTO",
"]",
"2",
".",
"1",
".",
"1"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L20067-L20108 | train | Parse a CFB containing a single encrypted package | [
30522,
3853,
11968,
3366,
1035,
28712,
2015,
2595,
2278,
26337,
1006,
12935,
2497,
1010,
1035,
23569,
2015,
1007,
1063,
13075,
23569,
2015,
1027,
1035,
23569,
2015,
1064,
1064,
1063,
1065,
1025,
13075,
1042,
1027,
1005,
2147,
8654,
1005,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/RoadMap.js | function(oThis, sDir){
if (!oThis.sCurrentFocusedStepRefId) {
return;
}
if (sDir && !RoadMapRenderer.isVisibleRef(oThis, oThis.sCurrentFocusedStepRefId)) {
focusStep(null, oThis, sDir);
} else {
document.getElementById(oThis.sCurrentFocusedStepRefId + "-box").focus();
}
} | javascript | function(oThis, sDir){
if (!oThis.sCurrentFocusedStepRefId) {
return;
}
if (sDir && !RoadMapRenderer.isVisibleRef(oThis, oThis.sCurrentFocusedStepRefId)) {
focusStep(null, oThis, sDir);
} else {
document.getElementById(oThis.sCurrentFocusedStepRefId + "-box").focus();
}
} | [
"function",
"(",
"oThis",
",",
"sDir",
")",
"{",
"if",
"(",
"!",
"oThis",
".",
"sCurrentFocusedStepRefId",
")",
"{",
"return",
";",
"}",
"if",
"(",
"sDir",
"&&",
"!",
"RoadMapRenderer",
".",
"isVisibleRef",
"(",
"oThis",
",",
"oThis",
".",
"sCurrentFocus... | Sets the focus on the current focused step again. If the current focused step is not visible anymore the following step in the given direction is focused. Allowed directions are: next, prev, first, last | [
"Sets",
"the",
"focus",
"on",
"the",
"current",
"focused",
"step",
"again",
".",
"If",
"the",
"current",
"focused",
"step",
"is",
"not",
"visible",
"anymore",
"the",
"following",
"step",
"in",
"the",
"given",
"direction",
"is",
"focused",
".",
"Allowed",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMap.js#L518-L528 | train | Focuses the currently focused step | [
30522,
3853,
1006,
27178,
24158,
1010,
17371,
4313,
1007,
1063,
2065,
1006,
999,
27178,
24158,
1012,
8040,
29264,
14876,
7874,
2098,
13473,
28139,
8873,
2094,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
17371,
4313,
1004,
30524,
24158,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/dialog/dialog.js | function(ev) {
if (sourceElem === target[0] && ev.target === target[0]) {
ev.stopPropagation();
ev.preventDefault();
smartClose();
}
} | javascript | function(ev) {
if (sourceElem === target[0] && ev.target === target[0]) {
ev.stopPropagation();
ev.preventDefault();
smartClose();
}
} | [
"function",
"(",
"ev",
")",
"{",
"if",
"(",
"sourceElem",
"===",
"target",
"[",
"0",
"]",
"&&",
"ev",
".",
"target",
"===",
"target",
"[",
"0",
"]",
")",
"{",
"ev",
".",
"stopPropagation",
"(",
")",
";",
"ev",
".",
"preventDefault",
"(",
")",
";"... | We check if our original element and the target is the backdrop because if the original was the backdrop and the target was inside the dialog we don't want to dialog to close. | [
"We",
"check",
"if",
"our",
"original",
"element",
"and",
"the",
"target",
"is",
"the",
"backdrop",
"because",
"if",
"the",
"original",
"was",
"the",
"backdrop",
"and",
"the",
"target",
"was",
"inside",
"the",
"dialog",
"we",
"don",
"t",
"want",
"to",
"d... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1009-L1016 | train | onmouseover event | [
30522,
3853,
1006,
23408,
1007,
1063,
2065,
1006,
3120,
12260,
2213,
1027,
1027,
1027,
4539,
1031,
1014,
1033,
1004,
1004,
23408,
1012,
4539,
1027,
1027,
1027,
4539,
1031,
1014,
1033,
1007,
1063,
23408,
1012,
2644,
21572,
4502,
12540,
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... | |
jgraph/mxgraph | javascript/mxClient.js | function(x0, y0, r1, r2, angle, largeArcFlag, sweepFlag, x, y)
{
x -= x0;
y -= y0;
if (r1 === 0 || r2 === 0)
{
return result;
}
var fS = sweepFlag;
var psai = angle;
r1 = Math.abs(r1);
r2 = Math.abs(r2);
var ctx = -x / 2;
... | javascript | function(x0, y0, r1, r2, angle, largeArcFlag, sweepFlag, x, y)
{
x -= x0;
y -= y0;
if (r1 === 0 || r2 === 0)
{
return result;
}
var fS = sweepFlag;
var psai = angle;
r1 = Math.abs(r1);
r2 = Math.abs(r2);
var ctx = -x / 2;
... | [
"function",
"(",
"x0",
",",
"y0",
",",
"r1",
",",
"r2",
",",
"angle",
",",
"largeArcFlag",
",",
"sweepFlag",
",",
"x",
",",
"y",
")",
"{",
"x",
"-=",
"x0",
";",
"y",
"-=",
"y0",
";",
"if",
"(",
"r1",
"===",
"0",
"||",
"r2",
"===",
"0",
")",... | Function: arcToCurves
Converts the given arc to a series of curves. | [
"Function",
":",
"arcToCurves"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L4093-L4198 | train | Calculate the arc angle | [
30522,
3853,
1006,
1060,
2692,
1010,
1061,
2692,
1010,
1054,
2487,
1010,
1054,
2475,
1010,
6466,
1010,
2312,
2906,
2278,
10258,
8490,
1010,
11740,
10258,
8490,
1010,
1060,
1010,
1061,
1007,
1063,
1060,
1011,
1027,
1060,
2692,
1025,
1061,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 (oSource, bContextMenu, oContextMenuPosition) {
if (this._bUseExpPop === undefined) {
this._bUseExpPop = !!bContextMenu;
}
this._bCompactMode = jQuery(oSource.getDomRef()).closest(".sapUiSizeCompact").length > 0;
this._bOpenAsContextMenu = bContextMenu;
this._oContextMenuPosition = oContex... | javascript | function (oSource, bContextMenu, oContextMenuPosition) {
if (this._bUseExpPop === undefined) {
this._bUseExpPop = !!bContextMenu;
}
this._bCompactMode = jQuery(oSource.getDomRef()).closest(".sapUiSizeCompact").length > 0;
this._bOpenAsContextMenu = bContextMenu;
this._oContextMenuPosition = oContex... | [
"function",
"(",
"oSource",
",",
"bContextMenu",
",",
"oContextMenuPosition",
")",
"{",
"if",
"(",
"this",
".",
"_bUseExpPop",
"===",
"undefined",
")",
"{",
"this",
".",
"_bUseExpPop",
"=",
"!",
"!",
"bContextMenu",
";",
"}",
"this",
".",
"_bCompactMode",
... | Opens the ContextMenu and sets the ContextMenu position by the oSource parameter.
Note: this gets called before the old Menu is closed because of asynchronus animations.
@param {sap.ui.core.Control} oSource - The control by which the Popover will be placed.
@param {boolean} bContextMenu - If the ContextMenu should appe... | [
"Opens",
"the",
"ContextMenu",
"and",
"sets",
"the",
"ContextMenu",
"position",
"by",
"the",
"oSource",
"parameter",
".",
"Note",
":",
"this",
"gets",
"called",
"before",
"the",
"old",
"Menu",
"is",
"closed",
"because",
"of",
"asynchronus",
"animations",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js#L160-L186 | train | Sets the context menu to the given source object. | [
30522,
3853,
1006,
9808,
8162,
3401,
1010,
4647,
28040,
18413,
3549,
2226,
1010,
1051,
8663,
18209,
3549,
6279,
19234,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
3902,
4402,
2595,
9397,
7361,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
BlackrockDigital/startbootstrap-sb-admin-2 | vendor/chart.js/Chart.js | generateTicks$1 | function generateTicks$1(generationOptions, dataRange) {
var ticks = [];
var tickVal = valueOrDefault$a(generationOptions.min, Math.pow(10, Math.floor(helpers$1.log10(dataRange.min))));
var endExp = Math.floor(helpers$1.log10(dataRange.max));
var endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));
... | javascript | function generateTicks$1(generationOptions, dataRange) {
var ticks = [];
var tickVal = valueOrDefault$a(generationOptions.min, Math.pow(10, Math.floor(helpers$1.log10(dataRange.min))));
var endExp = Math.floor(helpers$1.log10(dataRange.max));
var endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));
... | [
"function",
"generateTicks$1",
"(",
"generationOptions",
",",
"dataRange",
")",
"{",
"var",
"ticks",
"=",
"[",
"]",
";",
"var",
"tickVal",
"=",
"valueOrDefault$a",
"(",
"generationOptions",
".",
"min",
",",
"Math",
".",
"pow",
"(",
"10",
",",
"Math",
".",
... | Generate a set of logarithmic ticks
@param generationOptions the options used to generate the ticks
@param dataRange the range of the data
@returns {number[]} array of tick values | [
"Generate",
"a",
"set",
"of",
"logarithmic",
"ticks"
] | ddfaceb4a8e65a41f163e2fdc4eab49384b810a1 | https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/ddfaceb4a8e65a41f163e2fdc4eab49384b810a1/vendor/chart.js/Chart.js#L11684-L11722 | train | Generate ticks from the given data range | [
30522,
3853,
9699,
26348,
2015,
1002,
1015,
1006,
4245,
7361,
9285,
1010,
2951,
24388,
2063,
1007,
1063,
13075,
16356,
2015,
1027,
1031,
1033,
1025,
13075,
16356,
10175,
1027,
3643,
8551,
12879,
23505,
1002,
1037,
1006,
4245,
7361,
9285,
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... |
SheetJS/js-xlsx | xlsx.js | parse_BrtHLink | function parse_BrtHLink(data, length) {
var end = data.l + length;
var rfx = parse_UncheckedRfX(data, 16);
var relId = parse_XLNullableWideString(data);
var loc = parse_XLWideString(data);
var tooltip = parse_XLWideString(data);
var display = parse_XLWideString(data);
data.l = end;
var o = ({rfx:rfx, relId:relI... | javascript | function parse_BrtHLink(data, length) {
var end = data.l + length;
var rfx = parse_UncheckedRfX(data, 16);
var relId = parse_XLNullableWideString(data);
var loc = parse_XLWideString(data);
var tooltip = parse_XLWideString(data);
var display = parse_XLWideString(data);
data.l = end;
var o = ({rfx:rfx, relId:relI... | [
"function",
"parse_BrtHLink",
"(",
"data",
",",
"length",
")",
"{",
"var",
"end",
"=",
"data",
".",
"l",
"+",
"length",
";",
"var",
"rfx",
"=",
"parse_UncheckedRfX",
"(",
"data",
",",
"16",
")",
";",
"var",
"relId",
"=",
"parse_XLNullableWideString",
"("... | /* [MS-XLSB] 2.4.662 BrtHLink | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"4",
".",
"662",
"BrtHLink"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L13638-L13649 | train | Parse a BrtHLink | [
30522,
3853,
11968,
30524,
4895,
5403,
18141,
12881,
2595,
1006,
2951,
1010,
2385,
1007,
1025,
13075,
2128,
21273,
1027,
11968,
3366,
1035,
28712,
11231,
4571,
3468,
22517,
3367,
4892,
1006,
2951,
1007,
1025,
13075,
8840,
2278,
1027,
11968,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jhipster/generator-jhipster | generators/aws-containers/lib/cloudFormation.js | _doesEventContainsNestedStackId | function _doesEventContainsNestedStackId(stack) {
if (stack.ResourceType !== 'AWS::CloudFormation::Stack') {
return false;
}
if (stack.ResourceStatusReason !== 'Resource creation Initiated') {
return false;
}
if (stack.ResourceStatus !== 'CREATE_IN_PROGRESS') {
return false;
... | javascript | function _doesEventContainsNestedStackId(stack) {
if (stack.ResourceType !== 'AWS::CloudFormation::Stack') {
return false;
}
if (stack.ResourceStatusReason !== 'Resource creation Initiated') {
return false;
}
if (stack.ResourceStatus !== 'CREATE_IN_PROGRESS') {
return false;
... | [
"function",
"_doesEventContainsNestedStackId",
"(",
"stack",
")",
"{",
"if",
"(",
"stack",
".",
"ResourceType",
"!==",
"'AWS::CloudFormation::Stack'",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"stack",
".",
"ResourceStatusReason",
"!==",
"'Resource creation ... | Check if the stack event contains the name a Nested Stack name.
@param stack The StackEvent object.
@returns {boolean} true if the object contain a Nested Stack name, false otherwise.
@private | [
"Check",
"if",
"the",
"stack",
"event",
"contains",
"the",
"name",
"a",
"Nested",
"Stack",
"name",
"."
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/aws-containers/lib/cloudFormation.js#L266-L281 | train | Returns true if the event contains a nested stack ID | [
30522,
3853,
1035,
2515,
18697,
3372,
8663,
18249,
2015,
5267,
3064,
9153,
18009,
2094,
1006,
9991,
1007,
1063,
2065,
1006,
9991,
1012,
7692,
13874,
999,
1027,
1027,
1005,
22091,
2015,
1024,
1024,
6112,
14192,
3370,
1024,
1024,
9991,
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... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (bodyWrap, connectstatus) {
var errors = bodyWrap.getElementsByTagNameNS(Strophe.NS.STREAM, "error");
if (errors.length === 0) {
return false;
}
var error = errors[0];
var condition = "";
var text = "";
var ns = "urn:ietf:params:xm... | javascript | function (bodyWrap, connectstatus) {
var errors = bodyWrap.getElementsByTagNameNS(Strophe.NS.STREAM, "error");
if (errors.length === 0) {
return false;
}
var error = errors[0];
var condition = "";
var text = "";
var ns = "urn:ietf:params:xm... | [
"function",
"(",
"bodyWrap",
",",
"connectstatus",
")",
"{",
"var",
"errors",
"=",
"bodyWrap",
".",
"getElementsByTagNameNS",
"(",
"Strophe",
".",
"NS",
".",
"STREAM",
",",
"\"error\"",
")",
";",
"if",
"(",
"errors",
".",
"length",
"===",
"0",
")",
"{",
... | PrivateFunction: _check_streamerror
_Private_ checks a message for stream:error
Parameters:
(Strophe.Request) bodyWrap - The received stanza.
connectstatus - The ConnectStatus that will be set on error.
Returns:
true if there was a streamerror, false otherwise. | [
"PrivateFunction",
":",
"_check_streamerror",
"_Private_",
"checks",
"a",
"message",
"for",
"stream",
":",
"error"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L4803-L4843 | train | An error message from the server | [
30522,
3853,
1006,
2303,
13088,
9331,
1010,
8539,
29336,
2271,
1007,
1063,
13075,
10697,
1027,
2303,
13088,
9331,
1012,
2131,
12260,
8163,
3762,
15900,
18442,
3619,
1006,
2358,
18981,
5369,
1012,
24978,
1012,
5460,
1010,
1000,
7561,
1000,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
swimlane/ngx-datatable | release/utils/sort.js | sortRows | function sortRows(rows, columns, dirs) {
if (!rows)
return [];
if (!dirs || !dirs.length || !columns)
return rows.slice();
/**
* record the row ordering of results from prior sort operations (if applicable)
* this is necessary to guarantee stable sorting behavior
*/
var ro... | javascript | function sortRows(rows, columns, dirs) {
if (!rows)
return [];
if (!dirs || !dirs.length || !columns)
return rows.slice();
/**
* record the row ordering of results from prior sort operations (if applicable)
* this is necessary to guarantee stable sorting behavior
*/
var ro... | [
"function",
"sortRows",
"(",
"rows",
",",
"columns",
",",
"dirs",
")",
"{",
"if",
"(",
"!",
"rows",
")",
"return",
"[",
"]",
";",
"if",
"(",
"!",
"dirs",
"||",
"!",
"dirs",
".",
"length",
"||",
"!",
"columns",
")",
"return",
"rows",
".",
"slice",... | creates a shallow copy of the `rows` input and returns the sorted copy. this function
does not sort the `rows` argument in place | [
"creates",
"a",
"shallow",
"copy",
"of",
"the",
"rows",
"input",
"and",
"returns",
"the",
"sorted",
"copy",
".",
"this",
"function",
"does",
"not",
"sort",
"the",
"rows",
"argument",
"in",
"place"
] | d7df15a070282a169524dba51d9572008b74804c | https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/sort.js#L72-L130 | train | Sort rows according to the columns and dirs | [
30522,
3853,
4066,
10524,
2015,
1006,
10281,
1010,
7753,
1010,
16101,
2015,
1007,
1063,
2065,
1006,
999,
10281,
1007,
2709,
1031,
1033,
1025,
2065,
1006,
999,
16101,
2015,
1064,
1064,
999,
16101,
2015,
1012,
3091,
1064,
1064,
999,
7753,
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.fl/src/sap/ui/fl/Utils.js | function(){
var oUshellContainer = Utils.getUshellContainer();
if (oUshellContainer) {
var oURLParser = oUshellContainer.getService("URLParsing");
var oParsedHash = oURLParser.parseShellHash(hasher.getHash());
return oParsedHash ? oParsedHash : { };
}
return { };
} | javascript | function(){
var oUshellContainer = Utils.getUshellContainer();
if (oUshellContainer) {
var oURLParser = oUshellContainer.getService("URLParsing");
var oParsedHash = oURLParser.parseShellHash(hasher.getHash());
return oParsedHash ? oParsedHash : { };
}
return { };
} | [
"function",
"(",
")",
"{",
"var",
"oUshellContainer",
"=",
"Utils",
".",
"getUshellContainer",
"(",
")",
";",
"if",
"(",
"oUshellContainer",
")",
"{",
"var",
"oURLParser",
"=",
"oUshellContainer",
".",
"getService",
"(",
"\"URLParsing\"",
")",
";",
"var",
"o... | Returns URL hash when ushell container is available
@returns {object} Returns the parsed URL hash object or an empty object if ushell container is not available | [
"Returns",
"URL",
"hash",
"when",
"ushell",
"container",
"is",
"available"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L891-L899 | train | Returns the hash of the current shell. | [
30522,
3853,
1006,
1007,
1063,
13075,
15068,
4095,
5349,
8663,
18249,
2121,
1027,
21183,
12146,
1012,
2131,
20668,
5349,
8663,
18249,
2121,
1006,
1007,
1025,
2065,
1006,
15068,
4095,
5349,
8663,
18249,
2121,
1007,
1063,
13075,
2256,
14277,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/prefer-rest-params.js | report | function report(reference) {
context.report({
node: reference.identifier,
loc: reference.identifier.loc,
message: "Use the rest parameters instead of 'arguments'."
});
} | javascript | function report(reference) {
context.report({
node: reference.identifier,
loc: reference.identifier.loc,
message: "Use the rest parameters instead of 'arguments'."
});
} | [
"function",
"report",
"(",
"reference",
")",
"{",
"context",
".",
"report",
"(",
"{",
"node",
":",
"reference",
".",
"identifier",
",",
"loc",
":",
"reference",
".",
"identifier",
".",
"loc",
",",
"message",
":",
"\"Use the rest parameters instead of 'arguments'... | Reports a given reference.
@param {eslint-scope.Reference} reference - A reference to report.
@returns {void} | [
"Reports",
"a",
"given",
"reference",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-rest-params.js#L85-L91 | train | Report an error for a given reference. | [
30522,
3853,
3189,
1006,
4431,
1007,
1063,
6123,
1012,
3189,
1006,
1063,
13045,
1024,
4431,
1012,
8909,
4765,
18095,
1010,
8840,
2278,
1024,
4431,
1012,
8909,
4765,
18095,
1012,
8840,
2278,
1010,
4471,
1024,
1000,
2224,
1996,
2717,
11709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | src/helpers/helpers.core.js | function(value) {
if (Array.isArray && Array.isArray(value)) {
return true;
}
var type = Object.prototype.toString.call(value);
if (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {
return true;
}
return false;
} | javascript | function(value) {
if (Array.isArray && Array.isArray(value)) {
return true;
}
var type = Object.prototype.toString.call(value);
if (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {
return true;
}
return false;
} | [
"function",
"(",
"value",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"&&",
"Array",
".",
"isArray",
"(",
"value",
")",
")",
"{",
"return",
"true",
";",
"}",
"var",
"type",
"=",
"Object",
".",
"prototype",
".",
"toString",
".",
"call",
"(",
"valu... | Returns true if `value` is an array (including typed arrays), else returns false.
@param {*} value - The value to test.
@returns {boolean}
@function | [
"Returns",
"true",
"if",
"value",
"is",
"an",
"array",
"(",
"including",
"typed",
"arrays",
")",
"else",
"returns",
"false",
"."
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/helpers/helpers.core.js#L40-L49 | train | Check if value is an array | [
30522,
3853,
1006,
3643,
1007,
1063,
2065,
1006,
9140,
1012,
18061,
11335,
2100,
1004,
1004,
9140,
1012,
18061,
11335,
2100,
1006,
3643,
1007,
1007,
1063,
2709,
2995,
1025,
1065,
13075,
2828,
1027,
4874,
1012,
8773,
1012,
2000,
3367,
4892,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | suppressDefaultAndStopPropagation | function suppressDefaultAndStopPropagation(oEvent) {
var bTargetIsBlockLayer = oEvent.target === this.$blockLayer.get(0),
oTabbable;
if (bTargetIsBlockLayer && oEvent.type === 'keydown' && oEvent.keyCode === 9) {
// Special handling for "tab" keydown: redirect to next element before or after busy section... | javascript | function suppressDefaultAndStopPropagation(oEvent) {
var bTargetIsBlockLayer = oEvent.target === this.$blockLayer.get(0),
oTabbable;
if (bTargetIsBlockLayer && oEvent.type === 'keydown' && oEvent.keyCode === 9) {
// Special handling for "tab" keydown: redirect to next element before or after busy section... | [
"function",
"suppressDefaultAndStopPropagation",
"(",
"oEvent",
")",
"{",
"var",
"bTargetIsBlockLayer",
"=",
"oEvent",
".",
"target",
"===",
"this",
".",
"$blockLayer",
".",
"get",
"(",
"0",
")",
",",
"oTabbable",
";",
"if",
"(",
"bTargetIsBlockLayer",
"&&",
"... | Handler which suppresses event bubbling for blocked section
@param {object} oEvent The event on the suppressed DOM
@private | [
"Handler",
"which",
"suppresses",
"event",
"bubbling",
"for",
"blocked",
"section"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/BlockLayerUtils.js#L215-L241 | train | This function is called by the event handler when the event is handled by the Local Busy Indicator. | [
30522,
3853,
16081,
3207,
7011,
11314,
29560,
14399,
21572,
4502,
12540,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
18411,
2906,
18150,
2483,
23467,
24314,
1027,
1051,
18697,
3372,
1012,
4539,
1027,
1027,
1027,
2023,
1012,
1002,
3796,
24314,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Configuration.js | function(bRTL) {
check(bRTL === null || typeof bRTL === "boolean", "bRTL must be null or a boolean");
var oldRTL = this.getRTL(),
mChanges;
this.rtl = bRTL;
if ( oldRTL != this.getRTL() ) { // also take the derived RTL flag into account for the before/after comparison!
mChanges = this._collect();
... | javascript | function(bRTL) {
check(bRTL === null || typeof bRTL === "boolean", "bRTL must be null or a boolean");
var oldRTL = this.getRTL(),
mChanges;
this.rtl = bRTL;
if ( oldRTL != this.getRTL() ) { // also take the derived RTL flag into account for the before/after comparison!
mChanges = this._collect();
... | [
"function",
"(",
"bRTL",
")",
"{",
"check",
"(",
"bRTL",
"===",
"null",
"||",
"typeof",
"bRTL",
"===",
"\"boolean\"",
",",
"\"bRTL must be null or a boolean\"",
")",
";",
"var",
"oldRTL",
"=",
"this",
".",
"getRTL",
"(",
")",
",",
"mChanges",
";",
"this",
... | Sets the character orientation mode to be used from now on.
Can either be set to a concrete value (true meaning right-to-left,
false meaning left-to-right) or to <code>null</code> which means that
the character orientation mode should be derived from the current
language (incl. region) setting.
After changing the cha... | [
"Sets",
"the",
"character",
"orientation",
"mode",
"to",
"be",
"used",
"from",
"now",
"on",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Configuration.js#L1071-L1083 | train | Sets the RTL flag of the node. | [
30522,
3853,
1006,
7987,
19646,
1007,
1063,
4638,
1006,
7987,
19646,
1027,
1027,
1027,
19701,
1064,
1064,
30524,
1010,
1000,
7987,
19646,
2442,
2022,
19701,
2030,
1037,
22017,
20898,
1000,
1007,
1025,
13075,
2214,
5339,
2140,
1027,
2023,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/routing/Router.js | function () {
if (this.bIsDestroyed) {
return this;
}
EventProvider.prototype.destroy.apply(this);
// destroy the view cache
if (this._oViews) {
this._oViews.destroy();
this._oViews = null;
}
if (!this._bIsInitialized) {
Log.info("Router is not initialized, but got des... | javascript | function () {
if (this.bIsDestroyed) {
return this;
}
EventProvider.prototype.destroy.apply(this);
// destroy the view cache
if (this._oViews) {
this._oViews.destroy();
this._oViews = null;
}
if (!this._bIsInitialized) {
Log.info("Router is not initialized, but got des... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"bIsDestroyed",
")",
"{",
"return",
"this",
";",
"}",
"EventProvider",
".",
"prototype",
".",
"destroy",
".",
"apply",
"(",
"this",
")",
";",
"// destroy the view cache",
"if",
"(",
"this",
".",
"_oViews... | Removes the router from the hash changer @see sap.ui.core.routing.HashChanger
@public
@returns { sap.ui.core.routing.Router } this for chaining. | [
"Removes",
"the",
"router",
"from",
"the",
"hash",
"changer",
"@see",
"sap",
".",
"ui",
".",
"core",
".",
"routing",
".",
"HashChanger"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L459-L503 | train | Destroys the event provider | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
20377,
6155,
13181,
20821,
1007,
1063,
2709,
2023,
1025,
1065,
2724,
21572,
17258,
2121,
1012,
8773,
1012,
6033,
1012,
6611,
1006,
2023,
1007,
1025,
1013,
1013,
6033,
1996,
3193,
17053,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | lib/jsdoc/ui5/plugin.js | resolveModuleName | function resolveModuleName(base, name) {
var stack = base.split('/');
stack.pop();
name.split('/').forEach(function(segment, i) {
if ( segment == '..' ) {
stack.pop();
} else if ( segment === '.' ) {
// ignore
} else {
if ( i === 0 ) {
stack = [];
}
stack.push(segment);
}
});
return stac... | javascript | function resolveModuleName(base, name) {
var stack = base.split('/');
stack.pop();
name.split('/').forEach(function(segment, i) {
if ( segment == '..' ) {
stack.pop();
} else if ( segment === '.' ) {
// ignore
} else {
if ( i === 0 ) {
stack = [];
}
stack.push(segment);
}
});
return stac... | [
"function",
"resolveModuleName",
"(",
"base",
",",
"name",
")",
"{",
"var",
"stack",
"=",
"base",
".",
"split",
"(",
"'/'",
")",
";",
"stack",
".",
"pop",
"(",
")",
";",
"name",
".",
"split",
"(",
"'/'",
")",
".",
"forEach",
"(",
"function",
"(",
... | /*
resolves relative AMD module identifiers relative to a given base name | [
"/",
"*",
"resolves",
"relative",
"AMD",
"module",
"identifiers",
"relative",
"to",
"a",
"given",
"base",
"name"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/ui5/plugin.js#L229-L245 | train | Resolve a module name | [
30522,
3853,
10663,
5302,
8566,
20844,
4168,
1006,
2918,
1010,
2171,
1007,
1063,
13075,
9991,
1027,
2918,
30524,
1005,
1007,
1063,
9991,
1012,
3769,
1006,
1007,
1025,
1065,
2842,
2065,
1006,
6903,
1027,
1027,
1027,
1005,
1012,
1005,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js | visitNode | function visitNode(oNode, oWithControl) {
var fnVisitor;
function visitAttributesAndChildren() {
return visitAttributes(oNode, oWithControl).then(function () {
return visitChildNodes(oNode, oWithControl);
}).then(function () {
if (fnSupportInfo) {
fnSupportInfo({context:oNode, env:... | javascript | function visitNode(oNode, oWithControl) {
var fnVisitor;
function visitAttributesAndChildren() {
return visitAttributes(oNode, oWithControl).then(function () {
return visitChildNodes(oNode, oWithControl);
}).then(function () {
if (fnSupportInfo) {
fnSupportInfo({context:oNode, env:... | [
"function",
"visitNode",
"(",
"oNode",
",",
"oWithControl",
")",
"{",
"var",
"fnVisitor",
";",
"function",
"visitAttributesAndChildren",
"(",
")",
"{",
"return",
"visitAttributes",
"(",
"oNode",
",",
"oWithControl",
")",
".",
"then",
"(",
"function",
"(",
")",... | Visits the given node.
@param {Node} oNode the XML DOM node
@param {sap.ui.core.template._with} oWithControl the "with" control
@returns {sap.ui.base.SyncPromise}
A sync promise which resolves with <code>undefined</code> as soon as visiting is
done, or is rejected with a corresponding error if visiting fails.
@throws ... | [
"Visits",
"the",
"given",
"node",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L1799-L1873 | train | Visit a node | [
30522,
3853,
3942,
3630,
3207,
1006,
21058,
3207,
1010,
27593,
8939,
8663,
13181,
2140,
1007,
1063,
13075,
1042,
2078,
11365,
15660,
1025,
3853,
3942,
19321,
3089,
8569,
4570,
5685,
19339,
7389,
1006,
1007,
1063,
2709,
3942,
19321,
3089,
85... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
lovell/sharp | lib/resize.js | trim | function trim (threshold) {
if (!is.defined(threshold)) {
this.options.trimThreshold = 10;
} else if (is.number(threshold) && threshold > 0) {
this.options.trimThreshold = threshold;
} else {
throw is.invalidParameterError('threshold', 'number greater than zero', threshold);
}
return this;
} | javascript | function trim (threshold) {
if (!is.defined(threshold)) {
this.options.trimThreshold = 10;
} else if (is.number(threshold) && threshold > 0) {
this.options.trimThreshold = threshold;
} else {
throw is.invalidParameterError('threshold', 'number greater than zero', threshold);
}
return this;
} | [
"function",
"trim",
"(",
"threshold",
")",
"{",
"if",
"(",
"!",
"is",
".",
"defined",
"(",
"threshold",
")",
")",
"{",
"this",
".",
"options",
".",
"trimThreshold",
"=",
"10",
";",
"}",
"else",
"if",
"(",
"is",
".",
"number",
"(",
"threshold",
")",... | Trim "boring" pixels from all edges that contain values similar to the top-left pixel.
The `info` response Object will contain `trimOffsetLeft` and `trimOffsetTop` properties.
@param {Number} [threshold=10] the allowed difference from the top-left pixel, a number greater than zero.
@returns {Sharp}
@throws {Error} Inva... | [
"Trim",
"boring",
"pixels",
"from",
"all",
"edges",
"that",
"contain",
"values",
"similar",
"to",
"the",
"top",
"-",
"left",
"pixel",
".",
"The",
"info",
"response",
"Object",
"will",
"contain",
"trimOffsetLeft",
"and",
"trimOffsetTop",
"properties",
"."
] | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/resize.js#L369-L378 | train | Trim the from the specified threshold | [
30522,
3853,
12241,
1006,
11207,
1007,
1063,
2065,
1006,
999,
2003,
1012,
4225,
1006,
11207,
1007,
1007,
1063,
2023,
1012,
7047,
1012,
12241,
2705,
21898,
11614,
1027,
2184,
1025,
1065,
2842,
2065,
1006,
2003,
1012,
2193,
1006,
11207,
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... |
adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js | _convertToNumber | function _convertToNumber(str) {
if (typeof str !== "string") {
return { isNumber: false, value: null };
}
var val = parseFloat(+str, 10),
isNum = (typeof val === "number") && !isNaN(val) &&
(val !== Infinity) && (val !== -Infinity);
return {... | javascript | function _convertToNumber(str) {
if (typeof str !== "string") {
return { isNumber: false, value: null };
}
var val = parseFloat(+str, 10),
isNum = (typeof val === "number") && !isNaN(val) &&
(val !== Infinity) && (val !== -Infinity);
return {... | [
"function",
"_convertToNumber",
"(",
"str",
")",
"{",
"if",
"(",
"typeof",
"str",
"!==",
"\"string\"",
")",
"{",
"return",
"{",
"isNumber",
":",
"false",
",",
"value",
":",
"null",
"}",
";",
"}",
"var",
"val",
"=",
"parseFloat",
"(",
"+",
"str",
",",... | If string is a number, then convert it.
@param {string} str value parsed from page.
@return { isNumber: boolean, value: ?number } | [
"If",
"string",
"is",
"a",
"number",
"then",
"convert",
"it",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js#L64-L77 | train | Convert string to number | [
30522,
3853,
1035,
10463,
2669,
29440,
1006,
2358,
2099,
1007,
1063,
2065,
1006,
2828,
11253,
2358,
2099,
999,
1027,
1027,
1000,
5164,
1000,
1007,
1063,
2709,
1063,
3475,
29440,
1024,
6270,
1010,
3643,
1024,
19701,
1065,
1025,
1065,
13075,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js | function (aArray, vExpectedPropertyValue, sPropertyName) {
var iIndex = Utils.findIndex(aArray, vExpectedPropertyValue, sPropertyName);
return iIndex < 0 ? null : aArray[iIndex];
} | javascript | function (aArray, vExpectedPropertyValue, sPropertyName) {
var iIndex = Utils.findIndex(aArray, vExpectedPropertyValue, sPropertyName);
return iIndex < 0 ? null : aArray[iIndex];
} | [
"function",
"(",
"aArray",
",",
"vExpectedPropertyValue",
",",
"sPropertyName",
")",
"{",
"var",
"iIndex",
"=",
"Utils",
".",
"findIndex",
"(",
"aArray",
",",
"vExpectedPropertyValue",
",",
"sPropertyName",
")",
";",
"return",
"iIndex",
"<",
"0",
"?",
"null",
... | Returns the object inside the given array, where the property with the given name has
the given expected value.
@param {object[]} aArray
some array
@param {any} vExpectedPropertyValue
expected value of the property with given name
@param {string} [sPropertyName="name"]
some property name
@returns {object}
the object f... | [
"Returns",
"the",
"object",
"inside",
"the",
"given",
"array",
"where",
"the",
"property",
"with",
"the",
"given",
"name",
"has",
"the",
"given",
"expected",
"value",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L613-L617 | train | Returns the value of the given property in the given array | [
30522,
3853,
1006,
9779,
11335,
2100,
1010,
2310,
2595,
5051,
10985,
21572,
4842,
3723,
10175,
5657,
1010,
11867,
18981,
15010,
18442,
1007,
1063,
13075,
2462,
13629,
2595,
1027,
21183,
12146,
1012,
2424,
22254,
10288,
1006,
9779,
11335,
2100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | tools/internal-rules/no-invalid-meta.js | hasMetaDocsCategory | function hasMetaDocsCategory(metaPropertyNode) {
const metaDocs = getPropertyFromObject("docs", metaPropertyNode.value);
return metaDocs && getPropertyFromObject("category", metaDocs.value);
} | javascript | function hasMetaDocsCategory(metaPropertyNode) {
const metaDocs = getPropertyFromObject("docs", metaPropertyNode.value);
return metaDocs && getPropertyFromObject("category", metaDocs.value);
} | [
"function",
"hasMetaDocsCategory",
"(",
"metaPropertyNode",
")",
"{",
"const",
"metaDocs",
"=",
"getPropertyFromObject",
"(",
"\"docs\"",
",",
"metaPropertyNode",
".",
"value",
")",
";",
"return",
"metaDocs",
"&&",
"getPropertyFromObject",
"(",
"\"category\"",
",",
... | Whether this `meta` ObjectExpression has a `docs.category` property defined or not.
@param {ASTNode} metaPropertyNode The `meta` ObjectExpression for this rule.
@returns {boolean} `true` if a `docs.category` property exists. | [
"Whether",
"this",
"meta",
"ObjectExpression",
"has",
"a",
"docs",
".",
"category",
"property",
"defined",
"or",
"not",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/tools/internal-rules/no-invalid-meta.js#L74-L78 | train | Checks if the metaDocs property has a category property | [
30522,
3853,
2038,
11368,
9365,
6169,
16280,
20255,
2100,
1006,
18804,
21572,
4842,
25680,
10244,
1007,
1063,
9530,
3367,
18804,
3527,
6169,
1027,
2131,
21572,
4842,
3723,
19699,
19506,
2497,
20614,
1006,
1000,
9986,
2015,
1000,
1010,
18804,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/api/v0.1/users.js | deleteUser | function deleteUser(options) {
return models.Base.transaction((t) => {
options.transacting = t;
return Promise.all([
models.Accesstoken.destroyByUser(options),
models.Refreshtoken.destroyByUser(options),
models.Post... | javascript | function deleteUser(options) {
return models.Base.transaction((t) => {
options.transacting = t;
return Promise.all([
models.Accesstoken.destroyByUser(options),
models.Refreshtoken.destroyByUser(options),
models.Post... | [
"function",
"deleteUser",
"(",
"options",
")",
"{",
"return",
"models",
".",
"Base",
".",
"transaction",
"(",
"(",
"t",
")",
"=>",
"{",
"options",
".",
"transacting",
"=",
"t",
";",
"return",
"Promise",
".",
"all",
"(",
"[",
"models",
".",
"Accesstoken... | ### Delete User
Make the call to the Model layer
@param {Object} options | [
"###",
"Delete",
"User",
"Make",
"the",
"call",
"to",
"the",
"Model",
"layer"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/users.js#L201-L217 | train | Delete user | [
30522,
3853,
3972,
12870,
20330,
1006,
7047,
1007,
1063,
2709,
4275,
1012,
2918,
1012,
12598,
1006,
1006,
1056,
1007,
1027,
1028,
1063,
7047,
1012,
9099,
18908,
2075,
1027,
1056,
1025,
2709,
4872,
1012,
2035,
1006,
1031,
4275,
1012,
3229,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | bits/28_binstructs.js | parse_ClipboardFormatOrString | function parse_ClipboardFormatOrString(o, w/*:number*/)/*:string*/ {
// $FlowIgnore
var ClipFmt = {2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"};
var m/*:number*/ = o.read_shift(4);
switch(m) {
case 0x00000000: return "";
case 0xffffffff: case 0xfffffffe: return ClipFmt[o.read_shift(4)]||"";
}
if(m > ... | javascript | function parse_ClipboardFormatOrString(o, w/*:number*/)/*:string*/ {
// $FlowIgnore
var ClipFmt = {2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"};
var m/*:number*/ = o.read_shift(4);
switch(m) {
case 0x00000000: return "";
case 0xffffffff: case 0xfffffffe: return ClipFmt[o.read_shift(4)]||"";
}
if(m > ... | [
"function",
"parse_ClipboardFormatOrString",
"(",
"o",
",",
"w",
"/*:number*/",
")",
"/*:string*/",
"{",
"// $FlowIgnore",
"var",
"ClipFmt",
"=",
"{",
"2",
":",
"\"BITMAP\"",
",",
"3",
":",
"\"METAFILEPICT\"",
",",
"8",
":",
"\"DIB\"",
",",
"14",
":",
"\"ENH... | /* [MS-OLEDS] 2.3.1 and 2.3.2 | [
"/",
"*",
"[",
"MS",
"-",
"OLEDS",
"]",
"2",
".",
"3",
".",
"1",
"and",
"2",
".",
"3",
".",
"2"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/28_binstructs.js#L266-L277 | train | Parse a Clipboard format or string | [
30522,
3853,
11968,
3366,
1035,
12528,
6277,
14192,
18926,
18886,
3070,
1006,
1051,
1010,
1059,
1013,
1008,
1024,
2193,
1008,
1013,
1007,
1013,
1008,
1024,
5164,
1008,
1013,
1063,
1013,
1013,
1002,
4834,
23773,
5686,
13075,
12528,
16715,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | lib/jsdoc/transform-apijson-for-sdk.js | extractSamplesFromDocuIndex | function extractSamplesFromDocuIndex(oChainObject) {
// If we have not extracted docuPath we return early
if (!oChainObject.docuPath) {
return oChainObject;
}
return new Promise(function(oResolve) {
// Join .library path with relative docuindex.json path
let sPath = path.join(path.dirname(oChainObject.... | javascript | function extractSamplesFromDocuIndex(oChainObject) {
// If we have not extracted docuPath we return early
if (!oChainObject.docuPath) {
return oChainObject;
}
return new Promise(function(oResolve) {
// Join .library path with relative docuindex.json path
let sPath = path.join(path.dirname(oChainObject.... | [
"function",
"extractSamplesFromDocuIndex",
"(",
"oChainObject",
")",
"{",
"// If we have not extracted docuPath we return early",
"if",
"(",
"!",
"oChainObject",
".",
"docuPath",
")",
"{",
"return",
"oChainObject",
";",
"}",
"return",
"new",
"Promise",
"(",
"function",
... | Adds to the passed object array with entities which have explored samples
@param {object} oChainObject chain object
@returns {object} chain object | [
"Adds",
"to",
"the",
"passed",
"object",
"array",
"with",
"entities",
"which",
"have",
"explored",
"samples"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/transform-apijson-for-sdk.js#L847-L873 | train | Extract samples from docuindex. json | [
30522,
3853,
27059,
16613,
4244,
19699,
5358,
3527,
10841,
22254,
10288,
1006,
28166,
8113,
16429,
20614,
1007,
1063,
1013,
1013,
2065,
2057,
2031,
2025,
15901,
9986,
6279,
8988,
2057,
2709,
2220,
2065,
1006,
999,
28166,
8113,
16429,
20614,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/config/config-file.js | applyExtends | function applyExtends(config, configContext, filePath) {
const extendsList = Array.isArray(config.extends) ? config.extends : [config.extends];
// Make the last element in an array take the highest precedence
const flattenedConfig = extendsList.reduceRight((previousValue, extendedConfigReference) => {
... | javascript | function applyExtends(config, configContext, filePath) {
const extendsList = Array.isArray(config.extends) ? config.extends : [config.extends];
// Make the last element in an array take the highest precedence
const flattenedConfig = extendsList.reduceRight((previousValue, extendedConfigReference) => {
... | [
"function",
"applyExtends",
"(",
"config",
",",
"configContext",
",",
"filePath",
")",
"{",
"const",
"extendsList",
"=",
"Array",
".",
"isArray",
"(",
"config",
".",
"extends",
")",
"?",
"config",
".",
"extends",
":",
"[",
"config",
".",
"extends",
"]",
... | Applies values from the "extends" field in a configuration file.
@param {Object} config The configuration information.
@param {Config} configContext Plugin context for the config instance
@param {string} filePath The file path from which the configuration information
was loaded.
@returns {Object} A new configuration ob... | [
"Applies",
"values",
"from",
"the",
"extends",
"field",
"in",
"a",
"configuration",
"file",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-file.js#L380-L411 | train | Apply an extended config to the given config | [
30522,
3853,
6611,
10288,
6528,
5104,
1006,
9530,
8873,
2290,
1010,
9530,
8873,
18195,
28040,
18413,
1010,
5371,
15069,
1007,
1063,
9530,
3367,
8908,
9863,
1027,
9140,
1012,
18061,
11335,
2100,
1006,
9530,
8873,
2290,
1012,
8908,
1007,
1029... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ComponentContainer.js | setContainerComponent | function setContainerComponent(oComponentContainer, vComponent, bSuppressInvalidate, bDestroyOldComponent) {
// find the reference to the current component and to the old component
var oComponent = typeof vComponent === "string" ? Core.getComponent(vComponent) : vComponent;
var oOldComponent = oComponentContainer... | javascript | function setContainerComponent(oComponentContainer, vComponent, bSuppressInvalidate, bDestroyOldComponent) {
// find the reference to the current component and to the old component
var oComponent = typeof vComponent === "string" ? Core.getComponent(vComponent) : vComponent;
var oOldComponent = oComponentContainer... | [
"function",
"setContainerComponent",
"(",
"oComponentContainer",
",",
"vComponent",
",",
"bSuppressInvalidate",
",",
"bDestroyOldComponent",
")",
"{",
"// find the reference to the current component and to the old component",
"var",
"oComponent",
"=",
"typeof",
"vComponent",
"===... | /*
Helper function to set the new Component of the container. | [
"/",
"*",
"Helper",
"function",
"to",
"set",
"the",
"new",
"Component",
"of",
"the",
"container",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/ComponentContainer.js#L178-L203 | train | Sets the component to the container | [
30522,
3853,
2275,
8663,
18249,
2121,
9006,
29513,
3372,
1006,
1051,
9006,
29513,
3372,
8663,
18249,
2121,
1010,
18315,
25377,
5643,
3372,
1010,
18667,
6279,
20110,
2378,
10175,
8524,
2618,
1010,
1038,
6155,
13181,
7677,
6392,
9006,
29513,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/closure/goog/ui/charpicker.js | onBeforeShow | function onBeforeShow() {
var trigger = self.hc_.getAnchorElement();
var ch = self.getChar_(trigger);
if (ch) {
goog.dom.setTextContent(self.zoomEl_, self.displayChar_(ch));
goog.dom.setTextContent(self.unicodeEl_, goog.i18n.uChar.toHexString(ch));
// Clear the character name since we don'... | javascript | function onBeforeShow() {
var trigger = self.hc_.getAnchorElement();
var ch = self.getChar_(trigger);
if (ch) {
goog.dom.setTextContent(self.zoomEl_, self.displayChar_(ch));
goog.dom.setTextContent(self.unicodeEl_, goog.i18n.uChar.toHexString(ch));
// Clear the character name since we don'... | [
"function",
"onBeforeShow",
"(",
")",
"{",
"var",
"trigger",
"=",
"self",
".",
"hc_",
".",
"getAnchorElement",
"(",
")",
";",
"var",
"ch",
"=",
"self",
".",
"getChar_",
"(",
"trigger",
")",
";",
"if",
"(",
"ch",
")",
"{",
"goog",
".",
"dom",
".",
... | Function called by hover card just before it is visible to collect data. | [
"Function",
"called",
"by",
"hover",
"card",
"just",
"before",
"it",
"is",
"visible",
"to",
"collect",
"data",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/closure/goog/ui/charpicker.js#L454-L469 | train | Called before the character is displayed | [
30522,
3853,
2006,
4783,
29278,
9953,
5004,
1006,
1007,
1063,
13075,
9495,
1027,
2969,
1012,
16731,
1035,
1012,
2131,
2319,
9905,
16570,
13665,
1006,
1007,
1025,
13075,
10381,
1027,
2969,
1012,
2131,
7507,
2099,
1035,
1006,
9495,
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... |
eslint/eslint | lib/rules/no-unmodified-loop-condition.js | registerConditionsToGroup | function registerConditionsToGroup(conditions) {
for (let i = 0; i < conditions.length; ++i) {
const condition = conditions[i];
if (condition.group) {
let group = groupMap.get(condition.group);
if (!group) {
gr... | javascript | function registerConditionsToGroup(conditions) {
for (let i = 0; i < conditions.length; ++i) {
const condition = conditions[i];
if (condition.group) {
let group = groupMap.get(condition.group);
if (!group) {
gr... | [
"function",
"registerConditionsToGroup",
"(",
"conditions",
")",
"{",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"conditions",
".",
"length",
";",
"++",
"i",
")",
"{",
"const",
"condition",
"=",
"conditions",
"[",
"i",
"]",
";",
"if",
"(",
"con... | Registers given conditions to the group the condition belongs to.
@param {LoopConditionInfo[]} conditions - A loop condition info to
register.
@returns {void} | [
"Registers",
"given",
"conditions",
"to",
"the",
"group",
"the",
"condition",
"belongs",
"to",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-unmodified-loop-condition.js#L207-L221 | train | Register conditions to group | [
30522,
3853,
4236,
8663,
20562,
16033,
17058,
1006,
3785,
1007,
1063,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026,
3785,
1012,
3091,
1025,
1009,
1009,
1045,
1007,
1063,
9530,
3367,
4650,
1027,
3785,
1031,
1045,
1033,
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... |
jgraph/mxgraph | javascript/mxClient.js | function(label, funct, doc)
{
doc = (doc != null) ? doc : document;
var button = doc.createElement('button');
mxUtils.write(button, label);
mxEvent.addListener(button, 'click', function(evt)
{
funct(evt);
});
return button;
} | javascript | function(label, funct, doc)
{
doc = (doc != null) ? doc : document;
var button = doc.createElement('button');
mxUtils.write(button, label);
mxEvent.addListener(button, 'click', function(evt)
{
funct(evt);
});
return button;
} | [
"function",
"(",
"label",
",",
"funct",
",",
"doc",
")",
"{",
"doc",
"=",
"(",
"doc",
"!=",
"null",
")",
"?",
"doc",
":",
"document",
";",
"var",
"button",
"=",
"doc",
".",
"createElement",
"(",
"'button'",
")",
";",
"mxUtils",
".",
"write",
"(",
... | Function: button
Returns a new button with the given level and function as an onclick
event handler.
(code)
document.body.appendChild(mxUtils.button('Test', function(evt)
{
alert('Hello, World!');
}));
(end)
Parameters:
label - String that represents the label of the button.
funct - Function to be called if the but... | [
"Function",
":",
"button"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L3337-L3350 | train | Creates a button element | [
30522,
3853,
1006,
3830,
1010,
4569,
6593,
1010,
9986,
1007,
1063,
9986,
1027,
1006,
9986,
999,
1027,
19701,
1007,
1029,
9986,
1024,
6254,
1025,
13075,
6462,
1027,
9986,
1012,
3443,
12260,
3672,
1006,
1005,
6462,
1005,
1007,
1025,
25630,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | function(oInstance) {
// activate the customizing configuration
var oUI5Manifest = this.getEntry("sap.ui5", true),
mExtensions = oUI5Manifest && oUI5Manifest["extends"] && oUI5Manifest["extends"].extensions;
if (!jQuery.isEmptyObject(mExtensions)) {
var CustomizingConfiguration = sap.ui.requireSync('sa... | javascript | function(oInstance) {
// activate the customizing configuration
var oUI5Manifest = this.getEntry("sap.ui5", true),
mExtensions = oUI5Manifest && oUI5Manifest["extends"] && oUI5Manifest["extends"].extensions;
if (!jQuery.isEmptyObject(mExtensions)) {
var CustomizingConfiguration = sap.ui.requireSync('sa... | [
"function",
"(",
"oInstance",
")",
"{",
"// activate the customizing configuration",
"var",
"oUI5Manifest",
"=",
"this",
".",
"getEntry",
"(",
"\"sap.ui5\"",
",",
"true",
")",
",",
"mExtensions",
"=",
"oUI5Manifest",
"&&",
"oUI5Manifest",
"[",
"\"extends\"",
"]",
... | Activates the customizing for the component or a dedicated component
instance when providing the component instance as parameter.
@param {sap.ui.core.Component} [oInstance] Reference to the Component instance
@private | [
"Activates",
"the",
"customizing",
"for",
"the",
"component",
"or",
"a",
"dedicated",
"component",
"instance",
"when",
"providing",
"the",
"component",
"instance",
"as",
"parameter",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Manifest.js#L694-L706 | train | Activates the customizing configuration for the component. | [
30522,
3853,
1006,
1051,
7076,
26897,
1007,
1063,
1013,
1013,
20544,
1996,
7661,
6026,
9563,
13075,
15068,
2072,
2629,
20799,
14081,
1027,
2023,
1012,
2131,
4765,
2854,
1006,
1000,
20066,
1012,
21318,
2629,
1000,
1010,
2995,
1007,
1010,
203... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jhipster/generator-jhipster | generators/cleanup.js | cleanupOldFiles | function cleanupOldFiles(generator) {
if (generator.isJhipsterVersionLessThan('3.2.0')) {
// removeFile and removeFolder methods should be called here for files and folders to cleanup
generator.removeFile(`${ANGULAR_DIR}components/form/uib-pager.config.js`);
generator.removeFile(`${ANGULAR_D... | javascript | function cleanupOldFiles(generator) {
if (generator.isJhipsterVersionLessThan('3.2.0')) {
// removeFile and removeFolder methods should be called here for files and folders to cleanup
generator.removeFile(`${ANGULAR_DIR}components/form/uib-pager.config.js`);
generator.removeFile(`${ANGULAR_D... | [
"function",
"cleanupOldFiles",
"(",
"generator",
")",
"{",
"if",
"(",
"generator",
".",
"isJhipsterVersionLessThan",
"(",
"'3.2.0'",
")",
")",
"{",
"// removeFile and removeFolder methods should be called here for files and folders to cleanup",
"generator",
".",
"removeFile",
... | Removes files that where generated in previous JHipster versions and therefore
need to be removed.
WARNING this only removes files created by the main generator. Each sub-generator
should clean-up its own files: see the `cleanup` method in entity/index.js for cleaning
up entities.
@param {any} generator - reference t... | [
"Removes",
"files",
"that",
"where",
"generated",
"in",
"previous",
"JHipster",
"versions",
"and",
"therefore",
"need",
"to",
"be",
"removed",
"."
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/cleanup.js#L41-L78 | train | Removes old files | [
30522,
3853,
27686,
11614,
8873,
4244,
1006,
13103,
1007,
1063,
2065,
1006,
13103,
1012,
2003,
3501,
19801,
3334,
27774,
3238,
21604,
1006,
1005,
1017,
1012,
1016,
1012,
1014,
1005,
1007,
1007,
1063,
1013,
1013,
6366,
8873,
2571,
1998,
6366... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js | function (oAnnotations, oSchema, oEntityContainer, oFunctionImport) {
var mAnnotations;
if (!oFunctionImport.parameter) {
return;
}
mAnnotations = Utils.getChildAnnotations(oAnnotations,
oSchema.namespace + "." + oEntityContainer.name, true);
oFunctionImport.parameter.forEach(
function (oPar... | javascript | function (oAnnotations, oSchema, oEntityContainer, oFunctionImport) {
var mAnnotations;
if (!oFunctionImport.parameter) {
return;
}
mAnnotations = Utils.getChildAnnotations(oAnnotations,
oSchema.namespace + "." + oEntityContainer.name, true);
oFunctionImport.parameter.forEach(
function (oPar... | [
"function",
"(",
"oAnnotations",
",",
"oSchema",
",",
"oEntityContainer",
",",
"oFunctionImport",
")",
"{",
"var",
"mAnnotations",
";",
"if",
"(",
"!",
"oFunctionImport",
".",
"parameter",
")",
"{",
"return",
";",
"}",
"mAnnotations",
"=",
"Utils",
".",
"get... | Visits all parameters of the given function import.
@param {object} oAnnotations
annotations "JSON"
@param {object} oSchema
OData data service schema
@param {object} oEntityContainer
the entity container
@param {object} oFunctionImport
a function import's V2 metadata object | [
"Visits",
"all",
"parameters",
"of",
"the",
"given",
"function",
"import",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L1079-L1094 | train | Adds the parameters of the function import | [
30522,
3853,
1006,
1051,
11639,
17287,
9285,
1010,
9808,
5403,
2863,
1010,
1051,
4765,
3012,
8663,
18249,
2121,
1010,
1997,
4609,
7542,
5714,
6442,
1007,
1063,
13075,
10856,
17287,
9285,
1025,
2065,
1006,
999,
1997,
4609,
7542,
5714,
6442,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/commons/color/get-background-color.js | elmPartiallyObscured | function elmPartiallyObscured(elm, bgElm, bgColor) {
var obscured =
elm !== bgElm && !dom.visuallyContains(elm, bgElm) && bgColor.alpha !== 0;
if (obscured) {
axe.commons.color.incompleteData.set('bgColor', 'elmPartiallyObscured');
}
return obscured;
} | javascript | function elmPartiallyObscured(elm, bgElm, bgColor) {
var obscured =
elm !== bgElm && !dom.visuallyContains(elm, bgElm) && bgColor.alpha !== 0;
if (obscured) {
axe.commons.color.incompleteData.set('bgColor', 'elmPartiallyObscured');
}
return obscured;
} | [
"function",
"elmPartiallyObscured",
"(",
"elm",
",",
"bgElm",
",",
"bgColor",
")",
"{",
"var",
"obscured",
"=",
"elm",
"!==",
"bgElm",
"&&",
"!",
"dom",
".",
"visuallyContains",
"(",
"elm",
",",
"bgElm",
")",
"&&",
"bgColor",
".",
"alpha",
"!==",
"0",
... | Determine if element is partially overlapped, triggering a Can't Tell result
@private
@param {Element} elm
@param {Element} bgElm
@param {Object} bgColor
@return {Boolean} | [
"Determine",
"if",
"element",
"is",
"partially",
"overlapped",
"triggering",
"a",
"Can",
"t",
"Tell",
"result"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/commons/color/get-background-color.js#L294-L301 | train | Check if an element is partially obscured | [
30522,
3853,
17709,
19362,
20925,
2135,
16429,
28817,
5596,
1006,
17709,
1010,
1038,
12439,
2213,
1010,
1038,
18195,
12898,
2099,
1007,
1063,
13075,
23649,
1027,
17709,
999,
1027,
1027,
1038,
12439,
2213,
1004,
1004,
999,
14383,
1012,
17453,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ksky521/nodeppt | packages/nodeppt-parser/lib/markdown/prism.js | checkLanguageOption | function checkLanguageOption(options, optionName) {
const language = options[optionName];
if (language !== undefined && loadPrismLang(language) === undefined) {
throw new Error(`Bad option ${optionName}: There is no Prism language '${language}'.`);
}
} | javascript | function checkLanguageOption(options, optionName) {
const language = options[optionName];
if (language !== undefined && loadPrismLang(language) === undefined) {
throw new Error(`Bad option ${optionName}: There is no Prism language '${language}'.`);
}
} | [
"function",
"checkLanguageOption",
"(",
"options",
",",
"optionName",
")",
"{",
"const",
"language",
"=",
"options",
"[",
"optionName",
"]",
";",
"if",
"(",
"language",
"!==",
"undefined",
"&&",
"loadPrismLang",
"(",
"language",
")",
"===",
"undefined",
")",
... | Checks whether an option represents a valid Prism language
@param {MarkdownItPrismOptions} options
The options that have been used to initialise the plugin.
@param optionName
The key of the option insides {@code options} that shall be checked.
@throws {Error} If the option is not set to a valid Prism language. | [
"Checks",
"whether",
"an",
"option",
"represents",
"a",
"valid",
"Prism",
"language"
] | ca77e29ef818c08b0522b31e3925b073cf159b9c | https://github.com/ksky521/nodeppt/blob/ca77e29ef818c08b0522b31e3925b073cf159b9c/packages/nodeppt-parser/lib/markdown/prism.js#L152-L157 | train | Check if the language option is valid | [
30522,
3853,
4638,
25023,
6692,
3351,
7361,
3508,
1006,
7047,
1010,
5724,
18442,
1007,
1063,
9530,
3367,
2653,
1027,
7047,
1031,
5724,
18442,
1033,
1025,
2065,
1006,
2653,
999,
1027,
1027,
6151,
28344,
1004,
1004,
7170,
18098,
2964,
25023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/message/MessageMixin.js | refreshDataState | function refreshDataState (sName, oDataState) {
if (oDataState.getChanges().messages) {
var aMessages = oDataState.getMessages();
var aLabels = sap.ui.core.LabelEnablement.getReferencingLabels(this);
var sLabelId = aLabels[0];
var bForceUpdate = false;
aMessages.forEach(function(oMessage) {
if (aL... | javascript | function refreshDataState (sName, oDataState) {
if (oDataState.getChanges().messages) {
var aMessages = oDataState.getMessages();
var aLabels = sap.ui.core.LabelEnablement.getReferencingLabels(this);
var sLabelId = aLabels[0];
var bForceUpdate = false;
aMessages.forEach(function(oMessage) {
if (aL... | [
"function",
"refreshDataState",
"(",
"sName",
",",
"oDataState",
")",
"{",
"if",
"(",
"oDataState",
".",
"getChanges",
"(",
")",
".",
"messages",
")",
"{",
"var",
"aMessages",
"=",
"oDataState",
".",
"getMessages",
"(",
")",
";",
"var",
"aLabels",
"=",
"... | If messages are present:
- Adds an additional text to the message from the label(s) of the corresponding control instance
- Adds the control ID to the messages
- Propagates the value state | [
"If",
"messages",
"are",
"present",
":",
"-",
"Adds",
"an",
"additional",
"text",
"to",
"the",
"message",
"from",
"the",
"label",
"(",
"s",
")",
"of",
"the",
"corresponding",
"control",
"instance",
"-",
"Adds",
"the",
"control",
"ID",
"to",
"the",
"messa... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/message/MessageMixin.js#L35-L80 | train | Refreshes the data state of the control | [
30522,
3853,
25416,
21898,
2850,
10230,
12259,
1006,
1055,
18442,
1010,
1051,
2850,
10230,
12259,
1007,
1063,
2065,
1006,
1051,
2850,
10230,
12259,
1012,
2131,
22305,
2229,
1006,
1007,
1012,
7696,
1007,
1063,
13075,
19900,
3736,
8449,
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... |
fex-team/webuploader | dist/webuploader.withoutimage.js | function( Super, protos, staticProtos ) {
var child;
if ( typeof protos === 'function' ) {
child = protos;
protos = null;
} else if ( protos && protos.hasOwnProperty('constructor') ) {
child = protos.constru... | javascript | function( Super, protos, staticProtos ) {
var child;
if ( typeof protos === 'function' ) {
child = protos;
protos = null;
} else if ( protos && protos.hasOwnProperty('constructor') ) {
child = protos.constru... | [
"function",
"(",
"Super",
",",
"protos",
",",
"staticProtos",
")",
"{",
"var",
"child",
";",
"if",
"(",
"typeof",
"protos",
"===",
"'function'",
")",
"{",
"child",
"=",
"protos",
";",
"protos",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"protos",
"&&"... | 实现类与类之间的继承。
@method inherits
@grammar Base.inherits( super ) => child
@grammar Base.inherits( super, protos ) => child
@grammar Base.inherits( super, protos, statics ) => child
@param {Class} super 父类
@param {Object | Function} [protos] 子类或者对象。如果对象中包含constructor,子类将是用此属性值。
@param {Function} [protos.constructor] 子类构造... | [
"实现类与类之间的继承。",
"@method",
"inherits",
"@grammar",
"Base",
".",
"inherits",
"(",
"super",
")",
"=",
">",
"child",
"@grammar",
"Base",
".",
"inherits",
"(",
"super",
"protos",
")",
"=",
">",
"child",
"@grammar",
"Base",
".",
"inherits",
"(",
"super",
"protos... | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/dist/webuploader.withoutimage.js#L342-L370 | train | create a new instance of a class | [
30522,
3853,
1006,
3565,
1010,
30524,
2775,
1025,
2065,
1006,
2828,
11253,
15053,
2015,
1027,
1027,
1027,
1005,
3853,
1005,
1007,
1063,
2775,
1027,
15053,
2015,
1025,
15053,
2015,
1027,
19701,
1025,
1065,
2842,
2065,
1006,
15053,
2015,
1004... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
TryGhost/Ghost | core/server/api/v0.1/users.js | handlePermissions | function handlePermissions(options) {
return canThis(options.context).edit.user(options.data.password[0].user_id).then(() => {
return options;
}).catch((err) => {
return Promise.reject(new common.errors.NoPermissionError({
err: err,
... | javascript | function handlePermissions(options) {
return canThis(options.context).edit.user(options.data.password[0].user_id).then(() => {
return options;
}).catch((err) => {
return Promise.reject(new common.errors.NoPermissionError({
err: err,
... | [
"function",
"handlePermissions",
"(",
"options",
")",
"{",
"return",
"canThis",
"(",
"options",
".",
"context",
")",
".",
"edit",
".",
"user",
"(",
"options",
".",
"data",
".",
"password",
"[",
"0",
"]",
".",
"user_id",
")",
".",
"then",
"(",
"(",
")... | ### Handle Permissions
We need to be an authorised user to perform this action
@param {Object} options
@returns {Object} options | [
"###",
"Handle",
"Permissions",
"We",
"need",
"to",
"be",
"an",
"authorised",
"user",
"to",
"perform",
"this",
"action"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/users.js#L261-L270 | train | Check if user has permissions to change users password | [
30522,
3853,
5047,
30524,
8909,
1007,
1012,
2059,
1006,
1006,
1007,
1027,
1028,
1063,
2709,
7047,
1025,
1065,
1007,
1012,
4608,
1006,
1006,
9413,
2099,
1007,
1027,
1028,
1063,
2709,
4872,
1012,
15454,
1006,
2047,
2691,
1012,
10697,
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.rta/src/sap/ui/rta/ControlTreeModifier.js | function (oControl, sPropertyName, oPropertyBinding) {
var oOldValue;
var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName);
if (oMetadata) {
var sPropertyGetter = oMetadata._sGetter;
oOldValue = oControl[sPropertyGetter]();
}
JsControlTreeModifier.setPropertyBinding.appl... | javascript | function (oControl, sPropertyName, oPropertyBinding) {
var oOldValue;
var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName);
if (oMetadata) {
var sPropertyGetter = oMetadata._sGetter;
oOldValue = oControl[sPropertyGetter]();
}
JsControlTreeModifier.setPropertyBinding.appl... | [
"function",
"(",
"oControl",
",",
"sPropertyName",
",",
"oPropertyBinding",
")",
"{",
"var",
"oOldValue",
";",
"var",
"oMetadata",
"=",
"oControl",
".",
"getMetadata",
"(",
")",
".",
"getPropertyLikeSetting",
"(",
"sPropertyName",
")",
";",
"if",
"(",
"oMetada... | Record the previous value of the property binding in the undo operation
@override | [
"Record",
"the",
"previous",
"value",
"of",
"the",
"property",
"binding",
"in",
"the",
"undo",
"operation"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L187-L202 | train | Sets the value of a property in the control tree. | [
30522,
3853,
1006,
1051,
8663,
13181,
2140,
1010,
11867,
18981,
15010,
18442,
1010,
6728,
18981,
15010,
8428,
4667,
1007,
1063,
13075,
1051,
11614,
10175,
5657,
1025,
13075,
18168,
12928,
2850,
2696,
1027,
1051,
8663,
13181,
2140,
1012,
2131,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
dcloudio/mui | examples/hello-mui/js/mui.picker.all.js | function() {
var self = this;
if (self.disposed) return;
self.panel.classList.remove($.className('active'));
self.mask.close();
document.body.classList.remove($.className('poppicker-active-for-page'));
//处理物理返回键
$.back=self.__back;
} | javascript | function() {
var self = this;
if (self.disposed) return;
self.panel.classList.remove($.className('active'));
self.mask.close();
document.body.classList.remove($.className('poppicker-active-for-page'));
//处理物理返回键
$.back=self.__back;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"self",
".",
"disposed",
")",
"return",
";",
"self",
".",
"panel",
".",
"classList",
".",
"remove",
"(",
"$",
".",
"className",
"(",
"'active'",
")",
")",
";",
"self",
".",
"m... | 隐藏 | [
"隐藏"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/hello-mui/js/mui.picker.all.js#L524-L532 | train | Close the popup | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2065,
1006,
2969,
1012,
21866,
1007,
2709,
1025,
2969,
1012,
5997,
1012,
2465,
9863,
1012,
6366,
1006,
1002,
1012,
2465,
18442,
1006,
1005,
3161,
1005,
1007,
1007,
1025,
2969,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ecomfe/zrender | src/contain/path.js | windingArc | function windingArc(
cx, cy, r, startAngle, endAngle, anticlockwise, x, y
) {
y -= cy;
if (y > r || y < -r) {
return 0;
}
var tmp = Math.sqrt(r * r - y * y);
roots[0] = -tmp;
roots[1] = tmp;
var diff = Math.abs(startAngle - endAngle);
if (diff < 1e-4) {
return 0;
... | javascript | function windingArc(
cx, cy, r, startAngle, endAngle, anticlockwise, x, y
) {
y -= cy;
if (y > r || y < -r) {
return 0;
}
var tmp = Math.sqrt(r * r - y * y);
roots[0] = -tmp;
roots[1] = tmp;
var diff = Math.abs(startAngle - endAngle);
if (diff < 1e-4) {
return 0;
... | [
"function",
"windingArc",
"(",
"cx",
",",
"cy",
",",
"r",
",",
"startAngle",
",",
"endAngle",
",",
"anticlockwise",
",",
"x",
",",
"y",
")",
"{",
"y",
"-=",
"cy",
";",
"if",
"(",
"y",
">",
"r",
"||",
"y",
"<",
"-",
"r",
")",
"{",
"return",
"0... | TODO Arc 旋转 | [
"TODO",
"Arc",
"旋转"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/contain/path.js#L141-L203 | train | returns the winding arc of the given arc | [
30522,
3853,
12788,
2906,
2278,
1006,
1039,
2595,
1010,
22330,
1010,
1054,
1010,
2707,
5654,
2571,
1010,
2203,
5654,
2571,
1010,
3424,
20464,
7432,
14244,
1010,
1060,
1010,
1061,
1007,
1063,
1061,
1011,
1027,
22330,
1025,
2065,
1006,
1061,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/chips/js/chipsDirective.js | compile | function compile(element, attr) {
// Grab the user template from attr and reset the attribute to null.
var userTemplate = attr['$mdUserTemplate'];
attr['$mdUserTemplate'] = null;
var chipTemplate = getTemplateByQuery('md-chips>md-chip-template');
var chipRemoveSelector = $mdUtil
... | javascript | function compile(element, attr) {
// Grab the user template from attr and reset the attribute to null.
var userTemplate = attr['$mdUserTemplate'];
attr['$mdUserTemplate'] = null;
var chipTemplate = getTemplateByQuery('md-chips>md-chip-template');
var chipRemoveSelector = $mdUtil
... | [
"function",
"compile",
"(",
"element",
",",
"attr",
")",
"{",
"// Grab the user template from attr and reset the attribute to null.",
"var",
"userTemplate",
"=",
"attr",
"[",
"'$mdUserTemplate'",
"]",
";",
"attr",
"[",
"'$mdUserTemplate'",
"]",
"=",
"null",
";",
"var"... | Builds the final template for `md-chips` and returns the postLink function.
Building the template involves 3 key components:
static chips
chip template
input control
If no `ng-model` is provided, only the static chip work needs to be done.
If no user-passed `md-chip-template` exists, the default template is used. Th... | [
"Builds",
"the",
"final",
"template",
"for",
"md",
"-",
"chips",
"and",
"returns",
"the",
"postLink",
"function",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/chips/js/chipsDirective.js#L349-L479 | train | Compile the md - chips directive. | [
30522,
3853,
4012,
22090,
1006,
5783,
1010,
2012,
16344,
1007,
1063,
1013,
1013,
6723,
1996,
5310,
23561,
2013,
2012,
16344,
1998,
25141,
1996,
17961,
2000,
19701,
1012,
13075,
5310,
18532,
15725,
1027,
2012,
16344,
1031,
1005,
1002,
9108,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
transloadit/uppy | website/build-examples.js | onError | function onError (err) {
console.error(chalk.red('✗ error:'), chalk.red(err.message))
notifier.notify({
title: 'Build failed:',
message: err.message
})
this.emit('end')
// When running without watch, process.exit(1) on error
if (!watchifyEnabled) {
process.exit(1)
}
} | javascript | function onError (err) {
console.error(chalk.red('✗ error:'), chalk.red(err.message))
notifier.notify({
title: 'Build failed:',
message: err.message
})
this.emit('end')
// When running without watch, process.exit(1) on error
if (!watchifyEnabled) {
process.exit(1)
}
} | [
"function",
"onError",
"(",
"err",
")",
"{",
"console",
".",
"error",
"(",
"chalk",
".",
"red",
"(",
"'✗ error:'),",
" ",
"c",
"alk.r",
"e",
"d(e",
"r",
"r.m",
"e",
"ssage))",
"",
"",
"notifier",
".",
"notify",
"(",
"{",
"title",
":",
"'Build failed:... | Logs to console and shows desktop notification on error.
Calls `this.emit(end)` to stop bundling.
@param {object} err Error object | [
"Logs",
"to",
"console",
"and",
"shows",
"desktop",
"notification",
"on",
"error",
".",
"Calls",
"this",
".",
"emit",
"(",
"end",
")",
"to",
"stop",
"bundling",
"."
] | 7ae18bf992d544a64da998f033258ec09a3de275 | https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/website/build-examples.js#L147-L159 | train | Handle error | [
30522,
3853,
2028,
18933,
2099,
1006,
9413,
2099,
1007,
1063,
10122,
1012,
7561,
1006,
16833,
1012,
2417,
1006,
1005,
100,
7561,
1024,
1005,
1007,
1010,
16833,
1012,
2417,
1006,
9413,
2099,
1012,
4471,
1007,
1007,
2025,
18095,
1012,
2025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sparksuite/simplemde-markdown-editor | src/js/simplemde.js | _mergeProperties | function _mergeProperties(target, source) {
for(var property in source) {
if(source.hasOwnProperty(property)) {
if(source[property] instanceof Array) {
target[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);
} else if(
source[property] !== null &&
type... | javascript | function _mergeProperties(target, source) {
for(var property in source) {
if(source.hasOwnProperty(property)) {
if(source[property] instanceof Array) {
target[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);
} else if(
source[property] !== null &&
type... | [
"function",
"_mergeProperties",
"(",
"target",
",",
"source",
")",
"{",
"for",
"(",
"var",
"property",
"in",
"source",
")",
"{",
"if",
"(",
"source",
".",
"hasOwnProperty",
"(",
"property",
")",
")",
"{",
"if",
"(",
"source",
"[",
"property",
"]",
"ins... | Merge the properties of one object into another. | [
"Merge",
"the",
"properties",
"of",
"one",
"object",
"into",
"another",
"."
] | 6abda7ab68cc20f4aca870eb243747951b90ab04 | https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js#L1024-L1042 | train | Merges properties from source into target | [
30522,
3853,
1035,
13590,
21572,
4842,
7368,
1006,
4539,
1010,
3120,
1007,
1063,
2005,
1006,
13075,
3200,
1999,
3120,
1007,
1063,
2065,
1006,
3120,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
3200,
1007,
1007,
1063,
2065,
1006,
3120,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
postmanlabs/newman | examples/parallel-collection-runs.js | function (err, results) {
err && console.error(err);
results.forEach(function (result) {
var failures = result.run.failures;
console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
`${result.collection.name} ran successfully.`);
});
} | javascript | function (err, results) {
err && console.error(err);
results.forEach(function (result) {
var failures = result.run.failures;
console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
`${result.collection.name} ran successfully.`);
});
} | [
"function",
"(",
"err",
",",
"results",
")",
"{",
"err",
"&&",
"console",
".",
"error",
"(",
"err",
")",
";",
"results",
".",
"forEach",
"(",
"function",
"(",
"result",
")",
"{",
"var",
"failures",
"=",
"result",
".",
"run",
".",
"failures",
";",
"... | The
@param {?Error} err - An Error instance / null that determines whether or not the parallel collection run
succeeded.
@param {Array} results - An array of collection run summary objects. | [
"The"
] | c05a5a1e82aa3c2021e94ba09e627ba4718af69e | https://github.com/postmanlabs/newman/blob/c05a5a1e82aa3c2021e94ba09e627ba4718af69e/examples/parallel-collection-runs.js#L43-L52 | train | print results | [
30522,
3853,
1006,
9413,
2099,
1010,
3463,
1007,
1063,
9413,
2099,
1004,
1004,
10122,
1012,
7561,
1006,
9413,
2099,
1007,
1025,
3463,
1012,
18921,
6776,
1006,
3853,
1006,
2765,
1007,
1063,
13075,
15428,
1027,
2765,
1012,
2448,
1012,
15428,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
goldfire/howler.js | dist/howler.js | function(event, fn, id, once) {
var self = this;
var events = self['_on' + event];
if (typeof fn === 'function') {
events.push(once ? {id: id, fn: fn, once: once} : {id: id, fn: fn});
}
return self;
} | javascript | function(event, fn, id, once) {
var self = this;
var events = self['_on' + event];
if (typeof fn === 'function') {
events.push(once ? {id: id, fn: fn, once: once} : {id: id, fn: fn});
}
return self;
} | [
"function",
"(",
"event",
",",
"fn",
",",
"id",
",",
"once",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"events",
"=",
"self",
"[",
"'_on'",
"+",
"event",
"]",
";",
"if",
"(",
"typeof",
"fn",
"===",
"'function'",
")",
"{",
"events",
".",
... | Listen to a custom event.
@param {String} event Event name.
@param {Function} fn Listener to call.
@param {Number} id (optional) Only listen to events for this sound.
@param {Number} once (INTERNAL) Marks event to fire only once.
@return {Howl} | [
"Listen",
"to",
"a",
"custom",
"event",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L1771-L1780 | train | Add an event listener | [
30522,
3853,
1006,
2724,
1010,
1042,
2078,
1010,
8909,
1010,
2320,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
2824,
1027,
2969,
1031,
1005,
1035,
2006,
1005,
1009,
2724,
1033,
1025,
2065,
1006,
2828,
11253,
1042,
2078,
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... | |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | destroy | function destroy ( ) {
for ( var key in options.cssClasses ) {
if ( !options.cssClasses.hasOwnProperty(key) ) { continue; }
removeClass(scope_Target, options.cssClasses[key]);
}
while (scope_Target.firstChild) {
scope_Target.removeChi... | javascript | function destroy ( ) {
for ( var key in options.cssClasses ) {
if ( !options.cssClasses.hasOwnProperty(key) ) { continue; }
removeClass(scope_Target, options.cssClasses[key]);
}
while (scope_Target.firstChild) {
scope_Target.removeChi... | [
"function",
"destroy",
"(",
")",
"{",
"for",
"(",
"var",
"key",
"in",
"options",
".",
"cssClasses",
")",
"{",
"if",
"(",
"!",
"options",
".",
"cssClasses",
".",
"hasOwnProperty",
"(",
"key",
")",
")",
"{",
"continue",
";",
"}",
"removeClass",
"(",
"s... | Removes classes from the root and empties it. | [
"Removes",
"classes",
"from",
"the",
"root",
"and",
"empties",
"it",
"."
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L1931-L1943 | train | Destroys the page | [
30522,
3853,
6033,
1006,
1007,
1063,
2005,
1006,
13075,
3145,
1999,
7047,
1012,
20116,
11020,
27102,
2229,
1007,
1063,
2065,
1006,
999,
7047,
1012,
20116,
11020,
27102,
2229,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
3145,
1007,
1007,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/AnnotationParser.js | function (oElement, mAnnotations) {
var sQualifier,
aSegments = [];
// returns the current oElement's index in its parentElement's "children" collection
// (but works in IE as well)
function index() {
return Array.prototype.filter.call(oElement.parentNode.childNodes, function (oNode) {
return oNode.... | javascript | function (oElement, mAnnotations) {
var sQualifier,
aSegments = [];
// returns the current oElement's index in its parentElement's "children" collection
// (but works in IE as well)
function index() {
return Array.prototype.filter.call(oElement.parentNode.childNodes, function (oNode) {
return oNode.... | [
"function",
"(",
"oElement",
",",
"mAnnotations",
")",
"{",
"var",
"sQualifier",
",",
"aSegments",
"=",
"[",
"]",
";",
"// returns the current oElement's index in its parentElement's \"children\" collection",
"// (but works in IE as well)",
"function",
"index",
"(",
")",
"{... | /*
Backs up the annotation corresponding to the given element by adding it also as a sibling of
the array under the name of "Property@Term#Qualifier". This way, it will survive
(de-)serialization via JSON.stringify and JSON.parse. Returns a path which points to it.
@param {Element} oElement
The <Annotation> element of... | [
"/",
"*",
"Backs",
"up",
"the",
"annotation",
"corresponding",
"to",
"the",
"given",
"element",
"by",
"adding",
"it",
"also",
"as",
"a",
"sibling",
"of",
"the",
"array",
"under",
"the",
"name",
"of",
"Property@Term#Qualifier",
".",
"This",
"way",
"it",
"wi... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/AnnotationParser.js#L436-L492 | train | Syncs the annotations at the current index of the given element. | [
30522,
3853,
1006,
1051,
12260,
3672,
1010,
10856,
17287,
9285,
1007,
1063,
13075,
5490,
8787,
18095,
1010,
2004,
13910,
8163,
1027,
1031,
1033,
1025,
1013,
1013,
5651,
1996,
2783,
1051,
12260,
3672,
1005,
1055,
5950,
1999,
2049,
6687,
1226... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/panel/panel.js | MdPanelRef | function MdPanelRef(config, $injector) {
// Injected variables.
/** @private @const {!angular.$q} */
this._$q = $injector.get('$q');
/** @private @const {!angular.$mdCompiler} */
this._$mdCompiler = $injector.get('$mdCompiler');
/** @private @const {!angular.$mdConstant} */
this._$mdConstant = $injector... | javascript | function MdPanelRef(config, $injector) {
// Injected variables.
/** @private @const {!angular.$q} */
this._$q = $injector.get('$q');
/** @private @const {!angular.$mdCompiler} */
this._$mdCompiler = $injector.get('$mdCompiler');
/** @private @const {!angular.$mdConstant} */
this._$mdConstant = $injector... | [
"function",
"MdPanelRef",
"(",
"config",
",",
"$injector",
")",
"{",
"// Injected variables.",
"/** @private @const {!angular.$q} */",
"this",
".",
"_$q",
"=",
"$injector",
".",
"get",
"(",
"'$q'",
")",
";",
"/** @private @const {!angular.$mdCompiler} */",
"this",
".",
... | ***************************************************************************
MdPanelRef *
***************************************************************************
A reference to a created panel. This reference contains a unique id for the
panel, along with properties/functions used to ... | [
"***************************************************************************",
"MdPanelRef",
"*",
"***************************************************************************",
"A",
"reference",
"to",
"a",
"created",
"panel",
".",
"This",
"reference",
"contains",
"a",
"unique",
"id",... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/panel/panel.js#L1359-L1456 | train | The MdPanelRef constructor. | [
30522,
3853,
9108,
9739,
2884,
2890,
2546,
1006,
9530,
8873,
2290,
1010,
1002,
1999,
20614,
2953,
1007,
1063,
1013,
1013,
19737,
10857,
1012,
1013,
1008,
1008,
1030,
2797,
1030,
9530,
3367,
1063,
999,
30524,
1006,
1005,
1002,
1053,
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... |
adobe/brackets | src/project/ProjectModel.js | _isWelcomeProjectPath | function _isWelcomeProjectPath(path, welcomeProjectPath, welcomeProjects) {
if (path === welcomeProjectPath) {
return true;
}
// No match on the current path, and it's not a match if there are no previously known projects
if (!welcomeProjects) {
return false;
... | javascript | function _isWelcomeProjectPath(path, welcomeProjectPath, welcomeProjects) {
if (path === welcomeProjectPath) {
return true;
}
// No match on the current path, and it's not a match if there are no previously known projects
if (!welcomeProjects) {
return false;
... | [
"function",
"_isWelcomeProjectPath",
"(",
"path",
",",
"welcomeProjectPath",
",",
"welcomeProjects",
")",
"{",
"if",
"(",
"path",
"===",
"welcomeProjectPath",
")",
"{",
"return",
"true",
";",
"}",
"// No match on the current path, and it's not a match if there are no previo... | Returns true if the given path is the same as one of the welcome projects we've previously opened,
or the one for the current build.
@param {string} path Path to check to see if it's a welcome project
@param {string} welcomeProjectPath Current welcome project path
@param {Array.<string>=} welcomeProjects All known wel... | [
"Returns",
"true",
"if",
"the",
"given",
"path",
"is",
"the",
"same",
"as",
"one",
"of",
"the",
"welcome",
"projects",
"we",
"ve",
"previously",
"opened",
"or",
"the",
"one",
"for",
"the",
"current",
"build",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectModel.js#L1351-L1363 | train | Returns true if the path is a match on the current path | [
30522,
3853,
1035,
2003,
8545,
22499,
4168,
21572,
20614,
15069,
1006,
4130,
1010,
6160,
21572,
20614,
15069,
1010,
6160,
21572,
20614,
2015,
1007,
1063,
2065,
1006,
4130,
1027,
1027,
1027,
6160,
21572,
20614,
15069,
1007,
1063,
2709,
2995,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/atoms/dom.js | getScroll | function getScroll(e) {
if (e == htmlElem) {
return new goog.dom.DomHelper(ownerDoc).getDocumentScroll();
} else {
return new goog.math.Coordinate(e.scrollLeft, e.scrollTop);
}
} | javascript | function getScroll(e) {
if (e == htmlElem) {
return new goog.dom.DomHelper(ownerDoc).getDocumentScroll();
} else {
return new goog.math.Coordinate(e.scrollLeft, e.scrollTop);
}
} | [
"function",
"getScroll",
"(",
"e",
")",
"{",
"if",
"(",
"e",
"==",
"htmlElem",
")",
"{",
"return",
"new",
"goog",
".",
"dom",
".",
"DomHelper",
"(",
"ownerDoc",
")",
".",
"getDocumentScroll",
"(",
")",
";",
"}",
"else",
"{",
"return",
"new",
"goog",
... | Returns the scroll offset of the given element. | [
"Returns",
"the",
"scroll",
"offset",
"of",
"the",
"given",
"element",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/atoms/dom.js#L717-L723 | train | Get the scroll position of an element. | [
30522,
3853,
4152,
26775,
14511,
1006,
1041,
1007,
1063,
2065,
1006,
1041,
1027,
1027,
16129,
12260,
2213,
1007,
1063,
2709,
2047,
27571,
2290,
1012,
14383,
1012,
14383,
16001,
4842,
1006,
3954,
3527,
2278,
1007,
1012,
2131,
3527,
24894,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ecomfe/zrender | src/mixin/Eventful.js | function (event, query, handler, context) {
return on(this, event, query, handler, context, false);
} | javascript | function (event, query, handler, context) {
return on(this, event, query, handler, context, false);
} | [
"function",
"(",
"event",
",",
"query",
",",
"handler",
",",
"context",
")",
"{",
"return",
"on",
"(",
"this",
",",
"event",
",",
"query",
",",
"handler",
",",
"context",
",",
"false",
")",
";",
"}"
] | Bind a handler.
@param {string} event The event name.
@param {string|Object} [query] Condition used on event filter.
@param {Function} handler The event handler.
@param {Object} [context] | [
"Bind",
"a",
"handler",
"."
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/mixin/Eventful.js#L57-L59 | train | Add an event listener to the current context | [
30522,
3853,
1006,
2724,
1010,
23032,
1010,
28213,
1010,
6123,
1007,
1063,
2709,
2006,
1006,
2023,
1010,
2724,
1010,
23032,
1010,
28213,
1010,
6123,
1010,
6270,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
fex-team/webuploader | src/dollar-builtin.js | function( type, fn ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, fn, false );
} else if ( elem.attachEvent ) {
elem.detachEvent( 'on' + type, fn );
}
return this;
} | javascript | function( type, fn ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, fn, false );
} else if ( elem.attachEvent ) {
elem.detachEvent( 'on' + type, fn );
}
return this;
} | [
"function",
"(",
"type",
",",
"fn",
")",
"{",
"if",
"(",
"elem",
".",
"removeEventListener",
")",
"{",
"elem",
".",
"removeEventListener",
"(",
"type",
",",
"fn",
",",
"false",
")",
";",
"}",
"else",
"if",
"(",
"elem",
".",
"attachEvent",
")",
"{",
... | off | [
"off"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/src/dollar-builtin.js#L156-L163 | train | Remove event listener | [
30522,
3853,
1006,
2828,
1010,
1042,
2078,
1007,
1063,
2065,
1006,
3449,
6633,
1012,
6366,
18697,
3372,
9863,
24454,
1007,
1063,
3449,
6633,
1012,
6366,
18697,
3372,
9863,
24454,
1006,
2828,
1010,
1042,
2078,
1010,
6270,
1007,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.unified/src/sap/ui/unified/CalendarTimeInterval.js | _togglePrevNexYearPicker | function _togglePrevNexYearPicker(){
var oYearPicker = this.getAggregation("yearPicker");
var iYears = oYearPicker.getYears();
var oDate = CalendarUtils._createUniversalUTCDate(oYearPicker.getFirstRenderedDate());
oDate.setUTCFullYear(oDate.getUTCFullYear() + Math.floor(iYears / 2));
var oHeader = this.getAg... | javascript | function _togglePrevNexYearPicker(){
var oYearPicker = this.getAggregation("yearPicker");
var iYears = oYearPicker.getYears();
var oDate = CalendarUtils._createUniversalUTCDate(oYearPicker.getFirstRenderedDate());
oDate.setUTCFullYear(oDate.getUTCFullYear() + Math.floor(iYears / 2));
var oHeader = this.getAg... | [
"function",
"_togglePrevNexYearPicker",
"(",
")",
"{",
"var",
"oYearPicker",
"=",
"this",
".",
"getAggregation",
"(",
"\"yearPicker\"",
")",
";",
"var",
"iYears",
"=",
"oYearPicker",
".",
"getYears",
"(",
")",
";",
"var",
"oDate",
"=",
"CalendarUtils",
".",
... | Disable / Enable the next and previous button in the Header.
This function assumes there is a "yearPicker" aggregation.
So callers must take care.
@return {void}
@private | [
"Disable",
"/",
"Enable",
"the",
"next",
"and",
"previous",
"button",
"in",
"the",
"Header",
".",
"This",
"function",
"assumes",
"there",
"is",
"a",
"yearPicker",
"aggregation",
".",
"So",
"callers",
"must",
"take",
"care",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.unified/src/sap/ui/unified/CalendarTimeInterval.js#L1686-L1711 | train | Toggles the previous year of the year picker | [
30522,
3853,
1035,
2000,
24679,
28139,
16022,
10288,
29100,
24330,
5484,
1006,
1007,
1063,
13075,
1051,
29100,
24330,
5484,
1027,
2023,
1012,
2131,
8490,
17603,
12540,
1006,
1000,
2095,
24330,
5484,
1000,
1007,
1025,
13075,
1045,
29100,
2015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | parse_ExternSheet | function parse_ExternSheet(blob, length, opts) {
if(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);
var o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);
while(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));
// [iSupBook, itabFirst, itabLast];
if... | javascript | function parse_ExternSheet(blob, length, opts) {
if(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);
var o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);
while(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));
// [iSupBook, itabFirst, itabLast];
if... | [
"function",
"parse_ExternSheet",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"if",
"(",
"opts",
".",
"biff",
"<",
"8",
")",
"return",
"parse_BIFF5ExternSheet",
"(",
"blob",
",",
"length",
",",
"opts",
")",
";",
"var",
"o",
"=",
"[",
"]",
",",
... | /* [MS-XLS] 2.4.106 TODO: verify filename encoding | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"4",
".",
"106",
"TODO",
":",
"verify",
"filename",
"encoding"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L6260-L6267 | train | ECMA - 262 15. 2 Extern Sheet | [
30522,
3853,
11968,
3366,
1035,
4654,
16451,
4095,
15558,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
2065,
1006,
23569,
2015,
1012,
12170,
4246,
1026,
1022,
1007,
2709,
11968,
3366,
1035,
12170,
4246,
2629,
10288,
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... |
googleapis/google-api-nodejs-client | samples/mirror/mirror.js | runSample | async function runSample() {
const res = await mirror.locations.list({});
console.log(res.data);
} | javascript | async function runSample() {
const res = await mirror.locations.list({});
console.log(res.data);
} | [
"async",
"function",
"runSample",
"(",
")",
"{",
"const",
"res",
"=",
"await",
"mirror",
".",
"locations",
".",
"list",
"(",
"{",
"}",
")",
";",
"console",
".",
"log",
"(",
"res",
".",
"data",
")",
";",
"}"
] | a very simple example of listing locations from the mirror API | [
"a",
"very",
"simple",
"example",
"of",
"listing",
"locations",
"from",
"the",
"mirror",
"API"
] | e6e632a29d0b246d058e3067de3a5c3827e2b54e | https://github.com/googleapis/google-api-nodejs-client/blob/e6e632a29d0b246d058e3067de3a5c3827e2b54e/samples/mirror/mirror.js#L26-L29 | train | A sample of the sample | [
30522,
2004,
6038,
2278,
3853,
3216,
16613,
2571,
1006,
1007,
1063,
9530,
3367,
24501,
1027,
26751,
5259,
1012,
5269,
1012,
2862,
1006,
1063,
1065,
1007,
1025,
10122,
1012,
8833,
1006,
24501,
1012,
2951,
1007,
1025,
1065,
102,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | release.js | updateBowerVersion | function updateBowerVersion () {
start('Updating bower version...');
const options = { cwd: './bower-material' };
const bower = require(options.cwd + '/bower.json'),
pkg = require(options.cwd + '/package.json');
// update versions in config files
bower.version = pkg.version = newVers... | javascript | function updateBowerVersion () {
start('Updating bower version...');
const options = { cwd: './bower-material' };
const bower = require(options.cwd + '/bower.json'),
pkg = require(options.cwd + '/package.json');
// update versions in config files
bower.version = pkg.version = newVers... | [
"function",
"updateBowerVersion",
"(",
")",
"{",
"start",
"(",
"'Updating bower version...'",
")",
";",
"const",
"options",
"=",
"{",
"cwd",
":",
"'./bower-material'",
"}",
";",
"const",
"bower",
"=",
"require",
"(",
"options",
".",
"cwd",
"+",
"'/bower.json'"... | updates the version for bower-material in package.json and bower.json | [
"updates",
"the",
"version",
"for",
"bower",
"-",
"material",
"in",
"package",
".",
"json",
"and",
"bower",
".",
"json"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/release.js#L214-L258 | train | Update bower version | [
30522,
3853,
10651,
18912,
2121,
27774,
1006,
1007,
1063,
2707,
1006,
1005,
2039,
16616,
6812,
2121,
2544,
1012,
1012,
1012,
1005,
1007,
1025,
9530,
3367,
7047,
1027,
1063,
19296,
2094,
1024,
1005,
1012,
1013,
6812,
2121,
1011,
3430,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/ExpressionParser.js | INFIX | function INFIX(fnLeft, fnRight, fnOperator, bLazy, aParts) {
return fnOperator(fnLeft(aParts),
bLazy ? fnRight.bind(null, aParts) : fnRight(aParts));
} | javascript | function INFIX(fnLeft, fnRight, fnOperator, bLazy, aParts) {
return fnOperator(fnLeft(aParts),
bLazy ? fnRight.bind(null, aParts) : fnRight(aParts));
} | [
"function",
"INFIX",
"(",
"fnLeft",
",",
"fnRight",
",",
"fnOperator",
",",
"bLazy",
",",
"aParts",
")",
"{",
"return",
"fnOperator",
"(",
"fnLeft",
"(",
"aParts",
")",
",",
"bLazy",
"?",
"fnRight",
".",
"bind",
"(",
"null",
",",
"aParts",
")",
":",
... | Formatter function for an infix operator.
@param {function} fnLeft - formatter function for the left operand
@param {function} fnRight - formatter function for the right operand
@param {function} fnOperator
function taking two arguments which evaluates the infix operator
@param {boolean} bLazy - whether the right oper... | [
"Formatter",
"function",
"for",
"an",
"infix",
"operator",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ExpressionParser.js#L399-L402 | train | Infix operator. | [
30522,
3853,
1999,
8873,
2595,
1006,
1042,
20554,
29218,
1010,
1042,
16118,
18743,
1010,
1042,
3630,
4842,
8844,
1010,
1038,
2721,
9096,
1010,
4237,
2015,
1007,
1063,
2709,
1042,
3630,
4842,
8844,
1006,
1042,
20554,
29218,
1006,
4237,
2015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
catapult-project/catapult | third_party/polymer2/bower_components/web-animations-js/src/handler-utils.js | consumeParenthesised | function consumeParenthesised(parser, string) {
var nesting = 0;
for (var n = 0; n < string.length; n++) {
if (/\s|,/.test(string[n]) && nesting == 0) {
break;
} else if (string[n] == '(') {
nesting++;
} else if (string[n] == ')') {
nesting--;
if (nesting == 0)
... | javascript | function consumeParenthesised(parser, string) {
var nesting = 0;
for (var n = 0; n < string.length; n++) {
if (/\s|,/.test(string[n]) && nesting == 0) {
break;
} else if (string[n] == '(') {
nesting++;
} else if (string[n] == ')') {
nesting--;
if (nesting == 0)
... | [
"function",
"consumeParenthesised",
"(",
"parser",
",",
"string",
")",
"{",
"var",
"nesting",
"=",
"0",
";",
"for",
"(",
"var",
"n",
"=",
"0",
";",
"n",
"<",
"string",
".",
"length",
";",
"n",
"++",
")",
"{",
"if",
"(",
"/",
"\\s|,",
"/",
".",
... | Consumes a token or expression with balanced parentheses | [
"Consumes",
"a",
"token",
"or",
"expression",
"with",
"balanced",
"parentheses"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer2/bower_components/web-animations-js/src/handler-utils.js#L55-L72 | train | Consumes a string of parentheses | [
30522,
3853,
16678,
19362,
4765,
24124,
2098,
1006,
11968,
8043,
1010,
5164,
1007,
1063,
13075,
21016,
1027,
1014,
1025,
2005,
1006,
13075,
1050,
1027,
1014,
1025,
1050,
1026,
5164,
1012,
3091,
1025,
1050,
1009,
1009,
1007,
1063,
2065,
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... |
elastic/elasticsearch-js | api/api/cluster.state.js | buildClusterState | function buildClusterState (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [cluster.state](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html) request
*
* @param {list} index - A... | javascript | function buildClusterState (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [cluster.state](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html) request
*
* @param {list} index - A... | [
"function",
"buildClusterState",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [cluster.state](http://www.elastic.co/g... | /* eslint camelcase: 0 /* eslint no-unused-vars: 0 | [
"/",
"*",
"eslint",
"camelcase",
":",
"0",
"/",
"*",
"eslint",
"no",
"-",
"unused",
"-",
"vars",
":",
"0"
] | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/api/cluster.state.js#L25-L135 | train | Build cluster state | [
30522,
3853,
3857,
20464,
19966,
30524,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2279,
1011,
2240,
2053,
1011,
15171,
1011,
13075,
2015,
9530,
3367,
1063,
9338,
2063,
15500,
1010,
9563,
2121,
29165,
1010,
5047,
2121,
29165,
1010,
7488,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function() {
clearInterval(this.interval);
this.elementToChange = null;
dom.removeClass(this.link, CLASS_NAME_OPENED);
this.container.style.display = "none";
this.fire("hide");
} | javascript | function() {
clearInterval(this.interval);
this.elementToChange = null;
dom.removeClass(this.link, CLASS_NAME_OPENED);
this.container.style.display = "none";
this.fire("hide");
} | [
"function",
"(",
")",
"{",
"clearInterval",
"(",
"this",
".",
"interval",
")",
";",
"this",
".",
"elementToChange",
"=",
"null",
";",
"dom",
".",
"removeClass",
"(",
"this",
".",
"link",
",",
"CLASS_NAME_OPENED",
")",
";",
"this",
".",
"container",
".",
... | Hide the dialog element | [
"Hide",
"the",
"dialog",
"element"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L13624-L13630 | train | Hide the container | [
30522,
3853,
1006,
1007,
1063,
3154,
18447,
2121,
10175,
1006,
2023,
1012,
13483,
1007,
1025,
2023,
1012,
5783,
3406,
22305,
2063,
1027,
19701,
1025,
14383,
1012,
6366,
26266,
1006,
2023,
1012,
4957,
1010,
2465,
1035,
2171,
1035,
2441,
3052... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_biff8_buf | function write_biff8_buf(wb, opts) {
var o = opts || {};
var bufs = [];
if(wb && !wb.SSF) {
wb.SSF = SSF.get_table();
}
if(wb && wb.SSF) {
make_ssf(SSF); SSF.load_table(wb.SSF);
// $FlowIgnore
o.revssf = evert_num(wb.SSF); o.revssf[wb.SSF[65535]] = 0;
o.ssf = wb.SSF;
}
o.cellXfs = [];
o.Strings = [];... | javascript | function write_biff8_buf(wb, opts) {
var o = opts || {};
var bufs = [];
if(wb && !wb.SSF) {
wb.SSF = SSF.get_table();
}
if(wb && wb.SSF) {
make_ssf(SSF); SSF.load_table(wb.SSF);
// $FlowIgnore
o.revssf = evert_num(wb.SSF); o.revssf[wb.SSF[65535]] = 0;
o.ssf = wb.SSF;
}
o.cellXfs = [];
o.Strings = [];... | [
"function",
"write_biff8_buf",
"(",
"wb",
",",
"opts",
")",
"{",
"var",
"o",
"=",
"opts",
"||",
"{",
"}",
";",
"var",
"bufs",
"=",
"[",
"]",
";",
"if",
"(",
"wb",
"&&",
"!",
"wb",
".",
"SSF",
")",
"{",
"wb",
".",
"SSF",
"=",
"SSF",
".",
"ge... | /* [MS-XLS] 2.1.7.20 Workbook Stream | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"1",
".",
"7",
".",
"20",
"Workbook",
"Stream"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L18810-L18830 | train | Write a BIFF8 buffer | [
30522,
3853,
4339,
1035,
12170,
4246,
2620,
1035,
20934,
2546,
1006,
25610,
1010,
23569,
2015,
1007,
1063,
13075,
1051,
1027,
23569,
2015,
1064,
1064,
1063,
1065,
1025,
13075,
20934,
10343,
1027,
1031,
1033,
1025,
2065,
1006,
25610,
1004,
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... |
grpc/grpc-node | packages/grpc-native-core/src/client_interceptors.js | _startBatchIfReady | function _startBatchIfReady(call, batch, batch_state, callback) {
var completed_ops = batch_state.completed_ops;
var deferred_batches = batch_state.deferred_batches;
var batch_ops = Object.keys(batch).map(Number);
if (_areBatchRequirementsMet(batch_ops, completed_ops)) {
// Dependencies are met, start the b... | javascript | function _startBatchIfReady(call, batch, batch_state, callback) {
var completed_ops = batch_state.completed_ops;
var deferred_batches = batch_state.deferred_batches;
var batch_ops = Object.keys(batch).map(Number);
if (_areBatchRequirementsMet(batch_ops, completed_ops)) {
// Dependencies are met, start the b... | [
"function",
"_startBatchIfReady",
"(",
"call",
",",
"batch",
",",
"batch_state",
",",
"callback",
")",
"{",
"var",
"completed_ops",
"=",
"batch_state",
".",
"completed_ops",
";",
"var",
"deferred_batches",
"=",
"batch_state",
".",
"deferred_batches",
";",
"var",
... | Enforces the order of operations for synchronous requests. If a batch's
operations cannot be started because required operations have not started
yet, the batch is deferred until requirements are met.
@private
@param {grpc.Client~Call} call
@param {object} batch
@param {object} batch_state
@param {number[]} [batch_stat... | [
"Enforces",
"the",
"order",
"of",
"operations",
"for",
"synchronous",
"requests",
".",
"If",
"a",
"batch",
"s",
"operations",
"cannot",
"be",
"started",
"because",
"required",
"operations",
"have",
"not",
"started",
"yet",
"the",
"batch",
"is",
"deferred",
"un... | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/client_interceptors.js#L745-L773 | train | Starts the batch if the batch requirements are met | [
30522,
3853,
1035,
2707,
14479,
5428,
19699,
13775,
2100,
1006,
2655,
1010,
14108,
1010,
14108,
1035,
2110,
1010,
2655,
5963,
1007,
1063,
13075,
2949,
1035,
23092,
1027,
14108,
1035,
2110,
1012,
2949,
1035,
23092,
1025,
13075,
13366,
28849,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ecomfe/zrender | src/dom/HandlerProxy.js | function (event) {
// Default mouse behaviour should not be disabled here.
// For example, page may needs to be slided.
event = normalizeEvent(this.dom, event);
// Mark touch, which is useful in distinguish touch and
// mouse event in upper applicatoin.
event.zrByTouch =... | javascript | function (event) {
// Default mouse behaviour should not be disabled here.
// For example, page may needs to be slided.
event = normalizeEvent(this.dom, event);
// Mark touch, which is useful in distinguish touch and
// mouse event in upper applicatoin.
event.zrByTouch =... | [
"function",
"(",
"event",
")",
"{",
"// Default mouse behaviour should not be disabled here.",
"// For example, page may needs to be slided.",
"event",
"=",
"normalizeEvent",
"(",
"this",
".",
"dom",
",",
"event",
")",
";",
"// Mark touch, which is useful in distinguish touch and... | Touch开始响应函数
@inner
@param {Event} event | [
"Touch开始响应函数"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/dom/HandlerProxy.js#L104-L124 | train | Handle mouse events | [
30522,
3853,
1006,
2724,
1007,
1063,
1013,
1013,
12398,
8000,
9164,
2323,
2025,
2022,
9776,
2182,
1012,
1013,
1013,
2005,
2742,
1010,
3931,
2089,
3791,
2000,
2022,
7358,
2094,
1012,
2724,
1027,
3671,
4697,
18697,
3372,
1006,
2023,
1012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/base/ManagedObjectModel.js | _stringify | function _stringify(vObject) {
var sData = "", sProp;
var type = typeof vObject;
if (vObject == null || (type != "object" && type != "function")) {
sData = vObject;
} else if (isPlainObject(vObject)) {
sData = JSON.stringify(vObject);
} else if (vObject instanceof ManagedObject) {
sData = vObject.ge... | javascript | function _stringify(vObject) {
var sData = "", sProp;
var type = typeof vObject;
if (vObject == null || (type != "object" && type != "function")) {
sData = vObject;
} else if (isPlainObject(vObject)) {
sData = JSON.stringify(vObject);
} else if (vObject instanceof ManagedObject) {
sData = vObject.ge... | [
"function",
"_stringify",
"(",
"vObject",
")",
"{",
"var",
"sData",
"=",
"\"\"",
",",
"sProp",
";",
"var",
"type",
"=",
"typeof",
"vObject",
";",
"if",
"(",
"vObject",
"==",
"null",
"||",
"(",
"type",
"!=",
"\"object\"",
"&&",
"type",
"!=",
"\"function... | Serialize the object to a string to support change detection
@param vObject
@returns {string} a serialization of the object to a string
@private | [
"Serialize",
"the",
"object",
"to",
"a",
"string",
"to",
"support",
"change",
"detection"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/base/ManagedObjectModel.js#L98-L121 | train | Stringifies the given object | [
30522,
3853,
1035,
5164,
8757,
1006,
29536,
2497,
20614,
1007,
1063,
13075,
17371,
6790,
1027,
1000,
1000,
1010,
11867,
18981,
1025,
13075,
2828,
1027,
2828,
11253,
29536,
2497,
20614,
1025,
2065,
1006,
29536,
2497,
20614,
1027,
1027,
19701,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Manifest.js | function() {
// skip removing includes when not loaded yet
if (!this._bIncludesLoaded) {
return;
}
var mResources = this.getEntry("/sap.ui5/resources");
if (!mResources) {
return;
}
var sComponentName = this.getComponentName();
// remove CSS files
var aCSSResources = mResources["... | javascript | function() {
// skip removing includes when not loaded yet
if (!this._bIncludesLoaded) {
return;
}
var mResources = this.getEntry("/sap.ui5/resources");
if (!mResources) {
return;
}
var sComponentName = this.getComponentName();
// remove CSS files
var aCSSResources = mResources["... | [
"function",
"(",
")",
"{",
"// skip removing includes when not loaded yet",
"if",
"(",
"!",
"this",
".",
"_bIncludesLoaded",
")",
"{",
"return",
";",
"}",
"var",
"mResources",
"=",
"this",
".",
"getEntry",
"(",
"\"/sap.ui5/resources\"",
")",
";",
"if",
"(",
"!... | Removes the included CSS resources.
@private | [
"Removes",
"the",
"included",
"CSS",
"resources",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Manifest.js#L457-L489 | train | Removes all CSS files defined in the manifest | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
30524,
9623,
1027,
2023,
1012,
2131,
4765,
2854,
1006,
1000,
1013,
20066,
1012,
21318,
2629,
1013,
4219,
1000,
1007,
1025,
2065,
1006,
999,
2720,
2229,
8162,
9623,
1007,
1063,
2709,
1025,
1065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/private-browsing.js | privateBrowsing | function privateBrowsing(controller) {
this._controller = controller;
this._handler = null;
/**
* Menu item in the main menu to enter/leave Private Browsing mode
* @private
*/
this._pbMenuItem = new elementslib.Elem(this._controller.menus['tools-menu'].privateBrowsingItem);
this._pbTransitionItem = ... | javascript | function privateBrowsing(controller) {
this._controller = controller;
this._handler = null;
/**
* Menu item in the main menu to enter/leave Private Browsing mode
* @private
*/
this._pbMenuItem = new elementslib.Elem(this._controller.menus['tools-menu'].privateBrowsingItem);
this._pbTransitionItem = ... | [
"function",
"privateBrowsing",
"(",
"controller",
")",
"{",
"this",
".",
"_controller",
"=",
"controller",
";",
"this",
".",
"_handler",
"=",
"null",
";",
"/**\n * Menu item in the main menu to enter/leave Private Browsing mode\n * @private\n */",
"this",
".",
"_pbMen... | Create a new privateBrowsing instance.
@class This class adds support for the Private Browsing mode
@param {MozMillController} controller
MozMillController to use for the modal entry dialog | [
"Create",
"a",
"new",
"privateBrowsing",
"instance",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/private-browsing.js#L61-L77 | train | Constructor for Private Browsing mode | [
30522,
3853,
2797,
12618,
9333,
2075,
1006,
11486,
1007,
1063,
2023,
1012,
1035,
11486,
1027,
11486,
1025,
2023,
1012,
1035,
28213,
1027,
19701,
1025,
1013,
1008,
1008,
1008,
12183,
8875,
1999,
1996,
2364,
12183,
2000,
4607,
1013,
2681,
279... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/commons/text/form-control-value.js | ariaListboxValue | function ariaListboxValue(virtualNode, context) {
const { actualNode } = virtualNode;
const role = aria.getRole(actualNode);
if (role !== 'listbox') {
return '';
}
const selected = aria
.getOwnedVirtual(virtualNode)
.filter(
owned =>
aria.getRole(owned) === 'option' &&
owned.actualNode.getAttribu... | javascript | function ariaListboxValue(virtualNode, context) {
const { actualNode } = virtualNode;
const role = aria.getRole(actualNode);
if (role !== 'listbox') {
return '';
}
const selected = aria
.getOwnedVirtual(virtualNode)
.filter(
owned =>
aria.getRole(owned) === 'option' &&
owned.actualNode.getAttribu... | [
"function",
"ariaListboxValue",
"(",
"virtualNode",
",",
"context",
")",
"{",
"const",
"{",
"actualNode",
"}",
"=",
"virtualNode",
";",
"const",
"role",
"=",
"aria",
".",
"getRole",
"(",
"actualNode",
")",
";",
"if",
"(",
"role",
"!==",
"'listbox'",
")",
... | Calculate value of an element with role=combobox or role=listbox
@param {VirtualNode} element The VirtualNode instance whose value we want
@param {Object} context The VirtualNode instance whose value we want
@property {Element} startNode First node in accessible name computation
@property {String[]} unsupported List o... | [
"Calculate",
"value",
"of",
"an",
"element",
"with",
"role",
"=",
"combobox",
"or",
"role",
"=",
"listbox"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/commons/text/form-control-value.js#L136-L158 | train | Get the value of the selected option | [
30522,
3853,
9342,
9863,
8758,
10175,
5657,
1006,
7484,
3630,
3207,
1010,
6123,
1007,
1063,
9530,
3367,
1063,
5025,
3630,
3207,
1065,
1027,
7484,
3630,
3207,
1025,
9530,
3367,
2535,
1027,
9342,
1012,
2131,
13153,
2063,
1006,
5025,
3630,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableAccExtension.js | function(oExtension, $Cell, aDefaultLabels, aDefaultDescriptions) {
oExtension._cleanupInfo = {
cell: $Cell,
attr: {
"aria-labelledby": aDefaultLabels && aDefaultLabels.length ? aDefaultLabels.join(" ") : null,
"aria-describedby": aDefaultDescriptions && aDefaultDescriptions.length ? aDefaultDescri... | javascript | function(oExtension, $Cell, aDefaultLabels, aDefaultDescriptions) {
oExtension._cleanupInfo = {
cell: $Cell,
attr: {
"aria-labelledby": aDefaultLabels && aDefaultLabels.length ? aDefaultLabels.join(" ") : null,
"aria-describedby": aDefaultDescriptions && aDefaultDescriptions.length ? aDefaultDescri... | [
"function",
"(",
"oExtension",
",",
"$Cell",
",",
"aDefaultLabels",
",",
"aDefaultDescriptions",
")",
"{",
"oExtension",
".",
"_cleanupInfo",
"=",
"{",
"cell",
":",
"$Cell",
",",
"attr",
":",
"{",
"\"aria-labelledby\"",
":",
"aDefaultLabels",
"&&",
"aDefaultLabe... | /*
Stores the defaults before modifications of a cell for later cleanup
@see ExtensionHelper.cleanupCellModifications | [
"/",
"*",
"Stores",
"the",
"defaults",
"before",
"modifications",
"of",
"a",
"cell",
"for",
"later",
"cleanup"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableAccExtension.js#L291-L299 | train | This function is called by the cleanup function when the cell is not found. | [
30522,
3853,
1006,
1051,
10288,
29048,
1010,
1002,
3526,
1010,
4748,
12879,
23505,
20470,
9050,
1010,
4748,
12879,
23505,
6155,
23235,
8496,
1007,
1063,
1051,
10288,
29048,
1012,
1035,
27686,
2378,
14876,
1027,
1063,
3526,
1024,
1002,
3526,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/view/Chart.js | elSetState | function elSetState(el, state, highlightDigit) {
if (el) {
el.trigger(state, highlightDigit);
if (el.isGroup
// Simple optimize.
&& !graphicUtil.isHighDownDispatcher(el)
) {
for (var i = 0, len = el.childCount(); i < len; i++) {
elSetState(... | javascript | function elSetState(el, state, highlightDigit) {
if (el) {
el.trigger(state, highlightDigit);
if (el.isGroup
// Simple optimize.
&& !graphicUtil.isHighDownDispatcher(el)
) {
for (var i = 0, len = el.childCount(); i < len; i++) {
elSetState(... | [
"function",
"elSetState",
"(",
"el",
",",
"state",
",",
"highlightDigit",
")",
"{",
"if",
"(",
"el",
")",
"{",
"el",
".",
"trigger",
"(",
"state",
",",
"highlightDigit",
")",
";",
"if",
"(",
"el",
".",
"isGroup",
"// Simple optimize.",
"&&",
"!",
"grap... | Set state of single element
@param {module:zrender/Element} el
@param {string} state 'normal'|'emphasis'
@param {number} highlightDigit | [
"Set",
"state",
"of",
"single",
"element"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/view/Chart.js#L173-L185 | train | Set the state of an element | [
30522,
3853,
2842,
3215,
12259,
1006,
3449,
1010,
2110,
1010,
12944,
4305,
23806,
1007,
1063,
2065,
1006,
3449,
1007,
1063,
3449,
1012,
9495,
1006,
2110,
1010,
12944,
4305,
23806,
1007,
1025,
2065,
1006,
3449,
1012,
2003,
17058,
1013,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | lib/jsdoc/ui5/template/publish.js | publish | function publish(symbolSet) {
info("entering sapui5 template");
// create output dir
fs.mkPath(env.opts.destination);
// if ( symbolSet().count() < 20000 ) {
// info("writing raw symbols to " + path.join(env.opts.destination, "symbols-unpruned-ui5.json"));
// fs.writeFileSync(path.join(env.opts.destination, "sy... | javascript | function publish(symbolSet) {
info("entering sapui5 template");
// create output dir
fs.mkPath(env.opts.destination);
// if ( symbolSet().count() < 20000 ) {
// info("writing raw symbols to " + path.join(env.opts.destination, "symbols-unpruned-ui5.json"));
// fs.writeFileSync(path.join(env.opts.destination, "sy... | [
"function",
"publish",
"(",
"symbolSet",
")",
"{",
"info",
"(",
"\"entering sapui5 template\"",
")",
";",
"// create output dir",
"fs",
".",
"mkPath",
"(",
"env",
".",
"opts",
".",
"destination",
")",
";",
"//\tif ( symbolSet().count() < 20000 ) {",
"//\t\tinfo(\"writ... | ---- publish() - main entry point for JSDoc templates ------------------------------------------------------------------------------------------------------- /* Called automatically by JsDoc Toolkit. | [
"----",
"publish",
"()",
"-",
"main",
"entry",
"point",
"for",
"JSDoc",
"templates",
"-------------------------------------------------------------------------------------------------------",
"/",
"*",
"Called",
"automatically",
"by",
"JsDoc",
"Toolkit",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/ui5/template/publish.js#L393-L642 | train | publishes a set of symbols to the output directory | [
30522,
3853,
10172,
1006,
9255,
3388,
1007,
1063,
18558,
1006,
1000,
5738,
20066,
10179,
2629,
23561,
1000,
1007,
1025,
1013,
1013,
3443,
6434,
16101,
1042,
2015,
1012,
12395,
15069,
1006,
4372,
2615,
1012,
23569,
2015,
1012,
7688,
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... |
catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | ensureTransitionEndEvent | function ensureTransitionEndEvent(el, opt_timeOut) {
if (opt_timeOut === undefined) {
var style = getComputedStyle(el);
opt_timeOut = parseFloat(style.transitionDuration) * 1000;
// Give an additional 50ms buffer for the animation to complete.
opt_timeOut += 50;
}
var fired = false;
el.addEven... | javascript | function ensureTransitionEndEvent(el, opt_timeOut) {
if (opt_timeOut === undefined) {
var style = getComputedStyle(el);
opt_timeOut = parseFloat(style.transitionDuration) * 1000;
// Give an additional 50ms buffer for the animation to complete.
opt_timeOut += 50;
}
var fired = false;
el.addEven... | [
"function",
"ensureTransitionEndEvent",
"(",
"el",
",",
"opt_timeOut",
")",
"{",
"if",
"(",
"opt_timeOut",
"===",
"undefined",
")",
"{",
"var",
"style",
"=",
"getComputedStyle",
"(",
"el",
")",
";",
"opt_timeOut",
"=",
"parseFloat",
"(",
"style",
".",
"trans... | webkitTransitionEnd does not always fire (e.g. when animation is aborted
or when no paint happens during the animation). This function sets up
a timer and emulate the event if it is not fired when the timer expires.
@param {!HTMLElement} el The element to watch for webkitTransitionEnd.
@param {number=} opt_timeOut The ... | [
"webkitTransitionEnd",
"does",
"not",
"always",
"fire",
"(",
"e",
".",
"g",
".",
"when",
"animation",
"is",
"aborted",
"or",
"when",
"no",
"paint",
"happens",
"during",
"the",
"animation",
")",
".",
"This",
"function",
"sets",
"up",
"a",
"timer",
"and",
... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L279-L297 | train | Ensure transition end event is fired | [
30522,
3853,
5676,
6494,
3619,
22753,
10497,
18697,
3372,
1006,
3449,
1010,
23569,
1035,
2051,
5833,
1007,
1063,
2065,
1006,
23569,
1035,
2051,
5833,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
13075,
2806,
1027,
2131,
9006,
29462,
21756,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/EventDispatcher.js | makeEventDispatcher | function makeEventDispatcher(obj) {
$.extend(obj, {
on: on,
off: off,
one: one,
trigger: trigger,
_EventDispatcher: true
});
// Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,
// ha... | javascript | function makeEventDispatcher(obj) {
$.extend(obj, {
on: on,
off: off,
one: one,
trigger: trigger,
_EventDispatcher: true
});
// Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,
// ha... | [
"function",
"makeEventDispatcher",
"(",
"obj",
")",
"{",
"$",
".",
"extend",
"(",
"obj",
",",
"{",
"on",
":",
"on",
",",
"off",
":",
"off",
",",
"one",
":",
"one",
",",
"trigger",
":",
"trigger",
",",
"_EventDispatcher",
":",
"true",
"}",
")",
";",... | Adds the EventDispatcher APIs to the given object: on(), one(), off(), and trigger(). May also be
called on a prototype object - each instance will still behave independently.
@param {!Object} obj Object to add event-dispatch methods to | [
"Adds",
"the",
"EventDispatcher",
"APIs",
"to",
"the",
"given",
"object",
":",
"on",
"()",
"one",
"()",
"off",
"()",
"and",
"trigger",
"()",
".",
"May",
"also",
"be",
"called",
"on",
"a",
"prototype",
"object",
"-",
"each",
"instance",
"will",
"still",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/EventDispatcher.js#L243-L256 | train | makeEventDispatcher - Creates an event dispatcher object | [
30522,
3853,
2191,
18697,
3372,
10521,
4502,
10649,
2121,
1006,
27885,
3501,
1007,
1063,
1002,
1012,
7949,
1006,
27885,
3501,
1010,
1063,
2006,
1024,
2006,
1010,
2125,
1024,
2125,
1010,
2028,
1024,
2028,
1010,
9495,
1024,
9495,
1010,
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... |
eslint/eslint | lib/rules/comma-style.js | validateComma | function validateComma(node, property) {
const items = node[property],
arrayLiteral = (node.type === "ArrayExpression" || node.type === "ArrayPattern");
if (items.length > 1 || arrayLiteral) {
// seed as opening [
let previousItemToken = sourceCo... | javascript | function validateComma(node, property) {
const items = node[property],
arrayLiteral = (node.type === "ArrayExpression" || node.type === "ArrayPattern");
if (items.length > 1 || arrayLiteral) {
// seed as opening [
let previousItemToken = sourceCo... | [
"function",
"validateComma",
"(",
"node",
",",
"property",
")",
"{",
"const",
"items",
"=",
"node",
"[",
"property",
"]",
",",
"arrayLiteral",
"=",
"(",
"node",
".",
"type",
"===",
"\"ArrayExpression\"",
"||",
"node",
".",
"type",
"===",
"\"ArrayPattern\"",
... | Checks the comma placement with regards to a declaration/property/element
@param {ASTNode} node The binary expression node to check
@param {string} property The property of the node containing child nodes.
@private
@returns {void} | [
"Checks",
"the",
"comma",
"placement",
"with",
"regards",
"to",
"a",
"declaration",
"/",
"property",
"/",
"element"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/comma-style.js#L186-L249 | train | Validate comma between two items | [
30522,
3853,
9398,
3686,
9006,
2863,
1006,
13045,
1010,
3200,
1007,
1063,
9530,
3367,
5167,
1027,
13045,
1031,
3200,
1033,
1010,
9140,
22779,
7941,
1027,
1006,
13045,
1012,
2828,
1027,
1027,
1027,
1000,
9140,
10288,
20110,
3258,
1000,
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... |
catapult-project/catapult | third_party/coverage/coverage/htmlfiles/coverage_html.js | function (table) {
if (table.config.sortList.length === 0 && sort_list.length > 0) {
// This table hasn't been sorted before - we'll use
// our stored settings:
$(table).trigger('sorton', [sort_list]);
}
else {
// This i... | javascript | function (table) {
if (table.config.sortList.length === 0 && sort_list.length > 0) {
// This table hasn't been sorted before - we'll use
// our stored settings:
$(table).trigger('sorton', [sort_list]);
}
else {
// This i... | [
"function",
"(",
"table",
")",
"{",
"if",
"(",
"table",
".",
"config",
".",
"sortList",
".",
"length",
"===",
"0",
"&&",
"sort_list",
".",
"length",
">",
"0",
")",
"{",
"// This table hasn't been sorted before - we'll use",
"// our stored settings:",
"$",
"(",
... | Format is called by the widget before displaying: | [
"Format",
"is",
"called",
"by",
"the",
"widget",
"before",
"displaying",
":"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/coverage/coverage/htmlfiles/coverage_html.js#L198-L210 | train | If the table has already been sorted before we can t do anything | [
30522,
3853,
1006,
2795,
1007,
1063,
2065,
1006,
2795,
1012,
9530,
8873,
2290,
1012,
4066,
9863,
1012,
3091,
1027,
1027,
1027,
1014,
1004,
1004,
4066,
1035,
2862,
1012,
3091,
1028,
1014,
1007,
1063,
1013,
1013,
2023,
2795,
8440,
1005,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/dialog/dialog.js | onRemove | function onRemove(scope, element, options) {
options.deactivateListeners();
options.unlockScreenReader();
options.hideBackdrop(options.$destroy);
// Remove the focus traps that we added earlier for keeping focus within the dialog.
if (topFocusTrap && topFocusTrap.parentNode) {
top... | javascript | function onRemove(scope, element, options) {
options.deactivateListeners();
options.unlockScreenReader();
options.hideBackdrop(options.$destroy);
// Remove the focus traps that we added earlier for keeping focus within the dialog.
if (topFocusTrap && topFocusTrap.parentNode) {
top... | [
"function",
"onRemove",
"(",
"scope",
",",
"element",
",",
"options",
")",
"{",
"options",
".",
"deactivateListeners",
"(",
")",
";",
"options",
".",
"unlockScreenReader",
"(",
")",
";",
"options",
".",
"hideBackdrop",
"(",
"options",
".",
"$destroy",
")",
... | Remove function for all dialogs | [
"Remove",
"function",
"for",
"all",
"dialogs"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L806-L851 | train | Remove the dialog element | [
30522,
3853,
2006,
28578,
21818,
1006,
9531,
1010,
5783,
1010,
7047,
1007,
1063,
7047,
1012,
26709,
6593,
21466,
9863,
24454,
2015,
1006,
1007,
1025,
7047,
1012,
19829,
18182,
16416,
4063,
1006,
1007,
1025,
7047,
1012,
5342,
5963,
25711,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/document/DocumentManager.js | getDocumentText | function getDocumentText(file, checkLineEndings) {
var result = new $.Deferred(),
doc = getOpenDocumentForPath(file.fullPath);
if (doc) {
result.resolve(doc.getText(), doc.diskTimestamp, checkLineEndings ? doc._lineEndings : null);
} else {
file.read(function ... | javascript | function getDocumentText(file, checkLineEndings) {
var result = new $.Deferred(),
doc = getOpenDocumentForPath(file.fullPath);
if (doc) {
result.resolve(doc.getText(), doc.diskTimestamp, checkLineEndings ? doc._lineEndings : null);
} else {
file.read(function ... | [
"function",
"getDocumentText",
"(",
"file",
",",
"checkLineEndings",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"doc",
"=",
"getOpenDocumentForPath",
"(",
"file",
".",
"fullPath",
")",
";",
"if",
"(",
"doc",
")",
"{",
"... | Gets the text of a Document (including any unsaved changes), or would-be Document if the
file is not actually open. More efficient than getDocumentForPath(). Use when you're reading
document(s) but don't need to hang onto a Document object.
If the file is open this is equivalent to calling getOpenDocumentForPath().get... | [
"Gets",
"the",
"text",
"of",
"a",
"Document",
"(",
"including",
"any",
"unsaved",
"changes",
")",
"or",
"would",
"-",
"be",
"Document",
"if",
"the",
"file",
"is",
"not",
"actually",
"open",
".",
"More",
"efficient",
"than",
"getDocumentForPath",
"()",
".",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L418-L437 | train | Get the text of a file | [
30522,
3853,
2131,
3527,
24894,
4765,
18209,
1006,
5371,
1010,
4638,
4179,
18537,
2015,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
9986,
1027,
2131,
26915,
3527,
24894,
4765,
29278,
15069,
1006,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | parse_BoundSheet8 | function parse_BoundSheet8(blob, length, opts) {
var pos = blob.read_shift(4);
var hidden = blob.read_shift(1) & 0x03;
var dt = blob.read_shift(1);
switch(dt) {
case 0: dt = 'Worksheet'; break;
case 1: dt = 'Macrosheet'; break;
case 2: dt = 'Chartsheet'; break;
case 6: dt = 'VBAModule'; break;
}
var name ... | javascript | function parse_BoundSheet8(blob, length, opts) {
var pos = blob.read_shift(4);
var hidden = blob.read_shift(1) & 0x03;
var dt = blob.read_shift(1);
switch(dt) {
case 0: dt = 'Worksheet'; break;
case 1: dt = 'Macrosheet'; break;
case 2: dt = 'Chartsheet'; break;
case 6: dt = 'VBAModule'; break;
}
var name ... | [
"function",
"parse_BoundSheet8",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"var",
"pos",
"=",
"blob",
".",
"read_shift",
"(",
"4",
")",
";",
"var",
"hidden",
"=",
"blob",
".",
"read_shift",
"(",
"1",
")",
"&",
"0x03",
";",
"var",
"dt",
"="... | /* [MS-XLS] 2.4.28 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"4",
".",
"28"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L5800-L5813 | train | Parse BoundSheet8 | [
30522,
3853,
11968,
3366,
1035,
19202,
21030,
2102,
2620,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
13075,
13433,
2015,
1027,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1018,
1007,
1025,
13075,
5023,
1027,
1038... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/jszip.js | JSZip | function JSZip(data, options) {
// if this constructor is used without `new`, it adds `new` before itself:
if(!(this instanceof JSZip)) return new JSZip(data, options);
// object containing the files :
// {
// "folder/" : {...},
// "folder/data.txt" : {...}
// }
this.files = {};... | javascript | function JSZip(data, options) {
// if this constructor is used without `new`, it adds `new` before itself:
if(!(this instanceof JSZip)) return new JSZip(data, options);
// object containing the files :
// {
// "folder/" : {...},
// "folder/data.txt" : {...}
// }
this.files = {};... | [
"function",
"JSZip",
"(",
"data",
",",
"options",
")",
"{",
"// if this constructor is used without `new`, it adds `new` before itself:",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"JSZip",
")",
")",
"return",
"new",
"JSZip",
"(",
"data",
",",
"options",
")",
... | Usage:
zip = new JSZip();
zip.file("hello.txt", "Hello, World!").file("tempfile", "nothing");
zip.folder("images").file("smile.gif", base64Data, {base64: true});
zip.file("Xmas.txt", "Ho ho ho !", {date : new Date("December 25, 2007 00:00:01")});
zip.remove("tempfile");
base64zip = zip.generate();
Representation a ... | [
"Usage",
":",
"zip",
"=",
"new",
"JSZip",
"()",
";",
"zip",
".",
"file",
"(",
"hello",
".",
"txt",
"Hello",
"World!",
")",
".",
"file",
"(",
"tempfile",
"nothing",
")",
";",
"zip",
".",
"folder",
"(",
"images",
")",
".",
"file",
"(",
"smile",
"."... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jszip.js#L286-L311 | train | JSZip constructor. | [
30522,
3853,
1046,
17112,
11514,
1006,
2951,
1010,
7047,
1007,
1063,
1013,
1013,
2065,
2023,
9570,
2953,
18061,
2109,
2302,
2050,
1036,
2047,
1036,
1010,
2009,
2050,
9909,
1036,
2047,
1036,
2077,
2050,
2993,
1024,
2065,
1006,
999,
1006,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/widgets/PopUpManager.js | addPopUp | function addPopUp($popUp, removeHandler, autoRemove) {
autoRemove = autoRemove || false;
_popUps.push($popUp[0]);
$popUp.data("PopUpManager-autoRemove", autoRemove);
$popUp.data("PopUpManager-removeHandler", removeHandler);
} | javascript | function addPopUp($popUp, removeHandler, autoRemove) {
autoRemove = autoRemove || false;
_popUps.push($popUp[0]);
$popUp.data("PopUpManager-autoRemove", autoRemove);
$popUp.data("PopUpManager-removeHandler", removeHandler);
} | [
"function",
"addPopUp",
"(",
"$popUp",
",",
"removeHandler",
",",
"autoRemove",
")",
"{",
"autoRemove",
"=",
"autoRemove",
"||",
"false",
";",
"_popUps",
".",
"push",
"(",
"$popUp",
"[",
"0",
"]",
")",
";",
"$popUp",
".",
"data",
"(",
"\"PopUpManager-autoR... | Add Esc key handling for a popup DOM element.
@param {!jQuery} $popUp jQuery object for the DOM element pop-up
@param {function} removeHandler Pop-up specific remove (e.g. display:none or DOM removal)
@param {?Boolean} autoRemove - Specify true to indicate the PopUpManager should
remove the popup from the _popUps arra... | [
"Add",
"Esc",
"key",
"handling",
"for",
"a",
"popup",
"DOM",
"element",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/PopUpManager.js#L47-L53 | train | Add a popup to the list of available languages | [
30522,
3853,
5587,
16340,
6279,
1006,
1002,
3769,
6279,
1010,
6366,
11774,
3917,
1010,
8285,
28578,
21818,
1007,
1063,
8285,
28578,
21818,
1027,
8285,
28578,
21818,
1064,
1064,
6270,
1025,
1035,
3769,
22264,
1012,
5245,
1006,
1002,
3769,
62... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/new-cap.js | getCap | function getCap(str) {
const firstChar = str.charAt(0);
const firstCharLower = firstChar.toLowerCase();
const firstCharUpper = firstChar.toUpperCase();
if (firstCharLower === firstCharUpper) {
// char has no uppercase variant, so it's non-alphabetic
... | javascript | function getCap(str) {
const firstChar = str.charAt(0);
const firstCharLower = firstChar.toLowerCase();
const firstCharUpper = firstChar.toUpperCase();
if (firstCharLower === firstCharUpper) {
// char has no uppercase variant, so it's non-alphabetic
... | [
"function",
"getCap",
"(",
"str",
")",
"{",
"const",
"firstChar",
"=",
"str",
".",
"charAt",
"(",
"0",
")",
";",
"const",
"firstCharLower",
"=",
"firstChar",
".",
"toLowerCase",
"(",
")",
";",
"const",
"firstCharUpper",
"=",
"firstChar",
".",
"toUpperCase"... | Returns the capitalization state of the string -
Whether the first character is uppercase, lowercase, or non-alphabetic
@param {string} str String
@returns {string} capitalization state: "non-alpha", "lower", or "upper" | [
"Returns",
"the",
"capitalization",
"state",
"of",
"the",
"string",
"-",
"Whether",
"the",
"first",
"character",
"is",
"uppercase",
"lowercase",
"or",
"non",
"-",
"alphabetic"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/new-cap.js#L181-L197 | train | getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap - getCap | [
30522,
3853,
2131,
17695,
1006,
2358,
2099,
1007,
1063,
9530,
3367,
2034,
7507,
2099,
1027,
2358,
2099,
1012,
25869,
4017,
1006,
1014,
1007,
1025,
9530,
3367,
2034,
7507,
12190,
25114,
1027,
2034,
7507,
2099,
1012,
2000,
27663,
18992,
3366,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
BlackrockDigital/startbootstrap-sb-admin-2 | vendor/chart.js/Chart.js | function(inputs, context, index) {
var i, ilen, value;
for (i = 0, ilen = inputs.length; i < ilen; ++i) {
value = inputs[i];
if (value === undefined) {
continue;
}
if (context !== undefined && typeof value === 'function') {
value = value(context);
}
if (index !== undefined && helpers_core... | javascript | function(inputs, context, index) {
var i, ilen, value;
for (i = 0, ilen = inputs.length; i < ilen; ++i) {
value = inputs[i];
if (value === undefined) {
continue;
}
if (context !== undefined && typeof value === 'function') {
value = value(context);
}
if (index !== undefined && helpers_core... | [
"function",
"(",
"inputs",
",",
"context",
",",
"index",
")",
"{",
"var",
"i",
",",
"ilen",
",",
"value",
";",
"for",
"(",
"i",
"=",
"0",
",",
"ilen",
"=",
"inputs",
".",
"length",
";",
"i",
"<",
"ilen",
";",
"++",
"i",
")",
"{",
"value",
"="... | Evaluates the given `inputs` sequentially and returns the first defined value.
@param {Array} inputs - An array of values, falling back to the last value.
@param {object} [context] - If defined and the current value is a function, the value
is called with `context` as first argument and the result becomes the new input... | [
"Evaluates",
"the",
"given",
"inputs",
"sequentially",
"and",
"returns",
"the",
"first",
"defined",
"value",
"."
] | ddfaceb4a8e65a41f163e2fdc4eab49384b810a1 | https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/ddfaceb4a8e65a41f163e2fdc4eab49384b810a1/vendor/chart.js/Chart.js#L2667-L2685 | train | Returns the value of the specified parameter in the specified context. | [
30522,
3853,
1006,
20407,
1010,
6123,
1010,
5950,
1007,
1063,
13075,
1045,
1010,
17869,
2078,
1010,
3643,
1025,
2005,
1006,
1045,
1027,
1014,
1010,
17869,
2078,
1027,
20407,
1012,
3091,
1025,
1045,
1026,
17869,
2078,
1025,
1009,
1009,
1045,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
MithrilJS/mithril.js | mithril.js | callHook | function callHook(vnode3) {
var original = vnode3.state
try {
return this.apply(original, arguments)
} finally {
checkState(vnode3, original)
}
} | javascript | function callHook(vnode3) {
var original = vnode3.state
try {
return this.apply(original, arguments)
} finally {
checkState(vnode3, original)
}
} | [
"function",
"callHook",
"(",
"vnode3",
")",
"{",
"var",
"original",
"=",
"vnode3",
".",
"state",
"try",
"{",
"return",
"this",
".",
"apply",
"(",
"original",
",",
"arguments",
")",
"}",
"finally",
"{",
"checkState",
"(",
"vnode3",
",",
"original",
")",
... | Note: the hook is passed as the `this` argument to allow proxying the arguments without requiring a full array allocation to do so. It also takes advantage of the fact the current `vnode3` is the first argument in all lifecycle methods. | [
"Note",
":",
"the",
"hook",
"is",
"passed",
"as",
"the",
"this",
"argument",
"to",
"allow",
"proxying",
"the",
"arguments",
"without",
"requiring",
"a",
"full",
"array",
"allocation",
"to",
"do",
"so",
".",
"It",
"also",
"takes",
"advantage",
"of",
"the",
... | 6d36fe09d129928c6b460720e08d9ed321fcd62b | https://github.com/MithrilJS/mithril.js/blob/6d36fe09d129928c6b460720e08d9ed321fcd62b/mithril.js#L469-L476 | train | Call the hook with the given vnode3 | [
30522,
3853,
2655,
6806,
6559,
1006,
1058,
3630,
3207,
2509,
1007,
1063,
13075,
2434,
1027,
1058,
3630,
3207,
2509,
1012,
2110,
3046,
1063,
2709,
2023,
1012,
6611,
1006,
2434,
1010,
9918,
1007,
1065,
2633,
1063,
14148,
12259,
1006,
1058,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | features/extra/helpers.js | eventually | function eventually(callback, block, options) {
if (!options) options = {};
if (!options.delay) options.delay = 0;
if (!options.backoff) options.backoff = 500;
if (!options.maxTime) options.maxTime = 5;
var delay = options.delay;
var started = this.AWS.util.date.getDate();
var self = this... | javascript | function eventually(callback, block, options) {
if (!options) options = {};
if (!options.delay) options.delay = 0;
if (!options.backoff) options.backoff = 500;
if (!options.maxTime) options.maxTime = 5;
var delay = options.delay;
var started = this.AWS.util.date.getDate();
var self = this... | [
"function",
"eventually",
"(",
"callback",
",",
"block",
",",
"options",
")",
"{",
"if",
"(",
"!",
"options",
")",
"options",
"=",
"{",
"}",
";",
"if",
"(",
"!",
"options",
".",
"delay",
")",
"options",
".",
"delay",
"=",
"0",
";",
"if",
"(",
"!"... | Call this function with a block that will be executed multiple times
to deal with eventually consistent conditions.
this.When(/^I something is eventually consistent$/, function(callback) {
this.eventually(callback, function(next) {
doSomething(function(response) {
if (response != notWhatIExpect) {
next.fail();
} else ... | [
"Call",
"this",
"function",
"with",
"a",
"block",
"that",
"will",
"be",
"executed",
"multiple",
"times",
"to",
"deal",
"with",
"eventually",
"consistent",
"conditions",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/helpers.js#L33-L59 | train | Called when the service is eventually created | [
30522,
3853,
2776,
1006,
2655,
5963,
1010,
3796,
1010,
7047,
1007,
1063,
2065,
1006,
999,
7047,
1007,
7047,
1027,
1063,
1065,
1025,
2065,
1006,
999,
7047,
1012,
8536,
1007,
7047,
1012,
8536,
1027,
1014,
1025,
2065,
1006,
999,
7047,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/preferences/PreferencesBase.js | function (id) {
var scope = this._scopes[id];
if (scope) {
_.pull(this._defaults.scopeOrder, id);
scope.off(".prefsys");
this.trigger(SCOPEORDER_CHANGE, {
id: id,
action: "removed"
});
... | javascript | function (id) {
var scope = this._scopes[id];
if (scope) {
_.pull(this._defaults.scopeOrder, id);
scope.off(".prefsys");
this.trigger(SCOPEORDER_CHANGE, {
id: id,
action: "removed"
});
... | [
"function",
"(",
"id",
")",
"{",
"var",
"scope",
"=",
"this",
".",
"_scopes",
"[",
"id",
"]",
";",
"if",
"(",
"scope",
")",
"{",
"_",
".",
"pull",
"(",
"this",
".",
"_defaults",
".",
"scopeOrder",
",",
"id",
")",
";",
"scope",
".",
"off",
"(",
... | Removes a scope from the default scope order.
@param {string} id Name of the Scope to remove from the default scope order. | [
"Removes",
"a",
"scope",
"from",
"the",
"default",
"scope",
"order",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1533-L1546 | train | Remove a node from the scope order | [
30522,
3853,
1006,
8909,
1007,
1063,
13075,
9531,
1027,
2023,
1012,
1035,
9531,
2015,
1031,
8909,
1033,
1025,
2065,
1006,
9531,
1007,
1063,
1035,
1012,
4139,
1006,
2023,
1012,
1035,
12398,
2015,
1012,
9531,
8551,
2121,
1010,
8909,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aframevr/aframe | src/systems/camera.js | function (newCameraEl) {
var cameraEl;
var cameraEls;
var i;
var newCamera;
var previousCamera = this.activeCameraEl;
var sceneEl = this.sceneEl;
// Same camera.
newCamera = newCameraEl.getObject3D('camera');
if (!newCamera || newCameraEl === this.activeCameraEl) { return; }
//... | javascript | function (newCameraEl) {
var cameraEl;
var cameraEls;
var i;
var newCamera;
var previousCamera = this.activeCameraEl;
var sceneEl = this.sceneEl;
// Same camera.
newCamera = newCameraEl.getObject3D('camera');
if (!newCamera || newCameraEl === this.activeCameraEl) { return; }
//... | [
"function",
"(",
"newCameraEl",
")",
"{",
"var",
"cameraEl",
";",
"var",
"cameraEls",
";",
"var",
"i",
";",
"var",
"newCamera",
";",
"var",
"previousCamera",
"=",
"this",
".",
"activeCameraEl",
";",
"var",
"sceneEl",
"=",
"this",
".",
"sceneEl",
";",
"//... | Set active camera to be used by renderer.
Removes the default camera (if present).
Disables all other cameras in the scene.
@param {Element} newCameraEl - Entity with camera component. | [
"Set",
"active",
"camera",
"to",
"be",
"used",
"by",
"renderer",
".",
"Removes",
"the",
"default",
"camera",
"(",
"if",
"present",
")",
".",
"Disables",
"all",
"other",
"cameras",
"in",
"the",
"scene",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/systems/camera.js#L147-L186 | train | Sets the active camera of the scene. | [
30522,
3853,
1006,
2047,
28727,
6906,
2884,
1007,
1063,
13075,
4950,
2884,
1025,
13075,
4950,
9050,
1025,
13075,
1045,
1025,
13075,
2047,
28727,
6906,
1025,
13075,
3025,
28727,
6906,
1027,
2023,
1012,
3161,
28727,
6906,
2884,
1025,
13075,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/routing/Targets.js | function () {
var sTargetName;
EventProvider.prototype.destroy.apply(this);
for (sTargetName in this._mTargets) {
if (this._mTargets.hasOwnProperty(sTargetName)) {
this._mTargets[sTargetName].destroy();
}
}
this._mTargets = null;
this._oCache = null;
this._oConfig = null;
... | javascript | function () {
var sTargetName;
EventProvider.prototype.destroy.apply(this);
for (sTargetName in this._mTargets) {
if (this._mTargets.hasOwnProperty(sTargetName)) {
this._mTargets[sTargetName].destroy();
}
}
this._mTargets = null;
this._oCache = null;
this._oConfig = null;
... | [
"function",
"(",
")",
"{",
"var",
"sTargetName",
";",
"EventProvider",
".",
"prototype",
".",
"destroy",
".",
"apply",
"(",
"this",
")",
";",
"for",
"(",
"sTargetName",
"in",
"this",
".",
"_mTargets",
")",
"{",
"if",
"(",
"this",
".",
"_mTargets",
".",... | Destroys the targets instance and all created targets. Does not destroy the views instance passed to the constructor. It has to be destroyed separately.
@public
@returns { sap.ui.core.routing.Targets } this for chaining. | [
"Destroys",
"the",
"targets",
"instance",
"and",
"all",
"created",
"targets",
".",
"Does",
"not",
"destroy",
"the",
"views",
"instance",
"passed",
"to",
"the",
"constructor",
".",
"It",
"has",
"to",
"be",
"destroyed",
"separately",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Targets.js#L347-L363 | train | Destroys all related objects. | [
30522,
3853,
1006,
1007,
1063,
13075,
2732,
18150,
18442,
1025,
2724,
21572,
17258,
2121,
1012,
8773,
1012,
6033,
1012,
6611,
1006,
2023,
1007,
1025,
2005,
1006,
2732,
18150,
18442,
1999,
2023,
1012,
1035,
11047,
2906,
18150,
2015,
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... | |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | function( xhr, url ) {
var lastModified = xhr.getResponseHeader("Last-Modified"),
etag = xhr.getResponseHeader("Etag");
if ( lastModified ) {
jQuery.lastModified[url] = lastModified;
}
if ( etag ) {
jQuery.etag[url] = etag;
}
// Opera returns 0 when status is 304
return xhr.status === 304 || x... | javascript | function( xhr, url ) {
var lastModified = xhr.getResponseHeader("Last-Modified"),
etag = xhr.getResponseHeader("Etag");
if ( lastModified ) {
jQuery.lastModified[url] = lastModified;
}
if ( etag ) {
jQuery.etag[url] = etag;
}
// Opera returns 0 when status is 304
return xhr.status === 304 || x... | [
"function",
"(",
"xhr",
",",
"url",
")",
"{",
"var",
"lastModified",
"=",
"xhr",
".",
"getResponseHeader",
"(",
"\"Last-Modified\"",
")",
",",
"etag",
"=",
"xhr",
".",
"getResponseHeader",
"(",
"\"Etag\"",
")",
";",
"if",
"(",
"lastModified",
")",
"{",
"... | Determines if an XMLHttpRequest returns NotModified | [
"Determines",
"if",
"an",
"XMLHttpRequest",
"returns",
"NotModified"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L7769-L7783 | train | Cache the response headers | [
30522,
3853,
1006,
1060,
8093,
1010,
24471,
2140,
1007,
1063,
13075,
30524,
2121,
1006,
1000,
2197,
1011,
6310,
1000,
1007,
1010,
27859,
2290,
1027,
1060,
8093,
1012,
2131,
6072,
26029,
3366,
4974,
2121,
1006,
1000,
27859,
2290,
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... | |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (bin) {
var str = "";
for(var i = 0; i < bin.length * 32; i += 8)
{
str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & 255);
}
return str;
} | javascript | function (bin) {
var str = "";
for(var i = 0; i < bin.length * 32; i += 8)
{
str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & 255);
}
return str;
} | [
"function",
"(",
"bin",
")",
"{",
"var",
"str",
"=",
"\"\"",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"bin",
".",
"length",
"*",
"32",
";",
"i",
"+=",
"8",
")",
"{",
"str",
"+=",
"String",
".",
"fromCharCode",
"(",
"(",
"bin",
... | /*
Convert an array of little-endian words to a string | [
"/",
"*",
"Convert",
"an",
"array",
"of",
"little",
"-",
"endian",
"words",
"to",
"a",
"string"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L316-L323 | train | Returns a string of the contents of a binary array of words | [
30522,
3853,
1006,
8026,
1007,
1063,
13075,
2358,
2099,
1027,
1000,
1000,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
8026,
1012,
3091,
1008,
3590,
1025,
1045,
1009,
1027,
1022,
1007,
1063,
2358,
2099,
1009,
1027,
5164,
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/treemap/Breadcrumb.js | packEventData | function packEventData(el, seriesModel, itemNode) {
el.eventData = {
componentType: 'series',
componentSubType: 'treemap',
componentIndex: seriesModel.componentIndex,
seriesIndex: seriesModel.componentIndex,
seriesName: seriesModel.name,
seriesType: 'treemap',
... | javascript | function packEventData(el, seriesModel, itemNode) {
el.eventData = {
componentType: 'series',
componentSubType: 'treemap',
componentIndex: seriesModel.componentIndex,
seriesIndex: seriesModel.componentIndex,
seriesName: seriesModel.name,
seriesType: 'treemap',
... | [
"function",
"packEventData",
"(",
"el",
",",
"seriesModel",
",",
"itemNode",
")",
"{",
"el",
".",
"eventData",
"=",
"{",
"componentType",
":",
"'series'",
",",
"componentSubType",
":",
"'treemap'",
",",
"componentIndex",
":",
"seriesModel",
".",
"componentIndex"... | Package custom mouse event. | [
"Package",
"custom",
"mouse",
"event",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/treemap/Breadcrumb.js#L171-L186 | train | Pack event data into an event object | [
30522,
3853,
5308,
18697,
3372,
2850,
2696,
1006,
3449,
1010,
2186,
5302,
9247,
1010,
8875,
3630,
3207,
1007,
1063,
3449,
1012,
2724,
2850,
2696,
1027,
1063,
6922,
13874,
1024,
1005,
2186,
1005,
1010,
6177,
12083,
13874,
1024,
1005,
3392,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | mxUndoableEdit | function mxUndoableEdit(source, significant)
{
this.source = source;
this.changes = [];
this.significant = (significant != null) ? significant : true;
} | javascript | function mxUndoableEdit(source, significant)
{
this.source = source;
this.changes = [];
this.significant = (significant != null) ? significant : true;
} | [
"function",
"mxUndoableEdit",
"(",
"source",
",",
"significant",
")",
"{",
"this",
".",
"source",
"=",
"source",
";",
"this",
".",
"changes",
"=",
"[",
"]",
";",
"this",
".",
"significant",
"=",
"(",
"significant",
"!=",
"null",
")",
"?",
"significant",
... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxUndoableEdit
Implements a composite undoable edit. Here is an example for a custom change
which gets executed via the model:
(code)
function CustomChange(model, name)
{
this.model = model;
this.name = name;
this.previous = name;
};
... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxUndoableEdit"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L14287-L14292 | train | A wrapper around the mxUndoableEdit class | [
30522,
3853,
25630,
8630,
10441,
3468,
2098,
4183,
1006,
3120,
1010,
3278,
1007,
1063,
2023,
1012,
3120,
1027,
3120,
1025,
2023,
1012,
3431,
1027,
1031,
1033,
1025,
2023,
1012,
3278,
1027,
1006,
3278,
999,
1027,
19701,
1007,
1029,
3278,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.