repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function(sPropertyName) {
var oResult = null;
for (var i = -1, oCurrentSorter; (oCurrentSorter = this._aSortCondition[++i]) !== undefined;) {
if (oCurrentSorter.property.name === sPropertyName) {
oResult = {
sorter : oCurrentSorter,
index : i
};
break;
}
}
return oResult;
... | javascript | function(sPropertyName) {
var oResult = null;
for (var i = -1, oCurrentSorter; (oCurrentSorter = this._aSortCondition[++i]) !== undefined;) {
if (oCurrentSorter.property.name === sPropertyName) {
oResult = {
sorter : oCurrentSorter,
index : i
};
break;
}
}
return oResult;
... | [
"function",
"(",
"sPropertyName",
")",
"{",
"var",
"oResult",
"=",
"null",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"oCurrentSorter",
";",
"(",
"oCurrentSorter",
"=",
"this",
".",
"_aSortCondition",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",... | Checks if an order by expression for the given property is already
defined and returns a reference to an object with property sorter and
index of the object or null if the property is not yet defined in an
order by expression.
@private | [
"Checks",
"if",
"an",
"order",
"by",
"expression",
"for",
"the",
"given",
"property",
"is",
"already",
"defined",
"and",
"returns",
"a",
"reference",
"to",
"an",
"object",
"with",
"property",
"sorter",
"and",
"index",
"of",
"the",
"object",
"or",
"null",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3635-L3647 | train | Returns the highest priority sorting condition for the given property name. | [
30522,
3853,
1006,
11867,
18981,
15010,
18442,
1007,
1063,
13075,
10848,
23722,
2102,
1027,
19701,
1025,
2005,
1006,
13075,
1045,
1027,
1011,
1015,
1010,
1051,
10841,
14343,
7666,
11589,
2121,
1025,
1006,
1051,
10841,
14343,
7666,
11589,
2121... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/utils/ExtensionUtils.js | getModulePath | function getModulePath(module, path) {
var modulePath = module.uri.substr(0, module.uri.lastIndexOf("/") + 1);
if (path) {
modulePath += path;
}
return modulePath;
} | javascript | function getModulePath(module, path) {
var modulePath = module.uri.substr(0, module.uri.lastIndexOf("/") + 1);
if (path) {
modulePath += path;
}
return modulePath;
} | [
"function",
"getModulePath",
"(",
"module",
",",
"path",
")",
"{",
"var",
"modulePath",
"=",
"module",
".",
"uri",
".",
"substr",
"(",
"0",
",",
"module",
".",
"uri",
".",
"lastIndexOf",
"(",
"\"/\"",
")",
"+",
"1",
")",
";",
"if",
"(",
"path",
")"... | Returns a path to an extension module.
@param {!module} module Module provided by RequireJS
@param {?string} path Relative path from the extension folder to a file
@return {!string} The path to the module's folder | [
"Returns",
"a",
"path",
"to",
"an",
"extension",
"module",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ExtensionUtils.js#L137-L144 | train | Get the module path | [
30522,
3853,
2131,
5302,
8566,
2571,
15069,
1006,
11336,
1010,
4130,
1007,
1063,
13075,
11336,
15069,
1027,
11336,
1012,
24471,
30524,
4130,
1025,
1065,
2709,
11336,
15069,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | lib/discover_endpoint.js | getCacheKey | function getCacheKey(request) {
var service = request.service;
var api = service.api || {};
var operations = api.operations;
var identifiers = {};
if (service.config.region) {
identifiers.region = service.config.region;
}
if (api.serviceId) {
identifiers.serviceId = api.serviceId;
}
if (servic... | javascript | function getCacheKey(request) {
var service = request.service;
var api = service.api || {};
var operations = api.operations;
var identifiers = {};
if (service.config.region) {
identifiers.region = service.config.region;
}
if (api.serviceId) {
identifiers.serviceId = api.serviceId;
}
if (servic... | [
"function",
"getCacheKey",
"(",
"request",
")",
"{",
"var",
"service",
"=",
"request",
".",
"service",
";",
"var",
"api",
"=",
"service",
".",
"api",
"||",
"{",
"}",
";",
"var",
"operations",
"=",
"api",
".",
"operations",
";",
"var",
"identifiers",
"=... | Generate key (except resources and operation part) to index the endpoints in the cache
If input shape has endpointdiscoveryid trait then use
accessKey + operation + resources + region + service as cache key
If input shape doesn't have endpointdiscoveryid trait then use
accessKey + region + service as cache key
@return ... | [
"Generate",
"key",
"(",
"except",
"resources",
"and",
"operation",
"part",
")",
"to",
"index",
"the",
"endpoints",
"in",
"the",
"cache",
"If",
"input",
"shape",
"has",
"endpointdiscoveryid",
"trait",
"then",
"use",
"accessKey",
"+",
"operation",
"+",
"resource... | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L14-L29 | train | Get the cache key for a given service | [
30522,
3853,
2131,
3540,
5403,
14839,
1006,
5227,
1007,
1063,
13075,
2326,
1027,
5227,
1012,
2326,
1025,
13075,
17928,
1027,
2326,
1012,
17928,
1064,
1064,
1063,
1065,
1025,
13075,
3136,
1027,
17928,
1012,
3136,
1025,
13075,
8909,
4765,
282... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | annotationAtParameter | function annotationAtParameter(sSegment, sWholeSegment) {
var mAnnotationsXAllOverloads,
sIndividualOverloadTarget,
aOverloads,
sSignature = "",
sTerm = sWholeSegment.slice(sSegment.length);
if (sTerm && maybeParameter(sSegment, vResult)) {
// not looking for parameter itself, but for ... | javascript | function annotationAtParameter(sSegment, sWholeSegment) {
var mAnnotationsXAllOverloads,
sIndividualOverloadTarget,
aOverloads,
sSignature = "",
sTerm = sWholeSegment.slice(sSegment.length);
if (sTerm && maybeParameter(sSegment, vResult)) {
// not looking for parameter itself, but for ... | [
"function",
"annotationAtParameter",
"(",
"sSegment",
",",
"sWholeSegment",
")",
"{",
"var",
"mAnnotationsXAllOverloads",
",",
"sIndividualOverloadTarget",
",",
"aOverloads",
",",
"sSignature",
"=",
"\"\"",
",",
"sTerm",
"=",
"sWholeSegment",
".",
"slice",
"(",
"sSe... | current object /*
Handles annotation at action/function parameter, taking care of individual versus all
overloads.
@param {string} sSegment
The current <code>sSegment</code> of <code>step</code>
@param {string} sWholeSegment
The current <code>aSegments[i]</code> of <code>step</code>
@returns {boolean}
<code>undefined<... | [
"current",
"object",
"/",
"*",
"Handles",
"annotation",
"at",
"action",
"/",
"function",
"parameter",
"taking",
"care",
"of",
"individual",
"versus",
"all",
"overloads",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L977-L1023 | train | This function is called when a parameter is found in the scope. | [
30522,
3853,
5754,
17287,
3508,
4017,
28689,
22828,
1006,
7020,
13910,
3672,
1010,
25430,
19990,
13910,
3672,
1007,
1063,
13075,
10856,
17287,
9285,
18684,
7174,
6299,
11066,
2015,
1010,
8254,
4305,
17258,
8787,
7840,
11066,
7559,
18150,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/semi.js | maybeAsiHazardAfter | function maybeAsiHazardAfter(node) {
const t = node.type;
if (t === "DoWhileStatement" ||
t === "BreakStatement" ||
t === "ContinueStatement" ||
t === "DebuggerStatement" ||
t === "ImportDeclaration" ||
t === "Expor... | javascript | function maybeAsiHazardAfter(node) {
const t = node.type;
if (t === "DoWhileStatement" ||
t === "BreakStatement" ||
t === "ContinueStatement" ||
t === "DebuggerStatement" ||
t === "ImportDeclaration" ||
t === "Expor... | [
"function",
"maybeAsiHazardAfter",
"(",
"node",
")",
"{",
"const",
"t",
"=",
"node",
".",
"type",
";",
"if",
"(",
"t",
"===",
"\"DoWhileStatement\"",
"||",
"t",
"===",
"\"BreakStatement\"",
"||",
"t",
"===",
"\"ContinueStatement\"",
"||",
"t",
"===",
"\"Debu... | Check whether a given node can connect the next line if the next line is unreliable.
@param {Node} node A statement node to check.
@returns {boolean} `true` if the node can connect the next line. | [
"Check",
"whether",
"a",
"given",
"node",
"can",
"connect",
"the",
"next",
"line",
"if",
"the",
"next",
"line",
"is",
"unreliable",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/semi.js#L178-L201 | train | AlihazardAfter is a bug in the code | [
30522,
3853,
2672,
21369,
3270,
26154,
10354,
3334,
1006,
13045,
1007,
1063,
9530,
3367,
1056,
1027,
13045,
1012,
2828,
1025,
2065,
1006,
1056,
1027,
1027,
1027,
1000,
23268,
19466,
4355,
3686,
3672,
1000,
1064,
1064,
1056,
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... |
cypress-io/cypress | scripts/utils.js | getNameAndBinary | function getNameAndBinary (args = process.argv) {
const options = minimist(args)
la(is.unemptyString(options.npm),
'missing --npm option', options)
la(is.unemptyString(options.binary),
'missing --binary option', options)
let npm = options.npm
if (fs.existsSync(options.npm)) {
console.log('loadi... | javascript | function getNameAndBinary (args = process.argv) {
const options = minimist(args)
la(is.unemptyString(options.npm),
'missing --npm option', options)
la(is.unemptyString(options.binary),
'missing --binary option', options)
let npm = options.npm
if (fs.existsSync(options.npm)) {
console.log('loadi... | [
"function",
"getNameAndBinary",
"(",
"args",
"=",
"process",
".",
"argv",
")",
"{",
"const",
"options",
"=",
"minimist",
"(",
"args",
")",
"la",
"(",
"is",
".",
"unemptyString",
"(",
"options",
".",
"npm",
")",
",",
"'missing --npm option'",
",",
"options"... | /* eslint-disable no-console | [
"/",
"*",
"eslint",
"-",
"disable",
"no",
"-",
"console"
] | bf1a942944f0e99684ff7fe0e18314332e46f83e | https://github.com/cypress-io/cypress/blob/bf1a942944f0e99684ff7fe0e18314332e46f83e/scripts/utils.js#L9-L37 | train | get name and binary from args | [
30522,
3853,
2131,
18442,
5685,
21114,
2854,
1006,
12098,
5620,
1027,
2832,
1012,
12098,
2290,
2615,
1007,
1063,
9530,
3367,
7047,
1027,
7163,
23738,
1006,
12098,
5620,
1007,
2474,
1006,
2003,
1012,
16655,
27718,
27268,
4892,
1006,
7047,
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(deleteRecordings) {
var bDeleteRecordings = deleteRecordings || false;
_private.oLog.info(sModuleName + " - Get Recordings");
return _private.getHarContent(bDeleteRecordings);
} | javascript | function(deleteRecordings) {
var bDeleteRecordings = deleteRecordings || false;
_private.oLog.info(sModuleName + " - Get Recordings");
return _private.getHarContent(bDeleteRecordings);
} | [
"function",
"(",
"deleteRecordings",
")",
"{",
"var",
"bDeleteRecordings",
"=",
"deleteRecordings",
"||",
"false",
";",
"_private",
".",
"oLog",
".",
"info",
"(",
"sModuleName",
"+",
"\" - Get Recordings\"",
")",
";",
"return",
"_private",
".",
"getHarContent",
... | Delivers the current recordings in HAR format during record mode and the recording is not aborted.
Requests which are not completed with readyState 4 are not included.
@param {boolean} [deleteRecordings] True if the recordings should be deleted.
@returns {Object} The har file as json. | [
"Delivers",
"the",
"current",
"recordings",
"in",
"HAR",
"format",
"during",
"record",
"mode",
"and",
"the",
"recording",
"is",
"not",
"aborted",
".",
"Requests",
"which",
"are",
"not",
"completed",
"with",
"readyState",
"4",
"are",
"not",
"included",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L773-L777 | train | Get the HAR content | [
30522,
3853,
1006,
3972,
15141,
8586,
8551,
8613,
1007,
1063,
13075,
1038,
9247,
15141,
8586,
8551,
8613,
1027,
3972,
15141,
8586,
8551,
8613,
1064,
1064,
6270,
1025,
1035,
2797,
1012,
19330,
8649,
1012,
18558,
30524,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/webdriver.js | executeCommand | function executeCommand(executor, command) {
return toWireValue(command.getParameters()).
then(function(parameters) {
command.setParameters(parameters);
return executor.execute(command);
});
} | javascript | function executeCommand(executor, command) {
return toWireValue(command.getParameters()).
then(function(parameters) {
command.setParameters(parameters);
return executor.execute(command);
});
} | [
"function",
"executeCommand",
"(",
"executor",
",",
"command",
")",
"{",
"return",
"toWireValue",
"(",
"command",
".",
"getParameters",
"(",
")",
")",
".",
"then",
"(",
"function",
"(",
"parameters",
")",
"{",
"command",
".",
"setParameters",
"(",
"parameter... | //////////////////////////////////////////////////////////////////////////// WebDriver ////////////////////////////////////////////////////////////////////////////
Translates a command to its wire-protocol representation before passing it
to the given `executor` for execution.
@param {!command.Executor} executor The... | [
"////////////////////////////////////////////////////////////////////////////",
"WebDriver",
"////////////////////////////////////////////////////////////////////////////",
"Translates",
"a",
"command",
"to",
"its",
"wire",
"-",
"protocol",
"representation",
"before",
"passing",
"it",
... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/selenium-webdriver/lib/webdriver.js#L110-L116 | train | Execute a command | [
30522,
3853,
15389,
9006,
2386,
2094,
1006,
4654,
8586,
16161,
2099,
1010,
3094,
1007,
1063,
2709,
15805,
7442,
10175,
5657,
1006,
3094,
1012,
2131,
28689,
22828,
2015,
1006,
1007,
1007,
1012,
2059,
1006,
3853,
1006,
11709,
1007,
1063,
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... |
fex-team/webuploader | _draft/music/webuploader.js | function( type/*, args...*/ ) {
var args = [].slice.call( arguments, 1 ),
opts = this.options,
name = 'on' + type.substring( 0, 1 ).toUpperCase() +
type.substring( 1 );
if ( Mediator.trigger.apply( this, arguments ) ===... | javascript | function( type/*, args...*/ ) {
var args = [].slice.call( arguments, 1 ),
opts = this.options,
name = 'on' + type.substring( 0, 1 ).toUpperCase() +
type.substring( 1 );
if ( Mediator.trigger.apply( this, arguments ) ===... | [
"function",
"(",
"type",
"/*, args...*/",
")",
"{",
"var",
"args",
"=",
"[",
"]",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
",",
"opts",
"=",
"this",
".",
"options",
",",
"name",
"=",
"'on'",
"+",
"type",
".",
"substring",
"(",
... | 需要重写此方法来来支持opts.onEvent和instance.onEvent的处理器 | [
"需要重写此方法来来支持opts",
".",
"onEvent和instance",
".",
"onEvent的处理器"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/_draft/music/webuploader.js#L779-L800 | train | trigger a event | [
30522,
3853,
1006,
2828,
1013,
1008,
1010,
12098,
5620,
1012,
1012,
1012,
1008,
1013,
1007,
1063,
13075,
12098,
5620,
1027,
1031,
1033,
1012,
14704,
1012,
2655,
1006,
9918,
1010,
1015,
1007,
1010,
23569,
2015,
1027,
2023,
1012,
7047,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/AutoUpdate/main.js | handleValidationStatus | function handleValidationStatus(statusObj) {
enableCheckForUpdateEntry(true);
UpdateStatus.cleanUpdateStatus();
if (statusObj.valid) {
// Installer is validated successfully
var statusValidFn = function () {
// Restart button click handler
... | javascript | function handleValidationStatus(statusObj) {
enableCheckForUpdateEntry(true);
UpdateStatus.cleanUpdateStatus();
if (statusObj.valid) {
// Installer is validated successfully
var statusValidFn = function () {
// Restart button click handler
... | [
"function",
"handleValidationStatus",
"(",
"statusObj",
")",
"{",
"enableCheckForUpdateEntry",
"(",
"true",
")",
";",
"UpdateStatus",
".",
"cleanUpdateStatus",
"(",
")",
";",
"if",
"(",
"statusObj",
".",
"valid",
")",
"{",
"// Installer is validated successfully",
"... | Handles the installer validation callback from Node
@param {object} statusObj - json containing - {
valid - (boolean)true for a valid installer, false otherwise,
installerPath, logFilePath,
installStatusFilePath - for a valid installer,
err - for an invalid installer } | [
"Handles",
"the",
"installer",
"validation",
"callback",
"from",
"Node"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L904-L1018 | train | Handle validation status | [
30522,
3853,
5047,
10175,
8524,
9285,
29336,
2271,
1006,
3570,
16429,
3501,
1007,
1063,
9585,
5403,
3600,
29278,
6279,
13701,
4765,
2854,
1006,
2995,
1007,
1025,
14409,
29336,
2271,
1012,
27686,
27122,
29336,
2271,
1006,
1007,
1025,
2065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
pagekit/vue-resource | dist/vue-resource.esm.js | plugin | function plugin(Vue) {
if (plugin.installed) {
return;
}
Util(Vue);
Vue.url = Url;
Vue.http = Http;
Vue.resource = Resource;
Vue.Promise = PromiseObj;
Object.defineProperties(Vue.prototype, {
$url: {
get: function get() {
return options(Vu... | javascript | function plugin(Vue) {
if (plugin.installed) {
return;
}
Util(Vue);
Vue.url = Url;
Vue.http = Http;
Vue.resource = Resource;
Vue.Promise = PromiseObj;
Object.defineProperties(Vue.prototype, {
$url: {
get: function get() {
return options(Vu... | [
"function",
"plugin",
"(",
"Vue",
")",
"{",
"if",
"(",
"plugin",
".",
"installed",
")",
"{",
"return",
";",
"}",
"Util",
"(",
"Vue",
")",
";",
"Vue",
".",
"url",
"=",
"Url",
";",
"Vue",
".",
"http",
"=",
"Http",
";",
"Vue",
".",
"resource",
"="... | Install plugin. | [
"Install",
"plugin",
"."
] | fe268fa1d6053ede5f34aef9a11e1a424a70446c | https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1507-L1549 | train | Vue plugin for
| [
30522,
3853,
13354,
2378,
1006,
24728,
2063,
1007,
1063,
2065,
1006,
13354,
2378,
1012,
5361,
1007,
1063,
2709,
1025,
1065,
21183,
4014,
1006,
24728,
2063,
1007,
1025,
24728,
2063,
1012,
24471,
2140,
1027,
24471,
2140,
1025,
24728,
2063,
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... |
chartjs/Chart.js | src/core/core.tooltip.js | createTooltipItem | function createTooltipItem(element) {
var xScale = element._xScale;
var yScale = element._yScale || element._scale; // handle radar || polarArea charts
var index = element._index;
var datasetIndex = element._datasetIndex;
var controller = element._chart.getDatasetMeta(datasetIndex).controller;
var indexScale = co... | javascript | function createTooltipItem(element) {
var xScale = element._xScale;
var yScale = element._yScale || element._scale; // handle radar || polarArea charts
var index = element._index;
var datasetIndex = element._datasetIndex;
var controller = element._chart.getDatasetMeta(datasetIndex).controller;
var indexScale = co... | [
"function",
"createTooltipItem",
"(",
"element",
")",
"{",
"var",
"xScale",
"=",
"element",
".",
"_xScale",
";",
"var",
"yScale",
"=",
"element",
".",
"_yScale",
"||",
"element",
".",
"_scale",
";",
"// handle radar || polarArea charts",
"var",
"index",
"=",
"... | Private helper to create a tooltip item model
@param element - the chart element (point, arc, bar) to create the tooltip item for
@return new tooltip item | [
"Private",
"helper",
"to",
"create",
"a",
"tooltip",
"item",
"model"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/core/core.tooltip.js#L210-L229 | train | Create tooltip item for element | [
30522,
3853,
3443,
3406,
27914,
11514,
4221,
2213,
1006,
5783,
1007,
1063,
13075,
1060,
15782,
2571,
1027,
5783,
1012,
1035,
1060,
15782,
2571,
1025,
13075,
1061,
15782,
2571,
1027,
5783,
1012,
1035,
1061,
15782,
2571,
1064,
1064,
5783,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | dist/howler.js | function() {
var self = this || Howler;
var audioTest = null;
// Must wrap in a try/catch because IE11 in server mode throws an error.
try {
audioTest = (typeof Audio !== 'undefined') ? new Audio() : null;
} catch (err) {
return self;
}
if (!audioTest || typeo... | javascript | function() {
var self = this || Howler;
var audioTest = null;
// Must wrap in a try/catch because IE11 in server mode throws an error.
try {
audioTest = (typeof Audio !== 'undefined') ? new Audio() : null;
} catch (err) {
return self;
}
if (!audioTest || typeo... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
"||",
"Howler",
";",
"var",
"audioTest",
"=",
"null",
";",
"// Must wrap in a try/catch because IE11 in server mode throws an error.",
"try",
"{",
"audioTest",
"=",
"(",
"typeof",
"Audio",
"!==",
"'undefined'",
... | Check for browser support for various codecs and cache the results.
@return {Howler} | [
"Check",
"for",
"browser",
"support",
"for",
"various",
"codecs",
"and",
"cache",
"the",
"results",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L235-L274 | train | Get the current state of the current instance. | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1064,
1064,
22912,
2121,
1025,
13075,
5746,
22199,
1027,
19701,
1025,
1013,
1013,
2442,
10236,
1999,
1037,
3046,
1013,
4608,
2138,
29464,
14526,
1999,
8241,
5549,
11618,
2019,
7561,
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... | |
statsd/statsd | lib/mgmt_console.js | existing_stats | function existing_stats(stats_type, bucket){
matches = [];
//typical case: one-off, fully qualified
if (bucket in stats_type) {
matches.push(bucket);
}
//special case: match a whole 'folder' (and subfolders) of stats
if (bucket.slice(-2) == ".*") {
var folder = bucket.slice(0,-1);
for (var na... | javascript | function existing_stats(stats_type, bucket){
matches = [];
//typical case: one-off, fully qualified
if (bucket in stats_type) {
matches.push(bucket);
}
//special case: match a whole 'folder' (and subfolders) of stats
if (bucket.slice(-2) == ".*") {
var folder = bucket.slice(0,-1);
for (var na... | [
"function",
"existing_stats",
"(",
"stats_type",
",",
"bucket",
")",
"{",
"matches",
"=",
"[",
"]",
";",
"//typical case: one-off, fully qualified",
"if",
"(",
"bucket",
"in",
"stats_type",
")",
"{",
"matches",
".",
"push",
"(",
"bucket",
")",
";",
"}",
"//s... | existing_stats - find fully qualified matches for the requested stats bucket
@param stats_type array of all statistics of this type (eg~ timers) to match
@param bucket string to search on, which can be fully qualified,
or end in a .* to search for a folder, like stats.temp.*
@return array of fully qualified stats tha... | [
"existing_stats",
"-",
"find",
"fully",
"qualified",
"matches",
"for",
"the",
"requested",
"stats",
"bucket"
] | ef8e4d76d76c3a0cf771e3724cf79ea22f3c50d9 | https://github.com/statsd/statsd/blob/ef8e4d76d76c3a0cf771e3724cf79ea22f3c50d9/lib/mgmt_console.js#L46-L67 | train | Find existing stats in the stats_type | [
30522,
3853,
4493,
1035,
26319,
1006,
26319,
1035,
2828,
1010,
13610,
1007,
1063,
3503,
1027,
1031,
1033,
1025,
1013,
1013,
5171,
2553,
1024,
2028,
1011,
2125,
1010,
3929,
4591,
2065,
1006,
13610,
1999,
26319,
1035,
2828,
1007,
1063,
3503,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getinsomnia/insomnia | packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js | replaceWithSurround | function replaceWithSurround(text, find, prefix, suffix) {
const escapedString = escapeRegex(find);
const re = new RegExp(escapedString, 'gi');
return text.replace(re, matched => prefix + matched + suffix);
} | javascript | function replaceWithSurround(text, find, prefix, suffix) {
const escapedString = escapeRegex(find);
const re = new RegExp(escapedString, 'gi');
return text.replace(re, matched => prefix + matched + suffix);
} | [
"function",
"replaceWithSurround",
"(",
"text",
",",
"find",
",",
"prefix",
",",
"suffix",
")",
"{",
"const",
"escapedString",
"=",
"escapeRegex",
"(",
"find",
")",
";",
"const",
"re",
"=",
"new",
"RegExp",
"(",
"escapedString",
",",
"'gi'",
")",
";",
"r... | Replace all occurrences of string
@param text
@param find
@param prefix
@param suffix
@returns string | [
"Replace",
"all",
"occurrences",
"of",
"string"
] | e24ce7f7b41246e700c4b9bdb6b34b6652ad589b | https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js#L399-L403 | train | Replace all occurrences of find with prefix and suffix | [
30522,
3853,
5672,
24415,
26210,
22494,
4859,
1006,
3793,
1010,
2424,
1010,
17576,
1010,
16809,
1007,
1063,
9530,
3367,
6376,
3367,
4892,
1027,
4019,
2890,
3351,
2595,
1006,
2424,
1007,
1025,
9530,
3367,
2128,
1027,
2047,
19723,
10288,
2361... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(needle) {
if (arr.indexOf) {
return arr.indexOf(needle);
} else {
for (var i=0, length=arr.length; i<length; i++) {
if (arr[i] === needle) { return i; }
}
return -1;
}
} | javascript | function(needle) {
if (arr.indexOf) {
return arr.indexOf(needle);
} else {
for (var i=0, length=arr.length; i<length; i++) {
if (arr[i] === needle) { return i; }
}
return -1;
}
} | [
"function",
"(",
"needle",
")",
"{",
"if",
"(",
"arr",
".",
"indexOf",
")",
"{",
"return",
"arr",
".",
"indexOf",
"(",
"needle",
")",
";",
"}",
"else",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"length",
"=",
"arr",
".",
"length",
";",
"i",
... | Check whether a given object exists in an array and return index
If no elelemt found returns -1
@example
wysihtml5.lang.array([1, 2]).indexOf(2);
// => 1 | [
"Check",
"whether",
"a",
"given",
"object",
"exists",
"in",
"an",
"array",
"and",
"return",
"index",
"If",
"no",
"elelemt",
"found",
"returns",
"-",
"1"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L4609-L4618 | train | Find the index of a given tag | [
30522,
3853,
1006,
12201,
1007,
1063,
2065,
1006,
12098,
2099,
1012,
5950,
11253,
1007,
1063,
2709,
12098,
2099,
1012,
5950,
11253,
1006,
12201,
1007,
1025,
1065,
2842,
1063,
2005,
1006,
13075,
1045,
1027,
1014,
1010,
3091,
1027,
12098,
209... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
firebase/firebaseui-web | gulpfile.js | buildCss | function buildCss(isRtl) {
const mdlSrcs = gulp.src('stylesheet/mdl.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(cssInlineImages({
webRoot: 'node_modules/material-design-lite/src',
}));
const dialogPolyfillSrcs = gulp.src(
'node_modules/dialog-polyfill/dialog-polyfill.c... | javascript | function buildCss(isRtl) {
const mdlSrcs = gulp.src('stylesheet/mdl.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(cssInlineImages({
webRoot: 'node_modules/material-design-lite/src',
}));
const dialogPolyfillSrcs = gulp.src(
'node_modules/dialog-polyfill/dialog-polyfill.c... | [
"function",
"buildCss",
"(",
"isRtl",
")",
"{",
"const",
"mdlSrcs",
"=",
"gulp",
".",
"src",
"(",
"'stylesheet/mdl.scss'",
")",
".",
"pipe",
"(",
"sass",
".",
"sync",
"(",
")",
".",
"on",
"(",
"'error'",
",",
"sass",
".",
"logError",
")",
")",
".",
... | Builds the CSS for FirebaseUI.
@param {boolean} isRtl Whether to build in right-to-left mode.
@return {*} A stream that finishes when compilation finishes. | [
"Builds",
"the",
"CSS",
"for",
"FirebaseUI",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/gulpfile.js#L297-L318 | train | Build CSS for the given language | [
30522,
3853,
3857,
6169,
2015,
1006,
2003,
5339,
2140,
1007,
1063,
9530,
3367,
9108,
4877,
11890,
2015,
1027,
26546,
1012,
5034,
2278,
1006,
1005,
6782,
21030,
2102,
1013,
9108,
2140,
1012,
8040,
4757,
1005,
1007,
1012,
8667,
1006,
21871,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js | skipTop | function skipTop() {
var sTransformation = "";
if (mQueryOptions.$skip) {
sTransformation = "skip(" + mQueryOptions.$skip + ")";
}
delete mQueryOptions.$skip; // delete 0 value even w/o skip(0)
if (mQueryOptions.$top < Infinity) { // ignore +Infinity, undefined, NaN, ...
if (sTransformati... | javascript | function skipTop() {
var sTransformation = "";
if (mQueryOptions.$skip) {
sTransformation = "skip(" + mQueryOptions.$skip + ")";
}
delete mQueryOptions.$skip; // delete 0 value even w/o skip(0)
if (mQueryOptions.$top < Infinity) { // ignore +Infinity, undefined, NaN, ...
if (sTransformati... | [
"function",
"skipTop",
"(",
")",
"{",
"var",
"sTransformation",
"=",
"\"\"",
";",
"if",
"(",
"mQueryOptions",
".",
"$skip",
")",
"{",
"sTransformation",
"=",
"\"skip(\"",
"+",
"mQueryOptions",
".",
"$skip",
"+",
"\")\"",
";",
"}",
"delete",
"mQueryOptions",
... | /*
Takes care of the $skip/$top system query options and returns the corresponding
transformation(s).
@returns {string} The transformation(s) corresponding to $skip/$top or "". | [
"/",
"*",
"Takes",
"care",
"of",
"the",
"$skip",
"/",
"$top",
"system",
"query",
"options",
"and",
"returns",
"the",
"corresponding",
"transformation",
"(",
"s",
")",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js#L263-L279 | train | skip top | [
30522,
3853,
13558,
14399,
1006,
1007,
1063,
13075,
2358,
5521,
22747,
2953,
28649,
1027,
1000,
1000,
1025,
2065,
1006,
1049,
4226,
2854,
7361,
9285,
1012,
1002,
13558,
1007,
1063,
2358,
5521,
22747,
2953,
28649,
1027,
1000,
13558,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/selenium-core/lib/snapsie.js | Snapsie | function Snapsie() {
// private methods
function isQuirksMode(inDocument) {
return (inDocument.compatMode == 'BackCompat');
}
function getDrawableElement(inDocument) {
if (isQuirksMode(inDocument)) {
var body = inDocument.getElementsByTagName('body')[0];
... | javascript | function Snapsie() {
// private methods
function isQuirksMode(inDocument) {
return (inDocument.compatMode == 'BackCompat');
}
function getDrawableElement(inDocument) {
if (isQuirksMode(inDocument)) {
var body = inDocument.getElementsByTagName('body')[0];
... | [
"function",
"Snapsie",
"(",
")",
"{",
"// private methods",
"function",
"isQuirksMode",
"(",
"inDocument",
")",
"{",
"return",
"(",
"inDocument",
".",
"compatMode",
"==",
"'BackCompat'",
")",
";",
"}",
"function",
"getDrawableElement",
"(",
"inDocument",
")",
"{... | This file wraps the Snapsie ActiveX object, exposing a single saveSnapshot()
method on a the object.
See http://snapsie.sourceforge.net/ | [
"This",
"file",
"wraps",
"the",
"Snapsie",
"ActiveX",
"object",
"exposing",
"a",
"single",
"saveSnapshot",
"()",
"method",
"on",
"a",
"the",
"object",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/lib/snapsie.js#L8-L91 | train | Snapsie Snapsie. | [
30522,
3853,
20057,
2666,
1006,
1007,
1063,
1013,
1013,
2797,
4725,
3853,
2003,
15549,
19987,
5302,
3207,
1006,
11424,
24894,
4765,
1007,
1063,
2709,
1006,
11424,
24894,
4765,
1012,
4012,
4502,
21246,
10244,
1027,
1027,
1005,
2067,
9006,
45... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/qunit/QUnitUtils.js | function (sDateString) {
var iMillis = NativeDate_parse.apply(Date, arguments);
if (sDateString && typeof sDateString === "string") {
// if the year is gt/eq 2034 we need to increment the
// date by one additional day since this is broken in
// PhantomJS => this is a workaround for the upper BUG!
... | javascript | function (sDateString) {
var iMillis = NativeDate_parse.apply(Date, arguments);
if (sDateString && typeof sDateString === "string") {
// if the year is gt/eq 2034 we need to increment the
// date by one additional day since this is broken in
// PhantomJS => this is a workaround for the upper BUG!
... | [
"function",
"(",
"sDateString",
")",
"{",
"var",
"iMillis",
"=",
"NativeDate_parse",
".",
"apply",
"(",
"Date",
",",
"arguments",
")",
";",
"if",
"(",
"sDateString",
"&&",
"typeof",
"sDateString",
"===",
"\"string\"",
")",
"{",
"// if the year is gt/eq 2034 we n... | patch the parse function of the Date | [
"patch",
"the",
"parse",
"function",
"of",
"the",
"Date"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/QUnitUtils.js#L142-L154 | train | Parse the specified date string into milliseconds | [
30522,
3853,
1006,
17371,
8520,
18886,
3070,
1007,
1063,
13075,
10047,
8591,
2483,
1027,
3128,
13701,
1035,
11968,
3366,
1012,
6611,
1006,
3058,
1010,
9918,
1007,
1025,
2065,
1006,
17371,
8520,
18886,
3070,
1004,
1004,
2828,
11253,
17371,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GeekyAnts/vue-native-core | packages/vue-native-core/build.js | observer | function observer (componentClass) {
if (typeof componentClass === 'function' &&
(!componentClass.prototype || !componentClass.prototype.render) && !componentClass.isReactClass && !React.Component.isPrototypeOf(componentClass)
) {
var ObserverComponent = (function (superclass) {
function ObserverCompo... | javascript | function observer (componentClass) {
if (typeof componentClass === 'function' &&
(!componentClass.prototype || !componentClass.prototype.render) && !componentClass.isReactClass && !React.Component.isPrototypeOf(componentClass)
) {
var ObserverComponent = (function (superclass) {
function ObserverCompo... | [
"function",
"observer",
"(",
"componentClass",
")",
"{",
"if",
"(",
"typeof",
"componentClass",
"===",
"'function'",
"&&",
"(",
"!",
"componentClass",
".",
"prototype",
"||",
"!",
"componentClass",
".",
"prototype",
".",
"render",
")",
"&&",
"!",
"componentCla... | Reference to mobx https://github.com/mobxjs/mobx-react-vue/blob/master/src/observer.js | [
"Reference",
"to",
"mobx",
"https",
":",
"//",
"github",
".",
"com",
"/",
"mobxjs",
"/",
"mobx",
"-",
"react",
"-",
"vue",
"/",
"blob",
"/",
"master",
"/",
"src",
"/",
"observer",
".",
"js"
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-native-core/build.js#L3968-L4001 | train | Creates an observer component | [
30522,
3853,
9718,
1006,
6922,
26266,
1007,
1063,
2065,
1006,
2828,
11253,
6922,
26266,
1027,
1027,
1027,
1005,
3853,
1005,
1004,
1004,
1006,
999,
6922,
26266,
1012,
8773,
1064,
1064,
999,
6922,
26266,
1012,
8773,
1012,
17552,
1007,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/function-paren-newline.js | validateParens | function validateParens(parens, elements) {
const leftParen = parens.leftParen;
const rightParen = parens.rightParen;
const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen);
const tokenBeforeRightParen = sourceCode.getTokenBefore(rightParen);
const ha... | javascript | function validateParens(parens, elements) {
const leftParen = parens.leftParen;
const rightParen = parens.rightParen;
const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen);
const tokenBeforeRightParen = sourceCode.getTokenBefore(rightParen);
const ha... | [
"function",
"validateParens",
"(",
"parens",
",",
"elements",
")",
"{",
"const",
"leftParen",
"=",
"parens",
".",
"leftParen",
";",
"const",
"rightParen",
"=",
"parens",
".",
"rightParen",
";",
"const",
"tokenAfterLeftParen",
"=",
"sourceCode",
".",
"getTokenAft... | Validates parens
@param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token
@param {ASTNode[]} elements The arguments or parameters in the list
@returns {void} | [
"Validates",
"parens"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/function-paren-newline.js#L106-L154 | train | Validates parens. | [
30522,
3853,
9398,
3686,
19362,
6132,
1006,
11968,
6132,
1010,
3787,
1007,
1063,
9530,
3367,
2187,
19362,
2368,
1027,
11968,
6132,
1012,
2187,
19362,
2368,
1025,
9530,
3367,
2157,
19362,
2368,
1027,
11968,
6132,
1012,
2157,
19362,
2368,
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... |
electron/electron | script/bump-version.js | updateWinRC | async function updateWinRC (components) {
const filePath = path.resolve(__dirname, '..', 'atom', 'browser', 'resources', 'win', 'atom.rc')
const data = await readFile(filePath, 'utf8')
const arr = data.split('\n')
arr.forEach((line, idx) => {
if (line.includes('FILEVERSION')) {
arr[idx] = ` FILEVERSIO... | javascript | async function updateWinRC (components) {
const filePath = path.resolve(__dirname, '..', 'atom', 'browser', 'resources', 'win', 'atom.rc')
const data = await readFile(filePath, 'utf8')
const arr = data.split('\n')
arr.forEach((line, idx) => {
if (line.includes('FILEVERSION')) {
arr[idx] = ` FILEVERSIO... | [
"async",
"function",
"updateWinRC",
"(",
"components",
")",
"{",
"const",
"filePath",
"=",
"path",
".",
"resolve",
"(",
"__dirname",
",",
"'..'",
",",
"'atom'",
",",
"'browser'",
",",
"'resources'",
",",
"'win'",
",",
"'atom.rc'",
")",
"const",
"data",
"="... | updates atom.rc file with new semver values | [
"updates",
"atom",
".",
"rc",
"file",
"with",
"new",
"semver",
"values"
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/script/bump-version.js#L161-L175 | train | Updates atom. rc file with new version | [
30522,
2004,
6038,
2278,
3853,
10651,
10105,
11890,
1006,
6177,
1007,
1063,
9530,
3367,
5371,
15069,
30524,
1010,
1005,
1012,
1012,
1005,
1010,
1005,
13787,
1005,
1010,
1005,
16602,
1005,
1010,
1005,
4219,
1005,
1010,
1005,
2663,
1005,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js | init | function init(domainManager) {
if (!domainManager.hasDomain("AutoUpdate")) {
domainManager.registerDomain("AutoUpdate", {
major: 0,
minor: 1
});
}
_domainManager = domainManager;
domainManager.registerCommand(
"AutoUpda... | javascript | function init(domainManager) {
if (!domainManager.hasDomain("AutoUpdate")) {
domainManager.registerDomain("AutoUpdate", {
major: 0,
minor: 1
});
}
_domainManager = domainManager;
domainManager.registerCommand(
"AutoUpda... | [
"function",
"init",
"(",
"domainManager",
")",
"{",
"if",
"(",
"!",
"domainManager",
".",
"hasDomain",
"(",
"\"AutoUpdate\"",
")",
")",
"{",
"domainManager",
".",
"registerDomain",
"(",
"\"AutoUpdate\"",
",",
"{",
"major",
":",
"0",
",",
"minor",
":",
"1",... | Initialize the domain with commands and events related to AutoUpdate
@param {DomainManager} domainManager - The DomainManager for AutoUpdateDomain | [
"Initialize",
"the",
"domain",
"with",
"commands",
"and",
"events",
"related",
"to",
"AutoUpdate"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L455-L507 | train | Initializes the auto update command | [
30522,
3853,
1999,
4183,
1006,
5884,
24805,
4590,
1007,
1063,
2065,
1006,
999,
5884,
24805,
4590,
1012,
2038,
9527,
8113,
1006,
1000,
8285,
6279,
13701,
1000,
1007,
1007,
1063,
5884,
24805,
4590,
1012,
4236,
9527,
8113,
1006,
1000,
8285,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | src/core/core.scale.js | computeLabelSizes | function computeLabelSizes(ctx, tickFonts, ticks, caches) {
var length = ticks.length;
var widths = [];
var heights = [];
var offsets = [];
var i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel, widest, highest;
for (i = 0; i < length; ++i) {
label = ticks[i].label;
tickF... | javascript | function computeLabelSizes(ctx, tickFonts, ticks, caches) {
var length = ticks.length;
var widths = [];
var heights = [];
var offsets = [];
var i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel, widest, highest;
for (i = 0; i < length; ++i) {
label = ticks[i].label;
tickF... | [
"function",
"computeLabelSizes",
"(",
"ctx",
",",
"tickFonts",
",",
"ticks",
",",
"caches",
")",
"{",
"var",
"length",
"=",
"ticks",
".",
"length",
";",
"var",
"widths",
"=",
"[",
"]",
";",
"var",
"heights",
"=",
"[",
"]",
";",
"var",
"offsets",
"=",... | Returns {width, height, offset} objects for the first, last, widest, highest tick
labels where offset indicates the anchor point offset from the top in pixels. | [
"Returns",
"{",
"width",
"height",
"offset",
"}",
"objects",
"for",
"the",
"first",
"last",
"widest",
"highest",
"tick",
"labels",
"where",
"offset",
"indicates",
"the",
"anchor",
"point",
"offset",
"from",
"the",
"top",
"in",
"pixels",
"."
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/core/core.scale.js#L103-L155 | train | Compute the sizes of the labels | [
30522,
3853,
24134,
20470,
9050,
10057,
1006,
14931,
2595,
1010,
16356,
14876,
7666,
1010,
16356,
2015,
1010,
17053,
2015,
1007,
1063,
13075,
3091,
1027,
16356,
2015,
1012,
3091,
1025,
13075,
9381,
2015,
1027,
1031,
1033,
1025,
13075,
7535,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
postcss/autoprefixer | lib/hacks/grid-utils.js | parseGridTemplatesData | function parseGridTemplatesData (css) {
let parsed = []
// we walk through every grid-template(-areas) declaration and store
// data with the same area names inside the item
css.walkDecls(/grid-template(-areas)?$/, d => {
let rule = d.parent
let media = getParentMedia(rule)
let gap = getGridGap(d)
... | javascript | function parseGridTemplatesData (css) {
let parsed = []
// we walk through every grid-template(-areas) declaration and store
// data with the same area names inside the item
css.walkDecls(/grid-template(-areas)?$/, d => {
let rule = d.parent
let media = getParentMedia(rule)
let gap = getGridGap(d)
... | [
"function",
"parseGridTemplatesData",
"(",
"css",
")",
"{",
"let",
"parsed",
"=",
"[",
"]",
"// we walk through every grid-template(-areas) declaration and store",
"// data with the same area names inside the item",
"css",
".",
"walkDecls",
"(",
"/",
"grid-template(-areas)?$",
... | Parse data from all grid-template(-areas) declarations
@param {Root} css css root
@return {Object} parsed data | [
"Parse",
"data",
"from",
"all",
"grid",
"-",
"template",
"(",
"-",
"areas",
")",
"declarations"
] | 24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32 | https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L351-L448 | train | Parse grid - templates data | [
30522,
3853,
11968,
3366,
16523,
3593,
18532,
15725,
16150,
6790,
1006,
20116,
2015,
1007,
1063,
2292,
11968,
6924,
1027,
1031,
1033,
1013,
1013,
2057,
3328,
2083,
2296,
8370,
1011,
23561,
1006,
1011,
2752,
1007,
8170,
1998,
3573,
1013,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/components/animation.js | function () {
var propType;
// Route config type.
propType = getPropertyType(this.el, this.data.property);
if (isRawProperty(this.data) && this.data.type === TYPE_COLOR) {
this.updateConfigForRawColor();
} else if (propType === 'vec2' || propType === 'vec3' || propType === 'vec4') {
thi... | javascript | function () {
var propType;
// Route config type.
propType = getPropertyType(this.el, this.data.property);
if (isRawProperty(this.data) && this.data.type === TYPE_COLOR) {
this.updateConfigForRawColor();
} else if (propType === 'vec2' || propType === 'vec3' || propType === 'vec4') {
thi... | [
"function",
"(",
")",
"{",
"var",
"propType",
";",
"// Route config type.",
"propType",
"=",
"getPropertyType",
"(",
"this",
".",
"el",
",",
"this",
".",
"data",
".",
"property",
")",
";",
"if",
"(",
"isRawProperty",
"(",
"this",
".",
"data",
")",
"&&",
... | Update the config before each run. | [
"Update",
"the",
"config",
"before",
"each",
"run",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/animation.js#L422-L434 | train | Update the route config | [
30522,
3853,
1006,
1007,
1063,
13075,
17678,
13874,
1025,
1013,
1013,
2799,
9530,
8873,
2290,
2828,
1012,
17678,
13874,
1027,
2131,
21572,
4842,
3723,
13874,
1006,
2023,
1012,
3449,
1010,
2023,
1012,
2951,
1012,
3200,
1007,
1025,
2065,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
wangfupeng1988/wangEditor | src/js/menus/droplist.js | DropList | function DropList(menu, opt) {
// droplist 所依附的菜单
const editor = menu.editor
this.menu = menu
this.opt = opt
// 容器
const $container = $('<div class="w-e-droplist"></div>')
// 标题
const $title = opt.$title
let titleHtml
if ($title) {
// 替换多语言
titleHtml = $title.htm... | javascript | function DropList(menu, opt) {
// droplist 所依附的菜单
const editor = menu.editor
this.menu = menu
this.opt = opt
// 容器
const $container = $('<div class="w-e-droplist"></div>')
// 标题
const $title = opt.$title
let titleHtml
if ($title) {
// 替换多语言
titleHtml = $title.htm... | [
"function",
"DropList",
"(",
"menu",
",",
"opt",
")",
"{",
"// droplist 所依附的菜单",
"const",
"editor",
"=",
"menu",
".",
"editor",
"this",
".",
"menu",
"=",
"menu",
"this",
".",
"opt",
"=",
"opt",
"// 容器",
"const",
"$container",
"=",
"$",
"(",
"'<div class=... | 构造函数 | [
"构造函数"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/menus/droplist.js#L10-L75 | train | DropList 所依附的菜单 | [
30522,
3853,
4530,
9863,
1006,
12183,
1010,
23569,
1007,
1063,
1013,
1013,
4530,
9863,
100,
100,
100,
1916,
100,
100,
9530,
3367,
3559,
1027,
12183,
1012,
3559,
2023,
1012,
12183,
1027,
12183,
2023,
1012,
23569,
1027,
23569,
1013,
1013,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/core/component.js | wrapPause | function wrapPause (pauseMethod) {
return function pause () {
var sceneEl = this.el.sceneEl;
if (!this.isPlaying) { return; }
pauseMethod.call(this);
this.isPlaying = false;
this.eventsDetach();
// Remove tick behavior.
if (!hasBehavior(this)) { return; }
sceneEl.removeBehavior(this);
... | javascript | function wrapPause (pauseMethod) {
return function pause () {
var sceneEl = this.el.sceneEl;
if (!this.isPlaying) { return; }
pauseMethod.call(this);
this.isPlaying = false;
this.eventsDetach();
// Remove tick behavior.
if (!hasBehavior(this)) { return; }
sceneEl.removeBehavior(this);
... | [
"function",
"wrapPause",
"(",
"pauseMethod",
")",
"{",
"return",
"function",
"pause",
"(",
")",
"{",
"var",
"sceneEl",
"=",
"this",
".",
"el",
".",
"sceneEl",
";",
"if",
"(",
"!",
"this",
".",
"isPlaying",
")",
"{",
"return",
";",
"}",
"pauseMethod",
... | Wrapper for defined pause method.
Pause component by removing tick behavior and calling user's pause method.
@param pauseMethod {function} | [
"Wrapper",
"for",
"defined",
"pause",
"method",
".",
"Pause",
"component",
"by",
"removing",
"tick",
"behavior",
"and",
"calling",
"user",
"s",
"pause",
"method",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/component.js#L761-L772 | train | Wrap pause method to prevent pause from being played | [
30522,
3853,
10236,
4502,
8557,
1006,
8724,
11368,
6806,
2094,
1007,
1063,
2709,
3853,
8724,
1006,
1007,
1063,
13075,
3496,
2884,
1027,
2023,
1012,
3449,
1012,
3496,
2884,
1025,
2065,
1006,
999,
2023,
1012,
2003,
13068,
2075,
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... |
mochajs/mocha | lib/reporters/json-stream.js | JSONStream | function JSONStream(runner, options) {
Base.call(this, runner, options);
var self = this;
var total = runner.total;
runner.once(EVENT_RUN_BEGIN, function() {
writeEvent(['start', {total: total}]);
});
runner.on(EVENT_TEST_PASS, function(test) {
writeEvent(['pass', clean(test)]);
});
runner.o... | javascript | function JSONStream(runner, options) {
Base.call(this, runner, options);
var self = this;
var total = runner.total;
runner.once(EVENT_RUN_BEGIN, function() {
writeEvent(['start', {total: total}]);
});
runner.on(EVENT_TEST_PASS, function(test) {
writeEvent(['pass', clean(test)]);
});
runner.o... | [
"function",
"JSONStream",
"(",
"runner",
",",
"options",
")",
"{",
"Base",
".",
"call",
"(",
"this",
",",
"runner",
",",
"options",
")",
";",
"var",
"self",
"=",
"this",
";",
"var",
"total",
"=",
"runner",
".",
"total",
";",
"runner",
".",
"once",
... | Constructs a new `JSONStream` reporter instance.
@public
@class
@memberof Mocha.reporters
@extends Mocha.reporters.Base
@param {Runner} runner - Instance triggers reporter actions.
@param {Object} [options] - runner options | [
"Constructs",
"a",
"new",
"JSONStream",
"reporter",
"instance",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/json-stream.js#L32-L56 | train | A JSON stream that can be used to write the results of a test. | [
30522,
3853,
1046,
23345,
25379,
1006,
5479,
1010,
7047,
1007,
1063,
2918,
1012,
2655,
1006,
2023,
1010,
5479,
1010,
7047,
1007,
1025,
13075,
2969,
1027,
2023,
1025,
13075,
2561,
1027,
5479,
1012,
2561,
1025,
5479,
1012,
2320,
1006,
2724,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
NetEase/pomelo | lib/components/connector.js | function(self, socket) {
var app = self.app,
sid = socket.id;
var session = self.session.get(sid);
if (session) {
return session;
}
session = self.session.create(sid, app.getServerId(), socket);
logger.debug('[%s] getSession session is created with session id: %s', app.getServerId(), sid);
// bi... | javascript | function(self, socket) {
var app = self.app,
sid = socket.id;
var session = self.session.get(sid);
if (session) {
return session;
}
session = self.session.create(sid, app.getServerId(), socket);
logger.debug('[%s] getSession session is created with session id: %s', app.getServerId(), sid);
// bi... | [
"function",
"(",
"self",
",",
"socket",
")",
"{",
"var",
"app",
"=",
"self",
".",
"app",
",",
"sid",
"=",
"socket",
".",
"id",
";",
"var",
"session",
"=",
"self",
".",
"session",
".",
"get",
"(",
"sid",
")",
";",
"if",
"(",
"session",
")",
"{",... | get session for current connection | [
"get",
"session",
"for",
"current",
"connection"
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/components/connector.js#L331-L367 | train | get session from pool | [
30522,
3853,
1006,
2969,
1010,
22278,
1007,
1063,
13075,
10439,
1027,
2969,
1012,
10439,
1010,
15765,
1027,
22278,
1012,
8909,
1025,
13075,
5219,
1027,
2969,
1012,
5219,
1012,
2131,
1006,
15765,
1007,
1025,
2065,
1006,
5219,
1007,
1063,
270... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/utils/HealthLogger.js | fileClosed | function fileClosed(file) {
if (!file) {
return;
}
var language = LanguageManager.getLanguageForPath(file._path),
size = -1;
function _sendData(fileSize) {
var subType = "";
if(fileSize/1024 <= 1) {
if(fileSize < 0) {
... | javascript | function fileClosed(file) {
if (!file) {
return;
}
var language = LanguageManager.getLanguageForPath(file._path),
size = -1;
function _sendData(fileSize) {
var subType = "";
if(fileSize/1024 <= 1) {
if(fileSize < 0) {
... | [
"function",
"fileClosed",
"(",
"file",
")",
"{",
"if",
"(",
"!",
"file",
")",
"{",
"return",
";",
"}",
"var",
"language",
"=",
"LanguageManager",
".",
"getLanguageForPath",
"(",
"file",
".",
"_path",
")",
",",
"size",
"=",
"-",
"1",
";",
"function",
... | Whenever a file is closed call this function.
The function will send the analytics Data.
We only log the standard filetypes and fileSize
@param {String} filePath The path of the file to be registered | [
"Whenever",
"a",
"file",
"is",
"closed",
"call",
"this",
"function",
".",
"The",
"function",
"will",
"send",
"the",
"analytics",
"Data",
".",
"We",
"only",
"log",
"the",
"standard",
"filetypes",
"and",
"fileSize"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/HealthLogger.js#L216-L268 | train | fileClosed - send analytics data | [
30522,
3853,
5371,
20464,
24768,
1006,
5371,
1007,
1063,
2065,
1006,
999,
5371,
1007,
1063,
2709,
1025,
1065,
13075,
2653,
1027,
2653,
24805,
4590,
1012,
2131,
25023,
6692,
3351,
29278,
15069,
1006,
5371,
1012,
1035,
4130,
1007,
1010,
2946,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
shipshapecode/shepherd | src/js/utils/modal.js | _createMaskRect | function _createMaskRect() {
const element = document.createElementNS(svgNS, 'rect');
_setAttributes(element, {
fill: '#FFFFFF',
height: '100%',
id: elementIds.modalOverlayMaskRect,
width: '100%',
x: '0',
y: '0'
});
return element;
} | javascript | function _createMaskRect() {
const element = document.createElementNS(svgNS, 'rect');
_setAttributes(element, {
fill: '#FFFFFF',
height: '100%',
id: elementIds.modalOverlayMaskRect,
width: '100%',
x: '0',
y: '0'
});
return element;
} | [
"function",
"_createMaskRect",
"(",
")",
"{",
"const",
"element",
"=",
"document",
".",
"createElementNS",
"(",
"svgNS",
",",
"'rect'",
")",
";",
"_setAttributes",
"(",
"element",
",",
"{",
"fill",
":",
"'#FFFFFF'",
",",
"height",
":",
"'100%'",
",",
"id",... | <rect id="modalOverlayMaskRect" x="0" y="0" width="100%" height="100%" fill="#FFFFFF"/> | [
"<rect",
"id",
"=",
"modalOverlayMaskRect",
"x",
"=",
"0",
"y",
"=",
"0",
"width",
"=",
"100%",
"height",
"=",
"100%",
"fill",
"=",
"#FFFFFF",
"/",
">"
] | 0cb1c63fb07b58796358f6d33da5f6405e2b05f4 | https://github.com/shipshapecode/shepherd/blob/0cb1c63fb07b58796358f6d33da5f6405e2b05f4/src/js/utils/modal.js#L46-L59 | train | Creates mask rect | [
30522,
3853,
1035,
3443,
9335,
21638,
22471,
1006,
1007,
1063,
9530,
3367,
5783,
1027,
6254,
1012,
3443,
12260,
3672,
3619,
1006,
17917,
16206,
2015,
1010,
1005,
28667,
2102,
1005,
1007,
1025,
1035,
2275,
19321,
3089,
8569,
4570,
1006,
5783... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/config/config-validator.js | validateEnvironment | function validateEnvironment(environment, envContext, source = null) {
// not having an environment is ok
if (!environment) {
return;
}
Object.keys(environment).forEach(env => {
if (!envContext.get(env)) {
const message = `${source}:\n\tEnvironment key "${env}" is unknown\n... | javascript | function validateEnvironment(environment, envContext, source = null) {
// not having an environment is ok
if (!environment) {
return;
}
Object.keys(environment).forEach(env => {
if (!envContext.get(env)) {
const message = `${source}:\n\tEnvironment key "${env}" is unknown\n... | [
"function",
"validateEnvironment",
"(",
"environment",
",",
"envContext",
",",
"source",
"=",
"null",
")",
"{",
"// not having an environment is ok",
"if",
"(",
"!",
"environment",
")",
"{",
"return",
";",
"}",
"Object",
".",
"keys",
"(",
"environment",
")",
"... | Validates an environment object
@param {Object} environment The environment config object to validate.
@param {Environments} envContext Env context
@param {string} source The name of the configuration source to report in any errors.
@returns {void} | [
"Validates",
"an",
"environment",
"object"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-validator.js#L148-L162 | train | Validate an environment | [
30522,
3853,
9398,
3686,
2368,
21663,
2239,
3672,
1006,
4044,
1010,
4372,
25465,
28040,
18413,
1010,
3120,
1027,
19701,
1007,
1063,
1013,
1013,
2025,
2383,
2019,
4044,
2003,
7929,
2065,
1006,
999,
4044,
1007,
1063,
2709,
1025,
1065,
4874,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/LiveDevMultiBrowser.js | _onDirtyFlagChange | function _onDirtyFlagChange(event, doc) {
if (!isActive() || !_server) {
return;
}
var absolutePath = doc.file.fullPath;
if (_liveDocument.isRelated(absolutePath)) {
// Set status to out of sync if dirty. Otherwise, set it to active status.
_setStatu... | javascript | function _onDirtyFlagChange(event, doc) {
if (!isActive() || !_server) {
return;
}
var absolutePath = doc.file.fullPath;
if (_liveDocument.isRelated(absolutePath)) {
// Set status to out of sync if dirty. Otherwise, set it to active status.
_setStatu... | [
"function",
"_onDirtyFlagChange",
"(",
"event",
",",
"doc",
")",
"{",
"if",
"(",
"!",
"isActive",
"(",
")",
"||",
"!",
"_server",
")",
"{",
"return",
";",
"}",
"var",
"absolutePath",
"=",
"doc",
".",
"file",
".",
"fullPath",
";",
"if",
"(",
"_liveDoc... | 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 show a dirty indicator on the live development icon when they
have unsaved changes, so the user knows s/he needs to save in order to have the page reload.
@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",
"show",
"a",
"dirty",
"indi... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L756-L767 | train | Called when a document is dirty | [
30522,
3853,
1035,
2006,
30524,
9986,
1012,
5371,
1012,
2440,
15069,
1025,
2065,
1006,
1035,
2973,
10085,
27417,
2102,
1012,
2003,
16570,
4383,
1006,
7619,
15069,
1007,
1007,
1063,
1013,
1013,
2275,
3570,
2000,
2041,
1997,
26351,
2065,
6530... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/languageTools/LanguageClientWrapper.js | validateRequestParams | function validateRequestParams(type, params) {
var validatedParams = null;
params = params || {};
//Don't validate if the formatting is done by the caller
if (params.format === MESSAGE_FORMAT.LSP) {
return params;
}
switch (type) {
case ToolingI... | javascript | function validateRequestParams(type, params) {
var validatedParams = null;
params = params || {};
//Don't validate if the formatting is done by the caller
if (params.format === MESSAGE_FORMAT.LSP) {
return params;
}
switch (type) {
case ToolingI... | [
"function",
"validateRequestParams",
"(",
"type",
",",
"params",
")",
"{",
"var",
"validatedParams",
"=",
"null",
";",
"params",
"=",
"params",
"||",
"{",
"}",
";",
"//Don't validate if the formatting is done by the caller",
"if",
"(",
"params",
".",
"format",
"==... | /*
RequestParams creator - sendNotifications/request | [
"/",
"*",
"RequestParams",
"creator",
"-",
"sendNotifications",
"/",
"request"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/languageTools/LanguageClientWrapper.js#L61-L125 | train | Validates the parameters for a request | [
30522,
3853,
9398,
24932,
2063,
15500,
28689,
5244,
1006,
2828,
1010,
11498,
5244,
1007,
1063,
13075,
9398,
4383,
28689,
5244,
1027,
19701,
1025,
11498,
5244,
1027,
11498,
5244,
1064,
1064,
1063,
1065,
1025,
1013,
1013,
2123,
1005,
1056,
93... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ScrollTrackMarkers.js | _renderMarks | function _renderMarks(posArray) {
var html = "",
cm = editor._codeMirror,
editorHt = cm.getScrollerElement().scrollHeight;
// We've pretty much taken these vars and the getY function from CodeMirror's annotatescrollbar addon
// https://github.com/codemirror/CodeMirror/bl... | javascript | function _renderMarks(posArray) {
var html = "",
cm = editor._codeMirror,
editorHt = cm.getScrollerElement().scrollHeight;
// We've pretty much taken these vars and the getY function from CodeMirror's annotatescrollbar addon
// https://github.com/codemirror/CodeMirror/bl... | [
"function",
"_renderMarks",
"(",
"posArray",
")",
"{",
"var",
"html",
"=",
"\"\"",
",",
"cm",
"=",
"editor",
".",
"_codeMirror",
",",
"editorHt",
"=",
"cm",
".",
"getScrollerElement",
"(",
")",
".",
"scrollHeight",
";",
"// We've pretty much taken these vars and... | Add all the given tickmarks to the DOM in a batch | [
"Add",
"all",
"the",
"given",
"tickmarks",
"to",
"the",
"DOM",
"in",
"a",
"batch"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/ScrollTrackMarkers.js#L126-L157 | train | Render marks for a given position | [
30522,
3853,
1035,
17552,
27373,
1006,
13433,
10286,
9447,
1007,
1063,
13075,
16129,
1027,
1000,
1000,
1010,
4642,
1027,
3559,
1012,
1035,
3642,
14503,
29165,
1010,
3559,
11039,
1027,
4642,
1012,
4152,
26775,
14511,
7869,
16930,
4765,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/angular | .circleci/get-commit-range.js | _main | async function _main([buildNumber, compareUrl = '', circleToken = '']) {
try {
if (!buildNumber || isNaN(buildNumber)) {
throw new Error(
'Missing or invalid arguments.\n' +
'Expected: buildNumber (number), compareUrl? (string), circleToken? (string)');
}
if (!compareUrl) {
... | javascript | async function _main([buildNumber, compareUrl = '', circleToken = '']) {
try {
if (!buildNumber || isNaN(buildNumber)) {
throw new Error(
'Missing or invalid arguments.\n' +
'Expected: buildNumber (number), compareUrl? (string), circleToken? (string)');
}
if (!compareUrl) {
... | [
"async",
"function",
"_main",
"(",
"[",
"buildNumber",
",",
"compareUrl",
"=",
"''",
",",
"circleToken",
"=",
"''",
"]",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"buildNumber",
"||",
"isNaN",
"(",
"buildNumber",
")",
")",
"{",
"throw",
"new",
"Error",
"... | Helpers | [
"Helpers"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/.circleci/get-commit-range.js#L100-L120 | train | Main function. | [
30522,
2004,
6038,
2278,
3853,
1035,
2364,
1006,
1031,
3857,
19172,
5677,
1010,
12826,
3126,
2140,
1027,
1005,
1005,
1010,
4418,
18715,
2368,
1027,
1005,
1005,
1033,
1007,
1063,
3046,
1063,
2065,
1006,
999,
3857,
19172,
5677,
1064,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js | function(logger) {
if (typeof logger != "object"
|| typeof logger.info != "function"
|| typeof logger.debug != "function"
|| typeof logger.warning != "function"
|| typeof logger.error != "function"
) {
throw new Error("Logger is not valid. It should implement at least the functions: info, debu... | javascript | function(logger) {
if (typeof logger != "object"
|| typeof logger.info != "function"
|| typeof logger.debug != "function"
|| typeof logger.warning != "function"
|| typeof logger.error != "function"
) {
throw new Error("Logger is not valid. It should implement at least the functions: info, debu... | [
"function",
"(",
"logger",
")",
"{",
"if",
"(",
"typeof",
"logger",
"!=",
"\"object\"",
"||",
"typeof",
"logger",
".",
"info",
"!=",
"\"function\"",
"||",
"typeof",
"logger",
".",
"debug",
"!=",
"\"function\"",
"||",
"typeof",
"logger",
".",
"warning",
"!=... | Sets a custom logger for the log messages of the RequestRecorder.
The logger objects needs to implement the following functions: info, debug, warning, error
@param {object} logger The log object with the required functions. | [
"Sets",
"a",
"custom",
"logger",
"for",
"the",
"log",
"messages",
"of",
"the",
"RequestRecorder",
".",
"The",
"logger",
"objects",
"needs",
"to",
"implement",
"the",
"following",
"functions",
":",
"info",
"debug",
"warning",
"error"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L842-L852 | train | Sets the logger | [
30522,
3853,
1006,
8833,
4590,
1007,
1063,
2065,
1006,
2828,
11253,
8833,
4590,
999,
1027,
1000,
4874,
1000,
1064,
1064,
2828,
11253,
8833,
4590,
1012,
18558,
999,
1027,
1000,
3853,
1000,
1064,
1064,
2828,
11253,
8833,
4590,
1012,
2139,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js | liftChildNodes | function liftChildNodes(oParent, oWithControl, oTarget) {
return visitChildNodes(oParent, oWithControl).then(function () {
var oChild;
oTarget = oTarget || oParent;
while ((oChild = oParent.firstChild)) {
oTarget.parentNode.insertBefore(oChild, oTarget);
}
});
} | javascript | function liftChildNodes(oParent, oWithControl, oTarget) {
return visitChildNodes(oParent, oWithControl).then(function () {
var oChild;
oTarget = oTarget || oParent;
while ((oChild = oParent.firstChild)) {
oTarget.parentNode.insertBefore(oChild, oTarget);
}
});
} | [
"function",
"liftChildNodes",
"(",
"oParent",
",",
"oWithControl",
",",
"oTarget",
")",
"{",
"return",
"visitChildNodes",
"(",
"oParent",
",",
"oWithControl",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"var",
"oChild",
";",
"oTarget",
"=",
"oTarget",
... | Visits the child nodes of the given parent element. Lifts them up by inserting them
before the target element.
@param {Element} oParent the XML DOM DOM element
@param {sap.ui.core.util._with} oWithControl the "with" control
@param {Element} [oTarget=oParent] the target DOM element
@returns {sap.ui.base.SyncPromise}
A ... | [
"Visits",
"the",
"child",
"nodes",
"of",
"the",
"given",
"parent",
"element",
".",
"Lifts",
"them",
"up",
"by",
"inserting",
"them",
"before",
"the",
"target",
"element",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L1207-L1216 | train | Lifts all child nodes of a parent node to the target node. | [
30522,
3853,
6336,
19339,
3630,
6155,
1006,
6728,
12069,
3372,
1010,
27593,
8939,
8663,
13181,
2140,
1010,
27178,
2906,
18150,
1007,
1063,
2709,
3942,
19339,
3630,
6155,
1006,
6728,
12069,
3372,
1010,
27593,
8939,
8663,
13181,
2140,
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... |
adobe/brackets | src/project/FileViewController.js | setFileViewFocus | function setFileViewFocus(fileSelectionFocus) {
if (fileSelectionFocus !== PROJECT_MANAGER && fileSelectionFocus !== WORKING_SET_VIEW) {
console.error("Bad parameter passed to FileViewController.setFileViewFocus");
return;
}
if (_fileSelectionFocus !== fileSelectionFocus... | javascript | function setFileViewFocus(fileSelectionFocus) {
if (fileSelectionFocus !== PROJECT_MANAGER && fileSelectionFocus !== WORKING_SET_VIEW) {
console.error("Bad parameter passed to FileViewController.setFileViewFocus");
return;
}
if (_fileSelectionFocus !== fileSelectionFocus... | [
"function",
"setFileViewFocus",
"(",
"fileSelectionFocus",
")",
"{",
"if",
"(",
"fileSelectionFocus",
"!==",
"PROJECT_MANAGER",
"&&",
"fileSelectionFocus",
"!==",
"WORKING_SET_VIEW",
")",
"{",
"console",
".",
"error",
"(",
"\"Bad parameter passed to FileViewController.setFi... | Modifies the selection focus in the project side bar. A file can either be selected
in the working set (the open files) or in the file tree, but not both.
@param {String} fileSelectionFocus - either PROJECT_MANAGER or WORKING_SET_VIEW | [
"Modifies",
"the",
"selection",
"focus",
"in",
"the",
"project",
"side",
"bar",
".",
"A",
"file",
"can",
"either",
"be",
"selected",
"in",
"the",
"working",
"set",
"(",
"the",
"open",
"files",
")",
"or",
"in",
"the",
"file",
"tree",
"but",
"not",
"both... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileViewController.js#L125-L135 | train | Set file selection focus | [
30522,
3853,
2275,
8873,
20414,
2666,
2860,
14876,
7874,
1006,
6764,
12260,
7542,
14876,
7874,
1007,
1063,
2065,
1006,
6764,
12260,
7542,
14876,
7874,
999,
1027,
1027,
2622,
1035,
3208,
1004,
1004,
6764,
12260,
7542,
14876,
7874,
999,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-return-await.js | reportUnnecessaryAwait | function reportUnnecessaryAwait(node) {
context.report({
node: context.getSourceCode().getFirstToken(node),
loc: node.loc,
message
});
} | javascript | function reportUnnecessaryAwait(node) {
context.report({
node: context.getSourceCode().getFirstToken(node),
loc: node.loc,
message
});
} | [
"function",
"reportUnnecessaryAwait",
"(",
"node",
")",
"{",
"context",
".",
"report",
"(",
"{",
"node",
":",
"context",
".",
"getSourceCode",
"(",
")",
".",
"getFirstToken",
"(",
"node",
")",
",",
"loc",
":",
"node",
".",
"loc",
",",
"message",
"}",
"... | Reports a found unnecessary `await` expression.
@param {ASTNode} node The node representing the `await` expression to report
@returns {void} | [
"Reports",
"a",
"found",
"unnecessary",
"await",
"expression",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-return-await.js#L41-L47 | train | Reports an uncle wait if the node is unnecessary. | [
30522,
3853,
3189,
4609,
2638,
9623,
10286,
3148,
21547,
2102,
1006,
13045,
1007,
1063,
6123,
1012,
3189,
1006,
1063,
13045,
1024,
6123,
1012,
4152,
8162,
3401,
16044,
1006,
1007,
1012,
2131,
8873,
12096,
18715,
2368,
1006,
13045,
1007,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
airyland/vux | src/components/video/zy.media.js | _addClass | function _addClass(el, token) {
if (el.classList) {
el.classList.add(token)
} else if (!_hasClass(el, token)) {
el.className += '' + token
}
} | javascript | function _addClass(el, token) {
if (el.classList) {
el.classList.add(token)
} else if (!_hasClass(el, token)) {
el.className += '' + token
}
} | [
"function",
"_addClass",
"(",
"el",
",",
"token",
")",
"{",
"if",
"(",
"el",
".",
"classList",
")",
"{",
"el",
".",
"classList",
".",
"add",
"(",
"token",
")",
"}",
"else",
"if",
"(",
"!",
"_hasClass",
"(",
"el",
",",
"token",
")",
")",
"{",
"e... | Add class | [
"Add",
"class"
] | 484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6 | https://github.com/airyland/vux/blob/484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6/src/components/video/zy.media.js#L120-L126 | train | Adds a class to an element | [
30522,
3853,
1035,
5587,
26266,
1006,
3449,
1010,
19204,
1007,
1063,
2065,
1006,
3449,
1012,
2465,
9863,
1007,
1063,
3449,
1012,
2465,
9863,
1012,
5587,
1006,
19204,
1007,
1065,
2842,
2065,
1006,
999,
1035,
2038,
26266,
1006,
3449,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v2/ODataTreeBinding.js | function(iStartIndex) {
// check in the sections which where loaded
for (var i = 0; i < that._mLoadedSections[sNodeId].length; i++) {
var oSection = that._mLoadedSections[sNodeId][i];
// try to find i in the loaded sections. If i is within one of the sections it needs not to be loaded again
if (iStart... | javascript | function(iStartIndex) {
// check in the sections which where loaded
for (var i = 0; i < that._mLoadedSections[sNodeId].length; i++) {
var oSection = that._mLoadedSections[sNodeId][i];
// try to find i in the loaded sections. If i is within one of the sections it needs not to be loaded again
if (iStart... | [
"function",
"(",
"iStartIndex",
")",
"{",
"// check in the sections which where loaded",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"that",
".",
"_mLoadedSections",
"[",
"sNodeId",
"]",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"oSection",
"=",... | check whether a start index was already requested | [
"check",
"whether",
"a",
"start",
"index",
"was",
"already",
"requested"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v2/ODataTreeBinding.js#L609-L620 | train | check if the requested index is within the loaded sections | [
30522,
3853,
1006,
21541,
8445,
22254,
10288,
1007,
1063,
1013,
1013,
4638,
1999,
1996,
5433,
2029,
2073,
8209,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
2008,
1012,
1035,
19875,
10441,
5732,
29015,
2015,
1031,
1055,
3630,
3207... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
apache/incubator-echarts | src/coord/single/Single.js | function (point) {
var rect = this.getRect();
var axis = this.getAxis();
var orient = axis.orient;
if (orient === 'horizontal') {
return axis.contain(axis.toLocalCoord(point[0]))
&& (point[1] >= rect.y && point[1] <= (rect.y + rect.height));
}
else... | javascript | function (point) {
var rect = this.getRect();
var axis = this.getAxis();
var orient = axis.orient;
if (orient === 'horizontal') {
return axis.contain(axis.toLocalCoord(point[0]))
&& (point[1] >= rect.y && point[1] <= (rect.y + rect.height));
}
else... | [
"function",
"(",
"point",
")",
"{",
"var",
"rect",
"=",
"this",
".",
"getRect",
"(",
")",
";",
"var",
"axis",
"=",
"this",
".",
"getAxis",
"(",
")",
";",
"var",
"orient",
"=",
"axis",
".",
"orient",
";",
"if",
"(",
"orient",
"===",
"'horizontal'",
... | If contain point.
@param {Array.<number>} point
@return {boolean} | [
"If",
"contain",
"point",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/single/Single.js#L243-L255 | train | Returns true if the given point is inside the image | [
30522,
3853,
1006,
2391,
1007,
1063,
13075,
28667,
2102,
1027,
2023,
1012,
2131,
2890,
6593,
1006,
1007,
1025,
13075,
8123,
1027,
2023,
1012,
2131,
8528,
2483,
1006,
1007,
1025,
13075,
30524,
1012,
1061,
1004,
1004,
2391,
1031,
1015,
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... | |
SheetJS/js-xlsx | xlsx.js | parse_dos_date | function parse_dos_date(buf) {
var hms = buf.read_shift(2) & 0xFFFF;
var ymd = buf.read_shift(2) & 0xFFFF;
var val = new Date();
var d = ymd & 0x1F; ymd >>>= 5;
var m = ymd & 0x0F; ymd >>>= 4;
val.setMilliseconds(0);
val.setFullYear(ymd + 1980);
val.setMonth(m-1);
val.setDate(d);
var S = hms & 0x1F; hms >>>= ... | javascript | function parse_dos_date(buf) {
var hms = buf.read_shift(2) & 0xFFFF;
var ymd = buf.read_shift(2) & 0xFFFF;
var val = new Date();
var d = ymd & 0x1F; ymd >>>= 5;
var m = ymd & 0x0F; ymd >>>= 4;
val.setMilliseconds(0);
val.setFullYear(ymd + 1980);
val.setMonth(m-1);
val.setDate(d);
var S = hms & 0x1F; hms >>>= ... | [
"function",
"parse_dos_date",
"(",
"buf",
")",
"{",
"var",
"hms",
"=",
"buf",
".",
"read_shift",
"(",
"2",
")",
"&",
"0xFFFF",
";",
"var",
"ymd",
"=",
"buf",
".",
"read_shift",
"(",
"2",
")",
"&",
"0xFFFF",
";",
"var",
"val",
"=",
"new",
"Date",
... | /* read four bytes from buf and interpret as a DOS date | [
"/",
"*",
"read",
"four",
"bytes",
"from",
"buf",
"and",
"interpret",
"as",
"a",
"DOS",
"date"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L1291-L1307 | train | Parse a DOS date | [
30522,
3853,
11968,
3366,
1035,
9998,
1035,
3058,
1006,
20934,
2546,
1007,
1063,
13075,
7220,
1027,
20934,
2546,
1012,
3191,
1035,
5670,
1006,
1016,
1007,
1004,
1014,
2595,
4246,
4246,
1025,
13075,
1061,
26876,
1027,
20934,
2546,
1012,
3191... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
LLK/scratch-blocks | blocks_vertical/event.js | function() {
this.jsonInit({
"id": "event_whenkeypressed",
"message0": Blockly.Msg.EVENT_WHENKEYPRESSED,
"args0": [
{
"type": "field_dropdown",
"name": "KEY_OPTION",
"options": [
[Blockly.Msg.EVENT_WHENKEYPRESSED_SPACE, 'space'],
[Block... | javascript | function() {
this.jsonInit({
"id": "event_whenkeypressed",
"message0": Blockly.Msg.EVENT_WHENKEYPRESSED,
"args0": [
{
"type": "field_dropdown",
"name": "KEY_OPTION",
"options": [
[Blockly.Msg.EVENT_WHENKEYPRESSED_SPACE, 'space'],
[Block... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"id\"",
":",
"\"event_whenkeypressed\"",
",",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"EVENT_WHENKEYPRESSED",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
... | Block to send a broadcast.
@this Blockly.Block | [
"Block",
"to",
"send",
"a",
"broadcast",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/event.js#L270-L327 | train | Block for keypressed event. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
8909,
1000,
1024,
1000,
2724,
1035,
2043,
14839,
19811,
1000,
1010,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
2724,
1035,
2043,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/core/util/color.js | rgbaToHex | function rgbaToHex(color) {
color = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
var hex = (color && color.length === 4) ? "#" +
("0" + parseInt(color[1],10).toString(16)).slice(-2) +
("0" + parseInt(color[2],10).toString(16)).slice(-2) +
("0" + parseInt(colo... | javascript | function rgbaToHex(color) {
color = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
var hex = (color && color.length === 4) ? "#" +
("0" + parseInt(color[1],10).toString(16)).slice(-2) +
("0" + parseInt(color[2],10).toString(16)).slice(-2) +
("0" + parseInt(colo... | [
"function",
"rgbaToHex",
"(",
"color",
")",
"{",
"color",
"=",
"color",
".",
"match",
"(",
"/",
"^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?",
"/",
"i",
")",
";",
"var",
"hex",
"=",
"(",
"color",
"&&",
"color",
".",
"length",
"... | Converts rgba value to hex string
@param {string} color
@returns {string} | [
"Converts",
"rgba",
"value",
"to",
"hex",
"string"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/color.js#L36-L45 | train | Converts a rgba color to a hex string | [
30522,
3853,
1054,
18259,
10610,
5369,
2595,
1006,
3609,
1007,
1063,
3609,
1027,
3609,
1012,
2674,
1006,
1013,
1034,
1054,
18259,
2050,
1029,
1031,
1032,
1055,
1009,
1033,
1029,
1032,
1006,
1031,
1032,
1055,
1009,
1033,
1029,
1006,
1032,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_Label | function parse_Label(blob, length, opts) {
var target = blob.l + length;
var cell = parse_XLSCell(blob, 6);
if(opts.biff == 2) blob.l++;
var str = parse_XLUnicodeString(blob, target - blob.l, opts);
cell.val = str;
return cell;
} | javascript | function parse_Label(blob, length, opts) {
var target = blob.l + length;
var cell = parse_XLSCell(blob, 6);
if(opts.biff == 2) blob.l++;
var str = parse_XLUnicodeString(blob, target - blob.l, opts);
cell.val = str;
return cell;
} | [
"function",
"parse_Label",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"var",
"target",
"=",
"blob",
".",
"l",
"+",
"length",
";",
"var",
"cell",
"=",
"parse_XLSCell",
"(",
"blob",
",",
"6",
")",
";",
"if",
"(",
"opts",
".",
"biff",
"==",
... | /* [MS-XLS] 2.4.148 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"4",
".",
"148"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L5974-L5981 | train | Parse a label | [
30522,
3853,
11968,
3366,
1035,
3830,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
13075,
4539,
1027,
1038,
4135,
2497,
1012,
1048,
1009,
3091,
1025,
13075,
3526,
1027,
11968,
3366,
1035,
28712,
11020,
5349,
1006,
1038... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/arrow-spacing.js | countSpaces | function countSpaces(tokens) {
const before = tokens.arrow.range[0] - tokens.before.range[1];
const after = tokens.after.range[0] - tokens.arrow.range[1];
return { before, after };
} | javascript | function countSpaces(tokens) {
const before = tokens.arrow.range[0] - tokens.before.range[1];
const after = tokens.after.range[0] - tokens.arrow.range[1];
return { before, after };
} | [
"function",
"countSpaces",
"(",
"tokens",
")",
"{",
"const",
"before",
"=",
"tokens",
".",
"arrow",
".",
"range",
"[",
"0",
"]",
"-",
"tokens",
".",
"before",
".",
"range",
"[",
"1",
"]",
";",
"const",
"after",
"=",
"tokens",
".",
"after",
".",
"ra... | Count spaces before/after arrow(`=>`) token.
@param {Object} tokens Tokens before/after arrow.
@returns {Object} count of space before/after arrow. | [
"Count",
"spaces",
"before",
"/",
"after",
"arrow",
"(",
"=",
">",
")",
"token",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/arrow-spacing.js#L86-L91 | train | Count spaces in a token | [
30522,
3853,
9294,
15327,
2015,
1006,
19204,
2015,
1007,
1063,
9530,
3367,
2077,
1027,
19204,
2015,
1012,
8612,
1012,
2846,
1031,
1014,
1033,
1011,
19204,
2015,
1012,
2077,
1012,
2846,
1031,
1015,
1033,
1025,
9530,
3367,
2044,
1027,
19204,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/Agents/HighlightAgent.js | domElement | function domElement(ids) {
var selector = "";
if (!Array.isArray(ids)) {
ids = [ids];
}
_.each(ids, function (id) {
if (selector !== "") {
selector += ",";
}
selector += "[data-brackets-id='" + id + "']";
});
... | javascript | function domElement(ids) {
var selector = "";
if (!Array.isArray(ids)) {
ids = [ids];
}
_.each(ids, function (id) {
if (selector !== "") {
selector += ",";
}
selector += "[data-brackets-id='" + id + "']";
});
... | [
"function",
"domElement",
"(",
"ids",
")",
"{",
"var",
"selector",
"=",
"\"\"",
";",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"ids",
")",
")",
"{",
"ids",
"=",
"[",
"ids",
"]",
";",
"}",
"_",
".",
"each",
"(",
"ids",
",",
"function",
"(",
... | Highlight all nodes with 'data-brackets-id' value
that matches id, or if id is an array, matches any of the given ids.
@param {string|Array<string>} value of the 'data-brackets-id' to match,
or an array of such. | [
"Highlight",
"all",
"nodes",
"with",
"data",
"-",
"brackets",
"-",
"id",
"value",
"that",
"matches",
"id",
"or",
"if",
"id",
"is",
"an",
"array",
"matches",
"any",
"of",
"the",
"given",
"ids",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/HighlightAgent.js#L113-L125 | train | Returns the dom element for the specified tag | [
30522,
3853,
8514,
16930,
4765,
1006,
8909,
2015,
1007,
1063,
13075,
27000,
1027,
1000,
1000,
1025,
2065,
1006,
999,
9140,
1012,
18061,
11335,
2100,
1006,
8909,
2015,
1007,
1007,
1063,
8909,
2015,
1027,
1031,
8909,
2015,
1033,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensibility/node/ExtensionManagerDomain.js | init | function init(domainManager) {
if (!domainManager.hasDomain("extensionManager")) {
domainManager.registerDomain("extensionManager", {major: 0, minor: 1});
}
domainManager.registerCommand(
"extensionManager",
"validate",
validate,
true,
"Verifies that the conte... | javascript | function init(domainManager) {
if (!domainManager.hasDomain("extensionManager")) {
domainManager.registerDomain("extensionManager", {major: 0, minor: 1});
}
domainManager.registerCommand(
"extensionManager",
"validate",
validate,
true,
"Verifies that the conte... | [
"function",
"init",
"(",
"domainManager",
")",
"{",
"if",
"(",
"!",
"domainManager",
".",
"hasDomain",
"(",
"\"extensionManager\"",
")",
")",
"{",
"domainManager",
".",
"registerDomain",
"(",
"\"extensionManager\"",
",",
"{",
"major",
":",
"0",
",",
"minor",
... | Initialize the "extensions" domain.
The extensions domain handles downloading, unpacking/verifying, and installing extensions. | [
"Initialize",
"the",
"extensions",
"domain",
".",
"The",
"extensions",
"domain",
"handles",
"downloading",
"unpacking",
"/",
"verifying",
"and",
"installing",
"extensions",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L461-L633 | train | Initializes the extension manager | [
30522,
3853,
1999,
4183,
1006,
5884,
24805,
4590,
1007,
1063,
2065,
1006,
999,
5884,
24805,
4590,
1012,
2038,
9527,
8113,
1006,
1000,
5331,
24805,
4590,
1000,
1007,
1007,
1063,
5884,
24805,
4590,
1012,
4236,
9527,
8113,
1006,
1000,
5331,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/colors/colors.js | MdColorsService | function MdColorsService($mdTheming, $mdUtil, $log) {
colorPalettes = colorPalettes || Object.keys($mdTheming.PALETTES);
// Publish service instance
return {
applyThemeColors: applyThemeColors,
getThemeColor: getThemeColor,
hasTheme: hasTheme
};
// *******************************... | javascript | function MdColorsService($mdTheming, $mdUtil, $log) {
colorPalettes = colorPalettes || Object.keys($mdTheming.PALETTES);
// Publish service instance
return {
applyThemeColors: applyThemeColors,
getThemeColor: getThemeColor,
hasTheme: hasTheme
};
// *******************************... | [
"function",
"MdColorsService",
"(",
"$mdTheming",
",",
"$mdUtil",
",",
"$log",
")",
"{",
"colorPalettes",
"=",
"colorPalettes",
"||",
"Object",
".",
"keys",
"(",
"$mdTheming",
".",
"PALETTES",
")",
";",
"// Publish service instance",
"return",
"{",
"applyThemeColo... | @ngdoc service
@name $mdColors
@module material.components.colors
@description
By default, defining a theme does not make its colors available for applying to non AngularJS
Material elements. The `$mdColors` service is used by the `md-color` directive to convert a
set of color expressions to RGBA values and then apply... | [
"@ngdoc",
"service",
"@name",
"$mdColors",
"@module",
"material",
".",
"components",
".",
"colors"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/colors/colors.js#L56-L249 | train | The MdColorsService provides a service that can be used to apply theme colors to an element. | [
30522,
3853,
9108,
18717,
18116,
7903,
2063,
1006,
1002,
9108,
10760,
6562,
1010,
1002,
9108,
21823,
2140,
1010,
1002,
8833,
1007,
1063,
3609,
12952,
26592,
1027,
3609,
12952,
26592,
1064,
1064,
4874,
1012,
6309,
1006,
1002,
9108,
10760,
65... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
airyland/vux | packages/loader/src/index.js | getBabelLoader | function getBabelLoader(projectRoot, name, isDev) {
name = name || 'vux'
if (!projectRoot) {
projectRoot = path.resolve(__dirname, '../../../')
if (/\.npm/.test(projectRoot)) {
projectRoot = path.resolve(projectRoot, '../../../')
}
}
let componentPath
let regex
if (!isDev) {
... | javascript | function getBabelLoader(projectRoot, name, isDev) {
name = name || 'vux'
if (!projectRoot) {
projectRoot = path.resolve(__dirname, '../../../')
if (/\.npm/.test(projectRoot)) {
projectRoot = path.resolve(projectRoot, '../../../')
}
}
let componentPath
let regex
if (!isDev) {
... | [
"function",
"getBabelLoader",
"(",
"projectRoot",
",",
"name",
",",
"isDev",
")",
"{",
"name",
"=",
"name",
"||",
"'vux'",
"if",
"(",
"!",
"projectRoot",
")",
"{",
"projectRoot",
"=",
"path",
".",
"resolve",
"(",
"__dirname",
",",
"'../../../'",
")",
"if... | use babel so component's js can be compiled | [
"use",
"babel",
"so",
"component",
"s",
"js",
"can",
"be",
"compiled"
] | 484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6 | https://github.com/airyland/vux/blob/484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6/packages/loader/src/index.js#L589-L613 | train | Returns a babel - loader object | [
30522,
3853,
2131,
3676,
17327,
10441,
4063,
1006,
2622,
3217,
4140,
1010,
2171,
1010,
2003,
24844,
1007,
1063,
2171,
1027,
2171,
1064,
1064,
1005,
24728,
2595,
1005,
2065,
1006,
999,
2622,
3217,
4140,
1007,
1063,
2622,
3217,
4140,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/ScopeManager.js | getTernHints | function getTernHints(fileInfo, offset, isProperty) {
/**
* If the document is large and we have modified a small portions of it that
* we are asking hints for, then send a partial document.
*/
postMessage({
type: MessageIds.TERN_COMPLETIONS_MSG,
fil... | javascript | function getTernHints(fileInfo, offset, isProperty) {
/**
* If the document is large and we have modified a small portions of it that
* we are asking hints for, then send a partial document.
*/
postMessage({
type: MessageIds.TERN_COMPLETIONS_MSG,
fil... | [
"function",
"getTernHints",
"(",
"fileInfo",
",",
"offset",
",",
"isProperty",
")",
"{",
"/**\n * If the document is large and we have modified a small portions of it that\n * we are asking hints for, then send a partial document.\n */",
"postMessage",
"(",
"{",
... | Get a Promise for the completions from TernJS, for the file & offset passed in.
@param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
- type of update, name of file, and the text of the update.
For "full" updates, the whole text of the file is present. For "part" updates,
the changed portio... | [
"Get",
"a",
"Promise",
"for",
"the",
"completions",
"from",
"TernJS",
"for",
"the",
"file",
"&",
"offset",
"passed",
"in",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L476-L490 | train | This function is called when the tern process is complete | [
30522,
3853,
2131,
16451,
10606,
3215,
1006,
5371,
2378,
14876,
1010,
16396,
1010,
2003,
21572,
4842,
3723,
1007,
1063,
1013,
1008,
1008,
1008,
2065,
1996,
6254,
2003,
2312,
1998,
2057,
2031,
6310,
1037,
2235,
8810,
1997,
2009,
2008,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function(aUI5Filter) {
if (!Array.isArray(aUI5Filter)) {
throw "Argument is not an array";
}
if (aUI5Filter.length == 0) {
return this;
}
// check if a multi filter is included; otherwise every element simply represents a single condition
var bHasMultiFilter = false;
for (var i = 0; i < aU... | javascript | function(aUI5Filter) {
if (!Array.isArray(aUI5Filter)) {
throw "Argument is not an array";
}
if (aUI5Filter.length == 0) {
return this;
}
// check if a multi filter is included; otherwise every element simply represents a single condition
var bHasMultiFilter = false;
for (var i = 0; i < aU... | [
"function",
"(",
"aUI5Filter",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"aUI5Filter",
")",
")",
"{",
"throw",
"\"Argument is not an array\"",
";",
"}",
"if",
"(",
"aUI5Filter",
".",
"length",
"==",
"0",
")",
"{",
"return",
"this",
";",
"... | Add an array of UI5 filter conditions to the filter expression.
The UI5 filter condition is combined with the other given conditions using a logical AND. This method
is particularly useful for passing forward already created UI5 filter arrays.
@param {sap.ui.model.Filter[]}
aUI5Filter Array of UI5 filter objects
@ret... | [
"Add",
"an",
"array",
"of",
"UI5",
"filter",
"conditions",
"to",
"the",
"filter",
"expression",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3239-L3263 | train | Add a filter to the filter list | [
30522,
3853,
1006,
8740,
2072,
2629,
8873,
21928,
1007,
1063,
2065,
1006,
999,
9140,
1012,
18061,
11335,
2100,
1006,
8740,
2072,
2629,
8873,
21928,
1007,
1007,
1063,
5466,
1000,
6685,
2003,
2025,
2019,
9140,
1000,
1025,
1065,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.codeeditor/src/sap/ui/codeeditor/js/ace/worker-xml.js | function(namespaceURI,localName){
var attr = this.getNamedItemNS(namespaceURI,localName);
_removeNamedNode(this._ownerElement,this,attr);
return attr;
} | javascript | function(namespaceURI,localName){
var attr = this.getNamedItemNS(namespaceURI,localName);
_removeNamedNode(this._ownerElement,this,attr);
return attr;
} | [
"function",
"(",
"namespaceURI",
",",
"localName",
")",
"{",
"var",
"attr",
"=",
"this",
".",
"getNamedItemNS",
"(",
"namespaceURI",
",",
"localName",
")",
";",
"_removeNamedNode",
"(",
"this",
".",
"_ownerElement",
",",
"this",
",",
"attr",
")",
";",
"ret... | raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR | [
"raises",
":",
"NOT_FOUND_ERR",
"NO_MODIFICATION_ALLOWED_ERR"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.codeeditor/src/sap/ui/codeeditor/js/ace/worker-xml.js#L2100-L2104 | train | Removes an attribute from the element. | [
30522,
3853,
1006,
3415,
15327,
9496,
1010,
2334,
18442,
1007,
1063,
13075,
2012,
16344,
1027,
2023,
1012,
2131,
18442,
23194,
6633,
3619,
1006,
3415,
15327,
9496,
1010,
2334,
18442,
1007,
1025,
1035,
6366,
18442,
2094,
3630,
3207,
1006,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/icon/js/iconService.js | loadByDataUrl | function loadByDataUrl(url) {
var results = dataUrlRegex.exec(url);
var isBase64 = /base64/i.test(url);
var data = isBase64 ? window.atob(results[2]) : results[2];
return $q.when(angular.element(data)[0]);
} | javascript | function loadByDataUrl(url) {
var results = dataUrlRegex.exec(url);
var isBase64 = /base64/i.test(url);
var data = isBase64 ? window.atob(results[2]) : results[2];
return $q.when(angular.element(data)[0]);
} | [
"function",
"loadByDataUrl",
"(",
"url",
")",
"{",
"var",
"results",
"=",
"dataUrlRegex",
".",
"exec",
"(",
"url",
")",
";",
"var",
"isBase64",
"=",
"/",
"base64",
"/",
"i",
".",
"test",
"(",
"url",
")",
";",
"var",
"data",
"=",
"isBase64",
"?",
"w... | /* Load the icon from embedded data URL. | [
"/",
"*",
"Load",
"the",
"icon",
"from",
"embedded",
"data",
"URL",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/icon/js/iconService.js#L630-L636 | train | Load the data from a data url | [
30522,
3853,
7170,
3762,
2850,
2696,
3126,
2140,
1006,
24471,
2140,
1007,
1063,
13075,
3463,
1027,
2951,
3126,
20974,
24746,
2595,
1012,
4654,
8586,
1006,
24471,
2140,
1007,
1025,
13075,
2003,
15058,
21084,
1027,
1013,
2918,
21084,
1013,
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... |
SheetJS/js-xlsx | bits/46_stycommon.js | process_col | function process_col(coll/*:ColInfo*/) {
if(coll.width) {
coll.wpx = width2px(coll.width);
coll.wch = px2char(coll.wpx);
coll.MDW = MDW;
} else if(coll.wpx) {
coll.wch = px2char(coll.wpx);
coll.width = char2width(coll.wch);
coll.MDW = MDW;
} else if(typeof coll.wch == 'number') {
coll.width = char2widt... | javascript | function process_col(coll/*:ColInfo*/) {
if(coll.width) {
coll.wpx = width2px(coll.width);
coll.wch = px2char(coll.wpx);
coll.MDW = MDW;
} else if(coll.wpx) {
coll.wch = px2char(coll.wpx);
coll.width = char2width(coll.wch);
coll.MDW = MDW;
} else if(typeof coll.wch == 'number') {
coll.width = char2widt... | [
"function",
"process_col",
"(",
"coll",
"/*:ColInfo*/",
")",
"{",
"if",
"(",
"coll",
".",
"width",
")",
"{",
"coll",
".",
"wpx",
"=",
"width2px",
"(",
"coll",
".",
"width",
")",
";",
"coll",
".",
"wch",
"=",
"px2char",
"(",
"coll",
".",
"wpx",
")",... | /* XLML specifies width in terms of pixels /*function find_mdw_wpx(wpx) {
var delta = Infinity, guess = 0, _MDW = MIN_MDW;
for(MDW=MIN_MDW; MDW<MAX_MDW; ++MDW) {
guess = char2width_(px2char_(wpx))*256;
guess = (guess) % 1;
if(guess > 0.5) guess--;
if(Math.abs(guess) < delta) { delta = Math.abs(guess); _MDW = MDW; }
}
M... | [
"/",
"*",
"XLML",
"specifies",
"width",
"in",
"terms",
"of",
"pixels",
"/",
"*",
"function",
"find_mdw_wpx",
"(",
"wpx",
")",
"{",
"var",
"delta",
"=",
"Infinity",
"guess",
"=",
"0",
"_MDW",
"=",
"MIN_MDW",
";",
"for",
"(",
"MDW",
"=",
"MIN_MDW",
";"... | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/46_stycommon.js#L79-L94 | train | Process a col | [
30522,
3853,
2832,
1035,
8902,
1006,
8902,
2140,
1013,
1008,
1024,
6972,
14876,
1008,
1013,
1007,
1063,
2065,
1006,
8902,
2140,
1012,
9381,
1007,
1063,
8902,
2140,
1012,
1059,
2361,
2595,
1027,
9381,
2475,
2361,
2595,
1006,
8902,
2140,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/util/util.js | function(element, nodeName, scanDeep, warnNotFound) {
var found = scanTree(element);
if (!found && !!warnNotFound) {
$log.warn($mdUtil.supplant("Unable to find node '{0}' in element '{1}'.",[nodeName, element[0].outerHTML]));
}
return angular.element(found || element);
/**
... | javascript | function(element, nodeName, scanDeep, warnNotFound) {
var found = scanTree(element);
if (!found && !!warnNotFound) {
$log.warn($mdUtil.supplant("Unable to find node '{0}' in element '{1}'.",[nodeName, element[0].outerHTML]));
}
return angular.element(found || element);
/**
... | [
"function",
"(",
"element",
",",
"nodeName",
",",
"scanDeep",
",",
"warnNotFound",
")",
"{",
"var",
"found",
"=",
"scanTree",
"(",
"element",
")",
";",
"if",
"(",
"!",
"found",
"&&",
"!",
"!",
"warnNotFound",
")",
"{",
"$log",
".",
"warn",
"(",
"$mdU... | Functional equivalent for $element.filter(‘md-bottom-sheet’)
useful with interimElements where the element and its container are important...
@param {angular.JQLite} element to scan
@param {string} nodeName of node to find (e.g. 'md-dialog')
@param {boolean=} scanDeep optional flag to allow deep scans; defaults to 'fa... | [
"Functional",
"equivalent",
"for",
"$element",
".",
"filter",
"(",
"‘md",
"-",
"bottom",
"-",
"sheet’",
")",
"useful",
"with",
"interimElements",
"where",
"the",
"element",
"and",
"its",
"container",
"are",
"important",
"..."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L597-L644 | train | Returns the first node that matches nodeName | [
30522,
3853,
1006,
5783,
1010,
13045,
18442,
1010,
13594,
26095,
2361,
1010,
11582,
17048,
14876,
8630,
1007,
1063,
13075,
2179,
1027,
13594,
13334,
1006,
5783,
1007,
1025,
2065,
1006,
999,
2179,
1004,
1004,
999,
999,
11582,
17048,
14876,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
electron/electron | lib/browser/guest-view-manager.js | function (event, embedderFrameId, elementInstanceId, guestInstanceId, params) {
const embedder = event.sender
// Destroy the old guest when attaching.
const key = `${embedder.id}-${elementInstanceId}`
const oldGuestInstanceId = embedderElementsMap[key]
if (oldGuestInstanceId != null) {
// Reattachment to ... | javascript | function (event, embedderFrameId, elementInstanceId, guestInstanceId, params) {
const embedder = event.sender
// Destroy the old guest when attaching.
const key = `${embedder.id}-${elementInstanceId}`
const oldGuestInstanceId = embedderElementsMap[key]
if (oldGuestInstanceId != null) {
// Reattachment to ... | [
"function",
"(",
"event",
",",
"embedderFrameId",
",",
"elementInstanceId",
",",
"guestInstanceId",
",",
"params",
")",
"{",
"const",
"embedder",
"=",
"event",
".",
"sender",
"// Destroy the old guest when attaching.",
"const",
"key",
"=",
"`",
"${",
"embedder",
"... | Attach the guest to an element of embedder. | [
"Attach",
"the",
"guest",
"to",
"an",
"element",
"of",
"embedder",
"."
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/guest-view-manager.js#L164-L273 | train | This function is called when the guest is attached to an element. | [
30522,
3853,
1006,
2724,
1010,
7861,
8270,
4063,
15643,
3593,
1010,
5783,
7076,
26897,
3593,
1010,
4113,
7076,
26897,
3593,
1010,
11498,
5244,
1007,
1063,
9530,
3367,
7861,
8270,
4063,
1027,
2724,
1012,
4604,
2121,
1013,
1013,
6033,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/closure.js | generateAllLocalesFile | function generateAllLocalesFile(LOCALES, ALIASES) {
const existingLocalesAliases = {};
const existingLocalesData = {};
// for each locale, get the data and the list of equivalent locales
LOCALES.forEach(locale => {
const eqLocales = new Set();
eqLocales.add(locale);
if (locale.match(/-/)) {
e... | javascript | function generateAllLocalesFile(LOCALES, ALIASES) {
const existingLocalesAliases = {};
const existingLocalesData = {};
// for each locale, get the data and the list of equivalent locales
LOCALES.forEach(locale => {
const eqLocales = new Set();
eqLocales.add(locale);
if (locale.match(/-/)) {
e... | [
"function",
"generateAllLocalesFile",
"(",
"LOCALES",
",",
"ALIASES",
")",
"{",
"const",
"existingLocalesAliases",
"=",
"{",
"}",
";",
"const",
"existingLocalesData",
"=",
"{",
"}",
";",
"// for each locale, get the data and the list of equivalent locales",
"LOCALES",
"."... | Generate a file that contains all locale to import for closure.
Tree shaking will only keep the data for the `goog.LOCALE` locale. | [
"Generate",
"a",
"file",
"that",
"contains",
"all",
"locale",
"to",
"import",
"for",
"closure",
".",
"Tree",
"shaking",
"will",
"only",
"keep",
"the",
"data",
"for",
"the",
"goog",
".",
"LOCALE",
"locale",
"."
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/gulp-tasks/cldr/closure.js#L71-L163 | train | Generate all locales file | [
30522,
3853,
9699,
8095,
4135,
9289,
2229,
8873,
2571,
1006,
2334,
2229,
1010,
14593,
2229,
1007,
1063,
9530,
3367,
4493,
4135,
9289,
22447,
6632,
8583,
1027,
1063,
1065,
1025,
9530,
3367,
4493,
4135,
9289,
2229,
2850,
2696,
1027,
1063,
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 | lib/jsdoc/transform-apijson-for-sdk.js | function (aMethods) {
var fnCreateTypesArr = function (sTypes) {
return sTypes.split("|").map(function (sType) {
return {value: sType}
});
};
var fnExtractParameterProperties = function (oParameter, aParameters, iDepth, aPhoneName) {
if (oParameter.parameterProperties) {
Object.keys(oPara... | javascript | function (aMethods) {
var fnCreateTypesArr = function (sTypes) {
return sTypes.split("|").map(function (sType) {
return {value: sType}
});
};
var fnExtractParameterProperties = function (oParameter, aParameters, iDepth, aPhoneName) {
if (oParameter.parameterProperties) {
Object.keys(oPara... | [
"function",
"(",
"aMethods",
")",
"{",
"var",
"fnCreateTypesArr",
"=",
"function",
"(",
"sTypes",
")",
"{",
"return",
"sTypes",
".",
"split",
"(",
"\"|\"",
")",
".",
"map",
"(",
"function",
"(",
"sType",
")",
"{",
"return",
"{",
"value",
":",
"sType",
... | Adjusts methods info so that it can be easily displayed in a table
@param aMethods - the methods array initially coming from the server | [
"Adjusts",
"methods",
"info",
"so",
"that",
"it",
"can",
"be",
"easily",
"displayed",
"in",
"a",
"table"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/transform-apijson-for-sdk.js#L1796-L1865 | train | Function to create the parameters array | [
30522,
3853,
1006,
2572,
11031,
20620,
1007,
1063,
13075,
1042,
12273,
29313,
13874,
10286,
2099,
1027,
3853,
1006,
2358,
18863,
2015,
1007,
1063,
2709,
2358,
18863,
2015,
1012,
3975,
1006,
1000,
1064,
1000,
1007,
1012,
4949,
1006,
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.table/src/sap/ui/table/TableUtils.js | function(vObject, vCall, oThis) {
var oObject = typeof vObject === "function" ? vObject() : vObject;
if (!oObject || !vCall) {
return undefined;
}
oThis = oThis || oObject;
if (typeof vCall === "function") {
vCall.call(oThis, oObject);
return undefined;
} else {
var aParameters;
... | javascript | function(vObject, vCall, oThis) {
var oObject = typeof vObject === "function" ? vObject() : vObject;
if (!oObject || !vCall) {
return undefined;
}
oThis = oThis || oObject;
if (typeof vCall === "function") {
vCall.call(oThis, oObject);
return undefined;
} else {
var aParameters;
... | [
"function",
"(",
"vObject",
",",
"vCall",
",",
"oThis",
")",
"{",
"var",
"oObject",
"=",
"typeof",
"vObject",
"===",
"\"function\"",
"?",
"vObject",
"(",
")",
":",
"vObject",
";",
"if",
"(",
"!",
"oObject",
"||",
"!",
"vCall",
")",
"{",
"return",
"un... | Facilitates dynamic calling.
@param {function():T | T} vObject The object, or a function returning the object, on which methods will be called.
@param {function(this:U, T) | Object<string, Array.<*>>} vCall Called if <code>vObject</code> is, or returns an object.
@param {U} [oThis] Context in the function calls, or in... | [
"Facilitates",
"dynamic",
"calling",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L1197-L1226 | train | Returns the return value of a function | [
30522,
3853,
1006,
29536,
2497,
20614,
1010,
18315,
8095,
1010,
27178,
24158,
1007,
1063,
13075,
1051,
16429,
20614,
1027,
2828,
11253,
29536,
2497,
20614,
1027,
1027,
1027,
1000,
3853,
1000,
1029,
29536,
2497,
20614,
1006,
1007,
1024,
29536,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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) {
var sComponentName = "";
if (oComponent) {
sComponentName = oComponent.getMetadata().getName();
}
if (sComponentName.length > 0 && sComponentName.indexOf(".Component") < 0) {
sComponentName += ".Component";
}
return sComponentName;
} | javascript | function (oComponent) {
var sComponentName = "";
if (oComponent) {
sComponentName = oComponent.getMetadata().getName();
}
if (sComponentName.length > 0 && sComponentName.indexOf(".Component") < 0) {
sComponentName += ".Component";
}
return sComponentName;
} | [
"function",
"(",
"oComponent",
")",
"{",
"var",
"sComponentName",
"=",
"\"\"",
";",
"if",
"(",
"oComponent",
")",
"{",
"sComponentName",
"=",
"oComponent",
".",
"getMetadata",
"(",
")",
".",
"getName",
"(",
")",
";",
"}",
"if",
"(",
"sComponentName",
"."... | Gets the component name for a component instance.
@param {sap.ui.core.Component} oComponent component instance
@returns {String} component name
@public | [
"Gets",
"the",
"component",
"name",
"for",
"a",
"component",
"instance",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L478-L487 | train | Returns the name of the component | [
30522,
30524,
1012,
2131,
11368,
8447,
2696,
1006,
1007,
1012,
2131,
18442,
1006,
1007,
1025,
1065,
2065,
1006,
8040,
25377,
5643,
3372,
18442,
1012,
3091,
1028,
1014,
1004,
1004,
8040,
25377,
5643,
3372,
18442,
1012,
5950,
11253,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
apache/incubator-echarts | src/chart/line/lineAnimationDiff.js | diffData | function diffData(oldData, newData) {
var diffResult = [];
newData.diff(oldData)
.add(function (idx) {
diffResult.push({cmd: '+', idx: idx});
})
.update(function (newIdx, oldIdx) {
diffResult.push({cmd: '=', idx: oldIdx, idx1: newIdx});
})
.remove... | javascript | function diffData(oldData, newData) {
var diffResult = [];
newData.diff(oldData)
.add(function (idx) {
diffResult.push({cmd: '+', idx: idx});
})
.update(function (newIdx, oldIdx) {
diffResult.push({cmd: '=', idx: oldIdx, idx1: newIdx});
})
.remove... | [
"function",
"diffData",
"(",
"oldData",
",",
"newData",
")",
"{",
"var",
"diffResult",
"=",
"[",
"]",
";",
"newData",
".",
"diff",
"(",
"oldData",
")",
".",
"add",
"(",
"function",
"(",
"idx",
")",
"{",
"diffResult",
".",
"push",
"(",
"{",
"cmd",
"... | // Assume id in idList are all unique var idIndicesMap = {}; var idx = 0; for (var i = 0; i < newIdList.length; i++) { idIndicesMap[newIdList[i]] = idx; newIdList[i] = idx++; } for (var i = 0; i < oldIdList.length; i++) { var oldId = oldIdList[i]; // Same with newIdList if (idIndicesMap[oldId]) { oldIdList[i] = idIndic... | [
"//",
"Assume",
"id",
"in",
"idList",
"are",
"all",
"unique",
"var",
"idIndicesMap",
"=",
"{}",
";",
"var",
"idx",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"newIdList",
".",
"length",
";",
"i",
"++",
")",
"{",
"idIndicesMap... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/line/lineAnimationDiff.js#L49-L65 | train | diffData - diff data | [
30522,
3853,
4487,
4246,
2850,
2696,
1006,
2214,
2850,
2696,
1010,
2047,
2850,
2696,
1007,
1063,
13075,
4487,
4246,
6072,
11314,
1027,
1031,
1033,
1025,
2047,
2850,
2696,
1012,
4487,
4246,
1006,
2214,
2850,
2696,
1007,
1012,
5587,
1006,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/mvc/View.js | initPreprocessorQueues | function initPreprocessorQueues(oView, mSettings) {
var oViewClass = oView.getMetadata().getClass();
function resolvePreprocessors(oPreprocessor) {
oPreprocessor.preprocessor = initPreprocessor(oPreprocessor, mSettings.async);
}
// shallow copy to avoid issues when manipulating the internal object structur... | javascript | function initPreprocessorQueues(oView, mSettings) {
var oViewClass = oView.getMetadata().getClass();
function resolvePreprocessors(oPreprocessor) {
oPreprocessor.preprocessor = initPreprocessor(oPreprocessor, mSettings.async);
}
// shallow copy to avoid issues when manipulating the internal object structur... | [
"function",
"initPreprocessorQueues",
"(",
"oView",
",",
"mSettings",
")",
"{",
"var",
"oViewClass",
"=",
"oView",
".",
"getMetadata",
"(",
")",
".",
"getClass",
"(",
")",
";",
"function",
"resolvePreprocessors",
"(",
"oPreprocessor",
")",
"{",
"oPreprocessor",
... | init internal registry and convert single declarations to array, for compatibility
@param {sap.ui.core.mvc.View} oView This view instance
@param {object} mSettings Settings for the view
@private | [
"init",
"internal",
"registry",
"and",
"convert",
"single",
"declarations",
"to",
"array",
"for",
"compatibility"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/mvc/View.js#L308-L329 | train | Initializes the preprocessors for the given view | [
30522,
3853,
1999,
4183,
28139,
21572,
9623,
21748,
4226,
15808,
1006,
1051,
8584,
1010,
5796,
18319,
3070,
2015,
1007,
1063,
13075,
1051,
8584,
26266,
1027,
1051,
8584,
1012,
2131,
11368,
8447,
2696,
1006,
1007,
1012,
2131,
26266,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/modal-dialog.js | modalDialog_start | function modalDialog_start(aCallback) {
if (!aCallback)
throw new Error(arguments.callee.name + ": Callback not specified.");
this._observer = new mdObserver(this._window, aCallback);
this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
this._timer.init(this._observer, DELAY_CHE... | javascript | function modalDialog_start(aCallback) {
if (!aCallback)
throw new Error(arguments.callee.name + ": Callback not specified.");
this._observer = new mdObserver(this._window, aCallback);
this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
this._timer.init(this._observer, DELAY_CHE... | [
"function",
"modalDialog_start",
"(",
"aCallback",
")",
"{",
"if",
"(",
"!",
"aCallback",
")",
"throw",
"new",
"Error",
"(",
"arguments",
".",
"callee",
".",
"name",
"+",
"\": Callback not specified.\"",
")",
";",
"this",
".",
"_observer",
"=",
"new",
"mdObs... | Start timer to wait for the modal dialog.
@param {function} aCallback
The callback handler to use to interact with the modal dialog | [
"Start",
"timer",
"to",
"wait",
"for",
"the",
"modal",
"dialog",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/modal-dialog.js#L177-L185 | train | Start modal dialog | [
30522,
3853,
16913,
24657,
23067,
2290,
1035,
2707,
1006,
9353,
8095,
5963,
1007,
1063,
2065,
1006,
999,
9353,
8095,
5963,
1007,
5466,
2047,
7561,
1006,
9918,
1012,
2655,
4402,
1012,
2171,
1009,
1000,
1024,
2655,
5963,
2025,
9675,
1012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/menuBar/js/menuItemDirective.js | MenuItemDirective | function MenuItemDirective($mdUtil, $mdConstant, $$mdSvgRegistry) {
return {
controller: 'MenuItemController',
require: ['mdMenuItem', '?ngModel'],
priority: $mdConstant.BEFORE_NG_ARIA,
compile: function(templateEl, templateAttrs) {
var type = templateAttrs.type;
var inMenuBarClass = 'md-i... | javascript | function MenuItemDirective($mdUtil, $mdConstant, $$mdSvgRegistry) {
return {
controller: 'MenuItemController',
require: ['mdMenuItem', '?ngModel'],
priority: $mdConstant.BEFORE_NG_ARIA,
compile: function(templateEl, templateAttrs) {
var type = templateAttrs.type;
var inMenuBarClass = 'md-i... | [
"function",
"MenuItemDirective",
"(",
"$mdUtil",
",",
"$mdConstant",
",",
"$$mdSvgRegistry",
")",
"{",
"return",
"{",
"controller",
":",
"'MenuItemController'",
",",
"require",
":",
"[",
"'mdMenuItem'",
",",
"'?ngModel'",
"]",
",",
"priority",
":",
"$mdConstant",
... | /* @ngInject | [
"/",
"*"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menuBar/js/menuItemDirective.js#L7-L68 | train | MenuItem directive. | [
30522,
3853,
12183,
4221,
26876,
7442,
15277,
1006,
1002,
9108,
21823,
2140,
1010,
1002,
9108,
8663,
12693,
2102,
1010,
1002,
1002,
9108,
2015,
2615,
17603,
24063,
2854,
1007,
1063,
2709,
1063,
11486,
1024,
1005,
12183,
4221,
12458,
12162,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getsentry/sentry-javascript | packages/raven-js/scripts/build.js | build | async function build(inputOptions, outputOptions) {
const input = Object.assign(
{
plugins: [
commonjs(), // We can remove this plugin if there are no more CommonJS modules
resolve(), // We need this plugin only to build the test script
babel({
exclude: 'node_modules/**'
... | javascript | async function build(inputOptions, outputOptions) {
const input = Object.assign(
{
plugins: [
commonjs(), // We can remove this plugin if there are no more CommonJS modules
resolve(), // We need this plugin only to build the test script
babel({
exclude: 'node_modules/**'
... | [
"async",
"function",
"build",
"(",
"inputOptions",
",",
"outputOptions",
")",
"{",
"const",
"input",
"=",
"Object",
".",
"assign",
"(",
"{",
"plugins",
":",
"[",
"commonjs",
"(",
")",
",",
"// We can remove this plugin if there are no more CommonJS modules",
"resolv... | Only needed for test build
Build using rollup.js
@see https://rollupjs.org/#javascript-api
@param inputOptions
@param outputOptions
@returns Promise | [
"Only",
"needed",
"for",
"test",
"build",
"Build",
"using",
"rollup",
".",
"js"
] | a872223343fecf7364473b78bede937f1eb57bd0 | https://github.com/getsentry/sentry-javascript/blob/a872223343fecf7364473b78bede937f1eb57bd0/packages/raven-js/scripts/build.js#L15-L38 | train | Build the test script | [
30522,
2004,
6038,
2278,
3853,
3857,
1006,
7953,
7361,
9285,
1010,
6434,
7361,
9285,
1007,
1063,
9530,
3367,
7953,
1027,
4874,
1012,
23911,
1006,
1063,
13354,
7076,
1024,
1031,
2691,
22578,
1006,
1007,
1010,
1013,
1013,
2057,
2064,
6366,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/jquery-mobile-custom.js | function( event ) {
var newEvent = new $.Event( "navigate" ),
beforeNavigate = new $.Event( "beforenavigate" ),
state = event.originalEvent.state || {},
href = location.href;
$win.trigger( beforeNavigate );
if( beforeNavigate.isDefaultPrevented() ){
return;
}
if( event.historyState ){
... | javascript | function( event ) {
var newEvent = new $.Event( "navigate" ),
beforeNavigate = new $.Event( "beforenavigate" ),
state = event.originalEvent.state || {},
href = location.href;
$win.trigger( beforeNavigate );
if( beforeNavigate.isDefaultPrevented() ){
return;
}
if( event.historyState ){
... | [
"function",
"(",
"event",
")",
"{",
"var",
"newEvent",
"=",
"new",
"$",
".",
"Event",
"(",
"\"navigate\"",
")",
",",
"beforeNavigate",
"=",
"new",
"$",
".",
"Event",
"(",
"\"beforenavigate\"",
")",
",",
"state",
"=",
"event",
".",
"originalEvent",
".",
... | TODO a lot of duplication between popstate and hashchange | [
"TODO",
"a",
"lot",
"of",
"duplication",
"between",
"popstate",
"and",
"hashchange"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jquery-mobile-custom.js#L1011-L1040 | train | This function is called when the user clicks on the page | [
30522,
3853,
1006,
2724,
1007,
1063,
13075,
2047,
18697,
3372,
1027,
2047,
1002,
1012,
2724,
1006,
1000,
22149,
1000,
1007,
1010,
2077,
2532,
5737,
5867,
1027,
2047,
1002,
1012,
2724,
1006,
1000,
2077,
2532,
5737,
5867,
1000,
1007,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
TryGhost/Ghost | core/server/api/v0.1/webhooks.js | doQuery | function doQuery(options) {
return models.Webhook.getByEventAndTarget(options.data.webhooks[0].event, options.data.webhooks[0].target_url, _.omit(options, ['data']))
.then((webhook) => {
if (webhook) {
return Promise.reject(new common.errors.Valida... | javascript | function doQuery(options) {
return models.Webhook.getByEventAndTarget(options.data.webhooks[0].event, options.data.webhooks[0].target_url, _.omit(options, ['data']))
.then((webhook) => {
if (webhook) {
return Promise.reject(new common.errors.Valida... | [
"function",
"doQuery",
"(",
"options",
")",
"{",
"return",
"models",
".",
"Webhook",
".",
"getByEventAndTarget",
"(",
"options",
".",
"data",
".",
"webhooks",
"[",
"0",
"]",
".",
"event",
",",
"options",
".",
"data",
".",
"webhooks",
"[",
"0",
"]",
"."... | ### Model Query
Make the call to the Model layer
@param {Object} options
@returns {Object} options | [
"###",
"Model",
"Query",
"Make",
"the",
"call",
"to",
"the",
"Model",
"layer"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/webhooks.js#L35-L49 | train | Query for webhooks | [
30522,
3853,
2079,
4226,
2854,
1006,
7047,
1007,
1063,
2709,
4275,
1012,
4773,
6806,
6559,
1012,
2131,
3762,
18697,
12380,
26379,
2906,
18150,
1006,
7047,
1012,
2951,
1012,
4773,
6806,
6559,
2015,
1031,
1014,
1033,
1012,
2724,
1010,
7047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
vuejs/vue-devtools | src/backend/index.js | processRouteContext | function processRouteContext (instance) {
try {
const route = instance.$route
if (route) {
const { path, query, params } = route
const value = { path, query, params }
if (route.fullPath) value.fullPath = route.fullPath
if (route.hash) value.hash = route.hash
if (route.name) value... | javascript | function processRouteContext (instance) {
try {
const route = instance.$route
if (route) {
const { path, query, params } = route
const value = { path, query, params }
if (route.fullPath) value.fullPath = route.fullPath
if (route.hash) value.hash = route.hash
if (route.name) value... | [
"function",
"processRouteContext",
"(",
"instance",
")",
"{",
"try",
"{",
"const",
"route",
"=",
"instance",
".",
"$route",
"if",
"(",
"route",
")",
"{",
"const",
"{",
"path",
",",
"query",
",",
"params",
"}",
"=",
"route",
"const",
"value",
"=",
"{",
... | Process possible vue-router $route context
@param {Vue} instance
@return {Array} | [
"Process",
"possible",
"vue",
"-",
"router",
"$route",
"context"
] | 4de4b86388453cd07f0c1bf967d43a4dd4b011c9 | https://github.com/vuejs/vue-devtools/blob/4de4b86388453cd07f0c1bf967d43a4dd4b011c9/src/backend/index.js#L784-L809 | train | Process the route context | [
30522,
3853,
2832,
22494,
26557,
28040,
18413,
1006,
6013,
1007,
1063,
3046,
1063,
9530,
3367,
2799,
1027,
6013,
1012,
1002,
2799,
2065,
1006,
2799,
1007,
1063,
9530,
3367,
1063,
4130,
1010,
23032,
1010,
11498,
5244,
1065,
1027,
2799,
9530,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dcloudio/mui | examples/hello-mui/js/mui.js | function() {
var self = this;
self.plus.addEventListener(tapEventName, function(event) {
var val = parseInt(self.input.value) + self.options.step;
self.input.value = val.toString();
$.trigger(self.input, changeEventName, null);
});
... | javascript | function() {
var self = this;
self.plus.addEventListener(tapEventName, function(event) {
var val = parseInt(self.input.value) + self.options.step;
self.input.value = val.toString();
$.trigger(self.input, changeEventName, null);
});
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"plus",
".",
"addEventListener",
"(",
"tapEventName",
",",
"function",
"(",
"event",
")",
"{",
"var",
"val",
"=",
"parseInt",
"(",
"self",
".",
"input",
".",
"value",
")",
"+",
... | 初始化事件绑定 | [
"初始化事件绑定"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/hello-mui/js/mui.js#L8196-L8216 | train | add event listeners | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2969,
1012,
4606,
1012,
5587,
18697,
3372,
9863,
24454,
1006,
6823,
15338,
18442,
1010,
3853,
1006,
2724,
1007,
1063,
13075,
11748,
1027,
11968,
20240,
3372,
1006,
2969,
1012,
79... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/changes.js | makeChangeSingleDocInEditor | function makeChangeSingleDocInEditor(cm, change, spans) {
let doc = cm.doc, display = cm.display, from = change.from, to = change.to
let recomputeMaxLength = false, checkWidthStart = from.line
if (!cm.options.lineWrapping) {
checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))
doc.iter(checkWidt... | javascript | function makeChangeSingleDocInEditor(cm, change, spans) {
let doc = cm.doc, display = cm.display, from = change.from, to = change.to
let recomputeMaxLength = false, checkWidthStart = from.line
if (!cm.options.lineWrapping) {
checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))
doc.iter(checkWidt... | [
"function",
"makeChangeSingleDocInEditor",
"(",
"cm",
",",
"change",
",",
"spans",
")",
"{",
"let",
"doc",
"=",
"cm",
".",
"doc",
",",
"display",
"=",
"cm",
".",
"display",
",",
"from",
"=",
"change",
".",
"from",
",",
"to",
"=",
"change",
".",
"to",... | Handle the interaction of a change to a document with the editor that this document is part of. | [
"Handle",
"the",
"interaction",
"of",
"a",
"change",
"to",
"a",
"document",
"with",
"the",
"editor",
"that",
"this",
"document",
"is",
"part",
"of",
"."
] | dab6f676107c10ba8d16c654a42f66cae3f27db1 | https://github.com/codemirror/CodeMirror/blob/dab6f676107c10ba8d16c654a42f66cae3f27db1/src/model/changes.js#L209-L265 | train | Make a change in the editor | [
30522,
3853,
2191,
22305,
2229,
2075,
3709,
10085,
21280,
15660,
1006,
4642,
1010,
2689,
1010,
14798,
1007,
1063,
2292,
9986,
1027,
4642,
1012,
9986,
1010,
4653,
1027,
4642,
1012,
4653,
1010,
2013,
1027,
2689,
1012,
2013,
1010,
2000,
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... |
ecomfe/zrender | build/babel-plugin-transform-modules-commonjs-ec.js | getModuleMetadata | function getModuleMetadata(programPath) {
const localData = getLocalExportMetadata(programPath);
const sourceData = new Map();
const getData = sourceNode => {
const source = sourceNode.value;
let data = sourceData.get(source);
if (!data) {
data = {
name:... | javascript | function getModuleMetadata(programPath) {
const localData = getLocalExportMetadata(programPath);
const sourceData = new Map();
const getData = sourceNode => {
const source = sourceNode.value;
let data = sourceData.get(source);
if (!data) {
data = {
name:... | [
"function",
"getModuleMetadata",
"(",
"programPath",
")",
"{",
"const",
"localData",
"=",
"getLocalExportMetadata",
"(",
"programPath",
")",
";",
"const",
"sourceData",
"=",
"new",
"Map",
"(",
")",
";",
"const",
"getData",
"=",
"sourceNode",
"=>",
"{",
"const"... | Get metadata about the imports and exports present in this module. | [
"Get",
"metadata",
"about",
"the",
"imports",
"and",
"exports",
"present",
"in",
"this",
"module",
"."
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/build/babel-plugin-transform-modules-commonjs-ec.js#L98-L257 | train | Get module metadata | [
30522,
3853,
2131,
5302,
8566,
16930,
12928,
2850,
2696,
1006,
2565,
15069,
1007,
1063,
9530,
3367,
2334,
2850,
2696,
1027,
2131,
4135,
9289,
10288,
6442,
11368,
8447,
2696,
1006,
2565,
15069,
1007,
1025,
9530,
3367,
23184,
6790,
1027,
2047... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/FindUtils.js | _doReplaceOnDisk | function _doReplaceOnDisk(fullPath, matchInfo, replaceText, isRegexp) {
var file = FileSystem.getFileForPath(fullPath);
return DocumentManager.getDocumentText(file, true).then(function (contents, timestamp, lineEndings) {
if (timestamp.getTime() !== matchInfo.timestamp.getTime()) {
... | javascript | function _doReplaceOnDisk(fullPath, matchInfo, replaceText, isRegexp) {
var file = FileSystem.getFileForPath(fullPath);
return DocumentManager.getDocumentText(file, true).then(function (contents, timestamp, lineEndings) {
if (timestamp.getTime() !== matchInfo.timestamp.getTime()) {
... | [
"function",
"_doReplaceOnDisk",
"(",
"fullPath",
",",
"matchInfo",
",",
"replaceText",
",",
"isRegexp",
")",
"{",
"var",
"file",
"=",
"FileSystem",
".",
"getFileForPath",
"(",
"fullPath",
")",
";",
"return",
"DocumentManager",
".",
"getDocumentText",
"(",
"file"... | Does a set of replacements in a single file on disk.
@param {string} fullPath The full path to the file.
@param {Object} matchInfo The match info for this file, as returned by `_addSearchMatches()`.
@param {string} replaceText The text to replace each result with.
@param {boolean=} isRegexp Whether the original query w... | [
"Does",
"a",
"set",
"of",
"replacements",
"in",
"a",
"single",
"file",
"on",
"disk",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L145-L175 | train | Replace the text in the file at the given path. | [
30522,
3853,
1035,
2079,
2890,
24759,
10732,
15422,
20573,
1006,
2440,
15069,
1010,
2674,
2378,
14876,
1010,
5672,
18209,
1010,
2003,
2890,
3351,
2595,
2361,
1007,
1063,
13075,
5371,
1027,
6764,
27268,
6633,
1012,
2131,
8873,
2571,
29278,
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... |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | Spectrum | function Spectrum ( entry, snap, direction, singleStep ) {
this.xPct = [];
this.xVal = [];
this.xSteps = [ singleStep || false ];
this.xNumSteps = [ false ];
this.xHighestCompleteStep = [];
this.snap = snap;
this.direction = direction;
var index, ordere... | javascript | function Spectrum ( entry, snap, direction, singleStep ) {
this.xPct = [];
this.xVal = [];
this.xSteps = [ singleStep || false ];
this.xNumSteps = [ false ];
this.xHighestCompleteStep = [];
this.snap = snap;
this.direction = direction;
var index, ordere... | [
"function",
"Spectrum",
"(",
"entry",
",",
"snap",
",",
"direction",
",",
"singleStep",
")",
"{",
"this",
".",
"xPct",
"=",
"[",
"]",
";",
"this",
".",
"xVal",
"=",
"[",
"]",
";",
"this",
".",
"xSteps",
"=",
"[",
"singleStep",
"||",
"false",
"]",
... | The interface to Spectrum handles all direction-based conversions, so the above values are unaware. | [
"The",
"interface",
"to",
"Spectrum",
"handles",
"all",
"direction",
"-",
"based",
"conversions",
"so",
"the",
"above",
"values",
"are",
"unaware",
"."
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L352-L393 | train | Spectrum constructor. | [
30522,
3853,
8674,
1006,
4443,
1010,
10245,
1010,
3257,
1010,
3895,
2618,
2361,
1007,
1063,
2023,
1012,
26726,
6593,
1027,
1031,
1033,
1025,
2023,
1012,
15566,
2389,
1027,
1031,
1033,
1025,
2023,
1012,
1060,
13473,
4523,
1027,
1031,
3895,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/sidenav/sidenav.js | updateIsLocked | function updateIsLocked(isLocked, oldValue) {
scope.isLockedOpen = isLocked;
if (isLocked === oldValue) {
element.toggleClass('md-locked-open', !!isLocked);
} else {
$animate[isLocked ? 'addClass' : 'removeClass'](element, 'md-locked-open');
}
if (backdrop) {
backdr... | javascript | function updateIsLocked(isLocked, oldValue) {
scope.isLockedOpen = isLocked;
if (isLocked === oldValue) {
element.toggleClass('md-locked-open', !!isLocked);
} else {
$animate[isLocked ? 'addClass' : 'removeClass'](element, 'md-locked-open');
}
if (backdrop) {
backdr... | [
"function",
"updateIsLocked",
"(",
"isLocked",
",",
"oldValue",
")",
"{",
"scope",
".",
"isLockedOpen",
"=",
"isLocked",
";",
"if",
"(",
"isLocked",
"===",
"oldValue",
")",
"{",
"element",
".",
"toggleClass",
"(",
"'md-locked-open'",
",",
"!",
"!",
"isLocked... | Toggle the DOM classes to indicate `locked`
@param isLocked
@param oldValue | [
"Toggle",
"the",
"DOM",
"classes",
"to",
"indicate",
"locked"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/sidenav/sidenav.js#L351-L361 | train | Update the isLocked state of the | [
30522,
3853,
10651,
2483,
7878,
2098,
1006,
2003,
7878,
2098,
1010,
2214,
10175,
5657,
1007,
1063,
9531,
1012,
2003,
7878,
26010,
11837,
1027,
2003,
7878,
2098,
1025,
2065,
1006,
2003,
7878,
2098,
1027,
1027,
1027,
2214,
10175,
5657,
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... |
babel/babel | packages/babel-traverse/src/path/conversion.js | getSuperPropBinding | function getSuperPropBinding(thisEnvFn, isAssignment, propName) {
const op = isAssignment ? "set" : "get";
return getBinding(thisEnvFn, `superprop_${op}:${propName || ""}`, () => {
const argsList = [];
let fnBody;
if (propName) {
// () => super.foo
fnBody = t.memberExpression(t.super(), t.... | javascript | function getSuperPropBinding(thisEnvFn, isAssignment, propName) {
const op = isAssignment ? "set" : "get";
return getBinding(thisEnvFn, `superprop_${op}:${propName || ""}`, () => {
const argsList = [];
let fnBody;
if (propName) {
// () => super.foo
fnBody = t.memberExpression(t.super(), t.... | [
"function",
"getSuperPropBinding",
"(",
"thisEnvFn",
",",
"isAssignment",
",",
"propName",
")",
"{",
"const",
"op",
"=",
"isAssignment",
"?",
"\"set\"",
":",
"\"get\"",
";",
"return",
"getBinding",
"(",
"thisEnvFn",
",",
"`",
"${",
"op",
"}",
"${",
"propName... | Create a binding for a function that will call "super.foo" or "super[foo]". | [
"Create",
"a",
"binding",
"for",
"a",
"function",
"that",
"will",
"call",
"super",
".",
"foo",
"or",
"super",
"[",
"foo",
"]",
"."
] | 1969e6b6aa7d90be3fbb3aca98ea96849656a55a | https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-traverse/src/path/conversion.js#L520-L554 | train | Get the binding for the super property | [
30522,
3853,
4152,
6279,
2121,
21572,
2361,
8428,
4667,
1006,
2023,
2368,
2615,
2546,
2078,
1010,
18061,
18719,
16206,
3672,
1010,
17678,
18442,
1007,
1063,
9530,
3367,
6728,
1027,
18061,
18719,
16206,
3672,
1029,
1000,
2275,
1000,
1024,
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... |
facebook/create-react-app | packages/create-react-app/createReactApp.js | isSafeToCreateProjectIn | function isSafeToCreateProjectIn(root, name) {
const validFiles = [
'.DS_Store',
'Thumbs.db',
'.git',
'.gitignore',
'.idea',
'README.md',
'LICENSE',
'.hg',
'.hgignore',
'.hgcheck',
'.npmignore',
'mkdocs.yml',
'docs',
'.travis.yml',
'.gitlab-ci.yml',
'.gi... | javascript | function isSafeToCreateProjectIn(root, name) {
const validFiles = [
'.DS_Store',
'Thumbs.db',
'.git',
'.gitignore',
'.idea',
'README.md',
'LICENSE',
'.hg',
'.hgignore',
'.hgcheck',
'.npmignore',
'mkdocs.yml',
'docs',
'.travis.yml',
'.gitlab-ci.yml',
'.gi... | [
"function",
"isSafeToCreateProjectIn",
"(",
"root",
",",
"name",
")",
"{",
"const",
"validFiles",
"=",
"[",
"'.DS_Store'",
",",
"'Thumbs.db'",
",",
"'.git'",
",",
"'.gitignore'",
",",
"'.idea'",
",",
"'README.md'",
",",
"'LICENSE'",
",",
"'.hg'",
",",
"'.hgign... | If project only contains files generated by GH, it’s safe. Also, if project contains remnant error logs from a previous installation, lets remove them now. We also special case IJ-based products .idea because it integrates with CRA: https://github.com/facebook/create-react-app/pull/368#issuecomment-243446094 | [
"If",
"project",
"only",
"contains",
"files",
"generated",
"by",
"GH",
"it’s",
"safe",
".",
"Also",
"if",
"project",
"contains",
"remnant",
"error",
"logs",
"from",
"a",
"previous",
"installation",
"lets",
"remove",
"them",
"now",
".",
"We",
"also",
"special... | 57ef103440c24e41b0d7dc82b7ad7fc1dc817eca | https://github.com/facebook/create-react-app/blob/57ef103440c24e41b0d7dc82b7ad7fc1dc817eca/packages/create-react-app/createReactApp.js#L791-L849 | train | Checks if the project is safe to create | [
30522,
3853,
26354,
10354,
18903,
16748,
3686,
21572,
20614,
2378,
1006,
7117,
1010,
2171,
1007,
1063,
9530,
3367,
9398,
8873,
4244,
1027,
1031,
1005,
1012,
16233,
1035,
3573,
1005,
1010,
1005,
16784,
1012,
16962,
1005,
1010,
1005,
1012,
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... |
vuejs/vue-devtools | src/backend/index.js | processState | function processState (instance) {
const props = isLegacy
? instance._props
: instance.$options.props
const getters =
instance.$options.vuex &&
instance.$options.vuex.getters
return Object.keys(instance._data)
.filter(key => (
!(props && key in props) &&
!(getters && key in getters... | javascript | function processState (instance) {
const props = isLegacy
? instance._props
: instance.$options.props
const getters =
instance.$options.vuex &&
instance.$options.vuex.getters
return Object.keys(instance._data)
.filter(key => (
!(props && key in props) &&
!(getters && key in getters... | [
"function",
"processState",
"(",
"instance",
")",
"{",
"const",
"props",
"=",
"isLegacy",
"?",
"instance",
".",
"_props",
":",
"instance",
".",
"$options",
".",
"props",
"const",
"getters",
"=",
"instance",
".",
"$options",
".",
"vuex",
"&&",
"instance",
"... | Process state, filtering out props and "clean" the result
with a JSON dance. This removes functions which can cause
errors during structured clone used by window.postMessage.
@param {Vue} instance
@return {Array} | [
"Process",
"state",
"filtering",
"out",
"props",
"and",
"clean",
"the",
"result",
"with",
"a",
"JSON",
"dance",
".",
"This",
"removes",
"functions",
"which",
"can",
"cause",
"errors",
"during",
"structured",
"clone",
"used",
"by",
"window",
".",
"postMessage",... | 4de4b86388453cd07f0c1bf967d43a4dd4b011c9 | https://github.com/vuejs/vue-devtools/blob/4de4b86388453cd07f0c1bf967d43a4dd4b011c9/src/backend/index.js#L680-L697 | train | Process state of the object | [
30522,
3853,
2832,
9153,
2618,
1006,
6013,
1007,
1063,
9530,
3367,
24387,
1027,
8842,
3654,
5666,
1029,
6013,
1012,
1035,
24387,
1024,
6013,
1012,
1002,
7047,
1012,
24387,
9530,
3367,
2131,
7747,
1027,
6013,
1012,
1002,
7047,
1012,
24728,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | editFilter | function editFilter(filter, index) {
var lastFocus = window.document.activeElement;
var templateVars = {
instruction: StringUtils.format(Strings.FILE_FILTER_INSTRUCTIONS, brackets.config.glob_help_url),
Strings: Strings
};
var dialog = Dialogs.showMod... | javascript | function editFilter(filter, index) {
var lastFocus = window.document.activeElement;
var templateVars = {
instruction: StringUtils.format(Strings.FILE_FILTER_INSTRUCTIONS, brackets.config.glob_help_url),
Strings: Strings
};
var dialog = Dialogs.showMod... | [
"function",
"editFilter",
"(",
"filter",
",",
"index",
")",
"{",
"var",
"lastFocus",
"=",
"window",
".",
"document",
".",
"activeElement",
";",
"var",
"templateVars",
"=",
"{",
"instruction",
":",
"StringUtils",
".",
"format",
"(",
"Strings",
".",
"FILE_FILT... | Opens a dialog box to edit the given filter. When editing is finished, the value of getActiveFilter() changes to
reflect the edits. If the dialog was canceled, the preference is left unchanged.
@param {!{name: string, patterns: Array.<string>}} filter
@param {number} index The index of the filter set to be edited or cr... | [
"Opens",
"a",
"dialog",
"box",
"to",
"edit",
"the",
"given",
"filter",
".",
"When",
"editing",
"is",
"finished",
"the",
"value",
"of",
"getActiveFilter",
"()",
"changes",
"to",
"reflect",
"the",
"edits",
".",
"If",
"the",
"dialog",
"was",
"canceled",
"the"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L323-L415 | train | Edit filter | [
30522,
3853,
10086,
8873,
21928,
1006,
11307,
1010,
5950,
1007,
1063,
13075,
2197,
14876,
7874,
1027,
3332,
1012,
6254,
1012,
3161,
12260,
3672,
1025,
13075,
23561,
10755,
2015,
1027,
1063,
7899,
1024,
5164,
21823,
4877,
1012,
4289,
1006,
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... |
benweet/stackedit | src/libs/pagedown.js | function (wholeMatch, before, inner, afterInner, id, end) {
inner = inner.replace(regex, getLink);
if (defsToAdd[id]) {
addDefNumber(defsToAdd[id]);
return before + inner + afterInner + refNumber + end;
}
return wholeMatch;
} | javascript | function (wholeMatch, before, inner, afterInner, id, end) {
inner = inner.replace(regex, getLink);
if (defsToAdd[id]) {
addDefNumber(defsToAdd[id]);
return before + inner + afterInner + refNumber + end;
}
return wholeMatch;
} | [
"function",
"(",
"wholeMatch",
",",
"before",
",",
"inner",
",",
"afterInner",
",",
"id",
",",
"end",
")",
"{",
"inner",
"=",
"inner",
".",
"replace",
"(",
"regex",
",",
"getLink",
")",
";",
"if",
"(",
"defsToAdd",
"[",
"id",
"]",
")",
"{",
"addDef... | note that a) the recursive call to getLink cannot go infinite, because by definition of regex, inner is always a proper substring of wholeMatch, and b) more than one level of nesting is neither supported by the regex nor making a lot of sense (the only use case for nesting is a linked image) | [
"note",
"that",
"a",
")",
"the",
"recursive",
"call",
"to",
"getLink",
"cannot",
"go",
"infinite",
"because",
"by",
"definition",
"of",
"regex",
"inner",
"is",
"always",
"a",
"proper",
"substring",
"of",
"wholeMatch",
"and",
"b",
")",
"more",
"than",
"one"... | 91f8cf3c10b75df65b69f9181cee8151d65a788d | https://github.com/benweet/stackedit/blob/91f8cf3c10b75df65b69f9181cee8151d65a788d/src/libs/pagedown.js#L657-L664 | train | add reference number | [
30522,
3853,
1006,
2878,
18900,
2818,
1010,
2077,
1010,
5110,
1010,
2044,
23111,
2121,
1010,
8909,
1010,
2203,
1007,
1063,
5110,
1027,
5110,
1012,
5672,
1006,
19723,
10288,
1010,
2131,
13767,
1007,
1025,
2065,
1006,
13366,
16033,
4215,
2094... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
tgriesser/knex | src/dialects/mssql/index.js | _poolCreate | function _poolCreate() {
// implementation is copy-pasted from https://github.com/tediousjs/node-mssql/pull/614
return new base.Promise((resolve, reject) => {
const cfg = {
userName: this.config.user,
password: this.config.password,
server: this.config.server,
... | javascript | function _poolCreate() {
// implementation is copy-pasted from https://github.com/tediousjs/node-mssql/pull/614
return new base.Promise((resolve, reject) => {
const cfg = {
userName: this.config.user,
password: this.config.password,
server: this.config.server,
... | [
"function",
"_poolCreate",
"(",
")",
"{",
"// implementation is copy-pasted from https://github.com/tediousjs/node-mssql/pull/614",
"return",
"new",
"base",
".",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"const",
"cfg",
"=",
"{",
"userName",
":",
... | /* istanbul ignore next | [
"/",
"*",
"istanbul",
"ignore",
"next"
] | 6a4fecfe7822442ee5c43d924958eadfe6e17a93 | https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/dialects/mssql/index.js#L89-L179 | train | Creates a connection to the database using the specified parameters | [
30522,
3853,
1035,
4770,
16748,
3686,
1006,
1007,
1063,
1013,
1013,
7375,
2003,
6100,
1011,
19351,
2094,
2013,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
6945,
6313,
22578,
1013,
13045,
1011,
5796,
2015,
4160,
2140,
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... |
aws/aws-sdk-js | lib/services/s3.js | extractData | function extractData(resp) {
var req = resp.request;
if (req.operation === 'getBucketLocation') {
var match = resp.httpResponse.body.toString().match(/>(.+)<\/Location/);
delete resp.data['_'];
if (match) {
resp.data.LocationConstraint = match[1];
} else {
resp.data.Locat... | javascript | function extractData(resp) {
var req = resp.request;
if (req.operation === 'getBucketLocation') {
var match = resp.httpResponse.body.toString().match(/>(.+)<\/Location/);
delete resp.data['_'];
if (match) {
resp.data.LocationConstraint = match[1];
} else {
resp.data.Locat... | [
"function",
"extractData",
"(",
"resp",
")",
"{",
"var",
"req",
"=",
"resp",
".",
"request",
";",
"if",
"(",
"req",
".",
"operation",
"===",
"'getBucketLocation'",
")",
"{",
"var",
"match",
"=",
"resp",
".",
"httpResponse",
".",
"body",
".",
"toString",
... | Provides a specialized parser for getBucketLocation -- all other
operations are parsed by the super class.
@api private | [
"Provides",
"a",
"specialized",
"parser",
"for",
"getBucketLocation",
"--",
"all",
"other",
"operations",
"are",
"parsed",
"by",
"the",
"super",
"class",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L496-L530 | train | Extract data from the response | [
30522,
3853,
14817,
2850,
2696,
1006,
24501,
2361,
1007,
1063,
13075,
2128,
4160,
1027,
24501,
2361,
1012,
5227,
1025,
2065,
1006,
2128,
4160,
1012,
3169,
1027,
1027,
1027,
1005,
2131,
24204,
3388,
4135,
10719,
1005,
1007,
1063,
13075,
2674... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/PerfUtils.js | getHealthReport | function getHealthReport() {
var healthReport = {
projectLoadTimes : "",
fileOpenTimes : ""
};
_.forEach(perfData, function (entry, testName) {
if (StringUtils.startsWith(testName, "Application Startup")) {
healthReport.AppStartupTime = getVal... | javascript | function getHealthReport() {
var healthReport = {
projectLoadTimes : "",
fileOpenTimes : ""
};
_.forEach(perfData, function (entry, testName) {
if (StringUtils.startsWith(testName, "Application Startup")) {
healthReport.AppStartupTime = getVal... | [
"function",
"getHealthReport",
"(",
")",
"{",
"var",
"healthReport",
"=",
"{",
"projectLoadTimes",
":",
"\"\"",
",",
"fileOpenTimes",
":",
"\"\"",
"}",
";",
"_",
".",
"forEach",
"(",
"perfData",
",",
"function",
"(",
"entry",
",",
"testName",
")",
"{",
"... | Returns the Performance metrics to be logged for health report
@return {Object} An object with the health data logs to be sent | [
"Returns",
"the",
"Performance",
"metrics",
"to",
"be",
"logged",
"for",
"health",
"report"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/PerfUtils.js#L368-L387 | train | Get health report | [
30522,
3853,
2131,
20192,
24658,
2890,
6442,
1006,
1007,
1063,
13075,
2740,
2890,
6442,
1027,
1063,
2622,
11066,
7292,
2015,
1024,
1000,
1000,
1010,
5371,
26915,
7292,
2015,
1024,
1000,
1000,
1065,
1025,
1035,
1012,
18921,
6776,
1006,
2566,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
summernote/summernote | src/js/base/core/lists.js | contains | function contains(array, item) {
if (array && array.length && item) {
return array.indexOf(item) !== -1;
}
return false;
} | javascript | function contains(array, item) {
if (array && array.length && item) {
return array.indexOf(item) !== -1;
}
return false;
} | [
"function",
"contains",
"(",
"array",
",",
"item",
")",
"{",
"if",
"(",
"array",
"&&",
"array",
".",
"length",
"&&",
"item",
")",
"{",
"return",
"array",
".",
"indexOf",
"(",
"item",
")",
"!==",
"-",
"1",
";",
"}",
"return",
"false",
";",
"}"
] | returns true if the value is present in the list. | [
"returns",
"true",
"if",
"the",
"value",
"is",
"present",
"in",
"the",
"list",
"."
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/lists.js#L66-L71 | train | Returns true if the given item is in the array | [
30522,
3853,
3397,
1006,
9140,
1010,
8875,
1007,
1063,
2065,
1006,
9140,
1004,
1004,
9140,
1012,
3091,
1004,
1004,
8875,
1007,
1063,
2709,
9140,
1012,
5950,
11253,
1006,
8875,
1007,
999,
1027,
1027,
1011,
1015,
1025,
1065,
2709,
6270,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js | getBindings | function getBindings(oElement, oParentDefaultModel, bTemplate, sAggregationName) {
var aBindings = (
bTemplate
? getBindingsFromTemplateProperties(oElement)
: getBindingsFromProperties(oElement, oParentDefaultModel)
);
var aAggregationNames = sAggregationName ? [ sAggregationName ] : Object.keys(oElement... | javascript | function getBindings(oElement, oParentDefaultModel, bTemplate, sAggregationName) {
var aBindings = (
bTemplate
? getBindingsFromTemplateProperties(oElement)
: getBindingsFromProperties(oElement, oParentDefaultModel)
);
var aAggregationNames = sAggregationName ? [ sAggregationName ] : Object.keys(oElement... | [
"function",
"getBindings",
"(",
"oElement",
",",
"oParentDefaultModel",
",",
"bTemplate",
",",
"sAggregationName",
")",
"{",
"var",
"aBindings",
"=",
"(",
"bTemplate",
"?",
"getBindingsFromTemplateProperties",
"(",
"oElement",
")",
":",
"getBindingsFromProperties",
"(... | Gets bindings for the whole hierarchy of children for a specified Element
and filters out bindings which are not relevant (based on the parent model)
@param {sap.ui.core.Control} oElement - Starting point of the search
@param {sap.ui.model.Model} oParentDefaultModel - Model for filtering irrelevant binding paths
@para... | [
"Gets",
"bindings",
"for",
"the",
"whole",
"hierarchy",
"of",
"children",
"for",
"a",
"specified",
"Element",
"and",
"filters",
"out",
"bindings",
"which",
"are",
"not",
"relevant",
"(",
"based",
"on",
"the",
"parent",
"model",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/util/BindingsExtractor.js#L90-L103 | train | Get bindings for the given element | [
30522,
3853,
2131,
8428,
4667,
2015,
1006,
1051,
12260,
3672,
1010,
6728,
12069,
3372,
3207,
7011,
11314,
5302,
9247,
1010,
18411,
6633,
15725,
1010,
7842,
13871,
2890,
12540,
18442,
1007,
1063,
13075,
11113,
22254,
8613,
1027,
1006,
18411,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/relay | packages/relay-compiler/transforms/RelayRefetchableFragmentTransform.js | relayRefetchableFragmentTransform | function relayRefetchableFragmentTransform(
context: GraphQLCompilerContext,
): GraphQLCompilerContext {
const schema = context.serverSchema;
const queryType = schema.getQueryType();
if (queryType == null) {
throw createUserError('Expected the schema to define a query type.');
}
const refetchOperations ... | javascript | function relayRefetchableFragmentTransform(
context: GraphQLCompilerContext,
): GraphQLCompilerContext {
const schema = context.serverSchema;
const queryType = schema.getQueryType();
if (queryType == null) {
throw createUserError('Expected the schema to define a query type.');
}
const refetchOperations ... | [
"function",
"relayRefetchableFragmentTransform",
"(",
"context",
":",
"GraphQLCompilerContext",
",",
")",
":",
"GraphQLCompilerContext",
"{",
"const",
"schema",
"=",
"context",
".",
"serverSchema",
";",
"const",
"queryType",
"=",
"schema",
".",
"getQueryType",
"(",
... | This transform synthesizes "refetch" queries for fragments that
are trivially refetchable. This is comprised of three main stages:
1. Validating that fragments marked with @refetchable qualify for
refetch query generation; mainly this means that the fragment
type is able to be refetched in some canonical way.
2. Deter... | [
"This",
"transform",
"synthesizes",
"refetch",
"queries",
"for",
"fragments",
"that",
"are",
"trivially",
"refetchable",
".",
"This",
"is",
"comprised",
"of",
"three",
"main",
"stages",
":"
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/transforms/RelayRefetchableFragmentTransform.js#L80-L162 | train | Relays a refetchable fragment to the next context. | [
30522,
3853,
8846,
2890,
7959,
10649,
3085,
27843,
21693,
4765,
6494,
3619,
14192,
1006,
6123,
1024,
10629,
4160,
22499,
8737,
9463,
29566,
10111,
18413,
1010,
1007,
1024,
10629,
4160,
22499,
8737,
9463,
29566,
10111,
18413,
1063,
9530,
3367,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/ScopeManager.js | getPendingRequest | function getPendingRequest(file, offset, type) {
var key = file + "@" + offset.line + "@" + offset.ch;
if (_.has(pendingTernRequests, key)) {
var requests = pendingTernRequests[key],
requestType = requests[type];
delete pendingTernRequests[key][type];
... | javascript | function getPendingRequest(file, offset, type) {
var key = file + "@" + offset.line + "@" + offset.ch;
if (_.has(pendingTernRequests, key)) {
var requests = pendingTernRequests[key],
requestType = requests[type];
delete pendingTernRequests[key][type];
... | [
"function",
"getPendingRequest",
"(",
"file",
",",
"offset",
",",
"type",
")",
"{",
"var",
"key",
"=",
"file",
"+",
"\"@\"",
"+",
"offset",
".",
"line",
"+",
"\"@\"",
"+",
"offset",
".",
"ch",
";",
"if",
"(",
"_",
".",
"has",
"(",
"pendingTernRequest... | Get any pending $.Deferred object waiting on the specified file and request type
@param {string} file - the file
@param {{line: number, ch: number}} offset - the offset into the file the request is for
@param {string} type - the type of request
@return {jQuery.Deferred} - the $.Deferred for the request | [
"Get",
"any",
"pending",
"$",
".",
"Deferred",
"object",
"waiting",
"on",
"the",
"specified",
"file",
"and",
"request",
"type"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L310-L324 | train | Get the request type of a file offset | [
30522,
3853,
2131,
11837,
4667,
2890,
15500,
1006,
5371,
1010,
16396,
1010,
2828,
1007,
1063,
13075,
3145,
1027,
5371,
1009,
1000,
1030,
1000,
1009,
16396,
1012,
2240,
1009,
1000,
1030,
1000,
1009,
16396,
1012,
10381,
1025,
2065,
1006,
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... |
facebook/relay | packages/relay-compiler/core/getFieldDefinition.js | getFieldDefinitionLegacy | function getFieldDefinitionLegacy(
schema: GraphQLSchema,
parentType: GraphQLOutputType,
fieldName: string,
fieldAST: FieldNode,
): ?GraphQLField<mixed, mixed> {
let schemaFieldDef = getFieldDefinitionStrict(
schema,
parentType,
fieldName,
fieldAST,
);
if (!schemaFieldDef) {
const type... | javascript | function getFieldDefinitionLegacy(
schema: GraphQLSchema,
parentType: GraphQLOutputType,
fieldName: string,
fieldAST: FieldNode,
): ?GraphQLField<mixed, mixed> {
let schemaFieldDef = getFieldDefinitionStrict(
schema,
parentType,
fieldName,
fieldAST,
);
if (!schemaFieldDef) {
const type... | [
"function",
"getFieldDefinitionLegacy",
"(",
"schema",
":",
"GraphQLSchema",
",",
"parentType",
":",
"GraphQLOutputType",
",",
"fieldName",
":",
"string",
",",
"fieldAST",
":",
"FieldNode",
",",
")",
":",
"?",
"GraphQLField",
"<",
"mixed",
",",
"mixed",
">",
"... | Find the definition of a field of the specified type, first trying
the standard spec-compliant resolution process and falling back
to legacy mode that supports fat interfaces. | [
"Find",
"the",
"definition",
"of",
"a",
"field",
"of",
"the",
"specified",
"type",
"first",
"trying",
"the",
"standard",
"spec",
"-",
"compliant",
"resolution",
"process",
"and",
"falling",
"back",
"to",
"legacy",
"mode",
"that",
"supports",
"fat",
"interfaces... | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/core/getFieldDefinition.js#L79-L101 | train | Returns a GraphQLField instance from a field node | [
30522,
3853,
2131,
3790,
3207,
16294,
22753,
23115,
15719,
1006,
8040,
28433,
1024,
10629,
4160,
4877,
5403,
2863,
1010,
6687,
13874,
1024,
10629,
4160,
23743,
25856,
4904,
13874,
1010,
2492,
18442,
1024,
5164,
1010,
2492,
14083,
1024,
2492,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/formatters/codeframe.js | formatMessage | function formatMessage(message, parentResult) {
const type = (message.fatal || message.severity === 2) ? chalk.red("error") : chalk.yellow("warning");
const msg = `${chalk.bold(message.message.replace(/([^ ])\.$/u, "$1"))}`;
const ruleId = message.fatal ? "" : chalk.dim(`(${message.ruleId})`);
const fil... | javascript | function formatMessage(message, parentResult) {
const type = (message.fatal || message.severity === 2) ? chalk.red("error") : chalk.yellow("warning");
const msg = `${chalk.bold(message.message.replace(/([^ ])\.$/u, "$1"))}`;
const ruleId = message.fatal ? "" : chalk.dim(`(${message.ruleId})`);
const fil... | [
"function",
"formatMessage",
"(",
"message",
",",
"parentResult",
")",
"{",
"const",
"type",
"=",
"(",
"message",
".",
"fatal",
"||",
"message",
".",
"severity",
"===",
"2",
")",
"?",
"chalk",
".",
"red",
"(",
"\"error\"",
")",
":",
"chalk",
".",
"yell... | Gets the formatted output for a given message.
@param {Object} message The object that represents this message.
@param {Object} parentResult The result object that this message belongs to.
@returns {string} The formatted output. | [
"Gets",
"the",
"formatted",
"output",
"for",
"a",
"given",
"message",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/formatters/codeframe.js#L48-L71 | train | Format a message to be printed to the console | [
30522,
3853,
4289,
7834,
3736,
3351,
1006,
4471,
1010,
6687,
6072,
11314,
1007,
1063,
9530,
3367,
2828,
1027,
1006,
4471,
1012,
10611,
1064,
1064,
4471,
1012,
18976,
1027,
1027,
1027,
1016,
1007,
1029,
16833,
1012,
2417,
1006,
1000,
7561,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.demokit/src/sap/ui/demokit/explored/util/MyRouter.js | function (viewName, viewType, master, data) {
var app = sap.ui.getCore().byId("splitApp");
var view = this.getView(viewName, viewType);
app.addPage(view, master);
app.toDetail(view.getId(), "show", data);
} | javascript | function (viewName, viewType, master, data) {
var app = sap.ui.getCore().byId("splitApp");
var view = this.getView(viewName, viewType);
app.addPage(view, master);
app.toDetail(view.getId(), "show", data);
} | [
"function",
"(",
"viewName",
",",
"viewType",
",",
"master",
",",
"data",
")",
"{",
"var",
"app",
"=",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"byId",
"(",
"\"splitApp\"",
")",
";",
"var",
"view",
"=",
"this",
".",
"getView",
"(",
"viewNam... | a nav to method that does not write hashes but load the views properly | [
"a",
"nav",
"to",
"method",
"that",
"does",
"not",
"write",
"hashes",
"but",
"load",
"the",
"views",
"properly"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/explored/util/MyRouter.js#L31-L36 | train | Add a new page to the detail | [
30522,
3853,
1006,
3193,
18442,
1010,
3193,
13874,
1010,
3040,
1010,
2951,
1007,
1063,
13075,
10439,
1027,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
1012,
2011,
3593,
1006,
1000,
3975,
29098,
1000,
1007,
1025,
13075,
3193,
1027,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | xlsx.js | parse_SerAr | function parse_SerAr(blob, biff) {
var val = [blob.read_shift(1)];
if(biff == 12) switch(val[0]) {
case 0x02: val[0] = 0x04; break; /* SerBool */
case 0x04: val[0] = 0x10; break; /* SerErr */
case 0x00: val[0] = 0x01; break; /* SerNum */
case 0x01: val[0] = 0x02; break; /* SerStr */
}
switch(val[0]) {
cas... | javascript | function parse_SerAr(blob, biff) {
var val = [blob.read_shift(1)];
if(biff == 12) switch(val[0]) {
case 0x02: val[0] = 0x04; break; /* SerBool */
case 0x04: val[0] = 0x10; break; /* SerErr */
case 0x00: val[0] = 0x01; break; /* SerNum */
case 0x01: val[0] = 0x02; break; /* SerStr */
}
switch(val[0]) {
cas... | [
"function",
"parse_SerAr",
"(",
"blob",
",",
"biff",
")",
"{",
"var",
"val",
"=",
"[",
"blob",
".",
"read_shift",
"(",
"1",
")",
"]",
";",
"if",
"(",
"biff",
"==",
"12",
")",
"switch",
"(",
"val",
"[",
"0",
"]",
")",
"{",
"case",
"0x02",
":",
... | /* [MS-XLS] 2.5.192.112 + 2.5.192.11{3,4,5,6,7} /* [MS-XLSB] 2.5.97.93 + 2.5.97.9{4,5,6,7} | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"5",
".",
"192",
".",
"112",
"+",
"2",
".",
"5",
".",
"192",
".",
"11",
"{",
"3",
"4",
"5",
"6",
"7",
"}",
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"5",
".",
"97",
".",
"93",
... | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L10499-L10524 | train | Parse an SerAr | [
30522,
3853,
11968,
3366,
1035,
26358,
2099,
1006,
1038,
4135,
2497,
1010,
12170,
4246,
1007,
1063,
13075,
11748,
1027,
1031,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1015,
1007,
1033,
1025,
2065,
1006,
12170,
4246,
1027,
1027,
2260,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
verdaccio/verdaccio | src/lib/logger.js | print | function print(type, msg, obj, colors) {
if (typeof type === 'number') {
type = calculateLevel(type);
}
const finalMessage = fillInMsgTemplate(msg, obj, colors);
const subsystems = [
{
in: green('<--'),
out: yellow('-->'),
fs: black('-=-'),
default: blue('---'),
},
{
... | javascript | function print(type, msg, obj, colors) {
if (typeof type === 'number') {
type = calculateLevel(type);
}
const finalMessage = fillInMsgTemplate(msg, obj, colors);
const subsystems = [
{
in: green('<--'),
out: yellow('-->'),
fs: black('-=-'),
default: blue('---'),
},
{
... | [
"function",
"print",
"(",
"type",
",",
"msg",
",",
"obj",
",",
"colors",
")",
"{",
"if",
"(",
"typeof",
"type",
"===",
"'number'",
")",
"{",
"type",
"=",
"calculateLevel",
"(",
"type",
")",
";",
"}",
"const",
"finalMessage",
"=",
"fillInMsgTemplate",
"... | Apply colors to a string based on level parameters.
@param {*} type
@param {*} msg
@param {*} obj
@param {*} colors
@return {String} | [
"Apply",
"colors",
"to",
"a",
"string",
"based",
"on",
"level",
"parameters",
"."
] | daa7e897b6d093bf8282ff12df3f450bcd73476c | https://github.com/verdaccio/verdaccio/blob/daa7e897b6d093bf8282ff12df3f450bcd73476c/src/lib/logger.js#L227-L254 | train | Print a message to the console | [
30522,
3853,
6140,
1006,
2828,
1010,
5796,
2290,
1010,
27885,
3501,
1010,
6087,
1007,
1063,
2065,
1006,
2828,
11253,
2828,
1027,
1027,
1027,
1005,
2193,
1005,
1007,
1063,
2828,
1027,
18422,
20414,
2884,
1006,
2828,
1007,
1025,
1065,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
semantic-release/semantic-release | lib/git.js | getTags | async function getTags(execaOpts) {
return (await execa.stdout('git', ['tag'], execaOpts))
.split('\n')
.map(tag => tag.trim())
.filter(Boolean);
} | javascript | async function getTags(execaOpts) {
return (await execa.stdout('git', ['tag'], execaOpts))
.split('\n')
.map(tag => tag.trim())
.filter(Boolean);
} | [
"async",
"function",
"getTags",
"(",
"execaOpts",
")",
"{",
"return",
"(",
"await",
"execa",
".",
"stdout",
"(",
"'git'",
",",
"[",
"'tag'",
"]",
",",
"execaOpts",
")",
")",
".",
"split",
"(",
"'\\n'",
")",
".",
"map",
"(",
"tag",
"=>",
"tag",
".",... | Get all the repository tags.
@param {Object} [execaOpts] Options to pass to `execa`.
@return {Array<String>} List of git tags.
@throws {Error} If the `git` command fails. | [
"Get",
"all",
"the",
"repository",
"tags",
"."
] | edf382f88838ed543c0b76cb6c914cca1fc1ddd1 | https://github.com/semantic-release/semantic-release/blob/edf382f88838ed543c0b76cb6c914cca1fc1ddd1/lib/git.js#L28-L33 | train | Get all tags from the branch | [
30522,
2004,
6038,
2278,
3853,
2131,
15900,
2015,
1006,
4654,
19281,
7361,
3215,
1007,
1063,
2709,
1006,
26751,
4654,
19281,
1012,
2358,
26797,
2102,
1006,
1005,
21025,
2102,
1005,
1010,
1031,
1005,
6415,
1005,
1033,
1010,
4654,
19281,
7361... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/AnnotationParser.js | function(mAttributes, oNode) {
var mIgnoredAttributes = {
"Property" : true,
"Qualifier": true,
"Term": true,
"xmlns" : true
};
for (var i = 0; i < oNode.attributes.length; i += 1) {
var sName = oNode.attributes[i].name;
if (!mIgnoredAttributes[sName] && (sName.indexOf("xmlns:") !== 0)) {
... | javascript | function(mAttributes, oNode) {
var mIgnoredAttributes = {
"Property" : true,
"Qualifier": true,
"Term": true,
"xmlns" : true
};
for (var i = 0; i < oNode.attributes.length; i += 1) {
var sName = oNode.attributes[i].name;
if (!mIgnoredAttributes[sName] && (sName.indexOf("xmlns:") !== 0)) {
... | [
"function",
"(",
"mAttributes",
",",
"oNode",
")",
"{",
"var",
"mIgnoredAttributes",
"=",
"{",
"\"Property\"",
":",
"true",
",",
"\"Qualifier\"",
":",
"true",
",",
"\"Term\"",
":",
"true",
",",
"\"xmlns\"",
":",
"true",
"}",
";",
"for",
"(",
"var",
"i",
... | /*
Returns a map of key value pairs corresponding to the attributes of the given Node -
attributes named "Property", "Term" and "Qualifier" are ignored.
@param {map} mAttributes - A map that may already contain attributes, this map will be filled and returned by this method
@param {Node} oNode - The node with the attr... | [
"/",
"*",
"Returns",
"a",
"map",
"of",
"key",
"value",
"pairs",
"corresponding",
"to",
"the",
"attributes",
"of",
"the",
"given",
"Node",
"-",
"attributes",
"named",
"Property",
"Term",
"and",
"Qualifier",
"are",
"ignored",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/AnnotationParser.js#L821-L846 | train | Parses the attributes of a node | [
30522,
3853,
1006,
4717,
3089,
8569,
4570,
1010,
21058,
3207,
1007,
1063,
13075,
19117,
12131,
11960,
4779,
3089,
8569,
4570,
1027,
1063,
1000,
3200,
1000,
1024,
2995,
1010,
1000,
10981,
1000,
1024,
2995,
1010,
1000,
2744,
1000,
1024,
2995,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
firebase/firebaseui-web | javascript/utils/googleyolo.js | function() {
// UI initialized, it is OK to cancel last operation.
self.initialized_ = true;
// retrieve is only called if auto sign-in is enabled. Otherwise, it will
// get skipped.
var retrieveCredential = Promise.resolve(null);
if (!autoSignInDisabled) {
retrieveCredential... | javascript | function() {
// UI initialized, it is OK to cancel last operation.
self.initialized_ = true;
// retrieve is only called if auto sign-in is enabled. Otherwise, it will
// get skipped.
var retrieveCredential = Promise.resolve(null);
if (!autoSignInDisabled) {
retrieveCredential... | [
"function",
"(",
")",
"{",
"// UI initialized, it is OK to cancel last operation.",
"self",
".",
"initialized_",
"=",
"true",
";",
"// retrieve is only called if auto sign-in is enabled. Otherwise, it will",
"// get skipped.",
"var",
"retrieveCredential",
"=",
"Promise",
".",
"re... | One-Tap UI renderer. | [
"One",
"-",
"Tap",
"UI",
"renderer",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/utils/googleyolo.js#L131-L182 | train | Returns the credential that is available in the database. | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
21318,
3988,
3550,
1010,
2009,
2003,
7929,
2000,
17542,
2197,
3169,
1012,
2969,
1012,
3988,
3550,
1035,
1027,
2995,
1025,
1013,
1013,
12850,
2003,
2069,
2170,
2065,
8285,
3696,
1011,
1999,
2003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/InlineTimingFunctionEditor.js | InlineTimingFunctionEditor | function InlineTimingFunctionEditor(timingFunction, startBookmark, endBookmark) {
this._timingFunction = timingFunction;
this._startBookmark = startBookmark;
this._endBookmark = endBookmark;
this._isOwnChange = false;
this._isHostChange = false;
this._origin = "+InlineTim... | javascript | function InlineTimingFunctionEditor(timingFunction, startBookmark, endBookmark) {
this._timingFunction = timingFunction;
this._startBookmark = startBookmark;
this._endBookmark = endBookmark;
this._isOwnChange = false;
this._isHostChange = false;
this._origin = "+InlineTim... | [
"function",
"InlineTimingFunctionEditor",
"(",
"timingFunction",
",",
"startBookmark",
",",
"endBookmark",
")",
"{",
"this",
".",
"_timingFunction",
"=",
"timingFunction",
";",
"this",
".",
"_startBookmark",
"=",
"startBookmark",
";",
"this",
".",
"_endBookmark",
"=... | Constructor for inline widget containing a BezierCurveEditor control
@param {!RegExpMatch} timingFunction RegExp match object of initially selected timingFunction
@param {!CodeMirror.Bookmark} startBookmark
@param {!CodeMirror.Bookmark} endBookmark | [
"Constructor",
"for",
"inline",
"widget",
"containing",
"a",
"BezierCurveEditor",
"control"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/InlineTimingFunctionEditor.js#L43-L55 | train | InlineTimingFunctionEditor constructor. | [
30522,
3853,
23881,
3775,
6562,
11263,
27989,
2098,
15660,
1006,
10984,
11263,
27989,
1010,
2707,
8654,
10665,
1010,
2203,
8654,
10665,
1007,
1063,
2023,
1012,
1035,
10984,
11263,
27989,
1027,
10984,
11263,
27989,
1025,
2023,
1012,
1035,
2707... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.