repo stringclasses 195
values | path stringlengths 4 99 | func_name stringlengths 0 41 | original_string stringlengths 72 56.1k | language stringclasses 1
value | code stringlengths 72 56.1k | code_tokens listlengths 25 8.12k | docstring stringlengths 2 12.5k | docstring_tokens listlengths 1 449 | sha stringclasses 197
values | url stringlengths 88 186 | partition stringclasses 1
value | summary stringlengths 8 338 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aframevr/aframe | examples/showcase/link-traversal/js/components/aframe-tooltip-component.js | setPos | function setPos(id, x, y) {
pos[3 * id] = x;
pos[3 * id + 1] = y;
} | javascript | function setPos(id, x, y) {
pos[3 * id] = x;
pos[3 * id + 1] = y;
} | [
"function",
"setPos",
"(",
"id",
",",
"x",
",",
"y",
")",
"{",
"pos",
"[",
"3",
"*",
"id",
"]",
"=",
"x",
";",
"pos",
"[",
"3",
"*",
"id",
"+",
"1",
"]",
"=",
"y",
";",
"}"
] | /*
0--1------------------------------2--3
| | | |
4--5------------------------------6--7
| | | |
| | | |
| | | |
8--9-----------------------------10--11
| | | |
12-1... | [
"/",
"*",
"0",
"--",
"1",
"------------------------------",
"2",
"--",
"3",
"|",
"|",
"|",
"|",
"4",
"--",
"5",
"------------------------------",
"6",
"--",
"7",
"|",
"|",
"|",
"|",
"|",
"|",
"|",
"|",
"|",
"|",
"|",
"|",
"8",
"--",
"9",
"-------... | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/examples/showcase/link-traversal/js/components/aframe-tooltip-component.js#L242-L245 | train | set the position of the entry at the given index | [
30522,
3853,
2275,
6873,
2015,
1006,
8909,
1010,
1060,
1010,
1061,
1007,
1063,
13433,
2015,
1031,
1017,
1008,
8909,
1033,
1027,
1060,
1025,
13433,
2015,
1031,
1017,
1008,
8909,
1009,
1015,
1033,
1027,
1061,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/ion.rangeSlider/js/ion.rangeSlider.js | function (value, no_min) {
var diapason = this.options.max - this.options.min,
one_percent = diapason / 100,
val, percent;
if (!diapason) {
this.no_diapason = true;
return 0;
}
if (no_min) {
... | javascript | function (value, no_min) {
var diapason = this.options.max - this.options.min,
one_percent = diapason / 100,
val, percent;
if (!diapason) {
this.no_diapason = true;
return 0;
}
if (no_min) {
... | [
"function",
"(",
"value",
",",
"no_min",
")",
"{",
"var",
"diapason",
"=",
"this",
".",
"options",
".",
"max",
"-",
"this",
".",
"options",
".",
"min",
",",
"one_percent",
"=",
"diapason",
"/",
"100",
",",
"val",
",",
"percent",
";",
"if",
"(",
"!"... | Convert real value to percent
@param value {Number} X in real
@param no_min {boolean=} don't use min value
@returns {Number} X in percent | [
"Convert",
"real",
"value",
"to",
"percent"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/ion.rangeSlider/js/ion.rangeSlider.js#L1743-L1762 | train | cargar diapason | [
30522,
3853,
1006,
3643,
1010,
2053,
1035,
8117,
1007,
1063,
13075,
22939,
19707,
2239,
1027,
2023,
1012,
7047,
1012,
4098,
1011,
2023,
1012,
7047,
1012,
8117,
1010,
2028,
1035,
3867,
1027,
22939,
19707,
2239,
1013,
2531,
1010,
11748,
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... | |
graphql/graphql-js | src/type/scalars.js | serializeObject | function serializeObject(value: mixed): mixed {
if (typeof value === 'object' && value !== null) {
if (typeof value.valueOf === 'function') {
const valueOfResult = value.valueOf();
if (typeof valueOfResult !== 'object') {
return valueOfResult;
}
}
if (typeof value.toJSON === 'fun... | javascript | function serializeObject(value: mixed): mixed {
if (typeof value === 'object' && value !== null) {
if (typeof value.valueOf === 'function') {
const valueOfResult = value.valueOf();
if (typeof valueOfResult !== 'object') {
return valueOfResult;
}
}
if (typeof value.toJSON === 'fun... | [
"function",
"serializeObject",
"(",
"value",
":",
"mixed",
")",
":",
"mixed",
"{",
"if",
"(",
"typeof",
"value",
"===",
"'object'",
"&&",
"value",
"!==",
"null",
")",
"{",
"if",
"(",
"typeof",
"value",
".",
"valueOf",
"===",
"'function'",
")",
"{",
"co... | Support serializing objects with custom valueOf() or toJSON() functions - a common way to represent a complex value which can be represented as a string (ex: MongoDB id objects). | [
"Support",
"serializing",
"objects",
"with",
"custom",
"valueOf",
"()",
"or",
"toJSON",
"()",
"functions",
"-",
"a",
"common",
"way",
"to",
"represent",
"a",
"complex",
"value",
"which",
"can",
"be",
"represented",
"as",
"a",
"string",
"(",
"ex",
":",
"Mon... | b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef | https://github.com/graphql/graphql-js/blob/b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef/src/type/scalars.js#L123-L137 | train | Serialize an object | [
30522,
3853,
7642,
4697,
16429,
20614,
1006,
3643,
1024,
3816,
1007,
1024,
3816,
1063,
2065,
1006,
2828,
11253,
3643,
1027,
1027,
1027,
1005,
4874,
1005,
1004,
1004,
3643,
999,
1027,
1027,
19701,
1007,
1063,
2065,
1006,
2828,
11253,
3643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | withMetadata | function withMetadata (withMetadata) {
this.options.withMetadata = is.bool(withMetadata) ? withMetadata : true;
if (is.object(withMetadata)) {
if (is.defined(withMetadata.orientation)) {
if (is.integer(withMetadata.orientation) && is.inRange(withMetadata.orientation, 1, 8)) {
this.options.withMeta... | javascript | function withMetadata (withMetadata) {
this.options.withMetadata = is.bool(withMetadata) ? withMetadata : true;
if (is.object(withMetadata)) {
if (is.defined(withMetadata.orientation)) {
if (is.integer(withMetadata.orientation) && is.inRange(withMetadata.orientation, 1, 8)) {
this.options.withMeta... | [
"function",
"withMetadata",
"(",
"withMetadata",
")",
"{",
"this",
".",
"options",
".",
"withMetadata",
"=",
"is",
".",
"bool",
"(",
"withMetadata",
")",
"?",
"withMetadata",
":",
"true",
";",
"if",
"(",
"is",
".",
"object",
"(",
"withMetadata",
")",
")"... | Include all metadata (EXIF, XMP, IPTC) from the input image in the output image.
The default behaviour, when `withMetadata` is not used, is to strip all metadata and convert to the device-independent sRGB colour space.
This will also convert to and add a web-friendly sRGB ICC profile.
@example
sharp('input.jpg')
.with... | [
"Include",
"all",
"metadata",
"(",
"EXIF",
"XMP",
"IPTC",
")",
"from",
"the",
"input",
"image",
"in",
"the",
"output",
"image",
".",
"The",
"default",
"behaviour",
"when",
"withMetadata",
"is",
"not",
"used",
"is",
"to",
"strip",
"all",
"metadata",
"and",
... | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/output.js#L117-L129 | train | Sets the metadata for the resource | [
30522,
3853,
2007,
11368,
8447,
2696,
1006,
2007,
11368,
8447,
2696,
1007,
1063,
2023,
1012,
7047,
1012,
2007,
11368,
8447,
2696,
1027,
2003,
1012,
22017,
2140,
1006,
2007,
11368,
8447,
2696,
1007,
1029,
2007,
11368,
8447,
2696,
1024,
2995,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/RecentProjects/main.js | cleanupDropdown | function cleanupDropdown() {
$("html").off("click", closeDropdown);
$("#project-files-container").off("scroll", closeDropdown);
$("#titlebar .nav").off("click", closeDropdown);
$dropdown = null;
MainViewManager.focusActivePane();
$(window).off("keydown", keydownHook);
... | javascript | function cleanupDropdown() {
$("html").off("click", closeDropdown);
$("#project-files-container").off("scroll", closeDropdown);
$("#titlebar .nav").off("click", closeDropdown);
$dropdown = null;
MainViewManager.focusActivePane();
$(window).off("keydown", keydownHook);
... | [
"function",
"cleanupDropdown",
"(",
")",
"{",
"$",
"(",
"\"html\"",
")",
".",
"off",
"(",
"\"click\"",
",",
"closeDropdown",
")",
";",
"$",
"(",
"\"#project-files-container\"",
")",
".",
"off",
"(",
"\"scroll\"",
",",
"closeDropdown",
")",
";",
"$",
"(",
... | Remove the various event handlers that close the dropdown. This is called by the
PopUpManager when the dropdown is closed. | [
"Remove",
"the",
"various",
"event",
"handlers",
"that",
"close",
"the",
"dropdown",
".",
"This",
"is",
"called",
"by",
"the",
"PopUpManager",
"when",
"the",
"dropdown",
"is",
"closed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L262-L271 | train | Removes the dropdown events | [
30522,
3853,
27686,
25711,
7698,
1006,
1007,
1063,
1002,
1006,
1000,
16129,
1000,
1007,
1012,
2125,
1006,
1000,
11562,
1000,
1010,
2701,
18981,
7698,
1007,
1025,
1002,
1006,
1000,
1001,
2622,
1011,
6764,
1011,
11661,
1000,
1007,
1012,
2125,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/addons.js | addonsManager_getAddonLink | function addonsManager_getAddonLink(aSpec) {
var spec = aSpec || { };
var addon = spec.addon;
var link = spec.link;
if (!link)
throw new Error(arguments.callee.name + ": Link not specified.");
return this.getAddonChildElement({addon: addon, type: link + "Link"});
} | javascript | function addonsManager_getAddonLink(aSpec) {
var spec = aSpec || { };
var addon = spec.addon;
var link = spec.link;
if (!link)
throw new Error(arguments.callee.name + ": Link not specified.");
return this.getAddonChildElement({addon: addon, type: link + "Link"});
} | [
"function",
"addonsManager_getAddonLink",
"(",
"aSpec",
")",
"{",
"var",
"spec",
"=",
"aSpec",
"||",
"{",
"}",
";",
"var",
"addon",
"=",
"spec",
".",
"addon",
";",
"var",
"link",
"=",
"spec",
".",
"link",
";",
"if",
"(",
"!",
"link",
")",
"throw",
... | Returns the element of the specified add-ons link
@param {object} aSpec
Information on which add-on to operate on
Elements: addon - Add-on element
link - Link
List view (more, restart, undo)
Detail view (findUpdates, restart, undo)
@return Add-on link
@type {ElemBase} | [
"Returns",
"the",
"element",
"of",
"the",
"specified",
"add",
"-",
"ons",
"link"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/addons.js#L484-L493 | train | Get the link element of an addon | [
30522,
3853,
5587,
5644,
24805,
4590,
1035,
2131,
4215,
5280,
13767,
1006,
2004,
5051,
2278,
1007,
1063,
13075,
28699,
1027,
2004,
5051,
2278,
1064,
1064,
1063,
1065,
1025,
13075,
5587,
2239,
1027,
28699,
1012,
5587,
2239,
1025,
30524,
7561... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/languageTools/LanguageClient/NodeToBracketsInterface.js | NodeToBracketsInterface | function NodeToBracketsInterface(domainManager, domainName) {
this.domainManager = domainManager;
this.domainName = domainName;
this.nodeFn = {};
this._registerDataEvents(domainManager, domainName);
} | javascript | function NodeToBracketsInterface(domainManager, domainName) {
this.domainManager = domainManager;
this.domainName = domainName;
this.nodeFn = {};
this._registerDataEvents(domainManager, domainName);
} | [
"function",
"NodeToBracketsInterface",
"(",
"domainManager",
",",
"domainName",
")",
"{",
"this",
".",
"domainManager",
"=",
"domainManager",
";",
"this",
".",
"domainName",
"=",
"domainName",
";",
"this",
".",
"nodeFn",
"=",
"{",
"}",
";",
"this",
".",
"_re... | /*eslint-enable | [
"/",
"*",
"eslint",
"-",
"enable"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/languageTools/LanguageClient/NodeToBracketsInterface.js#L49-L55 | train | NodeToBracketsInterface constructor. | [
30522,
3853,
13045,
3406,
10024,
19869,
3215,
18447,
2121,
12172,
1006,
5884,
24805,
4590,
1010,
5884,
18442,
1007,
1063,
2023,
1012,
5884,
24805,
4590,
1027,
5884,
24805,
4590,
1025,
2023,
1012,
5884,
18442,
1027,
5884,
18442,
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... |
jgraph/mxgraph | javascript/examples/grapheditor/www/js/Graph.js | short | function short(str, max)
{
if (str.length > max)
{
str = str.substring(0, Math.round(max / 2)) + '...' +
str.substring(str.length - Math.round(max / 4));
}
return str;
} | javascript | function short(str, max)
{
if (str.length > max)
{
str = str.substring(0, Math.round(max / 2)) + '...' +
str.substring(str.length - Math.round(max / 4));
}
return str;
} | [
"function",
"short",
"(",
"str",
",",
"max",
")",
"{",
"if",
"(",
"str",
".",
"length",
">",
"max",
")",
"{",
"str",
"=",
"str",
".",
"substring",
"(",
"0",
",",
"Math",
".",
"round",
"(",
"max",
"/",
"2",
")",
")",
"+",
"'...'",
"+",
"str",
... | Helper function to shorten strings | [
"Helper",
"function",
"to",
"shorten",
"strings"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/examples/grapheditor/www/js/Graph.js#L6835-L6844 | train | shorten a string | [
30522,
3853,
2460,
1006,
2358,
2099,
1010,
4098,
1007,
1063,
2065,
1006,
2358,
2099,
1012,
3091,
1028,
4098,
1007,
1063,
2358,
2099,
1027,
2358,
2099,
1012,
4942,
3367,
4892,
1006,
1014,
1010,
8785,
1012,
2461,
1006,
4098,
1013,
1016,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/LiveDevMultiBrowser.js | _styleSheetAdded | function _styleSheetAdded(event, url, roots) {
var path = _server && _server.urlToPath(url),
alreadyAdded = !!_relatedDocuments[url];
// path may be null if loading an external stylesheet.
// Also, the stylesheet may already exist and be reported as added twice
// due to Chr... | javascript | function _styleSheetAdded(event, url, roots) {
var path = _server && _server.urlToPath(url),
alreadyAdded = !!_relatedDocuments[url];
// path may be null if loading an external stylesheet.
// Also, the stylesheet may already exist and be reported as added twice
// due to Chr... | [
"function",
"_styleSheetAdded",
"(",
"event",
",",
"url",
",",
"roots",
")",
"{",
"var",
"path",
"=",
"_server",
"&&",
"_server",
".",
"urlToPath",
"(",
"url",
")",
",",
"alreadyAdded",
"=",
"!",
"!",
"_relatedDocuments",
"[",
"url",
"]",
";",
"// path m... | Handles a notification from the browser that a stylesheet was loaded into
the live HTML document. If the stylesheet maps to a file in the project, then
creates a live document for the stylesheet and adds it to _relatedDocuments.
@param {$.Event} event
@param {string} url The URL of the stylesheet that was added.
@param... | [
"Handles",
"a",
"notification",
"from",
"the",
"browser",
"that",
"a",
"stylesheet",
"was",
"loaded",
"into",
"the",
"live",
"HTML",
"document",
".",
"If",
"the",
"stylesheet",
"maps",
"to",
"a",
"file",
"in",
"the",
"project",
"then",
"creates",
"a",
"liv... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L293-L322 | train | This function is called when a stylesheet is added to the page | [
30522,
3853,
1035,
6782,
21030,
17713,
5732,
1006,
2724,
1010,
24471,
2140,
1010,
6147,
1007,
1063,
13075,
4130,
1027,
1035,
8241,
1004,
1004,
1035,
8241,
1012,
24471,
23223,
15069,
1006,
24471,
2140,
1007,
1010,
2525,
4215,
5732,
1027,
999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/routing/sync/Target.js | function (vData) {
var oParentInfo;
if (this._oParent) {
oParentInfo = this._oParent.display(vData);
}
return this._place(oParentInfo, vData);
} | javascript | function (vData) {
var oParentInfo;
if (this._oParent) {
oParentInfo = this._oParent.display(vData);
}
return this._place(oParentInfo, vData);
} | [
"function",
"(",
"vData",
")",
"{",
"var",
"oParentInfo",
";",
"if",
"(",
"this",
".",
"_oParent",
")",
"{",
"oParentInfo",
"=",
"this",
".",
"_oParent",
".",
"display",
"(",
"vData",
")",
";",
"}",
"return",
"this",
".",
"_place",
"(",
"oParentInfo",
... | Creates a view and puts it in an aggregation of a control that has been defined in the {@link #constructor}.
@param {*} [vData] an object that will be passed to the display event in the data property. If the target has parents, the data will also be passed to them.
@private | [
"Creates",
"a",
"view",
"and",
"puts",
"it",
"in",
"an",
"aggregation",
"of",
"a",
"control",
"that",
"has",
"been",
"defined",
"in",
"the",
"{",
"@link",
"#constructor",
"}",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/sync/Target.js#L21-L29 | train | Display the data in the parent | [
30522,
3853,
1006,
1058,
2850,
2696,
1007,
1063,
13075,
6728,
12069,
16778,
2078,
14876,
1025,
2065,
1006,
2023,
1012,
1035,
6728,
12069,
3372,
1007,
1063,
6728,
12069,
16778,
2078,
14876,
1027,
2023,
1012,
1035,
6728,
12069,
3372,
1012,
46... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | website/modules/examples/Auth.js | AuthExample | function AuthExample() {
return (
<Router>
<div>
<AuthButton />
<ul>
<li>
<Link to="/public">Public Page</Link>
</li>
<li>
<Link to="/protected">Protected Page</Link>
</li>
</ul>
<Route path="/public" component={... | javascript | function AuthExample() {
return (
<Router>
<div>
<AuthButton />
<ul>
<li>
<Link to="/public">Public Page</Link>
</li>
<li>
<Link to="/protected">Protected Page</Link>
</li>
</ul>
<Route path="/public" component={... | [
"function",
"AuthExample",
"(",
")",
"{",
"return",
"(",
"<",
"Router",
">",
"\n ",
"<",
"div",
">",
"\n ",
"<",
"AuthButton",
"/",
">",
"\n ",
"<",
"ul",
">",
"\n ",
"<",
"li",
">",
"\n ",
"<",
"Link",
"to",
"=",
... | ////////////////////////////////////////////////////////// 1. Click the public page 2. Click the protected page 3. Log in 4. Click the back button, note the URL each time | [
"//////////////////////////////////////////////////////////",
"1",
".",
"Click",
"the",
"public",
"page",
"2",
".",
"Click",
"the",
"protected",
"page",
"3",
".",
"Log",
"in",
"4",
".",
"Click",
"the",
"back",
"button",
"note",
"the",
"URL",
"each",
"time"
] | 82ce94c3b4e74f71018d104df6dc999801fa9ab2 | https://github.com/ReactTraining/react-router/blob/82ce94c3b4e74f71018d104df6dc999801fa9ab2/website/modules/examples/Auth.js#L16-L35 | train | AuthExample - The main example of the application | [
30522,
3853,
8740,
10760,
18684,
23344,
1006,
1007,
1063,
2709,
1006,
1026,
2799,
2099,
1028,
1026,
4487,
2615,
1028,
1026,
8740,
2705,
8569,
15474,
1013,
1028,
1026,
17359,
1028,
1026,
5622,
1028,
1026,
4957,
2000,
1027,
1000,
1013,
2270,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/video/zy.media.js | timeFormat | function timeFormat(time, options) {
// Video's duration is Infinity in GiONEE(金立) device
if (!isFinite(time) || time < 0) {
time = 0;
}
// Get hours
var _time = options.alwaysShowHours ? [0] : [];
if (Math.floor(time / 3600) % 24) {
_time.push(Math.floor(time / 3600) % 24)
}
// Get minutes
_time.push(Math... | javascript | function timeFormat(time, options) {
// Video's duration is Infinity in GiONEE(金立) device
if (!isFinite(time) || time < 0) {
time = 0;
}
// Get hours
var _time = options.alwaysShowHours ? [0] : [];
if (Math.floor(time / 3600) % 24) {
_time.push(Math.floor(time / 3600) % 24)
}
// Get minutes
_time.push(Math... | [
"function",
"timeFormat",
"(",
"time",
",",
"options",
")",
"{",
"// Video's duration is Infinity in GiONEE(金立) device",
"if",
"(",
"!",
"isFinite",
"(",
"time",
")",
"||",
"time",
"<",
"0",
")",
"{",
"time",
"=",
"0",
";",
"}",
"// Get hours",
"var",
"_time... | Get time format | [
"Get",
"time",
"format"
] | 484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6 | https://github.com/airyland/vux/blob/484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6/src/components/video/zy.media.js#L138-L159 | train | Format time in seconds | [
30522,
3853,
2051,
14192,
4017,
1006,
2051,
1010,
7047,
1007,
1063,
1013,
1013,
2678,
1005,
1055,
9367,
2003,
15579,
1999,
21025,
5643,
2063,
1006,
1964,
1931,
1007,
5080,
2065,
1006,
999,
2003,
16294,
4221,
1006,
2051,
1007,
1064,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableMenuUtils.js | function(oTable, oElement, bHoverFirstMenuItem, bFireEvent, oEvent) {
if (!oTable || !oElement) {
return;
}
bFireEvent = bFireEvent !== false;
var $TableCell = MenuUtils.TableUtils.getCell(oTable, oElement);
var oCellInfo = MenuUtils.TableUtils.getCellInfo($TableCell);
var iColumnIndex = oCellIn... | javascript | function(oTable, oElement, bHoverFirstMenuItem, bFireEvent, oEvent) {
if (!oTable || !oElement) {
return;
}
bFireEvent = bFireEvent !== false;
var $TableCell = MenuUtils.TableUtils.getCell(oTable, oElement);
var oCellInfo = MenuUtils.TableUtils.getCellInfo($TableCell);
var iColumnIndex = oCellIn... | [
"function",
"(",
"oTable",
",",
"oElement",
",",
"bHoverFirstMenuItem",
",",
"bFireEvent",
",",
"oEvent",
")",
"{",
"if",
"(",
"!",
"oTable",
"||",
"!",
"oElement",
")",
"{",
"return",
";",
"}",
"bFireEvent",
"=",
"bFireEvent",
"!==",
"false",
";",
"var"... | Avoid cyclic dependency. Will be filled by TableUtils
Opens the context menu of a column or a data cell.
If a column header cell or an element inside a column header cell is passed as the parameter <code>oElement</code>,
the context menu of this column will be opened. If a data cell or an element inside a data cell is... | [
"Avoid",
"cyclic",
"dependency",
".",
"Will",
"be",
"filled",
"by",
"TableUtils",
"Opens",
"the",
"context",
"menu",
"of",
"a",
"column",
"or",
"a",
"data",
"cell",
".",
"If",
"a",
"column",
"header",
"cell",
"or",
"an",
"element",
"inside",
"a",
"column... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableMenuUtils.js#L59-L135 | train | Handles the column header menu. | [
30522,
3853,
1006,
27178,
3085,
1010,
1051,
12260,
3672,
1010,
1038,
6806,
6299,
8873,
12096,
3549,
14663,
6633,
1010,
28939,
7442,
18697,
3372,
1010,
1051,
18697,
3372,
1007,
1063,
2065,
1006,
999,
27178,
3085,
1064,
1064,
999,
1051,
12260... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/callback-return.js | containsOnlyIdentifiers | function containsOnlyIdentifiers(node) {
if (node.type === "Identifier") {
return true;
}
if (node.type === "MemberExpression") {
if (node.object.type === "Identifier") {
return true;
}
if (node.obje... | javascript | function containsOnlyIdentifiers(node) {
if (node.type === "Identifier") {
return true;
}
if (node.type === "MemberExpression") {
if (node.object.type === "Identifier") {
return true;
}
if (node.obje... | [
"function",
"containsOnlyIdentifiers",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"type",
"===",
"\"Identifier\"",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"node",
".",
"type",
"===",
"\"MemberExpression\"",
")",
"{",
"if",
"(",
"node",
".",
... | Check to see if a node contains only identifers
@param {ASTNode} node The node to check
@returns {boolean} Whether or not the node contains only identifers | [
"Check",
"to",
"see",
"if",
"a",
"node",
"contains",
"only",
"identifers"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/callback-return.js#L62-L77 | train | returns true if node contains only identifiers | [
30522,
3853,
3397,
2239,
2135,
5178,
16778,
30524,
10288,
20110,
3258,
1000,
1007,
1063,
2065,
1006,
13045,
1012,
4874,
1012,
2828,
1027,
1027,
1027,
1000,
8909,
4765,
18095,
1000,
1007,
1063,
2709,
2995,
1025,
1065,
2065,
1006,
13045,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/commons/dom/is-in-text-block.js | walkDomNode | function walkDomNode(node, functor) {
if (functor(node.actualNode) !== false) {
node.children.forEach(child => walkDomNode(child, functor));
}
} | javascript | function walkDomNode(node, functor) {
if (functor(node.actualNode) !== false) {
node.children.forEach(child => walkDomNode(child, functor));
}
} | [
"function",
"walkDomNode",
"(",
"node",
",",
"functor",
")",
"{",
"if",
"(",
"functor",
"(",
"node",
".",
"actualNode",
")",
"!==",
"false",
")",
"{",
"node",
".",
"children",
".",
"forEach",
"(",
"child",
"=>",
"walkDomNode",
"(",
"child",
",",
"funct... | /* global axe, dom, window | [
"/",
"*",
"global",
"axe",
"dom",
"window"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/commons/dom/is-in-text-block.js#L2-L6 | train | Walks the DOM tree and calls the function for each node | [
30522,
3853,
3328,
9527,
3630,
3207,
1006,
13045,
1010,
4569,
16761,
1007,
1063,
2065,
1006,
4569,
16761,
1006,
13045,
1012,
5025,
3630,
3207,
1007,
999,
1027,
1027,
6270,
1007,
1063,
13045,
1012,
2336,
1012,
18921,
6776,
1006,
2775,
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... |
caolan/async | lib/forever.js | forever | function forever(fn, errback) {
var done = onlyOnce(errback);
var task = wrapAsync(ensureAsync(fn));
function next(err) {
if (err) return done(err);
if (err === false) return;
task(next);
}
return next();
} | javascript | function forever(fn, errback) {
var done = onlyOnce(errback);
var task = wrapAsync(ensureAsync(fn));
function next(err) {
if (err) return done(err);
if (err === false) return;
task(next);
}
return next();
} | [
"function",
"forever",
"(",
"fn",
",",
"errback",
")",
"{",
"var",
"done",
"=",
"onlyOnce",
"(",
"errback",
")",
";",
"var",
"task",
"=",
"wrapAsync",
"(",
"ensureAsync",
"(",
"fn",
")",
")",
";",
"function",
"next",
"(",
"err",
")",
"{",
"if",
"("... | Calls the asynchronous function `fn` with a callback parameter that allows it
to call itself again, in series, indefinitely.
If an error is passed to the callback then `errback` is called with the
error, and execution stops, otherwise it will never be called.
@name forever
@static
@memberOf module:ControlFlow
@method... | [
"Calls",
"the",
"asynchronous",
"function",
"fn",
"with",
"a",
"callback",
"parameter",
"that",
"allows",
"it",
"to",
"call",
"itself",
"again",
"in",
"series",
"indefinitely",
"."
] | 4330d536c106592139fa82062494c9dba0da1fdb | https://github.com/caolan/async/blob/4330d536c106592139fa82062494c9dba0da1fdb/lib/forever.js#L37-L47 | train | A function that will run once for each resource in the cluster | [
30522,
3853,
5091,
1006,
1042,
2078,
1010,
9413,
28483,
3600,
1007,
1063,
13075,
2589,
1027,
2069,
2239,
3401,
1006,
9413,
28483,
3600,
1007,
1025,
13075,
4708,
1027,
10236,
3022,
6038,
2278,
1006,
5676,
3022,
6038,
2278,
1006,
1042,
2078,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/fs.js | ensureFolder | function ensureFolder(rootFolder) {
return rmDir(rootFolder)
.fail(function() {
return Promise();
})
.then(function() {
return Promise.nfcall(mkdirp, rootFolder);
});
} | javascript | function ensureFolder(rootFolder) {
return rmDir(rootFolder)
.fail(function() {
return Promise();
})
.then(function() {
return Promise.nfcall(mkdirp, rootFolder);
});
} | [
"function",
"ensureFolder",
"(",
"rootFolder",
")",
"{",
"return",
"rmDir",
"(",
"rootFolder",
")",
".",
"fail",
"(",
"function",
"(",
")",
"{",
"return",
"Promise",
"(",
")",
";",
"}",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"return",
"Pro... | Ensure that a directory exists and is empty
@param {String} folder
@return {Promise} | [
"Ensure",
"that",
"a",
"directory",
"exists",
"and",
"is",
"empty"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/fs.js#L138-L146 | train | Ensure that the root folder exists | [
30522,
3853,
5676,
10371,
2121,
1006,
7117,
10371,
2121,
1007,
1063,
2709,
28549,
4305,
2099,
1006,
7117,
10371,
2121,
1007,
1012,
8246,
1006,
3853,
1006,
1007,
1063,
2709,
4872,
1006,
1007,
1025,
1065,
1007,
1012,
2059,
1006,
3853,
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... |
babel/babel | packages/babel-plugin-transform-block-scoping/src/index.js | isInLoop | function isInLoop(path) {
const loopOrFunctionParent = path.find(
path => path.isLoop() || path.isFunction(),
);
return loopOrFunctionParent && loopOrFunctionParent.isLoop();
} | javascript | function isInLoop(path) {
const loopOrFunctionParent = path.find(
path => path.isLoop() || path.isFunction(),
);
return loopOrFunctionParent && loopOrFunctionParent.isLoop();
} | [
"function",
"isInLoop",
"(",
"path",
")",
"{",
"const",
"loopOrFunctionParent",
"=",
"path",
".",
"find",
"(",
"path",
"=>",
"path",
".",
"isLoop",
"(",
")",
"||",
"path",
".",
"isFunction",
"(",
")",
",",
")",
";",
"return",
"loopOrFunctionParent",
"&&"... | If there is a loop ancestor closer than the closest function, we
consider ourselves to be in a loop. | [
"If",
"there",
"is",
"a",
"loop",
"ancestor",
"closer",
"than",
"the",
"closest",
"function",
"we",
"consider",
"ourselves",
"to",
"be",
"in",
"a",
"loop",
"."
] | 1969e6b6aa7d90be3fbb3aca98ea96849656a55a | https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-plugin-transform-block-scoping/src/index.js#L123-L129 | train | Check if path is a loop or function | [
30522,
3853,
2003,
2378,
4135,
7361,
1006,
4130,
1007,
1063,
9530,
3367,
7077,
16347,
4609,
7542,
19362,
4765,
1027,
4130,
1012,
2424,
1006,
4130,
1027,
1028,
4130,
1012,
2003,
4135,
7361,
1006,
1007,
1064,
1064,
4130,
1012,
2003,
11263,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/editor/EditorManager.js | _notifyActiveEditorChanged | function _notifyActiveEditorChanged(current) {
// Skip if the Editor that gained focus was already the most recently focused editor.
// This may happen e.g. if the window loses then regains focus.
if (_lastFocusedEditor === current) {
return;
}
var previous = _lastFoc... | javascript | function _notifyActiveEditorChanged(current) {
// Skip if the Editor that gained focus was already the most recently focused editor.
// This may happen e.g. if the window loses then regains focus.
if (_lastFocusedEditor === current) {
return;
}
var previous = _lastFoc... | [
"function",
"_notifyActiveEditorChanged",
"(",
"current",
")",
"{",
"// Skip if the Editor that gained focus was already the most recently focused editor.",
"// This may happen e.g. if the window loses then regains focus.",
"if",
"(",
"_lastFocusedEditor",
"===",
"current",
")",
"{",
"... | Editor focus handler to change the currently active editor
@private
@param {?Editor} current - the editor that will be the active editor | [
"Editor",
"focus",
"handler",
"to",
"change",
"the",
"currently",
"active",
"editor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorManager.js#L143-L153 | train | Notify the active editor that the current editor has changed. | [
30522,
3853,
1035,
2025,
8757,
19620,
2098,
15660,
22305,
2098,
1006,
2783,
1007,
1063,
1013,
1013,
13558,
2065,
1996,
3559,
2008,
4227,
3579,
2001,
2525,
1996,
2087,
3728,
4208,
3559,
1012,
1013,
1013,
2023,
2089,
4148,
1041,
1012,
1043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/performance/trace/FESR.js | createFESRopt | function createFESRopt(oInteraction, oFESRHandle) {
return [
format(oFESRHandle.appNameShort, 20, true), // application_name
format(oFESRHandle.stepName, 20, true), // step_name
"", // not assigned
format(CLIENT_MODEL, 20), // client_model
format(oInteraction.bytesSent, 16), // client_data_sent
form... | javascript | function createFESRopt(oInteraction, oFESRHandle) {
return [
format(oFESRHandle.appNameShort, 20, true), // application_name
format(oFESRHandle.stepName, 20, true), // step_name
"", // not assigned
format(CLIENT_MODEL, 20), // client_model
format(oInteraction.bytesSent, 16), // client_data_sent
form... | [
"function",
"createFESRopt",
"(",
"oInteraction",
",",
"oFESRHandle",
")",
"{",
"return",
"[",
"format",
"(",
"oFESRHandle",
".",
"appNameShort",
",",
"20",
",",
"true",
")",
",",
"// application_name",
"format",
"(",
"oFESRHandle",
".",
"stepName",
",",
"20",... | creates optional FESR header string | [
"creates",
"optional",
"FESR",
"header",
"string"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/performance/trace/FESR.js#L126-L149 | train | Creates a FESRopt object from the given interaction and FESRHandle | [
30522,
3853,
3443,
7959,
21338,
7361,
2102,
1006,
1051,
18447,
6906,
7542,
1010,
1997,
2229,
25032,
5685,
2571,
1007,
1063,
2709,
1031,
4289,
1006,
1997,
2229,
25032,
5685,
2571,
1012,
10439,
18442,
22231,
5339,
1010,
2322,
1010,
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... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/localization.js | filterAccessKeys | function filterAccessKeys(node) {
// Menus will need a separate filter set
var notAllowedLocalNames = ["menu", "menubar", "menupopup", "popupset"];
if (!node.disabled && !node.collapsed && !node.hidden &&
notAllowedLocalNames.indexOf(node.localName) == -1) {
// Code specific to the preferences panes to... | javascript | function filterAccessKeys(node) {
// Menus will need a separate filter set
var notAllowedLocalNames = ["menu", "menubar", "menupopup", "popupset"];
if (!node.disabled && !node.collapsed && !node.hidden &&
notAllowedLocalNames.indexOf(node.localName) == -1) {
// Code specific to the preferences panes to... | [
"function",
"filterAccessKeys",
"(",
"node",
")",
"{",
"// Menus will need a separate filter set",
"var",
"notAllowedLocalNames",
"=",
"[",
"\"menu\"",
",",
"\"menubar\"",
",",
"\"menupopup\"",
",",
"\"popupset\"",
"]",
";",
"if",
"(",
"!",
"node",
".",
"disabled",
... | Filters out nodes which should not be tested because they are not in the
current access key scope.
@param {node} node
@returns Filter status of the given node
@type {array of array of int} | [
"Filters",
"out",
"nodes",
"which",
"should",
"not",
"be",
"tested",
"because",
"they",
"are",
"not",
"in",
"the",
"current",
"access",
"key",
"scope",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/localization.js#L191-L215 | train | filter access keys | [
30522,
3853,
11307,
6305,
9623,
17140,
7274,
1006,
13045,
1007,
1063,
1013,
1013,
12183,
2015,
2097,
2342,
1037,
3584,
11307,
2275,
13075,
2025,
8095,
15096,
4135,
9289,
18442,
2015,
1027,
1031,
1000,
12183,
1000,
1010,
1000,
12183,
8237,
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... |
adobe/brackets | src/document/DocumentCommandHandlers.js | handleFileDelete | function handleFileDelete() {
var entry = ProjectManager.getSelectedItem();
Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_EXT_DELETED,
Strings.CONFIRM_DELETE_TITLE,
StringUtils.format(
entry.isFile ? Strings.CONFIRM_FILE_DELETE : Strings.CONFIRM_FO... | javascript | function handleFileDelete() {
var entry = ProjectManager.getSelectedItem();
Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_EXT_DELETED,
Strings.CONFIRM_DELETE_TITLE,
StringUtils.format(
entry.isFile ? Strings.CONFIRM_FILE_DELETE : Strings.CONFIRM_FO... | [
"function",
"handleFileDelete",
"(",
")",
"{",
"var",
"entry",
"=",
"ProjectManager",
".",
"getSelectedItem",
"(",
")",
";",
"Dialogs",
".",
"showModalDialog",
"(",
"DefaultDialogs",
".",
"DIALOG_ID_EXT_DELETED",
",",
"Strings",
".",
"CONFIRM_DELETE_TITLE",
",",
"... | Delete file command handler * | [
"Delete",
"file",
"command",
"handler",
"*"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentCommandHandlers.js#L1594-L1621 | train | Handle file delete | [
30522,
3853,
5047,
8873,
3709,
12260,
2618,
1006,
1007,
1063,
13075,
4443,
1027,
2622,
24805,
4590,
1012,
4152,
12260,
10985,
4221,
2213,
1006,
1007,
1025,
13764,
8649,
2015,
1012,
2265,
5302,
9305,
27184,
8649,
1006,
12398,
27184,
8649,
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... |
fex-team/webuploader | _draft/music/webuploader.js | function( type/*, args...*/ ) {
var args = [].slice.call( arguments, 1 ),
opts = this.options,
name = 'on' + type.substring( 0, 1 ).toUpperCase() +
type.substring( 1 );
if ( Mediator.trigger.apply( this, arguments ) ===... | javascript | function( type/*, args...*/ ) {
var args = [].slice.call( arguments, 1 ),
opts = this.options,
name = 'on' + type.substring( 0, 1 ).toUpperCase() +
type.substring( 1 );
if ( Mediator.trigger.apply( this, arguments ) ===... | [
"function",
"(",
"type",
"/*, args...*/",
")",
"{",
"var",
"args",
"=",
"[",
"]",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
",",
"opts",
"=",
"this",
".",
"options",
",",
"name",
"=",
"'on'",
"+",
"type",
".",
"substring",
"(",
... | 需要重写此方法来来支持opts.onEvent和instance.onEvent的处理器 | [
"需要重写此方法来来支持opts",
".",
"onEvent和instance",
".",
"onEvent的处理器"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/_draft/music/webuploader.js#L779-L800 | train | trigger a event | [
30522,
3853,
1006,
2828,
1013,
1008,
1010,
12098,
5620,
1012,
1012,
1012,
1008,
1013,
1007,
1063,
13075,
12098,
5620,
1027,
1031,
1033,
1012,
14704,
1012,
2655,
1006,
9918,
1010,
1015,
1007,
1010,
23569,
2015,
1027,
2023,
1012,
7047,
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... | |
GitbookIO/gitbook | lib/parse/listAssets.js | listAssets | function listAssets(book, pages) {
var fs = book.getContentFS();
var summary = book.getSummary();
var summaryFile = summary.getFile().getPath();
var glossary = book.getGlossary();
var glossaryFile = glossary.getFile().getPath();
var langs = book.getLanguages();
var langsFile = langs.getFi... | javascript | function listAssets(book, pages) {
var fs = book.getContentFS();
var summary = book.getSummary();
var summaryFile = summary.getFile().getPath();
var glossary = book.getGlossary();
var glossaryFile = glossary.getFile().getPath();
var langs = book.getLanguages();
var langsFile = langs.getFi... | [
"function",
"listAssets",
"(",
"book",
",",
"pages",
")",
"{",
"var",
"fs",
"=",
"book",
".",
"getContentFS",
"(",
")",
";",
"var",
"summary",
"=",
"book",
".",
"getSummary",
"(",
")",
";",
"var",
"summaryFile",
"=",
"summary",
".",
"getFile",
"(",
"... | List all assets in a book
Assets are file not ignored and not a page
@param {Book} book
@param {List<String>} pages
@param | [
"List",
"all",
"assets",
"in",
"a",
"book",
"Assets",
"are",
"file",
"not",
"ignored",
"and",
"not",
"a",
"page"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/parse/listAssets.js#L11-L41 | train | List assets from book | [
30522,
3853,
2862,
27241,
3215,
1006,
2338,
1010,
5530,
1007,
1063,
13075,
1042,
2015,
1027,
2338,
1012,
2131,
8663,
6528,
24475,
2015,
1006,
1007,
1025,
13075,
12654,
1027,
2338,
1012,
4152,
30524,
5649,
1027,
2338,
1012,
2131,
23296,
2184... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
pixijs/pixi.js | packages/prepare/src/BasePrepare.js | calculateTextStyle | function calculateTextStyle(helper, item)
{
if (item instanceof TextStyle)
{
const font = item.toFontString();
TextMetrics.measureFont(font);
return true;
}
return false;
} | javascript | function calculateTextStyle(helper, item)
{
if (item instanceof TextStyle)
{
const font = item.toFontString();
TextMetrics.measureFont(font);
return true;
}
return false;
} | [
"function",
"calculateTextStyle",
"(",
"helper",
",",
"item",
")",
"{",
"if",
"(",
"item",
"instanceof",
"TextStyle",
")",
"{",
"const",
"font",
"=",
"item",
".",
"toFontString",
"(",
")",
";",
"TextMetrics",
".",
"measureFont",
"(",
"font",
")",
";",
"r... | Built-in hook to calculate a text style for a PIXI.Text object.
@private
@param {PIXI.Renderer|PIXI.CanvasPrepare} helper - Not used by this upload handler
@param {PIXI.DisplayObject} item - Item to check
@return {boolean} If item was uploaded. | [
"Built",
"-",
"in",
"hook",
"to",
"calculate",
"a",
"text",
"style",
"for",
"a",
"PIXI",
".",
"Text",
"object",
"."
] | 99ae03b7565ae7ca5a6de633b0a277f7128fa4d0 | https://github.com/pixijs/pixi.js/blob/99ae03b7565ae7ca5a6de633b0a277f7128fa4d0/packages/prepare/src/BasePrepare.js#L426-L438 | train | Calculate text style | [
30522,
3853,
18422,
18209,
21756,
2571,
1006,
2393,
2121,
1010,
8875,
1007,
1063,
2065,
1006,
8875,
6013,
11253,
6981,
27983,
1007,
1063,
9530,
3367,
15489,
1027,
8875,
1012,
2000,
14876,
7666,
18886,
3070,
1006,
1007,
1025,
3793,
12589,
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... |
adobe/brackets | src/search/FileFilters.js | _updatePicker | function _updatePicker() {
var filter = getActiveFilter();
if (filter && filter.patterns.length) {
var label = filter.name || _getCondensedForm(filter.patterns);
_picker.setButtonLabel(StringUtils.format(Strings.EXCLUDE_FILE_FILTER, label));
} else {
_picker.s... | javascript | function _updatePicker() {
var filter = getActiveFilter();
if (filter && filter.patterns.length) {
var label = filter.name || _getCondensedForm(filter.patterns);
_picker.setButtonLabel(StringUtils.format(Strings.EXCLUDE_FILE_FILTER, label));
} else {
_picker.s... | [
"function",
"_updatePicker",
"(",
")",
"{",
"var",
"filter",
"=",
"getActiveFilter",
"(",
")",
";",
"if",
"(",
"filter",
"&&",
"filter",
".",
"patterns",
".",
"length",
")",
"{",
"var",
"label",
"=",
"filter",
".",
"name",
"||",
"_getCondensedForm",
"(",... | Update the picker button label with the name/patterns of the selected filter or
No Files Excluded if no filter is selected. | [
"Update",
"the",
"picker",
"button",
"label",
"with",
"the",
"name",
"/",
"patterns",
"of",
"the",
"selected",
"filter",
"or",
"No",
"Files",
"Excluded",
"if",
"no",
"filter",
"is",
"selected",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L158-L166 | train | Update the picker | [
30522,
3853,
1035,
10651,
24330,
5484,
1006,
1007,
1063,
13075,
11307,
1027,
2131,
19620,
8873,
21928,
1006,
1007,
1025,
2065,
1006,
11307,
1004,
1004,
11307,
1012,
7060,
1012,
3091,
1007,
1063,
13075,
3830,
1027,
11307,
1012,
2171,
1064,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js | function (sV2AnnotationName, oEntitySet, oProperty) {
var aNames = mV2ToV4PropertyCollection[sV2AnnotationName],
sTerm = aNames[0],
sCollection = aNames[1],
oAnnotation = oEntitySet[sTerm] || {},
aCollection = oAnnotation[sCollection] || [];
aCollection.push({ "PropertyPath" : oProperty.name });
... | javascript | function (sV2AnnotationName, oEntitySet, oProperty) {
var aNames = mV2ToV4PropertyCollection[sV2AnnotationName],
sTerm = aNames[0],
sCollection = aNames[1],
oAnnotation = oEntitySet[sTerm] || {},
aCollection = oAnnotation[sCollection] || [];
aCollection.push({ "PropertyPath" : oProperty.name });
... | [
"function",
"(",
"sV2AnnotationName",
",",
"oEntitySet",
",",
"oProperty",
")",
"{",
"var",
"aNames",
"=",
"mV2ToV4PropertyCollection",
"[",
"sV2AnnotationName",
"]",
",",
"sTerm",
"=",
"aNames",
"[",
"0",
"]",
",",
"sCollection",
"=",
"aNames",
"[",
"1",
"]... | Adds current property to the property collection for given V2 annotation.
@param {string} sV2AnnotationName
V2 annotation name (key in map mV2ToV4PropertyCollection)
@param {object} oEntitySet
the entity set
@param {object} oProperty
the property of the entity | [
"Adds",
"current",
"property",
"to",
"the",
"property",
"collection",
"for",
"given",
"V2",
"annotation",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L270-L280 | train | Adds the given property to the end of the entity set | [
30522,
3853,
1006,
17917,
2475,
11639,
17287,
3508,
18442,
1010,
1051,
4765,
3012,
13462,
1010,
6728,
18981,
15010,
1007,
1063,
13075,
9617,
7834,
1027,
19842,
2475,
26525,
2549,
21572,
4842,
3723,
26895,
18491,
1031,
17917,
2475,
11639,
1728... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
electron/electron | lib/browser/api/menu.js | areValidTemplateItems | function areValidTemplateItems (template) {
return template.every(item =>
item != null &&
typeof item === 'object' &&
(item.hasOwnProperty('label') ||
item.hasOwnProperty('role') ||
item.type === 'separator'))
} | javascript | function areValidTemplateItems (template) {
return template.every(item =>
item != null &&
typeof item === 'object' &&
(item.hasOwnProperty('label') ||
item.hasOwnProperty('role') ||
item.type === 'separator'))
} | [
"function",
"areValidTemplateItems",
"(",
"template",
")",
"{",
"return",
"template",
".",
"every",
"(",
"item",
"=>",
"item",
"!=",
"null",
"&&",
"typeof",
"item",
"===",
"'object'",
"&&",
"(",
"item",
".",
"hasOwnProperty",
"(",
"'label'",
")",
"||",
"it... | /* Helper Functions validate the template against having the wrong attribute | [
"/",
"*",
"Helper",
"Functions",
"validate",
"the",
"template",
"against",
"having",
"the",
"wrong",
"attribute"
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/api/menu.js#L192-L199 | train | Check if the template contains valid items | [
30522,
3853,
2024,
10175,
3593,
18532,
15725,
4221,
5244,
1006,
23561,
1007,
1063,
2709,
23561,
1012,
2296,
1006,
8875,
1027,
1028,
8875,
999,
1027,
19701,
1004,
1004,
2828,
11253,
8875,
1027,
1027,
1027,
1005,
4874,
1005,
1004,
1004,
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... |
catapult-project/catapult | dashboard/dashboard/spa/alerts-section.js | handleBatch | function handleBatch(results, showingTriaged) {
const alerts = [];
const nextRequests = [];
const triagedRequests = [];
let totalCount = 0;
for (const {body, response} of results) {
alerts.push.apply(alerts, response.anomalies);
if (body.count_limit) totalCount += response.count;
const cursor = ... | javascript | function handleBatch(results, showingTriaged) {
const alerts = [];
const nextRequests = [];
const triagedRequests = [];
let totalCount = 0;
for (const {body, response} of results) {
alerts.push.apply(alerts, response.anomalies);
if (body.count_limit) totalCount += response.count;
const cursor = ... | [
"function",
"handleBatch",
"(",
"results",
",",
"showingTriaged",
")",
"{",
"const",
"alerts",
"=",
"[",
"]",
";",
"const",
"nextRequests",
"=",
"[",
"]",
";",
"const",
"triagedRequests",
"=",
"[",
"]",
";",
"let",
"totalCount",
"=",
"0",
";",
"for",
"... | The BatchIterator in actions.loadAlerts yielded a batch of results. Collect all alerts from all batches into `alerts`. Chase cursors in `nextRequests`. Fetch triaged alerts when a request for untriaged alerts returns. | [
"The",
"BatchIterator",
"in",
"actions",
".",
"loadAlerts",
"yielded",
"a",
"batch",
"of",
"results",
".",
"Collect",
"all",
"alerts",
"from",
"all",
"batches",
"into",
"alerts",
".",
"Chase",
"cursors",
"in",
"nextRequests",
".",
"Fetch",
"triaged",
"alerts",... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/dashboard/dashboard/spa/alerts-section.js#L291-L321 | train | Handle a batch of alerts | [
30522,
3853,
5047,
14479,
2818,
1006,
3463,
1010,
4760,
18886,
18655,
1007,
1063,
9530,
3367,
9499,
2015,
1027,
1031,
1033,
1025,
9530,
3367,
2279,
2890,
15500,
2015,
1027,
1031,
1033,
1025,
9530,
3367,
13012,
18655,
2890,
15500,
2015,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/systems/camera.js | function () {
var cameraEls;
var i;
var sceneEl = this.sceneEl;
var self = this;
// Camera already defined or the one defined it is an spectator one.
if (sceneEl.camera && !sceneEl.camera.el.getAttribute('camera').spectator) {
sceneEl.emit('cameraready', {cameraEl: sceneEl.camera.el});
... | javascript | function () {
var cameraEls;
var i;
var sceneEl = this.sceneEl;
var self = this;
// Camera already defined or the one defined it is an spectator one.
if (sceneEl.camera && !sceneEl.camera.el.getAttribute('camera').spectator) {
sceneEl.emit('cameraready', {cameraEl: sceneEl.camera.el});
... | [
"function",
"(",
")",
"{",
"var",
"cameraEls",
";",
"var",
"i",
";",
"var",
"sceneEl",
"=",
"this",
".",
"sceneEl",
";",
"var",
"self",
"=",
"this",
";",
"// Camera already defined or the one defined it is an spectator one.",
"if",
"(",
"sceneEl",
".",
"camera",... | Setup initial camera, either searching for camera or
creating a default camera if user has not added one during the initial scene traversal.
We want sceneEl.camera to be ready, set, and initialized before the rest of the scene
loads.
Default camera offset height is at average eye level (~1.6m). | [
"Setup",
"initial",
"camera",
"either",
"searching",
"for",
"camera",
"or",
"creating",
"a",
"default",
"camera",
"if",
"user",
"has",
"not",
"added",
"one",
"during",
"the",
"initial",
"scene",
"traversal",
".",
"We",
"want",
"sceneEl",
".",
"camera",
"to",... | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/systems/camera.js#L33-L70 | train | Check if the scene has a camera | [
30522,
3853,
1006,
1007,
1063,
13075,
4950,
9050,
1025,
13075,
1045,
1025,
13075,
3496,
2884,
1027,
2023,
1012,
3496,
2884,
1025,
13075,
2969,
1027,
2023,
1025,
1013,
1013,
4950,
2525,
4225,
2030,
1996,
2028,
4225,
30524,
3496,
2884,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
google/code-prettify | js-modules/numberLines.js | breakAfter | function breakAfter(lineEndNode) {
// If there's nothing to the right, then we can skip ending the line
// here, and move root-wards since splitting just before an end-tag
// would require us to create a bunch of empty copies.
while (!lineEndNode.nextSibling) {
lineEndNode = lineEndNode.parentNode... | javascript | function breakAfter(lineEndNode) {
// If there's nothing to the right, then we can skip ending the line
// here, and move root-wards since splitting just before an end-tag
// would require us to create a bunch of empty copies.
while (!lineEndNode.nextSibling) {
lineEndNode = lineEndNode.parentNode... | [
"function",
"breakAfter",
"(",
"lineEndNode",
")",
"{",
"// If there's nothing to the right, then we can skip ending the line",
"// here, and move root-wards since splitting just before an end-tag",
"// would require us to create a bunch of empty copies.",
"while",
"(",
"!",
"lineEndNode",
... | Split a line after the given node. | [
"Split",
"a",
"line",
"after",
"the",
"given",
"node",
"."
] | e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc | https://github.com/google/code-prettify/blob/e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc/js-modules/numberLines.js#L66-L107 | train | This function is called when a line is ending in a tag. | [
30522,
3853,
3338,
10354,
3334,
1006,
2240,
10497,
3630,
3207,
1007,
1063,
1013,
1013,
2065,
2045,
1005,
1055,
2498,
2000,
1996,
2157,
1010,
2059,
2057,
2064,
13558,
4566,
1996,
2240,
1013,
1013,
2182,
1010,
1998,
2693,
7117,
1011,
11682,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 (oTree, bSelected) {
oTree.selected = bSelected;
for (var i = 0; i < oTree.nodes.length; i++) {
this.recursiveSelect(oTree.nodes[i], bSelected);
}
} | javascript | function (oTree, bSelected) {
oTree.selected = bSelected;
for (var i = 0; i < oTree.nodes.length; i++) {
this.recursiveSelect(oTree.nodes[i], bSelected);
}
} | [
"function",
"(",
"oTree",
",",
"bSelected",
")",
"{",
"oTree",
".",
"selected",
"=",
"bSelected",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"oTree",
".",
"nodes",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"recursiveSelect",
... | Recursively selected or deselects a branch of the tree
@param {object} oTree The tree to be selected
@param {boolean} bSelected Whether the branch should be selected or not | [
"Recursively",
"selected",
"or",
"deselects",
"a",
"branch",
"of",
"the",
"tree"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L314-L319 | train | Recursively selects the nodes in the tree | [
30522,
3853,
1006,
27178,
9910,
1010,
18667,
12260,
10985,
1007,
1063,
27178,
9910,
1012,
3479,
1027,
18667,
12260,
10985,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
27178,
9910,
1012,
14164,
1012,
3091,
1025,
1045,
1009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
uikit/uikit | src/js/util/options.js | concatStrat | function concatStrat(parentVal, childVal) {
parentVal = parentVal && !isArray(parentVal) ? [parentVal] : parentVal;
return childVal
? parentVal
? parentVal.concat(childVal)
: isArray(childVal)
? childVal
: [childVal]
: parentVal;
} | javascript | function concatStrat(parentVal, childVal) {
parentVal = parentVal && !isArray(parentVal) ? [parentVal] : parentVal;
return childVal
? parentVal
? parentVal.concat(childVal)
: isArray(childVal)
? childVal
: [childVal]
: parentVal;
} | [
"function",
"concatStrat",
"(",
"parentVal",
",",
"childVal",
")",
"{",
"parentVal",
"=",
"parentVal",
"&&",
"!",
"isArray",
"(",
"parentVal",
")",
"?",
"[",
"parentVal",
"]",
":",
"parentVal",
";",
"return",
"childVal",
"?",
"parentVal",
"?",
"parentVal",
... | concat strategy | [
"concat",
"strategy"
] | b7760008135313b6a81f645c750db6f285a89488 | https://github.com/uikit/uikit/blob/b7760008135313b6a81f645c750db6f285a89488/src/js/util/options.js#L80-L91 | train | concatStrat - Concatenates two terms of terms | [
30522,
3853,
9530,
19588,
6494,
2102,
1006,
6687,
10175,
1010,
2775,
10175,
1007,
1063,
6687,
10175,
1027,
6687,
10175,
1004,
1004,
999,
18061,
11335,
2100,
1006,
6687,
10175,
1007,
1029,
1031,
6687,
10175,
1033,
1024,
6687,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
openlayers/openlayers | src/ol/interaction/Modify.js | pointDistanceToSegmentDataSquared | function pointDistanceToSegmentDataSquared(pointCoordinates, segmentData) {
const geometry = segmentData.geometry;
if (geometry.getType() === GeometryType.CIRCLE) {
const circleGeometry = /** @type {import("../geom/Circle.js").default} */ (geometry);
if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {... | javascript | function pointDistanceToSegmentDataSquared(pointCoordinates, segmentData) {
const geometry = segmentData.geometry;
if (geometry.getType() === GeometryType.CIRCLE) {
const circleGeometry = /** @type {import("../geom/Circle.js").default} */ (geometry);
if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {... | [
"function",
"pointDistanceToSegmentDataSquared",
"(",
"pointCoordinates",
",",
"segmentData",
")",
"{",
"const",
"geometry",
"=",
"segmentData",
".",
"geometry",
";",
"if",
"(",
"geometry",
".",
"getType",
"(",
")",
"===",
"GeometryType",
".",
"CIRCLE",
")",
"{"... | Returns the distance from a point to a line segment.
@param {import("../coordinate.js").Coordinate} pointCoordinates The coordinates of the point from
which to calculate the distance.
@param {SegmentData} segmentData The object describing the line
segment we are calculating the distance to.
@return {number} The square... | [
"Returns",
"the",
"distance",
"from",
"a",
"point",
"to",
"a",
"line",
"segment",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/interaction/Modify.js#L1202-L1217 | train | Returns the squared distance to the point coordinates in the segmentData | [
30522,
3853,
2391,
10521,
26897,
22282,
21693,
30524,
1012,
4418,
1007,
1063,
9530,
3367,
4418,
3351,
8462,
11129,
1027,
1013,
1008,
1008,
1030,
2828,
1063,
12324,
1006,
1000,
1012,
1012,
1013,
20248,
2213,
1013,
4418,
1012,
1046,
2015,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/core/utils/get-selector.js | filterAttributes | function filterAttributes(at) {
return (
!ignoredAttributes.includes(at.name) &&
at.name.indexOf(':') === -1 &&
(!at.value || at.value.length < MAXATTRIBUTELENGTH)
);
} | javascript | function filterAttributes(at) {
return (
!ignoredAttributes.includes(at.name) &&
at.name.indexOf(':') === -1 &&
(!at.value || at.value.length < MAXATTRIBUTELENGTH)
);
} | [
"function",
"filterAttributes",
"(",
"at",
")",
"{",
"return",
"(",
"!",
"ignoredAttributes",
".",
"includes",
"(",
"at",
".",
"name",
")",
"&&",
"at",
".",
"name",
".",
"indexOf",
"(",
"':'",
")",
"===",
"-",
"1",
"&&",
"(",
"!",
"at",
".",
"value... | Filter the attributes
@param {Attribute} The potential attribute
@return {Boolean} Whether to include or exclude | [
"Filter",
"the",
"attributes"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/get-selector.js#L65-L71 | train | filter attributes to ignore | [
30522,
3853,
11307,
19321,
3089,
8569,
4570,
1006,
2012,
1007,
1063,
2709,
1006,
999,
6439,
19321,
3089,
8569,
4570,
1012,
2950,
1006,
2012,
1012,
2171,
1007,
1004,
1004,
2012,
1012,
2171,
1012,
5950,
11253,
1006,
1005,
1024,
1005,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/document/DocumentCommandHandlers.js | _handleNewItemInProject | function _handleNewItemInProject(isFolder) {
if (fileNewInProgress) {
ProjectManager.forceFinishRename();
return;
}
fileNewInProgress = true;
// Determine the directory to put the new file
// If a file is currently selected in the tree, put it next to it.... | javascript | function _handleNewItemInProject(isFolder) {
if (fileNewInProgress) {
ProjectManager.forceFinishRename();
return;
}
fileNewInProgress = true;
// Determine the directory to put the new file
// If a file is currently selected in the tree, put it next to it.... | [
"function",
"_handleNewItemInProject",
"(",
"isFolder",
")",
"{",
"if",
"(",
"fileNewInProgress",
")",
"{",
"ProjectManager",
".",
"forceFinishRename",
"(",
")",
";",
"return",
";",
"}",
"fileNewInProgress",
"=",
"true",
";",
"// Determine the directory to put the new... | Bottleneck function for creating new files and folders in the project tree.
@private
@param {boolean} isFolder - true if creating a new folder, false if creating a new file | [
"Bottleneck",
"function",
"for",
"creating",
"new",
"files",
"and",
"folders",
"in",
"the",
"project",
"tree",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentCommandHandlers.js#L644-L676 | train | Handle the new item in the project | [
30522,
3853,
1035,
5047,
2638,
9148,
18532,
2378,
21572,
20614,
1006,
2003,
10371,
2121,
1007,
1063,
2065,
1006,
5371,
2638,
10105,
21572,
17603,
4757,
1007,
1063,
2622,
24805,
4590,
1012,
2486,
16294,
4509,
7389,
14074,
1006,
1007,
1025,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/services/auth/auth-strategies.js | bearerStrategy | function bearerStrategy(accessToken, done) {
return models.Accesstoken.findOne({token: accessToken})
.then(function then(model) {
if (model) {
var token = model.toJSON();
if (token.expires > Date.now()) {
return models.U... | javascript | function bearerStrategy(accessToken, done) {
return models.Accesstoken.findOne({token: accessToken})
.then(function then(model) {
if (model) {
var token = model.toJSON();
if (token.expires > Date.now()) {
return models.U... | [
"function",
"bearerStrategy",
"(",
"accessToken",
",",
"done",
")",
"{",
"return",
"models",
".",
"Accesstoken",
".",
"findOne",
"(",
"{",
"token",
":",
"accessToken",
"}",
")",
".",
"then",
"(",
"function",
"then",
"(",
"model",
")",
"{",
"if",
"(",
"... | BearerStrategy
This strategy is used to authenticate users based on an access token (aka a
bearer token). The user must have previously authorized a client
application, which is issued an access token to make requests on behalf of
the authorizing user. | [
"BearerStrategy"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/services/auth/auth-strategies.js#L39-L72 | train | bearerStrategy - The bearer strategy | [
30522,
3853,
20905,
20528,
2618,
6292,
1006,
3229,
18715,
2368,
1010,
2589,
1007,
1063,
2709,
4275,
1012,
3229,
18715,
2368,
1012,
2424,
5643,
1006,
1063,
19204,
1024,
3229,
18715,
2368,
1065,
1007,
1012,
2059,
1006,
3853,
2059,
1006,
2944,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Component.js | runWithOwner | function runWithOwner(fn, sOwnerId, oThisArg) {
assert(typeof fn === "function", "fn must be a function");
var oldOwnerId = ManagedObject._sOwnerId;
try {
ManagedObject._sOwnerId = sOwnerId;
return fn.call(oThisArg);
} finally {
ManagedObject._sOwnerId = oldOwnerId;
}
} | javascript | function runWithOwner(fn, sOwnerId, oThisArg) {
assert(typeof fn === "function", "fn must be a function");
var oldOwnerId = ManagedObject._sOwnerId;
try {
ManagedObject._sOwnerId = sOwnerId;
return fn.call(oThisArg);
} finally {
ManagedObject._sOwnerId = oldOwnerId;
}
} | [
"function",
"runWithOwner",
"(",
"fn",
",",
"sOwnerId",
",",
"oThisArg",
")",
"{",
"assert",
"(",
"typeof",
"fn",
"===",
"\"function\"",
",",
"\"fn must be a function\"",
")",
";",
"var",
"oldOwnerId",
"=",
"ManagedObject",
".",
"_sOwnerId",
";",
"try",
"{",
... | Calls the function <code>fn</code> once and marks all ManagedObjects
created during that call as "owned" by the given ID.
@param {function} fn Function to execute
@param {string} sOwnerId Id of the owner
@param {Object} [oThisArg=undefined] Value to use as <code>this</code> when executing <code>fn</code>
@return {any}... | [
"Calls",
"the",
"function",
"<code",
">",
"fn<",
"/",
"code",
">",
"once",
"and",
"marks",
"all",
"ManagedObjects",
"created",
"during",
"that",
"call",
"as",
"owned",
"by",
"the",
"given",
"ID",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Component.js#L182-L194 | train | Runs a function on the specified object and returns the result | [
30522,
3853,
2448,
24415,
12384,
2121,
1006,
1042,
2078,
1010,
2061,
7962,
11124,
2094,
1010,
27178,
24158,
2906,
2290,
1007,
1063,
20865,
1006,
2828,
11253,
1042,
2078,
1027,
1027,
1027,
1000,
3853,
1000,
1010,
1000,
1042,
2078,
2442,
2022... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js | function (aButtons) {
var iVisibleButtons = 0;
for (var i = 0; i < aButtons.length; i++) {
if (iVisibleButtons < this.getMaxButtonsDisplayed() && aButtons[i].getVisible()) {
iVisibleButtons++;
} else {
aButtons[i].setVisible(false);
}
}
return iVisibleButtons;
} | javascript | function (aButtons) {
var iVisibleButtons = 0;
for (var i = 0; i < aButtons.length; i++) {
if (iVisibleButtons < this.getMaxButtonsDisplayed() && aButtons[i].getVisible()) {
iVisibleButtons++;
} else {
aButtons[i].setVisible(false);
}
}
return iVisibleButtons;
} | [
"function",
"(",
"aButtons",
")",
"{",
"var",
"iVisibleButtons",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"aButtons",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"iVisibleButtons",
"<",
"this",
".",
"getMaxButtonsDispla... | Hides the buttons in overflow
@param {array} aButtons some Buttons
@return {int} the number of visible buttons | [
"Hides",
"the",
"buttons",
"in",
"overflow"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js#L285-L296 | train | Sets the visibility of the buttons | [
30522,
3853,
1006,
8273,
15474,
2015,
1007,
1063,
13075,
4921,
17417,
3468,
8569,
15474,
2015,
1027,
1014,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
8273,
15474,
2015,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
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... | |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | checkDatabaseAuthAccess | function checkDatabaseAuthAccess() {
var randomString = Math.floor(Math.random() * 10000000).toString();
var dbRef;
var dbPath;
var errMessage;
// Run this check only when Database module is available.
if (typeof firebase !== 'undefined' &&
typeof firebase.database !== 'undefined') {
if (lastUser ... | javascript | function checkDatabaseAuthAccess() {
var randomString = Math.floor(Math.random() * 10000000).toString();
var dbRef;
var dbPath;
var errMessage;
// Run this check only when Database module is available.
if (typeof firebase !== 'undefined' &&
typeof firebase.database !== 'undefined') {
if (lastUser ... | [
"function",
"checkDatabaseAuthAccess",
"(",
")",
"{",
"var",
"randomString",
"=",
"Math",
".",
"floor",
"(",
"Math",
".",
"random",
"(",
")",
"*",
"10000000",
")",
".",
"toString",
"(",
")",
";",
"var",
"dbRef",
";",
"var",
"dbPath",
";",
"var",
"errMe... | Provides basic Database checks for authenticated and unauthenticated access.
The Database node being tested has the following rule:
"users": {
"$user_id": {
".read": "$user_id === auth.uid",
".write": "$user_id === auth.uid"
}
}
This applies when Real-time database service is available. | [
"Provides",
"basic",
"Database",
"checks",
"for",
"authenticated",
"and",
"unauthenticated",
"access",
".",
"The",
"Database",
"node",
"being",
"tested",
"has",
"the",
"following",
"rule",
":",
"users",
":",
"{",
"$user_id",
":",
"{",
".",
"read",
":",
"$use... | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L1185-L1249 | train | Checks if Database Auth is allowed. | [
30522,
3853,
4638,
2850,
2696,
15058,
4887,
8322,
9468,
7971,
1006,
1007,
1063,
13075,
6721,
3367,
4892,
1027,
8785,
1012,
2723,
1006,
8785,
1012,
6721,
1006,
1007,
1008,
6694,
8889,
8889,
1007,
1012,
2000,
3367,
4892,
1006,
1007,
1025,
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... |
goldfire/howler.js | dist/howler.js | function(id) {
var self = this;
var sound = self._soundById(id);
if (sound && sound._interval) {
if (self._webAudio) {
sound._node.gain.cancelScheduledValues(Howler.ctx.currentTime);
}
clearInterval(sound._interval);
sound._interval = null;
self.volu... | javascript | function(id) {
var self = this;
var sound = self._soundById(id);
if (sound && sound._interval) {
if (self._webAudio) {
sound._node.gain.cancelScheduledValues(Howler.ctx.currentTime);
}
clearInterval(sound._interval);
sound._interval = null;
self.volu... | [
"function",
"(",
"id",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"sound",
"=",
"self",
".",
"_soundById",
"(",
"id",
")",
";",
"if",
"(",
"sound",
"&&",
"sound",
".",
"_interval",
")",
"{",
"if",
"(",
"self",
".",
"_webAudio",
")",
"{",
... | Internal method that stops the currently playing fade when
a new fade starts, volume is changed or the sound is stopped.
@param {Number} id The sound id.
@return {Howl} | [
"Internal",
"method",
"that",
"stops",
"the",
"currently",
"playing",
"fade",
"when",
"a",
"new",
"fade",
"starts",
"volume",
"is",
"changed",
"or",
"the",
"sound",
"is",
"stopped",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L1376-L1393 | train | fade a sound | [
30522,
3853,
1006,
8909,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
2614,
1027,
2969,
1012,
1035,
2614,
3762,
3593,
1006,
8909,
1007,
1025,
2065,
1006,
2614,
1004,
1004,
2614,
1012,
1035,
13483,
1007,
1063,
2065,
1006,
2969,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | getQualifier | function getQualifier(sTerm, sExpectedTerm) {
if (sTerm === sExpectedTerm) {
return "";
}
if (sTerm.indexOf(sExpectedTerm) === 0 && sTerm[sExpectedTerm.length] === "#"
&& sTerm.indexOf("@", sExpectedTerm.length) < 0) {
return sTerm.slice(sExpectedTerm.length + 1);
}
} | javascript | function getQualifier(sTerm, sExpectedTerm) {
if (sTerm === sExpectedTerm) {
return "";
}
if (sTerm.indexOf(sExpectedTerm) === 0 && sTerm[sExpectedTerm.length] === "#"
&& sTerm.indexOf("@", sExpectedTerm.length) < 0) {
return sTerm.slice(sExpectedTerm.length + 1);
}
} | [
"function",
"getQualifier",
"(",
"sTerm",
",",
"sExpectedTerm",
")",
"{",
"if",
"(",
"sTerm",
"===",
"sExpectedTerm",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"sTerm",
".",
"indexOf",
"(",
"sExpectedTerm",
")",
"===",
"0",
"&&",
"sTerm",
"[",
"... | Checks that the term is the expected term and determines the qualifier.
@param {string} sTerm
The term
@param {string} sExpectedTerm
The expected term
@returns {string}
The qualifier or undefined, if the term is not the expected term | [
"Checks",
"that",
"the",
"term",
"is",
"the",
"expected",
"term",
"and",
"determines",
"the",
"qualifier",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L221-L229 | train | Returns the qualifier of the term | [
30522,
3853,
2131,
26426,
18095,
1006,
26261,
10867,
1010,
3348,
5051,
10985,
3334,
2213,
1007,
1063,
2065,
1006,
26261,
10867,
1027,
1027,
1027,
3348,
5051,
10985,
3334,
2213,
1007,
1063,
2709,
1000,
1000,
1025,
1065,
2065,
1006,
26261,
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... |
wangfupeng1988/wangEditor | src/js/text/index.js | function () {
const editor = this.editor
const $textElem = editor.$textElem
// 为图片增加 selected 样式
$textElem.on('click', 'img', function (e) {
const img = this
const $img = $(img)
if ($img.attr('data-w-e') === '1') {
// 是表情图片,忽略
... | javascript | function () {
const editor = this.editor
const $textElem = editor.$textElem
// 为图片增加 selected 样式
$textElem.on('click', 'img', function (e) {
const img = this
const $img = $(img)
if ($img.attr('data-w-e') === '1') {
// 是表情图片,忽略
... | [
"function",
"(",
")",
"{",
"const",
"editor",
"=",
"this",
".",
"editor",
"const",
"$textElem",
"=",
"editor",
".",
"$textElem",
"// 为图片增加 selected 样式",
"$textElem",
".",
"on",
"(",
"'click'",
",",
"'img'",
",",
"function",
"(",
"e",
")",
"{",
"const",
"... | img 点击 | [
"img",
"点击"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/text/index.js#L494-L525 | train | Select the image | [
30522,
3853,
1006,
1007,
1063,
9530,
3367,
3559,
1027,
2023,
1012,
3559,
9530,
3367,
1002,
3793,
12260,
2213,
1027,
3559,
1012,
1002,
3793,
12260,
2213,
1013,
1013,
100,
100,
100,
100,
1779,
3479,
100,
100,
1002,
3793,
12260,
2213,
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... | |
SheetJS/js-xlsx | xlsx.js | read_bits_n | function read_bits_n(buf, bl, n) {
var w = (bl&7), h = (bl>>>3), f = ((1<<n)-1);
var v = buf[h] >>> w;
if(n < 8 - w) return v & f;
v |= buf[h+1]<<(8-w);
if(n < 16 - w) return v & f;
v |= buf[h+2]<<(16-w);
if(n < 24 - w) return v & f;
v |= buf[h+3]<<(24-w);
return v & f;
} | javascript | function read_bits_n(buf, bl, n) {
var w = (bl&7), h = (bl>>>3), f = ((1<<n)-1);
var v = buf[h] >>> w;
if(n < 8 - w) return v & f;
v |= buf[h+1]<<(8-w);
if(n < 16 - w) return v & f;
v |= buf[h+2]<<(16-w);
if(n < 24 - w) return v & f;
v |= buf[h+3]<<(24-w);
return v & f;
} | [
"function",
"read_bits_n",
"(",
"buf",
",",
"bl",
",",
"n",
")",
"{",
"var",
"w",
"=",
"(",
"bl",
"&",
"7",
")",
",",
"h",
"=",
"(",
"bl",
">>>",
"3",
")",
",",
"f",
"=",
"(",
"(",
"1",
"<<",
"n",
")",
"-",
"1",
")",
";",
"var",
"v",
... | /* works up to n = 3 * 8 + 1 = 25 | [
"/",
"*",
"works",
"up",
"to",
"n",
"=",
"3",
"*",
"8",
"+",
"1",
"=",
"25"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L2006-L2016 | train | read n bits from buffer | [
30522,
3853,
3191,
1035,
9017,
1035,
1050,
1006,
20934,
2546,
1010,
1038,
2140,
1010,
1050,
1007,
1063,
13075,
1059,
1027,
1006,
1038,
2140,
1004,
1021,
1007,
1010,
1044,
1027,
1006,
1038,
2140,
1028,
1028,
1028,
1017,
1007,
1010,
1042,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/util/util.js | function(template) {
if (usesStandardSymbols) {
return template;
} else {
if (!template || !angular.isString(template)) return template;
return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol);
}
} | javascript | function(template) {
if (usesStandardSymbols) {
return template;
} else {
if (!template || !angular.isString(template)) return template;
return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol);
}
} | [
"function",
"(",
"template",
")",
"{",
"if",
"(",
"usesStandardSymbols",
")",
"{",
"return",
"template",
";",
"}",
"else",
"{",
"if",
"(",
"!",
"template",
"||",
"!",
"angular",
".",
"isString",
"(",
"template",
")",
")",
"return",
"template",
";",
"re... | Processes a template and replaces the start/end symbols if the application has
overridden them.
@param template The template to process whose start/end tags may be replaced.
@returns {*} | [
"Processes",
"a",
"template",
"and",
"replaces",
"the",
"start",
"/",
"end",
"symbols",
"if",
"the",
"application",
"has",
"overridden",
"them",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L721-L728 | train | Returns the template string | [
30522,
3853,
1006,
23561,
1007,
1063,
2065,
1006,
3594,
21515,
18117,
24335,
14956,
2015,
1007,
1063,
2709,
23561,
1025,
1065,
2842,
1063,
2065,
1006,
999,
23561,
1064,
1064,
999,
16108,
1012,
26354,
18886,
3070,
1006,
23561,
1007,
1007,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
LLK/scratch-blocks | blocks_vertical/data.js | function() {
this.jsonInit({
"message0": Blockly.Msg.DATA_ITEMOFLIST,
"args0": [
{
"type": "input_value",
"name": "INDEX"
},
{
"type": "field_variable",
"name": "LIST",
"variableTypes": [Blockly.LIST_VARIABLE_TYPE]
}
... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.DATA_ITEMOFLIST,
"args0": [
{
"type": "input_value",
"name": "INDEX"
},
{
"type": "field_variable",
"name": "LIST",
"variableTypes": [Blockly.LIST_VARIABLE_TYPE]
}
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"DATA_ITEMOFLIST",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"input_value\"",
",",
"\"name\"",
":",
"\"INDEX\"",
"}",
",",
"{",
"\"ty... | Block for reporting item of list.
@this Blockly.Block | [
"Block",
"for",
"reporting",
"item",
"of",
"list",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/data.js#L365-L384 | train | Block for the
. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
2951,
1035,
8875,
11253,
9863,
1010,
1000,
12098,
5620,
2692,
1000,
1024,
1031,
1063,
1000,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/ManagedObject.js | getStashedControls | function getStashedControls(sId) {
if (!StashedControlSupport) {
StashedControlSupport = sap.ui.require("sap/ui/core/StashedControlSupport");
}
if (StashedControlSupport) {
return StashedControlSupport.getStashedControls(sId);
}
return [];
} | javascript | function getStashedControls(sId) {
if (!StashedControlSupport) {
StashedControlSupport = sap.ui.require("sap/ui/core/StashedControlSupport");
}
if (StashedControlSupport) {
return StashedControlSupport.getStashedControls(sId);
}
return [];
} | [
"function",
"getStashedControls",
"(",
"sId",
")",
"{",
"if",
"(",
"!",
"StashedControlSupport",
")",
"{",
"StashedControlSupport",
"=",
"sap",
".",
"ui",
".",
"require",
"(",
"\"sap/ui/core/StashedControlSupport\"",
")",
";",
"}",
"if",
"(",
"StashedControlSuppor... | Returns an array of stashed child elements or an empty array if there are none.
@param {string} sId id of the object which should have stashed children
@return {sap.ui.core._StashedControl[]} array of stashed children
@private | [
"Returns",
"an",
"array",
"of",
"stashed",
"child",
"elements",
"or",
"an",
"empty",
"array",
"if",
"there",
"are",
"none",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ManagedObject.js#L970-L978 | train | Returns an array of all stashed control instances. | [
30522,
3853,
4152,
10230,
9072,
8663,
13181,
4877,
1006,
15765,
1007,
1063,
2065,
1006,
999,
2358,
11823,
2098,
8663,
13181,
4877,
6279,
6442,
1007,
1063,
2358,
11823,
2098,
8663,
13181,
4877,
6279,
6442,
1027,
20066,
1012,
21318,
1012,
547... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/yield-star-spacing.js | checkExpression | function checkExpression(node) {
if (!node.delegate) {
return;
}
const tokens = sourceCode.getFirstTokens(node, 3);
const yieldToken = tokens[0];
const starToken = tokens[1];
const nextToken = tokens[2];
checkSpacing("... | javascript | function checkExpression(node) {
if (!node.delegate) {
return;
}
const tokens = sourceCode.getFirstTokens(node, 3);
const yieldToken = tokens[0];
const starToken = tokens[1];
const nextToken = tokens[2];
checkSpacing("... | [
"function",
"checkExpression",
"(",
"node",
")",
"{",
"if",
"(",
"!",
"node",
".",
"delegate",
")",
"{",
"return",
";",
"}",
"const",
"tokens",
"=",
"sourceCode",
".",
"getFirstTokens",
"(",
"node",
",",
"3",
")",
";",
"const",
"yieldToken",
"=",
"toke... | Enforces the spacing around the star if node is a yield* expression.
@param {ASTNode} node A yield expression node.
@returns {void} | [
"Enforces",
"the",
"spacing",
"around",
"the",
"star",
"if",
"node",
"is",
"a",
"yield",
"*",
"expression",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/yield-star-spacing.js#L108-L120 | train | Check if the expression is a yield or a star expression. | [
30522,
3853,
4638,
10288,
20110,
3258,
1006,
13045,
1007,
1063,
2065,
1006,
999,
13045,
1012,
11849,
1007,
1063,
2709,
1025,
1065,
9530,
3367,
19204,
2015,
1027,
3120,
16044,
1012,
2131,
8873,
12096,
18715,
6132,
1006,
13045,
1010,
1017,
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... |
eslint/eslint | lib/rules/no-restricted-properties.js | checkPropertyAccess | function checkPropertyAccess(node, objectName, propertyName) {
if (propertyName === null) {
return;
}
const matchedObject = restrictedProperties.get(objectName);
const matchedObjectProperty = matchedObject ? matchedObject.get(propertyName) : globallyRestri... | javascript | function checkPropertyAccess(node, objectName, propertyName) {
if (propertyName === null) {
return;
}
const matchedObject = restrictedProperties.get(objectName);
const matchedObjectProperty = matchedObject ? matchedObject.get(propertyName) : globallyRestri... | [
"function",
"checkPropertyAccess",
"(",
"node",
",",
"objectName",
",",
"propertyName",
")",
"{",
"if",
"(",
"propertyName",
"===",
"null",
")",
"{",
"return",
";",
"}",
"const",
"matchedObject",
"=",
"restrictedProperties",
".",
"get",
"(",
"objectName",
")",... | Checks to see whether a property access is restricted, and reports it if so.
@param {ASTNode} node The node to report
@param {string} objectName The name of the object
@param {string} propertyName The name of the property
@returns {undefined} | [
"Checks",
"to",
"see",
"whether",
"a",
"property",
"access",
"is",
"restricted",
"and",
"reports",
"it",
"if",
"so",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-restricted-properties.js#L104-L138 | train | Check if a property is restricted from being used. | [
30522,
3853,
4638,
21572,
4842,
21426,
9468,
7971,
1006,
13045,
1010,
4874,
18442,
1010,
3200,
18442,
1007,
1063,
2065,
1006,
3200,
18442,
1027,
1027,
1027,
19701,
1007,
1063,
2709,
1025,
1065,
9530,
3367,
10349,
16429,
20614,
1027,
7775,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableUtils.js | function(oTable, row) {
if (isNaN(row)) {
var $Ref = jQuery(row);
row = parseInt($Ref.add($Ref.parent()).filter("[data-sap-ui-rowindex]").attr("data-sap-ui-rowindex"));
}
var iFixed = oTable.getFixedBottomRowCount() || 0;
return row == oTable.getVisibleRowCount() - iFixed - 1;
} | javascript | function(oTable, row) {
if (isNaN(row)) {
var $Ref = jQuery(row);
row = parseInt($Ref.add($Ref.parent()).filter("[data-sap-ui-rowindex]").attr("data-sap-ui-rowindex"));
}
var iFixed = oTable.getFixedBottomRowCount() || 0;
return row == oTable.getVisibleRowCount() - iFixed - 1;
} | [
"function",
"(",
"oTable",
",",
"row",
")",
"{",
"if",
"(",
"isNaN",
"(",
"row",
")",
")",
"{",
"var",
"$Ref",
"=",
"jQuery",
"(",
"row",
")",
";",
"row",
"=",
"parseInt",
"(",
"$Ref",
".",
"add",
"(",
"$Ref",
".",
"parent",
"(",
")",
")",
".... | Checks whether the cell of the given DOM reference is in the last row (from DOM point of view) of the scrollable area.
@param {sap.ui.table.Table} oTable Instance of the table.
@param {jQuery | HTMLElement | int} row The row element or row index.
@returns {boolean} Whether the row is the last scrollable row of the tab... | [
"Checks",
"whether",
"the",
"cell",
"of",
"the",
"given",
"DOM",
"reference",
"is",
"in",
"the",
"last",
"row",
"(",
"from",
"DOM",
"point",
"of",
"view",
")",
"of",
"the",
"scrollable",
"area",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L1009-L1016 | train | Returns true if the row is in the bottom of the table | [
30522,
3853,
1006,
27178,
3085,
1010,
5216,
1007,
1063,
2065,
1006,
3475,
2319,
1006,
5216,
1007,
1007,
1063,
13075,
1002,
25416,
1027,
1046,
4226,
2854,
1006,
5216,
1007,
1025,
5216,
1027,
11968,
20240,
3372,
1006,
1002,
25416,
1012,
5587,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
sass/node-sass | lib/index.js | getSourceMap | function getSourceMap(options) {
var sourceMap = options.sourceMap;
if (sourceMap && typeof sourceMap !== 'string' && options.outFile) {
sourceMap = options.outFile + '.map';
}
return sourceMap && typeof sourceMap === 'string' ? path.resolve(sourceMap) : null;
} | javascript | function getSourceMap(options) {
var sourceMap = options.sourceMap;
if (sourceMap && typeof sourceMap !== 'string' && options.outFile) {
sourceMap = options.outFile + '.map';
}
return sourceMap && typeof sourceMap === 'string' ? path.resolve(sourceMap) : null;
} | [
"function",
"getSourceMap",
"(",
"options",
")",
"{",
"var",
"sourceMap",
"=",
"options",
".",
"sourceMap",
";",
"if",
"(",
"sourceMap",
"&&",
"typeof",
"sourceMap",
"!==",
"'string'",
"&&",
"options",
".",
"outFile",
")",
"{",
"sourceMap",
"=",
"options",
... | Get source map
@param {Object} options
@api private | [
"Get",
"source",
"map"
] | 0c1a49eefa37544d16041c5fe5b2e3d9168004b7 | https://github.com/sass/node-sass/blob/0c1a49eefa37544d16041c5fe5b2e3d9168004b7/lib/index.js#L51-L59 | train | Get the source map path | [
30522,
3853,
4152,
8162,
3401,
2863,
2361,
1006,
7047,
1007,
1063,
13075,
3120,
2863,
2361,
1027,
7047,
1012,
3120,
2863,
2361,
1025,
2065,
1006,
3120,
2863,
2361,
1004,
1004,
2828,
11253,
3120,
2863,
2361,
999,
1027,
1027,
1005,
5164,
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... |
babel/babel | packages/babel-generator/src/generators/statements.js | getLastStatement | function getLastStatement(statement) {
if (!t.isStatement(statement.body)) return statement;
return getLastStatement(statement.body);
} | javascript | function getLastStatement(statement) {
if (!t.isStatement(statement.body)) return statement;
return getLastStatement(statement.body);
} | [
"function",
"getLastStatement",
"(",
"statement",
")",
"{",
"if",
"(",
"!",
"t",
".",
"isStatement",
"(",
"statement",
".",
"body",
")",
")",
"return",
"statement",
";",
"return",
"getLastStatement",
"(",
"statement",
".",
"body",
")",
";",
"}"
] | Recursively get the last statement. | [
"Recursively",
"get",
"the",
"last",
"statement",
"."
] | 1969e6b6aa7d90be3fbb3aca98ea96849656a55a | https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-generator/src/generators/statements.js#L45-L48 | train | Returns the last statement in the body of a given statement | [
30522,
3853,
2131,
8523,
3215,
12259,
3672,
1006,
4861,
1007,
1063,
2065,
1006,
999,
1056,
1012,
26354,
12259,
3672,
1006,
4861,
1012,
2303,
1007,
1007,
2709,
4861,
1025,
2709,
2131,
8523,
3215,
12259,
3672,
1006,
4861,
1012,
2303,
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... |
BlackrockDigital/startbootstrap-sb-admin-2 | vendor/chart.js/Chart.js | function(point, area) {
var epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.
return point.x > area.left - epsilon && point.x < area.right + epsilon &&
point.y > area.top - epsilon && point.y < area.bottom + epsilon;
} | javascript | function(point, area) {
var epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.
return point.x > area.left - epsilon && point.x < area.right + epsilon &&
point.y > area.top - epsilon && point.y < area.bottom + epsilon;
} | [
"function",
"(",
"point",
",",
"area",
")",
"{",
"var",
"epsilon",
"=",
"1e-6",
";",
"// 1e-6 is margin in pixels for accumulated error.",
"return",
"point",
".",
"x",
">",
"area",
".",
"left",
"-",
"epsilon",
"&&",
"point",
".",
"x",
"<",
"area",
".",
"ri... | Returns true if the point is inside the rectangle
@param {object} point - The point to test
@param {object} area - The rectangle
@returns {boolean}
@private | [
"Returns",
"true",
"if",
"the",
"point",
"is",
"inside",
"the",
"rectangle"
] | ddfaceb4a8e65a41f163e2fdc4eab49384b810a1 | https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/ddfaceb4a8e65a41f163e2fdc4eab49384b810a1/vendor/chart.js/Chart.js#L2458-L2463 | train | Check if point is within area | [
30522,
3853,
1006,
2391,
1010,
2181,
1007,
1063,
13075,
28038,
1027,
1015,
2063,
1011,
1020,
1025,
1013,
1013,
1015,
2063,
1011,
1020,
2003,
7785,
1999,
27725,
2005,
14830,
7561,
1012,
2709,
2391,
1012,
1060,
1028,
2181,
1012,
2187,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js | function (oTree) {
var sDebugString = this.toDebugInfo(oTree);
if (sDebugString === true) {
return 1;
} else if (sDebugString) {
return sDebugString.split(",").length;
}
return 0;
} | javascript | function (oTree) {
var sDebugString = this.toDebugInfo(oTree);
if (sDebugString === true) {
return 1;
} else if (sDebugString) {
return sDebugString.split(",").length;
}
return 0;
} | [
"function",
"(",
"oTree",
")",
"{",
"var",
"sDebugString",
"=",
"this",
".",
"toDebugInfo",
"(",
"oTree",
")",
";",
"if",
"(",
"sDebugString",
"===",
"true",
")",
"{",
"return",
"1",
";",
"}",
"else",
"if",
"(",
"sDebugString",
")",
"{",
"return",
"s... | Calculates the number of currently selected debug modules
@param {object} oTree The tree to be analyzed
@return {int} The amount of selected tree nodes | [
"Calculates",
"the",
"number",
"of",
"currently",
"selected",
"debug",
"modules"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L298-L307 | train | Returns the number of nodes in the tree that are not in debug info. | [
30522,
3853,
1006,
27178,
9910,
1007,
1063,
13075,
17371,
15878,
15916,
3367,
4892,
1027,
2023,
1012,
28681,
15878,
15916,
2378,
14876,
1006,
27178,
9910,
1007,
1025,
2065,
1006,
17371,
15878,
15916,
3367,
4892,
1027,
1027,
1027,
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... | |
eslint/eslint | lib/rules/function-paren-newline.js | getParenTokens | function getParenTokens(node) {
switch (node.type) {
case "NewExpression":
if (!node.arguments.length && !(
astUtils.isOpeningParenToken(sourceCode.getLastToken(node, { skip: 1 })) &&
astUtils.isClosingParenToken(sourceCode.... | javascript | function getParenTokens(node) {
switch (node.type) {
case "NewExpression":
if (!node.arguments.length && !(
astUtils.isOpeningParenToken(sourceCode.getLastToken(node, { skip: 1 })) &&
astUtils.isClosingParenToken(sourceCode.... | [
"function",
"getParenTokens",
"(",
"node",
")",
"{",
"switch",
"(",
"node",
".",
"type",
")",
"{",
"case",
"\"NewExpression\"",
":",
"if",
"(",
"!",
"node",
".",
"arguments",
".",
"length",
"&&",
"!",
"(",
"astUtils",
".",
"isOpeningParenToken",
"(",
"so... | Gets the left paren and right paren tokens of a node.
@param {ASTNode} node The node with parens
@returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token.
Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an Ar... | [
"Gets",
"the",
"left",
"paren",
"and",
"right",
"paren",
"tokens",
"of",
"a",
"node",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/function-paren-newline.js#L190-L238 | train | Gets the left and right parens of a given node | [
30522,
3853,
2131,
19362,
4765,
11045,
3619,
1006,
13045,
1007,
1063,
6942,
1006,
13045,
1012,
2828,
1007,
1063,
2553,
1000,
2047,
10288,
20110,
3258,
1000,
1024,
2065,
1006,
999,
13045,
1012,
9918,
1012,
3091,
1004,
1004,
999,
1006,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ccxt/ccxt | build/transpile.js | createFolderRecursively | function createFolderRecursively (folder) {
const parts = folder.split (path.sep)
for (let i = 1; i <= parts.length; i++) {
createFolder (path.join.apply (null, parts.slice (0, i)))
}
} | javascript | function createFolderRecursively (folder) {
const parts = folder.split (path.sep)
for (let i = 1; i <= parts.length; i++) {
createFolder (path.join.apply (null, parts.slice (0, i)))
}
} | [
"function",
"createFolderRecursively",
"(",
"folder",
")",
"{",
"const",
"parts",
"=",
"folder",
".",
"split",
"(",
"path",
".",
"sep",
")",
"for",
"(",
"let",
"i",
"=",
"1",
";",
"i",
"<=",
"parts",
".",
"length",
";",
"i",
"++",
")",
"{",
"create... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 8168069b9180a465532905e225586215e115a565 | https://github.com/ccxt/ccxt/blob/8168069b9180a465532905e225586215e115a565/build/transpile.js#L779-L786 | train | Create a folder recursively | [
30522,
3853,
3443,
10371,
28849,
10841,
2869,
14547,
1006,
19622,
1007,
1063,
9530,
3367,
3033,
1027,
19622,
1012,
3975,
1006,
4130,
1012,
19802,
1007,
2005,
1006,
2292,
1045,
1027,
1015,
1025,
1045,
1026,
1027,
3033,
1012,
3091,
1025,
1045... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js | function (oObject, sName) {
sName = sName === '/' ? '' : sName;
var aNames = sName.split('/'),
l = aNames.length, i;
if (l > 0) {
for (i = 0; oObject && i < l - 1; i++) {
if (!oObject[aNames[i]]) {
return false;
}
oObject = oObject[aNames[i]];
}
return oObject[aNames[l - 1... | javascript | function (oObject, sName) {
sName = sName === '/' ? '' : sName;
var aNames = sName.split('/'),
l = aNames.length, i;
if (l > 0) {
for (i = 0; oObject && i < l - 1; i++) {
if (!oObject[aNames[i]]) {
return false;
}
oObject = oObject[aNames[i]];
}
return oObject[aNames[l - 1... | [
"function",
"(",
"oObject",
",",
"sName",
")",
"{",
"sName",
"=",
"sName",
"===",
"'/'",
"?",
"''",
":",
"sName",
";",
"var",
"aNames",
"=",
"sName",
".",
"split",
"(",
"'/'",
")",
",",
"l",
"=",
"aNames",
".",
"length",
",",
"i",
";",
"if",
"(... | *
Gets the selection state for a package/module.
Package names must end with a slash, modules must not.
If an ancestor package of the package/module does not exists, undefined is returned.
@param {object} oObject The resulting hierarchy object
@param {string} sName The name to be set in the hierarchy
@returns {boolean}... | [
"*",
"Gets",
"the",
"selection",
"state",
"for",
"a",
"package",
"/",
"module",
".",
"Package",
"names",
"must",
"end",
"with",
"a",
"slash",
"modules",
"must",
"not",
".",
"If",
"an",
"ancestor",
"package",
"of",
"the",
"package",
"/",
"module",
"does",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L52-L66 | train | Returns the object with the given name | [
30522,
3853,
1006,
1051,
16429,
20614,
1010,
1055,
18442,
1007,
1063,
1055,
18442,
1027,
1055,
18442,
1027,
1027,
1027,
1005,
1013,
1005,
1029,
1005,
1005,
1024,
1055,
18442,
1025,
13075,
9617,
7834,
1027,
1055,
18442,
1012,
3975,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/events/jquery/EventSimulation.js | function(oEvent, oConfig) {
if (oEvent.isMarked("handledByTouchToMouse")) {
return;
}
oEvent.setMarked("handledByTouchToMouse");
var oNewStartEvent, oNewEndEvent, bSimulateClick;
function createNewEvent() {
return fnCreateNewEvent(oEvent, oConfig, oConfig.eventName === "mouseup" ? oEvent.change... | javascript | function(oEvent, oConfig) {
if (oEvent.isMarked("handledByTouchToMouse")) {
return;
}
oEvent.setMarked("handledByTouchToMouse");
var oNewStartEvent, oNewEndEvent, bSimulateClick;
function createNewEvent() {
return fnCreateNewEvent(oEvent, oConfig, oConfig.eventName === "mouseup" ? oEvent.change... | [
"function",
"(",
"oEvent",
",",
"oConfig",
")",
"{",
"if",
"(",
"oEvent",
".",
"isMarked",
"(",
"\"handledByTouchToMouse\"",
")",
")",
"{",
"return",
";",
"}",
"oEvent",
".",
"setMarked",
"(",
"\"handledByTouchToMouse\"",
")",
";",
"var",
"oNewStartEvent",
"... | This function simulates the corresponding mouse event by listening to touch event (touchstart, touchend, touchcancel).
The simulated event will be dispatch through UI5 event delegation which means that the on"EventName" function is called
on control's prototype.
@param {jQuery.Event} oEvent The original event object
... | [
"This",
"function",
"simulates",
"the",
"corresponding",
"mouse",
"event",
"by",
"listening",
"to",
"touch",
"event",
"(",
"touchstart",
"touchend",
"touchcancel",
")",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/jquery/EventSimulation.js#L298-L343 | train | This function is called when the mouse event is handled by touch. | [
30522,
3853,
1006,
1051,
18697,
3372,
1010,
1051,
8663,
8873,
2290,
1007,
1063,
2065,
1006,
1051,
18697,
3372,
1012,
2003,
10665,
2098,
1006,
1000,
8971,
3762,
24826,
10143,
19506,
8557,
1000,
1007,
1007,
1063,
2709,
1025,
1065,
1051,
18697... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js | function (oParent, sName, oObject, iIndex) {
var oOldAggregationValue = JsControlTreeModifier.getAggregation.call(this, oParent, sName);
JsControlTreeModifier.insertAggregation.apply(this, arguments);
if (oParent) {
if (oParent.getMetadata) {
var oMetadata = oParent.getMetadata();
var oAggregat... | javascript | function (oParent, sName, oObject, iIndex) {
var oOldAggregationValue = JsControlTreeModifier.getAggregation.call(this, oParent, sName);
JsControlTreeModifier.insertAggregation.apply(this, arguments);
if (oParent) {
if (oParent.getMetadata) {
var oMetadata = oParent.getMetadata();
var oAggregat... | [
"function",
"(",
"oParent",
",",
"sName",
",",
"oObject",
",",
"iIndex",
")",
"{",
"var",
"oOldAggregationValue",
"=",
"JsControlTreeModifier",
".",
"getAggregation",
".",
"call",
"(",
"this",
",",
"oParent",
",",
"sName",
")",
";",
"JsControlTreeModifier",
".... | Adds an additional item to the aggregation or changes it in case it is not a multiple one
Adds removeAggregation as the undo operation
@override | [
"Adds",
"an",
"additional",
"item",
"to",
"the",
"aggregation",
"or",
"changes",
"it",
"in",
"case",
"it",
"is",
"not",
"a",
"multiple",
"one",
"Adds",
"removeAggregation",
"as",
"the",
"undo",
"operation"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L261-L282 | train | Inserts an aggregation to the undo operation | [
30522,
3853,
1006,
6728,
12069,
3372,
1010,
1055,
18442,
1010,
1051,
16429,
20614,
1010,
2462,
13629,
2595,
1007,
1063,
13075,
1051,
11614,
8490,
17603,
12540,
10175,
5657,
1027,
1046,
9363,
3372,
13153,
13334,
5302,
4305,
8873,
2121,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
chriso/validator.js | lib/isEmail.js | isEmail | function isEmail(str, options) {
(0, _assertString.default)(str);
options = (0, _merge.default)(options, default_email_options);
if (options.require_display_name || options.allow_display_name) {
var display_email = str.match(displayName);
if (display_email) {
str = display_email[1];
} else if ... | javascript | function isEmail(str, options) {
(0, _assertString.default)(str);
options = (0, _merge.default)(options, default_email_options);
if (options.require_display_name || options.allow_display_name) {
var display_email = str.match(displayName);
if (display_email) {
str = display_email[1];
} else if ... | [
"function",
"isEmail",
"(",
"str",
",",
"options",
")",
"{",
"(",
"0",
",",
"_assertString",
".",
"default",
")",
"(",
"str",
")",
";",
"options",
"=",
"(",
"0",
",",
"_merge",
".",
"default",
")",
"(",
"options",
",",
"default_email_options",
")",
"... | /* eslint-enable max-len /* eslint-enable no-control-regex | [
"/",
"*",
"eslint",
"-",
"enable",
"max",
"-",
"len",
"/",
"*",
"eslint",
"-",
"enable",
"no",
"-",
"control",
"-",
"regex"
] | 63e4c78f07d08543af4be7b6c2c9cf24df009003 | https://github.com/chriso/validator.js/blob/63e4c78f07d08543af4be7b6c2c9cf24df009003/lib/isEmail.js#L40-L130 | train | Check if a string is an email address | [
30522,
3853,
2003,
14545,
4014,
1006,
2358,
2099,
1010,
7047,
1007,
1063,
1006,
1014,
1010,
1035,
19514,
18886,
3070,
1012,
12398,
1007,
1006,
2358,
2099,
1007,
1025,
7047,
1027,
1006,
1014,
1010,
1035,
13590,
1012,
12398,
1007,
1006,
7047,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | onApplyActionCode | function onApplyActionCode() {
var code = $('#email-verification-code').val();
auth.applyActionCode(code).then(function() {
alertSuccess('Email successfully verified!');
refreshUserData();
}, onAuthError);
} | javascript | function onApplyActionCode() {
var code = $('#email-verification-code').val();
auth.applyActionCode(code).then(function() {
alertSuccess('Email successfully verified!');
refreshUserData();
}, onAuthError);
} | [
"function",
"onApplyActionCode",
"(",
")",
"{",
"var",
"code",
"=",
"$",
"(",
"'#email-verification-code'",
")",
".",
"val",
"(",
")",
";",
"auth",
".",
"applyActionCode",
"(",
"code",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"alertSuccess",
"("... | Confirms the email verification code given. | [
"Confirms",
"the",
"email",
"verification",
"code",
"given",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L796-L802 | train | Apply the email verification code | [
30522,
3853,
2006,
29098,
2135,
18908,
3258,
16044,
1006,
1007,
1063,
13075,
3642,
1027,
1002,
1006,
1005,
1001,
10373,
1011,
22616,
1011,
3642,
1005,
1007,
1012,
11748,
1006,
1007,
1025,
8740,
2705,
1012,
6611,
18908,
3258,
16044,
1006,
36... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/type/Double.js | getFormatter | function getFormatter(oType) {
var oFormatOptions;
if (!oType.oFormat) {
oFormatOptions = jQuery.extend({groupingEnabled : true}, oType.oFormatOptions);
oType.oFormat = NumberFormat.getFloatInstance(oFormatOptions);
}
return oType.oFormat;
} | javascript | function getFormatter(oType) {
var oFormatOptions;
if (!oType.oFormat) {
oFormatOptions = jQuery.extend({groupingEnabled : true}, oType.oFormatOptions);
oType.oFormat = NumberFormat.getFloatInstance(oFormatOptions);
}
return oType.oFormat;
} | [
"function",
"getFormatter",
"(",
"oType",
")",
"{",
"var",
"oFormatOptions",
";",
"if",
"(",
"!",
"oType",
".",
"oFormat",
")",
"{",
"oFormatOptions",
"=",
"jQuery",
".",
"extend",
"(",
"{",
"groupingEnabled",
":",
"true",
"}",
",",
"oType",
".",
"oForma... | Returns the formatter. Creates it lazily.
@param {sap.ui.model.odata.type.Double} oType
the type instance
@returns {sap.ui.core.format.NumberFormat}
the formatter | [
"Returns",
"the",
"formatter",
".",
"Creates",
"it",
"lazily",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/Double.js#L34-L42 | train | Returns the formatter for the given type. | [
30522,
3853,
2131,
14192,
20097,
1006,
27178,
18863,
1007,
1063,
13075,
1997,
2953,
18900,
7361,
9285,
1025,
2065,
1006,
999,
27178,
18863,
1012,
1997,
2953,
18900,
1007,
1063,
1997,
2953,
18900,
7361,
9285,
1027,
1046,
4226,
2854,
1012,
79... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ViewUtils.js | scrollElementIntoView | function scrollElementIntoView($view, $element, scrollHorizontal) {
var elementOffset = $element.offset();
// scroll minimum amount
var elementRect = {
top: elementOffset.top,
left: elementOffset.left,
height: $element.height(),
... | javascript | function scrollElementIntoView($view, $element, scrollHorizontal) {
var elementOffset = $element.offset();
// scroll minimum amount
var elementRect = {
top: elementOffset.top,
left: elementOffset.left,
height: $element.height(),
... | [
"function",
"scrollElementIntoView",
"(",
"$view",
",",
"$element",
",",
"scrollHorizontal",
")",
"{",
"var",
"elementOffset",
"=",
"$element",
".",
"offset",
"(",
")",
";",
"// scroll minimum amount",
"var",
"elementRect",
"=",
"{",
"top",
":",
"elementOffset",
... | Within a scrolling DOMElement, if necessary, scroll element into viewport.
To Perform the minimum amount of scrolling necessary, cases should be handled as follows:
- element already completely in view : no scrolling
- element above viewport : scroll view so element is at top
- element left of viewport ... | [
"Within",
"a",
"scrolling",
"DOMElement",
"if",
"necessary",
"scroll",
"element",
"into",
"viewport",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ViewUtils.js#L362-L389 | train | scroll element into view | [
30522,
3853,
17186,
12260,
3672,
18447,
4492,
2666,
2860,
1006,
1002,
3193,
1010,
1002,
5783,
1010,
17186,
16368,
10993,
12162,
2389,
1007,
1063,
13075,
5783,
27475,
3388,
1027,
1002,
5783,
1012,
16396,
1006,
1007,
1025,
1013,
1013,
17186,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/file/FileUtils.js | writeText | function writeText(file, text, allowBlindWrite) {
var result = new $.Deferred(),
options = {};
if (allowBlindWrite) {
options.blind = true;
}
file.write(text, options, function (err) {
if (!err) {
result.resolve();
} else ... | javascript | function writeText(file, text, allowBlindWrite) {
var result = new $.Deferred(),
options = {};
if (allowBlindWrite) {
options.blind = true;
}
file.write(text, options, function (err) {
if (!err) {
result.resolve();
} else ... | [
"function",
"writeText",
"(",
"file",
",",
"text",
",",
"allowBlindWrite",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"options",
"=",
"{",
"}",
";",
"if",
"(",
"allowBlindWrite",
")",
"{",
"options",
".",
"blind",
"="... | Asynchronously writes a file as UTF-8 encoded text.
@param {!File} file File to write
@param {!string} text
@param {boolean=} allowBlindWrite Indicates whether or not CONTENTS_MODIFIED
errors---which can be triggered if the actual file contents differ from
the FileSystem's last-known contents---should be ignored.
@retu... | [
"Asynchronously",
"writes",
"a",
"file",
"as",
"UTF",
"-",
"8",
"encoded",
"text",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L101-L118 | train | write text to file | [
30522,
3853,
4339,
18209,
1006,
5371,
1010,
3793,
1010,
3499,
16558,
22254,
26373,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
7047,
1027,
1063,
1065,
1025,
2065,
1006,
3499,
16558,
22254,
26373,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.layout/src/sap/ui/layout/form/FormElement.js | _labelIsDisplayOnly | function _labelIsDisplayOnly(){
if (this.getDisplayOnly) {
if (!this.isPropertyInitial("displayOnly")) {
return this.getDisplayOnly();
}
var oFormElement = this.getParent();
var oFormContainer = oFormElement.getParent();
if (oFormContainer) {
var oForm = oFormContainer.getParent();
if (... | javascript | function _labelIsDisplayOnly(){
if (this.getDisplayOnly) {
if (!this.isPropertyInitial("displayOnly")) {
return this.getDisplayOnly();
}
var oFormElement = this.getParent();
var oFormContainer = oFormElement.getParent();
if (oFormContainer) {
var oForm = oFormContainer.getParent();
if (... | [
"function",
"_labelIsDisplayOnly",
"(",
")",
"{",
"if",
"(",
"this",
".",
"getDisplayOnly",
")",
"{",
"if",
"(",
"!",
"this",
".",
"isPropertyInitial",
"(",
"\"displayOnly\"",
")",
")",
"{",
"return",
"this",
".",
"getDisplayOnly",
"(",
")",
";",
"}",
"v... | /*
overwrite Labels isDisplayOnly function to use the editable property of the Form
to determine the mode.
If DisplayOnly is set explicitly on the Label, this is used. | [
"/",
"*",
"overwrite",
"Labels",
"isDisplayOnly",
"function",
"to",
"use",
"the",
"editable",
"property",
"of",
"the",
"Form",
"to",
"determine",
"the",
"mode",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.layout/src/sap/ui/layout/form/FormElement.js#L408-L429 | train | Returns true if the label is display only | [
30522,
3853,
1035,
3830,
2483,
10521,
13068,
2239,
2135,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
2131,
10521,
13068,
2239,
2135,
1007,
1063,
2065,
1006,
999,
2023,
1012,
2003,
21572,
4842,
3723,
5498,
20925,
1006,
1000,
4653,
2239,
2135,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dcloudio/mui | js/mui.ajax.js | function(error, type, xhr, settings) {
settings.error.call(settings.context, xhr, type, error);
ajaxComplete(type, xhr, settings);
} | javascript | function(error, type, xhr, settings) {
settings.error.call(settings.context, xhr, type, error);
ajaxComplete(type, xhr, settings);
} | [
"function",
"(",
"error",
",",
"type",
",",
"xhr",
",",
"settings",
")",
"{",
"settings",
".",
"error",
".",
"call",
"(",
"settings",
".",
"context",
",",
"xhr",
",",
"type",
",",
"error",
")",
";",
"ajaxComplete",
"(",
"type",
",",
"xhr",
",",
"se... | type: "timeout", "error", "abort", "parsererror" | [
"type",
":",
"timeout",
"error",
"abort",
"parsererror"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/js/mui.ajax.js#L47-L50 | train | Handle ajax error | [
30522,
3853,
1006,
7561,
1010,
2828,
1010,
1060,
8093,
1010,
10906,
1007,
1063,
10906,
1012,
7561,
1012,
2655,
1006,
10906,
1012,
6123,
1010,
1060,
8093,
1010,
2828,
30524,
2828,
1010,
1060,
8093,
1010,
10906,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
Microsoft/vscode | build/lib/bundle.js | positionToOffset | function positionToOffset(str, desiredLine, desiredCol) {
if (desiredLine === 1) {
return desiredCol - 1;
}
let line = 1;
let lastNewLineOffset = -1;
do {
if (desiredLine === line) {
return lastNewLineOffset + 1 + desiredCol - 1;
}
lastNewLineOffset = str.... | javascript | function positionToOffset(str, desiredLine, desiredCol) {
if (desiredLine === 1) {
return desiredCol - 1;
}
let line = 1;
let lastNewLineOffset = -1;
do {
if (desiredLine === line) {
return lastNewLineOffset + 1 + desiredCol - 1;
}
lastNewLineOffset = str.... | [
"function",
"positionToOffset",
"(",
"str",
",",
"desiredLine",
",",
"desiredCol",
")",
"{",
"if",
"(",
"desiredLine",
"===",
"1",
")",
"{",
"return",
"desiredCol",
"-",
"1",
";",
"}",
"let",
"line",
"=",
"1",
";",
"let",
"lastNewLineOffset",
"=",
"-",
... | Convert a position (line:col) to (offset) in string `str` | [
"Convert",
"a",
"position",
"(",
"line",
":",
"col",
")",
"to",
"(",
"offset",
")",
"in",
"string",
"str"
] | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/build/lib/bundle.js#L386-L400 | train | Returns the offset of the first line of the string that is at the given position. | [
30522,
3853,
2597,
3406,
27475,
3388,
1006,
2358,
2099,
1010,
9059,
4179,
1010,
30524,
1011,
1015,
1025,
1065,
2292,
2240,
1027,
1015,
1025,
2292,
2197,
2638,
13668,
3170,
27475,
3388,
1027,
1011,
1015,
1025,
2079,
1063,
2065,
1006,
9059,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
vuejs/vue-cli | packages/@vue/cli/bin/vue.js | cleanArgs | function cleanArgs (cmd) {
const args = {}
cmd.options.forEach(o => {
const key = camelize(o.long.replace(/^--/, ''))
// if an option is not present and Command has a method with the same name
// it should not be copied
if (typeof cmd[key] !== 'function' && typeof cmd[key] !== 'undefined') {
a... | javascript | function cleanArgs (cmd) {
const args = {}
cmd.options.forEach(o => {
const key = camelize(o.long.replace(/^--/, ''))
// if an option is not present and Command has a method with the same name
// it should not be copied
if (typeof cmd[key] !== 'function' && typeof cmd[key] !== 'undefined') {
a... | [
"function",
"cleanArgs",
"(",
"cmd",
")",
"{",
"const",
"args",
"=",
"{",
"}",
"cmd",
".",
"options",
".",
"forEach",
"(",
"o",
"=>",
"{",
"const",
"key",
"=",
"camelize",
"(",
"o",
".",
"long",
".",
"replace",
"(",
"/",
"^--",
"/",
",",
"''",
... | commander passes the Command object itself as options, extract only actual options into a fresh object. | [
"commander",
"passes",
"the",
"Command",
"object",
"itself",
"as",
"options",
"extract",
"only",
"actual",
"options",
"into",
"a",
"fresh",
"object",
"."
] | 206803cbefefdfbc7d8ed12440b0b751688b77b2 | https://github.com/vuejs/vue-cli/blob/206803cbefefdfbc7d8ed12440b0b751688b77b2/packages/@vue/cli/bin/vue.js#L239-L250 | train | clean args from command | [
30522,
3853,
4550,
2906,
5620,
1006,
4642,
2094,
1007,
1063,
9530,
3367,
12098,
5620,
1027,
1063,
1065,
4642,
2094,
1012,
7047,
1012,
18921,
6776,
1006,
1051,
1027,
1028,
1063,
9530,
3367,
3145,
1027,
19130,
4697,
1006,
1051,
1012,
2146,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/table/tableRangeHandler.js | _expandColMergedRange | function _expandColMergedRange(tableData, tableRange, rowIndex, colIndex) {
const rowData = tableData[rowIndex];
const cellData = rowData[colIndex];
const {colMergeWith} = cellData;
let lastColMergedIndex = -1;
if (util.isExisty(colMergeWith)) {
if (colMergeWith < tableRange.start.colIndex) {
table... | javascript | function _expandColMergedRange(tableData, tableRange, rowIndex, colIndex) {
const rowData = tableData[rowIndex];
const cellData = rowData[colIndex];
const {colMergeWith} = cellData;
let lastColMergedIndex = -1;
if (util.isExisty(colMergeWith)) {
if (colMergeWith < tableRange.start.colIndex) {
table... | [
"function",
"_expandColMergedRange",
"(",
"tableData",
",",
"tableRange",
",",
"rowIndex",
",",
"colIndex",
")",
"{",
"const",
"rowData",
"=",
"tableData",
"[",
"rowIndex",
"]",
";",
"const",
"cellData",
"=",
"rowData",
"[",
"colIndex",
"]",
";",
"const",
"{... | Expand table range by column merge properties like colspan, colMergeWith.
@param {Array.<Array.<object>>} tableData - table data
@param {{
start: {rowIndex: number, colIndex: number},
end: {rowIndex: number, colIndex: number}
}} tableRange - table range
@param {number} rowIndex - row index
@param {number} colIndex - co... | [
"Expand",
"table",
"range",
"by",
"column",
"merge",
"properties",
"like",
"colspan",
"colMergeWith",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/tableRangeHandler.js#L101-L120 | train | Expand the col merged range | [
30522,
3853,
1035,
7818,
25778,
5017,
5999,
24388,
2063,
1006,
2795,
2850,
2696,
1010,
2795,
24388,
2063,
1010,
5216,
22254,
10288,
1010,
6972,
3207,
2595,
1007,
1063,
9530,
3367,
5216,
2850,
2696,
1027,
2795,
30524,
2197,
25778,
5017,
5999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(element)
{
var list = element.mxListenerList;
if (list != null)
{
while (list.length > 0)
{
var entry = list[0];
mxEvent.removeListener(element, entry.name, entry.f);
}
}
} | javascript | function(element)
{
var list = element.mxListenerList;
if (list != null)
{
while (list.length > 0)
{
var entry = list[0];
mxEvent.removeListener(element, entry.name, entry.f);
}
}
} | [
"function",
"(",
"element",
")",
"{",
"var",
"list",
"=",
"element",
".",
"mxListenerList",
";",
"if",
"(",
"list",
"!=",
"null",
")",
"{",
"while",
"(",
"list",
".",
"length",
">",
"0",
")",
"{",
"var",
"entry",
"=",
"list",
"[",
"0",
"]",
";",
... | Function: removeAllListeners
Removes all listeners from the given element. | [
"Function",
":",
"removeAllListeners"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L9508-L9520 | train | Removes the listener for the specified element | [
30522,
3853,
1006,
5783,
1007,
1063,
13075,
2862,
1027,
5783,
1012,
25630,
9863,
24454,
9863,
1025,
2065,
1006,
2862,
999,
1027,
19701,
1007,
1063,
2096,
1006,
2862,
1012,
3091,
1028,
1014,
1007,
1063,
13075,
4443,
1027,
2862,
1031,
1014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | aStar | function aStar(options) {
var cy = this.cy();
var _aStarDefaults = aStarDefaults(options),
root = _aStarDefaults.root,
goal = _aStarDefaults.goal,
heuristic = _aStarDefaults.heuristic,
directed = _aStarDefaults.directed,
weight = _aStarDefaults.weight;
root = cy.col... | javascript | function aStar(options) {
var cy = this.cy();
var _aStarDefaults = aStarDefaults(options),
root = _aStarDefaults.root,
goal = _aStarDefaults.goal,
heuristic = _aStarDefaults.heuristic,
directed = _aStarDefaults.directed,
weight = _aStarDefaults.weight;
root = cy.col... | [
"function",
"aStar",
"(",
"options",
")",
"{",
"var",
"cy",
"=",
"this",
".",
"cy",
"(",
")",
";",
"var",
"_aStarDefaults",
"=",
"aStarDefaults",
"(",
"options",
")",
",",
"root",
"=",
"_aStarDefaults",
".",
"root",
",",
"goal",
"=",
"_aStarDefaults",
... | Implemented from pseudocode from wikipedia | [
"Implemented",
"from",
"pseudocode",
"from",
"wikipedia"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L1559-L1707 | train | A - Triangle Strength algorithm | [
30522,
3853,
2004,
7559,
1006,
7047,
1007,
1063,
13075,
22330,
1027,
2023,
1012,
22330,
1006,
1007,
1025,
13075,
1035,
2004,
7559,
3207,
7011,
11314,
2015,
1027,
2004,
7559,
3207,
7011,
11314,
2015,
1006,
7047,
1007,
1010,
7117,
1027,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/ExpressionParser.js | parse | function parse(aTokens, sInput, mGlobals) {
var fnFormatter,
iNextToken = 0,
oParser = {
advance: advance,
current: current,
expression: expression,
globals: mGlobals,
input: sInput
},
oToken;
/**
* Returns the next token in the array of tokens and advances the index in this arra... | javascript | function parse(aTokens, sInput, mGlobals) {
var fnFormatter,
iNextToken = 0,
oParser = {
advance: advance,
current: current,
expression: expression,
globals: mGlobals,
input: sInput
},
oToken;
/**
* Returns the next token in the array of tokens and advances the index in this arra... | [
"function",
"parse",
"(",
"aTokens",
",",
"sInput",
",",
"mGlobals",
")",
"{",
"var",
"fnFormatter",
",",
"iNextToken",
"=",
"0",
",",
"oParser",
"=",
"{",
"advance",
":",
"advance",
",",
"current",
":",
"current",
",",
"expression",
":",
"expression",
"... | Parses expression tokens to a result object as specified to be returned by
{@link sap.ui.base.ExpressionParser#parse}.
@param {object[]} aTokens - the array with the tokens
@param {string} sInput - the expression string (used when logging errors)
@param {object} mGlobals - the map of global variables
@returns {object} ... | [
"Parses",
"expression",
"tokens",
"to",
"a",
"result",
"object",
"as",
"specified",
"to",
"be",
"returned",
"by",
"{"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ExpressionParser.js#L715-L795 | train | Parses an array of tokens and returns the next token in the array. | [
30522,
3853,
11968,
3366,
1006,
2012,
11045,
3619,
1010,
8254,
18780,
1010,
11460,
4135,
10264,
2015,
1007,
1063,
13075,
1042,
2078,
14192,
20097,
1010,
1999,
10288,
9284,
7520,
1027,
1014,
1010,
6728,
11650,
2121,
1027,
1063,
5083,
1024,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/computed-property-spacing.js | reportNoBeginningSpace | function reportNoBeginningSpace(node, token, tokenAfter) {
context.report({
node,
loc: token.loc.start,
messageId: "unexpectedSpaceAfter",
data: {
tokenValue: token.value
},
fix(fixer) {
... | javascript | function reportNoBeginningSpace(node, token, tokenAfter) {
context.report({
node,
loc: token.loc.start,
messageId: "unexpectedSpaceAfter",
data: {
tokenValue: token.value
},
fix(fixer) {
... | [
"function",
"reportNoBeginningSpace",
"(",
"node",
",",
"token",
",",
"tokenAfter",
")",
"{",
"context",
".",
"report",
"(",
"{",
"node",
",",
"loc",
":",
"token",
".",
"loc",
".",
"start",
",",
"messageId",
":",
"\"unexpectedSpaceAfter\"",
",",
"data",
":... | -------------------------------------------------------------------------- Helpers --------------------------------------------------------------------------
Reports that there shouldn't be a space after the first token
@param {ASTNode} node - The node to report in the event of an error.
@param {Token} token - The tok... | [
"--------------------------------------------------------------------------",
"Helpers",
"--------------------------------------------------------------------------",
"Reports",
"that",
"there",
"shouldn",
"t",
"be",
"a",
"space",
"after",
"the",
"first",
"token"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/computed-property-spacing.js#L56-L68 | train | Reports an unexpected space after the given token. | [
30522,
3853,
3189,
25083,
13910,
23111,
8613,
15327,
1006,
13045,
1010,
19204,
1010,
19204,
10354,
3334,
1007,
1063,
6123,
1012,
3189,
1006,
1063,
13045,
1010,
8840,
2278,
1024,
19204,
1012,
8840,
2278,
1012,
2707,
1010,
4471,
3593,
1024,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
emberjs/ember.js | bin/build-for-publishing.js | updateDocumentationVersion | function updateDocumentationVersion() {
let docsPath = path.join(__dirname, '..', 'docs', 'data.json');
let contents = fs.readFileSync(docsPath, { encoding: 'utf-8' });
let docs = JSON.parse(contents);
docs.project.version = buildInfo.version;
fs.writeFileSync(docsPath, JSON.stringify(docs, null, 2), {
e... | javascript | function updateDocumentationVersion() {
let docsPath = path.join(__dirname, '..', 'docs', 'data.json');
let contents = fs.readFileSync(docsPath, { encoding: 'utf-8' });
let docs = JSON.parse(contents);
docs.project.version = buildInfo.version;
fs.writeFileSync(docsPath, JSON.stringify(docs, null, 2), {
e... | [
"function",
"updateDocumentationVersion",
"(",
")",
"{",
"let",
"docsPath",
"=",
"path",
".",
"join",
"(",
"__dirname",
",",
"'..'",
",",
"'docs'",
",",
"'data.json'",
")",
";",
"let",
"contents",
"=",
"fs",
".",
"readFileSync",
"(",
"docsPath",
",",
"{",
... | /*
Updates the version number listed within the docs/data.json file to match
`Ember.VERSION` and `package.json` version.
This is needed because ember-cli-yuidoc automatically sets the version string
property in the generated `docs/data.json` to
`${packageJsonVersion}.${gitSha}`. | [
"/",
"*",
"Updates",
"the",
"version",
"number",
"listed",
"within",
"the",
"docs",
"/",
"data",
".",
"json",
"file",
"to",
"match",
"Ember",
".",
"VERSION",
"and",
"package",
".",
"json",
"version",
"."
] | 7ef1d08b7fe44000cf97b3c43566d20337b0683d | https://github.com/emberjs/ember.js/blob/7ef1d08b7fe44000cf97b3c43566d20337b0683d/bin/build-for-publishing.js#L44-L53 | train | Update the documentation version | [
30522,
3853,
7172,
10085,
27417,
12516,
27774,
1006,
1007,
1063,
2292,
9986,
13102,
8988,
1027,
4130,
1012,
3693,
1006,
1035,
1035,
16101,
18442,
1010,
1005,
1012,
1012,
1005,
1010,
1005,
9986,
2015,
1005,
1010,
1005,
2951,
1012,
1046,
3385... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | addDescendantsToDrag | function addDescendantsToDrag(node, opts) {
if (!node.cy().hasCompoundNodes()) {
return;
}
if (opts.inDragLayer == null && opts.addToList == null) {
return;
} // nothing to do
var innerNodes = node.descendants();
if (opts.inDragLayer) {
innerNodes.forEach(setInDragLayer);
... | javascript | function addDescendantsToDrag(node, opts) {
if (!node.cy().hasCompoundNodes()) {
return;
}
if (opts.inDragLayer == null && opts.addToList == null) {
return;
} // nothing to do
var innerNodes = node.descendants();
if (opts.inDragLayer) {
innerNodes.forEach(setInDragLayer);
... | [
"function",
"addDescendantsToDrag",
"(",
"node",
",",
"opts",
")",
"{",
"if",
"(",
"!",
"node",
".",
"cy",
"(",
")",
".",
"hasCompoundNodes",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"opts",
".",
"inDragLayer",
"==",
"null",
"&&",
"opts",
... | helper function to determine which child nodes and inner edges of a compound node to be dragged as well as the grabbed and selected nodes | [
"helper",
"function",
"to",
"determine",
"which",
"child",
"nodes",
"and",
"inner",
"edges",
"of",
"a",
"compound",
"node",
"to",
"be",
"dragged",
"as",
"well",
"as",
"the",
"grabbed",
"and",
"selected",
"nodes"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L23284-L23304 | train | Add all descendant nodes to the drag layer | [
30522,
3853,
5587,
6155,
23865,
11390,
3406,
7265,
2290,
1006,
13045,
1010,
23569,
2015,
1007,
1063,
2065,
1006,
999,
13045,
1012,
22330,
1006,
1007,
1012,
30524,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
23569,
2015,
1012,
27427,
29181,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
google/material-design-lite | src/mdlComponentHandler.js | registerUpgradedCallbackInternal | function registerUpgradedCallbackInternal(jsClass, callback) {
var regClass = findRegisteredClass_(jsClass);
if (regClass) {
regClass.callbacks.push(callback);
}
} | javascript | function registerUpgradedCallbackInternal(jsClass, callback) {
var regClass = findRegisteredClass_(jsClass);
if (regClass) {
regClass.callbacks.push(callback);
}
} | [
"function",
"registerUpgradedCallbackInternal",
"(",
"jsClass",
",",
"callback",
")",
"{",
"var",
"regClass",
"=",
"findRegisteredClass_",
"(",
"jsClass",
")",
";",
"if",
"(",
"regClass",
")",
"{",
"regClass",
".",
"callbacks",
".",
"push",
"(",
"callback",
")... | Allows user to be alerted to any upgrades that are performed for a given
component type
@param {string} jsClass The class name of the MDL component we wish
to hook into for any upgrades performed.
@param {function(!HTMLElement)} callback The function to call upon an
upgrade. This function should expect 1 parameter - t... | [
"Allows",
"user",
"to",
"be",
"alerted",
"to",
"any",
"upgrades",
"that",
"are",
"performed",
"for",
"a",
"given",
"component",
"type"
] | 60f441a22ed98ed2c03f6179adf460d888bf459f | https://github.com/google/material-design-lite/blob/60f441a22ed98ed2c03f6179adf460d888bf459f/src/mdlComponentHandler.js#L346-L351 | train | Register a callback for a upgraded class | [
30522,
3853,
4236,
6279,
24170,
16409,
8095,
5963,
18447,
11795,
2389,
1006,
1046,
11020,
27102,
1010,
2655,
5963,
1007,
1063,
13075,
19723,
26266,
1027,
2424,
2890,
24063,
6850,
26266,
1035,
1006,
1046,
11020,
27102,
1007,
1025,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/tabs/js/tabsController.js | previousPage | function previousPage () {
if (!ctrl.canPageBack()) { return; }
var newOffset = MdTabsPaginationService.decreasePageOffset(getElements(), ctrl.offsetLeft);
// Set the new offset
ctrl.offsetLeft = fixOffset(newOffset);
} | javascript | function previousPage () {
if (!ctrl.canPageBack()) { return; }
var newOffset = MdTabsPaginationService.decreasePageOffset(getElements(), ctrl.offsetLeft);
// Set the new offset
ctrl.offsetLeft = fixOffset(newOffset);
} | [
"function",
"previousPage",
"(",
")",
"{",
"if",
"(",
"!",
"ctrl",
".",
"canPageBack",
"(",
")",
")",
"{",
"return",
";",
"}",
"var",
"newOffset",
"=",
"MdTabsPaginationService",
".",
"decreasePageOffset",
"(",
"getElements",
"(",
")",
",",
"ctrl",
".",
... | Slides the tabs over approximately one page backward. | [
"Slides",
"the",
"tabs",
"over",
"approximately",
"one",
"page",
"backward",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L377-L384 | train | Change the offsetLeft of the previous page | [
30522,
3853,
3025,
13704,
1006,
1007,
1063,
2065,
1006,
999,
14931,
12190,
1012,
2064,
13704,
5963,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
13075,
2047,
27475,
3388,
1027,
9108,
2696,
5910,
4502,
20876,
9285,
2121,
7903,
2063,
1012,
9885,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
testing-library/dom-testing-library | src/queries/label-text.js | getAllByLabelText | function getAllByLabelText(container, text, ...rest) {
const els = queryAllByLabelText(container, text, ...rest)
if (!els.length) {
const labels = queryAllLabelsByText(container, text, ...rest)
if (labels.length) {
throw getElementError(
`Found a label with the text of: ${text}, however no for... | javascript | function getAllByLabelText(container, text, ...rest) {
const els = queryAllByLabelText(container, text, ...rest)
if (!els.length) {
const labels = queryAllLabelsByText(container, text, ...rest)
if (labels.length) {
throw getElementError(
`Found a label with the text of: ${text}, however no for... | [
"function",
"getAllByLabelText",
"(",
"container",
",",
"text",
",",
"...",
"rest",
")",
"{",
"const",
"els",
"=",
"queryAllByLabelText",
"(",
"container",
",",
"text",
",",
"...",
"rest",
")",
"if",
"(",
"!",
"els",
".",
"length",
")",
"{",
"const",
"... | the getAll* query would normally look like this: const getAllByLabelText = makeGetAllQuery( queryAllByLabelText, (c, text) => `Unable to find a label with the text of: ${text}`, ) however, we can give a more helpful error message than the generic one, so we're writing this one out by hand. | [
"the",
"getAll",
"*",
"query",
"would",
"normally",
"look",
"like",
"this",
":",
"const",
"getAllByLabelText",
"=",
"makeGetAllQuery",
"(",
"queryAllByLabelText",
"(",
"c",
"text",
")",
"=",
">",
"Unable",
"to",
"find",
"a",
"label",
"with",
"the",
"text",
... | fcb2cbcffb7aff6ecff3be8731168c86eee82ce1 | https://github.com/testing-library/dom-testing-library/blob/fcb2cbcffb7aff6ecff3be8731168c86eee82ce1/src/queries/label-text.js#L94-L111 | train | Returns all elements with the given text | [
30522,
3853,
2131,
8095,
3762,
20470,
20042,
10288,
2102,
1006,
11661,
1010,
3793,
1010,
1012,
1012,
1012,
2717,
1007,
1063,
9530,
3367,
3449,
2015,
1027,
23032,
8095,
3762,
20470,
20042,
10288,
2102,
1006,
11661,
1010,
3793,
1010,
1012,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | mxTerminalChange | function mxTerminalChange(model, cell, terminal, source)
{
this.model = model;
this.cell = cell;
this.terminal = terminal;
this.previous = terminal;
this.source = source;
} | javascript | function mxTerminalChange(model, cell, terminal, source)
{
this.model = model;
this.cell = cell;
this.terminal = terminal;
this.previous = terminal;
this.source = source;
} | [
"function",
"mxTerminalChange",
"(",
"model",
",",
"cell",
",",
"terminal",
",",
"source",
")",
"{",
"this",
".",
"model",
"=",
"model",
";",
"this",
".",
"cell",
"=",
"cell",
";",
"this",
".",
"terminal",
"=",
"terminal",
";",
"this",
".",
"previous",... | Class: mxTerminalChange
Action to change a terminal in a model.
Constructor: mxTerminalChange
Constructs a change of a terminal in the
specified model. | [
"Class",
":",
"mxTerminalChange"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L41707-L41714 | train | This is the main entry point of the terminal change event. It is called by the mxTerminalChange constructor. | [
30522,
3853,
25630,
3334,
22311,
29358,
22043,
1006,
2944,
1010,
3526,
1010,
5536,
1010,
3120,
1007,
1063,
2023,
1012,
2944,
1027,
2944,
1025,
2023,
1012,
3526,
1027,
3526,
1025,
2023,
1012,
5536,
1027,
5536,
1025,
2023,
1012,
3025,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js | missingValue | function missingValue(oValue, sSegment, iPathLength) {
var sPropertyPath = "",
sReadLink,
sServiceUrl;
if (sPath[0] !== '(') {
sPropertyPath += "/";
}
sPropertyPath += sPath.split("/").slice(0, iPathLength).join("/");
return that.oRequestor.getModelInterface()
.fetchMetadata(that.sMetaPa... | javascript | function missingValue(oValue, sSegment, iPathLength) {
var sPropertyPath = "",
sReadLink,
sServiceUrl;
if (sPath[0] !== '(') {
sPropertyPath += "/";
}
sPropertyPath += sPath.split("/").slice(0, iPathLength).join("/");
return that.oRequestor.getModelInterface()
.fetchMetadata(that.sMetaPa... | [
"function",
"missingValue",
"(",
"oValue",
",",
"sSegment",
",",
"iPathLength",
")",
"{",
"var",
"sPropertyPath",
"=",
"\"\"",
",",
"sReadLink",
",",
"sServiceUrl",
";",
"if",
"(",
"sPath",
"[",
"0",
"]",
"!==",
"'('",
")",
"{",
"sPropertyPath",
"+=",
"\... | Determine the implicit value if the value is missing in the cache. Report an invalid segment if there is no implicit value. | [
"Determine",
"the",
"implicit",
"value",
"if",
"the",
"value",
"is",
"missing",
"in",
"the",
"cache",
".",
"Report",
"an",
"invalid",
"segment",
"if",
"there",
"is",
"no",
"implicit",
"value",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js#L429-L466 | train | Returns the missing value if the given value is missing. | [
30522,
3853,
4394,
10175,
5657,
1006,
9242,
5657,
1010,
7020,
13910,
3672,
1010,
24531,
2705,
7770,
13512,
2232,
1007,
1063,
13075,
11867,
18981,
15010,
15069,
1027,
1000,
1000,
1010,
5034,
13775,
13767,
1010,
7020,
2121,
7903,
11236,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/editor/CSSInlineEditor.js | _getSelectorName | function _getSelectorName(editor, pos) {
var tagInfo = HTMLUtils.getTagInfo(editor, pos),
selectorName = "",
reason;
if (tagInfo.position.tokenType === HTMLUtils.TAG_NAME || tagInfo.position.tokenType === HTMLUtils.CLOSING_TAG) {
// Type selector
selector... | javascript | function _getSelectorName(editor, pos) {
var tagInfo = HTMLUtils.getTagInfo(editor, pos),
selectorName = "",
reason;
if (tagInfo.position.tokenType === HTMLUtils.TAG_NAME || tagInfo.position.tokenType === HTMLUtils.CLOSING_TAG) {
// Type selector
selector... | [
"function",
"_getSelectorName",
"(",
"editor",
",",
"pos",
")",
"{",
"var",
"tagInfo",
"=",
"HTMLUtils",
".",
"getTagInfo",
"(",
"editor",
",",
"pos",
")",
",",
"selectorName",
"=",
"\"\"",
",",
"reason",
";",
"if",
"(",
"tagInfo",
".",
"position",
".",
... | Given a position in an HTML editor, returns the relevant selector for the attribute/tag
surrounding that position, or "" if none is found.
@param {!Editor} editor
@param {!{line:Number, ch:Number}} pos
@return {selectorName: {string}, reason: {string}}
@private | [
"Given",
"a",
"position",
"in",
"an",
"HTML",
"editor",
"returns",
"the",
"relevant",
"selector",
"for",
"the",
"attribute",
"/",
"tag",
"surrounding",
"that",
"position",
"or",
"if",
"none",
"is",
"found",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CSSInlineEditor.js#L60-L111 | train | Get selector name from tag position | [
30522,
3853,
1035,
4152,
12260,
16761,
18442,
1006,
3559,
1010,
13433,
2015,
1007,
1063,
13075,
6415,
2378,
14876,
1027,
16129,
21823,
4877,
1012,
2131,
15900,
2378,
14876,
1006,
3559,
1010,
13433,
2015,
1007,
1010,
27000,
18442,
1027,
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... |
apache/incubator-echarts | src/chart/sunburst/SunburstPiece.js | getRootId | function getRootId(node) {
var ancestor = node;
while (ancestor.depth > 1) {
ancestor = ancestor.parentNode;
}
var virtualRoot = node.getAncestors()[0];
return zrUtil.indexOf(virtualRoot.children, ancestor);
} | javascript | function getRootId(node) {
var ancestor = node;
while (ancestor.depth > 1) {
ancestor = ancestor.parentNode;
}
var virtualRoot = node.getAncestors()[0];
return zrUtil.indexOf(virtualRoot.children, ancestor);
} | [
"function",
"getRootId",
"(",
"node",
")",
"{",
"var",
"ancestor",
"=",
"node",
";",
"while",
"(",
"ancestor",
".",
"depth",
">",
"1",
")",
"{",
"ancestor",
"=",
"ancestor",
".",
"parentNode",
";",
"}",
"var",
"virtualRoot",
"=",
"node",
".",
"getAnces... | Get index of root in sorted order
@param {TreeNode} node current node
@return {number} index in root | [
"Get",
"index",
"of",
"root",
"in",
"sorted",
"order"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sunburst/SunburstPiece.js#L392-L400 | train | Get the root id of a node | [
30522,
3853,
2131,
3217,
4140,
3593,
1006,
13045,
1007,
1063,
13075,
13032,
1027,
13045,
1025,
2096,
1006,
13032,
1012,
5995,
1028,
1015,
1007,
1063,
13032,
1027,
13032,
1012,
6687,
3630,
3207,
1025,
1065,
13075,
7484,
3217,
4140,
1027,
130... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
lovell/sharp | lib/input.js | clone | function clone () {
const that = this;
// Clone existing options
const clone = this.constructor.call();
clone.options = Object.assign({}, this.options);
// Pass 'finish' event to clone for Stream-based input
if (this._isStreamInput()) {
this.on('finish', function () {
// Clone inherits input data
... | javascript | function clone () {
const that = this;
// Clone existing options
const clone = this.constructor.call();
clone.options = Object.assign({}, this.options);
// Pass 'finish' event to clone for Stream-based input
if (this._isStreamInput()) {
this.on('finish', function () {
// Clone inherits input data
... | [
"function",
"clone",
"(",
")",
"{",
"const",
"that",
"=",
"this",
";",
"// Clone existing options",
"const",
"clone",
"=",
"this",
".",
"constructor",
".",
"call",
"(",
")",
";",
"clone",
".",
"options",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
","... | Take a "snapshot" of the Sharp instance, returning a new instance.
Cloned instances inherit the input of their parent instance.
This allows multiple output Streams and therefore multiple processing pipelines to share a single input Stream.
@example
const pipeline = sharp().rotate();
pipeline.clone().resize(800, 600).p... | [
"Take",
"a",
"snapshot",
"of",
"the",
"Sharp",
"instance",
"returning",
"a",
"new",
"instance",
".",
"Cloned",
"instances",
"inherit",
"the",
"input",
"of",
"their",
"parent",
"instance",
".",
"This",
"allows",
"multiple",
"output",
"Streams",
"and",
"therefor... | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/input.js#L167-L182 | train | Clone the object | [
30522,
3853,
17598,
1006,
1007,
1063,
9530,
3367,
2008,
1027,
2023,
1025,
1013,
1013,
17598,
4493,
7047,
9530,
3367,
17598,
1027,
2023,
1012,
9570,
2953,
1012,
2655,
1006,
1007,
1025,
17598,
1012,
7047,
1027,
4874,
1012,
23911,
1006,
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... |
juliangarnier/anime | src/index.js | setTargetsValue | function setTargetsValue(targets, properties) {
const animatables = getAnimatables(targets);
animatables.forEach(animatable => {
for (let property in properties) {
const value = getFunctionValue(properties[property], animatable);
const target = animatable.target;
const valueUnit = getUnit(valu... | javascript | function setTargetsValue(targets, properties) {
const animatables = getAnimatables(targets);
animatables.forEach(animatable => {
for (let property in properties) {
const value = getFunctionValue(properties[property], animatable);
const target = animatable.target;
const valueUnit = getUnit(valu... | [
"function",
"setTargetsValue",
"(",
"targets",
",",
"properties",
")",
"{",
"const",
"animatables",
"=",
"getAnimatables",
"(",
"targets",
")",
";",
"animatables",
".",
"forEach",
"(",
"animatable",
"=>",
"{",
"for",
"(",
"let",
"property",
"in",
"properties",... | Set Value helper | [
"Set",
"Value",
"helper"
] | 875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a | https://github.com/juliangarnier/anime/blob/875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a/src/index.js#L777-L791 | train | Set the value of all targets in the given object | [
30522,
3853,
2275,
7559,
18150,
2015,
10175,
5657,
1006,
7889,
1010,
5144,
1007,
1063,
9530,
3367,
2019,
9581,
10880,
2015,
1027,
2131,
7088,
21022,
13510,
1006,
7889,
1007,
1025,
2019,
9581,
10880,
2015,
1012,
18921,
6776,
1006,
2019,
9581... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | function( a, traditional ) {
var s = [];
// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = jQuery.ajaxSettings.traditional;
}
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray(a) || a.jquery ) {
// S... | javascript | function( a, traditional ) {
var s = [];
// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = jQuery.ajaxSettings.traditional;
}
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray(a) || a.jquery ) {
// S... | [
"function",
"(",
"a",
",",
"traditional",
")",
"{",
"var",
"s",
"=",
"[",
"]",
";",
"// Set traditional to true for jQuery <= 1.3.2 behavior.",
"if",
"(",
"traditional",
"===",
"undefined",
")",
"{",
"traditional",
"=",
"jQuery",
".",
"ajaxSettings",
".",
"tradi... | Serialize an array of form elements or a set of key/values into a query string | [
"Serialize",
"an",
"array",
"of",
"form",
"elements",
"or",
"a",
"set",
"of",
"key",
"/",
"values",
"into",
"a",
"query",
"string"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L7817-L7879 | train | Serialize an array of form elements | [
30522,
3853,
1006,
1037,
1010,
3151,
1007,
1063,
13075,
1055,
1027,
1031,
1033,
1025,
1013,
1013,
2275,
3151,
2000,
2995,
2005,
1046,
4226,
2854,
1026,
1027,
1015,
1012,
1017,
1012,
1016,
5248,
1012,
2065,
1006,
3151,
1027,
1027,
1027,
61... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/autocomplete/js/autocompleteDirective.js | MdAutocomplete | function MdAutocomplete ($$mdSvgRegistry) {
var REPEAT_STANDARD = 'standard';
var REPEAT_VIRTUAL = 'virtual';
var REPEAT_MODES = [REPEAT_STANDARD, REPEAT_VIRTUAL];
/** get a valid repeat mode from an md-mode attribute string. */
function getRepeatMode(modeStr) {
if (!modeStr) { return REPEAT_VIRTUAL; }
... | javascript | function MdAutocomplete ($$mdSvgRegistry) {
var REPEAT_STANDARD = 'standard';
var REPEAT_VIRTUAL = 'virtual';
var REPEAT_MODES = [REPEAT_STANDARD, REPEAT_VIRTUAL];
/** get a valid repeat mode from an md-mode attribute string. */
function getRepeatMode(modeStr) {
if (!modeStr) { return REPEAT_VIRTUAL; }
... | [
"function",
"MdAutocomplete",
"(",
"$$mdSvgRegistry",
")",
"{",
"var",
"REPEAT_STANDARD",
"=",
"'standard'",
";",
"var",
"REPEAT_VIRTUAL",
"=",
"'virtual'",
";",
"var",
"REPEAT_MODES",
"=",
"[",
"REPEAT_STANDARD",
",",
"REPEAT_VIRTUAL",
"]",
";",
"/** get a valid re... | @ngdoc directive
@name mdAutocomplete
@module material.components.autocomplete
@description
`<md-autocomplete>` is a special input component with a drop-down of all possible matches to a
custom query. This component allows you to provide real-time suggestions as the user types
in the input area.
To start, you will ne... | [
"@ngdoc",
"directive",
"@name",
"mdAutocomplete",
"@module",
"material",
".",
"components",
".",
"autocomplete"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/autocomplete/js/autocompleteDirective.js#L292-L547 | train | Augment the md - autocomplete attribute | [
30522,
3853,
9108,
4887,
3406,
9006,
10814,
2618,
1006,
1002,
1002,
9108,
2015,
2615,
17603,
24063,
2854,
1007,
1063,
13075,
9377,
1035,
3115,
1027,
1005,
3115,
1005,
1025,
13075,
9377,
1035,
7484,
1027,
1005,
7484,
1005,
1025,
13075,
9377,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/CodeFolding/foldhelpers/foldgutter.js | moveRange | function moveRange(range, numLines) {
return {from: CodeMirror.Pos(range.from.line + numLines, range.from.ch),
to: CodeMirror.Pos(range.to.line + numLines, range.to.ch)};
} | javascript | function moveRange(range, numLines) {
return {from: CodeMirror.Pos(range.from.line + numLines, range.from.ch),
to: CodeMirror.Pos(range.to.line + numLines, range.to.ch)};
} | [
"function",
"moveRange",
"(",
"range",
",",
"numLines",
")",
"{",
"return",
"{",
"from",
":",
"CodeMirror",
".",
"Pos",
"(",
"range",
".",
"from",
".",
"line",
"+",
"numLines",
",",
"range",
".",
"from",
".",
"ch",
")",
",",
"to",
":",
"CodeMirror",
... | Helper function to move a fold range object by the specified number of lines
@param {Object} range An object specifying the fold range to move. It contains {from, to} which are CodeMirror.Pos objects.
@param {Number} numLines A positive or negative number representing the numbe of lines to move the range by | [
"Helper",
"function",
"to",
"move",
"a",
"fold",
"range",
"object",
"by",
"the",
"specified",
"number",
"of",
"lines"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L190-L193 | train | Move the given range to the next line | [
30522,
3853,
2693,
24388,
2063,
1006,
2846,
1010,
16371,
19968,
10586,
1007,
1063,
2709,
1063,
2013,
1024,
3642,
14503,
29165,
1012,
13433,
2015,
1006,
2846,
1012,
2013,
1012,
2240,
1009,
16371,
19968,
10586,
1010,
2846,
1012,
2013,
1012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
NetEase/pomelo | lib/connectors/hybrid/tcpsocket.js | function(socket, data, offset) {
var hlen = socket.headSize - socket.headOffset;
var dlen = data.length - offset;
var len = Math.min(hlen, dlen);
var dend = offset + len;
data.copy(socket.headBuffer, socket.headOffset, offset, dend);
socket.headOffset += len;
if(socket.headOffset === socket.headSize) {
... | javascript | function(socket, data, offset) {
var hlen = socket.headSize - socket.headOffset;
var dlen = data.length - offset;
var len = Math.min(hlen, dlen);
var dend = offset + len;
data.copy(socket.headBuffer, socket.headOffset, offset, dend);
socket.headOffset += len;
if(socket.headOffset === socket.headSize) {
... | [
"function",
"(",
"socket",
",",
"data",
",",
"offset",
")",
"{",
"var",
"hlen",
"=",
"socket",
".",
"headSize",
"-",
"socket",
".",
"headOffset",
";",
"var",
"dlen",
"=",
"data",
".",
"length",
"-",
"offset",
";",
"var",
"len",
"=",
"Math",
".",
"m... | Read head segment from data to socket.headBuffer.
@param {Object} socket Socket instance
@param {Object} data Buffer instance
@param {Number} offset offset read star from data
@return {Number} new offset of data after read | [
"Read",
"head",
"segment",
"from",
"data",
"to",
"socket",
".",
"headBuffer",
"."
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/connectors/hybrid/tcpsocket.js#L129-L160 | train | read the head message | [
30522,
3853,
1006,
22278,
1010,
2951,
1010,
16396,
1007,
1063,
13075,
1044,
7770,
1027,
22278,
1012,
4641,
4697,
1011,
22278,
1012,
2132,
27475,
3388,
1025,
13075,
21469,
2368,
1027,
2951,
1012,
3091,
1011,
16396,
1025,
13075,
18798,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aframevr/aframe | src/systems/material.js | function (src, data, handleImageTextureLoaded) {
var hash = this.hash(data);
var textureCache = this.textureCache;
// Texture already being loaded or already loaded. Wait on promise.
if (textureCache[hash]) {
textureCache[hash].then(handleImageTextureLoaded);
return;
}
// Texture n... | javascript | function (src, data, handleImageTextureLoaded) {
var hash = this.hash(data);
var textureCache = this.textureCache;
// Texture already being loaded or already loaded. Wait on promise.
if (textureCache[hash]) {
textureCache[hash].then(handleImageTextureLoaded);
return;
}
// Texture n... | [
"function",
"(",
"src",
",",
"data",
",",
"handleImageTextureLoaded",
")",
"{",
"var",
"hash",
"=",
"this",
".",
"hash",
"(",
"data",
")",
";",
"var",
"textureCache",
"=",
"this",
".",
"textureCache",
";",
"// Texture already being loaded or already loaded. Wait o... | High-level function for loading image textures (THREE.Texture).
@param {Element|string} src - Texture source.
@param {object} data - Texture data.
@param {function} cb - Callback to pass texture to. | [
"High",
"-",
"level",
"function",
"for",
"loading",
"image",
"textures",
"(",
"THREE",
".",
"Texture",
")",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/systems/material.js#L79-L92 | train | Load an image texture | [
30522,
3853,
1006,
5034,
2278,
1010,
2951,
1010,
5047,
9581,
18150,
10288,
11244,
17468,
1007,
1063,
13075,
23325,
1027,
2023,
1012,
23325,
1006,
2951,
1007,
1025,
13075,
14902,
3540,
30524,
1025,
2709,
1025,
1065,
1013,
1013,
14902,
2025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
wuchangming/spy-debugger | buildin_modules/weinre/web/client/UglifyJS/process.js | Scope | function Scope(parent) {
this.names = {}; // names defined in this scope
this.mangled = {}; // mangled names (orig.name => mangled)
this.rev_mangled = {}; // reverse lookup (mangled => orig.name)
this.cname = -1; // current mangled name
this.refs = {}; ... | javascript | function Scope(parent) {
this.names = {}; // names defined in this scope
this.mangled = {}; // mangled names (orig.name => mangled)
this.rev_mangled = {}; // reverse lookup (mangled => orig.name)
this.cname = -1; // current mangled name
this.refs = {}; ... | [
"function",
"Scope",
"(",
"parent",
")",
"{",
"this",
".",
"names",
"=",
"{",
"}",
";",
"// names defined in this scope",
"this",
".",
"mangled",
"=",
"{",
"}",
";",
"// mangled names (orig.name => mangled)",
"this",
".",
"rev_mangled",
"=",
"{",
"}",
";",
"... | /* -----[ Scope and mangling ]----- | [
"/",
"*",
"-----",
"[",
"Scope",
"and",
"mangling",
"]",
"-----"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/client/UglifyJS/process.js#L253-L269 | train | Scope constructor. | [
30522,
3853,
9531,
1006,
6687,
1007,
1063,
2023,
1012,
3415,
1027,
1063,
1065,
1025,
1013,
1013,
3415,
4225,
1999,
2023,
9531,
2023,
1012,
2158,
11533,
1027,
1063,
1065,
1025,
1013,
1013,
2158,
11533,
3415,
1006,
2030,
8004,
1012,
2171,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cytoscape/cytoscape.js | src/collection/index.js | function( cy, elements, options ){
if( cy === undefined || !is.core( cy ) ){
util.error( 'A collection must have a reference to the core' );
return;
}
let map = new Map();
let createdElements = false;
if( !elements ){
elements = [];
} else if( elements.length > 0 && is.plainObject( elements[0]... | javascript | function( cy, elements, options ){
if( cy === undefined || !is.core( cy ) ){
util.error( 'A collection must have a reference to the core' );
return;
}
let map = new Map();
let createdElements = false;
if( !elements ){
elements = [];
} else if( elements.length > 0 && is.plainObject( elements[0]... | [
"function",
"(",
"cy",
",",
"elements",
",",
"options",
")",
"{",
"if",
"(",
"cy",
"===",
"undefined",
"||",
"!",
"is",
".",
"core",
"(",
"cy",
")",
")",
"{",
"util",
".",
"error",
"(",
"'A collection must have a reference to the core'",
")",
";",
"retur... | represents a set of nodes, edges, or both together | [
"represents",
"a",
"set",
"of",
"nodes",
"edges",
"or",
"both",
"together"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/src/collection/index.js#L38-L108 | train | Creates an array of elements from a json object | [
30522,
3853,
1006,
22330,
1010,
3787,
1010,
7047,
1007,
1063,
2065,
1006,
22330,
1027,
1027,
1027,
6151,
28344,
1064,
1064,
999,
2003,
1012,
4563,
1006,
22330,
1007,
1007,
1063,
21183,
4014,
1012,
7561,
1006,
1005,
1037,
3074,
2442,
2031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/dom/containsOrEquals.js | function(oDomRefContainer, oDomRefChild) {
if (oDomRefChild && oDomRefContainer && oDomRefChild != document && oDomRefChild != window) {
return (oDomRefContainer === oDomRefChild) || jQuery.contains(oDomRefContainer, oDomRefChild);
}
return false;
} | javascript | function(oDomRefContainer, oDomRefChild) {
if (oDomRefChild && oDomRefContainer && oDomRefChild != document && oDomRefChild != window) {
return (oDomRefContainer === oDomRefChild) || jQuery.contains(oDomRefContainer, oDomRefChild);
}
return false;
} | [
"function",
"(",
"oDomRefContainer",
",",
"oDomRefChild",
")",
"{",
"if",
"(",
"oDomRefChild",
"&&",
"oDomRefContainer",
"&&",
"oDomRefChild",
"!=",
"document",
"&&",
"oDomRefChild",
"!=",
"window",
")",
"{",
"return",
"(",
"oDomRefContainer",
"===",
"oDomRefChild... | Returns whether <code>oDomRefChild</code> is contained in or equal to <code>oDomRefContainer</code>.
This is a browser-independent version of the <code>.contains</code> method of Internet Explorer.
For compatibility reasons it returns <code>true</code> if <code>oDomRefContainer</code> and
<code>oDomRefChild</code> are... | [
"Returns",
"whether",
"<code",
">",
"oDomRefChild<",
"/",
"code",
">",
"is",
"contained",
"in",
"or",
"equal",
"to",
"<code",
">",
"oDomRefContainer<",
"/",
"code",
">",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/dom/containsOrEquals.js#L25-L30 | train | Returns true if the given DOM reference is a descendant of the given DOM reference. | [
30522,
3853,
1006,
1051,
9527,
2890,
11329,
12162,
18175,
2099,
1010,
1051,
9527,
2890,
11329,
19466,
2094,
1007,
1063,
2065,
1006,
1051,
9527,
2890,
11329,
19466,
2094,
1004,
1004,
1051,
9527,
2890,
11329,
12162,
18175,
2099,
1004,
1004,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
verdaccio/verdaccio | src/lib/logger.js | setup | function setup(logs) {
const streams = [];
if (logs == null) {
logs = [{ type: 'stdout', format: 'pretty', level: 'http' }];
}
logs.forEach(function(target) {
let level = target.level || 35;
if (level === 'http') {
level = 35;
}
// create a stream for each log configuration
if (t... | javascript | function setup(logs) {
const streams = [];
if (logs == null) {
logs = [{ type: 'stdout', format: 'pretty', level: 'http' }];
}
logs.forEach(function(target) {
let level = target.level || 35;
if (level === 'http') {
level = 35;
}
// create a stream for each log configuration
if (t... | [
"function",
"setup",
"(",
"logs",
")",
"{",
"const",
"streams",
"=",
"[",
"]",
";",
"if",
"(",
"logs",
"==",
"null",
")",
"{",
"logs",
"=",
"[",
"{",
"type",
":",
"'stdout'",
",",
"format",
":",
"'pretty'",
",",
"level",
":",
"'http'",
"}",
"]",
... | Setup the Buyan logger
@param {*} logs list of log configuration | [
"Setup",
"the",
"Buyan",
"logger"
] | daa7e897b6d093bf8282ff12df3f450bcd73476c | https://github.com/verdaccio/verdaccio/blob/daa7e897b6d093bf8282ff12df3f450bcd73476c/src/lib/logger.js#L54-L150 | train | Creates a stream for the given logs | [
30522,
3853,
16437,
1006,
15664,
1007,
1063,
9530,
3367,
9199,
1027,
1031,
1033,
1025,
2065,
1006,
15664,
1027,
1027,
19701,
1007,
1063,
15664,
1027,
1031,
1063,
2828,
1024,
1005,
2358,
26797,
2102,
1005,
1010,
4289,
1024,
1005,
3492,
1005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/dom-utils.js | DOMWalker | function DOMWalker(controller, callbackFilter, callbackNodeTest,
callbackResults) {
this._controller = controller;
this._callbackFilter = callbackFilter;
this._callbackNodeTest = callbackNodeTest;
this._callbackResults = callbackResults;
} | javascript | function DOMWalker(controller, callbackFilter, callbackNodeTest,
callbackResults) {
this._controller = controller;
this._callbackFilter = callbackFilter;
this._callbackNodeTest = callbackNodeTest;
this._callbackResults = callbackResults;
} | [
"function",
"DOMWalker",
"(",
"controller",
",",
"callbackFilter",
",",
"callbackNodeTest",
",",
"callbackResults",
")",
"{",
"this",
".",
"_controller",
"=",
"controller",
";",
"this",
".",
"_callbackFilter",
"=",
"callbackFilter",
";",
"this",
".",
"_callbackNod... | DOMWalker Constructor
@param {MozMillController} controller
MozMill controller of the window to operate on.
@param {Function} callbackFilter
callback-method to filter nodes
@param {Function} callbackNodeTest
callback-method to test accepted nodes
@param {Function} callbackResults
callback-method to process the results... | [
"DOMWalker",
"Constructor"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/dom-utils.js#L79-L86 | train | DOMWalker constructor. | [
30522,
3853,
14383,
26965,
1006,
11486,
1010,
2655,
5963,
8873,
21928,
1010,
2655,
5963,
3630,
3207,
22199,
1010,
2655,
5963,
6072,
11314,
2015,
1007,
1063,
2023,
1012,
1035,
11486,
1027,
11486,
1025,
2023,
1012,
1035,
2655,
5963,
8873,
219... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/InlineColorEditor/ColorEditor.js | ColorEditor | function ColorEditor($parent, color, callback, swatches) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(ColorEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
this._handleKeydown = th... | javascript | function ColorEditor($parent, color, callback, swatches) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(ColorEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
this._handleKeydown = th... | [
"function",
"ColorEditor",
"(",
"$parent",
",",
"color",
",",
"callback",
",",
"swatches",
")",
"{",
"// Create the DOM structure, filling in localized strings via Mustache",
"this",
".",
"$element",
"=",
"$",
"(",
"Mustache",
".",
"render",
"(",
"ColorEditorTemplate",
... | Color picker control; may be used standalone or within an InlineColorEditor inline widget.
@param {!jQuery} $parent DOM node into which to append the root of the color picker UI
@param {!string} color Initially selected color
@param {!function(string)} callback Called whenever selected color changes
@param {!Array.<... | [
"Color",
"picker",
"control",
";",
"may",
"be",
"used",
"standalone",
"or",
"within",
"an",
"InlineColorEditor",
"inline",
"widget",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineColorEditor/ColorEditor.js#L106-L159 | train | ColorEditor constructor. | [
30522,
3853,
6910,
15660,
1006,
1002,
6687,
1010,
3609,
1010,
2655,
5963,
1010,
25414,
8376,
1007,
1063,
1013,
1013,
3443,
1996,
14383,
3252,
1010,
8110,
1999,
22574,
7817,
3081,
28786,
2023,
1012,
1002,
5783,
1027,
1002,
1006,
28786,
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/LiveDevServerManager.js | getServer | function getServer(localPath) {
var provider, server, i;
for (i = 0; i < _serverProviders.length; i++) {
provider = _serverProviders[i];
server = provider.create();
if (server.canServe(localPath)) {
return server;
}
}
ret... | javascript | function getServer(localPath) {
var provider, server, i;
for (i = 0; i < _serverProviders.length; i++) {
provider = _serverProviders[i];
server = provider.create();
if (server.canServe(localPath)) {
return server;
}
}
ret... | [
"function",
"getServer",
"(",
"localPath",
")",
"{",
"var",
"provider",
",",
"server",
",",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"_serverProviders",
".",
"length",
";",
"i",
"++",
")",
"{",
"provider",
"=",
"_serverProviders",
"[",
"i"... | Determines which provider can serve a file with a local path.
@param {string} localPath A local path to file being served.
@return {?BaseServer} A server no null if no servers can serve the file | [
"Determines",
"which",
"provider",
"can",
"serve",
"a",
"file",
"with",
"a",
"local",
"path",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevServerManager.js#L63-L76 | train | Get a server instance from the list of server providers | [
30522,
3853,
4152,
2121,
6299,
1006,
2334,
15069,
1007,
1063,
13075,
10802,
1010,
8241,
1010,
1045,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
1035,
8241,
21572,
17258,
2545,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
10802,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wangfupeng1988/wangEditor | src/js/menus/fontSize/index.js | FontSize | function FontSize(editor) {
this.editor = editor
this.$elem = $('<div class="w-e-menu"><i class="w-e-icon-text-heigh"></i></div>')
this.type = 'droplist'
// 当前是否 active 状态
this._active = false
// 初始化 droplist
this.droplist = new DropList(this, {
width: 160,
$title: $('<p>字号... | javascript | function FontSize(editor) {
this.editor = editor
this.$elem = $('<div class="w-e-menu"><i class="w-e-icon-text-heigh"></i></div>')
this.type = 'droplist'
// 当前是否 active 状态
this._active = false
// 初始化 droplist
this.droplist = new DropList(this, {
width: 160,
$title: $('<p>字号... | [
"function",
"FontSize",
"(",
"editor",
")",
"{",
"this",
".",
"editor",
"=",
"editor",
"this",
".",
"$elem",
"=",
"$",
"(",
"'<div class=\"w-e-menu\"><i class=\"w-e-icon-text-heigh\"></i></div>'",
")",
"this",
".",
"type",
"=",
"'droplist'",
"// 当前是否 active 状态",
"th... | 构造函数 | [
"构造函数"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/menus/fontSize/index.js#L9-L35 | train | Font size 对象 | [
30522,
3853,
15489,
5332,
4371,
1006,
3559,
1007,
1063,
2023,
1012,
3559,
1027,
3559,
2023,
1012,
1002,
3449,
6633,
1027,
1002,
1006,
1005,
1026,
4487,
2615,
2465,
1027,
1000,
1059,
1011,
1041,
1011,
12183,
1000,
1028,
1026,
1045,
2465,
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-core/scripts/htmlutils.js | clone | function clone(orig) {
var copy;
switch(typeof(orig)) {
case 'object':
copy = (orig.length) ? [] : {};
for (var attr in orig) {
copy[attr] = clone(orig[attr]);
}
break;
default:
copy = orig;
break;
}
... | javascript | function clone(orig) {
var copy;
switch(typeof(orig)) {
case 'object':
copy = (orig.length) ? [] : {};
for (var attr in orig) {
copy[attr] = clone(orig[attr]);
}
break;
default:
copy = orig;
break;
}
... | [
"function",
"clone",
"(",
"orig",
")",
"{",
"var",
"copy",
";",
"switch",
"(",
"typeof",
"(",
"orig",
")",
")",
"{",
"case",
"'object'",
":",
"copy",
"=",
"(",
"orig",
".",
"length",
")",
"?",
"[",
"]",
":",
"{",
"}",
";",
"for",
"(",
"var",
... | Create a clone of an object and return it. This is a deep copy of everything
but functions, whose references are copied. You shouldn't expect a deep copy
of functions anyway.
@param orig the original object to copy
@return a deep copy of the original object. Any functions attached,
however, will have their refer... | [
"Create",
"a",
"clone",
"of",
"an",
"object",
"and",
"return",
"it",
".",
"This",
"is",
"a",
"deep",
"copy",
"of",
"everything",
"but",
"functions",
"whose",
"references",
"are",
"copied",
".",
"You",
"shouldn",
"t",
"expect",
"a",
"deep",
"copy",
"of",
... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L2339-L2353 | train | Clone an object | [
30522,
3853,
17598,
1006,
2030,
8004,
1007,
1063,
13075,
6100,
1025,
6942,
1006,
2828,
11253,
1006,
2030,
8004,
1007,
1007,
1063,
2553,
1005,
4874,
1005,
1024,
6100,
1027,
1006,
2030,
8004,
1012,
3091,
1007,
1029,
1031,
1033,
1024,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/InAppNotifications/main.js | checkForNotification | function checkForNotification(versionInfoUrl) {
var result = new $.Deferred();
_getNotificationInformation(versionInfoUrl)
.done(function (notificationInfo) {
// Get all available notifications
var notifications = notificationInfo.notifications;
... | javascript | function checkForNotification(versionInfoUrl) {
var result = new $.Deferred();
_getNotificationInformation(versionInfoUrl)
.done(function (notificationInfo) {
// Get all available notifications
var notifications = notificationInfo.notifications;
... | [
"function",
"checkForNotification",
"(",
"versionInfoUrl",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"_getNotificationInformation",
"(",
"versionInfoUrl",
")",
".",
"done",
"(",
"function",
"(",
"notificationInfo",
")",
"{",
"... | Check for notifications, notification overlays are always displayed
@return {$.Promise} jQuery Promise object that is resolved or rejected after the notification check is complete. | [
"Check",
"for",
"notifications",
"notification",
"overlays",
"are",
"always",
"displayed"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InAppNotifications/main.js#L157-L192 | train | Checks if the user has been notified on a notification | [
30522,
3853,
4638,
29278,
17048,
9031,
1006,
2544,
2378,
14876,
3126,
2140,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
1035,
2131,
17048,
9031,
2378,
14192,
3370,
1006,
2544,
2378,
14876,
3126,
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... |
moleculerjs/moleculer | bin/moleculer-runner.js | mergeOptions | function mergeOptions() {
config = _.defaultsDeep(configFile, Moleculer.ServiceBroker.defaultOptions);
if (config.logger == null && !flags.silent)
config.logger = console;
function normalizeEnvValue(value) {
if (value.toLowerCase() === "true" || value.toLowerCase() === "false") {
// Convert to boolean
va... | javascript | function mergeOptions() {
config = _.defaultsDeep(configFile, Moleculer.ServiceBroker.defaultOptions);
if (config.logger == null && !flags.silent)
config.logger = console;
function normalizeEnvValue(value) {
if (value.toLowerCase() === "true" || value.toLowerCase() === "false") {
// Convert to boolean
va... | [
"function",
"mergeOptions",
"(",
")",
"{",
"config",
"=",
"_",
".",
"defaultsDeep",
"(",
"configFile",
",",
"Moleculer",
".",
"ServiceBroker",
".",
"defaultOptions",
")",
";",
"if",
"(",
"config",
".",
"logger",
"==",
"null",
"&&",
"!",
"flags",
".",
"si... | Merge broker options
Merge options from environment variables and config file. First
load the config file if exists. After it overwrite the vars from
the environment values.
Example options:
Original broker option: `logLevel`
Config file property: `logLevel`
Env variable: `LOGLEVEL`
Original broker option: `circ... | [
"Merge",
"broker",
"options"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/bin/moleculer-runner.js#L172-L243 | train | Merge options from config file | [
30522,
3853,
13590,
7361,
9285,
1006,
1007,
1063,
9530,
8873,
2290,
1027,
1035,
1012,
12398,
16150,
4402,
2361,
1006,
9530,
8873,
25708,
9463,
1010,
13922,
2099,
1012,
2326,
12618,
5484,
1012,
12398,
7361,
9285,
1007,
1025,
2065,
1006,
9530... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.