repo stringclasses 195
values | path stringlengths 4 99 | func_name stringlengths 0 41 | original_string stringlengths 72 56.1k | language stringclasses 1
value | code stringlengths 72 56.1k | code_tokens listlengths 25 8.12k | docstring stringlengths 2 12.5k | docstring_tokens listlengths 1 449 | sha stringclasses 197
values | url stringlengths 88 186 | partition stringclasses 1
value | summary stringlengths 8 338 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function(sName) {
if (this._oMeasureSet[sName]) { // the easy case
return this._oMeasureSet[sName];
}
for ( var sMeasureName in this._oMeasureSet) {
var oMeasure = this._oMeasureSet[sMeasureName];
var oFormattedValueProperty = oMeasure.getFormattedValueProperty();
if (oFormattedValueProperty &... | javascript | function(sName) {
if (this._oMeasureSet[sName]) { // the easy case
return this._oMeasureSet[sName];
}
for ( var sMeasureName in this._oMeasureSet) {
var oMeasure = this._oMeasureSet[sMeasureName];
var oFormattedValueProperty = oMeasure.getFormattedValueProperty();
if (oFormattedValueProperty &... | [
"function",
"(",
"sName",
")",
"{",
"if",
"(",
"this",
".",
"_oMeasureSet",
"[",
"sName",
"]",
")",
"{",
"// the easy case",
"return",
"this",
".",
"_oMeasureSet",
"[",
"sName",
"]",
";",
"}",
"for",
"(",
"var",
"sMeasureName",
"in",
"this",
".",
"_oMe... | Find measure by property name
@param {string}
sName Property name
@returns {sap.ui.model.analytics.odata4analytics.Measure} The measure object to which
the given property name is related, because the property holds
the raw measure value or its formatted value. If no such measure
exists, null is returned.
@public
@func... | [
"Find",
"measure",
"by",
"property",
"name"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1163-L1176 | train | Returns the measure with the given name | [
30522,
3853,
1006,
1055,
18442,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
18168,
5243,
28632,
13462,
1031,
1055,
18442,
1033,
1007,
1063,
1013,
1013,
1996,
3733,
2553,
2709,
2023,
1012,
1035,
18168,
5243,
28632,
13462,
1031,
1055,
18442,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Requestor.js | reject | function reject(oError, vRequest) {
if (Array.isArray(vRequest)) {
vRequest.forEach(reject.bind(null, oError));
} else {
vRequest.$reject(oError);
}
} | javascript | function reject(oError, vRequest) {
if (Array.isArray(vRequest)) {
vRequest.forEach(reject.bind(null, oError));
} else {
vRequest.$reject(oError);
}
} | [
"function",
"reject",
"(",
"oError",
",",
"vRequest",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"vRequest",
")",
")",
"{",
"vRequest",
".",
"forEach",
"(",
"reject",
".",
"bind",
"(",
"null",
",",
"oError",
")",
")",
";",
"}",
"else",
"{",... | /*
(Recursively) rejects the request(s) with the given error
@param {Error} oError
@param {object|object[]} vRequest | [
"/",
"*",
"(",
"Recursively",
")",
"rejects",
"the",
"request",
"(",
"s",
")",
"with",
"the",
"given",
"error"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Requestor.js#L1385-L1391 | train | rejects all the errors in the request | [
30522,
3853,
15454,
1006,
1051,
2121,
29165,
1010,
27830,
2063,
15500,
1007,
1063,
2065,
1006,
9140,
1012,
18061,
11335,
2100,
1006,
27830,
2063,
15500,
1007,
1007,
1063,
27830,
2063,
15500,
1012,
18921,
6776,
1006,
15454,
1012,
14187,
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... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/dom-utils.js | DOMWalker_modalWindowHelper | function DOMWalker_modalWindowHelper(controller) {
let domWalker = new DOMWalker(controller,
persisted.modalInfos.callbackFilter,
persisted.modalInfos.callbackNodeTest,
persisted.modalInfos.callbackResults);
do... | javascript | function DOMWalker_modalWindowHelper(controller) {
let domWalker = new DOMWalker(controller,
persisted.modalInfos.callbackFilter,
persisted.modalInfos.callbackNodeTest,
persisted.modalInfos.callbackResults);
do... | [
"function",
"DOMWalker_modalWindowHelper",
"(",
"controller",
")",
"{",
"let",
"domWalker",
"=",
"new",
"DOMWalker",
"(",
"controller",
",",
"persisted",
".",
"modalInfos",
".",
"callbackFilter",
",",
"persisted",
".",
"modalInfos",
".",
"callbackNodeTest",
",",
"... | Callback function to handle new windows
@param {MozMillController} controller
MozMill controller of the new window to operate on. | [
"Callback",
"function",
"to",
"handle",
"new",
"windows"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/dom-utils.js#L457-L469 | train | DOMWalker_modalWindowHelper - Helper function for the modal window | [
30522,
3853,
14383,
26965,
1035,
16913,
2389,
11101,
5004,
16001,
4842,
1006,
11486,
1007,
1063,
2292,
14383,
26965,
1027,
2047,
14383,
26965,
1006,
11486,
1010,
19035,
1012,
16913,
11475,
2078,
14876,
2015,
1012,
2655,
5963,
8873,
21928,
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... |
TryGhost/Ghost | core/server/models/post.js | filterData | function filterData(data) {
var filteredData = ghostBookshelf.Model.filterData.apply(this, arguments),
extraData = _.pick(data, this.prototype.relationships);
_.merge(filteredData, extraData);
return filteredData;
} | javascript | function filterData(data) {
var filteredData = ghostBookshelf.Model.filterData.apply(this, arguments),
extraData = _.pick(data, this.prototype.relationships);
_.merge(filteredData, extraData);
return filteredData;
} | [
"function",
"filterData",
"(",
"data",
")",
"{",
"var",
"filteredData",
"=",
"ghostBookshelf",
".",
"Model",
".",
"filterData",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
",",
"extraData",
"=",
"_",
".",
"pick",
"(",
"data",
",",
"this",
".",
"p... | Manually add 'tags' attribute since it's not in the schema and call parent.
@param {Object} data Has keys representing the model's attributes/fields in the database.
@return {Object} The filtered results of the passed in data, containing only what's allowed in the schema. | [
"Manually",
"add",
"tags",
"attribute",
"since",
"it",
"s",
"not",
"in",
"the",
"schema",
"and",
"call",
"parent",
"."
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/models/post.js#L749-L755 | train | filterData - Filter data | [
30522,
3853,
11307,
2850,
2696,
1006,
2951,
1007,
1063,
13075,
21839,
2850,
2696,
1027,
5745,
17470,
16001,
2546,
1012,
2944,
1012,
11307,
2850,
2696,
1012,
6611,
1006,
2023,
1010,
9918,
1007,
1010,
4469,
2850,
2696,
1027,
1035,
1012,
4060,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/errors.js | createInvalidExceptionError | function createInvalidExceptionError(message, value) {
var err = new Error(message);
err.code = 'ERR_MOCHA_INVALID_EXCEPTION';
err.valueType = typeof value;
err.value = value;
return err;
} | javascript | function createInvalidExceptionError(message, value) {
var err = new Error(message);
err.code = 'ERR_MOCHA_INVALID_EXCEPTION';
err.valueType = typeof value;
err.value = value;
return err;
} | [
"function",
"createInvalidExceptionError",
"(",
"message",
",",
"value",
")",
"{",
"var",
"err",
"=",
"new",
"Error",
"(",
"message",
")",
";",
"err",
".",
"code",
"=",
"'ERR_MOCHA_INVALID_EXCEPTION'",
";",
"err",
".",
"valueType",
"=",
"typeof",
"value",
";... | Creates an error object to be thrown when an exception was caught, but the `Error` is falsy or undefined.
@public
@param {string} message - Error message to be displayed.
@returns {Error} instance detailing the error condition | [
"Creates",
"an",
"error",
"object",
"to",
"be",
"thrown",
"when",
"an",
"exception",
"was",
"caught",
"but",
"the",
"Error",
"is",
"falsy",
"or",
"undefined",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/errors.js#L124-L130 | train | Creates an error object that can be thrown when the value is not a valid type | [
30522,
3853,
3443,
2378,
10175,
5178,
2595,
24422,
2121,
29165,
1006,
4471,
1010,
3643,
1007,
1063,
13075,
9413,
2099,
1027,
2047,
7561,
1006,
4471,
1007,
1025,
9413,
2099,
1012,
3642,
1027,
1005,
9413,
2099,
1035,
9587,
7507,
1035,
19528,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/s3/managed_upload.js | function(callback) {
var self = this;
self.failed = false;
self.callback = callback || function(err) { if (err) throw err; };
var runFill = true;
if (self.sliceFn) {
self.fillQueue = self.fillBuffer;
} else if (AWS.util.isNode()) {
var Stream = AWS.util.stream.Stream;
if (self... | javascript | function(callback) {
var self = this;
self.failed = false;
self.callback = callback || function(err) { if (err) throw err; };
var runFill = true;
if (self.sliceFn) {
self.fillQueue = self.fillBuffer;
} else if (AWS.util.isNode()) {
var Stream = AWS.util.stream.Stream;
if (self... | [
"function",
"(",
"callback",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"failed",
"=",
"false",
";",
"self",
".",
"callback",
"=",
"callback",
"||",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"err",
")",
"throw",
"err",
";",
"}",
"... | Initiates the managed upload for the payload.
@callback callback function(err, data)
@param err [Error] an error or null if no error occurred.
@param data [map] The response data from the successful upload:
* `Location` (String) the URL of the uploaded object
* `ETag` (String) the ETag of the uploaded object
* `Bucket... | [
"Initiates",
"the",
"managed",
"upload",
"for",
"the",
"payload",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/s3/managed_upload.js#L170-L200 | train | This method is called by the next iteration of the iteration. | [
30522,
3853,
1006,
2655,
5963,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2969,
1012,
3478,
1027,
6270,
1025,
2969,
1012,
2655,
5963,
1027,
2655,
5963,
1064,
1064,
3853,
1006,
9413,
2099,
1007,
1063,
2065,
1006,
9413,
2099,
1007,
5466,
94... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/LocaleData.js | function(sSkeleton, oAvailableFormats, sCalendarType, vDiff) {
var vPattern, aPatterns, oIntervalFormats;
if (!vDiff) {
// the call is from getCustomDateTimePattern
vPattern = oAvailableFormats[sSkeleton];
} else if (typeof vDiff === "string") {
// vDiff is given as a symbol
if (vDiff == "j" |... | javascript | function(sSkeleton, oAvailableFormats, sCalendarType, vDiff) {
var vPattern, aPatterns, oIntervalFormats;
if (!vDiff) {
// the call is from getCustomDateTimePattern
vPattern = oAvailableFormats[sSkeleton];
} else if (typeof vDiff === "string") {
// vDiff is given as a symbol
if (vDiff == "j" |... | [
"function",
"(",
"sSkeleton",
",",
"oAvailableFormats",
",",
"sCalendarType",
",",
"vDiff",
")",
"{",
"var",
"vPattern",
",",
"aPatterns",
",",
"oIntervalFormats",
";",
"if",
"(",
"!",
"vDiff",
")",
"{",
"// the call is from getCustomDateTimePattern",
"vPattern",
... | /* Helper functions for skeleton pattern processing | [
"/",
"*",
"Helper",
"functions",
"for",
"skeleton",
"pattern",
"processing"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L350-L384 | train | Returns the pattern for the given format skeleton. | [
30522,
3853,
1006,
7020,
11705,
18903,
2078,
1010,
1051,
12462,
11733,
3468,
14192,
11149,
1010,
4094,
8943,
30524,
1013,
1013,
1996,
2655,
2003,
2013,
2131,
7874,
20389,
13701,
7292,
4502,
12079,
2078,
21210,
20097,
2078,
1027,
1051,
12462,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableUtils.js | function(oTable) {
if (!oTable) {
return false;
}
var oRowSettingsTemplate = oTable.getRowSettingsTemplate();
if (!oRowSettingsTemplate) {
return false;
}
var sHighlight = oRowSettingsTemplate.getHighlight();
return oRowSettingsTemplate.isBound("highlight")
|| (sHighlight != null... | javascript | function(oTable) {
if (!oTable) {
return false;
}
var oRowSettingsTemplate = oTable.getRowSettingsTemplate();
if (!oRowSettingsTemplate) {
return false;
}
var sHighlight = oRowSettingsTemplate.getHighlight();
return oRowSettingsTemplate.isBound("highlight")
|| (sHighlight != null... | [
"function",
"(",
"oTable",
")",
"{",
"if",
"(",
"!",
"oTable",
")",
"{",
"return",
"false",
";",
"}",
"var",
"oRowSettingsTemplate",
"=",
"oTable",
".",
"getRowSettingsTemplate",
"(",
")",
";",
"if",
"(",
"!",
"oRowSettingsTemplate",
")",
"{",
"return",
... | Returns whether the table has row highlights.
@param {sap.ui.table.Table} oTable Instance of the table.
@returns {boolean} Whether the table has row highlights. | [
"Returns",
"whether",
"the",
"table",
"has",
"row",
"highlights",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L257-L272 | train | Returns true if the table has a row highlight property | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
2065,
1006,
999,
27178,
3085,
1007,
1063,
2709,
6270,
1025,
1065,
13075,
20298,
9333,
18319,
3070,
13473,
8737,
13806,
1027,
27178,
3085,
1012,
2131,
10524,
21678,
30524,
13473,
8737,
13806,
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... | |
ramda/ramda | scripts/transpile/esm-to-cjs.js | function(path, state) {
var defaultReexportSpecifier = path.get('specifiers')[0];
var local = defaultReexportSpecifier.get('local').get('name').node;
var exported = defaultReexportSpecifier.get('exported').get('name').node;
if (local !== 'default') {
throw path.buildCodeFrameError('Only named exports allow... | javascript | function(path, state) {
var defaultReexportSpecifier = path.get('specifiers')[0];
var local = defaultReexportSpecifier.get('local').get('name').node;
var exported = defaultReexportSpecifier.get('exported').get('name').node;
if (local !== 'default') {
throw path.buildCodeFrameError('Only named exports allow... | [
"function",
"(",
"path",
",",
"state",
")",
"{",
"var",
"defaultReexportSpecifier",
"=",
"path",
".",
"get",
"(",
"'specifiers'",
")",
"[",
"0",
"]",
";",
"var",
"local",
"=",
"defaultReexportSpecifier",
".",
"get",
"(",
"'local'",
")",
".",
"get",
"(",
... | /*
before
export { default as curryN } from './curryN';
after
module.exports.curryN = require('./curryN'); | [
"/",
"*",
"before",
"export",
"{",
"default",
"as",
"curryN",
"}",
"from",
".",
"/",
"curryN",
";"
] | 072d417a345e7087a95466a9825d43b6ca3a4941 | https://github.com/ramda/ramda/blob/072d417a345e7087a95466a9825d43b6ca3a4941/scripts/transpile/esm-to-cjs.js#L113-L134 | train | reexports is a function | [
30522,
3853,
1006,
4130,
1010,
2110,
1007,
1063,
13075,
12398,
9910,
2595,
25378,
5051,
6895,
8873,
2121,
1027,
4130,
1012,
2131,
1006,
1005,
28699,
28295,
1005,
1007,
1031,
1014,
1033,
1025,
13075,
2334,
1027,
12398,
9910,
2595,
25378,
505... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | xlsx.js | parse_XFCRC | function parse_XFCRC(blob) {
blob.l += 2;
var o = {cxfs:0, crc:0};
o.cxfs = blob.read_shift(2);
o.crc = blob.read_shift(4);
return o;
} | javascript | function parse_XFCRC(blob) {
blob.l += 2;
var o = {cxfs:0, crc:0};
o.cxfs = blob.read_shift(2);
o.crc = blob.read_shift(4);
return o;
} | [
"function",
"parse_XFCRC",
"(",
"blob",
")",
"{",
"blob",
".",
"l",
"+=",
"2",
";",
"var",
"o",
"=",
"{",
"cxfs",
":",
"0",
",",
"crc",
":",
"0",
"}",
";",
"o",
".",
"cxfs",
"=",
"blob",
".",
"read_shift",
"(",
"2",
")",
";",
"o",
".",
"crc... | /* [MS-XLS] 2.4.354 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"4",
".",
"354"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L6497-L6503 | train | Parse XFCRC | [
30522,
3853,
11968,
3366,
1035,
1060,
11329,
11890,
1006,
1038,
4135,
2497,
1007,
1063,
1038,
4135,
2497,
1012,
1048,
1009,
1027,
1016,
1025,
13075,
1051,
1027,
1063,
1039,
2595,
10343,
1024,
1014,
1010,
13675,
2278,
1024,
1014,
1065,
1025,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/atoms/dom.js | hiddenByOverflow | function hiddenByOverflow(e) {
return bot.dom.getOverflowState(e) == bot.dom.OverflowState.HIDDEN &&
goog.array.every(e.childNodes, function(n) {
return !bot.dom.isElement(n) || hiddenByOverflow(n) ||
!positiveSize(n);
});
} | javascript | function hiddenByOverflow(e) {
return bot.dom.getOverflowState(e) == bot.dom.OverflowState.HIDDEN &&
goog.array.every(e.childNodes, function(n) {
return !bot.dom.isElement(n) || hiddenByOverflow(n) ||
!positiveSize(n);
});
} | [
"function",
"hiddenByOverflow",
"(",
"e",
")",
"{",
"return",
"bot",
".",
"dom",
".",
"getOverflowState",
"(",
"e",
")",
"==",
"bot",
".",
"dom",
".",
"OverflowState",
".",
"HIDDEN",
"&&",
"goog",
".",
"array",
".",
"every",
"(",
"e",
".",
"childNodes"... | Elements that are hidden by overflow are not shown. | [
"Elements",
"that",
"are",
"hidden",
"by",
"overflow",
"are",
"not",
"shown",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/atoms/dom.js#L552-L558 | train | Checks if an element is hidden by overflow | [
30522,
3853,
5023,
3762,
7840,
12314,
1006,
1041,
1007,
1063,
2709,
28516,
1012,
14383,
1012,
2131,
7840,
12314,
9153,
2618,
1006,
1041,
1007,
1027,
1027,
28516,
1012,
14383,
1012,
2058,
12314,
9153,
2618,
1012,
5023,
1004,
1004,
27571,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Core.js | preloadLibrarySync | function preloadLibrarySync(libConfig) {
libConfig = evalLibConfig(libConfig);
var lib = libConfig.name,
fileType = libConfig.fileType,
libPackage = lib.replace(/\./g, '/'),
libLoaded = !!sap.ui.loader._.getModuleState(libPackage + '/library.js');
if ( fileType === 'none' || libLoaded ) {
return;
... | javascript | function preloadLibrarySync(libConfig) {
libConfig = evalLibConfig(libConfig);
var lib = libConfig.name,
fileType = libConfig.fileType,
libPackage = lib.replace(/\./g, '/'),
libLoaded = !!sap.ui.loader._.getModuleState(libPackage + '/library.js');
if ( fileType === 'none' || libLoaded ) {
return;
... | [
"function",
"preloadLibrarySync",
"(",
"libConfig",
")",
"{",
"libConfig",
"=",
"evalLibConfig",
"(",
"libConfig",
")",
";",
"var",
"lib",
"=",
"libConfig",
".",
"name",
",",
"fileType",
"=",
"libConfig",
".",
"fileType",
",",
"libPackage",
"=",
"lib",
".",
... | Preloads a library synchronously.
@param {string|object} libConfig Name of the library to preload or settings object describing library.
@param {string} [libConfig.name] Name of the library to preload
@param {boolean|undefined} [libConfig.json] Whether library supports only JSON (<code>true</code>) or only JS (<code>f... | [
"Preloads",
"a",
"library",
"synchronously",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Core.js#L1777-L1840 | train | Loads a library synchronously | [
30522,
3853,
3653,
11066,
29521,
19848,
7274,
6038,
2278,
1006,
5622,
9818,
2239,
8873,
2290,
1007,
1063,
5622,
9818,
2239,
8873,
2290,
1027,
9345,
6894,
9818,
2239,
8873,
2290,
1006,
5622,
9818,
2239,
8873,
2290,
1007,
1025,
13075,
5622,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/rules/App.support.js | function(oController, viewId, aInvalidContent, fnProcessInvalidFunction) {
var _aInvalidControllerFunctions = [];
Object.keys(oController).forEach(function(sProtoKey) {
var sFnContent = oController[sProtoKey].toString().replace(/(\r\n|\n|\r)/gm, "");
aInvalidContent.forEach(function(sInvalidContent) ... | javascript | function(oController, viewId, aInvalidContent, fnProcessInvalidFunction) {
var _aInvalidControllerFunctions = [];
Object.keys(oController).forEach(function(sProtoKey) {
var sFnContent = oController[sProtoKey].toString().replace(/(\r\n|\n|\r)/gm, "");
aInvalidContent.forEach(function(sInvalidContent) ... | [
"function",
"(",
"oController",
",",
"viewId",
",",
"aInvalidContent",
",",
"fnProcessInvalidFunction",
")",
"{",
"var",
"_aInvalidControllerFunctions",
"=",
"[",
"]",
";",
"Object",
".",
"keys",
"(",
"oController",
")",
".",
"forEach",
"(",
"function",
"(",
"... | checks the given module's functions code for invalidContent returns an array which contains the functions with invalid content | [
"checks",
"the",
"given",
"module",
"s",
"functions",
"code",
"for",
"invalidContent",
"returns",
"an",
"array",
"which",
"contains",
"the",
"functions",
"with",
"invalid",
"content"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/rules/App.support.js#L65-L79 | train | Process invalid content | [
30522,
3853,
1006,
1051,
8663,
13181,
10820,
1010,
3193,
3593,
1010,
7110,
10175,
3593,
8663,
6528,
2102,
1010,
1042,
16275,
3217,
9623,
11493,
10175,
3593,
11263,
27989,
1007,
1063,
13075,
1035,
7110,
10175,
3593,
8663,
13181,
10820,
11263,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aframevr/aframe | src/components/scene/screenshot.js | function () {
this.canvas.toBlob(function (blob) {
var fileName = 'screenshot-' + document.title.toLowerCase() + '-' + Date.now() + '.png';
var linkEl = document.createElement('a');
var url = URL.createObjectURL(blob);
linkEl.href = url;
linkEl.setAttribute('download', fileName);
... | javascript | function () {
this.canvas.toBlob(function (blob) {
var fileName = 'screenshot-' + document.title.toLowerCase() + '-' + Date.now() + '.png';
var linkEl = document.createElement('a');
var url = URL.createObjectURL(blob);
linkEl.href = url;
linkEl.setAttribute('download', fileName);
... | [
"function",
"(",
")",
"{",
"this",
".",
"canvas",
".",
"toBlob",
"(",
"function",
"(",
"blob",
")",
"{",
"var",
"fileName",
"=",
"'screenshot-'",
"+",
"document",
".",
"title",
".",
"toLowerCase",
"(",
")",
"+",
"'-'",
"+",
"Date",
".",
"now",
"(",
... | Download capture to file. | [
"Download",
"capture",
"to",
"file",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/scene/screenshot.js#L238-L253 | train | Download the screenshot | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
10683,
1012,
2000,
16558,
16429,
1006,
3853,
1006,
1038,
4135,
2497,
1007,
1063,
13075,
5371,
18442,
1027,
1005,
12117,
12326,
1011,
1005,
1009,
6254,
1012,
2516,
1012,
2000,
27663,
18992,
3366,
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... | |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/screenshot.js | create | function create(controller, boxes) {
var doc = controller.window.document;
var maxWidth = doc.documentElement.boxObject.width;
var maxHeight = doc.documentElement.boxObject.height;
var rect = [];
for (var i = 0, j = boxes.length; i < j; ++i) {
rect = boxes[i];
if (rect[0] + rect[2] > maxWidth) maxWidt... | javascript | function create(controller, boxes) {
var doc = controller.window.document;
var maxWidth = doc.documentElement.boxObject.width;
var maxHeight = doc.documentElement.boxObject.height;
var rect = [];
for (var i = 0, j = boxes.length; i < j; ++i) {
rect = boxes[i];
if (rect[0] + rect[2] > maxWidth) maxWidt... | [
"function",
"create",
"(",
"controller",
",",
"boxes",
")",
"{",
"var",
"doc",
"=",
"controller",
".",
"window",
".",
"document",
";",
"var",
"maxWidth",
"=",
"doc",
".",
"documentElement",
".",
"boxObject",
".",
"width",
";",
"var",
"maxHeight",
"=",
"d... | This function creates a screenshot of the window provided in the given
controller and highlights elements from the coordinates provided in the
given boxes-array.
@param {array of array of int} boxes
@param {MozmillController} controller | [
"This",
"function",
"creates",
"a",
"screenshot",
"of",
"the",
"window",
"provided",
"in",
"the",
"given",
"controller",
"and",
"highlights",
"elements",
"from",
"the",
"coordinates",
"provided",
"in",
"the",
"given",
"boxes",
"-",
"array",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/screenshot.js#L50-L79 | train | Create a canvas | [
30522,
3853,
3443,
1006,
11486,
1010,
8378,
1007,
1063,
13075,
9986,
1027,
11486,
1012,
3332,
1012,
6254,
1025,
13075,
4098,
9148,
11927,
2232,
1027,
9986,
1012,
6254,
12260,
3672,
1012,
3482,
16429,
20614,
1012,
9381,
1025,
13075,
4098,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/node/TernNodeDomain.js | inferArrTypeToString | function inferArrTypeToString(inferArrType) {
var result = "Array.<";
result += inferArrType.props["<i>"].types.map(inferTypeToString).join(", ");
// workaround case where types is zero length
if (inferArrType.props["<i>"].types.length === 0) {
result += "Object";
}... | javascript | function inferArrTypeToString(inferArrType) {
var result = "Array.<";
result += inferArrType.props["<i>"].types.map(inferTypeToString).join(", ");
// workaround case where types is zero length
if (inferArrType.props["<i>"].types.length === 0) {
result += "Object";
}... | [
"function",
"inferArrTypeToString",
"(",
"inferArrType",
")",
"{",
"var",
"result",
"=",
"\"Array.<\"",
";",
"result",
"+=",
"inferArrType",
".",
"props",
"[",
"\"<i>\"",
"]",
".",
"types",
".",
"map",
"(",
"inferTypeToString",
")",
".",
"join",
"(",
"\", \"... | Convert an infer array type to a string.
Formatted using google closure style. For example:
"Array.<string, number>"
@param {Infer.Arr} inferArrType
@return {string} - array formatted in google closure style. | [
"Convert",
"an",
"infer",
"array",
"type",
"to",
"a",
"string",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L515-L527 | train | Convert an array type to a string | [
30522,
3853,
1999,
27709,
12171,
13874,
13122,
18886,
3070,
1006,
1999,
27709,
12171,
13874,
1007,
1063,
13075,
2765,
1027,
1000,
9140,
1012,
1026,
1000,
30524,
1006,
1000,
1010,
1000,
1007,
1025,
1013,
1013,
2147,
24490,
2553,
2073,
4127,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
NetEase/pomelo | lib/connectors/mqttsocket.js | function(id, socket, adaptor) {
EventEmitter.call(this);
this.id = id;
this.socket = socket;
this.remoteAddress = {
ip: socket.stream.remoteAddress,
port: socket.stream.remotePort
};
this.adaptor = adaptor;
var self = this;
socket.on('close', this.emit.bind(this, 'disconnect'));
socket.on('e... | javascript | function(id, socket, adaptor) {
EventEmitter.call(this);
this.id = id;
this.socket = socket;
this.remoteAddress = {
ip: socket.stream.remoteAddress,
port: socket.stream.remotePort
};
this.adaptor = adaptor;
var self = this;
socket.on('close', this.emit.bind(this, 'disconnect'));
socket.on('e... | [
"function",
"(",
"id",
",",
"socket",
",",
"adaptor",
")",
"{",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"id",
"=",
"id",
";",
"this",
".",
"socket",
"=",
"socket",
";",
"this",
".",
"remoteAddress",
"=",
"{",
"ip",
":",
"... | Socket class that wraps socket and websocket to provide unified interface for up level. | [
"Socket",
"class",
"that",
"wraps",
"socket",
"and",
"websocket",
"to",
"provide",
"unified",
"interface",
"for",
"up",
"level",
"."
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/connectors/mqttsocket.js#L10-L37 | train | A Knockout connection | [
30522,
3853,
1006,
8909,
1010,
22278,
1010,
15581,
2953,
1007,
1063,
2724,
23238,
12079,
1012,
2655,
1006,
2023,
1007,
1025,
2023,
1012,
8909,
1027,
8909,
1025,
2023,
1012,
22278,
1027,
22278,
1025,
2023,
1012,
6556,
4215,
16200,
4757,
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... | |
pixijs/pixi.js | packages/utils/src/color/premultiply.js | mapPremultipliedBlendModes | function mapPremultipliedBlendModes()
{
const pm = [];
const npm = [];
for (let i = 0; i < 32; i++)
{
pm[i] = i;
npm[i] = i;
}
pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL;
pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD;
pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN;
... | javascript | function mapPremultipliedBlendModes()
{
const pm = [];
const npm = [];
for (let i = 0; i < 32; i++)
{
pm[i] = i;
npm[i] = i;
}
pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL;
pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD;
pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN;
... | [
"function",
"mapPremultipliedBlendModes",
"(",
")",
"{",
"const",
"pm",
"=",
"[",
"]",
";",
"const",
"npm",
"=",
"[",
"]",
";",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"32",
";",
"i",
"++",
")",
"{",
"pm",
"[",
"i",
"]",
"=",
"i",
... | Corrects PixiJS blend, takes premultiplied alpha into account
@memberof PIXI.utils
@function mapPremultipliedBlendModes
@private
@param {Array<number[]>} [array] - The array to output into.
@return {Array<number[]>} Mapped modes. | [
"Corrects",
"PixiJS",
"blend",
"takes",
"premultiplied",
"alpha",
"into",
"account"
] | 99ae03b7565ae7ca5a6de633b0a277f7128fa4d0 | https://github.com/pixijs/pixi.js/blob/99ae03b7565ae7ca5a6de633b0a277f7128fa4d0/packages/utils/src/color/premultiply.js#L12-L37 | train | Map premultiplied blend modes to the correct order | [
30522,
3853,
4949,
28139,
12274,
7096,
11514,
8751,
18939,
7770,
22117,
19847,
1006,
1007,
1063,
9530,
3367,
7610,
1027,
1031,
1033,
1025,
9530,
3367,
27937,
2213,
1027,
1031,
1033,
1025,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
openlayers/openlayers | examples/measure.js | function(evt) {
if (evt.dragging) {
return;
}
/** @type {string} */
let helpMsg = 'Click to start drawing';
if (sketch) {
const geom = sketch.getGeometry();
if (geom instanceof Polygon) {
helpMsg = continuePolygonMsg;
} else if (geom instanceof LineString) {
helpMsg = continueLine... | javascript | function(evt) {
if (evt.dragging) {
return;
}
/** @type {string} */
let helpMsg = 'Click to start drawing';
if (sketch) {
const geom = sketch.getGeometry();
if (geom instanceof Polygon) {
helpMsg = continuePolygonMsg;
} else if (geom instanceof LineString) {
helpMsg = continueLine... | [
"function",
"(",
"evt",
")",
"{",
"if",
"(",
"evt",
".",
"dragging",
")",
"{",
"return",
";",
"}",
"/** @type {string} */",
"let",
"helpMsg",
"=",
"'Click to start drawing'",
";",
"if",
"(",
"sketch",
")",
"{",
"const",
"geom",
"=",
"sketch",
".",
"getGe... | Handle pointer move.
@param {import("../src/ol/MapBrowserEvent").default} evt The event. | [
"Handle",
"pointer",
"move",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/measure.js#L92-L112 | train | This function is called when the user clicks on a drag event. | [
30522,
3853,
1006,
23408,
2102,
1007,
1063,
2065,
1006,
23408,
2102,
1012,
11920,
1007,
1063,
2709,
1025,
1065,
1013,
1008,
1008,
1030,
2828,
1063,
5164,
1065,
1008,
1013,
2292,
2393,
5244,
2290,
1027,
1005,
11562,
2000,
2707,
5059,
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... | |
dequelabs/axe-core | lib/core/utils/get-xpath.js | getXPathArray | function getXPathArray(node, path) {
var sibling, count;
// Gets an XPath for an element which describes its hierarchical location.
if (!node) {
return [];
}
if (!path && node.nodeType === 9) {
// special case for when we are called and give the document itself as the starting node
path = [
{
str: 'ht... | javascript | function getXPathArray(node, path) {
var sibling, count;
// Gets an XPath for an element which describes its hierarchical location.
if (!node) {
return [];
}
if (!path && node.nodeType === 9) {
// special case for when we are called and give the document itself as the starting node
path = [
{
str: 'ht... | [
"function",
"getXPathArray",
"(",
"node",
",",
"path",
")",
"{",
"var",
"sibling",
",",
"count",
";",
"// Gets an XPath for an element which describes its hierarchical location.",
"if",
"(",
"!",
"node",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"!",
... | /*global axe | [
"/",
"*",
"global",
"axe"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/get-xpath.js#L3-L63 | train | Returns an array of XPath expression nodes that are closest to the given node. | [
30522,
3853,
2131,
2595,
15069,
2906,
9447,
1006,
13045,
1010,
4130,
1007,
1063,
13075,
22941,
1010,
4175,
1025,
1013,
1013,
4152,
2019,
26726,
8988,
2005,
2019,
5783,
2029,
5577,
2049,
25835,
3295,
1012,
2065,
1006,
999,
13045,
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... |
zeit/pkg | prelude/bootstrap.js | findNativeAddonForExists | function findNativeAddonForExists (path) {
var foundPath = findNativeAddonSyncFreeFromRequire(path);
if (!foundPath) return false;
return ancestor.existsSync.call(fs, foundPath);
} | javascript | function findNativeAddonForExists (path) {
var foundPath = findNativeAddonSyncFreeFromRequire(path);
if (!foundPath) return false;
return ancestor.existsSync.call(fs, foundPath);
} | [
"function",
"findNativeAddonForExists",
"(",
"path",
")",
"{",
"var",
"foundPath",
"=",
"findNativeAddonSyncFreeFromRequire",
"(",
"path",
")",
";",
"if",
"(",
"!",
"foundPath",
")",
"return",
"false",
";",
"return",
"ancestor",
".",
"existsSync",
".",
"call",
... | /////////////////////////////////////////////////////////////// exists //////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// | [
"///////////////////////////////////////////////////////////////",
"exists",
"////////////////////////////////////////////////////////",
"///////////////////////////////////////////////////////////////"
] | 3775ab6decc2f8f013142e1282934c12fbd1881e | https://github.com/zeit/pkg/blob/3775ab6decc2f8f013142e1282934c12fbd1881e/prelude/bootstrap.js#L1003-L1007 | train | Find a native add - on | [
30522,
3853,
2424,
19833,
3512,
4215,
5280,
29278,
10288,
5130,
1006,
4130,
1007,
1063,
13075,
2179,
15069,
1027,
2424,
19833,
3512,
4215,
5280,
6508,
12273,
23301,
19699,
5358,
2890,
15549,
2890,
1006,
4130,
1007,
1025,
2065,
1006,
999,
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... |
testing-library/dom-testing-library | src/query-helpers.js | makeFindQuery | function makeFindQuery(getter) {
return (container, text, options, waitForElementOptions) =>
waitForElement(
() => getter(container, text, options),
waitForElementOptions,
)
} | javascript | function makeFindQuery(getter) {
return (container, text, options, waitForElementOptions) =>
waitForElement(
() => getter(container, text, options),
waitForElementOptions,
)
} | [
"function",
"makeFindQuery",
"(",
"getter",
")",
"{",
"return",
"(",
"container",
",",
"text",
",",
"options",
",",
"waitForElementOptions",
")",
"=>",
"waitForElement",
"(",
"(",
")",
"=>",
"getter",
"(",
"container",
",",
"text",
",",
"options",
")",
","... | this accepts a getter query function and returns a function which calls waitForElement and passing a function which invokes the getter. | [
"this",
"accepts",
"a",
"getter",
"query",
"function",
"and",
"returns",
"a",
"function",
"which",
"calls",
"waitForElement",
"and",
"passing",
"a",
"function",
"which",
"invokes",
"the",
"getter",
"."
] | fcb2cbcffb7aff6ecff3be8731168c86eee82ce1 | https://github.com/testing-library/dom-testing-library/blob/fcb2cbcffb7aff6ecff3be8731168c86eee82ce1/src/query-helpers.js#L95-L101 | train | Creates a function to return a query that will wait until the element is found | [
30522,
3853,
2191,
16294,
2094,
4226,
2854,
1006,
2131,
3334,
1007,
1063,
2709,
1006,
11661,
1010,
3793,
1010,
7047,
1010,
3524,
29278,
12260,
23065,
16790,
2015,
1007,
1027,
1028,
3524,
29278,
12260,
3672,
1006,
1006,
1007,
1027,
1028,
213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
lovell/sharp | lib/output.js | webp | function webp (options) {
if (is.object(options) && is.defined(options.quality)) {
if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) {
this.options.webpQuality = options.quality;
} else {
throw new Error('Invalid quality (integer, 1-100) ' + options.quality);
}
}
if (... | javascript | function webp (options) {
if (is.object(options) && is.defined(options.quality)) {
if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) {
this.options.webpQuality = options.quality;
} else {
throw new Error('Invalid quality (integer, 1-100) ' + options.quality);
}
}
if (... | [
"function",
"webp",
"(",
"options",
")",
"{",
"if",
"(",
"is",
".",
"object",
"(",
"options",
")",
"&&",
"is",
".",
"defined",
"(",
"options",
".",
"quality",
")",
")",
"{",
"if",
"(",
"is",
".",
"integer",
"(",
"options",
".",
"quality",
")",
"&... | Use these WebP options for output image.
@example
// Convert any input to lossless WebP output
const data = await sharp(input)
.webp({ lossless: true })
.toBuffer();
@param {Object} [options] - output options
@param {Number} [options.quality=80] - quality, integer 1-100
@param {Number} [options.alphaQuality=100] - qu... | [
"Use",
"these",
"WebP",
"options",
"for",
"output",
"image",
"."
] | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/output.js#L297-L319 | train | Update webp format | [
30522,
3853,
4773,
2361,
1006,
7047,
1007,
1063,
2065,
1006,
2003,
1012,
4874,
1006,
7047,
1007,
1004,
1004,
2003,
1012,
4225,
1006,
7047,
1012,
3737,
1007,
1007,
1063,
2065,
1006,
2003,
1012,
16109,
1006,
7047,
1012,
3737,
1007,
1004,
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... |
aws/aws-sdk-js | lib/services/s3.js | correctBucketRegionFromCache | function correctBucketRegionFromCache(req) {
var bucket = req.params.Bucket || null;
if (bucket) {
var service = req.service;
var requestRegion = req.httpRequest.region;
var cachedRegion = service.bucketRegionCache[bucket];
if (cachedRegion && cachedRegion !== requestRegion) {
se... | javascript | function correctBucketRegionFromCache(req) {
var bucket = req.params.Bucket || null;
if (bucket) {
var service = req.service;
var requestRegion = req.httpRequest.region;
var cachedRegion = service.bucketRegionCache[bucket];
if (cachedRegion && cachedRegion !== requestRegion) {
se... | [
"function",
"correctBucketRegionFromCache",
"(",
"req",
")",
"{",
"var",
"bucket",
"=",
"req",
".",
"params",
".",
"Bucket",
"||",
"null",
";",
"if",
"(",
"bucket",
")",
"{",
"var",
"service",
"=",
"req",
".",
"service",
";",
"var",
"requestRegion",
"=",... | Corrects request region if bucket's cached region is different
@api private | [
"Corrects",
"request",
"region",
"if",
"bucket",
"s",
"cached",
"region",
"is",
"different"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L703-L713 | train | This function is called by the regionCache function to check if the region is not the same as the request region. | [
30522,
3853,
6149,
24204,
3388,
23784,
19699,
5358,
3540,
5403,
1006,
2128,
4160,
1007,
1063,
13075,
13610,
1027,
2128,
4160,
1012,
11498,
5244,
1012,
13610,
1064,
1064,
19701,
1025,
2065,
1006,
13610,
1007,
1063,
13075,
2326,
1027,
2128,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/qunit.js | bindCallbacks | function bindCallbacks( o, callbacks, args ) {
var prop = QUnit.objectType( o );
if ( prop ) {
if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) {
return callbacks[ prop ].apply( callbacks, args );
} else {
return callbacks[ prop ]; // or undefined
}
}
} | javascript | function bindCallbacks( o, callbacks, args ) {
var prop = QUnit.objectType( o );
if ( prop ) {
if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) {
return callbacks[ prop ].apply( callbacks, args );
} else {
return callbacks[ prop ]; // or undefined
}
}
} | [
"function",
"bindCallbacks",
"(",
"o",
",",
"callbacks",
",",
"args",
")",
"{",
"var",
"prop",
"=",
"QUnit",
".",
"objectType",
"(",
"o",
")",
";",
"if",
"(",
"prop",
")",
"{",
"if",
"(",
"QUnit",
".",
"objectType",
"(",
"callbacks",
"[",
"prop",
"... | Call the o related callback with the given arguments. | [
"Call",
"the",
"o",
"related",
"callback",
"with",
"the",
"given",
"arguments",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/qunit.js#L1427-L1436 | train | bind callbacks to object | [
30522,
3853,
14187,
9289,
20850,
8684,
2015,
1006,
1051,
1010,
2655,
12221,
1010,
12098,
5620,
1007,
1063,
13075,
17678,
1027,
24209,
3490,
2102,
1012,
4874,
13874,
1006,
1051,
1007,
1025,
2065,
1006,
17678,
1007,
1063,
2065,
1006,
24209,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/util/graphic.js | rollbackDefaultTextStyle | function rollbackDefaultTextStyle(style) {
var insideRollback = style.insideRollback;
if (insideRollback) {
style.textFill = insideRollback.textFill;
style.textStroke = insideRollback.textStroke;
style.textStrokeWidth = insideRollback.textStrokeWidth;
style.insideRollback = null;... | javascript | function rollbackDefaultTextStyle(style) {
var insideRollback = style.insideRollback;
if (insideRollback) {
style.textFill = insideRollback.textFill;
style.textStroke = insideRollback.textStroke;
style.textStrokeWidth = insideRollback.textStrokeWidth;
style.insideRollback = null;... | [
"function",
"rollbackDefaultTextStyle",
"(",
"style",
")",
"{",
"var",
"insideRollback",
"=",
"style",
".",
"insideRollback",
";",
"if",
"(",
"insideRollback",
")",
"{",
"style",
".",
"textFill",
"=",
"insideRollback",
".",
"textFill",
";",
"style",
".",
"text... | Consider the case: in a scatter,
label: {
normal: {position: 'inside'},
emphasis: {position: 'top'}
}
In the normal state, the `textFill` will be set as '#fff' for pretty view (see
`applyDefaultTextStyle`), but when switching to emphasis state, the `textFill`
should be retured to 'autoColor', but not keep '#fff'. | [
"Consider",
"the",
"case",
":",
"in",
"a",
"scatter",
"label",
":",
"{",
"normal",
":",
"{",
"position",
":",
"inside",
"}",
"emphasis",
":",
"{",
"position",
":",
"top",
"}",
"}",
"In",
"the",
"normal",
"state",
"the",
"textFill",
"will",
"be",
"set... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/util/graphic.js#L979-L987 | train | Rollback the default text style | [
30522,
3853,
4897,
5963,
3207,
7011,
11314,
18209,
21756,
2571,
1006,
2806,
1007,
1063,
13075,
25297,
14511,
5963,
1027,
2806,
1012,
25297,
14511,
5963,
1025,
2065,
1006,
25297,
14511,
5963,
1007,
1063,
2806,
1012,
3793,
8873,
3363,
1027,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
radare/radare2 | shlr/www/graph/js-graph-it.js | BlocksToMoveVisitor | function BlocksToMoveVisitor() {
this.visit = function(element) {
if (isBlock(element)) {
blocksToMove.push(findBlock(element.id));
return false;
}
return true;
}
} | javascript | function BlocksToMoveVisitor() {
this.visit = function(element) {
if (isBlock(element)) {
blocksToMove.push(findBlock(element.id));
return false;
}
return true;
}
} | [
"function",
"BlocksToMoveVisitor",
"(",
")",
"{",
"this",
".",
"visit",
"=",
"function",
"(",
"element",
")",
"{",
"if",
"(",
"isBlock",
"(",
"element",
")",
")",
"{",
"blocksToMove",
".",
"push",
"(",
"findBlock",
"(",
"element",
".",
"id",
")",
")",
... | this visitor is used to find blocks nested in the element being moved. | [
"this",
"visitor",
"is",
"used",
"to",
"find",
"blocks",
"nested",
"in",
"the",
"element",
"being",
"moved",
"."
] | bf5e3028810a0ec7c267c6fe4bfad639b4819e35 | https://github.com/radare/radare2/blob/bf5e3028810a0ec7c267c6fe4bfad639b4819e35/shlr/www/graph/js-graph-it.js#L69-L77 | train | This is the visitor that will find blocks that are not in the DOM. | [
30522,
3853,
5991,
20389,
21818,
11365,
15660,
1006,
1007,
1063,
2023,
1012,
3942,
1027,
3853,
1006,
5783,
1007,
1063,
2065,
1006,
2003,
23467,
1006,
5783,
1007,
1007,
1063,
5991,
20389,
21818,
1012,
5245,
1006,
2424,
23467,
1006,
5783,
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... |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js | _getRelevantElements | function _getRelevantElements(oElement, oRelevantContainer, sAggregationName) {
if (oRelevantContainer && oRelevantContainer !== oElement) {
var sEntityName = RtaUtils.getEntityTypeByPath(
oElement.getModel(),
_getBindingPath(oElement, sAggregationName)
);
return ElementUtil
.findAllSiblingsInCo... | javascript | function _getRelevantElements(oElement, oRelevantContainer, sAggregationName) {
if (oRelevantContainer && oRelevantContainer !== oElement) {
var sEntityName = RtaUtils.getEntityTypeByPath(
oElement.getModel(),
_getBindingPath(oElement, sAggregationName)
);
return ElementUtil
.findAllSiblingsInCo... | [
"function",
"_getRelevantElements",
"(",
"oElement",
",",
"oRelevantContainer",
",",
"sAggregationName",
")",
"{",
"if",
"(",
"oRelevantContainer",
"&&",
"oRelevantContainer",
"!==",
"oElement",
")",
"{",
"var",
"sEntityName",
"=",
"RtaUtils",
".",
"getEntityTypeByPat... | Retrieving sibling elements from its parent container which are bound to the same Model (important!)
@param {sap.ui.core.Control} oElement - element for which we're looking for siblings
@param {sap.ui.core.Control} oRelevantContainer - "parent" container of the oElement
@param {string} sAggregationName - name of the a... | [
"Retrieving",
"sibling",
"elements",
"from",
"its",
"parent",
"container",
"which",
"are",
"bound",
"to",
"the",
"same",
"Model",
"(",
"important!",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js#L264-L284 | train | Returns an array of elements that are siblings of the given element | [
30522,
3853,
1035,
2131,
16570,
13331,
10111,
16930,
11187,
1006,
1051,
12260,
3672,
1010,
10848,
20414,
4630,
8663,
18249,
2121,
1010,
7842,
13871,
2890,
12540,
18442,
1007,
1063,
2065,
1006,
10848,
20414,
4630,
8663,
18249,
2121,
1004,
1004... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js | function(oList, bSkipNotify, fCallback){
var fFinalize = function(jRef) {
if (!bSkipNotify) {
var oAttr = oList._getAtt();
var iSelectedIndex = oAttr.getParent().indexOfAttribute(oAttr);
clearAttribute(oList.getParent(), oAttr, iSelectedIndex, true);
setHeaderText(oList.getParent());
getTopList... | javascript | function(oList, bSkipNotify, fCallback){
var fFinalize = function(jRef) {
if (!bSkipNotify) {
var oAttr = oList._getAtt();
var iSelectedIndex = oAttr.getParent().indexOfAttribute(oAttr);
clearAttribute(oList.getParent(), oAttr, iSelectedIndex, true);
setHeaderText(oList.getParent());
getTopList... | [
"function",
"(",
"oList",
",",
"bSkipNotify",
",",
"fCallback",
")",
"{",
"var",
"fFinalize",
"=",
"function",
"(",
"jRef",
")",
"{",
"if",
"(",
"!",
"bSkipNotify",
")",
"{",
"var",
"oAttr",
"=",
"oList",
".",
"_getAtt",
"(",
")",
";",
"var",
"iSelec... | Handles the close of the list | [
"Handles",
"the",
"close",
"of",
"the",
"list"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1375-L1398 | train | Clears the attribute of the given list and calls the callback function | [
30522,
3853,
1006,
19330,
2923,
1010,
18667,
3211,
2361,
17048,
8757,
1010,
4429,
8095,
5963,
1007,
1063,
13075,
21461,
13290,
4697,
1027,
3853,
1006,
3781,
12879,
1007,
1063,
2065,
1006,
999,
18667,
3211,
2361,
17048,
8757,
1007,
1063,
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... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/cache/LRUPersistentCache.js | seekMetadataLRU | function seekMetadataLRU(self) {
while (self._lru <= self._mru && self._metadata.__byIndex__[self._lru] == undefined) {
self._lru++;
}
// The lru should never skip item. So current value should always point to the 1st (numeric order) non-empty
// item in self._metadata.__byIndex map
return (self._lru... | javascript | function seekMetadataLRU(self) {
while (self._lru <= self._mru && self._metadata.__byIndex__[self._lru] == undefined) {
self._lru++;
}
// The lru should never skip item. So current value should always point to the 1st (numeric order) non-empty
// item in self._metadata.__byIndex map
return (self._lru... | [
"function",
"seekMetadataLRU",
"(",
"self",
")",
"{",
"while",
"(",
"self",
".",
"_lru",
"<=",
"self",
".",
"_mru",
"&&",
"self",
".",
"_metadata",
".",
"__byIndex__",
"[",
"self",
".",
"_lru",
"]",
"==",
"undefined",
")",
"{",
"self",
".",
"_lru",
"... | Moves the pointer of LRU to the next available (non-empty) item starting from the current position.
@returns {boolean} true if the seek moved the pointer to an existing item, false - if no item is found | [
"Moves",
"the",
"pointer",
"of",
"LRU",
"to",
"the",
"next",
"available",
"(",
"non",
"-",
"empty",
")",
"item",
"starting",
"from",
"the",
"current",
"position",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/cache/LRUPersistentCache.js#L831-L838 | train | Seeks the metadata LRU to the next non - empty item in the metadata. | [
30522,
3853,
6148,
11368,
8447,
9080,
6820,
1006,
2969,
1007,
1063,
2096,
1006,
2969,
1012,
1035,
1048,
6820,
1026,
1027,
2969,
1012,
1035,
2720,
2226,
1004,
1004,
2969,
1012,
1035,
27425,
1012,
1035,
1035,
2011,
22254,
10288,
1035,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jhipster/generator-jhipster | generators/utils.js | getAllJhipsterConfig | function getAllJhipsterConfig(generator, force) {
let configuration = generator && generator.config ? generator.config.getAll() || {} : {};
if ((force || !configuration.baseName) && jhiCore.FileUtils.doesFileExist('.yo-rc.json')) {
const yoRc = JSON.parse(fs.readFileSync('.yo-rc.json', { encoding: 'utf-... | javascript | function getAllJhipsterConfig(generator, force) {
let configuration = generator && generator.config ? generator.config.getAll() || {} : {};
if ((force || !configuration.baseName) && jhiCore.FileUtils.doesFileExist('.yo-rc.json')) {
const yoRc = JSON.parse(fs.readFileSync('.yo-rc.json', { encoding: 'utf-... | [
"function",
"getAllJhipsterConfig",
"(",
"generator",
",",
"force",
")",
"{",
"let",
"configuration",
"=",
"generator",
"&&",
"generator",
".",
"config",
"?",
"generator",
".",
"config",
".",
"getAll",
"(",
")",
"||",
"{",
"}",
":",
"{",
"}",
";",
"if",
... | Get all the generator configuration from the .yo-rc.json file
@param {Generator} generator the generator instance to use
@param {boolean} force force getting direct from file | [
"Get",
"all",
"the",
"generator",
"configuration",
"from",
"the",
".",
"yo",
"-",
"rc",
".",
"json",
"file"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/utils.js#L417-L438 | train | Get all the jhipster config | [
30522,
3853,
2131,
8095,
3501,
19801,
3334,
8663,
8873,
2290,
1006,
13103,
1010,
2486,
1007,
1063,
2292,
9563,
1027,
13103,
1004,
1004,
13103,
1012,
9530,
8873,
2290,
1029,
13103,
1012,
9530,
8873,
2290,
1012,
2131,
8095,
1006,
1007,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mui-org/material-ui | docs/src/modules/components/GoogleAnalytics.js | handleClick | function handleClick(event) {
const rootNode = document;
let element = event.target;
while (element && element !== rootNode) {
const category = element.getAttribute('data-ga-event-category');
// We reach a tracking element, no need to look higher in the dom tree.
if (category) {
window.ga('sen... | javascript | function handleClick(event) {
const rootNode = document;
let element = event.target;
while (element && element !== rootNode) {
const category = element.getAttribute('data-ga-event-category');
// We reach a tracking element, no need to look higher in the dom tree.
if (category) {
window.ga('sen... | [
"function",
"handleClick",
"(",
"event",
")",
"{",
"const",
"rootNode",
"=",
"document",
";",
"let",
"element",
"=",
"event",
".",
"target",
";",
"while",
"(",
"element",
"&&",
"element",
"!==",
"rootNode",
")",
"{",
"const",
"category",
"=",
"element",
... | So we can write code like: <Button ga-event-category="demo" ga-event-action="expand" > Foo </Button> | [
"So",
"we",
"can",
"write",
"code",
"like",
":",
"<Button",
"ga",
"-",
"event",
"-",
"category",
"=",
"demo",
"ga",
"-",
"event",
"-",
"action",
"=",
"expand",
">",
"Foo",
"<",
"/",
"Button",
">"
] | 1555e52367835946382fbf2a8f681de71318915d | https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/docs/src/modules/components/GoogleAnalytics.js#L12-L32 | train | Handle click events | [
30522,
3853,
5047,
20464,
6799,
1006,
2724,
1007,
1063,
9530,
3367,
7117,
3630,
3207,
1027,
6254,
1025,
2292,
5783,
1027,
2724,
1012,
4539,
1025,
2096,
1006,
5783,
1004,
1004,
5783,
999,
1027,
1027,
7117,
3630,
3207,
1007,
1063,
9530,
336... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fengyuanchen/cropper | dist/cropper.common.js | getData$$1 | function getData$$1() {
var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var options = this.options,
imageData = this.imageData,
canvasData = this.canvasData,
cropBoxData = this.cropBoxData;
var data = void 0;
if (this.ready && this.cropp... | javascript | function getData$$1() {
var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var options = this.options,
imageData = this.imageData,
canvasData = this.canvasData,
cropBoxData = this.cropBoxData;
var data = void 0;
if (this.ready && this.cropp... | [
"function",
"getData$$1",
"(",
")",
"{",
"var",
"rounded",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"false",
";",
"var",
"options",
"=",
"this",
".",
"optio... | Get the cropped area position and size data (base on the original image)
@param {boolean} [rounded=false] - Indicate if round the data values or not.
@returns {Object} The result cropped data. | [
"Get",
"the",
"cropped",
"area",
"position",
"and",
"size",
"data",
"(",
"base",
"on",
"the",
"original",
"image",
")"
] | 6677332a6a375b647f58808dfc24ea09f5804041 | https://github.com/fengyuanchen/cropper/blob/6677332a6a375b647f58808dfc24ea09f5804041/dist/cropper.common.js#L2805-L2847 | train | Get the data for the image | [
30522,
3853,
2131,
2850,
2696,
1002,
1002,
1015,
1006,
1007,
1063,
13075,
8352,
1027,
9918,
1012,
3091,
1028,
1014,
1004,
1004,
9918,
1031,
1014,
1033,
999,
1027,
1027,
6151,
28344,
1029,
9918,
1031,
1014,
1033,
1024,
6270,
1025,
13075,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/components/look-controls.js | function (evt) {
var direction;
var canvas = this.el.sceneEl.canvas;
var deltaY;
var yawObject = this.yawObject;
if (!this.touchStarted || !this.data.touchEnabled) { return; }
deltaY = 2 * Math.PI * (evt.touches[0].pageX - this.touchStart.x) / canvas.clientWidth;
direction = this.data.rev... | javascript | function (evt) {
var direction;
var canvas = this.el.sceneEl.canvas;
var deltaY;
var yawObject = this.yawObject;
if (!this.touchStarted || !this.data.touchEnabled) { return; }
deltaY = 2 * Math.PI * (evt.touches[0].pageX - this.touchStart.x) / canvas.clientWidth;
direction = this.data.rev... | [
"function",
"(",
"evt",
")",
"{",
"var",
"direction",
";",
"var",
"canvas",
"=",
"this",
".",
"el",
".",
"sceneEl",
".",
"canvas",
";",
"var",
"deltaY",
";",
"var",
"yawObject",
"=",
"this",
".",
"yawObject",
";",
"if",
"(",
"!",
"this",
".",
"touc... | Translate touch move to Y-axis rotation. | [
"Translate",
"touch",
"move",
"to",
"Y",
"-",
"axis",
"rotation",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/look-controls.js#L316-L333 | train | Touch drag event handler | [
30522,
3853,
1006,
23408,
2102,
1007,
1063,
13075,
3257,
1025,
13075,
10683,
1027,
2023,
1012,
3449,
1012,
3496,
2884,
1012,
10683,
1025,
13075,
7160,
2100,
1025,
13075,
8038,
12155,
2497,
20614,
1027,
2023,
1012,
8038,
12155,
2497,
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... | |
GitbookIO/gitbook | lib/output/json/onPage.js | onPage | function onPage(output, page) {
var file = page.getFile();
var readme = output.getBook().getReadme().getFile();
return Modifiers.modifyHTML(page, getModifiers(output, page))
.then(function(resultPage) {
// Generate the JSON
var json = JSONUtils.encodeBookWithPage(output.getBook(), resul... | javascript | function onPage(output, page) {
var file = page.getFile();
var readme = output.getBook().getReadme().getFile();
return Modifiers.modifyHTML(page, getModifiers(output, page))
.then(function(resultPage) {
// Generate the JSON
var json = JSONUtils.encodeBookWithPage(output.getBook(), resul... | [
"function",
"onPage",
"(",
"output",
",",
"page",
")",
"{",
"var",
"file",
"=",
"page",
".",
"getFile",
"(",
")",
";",
"var",
"readme",
"=",
"output",
".",
"getBook",
"(",
")",
".",
"getReadme",
"(",
")",
".",
"getFile",
"(",
")",
";",
"return",
... | Write a page as a json file
@param {Output} output
@param {Page} page | [
"Write",
"a",
"page",
"as",
"a",
"json",
"file"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/json/onPage.js#L15-L41 | train | Modify the page | [
30522,
3853,
2006,
13704,
1006,
6434,
1010,
3931,
1007,
1063,
13075,
5371,
1027,
3931,
1012,
2131,
8873,
2571,
1006,
1007,
1025,
13075,
3191,
4168,
1027,
6434,
1012,
2131,
8654,
1006,
1007,
1012,
2131,
16416,
22117,
2063,
1006,
1007,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/DeprecationWarning.js | deprecationWarning | function deprecationWarning(message, oncePerCaller, callerStackPos) {
// If oncePerCaller isn't set, then only show the message once no matter who calls it.
if (!message || (!oncePerCaller && displayedWarnings[message])) {
return;
}
// Don't show the warning again if we've a... | javascript | function deprecationWarning(message, oncePerCaller, callerStackPos) {
// If oncePerCaller isn't set, then only show the message once no matter who calls it.
if (!message || (!oncePerCaller && displayedWarnings[message])) {
return;
}
// Don't show the warning again if we've a... | [
"function",
"deprecationWarning",
"(",
"message",
",",
"oncePerCaller",
",",
"callerStackPos",
")",
"{",
"// If oncePerCaller isn't set, then only show the message once no matter who calls it.",
"if",
"(",
"!",
"message",
"||",
"(",
"!",
"oncePerCaller",
"&&",
"displayedWarni... | Show deprecation warning with the call stack if it
has never been displayed before.
@param {!string} message The deprecation message to be displayed.
@param {boolean=} oncePerCaller If true, displays the message once for each unique call location.
If false (the default), only displays the message once no matter where i... | [
"Show",
"deprecation",
"warning",
"with",
"the",
"call",
"stack",
"if",
"it",
"has",
"never",
"been",
"displayed",
"before",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/DeprecationWarning.js#L70-L93 | train | Show a deprecation warning | [
30522,
3853,
2139,
28139,
10719,
9028,
5582,
1006,
4471,
1010,
2320,
4842,
9289,
3917,
1010,
20587,
30524,
2065,
1006,
999,
4471,
1064,
1064,
1006,
999,
2320,
4842,
9289,
3917,
1004,
1004,
6913,
9028,
5582,
2015,
1031,
4471,
1033,
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... |
hakimel/reveal.js | plugin/highlight/highlight.js | betterTrim | function betterTrim(snippetEl) {
// Helper functions
function trimLeft(val) {
// Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
return val.replace(/^[\s\uFEFF\xA0]+/g, '');
}
function trimLineBreaks(input) {
var lines = input.split('\n... | javascript | function betterTrim(snippetEl) {
// Helper functions
function trimLeft(val) {
// Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
return val.replace(/^[\s\uFEFF\xA0]+/g, '');
}
function trimLineBreaks(input) {
var lines = input.split('\n... | [
"function",
"betterTrim",
"(",
"snippetEl",
")",
"{",
"// Helper functions",
"function",
"trimLeft",
"(",
"val",
")",
"{",
"// Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill",
"return",
"val",
".",
"replace",
"("... | Function to perform a better "data-trim" on code snippets Will slice an indentation amount on each line of the snippet (amount based on the line having the lowest indentation length) | [
"Function",
"to",
"perform",
"a",
"better",
"data",
"-",
"trim",
"on",
"code",
"snippets",
"Will",
"slice",
"an",
"indentation",
"amount",
"on",
"each",
"line",
"of",
"the",
"snippet",
"(",
"amount",
"based",
"on",
"the",
"line",
"having",
"the",
"lowest",... | 33bed47daca3f08c396215415e6ece005970734a | https://github.com/hakimel/reveal.js/blob/33bed47daca3f08c396215415e6ece005970734a/plugin/highlight/highlight.js#L25-L68 | train | This function is a bit of a hack to make sure that the trimming of the content is not a problem | [
30522,
3853,
2488,
18886,
2213,
1006,
1055,
3490,
29519,
2884,
1007,
1063,
1013,
1013,
2393,
2121,
4972,
3853,
12241,
2571,
6199,
1006,
11748,
1007,
1063,
1013,
1013,
5967,
2013,
16770,
1024,
1013,
1013,
9722,
1012,
9587,
5831,
4571,
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... |
Dogfalo/materialize | dist/js/materialize.js | destroy | function destroy() {
this._resetDropdownStyles();
this._removeEventHandlers();
Dropdown._dropdowns.splice(Dropdown._dropdowns.indexOf(this), 1);
this.el.M_Dropdown = undefined;
} | javascript | function destroy() {
this._resetDropdownStyles();
this._removeEventHandlers();
Dropdown._dropdowns.splice(Dropdown._dropdowns.indexOf(this), 1);
this.el.M_Dropdown = undefined;
} | [
"function",
"destroy",
"(",
")",
"{",
"this",
".",
"_resetDropdownStyles",
"(",
")",
";",
"this",
".",
"_removeEventHandlers",
"(",
")",
";",
"Dropdown",
".",
"_dropdowns",
".",
"splice",
"(",
"Dropdown",
".",
"_dropdowns",
".",
"indexOf",
"(",
"this",
")"... | Teardown component | [
"Teardown",
"component"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/dist/js/materialize.js#L2317-L2322 | train | Destroys the Dropdown instance | [
30522,
3853,
6033,
1006,
1007,
1063,
2023,
1012,
1035,
25141,
25711,
7698,
21756,
4244,
1006,
1007,
1025,
2023,
1012,
1035,
6366,
18697,
3372,
11774,
12910,
1006,
1007,
1025,
4530,
7698,
1012,
1035,
4530,
7698,
2015,
1012,
11867,
13231,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/Agents/RemoteFunctions.js | _scrollHandler | function _scrollHandler(e) {
// Document scrolls can be updated immediately. Any other scrolls
// need to be updated on a timer to ensure the layout is correct.
if (e.target === window.document) {
redrawHighlights();
} else {
if (_remoteHighlight || _localHighligh... | javascript | function _scrollHandler(e) {
// Document scrolls can be updated immediately. Any other scrolls
// need to be updated on a timer to ensure the layout is correct.
if (e.target === window.document) {
redrawHighlights();
} else {
if (_remoteHighlight || _localHighligh... | [
"function",
"_scrollHandler",
"(",
"e",
")",
"{",
"// Document scrolls can be updated immediately. Any other scrolls",
"// need to be updated on a timer to ensure the layout is correct.",
"if",
"(",
"e",
".",
"target",
"===",
"window",
".",
"document",
")",
"{",
"redrawHighligh... | Add a capture-phase scroll listener to update highlights when any element scrolls. | [
"Add",
"a",
"capture",
"-",
"phase",
"scroll",
"listener",
"to",
"update",
"highlights",
"when",
"any",
"element",
"scrolls",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L695-L705 | train | The scroll handler for the document. | [
30522,
3853,
1035,
17186,
11774,
3917,
1006,
1041,
1007,
1063,
1013,
1013,
6254,
23074,
2064,
2022,
7172,
3202,
1012,
2151,
2060,
23074,
1013,
1013,
2342,
2000,
2022,
7172,
2006,
1037,
25309,
2000,
5676,
1996,
30524,
2860,
4048,
5603,
15733... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/tree/layoutHelper.js | apportion | function apportion(subtreeV, subtreeW, ancestor, separation) {
if (subtreeW) {
var nodeOutRight = subtreeV;
var nodeInRight = subtreeV;
var nodeOutLeft = nodeInRight.parentNode.children[0];
var nodeInLeft = subtreeW;
var sumOutRight = nodeOutRight.hierNode.modifier;
... | javascript | function apportion(subtreeV, subtreeW, ancestor, separation) {
if (subtreeW) {
var nodeOutRight = subtreeV;
var nodeInRight = subtreeV;
var nodeOutLeft = nodeInRight.parentNode.children[0];
var nodeInLeft = subtreeW;
var sumOutRight = nodeOutRight.hierNode.modifier;
... | [
"function",
"apportion",
"(",
"subtreeV",
",",
"subtreeW",
",",
"ancestor",
",",
"separation",
")",
"{",
"if",
"(",
"subtreeW",
")",
"{",
"var",
"nodeOutRight",
"=",
"subtreeV",
";",
"var",
"nodeInRight",
"=",
"subtreeV",
";",
"var",
"nodeOutLeft",
"=",
"n... | The implementation of this function was originally copied from "d3.js"
<https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
with some modifications made for this program.
See the license statement at the head of this file.
The core of the algorithm. Here, a new subtree is comb... | [
"The",
"implementation",
"of",
"this",
"function",
"was",
"originally",
"copied",
"from",
"d3",
".",
"js",
"<https",
":",
"//",
"github",
".",
"com",
"/",
"d3",
"/",
"d3",
"-",
"hierarchy",
"/",
"blob",
"/",
"4c1f038f2725d6eae2e49b61d01456400694bac4",
"/",
"... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/tree/layoutHelper.js#L219-L260 | train | applicable to subtreeV | [
30522,
3853,
10439,
11589,
3258,
1006,
4942,
13334,
2615,
1010,
4942,
13334,
2860,
1010,
13032,
1010,
8745,
1007,
1063,
2065,
1006,
4942,
13334,
2860,
1007,
1063,
13075,
13045,
5833,
15950,
1027,
4942,
13334,
2615,
1025,
13075,
13045,
2378,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cytoscape/cytoscape.js | src/collection/style.js | function( name, value ){
let cy = this.cy();
if( !cy.styleEnabled() ){ return this; }
let updateTransitions = false;
let style = cy.style();
if( is.plainObject( name ) ){ // then extend the bypass
let props = name;
style.applyBypass( this, props, updateTransitions );
this.emitA... | javascript | function( name, value ){
let cy = this.cy();
if( !cy.styleEnabled() ){ return this; }
let updateTransitions = false;
let style = cy.style();
if( is.plainObject( name ) ){ // then extend the bypass
let props = name;
style.applyBypass( this, props, updateTransitions );
this.emitA... | [
"function",
"(",
"name",
",",
"value",
")",
"{",
"let",
"cy",
"=",
"this",
".",
"cy",
"(",
")",
";",
"if",
"(",
"!",
"cy",
".",
"styleEnabled",
"(",
")",
")",
"{",
"return",
"this",
";",
"}",
"let",
"updateTransitions",
"=",
"false",
";",
"let",
... | read the calculated css style of the element or override the style (via a bypass) | [
"read",
"the",
"calculated",
"css",
"style",
"of",
"the",
"element",
"or",
"override",
"the",
"style",
"(",
"via",
"a",
"bypass",
")"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/src/collection/style.js#L171-L213 | train | get the style of the node | [
30522,
3853,
1006,
2171,
1010,
3643,
1007,
1063,
2292,
22330,
1027,
2023,
1012,
22330,
1006,
1007,
1025,
2065,
1006,
999,
22330,
1012,
2806,
8189,
23242,
1006,
1007,
1007,
1063,
2709,
2023,
1025,
1065,
2292,
10651,
6494,
3619,
22753,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GitbookIO/gitbook | lib/plugins/loadPlugin.js | loadPlugin | function loadPlugin(book, plugin) {
var logger = book.getLogger();
var name = plugin.getName();
var pkgPath = plugin.getPath();
// Try loading plugins from different location
var p = Promise()
.then(function() {
var packageContent;
var packageMain;
var content;
... | javascript | function loadPlugin(book, plugin) {
var logger = book.getLogger();
var name = plugin.getName();
var pkgPath = plugin.getPath();
// Try loading plugins from different location
var p = Promise()
.then(function() {
var packageContent;
var packageMain;
var content;
... | [
"function",
"loadPlugin",
"(",
"book",
",",
"plugin",
")",
"{",
"var",
"logger",
"=",
"book",
".",
"getLogger",
"(",
")",
";",
"var",
"name",
"=",
"plugin",
".",
"getName",
"(",
")",
";",
"var",
"pkgPath",
"=",
"plugin",
".",
"getPath",
"(",
")",
"... | Load a plugin in a book
@param {Book} book
@param {Plugin} plugin
@param {String} pkgPath (optional)
@return {Promise<Plugin>} | [
"Load",
"a",
"plugin",
"in",
"a",
"book"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/plugins/loadPlugin.js#L25-L86 | train | Load a plugin from the same location | [
30522,
3853,
7170,
24759,
15916,
2378,
1006,
2338,
1010,
13354,
2378,
1007,
1063,
13075,
8833,
4590,
1027,
2338,
1012,
2131,
21197,
4590,
1006,
1007,
1025,
13075,
2171,
1027,
13354,
2378,
1012,
2131,
18442,
1006,
1007,
1025,
13075,
1052,
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... |
dcloudio/mui | examples/hello-mui/js/mui.js | function(event, target) {
if (!event.detail) {
event.detail = {
currentTarget: target
};
} else {
event.detail.currentTarget = target;
}
$.each(eventMethods, function(name, predicate) {
var sourceMethod = event[name];
event[name] = function() {
this[predicate] = returnTrue;
return sou... | javascript | function(event, target) {
if (!event.detail) {
event.detail = {
currentTarget: target
};
} else {
event.detail.currentTarget = target;
}
$.each(eventMethods, function(name, predicate) {
var sourceMethod = event[name];
event[name] = function() {
this[predicate] = returnTrue;
return sou... | [
"function",
"(",
"event",
",",
"target",
")",
"{",
"if",
"(",
"!",
"event",
".",
"detail",
")",
"{",
"event",
".",
"detail",
"=",
"{",
"currentTarget",
":",
"target",
"}",
";",
"}",
"else",
"{",
"event",
".",
"detail",
".",
"currentTarget",
"=",
"t... | wrap浏览器事件 | [
"wrap浏览器事件"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/hello-mui/js/mui.js#L572-L589 | train | This method is called by the event handler when an event is triggered. | [
30522,
3853,
1006,
2724,
1010,
4539,
1007,
1063,
2065,
1006,
999,
2724,
1012,
6987,
1007,
1063,
2724,
1012,
6987,
1027,
1063,
2783,
7559,
18150,
1024,
4539,
1065,
1025,
1065,
2842,
1063,
2724,
1012,
6987,
1012,
2783,
7559,
18150,
1027,
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... | |
adobe/brackets | src/LiveDevelopment/Agents/ScriptAgent.js | _onChildNodeInserted | function _onChildNodeInserted(event, res) {
// res = {parentNodeId, previousNodeId, node}
if (_insertTrace) {
var node = DOMAgent.nodeWithId(res.node.nodeId);
node.trace = _insertTrace;
_insertTrace = undefined;
}
} | javascript | function _onChildNodeInserted(event, res) {
// res = {parentNodeId, previousNodeId, node}
if (_insertTrace) {
var node = DOMAgent.nodeWithId(res.node.nodeId);
node.trace = _insertTrace;
_insertTrace = undefined;
}
} | [
"function",
"_onChildNodeInserted",
"(",
"event",
",",
"res",
")",
"{",
"// res = {parentNodeId, previousNodeId, node}",
"if",
"(",
"_insertTrace",
")",
"{",
"var",
"node",
"=",
"DOMAgent",
".",
"nodeWithId",
"(",
"res",
".",
"node",
".",
"nodeId",
")",
";",
"... | WebInspector Event: DOM.childNodeInserted | [
"WebInspector",
"Event",
":",
"DOM",
".",
"childNodeInserted"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/ScriptAgent.js#L62-L69 | train | onChildNodeInserted - event handler for insertNode | [
30522,
3853,
1035,
2006,
19339,
3630,
3207,
7076,
28728,
1006,
2724,
1010,
24501,
1007,
1063,
1013,
1013,
24501,
1027,
1063,
6687,
3630,
3207,
3593,
1010,
3025,
3630,
3207,
3593,
1010,
13045,
1065,
2065,
1006,
1035,
19274,
6494,
3401,
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... |
catapult-project/catapult | third_party/polymer2/bower_components/web-animations-js/src/handler-utils.js | consumeToken | function consumeToken(regex, string) {
var result = regex.exec(string);
if (result) {
result = regex.ignoreCase ? result[0].toLowerCase() : result[0];
return [result, string.substr(result.length)];
}
} | javascript | function consumeToken(regex, string) {
var result = regex.exec(string);
if (result) {
result = regex.ignoreCase ? result[0].toLowerCase() : result[0];
return [result, string.substr(result.length)];
}
} | [
"function",
"consumeToken",
"(",
"regex",
",",
"string",
")",
"{",
"var",
"result",
"=",
"regex",
".",
"exec",
"(",
"string",
")",
";",
"if",
"(",
"result",
")",
"{",
"result",
"=",
"regex",
".",
"ignoreCase",
"?",
"result",
"[",
"0",
"]",
".",
"to... | consume* functions return a 2 value array of [parsed-data, '' or not-yet consumed input] Regex should be anchored with /^ | [
"consume",
"*",
"functions",
"return",
"a",
"2",
"value",
"array",
"of",
"[",
"parsed",
"-",
"data",
"or",
"not",
"-",
"yet",
"consumed",
"input",
"]",
"Regex",
"should",
"be",
"anchored",
"with",
"/",
"^"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer2/bower_components/web-animations-js/src/handler-utils.js#L20-L26 | train | Consumes a token from a string | [
30522,
3853,
16678,
18715,
2368,
1006,
19723,
10288,
1010,
5164,
1007,
1063,
13075,
2765,
1027,
19723,
10288,
1012,
4654,
8586,
1006,
5164,
1007,
1025,
2065,
1006,
2765,
1007,
1063,
2765,
1027,
19723,
10288,
1012,
8568,
18382,
1029,
2765,
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... |
badges/shields | services/nuget/nuget-v2-service-family.js | createServiceFamily | function createServiceFamily({
title,
name = title,
defaultLabel,
serviceBaseUrl,
apiBaseUrl,
odataFormat,
examplePackageName,
exampleVersion,
examplePrereleaseVersion,
exampleDownloadCount,
}) {
let Base
if (odataFormat === 'xml') {
Base = BaseXmlService
} else if (odataFormat === 'json')... | javascript | function createServiceFamily({
title,
name = title,
defaultLabel,
serviceBaseUrl,
apiBaseUrl,
odataFormat,
examplePackageName,
exampleVersion,
examplePrereleaseVersion,
exampleDownloadCount,
}) {
let Base
if (odataFormat === 'xml') {
Base = BaseXmlService
} else if (odataFormat === 'json')... | [
"function",
"createServiceFamily",
"(",
"{",
"title",
",",
"name",
"=",
"title",
",",
"defaultLabel",
",",
"serviceBaseUrl",
",",
"apiBaseUrl",
",",
"odataFormat",
",",
"examplePackageName",
",",
"exampleVersion",
",",
"examplePrereleaseVersion",
",",
"exampleDownload... | /*
Create a version and download service for a NuGet v2 API. Return an object
containing both services.
defaultLabel: The label for the left hand side of the badge.
serviceBaseUrl: The base URL for the Shields service, e.g. chocolatey, resharper
apiBaseUrl: The complete base URL of the API, e.g. https://api.example.co... | [
"/",
"*",
"Create",
"a",
"version",
"and",
"download",
"service",
"for",
"a",
"NuGet",
"v2",
"API",
".",
"Return",
"an",
"object",
"containing",
"both",
"services",
"."
] | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/services/nuget/nuget-v2-service-family.js#L98-L220 | train | Creates a service family | [
30522,
3853,
9005,
2121,
7903,
12879,
10631,
2135,
1006,
1063,
2516,
1010,
2171,
1027,
2516,
1010,
12398,
20470,
2884,
1010,
2326,
15058,
3126,
2140,
1010,
17928,
15058,
3126,
2140,
1010,
1051,
2850,
2696,
14192,
4017,
1010,
2742,
23947,
42... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | dist/howler.js | function(sprite, internal) {
var self = this;
var id = null;
// Determine if a sprite, sound id or nothing was passed
if (typeof sprite === 'number') {
id = sprite;
sprite = null;
} else if (typeof sprite === 'string' && self._state === 'loaded' && !self._sprite[sprite]) {... | javascript | function(sprite, internal) {
var self = this;
var id = null;
// Determine if a sprite, sound id or nothing was passed
if (typeof sprite === 'number') {
id = sprite;
sprite = null;
} else if (typeof sprite === 'string' && self._state === 'loaded' && !self._sprite[sprite]) {... | [
"function",
"(",
"sprite",
",",
"internal",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"id",
"=",
"null",
";",
"// Determine if a sprite, sound id or nothing was passed",
"if",
"(",
"typeof",
"sprite",
"===",
"'number'",
")",
"{",
"id",
"=",
"sprite",
... | Play a sound or resume previous playback.
@param {String/Number} sprite Sprite name for sprite playback or sound id to continue previous.
@param {Boolean} internal Internal Use: true prevents event firing.
@return {Number} Sound ID. | [
"Play",
"a",
"sound",
"or",
"resume",
"previous",
"playback",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L709-L968 | train | Get the current node or the first active sound. | [
30522,
3853,
1006,
11867,
17625,
1010,
4722,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
8909,
1027,
19701,
1025,
1013,
1013,
5646,
2065,
1037,
11867,
17625,
1010,
2614,
8909,
2030,
2498,
2001,
2979,
2065,
1006,
2828,
11253,
11867,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/DraftEnabledMockServer.js | function(sEntityset, mEntitySets) {
var aSemanticKey = [];
for (var annotationsProperty in this._oDraftMetadata.annotations) {
if (annotationsProperty.lastIndexOf(mEntitySets[sEntityset].type) > -1) {
aSemanticKey = this._oDraftMetadata.annotations[annotationsProperty][this._oConstants.COM_SAP_VOCABULARI... | javascript | function(sEntityset, mEntitySets) {
var aSemanticKey = [];
for (var annotationsProperty in this._oDraftMetadata.annotations) {
if (annotationsProperty.lastIndexOf(mEntitySets[sEntityset].type) > -1) {
aSemanticKey = this._oDraftMetadata.annotations[annotationsProperty][this._oConstants.COM_SAP_VOCABULARI... | [
"function",
"(",
"sEntityset",
",",
"mEntitySets",
")",
"{",
"var",
"aSemanticKey",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"annotationsProperty",
"in",
"this",
".",
"_oDraftMetadata",
".",
"annotations",
")",
"{",
"if",
"(",
"annotationsProperty",
".",
"last... | Returns an array with key of the corresponding "draft-less" entity type
@param {string} sEntityset name of the entityset
@param {object} mEntitySets
@return {object} array with key of the corresponding "draft-less" entity type | [
"Returns",
"an",
"array",
"with",
"key",
"of",
"the",
"corresponding",
"draft",
"-",
"less",
"entity",
"type"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/DraftEnabledMockServer.js#L132-L149 | train | Returns an array of all semantic keys for the given entityset | [
30522,
3853,
1006,
2741,
3012,
13462,
1010,
2273,
3775,
3723,
13462,
2015,
1007,
1063,
13075,
2004,
16704,
26348,
3240,
1027,
1031,
1033,
1025,
2005,
1006,
13075,
5754,
17287,
9285,
21572,
4842,
3723,
1999,
2023,
1012,
1035,
1051,
7265,
619... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/discover_endpoint.js | hasCustomEndpoint | function hasCustomEndpoint(client) {
//if set endpoint is set for specific client, enable endpoint discovery will raise an error.
if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) {
throw util.error(new Error(), {
code: 'Configuratio... | javascript | function hasCustomEndpoint(client) {
//if set endpoint is set for specific client, enable endpoint discovery will raise an error.
if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) {
throw util.error(new Error(), {
code: 'Configuratio... | [
"function",
"hasCustomEndpoint",
"(",
"client",
")",
"{",
"//if set endpoint is set for specific client, enable endpoint discovery will raise an error.",
"if",
"(",
"client",
".",
"_originalConfig",
"&&",
"client",
".",
"_originalConfig",
".",
"endpoint",
"&&",
"client",
".",... | If endpoint is explicitly configured, SDK should not do endpoint discovery in anytime.
@param [object] client Service client object.
@api private | [
"If",
"endpoint",
"is",
"explicitly",
"configured",
"SDK",
"should",
"not",
"do",
"endpoint",
"discovery",
"in",
"anytime",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L247-L257 | train | Check if custom endpoint is set for specific client | [
30522,
3853,
2038,
7874,
20389,
10497,
8400,
1006,
7396,
1007,
1063,
1013,
1013,
2065,
2275,
2203,
8400,
2003,
2275,
2005,
3563,
7396,
1010,
9585,
2203,
8400,
5456,
2097,
5333,
2019,
7561,
1012,
2065,
1006,
7396,
1012,
1035,
2434,
8663,
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... |
angular/material | src/components/datepicker/js/calendar.spec.js | findCellByLabel | function findCellByLabel(monthElement, day) {
var tds = monthElement.querySelectorAll('td');
var td;
for (var i = 0; i < tds.length; i++) {
td = tds[i];
if (td.textContent === day.toString()) {
return td;
}
}
} | javascript | function findCellByLabel(monthElement, day) {
var tds = monthElement.querySelectorAll('td');
var td;
for (var i = 0; i < tds.length; i++) {
td = tds[i];
if (td.textContent === day.toString()) {
return td;
}
}
} | [
"function",
"findCellByLabel",
"(",
"monthElement",
",",
"day",
")",
"{",
"var",
"tds",
"=",
"monthElement",
".",
"querySelectorAll",
"(",
"'td'",
")",
";",
"var",
"td",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"tds",
".",
"length",
";",... | Finds a td given a label. | [
"Finds",
"a",
"td",
"given",
"a",
"label",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/calendar.spec.js#L44-L54 | train | Find a cell by label | [
30522,
3853,
2424,
29109,
14510,
20470,
2884,
1006,
3204,
12260,
3672,
1010,
2154,
1007,
1063,
13075,
14595,
2015,
1027,
3204,
12260,
3672,
1012,
23032,
11246,
22471,
6525,
3363,
1006,
1005,
14595,
1005,
1007,
1025,
13075,
14595,
1025,
2005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DragAndDrop.js | openDroppedFiles | function openDroppedFiles(paths) {
var errorFiles = [],
ERR_MULTIPLE_ITEMS_WITH_DIR = {};
return Async.doInParallel(paths, function (path, idx) {
var result = new $.Deferred();
// Only open files.
FileSystem.resolve(path, function (err, item) {
... | javascript | function openDroppedFiles(paths) {
var errorFiles = [],
ERR_MULTIPLE_ITEMS_WITH_DIR = {};
return Async.doInParallel(paths, function (path, idx) {
var result = new $.Deferred();
// Only open files.
FileSystem.resolve(path, function (err, item) {
... | [
"function",
"openDroppedFiles",
"(",
"paths",
")",
"{",
"var",
"errorFiles",
"=",
"[",
"]",
",",
"ERR_MULTIPLE_ITEMS_WITH_DIR",
"=",
"{",
"}",
";",
"return",
"Async",
".",
"doInParallel",
"(",
"paths",
",",
"function",
"(",
"path",
",",
"idx",
")",
"{",
... | Open dropped files
@param {Array.<string>} files Array of files dropped on the application.
@return {Promise} Promise that is resolved if all files are opened, or rejected
if there was an error. | [
"Open",
"dropped",
"files"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/DragAndDrop.js#L96-L171 | train | Open dropped files | [
30522,
3853,
2330,
25711,
5669,
8873,
4244,
1006,
10425,
1007,
1063,
13075,
7561,
8873,
4244,
1027,
1031,
1033,
1010,
9413,
2099,
1035,
3674,
1035,
5167,
1035,
2007,
1035,
16101,
1027,
1063,
1065,
1025,
2709,
2004,
6038,
2278,
1012,
24341,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/filesystem/impls/appshell/AppshellFileSystem.js | _mapError | function _mapError(err) {
if (!err) {
return null;
}
switch (err) {
case appshell.fs.ERR_INVALID_PARAMS:
return FileSystemError.INVALID_PARAMS;
case appshell.fs.ERR_NOT_FOUND:
return FileSystemError.NOT_FOUND;
case appshell.fs.ERR_CANT... | javascript | function _mapError(err) {
if (!err) {
return null;
}
switch (err) {
case appshell.fs.ERR_INVALID_PARAMS:
return FileSystemError.INVALID_PARAMS;
case appshell.fs.ERR_NOT_FOUND:
return FileSystemError.NOT_FOUND;
case appshell.fs.ERR_CANT... | [
"function",
"_mapError",
"(",
"err",
")",
"{",
"if",
"(",
"!",
"err",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
"err",
")",
"{",
"case",
"appshell",
".",
"fs",
".",
"ERR_INVALID_PARAMS",
":",
"return",
"FileSystemError",
".",
"INVALID_PARAMS",... | Convert appshell error codes to FileSystemError values.
@param {?number} err An appshell error code
@return {?string} A FileSystemError string, or null if there was no error code.
@private | [
"Convert",
"appshell",
"error",
"codes",
"to",
"FileSystemError",
"values",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L143-L171 | train | map error to FileSystemError | [
30522,
3853,
1035,
4949,
2121,
29165,
1006,
9413,
2099,
1007,
1063,
2065,
1006,
999,
9413,
2099,
1007,
1063,
2709,
19701,
1025,
1065,
6942,
1006,
9413,
2099,
1007,
1063,
2553,
18726,
18223,
1012,
1042,
2015,
1012,
9413,
2099,
1035,
19528,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (elem)
{
// delete unneeded handlers
if (this._sasl_success_handler) {
this.deleteHandler(this._sasl_success_handler);
this._sasl_success_handler = null;
}
if (this._sasl_challenge_handler) {
this.deleteHandler(this._sasl_challenge... | javascript | function (elem)
{
// delete unneeded handlers
if (this._sasl_success_handler) {
this.deleteHandler(this._sasl_success_handler);
this._sasl_success_handler = null;
}
if (this._sasl_challenge_handler) {
this.deleteHandler(this._sasl_challenge... | [
"function",
"(",
"elem",
")",
"{",
"// delete unneeded handlers\r",
"if",
"(",
"this",
".",
"_sasl_success_handler",
")",
"{",
"this",
".",
"deleteHandler",
"(",
"this",
".",
"_sasl_success_handler",
")",
";",
"this",
".",
"_sasl_success_handler",
"=",
"null",
"... | PrivateFunction: _sasl_failure_cb
_Private_ handler for SASL authentication failure.
Parameters:
(XMLElement) elem - The matching stanza.
Returns:
false to remove the handler.
/* jshint unused:false | [
"PrivateFunction",
":",
"_sasl_failure_cb",
"_Private_",
"handler",
"for",
"SASL",
"authentication",
"failure",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L3328-L3344 | train | endregion endregion endregion | [
30522,
3853,
1006,
3449,
6633,
1007,
1063,
1013,
1013,
3972,
12870,
4895,
24045,
5732,
28213,
2015,
2065,
1006,
2023,
1012,
1035,
21871,
2140,
1035,
3112,
1035,
28213,
1007,
1063,
2023,
1012,
3972,
12870,
11774,
3917,
1006,
2023,
1012,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Parser.js | addLeafSymbol | function addLeafSymbol(sId) {
// Note: this function is executed at load time only!
mFilterParserSymbols[sId] = {
lbp : 0,
nud : function (oToken) {
oToken.precedence = 99; // prevent it from being enclosed in brackets
return oToken;
}
};
} | javascript | function addLeafSymbol(sId) {
// Note: this function is executed at load time only!
mFilterParserSymbols[sId] = {
lbp : 0,
nud : function (oToken) {
oToken.precedence = 99; // prevent it from being enclosed in brackets
return oToken;
}
};
} | [
"function",
"addLeafSymbol",
"(",
"sId",
")",
"{",
"// Note: this function is executed at load time only!",
"mFilterParserSymbols",
"[",
"sId",
"]",
"=",
"{",
"lbp",
":",
"0",
",",
"nud",
":",
"function",
"(",
"oToken",
")",
"{",
"oToken",
".",
"precedence",
"="... | Adds a leaf symbol to mFilterParserSymbols.
@param {string} sId The token ID | [
"Adds",
"a",
"leaf",
"symbol",
"to",
"mFilterParserSymbols",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Parser.js#L189-L198 | train | Adds a leaf symbol to the filter parser | [
30522,
3853,
5587,
19213,
6508,
13344,
2140,
1006,
15765,
1007,
1063,
1013,
1013,
3602,
1024,
2023,
3853,
2003,
6472,
2012,
7170,
2051,
2069,
999,
1049,
8873,
21928,
19362,
8043,
6508,
13344,
4877,
1031,
15765,
1033,
1027,
1063,
6053,
2361,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ODataMessageParser.js | filterDuplicates | function filterDuplicates(/*ref*/ aMessages){
if (aMessages.length > 1) {
for (var iIndex = 1; iIndex < aMessages.length; iIndex++) {
if (aMessages[0].getCode() == aMessages[iIndex].getCode() && aMessages[0].getMessage() == aMessages[iIndex].getMessage()) {
aMessages.shift(); // Remove outer error, since ... | javascript | function filterDuplicates(/*ref*/ aMessages){
if (aMessages.length > 1) {
for (var iIndex = 1; iIndex < aMessages.length; iIndex++) {
if (aMessages[0].getCode() == aMessages[iIndex].getCode() && aMessages[0].getMessage() == aMessages[iIndex].getMessage()) {
aMessages.shift(); // Remove outer error, since ... | [
"function",
"filterDuplicates",
"(",
"/*ref*/",
"aMessages",
")",
"{",
"if",
"(",
"aMessages",
".",
"length",
">",
"1",
")",
"{",
"for",
"(",
"var",
"iIndex",
"=",
"1",
";",
"iIndex",
"<",
"aMessages",
".",
"length",
";",
"iIndex",
"++",
")",
"{",
"i... | The message container returned by the backend could contain duplicate messages in some scenarios.
The outer error could be identical to an inner error. This makes sense when the outer error is only though as error message container
for the inner errors and therefore shouldn't be end up in a seperate UI message.
This f... | [
"The",
"message",
"container",
"returned",
"by",
"the",
"backend",
"could",
"contain",
"duplicate",
"messages",
"in",
"some",
"scenarios",
".",
"The",
"outer",
"error",
"could",
"be",
"identical",
"to",
"an",
"inner",
"error",
".",
"This",
"makes",
"sense",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/ODataMessageParser.js#L892-L901 | train | Filter duplicates from the messages array | [
30522,
3853,
11307,
8566,
24759,
24695,
2015,
1006,
1013,
1008,
25416,
1008,
1013,
19900,
3736,
8449,
1007,
1063,
2065,
1006,
19900,
3736,
8449,
1012,
3091,
1028,
1015,
1007,
1063,
2005,
1006,
13075,
2462,
13629,
2595,
1027,
1015,
1025,
246... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | pushPoint | function pushPoint(pt)
{
if (lastPushed == null || Math.abs(lastPushed.x - pt.x) >= tol || Math.abs(lastPushed.y - pt.y) >= tol)
{
result.push(pt);
lastPushed = pt;
}
return lastPushed;
} | javascript | function pushPoint(pt)
{
if (lastPushed == null || Math.abs(lastPushed.x - pt.x) >= tol || Math.abs(lastPushed.y - pt.y) >= tol)
{
result.push(pt);
lastPushed = pt;
}
return lastPushed;
} | [
"function",
"pushPoint",
"(",
"pt",
")",
"{",
"if",
"(",
"lastPushed",
"==",
"null",
"||",
"Math",
".",
"abs",
"(",
"lastPushed",
".",
"x",
"-",
"pt",
".",
"x",
")",
">=",
"tol",
"||",
"Math",
".",
"abs",
"(",
"lastPushed",
".",
"y",
"-",
"pt",
... | Adds waypoints only if outside of tolerance | [
"Adds",
"waypoints",
"only",
"if",
"outside",
"of",
"tolerance"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L50016-L50025 | train | push point to result | [
30522,
3853,
5245,
8400,
1006,
13866,
1007,
1063,
2065,
1006,
2197,
12207,
9072,
1027,
1027,
19701,
1064,
1064,
8785,
1012,
14689,
1006,
2197,
12207,
9072,
1012,
1060,
1011,
13866,
1012,
1060,
1007,
1028,
1027,
2000,
2140,
1064,
1064,
8785,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wuchangming/spy-debugger | buildin_modules/weinre/web/interfaces/interfaces.js | reapplyDisplayStyle | function reapplyDisplayStyle(className, value) {
value = value ? "block" : "none"
;[].slice.call(document.querySelectorAll(className)).forEach(function(element) {
element.style.display = value
})
} | javascript | function reapplyDisplayStyle(className, value) {
value = value ? "block" : "none"
;[].slice.call(document.querySelectorAll(className)).forEach(function(element) {
element.style.display = value
})
} | [
"function",
"reapplyDisplayStyle",
"(",
"className",
",",
"value",
")",
"{",
"value",
"=",
"value",
"?",
"\"block\"",
":",
"\"none\"",
";",
"[",
"]",
".",
"slice",
".",
"call",
"(",
"document",
".",
"querySelectorAll",
"(",
"className",
")",
")",
".",
"f... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/interfaces/interfaces.js#L97-L102 | train | reapply display style to the page | [
30522,
3853,
2128,
29098,
2135,
10521,
13068,
21756,
2571,
1006,
2465,
18442,
1010,
3643,
1007,
1063,
3643,
1027,
3643,
1029,
1000,
3796,
1000,
1024,
1000,
3904,
1000,
1025,
1031,
1033,
1012,
14704,
1012,
2655,
1006,
6254,
1012,
23032,
1124... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tgriesser/knex | src/dialects/mssql/index.js | Client_MSSQL | function Client_MSSQL(config = {}) {
// #1235 mssql module wants 'server', not 'host'. This is to enforce the same
// options object across all dialects.
if (config && config.connection && config.connection.host) {
config.connection.server = config.connection.host;
}
// mssql always creates pool :( lets ... | javascript | function Client_MSSQL(config = {}) {
// #1235 mssql module wants 'server', not 'host'. This is to enforce the same
// options object across all dialects.
if (config && config.connection && config.connection.host) {
config.connection.server = config.connection.host;
}
// mssql always creates pool :( lets ... | [
"function",
"Client_MSSQL",
"(",
"config",
"=",
"{",
"}",
")",
"{",
"// #1235 mssql module wants 'server', not 'host'. This is to enforce the same",
"// options object across all dialects.",
"if",
"(",
"config",
"&&",
"config",
".",
"connection",
"&&",
"config",
".",
"conne... | Always initialize with the "QueryBuilder" and "QueryCompiler" objects, which extend the base 'lib/query/builder' and 'lib/query/compiler', respectively. | [
"Always",
"initialize",
"with",
"the",
"QueryBuilder",
"and",
"QueryCompiler",
"objects",
"which",
"extend",
"the",
"base",
"lib",
"/",
"query",
"/",
"builder",
"and",
"lib",
"/",
"query",
"/",
"compiler",
"respectively",
"."
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/dialects/mssql/index.js#L23-L39 | train | MSSQL Client constructor | [
30522,
3853,
7396,
1035,
5796,
2015,
4160,
2140,
1006,
9530,
8873,
2290,
1027,
1063,
1065,
1007,
1063,
1013,
1013,
1001,
13138,
2629,
5796,
2015,
4160,
2140,
11336,
4122,
1005,
8241,
1005,
1010,
2025,
1005,
3677,
1005,
1012,
2023,
2003,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/components/look-controls.js | function (event) {
var direction;
var movementX;
var movementY;
var pitchObject = this.pitchObject;
var previousMouseEvent = this.previousMouseEvent;
var yawObject = this.yawObject;
// Not dragging or not enabled.
if (!this.data.enabled || (!this.mouseDown && !this.pointerLocked)) { ret... | javascript | function (event) {
var direction;
var movementX;
var movementY;
var pitchObject = this.pitchObject;
var previousMouseEvent = this.previousMouseEvent;
var yawObject = this.yawObject;
// Not dragging or not enabled.
if (!this.data.enabled || (!this.mouseDown && !this.pointerLocked)) { ret... | [
"function",
"(",
"event",
")",
"{",
"var",
"direction",
";",
"var",
"movementX",
";",
"var",
"movementY",
";",
"var",
"pitchObject",
"=",
"this",
".",
"pitchObject",
";",
"var",
"previousMouseEvent",
"=",
"this",
".",
"previousMouseEvent",
";",
"var",
"yawOb... | Translate mouse drag into rotation.
Dragging up and down rotates the camera around the X-axis (yaw).
Dragging left and right rotates the camera around the Y-axis (pitch). | [
"Translate",
"mouse",
"drag",
"into",
"rotation",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/look-controls.js#L227-L253 | train | Handles mouse move. | [
30522,
3853,
1006,
2724,
1007,
1063,
13075,
3257,
1025,
13075,
2929,
2595,
1025,
13075,
2929,
2100,
1025,
13075,
6510,
16429,
20614,
1027,
2023,
1012,
6510,
16429,
20614,
1025,
13075,
3025,
27711,
4402,
15338,
1027,
2023,
1012,
3025,
27711,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | build/release/dist.js | push | function push() {
Release.chdir( Release.dir.dist );
console.log( "Pushing release to dist repo..." );
Release.exec( "git push " + distRemote + " master --tags",
"Error pushing master and tags to git repo." );
// Set repo for npm publish
Release.dir.origRepo = Release.dir.repo;
Release.dir.repo = Relea... | javascript | function push() {
Release.chdir( Release.dir.dist );
console.log( "Pushing release to dist repo..." );
Release.exec( "git push " + distRemote + " master --tags",
"Error pushing master and tags to git repo." );
// Set repo for npm publish
Release.dir.origRepo = Release.dir.repo;
Release.dir.repo = Relea... | [
"function",
"push",
"(",
")",
"{",
"Release",
".",
"chdir",
"(",
"Release",
".",
"dir",
".",
"dist",
")",
";",
"console",
".",
"log",
"(",
"\"Pushing release to dist repo...\"",
")",
";",
"Release",
".",
"exec",
"(",
"\"git push \"",
"+",
"distRemote",
"+"... | Push files to dist repo | [
"Push",
"files",
"to",
"dist",
"repo"
] | ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3 | https://github.com/jquery/jquery/blob/ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3/build/release/dist.js#L134-L144 | train | Pushes the release to dist repo | [
30522,
3853,
5245,
1006,
1007,
1063,
2713,
1012,
10381,
4305,
2099,
1006,
2713,
1012,
16101,
1012,
4487,
3367,
1007,
1025,
10122,
1012,
8833,
1006,
1000,
6183,
2713,
2000,
4487,
3367,
16360,
2080,
1012,
1012,
1012,
1000,
1007,
1025,
2713,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.ux3/src/sap/ui/ux3/ToolPopup.js | function (context) {
var oElement;
var oFocusControl;
var that = context;
var defaultFocusableElements = [that._mParameters.firstFocusable, that._mParameters.lastFocusable];
// jQuery custom selectors ":sapTabbable"
var aTab... | javascript | function (context) {
var oElement;
var oFocusControl;
var that = context;
var defaultFocusableElements = [that._mParameters.firstFocusable, that._mParameters.lastFocusable];
// jQuery custom selectors ":sapTabbable"
var aTab... | [
"function",
"(",
"context",
")",
"{",
"var",
"oElement",
";",
"var",
"oFocusControl",
";",
"var",
"that",
"=",
"context",
";",
"var",
"defaultFocusableElements",
"=",
"[",
"that",
".",
"_mParameters",
".",
"firstFocusable",
",",
"that",
".",
"_mParameters",
... | Determines the new element which will gain the focus.
@param {sap.ui.ux3.ToolPopup} context to get/set instance values
@private | [
"Determines",
"the",
"new",
"element",
"which",
"will",
"gain",
"the",
"focus",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ToolPopup.js#L327-L362 | train | This function is called when the control is not available | [
30522,
3853,
1006,
6123,
1007,
1063,
13075,
1051,
12260,
3672,
1025,
13075,
1997,
10085,
2271,
8663,
13181,
2140,
1025,
13075,
2008,
1027,
6123,
1025,
13075,
12398,
14876,
7874,
3085,
12260,
8163,
1027,
1031,
2008,
1012,
1035,
6131,
5400,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/LiveDevelopment/Agents/DOMAgent.js | nodeAtLocation | function nodeAtLocation(location) {
return exports.root.find(function each(n) {
return n.isAtLocation(location, false);
});
} | javascript | function nodeAtLocation(location) {
return exports.root.find(function each(n) {
return n.isAtLocation(location, false);
});
} | [
"function",
"nodeAtLocation",
"(",
"location",
")",
"{",
"return",
"exports",
".",
"root",
".",
"find",
"(",
"function",
"each",
"(",
"n",
")",
"{",
"return",
"n",
".",
"isAtLocation",
"(",
"location",
",",
"false",
")",
";",
"}",
")",
";",
"}"
] | Get the node at the given location
@param {location} | [
"Get",
"the",
"node",
"at",
"the",
"given",
"location"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMAgent.js#L79-L83 | train | Returns the node at the given location | [
30522,
3853,
13045,
4017,
4135,
10719,
1006,
3295,
1007,
1063,
2709,
14338,
1012,
7117,
1012,
2424,
1006,
3853,
2169,
1006,
1050,
1007,
1063,
2709,
1050,
1012,
18061,
19646,
23909,
1006,
3295,
1010,
6270,
1007,
1025,
1065,
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... |
webpack/webpack | lib/web/JsonpMainTemplate.runtime.js | hotDownloadUpdateChunk | function hotDownloadUpdateChunk(chunkId) {
var script = document.createElement("script");
script.charset = "utf-8";
script.src = $require$.p + $hotChunkFilename$;
if ($crossOriginLoading$) script.crossOrigin = $crossOriginLoading$;
document.head.appendChild(script);
} | javascript | function hotDownloadUpdateChunk(chunkId) {
var script = document.createElement("script");
script.charset = "utf-8";
script.src = $require$.p + $hotChunkFilename$;
if ($crossOriginLoading$) script.crossOrigin = $crossOriginLoading$;
document.head.appendChild(script);
} | [
"function",
"hotDownloadUpdateChunk",
"(",
"chunkId",
")",
"{",
"var",
"script",
"=",
"document",
".",
"createElement",
"(",
"\"script\"",
")",
";",
"script",
".",
"charset",
"=",
"\"utf-8\"",
";",
"script",
".",
"src",
"=",
"$require$",
".",
"p",
"+",
"$h... | $semicolon eslint-disable-next-line no-unused-vars | [
"$semicolon",
"eslint",
"-",
"disable",
"-",
"next",
"-",
"line",
"no",
"-",
"unused",
"-",
"vars"
] | 81cf088cd6a0231b94fa2399bd29294eccee1907 | https://github.com/webpack/webpack/blob/81cf088cd6a0231b94fa2399bd29294eccee1907/lib/web/JsonpMainTemplate.runtime.js#L14-L20 | train | Download a chunk | [
30522,
3853,
2980,
7698,
11066,
6279,
13701,
20760,
8950,
1006,
20000,
3593,
1007,
1063,
13075,
5896,
1027,
6254,
1012,
3443,
12260,
3672,
1006,
1000,
5896,
1000,
1007,
1025,
5896,
1012,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/language/CodeInspection.js | getProvidersForPath | function getProvidersForPath(filePath) {
var language = LanguageManager.getLanguageForPath(filePath).getId(),
context = PreferencesManager._buildContext(filePath, language),
installedProviders = getProvidersForLanguageId(language),
preferredProviders,
... | javascript | function getProvidersForPath(filePath) {
var language = LanguageManager.getLanguageForPath(filePath).getId(),
context = PreferencesManager._buildContext(filePath, language),
installedProviders = getProvidersForLanguageId(language),
preferredProviders,
... | [
"function",
"getProvidersForPath",
"(",
"filePath",
")",
"{",
"var",
"language",
"=",
"LanguageManager",
".",
"getLanguageForPath",
"(",
"filePath",
")",
".",
"getId",
"(",
")",
",",
"context",
"=",
"PreferencesManager",
".",
"_buildContext",
"(",
"filePath",
",... | Returns a list of provider for given file path, if available.
Decision is made depending on the file extension.
@param {!string} filePath
@return {Array.<{name:string, scanFileAsync:?function(string, string):!{$.Promise}, scanFile:?function(string, string):?{errors:!Array, aborted:boolean}}>} | [
"Returns",
"a",
"list",
"of",
"provider",
"for",
"given",
"file",
"path",
"if",
"available",
".",
"Decision",
"is",
"made",
"depending",
"on",
"the",
"file",
"extension",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L157-L188 | train | Get the list of providers for a given file path | [
30522,
3853,
2131,
21572,
17258,
2545,
29278,
15069,
1006,
5371,
15069,
1007,
1063,
13075,
2653,
1027,
2653,
24805,
4590,
1012,
2131,
25023,
6692,
3351,
29278,
15069,
1006,
5371,
15069,
1007,
1012,
2131,
3593,
1006,
1007,
1010,
6123,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/angular | aio/tools/transforms/angular-api-package/content-rules/noMarkdownHeadings.js | listify | function listify(values) {
if (values.length <= 1) return values;
const last = values[values.length - 1];
const rest = values.slice(0, values.length - 1);
return [rest.join(', '), last].join(' and ');
} | javascript | function listify(values) {
if (values.length <= 1) return values;
const last = values[values.length - 1];
const rest = values.slice(0, values.length - 1);
return [rest.join(', '), last].join(' and ');
} | [
"function",
"listify",
"(",
"values",
")",
"{",
"if",
"(",
"values",
".",
"length",
"<=",
"1",
")",
"return",
"values",
";",
"const",
"last",
"=",
"values",
"[",
"values",
".",
"length",
"-",
"1",
"]",
";",
"const",
"rest",
"=",
"values",
".",
"sli... | Convert an array of strings in to a human list - e.g separated by commas and the word `and`.
@param {string[]} values The strings to convert to a list | [
"Convert",
"an",
"array",
"of",
"strings",
"in",
"to",
"a",
"human",
"list",
"-",
"e",
".",
"g",
"separated",
"by",
"commas",
"and",
"the",
"word",
"and",
"."
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/aio/tools/transforms/angular-api-package/content-rules/noMarkdownHeadings.js#L45-L50 | train | Listify a list of values | [
30522,
3853,
2862,
8757,
1006,
5300,
1007,
1063,
2065,
1006,
5300,
1012,
3091,
1026,
1027,
1015,
1007,
2709,
5300,
1025,
9530,
3367,
2197,
1027,
5300,
1031,
5300,
1012,
3091,
1011,
1015,
1033,
1025,
9530,
3367,
2717,
1027,
5300,
1012,
147... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/webcam/src/index.js | getMediaDevices | function getMediaDevices () {
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
return navigator.mediaDevices
}
const getUserMedia = navigator.mozGetUserMedia || navigator.webkitGetUserMedia
if (!getUserMedia) {
return null
}
return {
getUserMedia (opts) {
return new P... | javascript | function getMediaDevices () {
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
return navigator.mediaDevices
}
const getUserMedia = navigator.mozGetUserMedia || navigator.webkitGetUserMedia
if (!getUserMedia) {
return null
}
return {
getUserMedia (opts) {
return new P... | [
"function",
"getMediaDevices",
"(",
")",
"{",
"if",
"(",
"navigator",
".",
"mediaDevices",
"&&",
"navigator",
".",
"mediaDevices",
".",
"getUserMedia",
")",
"{",
"return",
"navigator",
".",
"mediaDevices",
"}",
"const",
"getUserMedia",
"=",
"navigator",
".",
"... | Setup getUserMedia, with polyfill for older browsers Adapted from: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia | [
"Setup",
"getUserMedia",
"with",
"polyfill",
"for",
"older",
"browsers",
"Adapted",
"from",
":",
"https",
":",
"//",
"developer",
".",
"mozilla",
".",
"org",
"/",
"en",
"-",
"US",
"/",
"docs",
"/",
"Web",
"/",
"API",
"/",
"MediaDevices",
"/",
"getUserMed... | 7ae18bf992d544a64da998f033258ec09a3de275 | https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/packages/@uppy/webcam/src/index.js#L13-L30 | train | getMediaDevices - returns a Promise | [
30522,
3853,
2131,
16969,
24844,
23522,
1006,
1007,
1063,
2065,
1006,
20532,
1012,
2865,
24844,
23522,
1004,
1004,
20532,
1012,
2865,
24844,
23522,
1012,
2131,
20330,
16969,
1007,
1063,
2709,
20532,
1012,
2865,
24844,
23522,
1065,
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... |
tensorflow/tfjs-models | posenet/demos/camera.js | setupCamera | async function setupCamera() {
if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
throw new Error(
'Browser API navigator.mediaDevices.getUserMedia not available');
}
const video = document.getElementById('video');
video.width = videoWidth;
video.height = videoHeight;
const... | javascript | async function setupCamera() {
if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
throw new Error(
'Browser API navigator.mediaDevices.getUserMedia not available');
}
const video = document.getElementById('video');
video.width = videoWidth;
video.height = videoHeight;
const... | [
"async",
"function",
"setupCamera",
"(",
")",
"{",
"if",
"(",
"!",
"navigator",
".",
"mediaDevices",
"||",
"!",
"navigator",
".",
"mediaDevices",
".",
"getUserMedia",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Browser API navigator.mediaDevices.getUserMedia not avail... | Loads a the camera to be used in the demo | [
"Loads",
"a",
"the",
"camera",
"to",
"be",
"used",
"in",
"the",
"demo"
] | af194797c90cc5bcac1060d3cd41b0258a34c7dc | https://github.com/tensorflow/tfjs-models/blob/af194797c90cc5bcac1060d3cd41b0258a34c7dc/posenet/demos/camera.js#L43-L69 | train | Setup camera | [
30522,
2004,
6038,
2278,
3853,
16437,
28727,
6906,
1006,
1007,
1063,
2065,
1006,
999,
20532,
1012,
2865,
24844,
23522,
1064,
1064,
999,
20532,
1012,
2865,
24844,
23522,
1012,
2131,
20330,
16969,
1007,
1063,
5466,
2047,
7561,
1006,
1005,
166... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | dist/js/materialize.js | function (eventName, data) {
if (document.createEvent) {
var evt = document.createEvent('HTMLEvents');
evt.initEvent(eventName, true, false);
evt = this.extend(evt, data);
return this.each(function (v) {
return v.dispatchEvent(evt);
});
}
} | javascript | function (eventName, data) {
if (document.createEvent) {
var evt = document.createEvent('HTMLEvents');
evt.initEvent(eventName, true, false);
evt = this.extend(evt, data);
return this.each(function (v) {
return v.dispatchEvent(evt);
});
}
} | [
"function",
"(",
"eventName",
",",
"data",
")",
"{",
"if",
"(",
"document",
".",
"createEvent",
")",
"{",
"var",
"evt",
"=",
"document",
".",
"createEvent",
"(",
"'HTMLEvents'",
")",
";",
"evt",
".",
"initEvent",
"(",
"eventName",
",",
"true",
",",
"fa... | Modified
Triggers browser event
@param String eventName
@param Object data - Add properties to event object | [
"Modified",
"Triggers",
"browser",
"event"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/dist/js/materialize.js#L636-L645 | train | Dispatches an event on each element in the sequence | [
30522,
3853,
1006,
2724,
18442,
1010,
2951,
30524,
1027,
6254,
1012,
3443,
18697,
3372,
1006,
1005,
16129,
18697,
7666,
1005,
1007,
1025,
23408,
2102,
1012,
1999,
4221,
15338,
1006,
2724,
18442,
1010,
2995,
1010,
6270,
1007,
1025,
23408,
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... | |
eslint/eslint | lib/rules/constructor-super.js | isCalledInEveryPath | function isCalledInEveryPath(segment) {
/*
* If specific segment is the looped segment of the current segment,
* skip the segment.
* If not skipped, this never becomes true after a loop.
*/
if (segment.nextSegments.length === 1 &&
... | javascript | function isCalledInEveryPath(segment) {
/*
* If specific segment is the looped segment of the current segment,
* skip the segment.
* If not skipped, this never becomes true after a loop.
*/
if (segment.nextSegments.length === 1 &&
... | [
"function",
"isCalledInEveryPath",
"(",
"segment",
")",
"{",
"/*\n * If specific segment is the looped segment of the current segment,\n * skip the segment.\n * If not skipped, this never becomes true after a loop.\n */",
"if",
"(",
"segment",
".",... | Gets the flag which shows `super()` is called in all paths.
@param {CodePathSegment} segment - A code path segment to get.
@returns {boolean} The flag which shows `super()` is called in all paths. | [
"Gets",
"the",
"flag",
"which",
"shows",
"super",
"()",
"is",
"called",
"in",
"all",
"paths",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/constructor-super.js#L152-L165 | train | Returns true if segment is called in every path | [
30522,
3853,
30524,
1063,
1013,
1008,
1008,
2065,
3563,
6903,
2003,
1996,
7077,
2098,
6903,
1997,
1996,
2783,
6903,
1010,
1008,
13558,
1996,
6903,
1012,
1008,
2065,
2025,
16791,
1010,
2023,
2196,
4150,
2995,
2044,
1037,
7077,
1012,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
expressjs/express | examples/cookie-sessions/index.js | count | function count(req, res) {
req.session.count = (req.session.count || 0) + 1
res.send('viewed ' + req.session.count + ' times\n')
} | javascript | function count(req, res) {
req.session.count = (req.session.count || 0) + 1
res.send('viewed ' + req.session.count + ' times\n')
} | [
"function",
"count",
"(",
"req",
",",
"res",
")",
"{",
"req",
".",
"session",
".",
"count",
"=",
"(",
"req",
".",
"session",
".",
"count",
"||",
"0",
")",
"+",
"1",
"res",
".",
"send",
"(",
"'viewed '",
"+",
"req",
".",
"session",
".",
"count",
... | custom middleware | [
"custom",
"middleware"
] | dc538f6e810bd462c98ee7e6aae24c64d4b1da93 | https://github.com/expressjs/express/blob/dc538f6e810bd462c98ee7e6aae24c64d4b1da93/examples/cookie-sessions/index.js#L17-L20 | train | Count the number of views | [
30522,
3853,
4175,
1006,
2128,
4160,
1010,
24501,
1007,
1063,
2128,
4160,
1012,
5219,
1012,
4175,
1027,
1006,
2128,
4160,
1012,
5219,
1012,
4175,
1064,
1064,
1014,
1007,
1009,
1015,
24501,
1012,
4604,
1006,
1005,
7021,
1005,
1009,
2128,
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... |
adobe/brackets | src/project/FileSyncManager.js | syncUnopenWorkingSet | function syncUnopenWorkingSet() {
// We only care about working set entries that have never been open (have no Document).
var unopenWorkingSetFiles = MainViewManager.getWorkingSet(MainViewManager.ALL_PANES).filter(function (wsFile) {
return !DocumentManager.getOpenDocumentForPath(wsFile.full... | javascript | function syncUnopenWorkingSet() {
// We only care about working set entries that have never been open (have no Document).
var unopenWorkingSetFiles = MainViewManager.getWorkingSet(MainViewManager.ALL_PANES).filter(function (wsFile) {
return !DocumentManager.getOpenDocumentForPath(wsFile.full... | [
"function",
"syncUnopenWorkingSet",
"(",
")",
"{",
"// We only care about working set entries that have never been open (have no Document).",
"var",
"unopenWorkingSetFiles",
"=",
"MainViewManager",
".",
"getWorkingSet",
"(",
"MainViewManager",
".",
"ALL_PANES",
")",
".",
"filter"... | Scans all the files in the working set that do not have Documents (and thus were not scanned
by findExternalChanges()). If any were deleted on disk, removes them from the working set. | [
"Scans",
"all",
"the",
"files",
"in",
"the",
"working",
"set",
"that",
"do",
"not",
"have",
"Documents",
"(",
"and",
"thus",
"were",
"not",
"scanned",
"by",
"findExternalChanges",
"()",
")",
".",
"If",
"any",
"were",
"deleted",
"on",
"disk",
"removes",
"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileSyncManager.js#L178-L208 | train | Syncs all working set files to disk | [
30522,
3853,
26351,
27819,
11837,
21398,
13462,
1006,
1007,
1063,
1013,
1013,
2057,
2069,
2729,
2055,
2551,
2275,
10445,
2008,
2031,
2196,
30524,
6254,
24805,
4590,
1012,
2131,
26915,
3527,
24894,
4765,
29278,
15069,
1006,
1059,
22747,
9463,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ControlPersonalizationAPI.js | function(oControl) {
var oAppComponent = Utils.getAppComponentForControl(oControl);
var oFlexController = FlexControllerFactory.createForControl(oAppComponent);
var oRootControl = oAppComponent.getRootControl();
var oView = Utils.getViewForControl(oControl);
var oVariantModel = oAppComponent.getModel("$F... | javascript | function(oControl) {
var oAppComponent = Utils.getAppComponentForControl(oControl);
var oFlexController = FlexControllerFactory.createForControl(oAppComponent);
var oRootControl = oAppComponent.getRootControl();
var oView = Utils.getViewForControl(oControl);
var oVariantModel = oAppComponent.getModel("$F... | [
"function",
"(",
"oControl",
")",
"{",
"var",
"oAppComponent",
"=",
"Utils",
".",
"getAppComponentForControl",
"(",
"oControl",
")",
";",
"var",
"oFlexController",
"=",
"FlexControllerFactory",
".",
"createForControl",
"(",
"oAppComponent",
")",
";",
"var",
"oRoot... | Returns a map of parameters used in public functions.
@param {sap.ui.core.Element} oControl - The control for which a variant management control has to be evaluated
@returns {object} Returns a map with needed parameters
@private | [
"Returns",
"a",
"map",
"of",
"parameters",
"used",
"in",
"public",
"functions",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/ControlPersonalizationAPI.js#L66-L94 | train | Returns the parameters for the given control. | [
30522,
3853,
1006,
1051,
8663,
13181,
2140,
1007,
1063,
13075,
1051,
29098,
9006,
29513,
3372,
1027,
21183,
12146,
1012,
2131,
29098,
9006,
29513,
3372,
29278,
8663,
13181,
2140,
1006,
1051,
8663,
13181,
2140,
1007,
1025,
13075,
1997,
2571,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/software-update.js | softwareUpdate_assertUpdateApplied | function softwareUpdate_assertUpdateApplied(updateData) {
// Get the information from the last update
var info = updateData.updates[updateData.updateIndex];
// The upgraded version should be identical with the version given by
// the update and we shouldn't have run a downgrade
var check = this._vc... | javascript | function softwareUpdate_assertUpdateApplied(updateData) {
// Get the information from the last update
var info = updateData.updates[updateData.updateIndex];
// The upgraded version should be identical with the version given by
// the update and we shouldn't have run a downgrade
var check = this._vc... | [
"function",
"softwareUpdate_assertUpdateApplied",
"(",
"updateData",
")",
"{",
"// Get the information from the last update",
"var",
"info",
"=",
"updateData",
".",
"updates",
"[",
"updateData",
".",
"updateIndex",
"]",
";",
"// The upgraded version should be identical with the... | Checks if an update has been applied correctly
@param {object} updateData
All the data collected during the update process | [
"Checks",
"if",
"an",
"update",
"has",
"been",
"applied",
"correctly"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/software-update.js#L242-L262 | train | Assert that the software update is applied | [
30522,
3853,
4007,
6279,
13701,
1035,
20865,
6279,
13701,
29098,
8751,
2094,
1006,
7172,
6790,
1007,
1063,
1013,
1013,
2131,
1996,
2592,
2013,
1996,
2197,
10651,
13075,
18558,
1027,
7172,
6790,
1012,
14409,
1031,
7172,
6790,
1012,
10651,
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... |
adobe/brackets | src/JSUtils/ScopeManager.js | resetModule | function resetModule() {
function resetTernServer() {
if (_ternNodeDomain.ready()) {
_ternNodeDomain.exec('resetTernServer');
}
}
if (_ternNodeDomain) {
if (addFilesPromise) {
// If w... | javascript | function resetModule() {
function resetTernServer() {
if (_ternNodeDomain.ready()) {
_ternNodeDomain.exec('resetTernServer');
}
}
if (_ternNodeDomain) {
if (addFilesPromise) {
// If w... | [
"function",
"resetModule",
"(",
")",
"{",
"function",
"resetTernServer",
"(",
")",
"{",
"if",
"(",
"_ternNodeDomain",
".",
"ready",
"(",
")",
")",
"{",
"_ternNodeDomain",
".",
"exec",
"(",
"'resetTernServer'",
")",
";",
"}",
"}",
"if",
"(",
"_ternNodeDomai... | Do some cleanup when a project is closed.
We can clean up the node tern server we use to calculate hints now, since
we know we will need to re-init it in any new project that is opened. | [
"Do",
"some",
"cleanup",
"when",
"a",
"project",
"is",
"closed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1335-L1351 | train | Reset the module | [
30522,
3853,
25141,
5302,
8566,
2571,
1006,
1007,
1063,
3853,
25141,
16451,
8043,
6299,
1006,
1007,
1063,
2065,
1006,
1035,
28774,
10695,
10244,
9527,
8113,
1012,
3201,
1006,
1007,
1007,
1063,
1035,
28774,
10695,
10244,
9527,
8113,
1012,
46... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | dist/extension/dataTool.js | function (rawData, opt) {
opt = opt || [];
var boxData = [];
var outliers = [];
var axisData = [];
var boundIQR = opt.boundIQR;
var useExtreme = boundIQR === 'none' || boundIQR === 0;
for (var i = 0; i < rawData.length; i++) {
axisData.push(i + '');
var ascList = asc(rawData... | javascript | function (rawData, opt) {
opt = opt || [];
var boxData = [];
var outliers = [];
var axisData = [];
var boundIQR = opt.boundIQR;
var useExtreme = boundIQR === 'none' || boundIQR === 0;
for (var i = 0; i < rawData.length; i++) {
axisData.push(i + '');
var ascList = asc(rawData... | [
"function",
"(",
"rawData",
",",
"opt",
")",
"{",
"opt",
"=",
"opt",
"||",
"[",
"]",
";",
"var",
"boxData",
"=",
"[",
"]",
";",
"var",
"outliers",
"=",
"[",
"]",
";",
"var",
"axisData",
"=",
"[",
"]",
";",
"var",
"boundIQR",
"=",
"opt",
".",
... | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... | [
"/",
"*",
"Licensed",
"to",
"the",
"Apache",
"Software",
"Foundation",
"(",
"ASF",
")",
"under",
"one",
"or",
"more",
"contributor",
"license",
"agreements",
".",
"See",
"the",
"NOTICE",
"file",
"distributed",
"with",
"this",
"work",
"for",
"additional",
"in... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/dist/extension/dataTool.js#L770-L813 | train | Returns an array of tuples containing the data in the correct order | [
30522,
3853,
1006,
6315,
2850,
2696,
1010,
23569,
1007,
1063,
23569,
1027,
23569,
1064,
1064,
1031,
1033,
1025,
13075,
3482,
2850,
2696,
1027,
1031,
1033,
1025,
13075,
2041,
14355,
2015,
1027,
1031,
1033,
1025,
13075,
8123,
2850,
2696,
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... | |
SeleniumHQ/selenium | javascript/node/selenium-webdriver/lib/logging.js | getLevel | function getLevel(nameOrValue) {
if (typeof nameOrValue === 'string') {
return LEVELS_BY_NAME.get(nameOrValue) || Level.ALL;
}
if (typeof nameOrValue !== 'number') {
throw new TypeError('not a string or number');
}
for (let level of ALL_LEVELS) {
if (nameOrValue >= level.value) {
return leve... | javascript | function getLevel(nameOrValue) {
if (typeof nameOrValue === 'string') {
return LEVELS_BY_NAME.get(nameOrValue) || Level.ALL;
}
if (typeof nameOrValue !== 'number') {
throw new TypeError('not a string or number');
}
for (let level of ALL_LEVELS) {
if (nameOrValue >= level.value) {
return leve... | [
"function",
"getLevel",
"(",
"nameOrValue",
")",
"{",
"if",
"(",
"typeof",
"nameOrValue",
"===",
"'string'",
")",
"{",
"return",
"LEVELS_BY_NAME",
".",
"get",
"(",
"nameOrValue",
")",
"||",
"Level",
".",
"ALL",
";",
"}",
"if",
"(",
"typeof",
"nameOrValue",... | Converts a level name or value to a {@link Level} value. If the name/value
is not recognized, {@link Level.ALL} will be returned.
@param {(number|string)} nameOrValue The log level name, or value, to
convert.
@return {!Level} The converted level. | [
"Converts",
"a",
"level",
"name",
"or",
"value",
"to",
"a",
"{",
"@link",
"Level",
"}",
"value",
".",
"If",
"the",
"name",
"/",
"value",
"is",
"not",
"recognized",
"{",
"@link",
"Level",
".",
"ALL",
"}",
"will",
"be",
"returned",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/lib/logging.js#L202-L215 | train | Get the level of a given name or value | [
30522,
3853,
2131,
20414,
2884,
1006,
2171,
2953,
10175,
5657,
1007,
1063,
2065,
1006,
2828,
11253,
2171,
2953,
10175,
5657,
1027,
1027,
1027,
1005,
5164,
1005,
1007,
1063,
2709,
3798,
1035,
2011,
1035,
2171,
1012,
2131,
1006,
2171,
2953,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/ion.rangeSlider/js/ion.rangeSlider.js | function (target, e) {
if (this.current_plugin !== this.plugin_count || e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
return;
}
switch (e.which) {
case 83: // W
case 65: // A
case 40: // DOWN
case ... | javascript | function (target, e) {
if (this.current_plugin !== this.plugin_count || e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
return;
}
switch (e.which) {
case 83: // W
case 65: // A
case 40: // DOWN
case ... | [
"function",
"(",
"target",
",",
"e",
")",
"{",
"if",
"(",
"this",
".",
"current_plugin",
"!==",
"this",
".",
"plugin_count",
"||",
"e",
".",
"altKey",
"||",
"e",
".",
"ctrlKey",
"||",
"e",
".",
"shiftKey",
"||",
"e",
".",
"metaKey",
")",
"{",
"retu... | Keyborard controls for focused slider
@param target {String}
@param e {Object} event object
@returns {boolean|undefined} | [
"Keyborard",
"controls",
"for",
"focused",
"slider"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/ion.rangeSlider/js/ion.rangeSlider.js#L890-L914 | train | cisco cisco cisco | [
30522,
3853,
1006,
4539,
1010,
1041,
1007,
1063,
2065,
1006,
2023,
1012,
2783,
1035,
13354,
2378,
999,
1027,
1027,
2023,
1012,
13354,
2378,
1035,
4175,
1064,
1064,
1041,
1012,
12456,
14839,
1064,
1064,
1041,
1012,
14931,
12190,
14839,
1064,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
apache/incubator-echarts | src/chart/treemap/treemapLayout.js | squarify | function squarify(node, options, hideChildren, depth) {
var width;
var height;
if (node.isRemoved()) {
return;
}
var thisLayout = node.getLayout();
width = thisLayout.width;
height = thisLayout.height;
// Considering border and gap
var nodeModel = node.getModel();
var ... | javascript | function squarify(node, options, hideChildren, depth) {
var width;
var height;
if (node.isRemoved()) {
return;
}
var thisLayout = node.getLayout();
width = thisLayout.width;
height = thisLayout.height;
// Considering border and gap
var nodeModel = node.getModel();
var ... | [
"function",
"squarify",
"(",
"node",
",",
"options",
",",
"hideChildren",
",",
"depth",
")",
"{",
"var",
"width",
";",
"var",
"height",
";",
"if",
"(",
"node",
".",
"isRemoved",
"(",
")",
")",
"{",
"return",
";",
"}",
"var",
"thisLayout",
"=",
"node"... | Layout treemap with squarify algorithm.
The original presentation of this algorithm
was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk
<https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf>.
The implementation of this algorithm was originally copied from "d3.js"
<https://github.com... | [
"Layout",
"treemap",
"with",
"squarify",
"algorithm",
".",
"The",
"original",
"presentation",
"of",
"this",
"algorithm",
"was",
"made",
"by",
"Mark",
"Bruls",
"Kees",
"Huizing",
"and",
"Jarke",
"J",
".",
"van",
"Wijk",
"<https",
":",
"//",
"graphics",
".",
... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/treemap/treemapLayout.js#L172-L254 | train | Squarifies a node by expanding it s children to the nearest row. | [
30522,
3853,
5490,
6692,
3089,
12031,
1006,
13045,
1010,
7047,
1010,
5342,
19339,
7389,
1010,
5995,
1007,
1063,
13075,
9381,
1025,
13075,
4578,
1025,
2065,
1006,
13045,
1012,
2003,
28578,
21818,
2094,
1006,
1007,
1007,
1063,
2709,
1025,
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... |
baianat/vee-validate | src/components/provider.js | addListeners | function addListeners (node) {
const model = findModel(node);
// cache the input eventName.
this._inputEventName = this._inputEventName || getInputEventName(node, model);
onRenderUpdate.call(this, model);
const { onInput, onBlur, onValidate } = createCommonHandlers(this);
addVNodeListener(node, this._inpu... | javascript | function addListeners (node) {
const model = findModel(node);
// cache the input eventName.
this._inputEventName = this._inputEventName || getInputEventName(node, model);
onRenderUpdate.call(this, model);
const { onInput, onBlur, onValidate } = createCommonHandlers(this);
addVNodeListener(node, this._inpu... | [
"function",
"addListeners",
"(",
"node",
")",
"{",
"const",
"model",
"=",
"findModel",
"(",
"node",
")",
";",
"// cache the input eventName.",
"this",
".",
"_inputEventName",
"=",
"this",
".",
"_inputEventName",
"||",
"getInputEventName",
"(",
"node",
",",
"mode... | Adds all plugin listeners to the vnode. | [
"Adds",
"all",
"plugin",
"listeners",
"to",
"the",
"vnode",
"."
] | 31a7022569a7ea36857016e0f6e68c6539b0c935 | https://github.com/baianat/vee-validate/blob/31a7022569a7ea36857016e0f6e68c6539b0c935/src/components/provider.js#L136-L153 | train | Add the listeners to the node. | [
30522,
3853,
5587,
9863,
24454,
2015,
1006,
13045,
1007,
1063,
9530,
3367,
2944,
1027,
2424,
5302,
9247,
1006,
13045,
1007,
1025,
1013,
1013,
17053,
1996,
7953,
2724,
18442,
1012,
2023,
1012,
1035,
7953,
18697,
3372,
18442,
1027,
2023,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/plugins/TechInfo.js | formatBuildInfo | function formatBuildInfo(timestamp, scmRevision) {
var info = [];
if ( timestamp ) {
var match = /^(\d{4})(\d{2})(\d{2})-?(\d{2})(\d{2})$/.exec(timestamp);
if ( match ) {
timestamp = match[1] + '-' + match[2] + '-' + match[3] + 'T' + match[4] + ":" + match[5];
}
info.push("built at " +... | javascript | function formatBuildInfo(timestamp, scmRevision) {
var info = [];
if ( timestamp ) {
var match = /^(\d{4})(\d{2})(\d{2})-?(\d{2})(\d{2})$/.exec(timestamp);
if ( match ) {
timestamp = match[1] + '-' + match[2] + '-' + match[3] + 'T' + match[4] + ":" + match[5];
}
info.push("built at " +... | [
"function",
"formatBuildInfo",
"(",
"timestamp",
",",
"scmRevision",
")",
"{",
"var",
"info",
"=",
"[",
"]",
";",
"if",
"(",
"timestamp",
")",
"{",
"var",
"match",
"=",
"/",
"^(\\d{4})(\\d{2})(\\d{2})-?(\\d{2})(\\d{2})$",
"/",
".",
"exec",
"(",
"timestamp",
... | version information | [
"version",
"information"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/plugins/TechInfo.js#L64-L77 | train | Format build info | [
30522,
3853,
4289,
8569,
4014,
8718,
14876,
1006,
2335,
15464,
2361,
1010,
8040,
2213,
2890,
17084,
1007,
1063,
13075,
18558,
1027,
1031,
1033,
1025,
2065,
1006,
2335,
15464,
2361,
1007,
1063,
13075,
2674,
1027,
1013,
1034,
1006,
1032,
1040... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GeekyAnts/vue-native-core | packages/vue-server-renderer/build.js | renderAttrs | function renderAttrs (node) {
var attrs = node.data.attrs;
var res = '';
var parent = node.parent;
while (isDef(parent)) {
if (isDef(parent.data) && isDef(parent.data.attrs)) {
attrs = Object.assign({}, attrs, parent.data.attrs);
}
parent = parent.parent;
}
if (isUndef(attrs)) {
retu... | javascript | function renderAttrs (node) {
var attrs = node.data.attrs;
var res = '';
var parent = node.parent;
while (isDef(parent)) {
if (isDef(parent.data) && isDef(parent.data.attrs)) {
attrs = Object.assign({}, attrs, parent.data.attrs);
}
parent = parent.parent;
}
if (isUndef(attrs)) {
retu... | [
"function",
"renderAttrs",
"(",
"node",
")",
"{",
"var",
"attrs",
"=",
"node",
".",
"data",
".",
"attrs",
";",
"var",
"res",
"=",
"''",
";",
"var",
"parent",
"=",
"node",
".",
"parent",
";",
"while",
"(",
"isDef",
"(",
"parent",
")",
")",
"{",
"i... | /* | [
"/",
"*"
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-server-renderer/build.js#L245-L269 | train | render attrs | [
30522,
3853,
17552,
19321,
2869,
1006,
13045,
1007,
1063,
13075,
2012,
16344,
2015,
1027,
13045,
1012,
2951,
1012,
2012,
16344,
2015,
1025,
13075,
24501,
1027,
1005,
1005,
1025,
13075,
6687,
1027,
13045,
1012,
6687,
1025,
2096,
1006,
2003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/layout/layout.js | warnAttrNotSupported | function warnAttrNotSupported(className) {
var parts = className.split("-");
return ["$log", function($log) {
$log.warn(className + "has been deprecated. Please use a `" + parts[0] + "-gt-<xxx>` variant.");
return angular.noop;
}];
} | javascript | function warnAttrNotSupported(className) {
var parts = className.split("-");
return ["$log", function($log) {
$log.warn(className + "has been deprecated. Please use a `" + parts[0] + "-gt-<xxx>` variant.");
return angular.noop;
}];
} | [
"function",
"warnAttrNotSupported",
"(",
"className",
")",
"{",
"var",
"parts",
"=",
"className",
".",
"split",
"(",
"\"-\"",
")",
";",
"return",
"[",
"\"$log\"",
",",
"function",
"(",
"$log",
")",
"{",
"$log",
".",
"warn",
"(",
"className",
"+",
"\"has ... | Provide console warning that this layout attribute has been deprecated | [
"Provide",
"console",
"warning",
"that",
"this",
"layout",
"attribute",
"has",
"been",
"deprecated"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L373-L379 | train | Warn if an attribute is not supported. | [
30522,
3853,
11582,
19321,
19139,
10422,
9397,
15613,
1006,
2465,
18442,
1007,
1063,
13075,
3033,
1027,
2465,
18442,
1012,
3975,
1006,
1000,
1011,
1000,
1007,
1025,
2709,
1031,
1000,
1002,
8833,
1000,
1010,
3853,
1006,
1002,
8833,
1007,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/command/KeyBindingManager.js | _quitAltGrMode | function _quitAltGrMode() {
_enabled = true;
_ctrlDown = CtrlDownStates.NOT_YET_DETECTED;
_altGrDown = false;
_lastTimeStamp = null;
_lastKeyIdentifier = null;
$(window).off("keyup", _onCtrlUp);
} | javascript | function _quitAltGrMode() {
_enabled = true;
_ctrlDown = CtrlDownStates.NOT_YET_DETECTED;
_altGrDown = false;
_lastTimeStamp = null;
_lastKeyIdentifier = null;
$(window).off("keyup", _onCtrlUp);
} | [
"function",
"_quitAltGrMode",
"(",
")",
"{",
"_enabled",
"=",
"true",
";",
"_ctrlDown",
"=",
"CtrlDownStates",
".",
"NOT_YET_DETECTED",
";",
"_altGrDown",
"=",
"false",
";",
"_lastTimeStamp",
"=",
"null",
";",
"_lastKeyIdentifier",
"=",
"null",
";",
"$",
"(",
... | @private
Resets all the flags and removes _onCtrlUp event listener. | [
"@private",
"Resets",
"all",
"the",
"flags",
"and",
"removes",
"_onCtrlUp",
"event",
"listener",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L200-L207 | train | Quit AltGr mode | [
30522,
3853,
1035,
8046,
2389,
2102,
16523,
5302,
3207,
1006,
1007,
1063,
1035,
9124,
1027,
2995,
1025,
1035,
14931,
12190,
7698,
1027,
14931,
12190,
7698,
9153,
4570,
1012,
2025,
1035,
2664,
1035,
11156,
1025,
1035,
12456,
16523,
7698,
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... |
GitbookIO/gitbook | lib/utils/timing.js | measure | function measure(type, p) {
timers[type] = timers[type] || {
type: type,
count: 0,
total: 0,
min: undefined,
max: 0
};
var start = Date.now();
return p
.fin(function() {
var end = Date.now();
var duration = (end - start);
timers[type... | javascript | function measure(type, p) {
timers[type] = timers[type] || {
type: type,
count: 0,
total: 0,
min: undefined,
max: 0
};
var start = Date.now();
return p
.fin(function() {
var end = Date.now();
var duration = (end - start);
timers[type... | [
"function",
"measure",
"(",
"type",
",",
"p",
")",
"{",
"timers",
"[",
"type",
"]",
"=",
"timers",
"[",
"type",
"]",
"||",
"{",
"type",
":",
"type",
",",
"count",
":",
"0",
",",
"total",
":",
"0",
",",
"min",
":",
"undefined",
",",
"max",
":",
... | Mesure an operation
@parqm {String} type
@param {Promise} p
@return {Promise} | [
"Mesure",
"an",
"operation"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/timing.js#L14-L41 | train | Measure a time period | [
30522,
3853,
5468,
1006,
2828,
1010,
1052,
1007,
1063,
25309,
2015,
1031,
2828,
1033,
1027,
25309,
2015,
1031,
2828,
1033,
1064,
1064,
1063,
2828,
1024,
2828,
1010,
4175,
1024,
1014,
1010,
2561,
1024,
1014,
1010,
8117,
1024,
6151,
28344,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.support/src/sap/ui/support/supportRules/report/IssueRenderer.js | renderIssuesForOPA | function renderIssuesForOPA(issues) {
if (!jQuery("#qunit") || !issues) {
return;
}
// TODO: Add rendered issues to a buffer and render all of them at the same time at the end of the OPA test.
var element = jQuery(this.render(issues));
jQuery("#qunit").append(element);
if (!_OPARenderingInitialized) {
... | javascript | function renderIssuesForOPA(issues) {
if (!jQuery("#qunit") || !issues) {
return;
}
// TODO: Add rendered issues to a buffer and render all of them at the same time at the end of the OPA test.
var element = jQuery(this.render(issues));
jQuery("#qunit").append(element);
if (!_OPARenderingInitialized) {
... | [
"function",
"renderIssuesForOPA",
"(",
"issues",
")",
"{",
"if",
"(",
"!",
"jQuery",
"(",
"\"#qunit\"",
")",
"||",
"!",
"issues",
")",
"{",
"return",
";",
"}",
"// TODO: Add rendered issues to a buffer and render all of them at the same time at the end of the OPA test.",
... | /* eslint-disable no-undef
Creates an html string containing the issues and appends it to the OPA html page
@param {Object} issues - the issues in viewmodel format
@returns {String} | [
"/",
"*",
"eslint",
"-",
"disable",
"no",
"-",
"undef",
"Creates",
"an",
"html",
"string",
"containing",
"the",
"issues",
"and",
"appends",
"it",
"to",
"the",
"OPA",
"html",
"page"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/report/IssueRenderer.js#L186-L218 | train | Renders the given issues for the OPA test. | [
30522,
3853,
17552,
14643,
15808,
29278,
29477,
1006,
3314,
1007,
1063,
2065,
1006,
999,
1046,
4226,
2854,
1006,
1000,
1001,
24209,
3490,
2102,
1000,
1007,
1064,
1064,
999,
3314,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
28681,
2080,
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... |
angular/material | src/components/tabs/js/tabsController.js | updateInkBarStyles | function updateInkBarStyles (previousTotalWidth, previousWidthOfTabItems) {
if (ctrl.noInkBar) {
return;
}
var elements = getElements();
if (!elements.tabs[ ctrl.selectedIndex ]) {
angular.element(elements.inkBar).css({ left: 'auto', right: 'auto' });
return;
}
if (!ctrl.tabs... | javascript | function updateInkBarStyles (previousTotalWidth, previousWidthOfTabItems) {
if (ctrl.noInkBar) {
return;
}
var elements = getElements();
if (!elements.tabs[ ctrl.selectedIndex ]) {
angular.element(elements.inkBar).css({ left: 'auto', right: 'auto' });
return;
}
if (!ctrl.tabs... | [
"function",
"updateInkBarStyles",
"(",
"previousTotalWidth",
",",
"previousWidthOfTabItems",
")",
"{",
"if",
"(",
"ctrl",
".",
"noInkBar",
")",
"{",
"return",
";",
"}",
"var",
"elements",
"=",
"getElements",
"(",
")",
";",
"if",
"(",
"!",
"elements",
".",
... | Repositions the ink bar to the selected tab.
Parameters are used when calling itself recursively when md-center-tabs is used as we need to
run two passes to properly center the tabs. These parameters ensure that we only run two passes
and that we don't run indefinitely.
@param {number=} previousTotalWidth previous widt... | [
"Repositions",
"the",
"ink",
"bar",
"to",
"the",
"selected",
"tab",
".",
"Parameters",
"are",
"used",
"when",
"calling",
"itself",
"recursively",
"when",
"md",
"-",
"center",
"-",
"tabs",
"is",
"used",
"as",
"we",
"need",
"to",
"run",
"two",
"passes",
"t... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L861-L902 | train | Updates the ink bar s style based on the current tab and tab items. | [
30522,
3853,
10651,
19839,
8237,
21756,
4244,
1006,
3025,
3406,
9080,
9148,
11927,
2232,
1010,
3025,
9148,
11927,
14586,
2696,
16313,
6633,
2015,
1007,
1063,
2065,
1006,
14931,
12190,
1012,
2053,
19839,
8237,
1007,
1063,
2709,
1025,
1065,
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... |
dequelabs/axe-core | lib/core/utils/queue.js | function(fn) {
if (typeof fn === 'object' && fn.then && fn.catch) {
var defer = fn;
fn = function(resolve, reject) {
defer.then(resolve).catch(reject);
};
}
funcGuard(fn);
if (err !== undefined) {
return;
} else if (complete) {
throw new Error('Queue already completed'... | javascript | function(fn) {
if (typeof fn === 'object' && fn.then && fn.catch) {
var defer = fn;
fn = function(resolve, reject) {
defer.then(resolve).catch(reject);
};
}
funcGuard(fn);
if (err !== undefined) {
return;
} else if (complete) {
throw new Error('Queue already completed'... | [
"function",
"(",
"fn",
")",
"{",
"if",
"(",
"typeof",
"fn",
"===",
"'object'",
"&&",
"fn",
".",
"then",
"&&",
"fn",
".",
"catch",
")",
"{",
"var",
"defer",
"=",
"fn",
";",
"fn",
"=",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"defer",
... | Defer a function that may or may not run asynchronously.
First parameter should be the function to execute with subsequent
parameters being passed as arguments to that function | [
"Defer",
"a",
"function",
"that",
"may",
"or",
"may",
"not",
"run",
"asynchronously",
"."
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/queue.js#L75-L93 | train | Add a task to the queue | [
30522,
3853,
1006,
1042,
2078,
1007,
1063,
2065,
1006,
2828,
11253,
1042,
2078,
1027,
1027,
1027,
1005,
4874,
1005,
1004,
1004,
1042,
2078,
1012,
2059,
1004,
1004,
1042,
2078,
1012,
4608,
1007,
1063,
13075,
13366,
2121,
1027,
1042,
2078,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
swimlane/ngx-datatable | release/utils/column-helper.js | setColumnDefaults | function setColumnDefaults(columns) {
if (!columns)
return;
// Only one column should hold the tree view
// Thus if multiple columns are provided with
// isTreeColumn as true we take only the first one
var treeColumnFound = false;
for (var _i = 0, columns_1 = columns; _i < columns_1.leng... | javascript | function setColumnDefaults(columns) {
if (!columns)
return;
// Only one column should hold the tree view
// Thus if multiple columns are provided with
// isTreeColumn as true we take only the first one
var treeColumnFound = false;
for (var _i = 0, columns_1 = columns; _i < columns_1.leng... | [
"function",
"setColumnDefaults",
"(",
"columns",
")",
"{",
"if",
"(",
"!",
"columns",
")",
"return",
";",
"// Only one column should hold the tree view",
"// Thus if multiple columns are provided with",
"// isTreeColumn as true we take only the first one",
"var",
"treeColumnFound",... | Sets the column defaults | [
"Sets",
"the",
"column",
"defaults"
] | d7df15a070282a169524dba51d9572008b74804c | https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column-helper.js#L9-L67 | train | set column defaults | [
30522,
3853,
2275,
25778,
2819,
13629,
7011,
11314,
2015,
1006,
7753,
1007,
1063,
2065,
1006,
999,
7753,
1007,
2709,
1025,
1013,
1013,
2069,
2028,
5930,
2323,
2907,
1996,
3392,
3193,
1013,
1013,
2947,
2065,
3674,
7753,
2024,
3024,
2007,
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... |
dequelabs/axe-core | lib/core/utils/preload-cssom.js | getStylesheetsOfRootNode | function getStylesheetsOfRootNode(options) {
const { rootNode, shadowId } = options;
let sheets;
// nodeType === 11 -> DOCUMENT_FRAGMENT
if (rootNode.nodeType === 11 && shadowId) {
sheets = getStylesheetsFromDocumentFragment(options);
} else {
sheets = getStylesheetsFromDocument(rootNode);
}
return filter... | javascript | function getStylesheetsOfRootNode(options) {
const { rootNode, shadowId } = options;
let sheets;
// nodeType === 11 -> DOCUMENT_FRAGMENT
if (rootNode.nodeType === 11 && shadowId) {
sheets = getStylesheetsFromDocumentFragment(options);
} else {
sheets = getStylesheetsFromDocument(rootNode);
}
return filter... | [
"function",
"getStylesheetsOfRootNode",
"(",
"options",
")",
"{",
"const",
"{",
"rootNode",
",",
"shadowId",
"}",
"=",
"options",
";",
"let",
"sheets",
";",
"// nodeType === 11 -> DOCUMENT_FRAGMENT",
"if",
"(",
"rootNode",
".",
"nodeType",
"===",
"11",
"&&",
"s... | Get stylesheet(s) for root
@param {Object} options configuration options of `loadCssom`
@returns an array of stylesheets | [
"Get",
"stylesheet",
"(",
"s",
")",
"for",
"root"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/preload-cssom.js#L348-L360 | train | Get the stylesheets of a rootNode | [
30522,
3853,
4152,
27983,
4095,
15558,
6499,
19699,
17206,
3630,
3207,
1006,
7047,
1007,
1063,
9530,
3367,
1063,
7117,
3630,
3207,
1010,
5192,
3593,
1065,
1027,
7047,
1025,
2292,
8697,
1025,
1013,
1013,
13045,
13874,
1027,
1027,
1027,
2340,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/datetime.js | tsToObj | function tsToObj(ts, offset) {
ts += offset * 60 * 1000;
const d = new Date(ts);
return {
year: d.getUTCFullYear(),
month: d.getUTCMonth() + 1,
day: d.getUTCDate(),
hour: d.getUTCHours(),
minute: d.getUTCMinutes(),
second: d.getUTCSeconds(),
millisecond: d.getUTCMilliseconds()
};
} | javascript | function tsToObj(ts, offset) {
ts += offset * 60 * 1000;
const d = new Date(ts);
return {
year: d.getUTCFullYear(),
month: d.getUTCMonth() + 1,
day: d.getUTCDate(),
hour: d.getUTCHours(),
minute: d.getUTCMinutes(),
second: d.getUTCSeconds(),
millisecond: d.getUTCMilliseconds()
};
} | [
"function",
"tsToObj",
"(",
"ts",
",",
"offset",
")",
"{",
"ts",
"+=",
"offset",
"*",
"60",
"*",
"1000",
";",
"const",
"d",
"=",
"new",
"Date",
"(",
"ts",
")",
";",
"return",
"{",
"year",
":",
"d",
".",
"getUTCFullYear",
"(",
")",
",",
"month",
... | convert an epoch timestamp into a calendar object with the given offset | [
"convert",
"an",
"epoch",
"timestamp",
"into",
"a",
"calendar",
"object",
"with",
"the",
"given",
"offset"
] | 236f2badea297ee73421aa39a83e06177c1be6d0 | https://github.com/moment/luxon/blob/236f2badea297ee73421aa39a83e06177c1be6d0/src/datetime.js#L101-L115 | train | Convert a timestamp to an object | [
30522,
3853,
24529,
3406,
16429,
3501,
1006,
24529,
1010,
16396,
1007,
1063,
24529,
1009,
1027,
16396,
1008,
3438,
1008,
6694,
1025,
9530,
3367,
1040,
1027,
2047,
3058,
1006,
24529,
1007,
1025,
2709,
1063,
2095,
1024,
1040,
1012,
2131,
4904... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | rollup.plugins.js | stylesheet | function stylesheet(config = {}) {
const minifier = new cleancss();
const styles = [];
return {
name: 'stylesheet',
transform(code, id) {
// Note that 'id' can be mapped to a CJS proxy import, in which case
// 'id' will start with 'commonjs-proxy', so let's first check if we
// are importing an existin... | javascript | function stylesheet(config = {}) {
const minifier = new cleancss();
const styles = [];
return {
name: 'stylesheet',
transform(code, id) {
// Note that 'id' can be mapped to a CJS proxy import, in which case
// 'id' will start with 'commonjs-proxy', so let's first check if we
// are importing an existin... | [
"function",
"stylesheet",
"(",
"config",
"=",
"{",
"}",
")",
"{",
"const",
"minifier",
"=",
"new",
"cleancss",
"(",
")",
";",
"const",
"styles",
"=",
"[",
"]",
";",
"return",
"{",
"name",
":",
"'stylesheet'",
",",
"transform",
"(",
"code",
",",
"id",... | https://github.com/chartjs/Chart.js/issues/5208 | [
"https",
":",
"//",
"github",
".",
"com",
"/",
"chartjs",
"/",
"Chart",
".",
"js",
"/",
"issues",
"/",
"5208"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/rollup.plugins.js#L62-L103 | train | Generates a CSS file | [
30522,
3853,
6782,
21030,
2102,
1006,
9530,
8873,
2290,
1027,
1063,
1065,
1007,
1063,
9530,
3367,
7163,
8873,
2121,
1027,
2047,
4550,
6169,
2015,
1006,
1007,
1025,
9530,
3367,
6782,
1027,
1031,
1033,
1025,
2709,
1063,
2171,
1024,
1005,
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... |
angular/angular | tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js | getNextLNodeWithProjection | function
getNextLNodeWithProjection(node) {
var pNextOrParent = node.pNextOrParent;
return pNextOrParent ? 1 == (3 & pNextOrParent.flags) ? null : pNextOrParent : node.next;
} | javascript | function
getNextLNodeWithProjection(node) {
var pNextOrParent = node.pNextOrParent;
return pNextOrParent ? 1 == (3 & pNextOrParent.flags) ? null : pNextOrParent : node.next;
} | [
"function",
"getNextLNodeWithProjection",
"(",
"node",
")",
"{",
"var",
"pNextOrParent",
"=",
"node",
".",
"pNextOrParent",
";",
"return",
"pNextOrParent",
"?",
"1",
"==",
"(",
"3",
"&",
"pNextOrParent",
".",
"flags",
")",
"?",
"null",
":",
"pNextOrParent",
... | @license
Copyright Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that can be
found in the LICENSE file at https://angular.io/license
@license
Copyright Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that can be
found in the... | [
"@license",
"Copyright",
"Google",
"Inc",
".",
"All",
"Rights",
"Reserved",
"."
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js#L179-L183 | train | Returns the next node in the list of nodes | [
30522,
3853,
2131,
2638,
18413,
19666,
10244,
24415,
21572,
20614,
3258,
1006,
13045,
1007,
1063,
13075,
1052,
2638,
18413,
2953,
19362,
4765,
1027,
13045,
1012,
1052,
2638,
18413,
2953,
19362,
4765,
1025,
2709,
1052,
2638,
18413,
2953,
19362... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | function(graph, cells)
{
cells = cells || graph.getSelectionCells();
var result = graph.getExportableCells(graph.model.getTopmostCells(cells));
mxClipboard.insertCount = 1;
mxClipboard.setCells(graph.cloneCells(result));
return result;
} | javascript | function(graph, cells)
{
cells = cells || graph.getSelectionCells();
var result = graph.getExportableCells(graph.model.getTopmostCells(cells));
mxClipboard.insertCount = 1;
mxClipboard.setCells(graph.cloneCells(result));
return result;
} | [
"function",
"(",
"graph",
",",
"cells",
")",
"{",
"cells",
"=",
"cells",
"||",
"graph",
".",
"getSelectionCells",
"(",
")",
";",
"var",
"result",
"=",
"graph",
".",
"getExportableCells",
"(",
"graph",
".",
"model",
".",
"getTopmostCells",
"(",
"cells",
"... | Function: copy
Copies the given array of <mxCells> from the specified
graph to <cells>. Returns the original array of cells that has
been cloned. Descendants of cells in the array are ignored.
Parameters:
graph - <mxGraph> that contains the cells to be copied.
cells - Optional array of <mxCells> to be copied. | [
"Function",
":",
"copy"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L11425-L11433 | train | Returns the topmost cells of the graph | [
30522,
3853,
1006,
10629,
1010,
4442,
1007,
1063,
4442,
1027,
4442,
1064,
1064,
10629,
1012,
4152,
12260,
7542,
29109,
4877,
1006,
1007,
1025,
13075,
2765,
1027,
10629,
1012,
2131,
10288,
6442,
3085,
29109,
4877,
1006,
10629,
1012,
2944,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/BindingParser.js | setMode | function setMode(oBinding, iIndex) {
if (oBinding.parts) {
oBinding.parts.forEach(function (vPart, i) {
if (typeof vPart === "string") {
vPart = oBinding.parts[i] = {path : vPart};
}
setMode(vPart, i);
});
b2ndLevelMergedNeeded = b2ndLevelMergedNeeded || iIndex !== undefined;... | javascript | function setMode(oBinding, iIndex) {
if (oBinding.parts) {
oBinding.parts.forEach(function (vPart, i) {
if (typeof vPart === "string") {
vPart = oBinding.parts[i] = {path : vPart};
}
setMode(vPart, i);
});
b2ndLevelMergedNeeded = b2ndLevelMergedNeeded || iIndex !== undefined;... | [
"function",
"setMode",
"(",
"oBinding",
",",
"iIndex",
")",
"{",
"if",
"(",
"oBinding",
".",
"parts",
")",
"{",
"oBinding",
".",
"parts",
".",
"forEach",
"(",
"function",
"(",
"vPart",
",",
"i",
")",
"{",
"if",
"(",
"typeof",
"vPart",
"===",
"\"strin... | Recursively sets the mode <code>oBindingMode</code> on the given binding (or its
parts).
@param {object} oBinding
a binding which may be composite
@param {int} [iIndex]
index provided by <code>forEach</code> | [
"Recursively",
"sets",
"the",
"mode",
"<code",
">",
"oBindingMode<",
"/",
"code",
">",
"on",
"the",
"given",
"binding",
"(",
"or",
"its",
"parts",
")",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/BindingParser.js#L428-L440 | train | Sets the binding mode | [
30522,
3853,
2275,
5302,
3207,
1006,
27885,
22254,
2075,
1010,
2462,
13629,
2595,
1007,
1063,
2065,
1006,
27885,
22254,
2075,
1012,
3033,
1007,
1063,
27885,
22254,
2075,
1012,
3033,
1012,
18921,
6776,
1006,
3853,
1006,
21210,
8445,
1010,
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... |
feathericons/feather | src/icon.js | attrsToString | function attrsToString(attrs) {
return Object.keys(attrs)
.map(key => `${key}="${attrs[key]}"`)
.join(' ');
} | javascript | function attrsToString(attrs) {
return Object.keys(attrs)
.map(key => `${key}="${attrs[key]}"`)
.join(' ');
} | [
"function",
"attrsToString",
"(",
"attrs",
")",
"{",
"return",
"Object",
".",
"keys",
"(",
"attrs",
")",
".",
"map",
"(",
"key",
"=>",
"`",
"${",
"key",
"}",
"${",
"attrs",
"[",
"key",
"]",
"}",
"`",
")",
".",
"join",
"(",
"' '",
")",
";",
"}"
... | Convert attributes object to string of HTML attributes.
@param {Object} attrs
@returns {string} | [
"Convert",
"attributes",
"object",
"to",
"string",
"of",
"HTML",
"attributes",
"."
] | 8f658193d25e943b196a2367319b5d9e85ee9f9f | https://github.com/feathericons/feather/blob/8f658193d25e943b196a2367319b5d9e85ee9f9f/src/icon.js#L49-L53 | train | Convert an object to a string | [
30522,
3853,
2012,
16344,
16033,
3367,
4892,
1006,
2012,
16344,
2015,
1007,
1063,
2709,
4874,
1012,
6309,
1006,
2012,
16344,
2015,
1007,
1012,
4949,
1006,
3145,
1027,
1028,
1036,
1002,
1063,
3145,
1065,
1027,
1000,
1002,
1063,
2012,
16344,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/duration.js | convert | function convert(matrix, fromMap, fromUnit, toMap, toUnit) {
const conv = matrix[toUnit][fromUnit],
raw = fromMap[fromUnit] / conv,
sameSign = Math.sign(raw) === Math.sign(toMap[toUnit]),
// ok, so this is wild, but see the matrix in the tests
added =
!sameSign && toMap[toUnit] !== 0 && Math.abs... | javascript | function convert(matrix, fromMap, fromUnit, toMap, toUnit) {
const conv = matrix[toUnit][fromUnit],
raw = fromMap[fromUnit] / conv,
sameSign = Math.sign(raw) === Math.sign(toMap[toUnit]),
// ok, so this is wild, but see the matrix in the tests
added =
!sameSign && toMap[toUnit] !== 0 && Math.abs... | [
"function",
"convert",
"(",
"matrix",
",",
"fromMap",
",",
"fromUnit",
",",
"toMap",
",",
"toUnit",
")",
"{",
"const",
"conv",
"=",
"matrix",
"[",
"toUnit",
"]",
"[",
"fromUnit",
"]",
",",
"raw",
"=",
"fromMap",
"[",
"fromUnit",
"]",
"/",
"conv",
","... | NB: mutates parameters | [
"NB",
":",
"mutates",
"parameters"
] | 236f2badea297ee73421aa39a83e06177c1be6d0 | https://github.com/moment/luxon/blob/236f2badea297ee73421aa39a83e06177c1be6d0/src/duration.js#L125-L134 | train | Convert a matrix to a unit | [
30522,
3853,
10463,
1006,
8185,
1010,
2013,
2863,
2361,
1010,
2013,
19496,
2102,
1010,
3419,
9331,
1010,
2000,
19496,
2102,
1007,
1063,
9530,
3367,
9530,
2615,
1027,
8185,
1031,
2000,
19496,
2102,
1033,
1031,
2013,
19496,
2102,
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... |
apache/incubator-echarts | src/data/List.js | cloneListForMapAndSample | function cloneListForMapAndSample(original, excludeDimensions) {
var allDimensions = original.dimensions;
var list = new List(
zrUtil.map(allDimensions, original.getDimensionInfo, original),
original.hostModel
);
// FIXME If needs stackedOn, value may already been stacked
transferPro... | javascript | function cloneListForMapAndSample(original, excludeDimensions) {
var allDimensions = original.dimensions;
var list = new List(
zrUtil.map(allDimensions, original.getDimensionInfo, original),
original.hostModel
);
// FIXME If needs stackedOn, value may already been stacked
transferPro... | [
"function",
"cloneListForMapAndSample",
"(",
"original",
",",
"excludeDimensions",
")",
"{",
"var",
"allDimensions",
"=",
"original",
".",
"dimensions",
";",
"var",
"list",
"=",
"new",
"List",
"(",
"zrUtil",
".",
"map",
"(",
"allDimensions",
",",
"original",
"... | Data in excludeDimensions is copied, otherwise transfered. | [
"Data",
"in",
"excludeDimensions",
"is",
"copied",
"otherwise",
"transfered",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/data/List.js#L1556-L1586 | train | Clone list for mapping and sampling | [
30522,
3853,
17598,
9863,
14192,
22068,
18376,
16613,
2571,
1006,
2434,
1010,
12421,
14428,
3619,
8496,
1007,
1063,
13075,
2035,
22172,
6132,
8496,
1027,
2434,
1012,
9646,
1025,
13075,
2862,
1027,
2047,
2862,
1006,
1062,
22134,
4014,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.unified/src/sap/ui/unified/calendar/CalendarDate.js | checkNumericLike | function checkNumericLike(value, message) {
if (value == undefined || value === Infinity || isNaN(value)) {//checks also for null.
throw message;
}
} | javascript | function checkNumericLike(value, message) {
if (value == undefined || value === Infinity || isNaN(value)) {//checks also for null.
throw message;
}
} | [
"function",
"checkNumericLike",
"(",
"value",
",",
"message",
")",
"{",
"if",
"(",
"value",
"==",
"undefined",
"||",
"value",
"===",
"Infinity",
"||",
"isNaN",
"(",
"value",
")",
")",
"{",
"//checks also for null.",
"throw",
"message",
";",
"}",
"}"
] | Verifies the given value is numeric like, i.e. 3, "3" and throws an error if it is not.
@param {any} value The value of any type to check. If null or undefined, this method throws an error.
@param {string} message The message to be used if an error is to be thrown
@throws will throw an error if the value is null or und... | [
"Verifies",
"the",
"given",
"value",
"is",
"numeric",
"like",
"i",
".",
"e",
".",
"3",
"3",
"and",
"throws",
"an",
"error",
"if",
"it",
"is",
"not",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.unified/src/sap/ui/unified/calendar/CalendarDate.js#L361-L365 | train | Check if value is numeric like | [
30522,
3853,
4638,
19172,
22420,
10359,
1006,
3643,
1010,
4471,
1007,
1063,
2065,
1006,
3643,
1027,
1027,
6151,
28344,
1064,
1064,
3643,
1027,
1027,
1027,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
LLK/scratch-blocks | blocks_vertical/sensing.js | function() {
this.jsonInit({
"message0": Blockly.Msg.SENSING_CURRENT,
"args0": [
{
"type": "field_dropdown",
"name": "CURRENTMENU",
"options": [
[Blockly.Msg.SENSING_CURRENT_YEAR, 'YEAR'],
[Blockly.Msg.SENSING_CURRENT_MONTH, 'MONTH'],
... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.SENSING_CURRENT,
"args0": [
{
"type": "field_dropdown",
"name": "CURRENTMENU",
"options": [
[Blockly.Msg.SENSING_CURRENT_YEAR, 'YEAR'],
[Blockly.Msg.SENSING_CURRENT_MONTH, 'MONTH'],
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"SENSING_CURRENT",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"CURRENTMENU\"",
",",
"\"options... | Block to Report the current option.
@this Blockly.Block | [
"Block",
"to",
"Report",
"the",
"current",
"option",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/sensing.js#L471-L493 | train | Block for current sensing. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
13851,
1035,
2783,
1010,
1000,
12098,
5620,
2692,
1000,
1024,
1031,
1063,
1000,
2828,
1000,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onGetRedirectResult | function onGetRedirectResult() {
auth.getRedirectResult().then(function(response) {
log('Redirect results:');
if (response.credential) {
log('Credential:');
log(response.credential);
} else {
log('No credential');
}
if (response.user) {
log('User\'s id:');
log(respons... | javascript | function onGetRedirectResult() {
auth.getRedirectResult().then(function(response) {
log('Redirect results:');
if (response.credential) {
log('Credential:');
log(response.credential);
} else {
log('No credential');
}
if (response.user) {
log('User\'s id:');
log(respons... | [
"function",
"onGetRedirectResult",
"(",
")",
"{",
"auth",
".",
"getRedirectResult",
"(",
")",
".",
"then",
"(",
"function",
"(",
"response",
")",
"{",
"log",
"(",
"'Redirect results:'",
")",
";",
"if",
"(",
"response",
".",
"credential",
")",
"{",
"log",
... | Displays redirect result. | [
"Displays",
"redirect",
"result",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L1052-L1070 | train | Get redirect result | [
30522,
3853,
2006,
18150,
5596,
7442,
6593,
6072,
11314,
1006,
1007,
1063,
8740,
2705,
1012,
2131,
5596,
7442,
6593,
6072,
11314,
1006,
1007,
1012,
2059,
1006,
3853,
1006,
3433,
1007,
1063,
8833,
1006,
1005,
2417,
7442,
6593,
3463,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.