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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/jquery-mobile-custom.js | function( el, defaultTheme ) {
var e = el[ 0 ],
ltr = "",
re = /ui-(bar|body|overlay)-([a-z])\b/,
c, m;
while ( e ) {
c = e.className || "";
if ( c && ( m = re.exec( c ) ) && ( ltr = m[ 2 ] ) ) {
// We found a parent with a theme class
// on it so bail from this loop.
break;
... | javascript | function( el, defaultTheme ) {
var e = el[ 0 ],
ltr = "",
re = /ui-(bar|body|overlay)-([a-z])\b/,
c, m;
while ( e ) {
c = e.className || "";
if ( c && ( m = re.exec( c ) ) && ( ltr = m[ 2 ] ) ) {
// We found a parent with a theme class
// on it so bail from this loop.
break;
... | [
"function",
"(",
"el",
",",
"defaultTheme",
")",
"{",
"var",
"e",
"=",
"el",
"[",
"0",
"]",
",",
"ltr",
"=",
"\"\"",
",",
"re",
"=",
"/",
"ui-(bar|body|overlay)-([a-z])\\b",
"/",
",",
"c",
",",
"m",
";",
"while",
"(",
"e",
")",
"{",
"c",
"=",
"... | Find the closest parent with a theme class on it. Note that we are not using $.fn.closest() on purpose here because this method gets called quite a bit and we need it to be as fast as possible. | [
"Find",
"the",
"closest",
"parent",
"with",
"a",
"theme",
"class",
"on",
"it",
".",
"Note",
"that",
"we",
"are",
"not",
"using",
"$",
".",
"fn",
".",
"closest",
"()",
"on",
"purpose",
"here",
"because",
"this",
"method",
"gets",
"called",
"quite",
"a",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jquery-mobile-custom.js#L474-L495 | train | Returns the theme letter of the specified element. | [
30522,
3853,
1006,
3449,
1010,
12398,
10760,
4168,
1007,
1063,
13075,
1041,
1027,
3449,
1031,
1014,
1033,
30524,
1027,
1041,
1012,
2465,
18442,
1064,
1064,
1000,
1000,
1025,
2065,
1006,
1039,
1004,
1004,
1006,
1049,
1027,
2128,
1012,
4654,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/autocomplete/js/autocompleteController.js | cleanup | function cleanup () {
if (!ctrl.hidden) {
$mdUtil.enableScrolling();
}
angular.element($window).off('resize', debouncedOnResize);
if (elements){
var items = ['ul', 'scroller', 'scrollContainer', 'input'];
angular.forEach(items, function(key){
elements.$[key].remove();
}... | javascript | function cleanup () {
if (!ctrl.hidden) {
$mdUtil.enableScrolling();
}
angular.element($window).off('resize', debouncedOnResize);
if (elements){
var items = ['ul', 'scroller', 'scrollContainer', 'input'];
angular.forEach(items, function(key){
elements.$[key].remove();
}... | [
"function",
"cleanup",
"(",
")",
"{",
"if",
"(",
"!",
"ctrl",
".",
"hidden",
")",
"{",
"$mdUtil",
".",
"enableScrolling",
"(",
")",
";",
"}",
"angular",
".",
"element",
"(",
"$window",
")",
".",
"off",
"(",
"'resize'",
",",
"debouncedOnResize",
")",
... | Removes any events or leftover elements created by this controller | [
"Removes",
"any",
"events",
"or",
"leftover",
"elements",
"created",
"by",
"this",
"controller"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/autocomplete/js/autocompleteController.js#L254-L267 | train | Removes all elements | [
30522,
3853,
27686,
1006,
1007,
1063,
2065,
1006,
999,
14931,
12190,
1012,
5023,
1007,
1063,
1002,
9108,
21823,
2140,
1012,
12939,
26775,
14511,
2075,
1006,
1007,
1025,
1065,
16108,
1012,
5783,
1006,
1002,
3332,
1007,
1012,
2125,
1006,
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... |
knsv/mermaid | src/mermaidAPI.js | function (id, txt, cb, container) {
if (typeof container !== 'undefined') {
container.innerHTML = ''
d3.select(container).append('div')
.attr('id', 'd' + id)
.append('svg')
.attr('id', id)
.attr('width', '100%')
.attr('xmlns', 'http://www.w3.org/2000/svg')
.append('g')
}... | javascript | function (id, txt, cb, container) {
if (typeof container !== 'undefined') {
container.innerHTML = ''
d3.select(container).append('div')
.attr('id', 'd' + id)
.append('svg')
.attr('id', id)
.attr('width', '100%')
.attr('xmlns', 'http://www.w3.org/2000/svg')
.append('g')
}... | [
"function",
"(",
"id",
",",
"txt",
",",
"cb",
",",
"container",
")",
"{",
"if",
"(",
"typeof",
"container",
"!==",
"'undefined'",
")",
"{",
"container",
".",
"innerHTML",
"=",
"''",
"d3",
".",
"select",
"(",
"container",
")",
".",
"append",
"(",
"'di... | ##render
Function that renders an svg with a graph from a chart definition. Usage example below.
```
mermaidAPI.initialize({
startOnLoad:true
});
$(function(){
const graphDefinition = 'graph TB\na-->b';
const cb = function(svgGraph){
console.log(svgGraph);
};
mermaidAPI.render('id1',graphDefinition,cb);
});
```
@param... | [
"##render",
"Function",
"that",
"renders",
"an",
"svg",
"with",
"a",
"graph",
"from",
"a",
"chart",
"definition",
".",
"Usage",
"example",
"below",
"."
] | 7d3578b31aeea3bc9bbc618dcda57d82574eaffb | https://github.com/knsv/mermaid/blob/7d3578b31aeea3bc9bbc618dcda57d82574eaffb/src/mermaidAPI.js#L334-L460 | train | create a new node | [
30522,
3853,
1006,
8909,
1010,
19067,
2102,
1010,
17324,
1010,
11661,
1007,
1063,
2065,
1006,
2828,
11253,
11661,
999,
1027,
1027,
1005,
6151,
28344,
1005,
1007,
1063,
11661,
1012,
5110,
11039,
19968,
1027,
1005,
1005,
1040,
2509,
1012,
727... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aframevr/aframe | src/components/hand-controls.js | function (gesture, lastGesture) {
if (gesture) {
this.playAnimation(gesture || ANIMATIONS.open, lastGesture, false);
return;
}
// If no gesture, then reverse the current gesture back to open pose.
this.playAnimation(lastGesture, lastGesture, true);
} | javascript | function (gesture, lastGesture) {
if (gesture) {
this.playAnimation(gesture || ANIMATIONS.open, lastGesture, false);
return;
}
// If no gesture, then reverse the current gesture back to open pose.
this.playAnimation(lastGesture, lastGesture, true);
} | [
"function",
"(",
"gesture",
",",
"lastGesture",
")",
"{",
"if",
"(",
"gesture",
")",
"{",
"this",
".",
"playAnimation",
"(",
"gesture",
"||",
"ANIMATIONS",
".",
"open",
",",
"lastGesture",
",",
"false",
")",
";",
"return",
";",
"}",
"// If no gesture, then... | Play gesture animation.
@param {string} gesture - Which pose to animate to. If absent, then animate to open.
@param {string} lastGesture - Previous gesture, to reverse back to open if needed. | [
"Play",
"gesture",
"animation",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/hand-controls.js#L291-L299 | train | Play the specified animation | [
30522,
3853,
1006,
9218,
1010,
2197,
8449,
11244,
1007,
1063,
2065,
1006,
9218,
1007,
1063,
2023,
1012,
2377,
7088,
28649,
1006,
9218,
1064,
1064,
7284,
2015,
1012,
2330,
1010,
2197,
8449,
11244,
1010,
6270,
1007,
1025,
2709,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
goldfire/howler.js | examples/sprite/sprite.js | function(key) {
var self = this;
var sprite = self._spriteMap[key];
// Play the sprite sound and capture the ID.
var id = self.sound.play(sprite);
// Create a progress element and begin visually tracking it.
var elm = document.createElement('div');
elm.className = 'progress';
elm.id = ... | javascript | function(key) {
var self = this;
var sprite = self._spriteMap[key];
// Play the sprite sound and capture the ID.
var id = self.sound.play(sprite);
// Create a progress element and begin visually tracking it.
var elm = document.createElement('div');
elm.className = 'progress';
elm.id = ... | [
"function",
"(",
"key",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"sprite",
"=",
"self",
".",
"_spriteMap",
"[",
"key",
"]",
";",
"// Play the sprite sound and capture the ID.",
"var",
"id",
"=",
"self",
".",
"sound",
".",
"play",
"(",
"sprite",
... | Play a sprite when clicked and track the progress.
@param {String} key Key in the sprite map object. | [
"Play",
"a",
"sprite",
"when",
"clicked",
"and",
"track",
"the",
"progress",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/sprite/sprite.js#L67-L90 | train | Play the sprite sound and track the ID of the sprite. | [
30522,
3853,
1006,
3145,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
11867,
17625,
1027,
2969,
1012,
1035,
11867,
17625,
2863,
2361,
1031,
3145,
1033,
1025,
1013,
1013,
2377,
1996,
11867,
17625,
2614,
1998,
5425,
1996,
8909,
1012,
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... | |
exceljs/exceljs | lib/xlsx/xform/style/styles-xform.js | function(fill) {
var xml = this.map.fill.toXml(fill);
var index = this.index.fill[xml];
if (index === undefined) {
index = this.index.fill[xml] = this.model.fills.length;
this.model.fills.push(xml);
}
return index;
} | javascript | function(fill) {
var xml = this.map.fill.toXml(fill);
var index = this.index.fill[xml];
if (index === undefined) {
index = this.index.fill[xml] = this.model.fills.length;
this.model.fills.push(xml);
}
return index;
} | [
"function",
"(",
"fill",
")",
"{",
"var",
"xml",
"=",
"this",
".",
"map",
".",
"fill",
".",
"toXml",
"(",
"fill",
")",
";",
"var",
"index",
"=",
"this",
".",
"index",
".",
"fill",
"[",
"xml",
"]",
";",
"if",
"(",
"index",
"===",
"undefined",
")... | ========================================================================= Fills | [
"=========================================================================",
"Fills"
] | c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2 | https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/xlsx/xform/style/styles-xform.js#L391-L399 | train | Returns the index of the filled element | [
30522,
3853,
1006,
6039,
1007,
1063,
13075,
20950,
1027,
2023,
1012,
4949,
1012,
6039,
1012,
2000,
2595,
19968,
1006,
6039,
1007,
1025,
13075,
5950,
1027,
2023,
1012,
5950,
1012,
6039,
1031,
20950,
1033,
1025,
2065,
1006,
5950,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/gridList/grid-list.js | GridListDirective | function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
return {
restrict: 'E',
controller: GridListController,
scope: {
mdOnLayout: '&'
},
link: postLink
};
function postLink(scope, element, attrs, ctrl) {
element.addClass('_md'); // private md componen... | javascript | function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
return {
restrict: 'E',
controller: GridListController,
scope: {
mdOnLayout: '&'
},
link: postLink
};
function postLink(scope, element, attrs, ctrl) {
element.addClass('_md'); // private md componen... | [
"function",
"GridListDirective",
"(",
"$interpolate",
",",
"$mdConstant",
",",
"$mdGridLayout",
",",
"$mdMedia",
")",
"{",
"return",
"{",
"restrict",
":",
"'E'",
",",
"controller",
":",
"GridListController",
",",
"scope",
":",
"{",
"mdOnLayout",
":",
"'&'",
"}... | @ngdoc directive
@name mdGridList
@module material.components.gridList
@restrict E
@description
Grid lists are an alternative to standard list views. Grid lists are distinct
from grids used for layouts and other visual presentations.
A grid list is best suited to presenting a homogenous data type, typically
images, an... | [
"@ngdoc",
"directive",
"@name",
"mdGridList",
"@module",
"material",
".",
"components",
".",
"gridList",
"@restrict",
"E",
"@description",
"Grid",
"lists",
"are",
"an",
"alternative",
"to",
"standard",
"list",
"views",
".",
"Grid",
"lists",
"are",
"distinct",
"f... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/gridList/grid-list.js#L96-L430 | train | A directive that can be used to create a list of items. | [
30522,
3853,
8370,
9863,
4305,
2890,
15277,
1006,
1002,
6970,
18155,
3686,
1010,
1002,
9108,
8663,
12693,
2102,
1010,
1002,
9108,
16523,
3593,
8485,
5833,
1010,
1002,
9108,
16969,
1007,
1063,
2709,
1063,
21573,
1024,
1005,
1041,
1005,
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... |
adobe/brackets | src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js | receiveMessageFromBrackets | function receiveMessageFromBrackets(msgObj) {
var argList = msgObj.args;
argList.unshift(msgObj.requester || "");
functionMap[msgObj.fn].apply(null, argList);
} | javascript | function receiveMessageFromBrackets(msgObj) {
var argList = msgObj.args;
argList.unshift(msgObj.requester || "");
functionMap[msgObj.fn].apply(null, argList);
} | [
"function",
"receiveMessageFromBrackets",
"(",
"msgObj",
")",
"{",
"var",
"argList",
"=",
"msgObj",
".",
"args",
";",
"argList",
".",
"unshift",
"(",
"msgObj",
".",
"requester",
"||",
"\"\"",
")",
";",
"functionMap",
"[",
"msgObj",
".",
"fn",
"]",
".",
"... | Receives messages from brackets
@param {object} msgObj - json containing - {
fn - function to execute on node side
args - arguments to the above function } | [
"Receives",
"messages",
"from",
"brackets"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L444-L448 | train | receive message from brackets | [
30522,
3853,
4374,
7834,
3736,
3351,
19699,
5358,
10024,
19869,
3215,
1006,
5796,
3995,
2497,
3501,
1007,
1063,
13075,
12098,
25394,
3367,
1027,
5796,
3995,
2497,
3501,
1012,
12098,
5620,
1025,
12098,
25394,
3367,
1012,
4895,
6182,
6199,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
muaz-khan/RTCMultiConnection | dev/MediaStreamRecorder.js | WhammyRecorderHelper | function WhammyRecorderHelper(mediaStream, root) {
this.record = function(timeSlice) {
if (!this.width) {
this.width = 320;
}
if (!this.height) {
this.height = 240;
}
if (this.video && this.video instanceof HTMLVideoElement) {
if (!this.wi... | javascript | function WhammyRecorderHelper(mediaStream, root) {
this.record = function(timeSlice) {
if (!this.width) {
this.width = 320;
}
if (!this.height) {
this.height = 240;
}
if (this.video && this.video instanceof HTMLVideoElement) {
if (!this.wi... | [
"function",
"WhammyRecorderHelper",
"(",
"mediaStream",
",",
"root",
")",
"{",
"this",
".",
"record",
"=",
"function",
"(",
"timeSlice",
")",
"{",
"if",
"(",
"!",
"this",
".",
"width",
")",
"{",
"this",
".",
"width",
"=",
"320",
";",
"}",
"if",
"(",
... | ========================== WhammyRecorderHelper.js | [
"==========================",
"WhammyRecorderHelper",
".",
"js"
] | 2032ce949bde30b43a3d2666e0f1e5afbf337f3d | https://github.com/muaz-khan/RTCMultiConnection/blob/2032ce949bde30b43a3d2666e0f1e5afbf337f3d/dev/MediaStreamRecorder.js#L1762-L2057 | train | WhammyRecorderHelper - This function is the main entry point for the recorder | [
30522,
3853,
1059,
3511,
8029,
2890,
27108,
4063,
16001,
4842,
1006,
2865,
21422,
1010,
7117,
1007,
1063,
2023,
1012,
2501,
1027,
3853,
1006,
2335,
13231,
1007,
1063,
2065,
1006,
999,
2023,
1012,
9381,
1007,
1063,
2023,
1012,
9381,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/tabs/js/tabsController.js | refreshIndex | function refreshIndex () {
ctrl.selectedIndex = getNearestSafeIndex(ctrl.selectedIndex);
ctrl.focusIndex = getNearestSafeIndex(ctrl.focusIndex);
} | javascript | function refreshIndex () {
ctrl.selectedIndex = getNearestSafeIndex(ctrl.selectedIndex);
ctrl.focusIndex = getNearestSafeIndex(ctrl.focusIndex);
} | [
"function",
"refreshIndex",
"(",
")",
"{",
"ctrl",
".",
"selectedIndex",
"=",
"getNearestSafeIndex",
"(",
"ctrl",
".",
"selectedIndex",
")",
";",
"ctrl",
".",
"focusIndex",
"=",
"getNearestSafeIndex",
"(",
"ctrl",
".",
"focusIndex",
")",
";",
"}"
] | Moves the indexes to their nearest valid values. | [
"Moves",
"the",
"indexes",
"to",
"their",
"nearest",
"valid",
"values",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L783-L786 | train | Refreshes the index of the nearest item in the list | [
30522,
3853,
25416,
21898,
22254,
10288,
1006,
1007,
1063,
14931,
12190,
1012,
3479,
22254,
10288,
1027,
2131,
22084,
28533,
3736,
7959,
22254,
10288,
1006,
14931,
12190,
1012,
3479,
22254,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/base/i18n/ResourceBundle.js | loadNextPropertiesAsync | function loadNextPropertiesAsync(oBundle) {
if ( oBundle._sNextLocale != null ) {
return tryToLoadNextProperties(oBundle, true).then(function(oProps) {
// if props could not be loaded, try next fallback locale
return oProps || loadNextPropertiesAsync(oBundle);
});
}
// no more fallback locales: give... | javascript | function loadNextPropertiesAsync(oBundle) {
if ( oBundle._sNextLocale != null ) {
return tryToLoadNextProperties(oBundle, true).then(function(oProps) {
// if props could not be loaded, try next fallback locale
return oProps || loadNextPropertiesAsync(oBundle);
});
}
// no more fallback locales: give... | [
"function",
"loadNextPropertiesAsync",
"(",
"oBundle",
")",
"{",
"if",
"(",
"oBundle",
".",
"_sNextLocale",
"!=",
"null",
")",
"{",
"return",
"tryToLoadNextProperties",
"(",
"oBundle",
",",
"true",
")",
".",
"then",
"(",
"function",
"(",
"oProps",
")",
"{",
... | /*
Tries to load properties files asynchronously until one could be loaded
successfully or until there are no more fallback locales. | [
"/",
"*",
"Tries",
"to",
"load",
"properties",
"files",
"asynchronously",
"until",
"one",
"could",
"be",
"loaded",
"successfully",
"or",
"until",
"there",
"are",
"no",
"more",
"fallback",
"locales",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/i18n/ResourceBundle.js#L449-L458 | train | Loads the next locale properties from the bundle | [
30522,
3853,
7170,
2638,
18413,
21572,
4842,
7368,
3022,
6038,
2278,
1006,
27885,
8630,
2571,
1007,
1063,
2065,
1006,
27885,
8630,
2571,
1012,
1035,
1055,
2638,
18413,
4135,
9289,
2063,
999,
1027,
19701,
1007,
1063,
2709,
3046,
3406,
11066,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js | function (fnVisitor, sNamespace, sLocalName) {
var fnOldVisitor = mVisitors[sNamespace];
if (fnVisitor !== null && typeof fnVisitor !== "function"
|| fnVisitor === visitNodeWrapper) {
throw new Error("Invalid visitor: " + fnVisitor);
}
if (!sNamespace || sNamespace === sNAMESPACE || sNamespace ===... | javascript | function (fnVisitor, sNamespace, sLocalName) {
var fnOldVisitor = mVisitors[sNamespace];
if (fnVisitor !== null && typeof fnVisitor !== "function"
|| fnVisitor === visitNodeWrapper) {
throw new Error("Invalid visitor: " + fnVisitor);
}
if (!sNamespace || sNamespace === sNAMESPACE || sNamespace ===... | [
"function",
"(",
"fnVisitor",
",",
"sNamespace",
",",
"sLocalName",
")",
"{",
"var",
"fnOldVisitor",
"=",
"mVisitors",
"[",
"sNamespace",
"]",
";",
"if",
"(",
"fnVisitor",
"!==",
"null",
"&&",
"typeof",
"fnVisitor",
"!==",
"\"function\"",
"||",
"fnVisitor",
... | Plug-in the given visitor which is called for each matching XML element.
@param {function} [fnVisitor]
Visitor function, will be called with the matching XML DOM element and a
{@link sap.ui.core.util.XMLPreprocessor.ICallback callback interface} which uses a map
of currently known variables; must return <code>undefine... | [
"Plug",
"-",
"in",
"the",
"given",
"visitor",
"which",
"is",
"called",
"for",
"each",
"matching",
"XML",
"element",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L531-L550 | train | Plug - in a visitor function. | [
30522,
3853,
1006,
1042,
2078,
11365,
15660,
1010,
1055,
18442,
23058,
1010,
22889,
24755,
19666,
14074,
1007,
1063,
13075,
1042,
3630,
6392,
11365,
15660,
1027,
19842,
17417,
6591,
1031,
1055,
18442,
23058,
1033,
1025,
2065,
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... | |
aframevr/aframe | src/components/look-controls.js | function () {
if (!this.el.sceneEl.checkHeadsetConnected()) { return; }
this.saveCameraPose();
this.el.object3D.position.set(0, 0, 0);
this.el.object3D.updateMatrix();
} | javascript | function () {
if (!this.el.sceneEl.checkHeadsetConnected()) { return; }
this.saveCameraPose();
this.el.object3D.position.set(0, 0, 0);
this.el.object3D.updateMatrix();
} | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"el",
".",
"sceneEl",
".",
"checkHeadsetConnected",
"(",
")",
")",
"{",
"return",
";",
"}",
"this",
".",
"saveCameraPose",
"(",
")",
";",
"this",
".",
"el",
".",
"object3D",
".",
"position",
"... | Save pose. | [
"Save",
"pose",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/look-controls.js#L345-L350 | train | Update camera pose | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
999,
2023,
1012,
3449,
1012,
3496,
2884,
1012,
4638,
13038,
3388,
24230,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
2023,
1012,
3828,
28727,
6906,
20688,
1006,
1007,
1025,
2023,
1012,
3449,
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... | |
GitbookIO/gitbook | lib/utils/location.js | toAbsolute | function toAbsolute(_href, dir, outdir) {
if (isExternal(_href) || isDataURI(_href)) {
return _href;
}
outdir = outdir == undefined? dir : outdir;
_href = normalize(_href);
dir = normalize(dir);
outdir = normalize(outdir);
// Path "_href" inside the base folder
var hrefInRoot ... | javascript | function toAbsolute(_href, dir, outdir) {
if (isExternal(_href) || isDataURI(_href)) {
return _href;
}
outdir = outdir == undefined? dir : outdir;
_href = normalize(_href);
dir = normalize(dir);
outdir = normalize(outdir);
// Path "_href" inside the base folder
var hrefInRoot ... | [
"function",
"toAbsolute",
"(",
"_href",
",",
"dir",
",",
"outdir",
")",
"{",
"if",
"(",
"isExternal",
"(",
"_href",
")",
"||",
"isDataURI",
"(",
"_href",
")",
")",
"{",
"return",
"_href",
";",
"}",
"outdir",
"=",
"outdir",
"==",
"undefined",
"?",
"di... | Convert a relative path to absolute
@param {String} href
@param {String} dir: directory parent of the file currently in rendering process
@param {String} outdir: directory parent from the html output
@return {String} | [
"Convert",
"a",
"relative",
"path",
"to",
"absolute"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/location.js#L65-L89 | train | Convert a href to an absolute path | [
30522,
3853,
2000,
7875,
19454,
10421,
1006,
1035,
17850,
12879,
1010,
16101,
1010,
2041,
4305,
2099,
1007,
1063,
2065,
1006,
2003,
10288,
16451,
2389,
1006,
1035,
17850,
12879,
1007,
1064,
1064,
2003,
2850,
2696,
9496,
1006,
1035,
17850,
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/components/tabs/js/tabsController.js | getElements | function getElements () {
var elements = {};
var node = $element[0];
// gather tab bar elements
elements.wrapper = node.querySelector('md-tabs-wrapper');
elements.canvas = elements.wrapper.querySelector('md-tabs-canvas');
elements.paging = elements.canvas.querySelector('md-pagination-wrapper'... | javascript | function getElements () {
var elements = {};
var node = $element[0];
// gather tab bar elements
elements.wrapper = node.querySelector('md-tabs-wrapper');
elements.canvas = elements.wrapper.querySelector('md-tabs-canvas');
elements.paging = elements.canvas.querySelector('md-pagination-wrapper'... | [
"function",
"getElements",
"(",
")",
"{",
"var",
"elements",
"=",
"{",
"}",
";",
"var",
"node",
"=",
"$element",
"[",
"0",
"]",
";",
"// gather tab bar elements",
"elements",
".",
"wrapper",
"=",
"node",
".",
"querySelector",
"(",
"'md-tabs-wrapper'",
")",
... | Getter methods
Gathers references to all of the DOM elements used by this controller.
@returns {Object} | [
"Getter",
"methods",
"Gathers",
"references",
"to",
"all",
"of",
"the",
"DOM",
"elements",
"used",
"by",
"this",
"controller",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L489-L506 | train | Get all elements | [
30522,
3853,
2131,
12260,
8163,
1006,
1007,
1063,
13075,
3787,
1027,
1063,
1065,
1025,
13075,
13045,
1027,
1002,
5783,
1031,
1014,
1033,
1025,
1013,
1013,
8587,
21628,
3347,
3787,
3787,
1012,
10236,
4842,
1027,
13045,
1012,
23032,
11246,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
babel/babel | packages/babel-traverse/src/path/conversion.js | getSuperBinding | function getSuperBinding(thisEnvFn) {
return getBinding(thisEnvFn, "supercall", () => {
const argsBinding = thisEnvFn.scope.generateUidIdentifier("args");
return t.arrowFunctionExpression(
[t.restElement(argsBinding)],
t.callExpression(t.super(), [
t.spreadElement(t.identifier(argsBinding.... | javascript | function getSuperBinding(thisEnvFn) {
return getBinding(thisEnvFn, "supercall", () => {
const argsBinding = thisEnvFn.scope.generateUidIdentifier("args");
return t.arrowFunctionExpression(
[t.restElement(argsBinding)],
t.callExpression(t.super(), [
t.spreadElement(t.identifier(argsBinding.... | [
"function",
"getSuperBinding",
"(",
"thisEnvFn",
")",
"{",
"return",
"getBinding",
"(",
"thisEnvFn",
",",
"\"supercall\"",
",",
"(",
")",
"=>",
"{",
"const",
"argsBinding",
"=",
"thisEnvFn",
".",
"scope",
".",
"generateUidIdentifier",
"(",
"\"args\"",
")",
";"... | Create a binding for a function that will call "super()" with arguments passed through. | [
"Create",
"a",
"binding",
"for",
"a",
"function",
"that",
"will",
"call",
"super",
"()",
"with",
"arguments",
"passed",
"through",
"."
] | 1969e6b6aa7d90be3fbb3aca98ea96849656a55a | https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-traverse/src/path/conversion.js#L476-L486 | train | Get the superbinding of thisEnvFn | [
30522,
3853,
4152,
6279,
2121,
8428,
4667,
1006,
2023,
2368,
2615,
2546,
2078,
1007,
1063,
2709,
2131,
8428,
4667,
1006,
2023,
2368,
2615,
2546,
2078,
1010,
1000,
3565,
9289,
2140,
1000,
1010,
1006,
1007,
1027,
1028,
1063,
9530,
3367,
120... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jhipster/generator-jhipster | generators/docker-base.js | loadConfigs | function loadConfigs() {
this.appConfigs = [];
this.gatewayNb = 0;
this.monolithicNb = 0;
this.microserviceNb = 0;
this.uaaNb = 0;
// Loading configs
this.debug(`Apps folders: ${this.appsFolders}`);
this.appsFolders.forEach(appFolder => {
const path = this.destinationPath(`${thi... | javascript | function loadConfigs() {
this.appConfigs = [];
this.gatewayNb = 0;
this.monolithicNb = 0;
this.microserviceNb = 0;
this.uaaNb = 0;
// Loading configs
this.debug(`Apps folders: ${this.appsFolders}`);
this.appsFolders.forEach(appFolder => {
const path = this.destinationPath(`${thi... | [
"function",
"loadConfigs",
"(",
")",
"{",
"this",
".",
"appConfigs",
"=",
"[",
"]",
";",
"this",
".",
"gatewayNb",
"=",
"0",
";",
"this",
".",
"monolithicNb",
"=",
"0",
";",
"this",
".",
"microserviceNb",
"=",
"0",
";",
"this",
".",
"uaaNb",
"=",
"... | Load config from this.appFolders | [
"Load",
"config",
"from",
"this",
".",
"appFolders"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/docker-base.js#L96-L128 | train | Load configs from the. yo - rc. json file | [
30522,
3853,
7170,
8663,
8873,
5620,
1006,
1007,
1063,
2023,
1012,
10439,
8663,
8873,
5620,
1027,
1031,
1033,
1025,
2023,
1012,
11909,
27698,
1027,
1014,
1025,
2023,
1012,
18847,
28508,
27698,
1027,
1014,
1025,
2023,
1012,
12702,
8043,
7903... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
websockets/ws | lib/extension.js | parse | function parse(header) {
const offers = Object.create(null);
if (header === undefined || header === '') return offers;
let params = Object.create(null);
let mustUnescape = false;
let isEscaping = false;
let inQuotes = false;
let extensionName;
let paramName;
let start = -1;
let end = -1;
let i =... | javascript | function parse(header) {
const offers = Object.create(null);
if (header === undefined || header === '') return offers;
let params = Object.create(null);
let mustUnescape = false;
let isEscaping = false;
let inQuotes = false;
let extensionName;
let paramName;
let start = -1;
let end = -1;
let i =... | [
"function",
"parse",
"(",
"header",
")",
"{",
"const",
"offers",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"if",
"(",
"header",
"===",
"undefined",
"||",
"header",
"===",
"''",
")",
"return",
"offers",
";",
"let",
"params",
"=",
"Object",
... | Parses the `Sec-WebSocket-Extensions` header into an object.
@param {String} header The field value of the header
@return {Object} The parsed object
@public | [
"Parses",
"the",
"Sec",
"-",
"WebSocket",
"-",
"Extensions",
"header",
"into",
"an",
"object",
"."
] | 995c527c87d0d4833d8093c18dcfa2e4a41d9582 | https://github.com/websockets/ws/blob/995c527c87d0d4833d8093c18dcfa2e4a41d9582/lib/extension.js#L48-L190 | train | Parse the given header | [
30522,
3853,
11968,
3366,
1006,
20346,
1007,
1063,
9530,
3367,
4107,
1027,
4874,
1012,
30524,
1064,
20346,
1027,
1027,
1027,
1005,
1005,
1007,
2709,
4107,
1025,
2292,
11498,
5244,
1027,
4874,
1012,
3443,
1006,
19701,
1007,
1025,
2292,
2442,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
parcel-bundler/parcel | packages/core/parcel-bundler/src/utils/isAccessedVarChanged.js | isAccessedVarChanged | function isAccessedVarChanged(cacheData) {
for (let key in cacheData.env) {
if (cacheData.env[key] !== process.env[key]) {
return true;
}
}
return false;
} | javascript | function isAccessedVarChanged(cacheData) {
for (let key in cacheData.env) {
if (cacheData.env[key] !== process.env[key]) {
return true;
}
}
return false;
} | [
"function",
"isAccessedVarChanged",
"(",
"cacheData",
")",
"{",
"for",
"(",
"let",
"key",
"in",
"cacheData",
".",
"env",
")",
"{",
"if",
"(",
"cacheData",
".",
"env",
"[",
"key",
"]",
"!==",
"process",
".",
"env",
"[",
"key",
"]",
")",
"{",
"return",... | /*
Checks if any of the used variable from process.env is changed | [
"/",
"*",
"Checks",
"if",
"any",
"of",
"the",
"used",
"variable",
"from",
"process",
".",
"env",
"is",
"changed"
] | 84b308511f87d4b69da62bcd352f0ff2f7bd4f1b | https://github.com/parcel-bundler/parcel/blob/84b308511f87d4b69da62bcd352f0ff2f7bd4f1b/packages/core/parcel-bundler/src/utils/isAccessedVarChanged.js#L4-L12 | train | Check if the environment variable is changed | [
30522,
3853,
18061,
9468,
23656,
10755,
22305,
2098,
1006,
17053,
2850,
2696,
1007,
1063,
2005,
1006,
2292,
3145,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | tracing/tracing_examples/string_convert.js | uint6ToB64 | function uint6ToB64 (nUint6) {
return nUint6 < 26 ?
nUint6 + 65
: nUint6 < 52 ?
nUint6 + 71
: nUint6 < 62 ?
nUint6 - 4
: nUint6 === 62 ?
43
: nUint6 === 63 ?
47
:
65;
} | javascript | function uint6ToB64 (nUint6) {
return nUint6 < 26 ?
nUint6 + 65
: nUint6 < 52 ?
nUint6 + 71
: nUint6 < 62 ?
nUint6 - 4
: nUint6 === 62 ?
43
: nUint6 === 63 ?
47
:
65;
} | [
"function",
"uint6ToB64",
"(",
"nUint6",
")",
"{",
"return",
"nUint6",
"<",
"26",
"?",
"nUint6",
"+",
"65",
":",
"nUint6",
"<",
"52",
"?",
"nUint6",
"+",
"71",
":",
"nUint6",
"<",
"62",
"?",
"nUint6",
"-",
"4",
":",
"nUint6",
"===",
"62",
"?",
"4... | /* Base64 string to array encoding | [
"/",
"*",
"Base64",
"string",
"to",
"array",
"encoding"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/tracing_examples/string_convert.js#L53-L68 | train | Convert a uint6 to a 64 - bit integer | [
30522,
3853,
21318,
3372,
2575,
3406,
2497,
21084,
1006,
16371,
18447,
2575,
1007,
1063,
2709,
16371,
18447,
2575,
1026,
2656,
1029,
16371,
18447,
2575,
1009,
3515,
1024,
16371,
18447,
2575,
1026,
4720,
1029,
16371,
18447,
2575,
1009,
6390,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mochajs/mocha | lib/utils.js | jsonStringify | function jsonStringify(object, spaces, depth) {
if (typeof spaces === 'undefined') {
// primitive types
return _stringify(object);
}
depth = depth || 1;
var space = spaces * depth;
var str = Array.isArray(object) ? '[' : '{';
var end = Array.isArray(object) ? ']' : '}';
var length =
typeof ob... | javascript | function jsonStringify(object, spaces, depth) {
if (typeof spaces === 'undefined') {
// primitive types
return _stringify(object);
}
depth = depth || 1;
var space = spaces * depth;
var str = Array.isArray(object) ? '[' : '{';
var end = Array.isArray(object) ? ']' : '}';
var length =
typeof ob... | [
"function",
"jsonStringify",
"(",
"object",
",",
"spaces",
",",
"depth",
")",
"{",
"if",
"(",
"typeof",
"spaces",
"===",
"'undefined'",
")",
"{",
"// primitive types",
"return",
"_stringify",
"(",
"object",
")",
";",
"}",
"depth",
"=",
"depth",
"||",
"1",
... | like JSON.stringify but more sense.
@private
@param {Object} object
@param {number=} spaces
@param {number=} depth
@returns {*} | [
"like",
"JSON",
".",
"stringify",
"but",
"more",
"sense",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/utils.js#L357-L432 | train | Stringify an object | [
30522,
3853,
1046,
23345,
18886,
3070,
8757,
1006,
4874,
1010,
7258,
1010,
5995,
1007,
1063,
2065,
1006,
2828,
11253,
7258,
1027,
1027,
1027,
1005,
6151,
28344,
1005,
1007,
1063,
1013,
1013,
10968,
4127,
2709,
1035,
5164,
8757,
1006,
4874,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | lib/credentials/web_identity_credentials.js | WebIdentityCredentials | function WebIdentityCredentials(params, clientConfig) {
AWS.Credentials.call(this);
this.expired = true;
this.params = params;
this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity';
this.data = null;
this._clientConfig = AWS.util.copy(clientConfig || {});
} | javascript | function WebIdentityCredentials(params, clientConfig) {
AWS.Credentials.call(this);
this.expired = true;
this.params = params;
this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity';
this.data = null;
this._clientConfig = AWS.util.copy(clientConfig || {});
} | [
"function",
"WebIdentityCredentials",
"(",
"params",
",",
"clientConfig",
")",
"{",
"AWS",
".",
"Credentials",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"expired",
"=",
"true",
";",
"this",
".",
"params",
"=",
"params",
";",
"this",
".",
"params",... | Creates a new credentials object.
@param (see AWS.STS.assumeRoleWithWebIdentity)
@example Creating a new credentials object
AWS.config.credentials = new AWS.WebIdentityCredentials({
RoleArn: 'arn:aws:iam::1234567890:role/WebIdentity',
WebIdentityToken: 'ABCDEFGHIJKLMNOP', // token from identity service
RoleSessionName:... | [
"Creates",
"a",
"new",
"credentials",
"object",
".",
"@param",
"(",
"see",
"AWS",
".",
"STS",
".",
"assumeRoleWithWebIdentity",
")",
"@example",
"Creating",
"a",
"new",
"credentials",
"object",
"AWS",
".",
"config",
".",
"credentials",
"=",
"new",
"AWS",
"."... | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/credentials/web_identity_credentials.js#L64-L71 | train | A WebIdentityCredentials is a wrapper around AWS. Credentials. | [
30522,
3853,
4773,
30524,
1012,
11498,
5244,
1027,
11498,
5244,
1025,
2023,
1012,
11498,
5244,
1012,
4395,
7971,
3258,
18442,
1027,
2023,
1012,
11498,
5244,
1012,
4395,
7971,
3258,
18442,
1064,
1064,
1005,
4773,
1011,
4767,
1005,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/LocaleData.js | getCLDRCalendarName | function getCLDRCalendarName(sCalendarType) {
if (!sCalendarType) {
sCalendarType = sap.ui.getCore().getConfiguration().getCalendarType();
}
return "ca-" + sCalendarType.toLowerCase();
} | javascript | function getCLDRCalendarName(sCalendarType) {
if (!sCalendarType) {
sCalendarType = sap.ui.getCore().getConfiguration().getCalendarType();
}
return "ca-" + sCalendarType.toLowerCase();
} | [
"function",
"getCLDRCalendarName",
"(",
"sCalendarType",
")",
"{",
"if",
"(",
"!",
"sCalendarType",
")",
"{",
"sCalendarType",
"=",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getConfiguration",
"(",
")",
".",
"getCalendarType",
"(",
")",
";",
"}",
... | Returns the corresponding calendar name in CLDR of the given calendar type, or the calendar type
from the configuration, in case sCalendarType is undefined.
@param {sap.ui.core.CalendarType} sCalendarType the type defined in {@link sap.ui.core.CalendarType}.
@private | [
"Returns",
"the",
"corresponding",
"calendar",
"name",
"in",
"CLDR",
"of",
"the",
"given",
"calendar",
"type",
"or",
"the",
"calendar",
"type",
"from",
"the",
"configuration",
"in",
"case",
"sCalendarType",
"is",
"undefined",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L3190-L3195 | train | Returns the name of the calendar | [
30522,
3853,
2131,
20464,
13626,
9289,
10497,
2906,
18442,
1006,
4094,
8943,
5339,
18863,
1007,
1063,
2065,
1006,
999,
4094,
8943,
5339,
18863,
1007,
1063,
4094,
8943,
5339,
18863,
1027,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableUtils.js | function(oTable) {
var oRowActionTemplate = oTable ? oTable.getRowActionTemplate() : null;
return oRowActionTemplate != null
&& (oRowActionTemplate.isBound("visible") || oRowActionTemplate.getVisible())
&& TableUtils.getRowActionCount(oTable) > 0;
} | javascript | function(oTable) {
var oRowActionTemplate = oTable ? oTable.getRowActionTemplate() : null;
return oRowActionTemplate != null
&& (oRowActionTemplate.isBound("visible") || oRowActionTemplate.getVisible())
&& TableUtils.getRowActionCount(oTable) > 0;
} | [
"function",
"(",
"oTable",
")",
"{",
"var",
"oRowActionTemplate",
"=",
"oTable",
"?",
"oTable",
".",
"getRowActionTemplate",
"(",
")",
":",
"null",
";",
"return",
"oRowActionTemplate",
"!=",
"null",
"&&",
"(",
"oRowActionTemplate",
".",
"isBound",
"(",
"\"visi... | Returns whether the table has a row action column.
@param {sap.ui.table.Table} oTable Instance of the table.
@returns {boolean} Whether the table has row actions. | [
"Returns",
"whether",
"the",
"table",
"has",
"a",
"row",
"action",
"column",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L291-L297 | train | Returns true if the table has row actions | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
13075,
20298,
4213,
7542,
18532,
15725,
1027,
27178,
3085,
1029,
27178,
3085,
1012,
2131,
10524,
18908,
3258,
18532,
15725,
1006,
1007,
1024,
19701,
1025,
2709,
20298,
4213,
7542,
18532,
15725,
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... | |
jhipster/generator-jhipster | generators/aws-containers/prompts.js | askPerformances | function askPerformances() {
if (this.abort) return null;
const done = this.async();
const chainPromises = index => {
if (index === this.appConfigs.length) {
done();
return null;
}
const config = this.appConfigs[index];
const awsConfig = this.aws.apps.... | javascript | function askPerformances() {
if (this.abort) return null;
const done = this.async();
const chainPromises = index => {
if (index === this.appConfigs.length) {
done();
return null;
}
const config = this.appConfigs[index];
const awsConfig = this.aws.apps.... | [
"function",
"askPerformances",
"(",
")",
"{",
"if",
"(",
"this",
".",
"abort",
")",
"return",
"null",
";",
"const",
"done",
"=",
"this",
".",
"async",
"(",
")",
";",
"const",
"chainPromises",
"=",
"index",
"=>",
"{",
"if",
"(",
"index",
"===",
"this"... | As user to select AWS performance. | [
"As",
"user",
"to",
"select",
"AWS",
"performance",
"."
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/aws-containers/prompts.js#L220-L243 | train | Ask Performances | [
30522,
3853,
3198,
4842,
14192,
26755,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
11113,
11589,
1007,
2709,
19701,
1025,
9530,
3367,
2589,
1027,
2023,
1012,
2004,
6038,
2278,
1006,
1007,
1025,
9530,
3367,
4677,
21572,
28732,
2015,
1027,
5950... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/qunit.js | extractStacktrace | function extractStacktrace( e, offset ) {
offset = offset === undefined ? 4 : offset;
var stack, include, i;
if ( e.stack ) {
stack = e.stack.split( "\n" );
if ( /^error$/i.test( stack[ 0 ] ) ) {
stack.shift();
}
if ( fileName ) {
include = [];
for ( i = offset; i < stack.length; i++ ) {
if ( ... | javascript | function extractStacktrace( e, offset ) {
offset = offset === undefined ? 4 : offset;
var stack, include, i;
if ( e.stack ) {
stack = e.stack.split( "\n" );
if ( /^error$/i.test( stack[ 0 ] ) ) {
stack.shift();
}
if ( fileName ) {
include = [];
for ( i = offset; i < stack.length; i++ ) {
if ( ... | [
"function",
"extractStacktrace",
"(",
"e",
",",
"offset",
")",
"{",
"offset",
"=",
"offset",
"===",
"undefined",
"?",
"4",
":",
"offset",
";",
"var",
"stack",
",",
"include",
",",
"i",
";",
"if",
"(",
"e",
".",
"stack",
")",
"{",
"stack",
"=",
"e",... | Doesn't support IE6 to IE9, it will return undefined on these browsers See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack | [
"Doesn",
"t",
"support",
"IE6",
"to",
"IE9",
"it",
"will",
"return",
"undefined",
"on",
"these",
"browsers",
"See",
"also",
"https",
":",
"//",
"developer",
".",
"mozilla",
".",
"org",
"/",
"en",
"/",
"JavaScript",
"/",
"Reference",
"/",
"Global_Objects",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/qunit.js#L512-L547 | train | Extract the stacktrace from an Error object | [
30522,
3853,
27059,
2696,
3600,
6494,
3401,
1006,
1041,
1010,
16396,
1007,
1063,
16396,
1027,
16396,
1027,
1027,
1027,
6151,
28344,
1029,
1018,
1024,
16396,
1025,
13075,
9991,
1010,
2421,
1010,
1045,
1025,
2065,
1006,
1041,
1012,
9991,
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/space-unary-ops.js | verifyNonWordsDontHaveSpaces | function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) {
if (node.prefix) {
if (secondToken.range[0] > firstToken.range[1]) {
context.report({
node,
messageId: "unexpectedAfter",
data: {... | javascript | function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) {
if (node.prefix) {
if (secondToken.range[0] > firstToken.range[1]) {
context.report({
node,
messageId: "unexpectedAfter",
data: {... | [
"function",
"verifyNonWordsDontHaveSpaces",
"(",
"node",
",",
"firstToken",
",",
"secondToken",
")",
"{",
"if",
"(",
"node",
".",
"prefix",
")",
"{",
"if",
"(",
"secondToken",
".",
"range",
"[",
"0",
"]",
">",
"firstToken",
".",
"range",
"[",
"1",
"]",
... | Verifies UnaryExpression, UpdateExpression and NewExpression don't have spaces before or after the operator
@param {ASTnode} node AST node
@param {Object} firstToken First token in the expression
@param {Object} secondToken Second token in the expression
@returns {void} | [
"Verifies",
"UnaryExpression",
"UpdateExpression",
"and",
"NewExpression",
"don",
"t",
"have",
"spaces",
"before",
"or",
"after",
"the",
"operator"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/space-unary-ops.js#L243-L274 | train | Verify that the firstToken and secondToken are not spaces | [
30522,
3853,
20410,
8540,
22104,
5280,
8322,
6961,
15327,
2015,
1006,
13045,
1010,
2034,
18715,
2368,
1010,
2117,
18715,
2368,
1007,
1063,
2065,
1006,
13045,
1012,
17576,
1007,
1063,
2065,
1006,
2117,
18715,
2368,
1012,
2846,
1031,
1014,
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... |
apache/incubator-echarts | src/coord/Axis.js | function (data, clamp) {
var extent = this._extent;
var scale = this.scale;
data = scale.normalize(data);
if (this.onBand && scale.type === 'ordinal') {
extent = extent.slice();
fixExtentWithBands(extent, scale.count());
}
return linearMap(data, ... | javascript | function (data, clamp) {
var extent = this._extent;
var scale = this.scale;
data = scale.normalize(data);
if (this.onBand && scale.type === 'ordinal') {
extent = extent.slice();
fixExtentWithBands(extent, scale.count());
}
return linearMap(data, ... | [
"function",
"(",
"data",
",",
"clamp",
")",
"{",
"var",
"extent",
"=",
"this",
".",
"_extent",
";",
"var",
"scale",
"=",
"this",
".",
"scale",
";",
"data",
"=",
"scale",
".",
"normalize",
"(",
"data",
")",
";",
"if",
"(",
"this",
".",
"onBand",
"... | Convert data to coord. Data is the rank if it has an ordinal scale
@param {number} data
@param {boolean} clamp
@return {number} | [
"Convert",
"data",
"to",
"coord",
".",
"Data",
"is",
"the",
"rank",
"if",
"it",
"has",
"an",
"ordinal",
"scale"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/Axis.js#L128-L139 | train | Normalize the data | [
30522,
3853,
1006,
2951,
1010,
18856,
16613,
1007,
1063,
13075,
6698,
1027,
2023,
1012,
1035,
6698,
1025,
13075,
4094,
1027,
2023,
1012,
4094,
1025,
2951,
1027,
4094,
1012,
3671,
4697,
1006,
2951,
1007,
1025,
2065,
1006,
2023,
1012,
2006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/vars-on-top.js | blockScopeVarCheck | function blockScopeVarCheck(node, parent, grandParent) {
if (!(/Function/u.test(grandParent.type) &&
parent.type === "BlockStatement" &&
isVarOnTop(node, parent.body))) {
context.report({ node, messageId: "top" });
}
} | javascript | function blockScopeVarCheck(node, parent, grandParent) {
if (!(/Function/u.test(grandParent.type) &&
parent.type === "BlockStatement" &&
isVarOnTop(node, parent.body))) {
context.report({ node, messageId: "top" });
}
} | [
"function",
"blockScopeVarCheck",
"(",
"node",
",",
"parent",
",",
"grandParent",
")",
"{",
"if",
"(",
"!",
"(",
"/",
"Function",
"/",
"u",
".",
"test",
"(",
"grandParent",
".",
"type",
")",
"&&",
"parent",
".",
"type",
"===",
"\"BlockStatement\"",
"&&",... | Checks whether variable is on top at functional block scope level
@param {ASTNode} node - The node to check
@param {ASTNode} parent - Parent of the node
@param {ASTNode} grandParent - Parent of the node's parent
@returns {void} | [
"Checks",
"whether",
"variable",
"is",
"on",
"top",
"at",
"functional",
"block",
"scope",
"level"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/vars-on-top.js#L119-L125 | train | Check if variable is on top of block | [
30522,
3853,
5991,
16186,
10755,
5403,
3600,
1006,
13045,
1010,
6687,
1010,
15310,
22787,
1007,
1063,
2065,
1006,
999,
1006,
1013,
3853,
1013,
1057,
1012,
3231,
1006,
15310,
22787,
1012,
2828,
1007,
1004,
1004,
6687,
1012,
2828,
1027,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/keyword-spacing.js | expectSpaceAfter | function expectSpaceAfter(token, pattern) {
const nextToken = sourceCode.getTokenAfter(token);
if (nextToken &&
(CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) &&
!isCloseParenOfTemplate(nextToken) &&
astUtils.isTokenOnSameLine(... | javascript | function expectSpaceAfter(token, pattern) {
const nextToken = sourceCode.getTokenAfter(token);
if (nextToken &&
(CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) &&
!isCloseParenOfTemplate(nextToken) &&
astUtils.isTokenOnSameLine(... | [
"function",
"expectSpaceAfter",
"(",
"token",
",",
"pattern",
")",
"{",
"const",
"nextToken",
"=",
"sourceCode",
".",
"getTokenAfter",
"(",
"token",
")",
";",
"if",
"(",
"nextToken",
"&&",
"(",
"CHECK_TYPE",
".",
"test",
"(",
"nextToken",
".",
"type",
")",... | Reports a given token if there are not space(s) after the token.
@param {Token} token - A token to report.
@param {RegExp} pattern - A pattern of the next token to check.
@returns {void} | [
"Reports",
"a",
"given",
"token",
"if",
"there",
"are",
"not",
"space",
"(",
"s",
")",
"after",
"the",
"token",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/keyword-spacing.js#L176-L194 | train | Check if a space is after a token | [
30522,
3853,
24273,
15327,
10354,
3334,
1006,
19204,
1010,
5418,
1007,
1063,
9530,
3367,
2279,
18715,
2368,
1027,
3120,
16044,
1012,
2131,
18715,
8189,
6199,
2121,
1006,
19204,
1007,
1025,
2065,
1006,
2279,
18715,
2368,
1004,
1004,
1006,
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... |
adobe/brackets | src/extensions/default/RecentProjects/main.js | parsePath | function parsePath(path) {
var lastSlash = path.lastIndexOf("/"), folder, rest;
if (lastSlash === path.length - 1) {
lastSlash = path.slice(0, path.length - 1).lastIndexOf("/");
}
if (lastSlash >= 0) {
rest = " - " + (lastSlash ? path.slice(0, lastSlash) : "/");
... | javascript | function parsePath(path) {
var lastSlash = path.lastIndexOf("/"), folder, rest;
if (lastSlash === path.length - 1) {
lastSlash = path.slice(0, path.length - 1).lastIndexOf("/");
}
if (lastSlash >= 0) {
rest = " - " + (lastSlash ? path.slice(0, lastSlash) : "/");
... | [
"function",
"parsePath",
"(",
"path",
")",
"{",
"var",
"lastSlash",
"=",
"path",
".",
"lastIndexOf",
"(",
"\"/\"",
")",
",",
"folder",
",",
"rest",
";",
"if",
"(",
"lastSlash",
"===",
"path",
".",
"length",
"-",
"1",
")",
"{",
"lastSlash",
"=",
"path... | Parses the path and returns an object with the full path, the folder name and the path without the folder.
@param {string} path The full path to the folder.
@return {{path: string, folder: string, rest: string}} | [
"Parses",
"the",
"path",
"and",
"returns",
"an",
"object",
"with",
"the",
"full",
"path",
"the",
"folder",
"name",
"and",
"the",
"path",
"without",
"the",
"folder",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L334-L348 | train | parsePath - parse path | [
30522,
3853,
11968,
3366,
15069,
1006,
4130,
1007,
1063,
13075,
16180,
27067,
1027,
4130,
1012,
2197,
22254,
10288,
11253,
1006,
30524,
1000,
1007,
1025,
1065,
2065,
1006,
16180,
27067,
1028,
1027,
1014,
1007,
1063,
2717,
1027,
1000,
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... |
NetEase/pomelo | lib/server/server.js | function(isGlobal, server, err, msg, session, resp, opts, cb) {
if(isGlobal) {
cb(err, resp, opts);
// after filter should not interfere response
afterFilter(isGlobal, server, err, msg, session, resp, opts, cb);
} else {
afterFilter(isGlobal, server, err, msg, session, resp, opts, cb);
}
} | javascript | function(isGlobal, server, err, msg, session, resp, opts, cb) {
if(isGlobal) {
cb(err, resp, opts);
// after filter should not interfere response
afterFilter(isGlobal, server, err, msg, session, resp, opts, cb);
} else {
afterFilter(isGlobal, server, err, msg, session, resp, opts, cb);
}
} | [
"function",
"(",
"isGlobal",
",",
"server",
",",
"err",
",",
"msg",
",",
"session",
",",
"resp",
",",
"opts",
",",
"cb",
")",
"{",
"if",
"(",
"isGlobal",
")",
"{",
"cb",
"(",
"err",
",",
"resp",
",",
"opts",
")",
";",
"// after filter should not inte... | Send response to client and fire after filter chain if any. | [
"Send",
"response",
"to",
"client",
"and",
"fire",
"after",
"filter",
"chain",
"if",
"any",
"."
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/server/server.js#L297-L305 | train | after filter is not interferee response
| [
30522,
3853,
1006,
2003,
23296,
16429,
2389,
1010,
8241,
1010,
9413,
2099,
1010,
5796,
2290,
1010,
5219,
1010,
24501,
2361,
1010,
23569,
2015,
1010,
17324,
1007,
1063,
2065,
1006,
2003,
23296,
16429,
2389,
1007,
1063,
17324,
1006,
9413,
209... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/animation/animate.js | function (element) {
var bounds = angular.element(element)[0].getBoundingClientRect();
var isPositiveSizeClientRect = function (rect) {
return rect && (rect.width > 0) && (rect.height > 0);
};
// If the event origin element has zero size, it has probably been hidden.
return isPosi... | javascript | function (element) {
var bounds = angular.element(element)[0].getBoundingClientRect();
var isPositiveSizeClientRect = function (rect) {
return rect && (rect.width > 0) && (rect.height > 0);
};
// If the event origin element has zero size, it has probably been hidden.
return isPosi... | [
"function",
"(",
"element",
")",
"{",
"var",
"bounds",
"=",
"angular",
".",
"element",
"(",
"element",
")",
"[",
"0",
"]",
".",
"getBoundingClientRect",
"(",
")",
";",
"var",
"isPositiveSizeClientRect",
"=",
"function",
"(",
"rect",
")",
"{",
"return",
"... | Calculate ClientRect of element; return null if hidden or zero size | [
"Calculate",
"ClientRect",
"of",
"element",
";",
"return",
"null",
"if",
"hidden",
"or",
"zero",
"size"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/animation/animate.js#L238-L246 | train | Returns the bounding rect of the element | [
30522,
3853,
1006,
5783,
1007,
1063,
13075,
19202,
1027,
16108,
1012,
5783,
1006,
5783,
1007,
1031,
1014,
1033,
1012,
2131,
15494,
2075,
20464,
11638,
2890,
6593,
1006,
1007,
1025,
13075,
2003,
6873,
28032,
24653,
4697,
20464,
11638,
2890,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/walkSummary.js | walkSummary | function walkSummary(summary, fn) {
var parts = summary.getParts();
return Promise.forEach(parts, function(part) {
return walkArticles(part.getArticles(), fn);
});
} | javascript | function walkSummary(summary, fn) {
var parts = summary.getParts();
return Promise.forEach(parts, function(part) {
return walkArticles(part.getArticles(), fn);
});
} | [
"function",
"walkSummary",
"(",
"summary",
",",
"fn",
")",
"{",
"var",
"parts",
"=",
"summary",
".",
"getParts",
"(",
")",
";",
"return",
"Promise",
".",
"forEach",
"(",
"parts",
",",
"function",
"(",
"part",
")",
"{",
"return",
"walkArticles",
"(",
"p... | Walk over summary and execute "fn" on each article
@param {Summary} summary
@param {Function(article)}
@return {Promise} | [
"Walk",
"over",
"summary",
"and",
"execute",
"fn",
"on",
"each",
"article"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/parse/walkSummary.js#L26-L32 | train | Walk summary and return a promise | [
30522,
3853,
7365,
2819,
7849,
2100,
1006,
12654,
1010,
1042,
2078,
1007,
1063,
13075,
3033,
1027,
12654,
1012,
2131,
26950,
1006,
1007,
1025,
2709,
4872,
1012,
18921,
6776,
1006,
3033,
1010,
3853,
1006,
2112,
1007,
1063,
2709,
3328,
8445,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/coord/geo/Geo.js | function (coord) {
var regions = this.regions;
for (var i = 0; i < regions.length; i++) {
if (regions[i].contain(coord)) {
return true;
}
}
return false;
} | javascript | function (coord) {
var regions = this.regions;
for (var i = 0; i < regions.length; i++) {
if (regions[i].contain(coord)) {
return true;
}
}
return false;
} | [
"function",
"(",
"coord",
")",
"{",
"var",
"regions",
"=",
"this",
".",
"regions",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"regions",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"regions",
"[",
"i",
"]",
".",
"contain",
... | If contain given lng,lat coord
@param {Array.<number>}
@readOnly | [
"If",
"contain",
"given",
"lng",
"lat",
"coord"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/geo/Geo.js#L82-L90 | train | returns true if the region contains the given region | [
30522,
3853,
1006,
2522,
8551,
1007,
1063,
13075,
4655,
1027,
2023,
1012,
4655,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
4655,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
2065,
1006,
4655,
1031,
1045,
1033,
1012,
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... | |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (jid)
{
var bare = Strophe.getBareJidFromJid(jid);
if (bare.indexOf("@") < 0) {
return bare;
} else {
var parts = bare.split("@");
parts.splice(0, 1);
return parts.join('@');
}
} | javascript | function (jid)
{
var bare = Strophe.getBareJidFromJid(jid);
if (bare.indexOf("@") < 0) {
return bare;
} else {
var parts = bare.split("@");
parts.splice(0, 1);
return parts.join('@');
}
} | [
"function",
"(",
"jid",
")",
"{",
"var",
"bare",
"=",
"Strophe",
".",
"getBareJidFromJid",
"(",
"jid",
")",
";",
"if",
"(",
"bare",
".",
"indexOf",
"(",
"\"@\"",
")",
"<",
"0",
")",
"{",
"return",
"bare",
";",
"}",
"else",
"{",
"var",
"parts",
"=... | Function: getDomainFromJid
Get the domain portion of a JID String.
Parameters:
(String) jid - A JID.
Returns:
A String containing the domain. | [
"Function",
":",
"getDomainFromJid",
"Get",
"the",
"domain",
"portion",
"of",
"a",
"JID",
"String",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L1320-L1330 | train | Returns the bare jid of the specified xsd | [
30522,
3853,
1006,
10147,
2094,
1007,
1063,
13075,
6436,
1027,
2358,
18981,
5369,
1012,
2131,
8237,
20518,
3593,
19699,
5358,
4478,
2094,
1006,
10147,
2094,
1007,
1025,
2065,
1006,
6436,
1012,
5950,
11253,
1006,
1000,
1030,
1000,
1007,
1026... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/core/services/gesture/gesture.js | typesMatch | function typesMatch(ev, pointer) {
return ev && pointer && ev.type.charAt(0) === pointer.type;
} | javascript | function typesMatch(ev, pointer) {
return ev && pointer && ev.type.charAt(0) === pointer.type;
} | [
"function",
"typesMatch",
"(",
"ev",
",",
"pointer",
")",
"{",
"return",
"ev",
"&&",
"pointer",
"&&",
"ev",
".",
"type",
".",
"charAt",
"(",
"0",
")",
"===",
"pointer",
".",
"type",
";",
"}"
] | /*
return whether the pointer's type matches the event's type.
Eg if a touch event happens but the pointer has a mouse type, return false. | [
"/",
"*",
"return",
"whether",
"the",
"pointer",
"s",
"type",
"matches",
"the",
"event",
"s",
"type",
".",
"Eg",
"if",
"a",
"touch",
"event",
"happens",
"but",
"the",
"pointer",
"has",
"a",
"mouse",
"type",
"return",
"false",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/gesture/gesture.js#L721-L723 | train | Returns true if the event type matches the pointer type | [
30522,
3853,
4127,
18900,
2818,
1006,
23408,
1010,
20884,
1007,
1063,
2709,
23408,
1004,
1004,
20884,
1004,
1004,
23408,
1012,
2828,
1012,
25869,
4017,
1006,
1014,
1007,
1027,
1027,
1027,
20884,
1012,
2828,
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... |
avajs/ava | lib/babel-pipeline.js | wantsStage4 | function wantsStage4(userOptions, projectDir) {
if (!userOptions) {
return false;
}
if (!userOptions.testOptions.presets) {
return true;
}
const stage4 = require('../stage-4');
return userOptions.testOptions.presets.every(arr => {
if (!Array.isArray(arr)) {
return true; // There aren't any preset optio... | javascript | function wantsStage4(userOptions, projectDir) {
if (!userOptions) {
return false;
}
if (!userOptions.testOptions.presets) {
return true;
}
const stage4 = require('../stage-4');
return userOptions.testOptions.presets.every(arr => {
if (!Array.isArray(arr)) {
return true; // There aren't any preset optio... | [
"function",
"wantsStage4",
"(",
"userOptions",
",",
"projectDir",
")",
"{",
"if",
"(",
"!",
"userOptions",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"userOptions",
".",
"testOptions",
".",
"presets",
")",
"{",
"return",
"true",
";",
"}",
"... | Assume the stage-4 preset is wanted if there are `userOptions`, but there is no declaration of a stage-` preset that comes with `false` for its options. Ideally we'd detect the stage-4 preset anywhere in the configuration hierarchy, but Babel's loadPartialConfig() does not return disabled presets. See <https://github.... | [
"Assume",
"the",
"stage",
"-",
"4",
"preset",
"is",
"wanted",
"if",
"there",
"are",
"userOptions",
"but",
"there",
"is",
"no",
"declaration",
"of",
"a",
"stage",
"-",
"preset",
"that",
"comes",
"with",
"false",
"for",
"its",
"options",
".",
"Ideally",
"w... | 08e99e516e13af75d3ebe70f12194a89b610217c | https://github.com/avajs/ava/blob/08e99e516e13af75d3ebe70f12194a89b610217c/lib/babel-pipeline.js#L82-L103 | train | Checks if the user wants stage - 4 | [
30522,
3853,
4122,
9153,
3351,
2549,
1006,
5310,
7361,
9285,
1010,
2622,
4305,
2099,
1007,
1063,
2065,
1006,
999,
5310,
7361,
9285,
1007,
1063,
2709,
6270,
1025,
1065,
2065,
1006,
999,
5310,
7361,
9285,
1012,
3231,
7361,
9285,
1012,
3653,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/node/FindInFilesDomain.js | getNextPage | function getNextPage() {
var send_object = {
"results": {},
"numMatches": 0,
"foundMaximum": foundMaximum,
"exceedsMaximum": exceedsMaximum
};
if (!savedSearchObject) {
return send_object;
}
savedSearchObject.startFileIndex = lastSearchedIndex;
return d... | javascript | function getNextPage() {
var send_object = {
"results": {},
"numMatches": 0,
"foundMaximum": foundMaximum,
"exceedsMaximum": exceedsMaximum
};
if (!savedSearchObject) {
return send_object;
}
savedSearchObject.startFileIndex = lastSearchedIndex;
return d... | [
"function",
"getNextPage",
"(",
")",
"{",
"var",
"send_object",
"=",
"{",
"\"results\"",
":",
"{",
"}",
",",
"\"numMatches\"",
":",
"0",
",",
"\"foundMaximum\"",
":",
"foundMaximum",
",",
"\"exceedsMaximum\"",
":",
"exceedsMaximum",
"}",
";",
"if",
"(",
"!",... | Gets the next page of results of the ongoing search
@return {Object} search results | [
"Gets",
"the",
"next",
"page",
"of",
"results",
"of",
"the",
"ongoing",
"search"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L526-L538 | train | Get the next page | [
30522,
3853,
2131,
2638,
18413,
13704,
1006,
1007,
1063,
13075,
4604,
1035,
4874,
1027,
1063,
1000,
3463,
1000,
1024,
1063,
1065,
1010,
1000,
16371,
14760,
10649,
2229,
1000,
1024,
1014,
1010,
1000,
2179,
17848,
28591,
1000,
1024,
2179,
178... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js | _validateCubicBezierParams | function _validateCubicBezierParams(match) {
var x1 = _convertToNumber(match[1]),
y1 = _convertToNumber(match[2]),
x2 = _convertToNumber(match[3]),
y2 = _convertToNumber(match[4]);
// Verify all params are numbers
if (!x1.isNumber || !y1.isNumber || !x2.isNum... | javascript | function _validateCubicBezierParams(match) {
var x1 = _convertToNumber(match[1]),
y1 = _convertToNumber(match[2]),
x2 = _convertToNumber(match[3]),
y2 = _convertToNumber(match[4]);
// Verify all params are numbers
if (!x1.isNumber || !y1.isNumber || !x2.isNum... | [
"function",
"_validateCubicBezierParams",
"(",
"match",
")",
"{",
"var",
"x1",
"=",
"_convertToNumber",
"(",
"match",
"[",
"1",
"]",
")",
",",
"y1",
"=",
"_convertToNumber",
"(",
"match",
"[",
"2",
"]",
")",
",",
"x2",
"=",
"_convertToNumber",
"(",
"matc... | Validate cubic-bezier function parameters that are not already validated by regex:
@param {RegExp.match} match RegExp Match object with cubic-bezier function parameters
in array positions 1-4.
@return {boolean} true if all parameters are valid, otherwise, false | [
"Validate",
"cubic",
"-",
"bezier",
"function",
"parameters",
"that",
"are",
"not",
"already",
"validated",
"by",
"regex",
":"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js#L145-L162 | train | Validate cubic bezier params | [
30522,
3853,
1035,
9398,
3686,
10841,
13592,
4783,
21548,
28689,
5244,
1006,
2674,
1007,
1063,
13075,
1060,
2487,
1027,
1035,
10463,
2669,
29440,
1006,
2674,
1031,
1015,
1033,
1007,
1010,
1061,
2487,
1027,
1035,
10463,
2669,
29440,
1006,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/flow | packages/flow-remove-types/index.js | generateSourceMappings | function generateSourceMappings(removedNodes) {
var mappings = '';
if (!removedNodes || removedNodes.length === '') {
return mappings;
}
var end = {line: 1, column: 0};
for (var i = 0; i < removedNodes.length; i++) {
var start = removedNodes[i].loc.start;
var lineDiff = start.line - end.line;
... | javascript | function generateSourceMappings(removedNodes) {
var mappings = '';
if (!removedNodes || removedNodes.length === '') {
return mappings;
}
var end = {line: 1, column: 0};
for (var i = 0; i < removedNodes.length; i++) {
var start = removedNodes[i].loc.start;
var lineDiff = start.line - end.line;
... | [
"function",
"generateSourceMappings",
"(",
"removedNodes",
")",
"{",
"var",
"mappings",
"=",
"''",
";",
"if",
"(",
"!",
"removedNodes",
"||",
"removedNodes",
".",
"length",
"===",
"''",
")",
"{",
"return",
"mappings",
";",
"}",
"var",
"end",
"=",
"{",
"l... | Generate a source map when *removing* nodes rather than replacing them with spaces. | [
"Generate",
"a",
"source",
"map",
"when",
"*",
"removing",
"*",
"nodes",
"rather",
"than",
"replacing",
"them",
"with",
"spaces",
"."
] | 25bc6aba258658eaf21ccc4722ef7124724a1d2b | https://github.com/facebook/flow/blob/25bc6aba258658eaf21ccc4722ef7124724a1d2b/packages/flow-remove-types/index.js#L538-L573 | train | Generate source mappings from removed nodes | [
30522,
3853,
19421,
8162,
3401,
2863,
14853,
2015,
1006,
3718,
3630,
6155,
1007,
1063,
13075,
12375,
2015,
1027,
1005,
1005,
1025,
2065,
1006,
999,
3718,
3630,
6155,
1064,
1064,
3718,
3630,
6155,
1012,
3091,
1027,
1027,
1027,
1005,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | lib/cldr-openui5/lib/generate.js | Generator | function Generator(sOutputFolder, bPrettyPrint) {
if (!(this instanceof Generator)) {
return new Generator(sOutputFolder, bPrettyPrint);
}
this._sOutputFolder = sOutputFolder;
this._bPrettyPrint = bPrettyPrint;
events.EventEmitter.call(this);
} | javascript | function Generator(sOutputFolder, bPrettyPrint) {
if (!(this instanceof Generator)) {
return new Generator(sOutputFolder, bPrettyPrint);
}
this._sOutputFolder = sOutputFolder;
this._bPrettyPrint = bPrettyPrint;
events.EventEmitter.call(this);
} | [
"function",
"Generator",
"(",
"sOutputFolder",
",",
"bPrettyPrint",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Generator",
")",
")",
"{",
"return",
"new",
"Generator",
"(",
"sOutputFolder",
",",
"bPrettyPrint",
")",
";",
"}",
"this",
".",
"_sOut... | Generates the UI5 locale JSON files using the original JSON files. | [
"Generates",
"the",
"UI5",
"locale",
"JSON",
"files",
"using",
"the",
"original",
"JSON",
"files",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/cldr-openui5/lib/generate.js#L27-L34 | train | Creates a new Generator instance. | [
30522,
3853,
13103,
1006,
2061,
4904,
18780,
10371,
2121,
1010,
17531,
13465,
3723,
16550,
1007,
1063,
2065,
1006,
999,
1006,
2023,
6013,
11253,
13103,
1007,
1007,
1063,
2709,
2047,
13103,
1006,
2061,
4904,
18780,
10371,
2121,
1010,
17531,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/plugin-loader.js | tryLoad | function tryLoad(path: string) {
try {
return require(path);
} catch (err) {
if (err.code === MODULE_NOT_FOUND) {
return null;
}
throw err;
}
} | javascript | function tryLoad(path: string) {
try {
return require(path);
} catch (err) {
if (err.code === MODULE_NOT_FOUND) {
return null;
}
throw err;
}
} | [
"function",
"tryLoad",
"(",
"path",
":",
"string",
")",
"{",
"try",
"{",
"return",
"require",
"(",
"path",
")",
";",
"}",
"catch",
"(",
"err",
")",
"{",
"if",
"(",
"err",
".",
"code",
"===",
"MODULE_NOT_FOUND",
")",
"{",
"return",
"null",
";",
"}",... | Requires a module.
@param {*} path the module's path
@return {Object} | [
"Requires",
"a",
"module",
"."
] | daa7e897b6d093bf8282ff12df3f450bcd73476c | https://github.com/verdaccio/verdaccio/blob/daa7e897b6d093bf8282ff12df3f450bcd73476c/src/lib/plugin-loader.js#L17-L26 | train | Try to load a node module | [
30522,
3853,
3046,
11066,
1006,
4130,
1024,
5164,
1007,
1063,
3046,
1063,
2709,
5478,
1006,
4130,
1007,
1025,
1065,
4608,
30524,
2025,
1035,
2179,
1007,
1063,
2709,
19701,
1025,
1065,
5466,
9413,
2099,
1025,
1065,
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... |
adobe/brackets | src/command/DefaultMenus.js | _setMenuItemsVisible | function _setMenuItemsVisible() {
var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE);
if (file) {
file.exists(function (err, isPresent) {
if (err) {
return err;
}
_setContextMenuItemsVisible(isPre... | javascript | function _setMenuItemsVisible() {
var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE);
if (file) {
file.exists(function (err, isPresent) {
if (err) {
return err;
}
_setContextMenuItemsVisible(isPre... | [
"function",
"_setMenuItemsVisible",
"(",
")",
"{",
"var",
"file",
"=",
"MainViewManager",
".",
"getCurrentlyViewedFile",
"(",
"MainViewManager",
".",
"ACTIVE_PANE",
")",
";",
"if",
"(",
"file",
")",
"{",
"file",
".",
"exists",
"(",
"function",
"(",
"err",
",... | Checks if file saved and present on system and
disables menu items accordingly | [
"Checks",
"if",
"file",
"saved",
"and",
"present",
"on",
"system",
"and",
"disables",
"menu",
"items",
"accordingly"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/DefaultMenus.js#L53-L63 | train | Set the menu items visible in the current file tree | [
30522,
3853,
1035,
2275,
3549,
14663,
6633,
2015,
11365,
7028,
1006,
1007,
1063,
13075,
5371,
1027,
2364,
8584,
24805,
4590,
1012,
2131,
10841,
14343,
20630,
8584,
2098,
8873,
2571,
1006,
2364,
8584,
24805,
4590,
1012,
3161,
1035,
6090,
206... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/ion.rangeSlider/js/ion.rangeSlider.js | function (is_update) {
this.no_diapason = false;
this.coords.p_step = this.convertToPercent(this.options.step, true);
this.target = "base";
this.toggleInput();
this.append();
this.setMinMax();
if (is_update) {
this.fo... | javascript | function (is_update) {
this.no_diapason = false;
this.coords.p_step = this.convertToPercent(this.options.step, true);
this.target = "base";
this.toggleInput();
this.append();
this.setMinMax();
if (is_update) {
this.fo... | [
"function",
"(",
"is_update",
")",
"{",
"this",
".",
"no_diapason",
"=",
"false",
";",
"this",
".",
"coords",
".",
"p_step",
"=",
"this",
".",
"convertToPercent",
"(",
"this",
".",
"options",
".",
"step",
",",
"true",
")",
";",
"this",
".",
"target",
... | Starts or updates the plugin instance
@param [is_update] {boolean} | [
"Starts",
"or",
"updates",
"the",
"plugin",
"instance"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/ion.rangeSlider/js/ion.rangeSlider.js#L477-L502 | train | set parameters | [
30522,
3853,
1006,
2003,
1035,
10651,
1007,
1063,
2023,
1012,
2053,
1035,
22939,
19707,
2239,
1027,
6270,
1025,
2023,
1012,
2522,
8551,
2015,
1012,
1052,
1035,
3357,
1027,
2023,
1012,
10463,
14399,
2121,
13013,
1006,
2023,
1012,
7047,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/LiveEditor.controller.js | function () {
this._oSrcFileContent = {};
this._oViewModel = new JSONModel({
autoPreview: true,
selectedFileName: SRC_FILE_NAMES.XML, // initially select the xml file
selectedFileType: SRC_FILE_TYPES[SRC_FILE_NAMES.XML],
selectedFileContent: ""
});
this.getView().setModel(this._oV... | javascript | function () {
this._oSrcFileContent = {};
this._oViewModel = new JSONModel({
autoPreview: true,
selectedFileName: SRC_FILE_NAMES.XML, // initially select the xml file
selectedFileType: SRC_FILE_TYPES[SRC_FILE_NAMES.XML],
selectedFileContent: ""
});
this.getView().setModel(this._oV... | [
"function",
"(",
")",
"{",
"this",
".",
"_oSrcFileContent",
"=",
"{",
"}",
";",
"this",
".",
"_oViewModel",
"=",
"new",
"JSONModel",
"(",
"{",
"autoPreview",
":",
"true",
",",
"selectedFileName",
":",
"SRC_FILE_NAMES",
".",
"XML",
",",
"// initially select t... | Called when the controller is instantiated.
@public | [
"Called",
"when",
"the",
"controller",
"is",
"instantiated",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/LiveEditor.controller.js#L42-L78 | train | Initializes the model of the model | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1035,
9808,
11890,
8873,
2571,
8663,
6528,
2102,
1027,
1063,
1065,
1025,
2023,
1012,
1035,
1051,
8584,
5302,
9247,
1027,
2047,
1046,
3385,
5302,
9247,
1006,
1063,
8285,
28139,
8584,
1024,
2995,
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/base/i18n/ResourceBundle.js | convertLocaleToBCP47 | function convertLocaleToBCP47(sLocale) {
var m;
if ( typeof sLocale === 'string' && (m = rLocale.exec(sLocale.replace(/_/g, '-'))) ) {
var sLanguage = m[1].toLowerCase();
sLanguage = M_ISO639_OLD_TO_NEW[sLanguage] || sLanguage;
return sLanguage + (m[3] ? "-" + m[3].toUpperCase() + (m[4] ? "-" + m[4].slice(... | javascript | function convertLocaleToBCP47(sLocale) {
var m;
if ( typeof sLocale === 'string' && (m = rLocale.exec(sLocale.replace(/_/g, '-'))) ) {
var sLanguage = m[1].toLowerCase();
sLanguage = M_ISO639_OLD_TO_NEW[sLanguage] || sLanguage;
return sLanguage + (m[3] ? "-" + m[3].toUpperCase() + (m[4] ? "-" + m[4].slice(... | [
"function",
"convertLocaleToBCP47",
"(",
"sLocale",
")",
"{",
"var",
"m",
";",
"if",
"(",
"typeof",
"sLocale",
"===",
"'string'",
"&&",
"(",
"m",
"=",
"rLocale",
".",
"exec",
"(",
"sLocale",
".",
"replace",
"(",
"/",
"_",
"/",
"g",
",",
"'-'",
")",
... | Helper to normalize the given locale (java.util.Locale format) to the BCP-47 syntax.
@param {string} sLocale locale to convert
@returns {string} Normalized locale or undefined if the locale can't be normalized | [
"Helper",
"to",
"normalize",
"the",
"given",
"locale",
"(",
"java",
".",
"util",
".",
"Locale",
"format",
")",
"to",
"the",
"BCP",
"-",
"47",
"syntax",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/i18n/ResourceBundle.js#L157-L164 | train | Converts a locale string to BCP47 language | [
30522,
3853,
10463,
4135,
9289,
18903,
9818,
2361,
22610,
1006,
22889,
24755,
2571,
1007,
1063,
13075,
1049,
1025,
2065,
1006,
2828,
11253,
22889,
24755,
2571,
1027,
1027,
1027,
1005,
5164,
1005,
1004,
1004,
1006,
1049,
1027,
1054,
4135,
92... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(state, source, target, points, result)
{
var graph = state.view.graph;
var sourceEdge = source == null ? false : graph.getModel().isEdge(source.cell);
var targetEdge = target == null ? false : graph.getModel().isEdge(target.cell);
var pts = state.absolutePoints;
var p0 = pts[0];
var pe = pts[pts.... | javascript | function(state, source, target, points, result)
{
var graph = state.view.graph;
var sourceEdge = source == null ? false : graph.getModel().isEdge(source.cell);
var targetEdge = target == null ? false : graph.getModel().isEdge(target.cell);
var pts = state.absolutePoints;
var p0 = pts[0];
var pe = pts[pts.... | [
"function",
"(",
"state",
",",
"source",
",",
"target",
",",
"points",
",",
"result",
")",
"{",
"var",
"graph",
"=",
"state",
".",
"view",
".",
"graph",
";",
"var",
"sourceEdge",
"=",
"source",
"==",
"null",
"?",
"false",
":",
"graph",
".",
"getModel... | Function: OrthConnector
Implements a local orthogonal router between the given
cells.
Parameters:
state - <mxCellState> that represents the edge to be updated.
source - <mxCellState> that represents the source terminal.
target - <mxCellState> that represents the target terminal.
points - List of relative control poi... | [
"Function",
":",
"OrthConnector"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L50405-L50958 | train | Calculates the distance between two vertices of the source and target. | [
30522,
3853,
1006,
2110,
1010,
3120,
1010,
4539,
1010,
2685,
1010,
2765,
1007,
1063,
13075,
10629,
1027,
2110,
1012,
3193,
1012,
10629,
1025,
13075,
3120,
24225,
1027,
3120,
1027,
1027,
19701,
1029,
6270,
1024,
10629,
1012,
2131,
5302,
9247... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
tgriesser/knex | src/seed/Seeder.js | Seeder | function Seeder(knex) {
this.knex = knex;
this.config = this.setConfig(knex.client.config.seeds);
} | javascript | function Seeder(knex) {
this.knex = knex;
this.config = this.setConfig(knex.client.config.seeds);
} | [
"function",
"Seeder",
"(",
"knex",
")",
"{",
"this",
".",
"knex",
"=",
"knex",
";",
"this",
".",
"config",
"=",
"this",
".",
"setConfig",
"(",
"knex",
".",
"client",
".",
"config",
".",
"seeds",
")",
";",
"}"
] | The new seeds we're performing, typically called from the `knex.seed` interface on the main `knex` object. Passes the `knex` instance performing the seeds. | [
"The",
"new",
"seeds",
"we",
"re",
"performing",
"typically",
"called",
"from",
"the",
"knex",
".",
"seed",
"interface",
"on",
"the",
"main",
"knex",
"object",
".",
"Passes",
"the",
"knex",
"instance",
"performing",
"the",
"seeds",
"."
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/seed/Seeder.js#L13-L16 | train | Seeder constructor. | [
30522,
3853,
6534,
2121,
1006,
14161,
10288,
1007,
1063,
2023,
1012,
14161,
10288,
1027,
14161,
10288,
1025,
2023,
1012,
9530,
8873,
2290,
1027,
2023,
1012,
2275,
8663,
8873,
2290,
1006,
14161,
10288,
1012,
7396,
1012,
9530,
8873,
2290,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
postcss/autoprefixer | lib/hacks/grid-utils.js | selectorsEqual | function selectorsEqual (ruleA, ruleB) {
return ruleA.selectors.some(sel => {
return ruleB.selectors.some(s => s === sel)
})
} | javascript | function selectorsEqual (ruleA, ruleB) {
return ruleA.selectors.some(sel => {
return ruleB.selectors.some(s => s === sel)
})
} | [
"function",
"selectorsEqual",
"(",
"ruleA",
",",
"ruleB",
")",
"{",
"return",
"ruleA",
".",
"selectors",
".",
"some",
"(",
"sel",
"=>",
"{",
"return",
"ruleB",
".",
"selectors",
".",
"some",
"(",
"s",
"=>",
"s",
"===",
"sel",
")",
"}",
")",
"}"
] | check if selector of rules are equal
@param {Rule} ruleA
@param {Rule} ruleB
@return {Boolean} | [
"check",
"if",
"selector",
"of",
"rules",
"are",
"equal"
] | 24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32 | https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L340-L344 | train | Check if ruleA and ruleB have the same selectors | [
30522,
3853,
27000,
3366,
26426,
1006,
3627,
2050,
1010,
3627,
2497,
1007,
1063,
2709,
3627,
2050,
1012,
27000,
2015,
1012,
2070,
1006,
7367,
2140,
1027,
1028,
1063,
2709,
3627,
2497,
1012,
27000,
2015,
1012,
2070,
1006,
1055,
1027,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mochajs/mocha | lib/reporters/base.js | Base | function Base(runner, options) {
var failures = (this.failures = []);
if (!runner) {
throw new TypeError('Missing runner argument');
}
this.options = options || {};
this.runner = runner;
this.stats = runner.stats; // assigned so Reporters keep a closer reference
runner.on(EVENT_TEST_PASS, function(t... | javascript | function Base(runner, options) {
var failures = (this.failures = []);
if (!runner) {
throw new TypeError('Missing runner argument');
}
this.options = options || {};
this.runner = runner;
this.stats = runner.stats; // assigned so Reporters keep a closer reference
runner.on(EVENT_TEST_PASS, function(t... | [
"function",
"Base",
"(",
"runner",
",",
"options",
")",
"{",
"var",
"failures",
"=",
"(",
"this",
".",
"failures",
"=",
"[",
"]",
")",
";",
"if",
"(",
"!",
"runner",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"'Missing runner argument'",
")",
";",
"... | Constructs a new `Base` reporter instance.
@description
All other reporters generally inherit from this reporter.
@public
@class
@memberof Mocha.reporters
@param {Runner} runner - Instance triggers reporter actions.
@param {Object} [options] - runner options | [
"Constructs",
"a",
"new",
"Base",
"reporter",
"instance",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/base.js#L272-L299 | train | Base class for all the tests | [
30522,
3853,
2918,
1006,
5479,
1010,
7047,
1007,
1063,
13075,
15428,
1027,
1006,
2023,
1012,
15428,
1027,
1031,
1033,
1007,
1025,
2065,
1006,
999,
5479,
1007,
1063,
5466,
2047,
2828,
2121,
29165,
1006,
1005,
4394,
5479,
6685,
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... |
eslint/eslint | lib/rules/no-regex-spaces.js | checkFunction | function checkFunction(node) {
const scope = context.getScope();
const regExpVar = astUtils.getVariableByName(scope, "RegExp");
const shadowed = regExpVar && regExpVar.defs.length > 0;
if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(nod... | javascript | function checkFunction(node) {
const scope = context.getScope();
const regExpVar = astUtils.getVariableByName(scope, "RegExp");
const shadowed = regExpVar && regExpVar.defs.length > 0;
if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(nod... | [
"function",
"checkFunction",
"(",
"node",
")",
"{",
"const",
"scope",
"=",
"context",
".",
"getScope",
"(",
")",
";",
"const",
"regExpVar",
"=",
"astUtils",
".",
"getVariableByName",
"(",
"scope",
",",
"\"RegExp\"",
")",
";",
"const",
"shadowed",
"=",
"reg... | Validate strings passed to the RegExp constructor
@param {ASTNode} node node to validate
@returns {void}
@private | [
"Validate",
"strings",
"passed",
"to",
"the",
"RegExp",
"constructor"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-regex-spaces.js#L99-L107 | train | Check if a function is a RegExp | [
30522,
3853,
4638,
11263,
27989,
1006,
13045,
1007,
1063,
9530,
3367,
9531,
1027,
6123,
1012,
4152,
16186,
1006,
1007,
1025,
9530,
3367,
19723,
10288,
2361,
10755,
1027,
2004,
8525,
3775,
4877,
1012,
2131,
10755,
19210,
3762,
18442,
1006,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/core/a-assets.js | fixUpMediaElement | function fixUpMediaElement (mediaEl) {
// Cross-origin.
var newMediaEl = setCrossOrigin(mediaEl);
// Plays inline for mobile.
if (newMediaEl.tagName && newMediaEl.tagName.toLowerCase() === 'video') {
newMediaEl.setAttribute('playsinline', '');
newMediaEl.setAttribute('webkit-playsinline', '');
}
i... | javascript | function fixUpMediaElement (mediaEl) {
// Cross-origin.
var newMediaEl = setCrossOrigin(mediaEl);
// Plays inline for mobile.
if (newMediaEl.tagName && newMediaEl.tagName.toLowerCase() === 'video') {
newMediaEl.setAttribute('playsinline', '');
newMediaEl.setAttribute('webkit-playsinline', '');
}
i... | [
"function",
"fixUpMediaElement",
"(",
"mediaEl",
")",
"{",
"// Cross-origin.",
"var",
"newMediaEl",
"=",
"setCrossOrigin",
"(",
"mediaEl",
")",
";",
"// Plays inline for mobile.",
"if",
"(",
"newMediaEl",
".",
"tagName",
"&&",
"newMediaEl",
".",
"tagName",
".",
"t... | Automatically add attributes to media elements where convenient.
crossorigin, playsinline. | [
"Automatically",
"add",
"attributes",
"to",
"media",
"elements",
"where",
"convenient",
".",
"crossorigin",
"playsinline",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/a-assets.js#L180-L195 | train | Fixes up the media element | [
30522,
3853,
8081,
6279,
16969,
12260,
3672,
1006,
2865,
2884,
1007,
1063,
1013,
1013,
2892,
1011,
4761,
1012,
13075,
2047,
16969,
2884,
1027,
2275,
16458,
10050,
11528,
1006,
2865,
2884,
1007,
1025,
1013,
1013,
3248,
23881,
2005,
4684,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/modifiers/config/hasPlugin.js | hasPlugin | function hasPlugin(deps, pluginName, version) {
return !!deps.find(function(dep) {
return dep.getName() === pluginName && (!version || dep.getVersion() === version);
});
} | javascript | function hasPlugin(deps, pluginName, version) {
return !!deps.find(function(dep) {
return dep.getName() === pluginName && (!version || dep.getVersion() === version);
});
} | [
"function",
"hasPlugin",
"(",
"deps",
",",
"pluginName",
",",
"version",
")",
"{",
"return",
"!",
"!",
"deps",
".",
"find",
"(",
"function",
"(",
"dep",
")",
"{",
"return",
"dep",
".",
"getName",
"(",
")",
"===",
"pluginName",
"&&",
"(",
"!",
"versio... | Test if a plugin is listed
@param { {List<PluginDependency}} deps
@param {String} plugin
@param {String} version
@return {Boolean} | [
"Test",
"if",
"a",
"plugin",
"is",
"listed"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/modifiers/config/hasPlugin.js#L9-L13 | train | Check if a dependency is a plugin | [
30522,
3853,
2038,
24759,
30524,
4523,
1012,
2424,
1006,
3853,
1006,
2139,
2361,
1007,
1063,
2709,
2139,
2361,
1012,
2131,
18442,
1006,
1007,
1027,
1027,
1027,
13354,
23111,
14074,
1004,
1004,
1006,
999,
2544,
1064,
1064,
2139,
2361,
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... |
apache/incubator-echarts | src/coord/single/singleCreator.js | create | function create(ecModel, api) {
var singles = [];
ecModel.eachComponent('singleAxis', function (axisModel, idx) {
var single = new Single(axisModel, ecModel, api);
single.name = 'single_' + idx;
single.resize(axisModel, api);
axisModel.coordinateSystem = single;
singles... | javascript | function create(ecModel, api) {
var singles = [];
ecModel.eachComponent('singleAxis', function (axisModel, idx) {
var single = new Single(axisModel, ecModel, api);
single.name = 'single_' + idx;
single.resize(axisModel, api);
axisModel.coordinateSystem = single;
singles... | [
"function",
"create",
"(",
"ecModel",
",",
"api",
")",
"{",
"var",
"singles",
"=",
"[",
"]",
";",
"ecModel",
".",
"eachComponent",
"(",
"'singleAxis'",
",",
"function",
"(",
"axisModel",
",",
"idx",
")",
"{",
"var",
"single",
"=",
"new",
"Single",
"(",... | Create single coordinate system and inject it into seriesModel.
@param {module:echarts/model/Global} ecModel
@param {module:echarts/ExtensionAPI} api
@return {Array.<module:echarts/coord/single/Single>} | [
"Create",
"single",
"coordinate",
"system",
"and",
"inject",
"it",
"into",
"seriesModel",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/single/singleCreator.js#L34-L59 | train | Create single series | [
30522,
3853,
3443,
1006,
14925,
5302,
9247,
1010,
17928,
1007,
1063,
13075,
3895,
1027,
1031,
1033,
1025,
14925,
5302,
9247,
1012,
2169,
9006,
29513,
3372,
1006,
1005,
2309,
8528,
2483,
1005,
1010,
3853,
1006,
8123,
5302,
9247,
1010,
8909,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/command/KeyBindingManager.js | addBinding | function addBinding(command, keyBindings, platform) {
var commandID = "",
results;
if (!command) {
console.error("addBinding(): missing required parameter: command");
return;
}
if (!keyBindings) { return; }
if (typeof (command) === "string")... | javascript | function addBinding(command, keyBindings, platform) {
var commandID = "",
results;
if (!command) {
console.error("addBinding(): missing required parameter: command");
return;
}
if (!keyBindings) { return; }
if (typeof (command) === "string")... | [
"function",
"addBinding",
"(",
"command",
",",
"keyBindings",
",",
"platform",
")",
"{",
"var",
"commandID",
"=",
"\"\"",
",",
"results",
";",
"if",
"(",
"!",
"command",
")",
"{",
"console",
".",
"error",
"(",
"\"addBinding(): missing required parameter: command... | Add one or more key bindings to a particular Command.
@param {!string | Command} command - A command ID or command object
@param {?({key: string, displayKey: string}|Array.<{key: string, displayKey: string, platform: string}>)} keyBindings
A single key binding or an array of keybindings. Example:
"Shift-Cmd-F". Mac an... | [
"Add",
"one",
"or",
"more",
"key",
"bindings",
"to",
"a",
"particular",
"Command",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L850-L887 | train | Add a key binding to the specified command | [
30522,
3853,
5587,
8428,
4667,
1006,
3094,
1010,
3145,
8428,
4667,
2015,
1010,
4132,
1007,
1063,
13075,
3094,
3593,
1027,
1000,
1000,
1010,
3463,
1025,
2065,
1006,
999,
3094,
1007,
1063,
10122,
1012,
7561,
1006,
1000,
5587,
8428,
4667,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/layout/AbsoluteLayout.js | function(oPosition, bRegisterOnly) {
var oChildControl = oPosition.getControl();
if (oChildControl) {
AbsoluteLayout.cleanUpControl(oChildControl);
if (!bRegisterOnly) {
adaptControlSize(oChildControl);
}
var oDelegate = (function(oControl) {
return {
onAfterRendering: function(){
a... | javascript | function(oPosition, bRegisterOnly) {
var oChildControl = oPosition.getControl();
if (oChildControl) {
AbsoluteLayout.cleanUpControl(oChildControl);
if (!bRegisterOnly) {
adaptControlSize(oChildControl);
}
var oDelegate = (function(oControl) {
return {
onAfterRendering: function(){
a... | [
"function",
"(",
"oPosition",
",",
"bRegisterOnly",
")",
"{",
"var",
"oChildControl",
"=",
"oPosition",
".",
"getControl",
"(",
")",
";",
"if",
"(",
"oChildControl",
")",
"{",
"AbsoluteLayout",
".",
"cleanUpControl",
"(",
"oChildControl",
")",
";",
"if",
"("... | (Re-)Initialize listening to child rerendering
@private | [
"(",
"Re",
"-",
")",
"Initialize",
"listening",
"to",
"child",
"rerendering"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/layout/AbsoluteLayout.js#L536-L556 | train | Adds a delegate to the control that is not already registered. | [
30522,
3853,
1006,
6728,
19234,
1010,
7987,
13910,
12911,
2239,
2135,
1007,
1063,
13075,
28166,
4014,
16409,
12162,
13153,
1027,
6728,
19234,
1012,
2131,
8663,
13181,
2140,
1006,
1007,
1025,
2065,
1006,
28166,
4014,
16409,
12162,
13153,
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... | |
apache/incubator-echarts | src/chart/sunburst/sunburstLayout.js | initChildren | function initChildren(node, isAsc) {
var children = node.children || [];
node.children = sort(children, isAsc);
// Init children recursively
if (children.length) {
zrUtil.each(node.children, function (child) {
initChildren(child, isAsc);
});
}
} | javascript | function initChildren(node, isAsc) {
var children = node.children || [];
node.children = sort(children, isAsc);
// Init children recursively
if (children.length) {
zrUtil.each(node.children, function (child) {
initChildren(child, isAsc);
});
}
} | [
"function",
"initChildren",
"(",
"node",
",",
"isAsc",
")",
"{",
"var",
"children",
"=",
"node",
".",
"children",
"||",
"[",
"]",
";",
"node",
".",
"children",
"=",
"sort",
"(",
"children",
",",
"isAsc",
")",
";",
"// Init children recursively",
"if",
"(... | Init node children by order and update visual
@param {TreeNode} node root node
@param {boolean} isAsc if is in ascendant order | [
"Init",
"node",
"children",
"by",
"order",
"and",
"update",
"visual"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sunburst/sunburstLayout.js#L175-L186 | train | Recursively init children recursively | [
30522,
3853,
1999,
20189,
4014,
16200,
2078,
1006,
13045,
1010,
18061,
11020,
1007,
1063,
13075,
2336,
1027,
13045,
1012,
2336,
1064,
1064,
1031,
1033,
1025,
13045,
1012,
2336,
1027,
4066,
1006,
2336,
1010,
18061,
11020,
1007,
1025,
1013,
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/services/theming/theming.js | generateAllThemes | function generateAllThemes($injector, $mdTheming) {
var head = document.head;
var firstChild = head ? head.firstElementChild : null;
var themeCss = !themeConfig.disableTheming && $injector.has('$MD_THEME_CSS') ? $injector.get('$MD_THEME_CSS') : '';
// Append our custom registered styles to the theme stylesheet... | javascript | function generateAllThemes($injector, $mdTheming) {
var head = document.head;
var firstChild = head ? head.firstElementChild : null;
var themeCss = !themeConfig.disableTheming && $injector.has('$MD_THEME_CSS') ? $injector.get('$MD_THEME_CSS') : '';
// Append our custom registered styles to the theme stylesheet... | [
"function",
"generateAllThemes",
"(",
"$injector",
",",
"$mdTheming",
")",
"{",
"var",
"head",
"=",
"document",
".",
"head",
";",
"var",
"firstChild",
"=",
"head",
"?",
"head",
".",
"firstElementChild",
":",
"null",
";",
"var",
"themeCss",
"=",
"!",
"theme... | Generate our themes at run time given the state of THEMES and PALETTES | [
"Generate",
"our",
"themes",
"at",
"run",
"time",
"given",
"the",
"state",
"of",
"THEMES",
"and",
"PALETTES"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/theming/theming.js#L1033-L1151 | train | Generate all the theme styles | [
30522,
3853,
9699,
8095,
10760,
7834,
1006,
1002,
1999,
20614,
2953,
1010,
1002,
9108,
10760,
6562,
1007,
1063,
13075,
2132,
1027,
6254,
1012,
2132,
1025,
13075,
2034,
19339,
1027,
2132,
1029,
2132,
1012,
2034,
12260,
3672,
19339,
1024,
197... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function() {
var data = this.elementToChange || {},
fields = this.container.querySelectorAll(SELECTOR_FIELDS),
length = fields.length,
i = 0;
for (; i<length; i++) {
data[fields[i].getAttribute(ATTRIBUTE_FIELDS)] = fields[i].value;
}
return data;... | javascript | function() {
var data = this.elementToChange || {},
fields = this.container.querySelectorAll(SELECTOR_FIELDS),
length = fields.length,
i = 0;
for (; i<length; i++) {
data[fields[i].getAttribute(ATTRIBUTE_FIELDS)] = fields[i].value;
}
return data;... | [
"function",
"(",
")",
"{",
"var",
"data",
"=",
"this",
".",
"elementToChange",
"||",
"{",
"}",
",",
"fields",
"=",
"this",
".",
"container",
".",
"querySelectorAll",
"(",
"SELECTOR_FIELDS",
")",
",",
"length",
"=",
"fields",
".",
"length",
",",
"i",
"=... | Grabs all fields in the dialog and puts them in key=>value style in an object which
then gets returned | [
"Grabs",
"all",
"fields",
"in",
"the",
"dialog",
"and",
"puts",
"them",
"in",
"key",
"=",
">",
"value",
"style",
"in",
"an",
"object",
"which",
"then",
"gets",
"returned"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L13537-L13547 | train | Get the data structure for the current page | [
30522,
3853,
1006,
1007,
1063,
13075,
2951,
1027,
2023,
1012,
5783,
3406,
22305,
2063,
1064,
1064,
1063,
1065,
1010,
4249,
1027,
2023,
1012,
11661,
1012,
23032,
11246,
22471,
6525,
3363,
1006,
27000,
1035,
4249,
1007,
1010,
3091,
1027,
4249... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ColorlibHQ/AdminLTE | bower_components/ion.rangeSlider/js/ion.rangeSlider.js | function () {
if (this.options.type === "single") {
if (this.options.values.length) {
this.$cache.input.prop("value", this.result.from_value);
} else {
this.$cache.input.prop("value", this.result.from);
}
... | javascript | function () {
if (this.options.type === "single") {
if (this.options.values.length) {
this.$cache.input.prop("value", this.result.from_value);
} else {
this.$cache.input.prop("value", this.result.from);
}
... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"options",
".",
"type",
"===",
"\"single\"",
")",
"{",
"if",
"(",
"this",
".",
"options",
".",
"values",
".",
"length",
")",
"{",
"this",
".",
"$cache",
".",
"input",
".",
"prop",
"(",
"\"value\"",... | Write values to input element | [
"Write",
"values",
"to",
"input",
"element"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/ion.rangeSlider/js/ion.rangeSlider.js#L1649-L1666 | train | set the value of the key | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
7047,
1012,
2828,
1027,
1027,
1027,
1000,
2309,
1000,
1007,
1063,
2065,
1006,
2023,
1012,
7047,
1012,
5300,
1012,
3091,
1007,
1063,
2023,
1012,
1002,
17053,
1012,
7953,
1012,
17678,
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... | |
marcuswestin/store.js | plugins/events.js | set | function set(super_fn, key, val) {
var oldVal = this.get(key)
super_fn()
pubsub.fire(key, val, oldVal)
} | javascript | function set(super_fn, key, val) {
var oldVal = this.get(key)
super_fn()
pubsub.fire(key, val, oldVal)
} | [
"function",
"set",
"(",
"super_fn",
",",
"key",
",",
"val",
")",
"{",
"var",
"oldVal",
"=",
"this",
".",
"get",
"(",
"key",
")",
"super_fn",
"(",
")",
"pubsub",
".",
"fire",
"(",
"key",
",",
"val",
",",
"oldVal",
")",
"}"
] | overwrite function to fire when appropriate | [
"overwrite",
"function",
"to",
"fire",
"when",
"appropriate"
] | b8e22fea8738fc19da4d9e7dbf1cda6e5185c481 | https://github.com/marcuswestin/store.js/blob/b8e22fea8738fc19da4d9e7dbf1cda6e5185c481/plugins/events.js#L34-L38 | train | set is a wrapper around set | [
30522,
3853,
2275,
1006,
3565,
1035,
1042,
2078,
1010,
3145,
1010,
11748,
1007,
1063,
13075,
2214,
10175,
1027,
2023,
1012,
2131,
1006,
3145,
1007,
3565,
1035,
1042,
2078,
1006,
1007,
23598,
12083,
1012,
2543,
1006,
3145,
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... |
dequelabs/axe-core | lib/commons/text/accessible-text-virtual.js | shouldIgnoreHidden | function shouldIgnoreHidden({ actualNode }, context) {
if (
// If the parent isn't ignored, the text node should not be either
actualNode.nodeType !== 1 ||
// If the target of aria-labelledby is hidden, ignore all descendents
context.includeHidden
) {
return false;
}
return !dom.isVisible(actualNode, tru... | javascript | function shouldIgnoreHidden({ actualNode }, context) {
if (
// If the parent isn't ignored, the text node should not be either
actualNode.nodeType !== 1 ||
// If the target of aria-labelledby is hidden, ignore all descendents
context.includeHidden
) {
return false;
}
return !dom.isVisible(actualNode, tru... | [
"function",
"shouldIgnoreHidden",
"(",
"{",
"actualNode",
"}",
",",
"context",
")",
"{",
"if",
"(",
"// If the parent isn't ignored, the text node should not be either",
"actualNode",
".",
"nodeType",
"!==",
"1",
"||",
"// If the target of aria-labelledby is hidden, ignore all ... | Check if the
@param {VirtualNode} element
@param {Object} context
@property {VirtualNode[]} processed
@return {Boolean} | [
"Check",
"if",
"the"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/commons/text/accessible-text-virtual.js#L88-L99 | train | Returns true if the node should be ignored | [
30522,
3853,
2323,
23773,
5686,
27511,
4181,
1006,
1063,
5025,
3630,
3207,
1065,
1010,
6123,
1007,
1063,
2065,
1006,
1013,
1013,
2065,
1996,
6687,
3475,
1005,
1056,
6439,
1010,
1996,
3793,
13045,
2323,
2025,
2022,
2593,
5025,
3630,
3207,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FileFilters.js | filterFileList | function filterFileList(compiledFilter, files) {
if (!compiledFilter) {
return files;
}
var re = new RegExp(compiledFilter);
return files.filter(function (f) {
return !re.test(f.fullPath);
});
} | javascript | function filterFileList(compiledFilter, files) {
if (!compiledFilter) {
return files;
}
var re = new RegExp(compiledFilter);
return files.filter(function (f) {
return !re.test(f.fullPath);
});
} | [
"function",
"filterFileList",
"(",
"compiledFilter",
",",
"files",
")",
"{",
"if",
"(",
"!",
"compiledFilter",
")",
"{",
"return",
"files",
";",
"}",
"var",
"re",
"=",
"new",
"RegExp",
"(",
"compiledFilter",
")",
";",
"return",
"files",
".",
"filter",
"(... | Returns a copy of 'files' filtered to just those that don't match any of the exclusion globs in the filter.
@param {?string} compiledFilter 'Compiled' filter object as returned by compile(), or null to no-op
@param {!Array.<File>} files
@return {!Array.<File>} | [
"Returns",
"a",
"copy",
"of",
"files",
"filtered",
"to",
"just",
"those",
"that",
"don",
"t",
"match",
"any",
"of",
"the",
"exclusion",
"globs",
"in",
"the",
"filter",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L285-L294 | train | filter the files | [
30522,
3853,
11307,
8873,
2571,
9863,
1006,
9227,
8873,
21928,
1010,
6764,
1007,
1063,
2065,
1006,
999,
9227,
8873,
21928,
1007,
1063,
2709,
6764,
1025,
1065,
13075,
2128,
1027,
2047,
19723,
10288,
2361,
1006,
9227,
8873,
21928,
1007,
1025,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/prefer-promise-reject-errors.js | isPromiseRejectCall | function isPromiseRejectCall(node) {
return node.callee.type === "MemberExpression" &&
node.callee.object.type === "Identifier" && node.callee.object.name === "Promise" &&
node.callee.property.type === "Identifier" && node.callee.property.name === "reject";
} | javascript | function isPromiseRejectCall(node) {
return node.callee.type === "MemberExpression" &&
node.callee.object.type === "Identifier" && node.callee.object.name === "Promise" &&
node.callee.property.type === "Identifier" && node.callee.property.name === "reject";
} | [
"function",
"isPromiseRejectCall",
"(",
"node",
")",
"{",
"return",
"node",
".",
"callee",
".",
"type",
"===",
"\"MemberExpression\"",
"&&",
"node",
".",
"callee",
".",
"object",
".",
"type",
"===",
"\"Identifier\"",
"&&",
"node",
".",
"callee",
".",
"object... | Determines whether a function call is a Promise.reject() call
@param {ASTNode} node A CallExpression node
@returns {boolean} `true` if the call is a Promise.reject() call | [
"Determines",
"whether",
"a",
"function",
"call",
"is",
"a",
"Promise",
".",
"reject",
"()",
"call"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-promise-reject-errors.js#L71-L75 | train | Returns true if the given node is a call to Promise. reject | [
30522,
3853,
2003,
21572,
28732,
2890,
20614,
9289,
2140,
1006,
13045,
1007,
1063,
2709,
13045,
1012,
2655,
4402,
1012,
2828,
1027,
1027,
1027,
1000,
2266,
10288,
20110,
3258,
1000,
1004,
1004,
13045,
1012,
2655,
4402,
1012,
4874,
1012,
282... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
MithrilJS/mithril.js | render/render.js | updateEvent | function updateEvent(vnode, key, value) {
if (vnode.events != null) {
if (vnode.events[key] === value) return
if (value != null && (typeof value === "function" || typeof value === "object")) {
if (vnode.events[key] == null) vnode.dom.addEventListener(key.slice(2), vnode.events, false)
vnode.events[key] ... | javascript | function updateEvent(vnode, key, value) {
if (vnode.events != null) {
if (vnode.events[key] === value) return
if (value != null && (typeof value === "function" || typeof value === "object")) {
if (vnode.events[key] == null) vnode.dom.addEventListener(key.slice(2), vnode.events, false)
vnode.events[key] ... | [
"function",
"updateEvent",
"(",
"vnode",
",",
"key",
",",
"value",
")",
"{",
"if",
"(",
"vnode",
".",
"events",
"!=",
"null",
")",
"{",
"if",
"(",
"vnode",
".",
"events",
"[",
"key",
"]",
"===",
"value",
")",
"return",
"if",
"(",
"value",
"!=",
"... | event | [
"event"
] | 6d36fe09d129928c6b460720e08d9ed321fcd62b | https://github.com/MithrilJS/mithril.js/blob/6d36fe09d129928c6b460720e08d9ed321fcd62b/render/render.js#L848-L863 | train | Updates an event on a DOM node | [
30522,
3853,
10651,
18697,
3372,
1006,
1058,
3630,
3207,
1010,
3145,
1010,
3643,
1007,
1063,
2065,
1006,
1058,
3630,
3207,
1012,
2824,
999,
1027,
19701,
1007,
1063,
2065,
1006,
1058,
3630,
3207,
1012,
2824,
1031,
3145,
1033,
1027,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/component/helper/BrushTargetManager.js | function (foundCpts, targetInfo) {
var xAxisModel = foundCpts.xAxisModel;
var yAxisModel = foundCpts.yAxisModel;
var gridModel = foundCpts.gridModel;
!gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);
!gridModel && yAxisModel && (gridModel = yAxisModel.axis.gr... | javascript | function (foundCpts, targetInfo) {
var xAxisModel = foundCpts.xAxisModel;
var yAxisModel = foundCpts.yAxisModel;
var gridModel = foundCpts.gridModel;
!gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);
!gridModel && yAxisModel && (gridModel = yAxisModel.axis.gr... | [
"function",
"(",
"foundCpts",
",",
"targetInfo",
")",
"{",
"var",
"xAxisModel",
"=",
"foundCpts",
".",
"xAxisModel",
";",
"var",
"yAxisModel",
"=",
"foundCpts",
".",
"yAxisModel",
";",
"var",
"gridModel",
"=",
"foundCpts",
".",
"gridModel",
";",
"!",
"gridMo... | grid | [
"grid"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/component/helper/BrushTargetManager.js#L332-L341 | train | Returns true if the given chart is a grid model | [
30522,
3853,
1006,
2179,
21906,
3215,
1010,
4539,
2378,
14876,
1007,
1063,
13075,
1060,
8528,
2964,
10244,
2140,
1027,
2179,
21906,
3215,
1012,
1060,
8528,
2964,
10244,
2140,
1025,
13075,
8038,
9048,
25855,
9247,
1027,
2179,
21906,
3215,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js | function (oResult, bExpression, bWithType) {
var vValue = oResult.value;
function binding(bAddType) {
var sConstraints, sResult;
bAddType = bAddType && !oResult.ignoreTypeInPath && oResult.type;
if (bAddType || rBadChars.test(vValue)) {
sResult = "{path:" + Basics.toJSON(vValue);
if (bAddT... | javascript | function (oResult, bExpression, bWithType) {
var vValue = oResult.value;
function binding(bAddType) {
var sConstraints, sResult;
bAddType = bAddType && !oResult.ignoreTypeInPath && oResult.type;
if (bAddType || rBadChars.test(vValue)) {
sResult = "{path:" + Basics.toJSON(vValue);
if (bAddT... | [
"function",
"(",
"oResult",
",",
"bExpression",
",",
"bWithType",
")",
"{",
"var",
"vValue",
"=",
"oResult",
".",
"value",
";",
"function",
"binding",
"(",
"bAddType",
")",
"{",
"var",
"sConstraints",
",",
"sResult",
";",
"bAddType",
"=",
"bAddType",
"&&",... | Converts the result's value to a string.
@param {object} oResult
an object with the following properties:
result: "constant", "binding", "composite" or "expression"
value: {any} the value to write into the resulting string depending on result:
when "constant": the constant value as a string (from the annotation)
when ... | [
"Converts",
"the",
"result",
"s",
"value",
"to",
"a",
"string",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js#L333-L392 | train | Creates a binding string for the given value. | [
30522,
3853,
1006,
10848,
23722,
2102,
1010,
2022,
2595,
20110,
3258,
1010,
1038,
24415,
13874,
1007,
1063,
13075,
1058,
10175,
5657,
1027,
10848,
23722,
2102,
1012,
3643,
1025,
3853,
8031,
1006,
2919,
11927,
18863,
1007,
1063,
13075,
8040,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jhipster/generator-jhipster | generators/docker-prompts.js | askForApps | function askForApps() {
if (this.regenerate) return;
const done = this.async();
const messageAskForApps = 'Which applications do you want to include in your configuration?';
const prompts = [
{
type: 'checkbox',
name: 'chosenApps',
message: messageAskForApps... | javascript | function askForApps() {
if (this.regenerate) return;
const done = this.async();
const messageAskForApps = 'Which applications do you want to include in your configuration?';
const prompts = [
{
type: 'checkbox',
name: 'chosenApps',
message: messageAskForApps... | [
"function",
"askForApps",
"(",
")",
"{",
"if",
"(",
"this",
".",
"regenerate",
")",
"return",
";",
"const",
"done",
"=",
"this",
".",
"async",
"(",
")",
";",
"const",
"messageAskForApps",
"=",
"'Which applications do you want to include in your configuration?'",
"... | Ask For Apps | [
"Ask",
"For",
"Apps"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/docker-prompts.js#L168-L191 | train | Ask For Apps | [
30522,
3853,
3198,
29278,
29098,
2015,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
19723,
24454,
3686,
1007,
2709,
1025,
9530,
3367,
2589,
1027,
2023,
1012,
2004,
6038,
2278,
1006,
1007,
1025,
9530,
3367,
4471,
19895,
29278,
29098,
2015,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | parse_PtgAttrIfError | function parse_PtgAttrIfError(blob) {
var bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0;
blob.l += 2;
return [bitIf, blob.read_shift(2)];
} | javascript | function parse_PtgAttrIfError(blob) {
var bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0;
blob.l += 2;
return [bitIf, blob.read_shift(2)];
} | [
"function",
"parse_PtgAttrIfError",
"(",
"blob",
")",
"{",
"var",
"bitIf",
"=",
"(",
"blob",
"[",
"blob",
".",
"l",
"+",
"1",
"]",
"&",
"0xFF",
")",
"?",
"1",
":",
"0",
";",
"blob",
".",
"l",
"+=",
"2",
";",
"return",
"[",
"bitIf",
",",
"blob",... | /* [MS-XLSB] 2.5.97.28 | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"5",
".",
"97",
".",
"28"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L10390-L10394 | train | Parse an error in the PTG attribute | [
30522,
3853,
11968,
3366,
1035,
13866,
20697,
18886,
7512,
29165,
1006,
1038,
4135,
2497,
1007,
1063,
13075,
2978,
10128,
1027,
1006,
1038,
4135,
2497,
1031,
1038,
4135,
2497,
1012,
1048,
1009,
1015,
1033,
1004,
1014,
2595,
4246,
1007,
1029... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
airyland/vux | src/components/video/zy.media.js | detectType | function detectType(media, options, src) {
var mediaFiles = [];
var i;
var n;
var isCanPlay;
// Get URL and type
if (options.type) {
// Accept either string or array of types
if (typeof options.type == 'string') {
mediaFiles.push({
type: options.type,
url: src
});
} else {
for (i = 0; i < ... | javascript | function detectType(media, options, src) {
var mediaFiles = [];
var i;
var n;
var isCanPlay;
// Get URL and type
if (options.type) {
// Accept either string or array of types
if (typeof options.type == 'string') {
mediaFiles.push({
type: options.type,
url: src
});
} else {
for (i = 0; i < ... | [
"function",
"detectType",
"(",
"media",
",",
"options",
",",
"src",
")",
"{",
"var",
"mediaFiles",
"=",
"[",
"]",
";",
"var",
"i",
";",
"var",
"n",
";",
"var",
"isCanPlay",
";",
"// Get URL and type",
"if",
"(",
"options",
".",
"type",
")",
"{",
"// ... | Detect if current type is supported | [
"Detect",
"if",
"current",
"type",
"is",
"supported"
] | 484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6 | https://github.com/airyland/vux/blob/484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6/src/components/video/zy.media.js#L212-L283 | train | Detects the type of a media | [
30522,
3853,
11487,
13874,
1006,
2865,
1010,
7047,
1010,
5034,
2278,
1007,
1063,
13075,
2865,
8873,
4244,
1027,
1031,
1033,
1025,
13075,
1045,
1025,
13075,
1050,
1025,
13075,
2003,
9336,
13068,
1025,
1013,
1013,
2131,
24471,
2140,
1998,
282... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
vuejs/vuepress | packages/@vuepress/core/lib/node/build/index.js | workaroundEmptyStyleChunk | async function workaroundEmptyStyleChunk (stats, outDir) {
const styleChunk = stats.children[0].assets.find(a => {
return /styles\.\w{8}\.js$/.test(a.name)
})
if (!styleChunk) return
const styleChunkPath = path.resolve(outDir, styleChunk.name)
const styleChunkContent = await fs.readFile(styleChunkPath, 'u... | javascript | async function workaroundEmptyStyleChunk (stats, outDir) {
const styleChunk = stats.children[0].assets.find(a => {
return /styles\.\w{8}\.js$/.test(a.name)
})
if (!styleChunk) return
const styleChunkPath = path.resolve(outDir, styleChunk.name)
const styleChunkContent = await fs.readFile(styleChunkPath, 'u... | [
"async",
"function",
"workaroundEmptyStyleChunk",
"(",
"stats",
",",
"outDir",
")",
"{",
"const",
"styleChunk",
"=",
"stats",
".",
"children",
"[",
"0",
"]",
".",
"assets",
".",
"find",
"(",
"a",
"=>",
"{",
"return",
"/",
"styles\\.\\w{8}\\.js$",
"/",
".",... | find and remove empty style chunk caused by
https://github.com/webpack-contrib/mini-css-extract-plugin/issues/85
TODO remove when it's fixed
@param {Object} stats
@param {String} outDir
@returns {Promise<void>} | [
"find",
"and",
"remove",
"empty",
"style",
"chunk",
"caused",
"by",
"https",
":",
"//",
"github",
".",
"com",
"/",
"webpack",
"-",
"contrib",
"/",
"mini",
"-",
"css",
"-",
"extract",
"-",
"plugin",
"/",
"issues",
"/",
"85",
"TODO",
"remove",
"when",
... | 15784acc0cf2e87de3c147895b2c3977b0195d78 | https://github.com/vuejs/vuepress/blob/15784acc0cf2e87de3c147895b2c3977b0195d78/packages/@vuepress/core/lib/node/build/index.js#L255-L271 | train | fixes empty style chunks | [
30522,
2004,
6038,
2278,
3853,
2147,
24490,
6633,
13876,
27268,
12844,
20760,
8950,
1006,
26319,
1010,
2041,
4305,
2099,
1007,
1063,
9530,
3367,
2806,
20760,
8950,
1027,
26319,
1012,
2336,
1031,
1014,
1033,
1012,
7045,
1012,
2424,
1006,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Core.js | function() {
var oLocale = this.oConfiguration.getLocale();
oLocale ? html.setAttribute("lang", oLocale.toString()) : html.removeAttribute("lang");
} | javascript | function() {
var oLocale = this.oConfiguration.getLocale();
oLocale ? html.setAttribute("lang", oLocale.toString()) : html.removeAttribute("lang");
} | [
"function",
"(",
")",
"{",
"var",
"oLocale",
"=",
"this",
".",
"oConfiguration",
".",
"getLocale",
"(",
")",
";",
"oLocale",
"?",
"html",
".",
"setAttribute",
"(",
"\"lang\"",
",",
"oLocale",
".",
"toString",
"(",
")",
")",
":",
"html",
".",
"removeAtt... | append the lang info to the document (required for ARIA support) | [
"append",
"the",
"lang",
"info",
"to",
"the",
"document",
"(",
"required",
"for",
"ARIA",
"support",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Core.js#L821-L824 | train | Sets the lang attribute of the HTML markup. | [
30522,
3853,
1006,
1007,
1063,
13075,
19330,
24755,
2571,
1027,
2023,
1012,
1051,
30524,
2571,
1012,
2000,
3367,
4892,
1006,
1007,
1007,
1024,
16129,
1012,
6366,
19321,
3089,
8569,
2618,
1006,
1000,
11374,
1000,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/less.js | function (isLess) {
var index = i, $re = _$re, elements, extendList, c, e, extend, when, condition;
while ((isLess && (extend = this.extend())) || (isLess && (when = $re(/^when/))) || (e = this.element())) {
if (when) {
condition = expect(this... | javascript | function (isLess) {
var index = i, $re = _$re, elements, extendList, c, e, extend, when, condition;
while ((isLess && (extend = this.extend())) || (isLess && (when = $re(/^when/))) || (e = this.element())) {
if (when) {
condition = expect(this... | [
"function",
"(",
"isLess",
")",
"{",
"var",
"index",
"=",
"i",
",",
"$re",
"=",
"_$re",
",",
"elements",
",",
"extendList",
",",
"c",
",",
"e",
",",
"extend",
",",
"when",
",",
"condition",
";",
"while",
"(",
"(",
"isLess",
"&&",
"(",
"extend",
"... | A CSS Selector .class > div + h1 li a:hover Selectors are made out of one or more Elements, see above. | [
"A",
"CSS",
"Selector",
".",
"class",
">",
"div",
"+",
"h1",
"li",
"a",
":",
"hover",
"Selectors",
"are",
"made",
"out",
"of",
"one",
"or",
"more",
"Elements",
"see",
"above",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L1417-L1440 | train | returns the selector | [
30522,
3853,
1006,
14195,
2015,
1007,
1063,
13075,
5950,
1027,
1045,
1010,
1002,
2128,
1027,
1035,
1002,
2128,
1010,
3787,
1010,
7949,
9863,
1010,
1039,
1010,
1041,
1010,
7949,
1010,
2043,
1010,
4650,
1025,
2096,
1006,
1006,
14195,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/LiveDevelopment/Agents/RemoteFunctions.js | Menu | function Menu(element) {
this.element = element;
_trigger(this.element, "showgoto", 1, true);
window.setTimeout(window.remoteShowGoto);
this.remove = this.remove.bind(this);
} | javascript | function Menu(element) {
this.element = element;
_trigger(this.element, "showgoto", 1, true);
window.setTimeout(window.remoteShowGoto);
this.remove = this.remove.bind(this);
} | [
"function",
"Menu",
"(",
"element",
")",
"{",
"this",
".",
"element",
"=",
"element",
";",
"_trigger",
"(",
"this",
".",
"element",
",",
"\"showgoto\"",
",",
"1",
",",
"true",
")",
";",
"window",
".",
"setTimeout",
"(",
"window",
".",
"remoteShowGoto",
... | construct the info menu | [
"construct",
"the",
"info",
"menu"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L139-L144 | train | Menu constructor. | [
30522,
3853,
12183,
1006,
5783,
1007,
1063,
2023,
1012,
5783,
1027,
5783,
1025,
1035,
9495,
1006,
2023,
1012,
5783,
1010,
1000,
2265,
3995,
3406,
1000,
1010,
1015,
1010,
2995,
1007,
1025,
3332,
1012,
2275,
7292,
5833,
1006,
3332,
1012,
65... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/SimpleForm.js | _createFormContainer | function _createFormContainer(oTitle) {
var oContainer = new FormContainer();
_createContainerLayoutData.call(this, oContainer);
oContainer.getAriaLabelledBy = function() {
// use aria-label of toolbar
var oToolbar = this.getToolbar();
if (oToolbar) {
return oToolbar.getAriaLabelledBy();
} else ... | javascript | function _createFormContainer(oTitle) {
var oContainer = new FormContainer();
_createContainerLayoutData.call(this, oContainer);
oContainer.getAriaLabelledBy = function() {
// use aria-label of toolbar
var oToolbar = this.getToolbar();
if (oToolbar) {
return oToolbar.getAriaLabelledBy();
} else ... | [
"function",
"_createFormContainer",
"(",
"oTitle",
")",
"{",
"var",
"oContainer",
"=",
"new",
"FormContainer",
"(",
")",
";",
"_createContainerLayoutData",
".",
"call",
"(",
"this",
",",
"oContainer",
")",
";",
"oContainer",
".",
"getAriaLabelledBy",
"=",
"funct... | /*
Creates a new FormContainer and adds the given title to it.
@param {sap.ui.core.Title || sap.ui.core.Toolbar} optional The title or toolbar of the FormContainer
@returns {sap.ui.layout.form.FormContainer} The newly created FormContainer
@private | [
"/",
"*",
"Creates",
"a",
"new",
"FormContainer",
"and",
"adds",
"the",
"given",
"title",
"to",
"it",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.layout/src/sap/ui/layout/form/SimpleForm.js#L1670-L1694 | train | Creates a new FormContainer with the given title and toolbar. | [
30522,
3853,
1035,
3443,
14192,
8663,
18249,
2121,
1006,
27178,
4183,
2571,
1007,
1063,
13075,
1051,
8663,
18249,
2121,
1027,
2047,
2433,
8663,
18249,
2121,
1006,
1007,
1025,
1035,
3443,
8663,
18249,
2121,
8485,
5833,
2850,
2696,
1012,
2655... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js | visitAttribute | function visitAttribute(oElement, oAttribute, oWithControl) {
if (fnSupportInfo) {
fnSupportInfo({context:undefined /*context from node clone*/, env:{caller:"visitAttribute", before: {name: oAttribute.name, value: oAttribute.value}}});
}
return resolveAttributeBinding(oElement, oAttribute, oWithControl... | javascript | function visitAttribute(oElement, oAttribute, oWithControl) {
if (fnSupportInfo) {
fnSupportInfo({context:undefined /*context from node clone*/, env:{caller:"visitAttribute", before: {name: oAttribute.name, value: oAttribute.value}}});
}
return resolveAttributeBinding(oElement, oAttribute, oWithControl... | [
"function",
"visitAttribute",
"(",
"oElement",
",",
"oAttribute",
",",
"oWithControl",
")",
"{",
"if",
"(",
"fnSupportInfo",
")",
"{",
"fnSupportInfo",
"(",
"{",
"context",
":",
"undefined",
"/*context from node clone*/",
",",
"env",
":",
"{",
"caller",
":",
"... | Visits the given attribute of the given element. If the attribute value represents a
binding expression that can be resolved, it is replaced with the resulting value.
@param {Element} oElement the XML DOM element
@param {Attr} oAttribute one of the element's attribute nodes
@param {sap.ui.core.template._with} oWithCon... | [
"Visits",
"the",
"given",
"attribute",
"of",
"the",
"given",
"element",
".",
"If",
"the",
"attribute",
"value",
"represents",
"a",
"binding",
"expression",
"that",
"can",
"be",
"resolved",
"it",
"is",
"replaced",
"with",
"the",
"resulting",
"value",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L1726-L1736 | train | Visit an attribute binding | [
30522,
3853,
3942,
19321,
3089,
8569,
2618,
1006,
1051,
12260,
3672,
1010,
1051,
19321,
3089,
8569,
2618,
1010,
27593,
8939,
8663,
13181,
2140,
1007,
1063,
2065,
1006,
1042,
3619,
6279,
6442,
2378,
14876,
1007,
1063,
1042,
3619,
6279,
6442,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mui-org/material-ui | dangerfile.js | generateMDTable | function generateMDTable(headers, body) {
const headerRow = headers.map(header => header.label);
const alignmentRow = headers.map(header => {
if (header.align === 'right') {
return ' ---:';
}
if (header.align === 'center') {
return ':---:';
}
return ' --- ';
});
return [headerRo... | javascript | function generateMDTable(headers, body) {
const headerRow = headers.map(header => header.label);
const alignmentRow = headers.map(header => {
if (header.align === 'right') {
return ' ---:';
}
if (header.align === 'center') {
return ':---:';
}
return ' --- ';
});
return [headerRo... | [
"function",
"generateMDTable",
"(",
"headers",
",",
"body",
")",
"{",
"const",
"headerRow",
"=",
"headers",
".",
"map",
"(",
"header",
"=>",
"header",
".",
"label",
")",
";",
"const",
"alignmentRow",
"=",
"headers",
".",
"map",
"(",
"header",
"=>",
"{",
... | Generates a Markdown table
@param {{ label: string, align: 'left' | 'center' | 'right'}[]} headers
@param {string[][]} body
@returns {string} | [
"Generates",
"a",
"Markdown",
"table"
] | 1555e52367835946382fbf2a8f681de71318915d | https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/dangerfile.js#L85-L98 | train | Generate MD table | [
30522,
3853,
9699,
26876,
10880,
1006,
20346,
2015,
1010,
2303,
1007,
1063,
9530,
3367,
20346,
10524,
1027,
20346,
2015,
1012,
4949,
1006,
20346,
1027,
1028,
20346,
1012,
3830,
1007,
1025,
9530,
3367,
12139,
10524,
1027,
20346,
2015,
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... |
nhn/tui.editor | src/js/wysiwygCommands/codeBlock.js | getCodeBlockBody | function getCodeBlockBody(range, wwe) {
const mgr = wwe.componentManager.getManager('codeblock');
let codeBlock;
if (range.collapsed) {
codeBlock = '<br>';
} else {
const contents = range.extractContents();
const nodes = util.toArray(contents.childNodes);
const tempDiv = $('<div>').append(mgr.pr... | javascript | function getCodeBlockBody(range, wwe) {
const mgr = wwe.componentManager.getManager('codeblock');
let codeBlock;
if (range.collapsed) {
codeBlock = '<br>';
} else {
const contents = range.extractContents();
const nodes = util.toArray(contents.childNodes);
const tempDiv = $('<div>').append(mgr.pr... | [
"function",
"getCodeBlockBody",
"(",
"range",
",",
"wwe",
")",
"{",
"const",
"mgr",
"=",
"wwe",
".",
"componentManager",
".",
"getManager",
"(",
"'codeblock'",
")",
";",
"let",
"codeBlock",
";",
"if",
"(",
"range",
".",
"collapsed",
")",
"{",
"codeBlock",
... | getCodeBlockBody
get text wrapped by code
@param {object} range range object
@param {object} wwe wysiwyg editor
@returns {string} | [
"getCodeBlockBody",
"get",
"text",
"wrapped",
"by",
"code"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/wysiwygCommands/codeBlock.js#L70-L83 | train | Get code block body | [
30522,
3853,
2131,
16044,
23467,
23684,
1006,
2846,
1010,
11700,
1007,
1063,
9530,
3367,
11460,
2099,
1027,
11700,
1012,
6922,
24805,
4590,
1012,
2131,
24805,
4590,
1006,
1005,
3642,
23467,
1005,
1007,
1025,
2292,
3642,
23467,
1025,
2065,
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.m/src/sap/m/BarRenderer.js | writeWidthIfContentOccupiesWholeArea | function writeWidthIfContentOccupiesWholeArea(sArea, oRm, oControl) {
var bContentLeft = !!oControl.getContentLeft().length,
bContentMiddle = !!oControl.getContentMiddle().length,
bContentRight = !!oControl.getContentRight().length;
function writeAndUpdate() {
oRm.addStyle("width", "100%");
oRm.writeSt... | javascript | function writeWidthIfContentOccupiesWholeArea(sArea, oRm, oControl) {
var bContentLeft = !!oControl.getContentLeft().length,
bContentMiddle = !!oControl.getContentMiddle().length,
bContentRight = !!oControl.getContentRight().length;
function writeAndUpdate() {
oRm.addStyle("width", "100%");
oRm.writeSt... | [
"function",
"writeWidthIfContentOccupiesWholeArea",
"(",
"sArea",
",",
"oRm",
",",
"oControl",
")",
"{",
"var",
"bContentLeft",
"=",
"!",
"!",
"oControl",
".",
"getContentLeft",
"(",
")",
".",
"length",
",",
"bContentMiddle",
"=",
"!",
"!",
"oControl",
".",
... | Adds width style to 100% in case of the given content container is the only container with content amongst the three (left, middle, right)
@param {string} sArea The content container - one of the left, middle or right
@param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the Render-Ou... | [
"Adds",
"width",
"style",
"to",
"100%",
"in",
"case",
"of",
"the",
"given",
"content",
"container",
"is",
"the",
"only",
"container",
"with",
"content",
"amongst",
"the",
"three",
"(",
"left",
"middle",
"right",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/BarRenderer.js#L174-L202 | train | Writes width of the content area if the content is not empty | [
30522,
3853,
4339,
9148,
11927,
4048,
11329,
28040,
13663,
9468,
6279,
3111,
2860,
11484,
12069,
2050,
1006,
18906,
5243,
1010,
2030,
2213,
1010,
1051,
8663,
13181,
2140,
1007,
1063,
13075,
4647,
28040,
3372,
2571,
6199,
1027,
999,
999,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/table/mergedTableUI.js | updateContextMenu | function updateContextMenu(popupTableUtils, eventManager, selectionManager) {
_changeContent(popupTableUtils);
_bindEvents(popupTableUtils, eventManager, selectionManager);
} | javascript | function updateContextMenu(popupTableUtils, eventManager, selectionManager) {
_changeContent(popupTableUtils);
_bindEvents(popupTableUtils, eventManager, selectionManager);
} | [
"function",
"updateContextMenu",
"(",
"popupTableUtils",
",",
"eventManager",
",",
"selectionManager",
")",
"{",
"_changeContent",
"(",
"popupTableUtils",
")",
";",
"_bindEvents",
"(",
"popupTableUtils",
",",
"eventManager",
",",
"selectionManager",
")",
";",
"}"
] | Update contextmenu UI.
@param {object} popupTableUtils - PopupTableUtils instance for managing contextmenu of table
@param {object} eventManager - event manager instance of editor
@param {object} selectionManager - table selection manager instance
@ignore | [
"Update",
"contextmenu",
"UI",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/mergedTableUI.js#L89-L92 | train | Updates the context menu with the current content. | [
30522,
3853,
10651,
8663,
18209,
3549,
2226,
1006,
3769,
29441,
3085,
21823,
4877,
1010,
2724,
24805,
4590,
1010,
4989,
24805,
4590,
1007,
1063,
1035,
2689,
8663,
6528,
2102,
1006,
3769,
29441,
3085,
21823,
4877,
1007,
1025,
1035,
14187,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/input-mask/jquery.inputmask.numeric.extensions.js | function (buffer, greedy, repeat, currentBuffer, opts) { //custom getMaskLength to take the groupSeparator into account
var calculatedLength = buffer.length;
if (!greedy) {
if (repeat == "*") {
calculatedLength = currentBuffer.length + 1;
... | javascript | function (buffer, greedy, repeat, currentBuffer, opts) { //custom getMaskLength to take the groupSeparator into account
var calculatedLength = buffer.length;
if (!greedy) {
if (repeat == "*") {
calculatedLength = currentBuffer.length + 1;
... | [
"function",
"(",
"buffer",
",",
"greedy",
",",
"repeat",
",",
"currentBuffer",
",",
"opts",
")",
"{",
"//custom getMaskLength to take the groupSeparator into account",
"var",
"calculatedLength",
"=",
"buffer",
".",
"length",
";",
"if",
"(",
"!",
"greedy",
")",
"{"... | todo | [
"todo"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/input-mask/jquery.inputmask.numeric.extensions.js#L34-L50 | train | Returns the number of characters in the buffer | [
30522,
3853,
1006,
17698,
1010,
20505,
1010,
9377,
1010,
2783,
8569,
12494,
1010,
23569,
2015,
1007,
1063,
1013,
1013,
7661,
2131,
9335,
19099,
3070,
2705,
2000,
2202,
1996,
2967,
13699,
25879,
2953,
2046,
4070,
13075,
10174,
7770,
13512,
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... | |
google/material-design-icons | gulpfile.babel.js | getCategoryColorPairs | function getCategoryColorPairs() {
return _(ICON_CATEGORIES)
.map((category) =>
_.zip(_.times(PNG_COLORS.length, () => category), PNG_COLORS))
.flatten() // flattens 1 level
.value();
} | javascript | function getCategoryColorPairs() {
return _(ICON_CATEGORIES)
.map((category) =>
_.zip(_.times(PNG_COLORS.length, () => category), PNG_COLORS))
.flatten() // flattens 1 level
.value();
} | [
"function",
"getCategoryColorPairs",
"(",
")",
"{",
"return",
"_",
"(",
"ICON_CATEGORIES",
")",
".",
"map",
"(",
"(",
"category",
")",
"=>",
"_",
".",
"zip",
"(",
"_",
".",
"times",
"(",
"PNG_COLORS",
".",
"length",
",",
"(",
")",
"=>",
"category",
"... | Returns the catesian product of categories and colors. | [
"Returns",
"the",
"catesian",
"product",
"of",
"categories",
"and",
"colors",
"."
] | 224895a86501195e7a7ff3dde18e39f00b8e3d5a | https://github.com/google/material-design-icons/blob/224895a86501195e7a7ff3dde18e39f00b8e3d5a/gulpfile.babel.js#L160-L166 | train | Get the category color pairs | [
30522,
3853,
2131,
16280,
20255,
2100,
18717,
4502,
18894,
1006,
1007,
1063,
2709,
1035,
1006,
12696,
1035,
7236,
1007,
1012,
4949,
1006,
1006,
4696,
1007,
1027,
1028,
1035,
1012,
14101,
1006,
1035,
1012,
2335,
1006,
1052,
3070,
1035,
6087,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/qunit.js | function( handler ) {
var hooks = [];
// Hooks are ignored on skipped tests
if ( this.skip ) {
return hooks;
}
if ( this.module.testEnvironment &&
QUnit.objectType( this.module.testEnvironment[ handler ] ) === "function" ) {
hooks.push( this.queueHook( this.module.testEnvironment[ handler ], handl... | javascript | function( handler ) {
var hooks = [];
// Hooks are ignored on skipped tests
if ( this.skip ) {
return hooks;
}
if ( this.module.testEnvironment &&
QUnit.objectType( this.module.testEnvironment[ handler ] ) === "function" ) {
hooks.push( this.queueHook( this.module.testEnvironment[ handler ], handl... | [
"function",
"(",
"handler",
")",
"{",
"var",
"hooks",
"=",
"[",
"]",
";",
"// Hooks are ignored on skipped tests",
"if",
"(",
"this",
".",
"skip",
")",
"{",
"return",
"hooks",
";",
"}",
"if",
"(",
"this",
".",
"module",
".",
"testEnvironment",
"&&",
"QUn... | Currently only used for module level hooks, can be used to add global level ones | [
"Currently",
"only",
"used",
"for",
"module",
"level",
"hooks",
"can",
"be",
"used",
"to",
"add",
"global",
"level",
"ones"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/qunit.js#L947-L961 | train | Add a hook to the test environment | [
30522,
3853,
1006,
28213,
1007,
1063,
13075,
18008,
1027,
1031,
1033,
1025,
1013,
1013,
18008,
2024,
6439,
2006,
16791,
5852,
2065,
1006,
2023,
1012,
13558,
1007,
1063,
2709,
18008,
1025,
1065,
2065,
1006,
2023,
1012,
11336,
1012,
3231,
236... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/command/index.js | function ($elem) {
const editor = this.editor
const range = editor.selection.getRange()
if (range.insertNode) {
range.deleteContents()
range.insertNode($elem[0])
}
} | javascript | function ($elem) {
const editor = this.editor
const range = editor.selection.getRange()
if (range.insertNode) {
range.deleteContents()
range.insertNode($elem[0])
}
} | [
"function",
"(",
"$elem",
")",
"{",
"const",
"editor",
"=",
"this",
".",
"editor",
"const",
"range",
"=",
"editor",
".",
"selection",
".",
"getRange",
"(",
")",
"if",
"(",
"range",
".",
"insertNode",
")",
"{",
"range",
".",
"deleteContents",
"(",
")",
... | 插入 elem | [
"插入",
"elem"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/command/index.js#L75-L83 | train | insert a node in the current language | [
30522,
3853,
1006,
1002,
3449,
6633,
1007,
1063,
9530,
3367,
3559,
1027,
2023,
1012,
3559,
9530,
3367,
2846,
1027,
3559,
1012,
4989,
1012,
2131,
24388,
2063,
1006,
1007,
2065,
1006,
2846,
1012,
19274,
3630,
3207,
1007,
1063,
2846,
1012,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/ODataTreeBindingFlat.js | function (oNode) {
// if there are subnodes added to the current node -> traverse them first (added nodes are at the top, before any children)
if (oNode.addedSubtrees.length > 0 && !oNode.nodeState.collapsed) {
// an added subtree can be either a deep or a flat tree (depending on the addContexts) call
for... | javascript | function (oNode) {
// if there are subnodes added to the current node -> traverse them first (added nodes are at the top, before any children)
if (oNode.addedSubtrees.length > 0 && !oNode.nodeState.collapsed) {
// an added subtree can be either a deep or a flat tree (depending on the addContexts) call
for... | [
"function",
"(",
"oNode",
")",
"{",
"// if there are subnodes added to the current node -> traverse them first (added nodes are at the top, before any children)",
"if",
"(",
"oNode",
".",
"addedSubtrees",
".",
"length",
">",
"0",
"&&",
"!",
"oNode",
".",
"nodeState",
".",
"... | Helper function to iterate all added subtrees of a node. | [
"Helper",
"function",
"to",
"iterate",
"all",
"added",
"subtrees",
"of",
"a",
"node",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/ODataTreeBindingFlat.js#L302-L314 | train | Traverse the added subnodes of the current node | [
30522,
3853,
1006,
21058,
3207,
1007,
1063,
1013,
1013,
2065,
2045,
2024,
4942,
3630,
6155,
2794,
2000,
1996,
2783,
13045,
1011,
1028,
20811,
2068,
2034,
1006,
2794,
14164,
2024,
2012,
1996,
2327,
1010,
2077,
2151,
2336,
1007,
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... | |
airyland/vux | src/components/range/lib/closest.js | closest | function closest (el, selector, scope) {
scope = scope || document.documentElement
// walk up the dom
while (el && el !== scope) {
if (matches(el, selector)) return el
el = el.parentNode
}
// check scope for match
return matches(el, selector) ? el : null
} | javascript | function closest (el, selector, scope) {
scope = scope || document.documentElement
// walk up the dom
while (el && el !== scope) {
if (matches(el, selector)) return el
el = el.parentNode
}
// check scope for match
return matches(el, selector) ? el : null
} | [
"function",
"closest",
"(",
"el",
",",
"selector",
",",
"scope",
")",
"{",
"scope",
"=",
"scope",
"||",
"document",
".",
"documentElement",
"// walk up the dom",
"while",
"(",
"el",
"&&",
"el",
"!==",
"scope",
")",
"{",
"if",
"(",
"matches",
"(",
"el",
... | Closest
@param {Element} el
@param {String} selector
@param {Element} scope (optional) | [
"Closest"
] | 484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6 | https://github.com/airyland/vux/blob/484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6/src/components/range/lib/closest.js#L21-L32 | train | Find the closest element to selector | [
30522,
3853,
7541,
1006,
3449,
1010,
27000,
1010,
9531,
1007,
1063,
9531,
1027,
9531,
1064,
1064,
6254,
1012,
6254,
12260,
3672,
1013,
1013,
3328,
2039,
1996,
14383,
2096,
1006,
3449,
1004,
1004,
3449,
999,
1027,
1027,
9531,
1007,
1063,
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.m/src/sap/m/HyphenationSupport.js | isValidTextKey | function isValidTextKey(oControl, sKey) {
var mTexts = oControl.getTextsToBeHyphenated();
if (typeof mTexts !== "object") {
Log.error("[UI5 Hyphenation] The result of getTextsToBeHyphenated method is not a map object.", oControl.getId());
return false;
}
if (Object.keys(mTexts).indexOf(sKey) < 0) ... | javascript | function isValidTextKey(oControl, sKey) {
var mTexts = oControl.getTextsToBeHyphenated();
if (typeof mTexts !== "object") {
Log.error("[UI5 Hyphenation] The result of getTextsToBeHyphenated method is not a map object.", oControl.getId());
return false;
}
if (Object.keys(mTexts).indexOf(sKey) < 0) ... | [
"function",
"isValidTextKey",
"(",
"oControl",
",",
"sKey",
")",
"{",
"var",
"mTexts",
"=",
"oControl",
".",
"getTextsToBeHyphenated",
"(",
")",
";",
"if",
"(",
"typeof",
"mTexts",
"!==",
"\"object\"",
")",
"{",
"Log",
".",
"error",
"(",
"\"[UI5 Hyphenation]... | Checks if the required text key is present in the texts map.
@param {sap.m.IHyphenation} oControl The control to be checked
@param {string} sKey The key to look for
@returns {boolean} True if the key is correct
@private | [
"Checks",
"if",
"the",
"required",
"text",
"key",
"is",
"present",
"in",
"the",
"texts",
"map",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/HyphenationSupport.js#L47-L61 | train | Checks if the given text key is valid | [
30522,
3853,
2003,
10175,
3593,
18209,
14839,
1006,
1051,
8663,
13181,
2140,
1010,
15315,
3240,
1007,
1063,
13075,
11047,
10288,
3215,
1027,
1051,
8663,
13181,
2140,
1012,
2131,
18209,
16033,
4783,
10536,
8458,
8189,
3064,
1006,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
openlayers/openlayers | examples/color-manipulation.js | hcl2rgb | function hcl2rgb(pixel) {
const h = pixel[0];
const c = pixel[1];
const l = pixel[2];
const a = Math.cos(h) * c;
const b = Math.sin(h) * c;
let y = (l + 16) / 116;
let x = isNaN(a) ? y : y + a / 500;
let z = isNaN(b) ? y : y - b / 200;
y = Yn * lab2xyz(y);
x = Xn * lab2xyz(x);
z = Zn * lab2xyz(... | javascript | function hcl2rgb(pixel) {
const h = pixel[0];
const c = pixel[1];
const l = pixel[2];
const a = Math.cos(h) * c;
const b = Math.sin(h) * c;
let y = (l + 16) / 116;
let x = isNaN(a) ? y : y + a / 500;
let z = isNaN(b) ? y : y - b / 200;
y = Yn * lab2xyz(y);
x = Xn * lab2xyz(x);
z = Zn * lab2xyz(... | [
"function",
"hcl2rgb",
"(",
"pixel",
")",
"{",
"const",
"h",
"=",
"pixel",
"[",
"0",
"]",
";",
"const",
"c",
"=",
"pixel",
"[",
"1",
"]",
";",
"const",
"l",
"=",
"pixel",
"[",
"2",
"]",
";",
"const",
"a",
"=",
"Math",
".",
"cos",
"(",
"h",
... | Convert an HCL pixel into an RGB pixel.
@param {Array<number>} pixel A pixel in HCL space.
@return {Array<number>} A pixel in RGB space. | [
"Convert",
"an",
"HCL",
"pixel",
"into",
"an",
"RGB",
"pixel",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/color-manipulation.js#L61-L82 | train | Convert pixel from HCL to RGB | [
30522,
3853,
16731,
2140,
2475,
10623,
2497,
1006,
22138,
1007,
1063,
9530,
3367,
1044,
1027,
22138,
1031,
1014,
1033,
1025,
9530,
3367,
1039,
1027,
22138,
1031,
1015,
1033,
1025,
9530,
3367,
1048,
1027,
22138,
1031,
1016,
1033,
1025,
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... |
swimlane/ngx-datatable | release/utils/camel-case.js | camelCase | function camelCase(str) {
// Replace special characters with a space
str = str.replace(/[^a-zA-Z0-9 ]/g, ' ');
// put a space before an uppercase letter
str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
// Lower case first character and some other stuff
str = str.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,... | javascript | function camelCase(str) {
// Replace special characters with a space
str = str.replace(/[^a-zA-Z0-9 ]/g, ' ');
// put a space before an uppercase letter
str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
// Lower case first character and some other stuff
str = str.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,... | [
"function",
"camelCase",
"(",
"str",
")",
"{",
"// Replace special characters with a space",
"str",
"=",
"str",
".",
"replace",
"(",
"/",
"[^a-zA-Z0-9 ]",
"/",
"g",
",",
"' '",
")",
";",
"// put a space before an uppercase letter",
"str",
"=",
"str",
".",
"replace... | Converts strings from something to camel case
http://stackoverflow.com/questions/10425287/convert-dash-separated-string-to-camelcase | [
"Converts",
"strings",
"from",
"something",
"to",
"camel",
"case",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"10425287",
"/",
"convert",
"-",
"dash",
"-",
"separated",
"-",
"string",
"-",
"to",
"-",
"camelcase"
] | d7df15a070282a169524dba51d9572008b74804c | https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/camel-case.js#L7-L19 | train | Convert a string to camelCase | [
30522,
3853,
19130,
18382,
1006,
2358,
2099,
1007,
1063,
1013,
1013,
5672,
2569,
3494,
2007,
1037,
2686,
2358,
2099,
1027,
2358,
2099,
1012,
5672,
1006,
1013,
1031,
1034,
1037,
1011,
23564,
1011,
1062,
2692,
1011,
1023,
1033,
1013,
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... |
ecomfe/zrender | src/tool/path.js | createPathProxyFromString | function createPathProxyFromString(data) {
if (!data) {
return new PathProxy();
}
// var data = data.replace(/-/g, ' -')
// .replace(/ /g, ' ')
// .replace(/ /g, ',')
// .replace(/,,/g, ',');
// var n;
// create pipes so that we can split the data
// for (n = 0... | javascript | function createPathProxyFromString(data) {
if (!data) {
return new PathProxy();
}
// var data = data.replace(/-/g, ' -')
// .replace(/ /g, ' ')
// .replace(/ /g, ',')
// .replace(/,,/g, ',');
// var n;
// create pipes so that we can split the data
// for (n = 0... | [
"function",
"createPathProxyFromString",
"(",
"data",
")",
"{",
"if",
"(",
"!",
"data",
")",
"{",
"return",
"new",
"PathProxy",
"(",
")",
";",
"}",
"// var data = data.replace(/-/g, ' -')",
"// .replace(/ /g, ' ')",
"// .replace(/ /g, ',')",
"// .replace(/,,/... | var valueSplitReg = /[\s,]+/; | [
"var",
"valueSplitReg",
"=",
"/",
"[",
"\\",
"s",
"]",
"+",
"/",
";"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/tool/path.js#L90-L356 | train | Create PathProxy from string | [
30522,
3853,
3443,
15069,
21572,
18037,
19699,
30524,
1043,
1010,
1005,
1005,
1007,
1013,
1013,
1012,
5672,
1006,
1013,
1013,
1043,
1010,
1005,
1010,
1005,
1007,
1013,
1013,
1012,
5672,
1006,
1013,
1010,
1010,
1013,
1043,
1010,
1005,
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... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | getEngineFor | function getEngineFor(inDocument) {
if (allowNativeXPath &&
nativeEngine.setDocument(inDocument).isAvailable()) {
return nativeEngine;
}
var currentEngine = engines[currentEngineName];
if (currentEngine &&
currentEngine.setDocument(inDocument).isAvai... | javascript | function getEngineFor(inDocument) {
if (allowNativeXPath &&
nativeEngine.setDocument(inDocument).isAvailable()) {
return nativeEngine;
}
var currentEngine = engines[currentEngineName];
if (currentEngine &&
currentEngine.setDocument(inDocument).isAvai... | [
"function",
"getEngineFor",
"(",
"inDocument",
")",
"{",
"if",
"(",
"allowNativeXPath",
"&&",
"nativeEngine",
".",
"setDocument",
"(",
"inDocument",
")",
".",
"isAvailable",
"(",
")",
")",
"{",
"return",
"nativeEngine",
";",
"}",
"var",
"currentEngine",
"=",
... | Returns the most sensible engine given the settings and the document
object. | [
"Returns",
"the",
"most",
"sensible",
"engine",
"given",
"the",
"settings",
"and",
"the",
"document",
"object",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L1981-L1995 | train | get engine for inDocument | [
30522,
3853,
2131,
13159,
3170,
29278,
1006,
11424,
24894,
4765,
1007,
1063,
2065,
1006,
3499,
19833,
3512,
2595,
15069,
1004,
1004,
3128,
13159,
3170,
1012,
2275,
3527,
24894,
4765,
1006,
11424,
24894,
4765,
1007,
1012,
18061,
3567,
11733,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
exceljs/exceljs | lib/xlsx/xform/sheet/row-breaks-xform.js | function(xmlStream, model) {
if (model && model.length) {
xmlStream.openNode(this.tag, this.$);
if (this.count) {
xmlStream.addAttribute(this.$count, model.length);
xmlStream.addAttribute('manualBreakCount', model.length);
}
var childXform = this.childXform;
model.forE... | javascript | function(xmlStream, model) {
if (model && model.length) {
xmlStream.openNode(this.tag, this.$);
if (this.count) {
xmlStream.addAttribute(this.$count, model.length);
xmlStream.addAttribute('manualBreakCount', model.length);
}
var childXform = this.childXform;
model.forE... | [
"function",
"(",
"xmlStream",
",",
"model",
")",
"{",
"if",
"(",
"model",
"&&",
"model",
".",
"length",
")",
"{",
"xmlStream",
".",
"openNode",
"(",
"this",
".",
"tag",
",",
"this",
".",
"$",
")",
";",
"if",
"(",
"this",
".",
"count",
")",
"{",
... | get tag() { return 'rowBreaks'; }, | [
"get",
"tag",
"()",
"{",
"return",
"rowBreaks",
";",
"}"
] | c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2 | https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/xlsx/xform/sheet/row-breaks-xform.js#L17-L34 | train | Render the model to the XML stream | [
30522,
3853,
1006,
20950,
21422,
1010,
2944,
1007,
1063,
2065,
1006,
2944,
1004,
1004,
2944,
1012,
3091,
1007,
1063,
20950,
21422,
1012,
2330,
3630,
3207,
1006,
2023,
1012,
6415,
1010,
2023,
1012,
1002,
1007,
1025,
2065,
1006,
2023,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/util/report-translator.js | normalizeMultiArgReportCall | function normalizeMultiArgReportCall(...args) {
// If there is one argument, it is considered to be a new-style call already.
if (args.length === 1) {
// Shallow clone the object to avoid surprises if reusing the descriptor
return Object.assign({}, args[0]);
}
// If the second argumen... | javascript | function normalizeMultiArgReportCall(...args) {
// If there is one argument, it is considered to be a new-style call already.
if (args.length === 1) {
// Shallow clone the object to avoid surprises if reusing the descriptor
return Object.assign({}, args[0]);
}
// If the second argumen... | [
"function",
"normalizeMultiArgReportCall",
"(",
"...",
"args",
")",
"{",
"// If there is one argument, it is considered to be a new-style call already.",
"if",
"(",
"args",
".",
"length",
"===",
"1",
")",
"{",
"// Shallow clone the object to avoid surprises if reusing the descripto... | ------------------------------------------------------------------------------ Module Definition ------------------------------------------------------------------------------
Translates a multi-argument context.report() call into a single object argument call
@param {...*} args A list of arguments passed to `context.... | [
"------------------------------------------------------------------------------",
"Module",
"Definition",
"------------------------------------------------------------------------------",
"Translates",
"a",
"multi",
"-",
"argument",
"context",
".",
"report",
"()",
"call",
"into",
"a",
... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/report-translator.js#L57-L84 | train | Normalize a report call to a specific key | [
30522,
3853,
3671,
4697,
12274,
7096,
2401,
10623,
2890,
6442,
9289,
2140,
1006,
1012,
1012,
1012,
12098,
5620,
1007,
1063,
1013,
1013,
2065,
2045,
2003,
2028,
6685,
1010,
2009,
2003,
2641,
2000,
2022,
1037,
2047,
1011,
2806,
2655,
2525,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
zeit/pkg | prelude/bootstrap.js | function (orig) {
return function () {
var args = Array.from(arguments);
var promise = createPromise();
orig.apply(undefined, args.concat(function (error, stdout, stderr) {
if (error !== null) {
error.stdout = stdout;
error.stderr = stderr;
pr... | javascript | function (orig) {
return function () {
var args = Array.from(arguments);
var promise = createPromise();
orig.apply(undefined, args.concat(function (error, stdout, stderr) {
if (error !== null) {
error.stdout = stdout;
error.stderr = stderr;
pr... | [
"function",
"(",
"orig",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"args",
"=",
"Array",
".",
"from",
"(",
"arguments",
")",
";",
"var",
"promise",
"=",
"createPromise",
"(",
")",
";",
"orig",
".",
"apply",
"(",
"undefined",
",",
"args",
... | ///////////////////////////////////////////////////////////// CHILD_PROCESS /////////////////////////////////////////////// ///////////////////////////////////////////////////////////// | [
"/////////////////////////////////////////////////////////////",
"CHILD_PROCESS",
"///////////////////////////////////////////////",
"/////////////////////////////////////////////////////////////"
] | 3775ab6decc2f8f013142e1282934c12fbd1881e | https://github.com/zeit/pkg/blob/3775ab6decc2f8f013142e1282934c12fbd1881e/prelude/bootstrap.js#L1493-L1510 | train | returns a function that will execute the original function | [
30522,
3853,
1006,
2030,
8004,
1007,
1063,
2709,
3853,
1006,
1007,
1063,
13075,
12098,
5620,
1027,
9140,
1012,
2013,
1006,
9918,
1007,
1025,
13075,
4872,
1027,
3443,
21572,
28732,
1006,
1007,
1025,
2030,
8004,
1012,
6611,
1006,
6151,
28344,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
TryGhost/Ghost | core/server/models/plugins/pagination.js | formatResponse | function formatResponse(totalItems, options) {
var calcPages = Math.ceil(totalItems / options.limit) || 0,
pagination = {
page: options.page || defaults.page,
limit: options.limit,
pages: calcPages === 0 ? 1 : calcPages,
total: totalIte... | javascript | function formatResponse(totalItems, options) {
var calcPages = Math.ceil(totalItems / options.limit) || 0,
pagination = {
page: options.page || defaults.page,
limit: options.limit,
pages: calcPages === 0 ? 1 : calcPages,
total: totalIte... | [
"function",
"formatResponse",
"(",
"totalItems",
",",
"options",
")",
"{",
"var",
"calcPages",
"=",
"Math",
".",
"ceil",
"(",
"totalItems",
"/",
"options",
".",
"limit",
")",
"||",
"0",
",",
"pagination",
"=",
"{",
"page",
":",
"options",
".",
"page",
... | ### Format Response
Takes the no. items returned and original options and calculates all of the pagination meta data
@param {Number} totalItems
@param {options} options
@returns {pagination} pagination metadata | [
"###",
"Format",
"Response",
"Takes",
"the",
"no",
".",
"items",
"returned",
"and",
"original",
"options",
"and",
"calculates",
"all",
"of",
"the",
"pagination",
"meta",
"data"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/models/plugins/pagination.js#L67-L90 | train | Format response for an individual page | [
30522,
3853,
4289,
6072,
26029,
3366,
1006,
2561,
4221,
5244,
1010,
7047,
1007,
1063,
13075,
10250,
21906,
13923,
1027,
8785,
1012,
8292,
4014,
1006,
2561,
4221,
5244,
1013,
7047,
1012,
5787,
1007,
1064,
1064,
1014,
1010,
6643,
20876,
3508,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableGrouping.js | function(oTable, oRow) {
var oDomRefs = oRow.getDomRefs(true);
oDomRefs.row.removeAttr("data-sap-ui-level");
oDomRefs.row.removeData("sap-ui-level");
if (TableGrouping.isGroupMode(oTable)) {
oDomRefs.row.removeClass("sapUiTableGroupHeader sapUiAnalyticalTableSum sapUiAnalyticalTableDummy");
TableG... | javascript | function(oTable, oRow) {
var oDomRefs = oRow.getDomRefs(true);
oDomRefs.row.removeAttr("data-sap-ui-level");
oDomRefs.row.removeData("sap-ui-level");
if (TableGrouping.isGroupMode(oTable)) {
oDomRefs.row.removeClass("sapUiTableGroupHeader sapUiAnalyticalTableSum sapUiAnalyticalTableDummy");
TableG... | [
"function",
"(",
"oTable",
",",
"oRow",
")",
"{",
"var",
"oDomRefs",
"=",
"oRow",
".",
"getDomRefs",
"(",
"true",
")",
";",
"oDomRefs",
".",
"row",
".",
"removeAttr",
"(",
"\"data-sap-ui-level\"",
")",
";",
"oDomRefs",
".",
"row",
".",
"removeData",
"(",... | Cleanup the dom changes previously done by <code>updateTableRowForGrouping</code>.
@param {sap.ui.table.Table} oTable Instance of the table
@param {sap.ui.table.Row} oRow Instance of the row | [
"Cleanup",
"the",
"dom",
"changes",
"previously",
"done",
"by",
"<code",
">",
"updateTableRowForGrouping<",
"/",
"code",
">",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableGrouping.js#L422-L445 | train | Removes the control and its children | [
30522,
3853,
1006,
27178,
3085,
1010,
20298,
2860,
1007,
1063,
13075,
1051,
9527,
2890,
10343,
1027,
20298,
2860,
1012,
2131,
9527,
2890,
10343,
1006,
2995,
1007,
1025,
1051,
9527,
2890,
10343,
1012,
5216,
1012,
6366,
19321,
2099,
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... | |
jgraph/mxgraph | javascript/mxClient.js | function(evt)
{
return mxEvent.isRightMouseButton(evt) || (mxClient.IS_MAC && mxEvent.isControlDown(evt) &&
!mxEvent.isShiftDown(evt) && !mxEvent.isMetaDown(evt) && !mxEvent.isAltDown(evt));
} | javascript | function(evt)
{
return mxEvent.isRightMouseButton(evt) || (mxClient.IS_MAC && mxEvent.isControlDown(evt) &&
!mxEvent.isShiftDown(evt) && !mxEvent.isMetaDown(evt) && !mxEvent.isAltDown(evt));
} | [
"function",
"(",
"evt",
")",
"{",
"return",
"mxEvent",
".",
"isRightMouseButton",
"(",
"evt",
")",
"||",
"(",
"mxClient",
".",
"IS_MAC",
"&&",
"mxEvent",
".",
"isControlDown",
"(",
"evt",
")",
"&&",
"!",
"mxEvent",
".",
"isShiftDown",
"(",
"evt",
")",
... | Function: isPopupTrigger
Returns true if the event is a popup trigger. This implementation
returns true if the right button or the left button and control was
pressed on a Mac. | [
"Function",
":",
"isPopupTrigger"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L9935-L9939 | train | Returns true if the given event is a right mouse button | [
30522,
3853,
1006,
23408,
2102,
1007,
1063,
2709,
25630,
18697,
3372,
1012,
2003,
15950,
27711,
15878,
4904,
2669,
1006,
23408,
2102,
1007,
1064,
1064,
1006,
25630,
20464,
11638,
1012,
2003,
1035,
6097,
1004,
1004,
25630,
18697,
3372,
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... | |
nhn/tui.editor | src/js/extensions/table/mergeCell.js | _pickContent | function _pickContent(targetRows, startColIndex, endColIndex) {
const limitColIndex = endColIndex + 1;
const cells = [].concat(...targetRows.map(rowData => rowData.slice(startColIndex, limitColIndex)));
const foundCellData = cells.filter(({content}) => content && content !== BASIC_CELL_CONTENT);
return foundCe... | javascript | function _pickContent(targetRows, startColIndex, endColIndex) {
const limitColIndex = endColIndex + 1;
const cells = [].concat(...targetRows.map(rowData => rowData.slice(startColIndex, limitColIndex)));
const foundCellData = cells.filter(({content}) => content && content !== BASIC_CELL_CONTENT);
return foundCe... | [
"function",
"_pickContent",
"(",
"targetRows",
",",
"startColIndex",
",",
"endColIndex",
")",
"{",
"const",
"limitColIndex",
"=",
"endColIndex",
"+",
"1",
";",
"const",
"cells",
"=",
"[",
"]",
".",
"concat",
"(",
"...",
"targetRows",
".",
"map",
"(",
"rowD... | Pick merger content from selected cells.
@param {Array.<Array.<object>>} targetRows - target rows
@param {number} startColIndex - start column index
@param {number} endColIndex - end column index
@returns {string}
@private | [
"Pick",
"merger",
"content",
"from",
"selected",
"cells",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/mergeCell.js#L64-L70 | train | Pick the content from the target rows | [
30522,
3853,
1035,
4060,
8663,
6528,
2102,
1006,
4539,
10524,
2015,
1010,
2707,
25778,
22254,
10288,
1010,
2203,
25778,
22254,
10288,
1007,
1063,
9530,
3367,
5787,
25778,
22254,
10288,
1027,
2203,
25778,
22254,
10288,
1009,
1015,
1025,
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... |
eslint/eslint | lib/rules/no-constant-condition.js | checkConstantConditionLoopInSet | function checkConstantConditionLoopInSet(node) {
if (loopsInCurrentScope.has(node)) {
loopsInCurrentScope.delete(node);
context.report({ node: node.test, messageId: "unexpected" });
}
} | javascript | function checkConstantConditionLoopInSet(node) {
if (loopsInCurrentScope.has(node)) {
loopsInCurrentScope.delete(node);
context.report({ node: node.test, messageId: "unexpected" });
}
} | [
"function",
"checkConstantConditionLoopInSet",
"(",
"node",
")",
"{",
"if",
"(",
"loopsInCurrentScope",
".",
"has",
"(",
"node",
")",
")",
"{",
"loopsInCurrentScope",
".",
"delete",
"(",
"node",
")",
";",
"context",
".",
"report",
"(",
"{",
"node",
":",
"n... | Reports when the set contains the given constant condition node
@param {ASTNode} node The AST node to check.
@returns {void}
@private | [
"Reports",
"when",
"the",
"set",
"contains",
"the",
"given",
"constant",
"condition",
"node"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-constant-condition.js#L166-L171 | train | Check if a constant condition is in the set of loops | [
30522,
3853,
4638,
8663,
12693,
13535,
15422,
22753,
4135,
7361,
7076,
3388,
1006,
13045,
1007,
1063,
2065,
1006,
15932,
2378,
10841,
14343,
7666,
16186,
1012,
2038,
1006,
13045,
1007,
1007,
1063,
15932,
2378,
10841,
14343,
7666,
16186,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.