repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
google/material-design-lite | src/mdlComponentHandler.js | deconstructComponentInternal | function deconstructComponentInternal(component) {
if (component) {
var componentIndex = createdComponents_.indexOf(component);
createdComponents_.splice(componentIndex, 1);
var upgrades = component.element_.getAttribute('data-upgraded').split(',');
var componentPlace = upgrades.indexOf(com... | javascript | function deconstructComponentInternal(component) {
if (component) {
var componentIndex = createdComponents_.indexOf(component);
createdComponents_.splice(componentIndex, 1);
var upgrades = component.element_.getAttribute('data-upgraded').split(',');
var componentPlace = upgrades.indexOf(com... | [
"function",
"deconstructComponentInternal",
"(",
"component",
")",
"{",
"if",
"(",
"component",
")",
"{",
"var",
"componentIndex",
"=",
"createdComponents_",
".",
"indexOf",
"(",
"component",
")",
";",
"createdComponents_",
".",
"splice",
"(",
"componentIndex",
",... | Check the component for the downgrade method.
Execute if found.
Remove component from createdComponents list.
@param {?componentHandler.Component} component | [
"Check",
"the",
"component",
"for",
"the",
"downgrade",
"method",
".",
"Execute",
"if",
"found",
".",
"Remove",
"component",
"from",
"createdComponents",
"list",
"."
] | 60f441a22ed98ed2c03f6179adf460d888bf459f | https://github.com/google/material-design-lite/blob/60f441a22ed98ed2c03f6179adf460d888bf459f/src/mdlComponentHandler.js#L370-L383 | train | Deconstructs a component | [
30522,
3853,
21933,
23808,
6820,
6593,
9006,
29513,
16778,
10111,
12789,
2140,
1006,
6922,
1007,
1063,
2065,
1006,
6922,
1007,
1063,
13075,
6922,
22254,
10288,
1027,
2580,
9006,
29513,
7666,
1035,
1012,
5950,
11253,
1006,
6922,
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... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/dom-utils.js | nodeCollector_filter | function nodeCollector_filter(aCallback, aThisObject) {
if (!aCallback)
throw new Error(arguments.callee.name + ": No callback specified");
this.nodes = Array.filter(this.nodes, aCallback, aThisObject);
return this;
} | javascript | function nodeCollector_filter(aCallback, aThisObject) {
if (!aCallback)
throw new Error(arguments.callee.name + ": No callback specified");
this.nodes = Array.filter(this.nodes, aCallback, aThisObject);
return this;
} | [
"function",
"nodeCollector_filter",
"(",
"aCallback",
",",
"aThisObject",
")",
"{",
"if",
"(",
"!",
"aCallback",
")",
"throw",
"new",
"Error",
"(",
"arguments",
".",
"callee",
".",
"name",
"+",
"\": No callback specified\"",
")",
";",
"this",
".",
"nodes",
"... | Filter nodes given by the specified callback function
@param {function} aCallback
Function to test each element of the array.
Elements: node, index (optional) , array (optional)
@param {object} aThisObject
Object to use as 'this' when executing callback.
[optional - default: function scope]
@returns The class instanc... | [
"Filter",
"nodes",
"given",
"by",
"the",
"specified",
"callback",
"function"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/dom-utils.js#L566-L573 | train | Filter the nodes in the node list | [
30522,
3853,
13045,
26895,
22471,
2953,
1035,
11307,
1006,
9353,
8095,
5963,
1010,
2012,
24158,
16429,
20614,
1007,
1063,
2065,
1006,
999,
9353,
8095,
5963,
1007,
5466,
2047,
7561,
1006,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-eval.js | reportAccessingEvalViaGlobalObject | function reportAccessingEvalViaGlobalObject(globalScope) {
for (let i = 0; i < candidatesOfGlobalObject.length; ++i) {
const name = candidatesOfGlobalObject[i];
const variable = astUtils.getVariableByName(globalScope, name);
if (!variable) {
... | javascript | function reportAccessingEvalViaGlobalObject(globalScope) {
for (let i = 0; i < candidatesOfGlobalObject.length; ++i) {
const name = candidatesOfGlobalObject[i];
const variable = astUtils.getVariableByName(globalScope, name);
if (!variable) {
... | [
"function",
"reportAccessingEvalViaGlobalObject",
"(",
"globalScope",
")",
"{",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"candidatesOfGlobalObject",
".",
"length",
";",
"++",
"i",
")",
"{",
"const",
"name",
"=",
"candidatesOfGlobalObject",
"[",
"i",
... | Reports accesses of `eval` via the global object.
@param {eslint-scope.Scope} globalScope - The global scope.
@returns {void} | [
"Reports",
"accesses",
"of",
"eval",
"via",
"the",
"global",
"object",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-eval.js#L178-L204 | train | Reports accessing eval via global object | [
30522,
3853,
3189,
6305,
9623,
7741,
13331,
2140,
9035,
23296,
16429,
23067,
2497,
20614,
1006,
3795,
26127,
1007,
1063,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026,
5347,
11253,
23296,
16429,
23067,
2497,
20614,
1012,
3091,
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... |
jgraph/mxgraph | javascript/mxClient.js | function(p1, p2)
{
var min = Math.min(p1.length, p2.length);
var comp = 0;
for (var i = 0; i < min; i++)
{
if (p1[i] != p2[i])
{
if (p1[i].length == 0 ||
p2[i].length == 0)
{
comp = (p1[i] == p2[i]) ? 0 : ((p1[i] > p2[i]) ? 1 : -1);
}
else
{
var t1 = parseInt(p1[i]);... | javascript | function(p1, p2)
{
var min = Math.min(p1.length, p2.length);
var comp = 0;
for (var i = 0; i < min; i++)
{
if (p1[i] != p2[i])
{
if (p1[i].length == 0 ||
p2[i].length == 0)
{
comp = (p1[i] == p2[i]) ? 0 : ((p1[i] > p2[i]) ? 1 : -1);
}
else
{
var t1 = parseInt(p1[i]);... | [
"function",
"(",
"p1",
",",
"p2",
")",
"{",
"var",
"min",
"=",
"Math",
".",
"min",
"(",
"p1",
".",
"length",
",",
"p2",
".",
"length",
")",
";",
"var",
"comp",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"min",
";",
"i... | Function: compare
Compares the given cell paths and returns -1 if p1 is smaller, 0 if
p1 is equal and 1 if p1 is greater than p2. | [
"Function",
":",
"compare"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L43327-L43366 | train | Compares two arrays of points | [
30522,
3853,
1006,
1052,
2487,
1010,
1052,
2475,
1007,
1063,
13075,
8117,
1027,
8785,
1012,
8117,
1006,
1052,
2487,
1012,
3091,
1010,
1052,
2475,
1012,
3091,
1007,
1025,
13075,
4012,
2361,
1027,
1014,
1025,
2005,
1006,
13075,
1045,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | xlsx.js | parse_Guts | function parse_Guts(blob) {
blob.l += 4;
var out = [blob.read_shift(2), blob.read_shift(2)];
if(out[0] !== 0) out[0]--;
if(out[1] !== 0) out[1]--;
if(out[0] > 7 || out[1] > 7) throw new Error("Bad Gutters: " + out.join("|"));
return out;
} | javascript | function parse_Guts(blob) {
blob.l += 4;
var out = [blob.read_shift(2), blob.read_shift(2)];
if(out[0] !== 0) out[0]--;
if(out[1] !== 0) out[1]--;
if(out[0] > 7 || out[1] > 7) throw new Error("Bad Gutters: " + out.join("|"));
return out;
} | [
"function",
"parse_Guts",
"(",
"blob",
")",
"{",
"blob",
".",
"l",
"+=",
"4",
";",
"var",
"out",
"=",
"[",
"blob",
".",
"read_shift",
"(",
"2",
")",
",",
"blob",
".",
"read_shift",
"(",
"2",
")",
"]",
";",
"if",
"(",
"out",
"[",
"0",
"]",
"!=... | /* [MS-XLS] 2.4.134 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"4",
".",
"134"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L6134-L6141 | train | Parse Gutters | [
30522,
3853,
11968,
3366,
1035,
18453,
1006,
1038,
4135,
2497,
1007,
1063,
1038,
4135,
2497,
1012,
1048,
1009,
1027,
1018,
1025,
13075,
2041,
1027,
1031,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1016,
1007,
1010,
1038,
4135,
2497,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/angular | .circleci/trigger-webhook.js | _main | function _main(args) {
triggerWebhook(...args).
then(({statusCode, responseText}) => (200 <= statusCode && statusCode < 400) ?
console.log(`Status: ${statusCode}\n${responseText}`) :
Promise.reject(new Error(`Request failed (status: ${statusCode}): ${responseText}`))).
catch(err => {
console... | javascript | function _main(args) {
triggerWebhook(...args).
then(({statusCode, responseText}) => (200 <= statusCode && statusCode < 400) ?
console.log(`Status: ${statusCode}\n${responseText}`) :
Promise.reject(new Error(`Request failed (status: ${statusCode}): ${responseText}`))).
catch(err => {
console... | [
"function",
"_main",
"(",
"args",
")",
"{",
"triggerWebhook",
"(",
"...",
"args",
")",
".",
"then",
"(",
"(",
"{",
"statusCode",
",",
"responseText",
"}",
")",
"=>",
"(",
"200",
"<=",
"statusCode",
"&&",
"statusCode",
"<",
"400",
")",
"?",
"console",
... | Helpers | [
"Helpers"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/.circleci/trigger-webhook.js#L62-L71 | train | Main function. | [
30522,
3853,
1035,
2364,
1006,
12098,
5620,
1007,
1063,
9495,
8545,
23706,
14659,
1006,
1012,
1012,
1012,
12098,
5620,
1007,
1012,
2059,
1006,
1006,
1063,
3570,
16044,
1010,
3433,
18209,
1065,
1007,
1027,
1028,
1006,
3263,
1026,
1027,
3570,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
openlayers/openlayers | src/ol/color.js | fromNamed | function fromNamed(color) {
const el = document.createElement('div');
el.style.color = color;
if (el.style.color !== '') {
document.body.appendChild(el);
const rgb = getComputedStyle(el).color;
document.body.removeChild(el);
return rgb;
} else {
return '';
}
} | javascript | function fromNamed(color) {
const el = document.createElement('div');
el.style.color = color;
if (el.style.color !== '') {
document.body.appendChild(el);
const rgb = getComputedStyle(el).color;
document.body.removeChild(el);
return rgb;
} else {
return '';
}
} | [
"function",
"fromNamed",
"(",
"color",
")",
"{",
"const",
"el",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"el",
".",
"style",
".",
"color",
"=",
"color",
";",
"if",
"(",
"el",
".",
"style",
".",
"color",
"!==",
"''",
")",
"{",
... | Return named color as an rgba string.
@param {string} color Named color.
@return {string} Rgb string. | [
"Return",
"named",
"color",
"as",
"an",
"rgba",
"string",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/color.js#L55-L66 | train | Get the named color | [
30522,
3853,
2013,
18442,
2094,
1006,
3609,
1007,
1063,
9530,
3367,
3449,
1027,
6254,
1012,
3443,
12260,
3672,
1006,
1005,
4487,
2615,
1005,
1007,
1025,
3449,
1012,
2806,
1012,
3609,
1027,
3609,
1025,
2065,
1006,
3449,
1012,
2806,
1012,
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... |
apache/incubator-echarts | src/data/helper/sourceHelper.js | makeDefaultEncode | function makeDefaultEncode(
seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult
) {
var coordSysDefine = getCoordSysDefineBySeries(seriesModel);
var encode = {};
// var encodeTooltip = [];
// var encodeLabel = [];
var encodeItemName = [];
var encodeSeriesName = [];
... | javascript | function makeDefaultEncode(
seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult
) {
var coordSysDefine = getCoordSysDefineBySeries(seriesModel);
var encode = {};
// var encodeTooltip = [];
// var encodeLabel = [];
var encodeItemName = [];
var encodeSeriesName = [];
... | [
"function",
"makeDefaultEncode",
"(",
"seriesModel",
",",
"datasetModel",
",",
"data",
",",
"sourceFormat",
",",
"seriesLayoutBy",
",",
"completeResult",
")",
"{",
"var",
"coordSysDefine",
"=",
"getCoordSysDefineBySeries",
"(",
"seriesModel",
")",
";",
"var",
"encod... | ??? TODO merge to completedimensions, where also has default encode making logic. And the default rule should depends on series? consider 'map'. | [
"???",
"TODO",
"merge",
"to",
"completedimensions",
"where",
"also",
"has",
"default",
"encode",
"making",
"logic",
".",
"And",
"the",
"default",
"rule",
"should",
"depends",
"on",
"series?",
"consider",
"map",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/data/helper/sourceHelper.js#L365-L461 | train | This function is called by encodeSeries to create a default encode array for the series. | [
30522,
3853,
2191,
3207,
7011,
11314,
2368,
16044,
1006,
2186,
5302,
9247,
1010,
2951,
13462,
5302,
9247,
1010,
2951,
1010,
3120,
14192,
4017,
1010,
2186,
8485,
5833,
3762,
1010,
3143,
6072,
11314,
1007,
1063,
13075,
2522,
8551,
6508,
16150... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ManagedObjectObserver.js | destroy | function destroy(oListener) {
for (var n in mTargets) {
var oTargetConfig = mTargets[n];
for (var i = 0; i < oTargetConfig.listeners.length; i++) {
if (oTargetConfig.listeners[i] === oListener) {
oTargetConfig.listeners.splice(i, 1);
oTargetConfig.configurations.splice(i, 1);
}
}
if (oTa... | javascript | function destroy(oListener) {
for (var n in mTargets) {
var oTargetConfig = mTargets[n];
for (var i = 0; i < oTargetConfig.listeners.length; i++) {
if (oTargetConfig.listeners[i] === oListener) {
oTargetConfig.listeners.splice(i, 1);
oTargetConfig.configurations.splice(i, 1);
}
}
if (oTa... | [
"function",
"destroy",
"(",
"oListener",
")",
"{",
"for",
"(",
"var",
"n",
"in",
"mTargets",
")",
"{",
"var",
"oTargetConfig",
"=",
"mTargets",
"[",
"n",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"oTargetConfig",
".",
"listeners",
... | removes a given listener by looking at all registered targets and their listeners. if there are no more listeners to a target, the registered target is removed from the mTargets map. | [
"removes",
"a",
"given",
"listener",
"by",
"looking",
"at",
"all",
"registered",
"targets",
"and",
"their",
"listeners",
".",
"if",
"there",
"are",
"no",
"more",
"listeners",
"to",
"a",
"target",
"the",
"registered",
"target",
"is",
"removed",
"from",
"the",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ManagedObjectObserver.js#L513-L527 | train | Destroys a listener | [
30522,
3853,
6033,
1006,
19330,
27870,
3678,
1007,
1063,
2005,
1006,
13075,
1050,
1999,
11047,
2906,
18150,
2015,
1007,
1063,
13075,
27178,
2906,
18150,
8663,
8873,
2290,
1027,
11047,
2906,
18150,
2015,
1031,
1050,
1033,
1025,
2005,
1006,
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/core/a-assets.js | inferResponseType | function inferResponseType (src) {
var dotLastIndex = src.lastIndexOf('.');
if (dotLastIndex >= 0) {
var extension = src.slice(dotLastIndex, src.length);
if (extension === '.gltf' || extension === '.glb') {
return 'arraybuffer';
}
}
return 'text';
} | javascript | function inferResponseType (src) {
var dotLastIndex = src.lastIndexOf('.');
if (dotLastIndex >= 0) {
var extension = src.slice(dotLastIndex, src.length);
if (extension === '.gltf' || extension === '.glb') {
return 'arraybuffer';
}
}
return 'text';
} | [
"function",
"inferResponseType",
"(",
"src",
")",
"{",
"var",
"dotLastIndex",
"=",
"src",
".",
"lastIndexOf",
"(",
"'.'",
")",
";",
"if",
"(",
"dotLastIndex",
">=",
"0",
")",
"{",
"var",
"extension",
"=",
"src",
".",
"slice",
"(",
"dotLastIndex",
",",
... | Infer response-type attribute from src.
Default is text(default XMLHttpRequest.responseType)
but we use arraybuffer for .gltf and .glb files
because of THREE.GLTFLoader specification.
@param {string} src
@returns {string} | [
"Infer",
"response",
"-",
"type",
"attribute",
"from",
"src",
".",
"Default",
"is",
"text",
"(",
"default",
"XMLHttpRequest",
".",
"responseType",
")",
"but",
"we",
"use",
"arraybuffer",
"for",
".",
"gltf",
"and",
".",
"glb",
"files",
"because",
"of",
"THR... | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/a-assets.js#L253-L262 | train | infer response type from src | [
30522,
3853,
1999,
7512,
6072,
26029,
13462,
18863,
1006,
5034,
2278,
1007,
1063,
13075,
11089,
8523,
7629,
3207,
2595,
1027,
5034,
2278,
1012,
2197,
22254,
10288,
11253,
1006,
1005,
1012,
1005,
1007,
1025,
2065,
1006,
11089,
8523,
7629,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/performance/BeaconRequest.js | function (option) {
option = option || {};
if (!BeaconRequest.isSupported()) {
throw Error("Beacon API is not supported");
}
if (typeof option.url !== "string") {
throw Error("Beacon url must be valid");
}
this._nMaxBufferLength = option.maxBufferLength || 10;
this._aBuffer = [];
this._sUrl = o... | javascript | function (option) {
option = option || {};
if (!BeaconRequest.isSupported()) {
throw Error("Beacon API is not supported");
}
if (typeof option.url !== "string") {
throw Error("Beacon url must be valid");
}
this._nMaxBufferLength = option.maxBufferLength || 10;
this._aBuffer = [];
this._sUrl = o... | [
"function",
"(",
"option",
")",
"{",
"option",
"=",
"option",
"||",
"{",
"}",
";",
"if",
"(",
"!",
"BeaconRequest",
".",
"isSupported",
"(",
")",
")",
"{",
"throw",
"Error",
"(",
"\"Beacon API is not supported\"",
")",
";",
"}",
"if",
"(",
"typeof",
"o... | A helper for buffering and sending BeaconRequests to a certain URL
@param {object} option Options for beacon API initialization
@param {string} option.url beacon URL
@param {string} option.maxBufferLength Number of entries in the stack before the beacon is send
@private
@ui5-restricted sap.ui.core | [
"A",
"helper",
"for",
"buffering",
"and",
"sending",
"BeaconRequests",
"to",
"a",
"certain",
"URL"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/performance/BeaconRequest.js#L18-L33 | train | Initialize the beacon | [
30522,
3853,
1006,
5724,
1007,
1063,
5724,
1027,
5724,
1064,
1064,
1063,
1065,
1025,
2065,
1006,
999,
14400,
2890,
15500,
1012,
26354,
6279,
6442,
2098,
1006,
1007,
1007,
1063,
5466,
7561,
1006,
1000,
14400,
17928,
2003,
2025,
3569,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | setValue | function setValue ( to, handleNumber ) {
// Setting with null indicates an 'ignore'.
// Inputting 'false' is invalid.
if ( to === null || to === false ) {
return;
}
// If a formatted number was passed, attemt to decode it.
if ( ty... | javascript | function setValue ( to, handleNumber ) {
// Setting with null indicates an 'ignore'.
// Inputting 'false' is invalid.
if ( to === null || to === false ) {
return;
}
// If a formatted number was passed, attemt to decode it.
if ( ty... | [
"function",
"setValue",
"(",
"to",
",",
"handleNumber",
")",
"{",
"// Setting with null indicates an 'ignore'.",
"// Inputting 'false' is invalid.",
"if",
"(",
"to",
"===",
"null",
"||",
"to",
"===",
"false",
")",
"{",
"return",
";",
"}",
"// If a formatted number was... | ... | [
"..."
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L1855-L1875 | train | Set the value of a link | [
30522,
3853,
2275,
10175,
5657,
1006,
2000,
1010,
5047,
19172,
5677,
1007,
1063,
1013,
1013,
4292,
2007,
19701,
7127,
2019,
1005,
8568,
1005,
1012,
1013,
1013,
7953,
3436,
1005,
6270,
1005,
2003,
19528,
1012,
2065,
1006,
2000,
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... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(cell) {
if (cell.isColspan) {
var colspan = parseInt(api.getAttribute(cell.el, 'colspan') || 1, 10),
cType = cell.el.tagName.toLowerCase();
if (colspan > 1) {
var newCells = this.createCells(cType, colspan -1);
... | javascript | function(cell) {
if (cell.isColspan) {
var colspan = parseInt(api.getAttribute(cell.el, 'colspan') || 1, 10),
cType = cell.el.tagName.toLowerCase();
if (colspan > 1) {
var newCells = this.createCells(cType, colspan -1);
... | [
"function",
"(",
"cell",
")",
"{",
"if",
"(",
"cell",
".",
"isColspan",
")",
"{",
"var",
"colspan",
"=",
"parseInt",
"(",
"api",
".",
"getAttribute",
"(",
"cell",
".",
"el",
",",
"'colspan'",
")",
"||",
"1",
",",
"10",
")",
",",
"cType",
"=",
"ce... | Splits merged cell on row to unique cells | [
"Splits",
"merged",
"cell",
"on",
"row",
"to",
"unique",
"cells"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L7615-L7625 | train | create cells if colspan > 1 | [
30522,
3853,
1006,
3526,
1007,
1063,
2065,
1006,
3526,
1012,
2003,
25778,
13102,
2319,
1007,
1063,
13075,
8902,
13102,
2319,
1027,
11968,
20240,
3372,
1006,
17928,
1012,
2131,
19321,
3089,
8569,
2618,
1006,
3526,
1012,
3449,
1010,
1005,
890... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/max-lines-per-function.js | processFunction | function processFunction(funcNode) {
const node = isEmbedded(funcNode) ? funcNode.parent : funcNode;
if (!IIFEs && isIIFE(node)) {
return;
}
let lineCount = 0;
for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) {
... | javascript | function processFunction(funcNode) {
const node = isEmbedded(funcNode) ? funcNode.parent : funcNode;
if (!IIFEs && isIIFE(node)) {
return;
}
let lineCount = 0;
for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) {
... | [
"function",
"processFunction",
"(",
"funcNode",
")",
"{",
"const",
"node",
"=",
"isEmbedded",
"(",
"funcNode",
")",
"?",
"funcNode",
".",
"parent",
":",
"funcNode",
";",
"if",
"(",
"!",
"IIFEs",
"&&",
"isIIFE",
"(",
"node",
")",
")",
"{",
"return",
";"... | Count the lines in the function
@param {ASTNode} funcNode Function AST node
@returns {void}
@private | [
"Count",
"the",
"lines",
"in",
"the",
"function"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/max-lines-per-function.js#L168-L203 | train | Process function node | [
30522,
3853,
2832,
11263,
27989,
1006,
4569,
2278,
3630,
3207,
1007,
1063,
9530,
3367,
13045,
1027,
2003,
6633,
8270,
5732,
1006,
4569,
2278,
3630,
3207,
1007,
1029,
4569,
2278,
3630,
3207,
1012,
6687,
1024,
4569,
2278,
3630,
3207,
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... |
adobe/brackets | src/utils/Async.js | doSequentiallyInBackground | function doSequentiallyInBackground(items, fnProcessItem, maxBlockingTime, idleTime) {
maxBlockingTime = maxBlockingTime || 15;
idleTime = idleTime || 30;
var sliceStartTime = (new Date()).getTime();
return doSequentially(items, function (item, i) {
var result = new $.Defe... | javascript | function doSequentiallyInBackground(items, fnProcessItem, maxBlockingTime, idleTime) {
maxBlockingTime = maxBlockingTime || 15;
idleTime = idleTime || 30;
var sliceStartTime = (new Date()).getTime();
return doSequentially(items, function (item, i) {
var result = new $.Defe... | [
"function",
"doSequentiallyInBackground",
"(",
"items",
",",
"fnProcessItem",
",",
"maxBlockingTime",
",",
"idleTime",
")",
"{",
"maxBlockingTime",
"=",
"maxBlockingTime",
"||",
"15",
";",
"idleTime",
"=",
"idleTime",
"||",
"30",
";",
"var",
"sliceStartTime",
"=",... | Executes a series of synchronous tasks sequentially spread over time-slices less than maxBlockingTime.
Processing yields by idleTime between time-slices.
@param {!Array.<*>} items
@param {!function(*, number)} fnProcessItem Function that synchronously processes one item
@param {number=} maxBlockingTime
@param {number... | [
"Executes",
"a",
"series",
"of",
"synchronous",
"tasks",
"sequentially",
"spread",
"over",
"time",
"-",
"slices",
"less",
"than",
"maxBlockingTime",
".",
"Processing",
"yields",
"by",
"idleTime",
"between",
"time",
"-",
"slices",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/Async.js#L208-L235 | train | This function is a helper function that will iterate over the items in the background and process the next item in the background | [
30522,
3853,
13004,
15417,
4818,
2135,
2378,
5963,
16365,
1006,
5167,
1010,
1042,
16275,
3217,
9623,
28032,
6633,
1010,
4098,
23467,
2075,
7292,
1010,
18373,
7292,
1007,
1063,
4098,
23467,
2075,
7292,
1027,
4098,
23467,
2075,
7292,
1064,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
firebase/firebaseui-web | javascript/widgets/handler/common.js | function(account) {
var app = getApp();
if (!app) {
return;
}
firebaseui.auth.widget.handler.common.handleAcAccountSelectedResponse_(
account, app, container, uiShownCallback);
} | javascript | function(account) {
var app = getApp();
if (!app) {
return;
}
firebaseui.auth.widget.handler.common.handleAcAccountSelectedResponse_(
account, app, container, uiShownCallback);
} | [
"function",
"(",
"account",
")",
"{",
"var",
"app",
"=",
"getApp",
"(",
")",
";",
"if",
"(",
"!",
"app",
")",
"{",
"return",
";",
"}",
"firebaseui",
".",
"auth",
".",
"widget",
".",
"handler",
".",
"common",
".",
"handleAcAccountSelectedResponse_",
"("... | Handle the account returned from accountchooser.com. | [
"Handle",
"the",
"account",
"returned",
"from",
"accountchooser",
".",
"com",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/common.js#L381-L388 | train | Handle the account selected response from the auth service. | [
30522,
3853,
1006,
4070,
1007,
1063,
13075,
10439,
1027,
2131,
29098,
1006,
1007,
1025,
2065,
1006,
999,
10439,
1007,
1063,
2709,
1025,
1065,
2543,
15058,
10179,
1012,
8740,
2705,
1012,
15536,
24291,
1012,
28213,
1012,
2691,
1012,
5047,
196... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
zloirock/core-js | packages/core-js/modules/esnext.map.merge.js | merge | function merge(iterable /* ...iterbles */) {
var map = anObject(this);
var setter = aFunction(map.set);
var i = 0;
while (i < arguments.length) {
iterate(arguments[i++], setter, map, true);
}
return map;
} | javascript | function merge(iterable /* ...iterbles */) {
var map = anObject(this);
var setter = aFunction(map.set);
var i = 0;
while (i < arguments.length) {
iterate(arguments[i++], setter, map, true);
}
return map;
} | [
"function",
"merge",
"(",
"iterable",
"/* ...iterbles */",
")",
"{",
"var",
"map",
"=",
"anObject",
"(",
"this",
")",
";",
"var",
"setter",
"=",
"aFunction",
"(",
"map",
".",
"set",
")",
";",
"var",
"i",
"=",
"0",
";",
"while",
"(",
"i",
"<",
"argu... | eslint-disable-next-line no-unused-vars | [
"eslint",
"-",
"disable",
"-",
"next",
"-",
"line",
"no",
"-",
"unused",
"-",
"vars"
] | fe7c8511a6d27d03a9b8e075b3351416aae95c58 | https://github.com/zloirock/core-js/blob/fe7c8511a6d27d03a9b8e075b3351416aae95c58/packages/core-js/modules/esnext.map.merge.js#L10-L18 | train | Merge the given iterable into the current object. | [
30522,
3853,
13590,
1006,
2009,
6906,
3468,
1013,
1008,
1012,
1012,
1012,
2009,
2121,
13510,
1008,
1013,
1007,
1063,
13075,
4949,
1027,
2019,
16429,
20614,
1006,
2023,
1007,
1025,
13075,
2275,
3334,
1027,
21358,
4609,
7542,
1006,
4949,
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... |
graphql/dataloader | resources/watch.js | parseFiles | function parseFiles(filepaths) {
console.log('Checking Syntax');
return Promise.all(filepaths.map(filepath => {
if (isJS(filepath) && !isTest(filepath)) {
return exec('babel', [
'--optional', 'runtime',
'--out-file', '/dev/null',
srcPath(filepath)
]);
}
}));
} | javascript | function parseFiles(filepaths) {
console.log('Checking Syntax');
return Promise.all(filepaths.map(filepath => {
if (isJS(filepath) && !isTest(filepath)) {
return exec('babel', [
'--optional', 'runtime',
'--out-file', '/dev/null',
srcPath(filepath)
]);
}
}));
} | [
"function",
"parseFiles",
"(",
"filepaths",
")",
"{",
"console",
".",
"log",
"(",
"'Checking Syntax'",
")",
";",
"return",
"Promise",
".",
"all",
"(",
"filepaths",
".",
"map",
"(",
"filepath",
"=>",
"{",
"if",
"(",
"isJS",
"(",
"filepath",
")",
"&&",
"... | Checking steps | [
"Checking",
"steps"
] | d6272867e888b6b41e53852cccf0e0158ce60379 | https://github.com/graphql/dataloader/blob/d6272867e888b6b41e53852cccf0e0158ce60379/resources/watch.js#L114-L126 | train | Parse files and return a Promise | [
30522,
3853,
11968,
20106,
9463,
2015,
1006,
5371,
15069,
2015,
1007,
1063,
10122,
1012,
8833,
1006,
1005,
9361,
20231,
1005,
1007,
1025,
2709,
4872,
1012,
2035,
1006,
5371,
15069,
2015,
1012,
4949,
1006,
5371,
15069,
1027,
1028,
1063,
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... |
websockets/ws | lib/websocket-server.js | addListeners | function addListeners(server, map) {
for (const event of Object.keys(map)) server.on(event, map[event]);
return function removeListeners() {
for (const event of Object.keys(map)) {
server.removeListener(event, map[event]);
}
};
} | javascript | function addListeners(server, map) {
for (const event of Object.keys(map)) server.on(event, map[event]);
return function removeListeners() {
for (const event of Object.keys(map)) {
server.removeListener(event, map[event]);
}
};
} | [
"function",
"addListeners",
"(",
"server",
",",
"map",
")",
"{",
"for",
"(",
"const",
"event",
"of",
"Object",
".",
"keys",
"(",
"map",
")",
")",
"server",
".",
"on",
"(",
"event",
",",
"map",
"[",
"event",
"]",
")",
";",
"return",
"function",
"rem... | Add event listeners on an `EventEmitter` using a map of <event, listener>
pairs.
@param {EventEmitter} server The event emitter
@param {Object.<String, Function>} map The listeners to add
@return {Function} A function that will remove the added listeners when called
@private | [
"Add",
"event",
"listeners",
"on",
"an",
"EventEmitter",
"using",
"a",
"map",
"of",
"<event",
"listener",
">",
"pairs",
"."
] | 995c527c87d0d4833d8093c18dcfa2e4a41d9582 | https://github.com/websockets/ws/blob/995c527c87d0d4833d8093c18dcfa2e4a41d9582/lib/websocket-server.js#L336-L344 | train | Adds listener to server | [
30522,
3853,
5587,
9863,
24454,
2015,
1006,
8241,
1010,
4949,
1007,
1063,
2005,
1006,
9530,
3367,
2724,
1997,
4874,
1012,
6309,
1006,
4949,
1007,
1007,
8241,
1012,
2006,
1006,
2724,
1010,
4949,
1031,
2724,
1033,
1007,
1025,
2709,
3853,
63... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/treemapLayout.js | calculateRootPosition | function calculateRootPosition(layoutInfo, rootRect, targetInfo) {
if (rootRect) {
return {x: rootRect.x, y: rootRect.y};
}
var defaultPosition = {x: 0, y: 0};
if (!targetInfo) {
return defaultPosition;
}
// If targetInfo is fetched by 'retrieveTargetInfo',
// old tree and ... | javascript | function calculateRootPosition(layoutInfo, rootRect, targetInfo) {
if (rootRect) {
return {x: rootRect.x, y: rootRect.y};
}
var defaultPosition = {x: 0, y: 0};
if (!targetInfo) {
return defaultPosition;
}
// If targetInfo is fetched by 'retrieveTargetInfo',
// old tree and ... | [
"function",
"calculateRootPosition",
"(",
"layoutInfo",
",",
"rootRect",
",",
"targetInfo",
")",
"{",
"if",
"(",
"rootRect",
")",
"{",
"return",
"{",
"x",
":",
"rootRect",
".",
"x",
",",
"y",
":",
"rootRect",
".",
"y",
"}",
";",
"}",
"var",
"defaultPos... | Root postion base on coord of containerGroup | [
"Root",
"postion",
"base",
"on",
"coord",
"of",
"containerGroup"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/treemap/treemapLayout.js#L524-L559 | train | Calculate root position | [
30522,
3853,
18422,
3217,
4140,
26994,
1006,
9621,
2378,
14876,
1010,
7117,
2890,
6593,
1010,
4539,
2378,
14876,
1007,
1063,
2065,
1006,
7117,
2890,
6593,
1007,
1063,
2709,
1063,
1060,
1024,
7117,
2890,
6593,
1012,
1060,
1010,
1061,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/strict.js | reportAll | function reportAll(nodes, messageId, fix) {
reportSlice(nodes, 0, nodes.length, messageId, fix);
} | javascript | function reportAll(nodes, messageId, fix) {
reportSlice(nodes, 0, nodes.length, messageId, fix);
} | [
"function",
"reportAll",
"(",
"nodes",
",",
"messageId",
",",
"fix",
")",
"{",
"reportSlice",
"(",
"nodes",
",",
"0",
",",
"nodes",
".",
"length",
",",
"messageId",
",",
"fix",
")",
";",
"}"
] | Report all nodes in an array with a given message.
@param {ASTNode[]} nodes Nodes.
@param {string} messageId Message id to display.
@param {boolean} fix `true` if the directive should be fixed (i.e. removed)
@returns {void} | [
"Report",
"all",
"nodes",
"in",
"an",
"array",
"with",
"a",
"given",
"message",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/strict.js#L153-L155 | train | Report all the nodes in the array | [
30522,
3853,
3189,
8095,
1006,
14164,
1010,
4471,
3593,
1010,
8081,
1007,
1063,
4311,
13231,
1006,
14164,
1010,
1014,
1010,
14164,
1012,
3091,
1010,
4471,
3593,
1010,
8081,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/gridList/grid-list.js | GridLayout | function GridLayout(colCount, tileSpans) {
var self, layoutInfo, gridStyles, layoutTime, mapTime, reflowTime;
layoutTime = $mdUtil.time(function() {
layoutInfo = calculateGridFor(colCount, tileSpans);
});
return self = {
/**
* An array of objects describing each tile'... | javascript | function GridLayout(colCount, tileSpans) {
var self, layoutInfo, gridStyles, layoutTime, mapTime, reflowTime;
layoutTime = $mdUtil.time(function() {
layoutInfo = calculateGridFor(colCount, tileSpans);
});
return self = {
/**
* An array of objects describing each tile'... | [
"function",
"GridLayout",
"(",
"colCount",
",",
"tileSpans",
")",
"{",
"var",
"self",
",",
"layoutInfo",
",",
"gridStyles",
",",
"layoutTime",
",",
"mapTime",
",",
"reflowTime",
";",
"layoutTime",
"=",
"$mdUtil",
".",
"time",
"(",
"function",
"(",
")",
"{"... | Publish layout function | [
"Publish",
"layout",
"function"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/gridList/grid-list.js#L481-L537 | train | GridLayout constructor. | [
30522,
3853,
8370,
8485,
5833,
1006,
8902,
3597,
16671,
1010,
13262,
9739,
2015,
1007,
1063,
13075,
2969,
1010,
9621,
2378,
14876,
1010,
8370,
21756,
4244,
1010,
9621,
7292,
1010,
4949,
7292,
1010,
25416,
8261,
7292,
1025,
9621,
7292,
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... |
dequelabs/axe-core | lib/core/utils/respondable.js | verify | function verify(postedMessage) {
if (
// Check incoming message is valid
typeof postedMessage === 'object' &&
typeof postedMessage.uuid === 'string' &&
postedMessage._respondable === true
) {
var messageSource = _getSource();
return (
// Check the version matches
postedMessage._source === ... | javascript | function verify(postedMessage) {
if (
// Check incoming message is valid
typeof postedMessage === 'object' &&
typeof postedMessage.uuid === 'string' &&
postedMessage._respondable === true
) {
var messageSource = _getSource();
return (
// Check the version matches
postedMessage._source === ... | [
"function",
"verify",
"(",
"postedMessage",
")",
"{",
"if",
"(",
"// Check incoming message is valid",
"typeof",
"postedMessage",
"===",
"'object'",
"&&",
"typeof",
"postedMessage",
".",
"uuid",
"===",
"'string'",
"&&",
"postedMessage",
".",
"_respondable",
"===",
"... | Verify the received message is from the "respondable" module
@private
@param {Object} postedMessage The message received via postMessage
@return {Boolean} `true` if the message is verified from respondable | [
"Verify",
"the",
"received",
"message",
"is",
"from",
"the",
"respondable",
"module"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/respondable.js#L38-L55 | train | Verify the incoming message is valid | [
30522,
3853,
20410,
1006,
6866,
7834,
3736,
3351,
1007,
1063,
2065,
1006,
1013,
1013,
4638,
14932,
4471,
2003,
9398,
2828,
11253,
6866,
7834,
3736,
3351,
1027,
1027,
1027,
1005,
4874,
1005,
1004,
1004,
2828,
11253,
6866,
7834,
3736,
3351,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | gulp/util.js | dedupeCss | function dedupeCss() {
const prefixRegex = /-(webkit|moz|ms|o)-.+/;
return insert.transform(function(contents) {
// Parse the CSS into an AST.
const parsed = postcss.parse(contents);
// Walk through all the rules, skipping comments, media queries etc.
parsed.walk(function(rule) {
// Skip ove... | javascript | function dedupeCss() {
const prefixRegex = /-(webkit|moz|ms|o)-.+/;
return insert.transform(function(contents) {
// Parse the CSS into an AST.
const parsed = postcss.parse(contents);
// Walk through all the rules, skipping comments, media queries etc.
parsed.walk(function(rule) {
// Skip ove... | [
"function",
"dedupeCss",
"(",
")",
"{",
"const",
"prefixRegex",
"=",
"/",
"-(webkit|moz|ms|o)-.+",
"/",
";",
"return",
"insert",
".",
"transform",
"(",
"function",
"(",
"contents",
")",
"{",
"// Parse the CSS into an AST.",
"const",
"parsed",
"=",
"postcss",
"."... | Removes duplicated CSS properties. | [
"Removes",
"duplicated",
"CSS",
"properties",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/gulp/util.js#L252-L294 | train | Remove duplicate CSS properties | [
30522,
3853,
2139,
8566,
5051,
6169,
2015,
1006,
1007,
1063,
9530,
3367,
17576,
2890,
3351,
2595,
1027,
1013,
1011,
1006,
4773,
23615,
1064,
9587,
2480,
1064,
5796,
1064,
1051,
1007,
1011,
1012,
1009,
1013,
1025,
2709,
19274,
1012,
10938,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.uxap/src/sap/uxap/component/Component.js | function (vName) {
if (this.oComponentData.mode === ObjectPageConfigurationMode.JsonModel) {
var oController = this._oView.getController();
//some factory requires post-processing once the view and model are created
if (oController && oController.connectToComponent) {
oController.connectToComponen... | javascript | function (vName) {
if (this.oComponentData.mode === ObjectPageConfigurationMode.JsonModel) {
var oController = this._oView.getController();
//some factory requires post-processing once the view and model are created
if (oController && oController.connectToComponent) {
oController.connectToComponen... | [
"function",
"(",
"vName",
")",
"{",
"if",
"(",
"this",
".",
"oComponentData",
".",
"mode",
"===",
"ObjectPageConfigurationMode",
".",
"JsonModel",
")",
"{",
"var",
"oController",
"=",
"this",
".",
"_oView",
".",
"getController",
"(",
")",
";",
"//some factor... | traps propagated properties for postprocessing on useExternalModel cases
@param {*} vName the name of the property
@returns {*} result of the function | [
"traps",
"propagated",
"properties",
"for",
"postprocessing",
"on",
"useExternalModel",
"cases"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.uxap/src/sap/uxap/component/Component.js#L90-L101 | train | propagate properties to the controller | [
30522,
3853,
1006,
1058,
18442,
1007,
1063,
2065,
1006,
2023,
1012,
1051,
9006,
29513,
3372,
2850,
2696,
1012,
5549,
1027,
1027,
1027,
4874,
13704,
8663,
8873,
27390,
3370,
5302,
3207,
1012,
1046,
3385,
5302,
9247,
1007,
1063,
13075,
1051,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/language/CSSUtils.js | getInfoAtPos | function getInfoAtPos(editor, constPos) {
// We're going to be changing pos a lot, but we don't want to mess up
// the pos the caller passed in so we use extend to make a safe copy of it.
var pos = $.extend({}, constPos),
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos),
... | javascript | function getInfoAtPos(editor, constPos) {
// We're going to be changing pos a lot, but we don't want to mess up
// the pos the caller passed in so we use extend to make a safe copy of it.
var pos = $.extend({}, constPos),
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos),
... | [
"function",
"getInfoAtPos",
"(",
"editor",
",",
"constPos",
")",
"{",
"// We're going to be changing pos a lot, but we don't want to mess up",
"// the pos the caller passed in so we use extend to make a safe copy of it.",
"var",
"pos",
"=",
"$",
".",
"extend",
"(",
"{",
"}",
",... | Returns a context info object for the given cursor position
@param {!Editor} editor
@param {{ch: number, line: number}} constPos A CM pos (likely from editor.getCursorPos())
@return {{context: string,
offset: number,
name: string,
index: number,
values: Array.<string>,
isNewItem: boolean,
range: {start: {line: number,... | [
"Returns",
"a",
"context",
"info",
"object",
"for",
"the",
"given",
"cursor",
"position"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L611-L658 | train | Get info at pos | [
30522,
3853,
2131,
2378,
14876,
4017,
6873,
2015,
1006,
3559,
1010,
9530,
3367,
6873,
2015,
1007,
1063,
1013,
1013,
2057,
1005,
2128,
2183,
2000,
2022,
5278,
13433,
2015,
1037,
2843,
1010,
2021,
2057,
2123,
1005,
1056,
2215,
2000,
6752,
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/project/FileTreeView.js | function () {
if (!this.props.visible) {
return;
}
var node = Preact.findDOMNode(this),
selectedNode = $(node.parentNode).find(this.props.selectedClassName),
selectionViewInfo = this.props.selectionViewInfo;
if (selectedNo... | javascript | function () {
if (!this.props.visible) {
return;
}
var node = Preact.findDOMNode(this),
selectedNode = $(node.parentNode).find(this.props.selectedClassName),
selectionViewInfo = this.props.selectionViewInfo;
if (selectedNo... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"props",
".",
"visible",
")",
"{",
"return",
";",
"}",
"var",
"node",
"=",
"Preact",
".",
"findDOMNode",
"(",
"this",
")",
",",
"selectedNode",
"=",
"$",
"(",
"node",
".",
"parentNode",
")",
... | When the component has updated in the DOM, reposition it to where the currently
selected node is located now. | [
"When",
"the",
"component",
"has",
"updated",
"in",
"the",
"DOM",
"reposition",
"it",
"to",
"where",
"the",
"currently",
"selected",
"node",
"is",
"located",
"now",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L1002-L1016 | train | update selected node top | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
999,
2023,
1012,
24387,
1012,
5710,
1007,
1063,
2709,
1025,
1065,
13075,
13045,
1027,
3653,
18908,
1012,
2424,
9527,
3630,
3207,
1006,
2023,
1007,
1010,
3479,
3630,
3207,
1027,
1002,
1006,
13045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
lovell/sharp | lib/output.js | _updateFormatOut | function _updateFormatOut (formatOut, options) {
if (!(is.object(options) && options.force === false)) {
this.options.formatOut = formatOut;
}
return this;
} | javascript | function _updateFormatOut (formatOut, options) {
if (!(is.object(options) && options.force === false)) {
this.options.formatOut = formatOut;
}
return this;
} | [
"function",
"_updateFormatOut",
"(",
"formatOut",
",",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"is",
".",
"object",
"(",
"options",
")",
"&&",
"options",
".",
"force",
"===",
"false",
")",
")",
"{",
"this",
".",
"options",
".",
"formatOut",
"=",
"f... | Update the output format unless options.force is false,
in which case revert to input format.
@private
@param {String} formatOut
@param {Object} [options]
@param {Boolean} [options.force=true] - force output format, otherwise attempt to use input format
@returns {Sharp} | [
"Update",
"the",
"output",
"format",
"unless",
"options",
".",
"force",
"is",
"false",
"in",
"which",
"case",
"revert",
"to",
"input",
"format",
"."
] | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/output.js#L575-L580 | train | Update the formatOut option | [
30522,
3853,
1035,
10651,
14192,
10610,
4904,
1006,
4289,
5833,
1010,
7047,
1007,
1063,
2065,
1006,
999,
1006,
2003,
1012,
4874,
1006,
7047,
1007,
1004,
1004,
7047,
1012,
2486,
1027,
1027,
1027,
6270,
1007,
1007,
1063,
2023,
1012,
7047,
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 | javascript/selenium-atoms/inject.js | function() {
new Function(arguments[arguments.length - 3]).apply(null,
(function(args) {
var realCallback = args[args.length - 1];
var unwrapperCallback = args[args.length - 2];
Array.prototype.splice.apply(args, [args.length - 3, 3]);
args.push(function(result) {
... | javascript | function() {
new Function(arguments[arguments.length - 3]).apply(null,
(function(args) {
var realCallback = args[args.length - 1];
var unwrapperCallback = args[args.length - 2];
Array.prototype.splice.apply(args, [args.length - 3, 3]);
args.push(function(result) {
... | [
"function",
"(",
")",
"{",
"new",
"Function",
"(",
"arguments",
"[",
"arguments",
".",
"length",
"-",
"3",
"]",
")",
".",
"apply",
"(",
"null",
",",
"(",
"function",
"(",
"args",
")",
"{",
"var",
"realCallback",
"=",
"args",
"[",
"args",
".",
"leng... | When running in Firefox chrome mode, any DOM elements in the script result will be wrapped with a XPCNativeWrapper or XrayWrapper. We need to intercept the result and make sure it is "unwrapped" before returning to bot.inject.executeAsyncScript. The function below is in terms of the arguments object only to avoid defi... | [
"When",
"running",
"in",
"Firefox",
"chrome",
"mode",
"any",
"DOM",
"elements",
"in",
"the",
"script",
"result",
"will",
"be",
"wrapped",
"with",
"a",
"XPCNativeWrapper",
"or",
"XrayWrapper",
".",
"We",
"need",
"to",
"intercept",
"the",
"result",
"and",
"mak... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-atoms/inject.js#L99-L110 | train | This function is a function that will call the callback function | [
30522,
3853,
1006,
1007,
1063,
2047,
3853,
1006,
9918,
1031,
9918,
1012,
3091,
1011,
1017,
1033,
1007,
1012,
6611,
1006,
19701,
1010,
1006,
3853,
1006,
12098,
5620,
1007,
1063,
13075,
2613,
9289,
20850,
8684,
1027,
12098,
5620,
1031,
12098,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/_AnnotationHelperBasics.js | function (oPathValue, sExpectedType) {
var bError,
vValue = oPathValue.value;
if (sExpectedType === "array") {
bError = !Array.isArray(vValue);
} else {
bError = typeof vValue !== sExpectedType
|| vValue === null
|| Array.isArray(vValue);
}
if (bError) {
Basics.error(oPathValue... | javascript | function (oPathValue, sExpectedType) {
var bError,
vValue = oPathValue.value;
if (sExpectedType === "array") {
bError = !Array.isArray(vValue);
} else {
bError = typeof vValue !== sExpectedType
|| vValue === null
|| Array.isArray(vValue);
}
if (bError) {
Basics.error(oPathValue... | [
"function",
"(",
"oPathValue",
",",
"sExpectedType",
")",
"{",
"var",
"bError",
",",
"vValue",
"=",
"oPathValue",
".",
"value",
";",
"if",
"(",
"sExpectedType",
"===",
"\"array\"",
")",
"{",
"bError",
"=",
"!",
"Array",
".",
"isArray",
"(",
"vValue",
")"... | Logs an error and throws an error if the value is not of the expected type.
@param {object} oPathValue
a path/value pair
@param {string} oPathValue.path
the meta model path to start at
@param {any} oPathValue.value
the value at this path
@param {string} sExpectedType
the expected type (tested w/ typeof) or the special... | [
"Logs",
"an",
"error",
"and",
"throws",
"an",
"error",
"if",
"the",
"value",
"is",
"not",
"of",
"the",
"expected",
"type",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js#L112-L126 | train | Checks if the value of the given path is not an array | [
30522,
3853,
1006,
6728,
8988,
10175,
5657,
1010,
3348,
5051,
10985,
13874,
1007,
1063,
13075,
2022,
18933,
2099,
1010,
1058,
10175,
5657,
1027,
6728,
8988,
10175,
5657,
1012,
3643,
1025,
2065,
1006,
3348,
5051,
10985,
13874,
1027,
1027,
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... | |
mdn/browser-compat-data | scripts/render.js | getSupportClass | function getSupportClass(supportInfo) {
let cssClass = 'unknown-support';
if (Array.isArray(supportInfo)) {
// the first entry should be the most relevant/recent and will be treated as "the truth"
checkSupport(supportInfo[0].version_added, supportInfo[0].version_removed);
} else if (supportInfo) { // the... | javascript | function getSupportClass(supportInfo) {
let cssClass = 'unknown-support';
if (Array.isArray(supportInfo)) {
// the first entry should be the most relevant/recent and will be treated as "the truth"
checkSupport(supportInfo[0].version_added, supportInfo[0].version_removed);
} else if (supportInfo) { // the... | [
"function",
"getSupportClass",
"(",
"supportInfo",
")",
"{",
"let",
"cssClass",
"=",
"'unknown-support'",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"supportInfo",
")",
")",
"{",
"// the first entry should be the most relevant/recent and will be treated as \"the truth\""... | /*
Given the support information for a browser, this returns
a CSS class to apply to the table cell.
`supportData` is a (or an array of) support_statement(s) | [
"/",
"*",
"Given",
"the",
"support",
"information",
"for",
"a",
"browser",
"this",
"returns",
"a",
"CSS",
"class",
"to",
"apply",
"to",
"the",
"table",
"cell",
"."
] | 6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b | https://github.com/mdn/browser-compat-data/blob/6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b/scripts/render.js#L104-L130 | train | Returns the CSS class for the support statement | [
30522,
3853,
4152,
6279,
6442,
26266,
1006,
2490,
2378,
14876,
1007,
1063,
2292,
20116,
11020,
27102,
1027,
1005,
4242,
1011,
2490,
1005,
1025,
2065,
1006,
9140,
1012,
18061,
11335,
2100,
1006,
2490,
2378,
14876,
1007,
1007,
1063,
1013,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/UpdateNotification.js | _onRegistryDownloaded | function _onRegistryDownloaded() {
var availableUpdates = ExtensionManager.getAvailableUpdates();
PreferencesManager.setViewState("extensionUpdateInfo", availableUpdates);
PreferencesManager.setViewState("lastExtensionRegistryCheckTime", (new Date()).getTime());
$("#toolbar-extension-man... | javascript | function _onRegistryDownloaded() {
var availableUpdates = ExtensionManager.getAvailableUpdates();
PreferencesManager.setViewState("extensionUpdateInfo", availableUpdates);
PreferencesManager.setViewState("lastExtensionRegistryCheckTime", (new Date()).getTime());
$("#toolbar-extension-man... | [
"function",
"_onRegistryDownloaded",
"(",
")",
"{",
"var",
"availableUpdates",
"=",
"ExtensionManager",
".",
"getAvailableUpdates",
"(",
")",
";",
"PreferencesManager",
".",
"setViewState",
"(",
"\"extensionUpdateInfo\"",
",",
"availableUpdates",
")",
";",
"PreferencesM... | Calculate state of notification everytime registries are downloaded - no matter who triggered the download | [
"Calculate",
"state",
"of",
"notification",
"everytime",
"registries",
"are",
"downloaded",
"-",
"no",
"matter",
"who",
"triggered",
"the",
"download"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/UpdateNotification.js#L347-L352 | train | Called when the registry is downloaded | [
30522,
3853,
1035,
2006,
2890,
24063,
2854,
7698,
17468,
1006,
1007,
1063,
13075,
2800,
6279,
27122,
1027,
5331,
24805,
4590,
1012,
2131,
12462,
11733,
3468,
6279,
27122,
1006,
1007,
1025,
18394,
24805,
4590,
1012,
2275,
8584,
9153,
2618,
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... |
zeit/now-cli | src/commands/inspect.js | getEventMetadata | function getEventMetadata({ event, payload }) {
if (event === 'state') {
return chalk.bold(payload.value);
}
if (event === 'instance-start' || event === 'instance-stop') {
if (payload.dc != null) {
return chalk.green(`(${payload.dc})`);
}
}
return '';
} | javascript | function getEventMetadata({ event, payload }) {
if (event === 'state') {
return chalk.bold(payload.value);
}
if (event === 'instance-start' || event === 'instance-stop') {
if (payload.dc != null) {
return chalk.green(`(${payload.dc})`);
}
}
return '';
} | [
"function",
"getEventMetadata",
"(",
"{",
"event",
",",
"payload",
"}",
")",
"{",
"if",
"(",
"event",
"===",
"'state'",
")",
"{",
"return",
"chalk",
".",
"bold",
"(",
"payload",
".",
"value",
")",
";",
"}",
"if",
"(",
"event",
"===",
"'instance-start'"... | gets the metadata that should be printed next to each event | [
"gets",
"the",
"metadata",
"that",
"should",
"be",
"printed",
"next",
"to",
"each",
"event"
] | b53d907b745126113bc3e251ac2451088026a363 | https://github.com/zeit/now-cli/blob/b53d907b745126113bc3e251ac2451088026a363/src/commands/inspect.js#L286-L298 | train | Get metadata for an event | [
30522,
3853,
2131,
18697,
3372,
11368,
8447,
2696,
1006,
1063,
2724,
1010,
18093,
1065,
1007,
1063,
2065,
1006,
2724,
1027,
1027,
1027,
1005,
2110,
1005,
1007,
1063,
2709,
16833,
1012,
7782,
1006,
18093,
1012,
3643,
1007,
1025,
1065,
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... |
SAP/openui5 | src/sap.m/src/sap/m/Image.js | isSubSet | function isSubSet (aTestArray, aRefArray) {
function isOutsideSet(sTestValue) {
return aRefArray.indexOf(sTestValue) < 0; // value is not part of the reference set
}
return aTestArray && aRefArray && !aTestArray.some(isOutsideSet);
} | javascript | function isSubSet (aTestArray, aRefArray) {
function isOutsideSet(sTestValue) {
return aRefArray.indexOf(sTestValue) < 0; // value is not part of the reference set
}
return aTestArray && aRefArray && !aTestArray.some(isOutsideSet);
} | [
"function",
"isSubSet",
"(",
"aTestArray",
",",
"aRefArray",
")",
"{",
"function",
"isOutsideSet",
"(",
"sTestValue",
")",
"{",
"return",
"aRefArray",
".",
"indexOf",
"(",
"sTestValue",
")",
"<",
"0",
";",
"// value is not part of the reference set",
"}",
"return"... | Utility function that checks if the content of an array
is a subset of the content of a second (reference) array | [
"Utility",
"function",
"that",
"checks",
"if",
"the",
"content",
"of",
"an",
"array",
"is",
"a",
"subset",
"of",
"the",
"content",
"of",
"a",
"second",
"(",
"reference",
")",
"array"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/Image.js#L753-L758 | train | Checks if the given array is a subset of the reference array | [
30522,
3853,
26354,
12083,
13462,
1006,
8823,
14117,
9447,
1010,
2024,
14971,
9447,
1007,
1063,
3853,
11163,
30524,
3367,
10175,
5657,
1007,
1026,
1014,
1025,
1013,
1013,
3643,
2003,
2025,
2112,
1997,
1996,
4431,
2275,
1065,
2709,
8823,
141... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(graph)
{
var cells = null;
if (!mxClipboard.isEmpty())
{
cells = graph.getImportableCells(mxClipboard.getCells());
var delta = mxClipboard.insertCount * mxClipboard.STEPSIZE;
var parent = graph.getDefaultParent();
cells = graph.importCells(cells, delta, delta, parent);
// Increment... | javascript | function(graph)
{
var cells = null;
if (!mxClipboard.isEmpty())
{
cells = graph.getImportableCells(mxClipboard.getCells());
var delta = mxClipboard.insertCount * mxClipboard.STEPSIZE;
var parent = graph.getDefaultParent();
cells = graph.importCells(cells, delta, delta, parent);
// Increment... | [
"function",
"(",
"graph",
")",
"{",
"var",
"cells",
"=",
"null",
";",
"if",
"(",
"!",
"mxClipboard",
".",
"isEmpty",
"(",
")",
")",
"{",
"cells",
"=",
"graph",
".",
"getImportableCells",
"(",
"mxClipboard",
".",
"getCells",
"(",
")",
")",
";",
"var",... | Function: paste
Pastes the <cells> into the specified graph restoring
the relation to <parents>, if possible. If the parents
are no longer in the graph or invisible then the
cells are added to the graph's default or into the
swimlane under the cell's new location if one exists.
The cells are added to the graph using <... | [
"Function",
":",
"paste"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L11450-L11467 | train | Returns the inserted cells | [
30522,
3853,
1006,
10629,
1007,
1063,
13075,
4442,
1027,
19701,
1025,
2065,
1006,
999,
25630,
20464,
11514,
6277,
1012,
2003,
6633,
13876,
2100,
1006,
1007,
1007,
1063,
4442,
1027,
10629,
1012,
2131,
5714,
6442,
3085,
29109,
4877,
1006,
256... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.support/src/sap/ui/support/supportRules/ui/models/PresetsUtils.js | function (aSelectedRulesPlain) {
// if we persist settings - load any selection presets, else use the default ones
if (this.model.getProperty("/persistingSettings")) {
var aPersistedPresets = Storage.getSelectionPresets();
if (aPersistedPresets) {
this.model.setProperty("/selectionPresets", aPersiste... | javascript | function (aSelectedRulesPlain) {
// if we persist settings - load any selection presets, else use the default ones
if (this.model.getProperty("/persistingSettings")) {
var aPersistedPresets = Storage.getSelectionPresets();
if (aPersistedPresets) {
this.model.setProperty("/selectionPresets", aPersiste... | [
"function",
"(",
"aSelectedRulesPlain",
")",
"{",
"// if we persist settings - load any selection presets, else use the default ones",
"if",
"(",
"this",
".",
"model",
".",
"getProperty",
"(",
"\"/persistingSettings\"",
")",
")",
"{",
"var",
"aPersistedPresets",
"=",
"Stora... | Initializes the current selection preset
@param {Array} aSelectedRulesPlain The plain list of selected rules (same format as in the presets json file) | [
"Initializes",
"the",
"current",
"selection",
"preset"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/models/PresetsUtils.js#L34-L89 | train | Updates the selected rules in the selection presets | [
30522,
3853,
1006,
2004,
12260,
10985,
6820,
4244,
24759,
8113,
1007,
1063,
1013,
1013,
2065,
2057,
29486,
10906,
1011,
7170,
2151,
4989,
3653,
13462,
2015,
1010,
2842,
2224,
1996,
12398,
3924,
2065,
1006,
2023,
1012,
2944,
1012,
2131,
2157... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js | function () {
var self = this;
var removed = {},
newStatus,
current;
current = self.stylesheets;
newStatus = related().stylesheets;
Object.keys(current).forEach(function (v, i) {
... | javascript | function () {
var self = this;
var removed = {},
newStatus,
current;
current = self.stylesheets;
newStatus = related().stylesheets;
Object.keys(current).forEach(function (v, i) {
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"removed",
"=",
"{",
"}",
",",
"newStatus",
",",
"current",
";",
"current",
"=",
"self",
".",
"stylesheets",
";",
"newStatus",
"=",
"related",
"(",
")",
".",
"stylesheets",
";",
"Obje... | Send a notification for the removed stylesheet and
its import-ed styleshets based on document.stylesheets diff
from previous status. It also updates stylesheets status. | [
"Send",
"a",
"notification",
"for",
"the",
"removed",
"stylesheet",
"and",
"its",
"import",
"-",
"ed",
"styleshets",
"based",
"on",
"document",
".",
"stylesheets",
"diff",
"from",
"previous",
"status",
".",
"It",
"also",
"updates",
"stylesheets",
"status",
"."... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js#L199-L226 | train | Remove all stylesheets from the page | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
3718,
1027,
1063,
1065,
1010,
2739,
29336,
2271,
1010,
2783,
1025,
2783,
1027,
2969,
1012,
6782,
21030,
3215,
1025,
2739,
29336,
2271,
1027,
3141,
1006,
1007,
1012,
6782,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-sequences.js | requiresExtraParens | function requiresExtraParens(node) {
return node.parent && parenthesized[node.parent.type] &&
node === node.parent[parenthesized[node.parent.type]];
} | javascript | function requiresExtraParens(node) {
return node.parent && parenthesized[node.parent.type] &&
node === node.parent[parenthesized[node.parent.type]];
} | [
"function",
"requiresExtraParens",
"(",
"node",
")",
"{",
"return",
"node",
".",
"parent",
"&&",
"parenthesized",
"[",
"node",
".",
"parent",
".",
"type",
"]",
"&&",
"node",
"===",
"node",
".",
"parent",
"[",
"parenthesized",
"[",
"node",
".",
"parent",
... | Determines whether a node is required by the grammar to be wrapped in
parens, e.g. the test of an if statement.
@param {ASTNode} node - The AST node
@returns {boolean} True if parens around node belong to parent node. | [
"Determines",
"whether",
"a",
"node",
"is",
"required",
"by",
"the",
"grammar",
"to",
"be",
"wrapped",
"in",
"parens",
"e",
".",
"g",
".",
"the",
"test",
"of",
"an",
"if",
"statement",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-sequences.js#L60-L63 | train | Returns true if the node is not a child of the parent of the node | [
30522,
3853,
5942,
10288,
6494,
19362,
6132,
1006,
13045,
1007,
1063,
2709,
13045,
1012,
6687,
1004,
1004,
6687,
15689,
3550,
1031,
13045,
1012,
6687,
1012,
2828,
1033,
1004,
1004,
13045,
1027,
1027,
1027,
13045,
1012,
6687,
1031,
6687,
156... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | setValue | function setValue(sName, sValue) {
if ( typeof sValue === "undefined" || sValue === null ) {
return;
}
switch (M_SETTINGS[sName].type) {
case "boolean":
if ( typeof sValue === "string" ) {
if (M_SETTINGS[sName].defaultValue) {
config[sName] = sValue.toLowerCase() != "false";
... | javascript | function setValue(sName, sValue) {
if ( typeof sValue === "undefined" || sValue === null ) {
return;
}
switch (M_SETTINGS[sName].type) {
case "boolean":
if ( typeof sValue === "string" ) {
if (M_SETTINGS[sName].defaultValue) {
config[sName] = sValue.toLowerCase() != "false";
... | [
"function",
"setValue",
"(",
"sName",
",",
"sValue",
")",
"{",
"if",
"(",
"typeof",
"sValue",
"===",
"\"undefined\"",
"||",
"sValue",
"===",
"null",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"M_SETTINGS",
"[",
"sName",
"]",
".",
"type",
")",
"{",
... | /*eslint-enable consistent-this | [
"/",
"*",
"eslint",
"-",
"enable",
"consistent",
"-",
"this"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Configuration.js#L183-L247 | train | Sets the value of a property | [
30522,
3853,
2275,
10175,
5657,
1006,
1055,
18442,
1010,
17917,
2389,
5657,
1007,
1063,
2065,
1006,
2828,
11253,
17917,
2389,
5657,
1027,
1027,
1027,
1000,
6151,
28344,
1000,
1064,
1064,
17917,
2389,
5657,
1027,
1027,
1027,
19701,
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... |
apache/incubator-echarts | src/chart/parallel/ParallelView.js | isEmptyValue | function isEmptyValue(val, axisType) {
return axisType === 'category'
? val == null
: (val == null || isNaN(val)); // axisType === 'value'
} | javascript | function isEmptyValue(val, axisType) {
return axisType === 'category'
? val == null
: (val == null || isNaN(val)); // axisType === 'value'
} | [
"function",
"isEmptyValue",
"(",
"val",
",",
"axisType",
")",
"{",
"return",
"axisType",
"===",
"'category'",
"?",
"val",
"==",
"null",
":",
"(",
"val",
"==",
"null",
"||",
"isNaN",
"(",
"val",
")",
")",
";",
"// axisType === 'value'",
"}"
] | FIXME 公用方法? | [
"FIXME",
"公用方法?"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/parallel/ParallelView.js#L262-L266 | train | Check if a value is empty | [
30522,
3853,
2003,
6633,
13876,
2100,
10175,
5657,
1006,
11748,
1010,
8123,
13874,
1007,
1063,
2709,
8123,
13874,
1027,
1027,
1027,
1005,
4696,
1005,
1029,
11748,
1027,
1027,
19701,
1024,
1006,
11748,
1027,
1027,
19701,
1064,
1064,
3475,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableScrollExtension.js | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var iVirtualRowCount = oTable._getTotalRowCount() - oTable.getVisibleRowCount();
var iScrollRangeWithoutBuffer;
if (TableUtils.isVariableRowHeightEnabled(oTable)) {
iScrollRangeWithoutBuffer = VerticalScrollingHelper.getScrollRange... | javascript | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var iVirtualRowCount = oTable._getTotalRowCount() - oTable.getVisibleRowCount();
var iScrollRangeWithoutBuffer;
if (TableUtils.isVariableRowHeightEnabled(oTable)) {
iScrollRangeWithoutBuffer = VerticalScrollingHelper.getScrollRange... | [
"function",
"(",
"oTable",
")",
"{",
"var",
"oScrollExtension",
"=",
"oTable",
".",
"_getScrollExtension",
"(",
")",
";",
"var",
"iVirtualRowCount",
"=",
"oTable",
".",
"_getTotalRowCount",
"(",
")",
"-",
"oTable",
".",
"getVisibleRowCount",
"(",
")",
";",
"... | Gets the fraction of the vertical scroll range which corresponds to a row. This value specifies how many pixels must be scrolled to
scroll one row.
@param {sap.ui.table.Table} oTable Instance of the table.
@returns {number} The fraction of the vertical scroll range which corresponds to a row. | [
"Gets",
"the",
"fraction",
"of",
"the",
"vertical",
"scroll",
"range",
"which",
"corresponds",
"to",
"a",
"row",
".",
"This",
"value",
"specifies",
"how",
"many",
"pixels",
"must",
"be",
"scrolled",
"to",
"scroll",
"one",
"row",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableScrollExtension.js#L614-L634 | train | Calculates the fraction of the vertical scroll range. | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
13075,
9808,
26775,
14511,
10288,
29048,
1027,
27178,
3085,
1012,
1035,
4152,
26775,
14511,
10288,
29048,
1006,
1007,
1025,
13075,
4921,
4313,
26302,
20974,
5004,
3597,
16671,
1027,
27178,
3085,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onSetLanguageCode | function onSetLanguageCode() {
var languageCode = $('#language-code').val() || null;
try {
auth.languageCode = languageCode;
alertSuccess('Language code changed to "' + languageCode + '".');
} catch (error) {
alertError('Error: ' + error.code);
}
} | javascript | function onSetLanguageCode() {
var languageCode = $('#language-code').val() || null;
try {
auth.languageCode = languageCode;
alertSuccess('Language code changed to "' + languageCode + '".');
} catch (error) {
alertError('Error: ' + error.code);
}
} | [
"function",
"onSetLanguageCode",
"(",
")",
"{",
"var",
"languageCode",
"=",
"$",
"(",
"'#language-code'",
")",
".",
"val",
"(",
")",
"||",
"null",
";",
"try",
"{",
"auth",
".",
"languageCode",
"=",
"languageCode",
";",
"alertSuccess",
"(",
"'Language code ch... | Saves the new language code provided in the language code input field. | [
"Saves",
"the",
"new",
"language",
"code",
"provided",
"in",
"the",
"language",
"code",
"input",
"field",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L265-L273 | train | Set the language code | [
30522,
3853,
14447,
25023,
6692,
3351,
16044,
1006,
1007,
1063,
13075,
2653,
16044,
1027,
1002,
1006,
1005,
1001,
2653,
1011,
3642,
1005,
30524,
1005,
1000,
1012,
1005,
1007,
1025,
1065,
4608,
1006,
7561,
1007,
1063,
9499,
2121,
29165,
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... |
goldfire/howler.js | examples/3d/js/player.js | function(secs) {
var states = game.controls.states;
if (states.left) this.rotate(-Math.PI * secs);
if (states.right) this.rotate(Math.PI * secs);
if (states.front) this.walk(this.speed * secs);
if (states.back) this.walk(-this.speed * secs);
} | javascript | function(secs) {
var states = game.controls.states;
if (states.left) this.rotate(-Math.PI * secs);
if (states.right) this.rotate(Math.PI * secs);
if (states.front) this.walk(this.speed * secs);
if (states.back) this.walk(-this.speed * secs);
} | [
"function",
"(",
"secs",
")",
"{",
"var",
"states",
"=",
"game",
".",
"controls",
".",
"states",
";",
"if",
"(",
"states",
".",
"left",
")",
"this",
".",
"rotate",
"(",
"-",
"Math",
".",
"PI",
"*",
"secs",
")",
";",
"if",
"(",
"states",
".",
"r... | Update the player position and rotation on each tick.
@param {Number} secs Seconds since last update. | [
"Update",
"the",
"player",
"position",
"and",
"rotation",
"on",
"each",
"tick",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/3d/js/player.js#L71-L78 | train | Walks the game in a given speed. | [
30522,
3853,
1006,
10819,
2015,
1007,
1063,
13075,
2163,
1027,
2208,
1012,
7711,
1012,
2163,
1025,
2065,
1006,
2163,
1012,
2187,
1007,
2023,
1012,
24357,
1006,
1011,
8785,
1012,
14255,
1008,
10819,
2015,
1007,
1025,
2065,
1006,
2163,
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/LiveDevelopment/LiveDevelopment.js | enableAgent | function enableAgent(name) {
if (agents.hasOwnProperty(name) && !_enabledAgentNames.hasOwnProperty(name)) {
_enabledAgentNames[name] = true;
}
} | javascript | function enableAgent(name) {
if (agents.hasOwnProperty(name) && !_enabledAgentNames.hasOwnProperty(name)) {
_enabledAgentNames[name] = true;
}
} | [
"function",
"enableAgent",
"(",
"name",
")",
"{",
"if",
"(",
"agents",
".",
"hasOwnProperty",
"(",
"name",
")",
"&&",
"!",
"_enabledAgentNames",
".",
"hasOwnProperty",
"(",
"name",
")",
")",
"{",
"_enabledAgentNames",
"[",
"name",
"]",
"=",
"true",
";",
... | Enable an agent. Takes effect next time a connection is made. Does not affect
current live development sessions.
@param {string} name of agent to enable | [
"Enable",
"an",
"agent",
".",
"Takes",
"effect",
"next",
"time",
"a",
"connection",
"is",
"made",
".",
"Does",
"not",
"affect",
"current",
"live",
"development",
"sessions",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevelopment.js#L444-L448 | train | Enable an agent | [
30522,
3853,
9585,
4270,
3372,
1006,
2171,
1007,
1063,
2065,
1006,
6074,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
2171,
1007,
1004,
1004,
999,
1035,
9124,
4270,
3372,
18442,
2015,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
2171,
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/support/techinfo/moduleTreeHelper.js | function (oModules, oResult) {
var modules = oModules.modules,
vDebugInfo = window["sap-ui-debug"];
// create tree with all modules and empty selection
jQuery.each(modules, function (sName) {
this.set(oResult, sName, false, true);
}.bind(this));
// apply current debug info as tree selection
... | javascript | function (oModules, oResult) {
var modules = oModules.modules,
vDebugInfo = window["sap-ui-debug"];
// create tree with all modules and empty selection
jQuery.each(modules, function (sName) {
this.set(oResult, sName, false, true);
}.bind(this));
// apply current debug info as tree selection
... | [
"function",
"(",
"oModules",
",",
"oResult",
")",
"{",
"var",
"modules",
"=",
"oModules",
".",
"modules",
",",
"vDebugInfo",
"=",
"window",
"[",
"\"sap-ui-debug\"",
"]",
";",
"// create tree with all modules and empty selection",
"jQuery",
".",
"each",
"(",
"modul... | Converts a module object to a module hierarchy with selections state based on sap-ui-debug
@param {object} oModules Flat object of modules
@param {object} oResult Hierarchical tree of modules including selection state | [
"Converts",
"a",
"module",
"object",
"to",
"a",
"module",
"hierarchy",
"with",
"selections",
"state",
"based",
"on",
"sap",
"-",
"ui",
"-",
"debug"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L73-L111 | train | Creates a tree with all modules that match the current debug info | [
30522,
3853,
1006,
18168,
7716,
16308,
1010,
10848,
23722,
2102,
1007,
1063,
13075,
14184,
1027,
18168,
7716,
16308,
1012,
14184,
1010,
1058,
3207,
8569,
11528,
14876,
1027,
3332,
1031,
1000,
20066,
1011,
21318,
1011,
2139,
8569,
2290,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GitbookIO/gitbook | lib/output/modifiers/resolveLinks.js | resolveLinks | function resolveLinks(currentFile, resolveFile, $) {
var currentDirectory = path.dirname(currentFile);
return editHTMLElement($, 'a', function($a) {
var href = $a.attr('href');
// Don't change a tag without href
if (!href) {
return;
}
if (LocationUtils.isEx... | javascript | function resolveLinks(currentFile, resolveFile, $) {
var currentDirectory = path.dirname(currentFile);
return editHTMLElement($, 'a', function($a) {
var href = $a.attr('href');
// Don't change a tag without href
if (!href) {
return;
}
if (LocationUtils.isEx... | [
"function",
"resolveLinks",
"(",
"currentFile",
",",
"resolveFile",
",",
"$",
")",
"{",
"var",
"currentDirectory",
"=",
"path",
".",
"dirname",
"(",
"currentFile",
")",
";",
"return",
"editHTMLElement",
"(",
"$",
",",
"'a'",
",",
"function",
"(",
"$a",
")"... | Resolve all HTML links:
- /test.md in hello -> ../test.html
@param {String} currentFile
@param {Function(String) -> String} resolveFile
@param {HTMLDom} $ | [
"Resolve",
"all",
"HTML",
"links",
":",
"-",
"/",
"test",
".",
"md",
"in",
"hello",
"-",
">",
"..",
"/",
"test",
".",
"html"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/modifiers/resolveLinks.js#L15-L51 | train | Resolve links to the current file | [
30522,
3853,
10663,
13767,
2015,
1006,
2783,
8873,
2571,
1010,
10663,
8873,
2571,
1010,
1002,
1007,
1063,
13075,
2783,
4305,
2890,
16761,
2100,
1027,
4130,
1012,
16101,
18442,
1006,
2783,
8873,
2571,
1007,
1025,
2709,
13257,
21246,
2571,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js | createCallbackInterface | function createCallbackInterface(oWithControl) {
/**
* Callback interface for visitor functions which provides access to private
* {@link sap.ui.core.util.XMLPreprocessor} functionality using a map of currently
* known variables. Initially, these are the variables known to the XML
* pre-processo... | javascript | function createCallbackInterface(oWithControl) {
/**
* Callback interface for visitor functions which provides access to private
* {@link sap.ui.core.util.XMLPreprocessor} functionality using a map of currently
* known variables. Initially, these are the variables known to the XML
* pre-processo... | [
"function",
"createCallbackInterface",
"(",
"oWithControl",
")",
"{",
"/**\n\t\t\t\t * Callback interface for visitor functions which provides access to private\n\t\t\t\t * {@link sap.ui.core.util.XMLPreprocessor} functionality using a map of currently\n\t\t\t\t * known variables. Initially, these are t... | Returns a callback interface for visitor functions which provides access to private
{@link sap.ui.core.util.XMLPreprocessor} functionality using the given "with"
control.
@param {sap.ui.core.util._with} oWithControl
The "with" control
@returns {sap.ui.core.util.XMLPreprocessor.ICallback}
A callback interface | [
"Returns",
"a",
"callback",
"interface",
"for",
"visitor",
"functions",
"which",
"provides",
"access",
"to",
"private",
"{",
"@link",
"sap",
".",
"ui",
".",
"core",
".",
"util",
".",
"XMLPreprocessor",
"}",
"functionality",
"using",
"the",
"given",
"with",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L606-L923 | train | Creates a callback interface for the XML markup. | [
30522,
3853,
3443,
9289,
20850,
8684,
18447,
2121,
12172,
1006,
27593,
8939,
8663,
13181,
2140,
1007,
1063,
1013,
1008,
1008,
1008,
2655,
5963,
8278,
2005,
10367,
4972,
2029,
3640,
3229,
2000,
2797,
1008,
1063,
1030,
4957,
20066,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/hasher.js | function(){
hasher.stop();
hasher.initialized.dispose();
hasher.stopped.dispose();
hasher.changed.dispose();
_frame = hasher = window.hasher = null;
} | javascript | function(){
hasher.stop();
hasher.initialized.dispose();
hasher.stopped.dispose();
hasher.changed.dispose();
_frame = hasher = window.hasher = null;
} | [
"function",
"(",
")",
"{",
"hasher",
".",
"stop",
"(",
")",
";",
"hasher",
".",
"initialized",
".",
"dispose",
"(",
")",
";",
"hasher",
".",
"stopped",
".",
"dispose",
"(",
")",
";",
"hasher",
".",
"changed",
".",
"dispose",
"(",
")",
";",
"_frame"... | Removes all event listeners, stops hasher and destroy hasher object.
- IMPORTANT: hasher won't work after calling this method, hasher Object will be deleted. | [
"Removes",
"all",
"event",
"listeners",
"stops",
"hasher",
"and",
"destroy",
"hasher",
"object",
".",
"-",
"IMPORTANT",
":",
"hasher",
"won",
"t",
"work",
"after",
"calling",
"this",
"method",
"hasher",
"Object",
"will",
"be",
"deleted",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/hasher.js#L425-L431 | train | Stop the hasher and reset the window | [
30522,
3853,
1006,
1007,
1063,
23325,
2121,
1012,
2644,
1006,
1007,
1025,
23325,
2121,
1012,
3988,
3550,
1012,
27764,
1006,
1007,
1025,
23325,
2121,
1012,
3030,
1012,
27764,
1006,
1007,
1025,
23325,
2121,
1012,
2904,
1012,
27764,
1006,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js | function (aElementOverlays) {
var bOverlayIsSibling = true;
var sPluginId = "CTX_ADD_ELEMENTS_AS_SIBLING";
var iRank = 20;
var sIcon = "sap-icon://add";
var aMenuItems = [];
for (var i = 0; i < 2; i++){
if (this.isAvailable(bOverlayIsSibling, aElementOverlays)){
var sMenuItemText = this.getCo... | javascript | function (aElementOverlays) {
var bOverlayIsSibling = true;
var sPluginId = "CTX_ADD_ELEMENTS_AS_SIBLING";
var iRank = 20;
var sIcon = "sap-icon://add";
var aMenuItems = [];
for (var i = 0; i < 2; i++){
if (this.isAvailable(bOverlayIsSibling, aElementOverlays)){
var sMenuItemText = this.getCo... | [
"function",
"(",
"aElementOverlays",
")",
"{",
"var",
"bOverlayIsSibling",
"=",
"true",
";",
"var",
"sPluginId",
"=",
"\"CTX_ADD_ELEMENTS_AS_SIBLING\"",
";",
"var",
"iRank",
"=",
"20",
";",
"var",
"sIcon",
"=",
"\"sap-icon://add\"",
";",
"var",
"aMenuItems",
"="... | Retrieve the context menu item for the actions.
Two items are returned here: one for when the overlay is sibling and one for when it is child.
@param {sap.ui.dt.ElementOverlay} oOverlay Overlay for which the context menu was opened
@return {object[]} Returns array containing the items with required data | [
"Retrieve",
"the",
"context",
"menu",
"item",
"for",
"the",
"actions",
".",
"Two",
"items",
"are",
"returned",
"here",
":",
"one",
"for",
"when",
"the",
"overlay",
"is",
"sibling",
"and",
"one",
"for",
"when",
"it",
"is",
"child",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js#L947-L976 | train | Show the available elements | [
30522,
3853,
1006,
29347,
16930,
4765,
7840,
8485,
2015,
1007,
1063,
13075,
8945,
6299,
8485,
14643,
12322,
2989,
1027,
2995,
1025,
13075,
11867,
7630,
11528,
3593,
1027,
1000,
14931,
2595,
1035,
5587,
1035,
3787,
1035,
2004,
1035,
22941,
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... | |
facebook/relay | packages/relay-compiler/language/javascript/RelayFlowBabelFactories.js | importTypes | function importTypes(names: Array<string>, module: string) {
const importDeclaration = t.importDeclaration(
names.map(name =>
t.importSpecifier(t.identifier(name), t.identifier(name)),
),
t.stringLiteral(module),
);
importDeclaration.importKind = 'type';
return importDeclaration;
} | javascript | function importTypes(names: Array<string>, module: string) {
const importDeclaration = t.importDeclaration(
names.map(name =>
t.importSpecifier(t.identifier(name), t.identifier(name)),
),
t.stringLiteral(module),
);
importDeclaration.importKind = 'type';
return importDeclaration;
} | [
"function",
"importTypes",
"(",
"names",
":",
"Array",
"<",
"string",
">",
",",
"module",
":",
"string",
")",
"{",
"const",
"importDeclaration",
"=",
"t",
".",
"importDeclaration",
"(",
"names",
".",
"map",
"(",
"name",
"=>",
"t",
".",
"importSpecifier",
... | import type {NAMES[0], NAMES[1], ...} from 'MODULE'; | [
"import",
"type",
"{",
"NAMES",
"[",
"0",
"]",
"NAMES",
"[",
"1",
"]",
"...",
"}",
"from",
"MODULE",
";"
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/language/javascript/RelayFlowBabelFactories.js#L50-L59 | train | Imports types from the specified module | [
30522,
3853,
12324,
13874,
2015,
1006,
3415,
1024,
9140,
1026,
5164,
1028,
1010,
11336,
1024,
5164,
1007,
1063,
9530,
3367,
12324,
3207,
20464,
25879,
3258,
1027,
1056,
1012,
12324,
3207,
20464,
25879,
3258,
1006,
3415,
1012,
4949,
1006,
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... |
dequelabs/axe-core | lib/core/utils/flattened-tree.js | virtualDOMfromNode | function virtualDOMfromNode(node, shadowId) {
const vNodeCache = {};
const vNode = {
shadowId: shadowId,
children: [],
actualNode: node,
_isHidden: null, // will be populated by axe.utils.isHidden
get isFocusable() {
if (!vNodeCache._isFocusable) {
vNodeCache._isFocusable = axe.commons.dom.isFocusabl... | javascript | function virtualDOMfromNode(node, shadowId) {
const vNodeCache = {};
const vNode = {
shadowId: shadowId,
children: [],
actualNode: node,
_isHidden: null, // will be populated by axe.utils.isHidden
get isFocusable() {
if (!vNodeCache._isFocusable) {
vNodeCache._isFocusable = axe.commons.dom.isFocusabl... | [
"function",
"virtualDOMfromNode",
"(",
"node",
",",
"shadowId",
")",
"{",
"const",
"vNodeCache",
"=",
"{",
"}",
";",
"const",
"vNode",
"=",
"{",
"shadowId",
":",
"shadowId",
",",
"children",
":",
"[",
"]",
",",
"actualNode",
":",
"node",
",",
"_isHidden"... | This implemnts the flatten-tree algorithm specified:
Originally here https://drafts.csswg.org/css-scoping/#flat-tree
Hopefully soon published here: https://www.w3.org/TR/css-scoping-1/#flat-tree
Some notable information:
****** NOTE: as of Chrome 59, this is broken in Chrome so that tests fail completely
****** remove... | [
"This",
"implemnts",
"the",
"flatten",
"-",
"tree",
"algorithm",
"specified",
":",
"Originally",
"here",
"https",
":",
"//",
"drafts",
".",
"csswg",
".",
"org",
"/",
"css",
"-",
"scoping",
"/",
"#flat",
"-",
"tree",
"Hopefully",
"soon",
"published",
"here"... | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/flattened-tree.js#L29-L53 | train | Returns virtual DOM object from node | [
30522,
3853,
7484,
9527,
19699,
5358,
3630,
3207,
1006,
13045,
1010,
5192,
3593,
1007,
1063,
9530,
3367,
1058,
3630,
3207,
3540,
5403,
1027,
1063,
1065,
1025,
9530,
3367,
1058,
3630,
3207,
1027,
1063,
5192,
3593,
1024,
5192,
3593,
1010,
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... |
BlackrockDigital/startbootstrap-sb-admin-2 | vendor/chart.js/Chart.js | computeOffsets | function computeOffsets(table, ticks, min, max, options) {
var start = 0;
var end = 0;
var first, last;
if (options.offset && ticks.length) {
if (!options.time.min) {
first = interpolate$1(table, 'time', ticks[0], 'pos');
if (ticks.length === 1) {
start = 1 - first;
} else {
start = (interpolate... | javascript | function computeOffsets(table, ticks, min, max, options) {
var start = 0;
var end = 0;
var first, last;
if (options.offset && ticks.length) {
if (!options.time.min) {
first = interpolate$1(table, 'time', ticks[0], 'pos');
if (ticks.length === 1) {
start = 1 - first;
} else {
start = (interpolate... | [
"function",
"computeOffsets",
"(",
"table",
",",
"ticks",
",",
"min",
",",
"max",
",",
"options",
")",
"{",
"var",
"start",
"=",
"0",
";",
"var",
"end",
"=",
"0",
";",
"var",
"first",
",",
"last",
";",
"if",
"(",
"options",
".",
"offset",
"&&",
"... | Returns the start and end offsets from edges in the form of {start, end}
where each value is a relative width to the scale and ranges between 0 and 1.
They add extra margins on the both sides by scaling down the original scale.
Offsets are added when the `offset` option is true. | [
"Returns",
"the",
"start",
"and",
"end",
"offsets",
"from",
"edges",
"in",
"the",
"form",
"of",
"{",
"start",
"end",
"}",
"where",
"each",
"value",
"is",
"a",
"relative",
"width",
"to",
"the",
"scale",
"and",
"ranges",
"between",
"0",
"and",
"1",
".",
... | ddfaceb4a8e65a41f163e2fdc4eab49384b810a1 | https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/ddfaceb4a8e65a41f163e2fdc4eab49384b810a1/vendor/chart.js/Chart.js#L12909-L12934 | train | Compute offsets for a given set of ticks | [
30522,
3853,
24134,
27475,
8454,
1006,
2795,
1010,
16356,
2015,
1010,
8117,
1010,
4098,
1010,
7047,
1007,
1063,
13075,
2707,
1027,
1014,
1025,
13075,
2203,
1027,
1014,
1025,
13075,
2034,
1010,
2197,
1025,
2065,
1006,
7047,
1012,
16396,
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... |
openlayers/openlayers | src/ol/format/EsriJSON.js | convertRings | function convertRings(rings, layout) {
const flatRing = [];
const outerRings = [];
const holes = [];
let i, ii;
for (i = 0, ii = rings.length; i < ii; ++i) {
flatRing.length = 0;
deflateCoordinates(flatRing, 0, rings[i], layout.length);
// is this ring an outer ring? is it clockwise?
const clo... | javascript | function convertRings(rings, layout) {
const flatRing = [];
const outerRings = [];
const holes = [];
let i, ii;
for (i = 0, ii = rings.length; i < ii; ++i) {
flatRing.length = 0;
deflateCoordinates(flatRing, 0, rings[i], layout.length);
// is this ring an outer ring? is it clockwise?
const clo... | [
"function",
"convertRings",
"(",
"rings",
",",
"layout",
")",
"{",
"const",
"flatRing",
"=",
"[",
"]",
";",
"const",
"outerRings",
"=",
"[",
"]",
";",
"const",
"holes",
"=",
"[",
"]",
";",
"let",
"i",
",",
"ii",
";",
"for",
"(",
"i",
"=",
"0",
... | Determines inner and outer rings.
Checks if any polygons in this array contain any other polygons in this
array. It is used for checking for holes.
Logic inspired by: https://github.com/Esri/terraformer-arcgis-parser
@param {Array<!Array<!Array<number>>>} rings Rings.
@param {import("../geom/GeometryLayout.js").default... | [
"Determines",
"inner",
"and",
"outer",
"rings",
".",
"Checks",
"if",
"any",
"polygons",
"in",
"this",
"array",
"contain",
"any",
"other",
"polygons",
"in",
"this",
"array",
".",
"It",
"is",
"used",
"for",
"checking",
"for",
"holes",
".",
"Logic",
"inspired... | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/format/EsriJSON.js#L279-L320 | train | Convert a list of rings into a polygon of rings | [
30522,
3853,
10463,
4892,
2015,
1006,
7635,
1010,
9621,
1007,
1063,
9530,
3367,
4257,
4892,
1027,
1031,
1033,
1025,
9530,
3367,
6058,
4892,
2015,
1027,
1031,
1033,
1025,
9530,
3367,
8198,
1027,
1031,
1033,
1025,
2292,
1045,
1010,
2462,
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... |
fullcalendar/fullcalendar | tasks/dts.js | transformModuleName | function transformModuleName(moduleName) {
let parts = moduleName.split('/')
if (parts.length > 1) { // one of our packages
let packageName = dirToPackage[parts[0]]
parts.shift() // remove first item, the dir name
if (parts.length === 1 && parts[0] === 'main') {
parts.shift() // completely empt... | javascript | function transformModuleName(moduleName) {
let parts = moduleName.split('/')
if (parts.length > 1) { // one of our packages
let packageName = dirToPackage[parts[0]]
parts.shift() // remove first item, the dir name
if (parts.length === 1 && parts[0] === 'main') {
parts.shift() // completely empt... | [
"function",
"transformModuleName",
"(",
"moduleName",
")",
"{",
"let",
"parts",
"=",
"moduleName",
".",
"split",
"(",
"'/'",
")",
"if",
"(",
"parts",
".",
"length",
">",
"1",
")",
"{",
"// one of our packages",
"let",
"packageName",
"=",
"dirToPackage",
"[",... | /*
NOTE: this logic is overkill now that modules names are just '@fullcalendar/*' | [
"/",
"*",
"NOTE",
":",
"this",
"logic",
"is",
"overkill",
"now",
"that",
"modules",
"names",
"are",
"just"
] | f827f233581338ceb9723eabb7f895731498fd5b | https://github.com/fullcalendar/fullcalendar/blob/f827f233581338ceb9723eabb7f895731498fd5b/tasks/dts.js#L78-L94 | train | Transform a module name into a module name | [
30522,
3853,
10938,
5302,
8566,
20844,
4168,
1006,
11336,
18442,
1007,
1063,
2292,
3033,
1027,
11336,
18442,
1012,
3975,
1006,
1005,
1013,
1005,
1007,
2065,
1006,
3033,
1012,
3091,
1028,
1015,
1007,
1063,
1013,
1013,
2028,
1997,
2256,
14555... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
moleculerjs/moleculer | dev/param-mixin.js | paramConverterMiddleware | function paramConverterMiddleware(handler, action) {
function convertProperties(obj, schema) {
Object.keys(schema).forEach(key => {
const s = schema[key];
const val = obj[key];
if (val == null)
return;
if (s.type == "string" && typeof val !== "string") {
obj[key] = "" + val;
} else if (s.typ... | javascript | function paramConverterMiddleware(handler, action) {
function convertProperties(obj, schema) {
Object.keys(schema).forEach(key => {
const s = schema[key];
const val = obj[key];
if (val == null)
return;
if (s.type == "string" && typeof val !== "string") {
obj[key] = "" + val;
} else if (s.typ... | [
"function",
"paramConverterMiddleware",
"(",
"handler",
",",
"action",
")",
"{",
"function",
"convertProperties",
"(",
"obj",
",",
"schema",
")",
"{",
"Object",
".",
"keys",
"(",
"schema",
")",
".",
"forEach",
"(",
"key",
"=>",
"{",
"const",
"s",
"=",
"s... | Proof-of-Concept middleware to convert context params
@param {Function} handler
@param {Action} action | [
"Proof",
"-",
"of",
"-",
"Concept",
"middleware",
"to",
"convert",
"context",
"params"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/dev/param-mixin.js#L10-L41 | train | Convert params from context to context params | [
30522,
3853,
11498,
12458,
2239,
16874,
2121,
4328,
20338,
8059,
1006,
28213,
1010,
2895,
1007,
1063,
3853,
10463,
21572,
4842,
7368,
1006,
27885,
3501,
1010,
30524,
1031,
3145,
1033,
1025,
9530,
3367,
11748,
1027,
27885,
3501,
1031,
3145,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | Makefile.js | getFirstVersionOfFile | function getFirstVersionOfFile(filePath) {
const firstCommit = getFirstCommitOfFile(filePath);
let tags = execSilent(`git tag --contains ${firstCommit}`);
tags = splitCommandResultToLines(tags);
return tags.reduce((list, version) => {
const validatedVersion = semver.valid(version.trim());
... | javascript | function getFirstVersionOfFile(filePath) {
const firstCommit = getFirstCommitOfFile(filePath);
let tags = execSilent(`git tag --contains ${firstCommit}`);
tags = splitCommandResultToLines(tags);
return tags.reduce((list, version) => {
const validatedVersion = semver.valid(version.trim());
... | [
"function",
"getFirstVersionOfFile",
"(",
"filePath",
")",
"{",
"const",
"firstCommit",
"=",
"getFirstCommitOfFile",
"(",
"filePath",
")",
";",
"let",
"tags",
"=",
"execSilent",
"(",
"`",
"${",
"firstCommit",
"}",
"`",
")",
";",
"tags",
"=",
"splitCommandResul... | Gets the tag name where a given file was introduced first.
@param {string} filePath The file path to check.
@returns {string} The tag name. | [
"Gets",
"the",
"tag",
"name",
"where",
"a",
"given",
"file",
"was",
"introduced",
"first",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/Makefile.js#L340-L353 | train | Get the first version of a file | [
30522,
3853,
2131,
8873,
12096,
27774,
7245,
9463,
1006,
5371,
15069,
1007,
1063,
9530,
3367,
2034,
9006,
22930,
1027,
2131,
8873,
12096,
9006,
22930,
7245,
9463,
1006,
5371,
15069,
1007,
1025,
2292,
22073,
1027,
4654,
8586,
27572,
4765,
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/LiveDevelopment/Inspector/Inspector.js | _onError | function _onError(error) {
if (_connectDeferred) {
_connectDeferred.reject();
_connectDeferred = null;
}
exports.trigger("error", error);
} | javascript | function _onError(error) {
if (_connectDeferred) {
_connectDeferred.reject();
_connectDeferred = null;
}
exports.trigger("error", error);
} | [
"function",
"_onError",
"(",
"error",
")",
"{",
"if",
"(",
"_connectDeferred",
")",
"{",
"_connectDeferred",
".",
"reject",
"(",
")",
";",
"_connectDeferred",
"=",
"null",
";",
"}",
"exports",
".",
"trigger",
"(",
"\"error\"",
",",
"error",
")",
";",
"}"... | WebSocket reported an error | [
"WebSocket",
"reported",
"an",
"error"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Inspector/Inspector.js#L186-L192 | train | Called when an error occurs during the connection | [
30522,
3853,
1035,
2028,
18933,
2099,
1006,
7561,
1007,
1063,
2065,
1006,
1035,
7532,
3207,
7512,
5596,
1007,
1063,
1035,
7532,
3207,
7512,
5596,
1012,
15454,
1006,
1007,
1025,
1035,
7532,
3207,
7512,
5596,
1027,
19701,
1025,
1065,
14338,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/count.js | buildCount | function buildCount (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [count](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html) request
*
* @param {list} index - A comma-separated... | javascript | function buildCount (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [count](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html) request
*
* @param {list} index - A comma-separated... | [
"function",
"buildCount",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [count](http://www.elastic.co/guide/en/elastic... | /* eslint camelcase: 0 /* eslint no-unused-vars: 0 | [
"/",
"*",
"eslint",
"camelcase",
":",
"0",
"/",
"*",
"eslint",
"no",
"-",
"unused",
"-",
"vars",
":",
"0"
] | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/api/count.js#L25-L143 | train | Build a count query | [
30522,
3853,
3857,
3597,
16671,
1006,
23569,
2015,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2279,
1011,
2240,
2053,
1011,
15171,
1011,
13075,
2015,
9530,
3367,
1063,
9338,
2063,
15500,
1010,
9563,
2121,
29165,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/radix.js | isValidRadix | function isValidRadix(radix) {
return !(
(radix.type === "Literal" && typeof radix.value !== "number") ||
(radix.type === "Identifier" && radix.name === "undefined")
);
} | javascript | function isValidRadix(radix) {
return !(
(radix.type === "Literal" && typeof radix.value !== "number") ||
(radix.type === "Identifier" && radix.name === "undefined")
);
} | [
"function",
"isValidRadix",
"(",
"radix",
")",
"{",
"return",
"!",
"(",
"(",
"radix",
".",
"type",
"===",
"\"Literal\"",
"&&",
"typeof",
"radix",
".",
"value",
"!==",
"\"number\"",
")",
"||",
"(",
"radix",
".",
"type",
"===",
"\"Identifier\"",
"&&",
"rad... | Checks whether a given node is a valid value of radix or not.
The following values are invalid.
- A literal except numbers.
- undefined.
@param {ASTNode} radix - A node of radix to check.
@returns {boolean} `true` if the node is valid. | [
"Checks",
"whether",
"a",
"given",
"node",
"is",
"a",
"valid",
"value",
"of",
"radix",
"or",
"not",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/radix.js#L58-L63 | train | Check if the given radix is valid | [
30522,
3853,
2003,
10175,
3593,
12173,
7646,
1006,
10958,
4305,
2595,
1007,
1063,
2709,
999,
1006,
1006,
10958,
4305,
2595,
1012,
2828,
1027,
1027,
1027,
1000,
18204,
1000,
1004,
1004,
2828,
11253,
10958,
4305,
2595,
1012,
3643,
999,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/sticky/sticky.js | setupAugmentedScrollEvents | function setupAugmentedScrollEvents(element) {
var SCROLL_END_DELAY = 200;
var isScrolling;
var lastScrollTime;
element.on('scroll touchmove', function() {
if (!isScrolling) {
isScrolling = true;
$$rAF.throttle(loopScrollEvent);
element.triggerHandler('$scrollstart');
... | javascript | function setupAugmentedScrollEvents(element) {
var SCROLL_END_DELAY = 200;
var isScrolling;
var lastScrollTime;
element.on('scroll touchmove', function() {
if (!isScrolling) {
isScrolling = true;
$$rAF.throttle(loopScrollEvent);
element.triggerHandler('$scrollstart');
... | [
"function",
"setupAugmentedScrollEvents",
"(",
"element",
")",
"{",
"var",
"SCROLL_END_DELAY",
"=",
"200",
";",
"var",
"isScrolling",
";",
"var",
"lastScrollTime",
";",
"element",
".",
"on",
"(",
"'scroll touchmove'",
",",
"function",
"(",
")",
"{",
"if",
"(",... | Android 4.4 don't accurately give scroll events. To fix this problem, we setup a fake scroll event. We say: > If a scroll or touchmove event has happened in the last DELAY milliseconds, then send a `$scroll` event every animationFrame. Additionally, we add $scrollstart and $scrollend events. | [
"Android",
"4",
".",
"4",
"don",
"t",
"accurately",
"give",
"scroll",
"events",
".",
"To",
"fix",
"this",
"problem",
"we",
"setup",
"a",
"fake",
"scroll",
"event",
".",
"We",
"say",
":",
">",
"If",
"a",
"scroll",
"or",
"touchmove",
"event",
"has",
"h... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/sticky/sticky.js#L328-L351 | train | Setup event handlers for scroll events | [
30522,
3853,
16437,
4887,
21693,
14088,
11020,
28402,
18697,
7666,
1006,
5783,
1007,
1063,
13075,
17186,
1035,
2203,
1035,
8536,
1027,
3263,
1025,
13075,
26354,
26775,
14511,
2075,
1025,
13075,
16180,
26775,
14511,
7292,
1025,
5783,
1012,
200... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | examples/react-native-expo/FileList.js | FileIcon | function FileIcon () {
return <View style={styles.itemIconContainer}>
<Image
style={styles.itemIcon}
source={require('./assets/file-icon.png')}
/>
</View>
} | javascript | function FileIcon () {
return <View style={styles.itemIconContainer}>
<Image
style={styles.itemIcon}
source={require('./assets/file-icon.png')}
/>
</View>
} | [
"function",
"FileIcon",
"(",
")",
"{",
"return",
"<",
"View",
"style",
"=",
"{",
"styles",
".",
"itemIconContainer",
"}",
">",
"\n ",
"<",
"Image",
"style",
"=",
"{",
"styles",
".",
"itemIcon",
"}",
"source",
"=",
"{",
"require",
"(",
"'./assets/file-... | return str } | [
"return",
"str",
"}"
] | 7ae18bf992d544a64da998f033258ec09a3de275 | https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/examples/react-native-expo/FileList.js#L18-L25 | train | File Icon | [
30522,
3853,
5371,
28524,
1006,
1007,
1063,
2709,
1026,
3193,
2806,
1027,
1063,
6782,
1012,
8875,
28524,
8663,
18249,
2121,
1065,
1028,
1026,
3746,
2806,
1027,
1063,
6782,
1012,
8875,
28524,
1065,
3120,
1027,
1063,
5478,
1006,
1005,
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/search/node/FindInFilesDomain.js | doSearch | function doSearch(searchObject, nextPages) {
savedSearchObject = searchObject;
if (!files) {
console.log("no file object found");
return {};
}
results = {};
numMatches = 0;
numFiles = 0;
foundMaximum = false;
if (!nextPages) {
exceedsMaximum = false;
eval... | javascript | function doSearch(searchObject, nextPages) {
savedSearchObject = searchObject;
if (!files) {
console.log("no file object found");
return {};
}
results = {};
numMatches = 0;
numFiles = 0;
foundMaximum = false;
if (!nextPages) {
exceedsMaximum = false;
eval... | [
"function",
"doSearch",
"(",
"searchObject",
",",
"nextPages",
")",
"{",
"savedSearchObject",
"=",
"searchObject",
";",
"if",
"(",
"!",
"files",
")",
"{",
"console",
".",
"log",
"(",
"\"no file object found\"",
")",
";",
"return",
"{",
"}",
";",
"}",
"resu... | Do a search with the searchObject context and return the results
@param {Object} searchObject
@param {boolean} nextPages set to true if to indicate that next page of an existing page is being fetched
@return {Object} search results | [
"Do",
"a",
"search",
"with",
"the",
"searchObject",
"context",
"and",
"return",
"the",
"results"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L425-L466 | train | search the files in the current page | [
30522,
3853,
13004,
2906,
2818,
1006,
3945,
16429,
20614,
1010,
2279,
13704,
2015,
1007,
1063,
5552,
17310,
11140,
16429,
20614,
1027,
3945,
16429,
20614,
1025,
2065,
1006,
999,
6764,
1007,
1063,
10122,
1012,
8833,
1006,
1000,
2053,
5371,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.m/src/sap/m/FacetFilterList.js | isODataModel | function isODataModel(oModel) {
return oModel instanceof sap.ui.model.odata.ODataModel || oModel instanceof sap.ui.model.odata.v2.ODataModel;
} | javascript | function isODataModel(oModel) {
return oModel instanceof sap.ui.model.odata.ODataModel || oModel instanceof sap.ui.model.odata.v2.ODataModel;
} | [
"function",
"isODataModel",
"(",
"oModel",
")",
"{",
"return",
"oModel",
"instanceof",
"sap",
".",
"ui",
".",
"model",
".",
"odata",
".",
"ODataModel",
"||",
"oModel",
"instanceof",
"sap",
".",
"ui",
".",
"model",
".",
"odata",
".",
"v2",
".",
"ODataMode... | Checks whether given model is one of the OData Model(s) | [
"Checks",
"whether",
"given",
"model",
"is",
"one",
"of",
"the",
"OData",
"Model",
"(",
"s",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/FacetFilterList.js#L566-L568 | train | Returns true if the given model is an OData model | [
30522,
3853,
11163,
2850,
15464,
10244,
2140,
1006,
18168,
10244,
2140,
1007,
1063,
2709,
18168,
10244,
2140,
6013,
11253,
20066,
1012,
21318,
1012,
2944,
1012,
1051,
2850,
2696,
1012,
1051,
2850,
15464,
10244,
2140,
1064,
1064,
18168,
10244,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-rule.js | combinePropertyObjects | function combinePropertyObjects(objArr1, objArr2) {
const res = [];
if (objArr1.length === 0) {
return objArr2;
}
if (objArr2.length === 0) {
return objArr1;
}
objArr1.forEach(obj1 => {
objArr2.forEach(obj2 => {
const combinedObj = {};
const obj1P... | javascript | function combinePropertyObjects(objArr1, objArr2) {
const res = [];
if (objArr1.length === 0) {
return objArr2;
}
if (objArr2.length === 0) {
return objArr1;
}
objArr1.forEach(obj1 => {
objArr2.forEach(obj2 => {
const combinedObj = {};
const obj1P... | [
"function",
"combinePropertyObjects",
"(",
"objArr1",
",",
"objArr2",
")",
"{",
"const",
"res",
"=",
"[",
"]",
";",
"if",
"(",
"objArr1",
".",
"length",
"===",
"0",
")",
"{",
"return",
"objArr2",
";",
"}",
"if",
"(",
"objArr2",
".",
"length",
"===",
... | Object whose keys are rule names and values are arrays of valid ruleConfig items
which should be linted against the target source code to determine error counts.
(a ruleConfigSet.ruleConfigs).
e.g. rulesConfig = {
"comma-dangle": [2, [2, "always"], [2, "always-multiline"], [2, "never"]],
"no-console": [2]
}
@typedef r... | [
"Object",
"whose",
"keys",
"are",
"rule",
"names",
"and",
"values",
"are",
"arrays",
"of",
"valid",
"ruleConfig",
"items",
"which",
"should",
"be",
"linted",
"against",
"the",
"target",
"source",
"code",
"to",
"determine",
"error",
"counts",
".",
"(",
"a",
... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-rule.js#L145-L170 | train | Combine two object arrays | [
30522,
3853,
11506,
21572,
4842,
3723,
16429,
20614,
2015,
1006,
27885,
16084,
2099,
2487,
1010,
27885,
16084,
2099,
2475,
1007,
1063,
9530,
3367,
24501,
1027,
1031,
1033,
1025,
2065,
1006,
27885,
16084,
2099,
2487,
1012,
3091,
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... |
nhn/tui.editor | src/js/extensions/table/mergedTableRemoveCol.js | _findFocusCell | function _findFocusCell($newTable, rowIndex, colIndex) {
const tableData = dataHandler.createTableData($newTable);
if (tableData[0].length - 1 < colIndex) {
colIndex -= 1;
}
const cellElementIndex = dataHandler.findElementIndex(tableData, rowIndex, colIndex);
return $newTable.find('tr').eq(cellElementI... | javascript | function _findFocusCell($newTable, rowIndex, colIndex) {
const tableData = dataHandler.createTableData($newTable);
if (tableData[0].length - 1 < colIndex) {
colIndex -= 1;
}
const cellElementIndex = dataHandler.findElementIndex(tableData, rowIndex, colIndex);
return $newTable.find('tr').eq(cellElementI... | [
"function",
"_findFocusCell",
"(",
"$newTable",
",",
"rowIndex",
",",
"colIndex",
")",
"{",
"const",
"tableData",
"=",
"dataHandler",
".",
"createTableData",
"(",
"$newTable",
")",
";",
"if",
"(",
"tableData",
"[",
"0",
"]",
".",
"length",
"-",
"1",
"<",
... | Find focus cell element like td or th.
@param {jQuery} $newTable - changed table jQuery element
@param {number} rowIndex - row index of table data
@param {number} colIndex - column index of tabld data
@returns {HTMLElement}
@private | [
"Find",
"focus",
"cell",
"element",
"like",
"td",
"or",
"th",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/mergedTableRemoveCol.js#L136-L146 | train | Find focus cell | [
30522,
3853,
1035,
2424,
14876,
7874,
29109,
2140,
1006,
1002,
25597,
3085,
1010,
5216,
22254,
10288,
1010,
6972,
3207,
2595,
1007,
1063,
9530,
3367,
2795,
2850,
2696,
1027,
2951,
11774,
3917,
1012,
3443,
10880,
2850,
2696,
1006,
1002,
2559... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.m/src/sap/m/SinglePlanningCalendarGrid.js | function(oEvent) {
var oDragSession = oEvent.getParameter("dragSession"),
oAppointmentRef = oDragSession.getDragControl().$().get(0),
oDropTarget = oDragSession.getDropControl().getDomRef(),
oAppointmentStartingBoundaries = oDragSession.getComplexData("appointmentStartingBoundaries"),
fnHid... | javascript | function(oEvent) {
var oDragSession = oEvent.getParameter("dragSession"),
oAppointmentRef = oDragSession.getDragControl().$().get(0),
oDropTarget = oDragSession.getDropControl().getDomRef(),
oAppointmentStartingBoundaries = oDragSession.getComplexData("appointmentStartingBoundaries"),
fnHid... | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"oDragSession",
"=",
"oEvent",
".",
"getParameter",
"(",
"\"dragSession\"",
")",
",",
"oAppointmentRef",
"=",
"oDragSession",
".",
"getDragControl",
"(",
")",
".",
"$",
"(",
")",
".",
"get",
"(",
"0",
")",
",",... | Fired when a dragged appointment enters a drop target. | [
"Fired",
"when",
"a",
"dragged",
"appointment",
"enters",
"a",
"drop",
"target",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/SinglePlanningCalendarGrid.js#L597-L641 | train | Dragging of the drop control | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
1051,
7265,
5620,
7971,
3258,
1027,
1051,
18697,
3372,
1012,
2131,
28689,
22828,
1006,
1000,
8011,
8583,
10992,
1000,
1007,
1010,
1051,
29098,
25785,
3672,
2890,
2546,
1027,
1051,
726... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/semi-style.js | check | function check(semiToken, expected) {
const prevToken = sourceCode.getTokenBefore(semiToken);
const nextToken = sourceCode.getTokenAfter(semiToken);
const prevIsSameLine = !prevToken || astUtils.isTokenOnSameLine(prevToken, semiToken);
const nextIsSameLine = !nextToken ||... | javascript | function check(semiToken, expected) {
const prevToken = sourceCode.getTokenBefore(semiToken);
const nextToken = sourceCode.getTokenAfter(semiToken);
const prevIsSameLine = !prevToken || astUtils.isTokenOnSameLine(prevToken, semiToken);
const nextIsSameLine = !nextToken ||... | [
"function",
"check",
"(",
"semiToken",
",",
"expected",
")",
"{",
"const",
"prevToken",
"=",
"sourceCode",
".",
"getTokenBefore",
"(",
"semiToken",
")",
";",
"const",
"nextToken",
"=",
"sourceCode",
".",
"getTokenAfter",
"(",
"semiToken",
")",
";",
"const",
... | Check the given semicolon token.
@param {Token} semiToken The semicolon token to check.
@param {"first"|"last"} expected The expected location to check.
@returns {void} | [
"Check",
"the",
"given",
"semicolon",
"token",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/semi-style.js#L91-L119 | train | Check if a semicolon is at the end of the line | [
30522,
3853,
4638,
1006,
30524,
4783,
29278,
2063,
1006,
4100,
18715,
2368,
1007,
1025,
9530,
3367,
2279,
18715,
2368,
1027,
3120,
16044,
1012,
2131,
18715,
8189,
6199,
2121,
1006,
4100,
18715,
2368,
1007,
1025,
9530,
3367,
3653,
11365,
215... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/ripple/ripple.js | InkRippleProvider | function InkRippleProvider () {
var isDisabledGlobally = false;
return {
disableInkRipple: disableInkRipple,
$get: function($injector) {
return { attach: attach };
/**
* @ngdoc method
* @name $mdInkRipple#attach
*
* @description
* Attaching given scope, eleme... | javascript | function InkRippleProvider () {
var isDisabledGlobally = false;
return {
disableInkRipple: disableInkRipple,
$get: function($injector) {
return { attach: attach };
/**
* @ngdoc method
* @name $mdInkRipple#attach
*
* @description
* Attaching given scope, eleme... | [
"function",
"InkRippleProvider",
"(",
")",
"{",
"var",
"isDisabledGlobally",
"=",
"false",
";",
"return",
"{",
"disableInkRipple",
":",
"disableInkRipple",
",",
"$get",
":",
"function",
"(",
"$injector",
")",
"{",
"return",
"{",
"attach",
":",
"attach",
"}",
... | @ngdoc service
@name $mdInkRipple
@module material.core.ripple
@description
`$mdInkRipple` is a service for adding ripples to any element.
@usage
<hljs lang="js">
app.factory('$myElementInkRipple', function($mdInkRipple) {
return {
attach: function (scope, element, options) {
return $mdInkRipple.attach(scope, element... | [
"@ngdoc",
"service",
"@name",
"$mdInkRipple",
"@module",
"material",
".",
"core",
".",
"ripple"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/ripple/ripple.js#L108-L152 | train | The InkRippleProvider provides a provider that can be used to configure the ripples. | [
30522,
3853,
10710,
29443,
10814,
21572,
17258,
2121,
1006,
1007,
1063,
13075,
2003,
10521,
3085,
2094,
23296,
16429,
3973,
1027,
6270,
1025,
2709,
1063,
4487,
19150,
19839,
29443,
10814,
1024,
4487,
19150,
19839,
29443,
10814,
1010,
1002,
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... |
adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | showSaveDialog | function showSaveDialog(title, initialPath, proposedNewFilename, callback) {
appshell.fs.showSaveDialog(title, initialPath, proposedNewFilename, _wrap(callback));
} | javascript | function showSaveDialog(title, initialPath, proposedNewFilename, callback) {
appshell.fs.showSaveDialog(title, initialPath, proposedNewFilename, _wrap(callback));
} | [
"function",
"showSaveDialog",
"(",
"title",
",",
"initialPath",
",",
"proposedNewFilename",
",",
"callback",
")",
"{",
"appshell",
".",
"fs",
".",
"showSaveDialog",
"(",
"title",
",",
"initialPath",
",",
"proposedNewFilename",
",",
"_wrap",
"(",
"callback",
")",... | Display a save-file dialog and call back asynchronously with either a
FileSystemError string or the path to which the user has chosen to save
the file. If the dialog is cancelled, the path string will be empty.
@param {string} title
@param {string} initialPath
@param {string} proposedNewFilename
@param {function(?stri... | [
"Display",
"a",
"save",
"-",
"file",
"dialog",
"and",
"call",
"back",
"asynchronously",
"with",
"either",
"a",
"FileSystemError",
"string",
"or",
"the",
"path",
"to",
"which",
"the",
"user",
"has",
"chosen",
"to",
"save",
"the",
"file",
".",
"If",
"the",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L215-L217 | train | showSaveDialog - Shows a save dialog | [
30522,
3853,
3065,
10696,
27184,
8649,
1006,
2516,
1010,
3988,
15069,
1010,
3818,
2638,
2860,
8873,
20844,
4168,
1010,
2655,
5963,
1007,
1063,
18726,
18223,
1012,
1042,
2015,
1012,
3065,
10696,
27184,
8649,
1006,
2516,
1010,
3988,
15069,
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.table/src/sap/ui/table/TableUtils.js | function(oControl) {
var sContentDensity;
var aContentDensityStyleClasses = ["sapUiSizeCondensed", "sapUiSizeCompact", "sapUiSizeCozy"];
var fnGetContentDensity = function(sFnName, oObject) {
if (!oObject[sFnName]) {
return;
}
for (var i = 0; i < aContentDensityStyleClasses.length; i++) {
... | javascript | function(oControl) {
var sContentDensity;
var aContentDensityStyleClasses = ["sapUiSizeCondensed", "sapUiSizeCompact", "sapUiSizeCozy"];
var fnGetContentDensity = function(sFnName, oObject) {
if (!oObject[sFnName]) {
return;
}
for (var i = 0; i < aContentDensityStyleClasses.length; i++) {
... | [
"function",
"(",
"oControl",
")",
"{",
"var",
"sContentDensity",
";",
"var",
"aContentDensityStyleClasses",
"=",
"[",
"\"sapUiSizeCondensed\"",
",",
"\"sapUiSizeCompact\"",
",",
"\"sapUiSizeCozy\"",
"]",
";",
"var",
"fnGetContentDensity",
"=",
"function",
"(",
"sFnNam... | Returns the content density style class which is relevant for the given control. First it tries to find the
definition via the control API. While traversing the controls parents, it's tried to find the closest DOM
reference. If that is found, the check will use the DOM reference to find the closest content density styl... | [
"Returns",
"the",
"content",
"density",
"style",
"class",
"which",
"is",
"relevant",
"for",
"the",
"given",
"control",
".",
"First",
"it",
"tries",
"to",
"find",
"the",
"definition",
"via",
"the",
"control",
"API",
".",
"While",
"traversing",
"the",
"control... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L1030-L1101 | train | Returns the content density of the given control | [
30522,
3853,
1006,
1051,
8663,
13181,
2140,
1007,
1063,
13075,
8040,
28040,
3372,
4181,
17759,
1025,
13075,
9353,
28040,
3372,
4181,
17759,
21756,
2571,
26266,
2229,
1027,
1031,
1000,
20066,
27020,
4697,
8663,
4181,
6924,
1000,
1010,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | xlsx.js | parse_lpstr | function parse_lpstr(blob, type, pad) {
var start = blob.l;
var str = blob.read_shift(0, 'lpstr-cp');
if(pad) while((blob.l - start) & 3) ++blob.l;
return str;
} | javascript | function parse_lpstr(blob, type, pad) {
var start = blob.l;
var str = blob.read_shift(0, 'lpstr-cp');
if(pad) while((blob.l - start) & 3) ++blob.l;
return str;
} | [
"function",
"parse_lpstr",
"(",
"blob",
",",
"type",
",",
"pad",
")",
"{",
"var",
"start",
"=",
"blob",
".",
"l",
";",
"var",
"str",
"=",
"blob",
".",
"read_shift",
"(",
"0",
",",
"'lpstr-cp'",
")",
";",
"if",
"(",
"pad",
")",
"while",
"(",
"(",
... | /* [MS-OSHARED] 2.3.3.1.4 Lpstr | [
"/",
"*",
"[",
"MS",
"-",
"OSHARED",
"]",
"2",
".",
"3",
".",
"3",
".",
"1",
".",
"4",
"Lpstr"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L4986-L4991 | train | Parse LPSTR | [
30522,
3853,
11968,
3366,
1035,
6948,
3367,
2099,
1006,
1038,
4135,
2497,
1010,
2828,
1010,
11687,
1007,
1063,
13075,
2707,
1027,
1038,
4135,
2497,
1012,
1048,
1025,
13075,
2358,
2099,
1027,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
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... |
SAP/openui5 | src/sap.m/src/sap/m/PlanningCalendar.js | function (oEvent) {
var oDragSession = oEvent.getParameter("dragSession"),
sTargetElementId = this.getTargetElement(),
fnHideIndicator = function () {
var $Indicator = jQuery(oDragSession.getIndicator());
$Indicator.addClass("sapUiDnDIndicatorHide");
},
oDropRects = oDragSess... | javascript | function (oEvent) {
var oDragSession = oEvent.getParameter("dragSession"),
sTargetElementId = this.getTargetElement(),
fnHideIndicator = function () {
var $Indicator = jQuery(oDragSession.getIndicator());
$Indicator.addClass("sapUiDnDIndicatorHide");
},
oDropRects = oDragSess... | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"oDragSession",
"=",
"oEvent",
".",
"getParameter",
"(",
"\"dragSession\"",
")",
",",
"sTargetElementId",
"=",
"this",
".",
"getTargetElement",
"(",
")",
",",
"fnHideIndicator",
"=",
"function",
"(",
")",
"{",
"var... | Fired when a dragged appointment enters a drop target. | [
"Fired",
"when",
"a",
"dragged",
"appointment",
"enters",
"a",
"drop",
"target",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/PlanningCalendar.js#L3249-L3273 | train | Dragging the control | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
1051,
7265,
5620,
7971,
3258,
1027,
1051,
18697,
3372,
1012,
2131,
28689,
22828,
1006,
1000,
8011,
8583,
10992,
1000,
1007,
1010,
2732,
18150,
12260,
3672,
3593,
1027,
2023,
1012,
213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/tags.js | doQuery | function doQuery(options) {
return models.Tag.findOne(options.data, _.omit(options, ['data']))
.then((model) => {
if (!model) {
return Promise.reject(new common.errors.NotFoundError({
message: common.i18n.t('errors.api.t... | javascript | function doQuery(options) {
return models.Tag.findOne(options.data, _.omit(options, ['data']))
.then((model) => {
if (!model) {
return Promise.reject(new common.errors.NotFoundError({
message: common.i18n.t('errors.api.t... | [
"function",
"doQuery",
"(",
"options",
")",
"{",
"return",
"models",
".",
"Tag",
".",
"findOne",
"(",
"options",
".",
"data",
",",
"_",
".",
"omit",
"(",
"options",
",",
"[",
"'data'",
"]",
")",
")",
".",
"then",
"(",
"(",
"model",
")",
"=>",
"{"... | ### Model Query
Make the call to the Model layer
@param {Object} options
@returns {Object} options | [
"###",
"Model",
"Query",
"Make",
"the",
"call",
"to",
"the",
"Model",
"layer"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/tags.js#L74-L87 | train | Query for a tag | [
30522,
3853,
2079,
4226,
2854,
1006,
7047,
1007,
1063,
2709,
4275,
1012,
6415,
1012,
2424,
5643,
1006,
7047,
1012,
2951,
1010,
1035,
1012,
18168,
4183,
1006,
7047,
1010,
1031,
1005,
2951,
1005,
1033,
1007,
1007,
1012,
2059,
1006,
1006,
29... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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() {
var args = arguments;
var sc = args[0], so = args[1], ec = sc, eo = so;
switch (args.length) {
case 3:
eo = args[2];
break;
case 4:
... | javascript | function() {
var args = arguments;
var sc = args[0], so = args[1], ec = sc, eo = so;
switch (args.length) {
case 3:
eo = args[2];
break;
case 4:
... | [
"function",
"(",
")",
"{",
"var",
"args",
"=",
"arguments",
";",
"var",
"sc",
"=",
"args",
"[",
"0",
"]",
",",
"so",
"=",
"args",
"[",
"1",
"]",
",",
"ec",
"=",
"sc",
",",
"eo",
"=",
"so",
";",
"switch",
"(",
"args",
".",
"length",
")",
"{"... | Convenience method to set a range's start and end boundaries. Overloaded as follows:
- Two parameters (node, offset) creates a collapsed range at that position
- Three parameters (node, startOffset, endOffset) creates a range contained with node starting at
startOffset and ending at endOffset
- Four parameters (startNo... | [
"Convenience",
"method",
"to",
"set",
"a",
"range",
"s",
"start",
"and",
"end",
"boundaries",
".",
"Overloaded",
"as",
"follows",
":",
"-",
"Two",
"parameters",
"(",
"node",
"offset",
")",
"creates",
"a",
"collapsed",
"range",
"at",
"that",
"position",
"-"... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L1968-L1983 | train | Updates the boundary of the connection | [
30522,
3853,
1006,
1007,
1063,
13075,
12098,
5620,
1027,
9918,
1025,
13075,
8040,
1027,
12098,
5620,
1031,
1014,
1033,
1010,
2061,
1027,
12098,
5620,
1031,
1015,
1033,
1010,
14925,
1027,
8040,
1010,
1041,
2080,
1027,
2061,
1025,
6942,
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... | |
moleculerjs/moleculer | src/serializers/proto/packets.proto.js | PacketRequest | function PacketRequest(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | javascript | function PacketRequest(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | [
"function",
"PacketRequest",
"(",
"properties",
")",
"{",
"if",
"(",
"properties",
")",
"for",
"(",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"properties",
")",
",",
"i",
"=",
"0",
";",
"i",
"<",
"keys",
".",
"length",
";",
"++",
"i",
")",
... | Properties of a PacketRequest.
@memberof packets
@interface IPacketRequest
@property {string} ver PacketRequest ver
@property {string} sender PacketRequest sender
@property {string} id PacketRequest id
@property {string} action PacketRequest action
@property {Uint8Array|null} [params] PacketRequest params
@property {st... | [
"Properties",
"of",
"a",
"PacketRequest",
"."
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L365-L370 | train | Properties of a PacketRequest. | [
30522,
3853,
14771,
2890,
15500,
1006,
5144,
1007,
1063,
2065,
1006,
5144,
1007,
2005,
1006,
13075,
6309,
1027,
4874,
1012,
6309,
1006,
5144,
1007,
1010,
1045,
1027,
1014,
1025,
1045,
1026,
6309,
1012,
3091,
1025,
1009,
1009,
1045,
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/CodeFolding/main.js | removeGutters | function removeGutters(editor) {
Editor.unregisterGutter(GUTTER_NAME);
$(editor.getRootElement()).removeClass("folding-enabled");
CodeMirror.defineOption("foldGutter", false, null);
} | javascript | function removeGutters(editor) {
Editor.unregisterGutter(GUTTER_NAME);
$(editor.getRootElement()).removeClass("folding-enabled");
CodeMirror.defineOption("foldGutter", false, null);
} | [
"function",
"removeGutters",
"(",
"editor",
")",
"{",
"Editor",
".",
"unregisterGutter",
"(",
"GUTTER_NAME",
")",
";",
"$",
"(",
"editor",
".",
"getRootElement",
"(",
")",
")",
".",
"removeClass",
"(",
"\"folding-enabled\"",
")",
";",
"CodeMirror",
".",
"def... | Remove the fold gutter for a given CodeMirror instance.
@param {Editor} editor the editor instance whose gutter should be removed | [
"Remove",
"the",
"fold",
"gutter",
"for",
"a",
"given",
"CodeMirror",
"instance",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L315-L319 | train | Removes the fold gutter from the editor | [
30522,
3853,
6366,
27920,
7747,
1006,
3559,
1007,
1063,
3559,
1012,
4895,
2890,
24063,
2121,
27920,
3334,
1006,
9535,
3334,
1035,
2171,
1007,
1025,
1002,
1006,
3559,
1012,
2131,
3217,
12184,
16930,
4765,
1006,
1007,
1007,
1012,
6366,
26266,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-extra-parens.js | hasExcessParensNoLineTerminator | function hasExcessParensNoLineTerminator(token, node) {
if (token.loc.end.line === node.loc.start.line) {
return hasExcessParens(node);
}
return hasDoubleExcessParens(node);
} | javascript | function hasExcessParensNoLineTerminator(token, node) {
if (token.loc.end.line === node.loc.start.line) {
return hasExcessParens(node);
}
return hasDoubleExcessParens(node);
} | [
"function",
"hasExcessParensNoLineTerminator",
"(",
"token",
",",
"node",
")",
"{",
"if",
"(",
"token",
".",
"loc",
".",
"end",
".",
"line",
"===",
"node",
".",
"loc",
".",
"start",
".",
"line",
")",
"{",
"return",
"hasExcessParens",
"(",
"node",
")",
... | Determines if a node following a [no LineTerminator here] restriction is
surrounded by (potentially) invalid extra parentheses.
@param {Token} token - The token preceding the [no LineTerminator here] restriction.
@param {ASTNode} node - The node to be checked.
@returns {boolean} True if the node is incorrectly parenthe... | [
"Determines",
"if",
"a",
"node",
"following",
"a",
"[",
"no",
"LineTerminator",
"here",
"]",
"restriction",
"is",
"surrounded",
"by",
"(",
"potentially",
")",
"invalid",
"extra",
"parentheses",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-extra-parens.js#L248-L254 | train | Check if the node has excess parentheses | [
30522,
3853,
2038,
10288,
9623,
27694,
6132,
3630,
4179,
3334,
22311,
4263,
1006,
19204,
1010,
13045,
1007,
1063,
2065,
1006,
19204,
1012,
8840,
2278,
1012,
2203,
1012,
2240,
1027,
1027,
1027,
13045,
1012,
8840,
2278,
1012,
2707,
1012,
2240... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/multiline-comment-style.js | isJSDoc | function isJSDoc(commentGroup) {
const lines = commentGroup[0].value.split(astUtils.LINEBREAK_MATCHER);
return commentGroup[0].type === "Block" &&
/^\*\s*$/u.test(lines[0]) &&
lines.slice(1, -1).every(line => /^\s* /u.test(line)) &&
/^\s*$/u.test(... | javascript | function isJSDoc(commentGroup) {
const lines = commentGroup[0].value.split(astUtils.LINEBREAK_MATCHER);
return commentGroup[0].type === "Block" &&
/^\*\s*$/u.test(lines[0]) &&
lines.slice(1, -1).every(line => /^\s* /u.test(line)) &&
/^\s*$/u.test(... | [
"function",
"isJSDoc",
"(",
"commentGroup",
")",
"{",
"const",
"lines",
"=",
"commentGroup",
"[",
"0",
"]",
".",
"value",
".",
"split",
"(",
"astUtils",
".",
"LINEBREAK_MATCHER",
")",
";",
"return",
"commentGroup",
"[",
"0",
"]",
".",
"type",
"===",
"\"B... | Check a comment is JSDoc form
@param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment
@returns {boolean} if commentGroup is JSDoc form, return true | [
"Check",
"a",
"comment",
"is",
"JSDoc",
"form"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/multiline-comment-style.js#L102-L109 | train | Check if comment is JSDoc | [
30522,
3853,
2003,
22578,
3527,
2278,
1006,
7615,
17058,
1007,
1063,
9530,
3367,
3210,
1027,
7615,
17058,
1031,
1014,
1033,
1012,
3643,
1012,
3975,
1006,
2004,
8525,
3775,
4877,
1012,
2240,
23890,
1035,
2674,
2121,
1007,
1025,
2709,
7615,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | bindEvent | function bindEvent ( namespacedEvent, callback ) {
scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || [];
scope_Events[namespacedEvent].push(callback);
// If the event bound is 'update,' fire it immediately for all handles.
if ( namespacedEvent.split('.')[0... | javascript | function bindEvent ( namespacedEvent, callback ) {
scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || [];
scope_Events[namespacedEvent].push(callback);
// If the event bound is 'update,' fire it immediately for all handles.
if ( namespacedEvent.split('.')[0... | [
"function",
"bindEvent",
"(",
"namespacedEvent",
",",
"callback",
")",
"{",
"scope_Events",
"[",
"namespacedEvent",
"]",
"=",
"scope_Events",
"[",
"namespacedEvent",
"]",
"||",
"[",
"]",
";",
"scope_Events",
"[",
"namespacedEvent",
"]",
".",
"push",
"(",
"call... | Attach an event to this slider, possibly including a namespace | [
"Attach",
"an",
"event",
"to",
"this",
"slider",
"possibly",
"including",
"a",
"namespace"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L2007-L2017 | train | Bind event to all handles | [
30522,
3853,
14187,
18697,
3372,
1006,
3415,
15327,
24844,
4765,
1010,
2655,
5963,
1007,
1063,
9531,
1035,
2824,
1031,
3415,
15327,
24844,
4765,
1033,
1027,
9531,
1035,
2824,
1031,
3415,
15327,
24844,
4765,
1033,
1064,
1064,
1031,
1033,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
radare/radare2 | shlr/www/d3/packages.js | function(nodes) {
var map = {},
imports = [];
// Compute a map from name to node.
nodes.forEach(function(d) {
map[d.name] = d;
});
// For each import, construct a link from the source to target node.
nodes.forEach(function(d) {
if (d.imports) d.imports.for... | javascript | function(nodes) {
var map = {},
imports = [];
// Compute a map from name to node.
nodes.forEach(function(d) {
map[d.name] = d;
});
// For each import, construct a link from the source to target node.
nodes.forEach(function(d) {
if (d.imports) d.imports.for... | [
"function",
"(",
"nodes",
")",
"{",
"var",
"map",
"=",
"{",
"}",
",",
"imports",
"=",
"[",
"]",
";",
"// Compute a map from name to node.",
"nodes",
".",
"forEach",
"(",
"function",
"(",
"d",
")",
"{",
"map",
"[",
"d",
".",
"name",
"]",
"=",
"d",
"... | Return a list of imports for the given array of nodes. | [
"Return",
"a",
"list",
"of",
"imports",
"for",
"the",
"given",
"array",
"of",
"nodes",
"."
] | bf5e3028810a0ec7c267c6fe4bfad639b4819e35 | https://github.com/radare/radare2/blob/bf5e3028810a0ec7c267c6fe4bfad639b4819e35/shlr/www/d3/packages.js#L29-L46 | train | Returns an array of imports for the given nodes | [
30522,
3853,
1006,
14164,
1007,
1063,
13075,
4949,
1027,
1063,
1065,
1010,
17589,
1027,
1031,
1033,
1025,
1013,
1013,
24134,
1037,
4949,
2013,
2171,
2000,
13045,
1012,
14164,
1012,
18921,
6776,
1006,
3853,
1006,
1040,
1007,
1063,
4949,
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... | |
websockets/ws | lib/buffer-util.js | _unmask | function _unmask(buffer, mask) {
// Required until https://github.com/nodejs/node/issues/9006 is resolved.
const length = buffer.length;
for (let i = 0; i < length; i++) {
buffer[i] ^= mask[i & 3];
}
} | javascript | function _unmask(buffer, mask) {
// Required until https://github.com/nodejs/node/issues/9006 is resolved.
const length = buffer.length;
for (let i = 0; i < length; i++) {
buffer[i] ^= mask[i & 3];
}
} | [
"function",
"_unmask",
"(",
"buffer",
",",
"mask",
")",
"{",
"// Required until https://github.com/nodejs/node/issues/9006 is resolved.",
"const",
"length",
"=",
"buffer",
".",
"length",
";",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
... | Unmasks a buffer using the given mask.
@param {Buffer} buffer The buffer to unmask
@param {Buffer} mask The mask to use
@public | [
"Unmasks",
"a",
"buffer",
"using",
"the",
"given",
"mask",
"."
] | 995c527c87d0d4833d8093c18dcfa2e4a41d9582 | https://github.com/websockets/ws/blob/995c527c87d0d4833d8093c18dcfa2e4a41d9582/lib/buffer-util.js#L52-L58 | train | Unmasks a buffer using the given mask. | [
30522,
3853,
1035,
4895,
9335,
2243,
1006,
17698,
1010,
7308,
1007,
1063,
1013,
1013,
3223,
2127,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
13045,
22578,
1013,
13045,
1013,
3314,
1013,
7706,
2575,
2003,
10395,
1012,
953... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/relay | packages/relay-compiler/util/CodeMarker.js | postProcess | function postProcess(json: string, printModule: string => string): string {
return json.replace(
/"@@MODULE_START@@(.*?)@@MODULE_END@@"/g,
(_, moduleName) => printModule(moduleName),
);
} | javascript | function postProcess(json: string, printModule: string => string): string {
return json.replace(
/"@@MODULE_START@@(.*?)@@MODULE_END@@"/g,
(_, moduleName) => printModule(moduleName),
);
} | [
"function",
"postProcess",
"(",
"json",
":",
"string",
",",
"printModule",
":",
"string",
"=",
">",
"string",
")",
":",
"string",
"{",
"return",
"json",
".",
"replace",
"(",
"/",
"\"@@MODULE_START@@(.*?)@@MODULE_END@@\"",
"/",
"g",
",",
"(",
"_",
",",
"mod... | After JSON.stringify'ing some code that contained parts marked with `mark()`,
this post-processes the JSON to convert the marked code strings to raw code.
Example:
CodeMarker.postProcess(
JSON.stringify({code: CodeMarker.mark('alert(1)')})
) | [
"After",
"JSON",
".",
"stringify",
"ing",
"some",
"code",
"that",
"contained",
"parts",
"marked",
"with",
"mark",
"()",
"this",
"post",
"-",
"processes",
"the",
"JSON",
"to",
"convert",
"the",
"marked",
"code",
"strings",
"to",
"raw",
"code",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/util/CodeMarker.js#L29-L34 | train | Post process a json string | [
30522,
3853,
2695,
21572,
9623,
2015,
1006,
1046,
3385,
1024,
5164,
1010,
6140,
5302,
8566,
2571,
1024,
5164,
1027,
1028,
5164,
1007,
1024,
5164,
1063,
2709,
1046,
3385,
1012,
5672,
1006,
1013,
1000,
1030,
1030,
11336,
1035,
2707,
1030,
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... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(textRange) {
var parentEl = textRange.parentElement();
var range = textRange.duplicate();
range.collapse(true);
var startEl = range.parentElement();
range = textRange.duplicate();
range.collapse(false);
... | javascript | function(textRange) {
var parentEl = textRange.parentElement();
var range = textRange.duplicate();
range.collapse(true);
var startEl = range.parentElement();
range = textRange.duplicate();
range.collapse(false);
... | [
"function",
"(",
"textRange",
")",
"{",
"var",
"parentEl",
"=",
"textRange",
".",
"parentElement",
"(",
")",
";",
"var",
"range",
"=",
"textRange",
".",
"duplicate",
"(",
")",
";",
"range",
".",
"collapse",
"(",
"true",
")",
";",
"var",
"startEl",
"=",... | /*
This is a workaround for a bug where IE returns the wrong container element from the TextRange's parentElement()
method. For example, in the following (where pipes denote the selection boundaries):
<ul id="ul"><li id="a">| a </li><li id="b"> b |</li></ul>
var range = document.selection.createRange();
alert(range.p... | [
"/",
"*",
"This",
"is",
"a",
"workaround",
"for",
"a",
"bug",
"where",
"IE",
"returns",
"the",
"wrong",
"container",
"element",
"from",
"the",
"TextRange",
"s",
"parentElement",
"()",
"method",
".",
"For",
"example",
"in",
"the",
"following",
"(",
"where",... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L2461-L2472 | train | Returns the parent element of the text range | [
30522,
3853,
1006,
3793,
24388,
2063,
1007,
1063,
13075,
6687,
2884,
1027,
3793,
24388,
2063,
1012,
6687,
12260,
3672,
1006,
1007,
1025,
13075,
2846,
1027,
3793,
24388,
2063,
1012,
24473,
1006,
1007,
1025,
2846,
1012,
7859,
1006,
2995,
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/base/ManagedObjectMetadata.js | Property | function Property(oClass, name, info) {
info = typeof info !== 'object' ? { type: info } : info;
this.name = name;
this.type = info.type || 'string';
this.group = info.group || 'Misc';
this.defaultValue = info.defaultValue !== null ? info.defaultValue : null;
this.bindable = !!info.bindable;
this.deprecat... | javascript | function Property(oClass, name, info) {
info = typeof info !== 'object' ? { type: info } : info;
this.name = name;
this.type = info.type || 'string';
this.group = info.group || 'Misc';
this.defaultValue = info.defaultValue !== null ? info.defaultValue : null;
this.bindable = !!info.bindable;
this.deprecat... | [
"function",
"Property",
"(",
"oClass",
",",
"name",
",",
"info",
")",
"{",
"info",
"=",
"typeof",
"info",
"!==",
"'object'",
"?",
"{",
"type",
":",
"info",
"}",
":",
"info",
";",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"type",
"=",
"i... | ---- Property --------------------------------------------------------------------------
Property info object
@private
@since 1.27.1 | [
"----",
"Property",
"--------------------------------------------------------------------------",
"Property",
"info",
"object"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ManagedObjectMetadata.js#L169-L195 | train | Constructor for a property | [
30522,
3853,
3200,
1006,
1051,
26266,
1010,
2171,
1010,
18558,
1007,
1063,
18558,
1027,
2828,
11253,
18558,
999,
1027,
1027,
1005,
4874,
1005,
1029,
1063,
2828,
1024,
18558,
1065,
1024,
18558,
1025,
2023,
1012,
2171,
1027,
2171,
1025,
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... |
adobe/brackets | src/view/MainViewManager.js | _removeFileFromMRU | function _removeFileFromMRU(paneId, file) {
var index,
compare = function (record) {
return (record.file === file && record.paneId === paneId);
};
// find and remove all instances
do {
index = _.findIndex(_mruList, compare);
if (in... | javascript | function _removeFileFromMRU(paneId, file) {
var index,
compare = function (record) {
return (record.file === file && record.paneId === paneId);
};
// find and remove all instances
do {
index = _.findIndex(_mruList, compare);
if (in... | [
"function",
"_removeFileFromMRU",
"(",
"paneId",
",",
"file",
")",
"{",
"var",
"index",
",",
"compare",
"=",
"function",
"(",
"record",
")",
"{",
"return",
"(",
"record",
".",
"file",
"===",
"file",
"&&",
"record",
".",
"paneId",
"===",
"paneId",
")",
... | Removes a file from the global MRU list. Future versions of this
implementation may support the ALL_PANES constant but FOCUS_PANE is not allowed
@param {!string} paneId - Must be a valid paneId (not a shortcut e.g. ALL_PANES)
@ @param {File} file The file object to remove.
@private | [
"Removes",
"a",
"file",
"from",
"the",
"global",
"MRU",
"list",
".",
"Future",
"versions",
"of",
"this",
"implementation",
"may",
"support",
"the",
"ALL_PANES",
"constant",
"but",
"FOCUS_PANE",
"is",
"not",
"allowed"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L781-L794 | train | Remove a file from the MRU | [
30522,
3853,
1035,
6366,
8873,
2571,
19699,
5358,
2213,
6820,
1006,
6090,
7416,
2094,
1010,
5371,
1007,
1063,
13075,
5950,
1010,
12826,
1027,
3853,
1006,
2501,
1007,
1063,
2709,
1006,
2501,
1012,
5371,
1027,
1027,
1027,
5371,
1004,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js | function (oEntityType, mChildAnnotations) {
Utils.visitChildren(oEntityType.property, mChildAnnotations, "Property");
Utils.visitChildren(oEntityType.navigationProperty, mChildAnnotations);
Utils.addSapSemantics(oEntityType);
} | javascript | function (oEntityType, mChildAnnotations) {
Utils.visitChildren(oEntityType.property, mChildAnnotations, "Property");
Utils.visitChildren(oEntityType.navigationProperty, mChildAnnotations);
Utils.addSapSemantics(oEntityType);
} | [
"function",
"(",
"oEntityType",
",",
"mChildAnnotations",
")",
"{",
"Utils",
".",
"visitChildren",
"(",
"oEntityType",
".",
"property",
",",
"mChildAnnotations",
",",
"\"Property\"",
")",
";",
"Utils",
".",
"visitChildren",
"(",
"oEntityType",
".",
"navigationProp... | Visits the given entity type and its (structural or navigation) properties.
@param {object} oEntityType
the entity type
@param {object} mChildAnnotations
map from child name (or role) to annotations | [
"Visits",
"the",
"given",
"entity",
"type",
"and",
"its",
"(",
"structural",
"or",
"navigation",
")",
"properties",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L1061-L1065 | train | visit the entity type | [
30522,
3853,
1006,
1051,
4765,
3012,
13874,
1010,
11338,
19466,
7847,
17048,
10708,
1007,
1063,
21183,
12146,
1012,
3942,
19339,
7389,
1006,
1051,
4765,
3012,
13874,
1012,
3200,
1010,
11338,
19466,
7847,
17048,
10708,
1010,
1000,
3200,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
airyland/vux | src/components/orientation/orientation.js | function (cfg) {
this._cfg = merge({
delay: 400
}, cfg)
// 事件订阅数组
this._subs = {
on: [],
after: []
}
// 当前信息
this.info = this.getInfo()
// 绑定事件回调上下文
this._onWinOrientationChange = bind(this._onWinOrientationChange, this)
// 绑定窗口切换事件
window.addEventListen... | javascript | function (cfg) {
this._cfg = merge({
delay: 400
}, cfg)
// 事件订阅数组
this._subs = {
on: [],
after: []
}
// 当前信息
this.info = this.getInfo()
// 绑定事件回调上下文
this._onWinOrientationChange = bind(this._onWinOrientationChange, this)
// 绑定窗口切换事件
window.addEventListen... | [
"function",
"(",
"cfg",
")",
"{",
"this",
".",
"_cfg",
"=",
"merge",
"(",
"{",
"delay",
":",
"400",
"}",
",",
"cfg",
")",
"// 事件订阅数组",
"this",
".",
"_subs",
"=",
"{",
"on",
":",
"[",
"]",
",",
"after",
":",
"[",
"]",
"}",
"// 当前信息",
"this",
"... | 初始化
@method init
@public | [
"初始化"
] | 484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6 | https://github.com/airyland/vux/blob/484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6/src/components/orientation/orientation.js#L79-L98 | train | Initialize the
| [
30522,
3853,
1006,
12935,
2290,
1007,
1063,
2023,
1012,
1035,
12935,
2290,
1027,
13590,
1006,
1063,
8536,
1024,
4278,
1065,
1010,
12935,
2290,
1007,
1013,
1013,
30524,
100,
1822,
1751,
100,
100,
100,
1742,
1743,
1861,
2023,
1012,
1035,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
google/closure-library | closure/goog/html/cssspecificity.js | getSpecificity | function getSpecificity(selector) {
if (userAgentProduct.IE && !userAgent.isVersionOrHigher(9)) {
// IE8 has buggy regex support.
return [0, 0, 0, 0];
}
var specificity = specificityCache.hasOwnProperty(selector) ?
specificityCache[selector] :
null;
if (specificity) {
return specificity;... | javascript | function getSpecificity(selector) {
if (userAgentProduct.IE && !userAgent.isVersionOrHigher(9)) {
// IE8 has buggy regex support.
return [0, 0, 0, 0];
}
var specificity = specificityCache.hasOwnProperty(selector) ?
specificityCache[selector] :
null;
if (specificity) {
return specificity;... | [
"function",
"getSpecificity",
"(",
"selector",
")",
"{",
"if",
"(",
"userAgentProduct",
".",
"IE",
"&&",
"!",
"userAgent",
".",
"isVersionOrHigher",
"(",
"9",
")",
")",
"{",
"// IE8 has buggy regex support.",
"return",
"[",
"0",
",",
"0",
",",
"0",
",",
"0... | Calculates the specificity of CSS selectors, using a global cache if
supported.
@see http://www.w3.org/TR/css3-selectors/#specificity
@see https://specificity.keegan.st/
@param {string} selector The CSS selector.
@return {!Array<number>} The CSS specificity.
@supported IE9+, other browsers. | [
"Calculates",
"the",
"specificity",
"of",
"CSS",
"selectors",
"using",
"a",
"global",
"cache",
"if",
"supported",
"."
] | 97390e9ca4483cebb9628e06026139fbb3023d65 | https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/closure/goog/html/cssspecificity.js#L39-L58 | train | Returns the specificity of a selector. | [
30522,
3853,
4152,
5051,
6895,
8873,
12972,
1006,
27000,
1007,
1063,
2065,
1006,
5310,
4270,
3372,
21572,
8566,
6593,
1012,
29464,
1004,
1004,
999,
5310,
4270,
3372,
1012,
2003,
27774,
2953,
4048,
5603,
2121,
1006,
1023,
1007,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/view/MainViewManager.js | setLayoutScheme | function setLayoutScheme(rows, columns) {
if ((rows < 1) || (rows > 2) || (columns < 1) || (columns > 2) || (columns === 2 && rows === 2)) {
console.error("setLayoutScheme unsupported layout " + rows + ", " + columns);
return false;
}
if (rows === columns) {
... | javascript | function setLayoutScheme(rows, columns) {
if ((rows < 1) || (rows > 2) || (columns < 1) || (columns > 2) || (columns === 2 && rows === 2)) {
console.error("setLayoutScheme unsupported layout " + rows + ", " + columns);
return false;
}
if (rows === columns) {
... | [
"function",
"setLayoutScheme",
"(",
"rows",
",",
"columns",
")",
"{",
"if",
"(",
"(",
"rows",
"<",
"1",
")",
"||",
"(",
"rows",
">",
"2",
")",
"||",
"(",
"columns",
"<",
"1",
")",
"||",
"(",
"columns",
">",
"2",
")",
"||",
"(",
"columns",
"==="... | Changes the layout scheme
@param {!number} rows (may be 1 or 2)
@param {!number} columns (may be 1 or 2)
@summay Rows or Columns may be 1 or 2 but both cannot be 2. 1x2, 2x1 or 1x1 are the legal values | [
"Changes",
"the",
"layout",
"scheme"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1647-L1661 | train | set layout scheme | [
30522,
3853,
2275,
8485,
12166,
5403,
4168,
1006,
10281,
1010,
7753,
1007,
1063,
2065,
1006,
1006,
10281,
1026,
1015,
1007,
1064,
1064,
1006,
10281,
1028,
1016,
1007,
1064,
1064,
1006,
7753,
1026,
1015,
1007,
1064,
1064,
1006,
7753,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/node/optparse.js | OptionParser | function OptionParser() {
/** @type {string} */
var usage = OptionParser.DEFAULT_USAGE;
/** @type {boolean} */
var mustParse = true;
/** @type {!Object.<*>} */
var parsedOptions = {};
/** @type {!Array.<string>} */
var extraArgs = [];
/**
* Sets the usage string. All occurences of "$0" will be... | javascript | function OptionParser() {
/** @type {string} */
var usage = OptionParser.DEFAULT_USAGE;
/** @type {boolean} */
var mustParse = true;
/** @type {!Object.<*>} */
var parsedOptions = {};
/** @type {!Array.<string>} */
var extraArgs = [];
/**
* Sets the usage string. All occurences of "$0" will be... | [
"function",
"OptionParser",
"(",
")",
"{",
"/** @type {string} */",
"var",
"usage",
"=",
"OptionParser",
".",
"DEFAULT_USAGE",
";",
"/** @type {boolean} */",
"var",
"mustParse",
"=",
"true",
";",
"/** @type {!Object.<*>} */",
"var",
"parsedOptions",
"=",
"{",
"}",
"... | A command line option parser. Will automatically parse the command line
arguments to this program upon accessing the {@code options} or {@code argv}
properies. The command line will only be re-parsed if this parser's
configuration has changed since the last access.
@constructor | [
"A",
"command",
"line",
"option",
"parser",
".",
"Will",
"automatically",
"parse",
"the",
"command",
"line",
"arguments",
"to",
"this",
"program",
"upon",
"accessing",
"the",
"{"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/optparse.js#L254-L509 | train | The option parser. | [
30522,
3853,
5724,
19362,
8043,
1006,
1007,
1063,
1013,
1008,
1008,
1030,
2828,
1063,
5164,
1065,
1008,
1013,
13075,
8192,
1027,
5724,
19362,
8043,
1012,
12398,
1035,
8192,
1025,
1013,
1008,
1008,
1030,
2828,
1063,
22017,
20898,
1065,
1008,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js | sanitize | function sanitize(inputHtml, opt_naiveUriRewriter, opt_nmTokenPolicy) {
var tagPolicy = makeTagPolicy(opt_naiveUriRewriter, opt_nmTokenPolicy);
return sanitizeWithPolicy(inputHtml, tagPolicy);
} | javascript | function sanitize(inputHtml, opt_naiveUriRewriter, opt_nmTokenPolicy) {
var tagPolicy = makeTagPolicy(opt_naiveUriRewriter, opt_nmTokenPolicy);
return sanitizeWithPolicy(inputHtml, tagPolicy);
} | [
"function",
"sanitize",
"(",
"inputHtml",
",",
"opt_naiveUriRewriter",
",",
"opt_nmTokenPolicy",
")",
"{",
"var",
"tagPolicy",
"=",
"makeTagPolicy",
"(",
"opt_naiveUriRewriter",
",",
"opt_nmTokenPolicy",
")",
";",
"return",
"sanitizeWithPolicy",
"(",
"inputHtml",
",",... | Strips unsafe tags and attributes from HTML.
@param {string} inputHtml The HTML to sanitize.
@param {?function(?string): ?string} opt_naiveUriRewriter A transform to
apply to URI attributes. If not given, URI attributes are deleted.
@param {function(?string): ?string} opt_nmTokenPolicy A transform to apply
to attribut... | [
"Strips",
"unsafe",
"tags",
"and",
"attributes",
"from",
"HTML",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js#L3552-L3555 | train | Sanitize the input html using the given NMTokenRewriter and NMTokenPolicy. | [
30522,
3853,
2624,
25090,
4371,
1006,
7953,
11039,
19968,
1010,
23569,
1035,
15743,
9496,
15603,
17625,
2099,
1010,
23569,
1035,
13221,
18715,
2368,
18155,
2594,
2100,
1007,
1063,
13075,
6415,
18155,
2594,
2100,
1027,
2191,
15900,
18155,
2594... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js | function (oModules) {
var oHierarchy = {},
oTree = {
text: "All"
},
iSelectionDepth;
this.modulesToHierarchy(oModules, oHierarchy);
iSelectionDepth = this.setTreeNode(oHierarchy, oTree, 0, window["sap-ui-debug"] === true);
if (!iSelectionDepth) {
iSelectionDepth = 0;
}
return {... | javascript | function (oModules) {
var oHierarchy = {},
oTree = {
text: "All"
},
iSelectionDepth;
this.modulesToHierarchy(oModules, oHierarchy);
iSelectionDepth = this.setTreeNode(oHierarchy, oTree, 0, window["sap-ui-debug"] === true);
if (!iSelectionDepth) {
iSelectionDepth = 0;
}
return {... | [
"function",
"(",
"oModules",
")",
"{",
"var",
"oHierarchy",
"=",
"{",
"}",
",",
"oTree",
"=",
"{",
"text",
":",
"\"All\"",
"}",
",",
"iSelectionDepth",
";",
"this",
".",
"modulesToHierarchy",
"(",
"oModules",
",",
"oHierarchy",
")",
";",
"iSelectionDepth",... | Converts a module hierarchy to a bindable tree model structure
The returning object contains the tree structure and depth of the deepest selected node
@param {object} oModules Flat object of modules
@return {{tree: {text: string}, depth: number}} The resulting tree and the depth | [
"Converts",
"a",
"module",
"hierarchy",
"to",
"a",
"bindable",
"tree",
"model",
"structure",
"The",
"returning",
"object",
"contains",
"the",
"tree",
"structure",
"and",
"depth",
"of",
"the",
"deepest",
"selected",
"node"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L119-L137 | train | Creates a tree structure for the modules | [
30522,
3853,
1006,
18168,
7716,
16308,
1007,
1063,
13075,
2821,
3771,
2906,
11714,
1027,
1063,
1065,
1010,
27178,
9910,
1027,
1063,
3793,
1024,
1000,
2035,
1000,
1065,
1010,
2003,
12260,
7542,
3207,
13876,
2232,
1025,
2023,
1012,
14184,
340... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/project/FileTreeView.js | function (e) {
this.props.actions.setRenameValue(this.props.parentPath + this.refs.name.value.trim());
if (e.keyCode !== KeyEvent.DOM_VK_LEFT &&
e.keyCode !== KeyEvent.DOM_VK_RIGHT) {
// update the width of the input field
var node = this.refs... | javascript | function (e) {
this.props.actions.setRenameValue(this.props.parentPath + this.refs.name.value.trim());
if (e.keyCode !== KeyEvent.DOM_VK_LEFT &&
e.keyCode !== KeyEvent.DOM_VK_RIGHT) {
// update the width of the input field
var node = this.refs... | [
"function",
"(",
"e",
")",
"{",
"this",
".",
"props",
".",
"actions",
".",
"setRenameValue",
"(",
"this",
".",
"props",
".",
"parentPath",
"+",
"this",
".",
"refs",
".",
"name",
".",
"value",
".",
"trim",
"(",
")",
")",
";",
"if",
"(",
"e",
".",
... | The rename or create operation can be completed or canceled by actions outside of
this component, so we keep the model up to date by sending every update via an action. | [
"The",
"rename",
"or",
"create",
"operation",
"can",
"be",
"completed",
"or",
"canceled",
"by",
"actions",
"outside",
"of",
"this",
"component",
"so",
"we",
"keep",
"the",
"model",
"up",
"to",
"date",
"by",
"sending",
"every",
"update",
"via",
"an",
"actio... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L187-L197 | train | on keydown | [
30522,
3853,
1006,
1041,
1007,
1063,
2023,
1012,
24387,
1012,
4506,
1012,
2275,
7389,
14074,
10175,
5657,
1006,
2023,
1012,
24387,
1012,
6687,
15069,
1009,
2023,
1012,
25416,
2015,
1012,
2171,
1012,
3643,
1012,
12241,
1006,
1007,
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... | |
ReactTraining/react-router | packages/react-router-native/examples/RouteConfig.js | RouteWithSubRoutes | function RouteWithSubRoutes(route) {
return (
<Route
path={route.path}
render={props => (
// pass the sub-routes down to keep nesting
<route.component {...props} routes={route.routes} />
)}
/>
);
} | javascript | function RouteWithSubRoutes(route) {
return (
<Route
path={route.path}
render={props => (
// pass the sub-routes down to keep nesting
<route.component {...props} routes={route.routes} />
)}
/>
);
} | [
"function",
"RouteWithSubRoutes",
"(",
"route",
")",
"{",
"return",
"(",
"<",
"Route",
"path",
"=",
"{",
"route",
".",
"path",
"}",
"render",
"=",
"{",
"props",
"=>",
"(",
"// pass the sub-routes down to keep nesting",
"<",
"route",
".",
"component",
"{",
".... | wrap <Route> and use this everywhere instead, then when sub routes are added to any route it'll work | [
"wrap",
"<Route",
">",
"and",
"use",
"this",
"everywhere",
"instead",
"then",
"when",
"sub",
"routes",
"are",
"added",
"to",
"any",
"route",
"it",
"ll",
"work"
] | 82ce94c3b4e74f71018d104df6dc999801fa9ab2 | https://github.com/ReactTraining/react-router/blob/82ce94c3b4e74f71018d104df6dc999801fa9ab2/packages/react-router-native/examples/RouteConfig.js#L73-L83 | train | RouteWithSubRoutes - returns a Route with sub - routes | [
30522,
3853,
2799,
24415,
6342,
12618,
10421,
2015,
1006,
2799,
1007,
1063,
2709,
1006,
1026,
2799,
4130,
1027,
1063,
2799,
1012,
4130,
1065,
17552,
1027,
1063,
24387,
1027,
1028,
1006,
1013,
1013,
3413,
1996,
4942,
1011,
5847,
2091,
2000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/utils/command.js | spawnCmd | function spawnCmd(command, args, options) {
var d = Promise.defer();
var child = spawn(command, args, options);
child.on('error', function(error) {
return d.reject(error);
});
child.stdout.on('data', function (data) {
d.notify(data);
});
child.stderr.on('data', function (d... | javascript | function spawnCmd(command, args, options) {
var d = Promise.defer();
var child = spawn(command, args, options);
child.on('error', function(error) {
return d.reject(error);
});
child.stdout.on('data', function (data) {
d.notify(data);
});
child.stderr.on('data', function (d... | [
"function",
"spawnCmd",
"(",
"command",
",",
"args",
",",
"options",
")",
"{",
"var",
"d",
"=",
"Promise",
".",
"defer",
"(",
")",
";",
"var",
"child",
"=",
"spawn",
"(",
"command",
",",
"args",
",",
"options",
")",
";",
"child",
".",
"on",
"(",
... | Spawn an executable
@param {String} command
@param {Array} args
@param {Object} options
@return {Promise} | [
"Spawn",
"an",
"executable"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/command.js#L44-L69 | train | Spawns a child process | [
30522,
3853,
25645,
27487,
2094,
1006,
3094,
1010,
12098,
5620,
1010,
7047,
1007,
1063,
13075,
1040,
1027,
4872,
1012,
13366,
2121,
1006,
1007,
1025,
13075,
2775,
1027,
25645,
1006,
3094,
1010,
12098,
5620,
1010,
7047,
1007,
1025,
2775,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jiahaog/nativefier | src/build/buildApp.js | selectAppArgs | function selectAppArgs(options) {
return {
name: options.name,
targetUrl: options.targetUrl,
counter: options.counter,
bounce: options.bounce,
width: options.width,
height: options.height,
minWidth: options.minWidth,
minHeight: options.minHeight,
maxWidth: options.maxWidth,
max... | javascript | function selectAppArgs(options) {
return {
name: options.name,
targetUrl: options.targetUrl,
counter: options.counter,
bounce: options.bounce,
width: options.width,
height: options.height,
minWidth: options.minWidth,
minHeight: options.minHeight,
maxWidth: options.maxWidth,
max... | [
"function",
"selectAppArgs",
"(",
"options",
")",
"{",
"return",
"{",
"name",
":",
"options",
".",
"name",
",",
"targetUrl",
":",
"options",
".",
"targetUrl",
",",
"counter",
":",
"options",
".",
"counter",
",",
"bounce",
":",
"options",
".",
"bounce",
"... | Only picks certain app args to pass to nativefier.json
@param options | [
"Only",
"picks",
"certain",
"app",
"args",
"to",
"pass",
"to",
"nativefier",
".",
"json"
] | b959956a38ce51a9dd95d42308f0a6c66489b624 | https://github.com/jiahaog/nativefier/blob/b959956a38ce51a9dd95d42308f0a6c66489b624/src/build/buildApp.js#L13-L62 | train | Select App Arguments | [
30522,
3853,
7276,
29098,
2906,
5620,
1006,
7047,
1007,
1063,
2709,
1063,
2171,
1024,
7047,
1012,
2171,
1010,
4539,
3126,
2140,
1024,
7047,
1012,
4539,
3126,
2140,
1010,
4675,
1024,
7047,
1012,
4675,
1010,
17523,
1024,
7047,
1012,
17523,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/Flot/examples/axes-time-zones/date.js | getRule | function getRule(dt, zone, isUTC) {
var date = typeof dt === 'number' ? new Date(dt) : dt;
var ruleset = zone[1];
var basicOffset = zone[0];
//Convert a date to UTC. Depending on the 'type' parameter, the date
// parameter may be:
//
// - `u`, `g`, `z`: already UTC (no adjustm... | javascript | function getRule(dt, zone, isUTC) {
var date = typeof dt === 'number' ? new Date(dt) : dt;
var ruleset = zone[1];
var basicOffset = zone[0];
//Convert a date to UTC. Depending on the 'type' parameter, the date
// parameter may be:
//
// - `u`, `g`, `z`: already UTC (no adjustm... | [
"function",
"getRule",
"(",
"dt",
",",
"zone",
",",
"isUTC",
")",
"{",
"var",
"date",
"=",
"typeof",
"dt",
"===",
"'number'",
"?",
"new",
"Date",
"(",
"dt",
")",
":",
"dt",
";",
"var",
"ruleset",
"=",
"zone",
"[",
"1",
"]",
";",
"var",
"basicOffs... | if isUTC is true, date is given in UTC, otherwise it's given in local time (ie. date.getUTC*() returns local time components) | [
"if",
"isUTC",
"is",
"true",
"date",
"is",
"given",
"in",
"UTC",
"otherwise",
"it",
"s",
"given",
"in",
"local",
"time",
"(",
"ie",
".",
"date",
".",
"getUTC",
"*",
"()",
"returns",
"local",
"time",
"components",
")"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/Flot/examples/axes-time-zones/date.js#L519-L701 | train | Returns the rule for the given date and time zone. | [
30522,
3853,
2131,
6820,
2571,
1006,
26718,
1010,
4224,
1010,
2003,
4904,
2278,
1007,
1063,
13075,
3058,
1027,
2828,
11253,
26718,
1027,
1027,
1027,
1005,
2193,
1005,
1029,
2047,
3058,
1006,
26718,
1007,
1024,
26718,
1025,
13075,
3513,
3388... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GoogleChromeLabs/quicklink | demos/network-idle.js | handleMessage | function handleMessage(event) {
if (!event.data) {
return;
}
switch (event.data) {
case 'NETWORK_IDLE_ENQUIRY_RESULT_IDLE':
case 'NETWORK_IDLE_CALLBACK':
networkIdleCallback.__callbacks__.forEach(callback => {
networkIdleCallback.__popCallback__(callback, false);
});
break;
... | javascript | function handleMessage(event) {
if (!event.data) {
return;
}
switch (event.data) {
case 'NETWORK_IDLE_ENQUIRY_RESULT_IDLE':
case 'NETWORK_IDLE_CALLBACK':
networkIdleCallback.__callbacks__.forEach(callback => {
networkIdleCallback.__popCallback__(callback, false);
});
break;
... | [
"function",
"handleMessage",
"(",
"event",
")",
"{",
"if",
"(",
"!",
"event",
".",
"data",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"event",
".",
"data",
")",
"{",
"case",
"'NETWORK_IDLE_ENQUIRY_RESULT_IDLE'",
":",
"case",
"'NETWORK_IDLE_CALLBACK'",
":",... | Handle message passing
@param {*} event - A valid event | [
"Handle",
"message",
"passing"
] | f91f5c51964fc8e19ce136c52967f7ccd9179726 | https://github.com/GoogleChromeLabs/quicklink/blob/f91f5c51964fc8e19ce136c52967f7ccd9179726/demos/network-idle.js#L93-L106 | train | Handle a message from the network | [
30522,
3853,
5047,
7834,
3736,
3351,
1006,
2724,
1007,
1063,
2065,
1006,
999,
2724,
1012,
2951,
1007,
1063,
2709,
1025,
1065,
6942,
1006,
2724,
1012,
2951,
1007,
1063,
2553,
1005,
2897,
1035,
18373,
1035,
4372,
15549,
2854,
1035,
2765,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
react-bootstrap/react-bootstrap | src/utils/ElementChildren.js | forEach | function forEach(children, func) {
let index = 0;
React.Children.forEach(children, child => {
if (React.isValidElement(child)) func(child, index++);
});
} | javascript | function forEach(children, func) {
let index = 0;
React.Children.forEach(children, child => {
if (React.isValidElement(child)) func(child, index++);
});
} | [
"function",
"forEach",
"(",
"children",
",",
"func",
")",
"{",
"let",
"index",
"=",
"0",
";",
"React",
".",
"Children",
".",
"forEach",
"(",
"children",
",",
"child",
"=>",
"{",
"if",
"(",
"React",
".",
"isValidElement",
"(",
"child",
")",
")",
"func... | Iterates through children that are "valid elements".
The provided forEachFunc(child, index) will be called for each
leaf child with the index reflecting the position relative to "valid components". | [
"Iterates",
"through",
"children",
"that",
"are",
"valid",
"elements",
"."
] | f0dc81f91ae90eb54bd1e4c04fa9419872d347dc | https://github.com/react-bootstrap/react-bootstrap/blob/f0dc81f91ae90eb54bd1e4c04fa9419872d347dc/src/utils/ElementChildren.js#L25-L30 | train | Iterate over children | [
30522,
3853,
18921,
6776,
1006,
2336,
1010,
4569,
2278,
1007,
1063,
2292,
5950,
1027,
1014,
1025,
10509,
1012,
2336,
1012,
18921,
6776,
1006,
2336,
1010,
2775,
1027,
1028,
1063,
2065,
1006,
10509,
1012,
2003,
10175,
5178,
16930,
4765,
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... |
dimsemenov/PhotoSwipe | src/js/gestures.js | function(touch, p) {
p.x = touch.pageX;
p.y = touch.pageY;
p.id = touch.identifier;
return p;
} | javascript | function(touch, p) {
p.x = touch.pageX;
p.y = touch.pageY;
p.id = touch.identifier;
return p;
} | [
"function",
"(",
"touch",
",",
"p",
")",
"{",
"p",
".",
"x",
"=",
"touch",
".",
"pageX",
";",
"p",
".",
"y",
"=",
"touch",
".",
"pageY",
";",
"p",
".",
"id",
"=",
"touch",
".",
"identifier",
";",
"return",
"p",
";",
"}"
] | amount of pixels to drag to determine direction of swipe | [
"amount",
"of",
"pixels",
"to",
"drag",
"to",
"determine",
"direction",
"of",
"swipe"
] | 80607e12542a1a54ecefa837649e862b35dffd25 | https://github.com/dimsemenov/PhotoSwipe/blob/80607e12542a1a54ecefa837649e862b35dffd25/src/js/gestures.js#L106-L111 | train | touch event handler | [
30522,
3853,
1006,
3543,
1010,
1052,
1007,
1063,
1052,
1012,
1060,
1027,
3543,
1012,
3931,
2595,
1025,
1052,
1012,
1061,
1027,
3543,
1012,
3931,
2100,
1025,
1052,
1012,
8909,
1027,
3543,
1012,
8909,
4765,
18095,
1025,
2709,
1052,
1025,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.