repo stringclasses 195
values | path stringlengths 4 99 | func_name stringlengths 0 41 | original_string stringlengths 72 56.1k | language stringclasses 1
value | code stringlengths 72 56.1k | code_tokens listlengths 25 8.12k | docstring stringlengths 2 12.5k | docstring_tokens listlengths 1 449 | sha stringclasses 197
values | url stringlengths 88 186 | partition stringclasses 1
value | summary stringlengths 8 338 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
firebase/firebaseui-web | gulpfile.js | repeatTaskForAllLocales | function repeatTaskForAllLocales(taskName, dependencies, operation) {
return ALL_LOCALES.map((locale) => {
// Convert build-js-$ to build-js-fr, for example.
const replaceTokens = (name) => name.replace(/\$/g, locale);
const localeTaskName = replaceTokens(taskName);
const localeDependencies = dependen... | javascript | function repeatTaskForAllLocales(taskName, dependencies, operation) {
return ALL_LOCALES.map((locale) => {
// Convert build-js-$ to build-js-fr, for example.
const replaceTokens = (name) => name.replace(/\$/g, locale);
const localeTaskName = replaceTokens(taskName);
const localeDependencies = dependen... | [
"function",
"repeatTaskForAllLocales",
"(",
"taskName",
",",
"dependencies",
",",
"operation",
")",
"{",
"return",
"ALL_LOCALES",
".",
"map",
"(",
"(",
"locale",
")",
"=>",
"{",
"// Convert build-js-$ to build-js-fr, for example.",
"const",
"replaceTokens",
"=",
"(",
... | Repeats a gulp task for all locales.
@param {string} taskName The gulp task name to generate. Any $ tokens will be
replaced with the language code (e.g. build-$ becomes build-fr, build-es,
etc.).
@param {!Array<string>} dependencies The gulp tasks that each operation
depends on. Any $ tokens will be replaced with the l... | [
"Repeats",
"a",
"gulp",
"task",
"for",
"all",
"locales",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/gulpfile.js#L167-L179 | train | This function is called by the build - js - fr task to run a task for each locale | [
30522,
3853,
9377,
10230,
2243,
29278,
8095,
4135,
9289,
2229,
1006,
4708,
18442,
1010,
12530,
15266,
1010,
3169,
1007,
1063,
2709,
2035,
1035,
2334,
2229,
1012,
4949,
1006,
1006,
2334,
2063,
1007,
1027,
1028,
1063,
1013,
1013,
10463,
3857,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TableGrouping.js | function(oTable, vRowIndex, bExpand) {
var aIndices = [];
var oBinding = oTable ? oTable.getBinding("rows") : null;
if (!oTable || !oBinding || !oBinding.expand || vRowIndex == null) {
return null;
}
if (typeof vRowIndex === "number") {
aIndices = [vRowIndex];
} else if (Array.isArray(vRowIn... | javascript | function(oTable, vRowIndex, bExpand) {
var aIndices = [];
var oBinding = oTable ? oTable.getBinding("rows") : null;
if (!oTable || !oBinding || !oBinding.expand || vRowIndex == null) {
return null;
}
if (typeof vRowIndex === "number") {
aIndices = [vRowIndex];
} else if (Array.isArray(vRowIn... | [
"function",
"(",
"oTable",
",",
"vRowIndex",
",",
"bExpand",
")",
"{",
"var",
"aIndices",
"=",
"[",
"]",
";",
"var",
"oBinding",
"=",
"oTable",
"?",
"oTable",
".",
"getBinding",
"(",
"\"rows\"",
")",
":",
"null",
";",
"if",
"(",
"!",
"oTable",
"||",
... | Toggles or sets the expanded state of a single or multiple rows. Toggling only works for a single row.
@param {sap.ui.table.Table} oTable Instance of the table.
@param {int | int[]} vRowIndex A single index, or an array of indices of the rows to expand or collapse.
@param {boolean} [bExpand] If defined, instead of tog... | [
"Toggles",
"or",
"sets",
"the",
"expanded",
"state",
"of",
"a",
"single",
"or",
"multiple",
"rows",
".",
"Toggling",
"only",
"works",
"for",
"a",
"single",
"row",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableGrouping.js#L113-L184 | train | Returns the binding length of the given row. | [
30522,
3853,
1006,
27178,
3085,
1010,
27830,
5004,
22254,
10288,
1010,
2022,
2595,
9739,
2094,
1007,
1063,
13075,
7110,
24598,
2015,
1027,
1031,
1033,
1025,
13075,
27885,
22254,
2075,
1027,
27178,
3085,
1029,
27178,
3085,
1012,
2131,
8428,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GitbookIO/gitbook | lib/init.js | initBook | function initBook(rootFolder) {
var extension = '.md';
return fs.mkdirp(rootFolder)
// Parse the summary and readme
.then(function() {
var fs = createNodeFS(rootFolder);
var book = Book.createForFS(fs);
return Parse.parseReadme(book)
// Setup default readme if doesn't... | javascript | function initBook(rootFolder) {
var extension = '.md';
return fs.mkdirp(rootFolder)
// Parse the summary and readme
.then(function() {
var fs = createNodeFS(rootFolder);
var book = Book.createForFS(fs);
return Parse.parseReadme(book)
// Setup default readme if doesn't... | [
"function",
"initBook",
"(",
"rootFolder",
")",
"{",
"var",
"extension",
"=",
"'.md'",
";",
"return",
"fs",
".",
"mkdirp",
"(",
"rootFolder",
")",
"// Parse the summary and readme",
".",
"then",
"(",
"function",
"(",
")",
"{",
"var",
"fs",
"=",
"createNodeFS... | Initialize folder structure for a book
Read SUMMARY to created the right chapter
@param {Book}
@param {String}
@return {Promise} | [
"Initialize",
"folder",
"structure",
"for",
"a",
"book",
"Read",
"SUMMARY",
"to",
"created",
"the",
"right",
"chapter"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/init.js#L19-L81 | train | Initialize the book | [
30522,
3853,
1999,
4183,
8654,
1006,
7117,
10371,
2121,
1007,
1063,
13075,
5331,
1027,
1005,
1012,
9108,
1005,
1025,
2709,
1042,
2015,
1012,
12395,
4305,
14536,
1006,
7117,
10371,
2121,
1007,
1013,
1013,
11968,
3366,
1996,
12654,
1998,
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... |
adobe/brackets | src/preferences/PreferencesBase.js | function (id) {
var scope = this._scopes[id],
shadowIndex;
if (!scope) {
return;
}
this.removeFromScopeOrder(id);
shadowIndex = _.findIndex(this._defaults._shadowScopeOrder, function (entry) {
return entry.id ==... | javascript | function (id) {
var scope = this._scopes[id],
shadowIndex;
if (!scope) {
return;
}
this.removeFromScopeOrder(id);
shadowIndex = _.findIndex(this._defaults._shadowScopeOrder, function (entry) {
return entry.id ==... | [
"function",
"(",
"id",
")",
"{",
"var",
"scope",
"=",
"this",
".",
"_scopes",
"[",
"id",
"]",
",",
"shadowIndex",
";",
"if",
"(",
"!",
"scope",
")",
"{",
"return",
";",
"}",
"this",
".",
"removeFromScopeOrder",
"(",
"id",
")",
";",
"shadowIndex",
"... | Removes a Scope from this PreferencesSystem. Returns without doing anything
if the Scope does not exist. Notifies listeners of preferences that may have
changed.
@param {string} id Name of the Scope to remove | [
"Removes",
"a",
"Scope",
"from",
"this",
"PreferencesSystem",
".",
"Returns",
"without",
"doing",
"anything",
"if",
"the",
"Scope",
"does",
"not",
"exist",
".",
"Notifies",
"listeners",
"of",
"preferences",
"that",
"may",
"have",
"changed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1618-L1631 | train | Remove scope from scope order | [
30522,
3853,
1006,
8909,
1007,
1063,
13075,
9531,
1027,
2023,
1012,
1035,
9531,
2015,
1031,
8909,
1033,
1010,
5192,
22254,
10288,
1025,
2065,
1006,
999,
9531,
1007,
1063,
2709,
1025,
1065,
2023,
1012,
6366,
19699,
22225,
16186,
8551,
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/LiveDevelopment/Agents/RemoteAgent.js | call | function call(method, varargs) {
var argsArray = [_objectId, "_LD." + method];
if (arguments.length > 1) {
argsArray = argsArray.concat(Array.prototype.slice.call(arguments, 1));
}
return _call.apply(null, argsArray);
} | javascript | function call(method, varargs) {
var argsArray = [_objectId, "_LD." + method];
if (arguments.length > 1) {
argsArray = argsArray.concat(Array.prototype.slice.call(arguments, 1));
}
return _call.apply(null, argsArray);
} | [
"function",
"call",
"(",
"method",
",",
"varargs",
")",
"{",
"var",
"argsArray",
"=",
"[",
"_objectId",
",",
"\"_LD.\"",
"+",
"method",
"]",
";",
"if",
"(",
"arguments",
".",
"length",
">",
"1",
")",
"{",
"argsArray",
"=",
"argsArray",
".",
"concat",
... | Call a remote function
The parameters are passed on to the remote functions. Nodes are resolved
and sent as objectIds.
@param {string} function name | [
"Call",
"a",
"remote",
"function",
"The",
"parameters",
"are",
"passed",
"on",
"to",
"the",
"remote",
"functions",
".",
"Nodes",
"are",
"resolved",
"and",
"sent",
"as",
"objectIds",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteAgent.js#L98-L106 | train | Call a method on the object | [
30522,
3853,
2655,
1006,
4118,
1010,
13075,
2906,
5620,
1007,
1063,
13075,
12098,
5620,
2906,
9447,
1027,
1031,
1035,
4874,
3593,
1010,
1000,
1035,
25510,
1012,
1000,
1009,
4118,
1033,
1025,
2065,
1006,
9918,
1012,
3091,
1028,
1015,
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... |
GeekyAnts/vue-native-core | packages/weex-template-compiler/build.js | model | function model (
el,
dir,
_warn
) {
if (el.tag === 'input' || el.tag === 'textarea') {
genDefaultModel(el, dir.value, dir.modifiers);
} else {
genComponentModel(el, dir.value, dir.modifiers);
}
} | javascript | function model (
el,
dir,
_warn
) {
if (el.tag === 'input' || el.tag === 'textarea') {
genDefaultModel(el, dir.value, dir.modifiers);
} else {
genComponentModel(el, dir.value, dir.modifiers);
}
} | [
"function",
"model",
"(",
"el",
",",
"dir",
",",
"_warn",
")",
"{",
"if",
"(",
"el",
".",
"tag",
"===",
"'input'",
"||",
"el",
".",
"tag",
"===",
"'textarea'",
")",
"{",
"genDefaultModel",
"(",
"el",
",",
"dir",
".",
"value",
",",
"dir",
".",
"mo... | /* | [
"/",
"*"
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/weex-template-compiler/build.js#L2792-L2802 | train | Generates the model for a node | [
30522,
3853,
2944,
1006,
3449,
1010,
16101,
1010,
1035,
11582,
1007,
30524,
1025,
1065,
2842,
1063,
8991,
9006,
29513,
3372,
5302,
9247,
1006,
3449,
1010,
16101,
1012,
3643,
1010,
16101,
1012,
16913,
28295,
1007,
1025,
1065,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/looks.js | function() {
this.jsonInit({
"message0": Blockly.Msg.LOOKS_CHANGEEFFECTBY,
"args0": [
{
"type": "field_dropdown",
"name": "EFFECT",
"options": [
[Blockly.Msg.LOOKS_EFFECT_COLOR, 'COLOR'],
[Blockly.Msg.LOOKS_EFFECT_FISHEYE, 'FISHEYE'],
... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.LOOKS_CHANGEEFFECTBY,
"args0": [
{
"type": "field_dropdown",
"name": "EFFECT",
"options": [
[Blockly.Msg.LOOKS_EFFECT_COLOR, 'COLOR'],
[Blockly.Msg.LOOKS_EFFECT_FISHEYE, 'FISHEYE'],
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"LOOKS_CHANGEEFFECTBY",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"EFFECT\"",
",",
"\"options... | Block to change graphic effect.
@this Blockly.Block | [
"Block",
"to",
"change",
"graphic",
"effect",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/looks.js#L168-L193 | train | Block for changing the effect of a section. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
3504,
1035,
2689,
12879,
25969,
3762,
1010,
1000,
12098,
5620,
2692,
1000,
1024,
1031,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
marcuswestin/store.js | src/store-engine.js | function(key, optionalDefaultValue) {
var data = this.storage.read(this._namespacePrefix + key)
return this._deserialize(data, optionalDefaultValue)
} | javascript | function(key, optionalDefaultValue) {
var data = this.storage.read(this._namespacePrefix + key)
return this._deserialize(data, optionalDefaultValue)
} | [
"function",
"(",
"key",
",",
"optionalDefaultValue",
")",
"{",
"var",
"data",
"=",
"this",
".",
"storage",
".",
"read",
"(",
"this",
".",
"_namespacePrefix",
"+",
"key",
")",
"return",
"this",
".",
"_deserialize",
"(",
"data",
",",
"optionalDefaultValue",
... | get returns the value of the given key. If that value is undefined, it returns optionalDefaultValue instead. | [
"get",
"returns",
"the",
"value",
"of",
"the",
"given",
"key",
".",
"If",
"that",
"value",
"is",
"undefined",
"it",
"returns",
"optionalDefaultValue",
"instead",
"."
] | b8e22fea8738fc19da4d9e7dbf1cda6e5185c481 | https://github.com/marcuswestin/store.js/blob/b8e22fea8738fc19da4d9e7dbf1cda6e5185c481/src/store-engine.js#L21-L24 | train | Get the value of a key in the cache | [
30522,
3853,
1006,
3145,
1010,
11887,
3207,
7011,
11314,
10175,
5657,
1007,
1063,
13075,
2951,
1027,
2023,
1012,
5527,
1012,
3191,
1006,
2023,
1012,
1035,
3415,
15327,
28139,
8873,
2595,
1009,
3145,
1007,
2709,
2023,
1012,
1035,
4078,
11610... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/JavaScriptRefactoring/ExtractToFunction.js | analyzeCode | function analyzeCode(text, scopes, srcScope, destScope, start, end) {
var identifiers = {},
inThisScope = {},
thisPointerUsed = false,
returnStatementUsed = false,
variableDeclarations = {},
changedValues = {},
... | javascript | function analyzeCode(text, scopes, srcScope, destScope, start, end) {
var identifiers = {},
inThisScope = {},
thisPointerUsed = false,
returnStatementUsed = false,
variableDeclarations = {},
changedValues = {},
... | [
"function",
"analyzeCode",
"(",
"text",
",",
"scopes",
",",
"srcScope",
",",
"destScope",
",",
"start",
",",
"end",
")",
"{",
"var",
"identifiers",
"=",
"{",
"}",
",",
"inThisScope",
"=",
"{",
"}",
",",
"thisPointerUsed",
"=",
"false",
",",
"returnStatem... | Analyzes the code and finds values required for extract to function
@param {!string} text - text to be extracted
@param {!Array.<Scope>} - scopes
@param {!Scope} srcScope - source scope of the extraction
@param {!Scope} destScope - destination scope of the extraction
@param {!number} start - the start offset
@param {!n... | [
"Analyzes",
"the",
"code",
"and",
"finds",
"values",
"required",
"for",
"extract",
"to",
"function"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/ExtractToFunction.js#L55-L136 | train | Analyzes the given text. | [
30522,
3853,
17908,
16044,
1006,
3793,
1010,
9531,
2015,
1010,
5034,
6169,
16186,
1010,
4078,
3215,
16186,
1010,
2707,
1010,
2203,
1007,
1063,
13075,
8909,
4765,
28295,
1027,
1063,
1065,
1010,
20014,
24158,
26127,
1027,
1063,
1065,
1010,
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... |
moleculerjs/moleculer | bin/moleculer-runner.js | loadServices | function loadServices() {
const fileMask = flags.mask || "**/*.service.js";
const serviceDir = process.env.SERVICEDIR || "";
const svcDir = path.isAbsolute(serviceDir) ? serviceDir : path.resolve(process.cwd(), serviceDir);
let patterns = servicePaths;
if (process.env.SERVICES || process.env.SERVICEDIR) {
if... | javascript | function loadServices() {
const fileMask = flags.mask || "**/*.service.js";
const serviceDir = process.env.SERVICEDIR || "";
const svcDir = path.isAbsolute(serviceDir) ? serviceDir : path.resolve(process.cwd(), serviceDir);
let patterns = servicePaths;
if (process.env.SERVICES || process.env.SERVICEDIR) {
if... | [
"function",
"loadServices",
"(",
")",
"{",
"const",
"fileMask",
"=",
"flags",
".",
"mask",
"||",
"\"**/*.service.js\"",
";",
"const",
"serviceDir",
"=",
"process",
".",
"env",
".",
"SERVICEDIR",
"||",
"\"\"",
";",
"const",
"svcDir",
"=",
"path",
".",
"isAb... | Load services from files or directories
1. If find `SERVICEDIR` env var and not find `SERVICES` env var, load all services from the `SERVICEDIR` directory
2. If find `SERVICEDIR` env var and `SERVICES` env var, load the specified services from the `SERVICEDIR` directory
3. If not find `SERVICEDIR` env var but find `SE... | [
"Load",
"services",
"from",
"files",
"or",
"directories"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/bin/moleculer-runner.js#L292-L354 | train | Load all services from the service directory | [
30522,
3853,
15665,
2121,
7903,
2229,
1006,
1007,
1063,
9530,
3367,
5371,
9335,
2243,
1027,
9245,
1012,
7308,
1064,
1064,
1000,
1008,
1008,
1013,
1008,
1012,
2326,
1012,
1046,
2015,
1000,
1025,
9530,
3367,
22858,
4313,
1027,
2832,
1012,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
benweet/stackedit | src/services/timeSvc.js | isYearSeparator | function isYearSeparator() {
if (yearSeparator !== null) {
return yearSeparator;
}
if (!('Intl' in window)) {
return true;
}
const options = { day: 'numeric', month: 'short', year: 'numeric' };
const formatter = new window.Intl.DateTimeFormat(undefined, options);
const output = formatter.format(... | javascript | function isYearSeparator() {
if (yearSeparator !== null) {
return yearSeparator;
}
if (!('Intl' in window)) {
return true;
}
const options = { day: 'numeric', month: 'short', year: 'numeric' };
const formatter = new window.Intl.DateTimeFormat(undefined, options);
const output = formatter.format(... | [
"function",
"isYearSeparator",
"(",
")",
"{",
"if",
"(",
"yearSeparator",
"!==",
"null",
")",
"{",
"return",
"yearSeparator",
";",
"}",
"if",
"(",
"!",
"(",
"'Intl'",
"in",
"window",
")",
")",
"{",
"return",
"true",
";",
"}",
"const",
"options",
"=",
... | Private: Determine if the year should be separated from the month and day with a comma. For example, `9 Jun 2014` in en-GB and `Jun 9, 2014` in en-US. Returns true if the date needs a separator. | [
"Private",
":",
"Determine",
"if",
"the",
"year",
"should",
"be",
"separated",
"from",
"the",
"month",
"and",
"day",
"with",
"a",
"comma",
".",
"For",
"example",
"9",
"Jun",
"2014",
"in",
"en",
"-",
"GB",
"and",
"Jun",
"9",
"2014",
"in",
"en",
"-",
... | 91f8cf3c10b75df65b69f9181cee8151d65a788d | https://github.com/benweet/stackedit/blob/91f8cf3c10b75df65b69f9181cee8151d65a788d/src/services/timeSvc.js#L97-L112 | train | Check if the year separator is present in the current date | [
30522,
3853,
2003,
29100,
3366,
28689,
4263,
1006,
1007,
1063,
2065,
1006,
2086,
13699,
25879,
2953,
999,
1027,
1027,
19701,
1007,
1063,
2709,
2086,
13699,
25879,
2953,
1025,
1065,
2065,
1006,
999,
1006,
1005,
20014,
2140,
1005,
1999,
3332,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | function(key, params, defaultValue)
{
var value = mxResources.resources[key];
// Applies the default value if no resource was found
if (value == null)
{
value = defaultValue;
}
// Replaces the placeholders with the values in the array
if (value != null && params != null)
{
value = mxResourc... | javascript | function(key, params, defaultValue)
{
var value = mxResources.resources[key];
// Applies the default value if no resource was found
if (value == null)
{
value = defaultValue;
}
// Replaces the placeholders with the values in the array
if (value != null && params != null)
{
value = mxResourc... | [
"function",
"(",
"key",
",",
"params",
",",
"defaultValue",
")",
"{",
"var",
"value",
"=",
"mxResources",
".",
"resources",
"[",
"key",
"]",
";",
"// Applies the default value if no resource was found",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"value",
"=",... | Function: get
Returns the value for the specified resource key.
Example:
To read the value for 'welomeMessage', use the following:
(code)
var result = mxResources.get('welcomeMessage') || '';
(end)
This would require an entry of the following form in
one of the English language resource files:
(code)
welcomeMessage=... | [
"Function",
":",
"get"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L1605-L1622 | train | Returns the value of the specified resource | [
30522,
3853,
1006,
3145,
1010,
11498,
5244,
1010,
12398,
10175,
5657,
1007,
1063,
13075,
3643,
1027,
25630,
6072,
8162,
9623,
1012,
4219,
1031,
3145,
1033,
1025,
1013,
1013,
12033,
1996,
12398,
3643,
2065,
2053,
7692,
2001,
2179,
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... | |
eslint/eslint | lib/rules/space-infix-ops.js | getFirstNonSpacedToken | function getFirstNonSpacedToken(left, right, op) {
const operator = sourceCode.getFirstTokenBetween(left, right, token => token.value === op);
const prev = sourceCode.getTokenBefore(operator);
const next = sourceCode.getTokenAfter(operator);
if (!sourceCode.isSpaceBetwee... | javascript | function getFirstNonSpacedToken(left, right, op) {
const operator = sourceCode.getFirstTokenBetween(left, right, token => token.value === op);
const prev = sourceCode.getTokenBefore(operator);
const next = sourceCode.getTokenAfter(operator);
if (!sourceCode.isSpaceBetwee... | [
"function",
"getFirstNonSpacedToken",
"(",
"left",
",",
"right",
",",
"op",
")",
"{",
"const",
"operator",
"=",
"sourceCode",
".",
"getFirstTokenBetween",
"(",
"left",
",",
"right",
",",
"token",
"=>",
"token",
".",
"value",
"===",
"op",
")",
";",
"const",... | Returns the first token which violates the rule
@param {ASTNode} left - The left node of the main node
@param {ASTNode} right - The right node of the main node
@param {string} op - The operator of the main node
@returns {Object} The violator token or null
@private | [
"Returns",
"the",
"first",
"token",
"which",
"violates",
"the",
"rule"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/space-infix-ops.js#L50-L60 | train | Get the first non - spaced token between left and right | [
30522,
3853,
2131,
8873,
12096,
8540,
23058,
11927,
11045,
2078,
1006,
2187,
1010,
2157,
1010,
6728,
1007,
1063,
9530,
3367,
6872,
1027,
3120,
16044,
1012,
2131,
8873,
12096,
18715,
2368,
20915,
28394,
2078,
1006,
2187,
1010,
2157,
1010,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | mxRubberband | function mxRubberband(graph)
{
if (graph != null)
{
this.graph = graph;
this.graph.addMouseListener(this);
// Handles force rubberband event
this.forceRubberbandHandler = mxUtils.bind(this, function(sender, evt)
{
var evtName = evt.getProperty('eventName');
var me = evt.getProperty('event');
i... | javascript | function mxRubberband(graph)
{
if (graph != null)
{
this.graph = graph;
this.graph.addMouseListener(this);
// Handles force rubberband event
this.forceRubberbandHandler = mxUtils.bind(this, function(sender, evt)
{
var evtName = evt.getProperty('eventName');
var me = evt.getProperty('event');
i... | [
"function",
"mxRubberband",
"(",
"graph",
")",
"{",
"if",
"(",
"graph",
"!=",
"null",
")",
"{",
"this",
".",
"graph",
"=",
"graph",
";",
"this",
".",
"graph",
".",
"addMouseListener",
"(",
"this",
")",
";",
"// Handles force rubberband event",
"this",
".",... | Copyright (c) 2006-2016, JGraph Ltd
Copyright (c) 2006-2016, Gaudenz Alder
Class: mxRubberband
Event handler that selects rectangular regions. This is not built-into
<mxGraph>. To enable rubberband selection in a graph, use the following code.
Example:
(code)
var rubberband = new mxRubberband(graph);
(end)
Constr... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2016",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2016",
"Gaudenz",
"Alder",
"Class",
":",
"mxRubberband"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L74786-L74842 | train | The rubberband event handler | [
30522,
3853,
25630,
6820,
29325,
12733,
1006,
10629,
1007,
1063,
2065,
1006,
10629,
999,
1027,
19701,
1007,
1063,
2023,
1012,
10629,
1027,
10629,
1025,
2023,
1012,
10629,
1012,
5587,
27711,
29282,
6528,
2121,
1006,
2023,
1007,
1025,
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/components/raycaster.js | function (length) {
var data = this.data;
var el = this.el;
var endVec3;
// Switch each time vector so line update triggered and to avoid unnecessary vector clone.
endVec3 = this.lineData.end === this.lineEndVec3
? this.otherLineEndVec3
: this.lineEndVec3;
// Treat Infinity as 1000... | javascript | function (length) {
var data = this.data;
var el = this.el;
var endVec3;
// Switch each time vector so line update triggered and to avoid unnecessary vector clone.
endVec3 = this.lineData.end === this.lineEndVec3
? this.otherLineEndVec3
: this.lineEndVec3;
// Treat Infinity as 1000... | [
"function",
"(",
"length",
")",
"{",
"var",
"data",
"=",
"this",
".",
"data",
";",
"var",
"el",
"=",
"this",
".",
"el",
";",
"var",
"endVec3",
";",
"// Switch each time vector so line update triggered and to avoid unnecessary vector clone.",
"endVec3",
"=",
"this",
... | Create or update line to give raycaster visual representation.
Customize the line through through line component.
We draw the line in the raycaster component to customize the line to the
raycaster's origin, direction, and far.
Unlike the raycaster, we create the line as a child of the object. The line will
be affected... | [
"Create",
"or",
"update",
"line",
"to",
"give",
"raycaster",
"visual",
"representation",
".",
"Customize",
"the",
"line",
"through",
"through",
"line",
"component",
".",
"We",
"draw",
"the",
"line",
"in",
"the",
"raycaster",
"component",
"to",
"customize",
"th... | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/raycaster.js#L362-L382 | train | Update the line | [
30522,
3853,
1006,
3091,
1007,
1063,
13075,
2951,
1027,
2023,
1012,
2951,
1025,
13075,
3449,
1027,
2023,
1012,
3449,
1025,
13075,
2203,
3726,
2278,
2509,
1025,
1013,
1013,
6942,
2169,
30524,
2023,
1012,
2240,
10497,
3726,
2278,
2509,
1029,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/LiveDevelopment/Agents/EditAgent.js | _findChangedCharacters | function _findChangedCharacters(oldValue, value) {
if (oldValue === value) {
return undefined;
}
var length = oldValue.length;
var index = 0;
// find the first character that changed
var i;
for (i = 0; i < length; i++) {
if (value[i] !== o... | javascript | function _findChangedCharacters(oldValue, value) {
if (oldValue === value) {
return undefined;
}
var length = oldValue.length;
var index = 0;
// find the first character that changed
var i;
for (i = 0; i < length; i++) {
if (value[i] !== o... | [
"function",
"_findChangedCharacters",
"(",
"oldValue",
",",
"value",
")",
"{",
"if",
"(",
"oldValue",
"===",
"value",
")",
"{",
"return",
"undefined",
";",
"}",
"var",
"length",
"=",
"oldValue",
".",
"length",
";",
"var",
"index",
"=",
"0",
";",
"// find... | Find changed characters
@param {string} old value
@param {string} changed value
@return {from, to, text} | [
"Find",
"changed",
"characters"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/EditAgent.js#L45-L73 | train | Find changed characters in the value | [
30522,
3853,
1035,
2424,
22305,
2098,
7507,
22648,
7747,
1006,
2214,
10175,
5657,
1010,
3643,
1007,
1063,
2065,
1006,
2214,
10175,
5657,
1027,
1027,
1027,
3643,
1007,
1063,
2709,
6151,
28344,
1025,
1065,
13075,
3091,
1027,
2214,
10175,
5657... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/SyncPromise.js | reject | function reject(vReason) {
vResult = vReason;
iState = -1;
if (!bCaught && SyncPromise.listener) {
SyncPromise.listener(that, false);
}
if (fnReject) {
fnReject(vReason);
fnReject = fnResolve = null; // be nice to the garbage collector
}
} | javascript | function reject(vReason) {
vResult = vReason;
iState = -1;
if (!bCaught && SyncPromise.listener) {
SyncPromise.listener(that, false);
}
if (fnReject) {
fnReject(vReason);
fnReject = fnResolve = null; // be nice to the garbage collector
}
} | [
"function",
"reject",
"(",
"vReason",
")",
"{",
"vResult",
"=",
"vReason",
";",
"iState",
"=",
"-",
"1",
";",
"if",
"(",
"!",
"bCaught",
"&&",
"SyncPromise",
".",
"listener",
")",
"{",
"SyncPromise",
".",
"listener",
"(",
"that",
",",
"false",
")",
"... | /*
@param {any} [vReason]
The reason for rejection | [
"/",
"*"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/SyncPromise.js#L104-L116 | train | rejects the promise | [
30522,
3853,
15454,
1006,
27830,
5243,
3385,
1007,
1063,
27830,
2229,
11314,
1027,
27830,
5243,
3385,
1025,
21541,
3686,
1027,
1011,
1015,
1025,
2065,
1006,
999,
4647,
4887,
13900,
1004,
1004,
26351,
21572,
28732,
1012,
19373,
1007,
1063,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
radare/radare2 | shlr/www/graph/js-graph-it.js | ConnectorEndsInspector | function ConnectorEndsInspector()
{
this.inspect = function(connector)
{
var children = connector.htmlElement.childNodes;
var i;
for(i = 0; i < children.length; i++)
{
if(hasClass(children[i], "connector-end"))
{
var newElement = new ConnectorEnd(children[i], connector, END);
newElement.repaint(... | javascript | function ConnectorEndsInspector()
{
this.inspect = function(connector)
{
var children = connector.htmlElement.childNodes;
var i;
for(i = 0; i < children.length; i++)
{
if(hasClass(children[i], "connector-end"))
{
var newElement = new ConnectorEnd(children[i], connector, END);
newElement.repaint(... | [
"function",
"ConnectorEndsInspector",
"(",
")",
"{",
"this",
".",
"inspect",
"=",
"function",
"(",
"connector",
")",
"{",
"var",
"children",
"=",
"connector",
".",
"htmlElement",
".",
"childNodes",
";",
"var",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
... | /*
Inspector classes | [
"/",
"*",
"Inspector",
"classes"
] | bf5e3028810a0ec7c267c6fe4bfad639b4819e35 | https://github.com/radare/radare2/blob/bf5e3028810a0ec7c267c6fe4bfad639b4819e35/shlr/www/graph/js-graph-it.js#L1073-L1095 | train | Inspector for the end of a connector | [
30522,
3853,
19400,
10497,
11493,
13102,
22471,
2953,
1006,
1007,
1063,
2023,
1012,
22459,
1027,
3853,
1006,
19400,
1007,
1063,
13075,
2336,
1027,
19400,
1012,
16129,
12260,
3672,
1012,
2775,
3630,
6155,
1025,
13075,
1045,
1025,
2005,
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... |
TryGhost/Ghost | core/server/services/url/utils.js | makeAbsoluteUrls | function makeAbsoluteUrls(html, siteUrl, itemUrl, options = {assetsOnly: false}) {
html = html || '';
const htmlContent = cheerio.load(html, {decodeEntities: false});
const staticImageUrlPrefixRegex = new RegExp(STATIC_IMAGE_URL_PREFIX);
// convert relative resource urls to absolute
['href', 'src']... | javascript | function makeAbsoluteUrls(html, siteUrl, itemUrl, options = {assetsOnly: false}) {
html = html || '';
const htmlContent = cheerio.load(html, {decodeEntities: false});
const staticImageUrlPrefixRegex = new RegExp(STATIC_IMAGE_URL_PREFIX);
// convert relative resource urls to absolute
['href', 'src']... | [
"function",
"makeAbsoluteUrls",
"(",
"html",
",",
"siteUrl",
",",
"itemUrl",
",",
"options",
"=",
"{",
"assetsOnly",
":",
"false",
"}",
")",
"{",
"html",
"=",
"html",
"||",
"''",
";",
"const",
"htmlContent",
"=",
"cheerio",
".",
"load",
"(",
"html",
",... | Make absolute URLs
@param {string} html
@param {string} siteUrl (blog URL)
@param {string} itemUrl (URL of current context)
@returns {object} htmlContent
@description Takes html, blog url and item url and converts relative url into
absolute urls. Returns an object. The html string can be accessed by calling `html()` on... | [
"Make",
"absolute",
"URLs"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/services/url/utils.js#L395-L442 | train | Converts relative URLs to absolute URLs | [
30522,
3853,
2191,
7875,
19454,
10421,
3126,
4877,
1006,
16129,
1010,
2609,
3126,
2140,
1010,
8875,
3126,
2140,
1010,
7047,
1027,
1063,
7045,
2239,
2135,
1024,
6270,
1065,
1007,
1063,
16129,
1027,
16129,
1064,
1064,
1005,
1005,
1025,
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... |
adobe/brackets | src/extensions/default/AutoUpdate/main.js | enableCheckForUpdateEntry | function enableCheckForUpdateEntry(enable) {
var cfuCommand = CommandManager.get(Commands.HELP_CHECK_FOR_UPDATE);
cfuCommand.setEnabled(enable);
UpdateNotification.enableUpdateNotificationIcon(enable);
} | javascript | function enableCheckForUpdateEntry(enable) {
var cfuCommand = CommandManager.get(Commands.HELP_CHECK_FOR_UPDATE);
cfuCommand.setEnabled(enable);
UpdateNotification.enableUpdateNotificationIcon(enable);
} | [
"function",
"enableCheckForUpdateEntry",
"(",
"enable",
")",
"{",
"var",
"cfuCommand",
"=",
"CommandManager",
".",
"get",
"(",
"Commands",
".",
"HELP_CHECK_FOR_UPDATE",
")",
";",
"cfuCommand",
".",
"setEnabled",
"(",
"enable",
")",
";",
"UpdateNotification",
".",
... | Enables/disables the state of "Check For Updates" menu entry under Help Menu | [
"Enables",
"/",
"disables",
"the",
"state",
"of",
"Check",
"For",
"Updates",
"menu",
"entry",
"under",
"Help",
"Menu"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L592-L596 | train | Enable the check for update entry | [
30522,
3853,
9585,
5403,
3600,
29278,
6279,
13701,
4765,
2854,
1006,
9585,
1007,
1063,
13075,
12935,
14194,
5358,
2386,
2094,
1027,
3094,
24805,
4590,
1012,
2131,
1006,
10954,
1012,
2393,
1035,
4638,
1035,
2005,
1035,
10651,
1007,
1025,
129... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.m/src/sap/m/GrowingEnablement.js | function(sChangeReason) {
var mChangeReason = ChangeReason;
return sChangeReason == mChangeReason.Sort ||
sChangeReason == mChangeReason.Filter ||
sChangeReason == mChangeReason.Context;
} | javascript | function(sChangeReason) {
var mChangeReason = ChangeReason;
return sChangeReason == mChangeReason.Sort ||
sChangeReason == mChangeReason.Filter ||
sChangeReason == mChangeReason.Context;
} | [
"function",
"(",
"sChangeReason",
")",
"{",
"var",
"mChangeReason",
"=",
"ChangeReason",
";",
"return",
"sChangeReason",
"==",
"mChangeReason",
".",
"Sort",
"||",
"sChangeReason",
"==",
"mChangeReason",
".",
"Filter",
"||",
"sChangeReason",
"==",
"mChangeReason",
... | determines growing reset with binding change reason according to UX sort/filter/context should reset the growing | [
"determines",
"growing",
"reset",
"with",
"binding",
"change",
"reason",
"according",
"to",
"UX",
"sort",
"/",
"filter",
"/",
"context",
"should",
"reset",
"the",
"growing"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/GrowingEnablement.js#L138-L144 | train | Returns true if the given change reason is a valid change reason. | [
30522,
3853,
1006,
8040,
18003,
7869,
3022,
2239,
1007,
1063,
13075,
11338,
18003,
7869,
3022,
2239,
1027,
2689,
16416,
3385,
1025,
2709,
8040,
18003,
7869,
3022,
2239,
1027,
1027,
11338,
18003,
7869,
3022,
2239,
1012,
4066,
1064,
1064,
804... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js | function () {
var oModel = this._oDialog.getModel("view"),
oTreeData = oModel.getProperty("/DebugModules")[0],
sDisplayCount;
oModel.setProperty("/CustomDebugMode", this._treeHelper.toDebugInfo(oTreeData));
oModel.setProperty("/DebugModuleSelectionCount", this._treeHelper.getSelectionCount(oTreeData));... | javascript | function () {
var oModel = this._oDialog.getModel("view"),
oTreeData = oModel.getProperty("/DebugModules")[0],
sDisplayCount;
oModel.setProperty("/CustomDebugMode", this._treeHelper.toDebugInfo(oTreeData));
oModel.setProperty("/DebugModuleSelectionCount", this._treeHelper.getSelectionCount(oTreeData));... | [
"function",
"(",
")",
"{",
"var",
"oModel",
"=",
"this",
".",
"_oDialog",
".",
"getModel",
"(",
"\"view\"",
")",
",",
"oTreeData",
"=",
"oModel",
".",
"getProperty",
"(",
"\"/DebugModules\"",
")",
"[",
"0",
"]",
",",
"sDisplayCount",
";",
"oModel",
".",
... | Updates the debug mode input field and the number of selected debug modules
@private | [
"Updates",
"the",
"debug",
"mode",
"input",
"field",
"and",
"the",
"number",
"of",
"selected",
"debug",
"modules"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L921-L929 | train | Sets the debug mode to debug mode | [
30522,
3853,
1006,
1007,
1063,
13075,
18168,
10244,
2140,
1027,
2023,
1012,
1035,
21045,
23067,
2290,
1012,
2131,
5302,
9247,
1006,
1000,
3193,
1000,
1007,
1010,
27178,
30524,
1007,
1031,
1014,
1033,
1010,
17371,
2483,
13068,
3597,
16671,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function() {
if (this._aMeasureNames) {
return this._aMeasureNames;
}
this._aMeasureNames = [];
for ( var sName in this._oMeasureSet) {
this._aMeasureNames.push(this._oMeasureSet[sName].getName());
}
return this._aMeasureNames;
} | javascript | function() {
if (this._aMeasureNames) {
return this._aMeasureNames;
}
this._aMeasureNames = [];
for ( var sName in this._oMeasureSet) {
this._aMeasureNames.push(this._oMeasureSet[sName].getName());
}
return this._aMeasureNames;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_aMeasureNames",
")",
"{",
"return",
"this",
".",
"_aMeasureNames",
";",
"}",
"this",
".",
"_aMeasureNames",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"sName",
"in",
"this",
".",
"_oMeasureSet",
")",
"... | Get the names of all measures included in the query result
@returns {string[]} List of all measure names
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResult#getAllMeasureNames | [
"Get",
"the",
"names",
"of",
"all",
"measures",
"included",
"in",
"the",
"query",
"result"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1047-L1059 | train | Returns an array of all measure names | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
2572,
5243,
28632,
18442,
2015,
1007,
1063,
2709,
2023,
1012,
1035,
2572,
5243,
28632,
18442,
2015,
1025,
1065,
2023,
1012,
1035,
2572,
5243,
28632,
18442,
2015,
1027,
1031,
1033,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | lib/jsdoc/ui5/template/publish.js | asPlainSummary | function asPlainSummary(sText) {
return sText ? summarize(sText).replace(/<.*?>/g, '').replace(/\{\@link\s*(.*?)\}/g, '$1').replace(/"/g,""") : '';
} | javascript | function asPlainSummary(sText) {
return sText ? summarize(sText).replace(/<.*?>/g, '').replace(/\{\@link\s*(.*?)\}/g, '$1').replace(/"/g,""") : '';
} | [
"function",
"asPlainSummary",
"(",
"sText",
")",
"{",
"return",
"sText",
"?",
"summarize",
"(",
"sText",
")",
".",
"replace",
"(",
"/",
"<.*?>",
"/",
"g",
",",
"''",
")",
".",
"replace",
"(",
"/",
"\\{\\@link\\s*(.*?)\\}",
"/",
"g",
",",
"'$1'",
")",
... | Reduces the given text to a summary and removes all tags links etc. and escapes double quotes.
The result therefore should be suitable as content for an HTML tag attribute (e.g. title).
@param {string} sText Text to extract a summary from
@returns {string} summarized, plain attribute | [
"Reduces",
"the",
"given",
"text",
"to",
"a",
"summary",
"and",
"removes",
"all",
"tags",
"links",
"etc",
".",
"and",
"escapes",
"double",
"quotes",
".",
"The",
"result",
"therefore",
"should",
"be",
"suitable",
"as",
"content",
"for",
"an",
"HTML",
"tag",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/ui5/template/publish.js#L2106-L2108 | train | Converts a string of text to plain summary | [
30522,
3853,
2004,
24759,
28247,
2819,
7849,
2100,
1006,
26261,
18413,
1007,
1063,
2709,
26261,
18413,
1029,
7680,
7849,
4697,
1006,
26261,
18413,
1007,
1012,
5672,
1006,
1013,
1026,
1012,
1008,
1029,
1028,
1013,
1043,
1010,
1005,
1005,
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... |
GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/show.js | locateNode | function locateNode (vnode: VNode): VNodeWithData {
return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
? locateNode(vnode.componentInstance._vnode)
: vnode
} | javascript | function locateNode (vnode: VNode): VNodeWithData {
return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
? locateNode(vnode.componentInstance._vnode)
: vnode
} | [
"function",
"locateNode",
"(",
"vnode",
":",
"VNode",
")",
":",
"VNodeWithData",
"{",
"return",
"vnode",
".",
"componentInstance",
"&&",
"(",
"!",
"vnode",
".",
"data",
"||",
"!",
"vnode",
".",
"data",
".",
"transition",
")",
"?",
"locateNode",
"(",
"vno... | recursively search for possible transition defined inside the component root | [
"recursively",
"search",
"for",
"possible",
"transition",
"defined",
"inside",
"the",
"component",
"root"
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/src/platforms/web/runtime/directives/show.js#L7-L11 | train | Locates a node in the hierarchy. | [
30522,
3853,
12453,
3630,
3207,
1006,
1058,
3630,
3207,
1024,
1058,
3630,
3207,
1007,
1024,
1058,
3630,
3207,
24415,
2850,
2696,
1063,
2709,
1058,
3630,
3207,
1012,
6922,
7076,
26897,
1004,
1004,
1006,
999,
1058,
3630,
3207,
1012,
2951,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function (mQueryOptions, sOrderby, sFilter) {
var mResult;
function set(sProperty, sValue) {
if (sValue && (!mQueryOptions || mQueryOptions[sProperty] !== sValue)) {
if (!mResult) {
mResult = mQueryOptions ? _Helper.clone(mQueryOptions) : {};
}
mResult[sProperty] = sValue;
}
}
... | javascript | function (mQueryOptions, sOrderby, sFilter) {
var mResult;
function set(sProperty, sValue) {
if (sValue && (!mQueryOptions || mQueryOptions[sProperty] !== sValue)) {
if (!mResult) {
mResult = mQueryOptions ? _Helper.clone(mQueryOptions) : {};
}
mResult[sProperty] = sValue;
}
}
... | [
"function",
"(",
"mQueryOptions",
",",
"sOrderby",
",",
"sFilter",
")",
"{",
"var",
"mResult",
";",
"function",
"set",
"(",
"sProperty",
",",
"sValue",
")",
"{",
"if",
"(",
"sValue",
"&&",
"(",
"!",
"mQueryOptions",
"||",
"mQueryOptions",
"[",
"sProperty",... | Merges the given values for "$orderby" and "$filter" into the given map of query options.
Ensures that the original map is left unchanged, but creates a copy only if necessary.
@param {object} [mQueryOptions]
The map of query options
@param {string} [sOrderby]
The new value for the query option "$orderby"
@param {stri... | [
"Merges",
"the",
"given",
"values",
"for",
"$orderby",
"and",
"$filter",
"into",
"the",
"given",
"map",
"of",
"query",
"options",
".",
"Ensures",
"that",
"the",
"original",
"map",
"is",
"left",
"unchanged",
"but",
"creates",
"a",
"copy",
"only",
"if",
"nec... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L861-L876 | train | Sets the given query options to the given values. | [
30522,
3853,
1006,
1049,
4226,
2854,
7361,
9285,
1010,
2061,
26764,
3762,
1010,
16420,
4014,
3334,
1007,
1063,
13075,
2720,
2229,
11314,
1025,
3853,
2275,
1006,
11867,
18981,
15010,
1010,
17917,
2389,
5657,
1007,
1063,
2065,
1006,
17917,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(oSelectedPropertyNames) {
if (this._aSortCondition.length == 0) {
return "";
}
var sOrderByOptionString = "";
for (var i = -1, oCondition; (oCondition = this._aSortCondition[++i]) !== undefined;) {
if (!oSelectedPropertyNames[oCondition.property.name]) {
continue; // sorting of aggreg... | javascript | function(oSelectedPropertyNames) {
if (this._aSortCondition.length == 0) {
return "";
}
var sOrderByOptionString = "";
for (var i = -1, oCondition; (oCondition = this._aSortCondition[++i]) !== undefined;) {
if (!oSelectedPropertyNames[oCondition.property.name]) {
continue; // sorting of aggreg... | [
"function",
"(",
"oSelectedPropertyNames",
")",
"{",
"if",
"(",
"this",
".",
"_aSortCondition",
".",
"length",
"==",
"0",
")",
"{",
"return",
"\"\"",
";",
"}",
"var",
"sOrderByOptionString",
"=",
"\"\"",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",... | Get the value for the OData system query option $orderby corresponding to
this expression.
@param {object} oSelectedPropertyNames Object with properties requested for $select
@returns {string} The $orderby value for the sort expressions
@public
@function
@name sap.ui.model.analytics.odata4analytics.SortExpression#get... | [
"Get",
"the",
"value",
"for",
"the",
"OData",
"system",
"query",
"option",
"$orderby",
"corresponding",
"to",
"this",
"expression",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3781-L3795 | train | Returns the order by option for the given property list | [
30522,
3853,
1006,
9808,
12260,
10985,
21572,
4842,
25680,
14074,
2015,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
2004,
11589,
8663,
20562,
1012,
3091,
1027,
1027,
1014,
1007,
1063,
2709,
1000,
1000,
1025,
1065,
13075,
2061,
26764,
3762,
73... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
goldfire/howler.js | examples/player/player.js | function(index) {
var self = this;
// Stop the current track.
if (self.playlist[self.index].howl) {
self.playlist[self.index].howl.stop();
}
// Reset progress.
progress.style.width = '0%';
// Play the new track.
self.play(index);
} | javascript | function(index) {
var self = this;
// Stop the current track.
if (self.playlist[self.index].howl) {
self.playlist[self.index].howl.stop();
}
// Reset progress.
progress.style.width = '0%';
// Play the new track.
self.play(index);
} | [
"function",
"(",
"index",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Stop the current track.",
"if",
"(",
"self",
".",
"playlist",
"[",
"self",
".",
"index",
"]",
".",
"howl",
")",
"{",
"self",
".",
"playlist",
"[",
"self",
".",
"index",
"]",
"."... | Skip to a specific track based on its playlist index.
@param {Number} index Index in the playlist. | [
"Skip",
"to",
"a",
"specific",
"track",
"based",
"on",
"its",
"playlist",
"index",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/player/player.js#L166-L179 | train | Play the new track at the given index | [
30522,
3853,
1006,
5950,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
1013,
1013,
2644,
1996,
2783,
2650,
1012,
2065,
1006,
2969,
1012,
2377,
9863,
1031,
2969,
1012,
5950,
1033,
1012,
22912,
1007,
1063,
2969,
1012,
2377,
9863,
1031,
2969,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
badges/shields | services/suggest.js | setRoutes | function setRoutes(allowedOrigin, githubApiProvider, server) {
server.ajax.on('suggest/v1', (data, end, ask) => {
// The typical dev and production setups are cross-origin. However, in
// Heroku deploys and some self-hosted deploys these requests may come from
// the same host. Chrome does not send an Ori... | javascript | function setRoutes(allowedOrigin, githubApiProvider, server) {
server.ajax.on('suggest/v1', (data, end, ask) => {
// The typical dev and production setups are cross-origin. However, in
// Heroku deploys and some self-hosted deploys these requests may come from
// the same host. Chrome does not send an Ori... | [
"function",
"setRoutes",
"(",
"allowedOrigin",
",",
"githubApiProvider",
",",
"server",
")",
"{",
"server",
".",
"ajax",
".",
"on",
"(",
"'suggest/v1'",
",",
"(",
"data",
",",
"end",
",",
"ask",
")",
"=>",
"{",
"// The typical dev and production setups are cross... | data: {url}, JSON-serializable object. end: function(json), with json of the form: - suggestions: list of objects of the form: - title: string - link: target as a string URL - example: object - pattern: string - namedParams: object - queryParams: object (optional) - link: target as a string URL - preview: object (optio... | [
"data",
":",
"{",
"url",
"}",
"JSON",
"-",
"serializable",
"object",
".",
"end",
":",
"function",
"(",
"json",
")",
"with",
"json",
"of",
"the",
"form",
":",
"-",
"suggestions",
":",
"list",
"of",
"objects",
"of",
"the",
"form",
":",
"-",
"title",
... | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/services/suggest.js#L134-L183 | train | Sets the HTTP routes for the given server. | [
30522,
3853,
2275,
22494,
4570,
1006,
3039,
10050,
11528,
1010,
21025,
2705,
19761,
8197,
21572,
17258,
2121,
1010,
8241,
1007,
1063,
8241,
1012,
18176,
1012,
2006,
1006,
1005,
6592,
1013,
1058,
2487,
1005,
1010,
1006,
2951,
1010,
2203,
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... |
lynckia/licode | extras/basic_example/public/script.js | startRecording | function startRecording() {
if (room !== undefined) {
if (!recording) {
room.startRecording(localStream, (id) => {
recording = true;
recordingId = id;
});
} else {
room.stopRecording(recordingId);
recording = false;
}
}
} | javascript | function startRecording() {
if (room !== undefined) {
if (!recording) {
room.startRecording(localStream, (id) => {
recording = true;
recordingId = id;
});
} else {
room.stopRecording(recordingId);
recording = false;
}
}
} | [
"function",
"startRecording",
"(",
")",
"{",
"if",
"(",
"room",
"!==",
"undefined",
")",
"{",
"if",
"(",
"!",
"recording",
")",
"{",
"room",
".",
"startRecording",
"(",
"localStream",
",",
"(",
"id",
")",
"=>",
"{",
"recording",
"=",
"true",
";",
"re... | eslint-disable-next-line no-unused-vars | [
"eslint",
"-",
"disable",
"-",
"next",
"-",
"line",
"no",
"-",
"unused",
"-",
"vars"
] | ce1f09ae30054f677fc25f2011b0e5072fa6f71f | https://github.com/lynckia/licode/blob/ce1f09ae30054f677fc25f2011b0e5072fa6f71f/extras/basic_example/public/script.js#L28-L40 | train | Start recording the local stream | [
30522,
3853,
2707,
2890,
27108,
4667,
1006,
1007,
1063,
2065,
1006,
2282,
999,
1027,
1027,
6151,
28344,
1007,
1063,
2065,
1006,
999,
3405,
1007,
1063,
2282,
1012,
2707,
2890,
27108,
4667,
1006,
10575,
25379,
1010,
1006,
8909,
1007,
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/util/node-event-generator.js | countIdentifiers | function countIdentifiers(parsedSelector) {
switch (parsedSelector.type) {
case "child":
case "descendant":
case "sibling":
case "adjacent":
return countIdentifiers(parsedSelector.left) + countIdentifiers(parsedSelector.right);
case "compound":
case "not"... | javascript | function countIdentifiers(parsedSelector) {
switch (parsedSelector.type) {
case "child":
case "descendant":
case "sibling":
case "adjacent":
return countIdentifiers(parsedSelector.left) + countIdentifiers(parsedSelector.right);
case "compound":
case "not"... | [
"function",
"countIdentifiers",
"(",
"parsedSelector",
")",
"{",
"switch",
"(",
"parsedSelector",
".",
"type",
")",
"{",
"case",
"\"child\"",
":",
"case",
"\"descendant\"",
":",
"case",
"\"sibling\"",
":",
"case",
"\"adjacent\"",
":",
"return",
"countIdentifiers",... | Counts the number of identifier queries in this selector
@param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior
@returns {number} The number of identifier queries | [
"Counts",
"the",
"number",
"of",
"identifier",
"queries",
"in",
"this",
"selector"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/node-event-generator.js#L115-L134 | train | Count identifiers in a selector | [
30522,
3853,
4175,
5178,
16778,
8873,
2545,
1006,
11968,
6924,
11246,
22471,
2953,
1007,
1063,
6942,
1006,
11968,
6924,
11246,
22471,
2953,
1012,
2828,
1007,
1063,
2553,
1000,
2775,
1000,
1024,
2553,
1000,
12608,
1000,
1024,
2553,
1000,
229... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensibility/node/package-validator.js | validate | function validate(path, options, callback) {
options = options || {};
fs.exists(path, function (doesExist) {
if (!doesExist) {
callback(null, {
errors: [[Errors.NOT_FOUND_ERR, path]]
});
return;
}
temp.mkdir("bracketsPackage_", function... | javascript | function validate(path, options, callback) {
options = options || {};
fs.exists(path, function (doesExist) {
if (!doesExist) {
callback(null, {
errors: [[Errors.NOT_FOUND_ERR, path]]
});
return;
}
temp.mkdir("bracketsPackage_", function... | [
"function",
"validate",
"(",
"path",
",",
"options",
",",
"callback",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"fs",
".",
"exists",
"(",
"path",
",",
"function",
"(",
"doesExist",
")",
"{",
"if",
"(",
"!",
"doesExist",
")",
"{",
"c... | Implements the "validate" command in the "extensions" domain.
Validates the zipped package at path.
The "err" parameter of the callback is only set if there was an
unexpected error. Otherwise, errors are reported in the result.
The result object has an "errors" property. It is an array of
arrays of strings. Each arra... | [
"Implements",
"the",
"validate",
"command",
"in",
"the",
"extensions",
"domain",
".",
"Validates",
"the",
"zipped",
"package",
"at",
"path",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/package-validator.js#L348-L365 | train | Validate the given path | [
30522,
3853,
9398,
3686,
1006,
4130,
1010,
7047,
1010,
2655,
5963,
1007,
1063,
7047,
1027,
7047,
1064,
1064,
1063,
1065,
1025,
1042,
2015,
1012,
6526,
1006,
4130,
1010,
3853,
1006,
2515,
10288,
30524,
1025,
2709,
1025,
1065,
8915,
8737,
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... |
apache/incubator-echarts | src/model/Global.js | function (subType) {
var series = this._componentsMap.get('series');
return filter(series, function (oneSeries) {
return oneSeries.subType === subType;
});
} | javascript | function (subType) {
var series = this._componentsMap.get('series');
return filter(series, function (oneSeries) {
return oneSeries.subType === subType;
});
} | [
"function",
"(",
"subType",
")",
"{",
"var",
"series",
"=",
"this",
".",
"_componentsMap",
".",
"get",
"(",
"'series'",
")",
";",
"return",
"filter",
"(",
"series",
",",
"function",
"(",
"oneSeries",
")",
"{",
"return",
"oneSeries",
".",
"subType",
"==="... | Get series list before filtered by type.
FIXME: rename to getRawSeriesByType?
@param {string} subType
@return {Array.<module:echarts/model/Series>} | [
"Get",
"series",
"list",
"before",
"filtered",
"by",
"type",
".",
"FIXME",
":",
"rename",
"to",
"getRawSeriesByType?"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/model/Global.js#L499-L504 | train | Returns a list of all the calendar series of the specified type | [
30522,
3853,
1006,
4942,
13874,
1007,
1063,
13075,
2186,
1027,
2023,
1012,
1035,
6177,
2863,
2361,
1012,
2131,
1006,
1005,
2186,
1005,
1007,
1025,
2709,
11307,
1006,
2186,
1010,
3853,
1006,
3924,
28077,
1007,
1063,
2709,
3924,
28077,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
keplergl/kepler.gl | src/reducers/vis-state-updaters.js | computeSplitMapLayers | function computeSplitMapLayers(layers) {
const mapLayers = layers.reduce(
(newLayers, currentLayer) => ({
...newLayers,
[currentLayer.id]: generateLayerMetaForSplitViews(currentLayer)
}),
{}
);
return [
{
layers: mapLayers
},
{
layers: mapLayers
}
];
} | javascript | function computeSplitMapLayers(layers) {
const mapLayers = layers.reduce(
(newLayers, currentLayer) => ({
...newLayers,
[currentLayer.id]: generateLayerMetaForSplitViews(currentLayer)
}),
{}
);
return [
{
layers: mapLayers
},
{
layers: mapLayers
}
];
} | [
"function",
"computeSplitMapLayers",
"(",
"layers",
")",
"{",
"const",
"mapLayers",
"=",
"layers",
".",
"reduce",
"(",
"(",
"newLayers",
",",
"currentLayer",
")",
"=>",
"(",
"{",
"...",
"newLayers",
",",
"[",
"currentLayer",
".",
"id",
"]",
":",
"generateL... | This method will compute the default maps custom list
based on the current layers status
@param {Array<Object>} layers
@returns {Array<Object>} split map settings | [
"This",
"method",
"will",
"compute",
"the",
"default",
"maps",
"custom",
"list",
"based",
"on",
"the",
"current",
"layers",
"status"
] | 779238435707cc54335c2d00001e4b9334b314aa | https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/src/reducers/vis-state-updaters.js#L1094-L1110 | train | Compute split map layers | [
30522,
3853,
24134,
13102,
15909,
2863,
13068,
2545,
1006,
9014,
1007,
1063,
9530,
3367,
4949,
24314,
2015,
1027,
9014,
1012,
5547,
1006,
1006,
2047,
24314,
2015,
1010,
2783,
24314,
1007,
1027,
1028,
1006,
1063,
1012,
1012,
1012,
2047,
2431... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GeekyAnts/vue-native-core | packages/vue-server-renderer/build.js | remove | function remove (arr, item) {
if (arr.length) {
var index = arr.indexOf(item);
if (index > -1) {
return arr.splice(index, 1)
}
}
} | javascript | function remove (arr, item) {
if (arr.length) {
var index = arr.indexOf(item);
if (index > -1) {
return arr.splice(index, 1)
}
}
} | [
"function",
"remove",
"(",
"arr",
",",
"item",
")",
"{",
"if",
"(",
"arr",
".",
"length",
")",
"{",
"var",
"index",
"=",
"arr",
".",
"indexOf",
"(",
"item",
")",
";",
"if",
"(",
"index",
">",
"-",
"1",
")",
"{",
"return",
"arr",
".",
"splice",
... | Remove an item from an array | [
"Remove",
"an",
"item",
"from",
"an",
"array"
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-server-renderer/build.js#L84-L91 | train | Remove an item from an array | [
30522,
3853,
6366,
1006,
12098,
2099,
1010,
8875,
1007,
1063,
2065,
1006,
12098,
2099,
1012,
3091,
1007,
1063,
13075,
5950,
1027,
12098,
2099,
1012,
5950,
11253,
1006,
8875,
1007,
1025,
2065,
1006,
5950,
1028,
1011,
1015,
1007,
1063,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/implicit-arrow-linebreak.js | validateExpression | function validateExpression(node) {
if (node.body.type === "BlockStatement") {
return;
}
const arrowToken = sourceCode.getTokenBefore(node.body, isNotOpeningParenToken);
const firstTokenOfBody = sourceCode.getTokenAfter(arrowToken);
if (arrow... | javascript | function validateExpression(node) {
if (node.body.type === "BlockStatement") {
return;
}
const arrowToken = sourceCode.getTokenBefore(node.body, isNotOpeningParenToken);
const firstTokenOfBody = sourceCode.getTokenAfter(arrowToken);
if (arrow... | [
"function",
"validateExpression",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"body",
".",
"type",
"===",
"\"BlockStatement\"",
")",
"{",
"return",
";",
"}",
"const",
"arrowToken",
"=",
"sourceCode",
".",
"getTokenBefore",
"(",
"node",
".",
"body",
",",... | Validates the location of an arrow function body
@param {ASTNode} node The arrow function body
@returns {void} | [
"Validates",
"the",
"location",
"of",
"an",
"arrow",
"function",
"body"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/implicit-arrow-linebreak.js#L45-L72 | train | Validate an Expression node | [
30522,
3853,
9398,
3686,
10288,
20110,
3258,
1006,
13045,
1007,
1063,
2065,
1006,
13045,
1012,
2303,
1012,
2828,
1027,
1027,
1027,
1000,
5991,
12259,
3672,
1000,
1007,
1063,
2709,
1025,
1065,
9530,
3367,
8612,
18715,
2368,
1027,
3120,
16044... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/coord/polar/Polar.js | function (coord) {
var radius = coord[0];
var radian = coord[1] / 180 * Math.PI;
var x = Math.cos(radian) * radius + this.cx;
// Inverse the y
var y = -Math.sin(radian) * radius + this.cy;
return [x, y];
} | javascript | function (coord) {
var radius = coord[0];
var radian = coord[1] / 180 * Math.PI;
var x = Math.cos(radian) * radius + this.cx;
// Inverse the y
var y = -Math.sin(radian) * radius + this.cy;
return [x, y];
} | [
"function",
"(",
"coord",
")",
"{",
"var",
"radius",
"=",
"coord",
"[",
"0",
"]",
";",
"var",
"radian",
"=",
"coord",
"[",
"1",
"]",
"/",
"180",
"*",
"Math",
".",
"PI",
";",
"var",
"x",
"=",
"Math",
".",
"cos",
"(",
"radian",
")",
"*",
"radiu... | Convert a (radius, angle) coord to (x, y) point
@param {Array.<number>} coord
@return {Array.<number>} | [
"Convert",
"a",
"(",
"radius",
"angle",
")",
"coord",
"to",
"(",
"x",
"y",
")",
"point"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/polar/Polar.js#L249-L257 | train | Get the x y coordinates of the image | [
30522,
3853,
1006,
2522,
8551,
1007,
1063,
13075,
12177,
1027,
2522,
8551,
1031,
1014,
1033,
1025,
13075,
10958,
11692,
1027,
2522,
8551,
1031,
1015,
1033,
1013,
8380,
1008,
8785,
1012,
14255,
1025,
13075,
1060,
1027,
8785,
1012,
2522,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | setHandle | function setHandle ( handleNumber, to, lookBackward, lookForward ) {
to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward);
if ( to === false ) {
return false;
}
updateHandlePosition(handleNumber, to);
retur... | javascript | function setHandle ( handleNumber, to, lookBackward, lookForward ) {
to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward);
if ( to === false ) {
return false;
}
updateHandlePosition(handleNumber, to);
retur... | [
"function",
"setHandle",
"(",
"handleNumber",
",",
"to",
",",
"lookBackward",
",",
"lookForward",
")",
"{",
"to",
"=",
"checkHandlePosition",
"(",
"scope_Locations",
",",
"handleNumber",
",",
"to",
",",
"lookBackward",
",",
"lookForward",
")",
";",
"if",
"(",
... | Test suggested values and apply margin, step. | [
"Test",
"suggested",
"values",
"and",
"apply",
"margin",
"step",
"."
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L1818-L1829 | train | setHandle - Set handle | [
30522,
3853,
6662,
5685,
2571,
1006,
5047,
19172,
5677,
1010,
2000,
1010,
2298,
5963,
7652,
1010,
2298,
29278,
7652,
1007,
1063,
2000,
1027,
4638,
11774,
2571,
26994,
1006,
9531,
1035,
5269,
1010,
5047,
19172,
5677,
1010,
2000,
1010,
2298,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/coord/polar/AngleAxis.js | function () {
var axis = this;
var labelModel = axis.getLabelModel();
var ordinalScale = axis.scale;
var ordinalExtent = ordinalScale.getExtent();
// Providing this method is for optimization:
// avoid generating a long array by `getTicks`
// in large category da... | javascript | function () {
var axis = this;
var labelModel = axis.getLabelModel();
var ordinalScale = axis.scale;
var ordinalExtent = ordinalScale.getExtent();
// Providing this method is for optimization:
// avoid generating a long array by `getTicks`
// in large category da... | [
"function",
"(",
")",
"{",
"var",
"axis",
"=",
"this",
";",
"var",
"labelModel",
"=",
"axis",
".",
"getLabelModel",
"(",
")",
";",
"var",
"ordinalScale",
"=",
"axis",
".",
"scale",
";",
"var",
"ordinalExtent",
"=",
"ordinalScale",
".",
"getExtent",
"(",
... | Only be called in category axis.
Angle axis uses text height to decide interval
@override
@return {number} Auto interval for cateogry axis tick and label | [
"Only",
"be",
"called",
"in",
"category",
"axis",
".",
"Angle",
"axis",
"uses",
"text",
"height",
"to",
"decide",
"interval"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/polar/AngleAxis.js#L66-L122 | train | Returns the interval of the tick. | [
30522,
3853,
1006,
1007,
1063,
13075,
8123,
1027,
2023,
1025,
13075,
3830,
5302,
9247,
1027,
8123,
1012,
2131,
20470,
2884,
5302,
9247,
1006,
1007,
1025,
13075,
2030,
18979,
4877,
9289,
2063,
1027,
8123,
1012,
4094,
1025,
13075,
2030,
18979... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(oXhr) {
var aTemp = oXhr.getAllResponseHeaders().split("\r\n");
var aHeadersObjects = [];
for (var i = 0; i < aTemp.length; i++) {
if (aTemp[i]) {
var aHeaderValues = aTemp[i].split(":");
aHeadersObjects.push({
name: aHeaderValues[0].trim(),
value: aHeaderValues[1].trim()
... | javascript | function(oXhr) {
var aTemp = oXhr.getAllResponseHeaders().split("\r\n");
var aHeadersObjects = [];
for (var i = 0; i < aTemp.length; i++) {
if (aTemp[i]) {
var aHeaderValues = aTemp[i].split(":");
aHeadersObjects.push({
name: aHeaderValues[0].trim(),
value: aHeaderValues[1].trim()
... | [
"function",
"(",
"oXhr",
")",
"{",
"var",
"aTemp",
"=",
"oXhr",
".",
"getAllResponseHeaders",
"(",
")",
".",
"split",
"(",
"\"\\r\\n\"",
")",
";",
"var",
"aHeadersObjects",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"aTemp... | Transforms the headers from an XMLHttpRequest to the expected har file format.
The origin format is a string which will be transformed to an object with name and value properties.
E.g. { name: "headername", value: "headervalue" }
@param {Object} oXhr The XMLHttpRequest with response headers (needs to be sent).
@return... | [
"Transforms",
"the",
"headers",
"from",
"an",
"XMLHttpRequest",
"to",
"the",
"expected",
"har",
"file",
"format",
".",
"The",
"origin",
"format",
"is",
"a",
"string",
"which",
"will",
"be",
"transformed",
"to",
"an",
"object",
"with",
"name",
"and",
"value",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L260-L273 | train | Get all response headers | [
30522,
3853,
1006,
23060,
8093,
1007,
1063,
13075,
8823,
8737,
1027,
23060,
8093,
1012,
2131,
8095,
6072,
26029,
3366,
4974,
2545,
1006,
1007,
1012,
3975,
1006,
1000,
1032,
1054,
1032,
1050,
1000,
1007,
1025,
13075,
3805,
2545,
16429,
20614... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/angular | tools/gulp-tasks/cldr/extract.js | getNumberSettings | function getNumberSettings(localeData) {
const decimalFormat = localeData.main('numbers/decimalFormats-numberSystem-latn/standard');
const percentFormat = localeData.main('numbers/percentFormats-numberSystem-latn/standard');
const scientificFormat = localeData.main('numbers/scientificFormats-numberSystem-latn/sta... | javascript | function getNumberSettings(localeData) {
const decimalFormat = localeData.main('numbers/decimalFormats-numberSystem-latn/standard');
const percentFormat = localeData.main('numbers/percentFormats-numberSystem-latn/standard');
const scientificFormat = localeData.main('numbers/scientificFormats-numberSystem-latn/sta... | [
"function",
"getNumberSettings",
"(",
"localeData",
")",
"{",
"const",
"decimalFormat",
"=",
"localeData",
".",
"main",
"(",
"'numbers/decimalFormats-numberSystem-latn/standard'",
")",
";",
"const",
"percentFormat",
"=",
"localeData",
".",
"main",
"(",
"'numbers/percent... | Returns the number symbols and formats for a locale
@returns [ symbols, formats ]
symbols: [ decimal, group, list, percentSign, plusSign, minusSign, exponential, superscriptingExponent, perMille, infinity, nan, timeSeparator, currencyDecimal?, currencyGroup? ]
formats: [ currency, decimal, percent, scientific ] | [
"Returns",
"the",
"number",
"symbols",
"and",
"formats",
"for",
"a",
"locale"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/gulp-tasks/cldr/extract.js#L426-L459 | train | Get number settings | [
30522,
3853,
2131,
19172,
17198,
18319,
3070,
2015,
1006,
2334,
11960,
2696,
1007,
1063,
9530,
3367,
26066,
14192,
4017,
1027,
2334,
11960,
2696,
1012,
2364,
1006,
1005,
3616,
1013,
26066,
14192,
11149,
1011,
3616,
27268,
6633,
1011,
2474,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ccxt/ccxt | examples/js/cli.js | main | async function main () {
const requirements = exchangeId && methodName
if (!requirements) {
printUsage ()
} else {
let args = params
.map (s => s.match (/^[0-9]{4}[-]?[0-9]{2}[-]?[0-9]{2}[T\s]?[0-9]{2}[:]?[0-9]{2}[:]?[0-9]{2}/g) ? exchange.parse8601 (s) : s)
.map ... | javascript | async function main () {
const requirements = exchangeId && methodName
if (!requirements) {
printUsage ()
} else {
let args = params
.map (s => s.match (/^[0-9]{4}[-]?[0-9]{2}[-]?[0-9]{2}[T\s]?[0-9]{2}[:]?[0-9]{2}[:]?[0-9]{2}/g) ? exchange.parse8601 (s) : s)
.map ... | [
"async",
"function",
"main",
"(",
")",
"{",
"const",
"requirements",
"=",
"exchangeId",
"&&",
"methodName",
"if",
"(",
"!",
"requirements",
")",
"{",
"printUsage",
"(",
")",
"}",
"else",
"{",
"let",
"args",
"=",
"params",
".",
"map",
"(",
"s",
"=>",
... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 8168069b9180a465532905e225586215e115a565 | https://github.com/ccxt/ccxt/blob/8168069b9180a465532905e225586215e115a565/examples/js/cli.js#L210-L307 | train | Main entry point | [
30522,
2004,
6038,
2278,
3853,
2364,
1006,
1007,
1063,
9530,
3367,
5918,
1027,
3863,
3593,
1004,
1004,
4118,
30524,
1014,
1011,
1023,
1033,
1063,
1016,
1065,
1031,
1011,
1033,
1029,
1031,
1014,
1011,
1023,
1033,
1063,
1016,
1065,
1031,
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... |
lovell/sharp | lib/input.js | _createInputDescriptor | function _createInputDescriptor (input, inputOptions, containerOptions) {
const inputDescriptor = { failOnError: true };
if (is.string(input)) {
// filesystem
inputDescriptor.file = input;
} else if (is.buffer(input)) {
// Buffer
inputDescriptor.buffer = input;
} else if (is.plainObject(input) &... | javascript | function _createInputDescriptor (input, inputOptions, containerOptions) {
const inputDescriptor = { failOnError: true };
if (is.string(input)) {
// filesystem
inputDescriptor.file = input;
} else if (is.buffer(input)) {
// Buffer
inputDescriptor.buffer = input;
} else if (is.plainObject(input) &... | [
"function",
"_createInputDescriptor",
"(",
"input",
",",
"inputOptions",
",",
"containerOptions",
")",
"{",
"const",
"inputDescriptor",
"=",
"{",
"failOnError",
":",
"true",
"}",
";",
"if",
"(",
"is",
".",
"string",
"(",
"input",
")",
")",
"{",
"// filesyste... | Create Object containing input and input-related options.
@private | [
"Create",
"Object",
"containing",
"input",
"and",
"input",
"-",
"related",
"options",
"."
] | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/input.js#L11-L103 | train | Create a input descriptor based on the input | [
30522,
3853,
1035,
3443,
2378,
18780,
6155,
23235,
2953,
1006,
7953,
1010,
7953,
7361,
9285,
1010,
11661,
7361,
9285,
1007,
1063,
9530,
3367,
7953,
6155,
23235,
2953,
1027,
1063,
8246,
5643,
18933,
2099,
1024,
2995,
1065,
1025,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/MockServer.js | function(sEntitySetName, sKeys) {
sKeys = decodeURIComponent(sKeys);
var oFoundEntry;
var oEntitySet = that._mEntitySets[sEntitySetName];
var aKeys = oEntitySet.keys;
// split keys
var aRequestedKeys = sKeys.split(',');
// check number of keys to be equal to the entity keys and valid... | javascript | function(sEntitySetName, sKeys) {
sKeys = decodeURIComponent(sKeys);
var oFoundEntry;
var oEntitySet = that._mEntitySets[sEntitySetName];
var aKeys = oEntitySet.keys;
// split keys
var aRequestedKeys = sKeys.split(',');
// check number of keys to be equal to the entity keys and valid... | [
"function",
"(",
"sEntitySetName",
",",
"sKeys",
")",
"{",
"sKeys",
"=",
"decodeURIComponent",
"(",
"sKeys",
")",
";",
"var",
"oFoundEntry",
";",
"var",
"oEntitySet",
"=",
"that",
".",
"_mEntitySets",
"[",
"sEntitySetName",
"]",
";",
"var",
"aKeys",
"=",
"... | helper to find the entity set entry for a given entity set name and the keys of the entry | [
"helper",
"to",
"find",
"the",
"entity",
"set",
"entry",
"for",
"a",
"given",
"entity",
"set",
"name",
"and",
"the",
"keys",
"of",
"the",
"entry"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/MockServer.js#L1985-L2063 | train | Checks if the given keys are valid and if so checks the keys type of the entry are valid. | [
30522,
3853,
1006,
2741,
3012,
13462,
18442,
1010,
15315,
3240,
2015,
1007,
1063,
15315,
3240,
2015,
1027,
21933,
3207,
9496,
9006,
29513,
3372,
1006,
15315,
3240,
2015,
1007,
1025,
13075,
1997,
28819,
4765,
2854,
1025,
13075,
1051,
4765,
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... | |
ecomfe/zrender | build/babel-plugin-transform-modules-commonjs-ec.js | nameAnonymousExports | function nameAnonymousExports(programPath) {
// Name anonymous exported locals.
programPath.get('body').forEach(child => {
if (!child.isExportDefaultDeclaration()) {
return;
}
// export default foo;
const declaration = child.get('declaration');
if (declaratio... | javascript | function nameAnonymousExports(programPath) {
// Name anonymous exported locals.
programPath.get('body').forEach(child => {
if (!child.isExportDefaultDeclaration()) {
return;
}
// export default foo;
const declaration = child.get('declaration');
if (declaratio... | [
"function",
"nameAnonymousExports",
"(",
"programPath",
")",
"{",
"// Name anonymous exported locals.",
"programPath",
".",
"get",
"(",
"'body'",
")",
".",
"forEach",
"(",
"child",
"=>",
"{",
"if",
"(",
"!",
"child",
".",
"isExportDefaultDeclaration",
"(",
")",
... | Ensure that all exported values have local binding names. | [
"Ensure",
"that",
"all",
"exported",
"values",
"have",
"local",
"binding",
"names",
"."
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/build/babel-plugin-transform-modules-commonjs-ec.js#L368-L402 | train | Name anonymous exported locals. | [
30522,
3853,
2171,
6761,
4890,
27711,
10288,
25378,
1006,
2565,
15069,
1007,
1063,
1013,
1013,
2171,
10812,
15612,
10575,
1012,
2565,
15069,
1012,
2131,
1006,
1005,
2303,
1005,
1007,
1012,
18921,
6776,
1006,
2775,
1027,
1028,
1063,
2065,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/utils/location.js | isAnchor | function isAnchor(href) {
try {
var parsed = url.parse(href);
return !!(!parsed.protocol && !parsed.path && parsed.hash);
} catch(err) {
return false;
}
} | javascript | function isAnchor(href) {
try {
var parsed = url.parse(href);
return !!(!parsed.protocol && !parsed.path && parsed.hash);
} catch(err) {
return false;
}
} | [
"function",
"isAnchor",
"(",
"href",
")",
"{",
"try",
"{",
"var",
"parsed",
"=",
"url",
".",
"parse",
"(",
"href",
")",
";",
"return",
"!",
"!",
"(",
"!",
"parsed",
".",
"protocol",
"&&",
"!",
"parsed",
".",
"path",
"&&",
"parsed",
".",
"hash",
"... | Return true if the link is an achor | [
"Return",
"true",
"if",
"the",
"link",
"is",
"an",
"achor"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/location.js#L28-L35 | train | Check if the href is an anchor | [
30522,
3853,
18061,
12680,
2953,
1006,
17850,
12879,
1007,
1063,
3046,
1063,
13075,
11968,
6924,
1027,
24471,
2140,
1012,
11968,
3366,
1006,
17850,
12879,
1007,
1025,
2709,
999,
999,
1006,
999,
11968,
6924,
1012,
8778,
1004,
1004,
999,
1196... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netlify/netlify-cms | packages/netlify-cms-widget-markdown/src/serializers/remarkSlate.js | createBlock | function createBlock(type, nodes, props = {}) {
if (!isArray(nodes)) {
props = nodes;
nodes = undefined;
}
const node = { object: 'block', type, ...props };
return addNodes(node, nodes);
} | javascript | function createBlock(type, nodes, props = {}) {
if (!isArray(nodes)) {
props = nodes;
nodes = undefined;
}
const node = { object: 'block', type, ...props };
return addNodes(node, nodes);
} | [
"function",
"createBlock",
"(",
"type",
",",
"nodes",
",",
"props",
"=",
"{",
"}",
")",
"{",
"if",
"(",
"!",
"isArray",
"(",
"nodes",
")",
")",
"{",
"props",
"=",
"nodes",
";",
"nodes",
"=",
"undefined",
";",
"}",
"const",
"node",
"=",
"{",
"obje... | Create a Slate Inline node. | [
"Create",
"a",
"Slate",
"Inline",
"node",
"."
] | 2488556590cbfdcefa626f2f2de01e7a160cf6ee | https://github.com/netlify/netlify-cms/blob/2488556590cbfdcefa626f2f2de01e7a160cf6ee/packages/netlify-cms-widget-markdown/src/serializers/remarkSlate.js#L68-L76 | train | Create a block node | [
30522,
3853,
3443,
23467,
1006,
2828,
1010,
14164,
1010,
24387,
1027,
1063,
1065,
1007,
1063,
2065,
1006,
999,
18061,
11335,
2100,
1006,
14164,
1007,
1007,
1063,
24387,
1027,
14164,
1025,
14164,
1027,
6151,
28344,
1025,
1065,
9530,
3367,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Manifest.js | getObject | function getObject(oObject, sPath) {
// if the incoming sPath is a path we do a nested lookup in the
// manifest object and return the concrete value, e.g. "/sap.ui5/extends"
if (oObject && sPath && typeof sPath === "string" && sPath[0] === "/") {
var aPaths = sPath.substring(1).split("/"),
sPathSegment... | javascript | function getObject(oObject, sPath) {
// if the incoming sPath is a path we do a nested lookup in the
// manifest object and return the concrete value, e.g. "/sap.ui5/extends"
if (oObject && sPath && typeof sPath === "string" && sPath[0] === "/") {
var aPaths = sPath.substring(1).split("/"),
sPathSegment... | [
"function",
"getObject",
"(",
"oObject",
",",
"sPath",
")",
"{",
"// if the incoming sPath is a path we do a nested lookup in the",
"// manifest object and return the concrete value, e.g. \"/sap.ui5/extends\"",
"if",
"(",
"oObject",
"&&",
"sPath",
"&&",
"typeof",
"sPath",
"===",
... | Utility function to access a child member by a given path
@param {object} oObject Object
@param {string} sPath Path starting with a slash (/)
@return {any} value of a member specified by its path;
if the path doesn't start with a slash it returns the value for the given path of the object | [
"Utility",
"function",
"to",
"access",
"a",
"child",
"member",
"by",
"a",
"given",
"path"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Manifest.js#L84-L116 | train | Get the concrete value of the given path in the manifest object. | [
30522,
3853,
2131,
16429,
20614,
1006,
1051,
16429,
20614,
1010,
14690,
2232,
1007,
1063,
1013,
1013,
2065,
1996,
14932,
14690,
2232,
2003,
1037,
4130,
2057,
2079,
1037,
9089,
2098,
2298,
6279,
1999,
1996,
1013,
1013,
19676,
4874,
1998,
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... |
thomaspark/bootswatch | docs/_vendor/popper.js/dist/popper.js | includeScroll | function includeScroll(rect, element, subtract = false) {
const scrollTop = getScroll(element, 'top');
const scrollLeft = getScroll(element, 'left');
const modifier = subtract ? -1 : 1;
rect.top += scrollTop * modifier;
rect.bottom += scrollTop * modifier;
rect.left += scrollLeft * modifier;
rect.right +=... | javascript | function includeScroll(rect, element, subtract = false) {
const scrollTop = getScroll(element, 'top');
const scrollLeft = getScroll(element, 'left');
const modifier = subtract ? -1 : 1;
rect.top += scrollTop * modifier;
rect.bottom += scrollTop * modifier;
rect.left += scrollLeft * modifier;
rect.right +=... | [
"function",
"includeScroll",
"(",
"rect",
",",
"element",
",",
"subtract",
"=",
"false",
")",
"{",
"const",
"scrollTop",
"=",
"getScroll",
"(",
"element",
",",
"'top'",
")",
";",
"const",
"scrollLeft",
"=",
"getScroll",
"(",
"element",
",",
"'left'",
")",
... | /*
Sum or subtract the element scroll values (left and top) from a given rect object
@method
@memberof Popper.Utils
@param {Object} rect - Rect object you want to change
@param {HTMLElement} element - The element from the function reads the scroll values
@param {Boolean} subtract - set to true if you want to subtract t... | [
"/",
"*",
"Sum",
"or",
"subtract",
"the",
"element",
"scroll",
"values",
"(",
"left",
"and",
"top",
")",
"from",
"a",
"given",
"rect",
"object"
] | a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd | https://github.com/thomaspark/bootswatch/blob/a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd/docs/_vendor/popper.js/dist/popper.js#L301-L310 | train | Adds scroll position to rect | [
30522,
3853,
2950,
26775,
14511,
1006,
28667,
2102,
1010,
5783,
1010,
4942,
6494,
6593,
1027,
6270,
1007,
1063,
9530,
3367,
17186,
14399,
1027,
4152,
26775,
14511,
1006,
5783,
1010,
1005,
2327,
1005,
1007,
1025,
9530,
3367,
17186,
2571,
619... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/jszip.js | function() {
var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);
if (offset === -1) {
throw new Error("Corrupted zip : can't find end of central directory");
}
this.reader.setIndex(offset);
this.checkSignature(sig.CENTRAL_DIRECTORY_END);
... | javascript | function() {
var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);
if (offset === -1) {
throw new Error("Corrupted zip : can't find end of central directory");
}
this.reader.setIndex(offset);
this.checkSignature(sig.CENTRAL_DIRECTORY_END);
... | [
"function",
"(",
")",
"{",
"var",
"offset",
"=",
"this",
".",
"reader",
".",
"lastIndexOfSignature",
"(",
"sig",
".",
"CENTRAL_DIRECTORY_END",
")",
";",
"if",
"(",
"offset",
"===",
"-",
"1",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Corrupted zip : can't ... | Read the end of central directory. | [
"Read",
"the",
"end",
"of",
"central",
"directory",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jszip.js#L1809-L1855 | train | Extract the end of central directory | [
30522,
3853,
1006,
1007,
1063,
13075,
16396,
1027,
2023,
1012,
8068,
1012,
2197,
22254,
10288,
11253,
5332,
16989,
11244,
1006,
9033,
2290,
1012,
2430,
1035,
14176,
1035,
2203,
1007,
1025,
2065,
1006,
16396,
1027,
1027,
1027,
1011,
1015,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/Sorter.js | function(oContext) {
var oGroup = this.fnGroup(oContext);
if (typeof oGroup === "string" || typeof oGroup === "number" || typeof oGroup === "boolean" || oGroup == null) {
oGroup = {
key: oGroup
};
}
return oGroup;
} | javascript | function(oContext) {
var oGroup = this.fnGroup(oContext);
if (typeof oGroup === "string" || typeof oGroup === "number" || typeof oGroup === "boolean" || oGroup == null) {
oGroup = {
key: oGroup
};
}
return oGroup;
} | [
"function",
"(",
"oContext",
")",
"{",
"var",
"oGroup",
"=",
"this",
".",
"fnGroup",
"(",
"oContext",
")",
";",
"if",
"(",
"typeof",
"oGroup",
"===",
"\"string\"",
"||",
"typeof",
"oGroup",
"===",
"\"number\"",
"||",
"typeof",
"oGroup",
"===",
"\"boolean\"... | Returns a group object, at least containing a key property for group detection.
May contain additional properties as provided by a custom group function.
@param {sap.ui.model.Context} oContext the binding context
@return {object} An object containing a key property and optional custom properties
@public | [
"Returns",
"a",
"group",
"object",
"at",
"least",
"containing",
"a",
"key",
"property",
"for",
"group",
"detection",
".",
"May",
"contain",
"additional",
"properties",
"as",
"provided",
"by",
"a",
"custom",
"group",
"function",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/Sorter.js#L82-L90 | train | Returns the group object for the given context | [
30522,
3853,
1006,
1051,
8663,
18209,
1007,
1063,
13075,
13958,
22107,
1027,
2023,
1012,
1042,
3070,
22107,
1006,
1051,
8663,
18209,
1007,
1025,
2065,
1006,
2828,
11253,
13958,
22107,
1027,
1027,
1027,
1000,
5164,
1000,
1064,
1064,
2828,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/icon/js/iconService.js | getIcon | function getIcon(id) {
id = id || '';
// If the "id" provided is not a string, the only other valid value is a $sce trust wrapper
// over a URL string. If the value is not trusted, this will intentionally throw an error
// because the user is attempted to use an unsafe URL, potentially opening themselv... | javascript | function getIcon(id) {
id = id || '';
// If the "id" provided is not a string, the only other valid value is a $sce trust wrapper
// over a URL string. If the value is not trusted, this will intentionally throw an error
// because the user is attempted to use an unsafe URL, potentially opening themselv... | [
"function",
"getIcon",
"(",
"id",
")",
"{",
"id",
"=",
"id",
"||",
"''",
";",
"// If the \"id\" provided is not a string, the only other valid value is a $sce trust wrapper",
"// over a URL string. If the value is not trusted, this will intentionally throw an error",
"// because the user... | Actual $mdIcon service is essentially a lookup function
@param {*} id $sce trust wrapper over a URL string, URL, icon registry id, or icon set id
@returns {angular.$q.Promise} | [
"Actual",
"$mdIcon",
"service",
"is",
"essentially",
"a",
"lookup",
"function"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/icon/js/iconService.js#L423-L452 | train | Returns the icon for the given id. | [
30522,
3853,
2131,
28524,
1006,
8909,
1007,
1063,
8909,
1027,
8909,
1064,
1064,
1005,
1005,
1025,
1013,
1013,
2065,
1996,
1000,
8909,
1000,
3024,
2003,
2025,
1037,
5164,
1010,
1996,
2069,
2060,
9398,
3643,
2003,
1037,
1002,
8040,
2063,
34... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
didi/cube-ui | example/modules/image.js | getOrientation | function getOrientation(buffer){
var view = new DataView(buffer);
if (view.getUint16(0, false) != 0xFFD8) return -2;
var length = view.byteLength, offset = 2;
while (offset < length) {
var marker = view.getUint16(offset, false);
offset += 2;
if (marker == 0xFFE1) {
if... | javascript | function getOrientation(buffer){
var view = new DataView(buffer);
if (view.getUint16(0, false) != 0xFFD8) return -2;
var length = view.byteLength, offset = 2;
while (offset < length) {
var marker = view.getUint16(offset, false);
offset += 2;
if (marker == 0xFFE1) {
if... | [
"function",
"getOrientation",
"(",
"buffer",
")",
"{",
"var",
"view",
"=",
"new",
"DataView",
"(",
"buffer",
")",
";",
"if",
"(",
"view",
".",
"getUint16",
"(",
"0",
",",
"false",
")",
"!=",
"0xFFD8",
")",
"return",
"-",
"2",
";",
"var",
"length",
... | 获取图片的orientation
ref to http://stackoverflow.com/questions/7584794/accessing-jpeg-exif-rotation-data-in-javascript-on-the-client-side | [
"获取图片的orientation",
"ref",
"to",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"7584794",
"/",
"accessing",
"-",
"jpeg",
"-",
"exif",
"-",
"rotation",
"-",
"data",
"-",
"in",
"-",
"javascript",
"-",
"on",
"-",
"the",
"-",
"clie... | 29096d1fe600c699237db8039255f74126730157 | https://github.com/didi/cube-ui/blob/29096d1fe600c699237db8039255f74126730157/example/modules/image.js#L78-L99 | train | Get the orientation of the logarithmic algorithm | [
30522,
3853,
2131,
10050,
19304,
1006,
17698,
1007,
1063,
13075,
3193,
1027,
2047,
2951,
8584,
1006,
17698,
1007,
1025,
2065,
1006,
3193,
1012,
2131,
20023,
2102,
16048,
1006,
1014,
1010,
6270,
1007,
999,
1027,
1014,
2595,
4246,
2094,
2620,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | CubicBezier | function CubicBezier(coordinates) {
if (typeof coordinates === "string") {
this.coordinates = coordinates.split(",");
} else {
this.coordinates = coordinates;
}
if (!this.coordinates) {
throw "No offsets were defined";
}
this.coordina... | javascript | function CubicBezier(coordinates) {
if (typeof coordinates === "string") {
this.coordinates = coordinates.split(",");
} else {
this.coordinates = coordinates;
}
if (!this.coordinates) {
throw "No offsets were defined";
}
this.coordina... | [
"function",
"CubicBezier",
"(",
"coordinates",
")",
"{",
"if",
"(",
"typeof",
"coordinates",
"===",
"\"string\"",
")",
"{",
"this",
".",
"coordinates",
"=",
"coordinates",
".",
"split",
"(",
"\",\"",
")",
";",
"}",
"else",
"{",
"this",
".",
"coordinates",
... | CubicBezier object constructor
@param {string|Array.number[4]} coordinates Four parameters passes to cubic-bezier()
either in string or array format. | [
"CubicBezier",
"object",
"constructor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L50-L70 | train | CubicBezier constructor. | [
30522,
3853,
11919,
4783,
21548,
1006,
12093,
1007,
1063,
2065,
1006,
2828,
11253,
12093,
1027,
1027,
1027,
1000,
5164,
1000,
1007,
1063,
2023,
1012,
12093,
1027,
12093,
1012,
3975,
1006,
1000,
1010,
1000,
1007,
1025,
1065,
2842,
1063,
2023... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-await-in-loop.js | validate | function validate(awaitNode) {
if (awaitNode.type === "ForOfStatement" && !awaitNode.await) {
return;
}
let node = awaitNode;
let parent = node.parent;
while (parent && !isBoundary(parent)) {
if (isLooped(node, parent)) {
... | javascript | function validate(awaitNode) {
if (awaitNode.type === "ForOfStatement" && !awaitNode.await) {
return;
}
let node = awaitNode;
let parent = node.parent;
while (parent && !isBoundary(parent)) {
if (isLooped(node, parent)) {
... | [
"function",
"validate",
"(",
"awaitNode",
")",
"{",
"if",
"(",
"awaitNode",
".",
"type",
"===",
"\"ForOfStatement\"",
"&&",
"!",
"awaitNode",
".",
"await",
")",
"{",
"return",
";",
"}",
"let",
"node",
"=",
"awaitNode",
";",
"let",
"parent",
"=",
"node",
... | Validate an await expression.
@param {ASTNode} awaitNode An AwaitExpression or ForOfStatement node to validate.
@returns {void} | [
"Validate",
"an",
"await",
"expression",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-await-in-loop.js#L80-L99 | train | Validate await node | [
30522,
3853,
9398,
3686,
1006,
26751,
3630,
3207,
1007,
1063,
2065,
1006,
26751,
3630,
3207,
1012,
2828,
1027,
1027,
1027,
1000,
2005,
11253,
9153,
18532,
4765,
1000,
1004,
1004,
999,
26751,
3630,
3207,
1012,
26751,
1007,
1063,
2709,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/qunit.js | function( count ) {
var globalStartAlreadyCalled = globalStartCalled;
if ( !config.current ) {
globalStartCalled = true;
if ( runStarted ) {
throw new Error( "Called start() outside of a test context while already started" );
} else if ( globalStartAlreadyCalled || count > 1 ) {
throw new Error( ... | javascript | function( count ) {
var globalStartAlreadyCalled = globalStartCalled;
if ( !config.current ) {
globalStartCalled = true;
if ( runStarted ) {
throw new Error( "Called start() outside of a test context while already started" );
} else if ( globalStartAlreadyCalled || count > 1 ) {
throw new Error( ... | [
"function",
"(",
"count",
")",
"{",
"var",
"globalStartAlreadyCalled",
"=",
"globalStartCalled",
";",
"if",
"(",
"!",
"config",
".",
"current",
")",
"{",
"globalStartCalled",
"=",
"true",
";",
"if",
"(",
"runStarted",
")",
"{",
"throw",
"new",
"Error",
"("... | DEPRECATED: The functionality of QUnit.start() will be altered in QUnit 2.0. In QUnit 2.0, invoking it will ONLY affect the `QUnit.config.autostart` blocking behavior. | [
"DEPRECATED",
":",
"The",
"functionality",
"of",
"QUnit",
".",
"start",
"()",
"will",
"be",
"altered",
"in",
"QUnit",
"2",
".",
"0",
".",
"In",
"QUnit",
"2",
".",
"0",
"invoking",
"it",
"will",
"ONLY",
"affect",
"the",
"QUnit",
".",
"config",
".",
"a... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/qunit.js#L291-L333 | train | Starts a test at the specified count of times. | [
30522,
3853,
1006,
4175,
1007,
1063,
13075,
3795,
14117,
9080,
16416,
5149,
9289,
3709,
1027,
3795,
14117,
13535,
24164,
2094,
1025,
2065,
1006,
999,
9530,
8873,
2290,
1012,
2783,
1007,
1063,
3795,
14117,
13535,
24164,
2094,
1027,
2995,
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... | |
eslint/eslint | lib/rules/semi-spacing.js | isBeforeClosingParen | function isBeforeClosingParen(token) {
const nextToken = sourceCode.getTokenAfter(token);
return (nextToken && astUtils.isClosingBraceToken(nextToken) || astUtils.isClosingParenToken(nextToken));
} | javascript | function isBeforeClosingParen(token) {
const nextToken = sourceCode.getTokenAfter(token);
return (nextToken && astUtils.isClosingBraceToken(nextToken) || astUtils.isClosingParenToken(nextToken));
} | [
"function",
"isBeforeClosingParen",
"(",
"token",
")",
"{",
"const",
"nextToken",
"=",
"sourceCode",
".",
"getTokenAfter",
"(",
"token",
")",
";",
"return",
"(",
"nextToken",
"&&",
"astUtils",
".",
"isClosingBraceToken",
"(",
"nextToken",
")",
"||",
"astUtils",
... | Checks if the next token of a given token is a closing parenthesis.
@param {Token} token The token to check.
@returns {boolean} Whether or not the next token of a given token is a closing parenthesis. | [
"Checks",
"if",
"the",
"next",
"token",
"of",
"a",
"given",
"token",
"is",
"a",
"closing",
"parenthesis",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/semi-spacing.js#L106-L110 | train | Check if the given token is the first token of a closing parenthesis | [
30522,
3853,
2003,
4783,
29278,
8586,
10483,
2075,
19362,
2368,
1006,
19204,
1007,
1063,
9530,
3367,
2279,
18715,
2368,
1027,
3120,
16044,
1012,
2131,
18715,
8189,
6199,
2121,
1006,
19204,
1007,
1025,
2709,
1006,
2279,
18715,
2368,
1004,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
badges/shields | services/luarocks/luarocks-version-helpers.js | parseVersion | function parseVersion(versionString) {
versionString = versionString.toLowerCase().replace('-', '.')
const versionList = []
versionString.split('.').forEach(versionPart => {
const parsedPart = /(\d*)([a-z]*)(\d*)/.exec(versionPart)
if (parsedPart[1]) {
versionList.push(parseInt(parsedPart[1]))
}... | javascript | function parseVersion(versionString) {
versionString = versionString.toLowerCase().replace('-', '.')
const versionList = []
versionString.split('.').forEach(versionPart => {
const parsedPart = /(\d*)([a-z]*)(\d*)/.exec(versionPart)
if (parsedPart[1]) {
versionList.push(parseInt(parsedPart[1]))
}... | [
"function",
"parseVersion",
"(",
"versionString",
")",
"{",
"versionString",
"=",
"versionString",
".",
"toLowerCase",
"(",
")",
".",
"replace",
"(",
"'-'",
",",
"'.'",
")",
"const",
"versionList",
"=",
"[",
"]",
"versionString",
".",
"split",
"(",
"'.'",
... | Parse a dotted version string to an array of numbers 'rc', 'pre', 'beta', 'alpha' are converted to negative numbers | [
"Parse",
"a",
"dotted",
"version",
"string",
"to",
"an",
"array",
"of",
"numbers",
"rc",
"pre",
"beta",
"alpha",
"are",
"converted",
"to",
"negative",
"numbers"
] | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/services/luarocks/luarocks-version-helpers.js#L31-L59 | train | Parse a version string into an array of integers | [
30522,
3853,
11968,
3366,
27774,
1006,
4617,
18886,
3070,
1007,
1063,
4617,
18886,
3070,
1027,
4617,
18886,
3070,
1012,
2000,
27663,
18992,
3366,
1006,
1007,
1012,
5672,
1006,
1005,
1011,
1005,
1010,
1005,
1012,
1005,
1007,
9530,
3367,
2544... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/content/content.js | mdContentDirective | function mdContentDirective($mdTheming) {
return {
restrict: 'E',
controller: ['$scope', '$element', ContentController],
link: function(scope, element) {
element.addClass('_md'); // private md component indicator for styling
$mdTheming(element);
scope.$broadcast('$mdContentLoaded', ... | javascript | function mdContentDirective($mdTheming) {
return {
restrict: 'E',
controller: ['$scope', '$element', ContentController],
link: function(scope, element) {
element.addClass('_md'); // private md component indicator for styling
$mdTheming(element);
scope.$broadcast('$mdContentLoaded', ... | [
"function",
"mdContentDirective",
"(",
"$mdTheming",
")",
"{",
"return",
"{",
"restrict",
":",
"'E'",
",",
"controller",
":",
"[",
"'$scope'",
",",
"'$element'",
",",
"ContentController",
"]",
",",
"link",
":",
"function",
"(",
"scope",
",",
"element",
")",
... | @ngdoc directive
@name mdContent
@module material.components.content
@restrict E
@description
The `<md-content>` directive is a container element useful for scrollable content. It achieves
this by setting the CSS `overflow` property to `auto` so that content can properly scroll.
In general, `<md-content>` component... | [
"@ngdoc",
"directive",
"@name",
"mdContent",
"@module",
"material",
".",
"components",
".",
"content"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/content/content.js#L53-L71 | train | The content directive | [
30522,
3853,
9108,
8663,
6528,
2102,
4305,
2890,
15277,
1006,
1002,
9108,
10760,
6562,
1007,
1063,
2709,
1063,
21573,
1024,
1005,
1041,
1005,
1010,
11486,
1024,
1031,
1005,
1002,
9531,
1005,
1010,
1005,
1002,
5783,
1005,
1010,
4180,
8663,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/propertyTypes.js | isValidDefaultValue | function isValidDefaultValue (type, defaultVal) {
if (type === 'audio' && typeof defaultVal !== 'string') { return false; }
if (type === 'array' && !Array.isArray(defaultVal)) { return false; }
if (type === 'asset' && typeof defaultVal !== 'string') { return false; }
if (type === 'boolean' && typeof defaultVal ... | javascript | function isValidDefaultValue (type, defaultVal) {
if (type === 'audio' && typeof defaultVal !== 'string') { return false; }
if (type === 'array' && !Array.isArray(defaultVal)) { return false; }
if (type === 'asset' && typeof defaultVal !== 'string') { return false; }
if (type === 'boolean' && typeof defaultVal ... | [
"function",
"isValidDefaultValue",
"(",
"type",
",",
"defaultVal",
")",
"{",
"if",
"(",
"type",
"===",
"'audio'",
"&&",
"typeof",
"defaultVal",
"!==",
"'string'",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"type",
"===",
"'array'",
"&&",
"!",
"Arr... | Validate the default values in a schema to match their type.
@param {string} type - Property type name.
@param defaultVal - Property type default value.
@returns {boolean} Whether default value is accurate given the type. | [
"Validate",
"the",
"default",
"values",
"in",
"a",
"schema",
"to",
"match",
"their",
"type",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/propertyTypes.js#L173-L194 | train | Check if the default value is valid | [
30522,
3853,
2003,
10175,
3593,
3207,
7011,
11314,
10175,
5657,
1006,
2828,
1010,
12398,
10175,
1007,
1063,
2065,
1006,
2828,
1027,
1027,
1027,
1005,
5746,
1005,
1004,
1004,
2828,
11253,
12398,
10175,
999,
1027,
1027,
1005,
5164,
1005,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/Renderer.js | createExtendedRenderer | function createExtendedRenderer(sName, oRendererInfo) {
assert(this != null, 'BaseRenderer must be a non-null object');
assert(typeof sName === 'string' && sName, 'Renderer.extend must be called with a non-empty name for the new renderer');
assert(oRendererInfo == null ||
(isPlainObject(oRendererInfo)
&& ... | javascript | function createExtendedRenderer(sName, oRendererInfo) {
assert(this != null, 'BaseRenderer must be a non-null object');
assert(typeof sName === 'string' && sName, 'Renderer.extend must be called with a non-empty name for the new renderer');
assert(oRendererInfo == null ||
(isPlainObject(oRendererInfo)
&& ... | [
"function",
"createExtendedRenderer",
"(",
"sName",
",",
"oRendererInfo",
")",
"{",
"assert",
"(",
"this",
"!=",
"null",
",",
"'BaseRenderer must be a non-null object'",
")",
";",
"assert",
"(",
"typeof",
"sName",
"===",
"'string'",
"&&",
"sName",
",",
"'Renderer.... | Helper to create a new renderer by extending an existing one.
@this {sap.ui.core.Renderer} The base renderer to extend
@param {string} sName Global name of the new renderer
@param {object} oRendererInfo Methods and static properties of the new renderer
@returns {object} New static renderer class
@private | [
"Helper",
"to",
"create",
"a",
"new",
"renderer",
"by",
"extending",
"an",
"existing",
"one",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Renderer.js#L38-L56 | train | Creates an extended renderer instance. | [
30522,
3853,
3443,
10288,
6528,
5732,
7389,
4063,
2121,
1006,
1055,
18442,
1010,
10848,
11563,
23282,
14876,
1007,
1063,
20865,
1006,
2023,
999,
1027,
19701,
1010,
1005,
2918,
7389,
4063,
2121,
2442,
2022,
1037,
2512,
1011,
19701,
4874,
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... |
jgraph/mxgraph | javascript/mxClient.js | mxVertexHandler | function mxVertexHandler(state)
{
if (state != null)
{
this.state = state;
this.init();
// Handles escape keystrokes
this.escapeHandler = mxUtils.bind(this, function(sender, evt)
{
if (this.livePreview && this.index != null)
{
// Redraws the live preview
this.state.view.graph.cellRenderer.r... | javascript | function mxVertexHandler(state)
{
if (state != null)
{
this.state = state;
this.init();
// Handles escape keystrokes
this.escapeHandler = mxUtils.bind(this, function(sender, evt)
{
if (this.livePreview && this.index != null)
{
// Redraws the live preview
this.state.view.graph.cellRenderer.r... | [
"function",
"mxVertexHandler",
"(",
"state",
")",
"{",
"if",
"(",
"state",
"!=",
"null",
")",
"{",
"this",
".",
"state",
"=",
"state",
";",
"this",
".",
"init",
"(",
")",
";",
"// Handles escape keystrokes",
"this",
".",
"escapeHandler",
"=",
"mxUtils",
... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxVertexHandler
Event handler for resizing cells. This handler is automatically created in
<mxGraph.createHandler>.
Constructor: mxVertexHandler
Constructs an event handler that allows to resize vertices
and groups.
Parameters:
sta... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxVertexHandler"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L75564-L75590 | train | This is the main entry point for the vertex handler | [
30522,
3853,
25630,
16874,
10288,
11774,
3917,
1006,
2110,
1007,
1063,
2065,
1006,
2110,
999,
1027,
19701,
1007,
1063,
2023,
1012,
2110,
1027,
2110,
1025,
2023,
1012,
1999,
4183,
1006,
1007,
1025,
1013,
1013,
16024,
4019,
6309,
13181,
9681,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | parseLessCode | function parseLessCode(code, url) {
var result = new $.Deferred(),
options;
if (url) {
var dir = url.slice(0, url.lastIndexOf("/") + 1);
options = {
filename: url,
rootpath: dir
};
if (isAbsolutePathOrUrl(url)... | javascript | function parseLessCode(code, url) {
var result = new $.Deferred(),
options;
if (url) {
var dir = url.slice(0, url.lastIndexOf("/") + 1);
options = {
filename: url,
rootpath: dir
};
if (isAbsolutePathOrUrl(url)... | [
"function",
"parseLessCode",
"(",
"code",
",",
"url",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"options",
";",
"if",
"(",
"url",
")",
"{",
"var",
"dir",
"=",
"url",
".",
"slice",
"(",
"0",
",",
"url",
".",
"la... | Parses LESS code and returns a promise that resolves with plain CSS code.
Pass the {@link url} argument to resolve relative URLs contained in the code.
Make sure URLs in the code are wrapped in quotes, like so:
background-image: url("image.png");
@param {!string} code LESS code to parse
@param {?string} url URL to th... | [
"Parses",
"LESS",
"code",
"and",
"returns",
"a",
"promise",
"that",
"resolves",
"with",
"plain",
"CSS",
"code",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ExtensionUtils.js#L96-L128 | train | Parse less code | [
30522,
3853,
11968,
11246,
7971,
16044,
1006,
3642,
1010,
24471,
2140,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
7047,
1025,
2065,
1006,
24471,
2140,
1007,
1063,
13075,
16101,
1027,
24471,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/document/DocumentCommandHandlers.js | doClose | function doClose(file) {
if (!promptOnly) {
MainViewManager._close(paneId, file);
HealthLogger.fileClosed(file);
}
} | javascript | function doClose(file) {
if (!promptOnly) {
MainViewManager._close(paneId, file);
HealthLogger.fileClosed(file);
}
} | [
"function",
"doClose",
"(",
"file",
")",
"{",
"if",
"(",
"!",
"promptOnly",
")",
"{",
"MainViewManager",
".",
"_close",
"(",
"paneId",
",",
"file",
")",
";",
"HealthLogger",
".",
"fileClosed",
"(",
"file",
")",
";",
"}",
"}"
] | utility function for handleFileClose: closes document & removes from workingset | [
"utility",
"function",
"for",
"handleFileClose",
":",
"closes",
"document",
"&",
"removes",
"from",
"workingset"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentCommandHandlers.js#L1197-L1202 | train | Close the file | [
30522,
3853,
9986,
10483,
2063,
1006,
5371,
1007,
1063,
2065,
1006,
999,
25732,
2239,
2135,
1007,
1063,
2364,
8584,
24805,
4590,
1012,
1035,
2485,
1006,
6090,
7416,
2094,
1010,
5371,
1007,
1025,
2740,
21197,
4590,
1012,
5371,
20464,
24768,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/gesture/gesture.js | attachToDocument | function attachToDocument($mdGesture, $$MdGestureHandler) {
if (disableAllGestures) {
return;
}
// Polyfill document.contains for IE11.
// TODO: move to util
document.contains || (document.contains = function (node) {
return document.body.contains(node);
});
if (!isInitialized && $mdGesture.isHi... | javascript | function attachToDocument($mdGesture, $$MdGestureHandler) {
if (disableAllGestures) {
return;
}
// Polyfill document.contains for IE11.
// TODO: move to util
document.contains || (document.contains = function (node) {
return document.body.contains(node);
});
if (!isInitialized && $mdGesture.isHi... | [
"function",
"attachToDocument",
"(",
"$mdGesture",
",",
"$$MdGestureHandler",
")",
"{",
"if",
"(",
"disableAllGestures",
")",
"{",
"return",
";",
"}",
"// Polyfill document.contains for IE11.",
"// TODO: move to util",
"document",
".",
"contains",
"||",
"(",
"document",... | Attach Gestures: hook document and check shouldHijack clicks
@ngInject | [
"Attach",
"Gestures",
":",
"hook",
"document",
"and",
"check",
"shouldHijack",
"clicks"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/gesture/gesture.js#L546-L695 | train | Adds event listeners to the document | [
30522,
3853,
22476,
3406,
3527,
24894,
4765,
1006,
1002,
9108,
8449,
11244,
1010,
1002,
1002,
9108,
8449,
11244,
11774,
3917,
1007,
1063,
2065,
1006,
4487,
19150,
8095,
8449,
22662,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
26572,
8873,
336... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
LLK/scratch-blocks | blocks_vertical/operators.js | function() {
this.jsonInit({
"message0": Blockly.Msg.OPERATORS_MATHOP,
"args0": [
{
"type": "field_dropdown",
"name": "OPERATOR",
"options": [
[Blockly.Msg.OPERATORS_MATHOP_ABS, 'abs'],
[Blockly.Msg.OPERATORS_MATHOP_FLOOR, 'floor'],
... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.OPERATORS_MATHOP,
"args0": [
{
"type": "field_dropdown",
"name": "OPERATOR",
"options": [
[Blockly.Msg.OPERATORS_MATHOP_ABS, 'abs'],
[Blockly.Msg.OPERATORS_MATHOP_FLOOR, 'floor'],
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"OPERATORS_MATHOP",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"OPERATOR\"",
",",
"\"options\"... | Block for "advanced" math ops on a number.
@this Blockly.Block | [
"Block",
"for",
"advanced",
"math",
"ops",
"on",
"a",
"number",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/operators.js#L437-L469 | train | Block for the operator dropdown. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
9224,
1035,
8785,
7361,
1010,
1000,
12098,
5620,
2692,
1000,
1024,
1031,
1063,
1000,
2828,
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... | |
scrumpy/tiptap | packages/tiptap-extensions/src/plugins/Suggestions.js | triggerCharacter | function triggerCharacter({
char = '@',
allowSpaces = false,
startOfLine = false,
}) {
return $position => {
// Matching expressions used for later
const escapedChar = `\\${char}`
const suffix = new RegExp(`\\s${escapedChar}$`)
const prefix = startOfLine ? '^' : ''
const regexp = allowSpace... | javascript | function triggerCharacter({
char = '@',
allowSpaces = false,
startOfLine = false,
}) {
return $position => {
// Matching expressions used for later
const escapedChar = `\\${char}`
const suffix = new RegExp(`\\s${escapedChar}$`)
const prefix = startOfLine ? '^' : ''
const regexp = allowSpace... | [
"function",
"triggerCharacter",
"(",
"{",
"char",
"=",
"'@'",
",",
"allowSpaces",
"=",
"false",
",",
"startOfLine",
"=",
"false",
",",
"}",
")",
"{",
"return",
"$position",
"=>",
"{",
"// Matching expressions used for later",
"const",
"escapedChar",
"=",
"`",
... | Create a matcher that matches when a specific character is typed. Useful for @mentions and #tags. | [
"Create",
"a",
"matcher",
"that",
"matches",
"when",
"a",
"specific",
"character",
"is",
"typed",
".",
"Useful",
"for"
] | f02461cc791f9efa0d87b6e811d27b7078eb9b86 | https://github.com/scrumpy/tiptap/blob/f02461cc791f9efa0d87b6e811d27b7078eb9b86/packages/tiptap-extensions/src/plugins/Suggestions.js#L6-L63 | train | Trigger a character in the document | [
30522,
30524,
1063,
25869,
1027,
1005,
1030,
1005,
1010,
4473,
15327,
2015,
1027,
6270,
1010,
2707,
11253,
4179,
1027,
6270,
1010,
1065,
1007,
1063,
2709,
1002,
2597,
1027,
1028,
1063,
1013,
1013,
9844,
11423,
2109,
2005,
2101,
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... |
eslint/eslint | lib/rules/no-redeclare.js | checkForBlock | function checkForBlock(node) {
const scope = context.getScope();
/*
* In ES5, some node type such as `BlockStatement` doesn't have that scope.
* `scope.block` is a different node in such a case.
*/
if (scope.block === node) {
fi... | javascript | function checkForBlock(node) {
const scope = context.getScope();
/*
* In ES5, some node type such as `BlockStatement` doesn't have that scope.
* `scope.block` is a different node in such a case.
*/
if (scope.block === node) {
fi... | [
"function",
"checkForBlock",
"(",
"node",
")",
"{",
"const",
"scope",
"=",
"context",
".",
"getScope",
"(",
")",
";",
"/*\n * In ES5, some node type such as `BlockStatement` doesn't have that scope.\n * `scope.block` is a different node in such a case.\n ... | Find variables in the current scope.
@param {ASTNode} node The node of the current scope.
@returns {void}
@private | [
"Find",
"variables",
"in",
"the",
"current",
"scope",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-redeclare.js#L131-L141 | train | Check if node is a block | [
30522,
3853,
4638,
29278,
23467,
1006,
13045,
1007,
1063,
9530,
3367,
9531,
1027,
6123,
1012,
4152,
16186,
1006,
1007,
1025,
1013,
1008,
1008,
1999,
9686,
2629,
1010,
2070,
13045,
2828,
2107,
2004,
1036,
5991,
12259,
3672,
1036,
2987,
1005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | function(obj, variable)
{
var codec = new mxObjectCodec(obj, ['model', 'previous'], ['cell']);
/**
* Function: afterDecode
*
* Restores the state by assigning the previous value.
*/
codec.afterDecode = function(dec, node, obj)
{
// Allows forward references in sessions. This is a workaround
// for the... | javascript | function(obj, variable)
{
var codec = new mxObjectCodec(obj, ['model', 'previous'], ['cell']);
/**
* Function: afterDecode
*
* Restores the state by assigning the previous value.
*/
codec.afterDecode = function(dec, node, obj)
{
// Allows forward references in sessions. This is a workaround
// for the... | [
"function",
"(",
"obj",
",",
"variable",
")",
"{",
"var",
"codec",
"=",
"new",
"mxObjectCodec",
"(",
"obj",
",",
"[",
"'model'",
",",
"'previous'",
"]",
",",
"[",
"'cell'",
"]",
")",
";",
"/**\n\t * Function: afterDecode\n\t *\n\t * Restores the state by assigning... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxGenericChangeCodec
Codec for <mxValueChange>s, <mxStyleChange>s, <mxGeometryChange>s,
<mxCollapseChange>s and <mxVisibleChange>s. This class is created
and registered dynamically at load time and used implicitely
via <mxCodec> and th... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxGenericChangeCodec"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L88400-L88424 | train | A function that can be used to decode a cell | [
30522,
3853,
1006,
27885,
3501,
1010,
8023,
1007,
1063,
13075,
3642,
2278,
1027,
2047,
25630,
16429,
20614,
16044,
2278,
1006,
27885,
3501,
1010,
1031,
1005,
2944,
1005,
1010,
1005,
3025,
1005,
1033,
1010,
1031,
1005,
3526,
1005,
1033,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/hyphenation/Hyphenation.js | onLanguageInitialized | function onLanguageInitialized(sLanguage, resolve, hyphenateMethod) {
oHyphenateMethods[sLanguage] = hyphenateMethod;
oHyphenationInstance.bIsInitialized = true;
if (aLanguagesQueue.length > 0) {
aLanguagesQueue.forEach(function (oElement) {
initializeLanguage(oElement.sLanguage, oElement.oConfig, oElement... | javascript | function onLanguageInitialized(sLanguage, resolve, hyphenateMethod) {
oHyphenateMethods[sLanguage] = hyphenateMethod;
oHyphenationInstance.bIsInitialized = true;
if (aLanguagesQueue.length > 0) {
aLanguagesQueue.forEach(function (oElement) {
initializeLanguage(oElement.sLanguage, oElement.oConfig, oElement... | [
"function",
"onLanguageInitialized",
"(",
"sLanguage",
",",
"resolve",
",",
"hyphenateMethod",
")",
"{",
"oHyphenateMethods",
"[",
"sLanguage",
"]",
"=",
"hyphenateMethod",
";",
"oHyphenationInstance",
".",
"bIsInitialized",
"=",
"true",
";",
"if",
"(",
"aLanguagesQ... | A callback for when language initialization is ready.
@param {string} sLanguage What language was initialized
@param {function} resolve Callback to resolve the promise created on initialize
@param {string} hyphenateMethod Is it asm or wasm
@private | [
"A",
"callback",
"for",
"when",
"language",
"initialization",
"is",
"ready",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/hyphenation/Hyphenation.js#L169-L182 | train | This function is called when the language is initialized. It will call the initializeLanguage function of all languages in the queue. | [
30522,
3853,
2006,
25023,
6692,
3351,
5498,
20925,
3550,
1006,
21435,
6692,
3351,
1010,
10663,
1010,
1044,
22571,
10222,
3686,
11368,
6806,
2094,
1007,
1063,
2821,
22571,
10222,
3686,
11368,
6806,
5104,
1031,
21435,
6692,
3351,
1033,
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/view/MainViewManager.js | _loadViewState | function _loadViewState(e) {
// file root is appended for each project
var panes,
promises = [],
context = { location : { scope: "user",
layer: "project" } },
state = PreferencesManager.getViewState(PREFS_NAME, context);
f... | javascript | function _loadViewState(e) {
// file root is appended for each project
var panes,
promises = [],
context = { location : { scope: "user",
layer: "project" } },
state = PreferencesManager.getViewState(PREFS_NAME, context);
f... | [
"function",
"_loadViewState",
"(",
"e",
")",
"{",
"// file root is appended for each project",
"var",
"panes",
",",
"promises",
"=",
"[",
"]",
",",
"context",
"=",
"{",
"location",
":",
"{",
"scope",
":",
"\"user\"",
",",
"layer",
":",
"\"project\"",
"}",
"}... | Loads the workingset state
@private | [
"Loads",
"the",
"workingset",
"state"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1448-L1561 | train | Load the view state | [
30522,
3853,
1035,
7170,
8584,
9153,
2618,
1006,
1041,
1007,
1063,
1013,
1013,
5371,
7117,
2003,
10439,
21945,
2005,
2169,
2622,
13075,
6090,
2229,
1010,
10659,
1027,
1031,
1033,
1010,
6123,
1027,
1063,
3295,
1024,
1063,
9531,
1024,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/preferences/PreferencesBase.js | function (id, scope, promise, addBefore) {
var shadowScopeOrder = this._defaults._shadowScopeOrder,
shadowEntry,
index,
isPending = false,
self = this;
scope.on(PREFERENCE_CHANGE + ".prefsys", function (e, data) {
s... | javascript | function (id, scope, promise, addBefore) {
var shadowScopeOrder = this._defaults._shadowScopeOrder,
shadowEntry,
index,
isPending = false,
self = this;
scope.on(PREFERENCE_CHANGE + ".prefsys", function (e, data) {
s... | [
"function",
"(",
"id",
",",
"scope",
",",
"promise",
",",
"addBefore",
")",
"{",
"var",
"shadowScopeOrder",
"=",
"this",
".",
"_defaults",
".",
"_shadowScopeOrder",
",",
"shadowEntry",
",",
"index",
",",
"isPending",
"=",
"false",
",",
"self",
"=",
"this",... | @private
Schedules the new Scope to be added the scope order in the specified
location once the promise is resolved. Context's _shadowScopeOrder is
used to keep track of the order in which the scope should appear. If
the scope which should precede this scope fails to load, then
_shadowScopeOrder will be searched for t... | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1445-L1507 | train | Add a scope to the scope order | [
30522,
3853,
1006,
8909,
1010,
9531,
1010,
4872,
1010,
5587,
4783,
29278,
2063,
1007,
1063,
13075,
6281,
16186,
8551,
2121,
1027,
2023,
1012,
1035,
12398,
2015,
1012,
1035,
6281,
16186,
8551,
2121,
1010,
5192,
4765,
2854,
1010,
5950,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/core/services/layout/layout.js | directiveNormalize | function directiveNormalize(name) {
return name
.replace(PREFIX_REGEXP, '')
.replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
return offset ? letter.toUpperCase() : letter;
});
} | javascript | function directiveNormalize(name) {
return name
.replace(PREFIX_REGEXP, '')
.replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
return offset ? letter.toUpperCase() : letter;
});
} | [
"function",
"directiveNormalize",
"(",
"name",
")",
"{",
"return",
"name",
".",
"replace",
"(",
"PREFIX_REGEXP",
",",
"''",
")",
".",
"replace",
"(",
"SPECIAL_CHARS_REGEXP",
",",
"function",
"(",
"_",
",",
"separator",
",",
"letter",
",",
"offset",
")",
"{... | Converts snake_case to camelCase.
Also there is special case for Moz prefix starting with upper case letter.
@param name Name to normalize | [
"Converts",
"snake_case",
"to",
"camelCase",
".",
"Also",
"there",
"is",
"special",
"case",
"for",
"Moz",
"prefix",
"starting",
"with",
"upper",
"case",
"letter",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L156-L162 | train | Normalize a directive name | [
30522,
3853,
16449,
12131,
9067,
4697,
1006,
2171,
1007,
1063,
2709,
2171,
1012,
5672,
1006,
17576,
1035,
19723,
10288,
2361,
1010,
1005,
1005,
1007,
1012,
5672,
1006,
2569,
1035,
25869,
2015,
1035,
19723,
10288,
2361,
1010,
3853,
1006,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | dist/howler.js | function() {
var self = this;
var parent = self._parent;
// Reset all of the parameters of this sound.
self._muted = parent._muted;
self._loop = parent._loop;
self._volume = parent._volume;
self._rate = parent._rate;
self._seek = 0;
self._rateSeek = 0;
self._... | javascript | function() {
var self = this;
var parent = self._parent;
// Reset all of the parameters of this sound.
self._muted = parent._muted;
self._loop = parent._loop;
self._volume = parent._volume;
self._rate = parent._rate;
self._seek = 0;
self._rateSeek = 0;
self._... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"parent",
"=",
"self",
".",
"_parent",
";",
"// Reset all of the parameters of this sound.",
"self",
".",
"_muted",
"=",
"parent",
".",
"_muted",
";",
"self",
".",
"_loop",
"=",
"parent",
"... | Reset the parameters of this sound to the original state (for recycle).
@return {Sound} | [
"Reset",
"the",
"parameters",
"of",
"this",
"sound",
"to",
"the",
"original",
"state",
"(",
"for",
"recycle",
")",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L2233-L2252 | train | Returns a new sound object. | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
6687,
1027,
2969,
1012,
1035,
6687,
1025,
1013,
1013,
25141,
2035,
1997,
1996,
11709,
1997,
2023,
2614,
30524,
1035,
3872,
1025,
2969,
1012,
1035,
3446,
1027,
6687,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/BaseController.js | function(event) {
var sPreviousHash = History.getInstance().getPreviousHash();
if (sPreviousHash !== undefined) {
// The history contains a previous entry
if (sPreviousHash.indexOf("search/") === 0) {
this.getRouter().navTo("search", {searchParam: sPreviousHash.split("/")[1]}, false);
} el... | javascript | function(event) {
var sPreviousHash = History.getInstance().getPreviousHash();
if (sPreviousHash !== undefined) {
// The history contains a previous entry
if (sPreviousHash.indexOf("search/") === 0) {
this.getRouter().navTo("search", {searchParam: sPreviousHash.split("/")[1]}, false);
} el... | [
"function",
"(",
"event",
")",
"{",
"var",
"sPreviousHash",
"=",
"History",
".",
"getInstance",
"(",
")",
".",
"getPreviousHash",
"(",
")",
";",
"if",
"(",
"sPreviousHash",
"!==",
"undefined",
")",
"{",
"// The history contains a previous entry",
"if",
"(",
"s... | Event handler for navigating back.
It checks if there is a history entry. If yes, history.go(-1) will happen.
If not, it will replace the current entry of the browser history with the master route.
@public | [
"Event",
"handler",
"for",
"navigating",
"back",
".",
"It",
"checks",
"if",
"there",
"is",
"a",
"history",
"entry",
".",
"If",
"yes",
"history",
".",
"go",
"(",
"-",
"1",
")",
"will",
"happen",
".",
"If",
"not",
"it",
"will",
"replace",
"the",
"curre... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/BaseController.js#L90-L109 | train | This function is called when the history is being displayed | [
30522,
3853,
1006,
2724,
1007,
1063,
13075,
11867,
2890,
24918,
14949,
2232,
1027,
2381,
1012,
2131,
7076,
26897,
1006,
1007,
1012,
2131,
28139,
24918,
14949,
2232,
1006,
1007,
1025,
2065,
1006,
11867,
2890,
24918,
14949,
2232,
999,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jgraph/mxgraph | javascript/mxClient.js | function(element)
{
if (element.style != null)
{
element.style.cursor = '';
}
var children = element.childNodes;
if (children != null)
{
var childCount = children.length;
for (var i = 0; i < childCount; i += 1)
{
mxUtils.removeCursors(children[i]);... | javascript | function(element)
{
if (element.style != null)
{
element.style.cursor = '';
}
var children = element.childNodes;
if (children != null)
{
var childCount = children.length;
for (var i = 0; i < childCount; i += 1)
{
mxUtils.removeCursors(children[i]);... | [
"function",
"(",
"element",
")",
"{",
"if",
"(",
"element",
".",
"style",
"!=",
"null",
")",
"{",
"element",
".",
"style",
".",
"cursor",
"=",
"''",
";",
"}",
"var",
"children",
"=",
"element",
".",
"childNodes",
";",
"if",
"(",
"children",
"!=",
"... | Function: removeCursors
Removes the cursors from the style of the given DOM node and its
descendants.
Parameters:
element - DOM node to remove the cursor style from. | [
"Function",
":",
"removeCursors"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L2191-L2209 | train | Removes the cursor from the element | [
30522,
3853,
1006,
5783,
1007,
1063,
2065,
1006,
5783,
1012,
2806,
999,
1027,
19701,
1007,
1063,
5783,
1012,
2806,
1012,
12731,
25301,
2099,
1027,
1005,
1005,
1025,
1065,
13075,
2336,
1027,
5783,
1012,
2775,
3630,
6155,
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... | |
ColorlibHQ/AdminLTE | plugins/bootstrap-slider/bootstrap-slider.js | addOptionMethod | function addOptionMethod( PluginClass ) {
// don't overwrite original option method
if ( PluginClass.prototype.option ) {
return;
}
// option setter
PluginClass.prototype.option = function( opts ) {
// bail out if not an object
if ( !$.isPlainObject( opts ) ){
return;
... | javascript | function addOptionMethod( PluginClass ) {
// don't overwrite original option method
if ( PluginClass.prototype.option ) {
return;
}
// option setter
PluginClass.prototype.option = function( opts ) {
// bail out if not an object
if ( !$.isPlainObject( opts ) ){
return;
... | [
"function",
"addOptionMethod",
"(",
"PluginClass",
")",
"{",
"// don't overwrite original option method",
"if",
"(",
"PluginClass",
".",
"prototype",
".",
"option",
")",
"{",
"return",
";",
"}",
"// option setter",
"PluginClass",
".",
"prototype",
".",
"option",
"="... | -------------------------- addOptionMethod -------------------------- //
adds option method -> $().plugin('option', {...})
@param {Function} PluginClass - constructor class | [
"--------------------------",
"addOptionMethod",
"--------------------------",
"//",
"adds",
"option",
"method",
"-",
">",
"$",
"()",
".",
"plugin",
"(",
"option",
"{",
"...",
"}",
")"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-slider/bootstrap-slider.js#L81-L95 | train | add option method | [
30522,
3853,
5587,
7361,
3508,
11368,
6806,
2094,
1006,
13354,
2378,
26266,
1007,
1063,
1013,
1013,
2123,
1005,
1056,
2058,
26373,
2434,
5724,
4118,
2065,
1006,
13354,
2378,
26266,
1012,
8773,
1012,
5724,
1007,
1063,
2709,
1025,
1065,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | function(align, valign)
{
var dx = 0;
var dy = 0;
// Horizontal alignment
if (align == mxConstants.ALIGN_CENTER)
{
dx = -0.5;
}
else if (align == mxConstants.ALIGN_RIGHT)
{
dx = -1;
}
// Vertical alignment
if (valign == mxConstants.ALIGN_MIDDLE)
{
dy = -0.5;
}
else if (valign =... | javascript | function(align, valign)
{
var dx = 0;
var dy = 0;
// Horizontal alignment
if (align == mxConstants.ALIGN_CENTER)
{
dx = -0.5;
}
else if (align == mxConstants.ALIGN_RIGHT)
{
dx = -1;
}
// Vertical alignment
if (valign == mxConstants.ALIGN_MIDDLE)
{
dy = -0.5;
}
else if (valign =... | [
"function",
"(",
"align",
",",
"valign",
")",
"{",
"var",
"dx",
"=",
"0",
";",
"var",
"dy",
"=",
"0",
";",
"// Horizontal alignment",
"if",
"(",
"align",
"==",
"mxConstants",
".",
"ALIGN_CENTER",
")",
"{",
"dx",
"=",
"-",
"0.5",
";",
"}",
"else",
"... | Function: getAlignmentAsPoint
Returns an <mxPoint> that represents the horizontal and vertical alignment
for numeric computations. X is -0.5 for center, -1 for right and 0 for
left alignment. Y is -0.5 for middle, -1 for bottom and 0 for top
alignment. Default values for missing arguments is top, left. | [
"Function",
":",
"getAlignmentAsPoint"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L5705-L5731 | train | Returns the point of the given alignment and the given vertical alignment | [
30522,
3853,
1006,
25705,
1010,
11748,
23773,
1007,
1063,
13075,
1040,
2595,
1027,
1014,
1025,
13075,
1040,
2100,
1027,
1014,
1025,
1013,
1013,
9876,
12139,
2065,
1006,
25705,
1027,
1027,
25630,
8663,
12693,
3215,
1012,
25705,
1035,
2415,
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... | |
airbnb/enzyme | packages/enzyme/src/ShallowWrapper.js | validateOptions | function validateOptions(options) {
const {
lifecycleExperimental,
disableLifecycleMethods,
enableComponentDidUpdateOnSetState,
supportPrevContextArgumentOfComponentDidUpdate,
lifecycles,
} = options;
if (typeof lifecycleExperimental !== 'undefined' && typeof lifecycleExperimental !== 'boolean... | javascript | function validateOptions(options) {
const {
lifecycleExperimental,
disableLifecycleMethods,
enableComponentDidUpdateOnSetState,
supportPrevContextArgumentOfComponentDidUpdate,
lifecycles,
} = options;
if (typeof lifecycleExperimental !== 'undefined' && typeof lifecycleExperimental !== 'boolean... | [
"function",
"validateOptions",
"(",
"options",
")",
"{",
"const",
"{",
"lifecycleExperimental",
",",
"disableLifecycleMethods",
",",
"enableComponentDidUpdateOnSetState",
",",
"supportPrevContextArgumentOfComponentDidUpdate",
",",
"lifecycles",
",",
"}",
"=",
"options",
";"... | Ensure options passed to ShallowWrapper are valid. Throws otherwise.
@param {Object} options | [
"Ensure",
"options",
"passed",
"to",
"ShallowWrapper",
"are",
"valid",
".",
"Throws",
"otherwise",
"."
] | cd430eae95eba151f17e970ee77c18f09476de0e | https://github.com/airbnb/enzyme/blob/cd430eae95eba151f17e970ee77c18f09476de0e/packages/enzyme/src/ShallowWrapper.js#L79-L118 | train | Validate the provided options | [
30522,
3853,
9398,
3686,
7361,
9285,
1006,
7047,
1007,
1063,
9530,
3367,
1063,
2166,
23490,
10288,
4842,
14428,
15758,
1010,
4487,
19150,
15509,
23490,
11368,
6806,
5104,
1010,
9585,
9006,
29513,
3372,
4305,
8566,
17299,
3686,
5644,
8454,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/api/decodeGlobal.js | decodeGlobal | function decodeGlobal(output, result) {
var book = output.getBook();
var config = book.getConfig();
// Update config
config = decodeConfig(config, result.config);
book = book.set('config', config);
return output.set('book', book);
} | javascript | function decodeGlobal(output, result) {
var book = output.getBook();
var config = book.getConfig();
// Update config
config = decodeConfig(config, result.config);
book = book.set('config', config);
return output.set('book', book);
} | [
"function",
"decodeGlobal",
"(",
"output",
",",
"result",
")",
"{",
"var",
"book",
"=",
"output",
".",
"getBook",
"(",
")",
";",
"var",
"config",
"=",
"book",
".",
"getConfig",
"(",
")",
";",
"// Update config",
"config",
"=",
"decodeConfig",
"(",
"confi... | Decode changes from a JS API to a output object.
Only the configuration can be edited by plugin's hooks
@param {Output} output
@param {Object} result: result from API
@return {Output} | [
"Decode",
"changes",
"from",
"a",
"JS",
"API",
"to",
"a",
"output",
"object",
".",
"Only",
"the",
"configuration",
"can",
"be",
"edited",
"by",
"plugin",
"s",
"hooks"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/api/decodeGlobal.js#L11-L20 | train | Decode global data | [
30522,
3853,
21933,
3207,
23296,
16429,
2389,
1006,
6434,
1010,
2765,
1007,
1063,
13075,
2338,
1027,
6434,
1012,
2131,
8654,
1006,
1007,
1025,
13075,
9530,
8873,
2290,
1027,
2338,
1012,
2131,
8663,
8873,
2290,
1006,
1007,
1025,
1013,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | lib/dynamodb/converter.js | convertInput | function convertInput(data, options) {
options = options || {};
var type = typeOf(data);
if (type === 'Object') {
return formatMap(data, options);
} else if (type === 'Array') {
return formatList(data, options);
} else if (type === 'Set') {
return formatSet(data, options);
} el... | javascript | function convertInput(data, options) {
options = options || {};
var type = typeOf(data);
if (type === 'Object') {
return formatMap(data, options);
} else if (type === 'Array') {
return formatList(data, options);
} else if (type === 'Set') {
return formatSet(data, options);
} el... | [
"function",
"convertInput",
"(",
"data",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"var",
"type",
"=",
"typeOf",
"(",
"data",
")",
";",
"if",
"(",
"type",
"===",
"'Object'",
")",
"{",
"return",
"formatMap",
"(",
"data"... | Convert a JavaScript value to its equivalent DynamoDB AttributeValue type
@param data [any] The data to convert to a DynamoDB AttributeValue
@param options [map]
@option options convertEmptyValues [Boolean] Whether to automatically
convert empty strings, blobs,
and sets to `null`
@option options wrapNumbers [Boolean] ... | [
"Convert",
"a",
"JavaScript",
"value",
"to",
"its",
"equivalent",
"DynamoDB",
"AttributeValue",
"type"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/dynamodb/converter.js#L27-L56 | train | Converts an input to a format object | [
30522,
3853,
10463,
2378,
18780,
1006,
2951,
1010,
7047,
1007,
1063,
7047,
1027,
7047,
1064,
1064,
1063,
1065,
1025,
13075,
2828,
1027,
2828,
11253,
1006,
2951,
1007,
1025,
2065,
1006,
2828,
1027,
1027,
1027,
1005,
4874,
1005,
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... |
adobe/brackets | src/features/ParameterHintsManager.js | dismissHint | function dismissHint(editor) {
if (hintState.visible) {
$hintContainer.hide();
$hintContent.empty();
hintState = {};
if (editor) {
editor.off("cursorActivity.ParameterHinting", handleCursorActivity);
sessionEditor = null;
... | javascript | function dismissHint(editor) {
if (hintState.visible) {
$hintContainer.hide();
$hintContent.empty();
hintState = {};
if (editor) {
editor.off("cursorActivity.ParameterHinting", handleCursorActivity);
sessionEditor = null;
... | [
"function",
"dismissHint",
"(",
"editor",
")",
"{",
"if",
"(",
"hintState",
".",
"visible",
")",
"{",
"$hintContainer",
".",
"hide",
"(",
")",
";",
"$hintContent",
".",
"empty",
"(",
")",
";",
"hintState",
"=",
"{",
"}",
";",
"if",
"(",
"editor",
")"... | Dismiss the function hint. | [
"Dismiss",
"the",
"function",
"hint",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/ParameterHintsManager.js#L230-L244 | train | Dismisses the hint | [
30522,
3853,
19776,
10606,
2102,
1006,
3559,
1007,
1063,
2065,
1006,
20385,
12259,
1012,
5710,
1007,
1063,
1002,
9374,
8663,
18249,
2121,
1012,
5342,
1006,
1007,
1025,
1002,
9374,
8663,
6528,
2102,
1012,
4064,
1006,
1007,
1025,
30524,
1000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/components/animation.js | getPropertyType | function getPropertyType (el, property) {
var component;
var componentName;
var split;
var propertyName;
split = property.split('.');
componentName = split[0];
propertyName = split[1];
component = el.components[componentName] || components[componentName];
// Primitives.
if (!component) { return nu... | javascript | function getPropertyType (el, property) {
var component;
var componentName;
var split;
var propertyName;
split = property.split('.');
componentName = split[0];
propertyName = split[1];
component = el.components[componentName] || components[componentName];
// Primitives.
if (!component) { return nu... | [
"function",
"getPropertyType",
"(",
"el",
",",
"property",
")",
"{",
"var",
"component",
";",
"var",
"componentName",
";",
"var",
"split",
";",
"var",
"propertyName",
";",
"split",
"=",
"property",
".",
"split",
"(",
"'.'",
")",
";",
"componentName",
"=",
... | Given property name, check schema to see what type we are animating.
We just care whether the property is a vector. | [
"Given",
"property",
"name",
"check",
"schema",
"to",
"see",
"what",
"type",
"we",
"are",
"animating",
".",
"We",
"just",
"care",
"whether",
"the",
"property",
"is",
"a",
"vector",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/animation.js#L515-L537 | train | Get the type of a property in an element. | [
30522,
3853,
2131,
21572,
4842,
3723,
13874,
1006,
3449,
1010,
3200,
1007,
1063,
13075,
6922,
1025,
13075,
6922,
18442,
1025,
13075,
3975,
1025,
13075,
3200,
18442,
1025,
3975,
1027,
3200,
1012,
3975,
1006,
1005,
1012,
1005,
1007,
1025,
692... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jhipster/generator-jhipster | generators/utils.js | replaceContent | function replaceContent(args, generator) {
args.path = args.path || process.cwd();
const fullPath = path.join(args.path, args.file);
const re = args.regex ? new RegExp(args.pattern, 'g') : args.pattern;
let body = generator.fs.read(fullPath);
body = body.replace(re, args.content);
generator.fs... | javascript | function replaceContent(args, generator) {
args.path = args.path || process.cwd();
const fullPath = path.join(args.path, args.file);
const re = args.regex ? new RegExp(args.pattern, 'g') : args.pattern;
let body = generator.fs.read(fullPath);
body = body.replace(re, args.content);
generator.fs... | [
"function",
"replaceContent",
"(",
"args",
",",
"generator",
")",
"{",
"args",
".",
"path",
"=",
"args",
".",
"path",
"||",
"process",
".",
"cwd",
"(",
")",
";",
"const",
"fullPath",
"=",
"path",
".",
"join",
"(",
"args",
".",
"path",
",",
"args",
... | Replace content
@param {object} args argument object
@param {object} generator reference to the generator | [
"Replace",
"content"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/utils.js#L71-L80 | train | Replace content with the content | [
30522,
3853,
5672,
8663,
6528,
2102,
1006,
12098,
5620,
1010,
13103,
1007,
1063,
12098,
5620,
1012,
4130,
1027,
12098,
5620,
1012,
4130,
1064,
1064,
2832,
1012,
19296,
2094,
1006,
1007,
1025,
9530,
3367,
2440,
15069,
1027,
4130,
1012,
3693,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/reflection/BaseTreeModifier.js | function(vControl, sPropertyName, vBindingOrValue) {
var bIsBindingObject = vBindingOrValue && (vBindingOrValue.path || vBindingOrValue.parts);
var bIsBindingString = vBindingOrValue && typeof vBindingOrValue === "string" && vBindingOrValue.substring(0, 1) === "{" && vBindingOrValue.slice(-1) === "}";
var sOp... | javascript | function(vControl, sPropertyName, vBindingOrValue) {
var bIsBindingObject = vBindingOrValue && (vBindingOrValue.path || vBindingOrValue.parts);
var bIsBindingString = vBindingOrValue && typeof vBindingOrValue === "string" && vBindingOrValue.substring(0, 1) === "{" && vBindingOrValue.slice(-1) === "}";
var sOp... | [
"function",
"(",
"vControl",
",",
"sPropertyName",
",",
"vBindingOrValue",
")",
"{",
"var",
"bIsBindingObject",
"=",
"vBindingOrValue",
"&&",
"(",
"vBindingOrValue",
".",
"path",
"||",
"vBindingOrValue",
".",
"parts",
")",
";",
"var",
"bIsBindingString",
"=",
"v... | Calls {@link sap.ui.core.util.reflection.BaseTreeModifier#setPropertyBinding} if the passed value is a
binding info object or binding string,
otherwise calls {@link sap.ui.core.util.reflection.BaseTreeModifier#setProperty}.
@param {sap.ui.base.ManagedObject|Element} vControl - Control representation
@param {string} sP... | [
"Calls",
"{",
"@link",
"sap",
".",
"ui",
".",
"core",
".",
"util",
".",
"reflection",
".",
"BaseTreeModifier#setPropertyBinding",
"}",
"if",
"the",
"passed",
"value",
"is",
"a",
"binding",
"info",
"object",
"or",
"binding",
"string",
"otherwise",
"calls",
"{... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js#L363-L369 | train | Sets the value of a property | [
30522,
3853,
1006,
18315,
12162,
13153,
1010,
11867,
18981,
15010,
18442,
1010,
1058,
8428,
4667,
2953,
10175,
5657,
1007,
1063,
13075,
20377,
8428,
4667,
16429,
20614,
1027,
1058,
8428,
4667,
2953,
10175,
5657,
1004,
1004,
1006,
1058,
8428,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/75_xlml.js | write_props_xlml | function write_props_xlml(wb/*:Workbook*/, opts)/*:string*/ {
var o/*:Array<string>*/ = [];
/* DocumentProperties */
if(wb.Props) o.push(xlml_write_docprops(wb.Props, opts));
/* CustomDocumentProperties */
if(wb.Custprops) o.push(xlml_write_custprops(wb.Props, wb.Custprops, opts));
return o.join("");
} | javascript | function write_props_xlml(wb/*:Workbook*/, opts)/*:string*/ {
var o/*:Array<string>*/ = [];
/* DocumentProperties */
if(wb.Props) o.push(xlml_write_docprops(wb.Props, opts));
/* CustomDocumentProperties */
if(wb.Custprops) o.push(xlml_write_custprops(wb.Props, wb.Custprops, opts));
return o.join("");
} | [
"function",
"write_props_xlml",
"(",
"wb",
"/*:Workbook*/",
",",
"opts",
")",
"/*:string*/",
"{",
"var",
"o",
"/*:Array<string>*/",
"=",
"[",
"]",
";",
"/* DocumentProperties */",
"if",
"(",
"wb",
".",
"Props",
")",
"o",
".",
"push",
"(",
"xlml_write_docprops"... | /* TODO | [
"/",
"*",
"TODO"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/75_xlml.js#L851-L858 | train | Write DocumentProperties and CustomDocumentProperties to xlml | [
30522,
3853,
4339,
1035,
24387,
1035,
28712,
19968,
1006,
25610,
1013,
1008,
1024,
2147,
8654,
1008,
1013,
1010,
23569,
2015,
1007,
1013,
1008,
1024,
5164,
1008,
1013,
1063,
13075,
1051,
1013,
1008,
1024,
9140,
1026,
5164,
1028,
1008,
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... |
adobe/brackets | src/utils/StringMatch.js | _prefixMatchResult | function _prefixMatchResult(str, query) {
var result = new SearchResult(str);
result.matchGoodness = -Number.MAX_VALUE;
if (str.substr(0, query.length) !== query) {
// Penalize for not matching case
result.matchGoodness *= 0.5;
}
if (DEBUG_SCORES) {
... | javascript | function _prefixMatchResult(str, query) {
var result = new SearchResult(str);
result.matchGoodness = -Number.MAX_VALUE;
if (str.substr(0, query.length) !== query) {
// Penalize for not matching case
result.matchGoodness *= 0.5;
}
if (DEBUG_SCORES) {
... | [
"function",
"_prefixMatchResult",
"(",
"str",
",",
"query",
")",
"{",
"var",
"result",
"=",
"new",
"SearchResult",
"(",
"str",
")",
";",
"result",
".",
"matchGoodness",
"=",
"-",
"Number",
".",
"MAX_VALUE",
";",
"if",
"(",
"str",
".",
"substr",
"(",
"0... | /*
If we short circuit normal matching to produce a prefix match,
this function will generate the appropriate SearchResult.
This function assumes that the prefix match check has already
been performed.
@param {string} str The string with the prefix match for the query
@param {string} query The query that matched the... | [
"/",
"*",
"If",
"we",
"short",
"circuit",
"normal",
"matching",
"to",
"produce",
"a",
"prefix",
"match",
"this",
"function",
"will",
"generate",
"the",
"appropriate",
"SearchResult",
".",
"This",
"function",
"assumes",
"that",
"the",
"prefix",
"match",
"check"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringMatch.js#L709-L738 | train | Prefix match result with query | [
30522,
3853,
1035,
17576,
18900,
2818,
6072,
11314,
1006,
2358,
2099,
1010,
23032,
1007,
1063,
13075,
2765,
1027,
2047,
3945,
6072,
11314,
1006,
2358,
2099,
1007,
1025,
2765,
1012,
2674,
24146,
2791,
1027,
1011,
2193,
1012,
4098,
1035,
3643... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/templating/render.js | renderTemplate | function renderTemplate(engine, filePath, content, context) {
context = context || {};
// Mutable objects to contains all blocks requiring post-processing
var blocks = {};
// Create nunjucks environment
var env = engine.toNunjucks(blocks);
// Replace shortcuts from plugin's blocks
content... | javascript | function renderTemplate(engine, filePath, content, context) {
context = context || {};
// Mutable objects to contains all blocks requiring post-processing
var blocks = {};
// Create nunjucks environment
var env = engine.toNunjucks(blocks);
// Replace shortcuts from plugin's blocks
content... | [
"function",
"renderTemplate",
"(",
"engine",
",",
"filePath",
",",
"content",
",",
"context",
")",
"{",
"context",
"=",
"context",
"||",
"{",
"}",
";",
"// Mutable objects to contains all blocks requiring post-processing",
"var",
"blocks",
"=",
"{",
"}",
";",
"// ... | Render a template
@param {TemplateEngine} engine
@param {String} filePath: absolute path for the loader
@param {String} content
@param {Object} context (optional)
@return {Promise<TemplateOutput>} | [
"Render",
"a",
"template"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/templating/render.js#L15-L42 | train | Render a template | [
30522,
3853,
17552,
18532,
15725,
1006,
3194,
1010,
5371,
15069,
1010,
4180,
1010,
6123,
1007,
1063,
6123,
1027,
6123,
1064,
1064,
1063,
1065,
1025,
1013,
1013,
14163,
10880,
5200,
2000,
3397,
2035,
5991,
9034,
2695,
1011,
6364,
13075,
5991... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
expressjs/express | examples/auth/index.js | authenticate | function authenticate(name, pass, fn) {
if (!module.parent) console.log('authenticating %s:%s', name, pass);
var user = users[name];
// query the db for the given username
if (!user) return fn(new Error('cannot find user'));
// apply the same algorithm to the POSTed password, applying
// the hash against th... | javascript | function authenticate(name, pass, fn) {
if (!module.parent) console.log('authenticating %s:%s', name, pass);
var user = users[name];
// query the db for the given username
if (!user) return fn(new Error('cannot find user'));
// apply the same algorithm to the POSTed password, applying
// the hash against th... | [
"function",
"authenticate",
"(",
"name",
",",
"pass",
",",
"fn",
")",
"{",
"if",
"(",
"!",
"module",
".",
"parent",
")",
"console",
".",
"log",
"(",
"'authenticating %s:%s'",
",",
"name",
",",
"pass",
")",
";",
"var",
"user",
"=",
"users",
"[",
"name... | Authenticate using our plain-object database of doom! | [
"Authenticate",
"using",
"our",
"plain",
"-",
"object",
"database",
"of",
"doom!"
] | dc538f6e810bd462c98ee7e6aae24c64d4b1da93 | https://github.com/expressjs/express/blob/dc538f6e810bd462c98ee7e6aae24c64d4b1da93/examples/auth/index.js#L58-L71 | train | authenticate the user | [
30522,
3853,
14469,
3686,
1006,
2171,
1010,
3413,
1010,
1042,
2078,
1007,
1063,
2065,
1006,
999,
11336,
1012,
6687,
1007,
10122,
1012,
8833,
1006,
1005,
14469,
5844,
1003,
1055,
1024,
1003,
1055,
1005,
1010,
2171,
1010,
3413,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | function(a, b)
{
if ((a == null && b != null) || (a != null && b == null) ||
(a != null && b != null && a.length != b.length))
{
return false;
}
else if (a != null && b != null)
{
// Counts keys in b to check if all values have been compared
var count = 0;
for (var key in b)
{
count... | javascript | function(a, b)
{
if ((a == null && b != null) || (a != null && b == null) ||
(a != null && b != null && a.length != b.length))
{
return false;
}
else if (a != null && b != null)
{
// Counts keys in b to check if all values have been compared
var count = 0;
for (var key in b)
{
count... | [
"function",
"(",
"a",
",",
"b",
")",
"{",
"if",
"(",
"(",
"a",
"==",
"null",
"&&",
"b",
"!=",
"null",
")",
"||",
"(",
"a",
"!=",
"null",
"&&",
"b",
"==",
"null",
")",
"||",
"(",
"a",
"!=",
"null",
"&&",
"b",
"!=",
"null",
"&&",
"a",
".",
... | Function: equalEntries
Returns true if all properties of the given objects are equal. Values
with NaN are equal to NaN and unequal to any other value.
Parameters:
a - First object to be compared.
b - Second object to be compared. | [
"Function",
":",
"equalEntries"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L3930-L3959 | train | Compares two values in a with the values in b. | [
30522,
3853,
1006,
1037,
1010,
1038,
1007,
1063,
2065,
1006,
1006,
1037,
1027,
1027,
19701,
1004,
1004,
1038,
999,
1027,
19701,
1007,
1064,
1064,
1006,
1037,
999,
1027,
19701,
1004,
1004,
1038,
1027,
1027,
19701,
1007,
1064,
1064,
1006,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/jszip.js | function(asUTF8) {
var result = getRawData(this);
if (result === null || typeof result === "undefined") {
return "";
}
// if the data is a base64 string, we decode it before checking the encoding !
if (this.options.base64) {
result = base64.decode(result);
}
if (asUTF8 && thi... | javascript | function(asUTF8) {
var result = getRawData(this);
if (result === null || typeof result === "undefined") {
return "";
}
// if the data is a base64 string, we decode it before checking the encoding !
if (this.options.base64) {
result = base64.decode(result);
}
if (asUTF8 && thi... | [
"function",
"(",
"asUTF8",
")",
"{",
"var",
"result",
"=",
"getRawData",
"(",
"this",
")",
";",
"if",
"(",
"result",
"===",
"null",
"||",
"typeof",
"result",
"===",
"\"undefined\"",
")",
"{",
"return",
"\"\"",
";",
"}",
"// if the data is a base64 string, we... | Transform this._data into a string.
@param {function} filter a function String -> String, applied if not null on the result.
@return {String} the string representing this._data. | [
"Transform",
"this",
".",
"_data",
"into",
"a",
"string",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jszip.js#L422-L445 | train | Returns the raw data of the file | [
30522,
3853,
1006,
2004,
4904,
2546,
2620,
1007,
1063,
13075,
2765,
1027,
2131,
2527,
21724,
6790,
1006,
2023,
1007,
1025,
2065,
1006,
2765,
1027,
1027,
1027,
19701,
1064,
1064,
2828,
11253,
2765,
1027,
1027,
1027,
1000,
6151,
28344,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js | sanitizeHistorySensitive | function sanitizeHistorySensitive(blockOfProperties) {
var elide = false;
for (var i = 0, n = blockOfProperties.length; i < n-1; ++i) {
var token = blockOfProperties[i];
if (':' === blockOfProperties[i+1]) {
elide = !(cssSchema[token].cssPropBits & CSS_PROP_BIT_ALLOWED_IN_LINK);
}
... | javascript | function sanitizeHistorySensitive(blockOfProperties) {
var elide = false;
for (var i = 0, n = blockOfProperties.length; i < n-1; ++i) {
var token = blockOfProperties[i];
if (':' === blockOfProperties[i+1]) {
elide = !(cssSchema[token].cssPropBits & CSS_PROP_BIT_ALLOWED_IN_LINK);
}
... | [
"function",
"sanitizeHistorySensitive",
"(",
"blockOfProperties",
")",
"{",
"var",
"elide",
"=",
"false",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"n",
"=",
"blockOfProperties",
".",
"length",
";",
"i",
"<",
"n",
"-",
"1",
";",
"++",
"i",
")",
"{"... | Given a series of sanitized tokens, removes any properties that would
leak user history if allowed to style links differently depending on
whether the linked URL is in the user's browser history.
@param {Array.<string>} blockOfProperties | [
"Given",
"a",
"series",
"of",
"sanitized",
"tokens",
"removes",
"any",
"properties",
"that",
"would",
"leak",
"user",
"history",
"if",
"allowed",
"to",
"style",
"links",
"differently",
"depending",
"on",
"whether",
"the",
"linked",
"URL",
"is",
"in",
"the",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js#L1493-L1504 | train | Sanitize history sensitive | [
30522,
3853,
2624,
25090,
4371,
24158,
7062,
5054,
28032,
3512,
1006,
3796,
11253,
21572,
4842,
7368,
1007,
1063,
13075,
12005,
3207,
1027,
6270,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1010,
1050,
1027,
3796,
11253,
21572,
4842,
7368,
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/language/HTMLUtils.js | findBlocks | function findBlocks(editor, modeName) {
// Start scanning from beginning of file
var ctx = TokenUtils.getInitialContext(editor._codeMirror, {line: 0, ch: 0}),
blocks = [],
currentBlock = null,
inBlock = false,
outerMode = editor._codeMirror.getMode(),
... | javascript | function findBlocks(editor, modeName) {
// Start scanning from beginning of file
var ctx = TokenUtils.getInitialContext(editor._codeMirror, {line: 0, ch: 0}),
blocks = [],
currentBlock = null,
inBlock = false,
outerMode = editor._codeMirror.getMode(),
... | [
"function",
"findBlocks",
"(",
"editor",
",",
"modeName",
")",
"{",
"// Start scanning from beginning of file",
"var",
"ctx",
"=",
"TokenUtils",
".",
"getInitialContext",
"(",
"editor",
".",
"_codeMirror",
",",
"{",
"line",
":",
"0",
",",
"ch",
":",
"0",
"}",
... | Returns an Array of info about all blocks whose token mode name matches that passed in,
in the given Editor's HTML document (assumes the Editor contains HTML text).
@param {!Editor} editor - the editor containing the HTML text
@param {string} modeName - the mode name of the tokens to look for
@return {Array.<{start:{li... | [
"Returns",
"an",
"Array",
"of",
"info",
"about",
"all",
"blocks",
"whose",
"token",
"mode",
"name",
"matches",
"that",
"passed",
"in",
"in",
"the",
"given",
"Editor",
"s",
"HTML",
"document",
"(",
"assumes",
"the",
"Editor",
"contains",
"HTML",
"text",
")"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLUtils.js#L518-L559 | train | Find blocks in the current file | [
30522,
3853,
2424,
23467,
2015,
1006,
3559,
1010,
5549,
18442,
1007,
1063,
1013,
1013,
2707,
13722,
2013,
2927,
1997,
5371,
13075,
14931,
2595,
1027,
19204,
21823,
4877,
1012,
2131,
5498,
20925,
8663,
18209,
1006,
3559,
1012,
1035,
3642,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (_callback)
{
Strophe.error("Server did not send any auth methods");
this._conn._changeConnectStatus(Strophe.Status.CONNFAIL, "Server did not send any auth methods");
if (_callback) {
_callback = _callback.bind(this._conn);
_callback();
}
... | javascript | function (_callback)
{
Strophe.error("Server did not send any auth methods");
this._conn._changeConnectStatus(Strophe.Status.CONNFAIL, "Server did not send any auth methods");
if (_callback) {
_callback = _callback.bind(this._conn);
_callback();
}
... | [
"function",
"(",
"_callback",
")",
"{",
"Strophe",
".",
"error",
"(",
"\"Server did not send any auth methods\"",
")",
";",
"this",
".",
"_conn",
".",
"_changeConnectStatus",
"(",
"Strophe",
".",
"Status",
".",
"CONNFAIL",
",",
"\"Server did not send any auth methods\... | PrivateFunction: _no_auth_received
Called on stream start/restart when no stream:features
has been received. | [
"PrivateFunction",
":",
"_no_auth_received"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L5057-L5066 | train | Send any auth methods to the server | [
30522,
3853,
1006,
1035,
2655,
5963,
1007,
1063,
2358,
18981,
5369,
1012,
7561,
1006,
1000,
8241,
2106,
2025,
4604,
2151,
8740,
2705,
4725,
1000,
1007,
1025,
2023,
1012,
1035,
9530,
2078,
1012,
1035,
2689,
8663,
2638,
16649,
29336,
2271,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(element, event, selector, callback) {
return function(e) {
//same event
var callbackObjs = delegates[element._mid][event];
var handlerQueue = [];
var target = e.target;
var selectorAlls = {};
for (; target && target !== document; target = target.parentNode) {
if (target === element) {
... | javascript | function(element, event, selector, callback) {
return function(e) {
//same event
var callbackObjs = delegates[element._mid][event];
var handlerQueue = [];
var target = e.target;
var selectorAlls = {};
for (; target && target !== document; target = target.parentNode) {
if (target === element) {
... | [
"function",
"(",
"element",
",",
"event",
",",
"selector",
",",
"callback",
")",
"{",
"return",
"function",
"(",
"e",
")",
"{",
"//same event",
"var",
"callbackObjs",
"=",
"delegates",
"[",
"element",
".",
"_mid",
"]",
"[",
"event",
"]",
";",
"var",
"h... | 返回事件委托的wrap事件回调 | [
"返回事件委托的wrap事件回调"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/hello-mui/js/mui.js#L597-L649 | train | The event handler function | [
30522,
3853,
1006,
5783,
1010,
2724,
1010,
27000,
1010,
2655,
5963,
1007,
1063,
2709,
3853,
1006,
1041,
1007,
1063,
1013,
1013,
2168,
2724,
13075,
2655,
5963,
16429,
22578,
1027,
10284,
1031,
5783,
1012,
1035,
3054,
1033,
1031,
2724,
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... | |
aframevr/aframe | src/core/component.js | function (value, clobber) {
var newAttrValue;
var tempObject;
var property;
if (value === undefined) { return; }
// If null value is the new attribute value, make the attribute value falsy.
if (value === null) {
if (this.isObjectBased && this.attrValue) {
this.objectPool.recycle(... | javascript | function (value, clobber) {
var newAttrValue;
var tempObject;
var property;
if (value === undefined) { return; }
// If null value is the new attribute value, make the attribute value falsy.
if (value === null) {
if (this.isObjectBased && this.attrValue) {
this.objectPool.recycle(... | [
"function",
"(",
"value",
",",
"clobber",
")",
"{",
"var",
"newAttrValue",
";",
"var",
"tempObject",
";",
"var",
"property",
";",
"if",
"(",
"value",
"===",
"undefined",
")",
"{",
"return",
";",
"}",
"// If null value is the new attribute value, make the attribute... | Update the cache of the pre-parsed attribute value.
@param {string} value - New data.
@param {boolean } clobber - Whether to wipe out and replace previous data. | [
"Update",
"the",
"cache",
"of",
"the",
"pre",
"-",
"parsed",
"attribute",
"value",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/component.js#L186-L227 | train | Updates the attrValue object with the new value. | [
30522,
3853,
1006,
3643,
1010,
18856,
16429,
5677,
1007,
1063,
13075,
2047,
19321,
26585,
5657,
1025,
13075,
13657,
2497,
20614,
1025,
13075,
3200,
1025,
2065,
1006,
3643,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
2709,
1025,
1065,
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... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/type/Time.js | getErrorMessage | function getErrorMessage(oType) {
return sap.ui.getCore().getLibraryResourceBundle().getText("EnterTime",
[oType.formatValue(oDemoTime, "string")]);
} | javascript | function getErrorMessage(oType) {
return sap.ui.getCore().getLibraryResourceBundle().getText("EnterTime",
[oType.formatValue(oDemoTime, "string")]);
} | [
"function",
"getErrorMessage",
"(",
"oType",
")",
"{",
"return",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getLibraryResourceBundle",
"(",
")",
".",
"getText",
"(",
"\"EnterTime\"",
",",
"[",
"oType",
".",
"formatValue",
"(",
"oDemoTime",
",",
"\"s... | Returns the locale-dependent error message.
@param {sap.ui.model.odata.type.Time} oType
the type
@returns {string}
the locale-dependent error message
@private | [
"Returns",
"the",
"locale",
"-",
"dependent",
"error",
"message",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/Time.js#L36-L39 | train | Returns the error message for the given type. | [
30522,
3853,
2131,
2121,
29165,
7834,
3736,
3351,
1006,
27178,
18863,
1007,
1063,
2709,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
1012,
2131,
29521,
19848,
16363,
6499,
3126,
3401,
27265,
2571,
1006,
1007,
1012,
2131,
18209,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/JavaScriptCodeHints/main.js | installEditorListeners | function installEditorListeners(editor, previousEditor) {
// always clean up cached scope and hint info
resetCachedHintContext();
if (!jsHintsEnabled) {
return;
}
if (editor && HintUtils.isSupportedLanguage(LanguageManager.getLanguageForPath(... | javascript | function installEditorListeners(editor, previousEditor) {
// always clean up cached scope and hint info
resetCachedHintContext();
if (!jsHintsEnabled) {
return;
}
if (editor && HintUtils.isSupportedLanguage(LanguageManager.getLanguageForPath(... | [
"function",
"installEditorListeners",
"(",
"editor",
",",
"previousEditor",
")",
"{",
"// always clean up cached scope and hint info",
"resetCachedHintContext",
"(",
")",
";",
"if",
"(",
"!",
"jsHintsEnabled",
")",
"{",
"return",
";",
"}",
"if",
"(",
"editor",
"&&",... | /*
Connects to the given editor, creating a new Session & adding listeners
@param {?Editor} editor - editor context on which to listen for
changes. If null, 'session' is cleared.
@param {?Editor} previousEditor - the previous editor | [
"/",
"*",
"Connects",
"to",
"the",
"given",
"editor",
"creating",
"a",
"new",
"Session",
"&",
"adding",
"listeners"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptCodeHints/main.js#L659-L679 | train | install editor listeners | [
30522,
3853,
5361,
15660,
9863,
24454,
2015,
1006,
3559,
1010,
3025,
2098,
15660,
1007,
1063,
1013,
1013,
2467,
4550,
2039,
17053,
2094,
9531,
1998,
9374,
18558,
25141,
3540,
7690,
10606,
13535,
28040,
18413,
1006,
1007,
1025,
2065,
1006,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/prefer-arrow-callback.js | getCallbackInfo | function getCallbackInfo(node) {
const retv = { isCallback: false, isLexicalThis: false };
let currentNode = node;
let parent = node.parent;
while (currentNode) {
switch (parent.type) {
// Checks parents recursively.
case "LogicalExpression":
case "Conditio... | javascript | function getCallbackInfo(node) {
const retv = { isCallback: false, isLexicalThis: false };
let currentNode = node;
let parent = node.parent;
while (currentNode) {
switch (parent.type) {
// Checks parents recursively.
case "LogicalExpression":
case "Conditio... | [
"function",
"getCallbackInfo",
"(",
"node",
")",
"{",
"const",
"retv",
"=",
"{",
"isCallback",
":",
"false",
",",
"isLexicalThis",
":",
"false",
"}",
";",
"let",
"currentNode",
"=",
"node",
";",
"let",
"parent",
"=",
"node",
".",
"parent",
";",
"while",
... | Checkes whether or not a given node is a callback.
@param {ASTNode} node - A node to check.
@returns {Object}
{boolean} retv.isCallback - `true` if the node is a callback.
{boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`. | [
"Checkes",
"whether",
"or",
"not",
"a",
"given",
"node",
"is",
"a",
"callback",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-arrow-callback.js#L65-L116 | train | Returns the callback info for a node | [
30522,
3853,
2131,
9289,
20850,
8684,
2378,
14876,
1006,
13045,
1007,
1063,
9530,
3367,
2128,
9189,
1027,
1063,
2003,
9289,
20850,
8684,
1024,
6270,
1010,
8842,
9048,
9289,
15222,
2015,
1024,
6270,
1065,
1025,
2292,
2783,
3630,
3207,
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/view/WorkspaceManager.js | updateResizeLimits | function updateResizeLimits() {
var editorAreaHeight = $editorHolder.height();
$editorHolder.siblings().each(function (i, elem) {
var $elem = $(elem);
if ($elem.css("display") === "none") {
$elem.data("maxsize", editorAreaHeight);
} else {
... | javascript | function updateResizeLimits() {
var editorAreaHeight = $editorHolder.height();
$editorHolder.siblings().each(function (i, elem) {
var $elem = $(elem);
if ($elem.css("display") === "none") {
$elem.data("maxsize", editorAreaHeight);
} else {
... | [
"function",
"updateResizeLimits",
"(",
")",
"{",
"var",
"editorAreaHeight",
"=",
"$editorHolder",
".",
"height",
"(",
")",
";",
"$editorHolder",
".",
"siblings",
"(",
")",
".",
"each",
"(",
"function",
"(",
"i",
",",
"elem",
")",
"{",
"var",
"$elem",
"="... | Updates panel resize limits to disallow making panels big enough to shrink editor area below 0 | [
"Updates",
"panel",
"resize",
"limits",
"to",
"disallow",
"making",
"panels",
"big",
"enough",
"to",
"shrink",
"editor",
"area",
"below",
"0"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/WorkspaceManager.js#L91-L102 | train | update resize limits | [
30522,
3853,
10651,
6072,
4697,
17960,
12762,
1006,
1007,
1063,
13075,
3559,
12069,
4430,
7416,
13900,
1027,
1002,
3559,
14528,
1012,
4578,
1006,
1007,
1025,
1002,
3559,
14528,
1012,
9504,
1006,
1007,
1012,
2169,
1006,
3853,
1006,
1045,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.