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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
uber/deck.gl | modules/core/src/utils/old-log.js | time | function time(priority, label) {
assert(Number.isFinite(priority), 'log priority must be a number');
if (priority <= log.priority) {
// In case the platform doesn't have console.time
if (console.time) {
console.time(label);
} else {
console.info(label);
}
}
} | javascript | function time(priority, label) {
assert(Number.isFinite(priority), 'log priority must be a number');
if (priority <= log.priority) {
// In case the platform doesn't have console.time
if (console.time) {
console.time(label);
} else {
console.info(label);
}
}
} | [
"function",
"time",
"(",
"priority",
",",
"label",
")",
"{",
"assert",
"(",
"Number",
".",
"isFinite",
"(",
"priority",
")",
",",
"'log priority must be a number'",
")",
";",
"if",
"(",
"priority",
"<=",
"log",
".",
"priority",
")",
"{",
"// In case the plat... | Logs a message with a time | [
"Logs",
"a",
"message",
"with",
"a",
"time"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/core/src/utils/old-log.js#L71-L81 | train | Log time | [
30522,
3853,
2051,
1006,
9470,
1010,
3830,
1007,
1063,
20865,
1006,
2193,
1012,
2003,
16294,
4221,
1006,
9470,
1007,
1010,
1005,
8833,
9470,
2442,
2022,
1037,
2193,
1005,
1007,
1025,
2065,
1006,
9470,
1026,
1027,
8833,
1012,
9470,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
summernote/summernote | src/js/base/core/dom.js | fromOffsetPath | function fromOffsetPath(ancestor, offsets) {
let current = ancestor;
for (let i = 0, len = offsets.length; i < len; i++) {
if (current.childNodes.length <= offsets[i]) {
current = current.childNodes[current.childNodes.length - 1];
} else {
current = current.childNodes[offsets[i]];
}
}
re... | javascript | function fromOffsetPath(ancestor, offsets) {
let current = ancestor;
for (let i = 0, len = offsets.length; i < len; i++) {
if (current.childNodes.length <= offsets[i]) {
current = current.childNodes[current.childNodes.length - 1];
} else {
current = current.childNodes[offsets[i]];
}
}
re... | [
"function",
"fromOffsetPath",
"(",
"ancestor",
",",
"offsets",
")",
"{",
"let",
"current",
"=",
"ancestor",
";",
"for",
"(",
"let",
"i",
"=",
"0",
",",
"len",
"=",
"offsets",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"if",
"(... | @method fromOffsetPath
return element from offsetPath(array of offset)
@param {Node} ancestor - ancestor node
@param {array} offsets - offsetPath | [
"@method",
"fromOffsetPath"
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L715-L725 | train | Returns the nearest ancestor node that is at the given offset path. | [
30522,
3853,
2013,
27475,
3388,
15069,
1006,
13032,
1010,
16396,
2015,
1007,
1063,
2292,
2783,
1027,
13032,
1025,
2005,
1006,
2292,
1045,
1027,
1014,
1010,
18798,
1027,
16396,
2015,
1012,
3091,
1025,
1045,
1026,
18798,
1025,
1045,
1009,
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/odata/v4/lib/_Cache.js | onCancel | function onCancel() {
_Helper.removeByPath(that.mPatchRequests, sFullPath, oPatchPromise);
// write the previous value into the cache
_Helper.updateExisting(that.mChangeListeners, sEntityPath, oEntity,
Cache.makeUpdateData(aPropertyPath, vOldValue));
} | javascript | function onCancel() {
_Helper.removeByPath(that.mPatchRequests, sFullPath, oPatchPromise);
// write the previous value into the cache
_Helper.updateExisting(that.mChangeListeners, sEntityPath, oEntity,
Cache.makeUpdateData(aPropertyPath, vOldValue));
} | [
"function",
"onCancel",
"(",
")",
"{",
"_Helper",
".",
"removeByPath",
"(",
"that",
".",
"mPatchRequests",
",",
"sFullPath",
",",
"oPatchPromise",
")",
";",
"// write the previous value into the cache",
"_Helper",
".",
"updateExisting",
"(",
"that",
".",
"mChangeLis... | /*
Synchronous callback to cancel the PATCH request so that it is really gone when
resetChangesForPath has been called on the binding or model. | [
"/",
"*",
"Synchronous",
"callback",
"to",
"cancel",
"the",
"PATCH",
"request",
"so",
"that",
"it",
"is",
"really",
"gone",
"when",
"resetChangesForPath",
"has",
"been",
"called",
"on",
"the",
"binding",
"or",
"model",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js#L860-L865 | train | Cancels the current patch request | [
30522,
3853,
2006,
9336,
29109,
1006,
1007,
1063,
1035,
2393,
2121,
1012,
6366,
3762,
15069,
1006,
2008,
1012,
6131,
4017,
2818,
2890,
15500,
2015,
1010,
16420,
18083,
15069,
1010,
6728,
4017,
2818,
21572,
28732,
1007,
1025,
1013,
1013,
433... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | getEpState | function getEpState(ep, opts) {
let item = store.get(ep.name);
if (!item) {
item = {
ep,
opts,
count: 0,
failures: 0,
state: C.CIRCUIT_CLOSE,
cbTimer: null
};
store.set(ep.name, item);
}
return item;
} | javascript | function getEpState(ep, opts) {
let item = store.get(ep.name);
if (!item) {
item = {
ep,
opts,
count: 0,
failures: 0,
state: C.CIRCUIT_CLOSE,
cbTimer: null
};
store.set(ep.name, item);
}
return item;
} | [
"function",
"getEpState",
"(",
"ep",
",",
"opts",
")",
"{",
"let",
"item",
"=",
"store",
".",
"get",
"(",
"ep",
".",
"name",
")",
";",
"if",
"(",
"!",
"item",
")",
"{",
"item",
"=",
"{",
"ep",
",",
"opts",
",",
"count",
":",
"0",
",",
"failur... | Get Endpoint state from store. If not exists, create it.
@param {Endpoint} ep
@param {Object} opts
@returns {Object} | [
"Get",
"Endpoint",
"state",
"from",
"store",
".",
"If",
"not",
"exists",
"create",
"it",
"."
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/circuit-breaker.js#L57-L71 | train | Get the state of an endpoint | [
30522,
3853,
2131,
13699,
9153,
2618,
1006,
4958,
1010,
23569,
2015,
1007,
1063,
2292,
8875,
1027,
3573,
1012,
2131,
1006,
4958,
1012,
2171,
1007,
1025,
2065,
1006,
999,
8875,
1007,
1063,
8875,
1027,
1063,
4958,
1010,
23569,
2015,
1010,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/coord/polar/Polar.js | function (point, clamp) {
var coord = this.pointToCoord(point);
return [
this._radiusAxis.radiusToData(coord[0], clamp),
this._angleAxis.angleToData(coord[1], clamp)
];
} | javascript | function (point, clamp) {
var coord = this.pointToCoord(point);
return [
this._radiusAxis.radiusToData(coord[0], clamp),
this._angleAxis.angleToData(coord[1], clamp)
];
} | [
"function",
"(",
"point",
",",
"clamp",
")",
"{",
"var",
"coord",
"=",
"this",
".",
"pointToCoord",
"(",
"point",
")",
";",
"return",
"[",
"this",
".",
"_radiusAxis",
".",
"radiusToData",
"(",
"coord",
"[",
"0",
"]",
",",
"clamp",
")",
",",
"this",
... | Convert a (x, y) point to data
@param {Array.<number>} point
@param {boolean} [clamp=false]
@return {Array.<number>} | [
"Convert",
"a",
"(",
"x",
"y",
")",
"point",
"to",
"data"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/polar/Polar.js#L203-L209 | train | Returns the data for a point | [
30522,
3853,
1006,
2391,
1010,
18856,
16613,
1007,
1063,
13075,
2522,
8551,
1027,
2023,
1012,
2391,
3406,
3597,
8551,
1006,
2391,
1007,
1025,
2709,
1031,
2023,
1012,
1035,
12177,
8528,
2483,
1012,
12177,
3406,
2850,
2696,
1006,
2522,
8551,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ColorlibHQ/AdminLTE | build/js/DirectChat.js | Plugin | function Plugin(option) {
return this.each(function () {
var $this = $(this);
var data = $this.data(DataKey);
if (!data) {
$this.data(DataKey, (data = new DirectChat($this)));
}
if (typeof option == 'string') data.toggle($this);
});
} | javascript | function Plugin(option) {
return this.each(function () {
var $this = $(this);
var data = $this.data(DataKey);
if (!data) {
$this.data(DataKey, (data = new DirectChat($this)));
}
if (typeof option == 'string') data.toggle($this);
});
} | [
"function",
"Plugin",
"(",
"option",
")",
"{",
"return",
"this",
".",
"each",
"(",
"function",
"(",
")",
"{",
"var",
"$this",
"=",
"$",
"(",
"this",
")",
";",
"var",
"data",
"=",
"$this",
".",
"data",
"(",
"DataKey",
")",
";",
"if",
"(",
"!",
"... | Plugin Definition ================= | [
"Plugin",
"Definition",
"================="
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/build/js/DirectChat.js#L34-L45 | train | Plugin constructor. | [
30522,
3853,
13354,
2378,
1006,
5724,
1007,
1063,
2709,
2023,
1012,
2169,
1006,
3853,
1006,
1007,
1063,
30524,
1006,
2951,
14839,
1010,
1006,
2951,
1027,
2047,
3622,
7507,
2102,
1006,
1002,
2023,
1007,
1007,
1007,
1025,
1065,
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... |
adobe/brackets | src/LiveDevelopment/Agents/DOMAgent.js | _cleanURL | function _cleanURL(url) {
var index = url.search(/[#\?]/);
if (index >= 0) {
url = url.substr(0, index);
}
return url;
} | javascript | function _cleanURL(url) {
var index = url.search(/[#\?]/);
if (index >= 0) {
url = url.substr(0, index);
}
return url;
} | [
"function",
"_cleanURL",
"(",
"url",
")",
"{",
"var",
"index",
"=",
"url",
".",
"search",
"(",
"/",
"[#\\?]",
"/",
")",
";",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"url",
"=",
"url",
".",
"substr",
"(",
"0",
",",
"index",
")",
";",
"}",
"re... | Eliminate the query string from a URL
@param {string} URL | [
"Eliminate",
"the",
"query",
"string",
"from",
"a",
"URL"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L123-L129 | train | Remove the query string from the URL | [
30522,
3853,
1035,
4550,
3126,
2140,
1006,
24471,
2140,
1007,
1063,
13075,
5950,
1027,
24471,
2140,
1012,
3945,
1006,
1013,
1031,
1001,
1032,
1029,
1033,
1013,
1007,
1025,
2065,
1006,
5950,
1028,
1027,
1014,
1007,
1063,
24471,
2140,
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... |
apache/incubator-echarts | src/chart/line/poly.js | drawNonMono | function drawNonMono(
ctx, points, start, segLen, allLen,
dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls
) {
var prevIdx = 0;
var idx = start;
for (var k = 0; k < segLen; k++) {
var p = points[idx];
if (idx >= allLen || idx < 0) {
break;
}
... | javascript | function drawNonMono(
ctx, points, start, segLen, allLen,
dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls
) {
var prevIdx = 0;
var idx = start;
for (var k = 0; k < segLen; k++) {
var p = points[idx];
if (idx >= allLen || idx < 0) {
break;
}
... | [
"function",
"drawNonMono",
"(",
"ctx",
",",
"points",
",",
"start",
",",
"segLen",
",",
"allLen",
",",
"dir",
",",
"smoothMin",
",",
"smoothMax",
",",
"smooth",
",",
"smoothMonotone",
",",
"connectNulls",
")",
"{",
"var",
"prevIdx",
"=",
"0",
";",
"var",... | Draw smoothed line in non-monotone, in may cause undesired curve in extreme
situations. This should be used when points are non-monotone neither in x or
y dimension. | [
"Draw",
"smoothed",
"line",
"in",
"non",
"-",
"monotone",
"in",
"may",
"cause",
"undesired",
"curve",
"in",
"extreme",
"situations",
".",
"This",
"should",
"be",
"used",
"when",
"points",
"are",
"non",
"-",
"monotone",
"neither",
"in",
"x",
"or",
"y",
"d... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/line/poly.js#L171-L262 | train | Draw non - monotone points | [
30522,
3853,
4567,
2239,
8202,
2080,
1006,
14931,
2595,
1010,
2685,
1010,
2707,
1010,
7367,
9354,
2078,
1010,
2035,
7770,
1010,
16101,
1010,
5744,
10020,
1010,
5744,
17848,
1010,
5744,
1010,
5744,
8202,
25862,
2063,
1010,
7532,
11231,
12718... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/yoda.js | same | function same(a, b) {
if (a.type !== b.type) {
return false;
}
switch (a.type) {
case "Identifier":
return a.name === b.name;
case "Literal":
return a.value === b.value;
case "MemberExpression": {
const nameA = astUtils.getStaticProperty... | javascript | function same(a, b) {
if (a.type !== b.type) {
return false;
}
switch (a.type) {
case "Identifier":
return a.name === b.name;
case "Literal":
return a.value === b.value;
case "MemberExpression": {
const nameA = astUtils.getStaticProperty... | [
"function",
"same",
"(",
"a",
",",
"b",
")",
"{",
"if",
"(",
"a",
".",
"type",
"!==",
"b",
".",
"type",
")",
"{",
"return",
"false",
";",
"}",
"switch",
"(",
"a",
".",
"type",
")",
"{",
"case",
"\"Identifier\"",
":",
"return",
"a",
".",
"name",... | Checks whether two expressions reference the same value. For example:
a = a
a.b = a.b
a[0] = a[0]
a['b'] = a['b']
@param {ASTNode} a Left side of the comparison.
@param {ASTNode} b Right side of the comparison.
@returns {boolean} True if both sides match and reference the same value. | [
"Checks",
"whether",
"two",
"expressions",
"reference",
"the",
"same",
"value",
".",
"For",
"example",
":",
"a",
"=",
"a",
"a",
".",
"b",
"=",
"a",
".",
"b",
"a",
"[",
"0",
"]",
"=",
"a",
"[",
"0",
"]",
"a",
"[",
"b",
"]",
"=",
"a",
"[",
"b... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/yoda.js#L106-L147 | train | returns true if a and b are the same | [
30522,
3853,
2168,
1006,
1037,
1010,
1038,
1007,
1063,
2065,
1006,
1037,
1012,
2828,
999,
1027,
1027,
1038,
1012,
2828,
1007,
1063,
2709,
6270,
1025,
1065,
6942,
1006,
1037,
1012,
2828,
1007,
1063,
2553,
1000,
8909,
4765,
18095,
1000,
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... |
zloirock/core-js | packages/core-js/internals/collection-strong.js | forEach | function forEach(callbackfn /* , that = undefined */) {
var state = getInternalState(this);
var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
var entry;
while (entry = entry ? entry.next : state.first) {
boundFunction(entry.value, entry.k... | javascript | function forEach(callbackfn /* , that = undefined */) {
var state = getInternalState(this);
var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
var entry;
while (entry = entry ? entry.next : state.first) {
boundFunction(entry.value, entry.k... | [
"function",
"forEach",
"(",
"callbackfn",
"/* , that = undefined */",
")",
"{",
"var",
"state",
"=",
"getInternalState",
"(",
"this",
")",
";",
"var",
"boundFunction",
"=",
"bind",
"(",
"callbackfn",
",",
"arguments",
".",
"length",
">",
"1",
"?",
"arguments",... | 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) | [
"23",
".",
"2",
".",
"3",
".",
"6",
"Set",
".",
"prototype",
".",
"forEach",
"(",
"callbackfn",
"thisArg",
"=",
"undefined",
")",
"23",
".",
"1",
".",
"3",
".",
"5",
"Map",
".",
"prototype",
".",
"forEach",
"(",
"callbackfn",
"thisArg",
"=",
"undef... | fe7c8511a6d27d03a9b8e075b3351416aae95c58 | https://github.com/zloirock/core-js/blob/fe7c8511a6d27d03a9b8e075b3351416aae95c58/packages/core-js/internals/collection-strong.js#L110-L119 | train | Iterates over all the cache entries in the cache. | [
30522,
3853,
18921,
6776,
1006,
2655,
5963,
2546,
2078,
1013,
1008,
1010,
2008,
1027,
6151,
28344,
1008,
1013,
1007,
1063,
13075,
2110,
1027,
2131,
18447,
11795,
9777,
12259,
1006,
2023,
1007,
1025,
13075,
5391,
11263,
27989,
1027,
14187,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js | function (aButtons) {
var iVisibleButtons = 0;
aButtons.forEach(function (oButton) {
oButton.setVisible(oButton.getEnabled());
if (oButton.getEnabled()) {
iVisibleButtons++;
}
});
return iVisibleButtons;
} | javascript | function (aButtons) {
var iVisibleButtons = 0;
aButtons.forEach(function (oButton) {
oButton.setVisible(oButton.getEnabled());
if (oButton.getEnabled()) {
iVisibleButtons++;
}
});
return iVisibleButtons;
} | [
"function",
"(",
"aButtons",
")",
"{",
"var",
"iVisibleButtons",
"=",
"0",
";",
"aButtons",
".",
"forEach",
"(",
"function",
"(",
"oButton",
")",
"{",
"oButton",
".",
"setVisible",
"(",
"oButton",
".",
"getEnabled",
"(",
")",
")",
";",
"if",
"(",
"oBut... | Hiddes all disabled buttons and returns the number if visible buttons
@param {array} aButtons some Buttons
@return {int} the number of visible buttons | [
"Hiddes",
"all",
"disabled",
"buttons",
"and",
"returns",
"the",
"number",
"if",
"visible",
"buttons"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js#L268-L278 | train | Sets the visibility of all buttons | [
30522,
3853,
1006,
8273,
15474,
2015,
1007,
1063,
13075,
4921,
17417,
3468,
8569,
15474,
2015,
1027,
1014,
1025,
8273,
15474,
2015,
1012,
18921,
6776,
1006,
3853,
1006,
27885,
4904,
2669,
1007,
1063,
27885,
4904,
2669,
1012,
2275,
11365,
70... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/extensibility/ExtensionManagerDialog.js | updateNotificationIcon | function updateNotificationIcon(index) {
var model = models[index],
$notificationIcon = $dlg.find(".nav-tabs li").eq(index).find(".notification");
if (model.notifyCount) {
$notificationIcon.text(model.notifyCount);
$notificationIcon.show();
... | javascript | function updateNotificationIcon(index) {
var model = models[index],
$notificationIcon = $dlg.find(".nav-tabs li").eq(index).find(".notification");
if (model.notifyCount) {
$notificationIcon.text(model.notifyCount);
$notificationIcon.show();
... | [
"function",
"updateNotificationIcon",
"(",
"index",
")",
"{",
"var",
"model",
"=",
"models",
"[",
"index",
"]",
",",
"$notificationIcon",
"=",
"$dlg",
".",
"find",
"(",
"\".nav-tabs li\"",
")",
".",
"eq",
"(",
"index",
")",
".",
"find",
"(",
"\".notificati... | Update & hide/show the notification overlay on a tab's icon, based on its model's notifyCount | [
"Update",
"&",
"hide",
"/",
"show",
"the",
"notification",
"overlay",
"on",
"a",
"tab",
"s",
"icon",
"based",
"on",
"its",
"model",
"s",
"notifyCount"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManagerDialog.js#L409-L418 | train | Update notification icon | [
30522,
3853,
10651,
17048,
9031,
28524,
1006,
5950,
1007,
1063,
13075,
2944,
1027,
4275,
1031,
5950,
1033,
1010,
1002,
26828,
28524,
1027,
1002,
21469,
2290,
1012,
2424,
1006,
1000,
1012,
6583,
2615,
1011,
21628,
2015,
5622,
1000,
1007,
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... |
mochajs/mocha | lib/reporters/spec.js | Spec | function Spec(runner, options) {
Base.call(this, runner, options);
var self = this;
var indents = 0;
var n = 0;
function indent() {
return Array(indents).join(' ');
}
runner.on(EVENT_RUN_BEGIN, function() {
console.log();
});
runner.on(EVENT_SUITE_BEGIN, function(suite) {
++indents;
... | javascript | function Spec(runner, options) {
Base.call(this, runner, options);
var self = this;
var indents = 0;
var n = 0;
function indent() {
return Array(indents).join(' ');
}
runner.on(EVENT_RUN_BEGIN, function() {
console.log();
});
runner.on(EVENT_SUITE_BEGIN, function(suite) {
++indents;
... | [
"function",
"Spec",
"(",
"runner",
",",
"options",
")",
"{",
"Base",
".",
"call",
"(",
"this",
",",
"runner",
",",
"options",
")",
";",
"var",
"self",
"=",
"this",
";",
"var",
"indents",
"=",
"0",
";",
"var",
"n",
"=",
"0",
";",
"function",
"inde... | Constructs a new `Spec` reporter instance.
@public
@class
@memberof Mocha.reporters
@extends Mocha.reporters.Base
@param {Runner} runner - Instance triggers reporter actions.
@param {Object} [options] - runner options | [
"Constructs",
"a",
"new",
"Spec",
"reporter",
"instance",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/spec.js#L37-L92 | train | Spec constructor. | [
30522,
3853,
28699,
1006,
5479,
1010,
7047,
1007,
1063,
2918,
1012,
2655,
1006,
2023,
1010,
5479,
1010,
7047,
1007,
1025,
13075,
2969,
1027,
2023,
1025,
13075,
27427,
11187,
1027,
1014,
1025,
13075,
1050,
1027,
1014,
1025,
3853,
27427,
4765... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Microsoft/vscode | build/lib/extensions.js | sequence | function sequence(streamProviders) {
const result = es.through();
function pop() {
if (streamProviders.length === 0) {
result.emit('end');
}
else {
const fn = streamProviders.shift();
fn()
.on('end', function () { setTimeout(pop, 0); })... | javascript | function sequence(streamProviders) {
const result = es.through();
function pop() {
if (streamProviders.length === 0) {
result.emit('end');
}
else {
const fn = streamProviders.shift();
fn()
.on('end', function () { setTimeout(pop, 0); })... | [
"function",
"sequence",
"(",
"streamProviders",
")",
"{",
"const",
"result",
"=",
"es",
".",
"through",
"(",
")",
";",
"function",
"pop",
"(",
")",
"{",
"if",
"(",
"streamProviders",
".",
"length",
"===",
"0",
")",
"{",
"result",
".",
"emit",
"(",
"'... | We're doing way too much stuff at once, with webpack et al. So much stuff
that while downloading extensions from the marketplace, node js doesn't get enough
stack frames to complete the download in under 2 minutes, at which point the
marketplace server cuts off the http request. So, we sequentialize the extensino tasks... | [
"We",
"re",
"doing",
"way",
"too",
"much",
"stuff",
"at",
"once",
"with",
"webpack",
"et",
"al",
".",
"So",
"much",
"stuff",
"that",
"while",
"downloading",
"extensions",
"from",
"the",
"marketplace",
"node",
"js",
"doesn",
"t",
"get",
"enough",
"stack",
... | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/build/lib/extensions.js#L194-L209 | train | sequence sequence function | [
30522,
3853,
5537,
1006,
5460,
21572,
17258,
2545,
1007,
1063,
9530,
3367,
2765,
1027,
9686,
1012,
2083,
1006,
1007,
1025,
3853,
3769,
1006,
1007,
1063,
2065,
1006,
5460,
21572,
17258,
2545,
1012,
3091,
1027,
1027,
1027,
1014,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/config/config-file.js | loadConfigFile | function loadConfigFile(configInfo) {
const { filePath } = configInfo;
let config;
switch (path.extname(filePath)) {
case ".js":
config = loadJSConfigFile(filePath);
if (configInfo.configName) {
config = config.configs[configInfo.configName];
... | javascript | function loadConfigFile(configInfo) {
const { filePath } = configInfo;
let config;
switch (path.extname(filePath)) {
case ".js":
config = loadJSConfigFile(filePath);
if (configInfo.configName) {
config = config.configs[configInfo.configName];
... | [
"function",
"loadConfigFile",
"(",
"configInfo",
")",
"{",
"const",
"{",
"filePath",
"}",
"=",
"configInfo",
";",
"let",
"config",
";",
"switch",
"(",
"path",
".",
"extname",
"(",
"filePath",
")",
")",
"{",
"case",
"\".js\"",
":",
"config",
"=",
"loadJSC... | Loads a configuration file regardless of the source. Inspects the file path
to determine the correctly way to load the config file.
@param {Object} configInfo The path to the configuration.
@returns {Object} The configuration information.
@private | [
"Loads",
"a",
"configuration",
"file",
"regardless",
"of",
"the",
"source",
".",
"Inspects",
"the",
"file",
"path",
"to",
"determine",
"the",
"correctly",
"way",
"to",
"load",
"the",
"config",
"file",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-file.js#L206-L242 | train | Load a config file | [
30522,
3853,
7170,
8663,
8873,
25708,
9463,
1006,
9530,
8873,
11528,
14876,
1007,
1063,
9530,
3367,
1063,
5371,
15069,
1065,
1027,
9530,
8873,
11528,
14876,
1025,
2292,
9530,
8873,
2290,
1025,
6942,
1006,
4130,
1012,
4654,
2102,
18442,
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... |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | addOrigin | function addOrigin ( base, handleNumber ) {
var origin = addNodeTo(base, options.cssClasses.origin);
var handle = addNodeTo(origin, options.cssClasses.handle);
addNodeTo(handle, options.cssClasses.handleTouchArea);
handle.setAttribute('data-handle', handleNumber);
... | javascript | function addOrigin ( base, handleNumber ) {
var origin = addNodeTo(base, options.cssClasses.origin);
var handle = addNodeTo(origin, options.cssClasses.handle);
addNodeTo(handle, options.cssClasses.handleTouchArea);
handle.setAttribute('data-handle', handleNumber);
... | [
"function",
"addOrigin",
"(",
"base",
",",
"handleNumber",
")",
"{",
"var",
"origin",
"=",
"addNodeTo",
"(",
"base",
",",
"options",
".",
"cssClasses",
".",
"origin",
")",
";",
"var",
"handle",
"=",
"addNodeTo",
"(",
"origin",
",",
"options",
".",
"cssCl... | Append a origin to the base | [
"Append",
"a",
"origin",
"to",
"the",
"base"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L911-L928 | train | add origin to base | [
30522,
3853,
5587,
10050,
11528,
1006,
2918,
1010,
5047,
19172,
5677,
1007,
1063,
13075,
4761,
1027,
5587,
3630,
3207,
3406,
1006,
30524,
27102,
2229,
1012,
4761,
1007,
1025,
13075,
5047,
1027,
5587,
3630,
3207,
3406,
1006,
4761,
1010,
7047... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
pagekit/vue-resource | dist/vue-resource.esm.js | expand | function expand(url, params, variables) {
var tmpl = parse(url), expanded = tmpl.expand(params);
if (variables) {
variables.push.apply(variables, tmpl.vars);
}
return expanded;
} | javascript | function expand(url, params, variables) {
var tmpl = parse(url), expanded = tmpl.expand(params);
if (variables) {
variables.push.apply(variables, tmpl.vars);
}
return expanded;
} | [
"function",
"expand",
"(",
"url",
",",
"params",
",",
"variables",
")",
"{",
"var",
"tmpl",
"=",
"parse",
"(",
"url",
")",
",",
"expanded",
"=",
"tmpl",
".",
"expand",
"(",
"params",
")",
";",
"if",
"(",
"variables",
")",
"{",
"variables",
".",
"pu... | URL Template v2.0.6 (https://github.com/bramstein/url-template) | [
"URL",
"Template",
"v2",
".",
"0",
".",
"6",
"(",
"https",
":",
"//",
"github",
".",
"com",
"/",
"bramstein",
"/",
"url",
"-",
"template",
")"
] | fe268fa1d6053ede5f34aef9a11e1a424a70446c | https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L486-L495 | train | Expands a URL with parameters | [
30522,
3853,
7818,
1006,
24471,
2140,
1010,
11498,
5244,
1010,
10857,
1007,
1063,
13075,
1056,
8737,
2140,
1027,
11968,
3366,
1006,
24471,
2140,
1007,
1010,
4423,
1027,
1056,
8737,
2140,
1012,
7818,
1006,
11498,
5244,
1007,
1025,
2065,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataParentBinding.js | fetchPropertyAndType | function fetchPropertyAndType() {
if (bIsAdvertisement) {
// Ensure entity type metadata is loaded even for advertisement so that sync access
// to key properties is possible
return oMetaModel.fetchObject(sFullMetaPath.slice(0,
sFullMetaPath.lastIndexOf("/") + 1));
}
return oMetaModel.fetchObj... | javascript | function fetchPropertyAndType() {
if (bIsAdvertisement) {
// Ensure entity type metadata is loaded even for advertisement so that sync access
// to key properties is possible
return oMetaModel.fetchObject(sFullMetaPath.slice(0,
sFullMetaPath.lastIndexOf("/") + 1));
}
return oMetaModel.fetchObj... | [
"function",
"fetchPropertyAndType",
"(",
")",
"{",
"if",
"(",
"bIsAdvertisement",
")",
"{",
"// Ensure entity type metadata is loaded even for advertisement so that sync access",
"// to key properties is possible",
"return",
"oMetaModel",
".",
"fetchObject",
"(",
"sFullMetaPath",
... | /*
Fetches the property that is reached by the calculated meta path and (if necessary) its
type.
@returns {sap.ui.base.SyncPromise} A promise that is either resolved with the property
or, in case of an action advertisement with the entity. If no property can be reached
by the calculated meta path the promise is resolve... | [
"/",
"*",
"Fetches",
"the",
"property",
"that",
"is",
"reached",
"by",
"the",
"calculated",
"meta",
"path",
"and",
"(",
"if",
"necessary",
")",
"its",
"type",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataParentBinding.js#L556-L575 | train | Fetch the property and its type | [
30522,
3853,
18584,
21572,
4842,
21426,
26379,
18863,
1006,
1007,
1063,
2065,
1006,
20377,
4215,
16874,
5562,
3672,
1007,
1063,
1013,
1013,
5676,
9178,
2828,
27425,
2003,
8209,
2130,
2005,
15147,
2061,
2008,
26351,
3229,
1013,
1013,
2000,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/selenium-core/lib/cssQuery/src/cssQuery-level3.js | nthChild | function nthChild($element, $arguments, $traverse) {
switch ($arguments) {
case "n": return true;
case "even": $arguments = "2n"; break;
case "odd": $arguments = "2n+1";
}
var $$children = childElements($element.parentNode);
function _checkIndex($index) {
var $index = ($traverse == nextElementSibling) ? $$... | javascript | function nthChild($element, $arguments, $traverse) {
switch ($arguments) {
case "n": return true;
case "even": $arguments = "2n"; break;
case "odd": $arguments = "2n+1";
}
var $$children = childElements($element.parentNode);
function _checkIndex($index) {
var $index = ($traverse == nextElementSibling) ? $$... | [
"function",
"nthChild",
"(",
"$element",
",",
"$arguments",
",",
"$traverse",
")",
"{",
"switch",
"(",
"$arguments",
")",
"{",
"case",
"\"n\"",
":",
"return",
"true",
";",
"case",
"\"even\"",
":",
"$arguments",
"=",
"\"2n\"",
";",
"break",
";",
"case",
"... | ----------------------------------------------------------------------- nth child support (Bill Edney) ----------------------------------------------------------------------- | [
"-----------------------------------------------------------------------",
"nth",
"child",
"support",
"(",
"Bill",
"Edney",
")",
"-----------------------------------------------------------------------"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/lib/cssQuery/src/cssQuery-level3.js#L117-L148 | train | Returns true if the element is the nth child of the element | [
30522,
3853,
23961,
16257,
19466,
2094,
1006,
1002,
5783,
1010,
1002,
9918,
1010,
1002,
20811,
1007,
1063,
6942,
1006,
1002,
9918,
1007,
1063,
2553,
1000,
1050,
1000,
1024,
2709,
2995,
1025,
2553,
1000,
2130,
1000,
1024,
1002,
9918,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js | function (oInterface, oPathValue) {
var oRawValue = oPathValue.value,
oSubPathValue,
sType;
Basics.expectType(oPathValue, "object");
if (oRawValue.hasOwnProperty("Type")) {
sType = Basics.property(oPathValue, "Type", "string");
oSubPathValue = Basics.descend(oPathValue, "Value");
} else {
... | javascript | function (oInterface, oPathValue) {
var oRawValue = oPathValue.value,
oSubPathValue,
sType;
Basics.expectType(oPathValue, "object");
if (oRawValue.hasOwnProperty("Type")) {
sType = Basics.property(oPathValue, "Type", "string");
oSubPathValue = Basics.descend(oPathValue, "Value");
} else {
... | [
"function",
"(",
"oInterface",
",",
"oPathValue",
")",
"{",
"var",
"oRawValue",
"=",
"oPathValue",
".",
"value",
",",
"oSubPathValue",
",",
"sType",
";",
"Basics",
".",
"expectType",
"(",
"oPathValue",
",",
"\"object\"",
")",
";",
"if",
"(",
"oRawValue",
"... | Calculates an expression.
@param {sap.ui.core.util.XMLPreprocessor.IContext|sap.ui.model.Context} oInterface
the callback interface related to the current formatter call
@param {object} oPathValue
path and value information pointing to the parameters array (see Expression object)
@returns {object}
the result object | [
"Calculates",
"an",
"expression",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L337-L400 | train | Returns an object representation of the given path value. | [
30522,
3853,
1006,
1051,
18447,
2121,
12172,
1010,
6728,
8988,
10175,
5657,
1007,
1063,
13075,
2030,
10376,
10175,
5657,
1027,
6728,
8988,
10175,
5657,
1012,
3643,
1010,
9808,
12083,
15069,
10175,
5657,
1010,
2358,
18863,
1025,
24078,
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... | |
GoogleChrome/workbox | packages/workbox-build/src/entry-points/get-manifest.js | getManifest | async function getManifest(config) {
// This check needs to be done before validation, since the deprecated options
// will be renamed.
const deprecationWarnings = checkForDeprecatedOptions(config);
const options = validate(config, getManifestSchema);
const {manifestEntries, count, size, warnings} =
awa... | javascript | async function getManifest(config) {
// This check needs to be done before validation, since the deprecated options
// will be renamed.
const deprecationWarnings = checkForDeprecatedOptions(config);
const options = validate(config, getManifestSchema);
const {manifestEntries, count, size, warnings} =
awa... | [
"async",
"function",
"getManifest",
"(",
"config",
")",
"{",
"// This check needs to be done before validation, since the deprecated options",
"// will be renamed.",
"const",
"deprecationWarnings",
"=",
"checkForDeprecatedOptions",
"(",
"config",
")",
";",
"const",
"options",
"... | This method returns a list of URLs to precache, referred to as a "precache
manifest", along with details about the number of entries and their size,
based on the options you provide.
@param {Object} config Please refer to the
[configuration guide](https://developers.google.com/web/tools/workbox/modules/workbox-build#g... | [
"This",
"method",
"returns",
"a",
"list",
"of",
"URLs",
"to",
"precache",
"referred",
"to",
"as",
"a",
"precache",
"manifest",
"along",
"with",
"details",
"about",
"the",
"number",
"of",
"entries",
"and",
"their",
"size",
"based",
"on",
"the",
"options",
"... | 8379c51b6deaf52faed5879206fe84579cae41f0 | https://github.com/GoogleChrome/workbox/blob/8379c51b6deaf52faed5879206fe84579cae41f0/packages/workbox-build/src/entry-points/get-manifest.js#L32-L46 | train | Get the manifest from the specified config | [
30522,
2004,
6038,
2278,
3853,
2131,
20799,
14081,
1006,
9530,
8873,
2290,
1007,
1063,
1013,
1013,
2023,
4638,
3791,
2000,
2022,
2589,
2077,
27354,
1010,
2144,
1996,
2139,
28139,
12921,
7047,
1013,
1013,
2097,
2022,
4096,
1012,
9530,
3367,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/application.js | tryRender | function tryRender(view, options, callback) {
try {
view.render(options, callback);
} catch (err) {
callback(err);
}
} | javascript | function tryRender(view, options, callback) {
try {
view.render(options, callback);
} catch (err) {
callback(err);
}
} | [
"function",
"tryRender",
"(",
"view",
",",
"options",
",",
"callback",
")",
"{",
"try",
"{",
"view",
".",
"render",
"(",
"options",
",",
"callback",
")",
";",
"}",
"catch",
"(",
"err",
")",
"{",
"callback",
"(",
"err",
")",
";",
"}",
"}"
] | Try rendering a view.
@private | [
"Try",
"rendering",
"a",
"view",
"."
] | dc538f6e810bd462c98ee7e6aae24c64d4b1da93 | https://github.com/expressjs/express/blob/dc538f6e810bd462c98ee7e6aae24c64d4b1da93/lib/application.js#L638-L644 | train | Try to render a view using a Knockout algorithm. | [
30522,
3853,
3046,
7389,
4063,
1006,
3193,
1010,
7047,
1010,
2655,
5963,
1007,
1063,
3046,
1063,
3193,
1012,
17552,
1006,
7047,
1010,
2655,
5963,
1007,
1025,
1065,
4608,
1006,
9413,
2099,
1007,
1063,
2655,
5963,
1006,
9413,
2099,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Microsoft/vscode | src/main.js | getUserDefinedLocale | function getUserDefinedLocale() {
const locale = args['locale'];
if (locale) {
return Promise.resolve(locale.toLowerCase());
}
const localeConfig = path.join(userDataPath, 'User', 'locale.json');
return bootstrap.readFile(localeConfig).then(content => {
content = stripComments(content);
try {
const value... | javascript | function getUserDefinedLocale() {
const locale = args['locale'];
if (locale) {
return Promise.resolve(locale.toLowerCase());
}
const localeConfig = path.join(userDataPath, 'User', 'locale.json');
return bootstrap.readFile(localeConfig).then(content => {
content = stripComments(content);
try {
const value... | [
"function",
"getUserDefinedLocale",
"(",
")",
"{",
"const",
"locale",
"=",
"args",
"[",
"'locale'",
"]",
";",
"if",
"(",
"locale",
")",
"{",
"return",
"Promise",
".",
"resolve",
"(",
"locale",
".",
"toLowerCase",
"(",
")",
")",
";",
"}",
"const",
"loca... | Language tags are case insensitive however an amd loader is case sensitive To make this work on case preserving & insensitive FS we do the following: the language bundles have lower case language tags and we always lower case the locale we receive from the user or OS.
@returns {Promise<string>} | [
"Language",
"tags",
"are",
"case",
"insensitive",
"however",
"an",
"amd",
"loader",
"is",
"case",
"sensitive",
"To",
"make",
"this",
"work",
"on",
"case",
"preserving",
"&",
"insensitive",
"FS",
"we",
"do",
"the",
"following",
":",
"the",
"language",
"bundle... | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/src/main.js#L331-L349 | train | Get the user defined locale | [
30522,
3853,
2131,
20330,
3207,
23460,
19422,
24755,
2571,
1006,
1007,
1063,
9530,
3367,
2334,
2063,
1027,
12098,
5620,
1031,
1005,
2334,
2063,
1005,
1033,
1025,
2065,
1006,
2334,
2063,
1007,
1063,
2709,
4872,
1012,
10663,
1006,
2334,
2063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ccxt/ccxt | build/export-exchanges.js | replaceInFile | function replaceInFile (filename, regex, replacement) {
log.bright.cyan ('Exporting exchanges →', filename.yellow)
let contents = fs.readFileSync (filename, 'utf8')
const newContents = contents.replace (regex, replacement)
fs.truncateSync (filename)
fs.writeFileSync (filename, newContents)
} | javascript | function replaceInFile (filename, regex, replacement) {
log.bright.cyan ('Exporting exchanges →', filename.yellow)
let contents = fs.readFileSync (filename, 'utf8')
const newContents = contents.replace (regex, replacement)
fs.truncateSync (filename)
fs.writeFileSync (filename, newContents)
} | [
"function",
"replaceInFile",
"(",
"filename",
",",
"regex",
",",
"replacement",
")",
"{",
"log",
".",
"bright",
".",
"cyan",
"(",
"'Exporting exchanges →', ",
"f",
"lename.y",
"e",
"llow)",
"",
"let",
"contents",
"=",
"fs",
".",
"readFileSync",
"(",
"filenam... | ---------------------------------------------------------------------------- | [
"----------------------------------------------------------------------------"
] | 8168069b9180a465532905e225586215e115a565 | https://github.com/ccxt/ccxt/blob/8168069b9180a465532905e225586215e115a565/build/export-exchanges.js#L31-L37 | train | Replace a string in a file | [
30522,
3853,
5672,
2378,
8873,
2571,
1006,
5371,
18442,
1010,
19723,
10288,
1010,
30524,
1007,
9530,
3367,
2047,
8663,
6528,
3215,
1027,
8417,
1012,
5672,
1006,
19723,
10288,
1010,
6110,
1007,
1042,
2015,
1012,
19817,
4609,
16280,
6508,
122... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
codemirror/CodeMirror | src/display/update_display.js | patchDisplay | function patchDisplay(cm, updateNumbersFrom, dims) {
let display = cm.display, lineNumbers = cm.options.lineNumbers
let container = display.lineDiv, cur = container.firstChild
function rm(node) {
let next = node.nextSibling
// Works around a throw-scroll bug in OS X Webkit
if (webkit && mac && cm.dis... | javascript | function patchDisplay(cm, updateNumbersFrom, dims) {
let display = cm.display, lineNumbers = cm.options.lineNumbers
let container = display.lineDiv, cur = container.firstChild
function rm(node) {
let next = node.nextSibling
// Works around a throw-scroll bug in OS X Webkit
if (webkit && mac && cm.dis... | [
"function",
"patchDisplay",
"(",
"cm",
",",
"updateNumbersFrom",
",",
"dims",
")",
"{",
"let",
"display",
"=",
"cm",
".",
"display",
",",
"lineNumbers",
"=",
"cm",
".",
"options",
".",
"lineNumbers",
"let",
"container",
"=",
"display",
".",
"lineDiv",
",",... | Sync the actual display DOM structure with display.view, removing nodes for lines that are no longer in view, and creating the ones that are not there yet, and updating the ones that are out of date. | [
"Sync",
"the",
"actual",
"display",
"DOM",
"structure",
"with",
"display",
".",
"view",
"removing",
"nodes",
"for",
"lines",
"that",
"are",
"no",
"longer",
"in",
"view",
"and",
"creating",
"the",
"ones",
"that",
"are",
"not",
"there",
"yet",
"and",
"updati... | dab6f676107c10ba8d16c654a42f66cae3f27db1 | https://github.com/codemirror/CodeMirror/blob/dab6f676107c10ba8d16c654a42f66cae3f27db1/src/display/update_display.js#L209-L249 | train | Patch the display with the line number and dimensions | [
30522,
3853,
8983,
10521,
13068,
1006,
4642,
1010,
10651,
19172,
17198,
19699,
5358,
1010,
11737,
2015,
1007,
1063,
2292,
4653,
1027,
4642,
1012,
4653,
1010,
17517,
29440,
2015,
1027,
4642,
1012,
7047,
1012,
17517,
29440,
2015,
2292,
11661,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
BlackrockDigital/startbootstrap-sb-admin-2 | vendor/chart.js/Chart.js | function(label) {
var me = this;
var ticksOpts = me.options.ticks;
var tickLabelWidth = me.ctx.measureText(label).width;
var angle = helpers$1.toRadians(ticksOpts.maxRotation);
var cosRotation = Math.cos(angle);
var sinRotation = Math.sin(angle);
var tickFontSize = valueOrDefault$c(ticksOpts.fontSize, cor... | javascript | function(label) {
var me = this;
var ticksOpts = me.options.ticks;
var tickLabelWidth = me.ctx.measureText(label).width;
var angle = helpers$1.toRadians(ticksOpts.maxRotation);
var cosRotation = Math.cos(angle);
var sinRotation = Math.sin(angle);
var tickFontSize = valueOrDefault$c(ticksOpts.fontSize, cor... | [
"function",
"(",
"label",
")",
"{",
"var",
"me",
"=",
"this",
";",
"var",
"ticksOpts",
"=",
"me",
".",
"options",
".",
"ticks",
";",
"var",
"tickLabelWidth",
"=",
"me",
".",
"ctx",
".",
"measureText",
"(",
"label",
")",
".",
"width",
";",
"var",
"a... | Crude approximation of what the label width might be
@private | [
"Crude",
"approximation",
"of",
"what",
"the",
"label",
"width",
"might",
"be"
] | ddfaceb4a8e65a41f163e2fdc4eab49384b810a1 | https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/ddfaceb4a8e65a41f163e2fdc4eab49384b810a1/vendor/chart.js/Chart.js#L13279-L13289 | train | Calculate the width of the tick label | [
30522,
3853,
1006,
3830,
1007,
1063,
13075,
2033,
1027,
2023,
1025,
13075,
16356,
28793,
3215,
1027,
2033,
1012,
7047,
1012,
16356,
2015,
30524,
13075,
2522,
21338,
17287,
3508,
1027,
8785,
1012,
2522,
2015,
1006,
6466,
1007,
1025,
13075,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Requestor.js | function (aRequests) {
aRequests.forEach(function (oRequest) {
if (Array.isArray(oRequest)) {
_Requestor.cleanBatch(oRequest);
} else {
oRequest.body = _Requestor.cleanPayload(oRequest.body);
}
});
return aRequests;
} | javascript | function (aRequests) {
aRequests.forEach(function (oRequest) {
if (Array.isArray(oRequest)) {
_Requestor.cleanBatch(oRequest);
} else {
oRequest.body = _Requestor.cleanPayload(oRequest.body);
}
});
return aRequests;
} | [
"function",
"(",
"aRequests",
")",
"{",
"aRequests",
".",
"forEach",
"(",
"function",
"(",
"oRequest",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"oRequest",
")",
")",
"{",
"_Requestor",
".",
"cleanBatch",
"(",
"oRequest",
")",
";",
"}",
"else"... | Recursively cleans the payload of all contained requests via {@link #.cleanPayload}.
Modifies the array in-place.
@param {object[]} aRequests
The requests
@returns {object[]}
The cleaned requests
@private | [
"Recursively",
"cleans",
"the",
"payload",
"of",
"all",
"contained",
"requests",
"via",
"{",
"@link",
"#",
".",
"cleanPayload",
"}",
".",
"Modifies",
"the",
"array",
"in",
"-",
"place",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Requestor.js#L1448-L1457 | train | clean the request body | [
30522,
3853,
1006,
2024,
15500,
2015,
1007,
1063,
2024,
15500,
2015,
1012,
18921,
6776,
1006,
3853,
1006,
10848,
15500,
1007,
1063,
2065,
1006,
9140,
1012,
18061,
11335,
2100,
1006,
10848,
15500,
1007,
1007,
1063,
1035,
5227,
2953,
1012,
45... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aws/aws-sdk-js | lib/services/s3.js | willComputeChecksums | function willComputeChecksums(req) {
if (this.computableChecksumOperations[req.operation]) return true;
if (!this.config.computeChecksums) return false;
// TODO: compute checksums for Stream objects
if (!AWS.util.Buffer.isBuffer(req.httpRequest.body) &&
typeof req.httpRequest.body !== 'string')... | javascript | function willComputeChecksums(req) {
if (this.computableChecksumOperations[req.operation]) return true;
if (!this.config.computeChecksums) return false;
// TODO: compute checksums for Stream objects
if (!AWS.util.Buffer.isBuffer(req.httpRequest.body) &&
typeof req.httpRequest.body !== 'string')... | [
"function",
"willComputeChecksums",
"(",
"req",
")",
"{",
"if",
"(",
"this",
".",
"computableChecksumOperations",
"[",
"req",
".",
"operation",
"]",
")",
"return",
"true",
";",
"if",
"(",
"!",
"this",
".",
"config",
".",
"computeChecksums",
")",
"return",
... | Checks whether checksums should be computed for the request.
If the request requires checksums to be computed, this will always
return true, otherwise it depends on whether {AWS.Config.computeChecksums}
is set.
@param req [AWS.Request] the request to check against
@return [Boolean] whether to compute checksums for a r... | [
"Checks",
"whether",
"checksums",
"should",
"be",
"computed",
"for",
"the",
"request",
".",
"If",
"the",
"request",
"requires",
"checksums",
"to",
"be",
"computed",
"this",
"will",
"always",
"return",
"true",
"otherwise",
"it",
"depends",
"on",
"whether",
"{",... | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L325-L350 | train | Compute checksums for the given request | [
30522,
3853,
2097,
9006,
18780,
27635,
10603,
18163,
1006,
2128,
4160,
1007,
1063,
2065,
1006,
2023,
1012,
4012,
18780,
3085,
5403,
10603,
2819,
25918,
10708,
1031,
2128,
4160,
1012,
3169,
1033,
1007,
2709,
2995,
1025,
2065,
1006,
999,
2023... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
material-components/material-components-web | scripts/cp-pkgs.js | dtsBundler | function dtsBundler() {
const packageDirectories = fs.readdirSync(D_TS_DIRECTORY);
packageDirectories.forEach((packageDirectory) => {
const packagePath = path.join(PACKAGES_DIRECTORY, packageDirectory);
const name = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json'), 'utf8')).name;
const ... | javascript | function dtsBundler() {
const packageDirectories = fs.readdirSync(D_TS_DIRECTORY);
packageDirectories.forEach((packageDirectory) => {
const packagePath = path.join(PACKAGES_DIRECTORY, packageDirectory);
const name = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json'), 'utf8')).name;
const ... | [
"function",
"dtsBundler",
"(",
")",
"{",
"const",
"packageDirectories",
"=",
"fs",
".",
"readdirSync",
"(",
"D_TS_DIRECTORY",
")",
";",
"packageDirectories",
".",
"forEach",
"(",
"(",
"packageDirectory",
")",
"=>",
"{",
"const",
"packagePath",
"=",
"path",
"."... | Imports all files in index.d.ts and compiles a bundled .d.ts file for UMD bundles. | [
"Imports",
"all",
"files",
"in",
"index",
".",
"d",
".",
"ts",
"and",
"compiles",
"a",
"bundled",
".",
"d",
".",
"ts",
"file",
"for",
"UMD",
"bundles",
"."
] | 9f8b9ae5103ff86de4f6a5cb02e700d6eb851e5f | https://github.com/material-components/material-components-web/blob/9f8b9ae5103ff86de4f6a5cb02e700d6eb851e5f/scripts/cp-pkgs.js#L112-L129 | train | Bundle all the UMD declarations in the package. json | [
30522,
3853,
26718,
19022,
8630,
3917,
1006,
1007,
1063,
9530,
3367,
21972,
7442,
16761,
3111,
1027,
1042,
2015,
1012,
3191,
4305,
2869,
6038,
2278,
1006,
1040,
1035,
24529,
1035,
14176,
1007,
1025,
21972,
7442,
16761,
3111,
1012,
18921,
67... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/type/DateTimeBase.js | setConstraints | function setConstraints(oType, oConstraints) {
var vNullable,
iPrecision;
oType.oConstraints = undefined;
if (oConstraints) {
vNullable = oConstraints.nullable;
if (vNullable === false || vNullable === "false") {
oType.oConstraints = {nullable : false};
} else if (vNullable !== undefined && vNull... | javascript | function setConstraints(oType, oConstraints) {
var vNullable,
iPrecision;
oType.oConstraints = undefined;
if (oConstraints) {
vNullable = oConstraints.nullable;
if (vNullable === false || vNullable === "false") {
oType.oConstraints = {nullable : false};
} else if (vNullable !== undefined && vNull... | [
"function",
"setConstraints",
"(",
"oType",
",",
"oConstraints",
")",
"{",
"var",
"vNullable",
",",
"iPrecision",
";",
"oType",
".",
"oConstraints",
"=",
"undefined",
";",
"if",
"(",
"oConstraints",
")",
"{",
"vNullable",
"=",
"oConstraints",
".",
"nullable",
... | /*
Sets the constraints.
@param {sap.ui.model.odata.type.DateTimeBase} oType
The type instance
@param {object} [oConstraints]
Constraints, see {@link #constructor} | [
"/",
"*",
"Sets",
"the",
"constraints",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/DateTimeBase.js#L76-L105 | train | Sets constraints for the given type | [
30522,
3853,
2275,
8663,
20528,
18447,
2015,
1006,
27178,
18863,
1010,
1051,
8663,
20528,
18447,
2015,
1007,
1063,
13075,
1058,
11231,
4571,
3468,
1010,
12997,
2890,
28472,
1025,
27178,
18863,
1012,
1051,
8663,
20528,
18447,
2015,
1027,
6151,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/SearchPage.controller.js | function () {
var oView = this.getView(),
// Collect all possible items from all lists
aItems = [].concat(
oView.byId("allList").getItems(),
oView.byId("apiList").getItems(),
oView.byId("documentationList").getItems(),
oView.byId("samplesList").getItems()
),
iLen = aItems... | javascript | function () {
var oView = this.getView(),
// Collect all possible items from all lists
aItems = [].concat(
oView.byId("allList").getItems(),
oView.byId("apiList").getItems(),
oView.byId("documentationList").getItems(),
oView.byId("samplesList").getItems()
),
iLen = aItems... | [
"function",
"(",
")",
"{",
"var",
"oView",
"=",
"this",
".",
"getView",
"(",
")",
",",
"// Collect all possible items from all lists",
"aItems",
"=",
"[",
"]",
".",
"concat",
"(",
"oView",
".",
"byId",
"(",
"\"allList\"",
")",
".",
"getItems",
"(",
")",
... | Modify all search result links
@private | [
"Modify",
"all",
"search",
"result",
"links"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/SearchPage.controller.js#L232-L252 | train | This method is called when the list is empty | [
30522,
3853,
1006,
1007,
1063,
13075,
1051,
8584,
1027,
2023,
1012,
2131,
8584,
1006,
1007,
1010,
1013,
1013,
8145,
2035,
2825,
5167,
2013,
2035,
7201,
9932,
18532,
2015,
1027,
1031,
1033,
1012,
9530,
11266,
1006,
1051,
8584,
1012,
2011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/view/WorkspaceManager.js | calcAvailableHeight | function calcAvailableHeight() {
var availableHt = $windowContent.height();
$editorHolder.siblings().each(function (i, elem) {
var $elem = $(elem);
if ($elem.css("display") !== "none" && $elem.css("position") !== "absolute") {
availableHt -= $elem.outerHeight();
... | javascript | function calcAvailableHeight() {
var availableHt = $windowContent.height();
$editorHolder.siblings().each(function (i, elem) {
var $elem = $(elem);
if ($elem.css("display") !== "none" && $elem.css("position") !== "absolute") {
availableHt -= $elem.outerHeight();
... | [
"function",
"calcAvailableHeight",
"(",
")",
"{",
"var",
"availableHt",
"=",
"$windowContent",
".",
"height",
"(",
")",
";",
"$editorHolder",
".",
"siblings",
"(",
")",
".",
"each",
"(",
"function",
"(",
"i",
",",
"elem",
")",
"{",
"var",
"$elem",
"=",
... | Calculates the available height for the full-size Editor (or the no-editor placeholder),
accounting for the current size of all visible panels, toolbar, & status bar.
@return {number} | [
"Calculates",
"the",
"available",
"height",
"for",
"the",
"full",
"-",
"size",
"Editor",
"(",
"or",
"the",
"no",
"-",
"editor",
"placeholder",
")",
"accounting",
"for",
"the",
"current",
"size",
"of",
"all",
"visible",
"panels",
"toolbar",
"&",
"status",
"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/WorkspaceManager.js#L76-L88 | train | Calculate available height of the editor | [
30522,
3853,
10250,
3540,
3567,
11733,
3468,
26036,
13900,
1006,
1007,
1063,
13075,
2800,
11039,
1027,
1002,
3332,
8663,
6528,
2102,
1012,
4578,
1006,
1007,
1025,
1002,
3559,
14528,
1012,
9504,
1006,
1007,
30524,
1004,
1004,
1002,
3449,
663... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function() {
var ranges = [],
r = this.getRange(),
tmpRanges;
if (r) { ranges.push(r); }
if (this.unselectableClass && this.contain && r) {
var uneditables = this.getOwnUneditables(),
tmpRange;
if (uneditables.length > 0) {
for (var ... | javascript | function() {
var ranges = [],
r = this.getRange(),
tmpRanges;
if (r) { ranges.push(r); }
if (this.unselectableClass && this.contain && r) {
var uneditables = this.getOwnUneditables(),
tmpRange;
if (uneditables.length > 0) {
for (var ... | [
"function",
"(",
")",
"{",
"var",
"ranges",
"=",
"[",
"]",
",",
"r",
"=",
"this",
".",
"getRange",
"(",
")",
",",
"tmpRanges",
";",
"if",
"(",
"r",
")",
"{",
"ranges",
".",
"push",
"(",
"r",
")",
";",
"}",
"if",
"(",
"this",
".",
"unselectabl... | Returns an array of ranges that belong only to this editable Needed as uneditable block in contenteditabel can split range into pieces If manipulating content reverse loop is usually needed as manipulation can shift subsequent ranges | [
"Returns",
"an",
"array",
"of",
"ranges",
"that",
"belong",
"only",
"to",
"this",
"editable",
"Needed",
"as",
"uneditable",
"block",
"in",
"contenteditabel",
"can",
"split",
"range",
"into",
"pieces",
"If",
"manipulating",
"content",
"reverse",
"loop",
"is",
"... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L9434-L9474 | train | Returns an array of ranges | [
30522,
3853,
1006,
1007,
1063,
13075,
8483,
1027,
1031,
1033,
1010,
1054,
1027,
2023,
1012,
2131,
24388,
2063,
1006,
1007,
1010,
1056,
8737,
24388,
2229,
1025,
2065,
1006,
1054,
1007,
1063,
8483,
1012,
5245,
1006,
1054,
1007,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | grunt/config/connect.js | function(connect, options, middlewares) {
// make sure to put the middleware after "cors"
// if "watch" is enabled, there will be another livereload middleware in between
middlewares.splice(grunt.option('watch') ? 3 : 2, 0, [ '/' + testsuiteName + '/resources/sap/ui/Global.js', function(req, res, next) {... | javascript | function(connect, options, middlewares) {
// make sure to put the middleware after "cors"
// if "watch" is enabled, there will be another livereload middleware in between
middlewares.splice(grunt.option('watch') ? 3 : 2, 0, [ '/' + testsuiteName + '/resources/sap/ui/Global.js', function(req, res, next) {... | [
"function",
"(",
"connect",
",",
"options",
",",
"middlewares",
")",
"{",
"// make sure to put the middleware after \"cors\"",
"// if \"watch\" is enabled, there will be another livereload middleware in between",
"middlewares",
".",
"splice",
"(",
"grunt",
".",
"option",
"(",
"... | hacky solution to replace the "version" placeholder in sap/ui/Global.js to enable version comparison the file won't be cached | [
"hacky",
"solution",
"to",
"replace",
"the",
"version",
"placeholder",
"in",
"sap",
"/",
"ui",
"/",
"Global",
".",
"js",
"to",
"enable",
"version",
"comparison",
"the",
"file",
"won",
"t",
"be",
"cached"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/grunt/config/connect.js#L49-L134 | train | This function is called by the sap - ui - plugin to load the sap - ui - core. js and the sap - ui - version. json files | [
30522,
3853,
1006,
7532,
1010,
7047,
1010,
2690,
8059,
2015,
1007,
1063,
1013,
1013,
2191,
2469,
2000,
2404,
1996,
2690,
8059,
2044,
1000,
2522,
2869,
1000,
1013,
1013,
2065,
1000,
3422,
1000,
2003,
9124,
1010,
2045,
2097,
2022,
2178,
112... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
moleculerjs/moleculer | bin/moleculer-runner.js | loadConfigFile | function loadConfigFile() {
let filePath;
if (flags.config) {
filePath = path.isAbsolute(flags.config) ? flags.config : path.resolve(process.cwd(), flags.config);
}
if (!filePath && fs.existsSync(path.resolve(process.cwd(), "moleculer.config.js"))) {
filePath = path.resolve(process.cwd(), "moleculer.config.js")... | javascript | function loadConfigFile() {
let filePath;
if (flags.config) {
filePath = path.isAbsolute(flags.config) ? flags.config : path.resolve(process.cwd(), flags.config);
}
if (!filePath && fs.existsSync(path.resolve(process.cwd(), "moleculer.config.js"))) {
filePath = path.resolve(process.cwd(), "moleculer.config.js")... | [
"function",
"loadConfigFile",
"(",
")",
"{",
"let",
"filePath",
";",
"if",
"(",
"flags",
".",
"config",
")",
"{",
"filePath",
"=",
"path",
".",
"isAbsolute",
"(",
"flags",
".",
"config",
")",
"?",
"flags",
".",
"config",
":",
"path",
".",
"resolve",
... | Load configuration file
Try to load a configuration file in order to:
- load file which is defined in CLI option with --config
- try to load the `moleculer.config.js` file if exist in the cwd
- try to load the `moleculer.config.json` file if exist in the cwd | [
"Load",
"configuration",
"file"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/bin/moleculer-runner.js#L125-L152 | train | Load the config file | [
30522,
3853,
7170,
8663,
8873,
25708,
9463,
1006,
1007,
1063,
2292,
5371,
15069,
1025,
2065,
1006,
9245,
1012,
9530,
8873,
2290,
1007,
1063,
5371,
15069,
1027,
4130,
1012,
18061,
5910,
4747,
10421,
1006,
9245,
1012,
9530,
8873,
2290,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | reportAndThrowError | function reportAndThrowError(oMetaModel, sMessage, sDetails) {
var oError = new Error(sDetails + ": " + sMessage);
oMetaModel.oModel.reportError(sMessage, sODataMetaModel, oError);
throw oError;
} | javascript | function reportAndThrowError(oMetaModel, sMessage, sDetails) {
var oError = new Error(sDetails + ": " + sMessage);
oMetaModel.oModel.reportError(sMessage, sODataMetaModel, oError);
throw oError;
} | [
"function",
"reportAndThrowError",
"(",
"oMetaModel",
",",
"sMessage",
",",
"sDetails",
")",
"{",
"var",
"oError",
"=",
"new",
"Error",
"(",
"sDetails",
"+",
"\": \"",
"+",
"sMessage",
")",
";",
"oMetaModel",
".",
"oModel",
".",
"reportError",
"(",
"sMessage... | Reports an error with the given message and details and throws it.
@param {sap.ui.model.odata.v4.ODataMetaModel} oMetaModel
The OData metadata model
@param {string} sMessage
Error message
@param {string} sDetails
Error details
@throws {Error} | [
"Reports",
"an",
"error",
"with",
"the",
"given",
"message",
"and",
"details",
"and",
"throws",
"it",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L316-L321 | train | Reports an error and throws it. | [
30522,
3853,
3189,
5685,
2705,
10524,
2121,
29165,
1006,
18168,
12928,
5302,
9247,
1010,
15488,
7971,
4270,
1010,
17371,
12928,
12146,
1007,
1063,
13075,
1051,
2121,
29165,
1027,
2047,
7561,
1006,
17371,
12928,
12146,
1009,
1000,
1024,
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.ui.core/src/sap/ui/base/ManagedObject.js | removeBinding | function removeBinding(oBindingInfo) {
// Also tell the Control that the messages have been removed (if any)
if (that.refreshDataState) {
that.refreshDataState(sName, oBindingInfo.binding.getDataState());
}
oBindingInfo.binding.detachChange(oBindingInfo.modelChangeHandler);
if (oBindingInfo.modelRef... | javascript | function removeBinding(oBindingInfo) {
// Also tell the Control that the messages have been removed (if any)
if (that.refreshDataState) {
that.refreshDataState(sName, oBindingInfo.binding.getDataState());
}
oBindingInfo.binding.detachChange(oBindingInfo.modelChangeHandler);
if (oBindingInfo.modelRef... | [
"function",
"removeBinding",
"(",
"oBindingInfo",
")",
"{",
"// Also tell the Control that the messages have been removed (if any)",
"if",
"(",
"that",
".",
"refreshDataState",
")",
"{",
"that",
".",
"refreshDataState",
"(",
"sName",
",",
"oBindingInfo",
".",
"binding",
... | /*
Remove binding, detach all events and destroy binding object | [
"/",
"*",
"Remove",
"binding",
"detach",
"all",
"events",
"and",
"destroy",
"binding",
"object"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ManagedObject.js#L4207-L4224 | train | Removes the binding from the control | [
30522,
3853,
6366,
8428,
4667,
1006,
27885,
22254,
2075,
2378,
14876,
1007,
1063,
1013,
1013,
2036,
2425,
1996,
2491,
2008,
1996,
7696,
2031,
2042,
3718,
1006,
2065,
2151,
1007,
2065,
1006,
2008,
1012,
25416,
21898,
2850,
10230,
12259,
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/changeHandler/BaseRename.js | function(oChange, oControl, mPropertyBag) {
var oModifier = mPropertyBag.modifier;
var sPropertyName = mRenameSettings.propertyName;
var oChangeDefinition = oChange.getDefinition();
var sText = oChangeDefinition.texts[mRenameSettings.changePropertyName];
var sValue = sText.value;
if (oCha... | javascript | function(oChange, oControl, mPropertyBag) {
var oModifier = mPropertyBag.modifier;
var sPropertyName = mRenameSettings.propertyName;
var oChangeDefinition = oChange.getDefinition();
var sText = oChangeDefinition.texts[mRenameSettings.changePropertyName];
var sValue = sText.value;
if (oCha... | [
"function",
"(",
"oChange",
",",
"oControl",
",",
"mPropertyBag",
")",
"{",
"var",
"oModifier",
"=",
"mPropertyBag",
".",
"modifier",
";",
"var",
"sPropertyName",
"=",
"mRenameSettings",
".",
"propertyName",
";",
"var",
"oChangeDefinition",
"=",
"oChange",
".",
... | Renames a control.
@param {sap.ui.fl.Change} oChange change wrapper object with instructions to be applied on the control map
@param {sap.ui.core.Control} oControl Control that matches the change selector for applying the change
@param {object} mPropertyBag property bag
@param {object} mPropertyBag.modifier modifier f... | [
"Renames",
"a",
"control",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/changeHandler/BaseRename.js#L46-L61 | train | Applies a rename change to the control | [
30522,
3853,
1006,
28166,
22043,
1010,
1051,
8663,
13181,
2140,
1010,
6131,
18981,
15010,
16078,
1007,
1063,
13075,
18168,
7716,
18095,
1027,
6131,
18981,
15010,
16078,
1012,
16913,
18095,
1025,
13075,
11867,
18981,
15010,
18442,
1027,
2720,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | showErrorMessage | function showErrorMessage(message) {
var analyticsDescriptionMessage = "";
switch (message) {
case _nodeErrorMessages.UPDATEDIR_READ_FAILED:
analyticsDescriptionMessage = "Update directory could not be read.";
break;
case _nodeErrorMessages.UPDATEDIR_CLEAN_FAILED... | javascript | function showErrorMessage(message) {
var analyticsDescriptionMessage = "";
switch (message) {
case _nodeErrorMessages.UPDATEDIR_READ_FAILED:
analyticsDescriptionMessage = "Update directory could not be read.";
break;
case _nodeErrorMessages.UPDATEDIR_CLEAN_FAILED... | [
"function",
"showErrorMessage",
"(",
"message",
")",
"{",
"var",
"analyticsDescriptionMessage",
"=",
"\"\"",
";",
"switch",
"(",
"message",
")",
"{",
"case",
"_nodeErrorMessages",
".",
"UPDATEDIR_READ_FAILED",
":",
"analyticsDescriptionMessage",
"=",
"\"Update directory... | Handles the error messages from Node, in a popup displayed to the user.
@param {string} message - error string | [
"Handles",
"the",
"error",
"messages",
"from",
"Node",
"in",
"a",
"popup",
"displayed",
"to",
"the",
"user",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L778-L797 | train | Show an error message | [
30522,
3853,
6457,
29165,
7834,
3736,
3351,
1006,
4471,
1007,
1063,
13075,
25095,
6155,
23235,
3258,
7834,
3736,
3351,
1027,
1000,
1000,
1025,
6942,
1006,
4471,
1007,
1063,
2553,
1035,
13045,
2121,
29165,
7834,
3736,
8449,
1012,
7172,
4313,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wangfupeng1988/wangEditor | src/js/menus/link/index.js | function (text, link) {
const editor = this.editor
const config = editor.config
const linkCheck = config.linkCheck
let checkResult = true // 默认为 true
if (linkCheck && typeof linkCheck === 'function') {
checkResult = linkCheck(text, link)
}
if (checkRes... | javascript | function (text, link) {
const editor = this.editor
const config = editor.config
const linkCheck = config.linkCheck
let checkResult = true // 默认为 true
if (linkCheck && typeof linkCheck === 'function') {
checkResult = linkCheck(text, link)
}
if (checkRes... | [
"function",
"(",
"text",
",",
"link",
")",
"{",
"const",
"editor",
"=",
"this",
".",
"editor",
"const",
"config",
"=",
"editor",
".",
"config",
"const",
"linkCheck",
"=",
"config",
".",
"linkCheck",
"let",
"checkResult",
"=",
"true",
"// 默认为 true",
"if",
... | 插入链接 | [
"插入链接"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/menus/link/index.js#L135-L148 | train | Link Text | [
30522,
3853,
1006,
3793,
1010,
4957,
1007,
1063,
9530,
3367,
3559,
1027,
2023,
1012,
3559,
9530,
3367,
9530,
8873,
2290,
1027,
3559,
1012,
9530,
8873,
2290,
9530,
3367,
4957,
5403,
3600,
1027,
9530,
8873,
2290,
1012,
4957,
5403,
3600,
229... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/spaced-comment.js | checkCommentForSpace | function checkCommentForSpace(node) {
const type = node.type.toLowerCase(),
rule = styleRules[type],
commentIdentifier = type === "block" ? "/*" : "//";
// Ignores empty comments.
if (node.value.length === 0) {
return;
}
... | javascript | function checkCommentForSpace(node) {
const type = node.type.toLowerCase(),
rule = styleRules[type],
commentIdentifier = type === "block" ? "/*" : "//";
// Ignores empty comments.
if (node.value.length === 0) {
return;
}
... | [
"function",
"checkCommentForSpace",
"(",
"node",
")",
"{",
"const",
"type",
"=",
"node",
".",
"type",
".",
"toLowerCase",
"(",
")",
",",
"rule",
"=",
"styleRules",
"[",
"type",
"]",
",",
"commentIdentifier",
"=",
"type",
"===",
"\"block\"",
"?",
"\"/*\"",
... | Reports a given comment if it's invalid.
@param {ASTNode} node - a comment node to check.
@returns {void} | [
"Reports",
"a",
"given",
"comment",
"if",
"it",
"s",
"invalid",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/spaced-comment.js#L323-L365 | train | Checks if a comment is a space or tab. | [
30522,
3853,
4638,
9006,
3672,
29278,
23058,
1006,
13045,
1007,
1063,
9530,
3367,
2828,
1027,
13045,
1012,
2828,
1012,
2000,
27663,
18992,
3366,
1006,
1007,
1010,
3627,
1027,
2806,
6820,
4244,
1031,
2828,
1033,
1010,
7615,
5178,
16778,
8873... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
moment/luxon | src/impl/regexParser.js | combineRegexes | function combineRegexes(...regexes) {
const full = regexes.reduce((f, r) => f + r.source, "");
return RegExp(`^${full}$`);
} | javascript | function combineRegexes(...regexes) {
const full = regexes.reduce((f, r) => f + r.source, "");
return RegExp(`^${full}$`);
} | [
"function",
"combineRegexes",
"(",
"...",
"regexes",
")",
"{",
"const",
"full",
"=",
"regexes",
".",
"reduce",
"(",
"(",
"f",
",",
"r",
")",
"=>",
"f",
"+",
"r",
".",
"source",
",",
"\"\"",
")",
";",
"return",
"RegExp",
"(",
"`",
"${",
"full",
"}... | /*
This file handles parsing for well-specified formats. Here's how it works:
Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.
An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object
parse() does the work of e... | [
"/",
"*",
"This",
"file",
"handles",
"parsing",
"for",
"well",
"-",
"specified",
"formats",
".",
"Here",
"s",
"how",
"it",
"works",
":",
"Two",
"things",
"go",
"into",
"parsing",
":",
"a",
"regex",
"to",
"match",
"with",
"and",
"an",
"extractor",
"to",... | 236f2badea297ee73421aa39a83e06177c1be6d0 | https://github.com/moment/luxon/blob/236f2badea297ee73421aa39a83e06177c1be6d0/src/impl/regexParser.js#L16-L19 | train | Combine multiple regular expressions into one | [
30522,
3853,
11506,
2890,
3351,
20156,
1006,
1012,
1012,
1012,
19723,
10288,
2229,
1007,
1063,
9530,
3367,
2440,
1027,
19723,
10288,
2229,
1012,
5547,
1006,
1006,
1042,
1010,
1054,
1007,
1027,
1028,
1042,
1009,
1054,
1012,
3120,
1010,
1000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/closure/goog/module/modulemanager.js | function(requestedId) {
var requestedDeps =
this.getNotYetLoadedTransitiveDepIds_(requestedId);
return goog.array.some(failedIds, function(id) {
return goog.array.contains(requestedDeps, id);
});
} | javascript | function(requestedId) {
var requestedDeps =
this.getNotYetLoadedTransitiveDepIds_(requestedId);
return goog.array.some(failedIds, function(id) {
return goog.array.contains(requestedDeps, id);
});
} | [
"function",
"(",
"requestedId",
")",
"{",
"var",
"requestedDeps",
"=",
"this",
".",
"getNotYetLoadedTransitiveDepIds_",
"(",
"requestedId",
")",
";",
"return",
"goog",
".",
"array",
".",
"some",
"(",
"failedIds",
",",
"function",
"(",
"id",
")",
"{",
"return... | Returns true if the requestedId has dependencies on the modules that
just failed to load.
@param {string} requestedId The module to check for dependencies.
@return {boolean} True if the module depends on failed modules. | [
"Returns",
"true",
"if",
"the",
"requestedId",
"has",
"dependencies",
"on",
"the",
"modules",
"that",
"just",
"failed",
"to",
"load",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/closure/goog/module/modulemanager.js#L1220-L1226 | train | Returns true if the requested id is not a dependency of any other dependency. | [
30522,
3853,
1006,
7303,
3593,
1007,
1063,
13075,
7303,
3207,
4523,
1027,
2023,
1012,
2131,
17048,
6672,
19646,
10441,
5732,
6494,
3619,
13043,
3207,
23267,
2015,
1035,
1006,
7303,
3593,
1007,
1025,
2709,
27571,
2290,
1012,
9140,
1012,
2070... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
BrainJS/brain.js | dist/recurrent/matrix/add.js | add | function add(product, left, right) {
for (var i = 0; i < left.weights.length; i++) {
product.weights[i] = left.weights[i] + right.weights[i];
product.deltas[i] = 0;
}
} | javascript | function add(product, left, right) {
for (var i = 0; i < left.weights.length; i++) {
product.weights[i] = left.weights[i] + right.weights[i];
product.deltas[i] = 0;
}
} | [
"function",
"add",
"(",
"product",
",",
"left",
",",
"right",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"left",
".",
"weights",
".",
"length",
";",
"i",
"++",
")",
"{",
"product",
".",
"weights",
"[",
"i",
"]",
"=",
"left",
"... | add {left} and {right} matrix weights into {into}
@param {Matrix} product
@param {Matrix} left
@param {Matrix} right | [
"add",
"{",
"left",
"}",
"and",
"{",
"right",
"}",
"matrix",
"weights",
"into",
"{",
"into",
"}"
] | ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef | https://github.com/BrainJS/brain.js/blob/ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef/dist/recurrent/matrix/add.js#L13-L18 | train | Adds two centric terms | [
30522,
3853,
5587,
1006,
4031,
1010,
2187,
1010,
2157,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
2187,
1012,
15871,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
4031,
1012,
15871,
1031,
1045,
1033,
1027,
2187,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jquery/jquery | src/css/finalPropName.js | finalPropName | function finalPropName( name ) {
var final = vendorProps[ name ];
if ( final ) {
return final;
}
if ( name in emptyStyle ) {
return name;
}
return vendorProps[ name ] = vendorPropName( name ) || name;
} | javascript | function finalPropName( name ) {
var final = vendorProps[ name ];
if ( final ) {
return final;
}
if ( name in emptyStyle ) {
return name;
}
return vendorProps[ name ] = vendorPropName( name ) || name;
} | [
"function",
"finalPropName",
"(",
"name",
")",
"{",
"var",
"final",
"=",
"vendorProps",
"[",
"name",
"]",
";",
"if",
"(",
"final",
")",
"{",
"return",
"final",
";",
"}",
"if",
"(",
"name",
"in",
"emptyStyle",
")",
"{",
"return",
"name",
";",
"}",
"... | Return a potentially-mapped vendor prefixed property | [
"Return",
"a",
"potentially",
"-",
"mapped",
"vendor",
"prefixed",
"property"
] | ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3 | https://github.com/jquery/jquery/blob/ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3/src/css/finalPropName.js#L27-L37 | train | Returns the final property name | [
30522,
3853,
2345,
21572,
2361,
18442,
1006,
2171,
1007,
1063,
13075,
2345,
1027,
21431,
21572,
4523,
1031,
2171,
1033,
1025,
2065,
1006,
2345,
1007,
1063,
2709,
2345,
1025,
1065,
2065,
1006,
2171,
1999,
4064,
21756,
2571,
1007,
1063,
2709,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/animation/Animator.js | function (forwardToLast) {
var clipList = this._clipList;
var animation = this.animation;
for (var i = 0; i < clipList.length; i++) {
var clip = clipList[i];
if (forwardToLast) {
// Move to last frame before stop
clip.onframe(this._target, ... | javascript | function (forwardToLast) {
var clipList = this._clipList;
var animation = this.animation;
for (var i = 0; i < clipList.length; i++) {
var clip = clipList[i];
if (forwardToLast) {
// Move to last frame before stop
clip.onframe(this._target, ... | [
"function",
"(",
"forwardToLast",
")",
"{",
"var",
"clipList",
"=",
"this",
".",
"_clipList",
";",
"var",
"animation",
"=",
"this",
".",
"animation",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"clipList",
".",
"length",
";",
"i",
"++",
"... | 停止动画
@param {boolean} forwardToLast If move to last frame before stop | [
"停止动画"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/animation/Animator.js#L610-L622 | train | Stop the dialog | [
30522,
3853,
1006,
2830,
3406,
8523,
2102,
1007,
1063,
13075,
12528,
9863,
1027,
2023,
1012,
1035,
12528,
9863,
1025,
13075,
7284,
1027,
2023,
1012,
7284,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
12528,
9863,
1012,
3091,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
google/code-prettify | js-modules/numberLines.js | numberLines | function numberLines(node, startLineNum, isPreformatted) {
var nocode = /(?:^|\s)nocode(?:\s|$)/;
var lineBreak = /\r\n?|\n/;
var document = node.ownerDocument;
var li = document.createElement('li');
while (node.firstChild) {
li.appendChild(node.firstChild);
}
// An array of lines. We split below, ... | javascript | function numberLines(node, startLineNum, isPreformatted) {
var nocode = /(?:^|\s)nocode(?:\s|$)/;
var lineBreak = /\r\n?|\n/;
var document = node.ownerDocument;
var li = document.createElement('li');
while (node.firstChild) {
li.appendChild(node.firstChild);
}
// An array of lines. We split below, ... | [
"function",
"numberLines",
"(",
"node",
",",
"startLineNum",
",",
"isPreformatted",
")",
"{",
"var",
"nocode",
"=",
"/",
"(?:^|\\s)nocode(?:\\s|$)",
"/",
";",
"var",
"lineBreak",
"=",
"/",
"\\r\\n?|\\n",
"/",
";",
"var",
"document",
"=",
"node",
".",
"ownerD... | Given a DOM subtree, wraps it in a list, and puts each line into its own
list item.
@param {Node} node modified in place. Its content is pulled into an
HTMLOListElement, and each line is moved into a separate list item.
This requires cloning elements, so the input might not have unique
IDs after numbering.
@param {nu... | [
"Given",
"a",
"DOM",
"subtree",
"wraps",
"it",
"in",
"a",
"list",
"and",
"puts",
"each",
"line",
"into",
"its",
"own",
"list",
"item",
"."
] | e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc | https://github.com/google/code-prettify/blob/e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc/js-modules/numberLines.js#L16-L137 | train | Returns an array of lines from the given node. | [
30522,
3853,
2193,
12735,
1006,
13045,
1010,
2707,
4179,
19172,
1010,
2003,
28139,
14192,
19321,
2098,
1007,
1063,
13075,
2053,
16044,
1027,
1013,
30524,
5622,
1027,
6254,
1012,
3443,
12260,
3672,
1006,
1005,
5622,
1005,
1007,
1025,
2096,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function (jqXHR, sMessage, sRequestUrl, sResourcePath) {
var sBody = jqXHR.responseText,
sContentType = jqXHR.getResponseHeader("Content-Type"),
oResult = new Error(sMessage + ": " + jqXHR.status + " " + jqXHR.statusText);
oResult.status = jqXHR.status;
oResult.statusText = jqXHR.statusText;
oResul... | javascript | function (jqXHR, sMessage, sRequestUrl, sResourcePath) {
var sBody = jqXHR.responseText,
sContentType = jqXHR.getResponseHeader("Content-Type"),
oResult = new Error(sMessage + ": " + jqXHR.status + " " + jqXHR.statusText);
oResult.status = jqXHR.status;
oResult.statusText = jqXHR.statusText;
oResul... | [
"function",
"(",
"jqXHR",
",",
"sMessage",
",",
"sRequestUrl",
",",
"sResourcePath",
")",
"{",
"var",
"sBody",
"=",
"jqXHR",
".",
"responseText",
",",
"sContentType",
"=",
"jqXHR",
".",
"getResponseHeader",
"(",
"\"Content-Type\"",
")",
",",
"oResult",
"=",
... | Returns an <code>Error</code> instance from a jQuery XHR wrapper.
@param {object} jqXHR
A jQuery XHR wrapper as received by a failure handler
@param {function} jqXHR.getResponseHeader
Used to access the HTTP response header "Content-Type"
@param {string} jqXHR.responseText
HTTP response body, sometimes in JSON format ... | [
"Returns",
"an",
"<code",
">",
"Error<",
"/",
"code",
">",
"instance",
"from",
"a",
"jQuery",
"XHR",
"wrapper",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L232-L270 | train | This function is called when an error is received from the server. | [
30522,
3853,
1006,
1046,
4160,
2595,
8093,
1010,
15488,
7971,
4270,
1010,
5034,
2063,
15500,
3126,
2140,
1010,
5034,
2229,
8162,
3401,
15069,
1007,
1063,
13075,
24829,
7716,
2100,
1027,
1046,
4160,
2595,
8093,
1012,
3433,
18209,
1010,
8040,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js | function (bExplicitClose) {
if (this.getPopover()) {
if (bExplicitClose) {
this.getPopover(true).close();
this.getPopover(false).close();
}
// deletes the overflow button if there is one
if (this.getProperty("buttons").length > this.getProperty("maxButtonsDisplayed")) {
this.setProper... | javascript | function (bExplicitClose) {
if (this.getPopover()) {
if (bExplicitClose) {
this.getPopover(true).close();
this.getPopover(false).close();
}
// deletes the overflow button if there is one
if (this.getProperty("buttons").length > this.getProperty("maxButtonsDisplayed")) {
this.setProper... | [
"function",
"(",
"bExplicitClose",
")",
"{",
"if",
"(",
"this",
".",
"getPopover",
"(",
")",
")",
"{",
"if",
"(",
"bExplicitClose",
")",
"{",
"this",
".",
"getPopover",
"(",
"true",
")",
".",
"close",
"(",
")",
";",
"this",
".",
"getPopover",
"(",
... | Closes the ContextMenu.
@param {boolean} bExplicitClose true if the popover has to be closed explicitly from the contextMenu. Otherwhise the closing is handled by the popover itself
@return {sap.m.ContextMenu} Reference to this in order to allow method chaining
@public | [
"Closes",
"the",
"ContextMenu",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js#L619-L634 | train | Close the popup if the maxButtonsDisplayed is reached | [
30522,
3853,
1006,
2022,
2595,
24759,
28775,
13535,
10483,
2063,
1007,
1063,
2065,
1006,
2023,
1012,
2131,
16340,
7840,
1006,
1007,
1007,
1063,
2065,
1006,
2022,
2595,
24759,
28775,
13535,
10483,
2063,
1007,
1063,
2023,
1012,
30524,
2023,
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... | |
fex-team/webuploader | dist/webuploader.withoutimage.js | function( status ) {
var len = this._queue.length,
i, file;
status = status || STATUS.QUEUED;
for ( i = 0; i < len; i++ ) {
file = this._queue[ i ];
if ( status === file.getStatus() ) {
... | javascript | function( status ) {
var len = this._queue.length,
i, file;
status = status || STATUS.QUEUED;
for ( i = 0; i < len; i++ ) {
file = this._queue[ i ];
if ( status === file.getStatus() ) {
... | [
"function",
"(",
"status",
")",
"{",
"var",
"len",
"=",
"this",
".",
"_queue",
".",
"length",
",",
"i",
",",
"file",
";",
"status",
"=",
"status",
"||",
"STATUS",
".",
"QUEUED",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"len",
";",
"i",
... | 从队列中取出一个指定状态的文件。
@grammar fetch( status ) => File
@method fetch
@param {String} status [文件状态值](#WebUploader:File:File.Status)
@return {File} [File](#WebUploader:File) | [
"从队列中取出一个指定状态的文件。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/dist/webuploader.withoutimage.js#L2234-L2249 | train | Returns the first file in the queue that matches the status | [
30522,
3853,
1006,
3570,
1007,
1063,
13075,
18798,
1027,
2023,
1012,
1035,
24240,
1012,
3091,
1010,
1045,
1010,
5371,
1025,
3570,
1027,
3570,
1064,
1064,
3570,
1012,
24240,
2094,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
18798,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | writeFlagsNote | function writeFlagsNote(supportData, browserId) {
let output = '';
const firefoxPrefs = 'To change preferences in Firefox, visit about:config.';
const chromePrefs = 'To change preferences in Chrome, visit chrome://flags.';
if (typeof(supportData.version_added) === 'string') {
output = `From version ${supp... | javascript | function writeFlagsNote(supportData, browserId) {
let output = '';
const firefoxPrefs = 'To change preferences in Firefox, visit about:config.';
const chromePrefs = 'To change preferences in Chrome, visit chrome://flags.';
if (typeof(supportData.version_added) === 'string') {
output = `From version ${supp... | [
"function",
"writeFlagsNote",
"(",
"supportData",
",",
"browserId",
")",
"{",
"let",
"output",
"=",
"''",
";",
"const",
"firefoxPrefs",
"=",
"'To change preferences in Firefox, visit about:config.'",
";",
"const",
"chromePrefs",
"=",
"'To change preferences in Chrome, visit... | /*
Generate the note for a browser flag or preference
First checks version_added and version_removed to create a string indicating when
a preference setting is present. Then creates a (browser specific) string
for either a preference flag or a compile flag.
`supportData` is a support_statement
`browserId` is a compat_... | [
"/",
"*",
"Generate",
"the",
"note",
"for",
"a",
"browser",
"flag",
"or",
"preference",
"First",
"checks",
"version_added",
"and",
"version_removed",
"to",
"create",
"a",
"string",
"indicating",
"when",
"a",
"preference",
"setting",
"is",
"present",
".",
"Then... | 6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b | https://github.com/mdn/browser-compat-data/blob/6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b/scripts/render.js#L141-L189 | train | Writes a note to the console. | [
30522,
3853,
4339,
10258,
26454,
22074,
1006,
2490,
2850,
2696,
1010,
16602,
3593,
1007,
1063,
2292,
6434,
1027,
1005,
1005,
1025,
9530,
3367,
2543,
14876,
2595,
28139,
10343,
1027,
1005,
2000,
2689,
18394,
1999,
2543,
14876,
2595,
1010,
39... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
babel/babel | packages/babel-plugin-proposal-object-rest-spread/src/index.js | extractNormalizedKeys | function extractNormalizedKeys(path) {
const props = path.node.properties;
const keys = [];
let allLiteral = true;
for (const prop of props) {
if (t.isIdentifier(prop.key) && !prop.computed) {
// since a key {a: 3} is equivalent to {"a": 3}, use the latter
keys.push(t.stringLitera... | javascript | function extractNormalizedKeys(path) {
const props = path.node.properties;
const keys = [];
let allLiteral = true;
for (const prop of props) {
if (t.isIdentifier(prop.key) && !prop.computed) {
// since a key {a: 3} is equivalent to {"a": 3}, use the latter
keys.push(t.stringLitera... | [
"function",
"extractNormalizedKeys",
"(",
"path",
")",
"{",
"const",
"props",
"=",
"path",
".",
"node",
".",
"properties",
";",
"const",
"keys",
"=",
"[",
"]",
";",
"let",
"allLiteral",
"=",
"true",
";",
"for",
"(",
"const",
"prop",
"of",
"props",
")",... | returns an array of all keys of an object, and a status flag indicating if all extracted keys were converted to stringLiterals or not e.g. extracts {keys: ["a", "b", "3", ++x], allLiteral: false } from ast of {a: "foo", b, 3: "bar", [++x]: "baz"} | [
"returns",
"an",
"array",
"of",
"all",
"keys",
"of",
"an",
"object",
"and",
"a",
"status",
"flag",
"indicating",
"if",
"all",
"extracted",
"keys",
"were",
"converted",
"to",
"stringLiterals",
"or",
"not",
"e",
".",
"g",
".",
"extracts",
"{",
"keys",
":",... | 1969e6b6aa7d90be3fbb3aca98ea96849656a55a | https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-plugin-proposal-object-rest-spread/src/index.js#L70-L90 | train | Extract normalized keys from a node | [
30522,
3853,
14817,
12131,
9067,
3550,
14839,
2015,
1006,
4130,
1007,
1063,
9530,
3367,
24387,
1027,
4130,
1012,
13045,
1012,
5144,
1025,
9530,
3367,
6309,
1027,
1031,
1033,
1025,
2292,
2035,
22779,
7941,
1027,
2995,
1025,
2005,
1006,
9530,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/dialog/dialog.js | captureParentAndFromToElements | function captureParentAndFromToElements(options) {
options.origin = angular.extend({
element: null,
bounds: null,
focus: angular.noop
}, options.origin || {});
options.parent = getDomElement(options.parent, $rootElement);
options.closeTo = ... | javascript | function captureParentAndFromToElements(options) {
options.origin = angular.extend({
element: null,
bounds: null,
focus: angular.noop
}, options.origin || {});
options.parent = getDomElement(options.parent, $rootElement);
options.closeTo = ... | [
"function",
"captureParentAndFromToElements",
"(",
"options",
")",
"{",
"options",
".",
"origin",
"=",
"angular",
".",
"extend",
"(",
"{",
"element",
":",
"null",
",",
"bounds",
":",
"null",
",",
"focus",
":",
"angular",
".",
"noop",
"}",
",",
"options",
... | Capture originator/trigger/from/to element information (if available)
and the parent container for the dialog; defaults to the $rootElement
unless overridden in the options.parent | [
"Capture",
"originator",
"/",
"trigger",
"/",
"from",
"/",
"to",
"element",
"information",
"(",
"if",
"available",
")",
"and",
"the",
"parent",
"container",
"for",
"the",
"dialog",
";",
"defaults",
"to",
"the",
"$rootElement",
"unless",
"overridden",
"in",
"... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L891-L944 | train | Capture the parent and from to elements | [
30522,
3853,
5425,
19362,
4765,
5685,
19699,
5358,
3406,
12260,
8163,
1006,
7047,
1007,
1063,
7047,
1012,
4761,
1027,
16108,
1012,
7949,
1006,
1063,
5783,
1024,
19701,
1010,
19202,
1024,
19701,
1010,
3579,
1024,
16108,
1012,
2053,
7361,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
transloadit/uppy | packages/@uppy/transloadit/src/AssemblyOptions.js | validateParams | function validateParams (params) {
if (!params) {
throw new Error('Transloadit: The `params` option is required.')
}
if (typeof params === 'string') {
try {
params = JSON.parse(params)
} catch (err) {
// Tell the user that this is not an Uppy bug!
err.message = 'Transloadit: The `pa... | javascript | function validateParams (params) {
if (!params) {
throw new Error('Transloadit: The `params` option is required.')
}
if (typeof params === 'string') {
try {
params = JSON.parse(params)
} catch (err) {
// Tell the user that this is not an Uppy bug!
err.message = 'Transloadit: The `pa... | [
"function",
"validateParams",
"(",
"params",
")",
"{",
"if",
"(",
"!",
"params",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Transloadit: The `params` option is required.'",
")",
"}",
"if",
"(",
"typeof",
"params",
"===",
"'string'",
")",
"{",
"try",
"{",
"par... | Check that Assembly parameters are present and include all required fields. | [
"Check",
"that",
"Assembly",
"parameters",
"are",
"present",
"and",
"include",
"all",
"required",
"fields",
"."
] | 7ae18bf992d544a64da998f033258ec09a3de275 | https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/packages/@uppy/transloadit/src/AssemblyOptions.js#L4-L24 | train | Validate the params | [
30522,
3853,
9398,
3686,
28689,
5244,
1006,
11498,
5244,
1007,
1063,
2065,
1006,
999,
11498,
5244,
1007,
1063,
5466,
2047,
7561,
1006,
1005,
9099,
11066,
4183,
1024,
1996,
1036,
11498,
5244,
1036,
5724,
2003,
3223,
1012,
1005,
1007,
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... |
adobe/brackets | src/search/FileFilters.js | _handleDeleteFilter | function _handleDeleteFilter(e) {
// Remove the filter set from the preferences and
// clear the active filter set index from view state.
var filterSets = PreferencesManager.get("fileFilters") || [],
activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"),
... | javascript | function _handleDeleteFilter(e) {
// Remove the filter set from the preferences and
// clear the active filter set index from view state.
var filterSets = PreferencesManager.get("fileFilters") || [],
activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"),
... | [
"function",
"_handleDeleteFilter",
"(",
"e",
")",
"{",
"// Remove the filter set from the preferences and",
"// clear the active filter set index from view state.",
"var",
"filterSets",
"=",
"PreferencesManager",
".",
"get",
"(",
"\"fileFilters\"",
")",
"||",
"[",
"]",
",",
... | Remove the target item from the filter dropdown list and update dropdown button
and dropdown list UI.
@param {!Event} e Mouse events | [
"Remove",
"the",
"target",
"item",
"from",
"the",
"filter",
"dropdown",
"list",
"and",
"update",
"dropdown",
"button",
"and",
"dropdown",
"list",
"UI",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L434-L460 | train | Delete a filter set from the file picker | [
30522,
3853,
1035,
8971,
12260,
2618,
8873,
21928,
1006,
1041,
1007,
1063,
1013,
1013,
6366,
1996,
11307,
2275,
2013,
1996,
18394,
1998,
1013,
1013,
3154,
1996,
3161,
11307,
2275,
5950,
2013,
3193,
2110,
1012,
13075,
17736,
8454,
1027,
1839... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | release.js | updateSite | function updateSite () {
start('Adding new version of the docs site...');
const options = { cwd: './code.material.angularjs.org' };
writeDocsJson();
// build files for bower
exec([
'rm -rf dist',
'gulp docs'
]);
replaceFilePaths();
// copy files over to site repo
ex... | javascript | function updateSite () {
start('Adding new version of the docs site...');
const options = { cwd: './code.material.angularjs.org' };
writeDocsJson();
// build files for bower
exec([
'rm -rf dist',
'gulp docs'
]);
replaceFilePaths();
// copy files over to site repo
ex... | [
"function",
"updateSite",
"(",
")",
"{",
"start",
"(",
"'Adding new version of the docs site...'",
")",
";",
"const",
"options",
"=",
"{",
"cwd",
":",
"'./code.material.angularjs.org'",
"}",
";",
"writeDocsJson",
"(",
")",
";",
"// build files for bower",
"exec",
"(... | builds the website for the new version | [
"builds",
"the",
"website",
"for",
"the",
"new",
"version"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/release.js#L261-L331 | train | update site | [
30522,
3853,
14409,
4221,
1006,
1007,
1063,
2707,
1006,
1005,
5815,
2047,
2544,
1997,
1996,
9986,
2015,
2609,
1012,
1012,
1012,
1005,
1007,
1025,
9530,
3367,
7047,
1027,
1063,
19296,
2094,
1024,
1005,
1012,
1013,
3642,
1012,
3430,
1012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/AnnotationHelper.js | function (oInterface, vRawValue) {
if (arguments.length === 1) {
vRawValue = oInterface.getObject("");
}
return Expression.getExpression(oInterface, vRawValue, true);
} | javascript | function (oInterface, vRawValue) {
if (arguments.length === 1) {
vRawValue = oInterface.getObject("");
}
return Expression.getExpression(oInterface, vRawValue, true);
} | [
"function",
"(",
"oInterface",
",",
"vRawValue",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"===",
"1",
")",
"{",
"vRawValue",
"=",
"oInterface",
".",
"getObject",
"(",
"\"\"",
")",
";",
"}",
"return",
"Expression",
".",
"getExpression",
"(",
"oInt... | A formatter function to be used in a complex binding inside an XML template view
in order to interpret OData V4 annotations. It knows about
<ul>
<li> the "14.4 Constant Expressions" for "edm:Bool", "edm:Date",
"edm:DateTimeOffset", "edm:Decimal", "edm:Float", "edm:Guid", "edm:Int",
"edm:TimeOfDay".
<li> the constant "1... | [
"A",
"formatter",
"function",
"to",
"be",
"used",
"in",
"a",
"complex",
"binding",
"inside",
"an",
"XML",
"template",
"view",
"in",
"order",
"to",
"interpret",
"OData",
"V4",
"annotations",
".",
"It",
"knows",
"about",
"<ul",
">",
"<li",
">",
"the",
"14"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/AnnotationHelper.js#L279-L284 | train | Returns the expression for the given interface. | [
30522,
3853,
1006,
1051,
18447,
2121,
12172,
1010,
27830,
10376,
10175,
5657,
1007,
1063,
2065,
1006,
9918,
1012,
3091,
1027,
1027,
1027,
1015,
1007,
1063,
27830,
10376,
10175,
5657,
1027,
1051,
18447,
2121,
12172,
1012,
2131,
16429,
20614,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jgraph/mxgraph | javascript/mxClient.js | mxConnectionConstraint | function mxConnectionConstraint(point, perimeter, name, dx, dy)
{
this.point = point;
this.perimeter = (perimeter != null) ? perimeter : true;
this.name = name;
this.dx = dx? dx : 0;
this.dy = dy? dy : 0;
} | javascript | function mxConnectionConstraint(point, perimeter, name, dx, dy)
{
this.point = point;
this.perimeter = (perimeter != null) ? perimeter : true;
this.name = name;
this.dx = dx? dx : 0;
this.dy = dy? dy : 0;
} | [
"function",
"mxConnectionConstraint",
"(",
"point",
",",
"perimeter",
",",
"name",
",",
"dx",
",",
"dy",
")",
"{",
"this",
".",
"point",
"=",
"point",
";",
"this",
".",
"perimeter",
"=",
"(",
"perimeter",
"!=",
"null",
")",
"?",
"perimeter",
":",
"true... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxConnectionConstraint
Defines an object that contains the constraints about how to connect one
side of an edge to its terminal.
Constructor: mxConnectionConstraint
Constructs a new connection constraint for the given point and boole... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxConnectionConstraint"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L69430-L69437 | train | A constraint for a connection | [
30522,
3853,
25630,
8663,
2638,
7542,
8663,
20528,
18447,
1006,
2391,
1010,
13443,
1010,
2171,
1010,
1040,
2595,
1010,
1040,
2100,
1007,
1063,
2023,
1012,
2391,
1027,
2391,
1025,
2023,
1012,
13443,
1027,
1006,
13443,
999,
1027,
19701,
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... |
google/code-prettify | js-modules/prettify.js | registerLangHandler | function registerLangHandler(handler, fileExtensions) {
for (var i = fileExtensions.length; --i >= 0;) {
var ext = fileExtensions[i];
if (!langHandlerRegistry.hasOwnProperty(ext)) {
langHandlerRegistry[ext] = handler;
} else if (win['console']) {
console['warn']('cannot override la... | javascript | function registerLangHandler(handler, fileExtensions) {
for (var i = fileExtensions.length; --i >= 0;) {
var ext = fileExtensions[i];
if (!langHandlerRegistry.hasOwnProperty(ext)) {
langHandlerRegistry[ext] = handler;
} else if (win['console']) {
console['warn']('cannot override la... | [
"function",
"registerLangHandler",
"(",
"handler",
",",
"fileExtensions",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"fileExtensions",
".",
"length",
";",
"--",
"i",
">=",
"0",
";",
")",
"{",
"var",
"ext",
"=",
"fileExtensions",
"[",
"i",
"]",
";",
"if",
... | Register a language handler for the given file extensions.
@param {function (JobT)} handler a function from source code to a list
of decorations. Takes a single argument job which describes the
state of the computation and attaches the decorations to it.
@param {Array.<string>} fileExtensions | [
"Register",
"a",
"language",
"handler",
"for",
"the",
"given",
"file",
"extensions",
"."
] | e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc | https://github.com/google/code-prettify/blob/e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc/js-modules/prettify.js#L679-L688 | train | Register a language handler for a file extension | [
30522,
3853,
4236,
25023,
11774,
3917,
1006,
28213,
1010,
5371,
10288,
29048,
2015,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
5371,
10288,
29048,
2015,
1012,
3091,
1025,
1011,
1011,
1045,
1028,
1027,
1014,
1025,
1007,
1063,
13075,
4654,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | _curveClick | function _curveClick(e) {
var self = e.target,
bezierEditor = self.bezierEditor;
var curveBoundingBox = bezierEditor._getCurveBoundingBox(),
left = curveBoundingBox.left,
top = curveBoundingBox.top,
x = e.pageX - left,
y = e.pageY - top... | javascript | function _curveClick(e) {
var self = e.target,
bezierEditor = self.bezierEditor;
var curveBoundingBox = bezierEditor._getCurveBoundingBox(),
left = curveBoundingBox.left,
top = curveBoundingBox.top,
x = e.pageX - left,
y = e.pageY - top... | [
"function",
"_curveClick",
"(",
"e",
")",
"{",
"var",
"self",
"=",
"e",
".",
"target",
",",
"bezierEditor",
"=",
"self",
".",
"bezierEditor",
";",
"var",
"curveBoundingBox",
"=",
"bezierEditor",
".",
"_getCurveBoundingBox",
"(",
")",
",",
"left",
"=",
"cur... | Event handlers
Handle click in <canvas> element
@param {Event} e Mouse click event | [
"Event",
"handlers",
"Handle",
"click",
"in",
"<canvas",
">",
"element"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L242-L277 | train | Click event handler for curve | [
30522,
3853,
1035,
7774,
20464,
6799,
1006,
1041,
1007,
1063,
13075,
2969,
1027,
1041,
1012,
4539,
1010,
2022,
21548,
2098,
15660,
1027,
2969,
1012,
2022,
21548,
2098,
15660,
1025,
13075,
7774,
15494,
2075,
8758,
1027,
2022,
21548,
2098,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
webtorrent/webtorrent | lib/torrent.js | validateWire | function validateWire () {
if (wire.requests.length) return
let i = self._selections.length
while (i--) {
const next = self._selections[i]
let piece
if (self.strategy === 'rarest') {
const start = next.from + next.offset
const end = next.to
const ... | javascript | function validateWire () {
if (wire.requests.length) return
let i = self._selections.length
while (i--) {
const next = self._selections[i]
let piece
if (self.strategy === 'rarest') {
const start = next.from + next.offset
const end = next.to
const ... | [
"function",
"validateWire",
"(",
")",
"{",
"if",
"(",
"wire",
".",
"requests",
".",
"length",
")",
"return",
"let",
"i",
"=",
"self",
".",
"_selections",
".",
"length",
"while",
"(",
"i",
"--",
")",
"{",
"const",
"next",
"=",
"self",
".",
"_selection... | TODO: Do we need both validateWire and trySelectWire? | [
"TODO",
":",
"Do",
"we",
"need",
"both",
"validateWire",
"and",
"trySelectWire?"
] | f8923a66a8b1178a412b067bc913e267025b3d57 | https://github.com/webtorrent/webtorrent/blob/f8923a66a8b1178a412b067bc913e267025b3d57/lib/torrent.js#L1176-L1208 | train | Validate the wire | [
30522,
3853,
9398,
3686,
20357,
1006,
1007,
1063,
2065,
1006,
7318,
1012,
11186,
1012,
3091,
1007,
2709,
2292,
1045,
1027,
2969,
1012,
1035,
16310,
1012,
3091,
2096,
1006,
1045,
1011,
1011,
1007,
1063,
9530,
3367,
2279,
1027,
2969,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wangfupeng1988/wangEditor | src/js/menus/head/index.js | function (value) {
const editor = this.editor
const $selectionElem = editor.selection.getSelectionContainerElem()
if (editor.$textElem.equal($selectionElem)) {
// 不能选中多行来设置标题,否则会出现问题
// 例如选中的是 <p>xxx</p><p>yyy</p> 来设置标题,设置之后会成为 <h1>xxx<br>yyy</h1> 不符合预期
retur... | javascript | function (value) {
const editor = this.editor
const $selectionElem = editor.selection.getSelectionContainerElem()
if (editor.$textElem.equal($selectionElem)) {
// 不能选中多行来设置标题,否则会出现问题
// 例如选中的是 <p>xxx</p><p>yyy</p> 来设置标题,设置之后会成为 <h1>xxx<br>yyy</h1> 不符合预期
retur... | [
"function",
"(",
"value",
")",
"{",
"const",
"editor",
"=",
"this",
".",
"editor",
"const",
"$selectionElem",
"=",
"editor",
".",
"selection",
".",
"getSelectionContainerElem",
"(",
")",
"if",
"(",
"editor",
".",
"$textElem",
".",
"equal",
"(",
"$selectionEl... | 执行命令 | [
"执行命令"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/menus/head/index.js#L41-L52 | train | format block | [
30522,
3853,
1006,
3643,
1007,
1063,
9530,
3367,
3559,
1027,
2023,
1012,
3559,
9530,
3367,
1002,
4989,
12260,
2213,
1027,
3559,
1012,
4989,
1012,
4152,
12260,
7542,
8663,
18249,
7869,
16930,
1006,
1007,
2065,
1006,
3559,
1012,
1002,
3793,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | getArticleByPath | function getArticleByPath(filePath) {
var article = summary.getByPath(filePath);
if (!article) return undefined;
return JSONUtils.encodeSummaryArticle(article);
} | javascript | function getArticleByPath(filePath) {
var article = summary.getByPath(filePath);
if (!article) return undefined;
return JSONUtils.encodeSummaryArticle(article);
} | [
"function",
"getArticleByPath",
"(",
"filePath",
")",
"{",
"var",
"article",
"=",
"summary",
".",
"getByPath",
"(",
"filePath",
")",
";",
"if",
"(",
"!",
"article",
")",
"return",
"undefined",
";",
"return",
"JSONUtils",
".",
"encodeSummaryArticle",
"(",
"ar... | Return an article by its path
@param {String} filePath
@return {Object|undefined} | [
"Return",
"an",
"article",
"by",
"its",
"path"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/website/createTemplateEngine.js#L75-L80 | train | Get an article from summary by path | [
30522,
3853,
2131,
8445,
25128,
3762,
15069,
1006,
5371,
15069,
1007,
1063,
13075,
3720,
1027,
12654,
1012,
2131,
3762,
15069,
1006,
5371,
15069,
1007,
1025,
2065,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
grpc/grpc | examples/node/static_codegen/route_guide/route_guide_client.js | runGetFeature | function runGetFeature(callback) {
var next = _.after(2, callback);
function featureCallback(error, feature) {
if (error) {
callback(error);
return;
}
var latitude = feature.getLocation().getLatitude();
var longitude = feature.getLocation().getLongitude();
if (feature.getName() === '... | javascript | function runGetFeature(callback) {
var next = _.after(2, callback);
function featureCallback(error, feature) {
if (error) {
callback(error);
return;
}
var latitude = feature.getLocation().getLatitude();
var longitude = feature.getLocation().getLongitude();
if (feature.getName() === '... | [
"function",
"runGetFeature",
"(",
"callback",
")",
"{",
"var",
"next",
"=",
"_",
".",
"after",
"(",
"2",
",",
"callback",
")",
";",
"function",
"featureCallback",
"(",
"error",
",",
"feature",
")",
"{",
"if",
"(",
"error",
")",
"{",
"callback",
"(",
... | Run the getFeature demo. Calls getFeature with a point known to have a
feature and a point known not to have a feature.
@param {function} callback Called when this demo is complete | [
"Run",
"the",
"getFeature",
"demo",
".",
"Calls",
"getFeature",
"with",
"a",
"point",
"known",
"to",
"have",
"a",
"feature",
"and",
"a",
"point",
"known",
"not",
"to",
"have",
"a",
"feature",
"."
] | cc75d93818410e2b0edd0fa3009a6def9ac403ca | https://github.com/grpc/grpc/blob/cc75d93818410e2b0edd0fa3009a6def9ac403ca/examples/node/static_codegen/route_guide/route_guide_client.js#L39-L65 | train | Get a feature from the cluster | [
30522,
3853,
2448,
18150,
7959,
4017,
5397,
1006,
2655,
5963,
1007,
1063,
13075,
2279,
1027,
1035,
1012,
2044,
1006,
1016,
1010,
2655,
5963,
1007,
1025,
3853,
3444,
9289,
20850,
8684,
1006,
7561,
1010,
3444,
1007,
1063,
2065,
1006,
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/model/odata/v4/lib/_AggregationHelper.js | function (oAggregation, mQueryOptions, mAlias2MeasureAndMethod, bFollowUp) {
var aAggregate,
sApply = "",
// concat(aggregate(???),.) content for grand totals (w/o unit) or min/max or count
aConcatAggregate = [],
aGroupBy,
bHasGrandTotal,
sSkipTop;
/*
* Returns the corresponding part ... | javascript | function (oAggregation, mQueryOptions, mAlias2MeasureAndMethod, bFollowUp) {
var aAggregate,
sApply = "",
// concat(aggregate(???),.) content for grand totals (w/o unit) or min/max or count
aConcatAggregate = [],
aGroupBy,
bHasGrandTotal,
sSkipTop;
/*
* Returns the corresponding part ... | [
"function",
"(",
"oAggregation",
",",
"mQueryOptions",
",",
"mAlias2MeasureAndMethod",
",",
"bFollowUp",
")",
"{",
"var",
"aAggregate",
",",
"sApply",
"=",
"\"\"",
",",
"// concat(aggregate(???),.) content for grand totals (w/o unit) or min/max or count",
"aConcatAggregate",
... | Builds the value for a "$apply" system query option based on the given data aggregation
information. The value is "groupby((<groupable_1,...,groupable_N),aggregate(
<aggregatable> with <method> as <alias>,...))" where the "aggregate" part is
only present if aggregatable properties are given and both "with" ... | [
"Builds",
"the",
"value",
"for",
"a",
"$apply",
"system",
"query",
"option",
"based",
"on",
"the",
"given",
"data",
"aggregation",
"information",
".",
"The",
"value",
"is",
"groupby",
"((",
"<",
";",
"groupable_1",
"...",
"groupable_N",
")",
"aggregate",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js#L173-L339 | train | Returns the aggregate term for an aggregatable property. | [
30522,
3853,
1006,
1051,
8490,
17603,
12540,
1010,
1049,
4226,
2854,
7361,
9285,
1010,
16007,
3022,
2475,
4168,
3022,
5397,
5685,
11368,
6806,
2094,
1010,
28939,
14511,
5004,
6279,
1007,
1063,
13075,
9779,
13871,
2890,
5867,
1010,
20066,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
muaz-khan/RTCMultiConnection | dev/MediaStreamRecorder.js | WhammyVideo | function WhammyVideo(duration, quality) {
this.frames = [];
if (!duration) {
duration = 1;
}
this.duration = 1000 / duration;
this.quality = quality || 0.8;
} | javascript | function WhammyVideo(duration, quality) {
this.frames = [];
if (!duration) {
duration = 1;
}
this.duration = 1000 / duration;
this.quality = quality || 0.8;
} | [
"function",
"WhammyVideo",
"(",
"duration",
",",
"quality",
")",
"{",
"this",
".",
"frames",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"duration",
")",
"{",
"duration",
"=",
"1",
";",
"}",
"this",
".",
"duration",
"=",
"1000",
"/",
"duration",
";",
"this... | a more abstract-ish API | [
"a",
"more",
"abstract",
"-",
"ish",
"API"
] | 2032ce949bde30b43a3d2666e0f1e5afbf337f3d | https://github.com/muaz-khan/RTCMultiConnection/blob/2032ce949bde30b43a3d2666e0f1e5afbf337f3d/dev/MediaStreamRecorder.js#L2228-L2235 | train | Whammy video | [
30522,
3853,
1059,
3511,
8029,
17258,
8780,
1006,
9367,
1010,
3737,
1007,
1063,
2023,
1012,
11048,
1027,
1031,
1033,
1025,
2065,
1006,
999,
9367,
1007,
1063,
9367,
1027,
1015,
1025,
1065,
2023,
1012,
9367,
1027,
6694,
1013,
9367,
1025,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | examples/3d/js/camera.js | function(resolution) {
this.width = canvas.width = window.innerWidth;
this.height = canvas.height = window.innerHeight;
this.resolution = resolution;
this.spacing = this.width / resolution;
this.focalLen = this.height / this.width;
this.range = isMobile ? 9 : 18;
this.lightRange = 9;
this.scale = canvas... | javascript | function(resolution) {
this.width = canvas.width = window.innerWidth;
this.height = canvas.height = window.innerHeight;
this.resolution = resolution;
this.spacing = this.width / resolution;
this.focalLen = this.height / this.width;
this.range = isMobile ? 9 : 18;
this.lightRange = 9;
this.scale = canvas... | [
"function",
"(",
"resolution",
")",
"{",
"this",
".",
"width",
"=",
"canvas",
".",
"width",
"=",
"window",
".",
"innerWidth",
";",
"this",
".",
"height",
"=",
"canvas",
".",
"height",
"=",
"window",
".",
"innerHeight",
";",
"this",
".",
"resolution",
"... | Camera that draws everything you see on the screen from the player's perspective.
@param {Number} resolution Resolution to render at (higher has better quality, but lower performance). | [
"Camera",
"that",
"draws",
"everything",
"you",
"see",
"on",
"the",
"screen",
"from",
"the",
"player",
"s",
"perspective",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/3d/js/camera.js#L17-L26 | train | Initialize the cubemap | [
30522,
3853,
1006,
5813,
1007,
1063,
2023,
1012,
9381,
1027,
10683,
1012,
9381,
1027,
3332,
1012,
5110,
9148,
11927,
2232,
1025,
2023,
1012,
4578,
1027,
10683,
1012,
4578,
1027,
3332,
1012,
5110,
26036,
13900,
1025,
2023,
1012,
5813,
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... | |
google/closure-library | closure/goog/base.js | fetchInOwnScriptThenLoad | function fetchInOwnScriptThenLoad() {
/** @type {!HTMLDocument} */
var doc = goog.global.document;
var key = goog.Dependency.registerCallback_(function() {
goog.Dependency.unregisterCallback_(key);
load();
});
var script = '<script type="text/javascript">' +
goo... | javascript | function fetchInOwnScriptThenLoad() {
/** @type {!HTMLDocument} */
var doc = goog.global.document;
var key = goog.Dependency.registerCallback_(function() {
goog.Dependency.unregisterCallback_(key);
load();
});
var script = '<script type="text/javascript">' +
goo... | [
"function",
"fetchInOwnScriptThenLoad",
"(",
")",
"{",
"/** @type {!HTMLDocument} */",
"var",
"doc",
"=",
"goog",
".",
"global",
".",
"document",
";",
"var",
"key",
"=",
"goog",
".",
"Dependency",
".",
"registerCallback_",
"(",
"function",
"(",
")",
"{",
"goog... | Do not fetch now; in FireFox 47 the synchronous XHR doesn't block all events. If we fetched now and then document.write'd the contents the document.write would be an eval and would execute too soon! Instead write a script tag to fetch and eval synchronously at the correct time. | [
"Do",
"not",
"fetch",
"now",
";",
"in",
"FireFox",
"47",
"the",
"synchronous",
"XHR",
"doesn",
"t",
"block",
"all",
"events",
".",
"If",
"we",
"fetched",
"now",
"and",
"then",
"document",
".",
"write",
"d",
"the",
"contents",
"the",
"document",
".",
"w... | 97390e9ca4483cebb9628e06026139fbb3023d65 | https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/closure/goog/base.js#L3752-L3769 | train | Fetch in own script then load | [
30522,
3853,
18584,
5740,
7962,
22483,
10760,
20554,
10441,
2094,
1006,
1007,
1063,
1013,
1008,
1008,
1030,
2828,
1063,
999,
16129,
3527,
24894,
4765,
1065,
1008,
1013,
13075,
9986,
1027,
27571,
2290,
1012,
3795,
1012,
6254,
1025,
13075,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/patternAdapter.js | addUnderlyingListener | function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){
var emitMatch = oboeBus(fullEventName).emit;
predicateEvent.on( function (ascent) {
var maybeMatchingMapping = compiledJsonPath(ascent);
/* Possible values for maybeMatchingMapping are now:
... | javascript | function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){
var emitMatch = oboeBus(fullEventName).emit;
predicateEvent.on( function (ascent) {
var maybeMatchingMapping = compiledJsonPath(ascent);
/* Possible values for maybeMatchingMapping are now:
... | [
"function",
"addUnderlyingListener",
"(",
"fullEventName",
",",
"predicateEvent",
",",
"compiledJsonPath",
")",
"{",
"var",
"emitMatch",
"=",
"oboeBus",
"(",
"fullEventName",
")",
".",
"emit",
";",
"predicateEvent",
".",
"on",
"(",
"function",
"(",
"ascent",
")"... | /*
Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if
matching the specified pattern, propagate to pattern-match events such as
oboeBus('node:!')
@param {Function} predicateEvent
either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).
@param {Function} compiledJsonPath | [
"/",
"*",
"Set",
"up",
"the",
"catching",
"of",
"events",
"such",
"as",
"NODE_CLOSED",
"and",
"NODE_OPENED",
"and",
"if",
"matching",
"the",
"specified",
"pattern",
"propagate",
"to",
"pattern",
"-",
"match",
"events",
"such",
"as",
"oboeBus",
"(",
"node",
... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/patternAdapter.js#L48-L92 | train | Add a listener to the underlying event bus. | [
30522,
3853,
5587,
20824,
2135,
2075,
9863,
24454,
1006,
2440,
18697,
3372,
18442,
1010,
3653,
16467,
18697,
3372,
1010,
9227,
22578,
2239,
15069,
1007,
1063,
13075,
12495,
29418,
10649,
1027,
22523,
8286,
1006,
2440,
18697,
3372,
18442,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FindInFiles.js | filesChanged | function filesChanged(fileList) {
if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) {
return;
}
var updateObject = {
"fileList": fileList
};
if (searchModel.filter) {
updateObject.filesInSearchScope = FileFilters.getPa... | javascript | function filesChanged(fileList) {
if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) {
return;
}
var updateObject = {
"fileList": fileList
};
if (searchModel.filter) {
updateObject.filesInSearchScope = FileFilters.getPa... | [
"function",
"filesChanged",
"(",
"fileList",
")",
"{",
"if",
"(",
"FindUtils",
".",
"isNodeSearchDisabled",
"(",
")",
"||",
"!",
"fileList",
"||",
"fileList",
".",
"length",
"===",
"0",
")",
"{",
"return",
";",
"}",
"var",
"updateObject",
"=",
"{",
"\"fi... | Inform node that the list of files has changed.
@param {array} fileList The list of files that changed. | [
"Inform",
"node",
"that",
"the",
"list",
"of",
"files",
"has",
"changed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFiles.js#L674-L686 | train | Update the search domain with the new files | [
30522,
3853,
6764,
22305,
2098,
1006,
5371,
9863,
1007,
1063,
2065,
1006,
2424,
21823,
4877,
1012,
3475,
19847,
14644,
2818,
10521,
3085,
2094,
1006,
1007,
1064,
1064,
999,
5371,
9863,
1064,
1064,
5371,
9863,
1012,
3091,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/mvc/JSView.js | viewFactory | function viewFactory(sId, vView, bAsync) {
var mSettings = {}, oView;
if (vView && typeof (vView) == "string") { // instantiation sap.ui.jsview("id","name", [async])
mSettings.viewName = vView;
if (typeof arguments[2] == "boolean") {
mSettings.async = bAsync;
} else if (typeof arguments[2] == "object"... | javascript | function viewFactory(sId, vView, bAsync) {
var mSettings = {}, oView;
if (vView && typeof (vView) == "string") { // instantiation sap.ui.jsview("id","name", [async])
mSettings.viewName = vView;
if (typeof arguments[2] == "boolean") {
mSettings.async = bAsync;
} else if (typeof arguments[2] == "object"... | [
"function",
"viewFactory",
"(",
"sId",
",",
"vView",
",",
"bAsync",
")",
"{",
"var",
"mSettings",
"=",
"{",
"}",
",",
"oView",
";",
"if",
"(",
"vView",
"&&",
"typeof",
"(",
"vView",
")",
"==",
"\"string\"",
")",
"{",
"// instantiation sap.ui.jsview(\"id\",... | /*
The old view factory implementation | [
"/",
"*",
"The",
"old",
"view",
"factory",
"implementation"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/mvc/JSView.js#L166-L197 | train | Creates a view instance | [
30522,
3853,
3193,
21450,
1006,
15765,
1010,
1058,
8584,
1010,
19021,
6038,
2278,
1007,
1063,
13075,
5796,
18319,
3070,
2015,
1027,
1063,
1065,
1010,
1051,
8584,
1025,
2065,
1006,
1058,
8584,
1004,
1004,
2828,
11253,
1006,
1058,
8584,
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... |
ksky521/nodeppt | packages/nodeppt-serve/config/app.js | ensureRelative | function ensureRelative(outputDir, p) {
if (path.isAbsolute(p)) {
return path.relative(outputDir, p);
} else {
return p;
}
} | javascript | function ensureRelative(outputDir, p) {
if (path.isAbsolute(p)) {
return path.relative(outputDir, p);
} else {
return p;
}
} | [
"function",
"ensureRelative",
"(",
"outputDir",
",",
"p",
")",
"{",
"if",
"(",
"path",
".",
"isAbsolute",
"(",
"p",
")",
")",
"{",
"return",
"path",
".",
"relative",
"(",
"outputDir",
",",
"p",
")",
";",
"}",
"else",
"{",
"return",
"p",
";",
"}",
... | ensure the filename passed to html-webpack-plugin is a relative path because it cannot correctly handle absolute paths | [
"ensure",
"the",
"filename",
"passed",
"to",
"html",
"-",
"webpack",
"-",
"plugin",
"is",
"a",
"relative",
"path",
"because",
"it",
"cannot",
"correctly",
"handle",
"absolute",
"paths"
] | ca77e29ef818c08b0522b31e3925b073cf159b9c | https://github.com/ksky521/nodeppt/blob/ca77e29ef818c08b0522b31e3925b073cf159b9c/packages/nodeppt-serve/config/app.js#L9-L15 | train | Ensure p is relative to outputDir | [
30522,
3853,
5676,
16570,
8082,
1006,
6434,
4305,
2099,
1010,
1052,
1007,
1063,
2065,
1006,
4130,
1012,
18061,
5910,
4747,
10421,
1006,
1052,
1007,
1007,
1063,
2709,
4130,
1012,
5816,
1006,
6434,
4305,
2099,
1010,
1052,
1007,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fex-team/webuploader | dist/webuploader.withoutimage.js | Runtime | function Runtime( options ) {
this.options = $.extend({
container: document.body
}, options );
this.uid = Base.guid('rt_');
} | javascript | function Runtime( options ) {
this.options = $.extend({
container: document.body
}, options );
this.uid = Base.guid('rt_');
} | [
"function",
"Runtime",
"(",
"options",
")",
"{",
"this",
".",
"options",
"=",
"$",
".",
"extend",
"(",
"{",
"container",
":",
"document",
".",
"body",
"}",
",",
"options",
")",
";",
"this",
".",
"uid",
"=",
"Base",
".",
"guid",
"(",
"'rt_'",
")",
... | 接口类。 | [
"接口类。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/dist/webuploader.withoutimage.js#L930-L935 | train | Runtime constructor. | [
30522,
3853,
2448,
7292,
1006,
7047,
1007,
1063,
2023,
1012,
7047,
1027,
1002,
1012,
7949,
1006,
1063,
11661,
1024,
6254,
1012,
2303,
1065,
1010,
7047,
1007,
1025,
2023,
1012,
21318,
2094,
1027,
2918,
1012,
26458,
2094,
1006,
1005,
19387,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ValidationUtils.js | isIntegerInRange | function isIntegerInRange(value, lowerLimit, upperLimit) {
// Validate value is an integer
if (!isInteger(value)) {
return false;
}
// Validate integer is in range
var hasLowerLimt = (typeof (lowerLimit) === "number"),
hasUpperLimt = (typeof (upperLimit) ... | javascript | function isIntegerInRange(value, lowerLimit, upperLimit) {
// Validate value is an integer
if (!isInteger(value)) {
return false;
}
// Validate integer is in range
var hasLowerLimt = (typeof (lowerLimit) === "number"),
hasUpperLimt = (typeof (upperLimit) ... | [
"function",
"isIntegerInRange",
"(",
"value",
",",
"lowerLimit",
",",
"upperLimit",
")",
"{",
"// Validate value is an integer",
"if",
"(",
"!",
"isInteger",
"(",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"// Validate integer is in range",
"var",
"hasLo... | Used to validate whether type of unknown value is an integer, and, if so,
is it within the option lower and upper limits.
@param {*} value Value for which to validate its type
@param {number=} lowerLimit Optional lower limit (inclusive)
@param {number=} upperLimit Optional upper limit (inclusive)
@return {boolean} tru... | [
"Used",
"to",
"validate",
"whether",
"type",
"of",
"unknown",
"value",
"is",
"an",
"integer",
"and",
"if",
"so",
"is",
"it",
"within",
"the",
"option",
"lower",
"and",
"upper",
"limits",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ValidationUtils.js#L62-L73 | train | Check if value is an integer in the range lowerLimit and upperLimit | [
30522,
3853,
2003,
18447,
26320,
2378,
24388,
2063,
1006,
3643,
1010,
2896,
17960,
4183,
1010,
3356,
17960,
4183,
1007,
1063,
1013,
1013,
9398,
3686,
3643,
2003,
2019,
16109,
2065,
1006,
999,
2003,
18447,
26320,
1006,
3643,
1007,
1007,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/prefer-template.js | startsWithTemplateCurly | function startsWithTemplateCurly(node) {
if (node.type === "BinaryExpression") {
return startsWithTemplateCurly(node.left);
}
if (node.type === "TemplateLiteral") {
return node.expressions.length && node.quasis.length && node.quasis[0].range[0] === node.quasis[0].range[1];
}
return n... | javascript | function startsWithTemplateCurly(node) {
if (node.type === "BinaryExpression") {
return startsWithTemplateCurly(node.left);
}
if (node.type === "TemplateLiteral") {
return node.expressions.length && node.quasis.length && node.quasis[0].range[0] === node.quasis[0].range[1];
}
return n... | [
"function",
"startsWithTemplateCurly",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"type",
"===",
"\"BinaryExpression\"",
")",
"{",
"return",
"startsWithTemplateCurly",
"(",
"node",
".",
"left",
")",
";",
"}",
"if",
"(",
"node",
".",
"type",
"===",
"\"T... | Determines whether a given node will start with a template curly expression (`${}`) when being converted to a template literal.
@param {ASTNode} node The node that will be fixed to a template literal
@returns {boolean} `true` if the node will start with a template curly. | [
"Determines",
"whether",
"a",
"given",
"node",
"will",
"start",
"with",
"a",
"template",
"curly",
"expression",
"(",
"$",
"{}",
")",
"when",
"being",
"converted",
"to",
"a",
"template",
"literal",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-template.js#L113-L121 | train | Returns true if the node is a template curly | [
30522,
3853,
4627,
24415,
18532,
15725,
10841,
21194,
1006,
13045,
1007,
1063,
2065,
1006,
13045,
1012,
2828,
1027,
1027,
1027,
1000,
12441,
10288,
20110,
3258,
1000,
1007,
1063,
2709,
4627,
24415,
18532,
15725,
10841,
21194,
1006,
13045,
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... |
SheetJS/js-xlsx | bits/39_xlsbiff.js | parse_XLSCell | function parse_XLSCell(blob/*::, length*/)/*:Cell*/ {
var rw = blob.read_shift(2); // 0-indexed
var col = blob.read_shift(2);
var ixfe = blob.read_shift(2);
return ({r:rw, c:col, ixfe:ixfe}/*:any*/);
} | javascript | function parse_XLSCell(blob/*::, length*/)/*:Cell*/ {
var rw = blob.read_shift(2); // 0-indexed
var col = blob.read_shift(2);
var ixfe = blob.read_shift(2);
return ({r:rw, c:col, ixfe:ixfe}/*:any*/);
} | [
"function",
"parse_XLSCell",
"(",
"blob",
"/*::, length*/",
")",
"/*:Cell*/",
"{",
"var",
"rw",
"=",
"blob",
".",
"read_shift",
"(",
"2",
")",
";",
"// 0-indexed",
"var",
"col",
"=",
"blob",
".",
"read_shift",
"(",
"2",
")",
";",
"var",
"ixfe",
"=",
"b... | /* [MS-XLS] 2.5.19 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"5",
".",
"19"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/39_xlsbiff.js#L2-L7 | train | Parse an LXSCell | [
30522,
3853,
11968,
3366,
1035,
28712,
11020,
5349,
1006,
1038,
4135,
2497,
1013,
1008,
1024,
1024,
1010,
3091,
1008,
1013,
1007,
1013,
1008,
1024,
3526,
1008,
1013,
1063,
13075,
1054,
2860,
1027,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/core/public/run.js | normalizeRunParams | function normalizeRunParams(context, options, callback) {
'use strict';
let typeErr = new TypeError('axe.run arguments are invalid');
// Determine the context
if (!isContext(context)) {
if (callback !== undefined) {
// Either context is invalid or there are too many params
throw typeErr;
}
// Set defau... | javascript | function normalizeRunParams(context, options, callback) {
'use strict';
let typeErr = new TypeError('axe.run arguments are invalid');
// Determine the context
if (!isContext(context)) {
if (callback !== undefined) {
// Either context is invalid or there are too many params
throw typeErr;
}
// Set defau... | [
"function",
"normalizeRunParams",
"(",
"context",
",",
"options",
",",
"callback",
")",
"{",
"'use strict'",
";",
"let",
"typeErr",
"=",
"new",
"TypeError",
"(",
"'axe.run arguments are invalid'",
")",
";",
"// Determine the context",
"if",
"(",
"!",
"isContext",
... | Normalize the optional params of axe.run()
@param {object} context
@param {object} options
@param {Function} callback
@return {object} With 3 keys: context, options, callback | [
"Normalize",
"the",
"optional",
"params",
"of",
"axe",
".",
"run",
"()"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/public/run.js#L32-L69 | train | Normalizes the run parameters | [
30522,
3853,
3671,
17629,
4609,
28689,
5244,
1006,
6123,
1010,
7047,
1010,
2655,
5963,
1007,
1063,
1005,
2224,
9384,
1005,
1025,
2292,
2828,
2121,
2099,
1027,
2047,
2828,
2121,
29165,
1006,
1005,
12946,
1012,
2448,
9918,
2024,
19528,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/command/Menus.js | MenuItem | function MenuItem(id, command) {
this.id = id;
this.isDivider = (command === DIVIDER);
this.isNative = false;
if (!this.isDivider && command !== SUBMENU) {
// Bind event handlers
this._enabledChanged = this._enabledChanged.bind(this);
this._checkedCha... | javascript | function MenuItem(id, command) {
this.id = id;
this.isDivider = (command === DIVIDER);
this.isNative = false;
if (!this.isDivider && command !== SUBMENU) {
// Bind event handlers
this._enabledChanged = this._enabledChanged.bind(this);
this._checkedCha... | [
"function",
"MenuItem",
"(",
"id",
",",
"command",
")",
"{",
"this",
".",
"id",
"=",
"id",
";",
"this",
".",
"isDivider",
"=",
"(",
"command",
"===",
"DIVIDER",
")",
";",
"this",
".",
"isNative",
"=",
"false",
";",
"if",
"(",
"!",
"this",
".",
"i... | MenuItem represents a single menu item that executes a Command or a menu divider. MenuItems
may have a sub-menu. A MenuItem may correspond to an HTML-based
menu item or a native menu item if Brackets is running in a native application shell
Since MenuItems may have a native implementation clients should create MenuIte... | [
"MenuItem",
"represents",
"a",
"single",
"menu",
"item",
"that",
"executes",
"a",
"Command",
"or",
"a",
"menu",
"divider",
".",
"MenuItems",
"may",
"have",
"a",
"sub",
"-",
"menu",
".",
"A",
"MenuItem",
"may",
"correspond",
"to",
"an",
"HTML",
"-",
"base... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/Menus.js#L309-L330 | train | MenuItem constructor. | [
30522,
3853,
12183,
4221,
2213,
1006,
8909,
1010,
3094,
1007,
1063,
2023,
1012,
8909,
1027,
8909,
1025,
2023,
1012,
2003,
4305,
17258,
2121,
1027,
1006,
3094,
1027,
1027,
1027,
11443,
2099,
1007,
1025,
2023,
1012,
3475,
8082,
1027,
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... |
mochajs/mocha | lib/browser/growl.js | display | function display(runner) {
var stats = runner.stats;
var symbol = {
cross: '\u274C',
tick: '\u2705'
};
var logo = require('../../package').notifyLogo;
var _message;
var message;
var title;
if (stats.failures) {
_message = stats.failures + ' of ' + stats.tests + ' tests failed';
message ... | javascript | function display(runner) {
var stats = runner.stats;
var symbol = {
cross: '\u274C',
tick: '\u2705'
};
var logo = require('../../package').notifyLogo;
var _message;
var message;
var title;
if (stats.failures) {
_message = stats.failures + ' of ' + stats.tests + ' tests failed';
message ... | [
"function",
"display",
"(",
"runner",
")",
"{",
"var",
"stats",
"=",
"runner",
".",
"stats",
";",
"var",
"symbol",
"=",
"{",
"cross",
":",
"'\\u274C'",
",",
"tick",
":",
"'\\u2705'",
"}",
";",
"var",
"logo",
"=",
"require",
"(",
"'../../package'",
")",... | Displays the notification.
@private
@param {Runner} runner - Runner instance. | [
"Displays",
"the",
"notification",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/browser/growl.js#L121-L158 | train | Display the test results | [
30522,
3853,
4653,
1006,
5479,
1007,
1063,
13075,
26319,
1027,
5479,
1012,
26319,
1025,
13075,
6454,
1027,
1063,
2892,
1024,
1005,
1032,
23343,
2581,
2549,
2278,
1005,
1010,
16356,
1024,
1005,
1032,
23343,
19841,
2629,
1005,
1065,
1025,
130... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/component/brush/BrushModel.js | function (areas) {
if (__DEV__) {
zrUtil.assert(zrUtil.isArray(areas));
zrUtil.each(areas, function (area) {
zrUtil.assert(area.brushType, 'Illegal areas');
});
}
// If ranges is null/undefined, range state remain.
// This helps user t... | javascript | function (areas) {
if (__DEV__) {
zrUtil.assert(zrUtil.isArray(areas));
zrUtil.each(areas, function (area) {
zrUtil.assert(area.brushType, 'Illegal areas');
});
}
// If ranges is null/undefined, range state remain.
// This helps user t... | [
"function",
"(",
"areas",
")",
"{",
"if",
"(",
"__DEV__",
")",
"{",
"zrUtil",
".",
"assert",
"(",
"zrUtil",
".",
"isArray",
"(",
"areas",
")",
")",
";",
"zrUtil",
".",
"each",
"(",
"areas",
",",
"function",
"(",
"area",
")",
"{",
"zrUtil",
".",
"... | If ranges is null/undefined, range state remain.
@param {Array.<Object>} [ranges] | [
"If",
"ranges",
"is",
"null",
"/",
"undefined",
"range",
"state",
"remain",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/component/brush/BrushModel.js#L120-L138 | train | Set the current brush area | [
30522,
3853,
1006,
2752,
1007,
1063,
2065,
1006,
1035,
1035,
16475,
1035,
1035,
1007,
1063,
1062,
22134,
4014,
1012,
20865,
1006,
1062,
22134,
4014,
1012,
18061,
11335,
2100,
1006,
2752,
1007,
1007,
1025,
1062,
22134,
4014,
1012,
2169,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/hasher.js | function(){
if(! _isActive) return;
if(_isHashChangeSupported){
_removeListener(window, 'hashchange', _checkHistory);
}else{
clearInterval(_checkInterval);
_checkInterval = null;
}
_isActive = false;
hasher.stopped.dispatch(_trimHash(_hash));
} | javascript | function(){
if(! _isActive) return;
if(_isHashChangeSupported){
_removeListener(window, 'hashchange', _checkHistory);
}else{
clearInterval(_checkInterval);
_checkInterval = null;
}
_isActive = false;
hasher.stopped.dispatch(_trimHash(_hash));
} | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"_isActive",
")",
"return",
";",
"if",
"(",
"_isHashChangeSupported",
")",
"{",
"_removeListener",
"(",
"window",
",",
"'hashchange'",
",",
"_checkHistory",
")",
";",
"}",
"else",
"{",
"clearInterval",
"(",
"_chec... | Stop listening/dispatching changes in the hash/history.
<ul>
<li>hasher won't dispatch CHANGE events by manually typing a new value or pressing the back/forward buttons after calling this method, unless you call hasher.init() again.</li>
<li>hasher will still dispatch changes made programatically by calling hasher.setH... | [
"Stop",
"listening",
"/",
"dispatching",
"changes",
"in",
"the",
"hash",
"/",
"history",
".",
"<ul",
">",
"<li",
">",
"hasher",
"won",
"t",
"dispatch",
"CHANGE",
"events",
"by",
"manually",
"typing",
"a",
"new",
"value",
"or",
"pressing",
"the",
"back",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/hasher.js#L319-L331 | train | Stop the hashchange check | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
999,
1035,
18061,
15277,
1007,
2709,
1025,
2065,
1006,
1035,
2003,
14949,
16257,
18003,
2229,
6279,
6442,
2098,
1007,
1063,
1035,
6366,
9863,
24454,
1006,
3332,
1010,
1005,
23325,
22305,
2063,
1005... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/RecentProjects/main.js | showDropdown | function showDropdown(position) {
// If the dropdown is already visible, just return (so the root click handler on html
// will close it).
if ($dropdown) {
return;
}
Menus.closeAll();
$dropdown = $(renderList())
.css({
left: posit... | javascript | function showDropdown(position) {
// If the dropdown is already visible, just return (so the root click handler on html
// will close it).
if ($dropdown) {
return;
}
Menus.closeAll();
$dropdown = $(renderList())
.css({
left: posit... | [
"function",
"showDropdown",
"(",
"position",
")",
"{",
"// If the dropdown is already visible, just return (so the root click handler on html",
"// will close it).",
"if",
"(",
"$dropdown",
")",
"{",
"return",
";",
"}",
"Menus",
".",
"closeAll",
"(",
")",
";",
"$dropdown"... | Show or hide the recent projects dropdown.
@param {{pageX:number, pageY:number}} position - the absolute position where to open the dropdown | [
"Show",
"or",
"hide",
"the",
"recent",
"projects",
"dropdown",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L376-L414 | train | Show the dropdown | [
30522,
3853,
2265,
25711,
7698,
1006,
2597,
1007,
1063,
1013,
1013,
2065,
1996,
4530,
7698,
2003,
2525,
5710,
1010,
2074,
2709,
1006,
2061,
1996,
7117,
11562,
28213,
2006,
16129,
1013,
1013,
2097,
2485,
2009,
1007,
1012,
2065,
1006,
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... |
netlify/netlify-cms | packages/netlify-cms-widget-markdown/src/serializers/remarkSlate.js | createInline | function createInline(type, props = {}, nodes) {
const node = { object: 'inline', type, ...props };
return addNodes(node, nodes);
} | javascript | function createInline(type, props = {}, nodes) {
const node = { object: 'inline', type, ...props };
return addNodes(node, nodes);
} | [
"function",
"createInline",
"(",
"type",
",",
"props",
"=",
"{",
"}",
",",
"nodes",
")",
"{",
"const",
"node",
"=",
"{",
"object",
":",
"'inline'",
",",
"type",
",",
"...",
"props",
"}",
";",
"return",
"addNodes",
"(",
"node",
",",
"nodes",
")",
";... | Create a Slate Block node. | [
"Create",
"a",
"Slate",
"Block",
"node",
"."
] | 2488556590cbfdcefa626f2f2de01e7a160cf6ee | https://github.com/netlify/netlify-cms/blob/2488556590cbfdcefa626f2f2de01e7a160cf6ee/packages/netlify-cms-widget-markdown/src/serializers/remarkSlate.js#L81-L84 | train | Create inline node | [
30522,
3853,
3443,
2378,
4179,
1006,
2828,
1010,
24387,
30524,
2828,
1010,
1012,
1012,
1012,
24387,
1065,
1025,
2709,
5587,
3630,
6155,
1006,
13045,
1010,
14164,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/less.js | function (str, callback, additionalData) {
var root, line, lines, error = null, globalVars, modifyVars, preText = "";
i = j = currentPos = furthest = 0;
globalVars = (additionalData && additionalData.globalVars) ? less.Parser.serializeVars(additionalData.globalVars) + '\n' : '';
... | javascript | function (str, callback, additionalData) {
var root, line, lines, error = null, globalVars, modifyVars, preText = "";
i = j = currentPos = furthest = 0;
globalVars = (additionalData && additionalData.globalVars) ? less.Parser.serializeVars(additionalData.globalVars) + '\n' : '';
... | [
"function",
"(",
"str",
",",
"callback",
",",
"additionalData",
")",
"{",
"var",
"root",
",",
"line",
",",
"lines",
",",
"error",
"=",
"null",
",",
"globalVars",
",",
"modifyVars",
",",
"preText",
"=",
"\"\"",
";",
"i",
"=",
"j",
"=",
"currentPos",
"... | Parse an input string into an abstract syntax tree, @param str A string containing 'less' markup @param callback call `callback` when done. @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply | [
"Parse",
"an",
"input",
"string",
"into",
"an",
"abstract",
"syntax",
"tree"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L383-L706 | train | Parse a string into chunks of less. js | [
30522,
3853,
1006,
2358,
2099,
1010,
2655,
5963,
1010,
3176,
2850,
2696,
1007,
1063,
13075,
7117,
1010,
2240,
1010,
3210,
1010,
7561,
1027,
19701,
1010,
3795,
10755,
2015,
1010,
19933,
10755,
2015,
1010,
3653,
18209,
1027,
1000,
1000,
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... | |
aframevr/aframe | src/core/a-assets.js | mediaElementLoaded | function mediaElementLoaded (el) {
if (!el.hasAttribute('autoplay') && el.getAttribute('preload') !== 'auto') {
return;
}
// If media specifies autoplay or preload, wait until media is completely buffered.
return new Promise(function (resolve, reject) {
if (el.readyState === 4) { return resolve(); } /... | javascript | function mediaElementLoaded (el) {
if (!el.hasAttribute('autoplay') && el.getAttribute('preload') !== 'auto') {
return;
}
// If media specifies autoplay or preload, wait until media is completely buffered.
return new Promise(function (resolve, reject) {
if (el.readyState === 4) { return resolve(); } /... | [
"function",
"mediaElementLoaded",
"(",
"el",
")",
"{",
"if",
"(",
"!",
"el",
".",
"hasAttribute",
"(",
"'autoplay'",
")",
"&&",
"el",
".",
"getAttribute",
"(",
"'preload'",
")",
"!==",
"'auto'",
")",
"{",
"return",
";",
"}",
"// If media specifies autoplay o... | Create a Promise that resolves once the media element has finished buffering.
@param {Element} el - HTMLMediaElement.
@returns {Promise} | [
"Create",
"a",
"Promise",
"that",
"resolves",
"once",
"the",
"media",
"element",
"has",
"finished",
"buffering",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/a-assets.js#L140-L174 | train | The media element loaded event handler. | [
30522,
3853,
2865,
12260,
3672,
17468,
1006,
3449,
1007,
1063,
2065,
1006,
999,
3449,
1012,
2038,
19321,
3089,
8569,
2618,
1006,
1005,
8285,
13068,
1005,
1007,
1004,
1004,
3449,
1012,
2131,
19321,
3089,
8569,
2618,
1006,
1005,
3653,
11066,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/ScopeManager.js | initTernModule | function initTernModule() {
var moduleDeferred = $.Deferred();
ternPromise = moduleDeferred.promise();
function prepareTern() {
_ternNodeDomain.exec("setInterface", {
messageIds : MessageIds
});
_tern... | javascript | function initTernModule() {
var moduleDeferred = $.Deferred();
ternPromise = moduleDeferred.promise();
function prepareTern() {
_ternNodeDomain.exec("setInterface", {
messageIds : MessageIds
});
_tern... | [
"function",
"initTernModule",
"(",
")",
"{",
"var",
"moduleDeferred",
"=",
"$",
".",
"Deferred",
"(",
")",
";",
"ternPromise",
"=",
"moduleDeferred",
".",
"promise",
"(",
")",
";",
"function",
"prepareTern",
"(",
")",
"{",
"_ternNodeDomain",
".",
"exec",
"... | Init the Tern module that does all the code hinting work. | [
"Init",
"the",
"Tern",
"module",
"that",
"does",
"all",
"the",
"code",
"hinting",
"work",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1096-L1163 | train | initTernModule - Initialize tern module | [
30522,
3853,
1999,
27100,
6826,
5302,
8566,
2571,
1006,
1007,
1063,
13075,
11336,
3207,
7512,
5596,
1027,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
28774,
16275,
21716,
5562,
1027,
11336,
3207,
7512,
5596,
1012,
4872,
1006,
30524,
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... |
material-components/material-components-web-react | scripts/release/cp-pkgs.js | cpTypes | function cpTypes(typeAsset) {
const {dir, base} = path.parse(typeAsset);
let destDir = dir.split('build/types/')[1];
destDir = destDir.split('/');
destDir.splice(2, 0, 'dist');
destDir = `${destDir.join('/')}/${base}`;
addTsIgnore(typeAsset);
return cpFile(typeAsset, destDir)
.then(() => console.log(`... | javascript | function cpTypes(typeAsset) {
const {dir, base} = path.parse(typeAsset);
let destDir = dir.split('build/types/')[1];
destDir = destDir.split('/');
destDir.splice(2, 0, 'dist');
destDir = `${destDir.join('/')}/${base}`;
addTsIgnore(typeAsset);
return cpFile(typeAsset, destDir)
.then(() => console.log(`... | [
"function",
"cpTypes",
"(",
"typeAsset",
")",
"{",
"const",
"{",
"dir",
",",
"base",
"}",
"=",
"path",
".",
"parse",
"(",
"typeAsset",
")",
";",
"let",
"destDir",
"=",
"dir",
".",
"split",
"(",
"'build/types/'",
")",
"[",
"1",
"]",
";",
"destDir",
... | takes assetPath, computes the destination file directory path and copies file into destination directory | [
"takes",
"assetPath",
"computes",
"the",
"destination",
"file",
"directory",
"path",
"and",
"copies",
"file",
"into",
"destination",
"directory"
] | 5ee9df0982d6cff893523c3e1e447b0f98bf8611 | https://github.com/material-components/material-components-web-react/blob/5ee9df0982d6cff893523c3e1e447b0f98bf8611/scripts/release/cp-pkgs.js#L96-L105 | train | cp types | [
30522,
3853,
18133,
13874,
2015,
1006,
2828,
27241,
2102,
1007,
1063,
9530,
3367,
1063,
16101,
1010,
2918,
1065,
1027,
4130,
1012,
11968,
3366,
1006,
2828,
27241,
2102,
1007,
1025,
2292,
4078,
2102,
4305,
2099,
1027,
16101,
1012,
3975,
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... |
getinsomnia/insomnia | packages/insomnia-importers/src/importers/openapi3.js | prepareHeaders | function prepareHeaders(endpointSchema) {
const isSendInHeader = p => p.in === 'header';
const parameters = endpointSchema.parameters || [];
const headerParameters = parameters.filter(isSendInHeader);
return convertParameters(headerParameters);
} | javascript | function prepareHeaders(endpointSchema) {
const isSendInHeader = p => p.in === 'header';
const parameters = endpointSchema.parameters || [];
const headerParameters = parameters.filter(isSendInHeader);
return convertParameters(headerParameters);
} | [
"function",
"prepareHeaders",
"(",
"endpointSchema",
")",
"{",
"const",
"isSendInHeader",
"=",
"p",
"=>",
"p",
".",
"in",
"===",
"'header'",
";",
"const",
"parameters",
"=",
"endpointSchema",
".",
"parameters",
"||",
"[",
"]",
";",
"const",
"headerParameters",... | Imports insomnia definitions of header parameters.
@param {Object} endpointSchema - OpenAPI 3 endpoint schema
@returns {Object[]} array of parameters definitions | [
"Imports",
"insomnia",
"definitions",
"of",
"header",
"parameters",
"."
] | e24ce7f7b41246e700c4b9bdb6b34b6652ad589b | https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-importers/src/importers/openapi3.js#L209-L214 | train | Prepare headers for the endpoint | [
30522,
3853,
7374,
4974,
2545,
1006,
2203,
26521,
5403,
2863,
1007,
1063,
9530,
3367,
26354,
10497,
2378,
4974,
2121,
1027,
1052,
1027,
1028,
1052,
1012,
1999,
1027,
1027,
1027,
1005,
20346,
1005,
1025,
9530,
3367,
11709,
1027,
2203,
26521,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/less.js | function (path, currentFileInfo, importOptions, callback) {
var parserImports = this;
this.queue.push(path);
var fileParsedFunc = function (e, root, fullPath) {
parserImports.queue.splice(parserImports.queue.indexOf(path), 1); // Remove the path from the queue
... | javascript | function (path, currentFileInfo, importOptions, callback) {
var parserImports = this;
this.queue.push(path);
var fileParsedFunc = function (e, root, fullPath) {
parserImports.queue.splice(parserImports.queue.indexOf(path), 1); // Remove the path from the queue
... | [
"function",
"(",
"path",
",",
"currentFileInfo",
",",
"importOptions",
",",
"callback",
")",
"{",
"var",
"parserImports",
"=",
"this",
";",
"this",
".",
"queue",
".",
"push",
"(",
"path",
")",
";",
"var",
"fileParsedFunc",
"=",
"function",
"(",
"e",
",",... | Error in parsing/evaluating an import | [
"Error",
"in",
"parsing",
"/",
"evaluating",
"an",
"import"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L97-L138 | train | Parse a file and return the root | [
30522,
3853,
1006,
4130,
1010,
2783,
8873,
19856,
14876,
1010,
12324,
7361,
9285,
1010,
2655,
5963,
1007,
1063,
13075,
11968,
8043,
5714,
25378,
1027,
2023,
1025,
2023,
1012,
24240,
1012,
5245,
1006,
4130,
1007,
1025,
13075,
5371,
19362,
69... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onUpdateConfirmPhoneVerification | function onUpdateConfirmPhoneVerification() {
if (!activeUser()) {
alertError('You need to sign in before linking an account.');
return;
}
var verificationId = $('#link-reauth-phone-verification-id').val();
var verificationCode = $('#link-reauth-phone-verification-code').val();
var credential = fireba... | javascript | function onUpdateConfirmPhoneVerification() {
if (!activeUser()) {
alertError('You need to sign in before linking an account.');
return;
}
var verificationId = $('#link-reauth-phone-verification-id').val();
var verificationCode = $('#link-reauth-phone-verification-code').val();
var credential = fireba... | [
"function",
"onUpdateConfirmPhoneVerification",
"(",
")",
"{",
"if",
"(",
"!",
"activeUser",
"(",
")",
")",
"{",
"alertError",
"(",
"'You need to sign in before linking an account.'",
")",
";",
"return",
";",
"}",
"var",
"verificationId",
"=",
"$",
"(",
"'#link-re... | Updates the user's phone number. | [
"Updates",
"the",
"user",
"s",
"phone",
"number",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L492-L505 | train | Updates the user s phone number | [
30522,
3853,
2006,
6279,
13701,
8663,
27972,
9864,
6299,
9031,
1006,
1007,
1063,
2065,
1006,
999,
3161,
20330,
1006,
1007,
1007,
1063,
9499,
2121,
29165,
1006,
1005,
2017,
2342,
2000,
3696,
1999,
2077,
11383,
2019,
4070,
1012,
1005,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
summernote/summernote | src/js/base/core/dom.js | listPrev | function listPrev(node, pred) {
pred = pred || func.fail;
const nodes = [];
while (node) {
if (pred(node)) { break; }
nodes.push(node);
node = node.previousSibling;
}
return nodes;
} | javascript | function listPrev(node, pred) {
pred = pred || func.fail;
const nodes = [];
while (node) {
if (pred(node)) { break; }
nodes.push(node);
node = node.previousSibling;
}
return nodes;
} | [
"function",
"listPrev",
"(",
"node",
",",
"pred",
")",
"{",
"pred",
"=",
"pred",
"||",
"func",
".",
"fail",
";",
"const",
"nodes",
"=",
"[",
"]",
";",
"while",
"(",
"node",
")",
"{",
"if",
"(",
"pred",
"(",
"node",
")",
")",
"{",
"break",
";",
... | listing all previous siblings (until predicate hit).
@param {Node} node
@param {Function} [optional] pred - predicate function | [
"listing",
"all",
"previous",
"siblings",
"(",
"until",
"predicate",
"hit",
")",
"."
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L316-L326 | train | List the previous nodes of a node | [
30522,
3853,
2862,
28139,
2615,
1006,
13045,
1010,
3653,
2094,
1007,
1063,
3653,
2094,
1027,
3653,
2094,
1064,
1064,
4569,
2278,
1012,
8246,
1025,
9530,
3367,
14164,
1027,
1031,
1033,
1025,
2096,
1006,
13045,
1007,
1063,
2065,
1006,
3653,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | lib/jsdoc/ui5/template/publish.js | makeSortby | function makeSortby(/* fields ...*/) {
var aFields = Array.prototype.slice.apply(arguments),
aNorms = [],
aFuncs = [];
for (var i = 0; i < arguments.length; i++) {
aNorms[i] = 1;
if ( typeof aFields[i] === 'function' ) {
aFuncs[i] = aFields[i];
continue;
}
aFuncs[i] = function($,n) { return $[n]; };... | javascript | function makeSortby(/* fields ...*/) {
var aFields = Array.prototype.slice.apply(arguments),
aNorms = [],
aFuncs = [];
for (var i = 0; i < arguments.length; i++) {
aNorms[i] = 1;
if ( typeof aFields[i] === 'function' ) {
aFuncs[i] = aFields[i];
continue;
}
aFuncs[i] = function($,n) { return $[n]; };... | [
"function",
"makeSortby",
"(",
"/* fields ...*/",
")",
"{",
"var",
"aFields",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"apply",
"(",
"arguments",
")",
",",
"aNorms",
"=",
"[",
"]",
",",
"aFuncs",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
... | /* Make a symbol sorter by some attribute. | [
"/",
"*",
"Make",
"a",
"symbol",
"sorter",
"by",
"some",
"attribute",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/ui5/template/publish.js#L1197-L1246 | train | Creates a function that can be used to sort by a list of fields | [
30522,
3853,
3084,
11589,
3762,
1006,
1013,
1008,
4249,
1012,
1012,
1012,
1008,
1013,
1007,
1063,
13075,
28697,
14273,
2015,
1027,
9140,
1012,
8773,
1012,
14704,
1012,
6611,
1006,
9918,
1007,
1010,
2019,
2953,
5244,
1027,
1031,
1033,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/dialog/dialog.js | activateListeners | function activateListeners(element, options) {
var window = angular.element($window);
var onWindowResize = $mdUtil.debounce(function() {
stretchDialogContainerToViewport(element, options);
}, 60);
var removeListeners = [];
var smartClose = function() {
// Only 'confirm' di... | javascript | function activateListeners(element, options) {
var window = angular.element($window);
var onWindowResize = $mdUtil.debounce(function() {
stretchDialogContainerToViewport(element, options);
}, 60);
var removeListeners = [];
var smartClose = function() {
// Only 'confirm' di... | [
"function",
"activateListeners",
"(",
"element",
",",
"options",
")",
"{",
"var",
"window",
"=",
"angular",
".",
"element",
"(",
"$window",
")",
";",
"var",
"onWindowResize",
"=",
"$mdUtil",
".",
"debounce",
"(",
"function",
"(",
")",
"{",
"stretchDialogCont... | Listen for escape keys and outside clicks to auto close | [
"Listen",
"for",
"escape",
"keys",
"and",
"outside",
"clicks",
"to",
"auto",
"close"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L949-L1036 | train | Activate the listeners for the given element | [
30522,
3853,
20544,
9863,
24454,
2015,
1006,
5783,
1010,
7047,
1007,
1063,
13075,
3332,
1027,
16108,
1012,
5783,
1006,
1002,
3332,
1007,
1025,
13075,
2006,
11101,
5004,
6072,
4697,
1027,
1002,
9108,
21823,
2140,
1012,
2139,
5092,
17457,
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... |
eslint/eslint | lib/util/source-code.js | sortedMerge | function sortedMerge(tokens, comments) {
const result = [];
let tokenIndex = 0;
let commentIndex = 0;
while (tokenIndex < tokens.length || commentIndex < comments.length) {
if (commentIndex >= comments.length || tokenIndex < tokens.length && tokens[tokenIndex].range[0] < comments[commentIndex].... | javascript | function sortedMerge(tokens, comments) {
const result = [];
let tokenIndex = 0;
let commentIndex = 0;
while (tokenIndex < tokens.length || commentIndex < comments.length) {
if (commentIndex >= comments.length || tokenIndex < tokens.length && tokens[tokenIndex].range[0] < comments[commentIndex].... | [
"function",
"sortedMerge",
"(",
"tokens",
",",
"comments",
")",
"{",
"const",
"result",
"=",
"[",
"]",
";",
"let",
"tokenIndex",
"=",
"0",
";",
"let",
"commentIndex",
"=",
"0",
";",
"while",
"(",
"tokenIndex",
"<",
"tokens",
".",
"length",
"||",
"comme... | Merges two sorted lists into a larger sorted list in O(n) time.
@param {Token[]} tokens The list of tokens.
@param {Token[]} comments The list of comments.
@returns {Token[]} A sorted list of tokens and comments.
@private | [
"Merges",
"two",
"sorted",
"lists",
"into",
"a",
"larger",
"sorted",
"list",
"in",
"O",
"(",
"n",
")",
"time",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/source-code.js#L63-L77 | train | Merge a list of tokens and comments into a single array | [
30522,
3853,
19616,
5017,
3351,
1006,
19204,
2015,
1010,
7928,
1007,
1063,
9530,
3367,
2765,
1027,
1031,
1033,
1025,
2292,
19204,
22254,
10288,
1027,
1014,
1025,
2292,
7615,
22254,
10288,
1027,
1014,
1025,
2096,
1006,
19204,
22254,
10288,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js | htmlSplit | function htmlSplit(str) {
// can't hoist this out of the function because of the re.exec loop.
var re = /(<\/|<\!--|<[!?]|[&<>])/g;
str += '';
if (splitWillCapture) {
return str.split(re);
} else {
var parts = [];
var lastPos = 0;
var m;
while ((m = re.exec(str)) !== nu... | javascript | function htmlSplit(str) {
// can't hoist this out of the function because of the re.exec loop.
var re = /(<\/|<\!--|<[!?]|[&<>])/g;
str += '';
if (splitWillCapture) {
return str.split(re);
} else {
var parts = [];
var lastPos = 0;
var m;
while ((m = re.exec(str)) !== nu... | [
"function",
"htmlSplit",
"(",
"str",
")",
"{",
"// can't hoist this out of the function because of the re.exec loop.",
"var",
"re",
"=",
"/",
"(<\\/|<\\!--|<[!?]|[&<>])",
"/",
"g",
";",
"str",
"+=",
"''",
";",
"if",
"(",
"splitWillCapture",
")",
"{",
"return",
"str"... | Split str into parts for the html parser. | [
"Split",
"str",
"into",
"parts",
"for",
"the",
"html",
"parser",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js#L3152-L3170 | train | split the string into an array of parts | [
30522,
3853,
16129,
13102,
15909,
1006,
2358,
2099,
1007,
1063,
1013,
1013,
2064,
1005,
1056,
7570,
2923,
2023,
2041,
1997,
1996,
3853,
2138,
1997,
1996,
2128,
1012,
4654,
8586,
7077,
1012,
13075,
2128,
1027,
1013,
1006,
1026,
1032,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | function(evt)
{
var state = null;
// Workaround for touch events which started on some DOM node
// on top of the container, in which case the cells under the
// mouse for the move and up events are not detected.
if (mxClient.IS_TOUCH)
{
var x = mxEvent.getClientX(evt);
var y = mxEvent.ge... | javascript | function(evt)
{
var state = null;
// Workaround for touch events which started on some DOM node
// on top of the container, in which case the cells under the
// mouse for the move and up events are not detected.
if (mxClient.IS_TOUCH)
{
var x = mxEvent.getClientX(evt);
var y = mxEvent.ge... | [
"function",
"(",
"evt",
")",
"{",
"var",
"state",
"=",
"null",
";",
"// Workaround for touch events which started on some DOM node",
"// on top of the container, in which case the cells under the",
"// mouse for the move and up events are not detected.",
"if",
"(",
"mxClient",
".",
... | Workaround for touch events which started on some DOM node on top of the container, in which case the cells under the mouse for the move and up events are not detected. | [
"Workaround",
"for",
"touch",
"events",
"which",
"started",
"on",
"some",
"DOM",
"node",
"on",
"top",
"of",
"the",
"container",
"in",
"which",
"case",
"the",
"cells",
"under",
"the",
"mouse",
"for",
"the",
"move",
"and",
"up",
"events",
"are",
"not",
"de... | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L53687-L53706 | train | This function is called when the user clicks on a cell | [
30522,
3853,
1006,
23408,
2102,
1007,
1063,
13075,
2110,
1027,
19701,
1025,
1013,
1013,
2147,
24490,
2005,
3543,
2824,
2029,
2318,
2006,
2070,
14383,
13045,
1013,
1013,
2006,
2327,
1997,
1996,
11661,
1010,
1999,
2029,
2553,
1996,
4442,
2104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/constants/defaultPlugins.js | createFromDependency | function createFromDependency(pluginName) {
var npmID = PluginDependency.nameToNpmID(pluginName);
var version = pkg.dependencies[npmID];
return PluginDependency.create(pluginName, version);
} | javascript | function createFromDependency(pluginName) {
var npmID = PluginDependency.nameToNpmID(pluginName);
var version = pkg.dependencies[npmID];
return PluginDependency.create(pluginName, version);
} | [
"function",
"createFromDependency",
"(",
"pluginName",
")",
"{",
"var",
"npmID",
"=",
"PluginDependency",
".",
"nameToNpmID",
"(",
"pluginName",
")",
";",
"var",
"version",
"=",
"pkg",
".",
"dependencies",
"[",
"npmID",
"]",
";",
"return",
"PluginDependency",
... | Create a PluginDependency from a dependency of gitbook
@param {String} pluginName
@return {PluginDependency} | [
"Create",
"a",
"PluginDependency",
"from",
"a",
"dependency",
"of",
"gitbook"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/constants/defaultPlugins.js#L11-L16 | train | Create a new PluginDependency object from a name | [
30522,
3853,
3443,
19699,
5358,
3207,
11837,
4181,
5666,
1006,
13354,
23111,
14074,
1007,
1063,
13075,
27937,
4328,
2094,
1027,
13354,
22254,
13699,
10497,
11916,
1012,
2171,
2669,
9737,
3593,
1006,
13354,
23111,
14074,
1007,
1025,
13075,
254... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/qunit.js | function( fn ) {
var args,
l = fn.length;
if ( !l ) {
return "";
}
args = new Array( l );
while ( l-- ) {
// 97 is 'a'
args[ l ] = String.fromCharCode( 97 + l );
}
return " " + args.join( ", " ) + " ";
} | javascript | function( fn ) {
var args,
l = fn.length;
if ( !l ) {
return "";
}
args = new Array( l );
while ( l-- ) {
// 97 is 'a'
args[ l ] = String.fromCharCode( 97 + l );
}
return " " + args.join( ", " ) + " ";
} | [
"function",
"(",
"fn",
")",
"{",
"var",
"args",
",",
"l",
"=",
"fn",
".",
"length",
";",
"if",
"(",
"!",
"l",
")",
"{",
"return",
"\"\"",
";",
"}",
"args",
"=",
"new",
"Array",
"(",
"l",
")",
";",
"while",
"(",
"l",
"--",
")",
"{",
"// 97 i... | function calls it internally, it's the arguments part of the function | [
"function",
"calls",
"it",
"internally",
"it",
"s",
"the",
"arguments",
"part",
"of",
"the",
"function"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/qunit.js#L1864-L1879 | train | Returns a string that is a function that can be called with the arguments passed to the function. | [
30522,
3853,
1006,
1042,
2078,
1007,
1063,
13075,
12098,
5620,
1010,
1048,
1027,
1042,
2078,
1012,
3091,
1025,
2065,
1006,
999,
1048,
1007,
1063,
2709,
1000,
1000,
1025,
1065,
12098,
5620,
1027,
2047,
9140,
1006,
1048,
1007,
1025,
2096,
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/AutoUpdate/main.js | dirtyFileSaveCancelled | function dirtyFileSaveCancelled() {
UpdateInfoBar.showUpdateBar({
type: "warning",
title: Strings.WARNING_TYPE,
description: Strings.UPDATE_ON_NEXT_LAUNCH
});
} | javascript | function dirtyFileSaveCancelled() {
UpdateInfoBar.showUpdateBar({
type: "warning",
title: Strings.WARNING_TYPE,
description: Strings.UPDATE_ON_NEXT_LAUNCH
});
} | [
"function",
"dirtyFileSaveCancelled",
"(",
")",
"{",
"UpdateInfoBar",
".",
"showUpdateBar",
"(",
"{",
"type",
":",
"\"warning\"",
",",
"title",
":",
"Strings",
".",
"WARNING_TYPE",
",",
"description",
":",
"Strings",
".",
"UPDATE_ON_NEXT_LAUNCH",
"}",
")",
";",
... | Handles the Cancel button click by user in
Unsaved changes prompt, which would come up if user
has dirty files and he/she clicked UpdateNow | [
"Handles",
"the",
"Cancel",
"button",
"click",
"by",
"user",
"in",
"Unsaved",
"changes",
"prompt",
"which",
"would",
"come",
"up",
"if",
"user",
"has",
"dirty",
"files",
"and",
"he",
"/",
"she",
"clicked",
"UpdateNow"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L805-L811 | train | Called when a file has been saved to disk | [
30522,
3853,
6530,
8873,
4244,
10696,
9336,
29109,
3709,
1006,
1007,
1063,
10651,
2378,
14876,
8237,
1012,
2265,
6279,
13701,
8237,
1006,
1063,
2828,
1024,
1000,
5432,
1000,
1010,
2516,
1024,
7817,
1012,
5432,
1035,
2828,
1010,
6412,
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... |
SheetJS/js-xlsx | xlsx.js | write_ws_xlml_table | function write_ws_xlml_table(ws, opts, idx, wb) {
if(!ws['!ref']) return "";
var range = safe_decode_range(ws['!ref']);
var marr = ws['!merges'] || [], mi = 0;
var o = [];
if(ws['!cols']) ws['!cols'].forEach(function(n, i) {
process_col(n);
var w = !!n.width;
var p = col_obj_w(i, n);
var k = {"ss:Index":i+... | javascript | function write_ws_xlml_table(ws, opts, idx, wb) {
if(!ws['!ref']) return "";
var range = safe_decode_range(ws['!ref']);
var marr = ws['!merges'] || [], mi = 0;
var o = [];
if(ws['!cols']) ws['!cols'].forEach(function(n, i) {
process_col(n);
var w = !!n.width;
var p = col_obj_w(i, n);
var k = {"ss:Index":i+... | [
"function",
"write_ws_xlml_table",
"(",
"ws",
",",
"opts",
",",
"idx",
",",
"wb",
")",
"{",
"if",
"(",
"!",
"ws",
"[",
"'!ref'",
"]",
")",
"return",
"\"\"",
";",
"var",
"range",
"=",
"safe_decode_range",
"(",
"ws",
"[",
"'!ref'",
"]",
")",
";",
"va... | /* TODO | [
"/",
"*",
"TODO"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L16212-L16248 | train | Write a table of cells | [
30522,
3853,
4339,
1035,
1059,
2015,
1035,
28712,
19968,
1035,
2795,
1006,
1059,
2015,
1010,
23569,
2015,
1010,
8909,
2595,
1010,
25610,
1007,
1063,
2065,
1006,
999,
1059,
2015,
1031,
1005,
999,
25416,
1005,
1033,
1007,
2709,
1000,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.