repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/hyphenation/Hyphenation.js | loadScript | function loadScript(sPath, sFilename) {
return new Promise(function (resolve, reject) {
var script = document.createElement('script');
script.async = true;
script.src = sPath + sFilename;
script.addEventListener('load', resolve);
script.addEventListener('error', function () {
return reject('Error l... | javascript | function loadScript(sPath, sFilename) {
return new Promise(function (resolve, reject) {
var script = document.createElement('script');
script.async = true;
script.src = sPath + sFilename;
script.addEventListener('load', resolve);
script.addEventListener('error', function () {
return reject('Error l... | [
"function",
"loadScript",
"(",
"sPath",
",",
"sFilename",
")",
"{",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"var",
"script",
"=",
"document",
".",
"createElement",
"(",
"'script'",
")",
";",
"script",
".",
"a... | Loads a <code>javascript</code> file.
@param {string} sPath The root path
@param {string} sFilename File to be loaded
@returns {Promise} A promise which resolves when the script is loaded
@private | [
"Loads",
"a",
"<code",
">",
"javascript<",
"/",
"code",
">",
"file",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/hyphenation/Hyphenation.js#L243-L257 | train | Load a script | [
30522,
3853,
15665,
23235,
1006,
14690,
2232,
1010,
16420,
9463,
18442,
1007,
1063,
2709,
2047,
4872,
1006,
3853,
1006,
10663,
1010,
15454,
1007,
1063,
13075,
5896,
1027,
6254,
1012,
3443,
12260,
3672,
1006,
1005,
5896,
1005,
1007,
1025,
58... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/context/ContextManager.js | function (aContextObjects, aRuntimeContextParameters) {
var that = this;
var aActiveContexts = [];
aContextObjects.forEach(function (oContext) {
if (that._isContextObjectActive(oContext, aRuntimeContextParameters)) {
aActiveContexts.push(oContext.id);
}
});
return aActiveContexts;
} | javascript | function (aContextObjects, aRuntimeContextParameters) {
var that = this;
var aActiveContexts = [];
aContextObjects.forEach(function (oContext) {
if (that._isContextObjectActive(oContext, aRuntimeContextParameters)) {
aActiveContexts.push(oContext.id);
}
});
return aActiveContexts;
} | [
"function",
"(",
"aContextObjects",
",",
"aRuntimeContextParameters",
")",
"{",
"var",
"that",
"=",
"this",
";",
"var",
"aActiveContexts",
"=",
"[",
"]",
";",
"aContextObjects",
".",
"forEach",
"(",
"function",
"(",
"oContext",
")",
"{",
"if",
"(",
"that",
... | Function to filter all contexts by the passed runtime context parameters.
@param {object[]} aContextObjects - context objects within the application
@param {object} aRuntimeContextParameters - map of context keys and their current values
@returns {string[]} aActiveContexts - id list of all active contexts | [
"Function",
"to",
"filter",
"all",
"contexts",
"by",
"the",
"passed",
"runtime",
"context",
"parameters",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/context/ContextManager.js#L100-L111 | train | Returns an array of contexts that are active in the given context objects. | [
30522,
3853,
1006,
9353,
28040,
18413,
16429,
20614,
2015,
1010,
28217,
7292,
8663,
18209,
28689,
22828,
2015,
1007,
1063,
13075,
2008,
1027,
2023,
1025,
13075,
9779,
15277,
8663,
18209,
2015,
1027,
1031,
1033,
1025,
9353,
28040,
18413,
16429... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GitbookIO/gitbook | lib/output/website/createTemplateEngine.js | createTemplateEngine | function createTemplateEngine(output, currentFile) {
var book = output.getBook();
var state = output.getState();
var i18n = state.getI18n();
var config = book.getConfig();
var summary = book.getSummary();
var outputFolder = output.getRoot();
// Search paths for templates
var searchPaths... | javascript | function createTemplateEngine(output, currentFile) {
var book = output.getBook();
var state = output.getState();
var i18n = state.getI18n();
var config = book.getConfig();
var summary = book.getSummary();
var outputFolder = output.getRoot();
// Search paths for templates
var searchPaths... | [
"function",
"createTemplateEngine",
"(",
"output",
",",
"currentFile",
")",
"{",
"var",
"book",
"=",
"output",
".",
"getBook",
"(",
")",
";",
"var",
"state",
"=",
"output",
".",
"getState",
"(",
")",
";",
"var",
"i18n",
"=",
"state",
".",
"getI18n",
"(... | Create templating engine to render themes
@param {Output} output
@param {String} currentFile
@return {TemplateEngine} | [
"Create",
"templating",
"engine",
"to",
"render",
"themes"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/website/createTemplateEngine.js#L34-L149 | train | Create TemplateEngine | [
30522,
3853,
3443,
18532,
15725,
13159,
3170,
1006,
6434,
1010,
2783,
8873,
2571,
1007,
1063,
13075,
2338,
1027,
6434,
1012,
2131,
8654,
1006,
1007,
1025,
13075,
2110,
1027,
6434,
1012,
4152,
12259,
1006,
1007,
1025,
13075,
1045,
15136,
207... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/search.js | searchBar_getElement | function searchBar_getElement(spec) {
var elem = null;
switch(spec.type) {
/**
* subtype: subtype to match
* value: value to match
*/
case "engine":
// XXX: bug 555938 - Mozmill can't fetch the element via a lookup here.
// That means we have to grab it temporar... | javascript | function searchBar_getElement(spec) {
var elem = null;
switch(spec.type) {
/**
* subtype: subtype to match
* value: value to match
*/
case "engine":
// XXX: bug 555938 - Mozmill can't fetch the element via a lookup here.
// That means we have to grab it temporar... | [
"function",
"searchBar_getElement",
"(",
"spec",
")",
"{",
"var",
"elem",
"=",
"null",
";",
"switch",
"(",
"spec",
".",
"type",
")",
"{",
"/**\n * subtype: subtype to match\n * value: value to match\n */",
"case",
"\"engine\"",
":",
"// XXX: bug 555938 -... | Retrieve an UI element based on the given spec
@param {object} spec
Information of the UI element which should be retrieved
type: General type information
subtype: Specific element or property
value: Value of the element or property
@returns Element which has been created
@type ElemBase | [
"Retrieve",
"an",
"UI",
"element",
"based",
"on",
"the",
"given",
"spec"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/search.js#L600-L669 | train | Returns the element that matches the specified specification | [
30522,
3853,
3945,
8237,
1035,
2131,
12260,
3672,
1006,
28699,
1007,
1063,
13075,
3449,
6633,
1027,
19701,
1025,
6942,
1006,
28699,
1012,
2828,
1007,
1063,
1013,
1008,
1008,
1008,
4942,
13874,
1024,
4942,
13874,
2000,
2674,
1008,
3643,
1024... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js | function (oPathValue, iIndex, oResult, bWrapExpression) {
var oDate;
if (oResult.result === "constant") {
switch (oResult.category) {
case "boolean":
case "number":
return oResult.value;
case "date":
oDate = Expression.parseDate(oResult.value);
if (!oDate) {
Basics.err... | javascript | function (oPathValue, iIndex, oResult, bWrapExpression) {
var oDate;
if (oResult.result === "constant") {
switch (oResult.category) {
case "boolean":
case "number":
return oResult.value;
case "date":
oDate = Expression.parseDate(oResult.value);
if (!oDate) {
Basics.err... | [
"function",
"(",
"oPathValue",
",",
"iIndex",
",",
"oResult",
",",
"bWrapExpression",
")",
"{",
"var",
"oDate",
";",
"if",
"(",
"oResult",
".",
"result",
"===",
"\"constant\"",
")",
"{",
"switch",
"(",
"oResult",
".",
"category",
")",
"{",
"case",
"\"boo... | Formats the result to be an operand for a logical or comparison operator. Handles
constants accordingly.
@param {object} oPathValue
path and value information pointing to the parameters array (for a possible error
message, see above)
@param {number} iIndex
the parameter index (for a possible error message)
@param {obj... | [
"Formats",
"the",
"result",
"to",
"be",
"an",
"operand",
"for",
"a",
"logical",
"or",
"comparison",
"operator",
".",
"Handles",
"constants",
"accordingly",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L418-L449 | train | Returns the value of the given result | [
30522,
3853,
1006,
6728,
8988,
10175,
5657,
1010,
2462,
13629,
2595,
1010,
10848,
23722,
2102,
1010,
1038,
13088,
24065,
2595,
20110,
3258,
1007,
1063,
13075,
1051,
13701,
1025,
2065,
1006,
10848,
23722,
2102,
1012,
2765,
1027,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jgraph/mxgraph | javascript/mxClient.js | function(state, source, target, hints, result)
{
// Creates array of all way- and terminalpoints
var pts = state.absolutePoints;
var tol = Math.max(1, state.view.scale);
// Whether the first segment outgoing from the source end is horizontal
var lastPushed = (result.length > 0) ? result[0] : null;
var h... | javascript | function(state, source, target, hints, result)
{
// Creates array of all way- and terminalpoints
var pts = state.absolutePoints;
var tol = Math.max(1, state.view.scale);
// Whether the first segment outgoing from the source end is horizontal
var lastPushed = (result.length > 0) ? result[0] : null;
var h... | [
"function",
"(",
"state",
",",
"source",
",",
"target",
",",
"hints",
",",
"result",
")",
"{",
"// Creates array of all way- and terminalpoints",
"var",
"pts",
"=",
"state",
".",
"absolutePoints",
";",
"var",
"tol",
"=",
"Math",
".",
"max",
"(",
"1",
",",
... | Function: SegmentConnector
Implements an orthogonal edge style. Use <mxEdgeSegmentHandler>
as an interactive handler for this style. | [
"Function",
":",
"SegmentConnector"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L50004-L50295 | train | Adds a point to the end of the source segment | [
30522,
3853,
1006,
2110,
1010,
3120,
1010,
4539,
1010,
20385,
1010,
2765,
30524,
4098,
1006,
1015,
1010,
2110,
1012,
3193,
1012,
4094,
1007,
1025,
1013,
1013,
3251,
1996,
2034,
6903,
22011,
2013,
1996,
3120,
2203,
2003,
9876,
13075,
2197,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
wangfupeng1988/wangEditor | src/js/text/index.js | function (val) {
const editor = this.editor
const $textElem = editor.$textElem
let html
if (val == null) {
html = $textElem.html()
// 未选中任何内容的时候点击“加粗”或者“斜体”等按钮,就得需要一个空的占位符 ​ ,这里替换掉
html = html.replace(/\u200b/gm, '')
return html
... | javascript | function (val) {
const editor = this.editor
const $textElem = editor.$textElem
let html
if (val == null) {
html = $textElem.html()
// 未选中任何内容的时候点击“加粗”或者“斜体”等按钮,就得需要一个空的占位符 ​ ,这里替换掉
html = html.replace(/\u200b/gm, '')
return html
... | [
"function",
"(",
"val",
")",
"{",
"const",
"editor",
"=",
"this",
".",
"editor",
"const",
"$textElem",
"=",
"editor",
".",
"$textElem",
"let",
"html",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"html",
"=",
"$textElem",
".",
"html",
"(",
")",
"// 未选中任... | 获取 设置 html | [
"获取",
"设置",
"html"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/text/index.js#L71-L86 | train | set the tag | [
30522,
3853,
1006,
11748,
1007,
1063,
9530,
3367,
3559,
1027,
2023,
1012,
3559,
9530,
3367,
1002,
3793,
12260,
2213,
1027,
3559,
1012,
1002,
3793,
12260,
2213,
2292,
16129,
2065,
1006,
11748,
1027,
1027,
19701,
1007,
1063,
16129,
1027,
1002... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
wuchangming/spy-debugger | buildin_modules/weinre/web/demo/weinre-demo.js | createDatabase_other | function createDatabase_other(tx) {
var schema = "clicks_other (id integer primary key, other text)"
var sql = "create table if not exists " + schema
tx.executeSql(sql, null, null, sqlError);
} | javascript | function createDatabase_other(tx) {
var schema = "clicks_other (id integer primary key, other text)"
var sql = "create table if not exists " + schema
tx.executeSql(sql, null, null, sqlError);
} | [
"function",
"createDatabase_other",
"(",
"tx",
")",
"{",
"var",
"schema",
"=",
"\"clicks_other (id integer primary key, other text)\"",
"var",
"sql",
"=",
"\"create table if not exists \"",
"+",
"schema",
"tx",
".",
"executeSql",
"(",
"sql",
",",
"null",
",",
"null",
... | ------------------------------------------------------------------------------ | [
"------------------------------------------------------------------------------"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/demo/weinre-demo.js#L154-L159 | train | create database other | [
30522,
3853,
2580,
6790,
15058,
1035,
2060,
1006,
19067,
1007,
1063,
13075,
8040,
28433,
1027,
1000,
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,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fex-team/webuploader | dist/webuploader.withoutimage.js | function( file, ret, hds ) {
var owner = this.owner;
return owner
.request( 'after-send-file', arguments, function() {
file.setStatus( Status.COMPLETE );
owner.trigger( 'uploadSuccess', file, ret, hds );... | javascript | function( file, ret, hds ) {
var owner = this.owner;
return owner
.request( 'after-send-file', arguments, function() {
file.setStatus( Status.COMPLETE );
owner.trigger( 'uploadSuccess', file, ret, hds );... | [
"function",
"(",
"file",
",",
"ret",
",",
"hds",
")",
"{",
"var",
"owner",
"=",
"this",
".",
"owner",
";",
"return",
"owner",
".",
"request",
"(",
"'after-send-file'",
",",
"arguments",
",",
"function",
"(",
")",
"{",
"file",
".",
"setStatus",
"(",
"... | 完成上传。 | [
"完成上传。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/dist/webuploader.withoutimage.js#L3685-L3705 | train | upload success error | [
30522,
3853,
1006,
5371,
1010,
2128,
2102,
1010,
10751,
2015,
1007,
1063,
13075,
3954,
1027,
2023,
1012,
3954,
1025,
2709,
3954,
1012,
5227,
1006,
1005,
2044,
1011,
4604,
1011,
5371,
1005,
1010,
9918,
1010,
3853,
1006,
1007,
1063,
5371,
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... | |
getinsomnia/insomnia | packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js | matchSegments | function matchSegments(listOfThings, segment, type, limit = -1) {
if (!Array.isArray(listOfThings)) {
console.warn('Autocomplete received items in non-list form', listOfThings);
return [];
}
const matches = [];
for (const t of listOfThings) {
const name = typeof t === 'string' ? t : t.name;
con... | javascript | function matchSegments(listOfThings, segment, type, limit = -1) {
if (!Array.isArray(listOfThings)) {
console.warn('Autocomplete received items in non-list form', listOfThings);
return [];
}
const matches = [];
for (const t of listOfThings) {
const name = typeof t === 'string' ? t : t.name;
con... | [
"function",
"matchSegments",
"(",
"listOfThings",
",",
"segment",
",",
"type",
",",
"limit",
"=",
"-",
"1",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"listOfThings",
")",
")",
"{",
"console",
".",
"warn",
"(",
"'Autocomplete received items in... | Match against a list of things
@param listOfThings - Can be list of strings or list of {name, value}
@param segment - segment to match against
@param type
@param limit
@returns {Array} | [
"Match",
"against",
"a",
"list",
"of",
"things"
] | e24ce7f7b41246e700c4b9bdb6b34b6652ad589b | https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js#L347-L389 | train | Match a segment with a list of things | [
30522,
3853,
2674,
3366,
21693,
11187,
1006,
2862,
15794,
12053,
2015,
1010,
6903,
1010,
2828,
1010,
5787,
1027,
1011,
1015,
1007,
1063,
2065,
1006,
999,
9140,
1012,
18061,
11335,
2100,
1006,
2862,
15794,
12053,
2015,
1007,
1007,
1063,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/ExtensionUtils.js | addLinkedStyleSheet | function addLinkedStyleSheet(url, deferred) {
var attributes = {
type: "text/css",
rel: "stylesheet",
href: url
};
var $link = $("<link/>").attr(attributes);
if (deferred) {
$link.on('load', deferred.resolve).on('error', deferred.reject)... | javascript | function addLinkedStyleSheet(url, deferred) {
var attributes = {
type: "text/css",
rel: "stylesheet",
href: url
};
var $link = $("<link/>").attr(attributes);
if (deferred) {
$link.on('load', deferred.resolve).on('error', deferred.reject)... | [
"function",
"addLinkedStyleSheet",
"(",
"url",
",",
"deferred",
")",
"{",
"var",
"attributes",
"=",
"{",
"type",
":",
"\"text/css\"",
",",
"rel",
":",
"\"stylesheet\"",
",",
"href",
":",
"url",
"}",
";",
"var",
"$link",
"=",
"$",
"(",
"\"<link/>\"",
")",... | Appends a <link> tag to the document's head.
@param {!string} url URL to a style sheet
@param {$.Deferred=} deferred Optionally check for load and error events
@return {!HTMLLinkElement} The generated HTML node | [
"Appends",
"a",
"<link",
">",
"tag",
"to",
"the",
"document",
"s",
"head",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ExtensionUtils.js#L55-L71 | train | Add a linked stylesheet to the page | [
30522,
3853,
5587,
13767,
2098,
21756,
4244,
21030,
2102,
1006,
24471,
2140,
1010,
13366,
28849,
2094,
1007,
1063,
13075,
12332,
1027,
1063,
2828,
1024,
1000,
3793,
1013,
20116,
2015,
1000,
1010,
2128,
2140,
1024,
1000,
6782,
21030,
2102,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/QuickView/main.js | normalizeGradientExpressionForQuickview | function normalizeGradientExpressionForQuickview(expression) {
if (expression.indexOf("px") > 0) {
var paramStart = expression.indexOf("(") + 1,
paramEnd = expression.lastIndexOf(")"),
parameters = expression.substring(paramStart, paramEnd),
... | javascript | function normalizeGradientExpressionForQuickview(expression) {
if (expression.indexOf("px") > 0) {
var paramStart = expression.indexOf("(") + 1,
paramEnd = expression.lastIndexOf(")"),
parameters = expression.substring(paramStart, paramEnd),
... | [
"function",
"normalizeGradientExpressionForQuickview",
"(",
"expression",
")",
"{",
"if",
"(",
"expression",
".",
"indexOf",
"(",
"\"px\"",
")",
">",
"0",
")",
"{",
"var",
"paramStart",
"=",
"expression",
".",
"indexOf",
"(",
"\"(\"",
")",
"+",
"1",
",",
"... | Normalizes px color stops to % | [
"Normalizes",
"px",
"color",
"stops",
"to",
"%"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/QuickView/main.js#L335-L389 | train | Normalizes a gradient expression for quickview | [
30522,
3853,
3671,
4697,
16307,
25099,
2595,
20110,
3258,
29278,
15549,
3600,
8584,
1006,
3670,
1007,
1063,
2065,
1006,
3670,
1012,
5950,
11253,
1006,
1000,
1052,
2595,
1000,
1007,
1028,
1014,
1007,
1063,
13075,
11498,
5244,
7559,
2102,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js | function (oPathValue, sMessage, sComponent) {
sMessage = oPathValue.path + ": " + sMessage;
Log.error(sMessage, Basics.toErrorString(oPathValue.value),
sComponent || sAnnotationHelper);
throw new SyntaxError(sMessage);
} | javascript | function (oPathValue, sMessage, sComponent) {
sMessage = oPathValue.path + ": " + sMessage;
Log.error(sMessage, Basics.toErrorString(oPathValue.value),
sComponent || sAnnotationHelper);
throw new SyntaxError(sMessage);
} | [
"function",
"(",
"oPathValue",
",",
"sMessage",
",",
"sComponent",
")",
"{",
"sMessage",
"=",
"oPathValue",
".",
"path",
"+",
"\": \"",
"+",
"sMessage",
";",
"Log",
".",
"error",
"(",
"sMessage",
",",
"Basics",
".",
"toErrorString",
"(",
"oPathValue",
".",... | Logs the error message for the given path and throws a SyntaxError.
@param {object} oPathValue
a path/value pair
@param {string} sMessage
the message to log
@param {string} [sComponent="sap.ui.model.odata.AnnotationHelper"]
Name of the component that produced the log entry | [
"Logs",
"the",
"error",
"message",
"for",
"the",
"given",
"path",
"and",
"throws",
"a",
"SyntaxError",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js#L91-L96 | train | Log an error and throw an error | [
30522,
3853,
1006,
6728,
8988,
10175,
5657,
1010,
15488,
7971,
4270,
1010,
8040,
25377,
5643,
3372,
1007,
1063,
15488,
7971,
4270,
1027,
6728,
8988,
10175,
5657,
1012,
4130,
1009,
1000,
1024,
1000,
1009,
15488,
7971,
4270,
1025,
8833,
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... | |
muaz-khan/RecordRTC | RecordRTC.js | isElectron | function isElectron() {
// Renderer process
if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
return true;
}
// Main process
if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electr... | javascript | function isElectron() {
// Renderer process
if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
return true;
}
// Main process
if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electr... | [
"function",
"isElectron",
"(",
")",
"{",
"// Renderer process",
"if",
"(",
"typeof",
"window",
"!==",
"'undefined'",
"&&",
"typeof",
"window",
".",
"process",
"===",
"'object'",
"&&",
"window",
".",
"process",
".",
"type",
"===",
"'renderer'",
")",
"{",
"ret... | from: https://github.com/cheton/is-electron/blob/master/index.js | [
"from",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"cheton",
"/",
"is",
"-",
"electron",
"/",
"blob",
"/",
"master",
"/",
"index",
".",
"js"
] | 3c6bad427b9da35c1cf617199ed13dda056c38ba | https://github.com/muaz-khan/RecordRTC/blob/3c6bad427b9da35c1cf617199ed13dda056c38ba/RecordRTC.js#L1842-L1859 | train | Detect if the current environment is Electron | [
30522,
3853,
2003,
12260,
6593,
4948,
1006,
1007,
1063,
1013,
1013,
17552,
2121,
2832,
2065,
1006,
2828,
11253,
3332,
999,
1027,
1027,
1005,
6151,
28344,
1005,
1004,
1004,
2828,
11253,
3332,
1012,
2832,
1027,
1027,
1027,
1005,
30524,
11253,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/interimElement/interimElement.js | setDefaults | function setDefaults(definition) {
providerConfig.optionsFactory = definition.options;
providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);
return provider;
} | javascript | function setDefaults(definition) {
providerConfig.optionsFactory = definition.options;
providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);
return provider;
} | [
"function",
"setDefaults",
"(",
"definition",
")",
"{",
"providerConfig",
".",
"optionsFactory",
"=",
"definition",
".",
"options",
";",
"providerConfig",
".",
"methods",
"=",
"(",
"definition",
".",
"methods",
"||",
"[",
"]",
")",
".",
"concat",
"(",
"EXPOS... | Save the configured defaults to be used when the factory is instantiated | [
"Save",
"the",
"configured",
"defaults",
"to",
"be",
"used",
"when",
"the",
"factory",
"is",
"instantiated"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/interimElement/interimElement.js#L65-L69 | train | set the default values for the provider | [
30522,
3853,
2275,
3207,
7011,
11314,
2015,
1006,
6210,
1007,
1063,
10802,
8663,
8873,
2290,
1012,
7047,
21450,
1027,
6210,
1012,
7047,
1025,
10802,
8663,
8873,
2290,
1012,
4725,
1027,
1006,
6210,
1012,
4725,
1064,
1064,
1031,
1033,
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... |
moleculerjs/moleculer | src/serializers/proto/packets.proto.js | PacketInfo | function PacketInfo(properties) {
this.ipList = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | javascript | function PacketInfo(properties) {
this.ipList = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | [
"function",
"PacketInfo",
"(",
"properties",
")",
"{",
"this",
".",
"ipList",
"=",
"[",
"]",
";",
"if",
"(",
"properties",
")",
"for",
"(",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"properties",
")",
",",
"i",
"=",
"0",
";",
"i",
"<",
"key... | Properties of a PacketInfo.
@memberof packets
@interface IPacketInfo
@property {string} ver PacketInfo ver
@property {string} sender PacketInfo sender
@property {string} services PacketInfo services
@property {string} config PacketInfo config
@property {Array.<string>|null} [ipList] PacketInfo ipList
@property {string}... | [
"Properties",
"of",
"a",
"PacketInfo",
"."
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L1361-L1367 | train | Properties of a PacketInfo. | [
30522,
3853,
14771,
2378,
14876,
1006,
5144,
1007,
1063,
2023,
1012,
12997,
9863,
1027,
1031,
1033,
1025,
2065,
1006,
5144,
1007,
2005,
1006,
13075,
6309,
1027,
4874,
1012,
6309,
1006,
5144,
1007,
1010,
1045,
1027,
1014,
1025,
1045,
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... |
electron/electron | lib/browser/guest-window-manager.js | function (child, parent, visited) {
// Check for circular reference.
if (visited == null) visited = new Set()
if (visited.has(parent)) return
visited.add(parent)
for (const key in parent) {
if (key === 'isBrowserView') continue
if (!hasProp.call(parent, key)) continue
if (key in child && key !== ... | javascript | function (child, parent, visited) {
// Check for circular reference.
if (visited == null) visited = new Set()
if (visited.has(parent)) return
visited.add(parent)
for (const key in parent) {
if (key === 'isBrowserView') continue
if (!hasProp.call(parent, key)) continue
if (key in child && key !== ... | [
"function",
"(",
"child",
",",
"parent",
",",
"visited",
")",
"{",
"// Check for circular reference.",
"if",
"(",
"visited",
"==",
"null",
")",
"visited",
"=",
"new",
"Set",
"(",
")",
"if",
"(",
"visited",
".",
"has",
"(",
"parent",
")",
")",
"return",
... | Copy attribute of |parent| to |child| if it is not defined in |child|. | [
"Copy",
"attribute",
"of",
"|parent|",
"to",
"|child|",
"if",
"it",
"is",
"not",
"defined",
"in",
"|child|",
"."
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/guest-window-manager.js#L24-L45 | train | Merge child with parent | [
30522,
3853,
1006,
2775,
1010,
6687,
1010,
4716,
1007,
1063,
1013,
1013,
4638,
2005,
8206,
4431,
1012,
2065,
1006,
4716,
1027,
1027,
19701,
1007,
30524,
2065,
1006,
4716,
1012,
2038,
1006,
6687,
1007,
1007,
2709,
4716,
1012,
5587,
1006,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/core/PathProxy.js | function () {
var data = this.data;
if (data instanceof Array) {
data.length = this._len;
if (hasTypedArray) {
this.data = new Float32Array(data);
}
}
} | javascript | function () {
var data = this.data;
if (data instanceof Array) {
data.length = this._len;
if (hasTypedArray) {
this.data = new Float32Array(data);
}
}
} | [
"function",
"(",
")",
"{",
"var",
"data",
"=",
"this",
".",
"data",
";",
"if",
"(",
"data",
"instanceof",
"Array",
")",
"{",
"data",
".",
"length",
"=",
"this",
".",
"_len",
";",
"if",
"(",
"hasTypedArray",
")",
"{",
"this",
".",
"data",
"=",
"ne... | 转成静态的 Float32Array 减少堆内存占用
Convert dynamic array to static Float32Array | [
"转成静态的",
"Float32Array",
"减少堆内存占用",
"Convert",
"dynamic",
"array",
"to",
"static",
"Float32Array"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/core/PathProxy.js#L553-L561 | train | Aliquate de código de a sequenz | [
30522,
3853,
1006,
1007,
1063,
13075,
2951,
1027,
2023,
1012,
2951,
1025,
2065,
1006,
2951,
6013,
11253,
9140,
1007,
1063,
2951,
1012,
3091,
1027,
2023,
1012,
1035,
18798,
1025,
2065,
1006,
27151,
5669,
2906,
9447,
1007,
1063,
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... | |
facebook/relay | packages/relay-runtime/handlers/connection/RelayConnectionHandler.js | deleteNode | function deleteNode(record: RecordProxy, nodeID: DataID): void {
const {EDGES, NODE} = RelayConnectionInterface.get();
const edges = record.getLinkedRecords(EDGES);
if (!edges) {
return;
}
let nextEdges;
for (let ii = 0; ii < edges.length; ii++) {
const edge = edges[ii];
const node = edge && ed... | javascript | function deleteNode(record: RecordProxy, nodeID: DataID): void {
const {EDGES, NODE} = RelayConnectionInterface.get();
const edges = record.getLinkedRecords(EDGES);
if (!edges) {
return;
}
let nextEdges;
for (let ii = 0; ii < edges.length; ii++) {
const edge = edges[ii];
const node = edge && ed... | [
"function",
"deleteNode",
"(",
"record",
":",
"RecordProxy",
",",
"nodeID",
":",
"DataID",
")",
":",
"void",
"{",
"const",
"{",
"EDGES",
",",
"NODE",
"}",
"=",
"RelayConnectionInterface",
".",
"get",
"(",
")",
";",
"const",
"edges",
"=",
"record",
".",
... | @public
Remove any edges whose `node.id` matches the given id. | [
"@public"
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-runtime/handlers/connection/RelayConnectionHandler.js#L431-L453 | train | Delete a node from a record | [
30522,
3853,
3972,
12870,
3630,
3207,
1006,
2501,
1024,
2501,
21572,
18037,
1010,
13045,
3593,
1024,
2951,
3593,
1007,
1024,
11675,
1063,
9530,
3367,
1063,
7926,
1010,
13045,
1065,
1027,
8846,
8663,
2638,
7542,
18447,
2121,
12172,
1012,
213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
badges/shields | services/pypi/pypi-helpers.js | parseClassifiers | function parseClassifiers(parsedData, pattern) {
const results = []
for (let i = 0; i < parsedData.info.classifiers.length; i++) {
const matched = pattern.exec(parsedData.info.classifiers[i])
if (matched && matched[1]) {
results.push(matched[1].toLowerCase())
}
}
return results
} | javascript | function parseClassifiers(parsedData, pattern) {
const results = []
for (let i = 0; i < parsedData.info.classifiers.length; i++) {
const matched = pattern.exec(parsedData.info.classifiers[i])
if (matched && matched[1]) {
results.push(matched[1].toLowerCase())
}
}
return results
} | [
"function",
"parseClassifiers",
"(",
"parsedData",
",",
"pattern",
")",
"{",
"const",
"results",
"=",
"[",
"]",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"parsedData",
".",
"info",
".",
"classifiers",
".",
"length",
";",
"i",
"++",
")",
"{",
... | Extract classifiers from a pypi json response based on a regex. | [
"Extract",
"classifiers",
"from",
"a",
"pypi",
"json",
"response",
"based",
"on",
"a",
"regex",
"."
] | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/services/pypi/pypi-helpers.js#L42-L51 | train | Parse classifier from parsed data | [
30522,
3853,
11968,
3366,
26266,
28295,
1006,
11968,
6924,
2850,
2696,
1010,
5418,
1007,
1063,
9530,
3367,
3463,
1027,
1031,
1033,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026,
11968,
6924,
2850,
2696,
1012,
18558,
1012,
2465,
28295... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
firebase/firebaseui-web | buildtools/country_data/get_directory_args.js | assertIsDirectory | function assertIsDirectory(path) {
try {
if (!fs.lstatSync(path).isDirectory()) {
console.log('Path "' + path + '" is not a directory.');
process.exit();
}
} catch (e) {
console.log('Directory "' + path + '" could not be found.');
process.exit();
}
} | javascript | function assertIsDirectory(path) {
try {
if (!fs.lstatSync(path).isDirectory()) {
console.log('Path "' + path + '" is not a directory.');
process.exit();
}
} catch (e) {
console.log('Directory "' + path + '" could not be found.');
process.exit();
}
} | [
"function",
"assertIsDirectory",
"(",
"path",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"fs",
".",
"lstatSync",
"(",
"path",
")",
".",
"isDirectory",
"(",
")",
")",
"{",
"console",
".",
"log",
"(",
"'Path \"'",
"+",
"path",
"+",
"'\" is not a directory.'",
... | Asserts that the given path points to a directory and exits otherwise.
@param {string} path | [
"Asserts",
"that",
"the",
"given",
"path",
"points",
"to",
"a",
"directory",
"and",
"exits",
"otherwise",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/buildtools/country_data/get_directory_args.js#L26-L36 | train | Assert that the path is a directory | [
30522,
3853,
20865,
2483,
4305,
2890,
16761,
2100,
1006,
4130,
1007,
1063,
3046,
1063,
2065,
1006,
999,
1042,
2015,
1012,
1048,
9153,
3215,
6038,
2278,
1006,
4130,
1007,
1012,
2003,
4305,
2890,
16761,
2100,
1006,
1007,
1007,
1063,
10122,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Freeboard/freeboard | js/freeboard.thirdparty.js | function(date) {
if (!date) {
return null;
}
date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
return date;
} | javascript | function(date) {
if (!date) {
return null;
}
date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
return date;
} | [
"function",
"(",
"date",
")",
"{",
"if",
"(",
"!",
"date",
")",
"{",
"return",
"null",
";",
"}",
"date",
".",
"setHours",
"(",
"date",
".",
"getHours",
"(",
")",
">",
"12",
"?",
"date",
".",
"getHours",
"(",
")",
"+",
"2",
":",
"0",
")",
";",... | /* Handle switch to/from daylight saving.
Hours may be non-zero on daylight saving cut-over:
> 12 when midnight changeover, but then cannot generate
midnight datetime, so jump to 1AM, otherwise reset.
@param date (Date) the date to check
@return (Date) the corrected date | [
"/",
"*",
"Handle",
"switch",
"to",
"/",
"from",
"daylight",
"saving",
".",
"Hours",
"may",
"be",
"non",
"-",
"zero",
"on",
"daylight",
"saving",
"cut",
"-",
"over",
":",
">",
"12",
"when",
"midnight",
"changeover",
"but",
"then",
"cannot",
"generate",
... | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L9124-L9130 | train | Returns the date of the last day of the week | [
30522,
3853,
1006,
3058,
1007,
1063,
2065,
1006,
999,
3058,
1007,
1063,
2709,
19701,
1025,
1065,
3058,
1012,
6662,
22957,
1006,
3058,
1012,
2131,
6806,
9236,
1006,
1007,
1028,
2260,
1029,
3058,
1012,
2131,
6806,
9236,
1006,
1007,
1009,
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... | |
angular/angular | tools/npm/check-node-modules.js | checkNodeModules | function checkNodeModules(logOutput, purgeIfStale) {
var yarnCheck = childProcess.spawnSync(
'yarn check --integrity', {shell: true, cwd: path.resolve(__dirname, '../..')});
var nodeModulesOK = yarnCheck.status === 0;
if (nodeModulesOK) {
if (logOutput) console.log(':-) npm dependencies are looking goo... | javascript | function checkNodeModules(logOutput, purgeIfStale) {
var yarnCheck = childProcess.spawnSync(
'yarn check --integrity', {shell: true, cwd: path.resolve(__dirname, '../..')});
var nodeModulesOK = yarnCheck.status === 0;
if (nodeModulesOK) {
if (logOutput) console.log(':-) npm dependencies are looking goo... | [
"function",
"checkNodeModules",
"(",
"logOutput",
",",
"purgeIfStale",
")",
"{",
"var",
"yarnCheck",
"=",
"childProcess",
".",
"spawnSync",
"(",
"'yarn check --integrity'",
",",
"{",
"shell",
":",
"true",
",",
"cwd",
":",
"path",
".",
"resolve",
"(",
"__dirnam... | tslint:disable:no-console | [
"tslint",
":",
"disable",
":",
"no",
"-",
"console"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/npm/check-node-modules.js#L18-L34 | train | Check if node_modules are looking good | [
30522,
3853,
4638,
3630,
3207,
5302,
8566,
4244,
1006,
8154,
4904,
18780,
1010,
24694,
10128,
9153,
2571,
1007,
1063,
13075,
27158,
5403,
3600,
1027,
2775,
21572,
9623,
2015,
1012,
25645,
6508,
12273,
1006,
1005,
27158,
4638,
1011,
1011,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/icon/js/iconService.js | findRegisteredFontSet | function findRegisteredFontSet(alias) {
var useDefault = angular.isUndefined(alias) || !(alias && alias.length);
if (useDefault) {
return config.defaultFontSet;
}
var result = alias;
angular.forEach(config.fontSets, function(fontSet) {
if (fontSet.alias === alias) {
result = fon... | javascript | function findRegisteredFontSet(alias) {
var useDefault = angular.isUndefined(alias) || !(alias && alias.length);
if (useDefault) {
return config.defaultFontSet;
}
var result = alias;
angular.forEach(config.fontSets, function(fontSet) {
if (fontSet.alias === alias) {
result = fon... | [
"function",
"findRegisteredFontSet",
"(",
"alias",
")",
"{",
"var",
"useDefault",
"=",
"angular",
".",
"isUndefined",
"(",
"alias",
")",
"||",
"!",
"(",
"alias",
"&&",
"alias",
".",
"length",
")",
";",
"if",
"(",
"useDefault",
")",
"{",
"return",
"config... | Lookup a registered fontSet style using its alias.
@param {string} alias used to lookup the alias in the array of fontSets
@returns {*} matching fontSet or the defaultFontSet if that alias does not match | [
"Lookup",
"a",
"registered",
"fontSet",
"style",
"using",
"its",
"alias",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/icon/js/iconService.js#L459-L473 | train | Find the registered fontSet | [
30522,
3853,
2424,
2890,
24063,
6850,
14876,
7666,
3388,
1006,
14593,
1007,
1063,
13075,
2109,
12879,
23505,
1027,
16108,
1012,
2003,
8630,
28344,
1006,
14593,
1007,
1064,
1064,
999,
1006,
14593,
1004,
1004,
14593,
1012,
3091,
1007,
1025,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.demokit/src/sap/ui/demokit/js/highlight-query-terms.js | markText | function markText(node, expr, classes) {
/* Names of Element nodes whose children must not be visited */
var rtags = /object|embed|script|select|textarea/i;
function replace(node) {
var text = node.nodeValue,
p = node.parentNode,
start = 0,
match,span;
while ( (match = expr.exec(text)) != nul... | javascript | function markText(node, expr, classes) {
/* Names of Element nodes whose children must not be visited */
var rtags = /object|embed|script|select|textarea/i;
function replace(node) {
var text = node.nodeValue,
p = node.parentNode,
start = 0,
match,span;
while ( (match = expr.exec(text)) != nul... | [
"function",
"markText",
"(",
"node",
",",
"expr",
",",
"classes",
")",
"{",
"/* Names of Element nodes whose children must not be visited */",
"var",
"rtags",
"=",
"/",
"object|embed|script|select|textarea",
"/",
"i",
";",
"function",
"replace",
"(",
"node",
")",
"{",... | /*
Loops over all text nodes in the given subtree and searches for text fragments
that match the given RegExp. Each match is wrapped in its own span and the
span is given the class corresponding to the match. | [
"/",
"*",
"Loops",
"over",
"all",
"text",
"nodes",
"in",
"the",
"given",
"subtree",
"and",
"searches",
"for",
"text",
"fragments",
"that",
"match",
"the",
"given",
"RegExp",
".",
"Each",
"match",
"is",
"wrapped",
"in",
"its",
"own",
"span",
"and",
"the",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/js/highlight-query-terms.js#L76-L127 | train | Mark text nodes | [
30522,
3853,
2928,
18209,
1006,
13045,
1010,
4654,
18098,
1010,
4280,
1007,
1063,
1013,
1008,
3415,
1997,
5783,
14164,
3005,
2336,
2442,
2025,
2022,
4716,
1008,
1013,
13075,
19387,
26454,
1027,
1013,
4874,
1064,
7861,
8270,
1064,
5896,
1064... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js | function (iIndex) {
this.setProperty("buttons", this.getProperty("buttons").splice(iIndex, 1));
this.getFlexbox(true).removeItem(iIndex);
return this.getFlexbox(false).removeItem(iIndex);
} | javascript | function (iIndex) {
this.setProperty("buttons", this.getProperty("buttons").splice(iIndex, 1));
this.getFlexbox(true).removeItem(iIndex);
return this.getFlexbox(false).removeItem(iIndex);
} | [
"function",
"(",
"iIndex",
")",
"{",
"this",
".",
"setProperty",
"(",
"\"buttons\"",
",",
"this",
".",
"getProperty",
"(",
"\"buttons\"",
")",
".",
"splice",
"(",
"iIndex",
",",
"1",
")",
")",
";",
"this",
".",
"getFlexbox",
"(",
"true",
")",
".",
"r... | Removes a button from the ContextMenu.
@param {int} iIndex the button to remove or its index or id
@return {sap.m.OverflowToolbarButton} The removed button or null
@public | [
"Removes",
"a",
"button",
"from",
"the",
"ContextMenu",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js#L642-L646 | train | Removes the button at the given index from the toolbar | [
30522,
3853,
1006,
2462,
13629,
2595,
1007,
1063,
2023,
1012,
2275,
21572,
4842,
3723,
1006,
1000,
11287,
1000,
1010,
2023,
1012,
2131,
21572,
4842,
3723,
1006,
1000,
11287,
1000,
1007,
1012,
11867,
13231,
1006,
2462,
13629,
2595,
1010,
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... | |
aframevr/aframe | src/systems/material.js | function (material) {
delete this.materials[material.uuid];
// If any textures on this material are no longer in use, dispose of them.
var textureCounts = this.textureCounts;
Object.keys(material)
.filter(function (propName) {
return material[propName] && material[propName].isTexture;
... | javascript | function (material) {
delete this.materials[material.uuid];
// If any textures on this material are no longer in use, dispose of them.
var textureCounts = this.textureCounts;
Object.keys(material)
.filter(function (propName) {
return material[propName] && material[propName].isTexture;
... | [
"function",
"(",
"material",
")",
"{",
"delete",
"this",
".",
"materials",
"[",
"material",
".",
"uuid",
"]",
";",
"// If any textures on this material are no longer in use, dispose of them.",
"var",
"textureCounts",
"=",
"this",
".",
"textureCounts",
";",
"Object",
"... | Stop tracking material, and dispose of any textures not being used by
another material component.
@param {object} material | [
"Stop",
"tracking",
"material",
"and",
"dispose",
"of",
"any",
"textures",
"not",
"being",
"used",
"by",
"another",
"material",
"component",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/systems/material.js#L207-L222 | train | Remove material from cache | [
30522,
3853,
1006,
3430,
1007,
1063,
3972,
12870,
2023,
1012,
4475,
1031,
3430,
1012,
1057,
21272,
1033,
1025,
1013,
1013,
2065,
2151,
29343,
2006,
2023,
3430,
2024,
2053,
2936,
1999,
2224,
1010,
27764,
1997,
2068,
1012,
13075,
14902,
3597,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
sparksuite/simplemde-markdown-editor | src/js/simplemde.js | extend | function extend(target) {
for(var i = 1; i < arguments.length; i++) {
target = _mergeProperties(target, arguments[i]);
}
return target;
} | javascript | function extend(target) {
for(var i = 1; i < arguments.length; i++) {
target = _mergeProperties(target, arguments[i]);
}
return target;
} | [
"function",
"extend",
"(",
"target",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"1",
";",
"i",
"<",
"arguments",
".",
"length",
";",
"i",
"++",
")",
"{",
"target",
"=",
"_mergeProperties",
"(",
"target",
",",
"arguments",
"[",
"i",
"]",
")",
";",
"}"... | Merge an arbitrary number of objects into one. | [
"Merge",
"an",
"arbitrary",
"number",
"of",
"objects",
"into",
"one",
"."
] | 6abda7ab68cc20f4aca870eb243747951b90ab04 | https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js#L1045-L1051 | train | Extend target with the properties of the first argument | [
30522,
3853,
7949,
1006,
4539,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
1015,
1025,
1045,
1026,
9918,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
4539,
1027,
1035,
13590,
21572,
4842,
7368,
1006,
4539,
1010,
9918,
1031,
1045,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
airbnb/enzyme | packages/enzyme/src/ShallowWrapper.js | filterWhereUnwrapped | function filterWhereUnwrapped(wrapper, predicate) {
return wrapper.wrap(wrapper.getNodesInternal().filter(predicate).filter(Boolean));
} | javascript | function filterWhereUnwrapped(wrapper, predicate) {
return wrapper.wrap(wrapper.getNodesInternal().filter(predicate).filter(Boolean));
} | [
"function",
"filterWhereUnwrapped",
"(",
"wrapper",
",",
"predicate",
")",
"{",
"return",
"wrapper",
".",
"wrap",
"(",
"wrapper",
".",
"getNodesInternal",
"(",
")",
".",
"filter",
"(",
"predicate",
")",
".",
"filter",
"(",
"Boolean",
")",
")",
";",
"}"
] | Returns a new wrapper instance with only the nodes of the current wrapper instance that match
the provided predicate function.
@param {ShallowWrapper} wrapper
@param {Function} predicate
@returns {ShallowWrapper} | [
"Returns",
"a",
"new",
"wrapper",
"instance",
"with",
"only",
"the",
"nodes",
"of",
"the",
"current",
"wrapper",
"instance",
"that",
"match",
"the",
"provided",
"predicate",
"function",
"."
] | cd430eae95eba151f17e970ee77c18f09476de0e | https://github.com/airbnb/enzyme/blob/cd430eae95eba151f17e970ee77c18f09476de0e/packages/enzyme/src/ShallowWrapper.js#L71-L73 | train | Filter nodes by predicate. | [
30522,
3853,
11307,
2860,
5886,
13765,
2078,
13088,
29098,
2098,
1006,
10236,
4842,
1010,
3653,
16467,
1007,
1063,
2709,
10236,
4842,
1012,
10236,
1006,
10236,
4842,
1012,
2131,
3630,
6155,
18447,
11795,
2389,
1006,
1007,
1012,
11307,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/autocomplete/js/autocompleteController.js | configureWatchers | function configureWatchers () {
var wait = parseInt($scope.delay, 10) || 0;
$attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });
$attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });
... | javascript | function configureWatchers () {
var wait = parseInt($scope.delay, 10) || 0;
$attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });
$attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });
... | [
"function",
"configureWatchers",
"(",
")",
"{",
"var",
"wait",
"=",
"parseInt",
"(",
"$scope",
".",
"delay",
",",
"10",
")",
"||",
"0",
";",
"$attrs",
".",
"$observe",
"(",
"'disabled'",
",",
"function",
"(",
"value",
")",
"{",
"ctrl",
".",
"isDisabled... | Sets up any watchers used by autocomplete | [
"Sets",
"up",
"any",
"watchers",
"used",
"by",
"autocomplete"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/autocomplete/js/autocompleteController.js#L236-L249 | train | Configure watchers | [
30522,
3853,
9530,
8873,
27390,
7974,
4017,
21844,
1006,
1007,
1063,
13075,
3524,
1027,
11968,
20240,
3372,
1006,
1002,
9531,
1012,
8536,
1010,
2184,
1007,
1064,
1064,
1014,
1025,
1002,
2012,
16344,
2015,
1012,
1002,
11949,
1006,
1005,
9776... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/util/util.js | function(nodes) {
nodes = nodes || [];
var results = [];
for (var i = 0; i < nodes.length; ++i) {
results.push(nodes.item(i));
}
return results;
} | javascript | function(nodes) {
nodes = nodes || [];
var results = [];
for (var i = 0; i < nodes.length; ++i) {
results.push(nodes.item(i));
}
return results;
} | [
"function",
"(",
"nodes",
")",
"{",
"nodes",
"=",
"nodes",
"||",
"[",
"]",
";",
"var",
"results",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"nodes",
".",
"length",
";",
"++",
"i",
")",
"{",
"results",
".",
"push",
... | Annoying method to copy nodes to an array, thanks to IE | [
"Annoying",
"method",
"to",
"copy",
"nodes",
"to",
"an",
"array",
"thanks",
"to",
"IE"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L144-L152 | train | Returns an array of the result of the query | [
30522,
3853,
1006,
14164,
1007,
1063,
14164,
1027,
14164,
1064,
1064,
1031,
1033,
1025,
13075,
3463,
1027,
1031,
1033,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
14164,
1012,
3091,
1025,
1009,
1009,
1045,
1007,
1063,
3463,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/JSUtils/ScopeManager.js | TernModule | function TernModule() {
var ternPromise = null,
addFilesPromise = null,
rootTernDir = null,
projectRoot = null,
stopAddingFiles = false,
resolvedFiles = {}, // file -> resolved file
numInitialFile... | javascript | function TernModule() {
var ternPromise = null,
addFilesPromise = null,
rootTernDir = null,
projectRoot = null,
stopAddingFiles = false,
resolvedFiles = {}, // file -> resolved file
numInitialFile... | [
"function",
"TernModule",
"(",
")",
"{",
"var",
"ternPromise",
"=",
"null",
",",
"addFilesPromise",
"=",
"null",
",",
"rootTernDir",
"=",
"null",
",",
"projectRoot",
"=",
"null",
",",
"stopAddingFiles",
"=",
"false",
",",
"resolvedFiles",
"=",
"{",
"}",
",... | Encapsulate all the logic to talk to the tern module. This will create
a new instance of a TernModule, which the rest of the hinting code can use to talk
to the tern node domain, without worrying about initialization, priming the pump, etc. | [
"Encapsulate",
"all",
"the",
"logic",
"to",
"talk",
"to",
"the",
"tern",
"module",
".",
"This",
"will",
"create",
"a",
"new",
"instance",
"of",
"a",
"TernModule",
"which",
"the",
"rest",
"of",
"the",
"hinting",
"code",
"can",
"use",
"to",
"talk",
"to",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L817-L1364 | train | TernModule - TernModule constructor | [
30522,
3853,
28774,
2078,
5302,
8566,
2571,
1006,
1007,
1063,
13075,
28774,
16275,
21716,
5562,
1027,
19701,
1010,
5587,
8873,
4244,
21572,
28732,
1027,
19701,
1010,
7117,
16451,
4305,
2099,
1027,
19701,
1010,
2622,
3217,
4140,
1027,
19701,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | addSlider | function addSlider ( target ) {
// Apply classes and data to the target.
addClass(target, options.cssClasses.target);
if ( options.dir === 0 ) {
addClass(target, options.cssClasses.ltr);
} else {
addClass(target, options.cssClasses.rtl);
... | javascript | function addSlider ( target ) {
// Apply classes and data to the target.
addClass(target, options.cssClasses.target);
if ( options.dir === 0 ) {
addClass(target, options.cssClasses.ltr);
} else {
addClass(target, options.cssClasses.rtl);
... | [
"function",
"addSlider",
"(",
"target",
")",
"{",
"// Apply classes and data to the target.",
"addClass",
"(",
"target",
",",
"options",
".",
"cssClasses",
".",
"target",
")",
";",
"if",
"(",
"options",
".",
"dir",
"===",
"0",
")",
"{",
"addClass",
"(",
"tar... | Initialize a single slider. | [
"Initialize",
"a",
"single",
"slider",
"."
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L960-L978 | train | Add slider to target | [
30522,
3853,
9909,
24198,
2099,
1006,
4539,
1007,
1063,
1013,
1013,
6611,
4280,
1998,
2951,
2000,
1996,
4539,
1012,
5587,
26266,
1006,
4539,
1010,
7047,
1012,
20116,
11020,
27102,
2229,
1012,
4539,
1007,
1025,
2065,
1006,
7047,
1012,
16101,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | _bindEvents | function _bindEvents(popupTableUtils, eventManager, selectionManager) {
const $popupContent = popupTableUtils.$content;
const $mergeBtn = $($popupContent[5]);
const $unmergeBtn = $($popupContent[6]);
const $separator = $($popupContent[7]);
popupTableUtils.on('click .te-table-merge', () => {
eventManager.... | javascript | function _bindEvents(popupTableUtils, eventManager, selectionManager) {
const $popupContent = popupTableUtils.$content;
const $mergeBtn = $($popupContent[5]);
const $unmergeBtn = $($popupContent[6]);
const $separator = $($popupContent[7]);
popupTableUtils.on('click .te-table-merge', () => {
eventManager.... | [
"function",
"_bindEvents",
"(",
"popupTableUtils",
",",
"eventManager",
",",
"selectionManager",
")",
"{",
"const",
"$popupContent",
"=",
"popupTableUtils",
".",
"$content",
";",
"const",
"$mergeBtn",
"=",
"$",
"(",
"$popupContent",
"[",
"5",
"]",
")",
";",
"c... | Bind events for merge feature of contextmenu.
@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
@private | [
"Bind",
"events",
"for",
"merge",
"feature",
"of",
"contextmenu",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/mergedTableUI.js#L43-L80 | train | Bind events to the tableUtils | [
30522,
3853,
1035,
14187,
18697,
7666,
1006,
3769,
29441,
3085,
21823,
4877,
1010,
2724,
24805,
4590,
1010,
4989,
24805,
4590,
1007,
1063,
9530,
3367,
1002,
3769,
6279,
8663,
6528,
2102,
1027,
3769,
29441,
3085,
21823,
4877,
1012,
1002,
418... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Device.js | calcBrowser | function calcBrowser(customUa) {
var sUserAgent = (customUa || ua).toLowerCase(); // use custom user-agent if given
var rwebkit = /(webkit)[ \/]([\w.]+)/;
var ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/;
var rmsie = /(msie) ([\w.]+)/;
var rmsie11 = /(trident)\/[\w.]+;.*rv:([\w.]+)/;
var redge = /(e... | javascript | function calcBrowser(customUa) {
var sUserAgent = (customUa || ua).toLowerCase(); // use custom user-agent if given
var rwebkit = /(webkit)[ \/]([\w.]+)/;
var ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/;
var rmsie = /(msie) ([\w.]+)/;
var rmsie11 = /(trident)\/[\w.]+;.*rv:([\w.]+)/;
var redge = /(e... | [
"function",
"calcBrowser",
"(",
"customUa",
")",
"{",
"var",
"sUserAgent",
"=",
"(",
"customUa",
"||",
"ua",
")",
".",
"toLowerCase",
"(",
")",
";",
"// use custom user-agent if given",
"var",
"rwebkit",
"=",
"/",
"(webkit)[ \\/]([\\w.]+)",
"/",
";",
"var",
"r... | /*!
Taken from jQuery JavaScript Library v1.7.1
http://jquery.com/
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js
http://sizzlejs.com/
Copyright 2011, The Dojo Foundation
Released under the MIT, BSD, and GPL Licenses.
Date: Mon Nov 21 21... | [
"/",
"*",
"!",
"Taken",
"from",
"jQuery",
"JavaScript",
"Library",
"v1",
".",
"7",
".",
"1",
"http",
":",
"//",
"jquery",
".",
"com",
"/"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/Device.js#L688-L712 | train | Calculates the browser name and version | [
30522,
3853,
10250,
27421,
10524,
8043,
1006,
7661,
6692,
1007,
1063,
13075,
10514,
8043,
4270,
3372,
1027,
1006,
7661,
6692,
1064,
1064,
25423,
1007,
1012,
2000,
27663,
18992,
3366,
1006,
1007,
1025,
1013,
1013,
2224,
7661,
5310,
1011,
400... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | showHideHint | function showHideHint(hint, show, documentCode, editorCode) {
if (!hint || !hint.elem) {
return;
}
if (show) {
hint.shown = true;
hint.animationInProgress = false;
hint.elem.removeClass("fadeout");
hint.elem.html(StringUtils.format(Str... | javascript | function showHideHint(hint, show, documentCode, editorCode) {
if (!hint || !hint.elem) {
return;
}
if (show) {
hint.shown = true;
hint.animationInProgress = false;
hint.elem.removeClass("fadeout");
hint.elem.html(StringUtils.format(Str... | [
"function",
"showHideHint",
"(",
"hint",
",",
"show",
",",
"documentCode",
",",
"editorCode",
")",
"{",
"if",
"(",
"!",
"hint",
"||",
"!",
"hint",
".",
"elem",
")",
"{",
"return",
";",
"}",
"if",
"(",
"show",
")",
"{",
"hint",
".",
"shown",
"=",
... | Show, hide or update the hint text
@param {object} hint Editor.hint object of the current InlineTimingFunctionEditor
@param {boolean} show Whether the hint should be shown or hidden
@param {string=} documentCode The invalid code from the document (can be omitted when hiding)
@param {string=} editorCode The valid code ... | [
"Show",
"hide",
"or",
"update",
"the",
"hint",
"text"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js#L254-L278 | train | showHideHint - show the hint | [
30522,
3853,
2265,
26100,
10606,
2102,
1006,
9374,
1010,
2265,
1010,
6254,
16044,
1010,
3559,
16044,
1007,
1063,
2065,
1006,
999,
9374,
1064,
1064,
999,
9374,
1012,
3449,
6633,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
2265,
1007,
1063,
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... |
dimsemenov/PhotoSwipe | src/js/gestures.js | function() {
// temp local vars
var lastFlickDuration,
tempReleasePos;
// s = this
var s = {
lastFlickOffset: {},
lastFlickDist: {},
lastFlickSpeed: {},
slowDownRatio: {},
slowDownRatioReverse: {},
speedDecelerationRatio: {},
speedDecelerationRatioAbs: {},
distanceOffset: {},
... | javascript | function() {
// temp local vars
var lastFlickDuration,
tempReleasePos;
// s = this
var s = {
lastFlickOffset: {},
lastFlickDist: {},
lastFlickSpeed: {},
slowDownRatio: {},
slowDownRatioReverse: {},
speedDecelerationRatio: {},
speedDecelerationRatioAbs: {},
distanceOffset: {},
... | [
"function",
"(",
")",
"{",
"// temp local vars",
"var",
"lastFlickDuration",
",",
"tempReleasePos",
";",
"// s = this",
"var",
"s",
"=",
"{",
"lastFlickOffset",
":",
"{",
"}",
",",
"lastFlickDist",
":",
"{",
"}",
",",
"lastFlickSpeed",
":",
"{",
"}",
",",
... | amount of pixels to drag to determine direction of swipe | [
"amount",
"of",
"pixels",
"to",
"drag",
"to",
"determine",
"direction",
"of",
"swipe"
] | 80607e12542a1a54ecefa837649e862b35dffd25 | https://github.com/dimsemenov/PhotoSwipe/blob/80607e12542a1a54ecefa837649e862b35dffd25/src/js/gestures.js#L800-L922 | train | This function is called by the gesture manager when the gesture is in progress | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
8915,
8737,
2334,
13075,
2015,
13075,
2197,
10258,
6799,
24979,
3370,
1010,
8915,
8737,
16570,
19500,
6873,
2015,
1025,
1013,
1013,
1055,
1027,
2023,
13075,
1055,
1027,
1063,
2197,
10258,
6799,
274... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/routing/TargetCache.js | function (sName, sType) {
if (!sName) {
var sMessage = "A name for the " + sType.toLowerCase() + " has to be defined";
Log.error(sMessage, this);
throw Error(sMessage);
}
} | javascript | function (sName, sType) {
if (!sName) {
var sMessage = "A name for the " + sType.toLowerCase() + " has to be defined";
Log.error(sMessage, this);
throw Error(sMessage);
}
} | [
"function",
"(",
"sName",
",",
"sType",
")",
"{",
"if",
"(",
"!",
"sName",
")",
"{",
"var",
"sMessage",
"=",
"\"A name for the \"",
"+",
"sType",
".",
"toLowerCase",
"(",
")",
"+",
"\" has to be defined\"",
";",
"Log",
".",
"error",
"(",
"sMessage",
",",... | hook for the deprecated property viewId on the route, will not prefix the id with the component
@name sap.ui.core.routing.TargetCache#_getViewWithGlobalId
@returns {*}
@private
@param {string} sName logs an error if it is empty or undefined
@param {string} sType whether it's a 'View' or 'Component'
@private | [
"hook",
"for",
"the",
"deprecated",
"property",
"viewId",
"on",
"the",
"route",
"will",
"not",
"prefix",
"the",
"id",
"with",
"the",
"component"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/TargetCache.js#L305-L313 | train | Checks if the name is defined and if not throws an error | [
30522,
3853,
1006,
1055,
18442,
1010,
2358,
18863,
1007,
1063,
2065,
1006,
999,
1055,
18442,
1007,
1063,
13075,
15488,
7971,
4270,
1027,
1000,
1037,
2171,
2005,
1996,
1000,
1009,
2358,
18863,
1012,
2000,
27663,
18992,
3366,
1006,
1007,
1009... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.ux3/src/sap/ui/ux3/library.js | function() {
"use strict";
/**
* Controls that implement the SAP User Experience (UX) Guidelines 3.0
*
* @namespace
* @name sap.ui.ux3
* @author SAP SE
* @version ${version}
* @public
* @deprecated Since 1.38
*/
// delegate further initialization of this library to the Core
sap.ui.getCore().ini... | javascript | function() {
"use strict";
/**
* Controls that implement the SAP User Experience (UX) Guidelines 3.0
*
* @namespace
* @name sap.ui.ux3
* @author SAP SE
* @version ${version}
* @public
* @deprecated Since 1.38
*/
// delegate further initialization of this library to the Core
sap.ui.getCore().ini... | [
"function",
"(",
")",
"{",
"\"use strict\"",
";",
"/**\n\t * Controls that implement the SAP User Experience (UX) Guidelines 3.0\n\t *\n\t * @namespace\n\t * @name sap.ui.ux3\n\t * @author SAP SE\n\t * @version ${version}\n\t * @public\n\t * @deprecated Since 1.38\n\t */",
"// delegate further initial... | library dependency | [
"library",
"dependency"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/library.js#L11-L399 | train | The sap. ui. ux3. 0. 0 library | [
30522,
3853,
1006,
1007,
1063,
1000,
2224,
9384,
1000,
1025,
1013,
1008,
1008,
1008,
7711,
2008,
10408,
1996,
20066,
5310,
3325,
1006,
1057,
2595,
1007,
11594,
1017,
1012,
1014,
1008,
1008,
1030,
3415,
15327,
1008,
1030,
2171,
20066,
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... | |
moleculerjs/moleculer | src/middlewares/circuit-breaker.js | resetStore | function resetStore() {
if (!logger) return;
logger.debug("Reset circuit-breaker endpoint states...");
store.forEach((item, key) => {
if (item.count == 0) {
logger.debug(`Remove '${key}' endpoint state because it is not used`);
store.delete(key);
return;
}
logger.debug(`Clean '${key}' endpo... | javascript | function resetStore() {
if (!logger) return;
logger.debug("Reset circuit-breaker endpoint states...");
store.forEach((item, key) => {
if (item.count == 0) {
logger.debug(`Remove '${key}' endpoint state because it is not used`);
store.delete(key);
return;
}
logger.debug(`Clean '${key}' endpo... | [
"function",
"resetStore",
"(",
")",
"{",
"if",
"(",
"!",
"logger",
")",
"return",
";",
"logger",
".",
"debug",
"(",
"\"Reset circuit-breaker endpoint states...\"",
")",
";",
"store",
".",
"forEach",
"(",
"(",
"item",
",",
"key",
")",
"=>",
"{",
"if",
"("... | Clear endpoint state store | [
"Clear",
"endpoint",
"state",
"store"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/circuit-breaker.js#L33-L48 | train | Reset the circuit - breaker endpoint states store | [
30522,
3853,
25141,
23809,
2063,
1006,
1007,
1063,
2065,
1006,
999,
8833,
4590,
1007,
2709,
1025,
8833,
4590,
1012,
2139,
8569,
2290,
1006,
1000,
25141,
4984,
1011,
24733,
2203,
8400,
2163,
1012,
1012,
1012,
1000,
1007,
1025,
3573,
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... |
wuchangming/spy-debugger | buildin_modules/weinre/web/client/Resource.js | function(type)
{
switch (type) {
case this.Document:
return "document";
case this.Stylesheet:
return "stylesheet";
case this.Image:
return "image";
case this.Font:
return "font";
case ... | javascript | function(type)
{
switch (type) {
case this.Document:
return "document";
case this.Stylesheet:
return "stylesheet";
case this.Image:
return "image";
case this.Font:
return "font";
case ... | [
"function",
"(",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"this",
".",
"Document",
":",
"return",
"\"document\"",
";",
"case",
"this",
".",
"Stylesheet",
":",
"return",
"\"stylesheet\"",
";",
"case",
"this",
".",
"Image",
":",
"return",... | Returns locale-independent string identifier of resource type (primarily for use in extension API). The IDs need to be kept in sync with webInspector.resoureces.Types object in ExtensionAPI.js. | [
"Returns",
"locale",
"-",
"independent",
"string",
"identifier",
"of",
"resource",
"type",
"(",
"primarily",
"for",
"use",
"in",
"extension",
"API",
")",
".",
"The",
"IDs",
"need",
"to",
"be",
"kept",
"in",
"sync",
"with",
"webInspector",
".",
"resoureces",
... | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/client/Resource.js#L80-L101 | train | returns the name of the resource | [
30522,
3853,
1006,
2828,
1007,
1063,
6942,
1006,
2828,
1007,
1063,
2553,
2023,
1012,
6254,
1024,
2709,
1000,
6254,
1000,
1025,
2553,
2023,
1012,
6782,
21030,
2102,
1024,
2709,
1000,
6782,
21030,
2102,
1000,
1025,
2553,
2023,
1012,
3746,
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... | |
firebase/firebase-js-sdk | packages/firestore/karma.conf.js | getFirestoreSettings | function getFirestoreSettings(argv) {
if (argv.local) {
return {
host: 'localhost:8080',
ssl: false
};
} else {
return {
host: 'firestore.googleapis.com',
ssl: true
};
}
} | javascript | function getFirestoreSettings(argv) {
if (argv.local) {
return {
host: 'localhost:8080',
ssl: false
};
} else {
return {
host: 'firestore.googleapis.com',
ssl: true
};
}
} | [
"function",
"getFirestoreSettings",
"(",
"argv",
")",
"{",
"if",
"(",
"argv",
".",
"local",
")",
"{",
"return",
"{",
"host",
":",
"'localhost:8080'",
",",
"ssl",
":",
"false",
"}",
";",
"}",
"else",
"{",
"return",
"{",
"host",
":",
"'firestore.googleapis... | If the --local argument is passed, returns a {host, ssl} FirestoreSettings
object that point to localhost instead of production. | [
"If",
"the",
"--",
"local",
"argument",
"is",
"passed",
"returns",
"a",
"{",
"host",
"ssl",
"}",
"FirestoreSettings",
"object",
"that",
"point",
"to",
"localhost",
"instead",
"of",
"production",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/firestore/karma.conf.js#L60-L72 | train | Get the firestore settings | [
30522,
3853,
2131,
26332,
19277,
21678,
8613,
1006,
12098,
2290,
2615,
1007,
1063,
2065,
1006,
12098,
2290,
2615,
1012,
2334,
1007,
1063,
2709,
1063,
3677,
1024,
1005,
2334,
15006,
2102,
1024,
3770,
17914,
1005,
1010,
7020,
2140,
1024,
6270... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | mxGraph | function mxGraph(container, model, renderHint, stylesheet)
{
// Initializes the variable in case the prototype has been
// modified to hold some listeners (which is possible because
// the createHandlers call is executed regardless of the
// arguments passed into the ctor).
this.mouseListeners = null;
// Conver... | javascript | function mxGraph(container, model, renderHint, stylesheet)
{
// Initializes the variable in case the prototype has been
// modified to hold some listeners (which is possible because
// the createHandlers call is executed regardless of the
// arguments passed into the ctor).
this.mouseListeners = null;
// Conver... | [
"function",
"mxGraph",
"(",
"container",
",",
"model",
",",
"renderHint",
",",
"stylesheet",
")",
"{",
"// Initializes the variable in case the prototype has been",
"// modified to hold some listeners (which is possible because",
"// the createHandlers call is executed regardless of the"... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxGraph
Extends <mxEventSource> to implement a graph component for
the browser. This is the main class of the package. To activate
panning and connections use <setPanning> and <setConnectable>.
For rubberband selection you must create ... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxGraph"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L54714-L54773 | train | Constructs a new graph instance. | [
30522,
3853,
25630,
14413,
1006,
11661,
1010,
2944,
1010,
17552,
10606,
2102,
1010,
6782,
21030,
2102,
1007,
1063,
1013,
1013,
3988,
10057,
1996,
8023,
1999,
2553,
1996,
8773,
2038,
2042,
1013,
1013,
6310,
2000,
2907,
2070,
13810,
1006,
202... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/relay | packages/relay-runtime/store/RelayResponseNormalizer.js | normalize | function normalize(
recordSource: MutableRecordSource,
selector: NormalizationSelector,
response: PayloadData,
options: NormalizationOptions,
): NormalizedResponse {
const {dataID, node, variables} = selector;
const normalizer = new RelayResponseNormalizer(
recordSource,
variables,
options,
);... | javascript | function normalize(
recordSource: MutableRecordSource,
selector: NormalizationSelector,
response: PayloadData,
options: NormalizationOptions,
): NormalizedResponse {
const {dataID, node, variables} = selector;
const normalizer = new RelayResponseNormalizer(
recordSource,
variables,
options,
);... | [
"function",
"normalize",
"(",
"recordSource",
":",
"MutableRecordSource",
",",
"selector",
":",
"NormalizationSelector",
",",
"response",
":",
"PayloadData",
",",
"options",
":",
"NormalizationOptions",
",",
")",
":",
"NormalizedResponse",
"{",
"const",
"{",
"dataID... | Normalizes the results of a query and standard GraphQL response, writing the
normalized records/fields into the given MutableRecordSource.
If handleStrippedNulls is true, will replace fields on the Selector that
are not present in the response with null. Otherwise will leave fields unset. | [
"Normalizes",
"the",
"results",
"of",
"a",
"query",
"and",
"standard",
"GraphQL",
"response",
"writing",
"the",
"normalized",
"records",
"/",
"fields",
"into",
"the",
"given",
"MutableRecordSource",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-runtime/store/RelayResponseNormalizer.js#L83-L96 | train | Normalizes a response from a relation | [
30522,
3853,
3671,
4697,
1006,
2636,
8162,
3401,
1024,
14163,
10880,
2890,
27108,
5104,
8162,
3401,
1010,
27000,
1024,
3671,
22318,
12260,
16761,
1010,
3433,
1024,
18093,
2850,
2696,
1010,
7047,
1024,
3671,
3989,
7361,
9285,
1010,
1007,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/blanket.js | parseCatchClause | function parseCatchClause() {
var param, body, startToken;
startToken = lookahead;
expectKeyword('catch');
expect('(');
if (match(')')) {
throwUnexpected(lookahead);
}
param = parseVariableIdentifier();
// 12.14.1
if (strict && isRes... | javascript | function parseCatchClause() {
var param, body, startToken;
startToken = lookahead;
expectKeyword('catch');
expect('(');
if (match(')')) {
throwUnexpected(lookahead);
}
param = parseVariableIdentifier();
// 12.14.1
if (strict && isRes... | [
"function",
"parseCatchClause",
"(",
")",
"{",
"var",
"param",
",",
"body",
",",
"startToken",
";",
"startToken",
"=",
"lookahead",
";",
"expectKeyword",
"(",
"'catch'",
")",
";",
"expect",
"(",
"'('",
")",
";",
"if",
"(",
"match",
"(",
"')'",
")",
")"... | 12.14 The try statement | [
"12",
".",
"14",
"The",
"try",
"statement"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L3132-L3152 | train | ECMA - 262 12. 1 CatchClause | [
30522,
3853,
11968,
3366,
11266,
2818,
30524,
1027,
2298,
4430,
13775,
1025,
5987,
14839,
18351,
1006,
1005,
4608,
1005,
1007,
1025,
5987,
1006,
1005,
1006,
1005,
1007,
1025,
2065,
1006,
2674,
1006,
1005,
1007,
1005,
1007,
1007,
1063,
5466,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/utils/zip-stream.js | function(data, encoding, callback) {
if (this.error) {
if (callback) {
callback(error);
}
throw error;
} else {
return this.stream.write(data, encoding, callback);
}
} | javascript | function(data, encoding, callback) {
if (this.error) {
if (callback) {
callback(error);
}
throw error;
} else {
return this.stream.write(data, encoding, callback);
}
} | [
"function",
"(",
"data",
",",
"encoding",
",",
"callback",
")",
"{",
"if",
"(",
"this",
".",
"error",
")",
"{",
"if",
"(",
"callback",
")",
"{",
"callback",
"(",
"error",
")",
";",
"}",
"throw",
"error",
";",
"}",
"else",
"{",
"return",
"this",
"... | ========================================================================== Stream.Writable interface | [
"==========================================================================",
"Stream",
".",
"Writable",
"interface"
] | c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2 | https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/utils/zip-stream.js#L72-L81 | train | Writes the specified data to the file system. | [
30522,
3853,
1006,
2951,
1010,
17181,
1010,
2655,
5963,
1007,
1063,
2065,
1006,
2023,
1012,
7561,
1007,
1063,
2065,
1006,
2655,
5963,
1007,
1063,
2655,
5963,
1006,
7561,
1007,
1025,
1065,
5466,
7561,
1025,
1065,
2842,
1063,
2709,
2023,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
apache/incubator-echarts | src/coord/geo/Geo.js | Geo | function Geo(name, map, nameMap, invertLongitute) {
View.call(this, name);
/**
* Map type
* @type {string}
*/
this.map = map;
var source = geoSourceManager.load(map, nameMap);
this._nameCoordMap = source.nameCoordMap;
this._regionsMap = source.regionsMap;
this._invertLongi... | javascript | function Geo(name, map, nameMap, invertLongitute) {
View.call(this, name);
/**
* Map type
* @type {string}
*/
this.map = map;
var source = geoSourceManager.load(map, nameMap);
this._nameCoordMap = source.nameCoordMap;
this._regionsMap = source.regionsMap;
this._invertLongi... | [
"function",
"Geo",
"(",
"name",
",",
"map",
",",
"nameMap",
",",
"invertLongitute",
")",
"{",
"View",
".",
"call",
"(",
"this",
",",
"name",
")",
";",
"/**\n * Map type\n * @type {string}\n */",
"this",
".",
"map",
"=",
"map",
";",
"var",
"source... | [Geo description]
For backward compatibility, the orginal interface:
`name, map, geoJson, specialAreas, nameMap` is kept.
@param {string|Object} name
@param {string} map Map type
Specify the positioned areas by left, top, width, height
@param {Object.<string, string>} [nameMap]
Specify name alias
@param {boolean} [inv... | [
"[",
"Geo",
"description",
"]",
"For",
"backward",
"compatibility",
"the",
"orginal",
"interface",
":",
"name",
"map",
"geoJson",
"specialAreas",
"nameMap",
"is",
"kept",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/geo/Geo.js#L38-L63 | train | A geo view | [
30522,
3853,
20248,
1006,
2171,
1010,
4949,
1010,
2171,
2863,
2361,
1010,
1999,
16874,
10052,
4183,
10421,
1007,
1063,
3193,
1012,
2655,
1006,
2023,
1010,
30524,
1013,
2023,
1012,
4949,
1027,
4949,
1025,
13075,
3120,
1027,
20248,
6499,
3126... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/angular | tools/build/file2modulename.js | file2moduleName | function file2moduleName(filePath) {
return filePath
.replace(/\\/g, '/')
// module name should be relative to `modules` and `tools` folder
.replace(/.*\/modules\//, '')
// and 'dist' folder
.replace(/.*\/dist\/js\/dev\/es5\//, '')
// module name should not include `lib`, `web` fo... | javascript | function file2moduleName(filePath) {
return filePath
.replace(/\\/g, '/')
// module name should be relative to `modules` and `tools` folder
.replace(/.*\/modules\//, '')
// and 'dist' folder
.replace(/.*\/dist\/js\/dev\/es5\//, '')
// module name should not include `lib`, `web` fo... | [
"function",
"file2moduleName",
"(",
"filePath",
")",
"{",
"return",
"filePath",
".",
"replace",
"(",
"/",
"\\\\",
"/",
"g",
",",
"'/'",
")",
"// module name should be relative to `modules` and `tools` folder",
".",
"replace",
"(",
"/",
".*\\/modules\\/",
"/",
",",
... | @license
Copyright Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that can be
found in the LICENSE file at https://angular.io/license | [
"@license",
"Copyright",
"Google",
"Inc",
".",
"All",
"Rights",
"Reserved",
"."
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/build/file2modulename.js#L9-L22 | train | Convert a file path to a module name | [
30522,
3853,
5371,
2475,
5302,
8566,
20844,
4168,
1006,
5371,
15069,
1007,
1063,
2709,
5371,
15069,
1012,
5672,
1006,
1013,
1032,
1032,
1013,
1043,
1010,
1005,
1013,
1005,
1007,
1013,
1013,
11336,
2171,
2323,
2022,
5816,
2000,
1036,
14184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kriasoft/react-starter-kit | tools/build.js | build | async function build() {
await run(clean);
await run(copy);
await run(bundle);
if (process.argv.includes('--static')) {
await run(render);
}
if (process.argv.includes('--docker')) {
cp.spawnSync('docker', ['build', '-t', pkg.name, '.'], {
stdio: 'inherit',
});
}
} | javascript | async function build() {
await run(clean);
await run(copy);
await run(bundle);
if (process.argv.includes('--static')) {
await run(render);
}
if (process.argv.includes('--docker')) {
cp.spawnSync('docker', ['build', '-t', pkg.name, '.'], {
stdio: 'inherit',
});
}
} | [
"async",
"function",
"build",
"(",
")",
"{",
"await",
"run",
"(",
"clean",
")",
";",
"await",
"run",
"(",
"copy",
")",
";",
"await",
"run",
"(",
"bundle",
")",
";",
"if",
"(",
"process",
".",
"argv",
".",
"includes",
"(",
"'--static'",
")",
")",
... | Compiles the project from source files into a distributable
format and copies it to the output (build) folder. | [
"Compiles",
"the",
"project",
"from",
"source",
"files",
"into",
"a",
"distributable",
"format",
"and",
"copies",
"it",
"to",
"the",
"output",
"(",
"build",
")",
"folder",
"."
] | 8d6c018f3198dec2a580ecafb011a32f06e38dbf | https://github.com/kriasoft/react-starter-kit/blob/8d6c018f3198dec2a580ecafb011a32f06e38dbf/tools/build.js#L22-L36 | train | Build the cluster | [
30522,
2004,
6038,
2278,
3853,
3857,
1006,
1007,
1063,
26751,
2448,
1006,
4550,
1007,
1025,
26751,
2448,
1006,
6100,
1007,
1025,
26751,
2448,
1006,
14012,
1007,
1025,
2065,
1006,
2832,
1012,
12098,
2290,
2615,
1012,
2950,
1006,
1005,
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... |
adobe/brackets | src/language/CSSUtils.js | _getRangeForPropValue | function _getRangeForPropValue(startCtx, endCtx) {
var range = { "start": {},
"end": {} };
// Skip the ":" and any leading whitespace
while (TokenUtils.moveNextToken(startCtx)) {
if (_hasNonWhitespace(startCtx.token.string)) {
break;
... | javascript | function _getRangeForPropValue(startCtx, endCtx) {
var range = { "start": {},
"end": {} };
// Skip the ":" and any leading whitespace
while (TokenUtils.moveNextToken(startCtx)) {
if (_hasNonWhitespace(startCtx.token.string)) {
break;
... | [
"function",
"_getRangeForPropValue",
"(",
"startCtx",
",",
"endCtx",
")",
"{",
"var",
"range",
"=",
"{",
"\"start\"",
":",
"{",
"}",
",",
"\"end\"",
":",
"{",
"}",
"}",
";",
"// Skip the \":\" and any leading whitespace",
"while",
"(",
"TokenUtils",
".",
"move... | @private
Return a range object with a start position and an end position after
skipping any whitespaces and all separators used before and after a
valid property value.
@param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} startCtx context
@param {editor:{CodeMirror}, pos:{ch:{string}, line:{n... | [
"@private",
"Return",
"a",
"range",
"object",
"with",
"a",
"start",
"position",
"and",
"an",
"end",
"position",
"after",
"skipping",
"any",
"whitespaces",
"and",
"all",
"separators",
"used",
"before",
"and",
"after",
"a",
"valid",
"property",
"value",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L403-L427 | train | Get the range for a property value | [
30522,
3853,
1035,
2131,
24388,
12879,
2953,
21572,
2361,
10175,
5657,
1006,
2707,
6593,
2595,
1010,
2203,
6593,
2595,
1007,
1063,
13075,
2846,
1027,
1063,
1000,
2707,
1000,
1024,
1063,
1065,
1010,
1000,
2203,
1000,
1024,
1063,
1065,
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... |
chartjs/Chart.js | src/scales/scale.time.js | determineStepSize | function determineStepSize(min, max, unit, capacity) {
var range = max - min;
var interval = INTERVALS[unit];
var milliseconds = interval.size;
var steps = interval.steps;
var i, ilen, factor;
if (!steps) {
return Math.ceil(range / (capacity * milliseconds));
}
for (i = 0, ilen = steps.length; i < ilen; ++i... | javascript | function determineStepSize(min, max, unit, capacity) {
var range = max - min;
var interval = INTERVALS[unit];
var milliseconds = interval.size;
var steps = interval.steps;
var i, ilen, factor;
if (!steps) {
return Math.ceil(range / (capacity * milliseconds));
}
for (i = 0, ilen = steps.length; i < ilen; ++i... | [
"function",
"determineStepSize",
"(",
"min",
",",
"max",
",",
"unit",
",",
"capacity",
")",
"{",
"var",
"range",
"=",
"max",
"-",
"min",
";",
"var",
"interval",
"=",
"INTERVALS",
"[",
"unit",
"]",
";",
"var",
"milliseconds",
"=",
"interval",
".",
"size... | Returns the number of unit to skip to be able to display up to `capacity` number of ticks
in `unit` for the given `min` / `max` range and respecting the interval steps constraints. | [
"Returns",
"the",
"number",
"of",
"unit",
"to",
"skip",
"to",
"be",
"able",
"to",
"display",
"up",
"to",
"capacity",
"number",
"of",
"ticks",
"in",
"unit",
"for",
"the",
"given",
"min",
"/",
"max",
"range",
"and",
"respecting",
"the",
"interval",
"steps"... | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/scales/scale.time.js#L254-L273 | train | Determine the step size of a range of time | [
30522,
3853,
16463,
2618,
4523,
4697,
1006,
8117,
1010,
4098,
1010,
3131,
1010,
3977,
1007,
1063,
13075,
2846,
1027,
4098,
1011,
8117,
1025,
13075,
13483,
1027,
14025,
1031,
3131,
1033,
1025,
13075,
4971,
5562,
8663,
5104,
1027,
13483,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/init-declarations.js | isInitialized | function isInitialized(node) {
const declaration = node.parent;
const block = declaration.parent;
if (isForLoop(block)) {
if (block.type === "ForStatement") {
return block.init === declaration;
}
return block.left === declaration;
}
return Boolean(node.init);
} | javascript | function isInitialized(node) {
const declaration = node.parent;
const block = declaration.parent;
if (isForLoop(block)) {
if (block.type === "ForStatement") {
return block.init === declaration;
}
return block.left === declaration;
}
return Boolean(node.init);
} | [
"function",
"isInitialized",
"(",
"node",
")",
"{",
"const",
"declaration",
"=",
"node",
".",
"parent",
";",
"const",
"block",
"=",
"declaration",
".",
"parent",
";",
"if",
"(",
"isForLoop",
"(",
"block",
")",
")",
"{",
"if",
"(",
"block",
".",
"type",... | Checks whether or not a given declarator node has its initializer.
@param {ASTNode} node - A declarator node to check.
@returns {boolean} `true` when the node has its initializer. | [
"Checks",
"whether",
"or",
"not",
"a",
"given",
"declarator",
"node",
"has",
"its",
"initializer",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/init-declarations.js#L28-L39 | train | Returns true if the given node is initialized. | [
30522,
3853,
2003,
5498,
20925,
3550,
1006,
13045,
1007,
1063,
9530,
3367,
8170,
1027,
13045,
1012,
6687,
1025,
9530,
3367,
3796,
1027,
8170,
1012,
6687,
1025,
2065,
1006,
2003,
29278,
4135,
7361,
1006,
3796,
1007,
1007,
1063,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/core/schema.js | processPropertyDefinition | function processPropertyDefinition (propDefinition, componentName) {
var defaultVal = propDefinition.default;
var isCustomType;
var propType;
var typeName = propDefinition.type;
// Type inference.
if (!propDefinition.type) {
if (defaultVal !== undefined &&
(typeof defaultVal === 'boolean' || ty... | javascript | function processPropertyDefinition (propDefinition, componentName) {
var defaultVal = propDefinition.default;
var isCustomType;
var propType;
var typeName = propDefinition.type;
// Type inference.
if (!propDefinition.type) {
if (defaultVal !== undefined &&
(typeof defaultVal === 'boolean' || ty... | [
"function",
"processPropertyDefinition",
"(",
"propDefinition",
",",
"componentName",
")",
"{",
"var",
"defaultVal",
"=",
"propDefinition",
".",
"default",
";",
"var",
"isCustomType",
";",
"var",
"propType",
";",
"var",
"typeName",
"=",
"propDefinition",
".",
"typ... | Inject default value, parser, stringifier for single property.
@param {object} propDefinition
@param {string} componentName | [
"Inject",
"default",
"value",
"parser",
"stringifier",
"for",
"single",
"property",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/schema.js#L52-L102 | train | Process a property definition. | [
30522,
3853,
2832,
21572,
4842,
3723,
3207,
16294,
22753,
1006,
17678,
3207,
16294,
22753,
1010,
6922,
18442,
1007,
1063,
13075,
12398,
10175,
1027,
17678,
3207,
16294,
22753,
1012,
12398,
1025,
13075,
2003,
7874,
20389,
13874,
1025,
13075,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/linter.js | addDeclaredGlobals | function addDeclaredGlobals(globalScope, configGlobals, { exportedVariables, enabledGlobals }) {
// Define configured global variables.
for (const id of new Set([...Object.keys(configGlobals), ...Object.keys(enabledGlobals)])) {
/*
* `ConfigOps.normalizeConfigGlobal` will throw an error if a ... | javascript | function addDeclaredGlobals(globalScope, configGlobals, { exportedVariables, enabledGlobals }) {
// Define configured global variables.
for (const id of new Set([...Object.keys(configGlobals), ...Object.keys(enabledGlobals)])) {
/*
* `ConfigOps.normalizeConfigGlobal` will throw an error if a ... | [
"function",
"addDeclaredGlobals",
"(",
"globalScope",
",",
"configGlobals",
",",
"{",
"exportedVariables",
",",
"enabledGlobals",
"}",
")",
"{",
"// Define configured global variables.",
"for",
"(",
"const",
"id",
"of",
"new",
"Set",
"(",
"[",
"...",
"Object",
"."... | ------------------------------------------------------------------------------ Helpers ------------------------------------------------------------------------------
Ensures that variables representing built-in properties of the Global Object,
and any globals declared by special block comments, are present in the glob... | [
"------------------------------------------------------------------------------",
"Helpers",
"------------------------------------------------------------------------------",
"Ensures",
"that",
"variables",
"representing",
"built",
"-",
"in",
"properties",
"of",
"the",
"Global",
"Object"... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/linter.js#L73-L138 | train | Adds defined global variables to the global scope. | [
30522,
3853,
5587,
3207,
20464,
12069,
2094,
23296,
16429,
9777,
1006,
3795,
26127,
1010,
9530,
8873,
13871,
4135,
10264,
2015,
1010,
1063,
15612,
10755,
19210,
2015,
1010,
9124,
23296,
16429,
9777,
1065,
1007,
1063,
1013,
1013,
9375,
26928,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Icon.js | function (vColor) {
if (vColor != null && vColor !== "" && !CSSColor.isValid(vColor) && !(vColor in IconColor)) {
Log.error("\"" + vColor + "\" is not of type sap.ui.core.CSSColor nor of type sap.ui.core.IconColor.");
return false;
} else {
return true;
}
} | javascript | function (vColor) {
if (vColor != null && vColor !== "" && !CSSColor.isValid(vColor) && !(vColor in IconColor)) {
Log.error("\"" + vColor + "\" is not of type sap.ui.core.CSSColor nor of type sap.ui.core.IconColor.");
return false;
} else {
return true;
}
} | [
"function",
"(",
"vColor",
")",
"{",
"if",
"(",
"vColor",
"!=",
"null",
"&&",
"vColor",
"!==",
"\"\"",
"&&",
"!",
"CSSColor",
".",
"isValid",
"(",
"vColor",
")",
"&&",
"!",
"(",
"vColor",
"in",
"IconColor",
")",
")",
"{",
"Log",
".",
"error",
"(",
... | Validates whether an input color is a valid color of type
<code>sap.ui.core.CSSColor</code> or <code>sap.ui.core.IconColor</code>.
undefined, null and an empty string are also valid.
In case the color is not valid, an error gets logged to the console.
@param {sap.ui.core.CSSColor|sap.ui.core.IconColor|null|undefined|s... | [
"Validates",
"whether",
"an",
"input",
"color",
"is",
"a",
"valid",
"color",
"of",
"type",
"<code",
">",
"sap",
".",
"ui",
".",
"core",
".",
"CSSColor<",
"/",
"code",
">",
"or",
"<code",
">",
"sap",
".",
"ui",
".",
"core",
".",
"IconColor<",
"/",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Icon.js#L48-L55 | train | Checks if the given color is valid | [
30522,
3853,
1006,
18315,
12898,
2099,
1007,
1063,
2065,
1006,
18315,
12898,
2099,
999,
1027,
19701,
1004,
1004,
18315,
12898,
2099,
999,
1027,
1027,
1000,
1000,
1004,
1004,
999,
20116,
9363,
10626,
1012,
2003,
10175,
3593,
1006,
18315,
128... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/routing/Router.js | function (bIgnoreInitialHash) {
var that = this;
if (!this.oHashChanger) {
this.oHashChanger = HashChanger.getInstance().createRouterHashChanger();
}
if (this._bIsInitialized) {
Log.warning("Router is already initialized.", this);
return this;
}
this._bIsInitialized = true;
... | javascript | function (bIgnoreInitialHash) {
var that = this;
if (!this.oHashChanger) {
this.oHashChanger = HashChanger.getInstance().createRouterHashChanger();
}
if (this._bIsInitialized) {
Log.warning("Router is already initialized.", this);
return this;
}
this._bIsInitialized = true;
... | [
"function",
"(",
"bIgnoreInitialHash",
")",
"{",
"var",
"that",
"=",
"this",
";",
"if",
"(",
"!",
"this",
".",
"oHashChanger",
")",
"{",
"this",
".",
"oHashChanger",
"=",
"HashChanger",
".",
"getInstance",
"(",
")",
".",
"createRouterHashChanger",
"(",
")"... | Attaches the router to the hash changer @see sap.ui.core.routing.HashChanger
@param {boolean} [bIgnoreInitialHash=false] @since 1.48.0 whether the current url hash shouldn't be parsed after the router is initialized
@public
@returns {sap.ui.core.routing.Router} this for chaining. | [
"Attaches",
"the",
"router",
"to",
"the",
"hash",
"changer",
"@see",
"sap",
".",
"ui",
".",
"core",
".",
"routing",
".",
"HashChanger"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L319-L383 | train | Initializes the hashChanger | [
30522,
3853,
1006,
2502,
12131,
12377,
29050,
2140,
14949,
2232,
1007,
1063,
13075,
2008,
1027,
2023,
1025,
2065,
1006,
999,
2023,
1012,
2821,
11823,
22305,
2121,
1007,
1063,
2023,
1012,
2821,
11823,
22305,
2121,
1027,
23325,
22305,
2121,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/LiveDevelopment/LiveDevelopment.js | _onDirtyFlagChange | function _onDirtyFlagChange(event, doc) {
if (doc && Inspector.connected() &&
_server && agents.network && agents.network.wasURLRequested(_server.pathToUrl(doc.file.fullPath))) {
// Set status to out of sync if dirty. Otherwise, set it to active status.
_setStatus(_docIsO... | javascript | function _onDirtyFlagChange(event, doc) {
if (doc && Inspector.connected() &&
_server && agents.network && agents.network.wasURLRequested(_server.pathToUrl(doc.file.fullPath))) {
// Set status to out of sync if dirty. Otherwise, set it to active status.
_setStatus(_docIsO... | [
"function",
"_onDirtyFlagChange",
"(",
"event",
",",
"doc",
")",
"{",
"if",
"(",
"doc",
"&&",
"Inspector",
".",
"connected",
"(",
")",
"&&",
"_server",
"&&",
"agents",
".",
"network",
"&&",
"agents",
".",
"network",
".",
"wasURLRequested",
"(",
"_server",
... | Triggered by a change in dirty flag from the DocumentManager | [
"Triggered",
"by",
"a",
"change",
"in",
"dirty",
"flag",
"from",
"the",
"DocumentManager"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevelopment.js#L1491-L1497 | train | Called when the doc is dirty | [
30522,
3853,
1035,
2006,
4305,
5339,
2100,
10258,
8490,
22305,
2063,
1006,
2724,
1010,
9986,
1007,
1063,
2065,
1006,
9986,
1004,
1004,
7742,
1012,
4198,
1006,
1007,
1004,
1004,
1035,
8241,
1004,
1004,
6074,
1012,
2897,
1004,
1004,
6074,
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/registry/componentRegistry.js | function(handle) {
if (isValidID(handle)) {
var deferred = $q.defer();
var instance = self.get(handle);
if (instance) {
deferred.resolve(instance);
} else {
if (pendings[handle] === undefined) {
pendings[handle] = [];
}
... | javascript | function(handle) {
if (isValidID(handle)) {
var deferred = $q.defer();
var instance = self.get(handle);
if (instance) {
deferred.resolve(instance);
} else {
if (pendings[handle] === undefined) {
pendings[handle] = [];
}
... | [
"function",
"(",
"handle",
")",
"{",
"if",
"(",
"isValidID",
"(",
"handle",
")",
")",
"{",
"var",
"deferred",
"=",
"$q",
".",
"defer",
"(",
")",
";",
"var",
"instance",
"=",
"self",
".",
"get",
"(",
"handle",
")",
";",
"if",
"(",
"instance",
")",... | Async accessor to registered component instance
If not available then a promise is created to notify
all listeners when the instance is registered. | [
"Async",
"accessor",
"to",
"registered",
"component",
"instance",
"If",
"not",
"available",
"then",
"a",
"promise",
"is",
"created",
"to",
"notify",
"all",
"listeners",
"when",
"the",
"instance",
"is",
"registered",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/registry/componentRegistry.js#L99-L116 | train | Return a promise that resolves to the instance of the component with the given handle. | [
30522,
3853,
1006,
5047,
1007,
1063,
2065,
1006,
2003,
10175,
28173,
2094,
1006,
5047,
1007,
1007,
1063,
13075,
13366,
28849,
2094,
1027,
1002,
1053,
1012,
13366,
2121,
1006,
1007,
1025,
13075,
6013,
1027,
2969,
1012,
2131,
1006,
5047,
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... | |
aframevr/aframe | src/utils/src-loader.js | checkIsImage | function checkIsImage (src, onResult) {
var request;
if (src.tagName) {
onResult(src.tagName === 'IMG');
return;
}
request = new XMLHttpRequest();
// Try to send HEAD request to check if image first.
request.open('HEAD', src);
request.addEventListener('load', function (event) {
var contentTy... | javascript | function checkIsImage (src, onResult) {
var request;
if (src.tagName) {
onResult(src.tagName === 'IMG');
return;
}
request = new XMLHttpRequest();
// Try to send HEAD request to check if image first.
request.open('HEAD', src);
request.addEventListener('load', function (event) {
var contentTy... | [
"function",
"checkIsImage",
"(",
"src",
",",
"onResult",
")",
"{",
"var",
"request",
";",
"if",
"(",
"src",
".",
"tagName",
")",
"{",
"onResult",
"(",
"src",
".",
"tagName",
"===",
"'IMG'",
")",
";",
"return",
";",
"}",
"request",
"=",
"new",
"XMLHtt... | Call back whether `src` is an image.
@param {string|Element} src - URL or element that will be tested.
@param {function} onResult - Callback with whether `src` is an image. | [
"Call",
"back",
"whether",
"src",
"is",
"an",
"image",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/utils/src-loader.js#L91-L121 | train | Check if src is an image | [
30522,
3853,
4638,
17417,
26860,
1006,
5034,
2278,
1010,
2006,
6072,
11314,
1007,
1063,
13075,
5227,
1025,
2065,
1006,
5034,
2278,
1012,
6415,
18442,
1007,
1063,
2006,
6072,
11314,
1006,
5034,
2278,
1012,
6415,
18442,
1027,
1027,
1027,
1005... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableAccExtension.js | function(oExtension, $Cell, aDefaultLabels, aDefaultDescriptions, aLabels, aDescriptions, sText, fAdapt) {
ExtensionHelper.storeDefaultsBeforeCellModifications(oExtension, $Cell, aDefaultLabels, aDefaultDescriptions);
var oCountChangeInfo = ExtensionHelper.updateRowColCount(oExtension);
oExtension.getTable().$... | javascript | function(oExtension, $Cell, aDefaultLabels, aDefaultDescriptions, aLabels, aDescriptions, sText, fAdapt) {
ExtensionHelper.storeDefaultsBeforeCellModifications(oExtension, $Cell, aDefaultLabels, aDefaultDescriptions);
var oCountChangeInfo = ExtensionHelper.updateRowColCount(oExtension);
oExtension.getTable().$... | [
"function",
"(",
"oExtension",
",",
"$Cell",
",",
"aDefaultLabels",
",",
"aDefaultDescriptions",
",",
"aLabels",
",",
"aDescriptions",
",",
"sText",
",",
"fAdapt",
")",
"{",
"ExtensionHelper",
".",
"storeDefaultsBeforeCellModifications",
"(",
"oExtension",
",",
"$Ce... | /*
Updates the row / column counters, adapts the labels and descriptions of the given cell and stores the the
given defaults before the modification.
@see ExtensionHelper.updateRowColCount
@see ExtensionHelper.storeDefaultsBeforeCellModifications | [
"/",
"*",
"Updates",
"the",
"row",
"/",
"column",
"counters",
"adapts",
"the",
"labels",
"and",
"descriptions",
"of",
"the",
"given",
"cell",
"and",
"stores",
"the",
"the",
"given",
"defaults",
"before",
"the",
"modification",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableAccExtension.js#L307-L333 | train | Updates the default values of the cell | [
30522,
3853,
1006,
1051,
10288,
29048,
1010,
1002,
3526,
1010,
4748,
12879,
23505,
20470,
9050,
1010,
4748,
12879,
23505,
6155,
23235,
8496,
1010,
21862,
8671,
2015,
1010,
4748,
2229,
23235,
8496,
1010,
26261,
18413,
1010,
6904,
2850,
13876,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/third_party/oboe/src/lists.js | all | function all(fn, list) {
return !list ||
( fn(head(list)) && all(fn, tail(list)) );
} | javascript | function all(fn, list) {
return !list ||
( fn(head(list)) && all(fn, tail(list)) );
} | [
"function",
"all",
"(",
"fn",
",",
"list",
")",
"{",
"return",
"!",
"list",
"||",
"(",
"fn",
"(",
"head",
"(",
"list",
")",
")",
"&&",
"all",
"(",
"fn",
",",
"tail",
"(",
"list",
")",
")",
")",
";",
"}"
] | Returns true if the given function holds for every item in
the list, false otherwise | [
"Returns",
"true",
"if",
"the",
"given",
"function",
"holds",
"for",
"every",
"item",
"in",
"the",
"list",
"false",
"otherwise"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L147-L151 | train | Returns true if fn returns true for all elements in list | [
30522,
3853,
2035,
1006,
1042,
2078,
1010,
2862,
1007,
1063,
2709,
999,
2862,
1064,
1064,
1006,
1042,
2078,
1006,
2132,
1006,
2862,
1007,
1007,
1004,
1004,
2035,
1006,
1042,
2078,
1010,
5725,
1006,
2862,
1007,
1007,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_FILETIME | function parse_FILETIME(blob) {
var dwLowDateTime = blob.read_shift(4), dwHighDateTime = blob.read_shift(4);
return new Date(((dwHighDateTime/1e7*Math.pow(2,32) + dwLowDateTime/1e7) - 11644473600)*1000).toISOString().replace(/\.000/,"");
} | javascript | function parse_FILETIME(blob) {
var dwLowDateTime = blob.read_shift(4), dwHighDateTime = blob.read_shift(4);
return new Date(((dwHighDateTime/1e7*Math.pow(2,32) + dwLowDateTime/1e7) - 11644473600)*1000).toISOString().replace(/\.000/,"");
} | [
"function",
"parse_FILETIME",
"(",
"blob",
")",
"{",
"var",
"dwLowDateTime",
"=",
"blob",
".",
"read_shift",
"(",
"4",
")",
",",
"dwHighDateTime",
"=",
"blob",
".",
"read_shift",
"(",
"4",
")",
";",
"return",
"new",
"Date",
"(",
"(",
"(",
"dwHighDateTime... | /* [MS-DTYP] 2.3.3 FILETIME /* [MS-OLEDS] 2.1.3 FILETIME (Packet Version) /* [MS-OLEPS] 2.8 FILETIME (Packet Version) | [
"/",
"*",
"[",
"MS",
"-",
"DTYP",
"]",
"2",
".",
"3",
".",
"3",
"FILETIME",
"/",
"*",
"[",
"MS",
"-",
"OLEDS",
"]",
"2",
".",
"1",
".",
"3",
"FILETIME",
"(",
"Packet",
"Version",
")",
"/",
"*",
"[",
"MS",
"-",
"OLEPS",
"]",
"2",
".",
"8",... | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L4971-L4974 | train | Parse FILETIME | [
30522,
3853,
11968,
3366,
1035,
5371,
7292,
1006,
1038,
4135,
2497,
1007,
1063,
13075,
1040,
13668,
5004,
13701,
7292,
1027,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1018,
1007,
1010,
1040,
2860,
4048,
5603,
13701,
7292,
1027,
1038,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/util/animation/animate.js | function (element, originator) {
var zoomTemplate = "translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )";
var buildZoom = angular.bind(null, $mdUtil.supplant, zoomTemplate);
return buildZoom(self.calculateTransformValues(element, originator));
} | javascript | function (element, originator) {
var zoomTemplate = "translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )";
var buildZoom = angular.bind(null, $mdUtil.supplant, zoomTemplate);
return buildZoom(self.calculateTransformValues(element, originator));
} | [
"function",
"(",
"element",
",",
"originator",
")",
"{",
"var",
"zoomTemplate",
"=",
"\"translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )\"",
";",
"var",
"buildZoom",
"=",
"angular",
".",
"bind",
"(",
"null",
",",
"$mdUtil",
".",
"supplant",
",",
... | Calculate the zoom transform from dialog to origin.
We use this to set the dialog position immediately;
then the md-transition-in actually translates back to
`translate3d(0,0,0) scale(1.0)`...
NOTE: all values are rounded to the nearest integer | [
"Calculate",
"the",
"zoom",
"transform",
"from",
"dialog",
"to",
"origin",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/animation/animate.js#L143-L148 | train | Calculate the zoom transform for the element | [
30522,
3853,
1006,
5783,
1010,
4761,
8844,
1007,
1063,
13075,
24095,
18532,
15725,
1027,
1000,
17637,
29097,
1006,
1063,
2415,
2595,
1065,
1052,
2595,
1010,
1063,
2415,
2100,
1065,
1052,
2595,
1010,
1014,
1007,
4094,
1006,
1063,
4094,
2595,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ColorPalette.js | function (sColor) {
var sHexColor = "";
if (!sColor || sColor.toLowerCase().indexOf("hsl") !== -1) {
return undefined;
}
// named color
if (sColor.indexOf("#") === -1) {
return this.NAME_COLORS_TO_RGB_MAP[sColor.toLowerCase()] ? sColor.toLowerCase() : undefined;
}
//HEX value
... | javascript | function (sColor) {
var sHexColor = "";
if (!sColor || sColor.toLowerCase().indexOf("hsl") !== -1) {
return undefined;
}
// named color
if (sColor.indexOf("#") === -1) {
return this.NAME_COLORS_TO_RGB_MAP[sColor.toLowerCase()] ? sColor.toLowerCase() : undefined;
}
//HEX value
... | [
"function",
"(",
"sColor",
")",
"{",
"var",
"sHexColor",
"=",
"\"\"",
";",
"if",
"(",
"!",
"sColor",
"||",
"sColor",
".",
"toLowerCase",
"(",
")",
".",
"indexOf",
"(",
"\"hsl\"",
")",
"!==",
"-",
"1",
")",
"{",
"return",
"undefined",
";",
"}",
"// ... | Returns a named color for given color. For example - "gold" for input "#FFB200".
@param {string} sColor the given color
@return {string|undefined} The named color, if such can really corresponds to the input color, or undefined otherwise. | [
"Returns",
"a",
"named",
"color",
"for",
"given",
"color",
".",
"For",
"example",
"-",
"gold",
"for",
"input",
"#FFB200",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/ColorPalette.js#L922-L944 | train | Returns the named color if it exists otherwise returns undefined | [
30522,
3853,
1006,
8040,
12898,
2099,
1007,
1063,
13075,
2016,
2595,
18717,
1027,
1000,
1000,
1025,
2065,
1006,
999,
8040,
12898,
2099,
1064,
1064,
8040,
12898,
2099,
1012,
2000,
27663,
18992,
3366,
1006,
1007,
1012,
5950,
11253,
1006,
1000... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.m/src/sap/m/TimePickerSlider.js | function (oEvent) {
var iPageY = oEvent.touches && oEvent.touches.length ? oEvent.touches[0].pageY : oEvent.pageY;
this._bIsDrag = false;
if (!this.getIsExpanded()) {
return;
}
this._stopAnimation();
this._startDrag(iPageY);
oEvent.preventDefault();
this._mousedown = true;
} | javascript | function (oEvent) {
var iPageY = oEvent.touches && oEvent.touches.length ? oEvent.touches[0].pageY : oEvent.pageY;
this._bIsDrag = false;
if (!this.getIsExpanded()) {
return;
}
this._stopAnimation();
this._startDrag(iPageY);
oEvent.preventDefault();
this._mousedown = true;
} | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"iPageY",
"=",
"oEvent",
".",
"touches",
"&&",
"oEvent",
".",
"touches",
".",
"length",
"?",
"oEvent",
".",
"touches",
"[",
"0",
"]",
".",
"pageY",
":",
"oEvent",
".",
"pageY",
";",
"this",
".",
"_bIsDrag",... | Default onTouchStart handler.
@param {jQuery.Event} oEvent Event object | [
"Default",
"onTouchStart",
"handler",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/TimePickerSlider.js#L1235-L1248 | train | Dragging the page | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
24531,
3351,
2100,
1027,
1051,
18697,
3372,
1012,
12817,
1004,
1004,
1051,
18697,
3372,
1012,
12817,
1012,
3091,
1029,
1051,
18697,
3372,
1012,
12817,
1031,
1014,
1033,
1012,
3931,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
apache/incubator-echarts | src/data/helper/linkList.js | linkList | function linkList(opt) {
var mainData = opt.mainData;
var datas = opt.datas;
if (!datas) {
datas = {main: mainData};
opt.datasAttr = {main: 'data'};
}
opt.datas = opt.mainData = null;
linkAll(mainData, datas, opt);
// Porxy data original methods.
each(datas, function (... | javascript | function linkList(opt) {
var mainData = opt.mainData;
var datas = opt.datas;
if (!datas) {
datas = {main: mainData};
opt.datasAttr = {main: 'data'};
}
opt.datas = opt.mainData = null;
linkAll(mainData, datas, opt);
// Porxy data original methods.
each(datas, function (... | [
"function",
"linkList",
"(",
"opt",
")",
"{",
"var",
"mainData",
"=",
"opt",
".",
"mainData",
";",
"var",
"datas",
"=",
"opt",
".",
"datas",
";",
"if",
"(",
"!",
"datas",
")",
"{",
"datas",
"=",
"{",
"main",
":",
"mainData",
"}",
";",
"opt",
".",... | Caution: In most case, either list or its shallow clones (see list.cloneShallow) is active in echarts process. So considering heap memory consumption, we do not clone tree or graph, but share them among list and its shallow clones. But in some rare case, we have to keep old list (like do animation in chart). So please ... | [
"Caution",
":",
"In",
"most",
"case",
"either",
"list",
"or",
"its",
"shallow",
"clones",
"(",
"see",
"list",
".",
"cloneShallow",
")",
"is",
"active",
"in",
"echarts",
"process",
".",
"So",
"considering",
"heap",
"memory",
"consumption",
"we",
"do",
"not"... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/data/helper/linkList.js#L49-L80 | train | Link all the methods to the next class. | [
30522,
3853,
4957,
9863,
1006,
23569,
1007,
1063,
13075,
2364,
2850,
2696,
1027,
23569,
1012,
2364,
2850,
2696,
1025,
13075,
2951,
2015,
1027,
23569,
1012,
2951,
2015,
1025,
2065,
1006,
999,
2951,
2015,
1007,
1063,
2951,
2015,
1027,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/protractor | lib/clientsidescripts.js | getNg1Hooks | function getNg1Hooks(selector, injectorPlease) {
function tryEl(el) {
try {
if (!injectorPlease && angular.getTestability) {
var $$testability = angular.getTestability(el);
if ($$testability) {
return {$$testability: $$testability};
}
} else {
var $injector = ... | javascript | function getNg1Hooks(selector, injectorPlease) {
function tryEl(el) {
try {
if (!injectorPlease && angular.getTestability) {
var $$testability = angular.getTestability(el);
if ($$testability) {
return {$$testability: $$testability};
}
} else {
var $injector = ... | [
"function",
"getNg1Hooks",
"(",
"selector",
",",
"injectorPlease",
")",
"{",
"function",
"tryEl",
"(",
"el",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"injectorPlease",
"&&",
"angular",
".",
"getTestability",
")",
"{",
"var",
"$$testability",
"=",
"angular",
"... | /* Tries to find $$testability and possibly $injector for an ng1 app
By default, doesn't care about $injector if it finds $$testability. However,
these priorities can be reversed.
@param {string=} selector The selector for the element with the injector. If
falsy, tries a variety of methods to find an injector
@para... | [
"/",
"*",
"Tries",
"to",
"find",
"$$testability",
"and",
"possibly",
"$injector",
"for",
"an",
"ng1",
"app"
] | 4f74a4ec753c97adfe955fe468a39286a0a55837 | https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/lib/clientsidescripts.js#L75-L115 | train | Returns the first hook element that matches the selector | [
30522,
3853,
2131,
3070,
2487,
6806,
6559,
2015,
1006,
27000,
1010,
1999,
20614,
2953,
10814,
11022,
1007,
1063,
3853,
3046,
2884,
1006,
3449,
1007,
1063,
3046,
1063,
2065,
1006,
999,
1999,
20614,
2953,
10814,
11022,
1004,
1004,
16108,
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... |
heyui/heyui | src/plugins/popper/index.js | isModifierRequired | function isModifierRequired(modifiers, requestingName, requestedName) {
var requesting = find(modifiers, function (_ref) {
var name = _ref.name;
return name === requestingName;
});
var isRequired = !!requesting && modifiers.some(function (modifier) {
return modifier.name === requestedName && modifier... | javascript | function isModifierRequired(modifiers, requestingName, requestedName) {
var requesting = find(modifiers, function (_ref) {
var name = _ref.name;
return name === requestingName;
});
var isRequired = !!requesting && modifiers.some(function (modifier) {
return modifier.name === requestedName && modifier... | [
"function",
"isModifierRequired",
"(",
"modifiers",
",",
"requestingName",
",",
"requestedName",
")",
"{",
"var",
"requesting",
"=",
"find",
"(",
"modifiers",
",",
"function",
"(",
"_ref",
")",
"{",
"var",
"name",
"=",
"_ref",
".",
"name",
";",
"return",
"... | Helper used to know if the given modifier depends from another one.<br />
It checks if the needed modifier is listed and enabled.
@method
@memberof Popper.Utils
@param {Array} modifiers - list of modifiers
@param {String} requestingName - name of requesting modifier
@param {String} requestedName - name of requested mod... | [
"Helper",
"used",
"to",
"know",
"if",
"the",
"given",
"modifier",
"depends",
"from",
"another",
"one",
".",
"<br",
"/",
">",
"It",
"checks",
"if",
"the",
"needed",
"modifier",
"is",
"listed",
"and",
"enabled",
"."
] | d5405d27d994151b676eb91c12b389316d7f6679 | https://github.com/heyui/heyui/blob/d5405d27d994151b676eb91c12b389316d7f6679/src/plugins/popper/index.js#L1365-L1381 | train | Checks if a modifier is required by a particular specification | [
30522,
3853,
2003,
5302,
4305,
8873,
28849,
15549,
5596,
1006,
16913,
28295,
1010,
17942,
18442,
1010,
7303,
18442,
1007,
1063,
13075,
17942,
1027,
2424,
1006,
16913,
28295,
1010,
3853,
1006,
1035,
25416,
1007,
1063,
13075,
2171,
1027,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
LLK/scratch-blocks | blocks_vertical/sound.js | function() {
this.jsonInit({
"message0": Blockly.Msg.SOUND_SETEFFECTO,
"args0": [
{
"type": "field_dropdown",
"name": "EFFECT",
"options": [
[Blockly.Msg.SOUND_EFFECTS_PITCH, 'PITCH'],
[Blockly.Msg.SOUND_EFFECTS_PAN, 'PAN']
]
... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.SOUND_SETEFFECTO,
"args0": [
{
"type": "field_dropdown",
"name": "EFFECT",
"options": [
[Blockly.Msg.SOUND_EFFECTS_PITCH, 'PITCH'],
[Blockly.Msg.SOUND_EFFECTS_PAN, 'PAN']
]
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"SOUND_SETEFFECTO",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"EFFECT\"",
",",
"\"options\"",... | Block to set the audio effect
@this Blockly.Block | [
"Block",
"to",
"set",
"the",
"audio",
"effect"
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/sound.js#L126-L146 | train | Block for the segfault section. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
2614,
1035,
2275,
12879,
25969,
2080,
1010,
1000,
12098,
5620,
2692,
1000,
1024,
1031,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/AutoUpdate/main.js | handleInstallationStatus | function handleInstallationStatus(statusObj) {
var errorCode = "",
errorline = statusObj.installError;
if (errorline) {
errorCode = errorline.substr(errorline.lastIndexOf(':') + 2, errorline.length);
}
HealthLogger.sendAnalyticsData(
autoUpdateEventNam... | javascript | function handleInstallationStatus(statusObj) {
var errorCode = "",
errorline = statusObj.installError;
if (errorline) {
errorCode = errorline.substr(errorline.lastIndexOf(':') + 2, errorline.length);
}
HealthLogger.sendAnalyticsData(
autoUpdateEventNam... | [
"function",
"handleInstallationStatus",
"(",
"statusObj",
")",
"{",
"var",
"errorCode",
"=",
"\"\"",
",",
"errorline",
"=",
"statusObj",
".",
"installError",
";",
"if",
"(",
"errorline",
")",
"{",
"errorCode",
"=",
"errorline",
".",
"substr",
"(",
"errorline",... | Send Installer Error Code to Analytics Server | [
"Send",
"Installer",
"Error",
"Code",
"to",
"Analytics",
"Server"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L266-L279 | train | Handle installation status | [
30522,
3853,
5047,
7076,
9080,
13490,
9153,
5809,
1006,
3570,
16429,
3501,
1007,
1063,
13075,
7561,
16044,
1027,
1000,
1000,
1010,
7561,
4179,
1027,
3570,
16429,
3501,
1012,
16500,
2121,
29165,
1025,
2065,
1006,
7561,
4179,
1007,
1063,
7561... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/routing/async/Target.js | function (oParentInfo) {
var oOptions = this._oOptions,
oControl = oParentInfo && oParentInfo.control,
bHasTargetControl = (oControl || oOptions.controlId),
bIsValid = true,
sLogMessage = "";
if (!bHasTargetControl) {
sLogMessage = "The target " + oOptions._name + " has no controlId set and n... | javascript | function (oParentInfo) {
var oOptions = this._oOptions,
oControl = oParentInfo && oParentInfo.control,
bHasTargetControl = (oControl || oOptions.controlId),
bIsValid = true,
sLogMessage = "";
if (!bHasTargetControl) {
sLogMessage = "The target " + oOptions._name + " has no controlId set and n... | [
"function",
"(",
"oParentInfo",
")",
"{",
"var",
"oOptions",
"=",
"this",
".",
"_oOptions",
",",
"oControl",
"=",
"oParentInfo",
"&&",
"oParentInfo",
".",
"control",
",",
"bHasTargetControl",
"=",
"(",
"oControl",
"||",
"oOptions",
".",
"controlId",
")",
","... | Validates the target options, will also be called from the route but route will not log errors
@param oParentInfo
@returns {boolean|string} returns true if it's valid otherwise the error message
@private | [
"Validates",
"the",
"target",
"options",
"will",
"also",
"be",
"called",
"from",
"the",
"route",
"but",
"route",
"will",
"not",
"log",
"errors"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/async/Target.js#L277-L299 | train | Checks if the target has a control and if so logs an error. | [
30522,
3853,
1006,
6728,
12069,
16778,
2078,
14876,
30524,
13181,
2140,
1027,
1006,
1051,
8663,
13181,
2140,
1064,
1064,
1051,
7361,
9285,
1012,
2491,
3593,
1007,
1010,
20377,
10175,
3593,
1027,
2995,
1010,
22889,
8649,
7834,
3736,
3351,
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... | |
expressjs/express | lib/router/index.js | getProtohost | function getProtohost(url) {
if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {
return undefined
}
var searchIndex = url.indexOf('?')
var pathLength = searchIndex !== -1
? searchIndex
: url.length
var fqdnIndex = url.substr(0, pathLength).indexOf('://')
return fqdnIndex !== -... | javascript | function getProtohost(url) {
if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {
return undefined
}
var searchIndex = url.indexOf('?')
var pathLength = searchIndex !== -1
? searchIndex
: url.length
var fqdnIndex = url.substr(0, pathLength).indexOf('://')
return fqdnIndex !== -... | [
"function",
"getProtohost",
"(",
"url",
")",
"{",
"if",
"(",
"typeof",
"url",
"!==",
"'string'",
"||",
"url",
".",
"length",
"===",
"0",
"||",
"url",
"[",
"0",
"]",
"===",
"'/'",
")",
"{",
"return",
"undefined",
"}",
"var",
"searchIndex",
"=",
"url",... | Get get protocol + host for a URL | [
"Get",
"get",
"protocol",
"+",
"host",
"for",
"a",
"URL"
] | dc538f6e810bd462c98ee7e6aae24c64d4b1da93 | https://github.com/expressjs/express/blob/dc538f6e810bd462c98ee7e6aae24c64d4b1da93/lib/router/index.js#L535-L549 | train | Get the protocol of the given url | [
30522,
3853,
2131,
21572,
3406,
15006,
2102,
1006,
24471,
2140,
1007,
1063,
2065,
1006,
2828,
11253,
24471,
2140,
999,
1027,
1027,
1005,
5164,
1005,
1064,
1064,
24471,
2140,
1012,
3091,
1027,
1027,
1027,
1014,
1064,
1064,
24471,
2140,
1031,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-unused-vars.js | getFunctionDefinitions | function getFunctionDefinitions(variable) {
const functionDefinitions = [];
variable.defs.forEach(def => {
const { type, node } = def;
// FunctionDeclarations
if (type === "FunctionName") {
functionDefinitions.push(node);
... | javascript | function getFunctionDefinitions(variable) {
const functionDefinitions = [];
variable.defs.forEach(def => {
const { type, node } = def;
// FunctionDeclarations
if (type === "FunctionName") {
functionDefinitions.push(node);
... | [
"function",
"getFunctionDefinitions",
"(",
"variable",
")",
"{",
"const",
"functionDefinitions",
"=",
"[",
"]",
";",
"variable",
".",
"defs",
".",
"forEach",
"(",
"def",
"=>",
"{",
"const",
"{",
"type",
",",
"node",
"}",
"=",
"def",
";",
"// FunctionDeclar... | Gets a list of function definitions for a specified variable.
@param {Variable} variable - eslint-scope variable object.
@returns {ASTNode[]} Function nodes.
@private | [
"Gets",
"a",
"list",
"of",
"function",
"definitions",
"for",
"a",
"specified",
"variable",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-unused-vars.js#L233-L251 | train | Get Function Definitions | [
30522,
3853,
2131,
11263,
27989,
3207,
16294,
22753,
2015,
1006,
8023,
1007,
1063,
9530,
3367,
3853,
3207,
16294,
22753,
2015,
1027,
1031,
1033,
1025,
8023,
1012,
13366,
2015,
1012,
18921,
6776,
1006,
13366,
1027,
1028,
1063,
9530,
3367,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/UpdateNotification.js | _getVersionInfoUrl | function _getVersionInfoUrl(locale, removeCountryPartOfLocale) {
locale = locale || brackets.getLocale();
if (removeCountryPartOfLocale) {
locale = locale.substring(0, 2);
}
//AUTOUPDATE_PRERELEASE_BEGIN
// The following code is needed for supporting Auto Update in... | javascript | function _getVersionInfoUrl(locale, removeCountryPartOfLocale) {
locale = locale || brackets.getLocale();
if (removeCountryPartOfLocale) {
locale = locale.substring(0, 2);
}
//AUTOUPDATE_PRERELEASE_BEGIN
// The following code is needed for supporting Auto Update in... | [
"function",
"_getVersionInfoUrl",
"(",
"locale",
",",
"removeCountryPartOfLocale",
")",
"{",
"locale",
"=",
"locale",
"||",
"brackets",
".",
"getLocale",
"(",
")",
";",
"if",
"(",
"removeCountryPartOfLocale",
")",
"{",
"locale",
"=",
"locale",
".",
"substring",
... | Construct a new version update url with the given locale.
@param {string=} locale - optional locale, defaults to 'brackets.getLocale()' when omitted.
@param {boolean=} removeCountryPartOfLocale - optional, remove existing country information from locale 'en-gb' => 'en'
return {string} the new version update url | [
"Construct",
"a",
"new",
"version",
"update",
"url",
"with",
"the",
"given",
"locale",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/UpdateNotification.js#L110-L145 | train | Get the version info url | [
30522,
3853,
1035,
2131,
27774,
2378,
14876,
3126,
2140,
1006,
2334,
2063,
1010,
6366,
3597,
16671,
2854,
19362,
3406,
10258,
24755,
2571,
1007,
1063,
2334,
2063,
1027,
2334,
2063,
1064,
1064,
19719,
1012,
2131,
4135,
9289,
2063,
1006,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/context/ContextManager.js | function (aContextObjects) {
var aDesignTimeContextIdsByUrl = this._getContextIdsFromUrl();
if (aDesignTimeContextIdsByUrl.length === 0) {
// [default: runtime] use runtime contexts
return this._getContextParametersFromAPI(aContextObjects)
.then(this._getActiveContextsByAPIParameters.bind(this, aCon... | javascript | function (aContextObjects) {
var aDesignTimeContextIdsByUrl = this._getContextIdsFromUrl();
if (aDesignTimeContextIdsByUrl.length === 0) {
// [default: runtime] use runtime contexts
return this._getContextParametersFromAPI(aContextObjects)
.then(this._getActiveContextsByAPIParameters.bind(this, aCon... | [
"function",
"(",
"aContextObjects",
")",
"{",
"var",
"aDesignTimeContextIdsByUrl",
"=",
"this",
".",
"_getContextIdsFromUrl",
"(",
")",
";",
"if",
"(",
"aDesignTimeContextIdsByUrl",
".",
"length",
"===",
"0",
")",
"{",
"// [default: runtime] use runtime contexts",
"re... | Helper to filter passed context objects.
This method loops over each context object and check for its current validity
@param {sap.ui.fl.Context[]} aContextObjects - context objects within the application
@returns {Promise|string[]} aActiveContexts - Promise returning or direct build array containing ids of context ob... | [
"Helper",
"to",
"filter",
"passed",
"context",
"objects",
".",
"This",
"method",
"loops",
"over",
"each",
"context",
"object",
"and",
"check",
"for",
"its",
"current",
"validity"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/context/ContextManager.js#L59-L70 | train | Returns a promise that resolves to the active contexts | [
30522,
3853,
1006,
9353,
28040,
18413,
16429,
20614,
2015,
1007,
1063,
13075,
4748,
2229,
23773,
7292,
8663,
18209,
9821,
3762,
3126,
2140,
1027,
2023,
1012,
1035,
2131,
8663,
18209,
9821,
19699,
5358,
3126,
2140,
1006,
1007,
1025,
2065,
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... | |
angular/material | src/components/tabs/js/tabsController.js | updateTabOrder | function updateTabOrder () {
var selectedItem = ctrl.tabs[ ctrl.selectedIndex ],
focusItem = ctrl.tabs[ ctrl.focusIndex ];
ctrl.tabs = ctrl.tabs.sort(function (a, b) {
return a.index - b.index;
});
ctrl.selectedIndex = ctrl.tabs.indexOf(selectedItem);
ctrl.focusIndex ... | javascript | function updateTabOrder () {
var selectedItem = ctrl.tabs[ ctrl.selectedIndex ],
focusItem = ctrl.tabs[ ctrl.focusIndex ];
ctrl.tabs = ctrl.tabs.sort(function (a, b) {
return a.index - b.index;
});
ctrl.selectedIndex = ctrl.tabs.indexOf(selectedItem);
ctrl.focusIndex ... | [
"function",
"updateTabOrder",
"(",
")",
"{",
"var",
"selectedItem",
"=",
"ctrl",
".",
"tabs",
"[",
"ctrl",
".",
"selectedIndex",
"]",
",",
"focusItem",
"=",
"ctrl",
".",
"tabs",
"[",
"ctrl",
".",
"focusIndex",
"]",
";",
"ctrl",
".",
"tabs",
"=",
"ctrl"... | Re-orders the tabs and updates the selected and focus indexes to their new positions.
This is triggered by `tabDirective.js` when the user's tabs have been re-ordered. | [
"Re",
"-",
"orders",
"the",
"tabs",
"and",
"updates",
"the",
"selected",
"and",
"focus",
"indexes",
"to",
"their",
"new",
"positions",
".",
"This",
"is",
"triggered",
"by",
"tabDirective",
".",
"js",
"when",
"the",
"user",
"s",
"tabs",
"have",
"been",
"r... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L679-L687 | train | Update tab order | [
30522,
3853,
10651,
2696,
12821,
4063,
1006,
1007,
1063,
13075,
3479,
4221,
2213,
1027,
14931,
12190,
1012,
21628,
2015,
1031,
14931,
12190,
1012,
3479,
22254,
10288,
1033,
1010,
3579,
4221,
2213,
1027,
14931,
12190,
1012,
21628,
2015,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | getTimeoutTime | function getTimeoutTime(timeout) {
var now = new Date().getTime();
var timeoutLength = parseInt(timeout);
if (isNaN(timeoutLength)) {
throw new SeleniumError("Timeout is not a number: '" + timeout + "'");
}
return now + timeoutLength;
} | javascript | function getTimeoutTime(timeout) {
var now = new Date().getTime();
var timeoutLength = parseInt(timeout);
if (isNaN(timeoutLength)) {
throw new SeleniumError("Timeout is not a number: '" + timeout + "'");
}
return now + timeoutLength;
} | [
"function",
"getTimeoutTime",
"(",
"timeout",
")",
"{",
"var",
"now",
"=",
"new",
"Date",
"(",
")",
".",
"getTime",
"(",
")",
";",
"var",
"timeoutLength",
"=",
"parseInt",
"(",
"timeout",
")",
";",
"if",
"(",
"isNaN",
"(",
"timeoutLength",
")",
")",
... | Returns the absolute time represented as an offset of the current time.
Throws a SeleniumException if timeout is invalid.
@param timeout the number of milliseconds from "now" whose absolute time
to return | [
"Returns",
"the",
"absolute",
"time",
"represented",
"as",
"an",
"offset",
"of",
"the",
"current",
"time",
".",
"Throws",
"a",
"SeleniumException",
"if",
"timeout",
"is",
"invalid",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L943-L952 | train | Get timeout time | [
30522,
3853,
2131,
7292,
5833,
7292,
1006,
2051,
5833,
1007,
1063,
13075,
2085,
1027,
2047,
3058,
1006,
1007,
1012,
2131,
7292,
1006,
1007,
1025,
13075,
2051,
5833,
7770,
13512,
2232,
1027,
11968,
20240,
3372,
1006,
2051,
5833,
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... |
laurent22/joplin | Clipper/joplin-webclipper/content_scripts/Readability.js | function(e, tag) {
if (!this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY))
return;
var isList = tag === "ul" || tag === "ol";
// Gather counts for other typical elements embedded within.
// Traverse backwards so we can remove nodes at the same time
// without effecting the traversal.
//
... | javascript | function(e, tag) {
if (!this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY))
return;
var isList = tag === "ul" || tag === "ol";
// Gather counts for other typical elements embedded within.
// Traverse backwards so we can remove nodes at the same time
// without effecting the traversal.
//
... | [
"function",
"(",
"e",
",",
"tag",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_flagIsActive",
"(",
"this",
".",
"FLAG_CLEAN_CONDITIONALLY",
")",
")",
"return",
";",
"var",
"isList",
"=",
"tag",
"===",
"\"ul\"",
"||",
"tag",
"===",
"\"ol\"",
";",
"// Gather... | Clean an element of all tags of type "tag" if they look fishy.
"Fishy" is an algorithm based on content length, classnames, link density, number of images & embeds, etc.
@return void | [
"Clean",
"an",
"element",
"of",
"all",
"tags",
"of",
"type",
"tag",
"if",
"they",
"look",
"fishy",
".",
"Fishy",
"is",
"an",
"algorithm",
"based",
"on",
"content",
"length",
"classnames",
"link",
"density",
"number",
"of",
"images",
"&",
"embeds",
"etc",
... | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/Clipper/joplin-webclipper/content_scripts/Readability.js#L1593-L1654 | train | Remove the elements that are not in the conditionally list. | [
30522,
3853,
1006,
1041,
1010,
6415,
1007,
1063,
2065,
1006,
999,
2023,
1012,
1035,
5210,
14268,
15277,
1006,
2023,
1012,
5210,
1035,
4550,
1035,
18462,
2135,
1007,
1007,
2709,
1025,
13075,
2003,
9863,
1027,
6415,
1027,
1027,
1027,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | xlsx.js | parse_DataSpaceMapEntry | function parse_DataSpaceMapEntry(blob) {
var len = blob.read_shift(4);
var end = blob.l + len - 4;
var o = {};
var cnt = blob.read_shift(4);
var comps = [];
/* [MS-OFFCRYPTO] 2.1.6.2 DataSpaceReferenceComponent Structure */
while(cnt-- > 0) comps.push({ t: blob.read_shift(4), v: blob.read_shift(0, 'lpp4') });
o... | javascript | function parse_DataSpaceMapEntry(blob) {
var len = blob.read_shift(4);
var end = blob.l + len - 4;
var o = {};
var cnt = blob.read_shift(4);
var comps = [];
/* [MS-OFFCRYPTO] 2.1.6.2 DataSpaceReferenceComponent Structure */
while(cnt-- > 0) comps.push({ t: blob.read_shift(4), v: blob.read_shift(0, 'lpp4') });
o... | [
"function",
"parse_DataSpaceMapEntry",
"(",
"blob",
")",
"{",
"var",
"len",
"=",
"blob",
".",
"read_shift",
"(",
"4",
")",
";",
"var",
"end",
"=",
"blob",
".",
"l",
"+",
"len",
"-",
"4",
";",
"var",
"o",
"=",
"{",
"}",
";",
"var",
"cnt",
"=",
"... | /* [MS-OFFCRYPTO] 2.1.6.1 DataSpaceMapEntry Structure | [
"/",
"*",
"[",
"MS",
"-",
"OFFCRYPTO",
"]",
"2",
".",
"1",
".",
"6",
".",
"1",
"DataSpaceMapEntry",
"Structure"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L8141-L8153 | train | Parse a DataSpaceMapEntry | [
30522,
3853,
11968,
3366,
1035,
2951,
23058,
2863,
11837,
11129,
1006,
1038,
4135,
2497,
1007,
1063,
13075,
18798,
1027,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1018,
1007,
1025,
13075,
2203,
1027,
1038,
4135,
2497,
1012,
1048,
1009... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mdn/browser-compat-data | scripts/render.js | writeSupportCells | function writeSupportCells(supportData, compatNotes, browserPlatformType) {
let output = '';
for (let browserNameKey of Object.keys(browsers[browserPlatformType])) {
let support = supportData[browserNameKey];
let supportInfo = '';
// if supportData is an array, there are multiple support statements
... | javascript | function writeSupportCells(supportData, compatNotes, browserPlatformType) {
let output = '';
for (let browserNameKey of Object.keys(browsers[browserPlatformType])) {
let support = supportData[browserNameKey];
let supportInfo = '';
// if supportData is an array, there are multiple support statements
... | [
"function",
"writeSupportCells",
"(",
"supportData",
",",
"compatNotes",
",",
"browserPlatformType",
")",
"{",
"let",
"output",
"=",
"''",
";",
"for",
"(",
"let",
"browserNameKey",
"of",
"Object",
".",
"keys",
"(",
"browsers",
"[",
"browserPlatformType",
"]",
... | /*
For a single row, write all the cells that contain support data.
(That is, every cell in the row except the first, which contains
an identifier for the row, like "Basic support". | [
"/",
"*",
"For",
"a",
"single",
"row",
"write",
"all",
"the",
"cells",
"that",
"contain",
"support",
"data",
".",
"(",
"That",
"is",
"every",
"cell",
"in",
"the",
"row",
"except",
"the",
"first",
"which",
"contains",
"an",
"identifier",
"for",
"the",
"... | 6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b | https://github.com/mdn/browser-compat-data/blob/6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b/scripts/render.js#L333-L352 | train | Writes support cells | [
30522,
3853,
7009,
6279,
6442,
29109,
4877,
1006,
2490,
2850,
2696,
1010,
4012,
4502,
2102,
20564,
1010,
16602,
24759,
4017,
14192,
13874,
1007,
1063,
2292,
6434,
1027,
1005,
1005,
1025,
2005,
1006,
2292,
16602,
18442,
14839,
1997,
4874,
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... |
knsv/mermaid | src/diagrams/git/gitGraphRenderer.js | getElementCoords | function getElementCoords (element, coords) {
coords = coords || element.node().getBBox()
const ctm = element.node().getCTM()
const xn = ctm.e + coords.x * ctm.a
const yn = ctm.f + coords.y * ctm.d
return {
left: xn,
top: yn,
width: coords.width,
height: coords.height
}
} | javascript | function getElementCoords (element, coords) {
coords = coords || element.node().getBBox()
const ctm = element.node().getCTM()
const xn = ctm.e + coords.x * ctm.a
const yn = ctm.f + coords.y * ctm.d
return {
left: xn,
top: yn,
width: coords.width,
height: coords.height
}
} | [
"function",
"getElementCoords",
"(",
"element",
",",
"coords",
")",
"{",
"coords",
"=",
"coords",
"||",
"element",
".",
"node",
"(",
")",
".",
"getBBox",
"(",
")",
"const",
"ctm",
"=",
"element",
".",
"node",
"(",
")",
".",
"getCTM",
"(",
")",
"const... | Pass in the element and its pre-transform coords | [
"Pass",
"in",
"the",
"element",
"and",
"its",
"pre",
"-",
"transform",
"coords"
] | 7d3578b31aeea3bc9bbc618dcda57d82574eaffb | https://github.com/knsv/mermaid/blob/7d3578b31aeea3bc9bbc618dcda57d82574eaffb/src/diagrams/git/gitGraphRenderer.js#L76-L87 | train | Get element s bounding box | [
30522,
3853,
2131,
12260,
3672,
3597,
8551,
2015,
1006,
5783,
1010,
2522,
8551,
2015,
1007,
1063,
2522,
8551,
2015,
1027,
2522,
8551,
2015,
1064,
1064,
5783,
1012,
13045,
1006,
1007,
1012,
2131,
10322,
11636,
1006,
1007,
9530,
3367,
14931,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laurent22/joplin | Clipper/joplin-webclipper/content_scripts/Readability.js | function(node, ignoreSelfAndKids) {
// First check for kids if those aren't being ignored
if (!ignoreSelfAndKids && node.firstElementChild) {
return node.firstElementChild;
}
// Then for siblings...
if (node.nextElementSibling) {
return node.nextElementSibling;
}
// And finally, ... | javascript | function(node, ignoreSelfAndKids) {
// First check for kids if those aren't being ignored
if (!ignoreSelfAndKids && node.firstElementChild) {
return node.firstElementChild;
}
// Then for siblings...
if (node.nextElementSibling) {
return node.nextElementSibling;
}
// And finally, ... | [
"function",
"(",
"node",
",",
"ignoreSelfAndKids",
")",
"{",
"// First check for kids if those aren't being ignored",
"if",
"(",
"!",
"ignoreSelfAndKids",
"&&",
"node",
".",
"firstElementChild",
")",
"{",
"return",
"node",
".",
"firstElementChild",
";",
"}",
"// Then ... | Traverse the DOM from node to node, starting at the node passed in.
Pass true for the second parameter to indicate this node itself
(and its kids) are going away, and we want the next node over.
Calling this in a loop will traverse the DOM depth-first. | [
"Traverse",
"the",
"DOM",
"from",
"node",
"to",
"node",
"starting",
"at",
"the",
"node",
"passed",
"in",
".",
"Pass",
"true",
"for",
"the",
"second",
"parameter",
"to",
"indicate",
"this",
"node",
"itself",
"(",
"and",
"its",
"kids",
")",
"are",
"going",... | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/Clipper/joplin-webclipper/content_scripts/Readability.js#L676-L692 | train | Returns the first child of node | [
30522,
3853,
1006,
13045,
1010,
26663,
2884,
15143,
2094,
3211,
5104,
1007,
1063,
1013,
1013,
2034,
4638,
2005,
4268,
2065,
2216,
4995,
1005,
1056,
2108,
6439,
2065,
1006,
999,
26663,
2884,
15143,
2094,
3211,
5104,
1004,
1004,
13045,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/routing/History.js | function(oHashChanger) {
this._iHistoryLength = window.history.length;
this.aHistory = [];
this._bIsInitial = true;
if (!Device.browser.msie) { // the state information isn't used for IE
// because it doesn't clear the state after new hash is set
var oState = window.history.state === null ? {} : window.h... | javascript | function(oHashChanger) {
this._iHistoryLength = window.history.length;
this.aHistory = [];
this._bIsInitial = true;
if (!Device.browser.msie) { // the state information isn't used for IE
// because it doesn't clear the state after new hash is set
var oState = window.history.state === null ? {} : window.h... | [
"function",
"(",
"oHashChanger",
")",
"{",
"this",
".",
"_iHistoryLength",
"=",
"window",
".",
"history",
".",
"length",
";",
"this",
".",
"aHistory",
"=",
"[",
"]",
";",
"this",
".",
"_bIsInitial",
"=",
"true",
";",
"if",
"(",
"!",
"Device",
".",
"b... | Used to determine the {@link sap.ui.core.routing.HistoryDirection} of the current or a future navigation,
done with a {@link sap.ui.core.routing.Router} or {@link sap.ui.core.routing.HashChanger}.
<strong>ATTENTION:</strong> this class will not be accurate if someone does hash-replacement without the named classes abo... | [
"Used",
"to",
"determine",
"the",
"{",
"@link",
"sap",
".",
"ui",
".",
"core",
".",
"routing",
".",
"HistoryDirection",
"}",
"of",
"the",
"current",
"or",
"a",
"future",
"navigation",
"done",
"with",
"a",
"{",
"@link",
"sap",
".",
"ui",
".",
"core",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/History.js#L26-L52 | train | Sets the history to the current location | [
30522,
3853,
1006,
2821,
11823,
22305,
2121,
1007,
1063,
2023,
1012,
1035,
1045,
24158,
7062,
7770,
13512,
2232,
1027,
3332,
1012,
2381,
1012,
3091,
1025,
2023,
1012,
6289,
20483,
2854,
1027,
1031,
1033,
1025,
2023,
1012,
1035,
20377,
5498,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
tailwindcss/tailwindcss | src/cli/commands/build.js | stopWithHelp | function stopWithHelp(...msgs) {
utils.header()
utils.error(...msgs)
commands.help.forCommand(commands.build)
utils.die()
} | javascript | function stopWithHelp(...msgs) {
utils.header()
utils.error(...msgs)
commands.help.forCommand(commands.build)
utils.die()
} | [
"function",
"stopWithHelp",
"(",
"...",
"msgs",
")",
"{",
"utils",
".",
"header",
"(",
")",
"utils",
".",
"error",
"(",
"...",
"msgs",
")",
"commands",
".",
"help",
".",
"forCommand",
"(",
"commands",
".",
"build",
")",
"utils",
".",
"die",
"(",
")",... | Prints the error message and help for this command, then stops the process.
@param {...string} [msgs] | [
"Prints",
"the",
"error",
"message",
"and",
"help",
"for",
"this",
"command",
"then",
"stops",
"the",
"process",
"."
] | 5066a1e97b3f06b899a4539767ca2bee4bde2da9 | https://github.com/tailwindcss/tailwindcss/blob/5066a1e97b3f06b899a4539767ca2bee4bde2da9/src/cli/commands/build.js#L53-L58 | train | Stop with help | [
30522,
3853,
2644,
24415,
16001,
2361,
1006,
1012,
1012,
1012,
5796,
5620,
1007,
1063,
21183,
12146,
1012,
20346,
1006,
1007,
21183,
12146,
1012,
7561,
1006,
1012,
1012,
1012,
5796,
5620,
1007,
10954,
1012,
2393,
1012,
2005,
9006,
2386,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/AppCacheBuster.js | function(sBaseUrl, oSyncPoint) {
// determine the index
var mIndex = oSession.index;
// the request object
var oRequest;
var sUrl;
var sAbsoluteBaseUrl;
// in case of an incoming array we register each base url on its own
// except in case of the batch mode => there we pass all URLs in a POST request... | javascript | function(sBaseUrl, oSyncPoint) {
// determine the index
var mIndex = oSession.index;
// the request object
var oRequest;
var sUrl;
var sAbsoluteBaseUrl;
// in case of an incoming array we register each base url on its own
// except in case of the batch mode => there we pass all URLs in a POST request... | [
"function",
"(",
"sBaseUrl",
",",
"oSyncPoint",
")",
"{",
"// determine the index",
"var",
"mIndex",
"=",
"oSession",
".",
"index",
";",
"// the request object",
"var",
"oRequest",
";",
"var",
"sUrl",
";",
"var",
"sAbsoluteBaseUrl",
";",
"// in case of an incoming a... | internal registration function (with SyncPoint usage) | [
"internal",
"registration",
"function",
"(",
"with",
"SyncPoint",
"usage",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/AppCacheBuster.js#L96-L252 | train | This function is called by the server to register the base urls | [
30522,
3853,
1006,
24829,
11022,
3126,
2140,
1010,
9808,
6038,
21906,
25785,
1007,
1063,
1013,
1013,
5646,
1996,
5950,
13075,
2568,
10288,
1027,
9808,
7971,
3258,
1012,
5950,
1025,
1013,
1013,
1996,
5227,
4874,
13075,
10848,
15500,
1025,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.unified/src/sap/ui/unified/CalendarMonthInterval.js | _showYearPicker | function _showYearPicker(){
var oDate = this._getFocusedDate();
var oYearPicker = this.getAggregation("yearPicker");
if (oYearPicker.getDomRef()) {
// already rendered
oYearPicker.$().css("display", "");
} else {
var oRm = sap.ui.getCore().createRenderManager();
var $Container = this.$("content");... | javascript | function _showYearPicker(){
var oDate = this._getFocusedDate();
var oYearPicker = this.getAggregation("yearPicker");
if (oYearPicker.getDomRef()) {
// already rendered
oYearPicker.$().css("display", "");
} else {
var oRm = sap.ui.getCore().createRenderManager();
var $Container = this.$("content");... | [
"function",
"_showYearPicker",
"(",
")",
"{",
"var",
"oDate",
"=",
"this",
".",
"_getFocusedDate",
"(",
")",
";",
"var",
"oYearPicker",
"=",
"this",
".",
"getAggregation",
"(",
"\"yearPicker\"",
")",
";",
"if",
"(",
"oYearPicker",
".",
"getDomRef",
"(",
")... | Opens the year picker.
This function assumes its called when a yearPicker aggregation is available, so the caller must take care for it.
@private
@returns {void} | [
"Opens",
"the",
"year",
"picker",
".",
"This",
"function",
"assumes",
"its",
"called",
"when",
"a",
"yearPicker",
"aggregation",
"is",
"available",
"so",
"the",
"caller",
"must",
"take",
"care",
"for",
"it",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.unified/src/sap/ui/unified/CalendarMonthInterval.js#L1074-L1103 | train | show year picker | [
30522,
3853,
1035,
2265,
29100,
24330,
5484,
1006,
1007,
1063,
13075,
1051,
13701,
1027,
2023,
1012,
1035,
2131,
14876,
7874,
22367,
3686,
1006,
1007,
1025,
13075,
1051,
29100,
24330,
5484,
1027,
2023,
1012,
2131,
8490,
17603,
12540,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/table/tableDataHandler.js | findColMergedLastIndex | function findColMergedLastIndex(tableData, rowIndex, colIndex) {
const cellData = tableData[rowIndex][colIndex];
let foundColIndex = colIndex;
if (cellData.colspan > 1) {
foundColIndex += cellData.colspan - 1;
}
return foundColIndex;
} | javascript | function findColMergedLastIndex(tableData, rowIndex, colIndex) {
const cellData = tableData[rowIndex][colIndex];
let foundColIndex = colIndex;
if (cellData.colspan > 1) {
foundColIndex += cellData.colspan - 1;
}
return foundColIndex;
} | [
"function",
"findColMergedLastIndex",
"(",
"tableData",
",",
"rowIndex",
",",
"colIndex",
")",
"{",
"const",
"cellData",
"=",
"tableData",
"[",
"rowIndex",
"]",
"[",
"colIndex",
"]",
";",
"let",
"foundColIndex",
"=",
"colIndex",
";",
"if",
"(",
"cellData",
"... | Find last index of col merged cells.
@param {Array.<Array.<object>>} tableData - tableData data
@param {number} rowIndex - row index of base data
@param {number} colIndex - column index of tabld data
@returns {number}
@ignore | [
"Find",
"last",
"index",
"of",
"col",
"merged",
"cells",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/tableDataHandler.js#L302-L311 | train | Find the last index of a cell in a table | [
30522,
3853,
2424,
25778,
5017,
5999,
8523,
7629,
3207,
2595,
1006,
2795,
2850,
2696,
1010,
5216,
22254,
10288,
1010,
6972,
3207,
2595,
1007,
1063,
9530,
3367,
3526,
2850,
2696,
1027,
2795,
2850,
2696,
1031,
5216,
22254,
10288,
1033,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Manifest.js | function() {
// afterwards we load our dependencies!
var oDep = this.getEntry("/sap.ui5/dependencies"),
sComponentName = this.getComponentName();
if (oDep) {
// load the libraries
var mLibraries = oDep["libs"];
if (mLibraries) {
for (var sLib in mLibraries) {
if (!mLibraries[sLib]... | javascript | function() {
// afterwards we load our dependencies!
var oDep = this.getEntry("/sap.ui5/dependencies"),
sComponentName = this.getComponentName();
if (oDep) {
// load the libraries
var mLibraries = oDep["libs"];
if (mLibraries) {
for (var sLib in mLibraries) {
if (!mLibraries[sLib]... | [
"function",
"(",
")",
"{",
"// afterwards we load our dependencies!",
"var",
"oDep",
"=",
"this",
".",
"getEntry",
"(",
"\"/sap.ui5/dependencies\"",
")",
",",
"sComponentName",
"=",
"this",
".",
"getComponentName",
"(",
")",
";",
"if",
"(",
"oDep",
")",
"{",
"... | Load external dependencies (like libraries and components)
@private | [
"Load",
"external",
"dependencies",
"(",
"like",
"libraries",
"and",
"components",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Manifest.js#L496-L542 | train | Loads the component dependencies | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
5728,
2057,
7170,
2256,
12530,
15266,
999,
13075,
24040,
2361,
1027,
2023,
1012,
2131,
4765,
2854,
1006,
1000,
1013,
20066,
1012,
21318,
2629,
1013,
12530,
15266,
1000,
1007,
1010,
8040,
25377,
564... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/search/QuickOpen.js | extractCursorPos | function extractCursorPos(query) {
var regInfo = query.match(CURSOR_POS_EXP);
if (query.length <= 1 || !regInfo ||
(regInfo[1] && isNaN(regInfo[1])) ||
(regInfo[3] && isNaN(regInfo[3]))) {
return null;
}
return {
query: regInfo[... | javascript | function extractCursorPos(query) {
var regInfo = query.match(CURSOR_POS_EXP);
if (query.length <= 1 || !regInfo ||
(regInfo[1] && isNaN(regInfo[1])) ||
(regInfo[3] && isNaN(regInfo[3]))) {
return null;
}
return {
query: regInfo[... | [
"function",
"extractCursorPos",
"(",
"query",
")",
"{",
"var",
"regInfo",
"=",
"query",
".",
"match",
"(",
"CURSOR_POS_EXP",
")",
";",
"if",
"(",
"query",
".",
"length",
"<=",
"1",
"||",
"!",
"regInfo",
"||",
"(",
"regInfo",
"[",
"1",
"]",
"&&",
"isN... | Attempts to extract a line number from the query where the line number
is followed by a colon. Callers should explicitly test result with isNaN()
@param {string} query string to extract line number from
@return {{query: string, local: boolean, line: number, ch: number}} An object with
the extracted line and column num... | [
"Attempts",
"to",
"extract",
"a",
"line",
"number",
"from",
"the",
"query",
"where",
"the",
"line",
"number",
"is",
"followed",
"by",
"a",
"colon",
".",
"Callers",
"should",
"explicitly",
"test",
"result",
"with",
"isNaN",
"()"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/QuickOpen.js#L299-L315 | train | Extract cursor pos from query | [
30522,
3853,
14817,
10841,
25301,
14536,
2891,
1006,
23032,
1007,
1063,
13075,
19723,
2378,
14876,
1027,
23032,
1012,
2674,
1006,
12731,
25301,
2099,
1035,
13433,
2015,
1035,
4654,
2361,
1007,
1025,
2065,
1006,
23032,
1012,
3091,
1026,
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... |
adobe/brackets | src/editor/CodeHintManager.js | _handleChange | function _handleChange(event, editor, changeList) {
if (lastChar && editor === keyDownEditor) {
keyDownEditor = null;
if (_inSession(editor)) {
var charToRetest = lastChar;
_updateHintList();
// _updateHintList() may end a hinting session ... | javascript | function _handleChange(event, editor, changeList) {
if (lastChar && editor === keyDownEditor) {
keyDownEditor = null;
if (_inSession(editor)) {
var charToRetest = lastChar;
_updateHintList();
// _updateHintList() may end a hinting session ... | [
"function",
"_handleChange",
"(",
"event",
",",
"editor",
",",
"changeList",
")",
"{",
"if",
"(",
"lastChar",
"&&",
"editor",
"===",
"keyDownEditor",
")",
"{",
"keyDownEditor",
"=",
"null",
";",
"if",
"(",
"_inSession",
"(",
"editor",
")",
")",
"{",
"var... | Start a new implicit hinting session, or update the existing hint list.
Called by the editor after handleKeyEvent, which is responsible for setting
the lastChar.
@param {Event} event
@param {Editor} editor
@param {{from: Pos, to: Pos, text: Array, origin: string}} changeList | [
"Start",
"a",
"new",
"implicit",
"hinting",
"session",
"or",
"update",
"the",
"existing",
"hint",
"list",
".",
"Called",
"by",
"the",
"editor",
"after",
"handleKeyEvent",
"which",
"is",
"responsible",
"for",
"setting",
"the",
"lastChar",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L618-L652 | train | Handle change event | [
30522,
3853,
1035,
5047,
22305,
2063,
1006,
2724,
1010,
3559,
1010,
2689,
9863,
1007,
1063,
2065,
1006,
2197,
7507,
2099,
1004,
1004,
3559,
1027,
1027,
1027,
3145,
7698,
2098,
15660,
1007,
1063,
3145,
7698,
2098,
15660,
1027,
19701,
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... |
jhipster/generator-jhipster | generators/docker-utils.js | checkImageExist | function checkImageExist(opts = { cwd: './', appConfig: null }) {
if (this.abort) return;
let imagePath = '';
this.warning = false;
this.warningMessage = 'To generate the missing Docker image(s), please run:\n';
if (opts.appConfig.buildTool === 'maven') {
imagePath = this.destinationPath(`$... | javascript | function checkImageExist(opts = { cwd: './', appConfig: null }) {
if (this.abort) return;
let imagePath = '';
this.warning = false;
this.warningMessage = 'To generate the missing Docker image(s), please run:\n';
if (opts.appConfig.buildTool === 'maven') {
imagePath = this.destinationPath(`$... | [
"function",
"checkImageExist",
"(",
"opts",
"=",
"{",
"cwd",
":",
"'./'",
",",
"appConfig",
":",
"null",
"}",
")",
"{",
"if",
"(",
"this",
".",
"abort",
")",
"return",
";",
"let",
"imagePath",
"=",
"''",
";",
"this",
".",
"warning",
"=",
"false",
"... | Check that a Docker image exists in a JHipster app.
@param opts Options to pass.
@property pwd JHipster app directory. default is './'
@property appConfig Configuration for the current application | [
"Check",
"that",
"a",
"Docker",
"image",
"exists",
"in",
"a",
"JHipster",
"app",
"."
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/docker-utils.js#L80-L98 | train | Check if Docker image exists | [
30522,
3853,
4638,
9581,
18372,
9048,
3367,
1006,
23569,
2015,
1027,
1063,
19296,
2094,
1024,
1005,
1012,
1013,
1005,
1010,
10439,
8663,
8873,
2290,
1024,
19701,
1065,
1007,
1063,
2065,
1006,
2023,
1012,
11113,
11589,
1007,
2709,
1025,
2292... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js | function (oContentItem) {
var bNotBlacklisted = true;
jQuery.each(this.aBlacklist, function (index, mBlacklistedElement) {
var bAllPropertiesMatched = true;
jQuery.each(mBlacklistedElement, function (sProperty, sValue) {
bAllPropertiesMatched = bAllPropertiesMatched && oContentItem[sProperty] =... | javascript | function (oContentItem) {
var bNotBlacklisted = true;
jQuery.each(this.aBlacklist, function (index, mBlacklistedElement) {
var bAllPropertiesMatched = true;
jQuery.each(mBlacklistedElement, function (sProperty, sValue) {
bAllPropertiesMatched = bAllPropertiesMatched && oContentItem[sProperty] =... | [
"function",
"(",
"oContentItem",
")",
"{",
"var",
"bNotBlacklisted",
"=",
"true",
";",
"jQuery",
".",
"each",
"(",
"this",
".",
"aBlacklist",
",",
"function",
"(",
"index",
",",
"mBlacklistedElement",
")",
"{",
"var",
"bAllPropertiesMatched",
"=",
"true",
";... | Verifies if item content is not in the black list.
@param {Object} oContentItem - content item needs to be verified
@returns {Boolean} - <code>true</code> if not in the black list
@public | [
"Verifies",
"if",
"item",
"content",
"is",
"not",
"in",
"the",
"black",
"list",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js#L79-L94 | train | Checks if the content item is not in the blacklist | [
30522,
3853,
1006,
1051,
8663,
6528,
23096,
2213,
1007,
1063,
13075,
24869,
4140,
28522,
3600,
9863,
2098,
1027,
2995,
1025,
1046,
4226,
2854,
1012,
2169,
1006,
2023,
1012,
11113,
30524,
7368,
18900,
7690,
1027,
2995,
1025,
1046,
4226,
2854... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableScrollExtension.js | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var oHSb = oScrollExtension.getHorizontalScrollbar();
var aScrollAreas = HorizontalScrollingHelper.getScrollAreas(oTable);
if (oScrollExtension._onHorizontalScrollEventHandler) {
for (var i = 0; i < aScrollAreas.length; i++) {
... | javascript | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var oHSb = oScrollExtension.getHorizontalScrollbar();
var aScrollAreas = HorizontalScrollingHelper.getScrollAreas(oTable);
if (oScrollExtension._onHorizontalScrollEventHandler) {
for (var i = 0; i < aScrollAreas.length; i++) {
... | [
"function",
"(",
"oTable",
")",
"{",
"var",
"oScrollExtension",
"=",
"oTable",
".",
"_getScrollExtension",
"(",
")",
";",
"var",
"oHSb",
"=",
"oScrollExtension",
".",
"getHorizontalScrollbar",
"(",
")",
";",
"var",
"aScrollAreas",
"=",
"HorizontalScrollingHelper",... | Removes the horizontal <code>scroll</code> event listener from all horizontal scroll areas of a table.
@param {sap.ui.table.Table} oTable Instance of the table. | [
"Removes",
"the",
"horizontal",
"<code",
">",
"scroll<",
"/",
"code",
">",
"event",
"listener",
"from",
"all",
"horizontal",
"scroll",
"areas",
"of",
"a",
"table",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableScrollExtension.js#L244-L261 | train | Removes the event listeners for the horizontal scroll area. | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
13075,
9808,
26775,
14511,
10288,
29048,
1027,
27178,
3085,
1012,
1035,
4152,
26775,
14511,
10288,
29048,
1006,
1007,
1025,
13075,
2821,
19022,
1027,
9808,
26775,
14511,
10288,
29048,
1012,
2131,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/no-var.js | isOutsideOfScope | function isOutsideOfScope(reference) {
const scope = scopeNode.range;
const id = reference.identifier.range;
return id[0] < scope[0] || id[1] > scope[1];
} | javascript | function isOutsideOfScope(reference) {
const scope = scopeNode.range;
const id = reference.identifier.range;
return id[0] < scope[0] || id[1] > scope[1];
} | [
"function",
"isOutsideOfScope",
"(",
"reference",
")",
"{",
"const",
"scope",
"=",
"scopeNode",
".",
"range",
";",
"const",
"id",
"=",
"reference",
".",
"identifier",
".",
"range",
";",
"return",
"id",
"[",
"0",
"]",
"<",
"scope",
"[",
"0",
"]",
"||",
... | Checks whether a given reference is inside of the specified scope or not.
@param {eslint-scope.Reference} reference - A reference to check.
@returns {boolean} `true` if the reference is inside of the specified
scope. | [
"Checks",
"whether",
"a",
"given",
"reference",
"is",
"inside",
"of",
"the",
"specified",
"scope",
"or",
"not",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-var.js#L128-L133 | train | Checks whether the reference is outside of the scope | [
30522,
3853,
11163,
16446,
5178,
11253,
26127,
1006,
4431,
1007,
1063,
9530,
3367,
9531,
1027,
9531,
3630,
3207,
1012,
2846,
1025,
9530,
3367,
8909,
1027,
4431,
1012,
8909,
4765,
18095,
1012,
2846,
1025,
2709,
8909,
1031,
1014,
1033,
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... |
jhipster/generator-jhipster | generators/docker-prompts.js | askForClustersMode | function askForClustersMode() {
if (this.regenerate) return;
const clusteredDbApps = [];
this.appConfigs.forEach((appConfig, index) => {
if (appConfig.prodDatabaseType === 'mongodb' || appConfig.prodDatabaseType === 'couchbase') {
clusteredDbApps.push(this.appsFolders[index]);
}... | javascript | function askForClustersMode() {
if (this.regenerate) return;
const clusteredDbApps = [];
this.appConfigs.forEach((appConfig, index) => {
if (appConfig.prodDatabaseType === 'mongodb' || appConfig.prodDatabaseType === 'couchbase') {
clusteredDbApps.push(this.appsFolders[index]);
}... | [
"function",
"askForClustersMode",
"(",
")",
"{",
"if",
"(",
"this",
".",
"regenerate",
")",
"return",
";",
"const",
"clusteredDbApps",
"=",
"[",
"]",
";",
"this",
".",
"appConfigs",
".",
"forEach",
"(",
"(",
"appConfig",
",",
"index",
")",
"=>",
"{",
"... | Ask For Clusters Mode | [
"Ask",
"For",
"Clusters",
"Mode"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/docker-prompts.js#L196-L225 | train | Ask For Clusters Mode | [
30522,
3853,
3198,
29278,
20464,
19966,
2545,
5302,
3207,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
19723,
30524,
4013,
25062,
2696,
15058,
13874,
1027,
1027,
1027,
1005,
12256,
3995,
18939,
1005,
1064,
1064,
10439,
8663,
8873,
2290,
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/component/graphic.js | function (graphicModel) {
var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();
if (!elOptionsToUpdate) {
return;
}
var elMap = this._elMap;
var rootGroup = this.group;
// Top-down tranverse to assign graphic settings to each elements.
zrUtil... | javascript | function (graphicModel) {
var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();
if (!elOptionsToUpdate) {
return;
}
var elMap = this._elMap;
var rootGroup = this.group;
// Top-down tranverse to assign graphic settings to each elements.
zrUtil... | [
"function",
"(",
"graphicModel",
")",
"{",
"var",
"elOptionsToUpdate",
"=",
"graphicModel",
".",
"useElOptionsToUpdate",
"(",
")",
";",
"if",
"(",
"!",
"elOptionsToUpdate",
")",
"{",
"return",
";",
"}",
"var",
"elMap",
"=",
"this",
".",
"_elMap",
";",
"var... | Update graphic elements.
@private
@param {Object} graphicModel graphic model | [
"Update",
"graphic",
"elements",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/component/graphic.js#L279-L346 | train | Updates the graphic settings of the elements. | [
30522,
3853,
1006,
8425,
5302,
9247,
1007,
1063,
13075,
3449,
7361,
9285,
24826,
17299,
3686,
1027,
8425,
5302,
9247,
1012,
2224,
18349,
16790,
16033,
6279,
13701,
1006,
1007,
1025,
2065,
1006,
999,
3449,
7361,
9285,
24826,
17299,
3686,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function(sName) {
if (this._oDimensionSet[sName]) { // the easy case
return this._oDimensionSet[sName];
}
for ( var sDimensionName in this._oDimensionSet) {
var oDimension = this._oDimensionSet[sDimensionName];
var oTextProperty = oDimension.getTextProperty();
if (oTextProperty && oTextPropert... | javascript | function(sName) {
if (this._oDimensionSet[sName]) { // the easy case
return this._oDimensionSet[sName];
}
for ( var sDimensionName in this._oDimensionSet) {
var oDimension = this._oDimensionSet[sDimensionName];
var oTextProperty = oDimension.getTextProperty();
if (oTextProperty && oTextPropert... | [
"function",
"(",
"sName",
")",
"{",
"if",
"(",
"this",
".",
"_oDimensionSet",
"[",
"sName",
"]",
")",
"{",
"// the easy case",
"return",
"this",
".",
"_oDimensionSet",
"[",
"sName",
"]",
";",
"}",
"for",
"(",
"var",
"sDimensionName",
"in",
"this",
".",
... | Find dimension by property name
@param {string}
sName Property name
@returns {sap.ui.model.analytics.odata4analytics.Dimension} The dimension object to
which the given property name is related, because the property
holds the dimension key, its text, or is an attribute of this
dimension. If no such dimension exists, nu... | [
"Find",
"dimension",
"by",
"property",
"name"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1105-L1121 | train | Returns the dimension with the given name | [
30522,
3853,
1006,
1055,
18442,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
21045,
3549,
27466,
3388,
1031,
1055,
18442,
1033,
1007,
1063,
1013,
1013,
1996,
3733,
2553,
2709,
2023,
1012,
1035,
21045,
3549,
27466,
3388,
1031,
1055,
18442,
1033... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Element.js | function(element, key) {
var aData = element.getAggregation("customData");
if (aData) {
for (var i = 0; i < aData.length; i++) {
if (aData[i].getKey() == key) {
return aData[i];
}
}
}
return null;
} | javascript | function(element, key) {
var aData = element.getAggregation("customData");
if (aData) {
for (var i = 0; i < aData.length; i++) {
if (aData[i].getKey() == key) {
return aData[i];
}
}
}
return null;
} | [
"function",
"(",
"element",
",",
"key",
")",
"{",
"var",
"aData",
"=",
"element",
".",
"getAggregation",
"(",
"\"customData\"",
")",
";",
"if",
"(",
"aData",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"aData",
".",
"length",
";",
... | Returns the data object with the given key | [
"Returns",
"the",
"data",
"object",
"with",
"the",
"given",
"key"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Element.js#L908-L918 | train | Returns the data object for the given key | [
30522,
3853,
1006,
5783,
1010,
3145,
1007,
1063,
13075,
15262,
2696,
1027,
5783,
1012,
2131,
8490,
17603,
12540,
1006,
1000,
7661,
2850,
2696,
1000,
1007,
1025,
2065,
1006,
15262,
2696,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
1014,
1025,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.unified/src/sap/ui/unified/ColorPicker.js | function(oEvent) {
var iX = oEvent.offsetX,
iY = oEvent.offsetY,
iBoxHeight,
// Keep in mind that box width and height should be equal on all screen sizes
iBoxWidth = iBoxHeight = this.getWidth(),
oEventPosition,
oOffset;
// Prevent default to eliminate scrolling while someone uses the co... | javascript | function(oEvent) {
var iX = oEvent.offsetX,
iY = oEvent.offsetY,
iBoxHeight,
// Keep in mind that box width and height should be equal on all screen sizes
iBoxWidth = iBoxHeight = this.getWidth(),
oEventPosition,
oOffset;
// Prevent default to eliminate scrolling while someone uses the co... | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"iX",
"=",
"oEvent",
".",
"offsetX",
",",
"iY",
"=",
"oEvent",
".",
"offsetY",
",",
"iBoxHeight",
",",
"// Keep in mind that box width and height should be equal on all screen sizes",
"iBoxWidth",
"=",
"iBoxHeight",
"=",
"... | Calculates the <code>value</code> and <code>saturation</code> from event XY coordinates related to the
<code>ColorPickerBox</code> coordinates.
@param {object} oEvent event object
@returns {object|false} with 'value' and 'saturation' properties | [
"Calculates",
"the",
"<code",
">",
"value<",
"/",
"code",
">",
"and",
"<code",
">",
"saturation<",
"/",
"code",
">",
"from",
"event",
"XY",
"coordinates",
"related",
"to",
"the",
"<code",
">",
"ColorPickerBox<",
"/",
"code",
">",
"coordinates",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.unified/src/sap/ui/unified/ColorPicker.js#L700-L749 | train | Returns the handle position based on the event position | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
11814,
1027,
1051,
18697,
3372,
1012,
16396,
2595,
1010,
1045,
2100,
1027,
1051,
18697,
3372,
1012,
16396,
2100,
1010,
21307,
11636,
26036,
13900,
1010,
1013,
1013,
2562,
1999,
2568,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
google/material-design-lite | gulpfile.babel.js | watch | function watch() {
gulp.watch(['src/**/*.js', '!src/**/README.md'],
['scripts', 'demos', 'components', reload]);
gulp.watch(['src/**/*.{scss,css}'],
['styles', 'styles-grid', 'styletemplates', reload]);
gulp.watch(['src/**/*.html'], ['pages', reload]);
gulp.watch(['src/**/*.{svg,png,jpg}'], ['images', r... | javascript | function watch() {
gulp.watch(['src/**/*.js', '!src/**/README.md'],
['scripts', 'demos', 'components', reload]);
gulp.watch(['src/**/*.{scss,css}'],
['styles', 'styles-grid', 'styletemplates', reload]);
gulp.watch(['src/**/*.html'], ['pages', reload]);
gulp.watch(['src/**/*.{svg,png,jpg}'], ['images', r... | [
"function",
"watch",
"(",
")",
"{",
"gulp",
".",
"watch",
"(",
"[",
"'src/**/*.js'",
",",
"'!src/**/README.md'",
"]",
",",
"[",
"'scripts'",
",",
"'demos'",
",",
"'components'",
",",
"reload",
"]",
")",
";",
"gulp",
".",
"watch",
"(",
"[",
"'src/**/*.{sc... | Defines the list of resources to watch for changes. | [
"Defines",
"the",
"list",
"of",
"resources",
"to",
"watch",
"for",
"changes",
"."
] | 60f441a22ed98ed2c03f6179adf460d888bf459f | https://github.com/google/material-design-lite/blob/60f441a22ed98ed2c03f6179adf460d888bf459f/gulpfile.babel.js#L493-L504 | train | Watches the files | [
30522,
3853,
3422,
1006,
1007,
1063,
26546,
1012,
3422,
1006,
1031,
1005,
5034,
2278,
1013,
1008,
1008,
1013,
1008,
1012,
1046,
2015,
1005,
1010,
1005,
999,
5034,
2278,
1013,
1008,
1008,
1013,
3191,
4168,
1012,
9108,
1005,
1033,
1010,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.