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/core/cache/LRUPersistentCache.js | updateItemUsage | function updateItemUsage(self, oItem) {
if (self._metadata.__byKey__[oItem.oData.key] != null) { // ItemData already exists, we need to remove the old position index
var oldIndex = self._metadata.__byKey__[oItem.oData.key];
delete self._metadata.__byIndex__[oldIndex];
Log.debug("Cache Manager LRUPersiste... | javascript | function updateItemUsage(self, oItem) {
if (self._metadata.__byKey__[oItem.oData.key] != null) { // ItemData already exists, we need to remove the old position index
var oldIndex = self._metadata.__byKey__[oItem.oData.key];
delete self._metadata.__byIndex__[oldIndex];
Log.debug("Cache Manager LRUPersiste... | [
"function",
"updateItemUsage",
"(",
"self",
",",
"oItem",
")",
"{",
"if",
"(",
"self",
".",
"_metadata",
".",
"__byKey__",
"[",
"oItem",
".",
"oData",
".",
"key",
"]",
"!=",
"null",
")",
"{",
"// ItemData already exists, we need to remove the old position index",
... | Set/updates item's usage by setting LRU indexes and moves the LRU pointer if needed.
@param {sap.ui.core.cache.LRUPersistenceCache} self the <code>this</code> instance
@param {Item} oItem the item to update indexes for | [
"Set",
"/",
"updates",
"item",
"s",
"usage",
"by",
"setting",
"LRU",
"indexes",
"and",
"moves",
"the",
"LRU",
"pointer",
"if",
"needed",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/cache/LRUPersistentCache.js#L592-L602 | train | Updates the usage of an item | [
30522,
3853,
10651,
4221,
7606,
4270,
1006,
2969,
1010,
1051,
4221,
2213,
1007,
1063,
2065,
1006,
2969,
1012,
1035,
27425,
1012,
1035,
1035,
2011,
14839,
1035,
1035,
1031,
1051,
4221,
2213,
1012,
1051,
2850,
2696,
1012,
3145,
1033,
999,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/InlineColorEditor/ColorEditor.js | _getNewOffset | function _getNewOffset(pos, zeroPos, maxOffset) {
var offset = pos - zeroPos;
offset = Math.min(maxOffset, Math.max(0, offset));
return offset;
} | javascript | function _getNewOffset(pos, zeroPos, maxOffset) {
var offset = pos - zeroPos;
offset = Math.min(maxOffset, Math.max(0, offset));
return offset;
} | [
"function",
"_getNewOffset",
"(",
"pos",
",",
"zeroPos",
",",
"maxOffset",
")",
"{",
"var",
"offset",
"=",
"pos",
"-",
"zeroPos",
";",
"offset",
"=",
"Math",
".",
"min",
"(",
"maxOffset",
",",
"Math",
".",
"max",
"(",
"0",
",",
"offset",
")",
")",
... | Converts a mouse coordinate to be relative to zeroPos, and clips to [0, maxOffset] | [
"Converts",
"a",
"mouse",
"coordinate",
"to",
"be",
"relative",
"to",
"zeroPos",
"and",
"clips",
"to",
"[",
"0",
"maxOffset",
"]"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineColorEditor/ColorEditor.js#L545-L549 | train | Get new offset from pos | [
30522,
3853,
1035,
2131,
2638,
12155,
21807,
3388,
1006,
13433,
2015,
1010,
5717,
6873,
2015,
1010,
4098,
27475,
3388,
1007,
1063,
13075,
16396,
1027,
13433,
2015,
1011,
5717,
6873,
2015,
1025,
16396,
1027,
8785,
1012,
8117,
1006,
4098,
274... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js | _checkForDuplicateLabels | function _checkForDuplicateLabels(oInvisibleElement, aODataProperties) {
return aODataProperties.some(function(oDataProperty) {
return oDataProperty.fieldLabel === oInvisibleElement.fieldLabel;
});
} | javascript | function _checkForDuplicateLabels(oInvisibleElement, aODataProperties) {
return aODataProperties.some(function(oDataProperty) {
return oDataProperty.fieldLabel === oInvisibleElement.fieldLabel;
});
} | [
"function",
"_checkForDuplicateLabels",
"(",
"oInvisibleElement",
",",
"aODataProperties",
")",
"{",
"return",
"aODataProperties",
".",
"some",
"(",
"function",
"(",
"oDataProperty",
")",
"{",
"return",
"oDataProperty",
".",
"fieldLabel",
"===",
"oInvisibleElement",
"... | check for duplicate labels to later add the referenced complexTypeName if available | [
"check",
"for",
"duplicate",
"labels",
"to",
"later",
"add",
"the",
"referenced",
"complexTypeName",
"if",
"available"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js#L301-L305 | train | Check if the field label is already in the data | [
30522,
3853,
1035,
4638,
3877,
6279,
19341,
9834,
16336,
4877,
1006,
1051,
2378,
11365,
7028,
12260,
3672,
1010,
20118,
2850,
2696,
21572,
4842,
7368,
1007,
1063,
2709,
20118,
2850,
2696,
21572,
4842,
7368,
1012,
2070,
1006,
3853,
1006,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jhipster/generator-jhipster | generators/docker-prompts.js | askForApplicationType | function askForApplicationType() {
if (this.regenerate) return;
const done = this.async();
const prompts = [
{
type: 'list',
name: 'deploymentApplicationType',
message: 'Which *type* of application would you like to deploy?',
choices: [
... | javascript | function askForApplicationType() {
if (this.regenerate) return;
const done = this.async();
const prompts = [
{
type: 'list',
name: 'deploymentApplicationType',
message: 'Which *type* of application would you like to deploy?',
choices: [
... | [
"function",
"askForApplicationType",
"(",
")",
"{",
"if",
"(",
"this",
".",
"regenerate",
")",
"return",
";",
"const",
"done",
"=",
"this",
".",
"async",
"(",
")",
";",
"const",
"prompts",
"=",
"[",
"{",
"type",
":",
"'list'",
",",
"name",
":",
"'dep... | Ask For Application Type | [
"Ask",
"For",
"Application",
"Type"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/docker-prompts.js#L42-L70 | train | Ask For Application Type | [
30522,
3853,
3198,
29278,
29098,
19341,
3508,
13874,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
19723,
24454,
3686,
1007,
2709,
1025,
9530,
3367,
2589,
1027,
2023,
1012,
2004,
6038,
2278,
1006,
1007,
1025,
9530,
3367,
25732,
2015,
1027,
1031... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fex-team/webuploader | _draft/music/webuploader.js | Queue | function Queue() {
/**
* 统计文件数。
* * `numOfQueue` 队列中的文件数。
* * `numOfSuccess` 上传成功的文件数
* * `numOfCancel` 被移除的文件数
* * `numOfProgress` 正在上传中的文件数
* * `numOfUploadFailed` 上传错误的文件数。
* * `numOfInvalid` 无效的文件数。
... | javascript | function Queue() {
/**
* 统计文件数。
* * `numOfQueue` 队列中的文件数。
* * `numOfSuccess` 上传成功的文件数
* * `numOfCancel` 被移除的文件数
* * `numOfProgress` 正在上传中的文件数
* * `numOfUploadFailed` 上传错误的文件数。
* * `numOfInvalid` 无效的文件数。
... | [
"function",
"Queue",
"(",
")",
"{",
"/**\n * 统计文件数。\n * * `numOfQueue` 队列中的文件数。\n * * `numOfSuccess` 上传成功的文件数\n * * `numOfCancel` 被移除的文件数\n * * `numOfProgress` 正在上传中的文件数\n * * `numOfUploadFailed` 上传错误的文件数。\n * * `numOfInva... | 文件队列, 用来存储各个状态中的文件。
@class Queue
@extends Mediator | [
"文件队列",
"用来存储各个状态中的文件。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/_draft/music/webuploader.js#L2042-L2068 | train | Queue constructor. | [
30522,
3853,
24240,
1006,
1007,
1063,
1013,
1008,
1008,
1008,
100,
100,
1861,
100,
100,
1636,
1008,
1008,
1036,
16371,
5302,
2546,
4226,
5657,
1036,
100,
100,
1746,
1916,
1861,
100,
100,
1636,
1008,
1008,
1036,
16371,
5302,
10343,
14194,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TableSyncExtension.js | function(iIndex, bSelected) {
var oTable = this.getTable();
var oRow = oTable.getRows()[iIndex];
if (oRow && bSelected != null) {
TableUtils.toggleRowSelection(oTable, oRow.getIndex(), bSelected);
}
} | javascript | function(iIndex, bSelected) {
var oTable = this.getTable();
var oRow = oTable.getRows()[iIndex];
if (oRow && bSelected != null) {
TableUtils.toggleRowSelection(oTable, oRow.getIndex(), bSelected);
}
} | [
"function",
"(",
"iIndex",
",",
"bSelected",
")",
"{",
"var",
"oTable",
"=",
"this",
".",
"getTable",
"(",
")",
";",
"var",
"oRow",
"=",
"oTable",
".",
"getRows",
"(",
")",
"[",
"iIndex",
"]",
";",
"if",
"(",
"oRow",
"&&",
"bSelected",
"!=",
"null"... | Sets the selection state of a row.
@param {int} iIndex The index of the row in the aggregation.
@param {boolean} bSelected Whether the row should be selected. | [
"Sets",
"the",
"selection",
"state",
"of",
"a",
"row",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableSyncExtension.js#L20-L27 | train | Sets the selection state of a row. | [
30522,
3853,
1006,
2462,
13629,
2595,
1010,
18667,
12260,
10985,
1007,
1063,
13075,
27178,
3085,
1027,
2023,
1012,
2131,
10880,
1006,
1007,
1025,
13075,
20298,
2860,
1027,
27178,
3085,
1012,
2131,
10524,
2015,
1006,
1007,
1031,
2462,
13629,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/companion/src/server/controllers/s3.js | completeMultipartUpload | function completeMultipartUpload (req, res, next) {
// @ts-ignore The `uppy` property is added by middleware before reaching here.
const client = req.uppy.s3Client
const { uploadId } = req.params
const { key } = req.query
const { parts } = req.body
if (typeof key !== 'string') {
return re... | javascript | function completeMultipartUpload (req, res, next) {
// @ts-ignore The `uppy` property is added by middleware before reaching here.
const client = req.uppy.s3Client
const { uploadId } = req.params
const { key } = req.query
const { parts } = req.body
if (typeof key !== 'string') {
return re... | [
"function",
"completeMultipartUpload",
"(",
"req",
",",
"res",
",",
"next",
")",
"{",
"// @ts-ignore The `uppy` property is added by middleware before reaching here.",
"const",
"client",
"=",
"req",
".",
"uppy",
".",
"s3Client",
"const",
"{",
"uploadId",
"}",
"=",
"re... | Complete a multipart upload, combining all the parts into a single object in the S3 bucket.
Expected URL parameters:
- uploadId - The uploadId returned from `createMultipartUpload`.
Expected query parameters:
- key - The object key in the S3 bucket.
Expected JSON body:
- parts - An array of parts, see the `getUploaded... | [
"Complete",
"a",
"multipart",
"upload",
"combining",
"all",
"the",
"parts",
"into",
"a",
"single",
"object",
"in",
"the",
"S3",
"bucket",
"."
] | 7ae18bf992d544a64da998f033258ec09a3de275 | https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/packages/@uppy/companion/src/server/controllers/s3.js#L239-L269 | train | Complete a multipart upload | [
30522,
3853,
3143,
12274,
7096,
11514,
8445,
6279,
11066,
1006,
2128,
4160,
1010,
24501,
1010,
2279,
1007,
1063,
1013,
1013,
1030,
24529,
1011,
8568,
1996,
1036,
2039,
7685,
1036,
3200,
2003,
2794,
2011,
2690,
8059,
2077,
4285,
2182,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | blobify | function blobify(data) {
if(typeof data === "string") return s2ab(data);
if(Array.isArray(data)) return a2u(data);
return data;
} | javascript | function blobify(data) {
if(typeof data === "string") return s2ab(data);
if(Array.isArray(data)) return a2u(data);
return data;
} | [
"function",
"blobify",
"(",
"data",
")",
"{",
"if",
"(",
"typeof",
"data",
"===",
"\"string\"",
")",
"return",
"s2ab",
"(",
"data",
")",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"data",
")",
")",
"return",
"a2u",
"(",
"data",
")",
";",
"return... | /* normalize data for blob ctor | [
"/",
"*",
"normalize",
"data",
"for",
"blob",
"ctor"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L2582-L2586 | train | Convert a blob to a string array or array | [
30522,
3853,
1038,
4135,
5638,
12031,
1006,
2951,
1007,
1063,
2065,
1006,
2828,
11253,
2951,
1027,
1027,
1027,
1000,
5164,
1000,
1007,
2709,
1055,
2475,
7875,
1006,
2951,
1007,
1025,
2065,
1006,
9140,
1012,
18061,
11335,
2100,
1006,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Utils.js | function (oComponent, sParameterName, aValues) {
var oParsedHash = Utils.getParsedURLHash(sParameterName);
if (oParsedHash.params) {
hasher.changed.active = false; //disable changed signal
var mTechnicalParameters = Utils.getTechnicalParametersForComponent(oComponent);
// if mTechnicalParameter... | javascript | function (oComponent, sParameterName, aValues) {
var oParsedHash = Utils.getParsedURLHash(sParameterName);
if (oParsedHash.params) {
hasher.changed.active = false; //disable changed signal
var mTechnicalParameters = Utils.getTechnicalParametersForComponent(oComponent);
// if mTechnicalParameter... | [
"function",
"(",
"oComponent",
",",
"sParameterName",
",",
"aValues",
")",
"{",
"var",
"oParsedHash",
"=",
"Utils",
".",
"getParsedURLHash",
"(",
"sParameterName",
")",
";",
"if",
"(",
"oParsedHash",
".",
"params",
")",
"{",
"hasher",
".",
"changed",
".",
... | Sets the values for url hash and technical parameters for the component data.
Deactivates hash based navigation while performing the operations, which is then re-activated upon completion.
If the passed doesn't exist in the url hash or technical parameters, then a new object is added respectively.
@param {object} oCom... | [
"Sets",
"the",
"values",
"for",
"url",
"hash",
"and",
"technical",
"parameters",
"for",
"the",
"component",
"data",
".",
"Deactivates",
"hash",
"based",
"navigation",
"while",
"performing",
"the",
"operations",
"which",
"is",
"then",
"re",
"-",
"activated",
"u... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L910-L931 | train | Updates the technical parameters of the given component with the given values. | [
30522,
3853,
1006,
1051,
9006,
29513,
3372,
1010,
12403,
6444,
15141,
18442,
1010,
10927,
7630,
2229,
1007,
1063,
13075,
6728,
11650,
2098,
14949,
2232,
1027,
21183,
12146,
1012,
2131,
19362,
6924,
3126,
2140,
14949,
2232,
1006,
12403,
6444,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensibility/Package.js | validate | function validate(path, options) {
return _extensionManagerCall(function (extensionManager) {
var d = new $.Deferred();
// make sure proxy is attached to options before calling validate
// so npm can use it in the domain
options = options || {};
... | javascript | function validate(path, options) {
return _extensionManagerCall(function (extensionManager) {
var d = new $.Deferred();
// make sure proxy is attached to options before calling validate
// so npm can use it in the domain
options = options || {};
... | [
"function",
"validate",
"(",
"path",
",",
"options",
")",
"{",
"return",
"_extensionManagerCall",
"(",
"function",
"(",
"extensionManager",
")",
"{",
"var",
"d",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"// make sure proxy is attached to options before cal... | TODO: can this go away now that we never call it directly?
Validates the package at the given path. The actual validation is
handled by the Node server.
The promise is resolved with an object:
{ errors: Array.<{string}>, metadata: { name:string, version:string, ... } }
metadata is pulled straight from package.json an... | [
"TODO",
":",
"can",
"this",
"go",
"away",
"now",
"that",
"we",
"never",
"call",
"it",
"directly?"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/Package.js#L110-L132 | train | Validate the file | [
30522,
3853,
9398,
3686,
1006,
4130,
1010,
7047,
1007,
1063,
2709,
1035,
5331,
24805,
4590,
9289,
2140,
1006,
3853,
1006,
5331,
24805,
4590,
1007,
1063,
13075,
1040,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
1013,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
pagekit/vue-resource | dist/vue-resource.esm.js | nodeClient | function nodeClient (request) {
var client = require('got');
return new PromiseObj(function (resolve) {
var url = request.getUrl();
var body = request.getBody();
var method = request.method;
var headers = {}, handler;
request.headers.forEach(function (value, name) {
... | javascript | function nodeClient (request) {
var client = require('got');
return new PromiseObj(function (resolve) {
var url = request.getUrl();
var body = request.getBody();
var method = request.method;
var headers = {}, handler;
request.headers.forEach(function (value, name) {
... | [
"function",
"nodeClient",
"(",
"request",
")",
"{",
"var",
"client",
"=",
"require",
"(",
"'got'",
")",
";",
"return",
"new",
"PromiseObj",
"(",
"function",
"(",
"resolve",
")",
"{",
"var",
"url",
"=",
"request",
".",
"getUrl",
"(",
")",
";",
"var",
... | Http client (Node). | [
"Http",
"client",
"(",
"Node",
")",
"."
] | fe268fa1d6053ede5f34aef9a11e1a424a70446c | https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1090-L1120 | train | nodeClient - node - client | [
30522,
3853,
13045,
20464,
11638,
1006,
5227,
1007,
1063,
13075,
7396,
1027,
5478,
1006,
1005,
2288,
1005,
1007,
1025,
2709,
2047,
4872,
16429,
3501,
1006,
3853,
1006,
10663,
1007,
1063,
13075,
24471,
2140,
1027,
5227,
1012,
2131,
3126,
214... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/core/utils/get-selector.js | getBaseSelector | function getBaseSelector(elm) {
if (typeof isXHTML === 'undefined') {
isXHTML = axe.utils.isXHTML(document);
}
return escapeSelector(isXHTML ? elm.localName : elm.nodeName.toLowerCase());
} | javascript | function getBaseSelector(elm) {
if (typeof isXHTML === 'undefined') {
isXHTML = axe.utils.isXHTML(document);
}
return escapeSelector(isXHTML ? elm.localName : elm.nodeName.toLowerCase());
} | [
"function",
"getBaseSelector",
"(",
"elm",
")",
"{",
"if",
"(",
"typeof",
"isXHTML",
"===",
"'undefined'",
")",
"{",
"isXHTML",
"=",
"axe",
".",
"utils",
".",
"isXHTML",
"(",
"document",
")",
";",
"}",
"return",
"escapeSelector",
"(",
"isXHTML",
"?",
"el... | Return the base CSS selector for a given element
@param {HTMLElement} elm The element to get the selector for
@return {String|Array<String>} Base CSS selector for the node | [
"Return",
"the",
"base",
"CSS",
"selector",
"for",
"a",
"given",
"element"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/get-selector.js#L222-L227 | train | Returns the base selector for the given element | [
30522,
3853,
2131,
15058,
11246,
22471,
2953,
1006,
17709,
1007,
1063,
2065,
1006,
2828,
11253,
2003,
2595,
11039,
19968,
1027,
1027,
1027,
1005,
6151,
28344,
1005,
1007,
1063,
2003,
2595,
11039,
19968,
1027,
12946,
1012,
21183,
12146,
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.uxap/src/sap/uxap/component/Component.js | function () {
if (this._oView) {
this._oView.destroy();
this._oView = null;
}
if (this._oModel) {
this._oModel.destroy();
this._oModel = null;
}
if (UIComponent.prototype.destroy) {
UIComponent.prototype.destroy.call(this);
}
} | javascript | function () {
if (this._oView) {
this._oView.destroy();
this._oView = null;
}
if (this._oModel) {
this._oModel.destroy();
this._oModel = null;
}
if (UIComponent.prototype.destroy) {
UIComponent.prototype.destroy.call(this);
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_oView",
")",
"{",
"this",
".",
"_oView",
".",
"destroy",
"(",
")",
";",
"this",
".",
"_oView",
"=",
"null",
";",
"}",
"if",
"(",
"this",
".",
"_oModel",
")",
"{",
"this",
".",
"_oModel",
".",... | destroy the view and model before exiting | [
"destroy",
"the",
"view",
"and",
"model",
"before",
"exiting"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.uxap/src/sap/uxap/component/Component.js#L106-L120 | train | Destroys the view model and UI elements | [
30522,
3853,
1006,
1007,
30524,
2023,
1012,
1035,
1051,
8584,
1027,
19701,
1025,
1065,
2065,
1006,
2023,
1012,
1035,
18168,
10244,
2140,
1007,
1063,
2023,
1012,
1035,
18168,
10244,
2140,
1012,
6033,
1006,
1007,
1025,
2023,
1012,
1035,
18168... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
elastic/elasticsearch-js | api/api/search_template.js | buildSearchTemplate | function buildSearchTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [search_template](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request
*
* @param {list} in... | javascript | function buildSearchTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [search_template](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request
*
* @param {list} in... | [
"function",
"buildSearchTemplate",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [search_template](http://www.elastic.... | /* eslint camelcase: 0 /* eslint no-unused-vars: 0 | [
"/",
"*",
"eslint",
"camelcase",
":",
"0",
"/",
"*",
"eslint",
"no",
"-",
"unused",
"-",
"vars",
":",
"0"
] | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/api/search_template.js#L25-L147 | train | Build a search template | [
30522,
3853,
16473,
14644,
10143,
6633,
15725,
1006,
23569,
2015,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2279,
1011,
2240,
2053,
1011,
15171,
1011,
13075,
2015,
9530,
3367,
1063,
9338,
2063,
15500,
1010,
9563,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/LocaleData.js | getData | function getData(oLocale) {
var sLanguage = oLocale.getLanguage() || "",
sScript = oLocale.getScript() || "",
sRegion = oLocale.getRegion() || "",
mData;
/*
* Merge a CLDR delta file and a CLDR fallback file.
*
* Note: the contract of this method reg. null values differs from both,
* jQuery.e... | javascript | function getData(oLocale) {
var sLanguage = oLocale.getLanguage() || "",
sScript = oLocale.getScript() || "",
sRegion = oLocale.getRegion() || "",
mData;
/*
* Merge a CLDR delta file and a CLDR fallback file.
*
* Note: the contract of this method reg. null values differs from both,
* jQuery.e... | [
"function",
"getData",
"(",
"oLocale",
")",
"{",
"var",
"sLanguage",
"=",
"oLocale",
".",
"getLanguage",
"(",
")",
"||",
"\"\"",
",",
"sScript",
"=",
"oLocale",
".",
"getScript",
"(",
")",
"||",
"\"\"",
",",
"sRegion",
"=",
"oLocale",
".",
"getRegion",
... | Load LocaleData data from the CLDR generated files. | [
"Load",
"LocaleData",
"data",
"from",
"the",
"CLDR",
"generated",
"files",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L3200-L3293 | train | Get the data for a locale | [
30522,
3853,
2131,
2850,
2696,
1006,
19330,
24755,
2571,
1007,
1063,
13075,
21435,
6692,
3351,
1027,
19330,
24755,
2571,
1012,
2131,
25023,
6692,
3351,
1006,
1007,
1064,
1064,
1000,
1000,
1010,
7020,
30524,
3258,
1027,
19330,
24755,
2571,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/main.js | _togglePref | function _togglePref(key, value) {
var val,
oldPref = !!prefs.get(key);
if (value === undefined) {
val = !oldPref;
} else {
val = !!value;
}
// update menu
if (val !== oldPref) {
prefs.set(key, val);
}
ret... | javascript | function _togglePref(key, value) {
var val,
oldPref = !!prefs.get(key);
if (value === undefined) {
val = !oldPref;
} else {
val = !!value;
}
// update menu
if (val !== oldPref) {
prefs.set(key, val);
}
ret... | [
"function",
"_togglePref",
"(",
"key",
",",
"value",
")",
"{",
"var",
"val",
",",
"oldPref",
"=",
"!",
"!",
"prefs",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"===",
"undefined",
")",
"{",
"val",
"=",
"!",
"oldPref",
";",
"}",
"else",... | Toggles or sets the preference * | [
"Toggles",
"or",
"sets",
"the",
"preference",
"*"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L108-L124 | train | Toggles the preference of a key | [
30522,
3853,
1035,
2000,
24679,
28139,
2546,
1006,
3145,
1010,
3643,
1007,
1063,
13075,
11748,
1010,
2214,
28139,
2546,
1027,
999,
999,
3653,
10343,
1012,
2131,
1006,
3145,
1007,
1025,
2065,
1006,
3643,
1027,
1027,
1027,
6151,
28344,
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... |
fex-team/webuploader | _draft/music/webuploader.js | Image | function Image( opts ) {
this.options = $.extend({}, Image.options, opts );
RuntimeClient.call( this, 'Image' );
this.on( 'load', function() {
this._info = this.exec('info');
this._meta = this.exec('meta');
});
} | javascript | function Image( opts ) {
this.options = $.extend({}, Image.options, opts );
RuntimeClient.call( this, 'Image' );
this.on( 'load', function() {
this._info = this.exec('info');
this._meta = this.exec('meta');
});
} | [
"function",
"Image",
"(",
"opts",
")",
"{",
"this",
".",
"options",
"=",
"$",
".",
"extend",
"(",
"{",
"}",
",",
"Image",
".",
"options",
",",
"opts",
")",
";",
"RuntimeClient",
".",
"call",
"(",
"this",
",",
"'Image'",
")",
";",
"this",
".",
"on... | 构造器。 | [
"构造器。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/_draft/music/webuploader.js#L1811-L1819 | train | Image constructor. | [
30522,
3853,
3746,
1006,
23569,
2015,
1007,
1063,
2023,
1012,
7047,
1027,
1002,
1012,
7949,
1006,
1063,
1065,
1010,
3746,
1012,
7047,
1010,
23569,
2015,
1007,
1025,
2448,
7292,
20464,
11638,
1012,
2655,
1006,
2023,
1010,
1005,
3746,
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... |
aframevr/aframe | src/core/a-assets.js | setCrossOrigin | function setCrossOrigin (mediaEl) {
var newMediaEl;
var src;
// Already has crossorigin set.
if (mediaEl.hasAttribute('crossorigin')) { return mediaEl; }
src = mediaEl.getAttribute('src');
if (src !== null) {
// Does not have protocol.
if (src.indexOf('://') === -1) { return mediaEl; }
// De... | javascript | function setCrossOrigin (mediaEl) {
var newMediaEl;
var src;
// Already has crossorigin set.
if (mediaEl.hasAttribute('crossorigin')) { return mediaEl; }
src = mediaEl.getAttribute('src');
if (src !== null) {
// Does not have protocol.
if (src.indexOf('://') === -1) { return mediaEl; }
// De... | [
"function",
"setCrossOrigin",
"(",
"mediaEl",
")",
"{",
"var",
"newMediaEl",
";",
"var",
"src",
";",
"// Already has crossorigin set.",
"if",
"(",
"mediaEl",
".",
"hasAttribute",
"(",
"'crossorigin'",
")",
")",
"{",
"return",
"mediaEl",
";",
"}",
"src",
"=",
... | Automatically set `crossorigin` if not defined on the media element.
If it is not defined, we must create and re-append a new media element <img> and
have the browser re-request it with `crossorigin` set.
@param {Element} Media element (e.g., <img>, <audio>, <video>).
@returns {Element} Media element to be used to lis... | [
"Automatically",
"set",
"crossorigin",
"if",
"not",
"defined",
"on",
"the",
"media",
"element",
".",
"If",
"it",
"is",
"not",
"defined",
"we",
"must",
"create",
"and",
"re",
"-",
"append",
"a",
"new",
"media",
"element",
"<img",
">",
"and",
"have",
"the"... | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/a-assets.js#L205-L228 | train | Sets cross - origin attribute on the media element. | [
30522,
3853,
2275,
16458,
10050,
11528,
1006,
2865,
2884,
1007,
1063,
13075,
2047,
16969,
2884,
1025,
13075,
5034,
2278,
1025,
1013,
1013,
2525,
2038,
2892,
10050,
11528,
2275,
1012,
2065,
1006,
2865,
2884,
1012,
2038,
19321,
3089,
8569,
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... |
SheetJS/js-xlsx | xlsx.js | read_wb_ID | function read_wb_ID(d, opts) {
var o = opts || {}, OLD_WTF = !!o.WTF; o.WTF = true;
try {
var out = SYLK.to_workbook(d, o);
o.WTF = OLD_WTF;
return out;
} catch(e) {
o.WTF = OLD_WTF;
if(!e.message.match(/SYLK bad record ID/) && OLD_WTF) throw e;
return PRN.to_workbook(d, opts);
}
} | javascript | function read_wb_ID(d, opts) {
var o = opts || {}, OLD_WTF = !!o.WTF; o.WTF = true;
try {
var out = SYLK.to_workbook(d, o);
o.WTF = OLD_WTF;
return out;
} catch(e) {
o.WTF = OLD_WTF;
if(!e.message.match(/SYLK bad record ID/) && OLD_WTF) throw e;
return PRN.to_workbook(d, opts);
}
} | [
"function",
"read_wb_ID",
"(",
"d",
",",
"opts",
")",
"{",
"var",
"o",
"=",
"opts",
"||",
"{",
"}",
",",
"OLD_WTF",
"=",
"!",
"!",
"o",
".",
"WTF",
";",
"o",
".",
"WTF",
"=",
"true",
";",
"try",
"{",
"var",
"out",
"=",
"SYLK",
".",
"to_workbo... | /* Excel defaults to SYLK but warns if data is not valid | [
"/",
"*",
"Excel",
"defaults",
"to",
"SYLK",
"but",
"warns",
"if",
"data",
"is",
"not",
"valid"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L7505-L7516 | train | read_wb_ID - read the WBID from the file | [
30522,
3853,
3191,
1035,
25610,
1035,
8909,
1006,
1040,
1010,
30524,
1010,
2214,
1035,
1059,
24475,
1027,
999,
999,
1051,
1012,
1059,
24475,
1025,
1051,
1012,
1059,
24475,
1027,
2995,
1025,
3046,
1063,
13075,
2041,
1027,
25353,
13687,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | realloc | function realloc(b, sz) {
var L = b.length, M = 2*L > sz ? 2*L : sz + 5, i = 0;
if(L >= sz) return b;
if(has_buf) {
var o = new_unsafe_buf(M);
// $FlowIgnore
if(b.copy) b.copy(o);
else for(; i < b.length; ++i) o[i] = b[i];
return o;
} else if(use_typed_arrays) {
var a = new Uint8Array(M);
if(a.set) a.... | javascript | function realloc(b, sz) {
var L = b.length, M = 2*L > sz ? 2*L : sz + 5, i = 0;
if(L >= sz) return b;
if(has_buf) {
var o = new_unsafe_buf(M);
// $FlowIgnore
if(b.copy) b.copy(o);
else for(; i < b.length; ++i) o[i] = b[i];
return o;
} else if(use_typed_arrays) {
var a = new Uint8Array(M);
if(a.set) a.... | [
"function",
"realloc",
"(",
"b",
",",
"sz",
")",
"{",
"var",
"L",
"=",
"b",
".",
"length",
",",
"M",
"=",
"2",
"*",
"L",
">",
"sz",
"?",
"2",
"*",
"L",
":",
"sz",
"+",
"5",
",",
"i",
"=",
"0",
";",
"if",
"(",
"L",
">=",
"sz",
")",
"re... | /* until ArrayBuffer#realloc is a thing, fake a realloc | [
"/",
"*",
"until",
"ArrayBuffer#realloc",
"is",
"a",
"thing",
"fake",
"a",
"realloc"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L2019-L2036 | train | realloc - allocates a buffer of size sz | [
30522,
3853,
2613,
4135,
2278,
1006,
1038,
1010,
1055,
2480,
1007,
1063,
13075,
1048,
1027,
1038,
1012,
3091,
1010,
1049,
1027,
1016,
1008,
1048,
1028,
1055,
2480,
1029,
1016,
1008,
1048,
1024,
1055,
2480,
1009,
1019,
1010,
1045,
1027,
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.demokit/src/sap/ui/demokit/explored/view/entity.controller.js | function () {
this.router = UIComponent.getRouterFor(this);
this.router.attachRoutePatternMatched(this.onRouteMatched, this);
this._component = Component.getOwnerComponentFor(this.getView());
// click handler for @link tags in JSdoc fragments
this.getView().attachBrowserEvent("click", this.onJSDocLinkCli... | javascript | function () {
this.router = UIComponent.getRouterFor(this);
this.router.attachRoutePatternMatched(this.onRouteMatched, this);
this._component = Component.getOwnerComponentFor(this.getView());
// click handler for @link tags in JSdoc fragments
this.getView().attachBrowserEvent("click", this.onJSDocLinkCli... | [
"function",
"(",
")",
"{",
"this",
".",
"router",
"=",
"UIComponent",
".",
"getRouterFor",
"(",
"this",
")",
";",
"this",
".",
"router",
".",
"attachRoutePatternMatched",
"(",
"this",
".",
"onRouteMatched",
",",
"this",
")",
";",
"this",
".",
"_component",... | ====== event handling ==================================================================== | [
"======",
"event",
"handling",
"===================================================================="
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/explored/view/entity.controller.js#L32-L42 | train | Attaches event listeners to the view | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
2799,
2099,
1027,
21318,
9006,
29513,
3372,
1012,
2131,
22494,
3334,
29278,
1006,
2023,
1007,
1025,
2023,
1012,
2799,
2099,
1012,
22476,
22494,
2618,
4502,
12079,
2078,
18900,
7690,
1006,
2023,
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.ux3/src/sap/ui/ux3/NotificationBarRenderer.js | function(oRm, oMessageNotifier, oNotiBar) {
if (oMessageNotifier.hasItems()) {
var aMessages = oMessageNotifier.getMessages();
var lastItem = aMessages[aMessages.length - 1];
var oMA = oMessageNotifier._oMessageArea;
// this ensures that this message is selectable from the bar
oMA._message = las... | javascript | function(oRm, oMessageNotifier, oNotiBar) {
if (oMessageNotifier.hasItems()) {
var aMessages = oMessageNotifier.getMessages();
var lastItem = aMessages[aMessages.length - 1];
var oMA = oMessageNotifier._oMessageArea;
// this ensures that this message is selectable from the bar
oMA._message = las... | [
"function",
"(",
"oRm",
",",
"oMessageNotifier",
",",
"oNotiBar",
")",
"{",
"if",
"(",
"oMessageNotifier",
".",
"hasItems",
"(",
")",
")",
"{",
"var",
"aMessages",
"=",
"oMessageNotifier",
".",
"getMessages",
"(",
")",
";",
"var",
"lastItem",
"=",
"aMessag... | Renders the message area next to a message notifier | [
"Renders",
"the",
"message",
"area",
"next",
"to",
"a",
"message",
"notifier"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/NotificationBarRenderer.js#L466-L520 | train | Renders the message area | [
30522,
3853,
1006,
2030,
2213,
1010,
18168,
7971,
4270,
17048,
18095,
1010,
21058,
3775,
8237,
1007,
1063,
2065,
1006,
18168,
7971,
4270,
17048,
18095,
1012,
2038,
4221,
5244,
1006,
1007,
1007,
1063,
13075,
19900,
3736,
8449,
1027,
18168,
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... | |
openlayers/openlayers | examples/wms-custom-proj.js | CHtoWGSlng | function CHtoWGSlng(y, x) {
// Converts militar to civil and to unit = 1000km
// Axiliary values (% Bern)
const y_aux = (y - 600000) / 1000000;
const x_aux = (x - 200000) / 1000000;
// Process long
let lng = 2.6779094 +
4.728982 * y_aux +
0.791484 * y_aux * x_aux +
0.1306 * y_aux * Math... | javascript | function CHtoWGSlng(y, x) {
// Converts militar to civil and to unit = 1000km
// Axiliary values (% Bern)
const y_aux = (y - 600000) / 1000000;
const x_aux = (x - 200000) / 1000000;
// Process long
let lng = 2.6779094 +
4.728982 * y_aux +
0.791484 * y_aux * x_aux +
0.1306 * y_aux * Math... | [
"function",
"CHtoWGSlng",
"(",
"y",
",",
"x",
")",
"{",
"// Converts militar to civil and to unit = 1000km",
"// Axiliary values (% Bern)",
"const",
"y_aux",
"=",
"(",
"y",
"-",
"600000",
")",
"/",
"1000000",
";",
"const",
"x_aux",
"=",
"(",
"x",
"-",
"200000",... | Convert CH y/x to WGS long | [
"Convert",
"CH",
"y",
"/",
"x",
"to",
"WGS",
"long"
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/wms-custom-proj.js#L170-L189 | train | Convert CH to WGS lng | [
30522,
3853,
10381,
18790,
5620,
19666,
2290,
1006,
1061,
1010,
1060,
1007,
1063,
1013,
1013,
19884,
23689,
6590,
2099,
2000,
2942,
1998,
2000,
3131,
1027,
6694,
22287,
1013,
1013,
22260,
27861,
2854,
5300,
1006,
1003,
16595,
1007,
9530,
33... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/lines-around-comment.js | isParentNodeType | function isParentNodeType(parent, nodeType) {
return parent.type === nodeType ||
(parent.body && parent.body.type === nodeType) ||
(parent.consequent && parent.consequent.type === nodeType);
} | javascript | function isParentNodeType(parent, nodeType) {
return parent.type === nodeType ||
(parent.body && parent.body.type === nodeType) ||
(parent.consequent && parent.consequent.type === nodeType);
} | [
"function",
"isParentNodeType",
"(",
"parent",
",",
"nodeType",
")",
"{",
"return",
"parent",
".",
"type",
"===",
"nodeType",
"||",
"(",
"parent",
".",
"body",
"&&",
"parent",
".",
"body",
".",
"type",
"===",
"nodeType",
")",
"||",
"(",
"parent",
".",
... | Returns whether or not comments are inside a node type or not.
@param {ASTNode} parent The Comment parent node.
@param {string} nodeType The parent type to check against.
@returns {boolean} True if the comment is inside nodeType. | [
"Returns",
"whether",
"or",
"not",
"comments",
"are",
"inside",
"a",
"node",
"type",
"or",
"not",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/lines-around-comment.js#L181-L185 | train | Check if parent node type is the same as nodeType | [
30522,
3853,
2003,
19362,
4765,
3630,
3207,
13874,
1006,
6687,
1010,
13045,
13874,
1007,
1063,
2709,
6687,
1012,
2828,
1027,
1027,
1027,
13045,
13874,
1064,
1064,
1006,
6687,
1012,
2303,
1004,
1004,
6687,
1012,
2303,
1012,
2828,
1027,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(method, restoreScrollPosition) {
var body = this.doc.body,
oldScrollTop = restoreScrollPosition && body.scrollTop,
oldScrollLeft = restoreScrollPosition && body.scrollLeft,
className = "_wysihtml5-temp-placeholder",
pla... | javascript | function(method, restoreScrollPosition) {
var body = this.doc.body,
oldScrollTop = restoreScrollPosition && body.scrollTop,
oldScrollLeft = restoreScrollPosition && body.scrollLeft,
className = "_wysihtml5-temp-placeholder",
pla... | [
"function",
"(",
"method",
",",
"restoreScrollPosition",
")",
"{",
"var",
"body",
"=",
"this",
".",
"doc",
".",
"body",
",",
"oldScrollTop",
"=",
"restoreScrollPosition",
"&&",
"body",
".",
"scrollTop",
",",
"oldScrollLeft",
"=",
"restoreScrollPosition",
"&&",
... | TODO: has problems in chrome 12. investigate block level and uneditable area inbetween | [
"TODO",
":",
"has",
"problems",
"in",
"chrome",
"12",
".",
"investigate",
"block",
"level",
"and",
"uneditable",
"area",
"inbetween"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L9068-L9146 | train | Executes a method on the selection. | [
30522,
3853,
1006,
4118,
1010,
9239,
11020,
28402,
26994,
1007,
1063,
13075,
2303,
1027,
2023,
1012,
9986,
1012,
2303,
1010,
19457,
26775,
14511,
14399,
1027,
9239,
11020,
28402,
26994,
1004,
1004,
2303,
1012,
17186,
14399,
1010,
19457,
26775... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/promise.js | filter | async function filter(array, fn, self = undefined) {
const v = await Promise.resolve(array);
if (!Array.isArray(v)) {
throw TypeError('not an array');
}
const arr = /** @type {!Array} */(v);
const n = arr.length;
const values = [];
let valuesLength = 0;
for (let i = 0; i < n; i++) {
if (i in a... | javascript | async function filter(array, fn, self = undefined) {
const v = await Promise.resolve(array);
if (!Array.isArray(v)) {
throw TypeError('not an array');
}
const arr = /** @type {!Array} */(v);
const n = arr.length;
const values = [];
let valuesLength = 0;
for (let i = 0; i < n; i++) {
if (i in a... | [
"async",
"function",
"filter",
"(",
"array",
",",
"fn",
",",
"self",
"=",
"undefined",
")",
"{",
"const",
"v",
"=",
"await",
"Promise",
".",
"resolve",
"(",
"array",
")",
";",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"v",
")",
")",
"{",
"thr... | Calls a function for each element in an array, and if the function returns
true adds the element to a new array.
If the return value of the filter function is a promise, this function
will wait for it to be fulfilled before determining whether to insert the
element into the new array.
If the filter function throws or... | [
"Calls",
"a",
"function",
"for",
"each",
"element",
"in",
"an",
"array",
"and",
"if",
"the",
"function",
"returns",
"true",
"adds",
"the",
"element",
"to",
"a",
"new",
"array",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/lib/promise.js#L193-L214 | train | filter function for array | [
30522,
2004,
6038,
2278,
3853,
11307,
1006,
9140,
1010,
1042,
2078,
1010,
2969,
1027,
6151,
28344,
1007,
1063,
9530,
3367,
1058,
1027,
26751,
4872,
1012,
10663,
30524,
1008,
1030,
2828,
1063,
999,
9140,
1065,
1008,
1013,
1006,
1058,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.f/src/sap/f/shellBar/ResponsiveHandler.js | function (oContext) {
oControl = oContext;
// Get and calculate padding's
this._iREMSize = parseInt(jQuery("body").css("font-size"));
this._iChildControlMargin = parseInt(Parameters.get("_sap_f_ShellBar_ChildMargin"));
this._iDoubleChildControlMargin = this._iChildControlMargin * 2;
this._iCoPilotWidth = p... | javascript | function (oContext) {
oControl = oContext;
// Get and calculate padding's
this._iREMSize = parseInt(jQuery("body").css("font-size"));
this._iChildControlMargin = parseInt(Parameters.get("_sap_f_ShellBar_ChildMargin"));
this._iDoubleChildControlMargin = this._iChildControlMargin * 2;
this._iCoPilotWidth = p... | [
"function",
"(",
"oContext",
")",
"{",
"oControl",
"=",
"oContext",
";",
"// Get and calculate padding's",
"this",
".",
"_iREMSize",
"=",
"parseInt",
"(",
"jQuery",
"(",
"\"body\"",
")",
".",
"css",
"(",
"\"font-size\"",
")",
")",
";",
"this",
".",
"_iChildC... | Class taking care of the control responsive behaviour.
@alias sap/f/shellBar/ResponsiveHandler
@since 1.63
@private
@property {object} oContext the context of the ShellBar control instance | [
"Class",
"taking",
"care",
"of",
"the",
"control",
"responsive",
"behaviour",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.f/src/sap/f/shellBar/ResponsiveHandler.js#L29-L53 | train | Initializes the ShellBar | [
30522,
3853,
1006,
1051,
8663,
18209,
1007,
1063,
1051,
8663,
13181,
2140,
1027,
1051,
8663,
18209,
1025,
1013,
1013,
2131,
1998,
18422,
11687,
4667,
1005,
1055,
2023,
1012,
1035,
20868,
6633,
5332,
4371,
1027,
11968,
20240,
3372,
1006,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/dq-element.js | truncate | function truncate(str, maxLength) {
maxLength = maxLength || 300;
if (str.length > maxLength) {
var index = str.indexOf('>');
str = str.substring(0, index + 1);
}
return str;
} | javascript | function truncate(str, maxLength) {
maxLength = maxLength || 300;
if (str.length > maxLength) {
var index = str.indexOf('>');
str = str.substring(0, index + 1);
}
return str;
} | [
"function",
"truncate",
"(",
"str",
",",
"maxLength",
")",
"{",
"maxLength",
"=",
"maxLength",
"||",
"300",
";",
"if",
"(",
"str",
".",
"length",
">",
"maxLength",
")",
"{",
"var",
"index",
"=",
"str",
".",
"indexOf",
"(",
"'>'",
")",
";",
"str",
"... | /*exported DqElement | [
"/",
"*",
"exported",
"DqElement"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/dq-element.js#L3-L12 | train | Truncate a string to a specified length | [
30522,
3853,
19817,
4609,
16280,
1006,
2358,
2099,
1010,
4098,
7770,
13512,
2232,
1007,
1063,
4098,
7770,
13512,
2232,
1027,
4098,
7770,
13512,
2232,
1064,
1064,
3998,
1025,
2065,
1006,
2358,
2099,
1012,
3091,
1028,
4098,
7770,
13512,
2232,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/FileTreeViewModel.js | _filePathToObjectPath | function _filePathToObjectPath(treeData, path) {
if (path === null) {
return null;
} else if (path === "") {
return [];
}
var parts = path.split("/"),
part = parts.shift(),
result = [],
node;
// Step through the parts ... | javascript | function _filePathToObjectPath(treeData, path) {
if (path === null) {
return null;
} else if (path === "") {
return [];
}
var parts = path.split("/"),
part = parts.shift(),
result = [],
node;
// Step through the parts ... | [
"function",
"_filePathToObjectPath",
"(",
"treeData",
",",
"path",
")",
"{",
"if",
"(",
"path",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"path",
"===",
"\"\"",
")",
"{",
"return",
"[",
"]",
";",
"}",
"var",
"parts",
"... | @private
Converts a project-relative file path into an object path array suitable for
`Immutable.Map.getIn` and `Immutable.Map.updateIn`.
The root path is "".
@param {Immutable.Map} treeData
@param {string} path project relative path to the file or directory. Can include trailing slash.
@return {Array.<string>|null}... | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeViewModel.js#L172-L216 | train | Get the object of the given path | [
30522,
3853,
1035,
5371,
15069,
3406,
16429,
20614,
15069,
1006,
3392,
2850,
2696,
1010,
4130,
1007,
1063,
2065,
1006,
4130,
1027,
1027,
1027,
19701,
1007,
1063,
2709,
19701,
1025,
1065,
2842,
2065,
1006,
4130,
1027,
1027,
1027,
1000,
1000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/angular | tools/gulp-tasks/cldr/extract.js | getCurrencySettings | function getCurrencySettings(locale, localeData) {
const currencyInfo = localeData.main(`numbers/currencies`);
let currentCurrency = '';
// find the currency currently used in this country
const currencies =
localeData.get(`supplemental/currencyData/region/${localeData.attributes.territory}`) ||
locale... | javascript | function getCurrencySettings(locale, localeData) {
const currencyInfo = localeData.main(`numbers/currencies`);
let currentCurrency = '';
// find the currency currently used in this country
const currencies =
localeData.get(`supplemental/currencyData/region/${localeData.attributes.territory}`) ||
locale... | [
"function",
"getCurrencySettings",
"(",
"locale",
",",
"localeData",
")",
"{",
"const",
"currencyInfo",
"=",
"localeData",
".",
"main",
"(",
"`",
"`",
")",
";",
"let",
"currentCurrency",
"=",
"''",
";",
"// find the currency currently used in this country",
"const",... | Returns the currency symbol and name for a locale
@returns [ symbol, name ] | [
"Returns",
"the",
"currency",
"symbol",
"and",
"name",
"for",
"a",
"locale"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/gulp-tasks/cldr/extract.js#L465-L496 | train | Get currency settings for a locale | [
30522,
3853,
2131,
10841,
14343,
9407,
21678,
8613,
1006,
2334,
2063,
1010,
2334,
11960,
2696,
1007,
1063,
9530,
3367,
9598,
2378,
14876,
1027,
2334,
11960,
2696,
1012,
2364,
1006,
1036,
3616,
1013,
12731,
14343,
14767,
1036,
1007,
1025,
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/LiveDevelopment/LiveDevMultiBrowser.js | _onDocumentSaved | function _onDocumentSaved(event, doc) {
if (!isActive() || !_server) {
return;
}
var absolutePath = doc.file.fullPath,
liveDocument = absolutePath && _server.get(absolutePath),
liveEditingEnabled = liveDocument && liveDocument.isLiv... | javascript | function _onDocumentSaved(event, doc) {
if (!isActive() || !_server) {
return;
}
var absolutePath = doc.file.fullPath,
liveDocument = absolutePath && _server.get(absolutePath),
liveEditingEnabled = liveDocument && liveDocument.isLiv... | [
"function",
"_onDocumentSaved",
"(",
"event",
",",
"doc",
")",
"{",
"if",
"(",
"!",
"isActive",
"(",
")",
"||",
"!",
"_server",
")",
"{",
"return",
";",
"}",
"var",
"absolutePath",
"=",
"doc",
".",
"file",
".",
"fullPath",
",",
"liveDocument",
"=",
"... | For files that don't support as-you-type live editing, but are loaded by live HTML documents
(e.g. JS files), we want to reload the full document when they're saved.
@param {$.Event} event
@param {Document} doc | [
"For",
"files",
"that",
"don",
"t",
"support",
"as",
"-",
"you",
"-",
"type",
"live",
"editing",
"but",
"are",
"loaded",
"by",
"live",
"HTML",
"documents",
"(",
"e",
".",
"g",
".",
"JS",
"files",
")",
"we",
"want",
"to",
"reload",
"the",
"full",
"d... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L725-L747 | train | The event handler for the document saved event | [
30522,
3853,
1035,
2006,
3527,
24894,
11187,
10696,
2094,
1006,
2724,
1010,
9986,
1007,
1063,
2065,
1006,
999,
18061,
15277,
1006,
1007,
1064,
1064,
999,
1035,
8241,
1007,
1063,
2709,
1025,
1065,
13075,
7619,
15069,
1027,
9986,
1012,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
react-spring/react-spring | src/renderprops/animated/AnimatedValue.js | findAnimatedStyles | function findAnimatedStyles(node, styles) {
if (typeof node.update === 'function') styles.add(node)
else node.getChildren().forEach(child => findAnimatedStyles(child, styles))
} | javascript | function findAnimatedStyles(node, styles) {
if (typeof node.update === 'function') styles.add(node)
else node.getChildren().forEach(child => findAnimatedStyles(child, styles))
} | [
"function",
"findAnimatedStyles",
"(",
"node",
",",
"styles",
")",
"{",
"if",
"(",
"typeof",
"node",
".",
"update",
"===",
"'function'",
")",
"styles",
".",
"add",
"(",
"node",
")",
"else",
"node",
".",
"getChildren",
"(",
")",
".",
"forEach",
"(",
"ch... | Animated works by building a directed acyclic graph of dependencies
transparently when you render your Animated components.
new Animated.Value(0)
.interpolate() .interpolate() new Animated.Value(1)
opacity translateY scale
style transform
View#234 ... | [
"Animated",
"works",
"by",
"building",
"a",
"directed",
"acyclic",
"graph",
"of",
"dependencies",
"transparently",
"when",
"you",
"render",
"your",
"Animated",
"components",
"."
] | 807a1bb14822c97212fe54082ea5a675de499020 | https://github.com/react-spring/react-spring/blob/807a1bb14822c97212fe54082ea5a675de499020/src/renderprops/animated/AnimatedValue.js#L27-L30 | train | Recursively find animated styles for a node | [
30522,
3853,
2424,
7088,
8585,
5104,
27983,
2015,
1006,
13045,
1010,
6782,
1007,
1063,
2065,
1006,
2828,
11253,
13045,
1012,
10651,
1027,
1027,
1027,
1005,
3853,
1005,
1007,
6782,
1012,
5587,
1006,
13045,
1007,
2842,
13045,
1012,
2131,
1933... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/checks/navigation/region.js | findRegionlessElms | function findRegionlessElms(virtualNode) {
const node = virtualNode.actualNode;
// End recursion if the element is a landmark, skiplink, or hidden content
if (
isRegion(virtualNode) ||
(dom.isSkipLink(virtualNode.actualNode) &&
dom.getElementByReference(virtualNode.actualNode, 'href')) ||
!dom.isVisible(nod... | javascript | function findRegionlessElms(virtualNode) {
const node = virtualNode.actualNode;
// End recursion if the element is a landmark, skiplink, or hidden content
if (
isRegion(virtualNode) ||
(dom.isSkipLink(virtualNode.actualNode) &&
dom.getElementByReference(virtualNode.actualNode, 'href')) ||
!dom.isVisible(nod... | [
"function",
"findRegionlessElms",
"(",
"virtualNode",
")",
"{",
"const",
"node",
"=",
"virtualNode",
".",
"actualNode",
";",
"// End recursion if the element is a landmark, skiplink, or hidden content",
"if",
"(",
"isRegion",
"(",
"virtualNode",
")",
"||",
"(",
"dom",
"... | Find all visible elements not wrapped inside a landmark or skiplink | [
"Find",
"all",
"visible",
"elements",
"not",
"wrapped",
"inside",
"a",
"landmark",
"or",
"skiplink"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/checks/navigation/region.js#L41-L63 | train | Find all regionless elements | [
30522,
3853,
2424,
23784,
3238,
2884,
5244,
1006,
7484,
3630,
3207,
1007,
1063,
9530,
3367,
13045,
1027,
7484,
3630,
3207,
1012,
5025,
3630,
3207,
1025,
1013,
1013,
2203,
28667,
9236,
3258,
2065,
1996,
5783,
2003,
1037,
8637,
1010,
13558,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
uber/deck.gl | modules/core/src/utils/get.js | getGetter | function getGetter(container) {
// Check if container has a special get method
const prototype = Object.getPrototypeOf(container);
return prototype.get ? getMethodGetter : squareBracketGetter;
} | javascript | function getGetter(container) {
// Check if container has a special get method
const prototype = Object.getPrototypeOf(container);
return prototype.get ? getMethodGetter : squareBracketGetter;
} | [
"function",
"getGetter",
"(",
"container",
")",
"{",
"// Check if container has a special get method",
"const",
"prototype",
"=",
"Object",
".",
"getPrototypeOf",
"(",
"container",
")",
";",
"return",
"prototype",
".",
"get",
"?",
"getMethodGetter",
":",
"squareBracke... | Looks for a `get` function on the prototype TODO - follow prototype chain? @private @return {Function} - get function: (container, key) => value | [
"Looks",
"for",
"a",
"get",
"function",
"on",
"the",
"prototype",
"TODO",
"-",
"follow",
"prototype",
"chain?"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/core/src/utils/get.js#L68-L72 | train | Get getter for a container | [
30522,
3853,
2131,
18150,
3334,
1006,
11661,
1007,
1063,
1013,
1013,
4638,
2065,
11661,
2038,
1037,
2569,
2131,
4118,
9530,
3367,
8773,
1027,
4874,
1012,
2131,
21572,
3406,
13874,
11253,
1006,
11661,
1007,
1025,
2709,
8773,
1012,
2131,
1029... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/input-mask/jquery.inputmask.date.extensions.js | function (chrs, buffer, pos, strict, opts) {
if (opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) {
var dayMonthValue = buffer.join('').substr(0, 6);
if (dayMonthValue != opts.leapday)
... | javascript | function (chrs, buffer, pos, strict, opts) {
if (opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) {
var dayMonthValue = buffer.join('').substr(0, 6);
if (dayMonthValue != opts.leapday)
... | [
"function",
"(",
"chrs",
",",
"buffer",
",",
"pos",
",",
"strict",
",",
"opts",
")",
"{",
"if",
"(",
"opts",
".",
"isInYearRange",
"(",
"chrs",
",",
"opts",
".",
"yearrange",
".",
"minyear",
",",
"opts",
".",
"yearrange",
".",
"maxyear",
")",
")",
... | year | [
"year"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/input-mask/jquery.inputmask.date.extensions.js#L150-L166 | train | check if the chrs is a leap year | [
30522,
3853,
1006,
10381,
2869,
1010,
17698,
1010,
13433,
2015,
1010,
9384,
1010,
23569,
2015,
1007,
1063,
2065,
1006,
23569,
2015,
1012,
2003,
24300,
14644,
24388,
2063,
1006,
10381,
2869,
1010,
23569,
2015,
1012,
2095,
24388,
2063,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/type/Decimal.js | getText | function getText(sKey, aParams) {
return sap.ui.getCore().getLibraryResourceBundle().getText(sKey, aParams);
} | javascript | function getText(sKey, aParams) {
return sap.ui.getCore().getLibraryResourceBundle().getText(sKey, aParams);
} | [
"function",
"getText",
"(",
"sKey",
",",
"aParams",
")",
"{",
"return",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getLibraryResourceBundle",
"(",
")",
".",
"getText",
"(",
"sKey",
",",
"aParams",
")",
";",
"}"
] | Fetches a text from the message bundle and formats it using the parameters.
@param {string} sKey
the message key
@param {any[]} aParams
the message parameters
@returns {string}
the message | [
"Fetches",
"a",
"text",
"from",
"the",
"message",
"bundle",
"and",
"formats",
"it",
"using",
"the",
"parameters",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/Decimal.js#L68-L70 | train | Returns the text of the given key. | [
30522,
3853,
2131,
18209,
1006,
15315,
3240,
1010,
9706,
5400,
5244,
1007,
1063,
2709,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
1012,
2131,
29521,
19848,
16363,
6499,
3126,
3401,
27265,
2571,
1006,
1007,
1012,
2131,
18209,
1006,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js | function (oEvent) {
// Update filter value
this._sFilter = oEvent.getParameter("newValue").trim();
if (this._filterTimeout) {
clearTimeout(this._filterTimeout);
}
this._filterTimeout = setTimeout(function () {
if (this.buildAndApplyFilters()) {
this._expandAllNodes();
} else ... | javascript | function (oEvent) {
// Update filter value
this._sFilter = oEvent.getParameter("newValue").trim();
if (this._filterTimeout) {
clearTimeout(this._filterTimeout);
}
this._filterTimeout = setTimeout(function () {
if (this.buildAndApplyFilters()) {
this._expandAllNodes();
} else ... | [
"function",
"(",
"oEvent",
")",
"{",
"// Update filter value",
"this",
".",
"_sFilter",
"=",
"oEvent",
".",
"getParameter",
"(",
"\"newValue\"",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"this",
".",
"_filterTimeout",
")",
"{",
"clearTimeout",
"(",
"this... | Handler for the SearchField
@param oEvent | [
"Handler",
"for",
"the",
"SearchField"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js#L95-L117 | train | Updates the filter value | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
1013,
1013,
10651,
11307,
3643,
2023,
1012,
1035,
16420,
4014,
3334,
1027,
1051,
18697,
3372,
1012,
2131,
28689,
22828,
1006,
1000,
2047,
10175,
5657,
1000,
1007,
1012,
12241,
1006,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
nodejs/node-gyp | lib/configure.js | checkCommand | function checkCommand (command, errorCallback) {
var exec = command
var args = this.argsExecutable
var shell = false
if (this.win) {
// Arguments have to be manually quoted
exec = `"${exec}"`
args = args.map(a => `"${a}"`)
shell = true
}
this.log.verbose(`- executing "${... | javascript | function checkCommand (command, errorCallback) {
var exec = command
var args = this.argsExecutable
var shell = false
if (this.win) {
// Arguments have to be manually quoted
exec = `"${exec}"`
args = args.map(a => `"${a}"`)
shell = true
}
this.log.verbose(`- executing "${... | [
"function",
"checkCommand",
"(",
"command",
",",
"errorCallback",
")",
"{",
"var",
"exec",
"=",
"command",
"var",
"args",
"=",
"this",
".",
"argsExecutable",
"var",
"shell",
"=",
"false",
"if",
"(",
"this",
".",
"win",
")",
"{",
"// Arguments have to be manu... | Check if command is a valid Python to use. Will exit the Python finder on success. If on Windows, run in a CMD shell to support BAT/CMD launchers. | [
"Check",
"if",
"command",
"is",
"a",
"valid",
"Python",
"to",
"use",
".",
"Will",
"exit",
"the",
"Python",
"finder",
"on",
"success",
".",
"If",
"on",
"Windows",
"run",
"in",
"a",
"CMD",
"shell",
"to",
"support",
"BAT",
"/",
"CMD",
"launchers",
"."
] | 721eb691cf15556cc2700eda0558d5bad5f84232 | https://github.com/nodejs/node-gyp/blob/721eb691cf15556cc2700eda0558d5bad5f84232/lib/configure.js#L490-L514 | train | Check the executable path of the command | [
30522,
3853,
4638,
9006,
2386,
2094,
1006,
3094,
1010,
7561,
9289,
20850,
8684,
1007,
1063,
13075,
4654,
8586,
1027,
3094,
13075,
12098,
5620,
1027,
2023,
1012,
12098,
5620,
10288,
8586,
23056,
13075,
5806,
1027,
6270,
2065,
1006,
2023,
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.core/src/sap/ui/thirdparty/signals.js | function (listener, listenerContext, priority) {
validateListener(listener, 'addOnce');
return this._registerListener(listener, true, listenerContext, priority);
} | javascript | function (listener, listenerContext, priority) {
validateListener(listener, 'addOnce');
return this._registerListener(listener, true, listenerContext, priority);
} | [
"function",
"(",
"listener",
",",
"listenerContext",
",",
"priority",
")",
"{",
"validateListener",
"(",
"listener",
",",
"'addOnce'",
")",
";",
"return",
"this",
".",
"_registerListener",
"(",
"listener",
",",
"true",
",",
"listenerContext",
",",
"priority",
... | Add listener to the signal that should be removed after first execution (will be executed only once).
@param {Function} listener Signal handler function.
@param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
@param {Numb... | [
"Add",
"listener",
"to",
"the",
"signal",
"that",
"should",
"be",
"removed",
"after",
"first",
"execution",
"(",
"will",
"be",
"executed",
"only",
"once",
")",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/signals.js#L308-L311 | train | Add a listener to the event queue. | [
30522,
3853,
1006,
19373,
1010,
19373,
8663,
18209,
1010,
9470,
1007,
1063,
9398,
3686,
9863,
24454,
1006,
19373,
1010,
1005,
5587,
2239,
3401,
1005,
1007,
1025,
2709,
2023,
1012,
1035,
4236,
9863,
24454,
1006,
19373,
1010,
2995,
1010,
1937... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | bits/27_csfutils.js | encode_range | function encode_range(cs/*:CellAddrSpec|Range*/,ce/*:?CellAddrSpec*/)/*:string*/ {
if(typeof ce === 'undefined' || typeof ce === 'number') {
/*:: if(!(cs instanceof Range)) throw "unreachable"; */
return encode_range(cs.s, cs.e);
}
/*:: if((cs instanceof Range)) throw "unreachable"; */
if(typeof cs !== 'string') c... | javascript | function encode_range(cs/*:CellAddrSpec|Range*/,ce/*:?CellAddrSpec*/)/*:string*/ {
if(typeof ce === 'undefined' || typeof ce === 'number') {
/*:: if(!(cs instanceof Range)) throw "unreachable"; */
return encode_range(cs.s, cs.e);
}
/*:: if((cs instanceof Range)) throw "unreachable"; */
if(typeof cs !== 'string') c... | [
"function",
"encode_range",
"(",
"cs",
"/*:CellAddrSpec|Range*/",
",",
"ce",
"/*:?CellAddrSpec*/",
")",
"/*:string*/",
"{",
"if",
"(",
"typeof",
"ce",
"===",
"'undefined'",
"||",
"typeof",
"ce",
"===",
"'number'",
")",
"{",
"/*:: if(!(cs instanceof Range)) throw \"unr... | /*# if only one arg, it is assumed to be a Range. If 2 args, both are cell addresses | [
"/",
"*",
"#",
"if",
"only",
"one",
"arg",
"it",
"is",
"assumed",
"to",
"be",
"a",
"Range",
".",
"If",
"2",
"args",
"both",
"are",
"cell",
"addresses"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/27_csfutils.js#L16-L27 | train | Encode a range of cells | [
30522,
3853,
4372,
16044,
1035,
2846,
1006,
20116,
1013,
1008,
1024,
3526,
4215,
13626,
13102,
8586,
1064,
2846,
1008,
1013,
1010,
8292,
1013,
1008,
1024,
1029,
3526,
4215,
13626,
13102,
8586,
1008,
1013,
1007,
1013,
1008,
1024,
5164,
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... |
google/code-prettify | tasks/lib/lang-aliases.js | runLanguageHandler | function runLanguageHandler(src) {
// execute source code in an isolated sandbox with a mock PR object
var sandbox = createSandbox();
vm.runInNewContext(fs.readFileSync(src), sandbox, {
filename: src
});
// language name
var lang = path.basename(src, path.extname(src)).replace(/^lang-/, '');
// coll... | javascript | function runLanguageHandler(src) {
// execute source code in an isolated sandbox with a mock PR object
var sandbox = createSandbox();
vm.runInNewContext(fs.readFileSync(src), sandbox, {
filename: src
});
// language name
var lang = path.basename(src, path.extname(src)).replace(/^lang-/, '');
// coll... | [
"function",
"runLanguageHandler",
"(",
"src",
")",
"{",
"// execute source code in an isolated sandbox with a mock PR object",
"var",
"sandbox",
"=",
"createSandbox",
"(",
")",
";",
"vm",
".",
"runInNewContext",
"(",
"fs",
".",
"readFileSync",
"(",
"src",
")",
",",
... | Runs a language handler file under VM to collect extensions.
Given a lang-*.js file, runs the language handler in a fake context where
PR.registerLangHandler collects handler names without doing anything else.
This is later used to makes copies of the JS extension under all its
registered language names lang-<EXT>.js
... | [
"Runs",
"a",
"language",
"handler",
"file",
"under",
"VM",
"to",
"collect",
"extensions",
"."
] | e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc | https://github.com/google/code-prettify/blob/e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc/tasks/lib/lang-aliases.js#L67-L90 | train | Runs the language handler in a sandbox | [
30522,
3853,
2448,
25023,
6692,
3351,
11774,
3917,
1006,
5034,
2278,
1007,
1063,
1013,
1013,
15389,
3120,
3642,
1999,
2019,
7275,
5472,
8758,
2007,
1037,
12934,
10975,
4874,
13075,
5472,
8758,
1027,
9005,
5685,
8758,
1006,
1007,
1025,
1058,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/util/BindingsExtractor.js | getBindingsFromTemplateProperties | function getBindingsFromTemplateProperties(oElement) {
var aPropertiesKeys = Object.keys(oElement.getMetadata().getAllProperties());
return aPropertiesKeys
.filter(function (sPropertyName) {
return sPropertyName in oElement.mBindingInfos;
})
.reduce(function (aBindings, sPropertyName) {
return aBi... | javascript | function getBindingsFromTemplateProperties(oElement) {
var aPropertiesKeys = Object.keys(oElement.getMetadata().getAllProperties());
return aPropertiesKeys
.filter(function (sPropertyName) {
return sPropertyName in oElement.mBindingInfos;
})
.reduce(function (aBindings, sPropertyName) {
return aBi... | [
"function",
"getBindingsFromTemplateProperties",
"(",
"oElement",
")",
"{",
"var",
"aPropertiesKeys",
"=",
"Object",
".",
"keys",
"(",
"oElement",
".",
"getMetadata",
"(",
")",
".",
"getAllProperties",
"(",
")",
")",
";",
"return",
"aPropertiesKeys",
".",
"filte... | Retrieving all bindings from all available properties for a specified element of template
@param {sap.ui.core.Control} oElement - element to get bindings from
@return {Array} - returns found bindings
@private | [
"Retrieving",
"all",
"bindings",
"from",
"all",
"available",
"properties",
"for",
"a",
"specified",
"element",
"of",
"template"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js#L219-L233 | train | Get all bindings from template properties | [
30522,
3853,
2131,
8428,
4667,
22747,
21716,
18532,
15725,
21572,
4842,
7368,
1006,
1051,
12260,
3672,
1007,
1063,
13075,
19804,
25918,
7368,
14839,
2015,
1027,
4874,
1012,
6309,
1006,
1051,
12260,
3672,
1012,
2131,
11368,
8447,
2696,
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... |
jgraph/mxgraph | javascript/mxClient.js | function(element)
{
try
{
if (element != null)
{
mxEvent.removeAllListeners(element);
var children = element.childNodes;
if (children != null)
{
var childCount = children.length;
for (var i = 0; i < childCount; i += 1)
{
mxEve... | javascript | function(element)
{
try
{
if (element != null)
{
mxEvent.removeAllListeners(element);
var children = element.childNodes;
if (children != null)
{
var childCount = children.length;
for (var i = 0; i < childCount; i += 1)
{
mxEve... | [
"function",
"(",
"element",
")",
"{",
"try",
"{",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"mxEvent",
".",
"removeAllListeners",
"(",
"element",
")",
";",
"var",
"children",
"=",
"element",
".",
"childNodes",
";",
"if",
"(",
"children",
"!=",
"nul... | Function: release
Removes the known listeners from the given DOM node and its descendants.
Parameters:
element - DOM node to remove the listeners from. | [
"Function",
":",
"release"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L9683-L9708 | train | Removes all listeners from an element | [
30522,
3853,
1006,
5783,
1007,
1063,
3046,
1063,
2065,
1006,
5783,
999,
1027,
19701,
1007,
1063,
25630,
18697,
3372,
1012,
6366,
8095,
9863,
24454,
2015,
1006,
5783,
1007,
1025,
13075,
2336,
1027,
5783,
1012,
2775,
3630,
6155,
1025,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
nhn/tui.editor | src/js/extensions/table/tableDataHandler.js | _addMergedCell | function _addMergedCell(base, cellData, startRowIndex, startCellIndex) {
const {
colspan,
rowspan,
nodeName
} = cellData;
const colMerged = colspan > 1;
const rowMerged = rowspan > 1;
if (!colMerged && !rowMerged) {
return;
}
const limitRowIndex = startRowIndex + rowspan;
const limitCe... | javascript | function _addMergedCell(base, cellData, startRowIndex, startCellIndex) {
const {
colspan,
rowspan,
nodeName
} = cellData;
const colMerged = colspan > 1;
const rowMerged = rowspan > 1;
if (!colMerged && !rowMerged) {
return;
}
const limitRowIndex = startRowIndex + rowspan;
const limitCe... | [
"function",
"_addMergedCell",
"(",
"base",
",",
"cellData",
",",
"startRowIndex",
",",
"startCellIndex",
")",
"{",
"const",
"{",
"colspan",
",",
"rowspan",
",",
"nodeName",
"}",
"=",
"cellData",
";",
"const",
"colMerged",
"=",
"colspan",
">",
"1",
";",
"co... | Add merged cell.
@param {object} base - base table data
@param {object} cellData - cell data
@param {number} startRowIndex - start row index
@param {number} startCellIndex - start cell index
@private | [
"Add",
"merged",
"cell",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/tableDataHandler.js#L58-L97 | train | Add merged cell to base | [
30522,
3853,
1035,
5587,
5017,
5999,
29109,
2140,
1006,
2918,
1010,
3526,
2850,
2696,
1010,
2707,
10524,
22254,
10288,
1010,
2707,
29109,
27164,
10288,
1007,
1063,
9530,
3367,
1063,
8902,
13102,
2319,
1010,
10281,
9739,
1010,
13045,
18442,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/wysiwygCommands/tableAddRow.js | getSelectedRowsLength | function getSelectedRowsLength(wwe) {
const selectionMgr = wwe.componentManager.getManager('tableSelection');
const $selectedCells = selectionMgr.getSelectedCells();
let length = 1;
if ($selectedCells.length > 1) {
const first = $selectedCells.first().get(0);
const last = $selectedCells.last().get(0);
... | javascript | function getSelectedRowsLength(wwe) {
const selectionMgr = wwe.componentManager.getManager('tableSelection');
const $selectedCells = selectionMgr.getSelectedCells();
let length = 1;
if ($selectedCells.length > 1) {
const first = $selectedCells.first().get(0);
const last = $selectedCells.last().get(0);
... | [
"function",
"getSelectedRowsLength",
"(",
"wwe",
")",
"{",
"const",
"selectionMgr",
"=",
"wwe",
".",
"componentManager",
".",
"getManager",
"(",
"'tableSelection'",
")",
";",
"const",
"$selectedCells",
"=",
"selectionMgr",
".",
"getSelectedCells",
"(",
")",
";",
... | get number of selected rows
@param {WysiwygEditor} wwe - wysiwygEditor instance
@returns {number} - number of selected rows
@ignore | [
"get",
"number",
"of",
"selected",
"rows"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/wysiwygCommands/tableAddRow.js#L59-L72 | train | Returns the number of selected rows | [
30522,
3853,
4152,
12260,
10985,
10524,
25016,
3070,
2705,
1006,
11700,
1007,
1063,
9530,
3367,
4989,
24798,
2099,
1027,
11700,
1012,
6922,
24805,
4590,
1012,
2131,
24805,
4590,
1006,
1005,
7251,
12260,
7542,
1005,
1007,
1025,
9530,
3367,
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... |
GitbookIO/gitbook | lib/output/website/prepareI18n.js | prepareI18n | function prepareI18n(output) {
var state = output.getState();
var i18n = state.getI18n();
var searchPaths = listSearchPaths(output);
searchPaths
.reverse()
.forEach(function(searchPath) {
var i18nRoot = path.resolve(searchPath, '_i18n');
if (!fs.existsSync(i18nR... | javascript | function prepareI18n(output) {
var state = output.getState();
var i18n = state.getI18n();
var searchPaths = listSearchPaths(output);
searchPaths
.reverse()
.forEach(function(searchPath) {
var i18nRoot = path.resolve(searchPath, '_i18n');
if (!fs.existsSync(i18nR... | [
"function",
"prepareI18n",
"(",
"output",
")",
"{",
"var",
"state",
"=",
"output",
".",
"getState",
"(",
")",
";",
"var",
"i18n",
"=",
"state",
".",
"getI18n",
"(",
")",
";",
"var",
"searchPaths",
"=",
"listSearchPaths",
"(",
"output",
")",
";",
"searc... | Prepare i18n, load translations from plugins and book
@param {Output}
@return {Promise<Output>} | [
"Prepare",
"i18n",
"load",
"translations",
"from",
"plugins",
"and",
"book"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/website/prepareI18n.js#L13-L28 | train | prepareI18n - prepare the i18n | [
30522,
3853,
7374,
2072,
15136,
2078,
1006,
6434,
1007,
1063,
13075,
2110,
1027,
6434,
1012,
4152,
12259,
1006,
1007,
1025,
13075,
1045,
15136,
2078,
1027,
2110,
1012,
2131,
2072,
15136,
2078,
1006,
1007,
1025,
13075,
3945,
15069,
2015,
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... |
ColorlibHQ/AdminLTE | plugins/timepicker/bootstrap-timepicker.js | function(element, options) {
this.widget = '';
this.$element = $(element);
this.defaultTime = options.defaultTime;
this.disableFocus = options.disableFocus;
this.disableMousewheel = options.disableMousewheel;
this.isOpen = options.isOpen;
this.minuteStep = options.minuteStep;
this.modalB... | javascript | function(element, options) {
this.widget = '';
this.$element = $(element);
this.defaultTime = options.defaultTime;
this.disableFocus = options.disableFocus;
this.disableMousewheel = options.disableMousewheel;
this.isOpen = options.isOpen;
this.minuteStep = options.minuteStep;
this.modalB... | [
"function",
"(",
"element",
",",
"options",
")",
"{",
"this",
".",
"widget",
"=",
"''",
";",
"this",
".",
"$element",
"=",
"$",
"(",
"element",
")",
";",
"this",
".",
"defaultTime",
"=",
"options",
".",
"defaultTime",
";",
"this",
".",
"disableFocus",
... | TIMEPICKER PUBLIC CLASS DEFINITION | [
"TIMEPICKER",
"PUBLIC",
"CLASS",
"DEFINITION"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/timepicker/bootstrap-timepicker.js#L15-L49 | train | Constructor for timepicker | [
30522,
30524,
12398,
7292,
1027,
7047,
1012,
12398,
7292,
1025,
2023,
1012,
4487,
19150,
14876,
7874,
1027,
7047,
1012,
4487,
19150,
14876,
7874,
1025,
2023,
1012,
4487,
19150,
27711,
7974,
21030,
2140,
1027,
7047,
1012,
4487,
19150,
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... | |
google/closure-library | closure/goog/html/cssspecificity.js | calculateSpecificity | function calculateSpecificity(selector) {
var specificity = [0, 0, 0, 0];
// Cannot use RegExp literals for all regular expressions, IE does not accept
// the syntax.
// Matches a backslash followed by six hexadecimal digits followed by an
// optional single whitespace character.
var escapeHexadecimalRege... | javascript | function calculateSpecificity(selector) {
var specificity = [0, 0, 0, 0];
// Cannot use RegExp literals for all regular expressions, IE does not accept
// the syntax.
// Matches a backslash followed by six hexadecimal digits followed by an
// optional single whitespace character.
var escapeHexadecimalRege... | [
"function",
"calculateSpecificity",
"(",
"selector",
")",
"{",
"var",
"specificity",
"=",
"[",
"0",
",",
"0",
",",
"0",
",",
"0",
"]",
";",
"// Cannot use RegExp literals for all regular expressions, IE does not accept",
"// the syntax.",
"// Matches a backslash followed by... | Calculates the specificity of CSS selectors
@see http://www.w3.org/TR/css3-selectors/#specificity
@see https://github.com/keeganstreet/specificity
@see https://specificity.keegan.st/
@param {string} selector
@return {!Array<number>} The CSS specificity. | [
"Calculates",
"the",
"specificity",
"of",
"CSS",
"selectors"
] | 97390e9ca4483cebb9628e06026139fbb3023d65 | https://github.com/google/closure-library/blob/97390e9ca4483cebb9628e06026139fbb3023d65/closure/goog/html/cssspecificity.js#L98-L172 | train | Calculates the specificity of a selector. | [
30522,
3853,
18422,
13102,
8586,
18513,
3012,
1006,
27000,
1007,
1063,
13075,
3563,
3012,
1027,
1031,
1014,
1010,
1014,
1010,
1014,
1010,
1014,
1033,
1025,
1013,
1013,
3685,
2224,
19723,
10288,
2361,
18204,
2015,
2005,
2035,
3180,
11423,
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/thirdparty/RequestRecorder.js | function(url, response, method, status, headers) {
var aHeaders = headers || [];
aHeaders.push({
"name": "Content-Type",
"value": "application/json;charset=utf-8"
});
this.addResponse(url, response, method, status, aHeaders);
} | javascript | function(url, response, method, status, headers) {
var aHeaders = headers || [];
aHeaders.push({
"name": "Content-Type",
"value": "application/json;charset=utf-8"
});
this.addResponse(url, response, method, status, aHeaders);
} | [
"function",
"(",
"url",
",",
"response",
",",
"method",
",",
"status",
",",
"headers",
")",
"{",
"var",
"aHeaders",
"=",
"headers",
"||",
"[",
"]",
";",
"aHeaders",
".",
"push",
"(",
"{",
"\"name\"",
":",
"\"Content-Type\"",
",",
"\"value\"",
":",
"\"a... | Adds a JSON encoded response for a request with the provided URL.
@param {string} url The requested URL.
@param {string|function} response The returned response as string or callback.
@param {string} [method] The HTTP method (e.g. GET, POST), default is GET.
@param {int} [status] The desired status, default is 200.
@p... | [
"Adds",
"a",
"JSON",
"encoded",
"response",
"for",
"a",
"request",
"with",
"the",
"provided",
"URL",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L788-L795 | train | Add a response to the response queue | [
30522,
3853,
1006,
24471,
2140,
1010,
3433,
1010,
4118,
1010,
3570,
1010,
20346,
2015,
1007,
1063,
13075,
3805,
2545,
1027,
20346,
2015,
1064,
1064,
1031,
1033,
1025,
3805,
2545,
1012,
5245,
1006,
1063,
1000,
2171,
1000,
1024,
1000,
4180,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/dialog/dialog.js | MdDialogProvider | function MdDialogProvider($$interimElementProvider) {
// Elements to capture and redirect focus when the user presses tab at the dialog boundary.
var topFocusTrap, bottomFocusTrap;
return $$interimElementProvider('$mdDialog')
.setDefaults({
methods: ['disableParentScroll', 'hasBackdrop', 'clickOutsideT... | javascript | function MdDialogProvider($$interimElementProvider) {
// Elements to capture and redirect focus when the user presses tab at the dialog boundary.
var topFocusTrap, bottomFocusTrap;
return $$interimElementProvider('$mdDialog')
.setDefaults({
methods: ['disableParentScroll', 'hasBackdrop', 'clickOutsideT... | [
"function",
"MdDialogProvider",
"(",
"$$interimElementProvider",
")",
"{",
"// Elements to capture and redirect focus when the user presses tab at the dialog boundary.",
"var",
"topFocusTrap",
",",
"bottomFocusTrap",
";",
"return",
"$$interimElementProvider",
"(",
"'$mdDialog'",
")",... | @ngdoc method
@name $mdDialog#hide
@description
Hide an existing dialog and resolve the promise returned from `$mdDialog.show()`.
@param {*=} response An argument for the resolved promise.
@returns {promise} A promise that is resolved when the dialog has been closed.
@ngdoc method
@name $mdDialog#cancel
@descript... | [
"@ngdoc",
"method",
"@name",
"$mdDialog#hide"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L582-L1309 | train | A provider that provides the options for the advanced dialog. | [
30522,
3853,
9108,
27184,
8649,
21572,
17258,
2121,
1006,
1002,
1002,
9455,
12260,
3672,
21572,
17258,
2121,
1007,
1063,
1013,
1013,
3787,
2000,
5425,
1998,
2417,
7442,
6593,
3579,
2043,
1996,
5310,
14616,
21628,
2012,
1996,
13764,
8649,
61... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GeekyAnts/vue-native-core | dist/vue.runtime.common.js | checkDuration | function checkDuration (val, name, vnode) {
if (typeof val !== 'number') {
warn(
"<transition> explicit " + name + " duration is not a valid number - " +
"got " + (JSON.stringify(val)) + ".",
vnode.context
);
} else if (isNaN(val)) {
warn(
"<transition> explicit " + name + " dura... | javascript | function checkDuration (val, name, vnode) {
if (typeof val !== 'number') {
warn(
"<transition> explicit " + name + " duration is not a valid number - " +
"got " + (JSON.stringify(val)) + ".",
vnode.context
);
} else if (isNaN(val)) {
warn(
"<transition> explicit " + name + " dura... | [
"function",
"checkDuration",
"(",
"val",
",",
"name",
",",
"vnode",
")",
"{",
"if",
"(",
"typeof",
"val",
"!==",
"'number'",
")",
"{",
"warn",
"(",
"\"<transition> explicit \"",
"+",
"name",
"+",
"\" duration is not a valid number - \"",
"+",
"\"got \"",
"+",
... | only used in dev mode | [
"only",
"used",
"in",
"dev",
"mode"
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/dist/vue.runtime.common.js#L5977-L5991 | train | Check if the duration expression is valid | [
30522,
3853,
4638,
24979,
3370,
1006,
11748,
1010,
2171,
1010,
1058,
3630,
3207,
1007,
1063,
2065,
1006,
2828,
11253,
11748,
999,
1027,
1027,
1005,
2193,
1005,
1007,
1063,
11582,
1006,
1000,
1026,
6653,
1028,
13216,
1000,
1009,
2171,
1009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | dist/howler.js | function(node) {
var checkIE = /MSIE |Trident\//.test(Howler._navigator && Howler._navigator.userAgent);
if (!checkIE) {
node.src = 'data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA';
}
} | javascript | function(node) {
var checkIE = /MSIE |Trident\//.test(Howler._navigator && Howler._navigator.userAgent);
if (!checkIE) {
node.src = 'data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA';
}
} | [
"function",
"(",
"node",
")",
"{",
"var",
"checkIE",
"=",
"/",
"MSIE |Trident\\/",
"/",
".",
"test",
"(",
"Howler",
".",
"_navigator",
"&&",
"Howler",
".",
"_navigator",
".",
"userAgent",
")",
";",
"if",
"(",
"!",
"checkIE",
")",
"{",
"node",
".",
"s... | Set the source to a 0-second silence to stop any downloading (except in IE).
@param {Object} node Audio node to clear. | [
"Set",
"the",
"source",
"to",
"a",
"0",
"-",
"second",
"silence",
"to",
"stop",
"any",
"downloading",
"(",
"except",
"in",
"IE",
")",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L2140-L2145 | train | This function is called by the main function to create the audio file for a node | [
30522,
3853,
1006,
13045,
1007,
1063,
13075,
4638,
2666,
1027,
1013,
5796,
2666,
1064,
26515,
1032,
1013,
1013,
1012,
3231,
1006,
22912,
2121,
1012,
1035,
20532,
1004,
1004,
22912,
2121,
1012,
1035,
20532,
1012,
5310,
4270,
3372,
1007,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
feathericons/feather | src/replace.js | replace | function replace(attrs = {}) {
if (typeof document === 'undefined') {
throw new Error('`feather.replace()` only works in a browser environment.');
}
const elementsToReplace = document.querySelectorAll('[data-feather]');
Array.from(elementsToReplace).forEach(element =>
replaceElement(element, attrs),
... | javascript | function replace(attrs = {}) {
if (typeof document === 'undefined') {
throw new Error('`feather.replace()` only works in a browser environment.');
}
const elementsToReplace = document.querySelectorAll('[data-feather]');
Array.from(elementsToReplace).forEach(element =>
replaceElement(element, attrs),
... | [
"function",
"replace",
"(",
"attrs",
"=",
"{",
"}",
")",
"{",
"if",
"(",
"typeof",
"document",
"===",
"'undefined'",
")",
"{",
"throw",
"new",
"Error",
"(",
"'`feather.replace()` only works in a browser environment.'",
")",
";",
"}",
"const",
"elementsToReplace",
... | Replace all HTML elements that have a `data-feather` attribute with SVG markup
corresponding to the element's `data-feather` attribute value.
@param {Object} attrs | [
"Replace",
"all",
"HTML",
"elements",
"that",
"have",
"a",
"data",
"-",
"feather",
"attribute",
"with",
"SVG",
"markup",
"corresponding",
"to",
"the",
"element",
"s",
"data",
"-",
"feather",
"attribute",
"value",
"."
] | 8f658193d25e943b196a2367319b5d9e85ee9f9f | https://github.com/feathericons/feather/blob/8f658193d25e943b196a2367319b5d9e85ee9f9f/src/replace.js#L11-L21 | train | Replace all feather elements with the specified attributes. | [
30522,
3853,
5672,
1006,
2012,
16344,
2015,
1027,
1063,
1065,
1007,
1063,
2065,
1006,
2828,
11253,
6254,
1027,
1027,
1027,
1005,
6151,
28344,
1005,
1007,
1063,
5466,
2047,
7561,
1006,
1005,
1036,
15550,
1012,
5672,
1006,
1007,
1036,
2069,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/curly.js | getElseKeyword | function getElseKeyword(node) {
return node.alternate && sourceCode.getFirstTokenBetween(node.consequent, node.alternate, isElseKeywordToken);
} | javascript | function getElseKeyword(node) {
return node.alternate && sourceCode.getFirstTokenBetween(node.consequent, node.alternate, isElseKeywordToken);
} | [
"function",
"getElseKeyword",
"(",
"node",
")",
"{",
"return",
"node",
".",
"alternate",
"&&",
"sourceCode",
".",
"getFirstTokenBetween",
"(",
"node",
".",
"consequent",
",",
"node",
".",
"alternate",
",",
"isElseKeywordToken",
")",
";",
"}"
] | Gets the `else` keyword token of a given `IfStatement` node.
@param {ASTNode} node - A `IfStatement` node to get.
@returns {Token} The `else` keyword token. | [
"Gets",
"the",
"else",
"keyword",
"token",
"of",
"a",
"given",
"IfStatement",
"node",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/curly.js#L121-L123 | train | Returns the first token of the else keyword of a IfStatement node. | [
30522,
3853,
2131,
9050,
23941,
2100,
18351,
1006,
13045,
1007,
1063,
2709,
13045,
1012,
6585,
1004,
1004,
3120,
16044,
1012,
2131,
8873,
12096,
18715,
2368,
20915,
28394,
2078,
1006,
13045,
1012,
9530,
3366,
15417,
1010,
13045,
1012,
6585,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ToolsAPI.js | function (control) {
var result = [];
var inheritedMetadata = control.getMetadata().getParent();
while (inheritedMetadata instanceof ElementMetadata) {
result.push(this._copyInheritedProperties(control, inheritedMetadata));
inheritedMetadata = inheritedMetadata.getParent();
}
return resu... | javascript | function (control) {
var result = [];
var inheritedMetadata = control.getMetadata().getParent();
while (inheritedMetadata instanceof ElementMetadata) {
result.push(this._copyInheritedProperties(control, inheritedMetadata));
inheritedMetadata = inheritedMetadata.getParent();
}
return resu... | [
"function",
"(",
"control",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"var",
"inheritedMetadata",
"=",
"control",
".",
"getMetadata",
"(",
")",
".",
"getParent",
"(",
")",
";",
"while",
"(",
"inheritedMetadata",
"instanceof",
"ElementMetadata",
")",
"... | Creates an array with the control properties that are inherited.
@param {Object} control - UI5 control.
@returns {Array}
@private | [
"Creates",
"an",
"array",
"with",
"the",
"control",
"properties",
"that",
"are",
"inherited",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/ToolsAPI.js#L247-L257 | train | Returns an array of all inherited properties of the given control. | [
30522,
3853,
1006,
2491,
1007,
1063,
13075,
2765,
1027,
1031,
1033,
1025,
13075,
7900,
11368,
8447,
2696,
1027,
2491,
1012,
2131,
11368,
8447,
2696,
1006,
1007,
1012,
2131,
19362,
4765,
1006,
1007,
1025,
2096,
1006,
7900,
11368,
8447,
2696,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/NavigationAndHistory/main.js | _handleActiveEditorChange | function _handleActiveEditorChange(event, current, previous) {
if (current) { // Handle only full editors
if (_mrofList.length === 0) {
_initRecentFilesList();
}
var file = current.document.file;
var paneId = current._paneId;
_addToMRO... | javascript | function _handleActiveEditorChange(event, current, previous) {
if (current) { // Handle only full editors
if (_mrofList.length === 0) {
_initRecentFilesList();
}
var file = current.document.file;
var paneId = current._paneId;
_addToMRO... | [
"function",
"_handleActiveEditorChange",
"(",
"event",
",",
"current",
",",
"previous",
")",
"{",
"if",
"(",
"current",
")",
"{",
"// Handle only full editors",
"if",
"(",
"_mrofList",
".",
"length",
"===",
"0",
")",
"{",
"_initRecentFilesList",
"(",
")",
";",... | Handle Active Editor change to update mrof information | [
"Handle",
"Active",
"Editor",
"change",
"to",
"update",
"mrof",
"information"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L782-L796 | train | Handle active editor change | [
30522,
3853,
1035,
5047,
19620,
2098,
15660,
22305,
2063,
1006,
2724,
1010,
2783,
1010,
3025,
1007,
1063,
2065,
1006,
2783,
1007,
1063,
1013,
1013,
5047,
2069,
2440,
10195,
2065,
1006,
1035,
2720,
11253,
9863,
1012,
3091,
1027,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (node)
{
if (typeof node !== "string") { return node; }
return node.replace(/^\s+|\s+$/g, '')
.replace(/\\/g, "\\5c")
.replace(/ /g, "\\20")
.replace(/\"/g, "\\22")
.replace(/\&/g, "\\26")
.replace(/\'/g, "\\27")
... | javascript | function (node)
{
if (typeof node !== "string") { return node; }
return node.replace(/^\s+|\s+$/g, '')
.replace(/\\/g, "\\5c")
.replace(/ /g, "\\20")
.replace(/\"/g, "\\22")
.replace(/\&/g, "\\26")
.replace(/\'/g, "\\27")
... | [
"function",
"(",
"node",
")",
"{",
"if",
"(",
"typeof",
"node",
"!==",
"\"string\"",
")",
"{",
"return",
"node",
";",
"}",
"return",
"node",
".",
"replace",
"(",
"/",
"^\\s+|\\s+$",
"/",
"g",
",",
"''",
")",
".",
"replace",
"(",
"/",
"\\\\",
"/",
... | Function: escapeNode
Escape the node part (also called local part) of a JID.
Parameters:
(String) node - A node (or local part).
Returns:
An escaped node (or local part). | [
"Function",
":",
"escapeNode",
"Escape",
"the",
"node",
"part",
"(",
"also",
"called",
"local",
"part",
")",
"of",
"a",
"JID",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L1256-L1270 | train | Returns a string that contains the tag name | [
30522,
3853,
1006,
13045,
1007,
1063,
2065,
1006,
2828,
11253,
13045,
999,
1027,
1027,
1000,
5164,
1000,
1007,
1063,
2709,
13045,
1025,
1065,
2709,
13045,
1012,
5672,
1006,
1013,
1034,
1032,
1055,
1009,
1064,
1032,
1055,
1009,
1002,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jgraph/mxgraph | javascript/mxClient.js | function(evt, preventDefault, stopPropagation)
{
preventDefault = (preventDefault != null) ? preventDefault : true;
stopPropagation = (stopPropagation != null) ? stopPropagation : true;
if (preventDefault)
{
if (evt.preventDefault)
{
if (stopPropagation)
{
evt.stopPropagation();
}
... | javascript | function(evt, preventDefault, stopPropagation)
{
preventDefault = (preventDefault != null) ? preventDefault : true;
stopPropagation = (stopPropagation != null) ? stopPropagation : true;
if (preventDefault)
{
if (evt.preventDefault)
{
if (stopPropagation)
{
evt.stopPropagation();
}
... | [
"function",
"(",
"evt",
",",
"preventDefault",
",",
"stopPropagation",
")",
"{",
"preventDefault",
"=",
"(",
"preventDefault",
"!=",
"null",
")",
"?",
"preventDefault",
":",
"true",
";",
"stopPropagation",
"=",
"(",
"stopPropagation",
"!=",
"null",
")",
"?",
... | Function: consume
Consumes the given event.
Parameters:
evt - Native event to be consumed.
preventDefault - Optional boolean to prevent the default for the event.
Default is true.
stopPropagation - Option boolean to stop event propagation. Default is
true. | [
"Function",
":",
"consume"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L10033-L10063 | train | Prevent default behavior and stop propagation | [
30522,
3853,
1006,
23408,
2102,
1010,
4652,
3207,
7011,
11314,
1010,
2644,
21572,
4502,
12540,
1007,
1063,
4652,
3207,
7011,
11314,
1027,
1006,
4652,
3207,
7011,
11314,
999,
1027,
19701,
1007,
1029,
4652,
3207,
7011,
11314,
1024,
2995,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/base/i18n/ResourceBundle.js | nextFallbackLocale | function nextFallbackLocale(sLocale) {
// there is no fallback for the 'raw' locale or for null/undefined
if ( !sLocale ) {
return null;
}
// special (legacy) handling for zh_HK: try zh_TW (for Traditional Chinese) first before falling back to 'zh'
if ( sLocale === "zh_HK" ) {
return "zh_TW";
}
/... | javascript | function nextFallbackLocale(sLocale) {
// there is no fallback for the 'raw' locale or for null/undefined
if ( !sLocale ) {
return null;
}
// special (legacy) handling for zh_HK: try zh_TW (for Traditional Chinese) first before falling back to 'zh'
if ( sLocale === "zh_HK" ) {
return "zh_TW";
}
/... | [
"function",
"nextFallbackLocale",
"(",
"sLocale",
")",
"{",
"// there is no fallback for the 'raw' locale or for null/undefined",
"if",
"(",
"!",
"sLocale",
")",
"{",
"return",
"null",
";",
"}",
"// special (legacy) handling for zh_HK: try zh_TW (for Traditional Chinese) first befo... | Calculate the next fallback locale for the given locale.
Note: always keep this in sync with the fallback mechanism in Java, ABAP (MIME & BSP)
resource handler (Java: Peter M., MIME: Sebastian A., BSP: Silke A.)
@param {string} sLocale Locale string in Java format (underscores) or null
@returns {string|null} Next fall... | [
"Calculate",
"the",
"next",
"fallback",
"locale",
"for",
"the",
"given",
"locale",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/i18n/ResourceBundle.js#L129-L150 | train | Returns the next fallback locale for the given locale. | [
30522,
3853,
2279,
13976,
5963,
4135,
9289,
2063,
1006,
22889,
24755,
2571,
1007,
1063,
1013,
1013,
2045,
2003,
2053,
2991,
5963,
2005,
1996,
1005,
6315,
1005,
2334,
2063,
2030,
2005,
19701,
1013,
6151,
28344,
2065,
1006,
999,
22889,
24755,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
uber/deck.gl | modules/json/src/parsers/convert-json.js | convertJSONMapProps | function convertJSONMapProps(jsonProps, configuration) {
if (jsonProps.map || jsonProps.mapStyle) {
jsonProps.map = Object.assign({}, DEFAULT_MAP_PROPS, jsonProps.map);
}
if (!jsonProps.map) {
return;
}
if ('mapStyle' in jsonProps) {
jsonProps.map.style = jsonProps.mapStyle;
jsonProps.map.ma... | javascript | function convertJSONMapProps(jsonProps, configuration) {
if (jsonProps.map || jsonProps.mapStyle) {
jsonProps.map = Object.assign({}, DEFAULT_MAP_PROPS, jsonProps.map);
}
if (!jsonProps.map) {
return;
}
if ('mapStyle' in jsonProps) {
jsonProps.map.style = jsonProps.mapStyle;
jsonProps.map.ma... | [
"function",
"convertJSONMapProps",
"(",
"jsonProps",
",",
"configuration",
")",
"{",
"if",
"(",
"jsonProps",
".",
"map",
"||",
"jsonProps",
".",
"mapStyle",
")",
"{",
"jsonProps",
".",
"map",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"DEFAULT_MAP_P... | Normalizes map/mapStyle etc props to a `map: {style}` object-valued prop | [
"Normalizes",
"map",
"/",
"mapStyle",
"etc",
"props",
"to",
"a",
"map",
":",
"{",
"style",
"}",
"object",
"-",
"valued",
"prop"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/json/src/parsers/convert-json.js#L48-L67 | train | Convert the map properties from the json - style to the correct map style | [
30522,
3853,
10463,
22578,
2239,
2863,
9397,
18981,
2015,
1006,
1046,
3385,
21572,
4523,
1010,
9563,
1007,
1063,
2065,
1006,
1046,
3385,
21572,
4523,
1012,
4949,
1064,
1064,
1046,
3385,
21572,
4523,
1012,
7341,
27983,
1007,
1063,
1046,
3385... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/indent-legacy.js | checkIndentInFunctionBlock | function checkIndentInFunctionBlock(node) {
/*
* Search first caller in chain.
* Ex.:
*
* Models <- Identifier
* .User
* .find()
* .exec(function() {
* // function body
* });
... | javascript | function checkIndentInFunctionBlock(node) {
/*
* Search first caller in chain.
* Ex.:
*
* Models <- Identifier
* .User
* .find()
* .exec(function() {
* // function body
* });
... | [
"function",
"checkIndentInFunctionBlock",
"(",
"node",
")",
"{",
"/*\n * Search first caller in chain.\n * Ex.:\n *\n * Models <- Identifier\n * .User\n * .find()\n * .exec(function() {\n * // functio... | Check indent for function block content
@param {ASTNode} node A BlockStatement node that is inside of a function.
@returns {void} | [
"Check",
"indent",
"for",
"function",
"block",
"content"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/indent-legacy.js#L610-L683 | train | Check indent in function block | [
30522,
3853,
4638,
22254,
4765,
2378,
11263,
27989,
23467,
1006,
13045,
1007,
1063,
1013,
1008,
1008,
3945,
2034,
20587,
1999,
4677,
1012,
1008,
4654,
1012,
1024,
1008,
1008,
4275,
1026,
1011,
8909,
4765,
18095,
1008,
1012,
5310,
1008,
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/document/DocumentManager.js | _proxyDeprecatedEvent | function _proxyDeprecatedEvent(eventName) {
DeprecationWarning.deprecateEvent(exports,
MainViewManager,
eventName,
eventName,
... | javascript | function _proxyDeprecatedEvent(eventName) {
DeprecationWarning.deprecateEvent(exports,
MainViewManager,
eventName,
eventName,
... | [
"function",
"_proxyDeprecatedEvent",
"(",
"eventName",
")",
"{",
"DeprecationWarning",
".",
"deprecateEvent",
"(",
"exports",
",",
"MainViewManager",
",",
"eventName",
",",
"eventName",
",",
"\"DocumentManager.\"",
"+",
"eventName",
",",
"\"MainViewManager.\"",
"+",
"... | Listens for the given event on MainViewManager, and triggers a copy of the event on DocumentManager whenever it occurs | [
"Listens",
"for",
"the",
"given",
"event",
"on",
"MainViewManager",
"and",
"triggers",
"a",
"copy",
"of",
"the",
"event",
"on",
"DocumentManager",
"whenever",
"it",
"occurs"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L651-L658 | train | Proxy a deprecated event to the main view manager | [
30522,
3853,
1035,
24540,
3207,
28139,
12921,
18697,
3372,
1006,
2724,
18442,
1007,
1063,
2139,
28139,
10719,
9028,
5582,
1012,
2139,
28139,
16280,
18697,
3372,
1006,
14338,
1010,
2364,
8584,
24805,
4590,
1010,
2724,
18442,
1010,
2724,
18442,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fex-team/webuploader | src/widgets/upload.js | function(file) {
var me = this;
// 移出invalid的文件
$.each( me.request( 'get-files', Status.INVALID ), function() {
me.request( 'remove-file', this );
});
// 如果指定了开始某个文件,则只开始指定的文件。
if ( file ) {
file = file.id ? file :... | javascript | function(file) {
var me = this;
// 移出invalid的文件
$.each( me.request( 'get-files', Status.INVALID ), function() {
me.request( 'remove-file', this );
});
// 如果指定了开始某个文件,则只开始指定的文件。
if ( file ) {
file = file.id ? file :... | [
"function",
"(",
"file",
")",
"{",
"var",
"me",
"=",
"this",
";",
"// 移出invalid的文件",
"$",
".",
"each",
"(",
"me",
".",
"request",
"(",
"'get-files'",
",",
"Status",
".",
"INVALID",
")",
",",
"function",
"(",
")",
"{",
"me",
".",
"request",
"(",
"'r... | @event startUpload
@description 当开始上传流程时触发。
@for Uploader
开始上传。此方法可以从初始状态调用开始上传流程,也可以从暂停状态调用,继续上传流程。
可以指定开始某一个文件。
@grammar upload() => undefined
@grammar upload( file | fileId) => undefined
@method upload
@for Uploader | [
"@event",
"startUpload",
"@description",
"当开始上传流程时触发。",
"@for",
"Uploader",
"开始上传。此方法可以从初始状态调用开始上传流程,也可以从暂停状态调用,继续上传流程。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/src/widgets/upload.js#L220-L293 | train | upload file | [
30522,
3853,
1006,
5371,
1007,
1063,
13075,
2033,
1027,
2023,
1025,
1013,
1013,
100,
1774,
19528,
1916,
1861,
100,
1002,
1012,
2169,
1006,
2033,
1012,
5227,
1006,
1005,
2131,
1011,
6764,
1005,
1010,
3570,
1012,
19528,
1007,
1010,
3853,
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/qunit/utils/MemoryLeakCheck.js | function(assert, mActual, mExpected, sMessage) {
var aUnexpectedElements = [];
for (var sId in mActual) {
if (!mExpected[sId]) {
aUnexpectedElements.push(mActual[sId]);
}
}
// enrich with helpful info to more easily identify the leaked control
for (var i = 0; i < aUnexpectedElements.length; i++) {... | javascript | function(assert, mActual, mExpected, sMessage) {
var aUnexpectedElements = [];
for (var sId in mActual) {
if (!mExpected[sId]) {
aUnexpectedElements.push(mActual[sId]);
}
}
// enrich with helpful info to more easily identify the leaked control
for (var i = 0; i < aUnexpectedElements.length; i++) {... | [
"function",
"(",
"assert",
",",
"mActual",
",",
"mExpected",
",",
"sMessage",
")",
"{",
"var",
"aUnexpectedElements",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"sId",
"in",
"mActual",
")",
"{",
"if",
"(",
"!",
"mExpected",
"[",
"sId",
"]",
")",
"{",
"... | asserts that both given maps have the same entries | [
"asserts",
"that",
"both",
"given",
"maps",
"have",
"the",
"same",
"entries"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/utils/MemoryLeakCheck.js#L156-L174 | train | Assert that the given objects are not equal | [
30522,
3853,
1006,
20865,
1010,
6097,
26302,
2140,
1010,
2033,
2595,
5051,
10985,
1010,
15488,
7971,
4270,
1007,
1063,
13075,
8740,
2638,
2595,
5051,
10985,
12260,
8163,
1027,
1031,
1033,
1025,
2005,
1006,
13075,
15765,
1999,
6097,
26302,
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... | |
uber/deck.gl | modules/core/src/lifecycle/create-props.js | createPropsPrototype | function createPropsPrototype(props, parentProps, propTypes, componentClass) {
const defaultProps = Object.create(null);
Object.assign(defaultProps, parentProps, props);
// Avoid freezing `id` prop
const id = getComponentName(componentClass);
delete props.id;
// Add getters/setters for async prop propert... | javascript | function createPropsPrototype(props, parentProps, propTypes, componentClass) {
const defaultProps = Object.create(null);
Object.assign(defaultProps, parentProps, props);
// Avoid freezing `id` prop
const id = getComponentName(componentClass);
delete props.id;
// Add getters/setters for async prop propert... | [
"function",
"createPropsPrototype",
"(",
"props",
",",
"parentProps",
",",
"propTypes",
",",
"componentClass",
")",
"{",
"const",
"defaultProps",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"Object",
".",
"assign",
"(",
"defaultProps",
",",
"parentPro... | Builds a pre-merged default props object that component props can inherit from | [
"Builds",
"a",
"pre",
"-",
"merged",
"default",
"props",
"object",
"that",
"component",
"props",
"can",
"inherit",
"from"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/core/src/lifecycle/create-props.js#L139-L162 | train | Create a prototype for the given props object. | [
30522,
3853,
3443,
21572,
4523,
21572,
3406,
13874,
1006,
24387,
1010,
6687,
21572,
4523,
1010,
17678,
13874,
2015,
1010,
6922,
26266,
1007,
1063,
9530,
3367,
12398,
21572,
4523,
1027,
4874,
1012,
3443,
1006,
19701,
1007,
1025,
4874,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/object-shorthand.js | enterFunction | function enterFunction() {
lexicalScopeStack.unshift(new Set());
context.getScope().variables.filter(variable => variable.name === "arguments").forEach(variable => {
variable.references.map(ref => ref.identifier).forEach(identifier => argumentsIdentifiers.add(identifier));
... | javascript | function enterFunction() {
lexicalScopeStack.unshift(new Set());
context.getScope().variables.filter(variable => variable.name === "arguments").forEach(variable => {
variable.references.map(ref => ref.identifier).forEach(identifier => argumentsIdentifiers.add(identifier));
... | [
"function",
"enterFunction",
"(",
")",
"{",
"lexicalScopeStack",
".",
"unshift",
"(",
"new",
"Set",
"(",
")",
")",
";",
"context",
".",
"getScope",
"(",
")",
".",
"variables",
".",
"filter",
"(",
"variable",
"=>",
"variable",
".",
"name",
"===",
"\"argum... | Enters a function. This creates a new lexical identifier scope, so a new Set of arrow functions is pushed onto the stack.
Also, this marks all `arguments` identifiers so that they can be detected later.
@returns {void} | [
"Enters",
"a",
"function",
".",
"This",
"creates",
"a",
"new",
"lexical",
"identifier",
"scope",
"so",
"a",
"new",
"Set",
"of",
"arrow",
"functions",
"is",
"pushed",
"onto",
"the",
"stack",
".",
"Also",
"this",
"marks",
"all",
"arguments",
"identifiers",
"... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/object-shorthand.js#L321-L326 | train | Enter function. | [
30522,
3853,
4607,
11263,
27989,
1006,
1007,
1063,
16105,
9289,
26127,
9153,
3600,
1012,
4895,
6182,
6199,
1006,
2047,
2275,
1006,
1007,
1007,
1025,
6123,
1012,
4152,
16186,
1006,
1007,
1012,
10857,
1012,
11307,
1006,
8023,
1027,
1028,
8023... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-implicit-coercion.js | report | function report(node, recommendation, shouldFix) {
context.report({
node,
message: "use `{{recommendation}}` instead.",
data: {
recommendation
},
fix(fixer) {
if (!shouldFix) {
... | javascript | function report(node, recommendation, shouldFix) {
context.report({
node,
message: "use `{{recommendation}}` instead.",
data: {
recommendation
},
fix(fixer) {
if (!shouldFix) {
... | [
"function",
"report",
"(",
"node",
",",
"recommendation",
",",
"shouldFix",
")",
"{",
"context",
".",
"report",
"(",
"{",
"node",
",",
"message",
":",
"\"use `{{recommendation}}` instead.\"",
",",
"data",
":",
"{",
"recommendation",
"}",
",",
"fix",
"(",
"fi... | Reports an error and autofixes the node
@param {ASTNode} node - An ast node to report the error on.
@param {string} recommendation - The recommended code for the issue
@param {bool} shouldFix - Whether this report should fix the node
@returns {void} | [
"Reports",
"an",
"error",
"and",
"autofixes",
"the",
"node"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-implicit-coercion.js#L204-L228 | train | Reports a node with a given recommendation. | [
30522,
3853,
3189,
1006,
13045,
1010,
12832,
1010,
2323,
8873,
2595,
1007,
1063,
6123,
1012,
3189,
1006,
1063,
13045,
1010,
4471,
1024,
1000,
2224,
1036,
1063,
1063,
12832,
1065,
1065,
1036,
2612,
1012,
1000,
1010,
2951,
1024,
1063,
12832,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/QuickOpenHTML/main.js | FileLocation | function FileLocation(fullPath, line, chFrom, chTo, id) {
this.fullPath = fullPath;
this.line = line;
this.chFrom = chFrom;
this.chTo = chTo;
this.id = id;
} | javascript | function FileLocation(fullPath, line, chFrom, chTo, id) {
this.fullPath = fullPath;
this.line = line;
this.chFrom = chFrom;
this.chTo = chTo;
this.id = id;
} | [
"function",
"FileLocation",
"(",
"fullPath",
",",
"line",
",",
"chFrom",
",",
"chTo",
",",
"id",
")",
"{",
"this",
".",
"fullPath",
"=",
"fullPath",
";",
"this",
".",
"line",
"=",
"line",
";",
"this",
".",
"chFrom",
"=",
"chFrom",
";",
"this",
".",
... | FileLocation class
@constructor
@param {string} fullPath
@param {number} line
@param {number} chFrom column start position
@param {number} chTo column end position
@param {string} id | [
"FileLocation",
"class"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/QuickOpenHTML/main.js#L45-L51 | train | FileLocation constructor. | [
30522,
3853,
5371,
4135,
10719,
1006,
2440,
15069,
1010,
2240,
1010,
10381,
19699,
5358,
1010,
10381,
3406,
1010,
8909,
1007,
1063,
2023,
1012,
2440,
15069,
1027,
2440,
15069,
1025,
2023,
1012,
2240,
1027,
2240,
1025,
2023,
1012,
10381,
196... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
airbnb/enzyme | packages/enzyme/src/selectors.js | matchAdjacentSiblings | function matchAdjacentSiblings(nodes, predicate, root) {
return nodes.reduce((matches, node) => {
const parent = findParentNode(root, node);
// If there's no parent, there's no siblings
if (!parent) {
return matches;
}
const parentChildren = childrenOfNode(parent);
const nodeIndex = pare... | javascript | function matchAdjacentSiblings(nodes, predicate, root) {
return nodes.reduce((matches, node) => {
const parent = findParentNode(root, node);
// If there's no parent, there's no siblings
if (!parent) {
return matches;
}
const parentChildren = childrenOfNode(parent);
const nodeIndex = pare... | [
"function",
"matchAdjacentSiblings",
"(",
"nodes",
",",
"predicate",
",",
"root",
")",
"{",
"return",
"nodes",
".",
"reduce",
"(",
"(",
"matches",
",",
"node",
")",
"=>",
"{",
"const",
"parent",
"=",
"findParentNode",
"(",
"root",
",",
"node",
")",
";",
... | Matches only nodes which are adjacent siblings (direct next sibling)
against a predicate, returning those that match.
@param {Array<Node>} nodes
@param {Function} predicate
@param {Node} root | [
"Matches",
"only",
"nodes",
"which",
"are",
"adjacent",
"siblings",
"(",
"direct",
"next",
"sibling",
")",
"against",
"a",
"predicate",
"returning",
"those",
"that",
"match",
"."
] | cd430eae95eba151f17e970ee77c18f09476de0e | https://github.com/airbnb/enzyme/blob/cd430eae95eba151f17e970ee77c18f09476de0e/packages/enzyme/src/selectors.js#L301-L320 | train | Match adjacent siblings of nodes | [
30522,
3853,
2674,
4215,
3900,
13013,
5332,
9709,
2015,
1006,
14164,
1010,
3653,
16467,
1010,
7117,
1007,
1063,
2709,
14164,
1012,
5547,
1006,
1006,
3503,
1010,
13045,
1007,
1027,
1028,
1063,
9530,
3367,
6687,
1027,
2424,
19362,
4765,
3630,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/preferences/PreferencesBase.js | PreferencesSystem | function PreferencesSystem(contextBuilder) {
this.contextBuilder = contextBuilder;
this._knownPrefs = {};
this._scopes = {
"default": new Scope(new MemoryStorage())
};
this._scopes["default"].load();
this._defaults = {
scopeOrder: ["default"],
... | javascript | function PreferencesSystem(contextBuilder) {
this.contextBuilder = contextBuilder;
this._knownPrefs = {};
this._scopes = {
"default": new Scope(new MemoryStorage())
};
this._scopes["default"].load();
this._defaults = {
scopeOrder: ["default"],
... | [
"function",
"PreferencesSystem",
"(",
"contextBuilder",
")",
"{",
"this",
".",
"contextBuilder",
"=",
"contextBuilder",
";",
"this",
".",
"_knownPrefs",
"=",
"{",
"}",
";",
"this",
".",
"_scopes",
"=",
"{",
"\"default\"",
":",
"new",
"Scope",
"(",
"new",
"... | PreferencesSystem ties everything together to provide a simple interface for
managing the whole prefs system.
It keeps track of multiple Scope levels and also manages path-based Scopes.
It also provides the ability to register preferences, which gives a fine-grained
means for listening for changes and will ultimately... | [
"PreferencesSystem",
"ties",
"everything",
"together",
"to",
"provide",
"a",
"simple",
"interface",
"for",
"managing",
"the",
"whole",
"prefs",
"system",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1240-L1290 | train | Constructs a new PreferencesSystem instance. | [
30522,
3853,
18394,
6508,
13473,
2213,
1006,
6123,
8569,
23891,
2099,
1007,
1063,
2023,
1012,
6123,
8569,
23891,
2099,
1027,
6123,
8569,
23891,
2099,
1025,
2023,
1012,
1035,
2124,
28139,
10343,
1027,
1063,
1065,
1025,
2023,
1012,
1035,
9531... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/WorkingSetSort.js | setAutomatic | function setAutomatic(enable) {
_automaticSort = enable;
PreferencesManager.setViewState("automaticSort", _automaticSort);
CommandManager.get(Commands.CMD_WORKING_SORT_TOGGLE_AUTO).setChecked(_automaticSort);
_currentSort.setChecked(_automaticSort);
if (_automaticSort) {
... | javascript | function setAutomatic(enable) {
_automaticSort = enable;
PreferencesManager.setViewState("automaticSort", _automaticSort);
CommandManager.get(Commands.CMD_WORKING_SORT_TOGGLE_AUTO).setChecked(_automaticSort);
_currentSort.setChecked(_automaticSort);
if (_automaticSort) {
... | [
"function",
"setAutomatic",
"(",
"enable",
")",
"{",
"_automaticSort",
"=",
"enable",
";",
"PreferencesManager",
".",
"setViewState",
"(",
"\"automaticSort\"",
",",
"_automaticSort",
")",
";",
"CommandManager",
".",
"get",
"(",
"Commands",
".",
"CMD_WORKING_SORT_TOG... | Enables/Disables Automatic Sort depending on the value.
@param {boolean} enable True to enable, false to disable. | [
"Enables",
"/",
"Disables",
"Automatic",
"Sort",
"depending",
"on",
"the",
"value",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetSort.js#L153-L164 | train | Set automatic sort | [
30522,
3853,
2275,
4887,
20389,
12070,
1006,
9585,
1007,
1063,
1035,
6882,
21748,
2102,
1027,
9585,
1025,
18394,
24805,
4590,
1012,
2275,
8584,
9153,
2618,
1006,
1000,
6882,
21748,
2102,
1000,
1010,
1035,
6882,
21748,
2102,
1007,
1025,
3094... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/preferences/PreferencesBase.js | function (data, id, value, context, layerID) {
if (!layerID) {
layerID = this.getPreferenceLocation(data, id, context);
}
if (!layerID) {
return false;
}
var section = data[layerID];
if (!section) {
... | javascript | function (data, id, value, context, layerID) {
if (!layerID) {
layerID = this.getPreferenceLocation(data, id, context);
}
if (!layerID) {
return false;
}
var section = data[layerID];
if (!section) {
... | [
"function",
"(",
"data",
",",
"id",
",",
"value",
",",
"context",
",",
"layerID",
")",
"{",
"if",
"(",
"!",
"layerID",
")",
"{",
"layerID",
"=",
"this",
".",
"getPreferenceLocation",
"(",
"data",
",",
"id",
",",
"context",
")",
";",
"}",
"if",
"(",... | Sets the preference value in the given data structure for the layerID provided. If no
layerID is provided, then the current layer is used. If a layerID is provided and it
does not exist, it will be created.
This function returns whether or not a value was set.
@param {Object} data the preference data from the Scope
@... | [
"Sets",
"the",
"preference",
"value",
"in",
"the",
"given",
"data",
"structure",
"for",
"the",
"layerID",
"provided",
".",
"If",
"no",
"layerID",
"is",
"provided",
"then",
"the",
"current",
"layer",
"is",
"used",
".",
"If",
"a",
"layerID",
"is",
"provided"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L928-L950 | train | Set preference value | [
30522,
3853,
1006,
2951,
1010,
8909,
1010,
3643,
1010,
6123,
1010,
6741,
3593,
1007,
1063,
2065,
1006,
999,
6741,
3593,
1007,
1063,
6741,
3593,
1027,
2023,
1012,
2131,
28139,
25523,
4135,
10719,
1006,
2951,
1010,
8909,
1010,
6123,
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... | |
jgraph/mxgraph | javascript/mxClient.js | mxGraphHierarchyEdge | function mxGraphHierarchyEdge(edges)
{
mxGraphAbstractHierarchyCell.apply(this, arguments);
this.edges = edges;
this.ids = [];
for (var i = 0; i < edges.length; i++)
{
this.ids.push(mxObjectIdentity.get(edges[i]));
}
} | javascript | function mxGraphHierarchyEdge(edges)
{
mxGraphAbstractHierarchyCell.apply(this, arguments);
this.edges = edges;
this.ids = [];
for (var i = 0; i < edges.length; i++)
{
this.ids.push(mxObjectIdentity.get(edges[i]));
}
} | [
"function",
"mxGraphHierarchyEdge",
"(",
"edges",
")",
"{",
"mxGraphAbstractHierarchyCell",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"this",
".",
"edges",
"=",
"edges",
";",
"this",
".",
"ids",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxGraphHierarchyEdge
An abstraction of a hierarchical edge for the hierarchy layout
Constructor: mxGraphHierarchyEdge
Constructs a hierarchy edge
Arguments:
edges - a list of real graph edges this abstraction represents | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxGraphHierarchyEdge"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L33179-L33189 | train | A hierarchy edge is a cell that contains a single node. | [
30522,
3853,
25630,
14413,
4048,
6906,
29389,
24225,
1006,
7926,
1007,
1063,
25630,
14413,
7875,
20528,
6593,
4048,
6906,
29389,
29109,
2140,
1012,
6611,
1006,
2023,
1010,
9918,
1007,
1025,
2023,
1012,
7926,
1027,
7926,
1025,
2023,
1012,
89... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GoogleChrome/workbox | packages/workbox-cli/src/app.js | runBuildCommand | async function runBuildCommand({command, config, watch}) {
try {
const {size, count, warnings} = await workboxBuild[command](config);
for (const warning of warnings) {
logger.warn(warning);
}
logger.log(`The service worker was written to ${config.swDest}\n` +
`${count} files will be prec... | javascript | async function runBuildCommand({command, config, watch}) {
try {
const {size, count, warnings} = await workboxBuild[command](config);
for (const warning of warnings) {
logger.warn(warning);
}
logger.log(`The service worker was written to ${config.swDest}\n` +
`${count} files will be prec... | [
"async",
"function",
"runBuildCommand",
"(",
"{",
"command",
",",
"config",
",",
"watch",
"}",
")",
"{",
"try",
"{",
"const",
"{",
"size",
",",
"count",
",",
"warnings",
"}",
"=",
"await",
"workboxBuild",
"[",
"command",
"]",
"(",
"config",
")",
";",
... | Runs the specified build command with the provided configuration.
@param {Object} options | [
"Runs",
"the",
"specified",
"build",
"command",
"with",
"the",
"provided",
"configuration",
"."
] | 8379c51b6deaf52faed5879206fe84579cae41f0 | https://github.com/GoogleChrome/workbox/blob/8379c51b6deaf52faed5879206fe84579cae41f0/packages/workbox-cli/src/app.js#L27-L50 | train | Run the given command on the cluster | [
30522,
2004,
6038,
2278,
3853,
2448,
8569,
4014,
16409,
5358,
2386,
2094,
1006,
1063,
3094,
1010,
9530,
8873,
2290,
1010,
3422,
1065,
1007,
1063,
3046,
1063,
9530,
3367,
1063,
2946,
1010,
4175,
1010,
16234,
1065,
1027,
26751,
2147,
8758,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/publisher/configuration.js | fromConfigFile | function fromConfigFile(config) {
var sharedFileConfig;
try {
var configFile = AWS.util.iniLoader.loadFrom({
isConfig: true,
filename: process.env[AWS.util.sharedConfigFileEnv]
});
var sharedFileConfig = configFile[
process.env.AWS_PROFILE || AWS.util.defaultProfile
];
} catch (e... | javascript | function fromConfigFile(config) {
var sharedFileConfig;
try {
var configFile = AWS.util.iniLoader.loadFrom({
isConfig: true,
filename: process.env[AWS.util.sharedConfigFileEnv]
});
var sharedFileConfig = configFile[
process.env.AWS_PROFILE || AWS.util.defaultProfile
];
} catch (e... | [
"function",
"fromConfigFile",
"(",
"config",
")",
"{",
"var",
"sharedFileConfig",
";",
"try",
"{",
"var",
"configFile",
"=",
"AWS",
".",
"util",
".",
"iniLoader",
".",
"loadFrom",
"(",
"{",
"isConfig",
":",
"true",
",",
"filename",
":",
"process",
".",
"... | Resolve cofigurations from shared config file with specified role name
@param {object} client side monitoring config object needs to be resolved
@returns {boolean} whether resolving configurations is done
@api private | [
"Resolve",
"cofigurations",
"from",
"shared",
"config",
"file",
"with",
"specified",
"role",
"name"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/publisher/configuration.js#L40-L58 | train | Get the config from the shared config file | [
30522,
3853,
2013,
8663,
8873,
25708,
9463,
1006,
9530,
8873,
2290,
1007,
1063,
13075,
4207,
8873,
2571,
8663,
8873,
2290,
1025,
30524,
4372,
2615,
1031,
22091,
2015,
1012,
21183,
4014,
1012,
4207,
8663,
8873,
25708,
9463,
2368,
2615,
1033,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/events/jquery/EventSimulation.js | function(oEvent, oConfig) {
if (oEvent.isMarked("handledByTouchToMouse")) {
return;
}
oEvent.setMarked("handledByTouchToMouse");
if (!bFingerIsMoved) {
var oTouch = oEvent.originalEvent.touches[0];
bFingerIsMoved = (Math.abs(oTouch.pageX - iStartX) > iMoveThreshold ||
Math.abs(oTouch.pageY... | javascript | function(oEvent, oConfig) {
if (oEvent.isMarked("handledByTouchToMouse")) {
return;
}
oEvent.setMarked("handledByTouchToMouse");
if (!bFingerIsMoved) {
var oTouch = oEvent.originalEvent.touches[0];
bFingerIsMoved = (Math.abs(oTouch.pageX - iStartX) > iMoveThreshold ||
Math.abs(oTouch.pageY... | [
"function",
"(",
"oEvent",
",",
"oConfig",
")",
"{",
"if",
"(",
"oEvent",
".",
"isMarked",
"(",
"\"handledByTouchToMouse\"",
")",
")",
"{",
"return",
";",
"}",
"oEvent",
".",
"setMarked",
"(",
"\"handledByTouchToMouse\"",
")",
";",
"if",
"(",
"!",
"bFinger... | This function simulates the corresponding mouse event by listening to touch event (touchmove).
The simulated event will be dispatch through UI5 event delegation which means that the on"EventName" function is called
on control's prototype.
@param {jQuery.Event} oEvent The original event object
@param {object} oConfig ... | [
"This",
"function",
"simulates",
"the",
"corresponding",
"mouse",
"event",
"by",
"listening",
"to",
"touch",
"event",
"(",
"touchmove",
")",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/jquery/EventSimulation.js#L261-L287 | train | This function is called when a touch event is handled by the mouse | [
30522,
3853,
1006,
1051,
18697,
3372,
1010,
1051,
8663,
8873,
2290,
1007,
1063,
2065,
1006,
1051,
18697,
3372,
1012,
2003,
10665,
2098,
1006,
1000,
8971,
3762,
24826,
10143,
19506,
8557,
1000,
1007,
1007,
1063,
2709,
1025,
1065,
1051,
18697... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
Freeboard/freeboard | js/freeboard.thirdparty.js | function(key) {
var style = this.css( key ),
val = [];
$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
if ( style.indexOf( unit ) > 0 ) {
val = [ parseFloat( style ), unit ];
}
});
return val;
} | javascript | function(key) {
var style = this.css( key ),
val = [];
$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
if ( style.indexOf( unit ) > 0 ) {
val = [ parseFloat( style ), unit ];
}
});
return val;
} | [
"function",
"(",
"key",
")",
"{",
"var",
"style",
"=",
"this",
".",
"css",
"(",
"key",
")",
",",
"val",
"=",
"[",
"]",
";",
"$",
".",
"each",
"(",
"[",
"\"em\"",
",",
"\"px\"",
",",
"\"%\"",
",",
"\"pt\"",
"]",
",",
"function",
"(",
"i",
",",... | helper functions | [
"helper",
"functions"
] | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L5999-L6009 | train | get the value of a CSS property | [
30522,
3853,
1006,
3145,
1007,
1063,
13075,
2806,
1027,
2023,
1012,
20116,
2015,
1006,
3145,
1007,
1010,
11748,
1027,
1031,
1033,
1025,
1002,
1012,
2169,
1006,
1031,
1000,
7861,
1000,
1010,
1000,
1052,
2595,
1000,
1010,
1000,
1003,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
Microsoft/BotFramework-WebChat | packages/embed/src/setups/loadAsset.js | loadScript | function loadScript(src, integrity) {
return new Promise((resolve, reject) => {
document.head.appendChild(createElement(
'script',
{
async: true,
crossOrigin: 'anonymous',
integrity,
onError: reject,
onLoad: resolve,
src
}
));
});
} | javascript | function loadScript(src, integrity) {
return new Promise((resolve, reject) => {
document.head.appendChild(createElement(
'script',
{
async: true,
crossOrigin: 'anonymous',
integrity,
onError: reject,
onLoad: resolve,
src
}
));
});
} | [
"function",
"loadScript",
"(",
"src",
",",
"integrity",
")",
"{",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"document",
".",
"head",
".",
"appendChild",
"(",
"createElement",
"(",
"'script'",
",",
"{",
"async",
":",
... | We enable Subresource Integrity to protect our assets on CDN. https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity curl https://cdn.botframework.com/botframework-webchat/4.3.0/webchat.js | openssl dgst -sha384 -binary | openssl base64 -A | [
"We",
"enable",
"Subresource",
"Integrity",
"to",
"protect",
"our",
"assets",
"on",
"CDN",
".",
"https",
":",
"//",
"developer",
".",
"mozilla",
".",
"org",
"/",
"en",
"-",
"US",
"/",
"docs",
"/",
"Web",
"/",
"Security",
"/",
"Subresource_Integrity",
"cu... | 8bc934d3d07d1ca901d52b5e3a9481fddcdbd91e | https://github.com/Microsoft/BotFramework-WebChat/blob/8bc934d3d07d1ca901d52b5e3a9481fddcdbd91e/packages/embed/src/setups/loadAsset.js#L7-L21 | train | Load a script | [
30522,
3853,
15665,
23235,
1006,
5034,
2278,
1010,
11109,
1007,
1063,
2709,
2047,
4872,
1006,
1006,
10663,
1010,
15454,
1007,
1027,
1028,
1063,
6254,
1012,
2132,
1012,
10439,
10497,
19339,
1006,
3443,
12260,
3672,
1006,
1005,
5896,
1005,
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... |
PrismJS/prism | components/prism-asciidoc.js | copyFromAsciiDoc | function copyFromAsciiDoc(keys) {
keys = keys.split(' ');
var o = {};
for (var i = 0, l = keys.length; i < l; i++) {
o[keys[i]] = asciidoc[keys[i]];
}
return o;
} | javascript | function copyFromAsciiDoc(keys) {
keys = keys.split(' ');
var o = {};
for (var i = 0, l = keys.length; i < l; i++) {
o[keys[i]] = asciidoc[keys[i]];
}
return o;
} | [
"function",
"copyFromAsciiDoc",
"(",
"keys",
")",
"{",
"keys",
"=",
"keys",
".",
"split",
"(",
"' '",
")",
";",
"var",
"o",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"=",
"keys",
".",
"length",
";",
"i",
"<",
"l",
";",
... | Allow some nesting. There is no recursion though, so cloning should not be needed. | [
"Allow",
"some",
"nesting",
".",
"There",
"is",
"no",
"recursion",
"though",
"so",
"cloning",
"should",
"not",
"be",
"needed",
"."
] | acceb3b56f0e8362a7ef274dbd85b17611df2ec4 | https://github.com/PrismJS/prism/blob/acceb3b56f0e8362a7ef274dbd85b17611df2ec4/components/prism-asciidoc.js#L203-L211 | train | Copy the contents of an ASCII document to an object | [
30522,
3853,
6100,
19699,
9626,
11020,
6137,
3527,
2278,
1006,
6309,
1007,
1063,
6309,
1027,
6309,
1012,
3975,
1006,
1005,
1005,
1007,
1025,
13075,
1051,
1027,
1063,
1065,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1010,
1048,
1027,
6309,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_Theme | function parse_Theme(blob, length, opts) {
var end = blob.l + length;
var dwThemeVersion = blob.read_shift(4);
if(dwThemeVersion === 124226) return;
if(!opts.cellStyles || !jszip) { blob.l = end; return; }
var data = blob.slice(blob.l);
blob.l = end;
var zip; try { zip = new jszip(data); } catch(e) { return; }
... | javascript | function parse_Theme(blob, length, opts) {
var end = blob.l + length;
var dwThemeVersion = blob.read_shift(4);
if(dwThemeVersion === 124226) return;
if(!opts.cellStyles || !jszip) { blob.l = end; return; }
var data = blob.slice(blob.l);
blob.l = end;
var zip; try { zip = new jszip(data); } catch(e) { return; }
... | [
"function",
"parse_Theme",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"var",
"end",
"=",
"blob",
".",
"l",
"+",
"length",
";",
"var",
"dwThemeVersion",
"=",
"blob",
".",
"read_shift",
"(",
"4",
")",
";",
"if",
"(",
"dwThemeVersion",
"===",
"1... | /* [MS-XLS] 2.4.326 TODO: payload is a zip file | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"4",
".",
"326",
"TODO",
":",
"payload",
"is",
"a",
"zip",
"file"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L9681-L9692 | train | Parse a theme | [
30522,
3853,
11968,
3366,
30524,
1027,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1018,
1007,
1025,
2065,
1006,
1040,
26677,
29122,
22507,
10992,
1027,
1027,
1027,
13412,
19317,
2575,
1007,
2709,
1025,
2065,
1006,
999,
23569,
2015,
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... |
exceljs/exceljs | lib/xlsx/xform/static-xform.js | build | function build(xmlStream, model) {
xmlStream.openNode(model.tag, model.$);
if (model.c) {
model.c.forEach(function(child) {
build(xmlStream, child);
});
}
if (model.t) {
xmlStream.writeText(model.t);
}
xmlStream.closeNode();
} | javascript | function build(xmlStream, model) {
xmlStream.openNode(model.tag, model.$);
if (model.c) {
model.c.forEach(function(child) {
build(xmlStream, child);
});
}
if (model.t) {
xmlStream.writeText(model.t);
}
xmlStream.closeNode();
} | [
"function",
"build",
"(",
"xmlStream",
",",
"model",
")",
"{",
"xmlStream",
".",
"openNode",
"(",
"model",
".",
"tag",
",",
"model",
".",
"$",
")",
";",
"if",
"(",
"model",
".",
"c",
")",
"{",
"model",
".",
"c",
".",
"forEach",
"(",
"function",
"... | var model = { tag: 'name', $: {attr: 'value'}, c: [ { tag: 'child' } ], t: 'some text' }; | [
"var",
"model",
"=",
"{",
"tag",
":",
"name",
"$",
":",
"{",
"attr",
":",
"value",
"}",
"c",
":",
"[",
"{",
"tag",
":",
"child",
"}",
"]",
"t",
":",
"some",
"text",
"}",
";"
] | c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2 | https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/xlsx/xform/static-xform.js#L16-L27 | train | Build XML from model | [
30522,
3853,
3857,
1006,
20950,
30524,
1012,
1039,
1012,
18921,
6776,
1006,
3853,
1006,
2775,
1007,
1063,
3857,
1006,
20950,
21422,
1010,
2775,
1007,
1025,
1065,
1007,
1025,
1065,
2065,
1006,
2944,
1012,
1056,
1007,
1063,
20950,
21422,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controls/TitleLink.js | function (oRm, oTitle) {
var oAssoTitle = oTitle._getTitle(),
sLevel = (oAssoTitle ? oAssoTitle.getLevel() : oTitle.getLevel()) || coreLibrary.TitleLevel.Auto,
bAutoLevel = sLevel == TitleLevel.Auto,
sTag = bAutoLevel ? "div" : sLevel;
oRm.write("<", sTag);
oRm.writeControlData(oTitle);
oRm.add... | javascript | function (oRm, oTitle) {
var oAssoTitle = oTitle._getTitle(),
sLevel = (oAssoTitle ? oAssoTitle.getLevel() : oTitle.getLevel()) || coreLibrary.TitleLevel.Auto,
bAutoLevel = sLevel == TitleLevel.Auto,
sTag = bAutoLevel ? "div" : sLevel;
oRm.write("<", sTag);
oRm.writeControlData(oTitle);
oRm.add... | [
"function",
"(",
"oRm",
",",
"oTitle",
")",
"{",
"var",
"oAssoTitle",
"=",
"oTitle",
".",
"_getTitle",
"(",
")",
",",
"sLevel",
"=",
"(",
"oAssoTitle",
"?",
"oAssoTitle",
".",
"getLevel",
"(",
")",
":",
"oTitle",
".",
"getLevel",
"(",
")",
")",
"||",... | Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
@param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the Render-Output-Buffer
@param {sap.ui.core.Control} oTitle an object representation of the control that should be rendered | [
"Renders",
"the",
"HTML",
"for",
"the",
"given",
"control",
"using",
"the",
"provided",
"{"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controls/TitleLink.js#L135-L207 | train | Renders the title tag | [
30522,
3853,
1006,
2030,
2213,
1010,
27178,
4183,
2571,
1007,
1063,
13075,
1051,
12054,
4140,
4183,
2571,
1027,
27178,
4183,
2571,
1012,
1035,
2131,
3775,
9286,
1006,
1007,
1010,
22889,
18697,
2140,
1027,
1006,
1051,
12054,
4140,
4183,
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/prefs.js | aboutSessionRestore_getElement | function aboutSessionRestore_getElement(spec) {
var elem = null;
switch(spec.type) {
case "button":
elem = new elementslib.Lookup(this._controller.window.document, PREF_DIALOG_BUTTONS +
'/{"dlgtype":"' + spec.subtype + '"}');
break;
case "deck":... | javascript | function aboutSessionRestore_getElement(spec) {
var elem = null;
switch(spec.type) {
case "button":
elem = new elementslib.Lookup(this._controller.window.document, PREF_DIALOG_BUTTONS +
'/{"dlgtype":"' + spec.subtype + '"}');
break;
case "deck":... | [
"function",
"aboutSessionRestore_getElement",
"(",
"spec",
")",
"{",
"var",
"elem",
"=",
"null",
";",
"switch",
"(",
"spec",
".",
"type",
")",
"{",
"case",
"\"button\"",
":",
"elem",
"=",
"new",
"elementslib",
".",
"Lookup",
"(",
"this",
".",
"_controller"... | Retrieve an UI element based on the given spec
@param {object} spec
Information of the UI element which should be retrieved
type: General type information
subtype: Specific element or property
value: Value of the element or property
@returns Element which has been created
@type {ElemBase} | [
"Retrieve",
"an",
"UI",
"element",
"based",
"on",
"the",
"given",
"spec"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/prefs.js#L163-L196 | train | Get the element that is used to restore the session | [
30522,
3853,
2055,
8583,
10992,
28533,
5686,
1035,
2131,
12260,
3672,
1006,
28699,
1007,
1063,
13075,
3449,
6633,
1027,
19701,
1025,
6942,
1006,
28699,
1012,
2828,
1007,
1063,
2553,
1000,
6462,
1000,
1024,
3449,
6633,
1027,
2047,
3787,
2952... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Storage.js | function (RuleSerializer, constants) {
"use strict";
/**
* Encodes rules written by the user.
* @private
* @function
* @name Encode
* @param {string} sData Stringified object containing rule properties.
* @returns {string} base-64 encoded string.
*/
function encode(sData) {
return window.btoa(unesca... | javascript | function (RuleSerializer, constants) {
"use strict";
/**
* Encodes rules written by the user.
* @private
* @function
* @name Encode
* @param {string} sData Stringified object containing rule properties.
* @returns {string} base-64 encoded string.
*/
function encode(sData) {
return window.btoa(unesca... | [
"function",
"(",
"RuleSerializer",
",",
"constants",
")",
"{",
"\"use strict\"",
";",
"/**\n\t * Encodes rules written by the user.\n\t * @private\n\t * @function\n\t * @name Encode\n\t * @param {string} sData Stringified object containing rule properties.\n\t * @returns {string} base-64 encoded s... | @class
The Storage is used to store and recieve data in/from the LocalStorage in the browser.
<h3>Overview</h3>
The Storage class is used to persist user settings.
<h3>Usage</h3>
This class must be used with {@link sap.ui.support.RuleSerializer} and {@link sap.ui.support.Constants} in order to store user data in the Lo... | [
"@class",
"The",
"Storage",
"is",
"used",
"to",
"store",
"and",
"recieve",
"data",
"in",
"/",
"from",
"the",
"LocalStorage",
"in",
"the",
"browser",
".",
"<h3",
">",
"Overview<",
"/",
"h3",
">",
"The",
"Storage",
"class",
"is",
"used",
"to",
"persist",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/Storage.js#L33-L324 | train | The internal function used to serialize temporary rules into the LocalStorage persistence layer. | [
30522,
3853,
1006,
3513,
11610,
28863,
1010,
5377,
2015,
1007,
1063,
1000,
2224,
9384,
1000,
1025,
1013,
1008,
1008,
1008,
4372,
23237,
3513,
2517,
2011,
1996,
5310,
1012,
1008,
1030,
2797,
1008,
1030,
3853,
1008,
1030,
2171,
4372,
16044,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | grunt/config/aliases.js | function() {
var version = grunt.config(['package', 'version']);
config.libraries.forEach(function(library) {
if (library.bower === false) {
return;
}
var bowerFilename = 'tmp/packaged-' + library.name + '/bower.json';
grunt.log.subhead(library.name);
var bower = grunt.file.readJSON... | javascript | function() {
var version = grunt.config(['package', 'version']);
config.libraries.forEach(function(library) {
if (library.bower === false) {
return;
}
var bowerFilename = 'tmp/packaged-' + library.name + '/bower.json';
grunt.log.subhead(library.name);
var bower = grunt.file.readJSON... | [
"function",
"(",
")",
"{",
"var",
"version",
"=",
"grunt",
".",
"config",
"(",
"[",
"'package'",
",",
"'version'",
"]",
")",
";",
"config",
".",
"libraries",
".",
"forEach",
"(",
"function",
"(",
"library",
")",
"{",
"if",
"(",
"library",
".",
"bower... | updates version infos (incl. dependency versions) of bower.json files | [
"updates",
"version",
"infos",
"(",
"incl",
".",
"dependency",
"versions",
")",
"of",
"bower",
".",
"json",
"files"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/grunt/config/aliases.js#L222-L263 | train | update version of all libraries | [
30522,
3853,
1006,
1007,
1063,
13075,
2544,
1027,
20696,
1012,
9530,
8873,
2290,
1006,
1031,
1005,
7427,
1005,
1010,
1005,
2544,
1005,
1033,
1007,
1025,
9530,
8873,
2290,
1012,
8860,
1012,
18921,
6776,
1006,
3853,
1006,
3075,
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... | |
aframevr/aframe | src/components/material.js | function (oldData) {
var data = this.data;
if (!this.shader || data.shader !== oldData.shader) {
this.updateShader(data.shader);
}
this.shader.update(this.data);
this.updateMaterial(oldData);
} | javascript | function (oldData) {
var data = this.data;
if (!this.shader || data.shader !== oldData.shader) {
this.updateShader(data.shader);
}
this.shader.update(this.data);
this.updateMaterial(oldData);
} | [
"function",
"(",
"oldData",
")",
"{",
"var",
"data",
"=",
"this",
".",
"data",
";",
"if",
"(",
"!",
"this",
".",
"shader",
"||",
"data",
".",
"shader",
"!==",
"oldData",
".",
"shader",
")",
"{",
"this",
".",
"updateShader",
"(",
"data",
".",
"shade... | Update or create material.
@param {object|null} oldData | [
"Update",
"or",
"create",
"material",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/material.js#L46-L53 | train | update the shader and material | [
30522,
3853,
1006,
2214,
2850,
2696,
1007,
1063,
13075,
2951,
1027,
2023,
1012,
2951,
1025,
2065,
1006,
999,
2023,
1012,
8703,
2099,
1064,
1064,
2951,
1012,
8703,
2099,
999,
1027,
1027,
2214,
2850,
2696,
1012,
8703,
2099,
1007,
1063,
2023... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Requestor.js | function (sServiceUrl, oModelInterface, mHeaders, mQueryParams, sODataVersion) {
var oRequestor = new Requestor(sServiceUrl, mHeaders, mQueryParams, oModelInterface);
if (sODataVersion === "2.0") {
asV2Requestor(oRequestor);
}
return oRequestor;
} | javascript | function (sServiceUrl, oModelInterface, mHeaders, mQueryParams, sODataVersion) {
var oRequestor = new Requestor(sServiceUrl, mHeaders, mQueryParams, oModelInterface);
if (sODataVersion === "2.0") {
asV2Requestor(oRequestor);
}
return oRequestor;
} | [
"function",
"(",
"sServiceUrl",
",",
"oModelInterface",
",",
"mHeaders",
",",
"mQueryParams",
",",
"sODataVersion",
")",
"{",
"var",
"oRequestor",
"=",
"new",
"Requestor",
"(",
"sServiceUrl",
",",
"mHeaders",
",",
"mQueryParams",
",",
"oModelInterface",
")",
";"... | Creates a new <code>_Requestor</code> instance for the given service URL and default
headers.
@param {string} sServiceUrl
URL of the service document to request the CSRF token from; also used to resolve
relative resource paths (see {@link #request})
@param {object} oModelInterface
An interface allowing to call back to... | [
"Creates",
"a",
"new",
"<code",
">",
"_Requestor<",
"/",
"code",
">",
"instance",
"for",
"the",
"given",
"service",
"URL",
"and",
"default",
"headers",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Requestor.js#L1536-L1544 | train | Creates a new Requestor instance. | [
30522,
3853,
1006,
7020,
2121,
7903,
11236,
2140,
1010,
18168,
10244,
4115,
3334,
12172,
1010,
1049,
4974,
2545,
1010,
1049,
4226,
2854,
28689,
5244,
1010,
14904,
2696,
27774,
1007,
1063,
13075,
10848,
15500,
2953,
1027,
2047,
5227,
2953,
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... | |
BlackrockDigital/startbootstrap-sb-admin-2 | vendor/chart.js/Chart.js | getConstraintDimension | function getConstraintDimension(domNode, maxStyle, percentageProperty) {
var view = document.defaultView;
var parentNode = helpers$1._getParentNode(domNode);
var constrainedNode = view.getComputedStyle(domNode)[maxStyle];
var constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];
var hasCNode = i... | javascript | function getConstraintDimension(domNode, maxStyle, percentageProperty) {
var view = document.defaultView;
var parentNode = helpers$1._getParentNode(domNode);
var constrainedNode = view.getComputedStyle(domNode)[maxStyle];
var constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];
var hasCNode = i... | [
"function",
"getConstraintDimension",
"(",
"domNode",
",",
"maxStyle",
",",
"percentageProperty",
")",
"{",
"var",
"view",
"=",
"document",
".",
"defaultView",
";",
"var",
"parentNode",
"=",
"helpers$1",
".",
"_getParentNode",
"(",
"domNode",
")",
";",
"var",
... | Returns the max width or height of the given DOM node in a cross-browser compatible fashion
@param {HTMLElement} domNode - the node to check the constraint on
@param {string} maxStyle - the style that defines the maximum for the direction we are using ('max-width' / 'max-height')
@param {string} percentageProperty - pr... | [
"Returns",
"the",
"max",
"width",
"or",
"height",
"of",
"the",
"given",
"DOM",
"node",
"in",
"a",
"cross",
"-",
"browser",
"compatible",
"fashion"
] | ddfaceb4a8e65a41f163e2fdc4eab49384b810a1 | https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/ddfaceb4a8e65a41f163e2fdc4eab49384b810a1/vendor/chart.js/Chart.js#L9758-L9774 | train | Returns the max dimension of a constraint. | [
30522,
3853,
2131,
8663,
20528,
18447,
22172,
6132,
3258,
1006,
14383,
3630,
3207,
1010,
4098,
21756,
2571,
1010,
7017,
21572,
4842,
3723,
1007,
1063,
13075,
3193,
1027,
6254,
1012,
12398,
8584,
1025,
13075,
6687,
3630,
3207,
1027,
2393,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_LabelSst | function parse_LabelSst(blob) {
var cell = parse_XLSCell(blob);
cell.isst = blob.read_shift(4);
return cell;
} | javascript | function parse_LabelSst(blob) {
var cell = parse_XLSCell(blob);
cell.isst = blob.read_shift(4);
return cell;
} | [
"function",
"parse_LabelSst",
"(",
"blob",
")",
"{",
"var",
"cell",
"=",
"parse_XLSCell",
"(",
"blob",
")",
";",
"cell",
".",
"isst",
"=",
"blob",
".",
"read_shift",
"(",
"4",
")",
";",
"return",
"cell",
";",
"}"
] | /* [MS-XLS] 2.4.149 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"4",
".",
"149"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L5967-L5971 | train | Parse LabelSst | [
30522,
3853,
11968,
3366,
1035,
10873,
3367,
1006,
1038,
4135,
2497,
1007,
1063,
13075,
3526,
1027,
11968,
3366,
1035,
28712,
11020,
5349,
1006,
1038,
4135,
2497,
1007,
1025,
3526,
1012,
26354,
2102,
1027,
1038,
4135,
2497,
1012,
3191,
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... |
SheetJS/js-xlsx | xlsx.js | parse_FileMoniker | function parse_FileMoniker(blob) {
blob.l += 2; //var cAnti = blob.read_shift(2);
var ansiPath = blob.read_shift(0, 'lpstr-ansi');
blob.l += 2; //var endServer = blob.read_shift(2);
if(blob.read_shift(2) != 0xDEAD) throw new Error("Bad FileMoniker");
var sz = blob.read_shift(4);
if(sz === 0) return ansiPath.repla... | javascript | function parse_FileMoniker(blob) {
blob.l += 2; //var cAnti = blob.read_shift(2);
var ansiPath = blob.read_shift(0, 'lpstr-ansi');
blob.l += 2; //var endServer = blob.read_shift(2);
if(blob.read_shift(2) != 0xDEAD) throw new Error("Bad FileMoniker");
var sz = blob.read_shift(4);
if(sz === 0) return ansiPath.repla... | [
"function",
"parse_FileMoniker",
"(",
"blob",
")",
"{",
"blob",
".",
"l",
"+=",
"2",
";",
"//var cAnti = blob.read_shift(2);",
"var",
"ansiPath",
"=",
"blob",
".",
"read_shift",
"(",
"0",
",",
"'lpstr-ansi'",
")",
";",
"blob",
".",
"l",
"+=",
"2",
";",
"... | /* [MS-OSHARED] 2.3.7.8 FileMoniker TODO: all fields | [
"/",
"*",
"[",
"MS",
"-",
"OSHARED",
"]",
"2",
".",
"3",
".",
"7",
".",
"8",
"FileMoniker",
"TODO",
":",
"all",
"fields"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L5475-L5486 | train | Parse FileMoniker | [
30522,
3853,
11968,
3366,
1035,
5371,
8202,
17339,
2099,
1006,
1038,
4135,
2497,
1007,
1063,
1038,
4135,
2497,
1012,
1048,
1009,
1027,
1016,
1025,
1013,
1013,
13075,
2064,
3775,
1027,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1016,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/Toolbar.js | removeOverflowContentAndPopup | function removeOverflowContentAndPopup() {
if (this.bPopupInitialized) {
this._oOverflowPopup.destroy();
this._oOverflowPopup = null;
this.popup.detachOpened(this.handlePopupOpened, this);
this.popup.detachClosed(this.handlePopupClosed, this);
this.popup.destroy();
this.popup = null;
this... | javascript | function removeOverflowContentAndPopup() {
if (this.bPopupInitialized) {
this._oOverflowPopup.destroy();
this._oOverflowPopup = null;
this.popup.detachOpened(this.handlePopupOpened, this);
this.popup.detachClosed(this.handlePopupClosed, this);
this.popup.destroy();
this.popup = null;
this... | [
"function",
"removeOverflowContentAndPopup",
"(",
")",
"{",
"if",
"(",
"this",
".",
"bPopupInitialized",
")",
"{",
"this",
".",
"_oOverflowPopup",
".",
"destroy",
"(",
")",
";",
"this",
".",
"_oOverflowPopup",
"=",
"null",
";",
"this",
".",
"popup",
".",
"... | Destroy/Remove overflow menu content that is inside the popup and the popup itself
@private | [
"Destroy",
"/",
"Remove",
"overflow",
"menu",
"content",
"that",
"is",
"inside",
"the",
"popup",
"and",
"the",
"popup",
"itself"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/Toolbar.js#L1047-L1057 | train | Removes the overflow content and the popup | [
30522,
3853,
6366,
7840,
12314,
8663,
6528,
5794,
18927,
7361,
6279,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
30524,
26915,
2098,
1010,
2023,
1007,
1025,
2023,
1012,
3769,
6279,
1012,
20010,
6776,
20464,
24768,
1006,
2023,
1012,
5047,
1634... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ksky521/nodeppt | packages/nodeppt/lib/ask.js | render | function render(content, data) {
if (content && /{{([^{}]+)}}/g.test(content)) {
Object.keys(data).forEach(key => {
if (data[key] && typeof data[key] === 'string') {
content = content.split(new RegExp(`{{\\s*${key}\\s*}}`, 'g')).join(data[key]);
}
});
... | javascript | function render(content, data) {
if (content && /{{([^{}]+)}}/g.test(content)) {
Object.keys(data).forEach(key => {
if (data[key] && typeof data[key] === 'string') {
content = content.split(new RegExp(`{{\\s*${key}\\s*}}`, 'g')).join(data[key]);
}
});
... | [
"function",
"render",
"(",
"content",
",",
"data",
")",
"{",
"if",
"(",
"content",
"&&",
"/",
"{{([^{}]+)}}",
"/",
"g",
".",
"test",
"(",
"content",
")",
")",
"{",
"Object",
".",
"keys",
"(",
"data",
")",
".",
"forEach",
"(",
"key",
"=>",
"{",
"i... | 将 default 使用 templateData 渲染一下,比如作者之类的 | [
"将",
"default",
"使用",
"templateData",
"渲染一下,比如作者之类的"
] | ca77e29ef818c08b0522b31e3925b073cf159b9c | https://github.com/ksky521/nodeppt/blob/ca77e29ef818c08b0522b31e3925b073cf159b9c/packages/nodeppt/lib/ask.js#L26-L37 | train | render content with data | [
30522,
3853,
17552,
1006,
4180,
1010,
2951,
1007,
1063,
2065,
1006,
4180,
1004,
1004,
1013,
1063,
1063,
1006,
1031,
1034,
1063,
1065,
1033,
1009,
1007,
1065,
1065,
1013,
1043,
1012,
3231,
1006,
4180,
1007,
1007,
1063,
4874,
1012,
6309,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js | function (vValue) {
var sJSON;
if (typeof vValue !== "function") {
try {
sJSON = Basics.toJSON(vValue);
// undefined --> undefined
// null, NaN, Infinity --> "null"
// all are correctly handled by String
if (sJSON !== undefined && sJSON !== "null") {
return sJSON;
}
} ... | javascript | function (vValue) {
var sJSON;
if (typeof vValue !== "function") {
try {
sJSON = Basics.toJSON(vValue);
// undefined --> undefined
// null, NaN, Infinity --> "null"
// all are correctly handled by String
if (sJSON !== undefined && sJSON !== "null") {
return sJSON;
}
} ... | [
"function",
"(",
"vValue",
")",
"{",
"var",
"sJSON",
";",
"if",
"(",
"typeof",
"vValue",
"!==",
"\"function\"",
")",
"{",
"try",
"{",
"sJSON",
"=",
"Basics",
".",
"toJSON",
"(",
"vValue",
")",
";",
"// undefined --> undefined",
"// null, NaN, Infinity --> \"nu... | Stringifies the value for usage in an error message. Special handling for functions and
object trees with circular references.
@param {any} vValue the value
@returns {string} the stringified value | [
"Stringifies",
"the",
"value",
"for",
"usage",
"in",
"an",
"error",
"message",
".",
"Special",
"handling",
"for",
"functions",
"and",
"object",
"trees",
"with",
"circular",
"references",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js#L401-L418 | train | Converts a value to JSON | [
30522,
3853,
1006,
1058,
10175,
5657,
1007,
1063,
13075,
1055,
22578,
2239,
1025,
2065,
1006,
2828,
11253,
1058,
10175,
5657,
999,
1027,
1027,
1000,
3853,
1000,
1007,
1063,
3046,
1063,
1055,
22578,
2239,
1027,
24078,
1012,
2000,
22578,
2239... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.demokit/src/sap/ui/demokit/util/jsanalyzer/Doclet.js | Doclet | function Doclet(comment) {
this.comment = comment = unwrap(comment);
this.tags = [];
var m;
var lastContent = 0;
var lastTag = "description";
while ((m = rtag.exec(comment)) != null) {
this._addTag(lastTag, comment.slice(lastContent, m.index));
lastTag = m[2];
lastContent = rtag.lastInde... | javascript | function Doclet(comment) {
this.comment = comment = unwrap(comment);
this.tags = [];
var m;
var lastContent = 0;
var lastTag = "description";
while ((m = rtag.exec(comment)) != null) {
this._addTag(lastTag, comment.slice(lastContent, m.index));
lastTag = m[2];
lastContent = rtag.lastInde... | [
"function",
"Doclet",
"(",
"comment",
")",
"{",
"this",
".",
"comment",
"=",
"comment",
"=",
"unwrap",
"(",
"comment",
")",
";",
"this",
".",
"tags",
"=",
"[",
"]",
";",
"var",
"m",
";",
"var",
"lastContent",
"=",
"0",
";",
"var",
"lastTag",
"=",
... | Creates a Doclet from the given comment string
@param {string} comment Comment string.
@constructor
@private | [
"Creates",
"a",
"Doclet",
"from",
"the",
"given",
"comment",
"string"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/util/jsanalyzer/Doclet.js#L42-L56 | train | Doclet constructor. | [
30522,
3853,
9986,
7485,
1006,
7615,
1007,
1063,
2023,
1012,
7615,
1027,
7615,
1027,
4895,
13088,
9331,
1006,
7615,
1007,
1025,
2023,
1012,
22073,
1027,
1031,
1033,
1025,
13075,
1049,
1025,
13075,
2197,
8663,
6528,
2102,
1027,
1014,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FileFilters.js | _handleEditFilter | function _handleEditFilter(e) {
var filterSets = PreferencesManager.get("fileFilters") || [],
filterIndex = $(e.target).parent().data("index") - FIRST_FILTER_INDEX;
// Don't let the click bubble upward.
e.stopPropagation();
// Close the dropdown first before opening the ed... | javascript | function _handleEditFilter(e) {
var filterSets = PreferencesManager.get("fileFilters") || [],
filterIndex = $(e.target).parent().data("index") - FIRST_FILTER_INDEX;
// Don't let the click bubble upward.
e.stopPropagation();
// Close the dropdown first before opening the ed... | [
"function",
"_handleEditFilter",
"(",
"e",
")",
"{",
"var",
"filterSets",
"=",
"PreferencesManager",
".",
"get",
"(",
"\"fileFilters\"",
")",
"||",
"[",
"]",
",",
"filterIndex",
"=",
"$",
"(",
"e",
".",
"target",
")",
".",
"parent",
"(",
")",
".",
"dat... | Close filter dropdwon list and launch edit filter dialog.
@param {!Event} e Mouse events | [
"Close",
"filter",
"dropdwon",
"list",
"and",
"launch",
"edit",
"filter",
"dialog",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L466-L479 | train | Handles the edit filter click event. | [
30522,
3853,
1035,
5047,
2098,
4183,
8873,
21928,
1006,
1041,
1007,
1063,
13075,
17736,
8454,
1027,
18394,
24805,
4590,
1012,
2131,
1006,
1000,
5371,
8873,
21928,
2015,
1000,
1007,
1064,
1064,
1031,
1033,
1010,
11307,
22254,
10288,
1027,
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... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(node) {
var range = rangy.createRange(this.doc);
range.setStartAfter(node);
range.setEndAfter(node);
return this.setSelection(range);
} | javascript | function(node) {
var range = rangy.createRange(this.doc);
range.setStartAfter(node);
range.setEndAfter(node);
return this.setSelection(range);
} | [
"function",
"(",
"node",
")",
"{",
"var",
"range",
"=",
"rangy",
".",
"createRange",
"(",
"this",
".",
"doc",
")",
";",
"range",
".",
"setStartAfter",
"(",
"node",
")",
";",
"range",
".",
"setEndAfter",
"(",
"node",
")",
";",
"return",
"this",
".",
... | Set the caret after the given node
@param {Object} node The element or text node where to position the caret in front of
@example
selection.setBefore(myElement); | [
"Set",
"the",
"caret",
"after",
"the",
"given",
"node"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L8810-L8816 | train | Set selection to the node after the node | [
30522,
3853,
1006,
13045,
1007,
1063,
13075,
2846,
1027,
8369,
2100,
1012,
3443,
24388,
2063,
1006,
2023,
1012,
9986,
1007,
1025,
2846,
1012,
4520,
7559,
2696,
6199,
2121,
1006,
13045,
1007,
1025,
2846,
1012,
2275,
10497,
10354,
3334,
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... | |
codemirror/CodeMirror | src/model/history.js | getOldSpans | function getOldSpans(doc, change) {
let found = change["spans_" + doc.id]
if (!found) return null
let nw = []
for (let i = 0; i < change.text.length; ++i)
nw.push(removeClearedSpans(found[i]))
return nw
} | javascript | function getOldSpans(doc, change) {
let found = change["spans_" + doc.id]
if (!found) return null
let nw = []
for (let i = 0; i < change.text.length; ++i)
nw.push(removeClearedSpans(found[i]))
return nw
} | [
"function",
"getOldSpans",
"(",
"doc",
",",
"change",
")",
"{",
"let",
"found",
"=",
"change",
"[",
"\"spans_\"",
"+",
"doc",
".",
"id",
"]",
"if",
"(",
"!",
"found",
")",
"return",
"null",
"let",
"nw",
"=",
"[",
"]",
"for",
"(",
"let",
"i",
"=",... | Retrieve and filter the old marked spans stored in a change event. | [
"Retrieve",
"and",
"filter",
"the",
"old",
"marked",
"spans",
"stored",
"in",
"a",
"change",
"event",
"."
] | dab6f676107c10ba8d16c654a42f66cae3f27db1 | https://github.com/codemirror/CodeMirror/blob/dab6f676107c10ba8d16c654a42f66cae3f27db1/src/model/history.js#L169-L176 | train | Get old spans from a change | [
30522,
3853,
2131,
11614,
13102,
6962,
1006,
9986,
1010,
2689,
1007,
1063,
2292,
2179,
1027,
2689,
1031,
1000,
14798,
1035,
1000,
1009,
9986,
1012,
8909,
1033,
2065,
1006,
999,
2179,
1007,
2709,
19701,
2292,
22064,
1027,
1031,
1033,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Manifest.js | function(sUri, sRelativeTo) {
var oUri = this._resolveUri(new URI(sUri), sRelativeTo);
return oUri && oUri.toString();
} | javascript | function(sUri, sRelativeTo) {
var oUri = this._resolveUri(new URI(sUri), sRelativeTo);
return oUri && oUri.toString();
} | [
"function",
"(",
"sUri",
",",
"sRelativeTo",
")",
"{",
"var",
"oUri",
"=",
"this",
".",
"_resolveUri",
"(",
"new",
"URI",
"(",
"sUri",
")",
",",
"sRelativeTo",
")",
";",
"return",
"oUri",
"&&",
"oUri",
".",
"toString",
"(",
")",
";",
"}"
] | Resolves the given URI relative to the Component by default
or optional relative to the manifest when passing 'manifest'
as second parameter.
@param {string} sUri URI to resolve as string
@param {string} [sRelativeTo='component'] defines to which base URI the given URI will be resolved to; one of ‘component' (default)... | [
"Resolves",
"the",
"given",
"URI",
"relative",
"to",
"the",
"Component",
"by",
"default",
"or",
"optional",
"relative",
"to",
"the",
"manifest",
"when",
"passing",
"manifest",
"as",
"second",
"parameter",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Manifest.js#L599-L602 | train | Resolves the given URI and returns the absolute URI | [
30522,
3853,
1006,
7505,
2072,
1010,
5034,
10581,
6024,
3406,
1007,
1063,
13075,
2256,
2072,
1027,
2023,
1012,
1035,
10663,
9496,
1006,
2047,
24471,
2072,
1006,
7505,
2072,
1007,
1010,
5034,
10581,
6024,
3406,
1007,
1025,
2709,
2256,
2072,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jhipster/generator-jhipster | generators/aws-containers/prompts.js | askScaling | function askScaling() {
if (this.abort) return null;
const done = this.async();
const chainPromises = index => {
if (index === this.appConfigs.length) {
done();
return null;
}
const config = this.appConfigs[index];
const awsConfig = this.aws.apps.find(... | javascript | function askScaling() {
if (this.abort) return null;
const done = this.async();
const chainPromises = index => {
if (index === this.appConfigs.length) {
done();
return null;
}
const config = this.appConfigs[index];
const awsConfig = this.aws.apps.find(... | [
"function",
"askScaling",
"(",
")",
"{",
"if",
"(",
"this",
".",
"abort",
")",
"return",
"null",
";",
"const",
"done",
"=",
"this",
".",
"async",
"(",
")",
";",
"const",
"chainPromises",
"=",
"index",
"=>",
"{",
"if",
"(",
"index",
"===",
"this",
"... | Ask about scaling | [
"Ask",
"about",
"scaling"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/aws-containers/prompts.js#L291-L313 | train | Ask scaling for a new application | [
30522,
3853,
5176,
9289,
2075,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
11113,
11589,
1007,
2709,
19701,
1025,
9530,
3367,
2589,
1027,
2023,
1012,
2004,
6038,
2278,
1006,
1007,
1025,
9530,
3367,
4677,
21572,
28732,
2015,
1027,
5950,
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 | third_party/js/mozmill/shared-modules/utils.js | handleWindow | function handleWindow(type, text, callback, dontClose) {
// Set the window opener function to use depending on the type
var func_ptr = null;
switch (type) {
case "type":
func_ptr = mozmill.utils.getWindowByType;
break;
case "title":
func_ptr = mozmill.utils.getWindowByTitle;
break;... | javascript | function handleWindow(type, text, callback, dontClose) {
// Set the window opener function to use depending on the type
var func_ptr = null;
switch (type) {
case "type":
func_ptr = mozmill.utils.getWindowByType;
break;
case "title":
func_ptr = mozmill.utils.getWindowByTitle;
break;... | [
"function",
"handleWindow",
"(",
"type",
",",
"text",
",",
"callback",
",",
"dontClose",
")",
"{",
"// Set the window opener function to use depending on the type",
"var",
"func_ptr",
"=",
"null",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"\"type\"",
":",
"fun... | Function to handle non-modal windows
@param {string} type
Specifies how to check for the new window (possible values: type or title)
@param {string} text
The window type of title string to search for
@param {function} callback (optional)
Callback function to call for window specific tests
@param {boolean} dontClose (o... | [
"Function",
"to",
"handle",
"non",
"-",
"modal",
"windows"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/utils.js#L373-L425 | train | Handles a window opener | [
30522,
30524,
2828,
13075,
4569,
2278,
1035,
13866,
2099,
1027,
19701,
1025,
6942,
1006,
2828,
1007,
1063,
2553,
1000,
2828,
1000,
1024,
4569,
2278,
1035,
13866,
2099,
1027,
9587,
2480,
19912,
1012,
21183,
12146,
1012,
2131,
11101,
5004,
37... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.