repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
semantic-release/semantic-release | lib/git.js | repoUrl | async function repoUrl(execaOpts) {
try {
return await execa.stdout('git', ['config', '--get', 'remote.origin.url'], execaOpts);
} catch (error) {
debug(error);
}
} | javascript | async function repoUrl(execaOpts) {
try {
return await execa.stdout('git', ['config', '--get', 'remote.origin.url'], execaOpts);
} catch (error) {
debug(error);
}
} | [
"async",
"function",
"repoUrl",
"(",
"execaOpts",
")",
"{",
"try",
"{",
"return",
"await",
"execa",
".",
"stdout",
"(",
"'git'",
",",
"[",
"'config'",
",",
"'--get'",
",",
"'remote.origin.url'",
"]",
",",
"execaOpts",
")",
";",
"}",
"catch",
"(",
"error"... | Get the repository remote URL.
@param {Object} [execaOpts] Options to pass to `execa`.
@return {string} The value of the remote git URL. | [
"Get",
"the",
"repository",
"remote",
"URL",
"."
] | edf382f88838ed543c0b76cb6c914cca1fc1ddd1 | https://github.com/semantic-release/semantic-release/blob/edf382f88838ed543c0b76cb6c914cca1fc1ddd1/lib/git.js#L89-L95 | train | Get the remote url of the node_modules repo | [
30522,
2004,
6038,
2278,
3853,
16360,
8162,
2140,
1006,
4654,
19281,
7361,
3215,
1007,
1063,
3046,
1063,
2709,
26751,
4654,
19281,
1012,
2358,
26797,
2102,
1006,
1005,
21025,
2102,
1005,
1010,
1031,
1005,
9530,
8873,
2290,
1005,
1010,
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... |
apache/incubator-echarts | src/layout/barGrid.js | getValueAxisStart | function getValueAxisStart(baseAxis, valueAxis, stacked) {
var extent = valueAxis.getGlobalExtent();
var min;
var max;
if (extent[0] > extent[1]) {
min = extent[1];
max = extent[0];
}
else {
min = extent[0];
max = extent[1];
}
var valueStart = valueAxis.t... | javascript | function getValueAxisStart(baseAxis, valueAxis, stacked) {
var extent = valueAxis.getGlobalExtent();
var min;
var max;
if (extent[0] > extent[1]) {
min = extent[1];
max = extent[0];
}
else {
min = extent[0];
max = extent[1];
}
var valueStart = valueAxis.t... | [
"function",
"getValueAxisStart",
"(",
"baseAxis",
",",
"valueAxis",
",",
"stacked",
")",
"{",
"var",
"extent",
"=",
"valueAxis",
".",
"getGlobalExtent",
"(",
")",
";",
"var",
"min",
";",
"var",
"max",
";",
"if",
"(",
"extent",
"[",
"0",
"]",
">",
"exte... | See cases in `test/bar-start.html` and `#7412`, `#8747`. | [
"See",
"cases",
"in",
"test",
"/",
"bar",
"-",
"start",
".",
"html",
"and",
"#7412",
"#8747",
"."
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/layout/barGrid.js#L427-L445 | train | Get the start of the value axis | [
30522,
3853,
2131,
10175,
5657,
8528,
14643,
7559,
2102,
1006,
2918,
8528,
2483,
1010,
3643,
8528,
2483,
1010,
16934,
1007,
1063,
13075,
6698,
1027,
3643,
8528,
2483,
1012,
2131,
23296,
16429,
9453,
18413,
4765,
1006,
1007,
1025,
13075,
811... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/operation.js | modulate | function modulate (options) {
if (!is.plainObject(options)) {
throw is.invalidParameterError('options', 'plain object', options);
}
if ('brightness' in options) {
if (is.number(options.brightness) && options.brightness >= 0) {
this.options.brightness = options.brightness;
} else {
throw is... | javascript | function modulate (options) {
if (!is.plainObject(options)) {
throw is.invalidParameterError('options', 'plain object', options);
}
if ('brightness' in options) {
if (is.number(options.brightness) && options.brightness >= 0) {
this.options.brightness = options.brightness;
} else {
throw is... | [
"function",
"modulate",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"is",
".",
"plainObject",
"(",
"options",
")",
")",
"{",
"throw",
"is",
".",
"invalidParameterError",
"(",
"'options'",
",",
"'plain object'",
",",
"options",
")",
";",
"}",
"if",
"(",
"... | Transforms the image using brightness, saturation and hue rotation.
@example
sharp(input)
.modulate({
brightness: 2 // increase lightness by a factor of 2
});
sharp(input)
.modulate({
hue: 180 // hue-rotate by 180 degrees
});
// decreate brightness and saturation while also hue-rotating by 90 degrees
sharp(input)
.m... | [
"Transforms",
"the",
"image",
"using",
"brightness",
"saturation",
"and",
"hue",
"rotation",
"."
] | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/operation.js#L446-L472 | train | Modulate the image by the given parameters | [
30522,
3853,
16913,
9869,
1006,
7047,
1007,
1063,
2065,
1006,
999,
2003,
1012,
5810,
16429,
20614,
1006,
7047,
1007,
1007,
1063,
5466,
2003,
1012,
19528,
28689,
22828,
2121,
29165,
1006,
1005,
7047,
1005,
1010,
1005,
5810,
4874,
1005,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/cli-engine.js | calculateStatsPerRun | function calculateStatsPerRun(results) {
return results.reduce((stat, result) => {
stat.errorCount += result.errorCount;
stat.warningCount += result.warningCount;
stat.fixableErrorCount += result.fixableErrorCount;
stat.fixableWarningCount += result.fixableWarningCount;
retur... | javascript | function calculateStatsPerRun(results) {
return results.reduce((stat, result) => {
stat.errorCount += result.errorCount;
stat.warningCount += result.warningCount;
stat.fixableErrorCount += result.fixableErrorCount;
stat.fixableWarningCount += result.fixableWarningCount;
retur... | [
"function",
"calculateStatsPerRun",
"(",
"results",
")",
"{",
"return",
"results",
".",
"reduce",
"(",
"(",
"stat",
",",
"result",
")",
"=>",
"{",
"stat",
".",
"errorCount",
"+=",
"result",
".",
"errorCount",
";",
"stat",
".",
"warningCount",
"+=",
"result... | It will calculate the error and warning count for collection of results from all files
@param {Object[]} results - Collection of messages from all the files
@returns {Object} Contains the stats
@private | [
"It",
"will",
"calculate",
"the",
"error",
"and",
"warning",
"count",
"for",
"collection",
"of",
"results",
"from",
"all",
"files"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/cli-engine.js#L140-L153 | train | Calculates the stats per run for a given set of results | [
30522,
3853,
18422,
9153,
3215,
4842,
15532,
1006,
3463,
1007,
1063,
2709,
3463,
1012,
5547,
1006,
1006,
28093,
1010,
2765,
1007,
1027,
1028,
1063,
28093,
1012,
7561,
3597,
16671,
1009,
1027,
2765,
1012,
7561,
3597,
16671,
1025,
28093,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/plugins/Performance.js | _createTimelineGrid | function _createTimelineGrid(filterOptions) {
var gridParent = document.getElementById('sapUiSupportPerfHeaderTimelineBarWrapper');
var gridLineNumbers = Math.round(gridParent.offsetWidth / 10);
var filteredDuration = filterOptions.filterByTime.end - filterOptions.filterByTime.start;
var gridLineStepInTime ... | javascript | function _createTimelineGrid(filterOptions) {
var gridParent = document.getElementById('sapUiSupportPerfHeaderTimelineBarWrapper');
var gridLineNumbers = Math.round(gridParent.offsetWidth / 10);
var filteredDuration = filterOptions.filterByTime.end - filterOptions.filterByTime.start;
var gridLineStepInTime ... | [
"function",
"_createTimelineGrid",
"(",
"filterOptions",
")",
"{",
"var",
"gridParent",
"=",
"document",
".",
"getElementById",
"(",
"'sapUiSupportPerfHeaderTimelineBarWrapper'",
")",
";",
"var",
"gridLineNumbers",
"=",
"Math",
".",
"round",
"(",
"gridParent",
".",
... | /* =============================================================================================================
Timegrid
============================================================================================================= | [
"/",
"*",
"=============================================================================================================",
"Timegrid",
"============================================================================================================="
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/plugins/Performance.js#L826-L861 | train | Creates a grid of timeline items | [
30522,
3853,
1035,
3443,
7292,
4179,
16523,
3593,
1006,
11307,
7361,
9285,
1007,
1063,
13075,
8370,
19362,
4765,
1027,
6254,
1012,
2131,
12260,
3672,
3762,
3593,
1006,
1005,
20066,
27020,
6279,
6442,
4842,
2546,
4974,
8743,
14428,
4179,
823... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | generateLocale | function generateLocale(locale, localeData, baseCurrencies) {
// [ localeId, dateTime, number, currency, pluralCase ]
let data = stringify([
locale,
...getDateTimeTranslations(localeData),
...getDateTimeSettings(localeData),
...getNumberSettings(localeData),
...getCurrencySettings(locale, locale... | javascript | function generateLocale(locale, localeData, baseCurrencies) {
// [ localeId, dateTime, number, currency, pluralCase ]
let data = stringify([
locale,
...getDateTimeTranslations(localeData),
...getDateTimeSettings(localeData),
...getNumberSettings(localeData),
...getCurrencySettings(locale, locale... | [
"function",
"generateLocale",
"(",
"locale",
",",
"localeData",
",",
"baseCurrencies",
")",
"{",
"// [ localeId, dateTime, number, currency, pluralCase ]",
"let",
"data",
"=",
"stringify",
"(",
"[",
"locale",
",",
"...",
"getDateTimeTranslations",
"(",
"localeData",
")"... | Generate file that contains basic locale data | [
"Generate",
"file",
"that",
"contains",
"basic",
"locale",
"data"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/gulp-tasks/cldr/extract.js#L94-L117 | train | Generates a locale code | [
30522,
3853,
9699,
4135,
9289,
2063,
1006,
2334,
2063,
1010,
2334,
11960,
2696,
1010,
2918,
10841,
14343,
14767,
1007,
1063,
1013,
1013,
1031,
2334,
7416,
2094,
1010,
3058,
7292,
1010,
2193,
1010,
9598,
1010,
13994,
18382,
1033,
2292,
2951,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/relay | packages/relay-compiler/language/javascript/RelayFlowBabelFactories.js | intersectionTypeAnnotation | function intersectionTypeAnnotation(types: Array<BabelAST>): BabelAST {
invariant(
types.length > 0,
'RelayFlowBabelFactories: cannot create an intersection of 0 types',
);
return types.length === 1 ? types[0] : t.intersectionTypeAnnotation(types);
} | javascript | function intersectionTypeAnnotation(types: Array<BabelAST>): BabelAST {
invariant(
types.length > 0,
'RelayFlowBabelFactories: cannot create an intersection of 0 types',
);
return types.length === 1 ? types[0] : t.intersectionTypeAnnotation(types);
} | [
"function",
"intersectionTypeAnnotation",
"(",
"types",
":",
"Array",
"<",
"BabelAST",
">",
")",
":",
"BabelAST",
"{",
"invariant",
"(",
"types",
".",
"length",
">",
"0",
",",
"'RelayFlowBabelFactories: cannot create an intersection of 0 types'",
",",
")",
";",
"ret... | Create an intersection type if needed.
TYPES[0] & TYPES[1] & ... | [
"Create",
"an",
"intersection",
"type",
"if",
"needed",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/language/javascript/RelayFlowBabelFactories.js#L66-L72 | train | Returns the intersection type annotation of the given types. | [
30522,
3853,
6840,
13874,
11639,
17287,
3508,
1006,
4127,
1024,
9140,
1026,
11561,
8523,
2102,
1028,
1007,
1024,
11561,
8523,
2102,
1063,
30524,
1056,
1012,
6840,
13874,
11639,
17287,
3508,
1006,
4127,
1007,
1025,
1065,
102,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.layout/src/sap/ui/layout/form/FormElement.js | _labelIsRequired | function _labelIsRequired(){
if (this.getRequired && this.getRequired()) {
return true;
}
var oFormElement = this.getParent();
var aFields = oFormElement.getFields();
for ( var i = 0; i < aFields.length; i++) {
var oField = aFields[i];
if (oField.getRequired && oField.getRequired() === true &&
... | javascript | function _labelIsRequired(){
if (this.getRequired && this.getRequired()) {
return true;
}
var oFormElement = this.getParent();
var aFields = oFormElement.getFields();
for ( var i = 0; i < aFields.length; i++) {
var oField = aFields[i];
if (oField.getRequired && oField.getRequired() === true &&
... | [
"function",
"_labelIsRequired",
"(",
")",
"{",
"if",
"(",
"this",
".",
"getRequired",
"&&",
"this",
".",
"getRequired",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"var",
"oFormElement",
"=",
"this",
".",
"getParent",
"(",
")",
";",
"var",
"aFields... | /*
overwrite Labels isRequired function to check if one of the fields in the element is required,
not only the one directly assigned. | [
"/",
"*",
"overwrite",
"Labels",
"isRequired",
"function",
"to",
"check",
"if",
"one",
"of",
"the",
"fields",
"in",
"the",
"element",
"is",
"required",
"not",
"only",
"the",
"one",
"directly",
"assigned",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.layout/src/sap/ui/layout/form/FormElement.js#L381-L400 | train | Returns true if the label is required | [
30522,
3853,
1035,
3830,
2483,
2890,
15549,
5596,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
2131,
2890,
15549,
5596,
1004,
1004,
2023,
1012,
2131,
2890,
15549,
5596,
1006,
1007,
1007,
1063,
2709,
2995,
1025,
1065,
13075,
1997,
2953,
10199,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(visible)
{
if (mxLog.window == null)
{
mxLog.init();
}
if (mxLog.window != null)
{
mxLog.window.setVisible(visible);
}
} | javascript | function(visible)
{
if (mxLog.window == null)
{
mxLog.init();
}
if (mxLog.window != null)
{
mxLog.window.setVisible(visible);
}
} | [
"function",
"(",
"visible",
")",
"{",
"if",
"(",
"mxLog",
".",
"window",
"==",
"null",
")",
"{",
"mxLog",
".",
"init",
"(",
")",
";",
"}",
"if",
"(",
"mxLog",
".",
"window",
"!=",
"null",
")",
"{",
"mxLog",
".",
"window",
".",
"setVisible",
"(",
... | Function: setVisible
Shows or hides the console. | [
"Function",
":",
"setVisible"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L881-L892 | train | Sets the visibility of the window | [
30522,
3853,
1006,
5710,
1007,
1063,
2065,
1006,
25630,
21197,
1012,
3332,
1027,
1027,
19701,
1007,
1063,
25630,
21197,
1012,
1999,
4183,
1006,
1007,
1025,
1065,
2065,
1006,
25630,
21197,
1012,
3332,
999,
1027,
19701,
1007,
1063,
25630,
211... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/json/encodeSummary.js | encodeSummary | function encodeSummary(summary) {
var file = summary.getFile();
var parts = summary.getParts();
return {
file: encodeFile(file),
parts: parts.map(encodeSummaryPart).toJS()
};
} | javascript | function encodeSummary(summary) {
var file = summary.getFile();
var parts = summary.getParts();
return {
file: encodeFile(file),
parts: parts.map(encodeSummaryPart).toJS()
};
} | [
"function",
"encodeSummary",
"(",
"summary",
")",
"{",
"var",
"file",
"=",
"summary",
".",
"getFile",
"(",
")",
";",
"var",
"parts",
"=",
"summary",
".",
"getParts",
"(",
")",
";",
"return",
"{",
"file",
":",
"encodeFile",
"(",
"file",
")",
",",
"par... | Encode a summary to JSON
@param {Summary}
@return {Object} | [
"Encode",
"a",
"summary",
"to",
"JSON"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/json/encodeSummary.js#L10-L18 | train | Encode a summary | [
30522,
3853,
4372,
23237,
2819,
7849,
2100,
1006,
12654,
1007,
1063,
13075,
5371,
1027,
12654,
1012,
2131,
8873,
2571,
1006,
1007,
1025,
13075,
3033,
1027,
12654,
1012,
2131,
26950,
1006,
1007,
1025,
2709,
1063,
5371,
1024,
4372,
16044,
887... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
BlackrockDigital/startbootstrap-sb-admin-2 | gulpfile.js | watchFiles | function watchFiles() {
gulp.watch("./scss/**/*", css);
gulp.watch("./js/**/*", js);
gulp.watch("./**/*.html", browserSyncReload);
} | javascript | function watchFiles() {
gulp.watch("./scss/**/*", css);
gulp.watch("./js/**/*", js);
gulp.watch("./**/*.html", browserSyncReload);
} | [
"function",
"watchFiles",
"(",
")",
"{",
"gulp",
".",
"watch",
"(",
"\"./scss/**/*\"",
",",
"css",
")",
";",
"gulp",
".",
"watch",
"(",
"\"./js/**/*\"",
",",
"js",
")",
";",
"gulp",
".",
"watch",
"(",
"\"./**/*.html\"",
",",
"browserSyncReload",
")",
";"... | Watch files | [
"Watch",
"files"
] | ddfaceb4a8e65a41f163e2fdc4eab49384b810a1 | https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/ddfaceb4a8e65a41f163e2fdc4eab49384b810a1/gulpfile.js#L128-L132 | train | Watches all files in the project. | [
30522,
3853,
3422,
8873,
4244,
1006,
1007,
1063,
26546,
1012,
3422,
1006,
1000,
1012,
1013,
8040,
4757,
1013,
1008,
1008,
1013,
1008,
1000,
1010,
20116,
2015,
1007,
1025,
26546,
1012,
3422,
1006,
1000,
1012,
1013,
1046,
2015,
1013,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/ProjectManager.js | _revertSelection | function _revertSelection(previousPath, switchToWorkingSet) {
model.setSelected(previousPath);
if (switchToWorkingSet) {
FileViewController.setFileViewFocus(FileViewController.WORKING_SET_VIEW);
}
} | javascript | function _revertSelection(previousPath, switchToWorkingSet) {
model.setSelected(previousPath);
if (switchToWorkingSet) {
FileViewController.setFileViewFocus(FileViewController.WORKING_SET_VIEW);
}
} | [
"function",
"_revertSelection",
"(",
"previousPath",
",",
"switchToWorkingSet",
")",
"{",
"model",
".",
"setSelected",
"(",
"previousPath",
")",
";",
"if",
"(",
"switchToWorkingSet",
")",
"{",
"FileViewController",
".",
"setFileViewFocus",
"(",
"FileViewController",
... | @private
Reverts to the previous selection (useful if there's an error).
@param {string|File} previousPath The previously selected path.
@param {boolean} switchToWorkingSet True if we need to switch focus to the Working Set | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L203-L208 | train | Revert selection to the current file | [
30522,
3853,
1035,
7065,
8743,
11246,
18491,
1006,
3025,
15069,
1010,
6942,
18790,
2953,
6834,
13462,
1007,
1063,
2944,
1012,
4520,
12260,
10985,
1006,
3025,
15069,
1007,
1025,
2065,
1006,
6942,
18790,
2953,
6834,
13462,
1007,
1063,
5371,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | tools/internal-rules/consistent-meta-messages.js | checkMetaMessages | function checkMetaMessages(context, exportsNode) {
if (exportsNode.type !== "ObjectExpression") {
// if the exported node is not the correct format, "internal-no-invalid-meta" will already report this.
return;
}
const metaProperty = getPropertyFromObject("meta", exportsNode);
const mes... | javascript | function checkMetaMessages(context, exportsNode) {
if (exportsNode.type !== "ObjectExpression") {
// if the exported node is not the correct format, "internal-no-invalid-meta" will already report this.
return;
}
const metaProperty = getPropertyFromObject("meta", exportsNode);
const mes... | [
"function",
"checkMetaMessages",
"(",
"context",
",",
"exportsNode",
")",
"{",
"if",
"(",
"exportsNode",
".",
"type",
"!==",
"\"ObjectExpression\"",
")",
"{",
"// if the exported node is not the correct format, \"internal-no-invalid-meta\" will already report this.",
"return",
... | Verifies that the meta.messages property is present.
TODO: check it has the correct value
@param {RuleContext} context The ESLint rule context.
@param {ASTNode} exportsNode ObjectExpression node that the rule exports.
@returns {void} | [
"Verifies",
"that",
"the",
"meta",
".",
"messages",
"property",
"is",
"present",
".",
"TODO",
":",
"check",
"it",
"has",
"the",
"correct",
"value"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/tools/internal-rules/consistent-meta-messages.js#L38-L54 | train | Checks if the exported node has a messages property | [
30522,
3853,
4638,
11368,
14074,
11488,
8449,
1006,
6123,
1010,
14338,
3630,
3207,
1007,
1063,
2065,
1006,
14338,
3630,
3207,
1012,
2828,
999,
1027,
1027,
1000,
4874,
10288,
20110,
3258,
1000,
1007,
1063,
1013,
1013,
2065,
1996,
15612,
1304... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
blueimp/jQuery-File-Upload | js/jquery.fileupload-ui.js | function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var $this = $(this),
progress = Math.floor(data.loaded / data.total * 100),
globalProgressNode = $this.find('.fileupload-progress'),
... | javascript | function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var $this = $(this),
progress = Math.floor(data.loaded / data.total * 100),
globalProgressNode = $this.find('.fileupload-progress'),
... | [
"function",
"(",
"e",
",",
"data",
")",
"{",
"if",
"(",
"e",
".",
"isDefaultPrevented",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"var",
"$this",
"=",
"$",
"(",
"this",
")",
",",
"progress",
"=",
"Math",
".",
"floor",
"(",
"data",
".",
"... | Callback for global upload progress events: | [
"Callback",
"for",
"global",
"upload",
"progress",
"events",
":"
] | 4586771d65482dc9678c7e48d245a1501bf96ff5 | https://github.com/blueimp/jQuery-File-Upload/blob/4586771d65482dc9678c7e48d245a1501bf96ff5/js/jquery.fileupload-ui.js#L299-L321 | train | update progress bar | [
30522,
3853,
1006,
1041,
1010,
2951,
1007,
1063,
2065,
1006,
1041,
1012,
2003,
3207,
7011,
11314,
28139,
15338,
2098,
1006,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
13075,
1002,
2023,
1027,
1002,
1006,
2023,
1007,
1010,
5082,
1027,
8785,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | tools/eslint-fuzzer.js | isolateBadAutofixPass | function isolateBadAutofixPass(originalText, config) {
let lastGoodText = originalText;
let currentText = originalText;
do {
let messages;
try {
messages = linter.verify(currentText, config);
} catch (err) {
return lastGoodTex... | javascript | function isolateBadAutofixPass(originalText, config) {
let lastGoodText = originalText;
let currentText = originalText;
do {
let messages;
try {
messages = linter.verify(currentText, config);
} catch (err) {
return lastGoodTex... | [
"function",
"isolateBadAutofixPass",
"(",
"originalText",
",",
"config",
")",
"{",
"let",
"lastGoodText",
"=",
"originalText",
";",
"let",
"currentText",
"=",
"originalText",
";",
"do",
"{",
"let",
"messages",
";",
"try",
"{",
"messages",
"=",
"linter",
".",
... | Runs multipass autofix one pass at a time to find the last good source text before a fatal error occurs
@param {string} originalText Syntactically valid source code that results in a syntax error or crash when autofixing with `config`
@param {Object} config The config to lint with
@returns {string} A possibly-modified ... | [
"Runs",
"multipass",
"autofix",
"one",
"pass",
"at",
"a",
"time",
"to",
"find",
"the",
"last",
"good",
"source",
"text",
"before",
"a",
"fatal",
"error",
"occurs"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/tools/eslint-fuzzer.js#L83-L105 | train | Aliquirer is a bit of a hack. | [
30522,
3853,
27152,
9024,
4887,
3406,
8873,
2595,
15194,
1006,
2434,
18209,
1010,
9530,
8873,
2290,
1007,
1063,
2292,
2197,
24146,
18209,
1027,
2434,
18209,
1025,
2292,
2783,
18209,
1027,
2434,
18209,
1025,
2079,
1063,
2292,
7696,
1025,
304... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/data/importer/index.js | function (file, importOptions = {}) {
var self = this;
// Step 1: Handle converting the file to usable data
return this.loadFile(file).then(function (importData) {
// Step 2: Let the importers pre-process the data
return self.preProcess(importData);
}).then(funct... | javascript | function (file, importOptions = {}) {
var self = this;
// Step 1: Handle converting the file to usable data
return this.loadFile(file).then(function (importData) {
// Step 2: Let the importers pre-process the data
return self.preProcess(importData);
}).then(funct... | [
"function",
"(",
"file",
",",
"importOptions",
"=",
"{",
"}",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Step 1: Handle converting the file to usable data",
"return",
"this",
".",
"loadFile",
"(",
"file",
")",
".",
"then",
"(",
"function",
"(",
"importData... | Import From File
The main method of the ImportManager, call this to kick everything off!
@param {File} file
@param {importOptions} importOptions to allow override of certain import features such as locking a user
@returns {Promise} | [
"Import",
"From",
"File",
"The",
"main",
"method",
"of",
"the",
"ImportManager",
"call",
"this",
"to",
"kick",
"everything",
"off!"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/data/importer/index.js#L356-L371 | train | Import the file into the correct type | [
30522,
3853,
1006,
5371,
1010,
12324,
7361,
9285,
1027,
1063,
1065,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
1013,
1013,
3357,
1015,
1024,
5047,
16401,
1996,
5371,
2000,
24013,
2951,
2709,
2023,
1012,
7170,
8873,
2571,
1006,
5371,
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/util/serializer/XMLViewSerializer.js | function (oControl) {
return oControl instanceof this._oWindow.sap.ui.core.mvc.View && oControl !== that._oView;
} | javascript | function (oControl) {
return oControl instanceof this._oWindow.sap.ui.core.mvc.View && oControl !== that._oView;
} | [
"function",
"(",
"oControl",
")",
"{",
"return",
"oControl",
"instanceof",
"this",
".",
"_oWindow",
".",
"sap",
".",
"ui",
".",
"core",
".",
"mvc",
".",
"View",
"&&",
"oControl",
"!==",
"that",
".",
"_oView",
";",
"}"
] | a function to understand if to skip aggregations | [
"a",
"function",
"to",
"understand",
"if",
"to",
"skip",
"aggregations"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/serializer/XMLViewSerializer.js#L60-L62 | train | Returns true if the control is a View or not. | [
30522,
3853,
1006,
1051,
8663,
13181,
2140,
1007,
1063,
2709,
1051,
8663,
13181,
2140,
6013,
11253,
2023,
1012,
1035,
27593,
22254,
5004,
1012,
20066,
1012,
21318,
1012,
4563,
1012,
19842,
2278,
1012,
3193,
1004,
1004,
1051,
8663,
13181,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ecomfe/zrender | src/mixin/Animatable.js | animateToShallow | function animateToShallow(animatable, path, source, target, time, delay, reverse) {
var objShallow = {};
var propertyCount = 0;
for (var name in target) {
if (!target.hasOwnProperty(name)) {
continue;
}
if (source[name] != null) {
if (isObject(target[name]) &... | javascript | function animateToShallow(animatable, path, source, target, time, delay, reverse) {
var objShallow = {};
var propertyCount = 0;
for (var name in target) {
if (!target.hasOwnProperty(name)) {
continue;
}
if (source[name] != null) {
if (isObject(target[name]) &... | [
"function",
"animateToShallow",
"(",
"animatable",
",",
"path",
",",
"source",
",",
"target",
",",
"time",
",",
"delay",
",",
"reverse",
")",
"{",
"var",
"objShallow",
"=",
"{",
"}",
";",
"var",
"propertyCount",
"=",
"0",
";",
"for",
"(",
"var",
"name"... | @param {string} path=''
@param {Object} source=animatable
@param {Object} target
@param {number} [time=500]
@param {number} [delay=0]
@param {boolean} [reverse] If `true`, animate
from the `target` to current state.
@example
// Animate position
el._animateToShallow({
position: [10, 10]
})
// Animate shape, style and ... | [
"@param",
"{",
"string",
"}",
"path",
"=",
"@param",
"{",
"Object",
"}",
"source",
"=",
"animatable",
"@param",
"{",
"Object",
"}",
"target",
"@param",
"{",
"number",
"}",
"[",
"time",
"=",
"500",
"]",
"@param",
"{",
"number",
"}",
"[",
"delay",
"=",... | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/mixin/Animatable.js#L236-L277 | train | Animates to shallow | [
30522,
3853,
2019,
21499,
13122,
9892,
5004,
1006,
2019,
9581,
10880,
1010,
4130,
1010,
3120,
1010,
4539,
1010,
2051,
1010,
8536,
1010,
7901,
1007,
1063,
13075,
27885,
22578,
9892,
5004,
1027,
1063,
1065,
1025,
13075,
3200,
3597,
16671,
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... |
aframevr/aframe | src/components/tracked-controls-webvr.js | function () {
var buttonState;
var controller = this.controller;
var id;
if (!controller) { return; }
// Check every button.
for (id = 0; id < controller.buttons.length; ++id) {
// Initialize button state.
if (!this.buttonStates[id]) {
this.buttonStates[id] = {pressed: fals... | javascript | function () {
var buttonState;
var controller = this.controller;
var id;
if (!controller) { return; }
// Check every button.
for (id = 0; id < controller.buttons.length; ++id) {
// Initialize button state.
if (!this.buttonStates[id]) {
this.buttonStates[id] = {pressed: fals... | [
"function",
"(",
")",
"{",
"var",
"buttonState",
";",
"var",
"controller",
"=",
"this",
".",
"controller",
";",
"var",
"id",
";",
"if",
"(",
"!",
"controller",
")",
"{",
"return",
";",
"}",
"// Check every button.",
"for",
"(",
"id",
"=",
"0",
";",
"... | Handle button changes including axes, presses, touches, values. | [
"Handle",
"button",
"changes",
"including",
"axes",
"presses",
"touches",
"values",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/tracked-controls-webvr.js#L209-L231 | train | Check every button in the controller | [
30522,
3853,
1006,
1007,
1063,
13075,
11287,
12259,
1025,
13075,
11486,
1027,
2023,
1012,
11486,
1025,
13075,
8909,
1025,
2065,
1006,
999,
11486,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
4638,
2296,
6462,
1012,
2005,
1006,
8909,
1027,
1014... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/ToolsAPI.js | function (nodeElement, resultArray) {
var node = nodeElement;
var childNode = node.firstElementChild;
var results = resultArray;
var subResult = results;
var control = sap.ui.getCore().byId(node.id);
if (node.getAttribute('data-sap-ui') && control) {
results.push({
id: control.getId(... | javascript | function (nodeElement, resultArray) {
var node = nodeElement;
var childNode = node.firstElementChild;
var results = resultArray;
var subResult = results;
var control = sap.ui.getCore().byId(node.id);
if (node.getAttribute('data-sap-ui') && control) {
results.push({
id: control.getId(... | [
"function",
"(",
"nodeElement",
",",
"resultArray",
")",
"{",
"var",
"node",
"=",
"nodeElement",
";",
"var",
"childNode",
"=",
"node",
".",
"firstElementChild",
";",
"var",
"results",
"=",
"resultArray",
";",
"var",
"subResult",
"=",
"results",
";",
"var",
... | Creates data model of the rendered controls as a tree.
@param {Element} nodeElement - HTML DOM element from which the function will star searching.
@param {Array} resultArray - Array that will contains all the information.
@private | [
"Creates",
"data",
"model",
"of",
"the",
"rendered",
"controls",
"as",
"a",
"tree",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/ToolsAPI.js#L148-L179 | train | Creates a rendered tree model for the given node | [
30522,
3853,
1006,
13045,
12260,
30524,
13075,
2491,
1027,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
1012,
2011,
3593,
1006,
13045,
1012,
8909,
1007,
1025,
2065,
1006,
13045,
1012,
2131,
19321,
3089,
8569,
2618,
1006,
1005,
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... | |
adobe/brackets | src/editor/EditorStatusBar.js | _updateOverwriteLabel | function _updateOverwriteLabel(event, editor, newstate, doNotAnimate) {
if ($statusOverwrite.text() === (newstate ? Strings.STATUSBAR_OVERWRITE : Strings.STATUSBAR_INSERT)) {
// label already up-to-date
return;
}
$statusOverwrite.text(newstate ? Strings.STATUSBAR_OVERWRI... | javascript | function _updateOverwriteLabel(event, editor, newstate, doNotAnimate) {
if ($statusOverwrite.text() === (newstate ? Strings.STATUSBAR_OVERWRITE : Strings.STATUSBAR_INSERT)) {
// label already up-to-date
return;
}
$statusOverwrite.text(newstate ? Strings.STATUSBAR_OVERWRI... | [
"function",
"_updateOverwriteLabel",
"(",
"event",
",",
"editor",
",",
"newstate",
",",
"doNotAnimate",
")",
"{",
"if",
"(",
"$statusOverwrite",
".",
"text",
"(",
")",
"===",
"(",
"newstate",
"?",
"Strings",
".",
"STATUSBAR_OVERWRITE",
":",
"Strings",
".",
"... | Update insert/overwrite label
@param {Event} event (unused)
@param {Editor} editor Current editor
@param {string} newstate New overwrite state
@param {boolean=} doNotAnimate True if state should not be animated | [
"Update",
"insert",
"/",
"overwrite",
"label"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L242-L253 | train | update status bar label | [
30522,
3853,
1035,
10651,
7840,
26373,
20470,
2884,
1006,
2724,
1010,
3559,
1010,
2739,
12259,
1010,
2123,
17287,
3490,
8585,
1007,
1063,
2065,
1006,
1002,
3570,
7840,
26373,
1012,
3793,
1006,
1007,
1027,
1027,
1027,
1006,
2739,
12259,
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... |
angular/angular | packages/bazel/src/protractor/protractor.conf.js | setConf | function setConf(conf, name, value, msg) {
if (conf[name] && conf[name] !== value) {
console.warn(
`Your protractor configuration specifies an option which is overwritten by Bazel: '${name}' ${msg}`);
}
conf[name] = value;
} | javascript | function setConf(conf, name, value, msg) {
if (conf[name] && conf[name] !== value) {
console.warn(
`Your protractor configuration specifies an option which is overwritten by Bazel: '${name}' ${msg}`);
}
conf[name] = value;
} | [
"function",
"setConf",
"(",
"conf",
",",
"name",
",",
"value",
",",
"msg",
")",
"{",
"if",
"(",
"conf",
"[",
"name",
"]",
"&&",
"conf",
"[",
"name",
"]",
"!==",
"value",
")",
"{",
"console",
".",
"warn",
"(",
"`",
"${",
"name",
"}",
"${",
"msg"... | Helper function to warn when a user specified value is being overwritten | [
"Helper",
"function",
"to",
"warn",
"when",
"a",
"user",
"specified",
"value",
"is",
"being",
"overwritten"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/packages/bazel/src/protractor/protractor.conf.js#L24-L30 | train | Set a protractor configuration option | [
30522,
3853,
2275,
8663,
2546,
1006,
9530,
2546,
1010,
2171,
1010,
3643,
1010,
5796,
2290,
1007,
1063,
2065,
1006,
9530,
2546,
1031,
2171,
1033,
1004,
1004,
9530,
2546,
1031,
2171,
1033,
999,
1027,
1027,
3643,
1007,
1063,
10122,
1012,
115... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | findMatchingSpecial | function findMatchingSpecial() {
// used to loop through the specials
var i;
for (i = specialsCounter; i < specials.length; i++) {
// short circuit this search when we know there are no matches following
if (specials[i] >= deadBranches[queryCounter]) ... | javascript | function findMatchingSpecial() {
// used to loop through the specials
var i;
for (i = specialsCounter; i < specials.length; i++) {
// short circuit this search when we know there are no matches following
if (specials[i] >= deadBranches[queryCounter]) ... | [
"function",
"findMatchingSpecial",
"(",
")",
"{",
"// used to loop through the specials",
"var",
"i",
";",
"for",
"(",
"i",
"=",
"specialsCounter",
";",
"i",
"<",
"specials",
".",
"length",
";",
"i",
"++",
")",
"{",
"// short circuit this search when we know there a... | Compares the current character from the query string against the special characters in str. Returns true if a match was found, false otherwise. | [
"Compares",
"the",
"current",
"character",
"from",
"the",
"query",
"string",
"against",
"the",
"special",
"characters",
"in",
"str",
".",
"Returns",
"true",
"if",
"a",
"match",
"was",
"found",
"false",
"otherwise",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringMatch.js#L255-L288 | train | Find a match in the specials array | [
30522,
3853,
2424,
18900,
8450,
13102,
8586,
4818,
1006,
1007,
1063,
1013,
1013,
2109,
2000,
7077,
2083,
1996,
19247,
13075,
1045,
1025,
2005,
1006,
1045,
1027,
19247,
3597,
16671,
2121,
30524,
2023,
3945,
2043,
2057,
2113,
2045,
2024,
2053... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fex-team/webuploader | _draft/demo.js | addFile | function addFile( file ) {
var $li = $( '<li id="' + file.id + '">' +
'<p class="title">' + file.name + '</p>' +
'<p class="imgWrap"></p>'+
'<p class="progress"><span></span></p>' +
'</li>' ),
$btns = $('<div cl... | javascript | function addFile( file ) {
var $li = $( '<li id="' + file.id + '">' +
'<p class="title">' + file.name + '</p>' +
'<p class="imgWrap"></p>'+
'<p class="progress"><span></span></p>' +
'</li>' ),
$btns = $('<div cl... | [
"function",
"addFile",
"(",
"file",
")",
"{",
"var",
"$li",
"=",
"$",
"(",
"'<li id=\"'",
"+",
"file",
".",
"id",
"+",
"'\">'",
"+",
"'<p class=\"title\">'",
"+",
"file",
".",
"name",
"+",
"'</p>'",
"+",
"'<p class=\"imgWrap\"></p>'",
"+",
"'<p class=\"progr... | 当有文件添加进来时执行,负责view的创建 | [
"当有文件添加进来时执行,负责view的创建"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/_draft/demo.js#L62-L168 | train | add file to the image panel | [
30522,
3853,
5587,
8873,
2571,
1006,
5371,
1007,
1063,
13075,
1002,
5622,
1027,
1002,
1006,
1005,
1026,
5622,
8909,
1027,
1000,
1005,
1009,
5371,
1012,
8909,
1009,
1005,
1000,
1028,
1005,
1009,
1005,
1026,
1052,
2465,
1027,
1000,
2516,
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... |
eslint/eslint | lib/rules/one-var.js | hasOnlyOneStatement | function hasOnlyOneStatement(statementType, declarations) {
const declarationCounts = countDeclarations(declarations);
const currentOptions = options[statementType] || {};
const currentScope = getCurrentScope(statementType);
const hasRequires = declarations.some(isRequir... | javascript | function hasOnlyOneStatement(statementType, declarations) {
const declarationCounts = countDeclarations(declarations);
const currentOptions = options[statementType] || {};
const currentScope = getCurrentScope(statementType);
const hasRequires = declarations.some(isRequir... | [
"function",
"hasOnlyOneStatement",
"(",
"statementType",
",",
"declarations",
")",
"{",
"const",
"declarationCounts",
"=",
"countDeclarations",
"(",
"declarations",
")",
";",
"const",
"currentOptions",
"=",
"options",
"[",
"statementType",
"]",
"||",
"{",
"}",
";"... | Determines if there is more than one var statement in the current scope.
@param {string} statementType node.kind, one of: "var", "let", or "const"
@param {ASTNode[]} declarations List of declarations
@returns {boolean} Returns true if it is the first var declaration, false if not.
@private | [
"Determines",
"if",
"there",
"is",
"more",
"than",
"one",
"var",
"statement",
"in",
"the",
"current",
"scope",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/one-var.js#L225-L257 | train | returns true if statementType has only one declaration | [
30522,
3853,
2038,
2239,
2135,
21821,
12259,
3672,
1006,
4861,
13874,
1010,
8170,
2015,
1007,
1063,
9530,
3367,
8170,
3597,
16671,
2015,
1027,
4175,
3207,
20464,
25879,
8496,
1006,
8170,
2015,
1007,
1025,
9530,
3367,
2783,
7361,
9285,
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... |
moleculerjs/moleculer | src/serializers/proto/packets.proto.js | PacketHeartbeat | function PacketHeartbeat(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | javascript | function PacketHeartbeat(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | [
"function",
"PacketHeartbeat",
"(",
"properties",
")",
"{",
"if",
"(",
"properties",
")",
"for",
"(",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"properties",
")",
",",
"i",
"=",
"0",
";",
"i",
"<",
"keys",
".",
"length",
";",
"++",
"i",
")",
... | Properties of a PacketHeartbeat.
@memberof packets
@interface IPacketHeartbeat
@property {string} ver PacketHeartbeat ver
@property {string} sender PacketHeartbeat sender
@property {number} cpu PacketHeartbeat cpu
Constructs a new PacketHeartbeat.
@memberof packets
@classdesc Represents a PacketHeartbeat.
@implements... | [
"Properties",
"of",
"a",
"PacketHeartbeat",
"."
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L2163-L2168 | train | Properties of a PacketHeartbeat. | [
30522,
3853,
14771,
22375,
19442,
1006,
5144,
1007,
1063,
2065,
1006,
5144,
1007,
2005,
1006,
13075,
6309,
1027,
4874,
1012,
6309,
1006,
5144,
1007,
1010,
1045,
1027,
1014,
1025,
1045,
1026,
6309,
1012,
3091,
1025,
1009,
1009,
1045,
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... |
angular/material | src/components/datepicker/js/dateUtil.js | incrementDays | function incrementDays(date, numberOfDays) {
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + numberOfDays);
} | javascript | function incrementDays(date, numberOfDays) {
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + numberOfDays);
} | [
"function",
"incrementDays",
"(",
"date",
",",
"numberOfDays",
")",
"{",
"return",
"new",
"Date",
"(",
"date",
".",
"getFullYear",
"(",
")",
",",
"date",
".",
"getMonth",
"(",
")",
",",
"date",
".",
"getDate",
"(",
")",
"+",
"numberOfDays",
")",
";",
... | Gets a new date incremented by the given number of days. Number of days can be negative.
@param {Date} date
@param {number} numberOfDays
@returns {Date} | [
"Gets",
"a",
"new",
"date",
"incremented",
"by",
"the",
"given",
"number",
"of",
"days",
".",
"Number",
"of",
"days",
"can",
"be",
"negative",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/dateUtil.js#L139-L141 | train | Increment the days of the specified date | [
30522,
3853,
4297,
28578,
4765,
10259,
2015,
1006,
3058,
1010,
2193,
11253,
10259,
2015,
1007,
1063,
2709,
2047,
3058,
1006,
3058,
1012,
2131,
7699,
14644,
1006,
1007,
1010,
3058,
1012,
2131,
9629,
2232,
1006,
1007,
1010,
3058,
1012,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/routing/Route.js | function () {
EventProvider.prototype.destroy.apply(this);
this._aPattern = null;
this._aRoutes = null;
this._oParent = null;
this._oConfig = null;
this.bIsDestroyed = true;
return this;
} | javascript | function () {
EventProvider.prototype.destroy.apply(this);
this._aPattern = null;
this._aRoutes = null;
this._oParent = null;
this._oConfig = null;
this.bIsDestroyed = true;
return this;
} | [
"function",
"(",
")",
"{",
"EventProvider",
".",
"prototype",
".",
"destroy",
".",
"apply",
"(",
"this",
")",
";",
"this",
".",
"_aPattern",
"=",
"null",
";",
"this",
".",
"_aRoutes",
"=",
"null",
";",
"this",
".",
"_oParent",
"=",
"null",
";",
"this... | Destroys a route
@public
@returns { sap.ui.core.routing.Route } this for chaining. | [
"Destroys",
"a",
"route"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Route.js#L179-L190 | train | Destroys the route provider | [
30522,
3853,
1006,
1007,
1063,
2724,
21572,
17258,
2121,
1012,
8773,
1012,
6033,
1012,
6611,
1006,
2023,
1007,
1025,
2023,
1012,
1035,
9706,
20097,
2078,
1027,
19701,
1025,
2023,
1012,
1035,
12098,
5833,
2229,
1027,
19701,
1025,
2023,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
websockets/ws | lib/buffer-util.js | toBuffer | function toBuffer(data) {
toBuffer.readOnly = true;
if (Buffer.isBuffer(data)) return data;
let buf;
if (data instanceof ArrayBuffer) {
buf = Buffer.from(data);
} else if (ArrayBuffer.isView(data)) {
buf = viewToBuffer(data);
} else {
buf = Buffer.from(data);
toBuffer.readOnly = false;
... | javascript | function toBuffer(data) {
toBuffer.readOnly = true;
if (Buffer.isBuffer(data)) return data;
let buf;
if (data instanceof ArrayBuffer) {
buf = Buffer.from(data);
} else if (ArrayBuffer.isView(data)) {
buf = viewToBuffer(data);
} else {
buf = Buffer.from(data);
toBuffer.readOnly = false;
... | [
"function",
"toBuffer",
"(",
"data",
")",
"{",
"toBuffer",
".",
"readOnly",
"=",
"true",
";",
"if",
"(",
"Buffer",
".",
"isBuffer",
"(",
"data",
")",
")",
"return",
"data",
";",
"let",
"buf",
";",
"if",
"(",
"data",
"instanceof",
"ArrayBuffer",
")",
... | Converts `data` to a `Buffer`.
@param {*} data The data to convert
@return {Buffer} The buffer
@throws {TypeError}
@public | [
"Converts",
"data",
"to",
"a",
"Buffer",
"."
] | 995c527c87d0d4833d8093c18dcfa2e4a41d9582 | https://github.com/websockets/ws/blob/995c527c87d0d4833d8093c18dcfa2e4a41d9582/lib/buffer-util.js#L83-L100 | train | Converts data to Buffer | [
30522,
3853,
2000,
8569,
12494,
1006,
2951,
1007,
1063,
2000,
8569,
12494,
1012,
3191,
2239,
2135,
1027,
2995,
1025,
2065,
1006,
17698,
1012,
2003,
8569,
12494,
1006,
2951,
1007,
1007,
2709,
2951,
1025,
2292,
20934,
2546,
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... |
facebook/relay | packages/relay-runtime/store/RelayModernRecord.js | copyFields | function copyFields(source: Record, sink: Record): void {
for (const key in source) {
if (source.hasOwnProperty(key)) {
if (key !== ID_KEY && key !== TYPENAME_KEY) {
sink[key] = source[key];
}
}
}
} | javascript | function copyFields(source: Record, sink: Record): void {
for (const key in source) {
if (source.hasOwnProperty(key)) {
if (key !== ID_KEY && key !== TYPENAME_KEY) {
sink[key] = source[key];
}
}
}
} | [
"function",
"copyFields",
"(",
"source",
":",
"Record",
",",
"sink",
":",
"Record",
")",
":",
"void",
"{",
"for",
"(",
"const",
"key",
"in",
"source",
")",
"{",
"if",
"(",
"source",
".",
"hasOwnProperty",
"(",
"key",
")",
")",
"{",
"if",
"(",
"key"... | @public
Copies all fields from `source` to `sink`, excluding `__id` and `__typename`.
NOTE: This function does not treat `id` specially. To preserve the id,
manually reset it after calling this function. Also note that values are
copied by reference and not value; callers should ensure that values are
copied on write... | [
"@public"
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-runtime/store/RelayModernRecord.js#L95-L103 | train | Copy fields from source to sink | [
30522,
3853,
6100,
15155,
1006,
3120,
1024,
2501,
1010,
7752,
1024,
2501,
1007,
1024,
11675,
1063,
2005,
1006,
9530,
3367,
3145,
1999,
3120,
1007,
1063,
2065,
1006,
3120,
1012,
2038,
12384,
21572,
4842,
3723,
1006,
3145,
1007,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensibility/ExtensionManagerViewModel.js | InstalledViewModel | function InstalledViewModel() {
ExtensionManagerViewModel.call(this);
// when registry is downloaded, sort extensions again - those with updates will be before others
var self = this;
ExtensionManager.on("registryDownload." + this.source, function () {
self._sortFullSet();
... | javascript | function InstalledViewModel() {
ExtensionManagerViewModel.call(this);
// when registry is downloaded, sort extensions again - those with updates will be before others
var self = this;
ExtensionManager.on("registryDownload." + this.source, function () {
self._sortFullSet();
... | [
"function",
"InstalledViewModel",
"(",
")",
"{",
"ExtensionManagerViewModel",
".",
"call",
"(",
"this",
")",
";",
"// when registry is downloaded, sort extensions again - those with updates will be before others",
"var",
"self",
"=",
"this",
";",
"ExtensionManager",
".",
"on"... | The model for the ExtensionManagerView that is responsible for handling previously-installed extensions.
This extends ExtensionManagerViewModel.
Must be disposed with dispose() when done.
Events:
- change - triggered when the data for a given extension changes. Second parameter is the extension id.
- filter - triggere... | [
"The",
"model",
"for",
"the",
"ExtensionManagerView",
"that",
"is",
"responsible",
"for",
"handling",
"previously",
"-",
"installed",
"extensions",
".",
"This",
"extends",
"ExtensionManagerViewModel",
".",
"Must",
"be",
"disposed",
"with",
"dispose",
"()",
"when",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManagerViewModel.js#L389-L398 | train | This is the base view model for the installed extension | [
30522,
3853,
5361,
8584,
5302,
9247,
1006,
1007,
1063,
5331,
24805,
4590,
8584,
5302,
9247,
1012,
2655,
1006,
2023,
1007,
1025,
1013,
1013,
2043,
15584,
2003,
22817,
1010,
4066,
14305,
2153,
1011,
2216,
2007,
14409,
2097,
2022,
2077,
2500,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
elastic/elasticsearch-js | api/api/get.js | buildGet | function buildGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [get](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
*
* @param {string} id - The document ID
* @para... | javascript | function buildGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [get](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
*
* @param {string} id - The document ID
* @para... | [
"function",
"buildGet",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [get](http://www.elastic.co/guide/en/elasticsear... | /* eslint camelcase: 0 /* eslint no-unused-vars: 0 | [
"/",
"*",
"eslint",
"camelcase",
":",
"0",
"/",
"*",
"eslint",
"no",
"-",
"unused",
"-",
"vars",
":",
"0"
] | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/api/get.js#L25-L139 | train | Build a get request | [
30522,
3853,
3857,
18150,
1006,
23569,
2015,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2279,
1011,
2240,
2053,
1011,
15171,
1011,
13075,
2015,
9530,
3367,
1063,
9338,
2063,
15500,
1010,
9563,
2121,
29165,
1010,
5047... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | collapse | function collapse(edgeIndex, nodeMap, remainingEdges) {
if (remainingEdges.length === 0) {
error("Karger-Stein must be run on a connected (sub)graph");
}
var edgeInfo = remainingEdges[edgeIndex];
var sourceIn = edgeInfo[1];
var targetIn = edgeInfo[2];
var partition1 = nodeMap[sourceIn];
var partition... | javascript | function collapse(edgeIndex, nodeMap, remainingEdges) {
if (remainingEdges.length === 0) {
error("Karger-Stein must be run on a connected (sub)graph");
}
var edgeInfo = remainingEdges[edgeIndex];
var sourceIn = edgeInfo[1];
var targetIn = edgeInfo[2];
var partition1 = nodeMap[sourceIn];
var partition... | [
"function",
"collapse",
"(",
"edgeIndex",
",",
"nodeMap",
",",
"remainingEdges",
")",
"{",
"if",
"(",
"remainingEdges",
".",
"length",
"===",
"0",
")",
"{",
"error",
"(",
"\"Karger-Stein must be run on a connected (sub)graph\"",
")",
";",
"}",
"var",
"edgeInfo",
... | Function which colapses 2 (meta) nodes into one Updates the remaining edge lists Receives as a paramater the edge which causes the collapse | [
"Function",
"which",
"colapses",
"2",
"(",
"meta",
")",
"nodes",
"into",
"one",
"Updates",
"the",
"remaining",
"edge",
"lists",
"Receives",
"as",
"a",
"paramater",
"the",
"edge",
"which",
"causes",
"the",
"collapse"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L2036-L2084 | train | Collapse the edges of the given edgeIndex into the new edges. | [
30522,
3853,
7859,
1006,
3341,
22254,
10288,
1010,
13045,
2863,
2361,
1010,
3588,
24225,
2015,
1007,
1063,
2065,
1006,
3588,
24225,
2015,
1012,
3091,
1027,
1027,
1027,
1014,
1007,
1063,
7561,
1006,
1000,
10556,
25858,
1011,
14233,
2442,
202... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | tools/internal-rules/no-invalid-meta.js | hasMetaDocsRecommended | function hasMetaDocsRecommended(metaPropertyNode) {
const metaDocs = getPropertyFromObject("docs", metaPropertyNode.value);
return metaDocs && getPropertyFromObject("recommended", metaDocs.value);
} | javascript | function hasMetaDocsRecommended(metaPropertyNode) {
const metaDocs = getPropertyFromObject("docs", metaPropertyNode.value);
return metaDocs && getPropertyFromObject("recommended", metaDocs.value);
} | [
"function",
"hasMetaDocsRecommended",
"(",
"metaPropertyNode",
")",
"{",
"const",
"metaDocs",
"=",
"getPropertyFromObject",
"(",
"\"docs\"",
",",
"metaPropertyNode",
".",
"value",
")",
";",
"return",
"metaDocs",
"&&",
"getPropertyFromObject",
"(",
"\"recommended\"",
"... | Whether this `meta` ObjectExpression has a `docs.recommended` property defined or not.
@param {ASTNode} metaPropertyNode The `meta` ObjectExpression for this rule.
@returns {boolean} `true` if a `docs.recommended` property exists. | [
"Whether",
"this",
"meta",
"ObjectExpression",
"has",
"a",
"docs",
".",
"recommended",
"property",
"defined",
"or",
"not",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/tools/internal-rules/no-invalid-meta.js#L86-L90 | train | Checks if the metaDocs property has a recommended property | [
30522,
3853,
2038,
11368,
9365,
6169,
2890,
9006,
3549,
5732,
1006,
18804,
21572,
4842,
25680,
10244,
1007,
1063,
9530,
3367,
18804,
3527,
6169,
1027,
2131,
21572,
4842,
3723,
19699,
19506,
2497,
20614,
1006,
1000,
9986,
2015,
1000,
1010,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.dt/src/sap/ui/dt/enablement/report/Table.js | function(oData) {
if (this._oModel) {
this._oModel.destroy();
delete this._oModel;
}
if (oData) {
this._oModel = new JSONModel(oData);
this._getTable().setModel(this._oModel);
} else {
this._getTable().setModel(null);
}
this.setProperty("data", oData);
} | javascript | function(oData) {
if (this._oModel) {
this._oModel.destroy();
delete this._oModel;
}
if (oData) {
this._oModel = new JSONModel(oData);
this._getTable().setModel(this._oModel);
} else {
this._getTable().setModel(null);
}
this.setProperty("data", oData);
} | [
"function",
"(",
"oData",
")",
"{",
"if",
"(",
"this",
".",
"_oModel",
")",
"{",
"this",
".",
"_oModel",
".",
"destroy",
"(",
")",
";",
"delete",
"this",
".",
"_oModel",
";",
"}",
"if",
"(",
"oData",
")",
"{",
"this",
".",
"_oModel",
"=",
"new",
... | Sets the data to display in the table
@param {object} oData the data to display
@public | [
"Sets",
"the",
"data",
"to",
"display",
"in",
"the",
"table",
"@param",
"{",
"object",
"}",
"oData",
"the",
"data",
"to",
"display"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/enablement/report/Table.js#L102-L114 | train | set the data to the model | [
30522,
3853,
1006,
1051,
2850,
2696,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
18168,
10244,
2140,
1007,
1063,
2023,
1012,
1035,
18168,
10244,
2140,
1012,
6033,
1006,
1007,
1025,
3972,
12870,
2023,
1012,
1035,
18168,
10244,
2140,
1025,
1065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/crossroads.js | Route | function Route(pattern, callback, priority, router) {
var isRegexPattern = isRegExp(pattern),
patternLexer = router.patternLexer;
this._router = router;
this._pattern = pattern;
this._paramsIds = isRegexPattern? null : patternLexer.getParamIds(pattern);
this._optional... | javascript | function Route(pattern, callback, priority, router) {
var isRegexPattern = isRegExp(pattern),
patternLexer = router.patternLexer;
this._router = router;
this._pattern = pattern;
this._paramsIds = isRegexPattern? null : patternLexer.getParamIds(pattern);
this._optional... | [
"function",
"Route",
"(",
"pattern",
",",
"callback",
",",
"priority",
",",
"router",
")",
"{",
"var",
"isRegexPattern",
"=",
"isRegExp",
"(",
"pattern",
")",
",",
"patternLexer",
"=",
"router",
".",
"patternLexer",
";",
"this",
".",
"_router",
"=",
"route... | Route -------------- =====================
@constructor | [
"Route",
"--------------",
"====================="
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/crossroads.js#L292-L306 | train | Constructor for Route | [
30522,
3853,
2799,
1006,
5418,
1010,
2655,
5963,
1010,
9470,
1010,
2799,
2099,
1007,
1063,
13075,
2003,
2890,
3351,
2595,
4502,
12079,
2078,
1027,
2003,
2890,
3351,
2595,
2361,
1006,
5418,
1007,
1010,
5418,
2571,
2595,
2121,
1027,
2799,
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... |
angular/material | src/components/slider/slider.js | SliderContainerDirective | function SliderContainerDirective() {
return {
controller: function () {},
compile: function (elem) {
var slider = elem.find('md-slider');
if (!slider) {
return;
}
var vertical = slider.attr('md-vertical');
if (vertical !== undefined) {
elem.attr('md-vertical',... | javascript | function SliderContainerDirective() {
return {
controller: function () {},
compile: function (elem) {
var slider = elem.find('md-slider');
if (!slider) {
return;
}
var vertical = slider.attr('md-vertical');
if (vertical !== undefined) {
elem.attr('md-vertical',... | [
"function",
"SliderContainerDirective",
"(",
")",
"{",
"return",
"{",
"controller",
":",
"function",
"(",
")",
"{",
"}",
",",
"compile",
":",
"function",
"(",
"elem",
")",
"{",
"var",
"slider",
"=",
"elem",
".",
"find",
"(",
"'md-slider'",
")",
";",
"i... | @ngdoc directive
@name mdSliderContainer
@module material.components.slider
@restrict E
@description
The `<md-slider-container>` can hold the slider with two other elements.
In this case, the other elements are a `span` for the label and an `input` for displaying
the model value.
@usage
<hljs lang="html">
<md-slider-c... | [
"@ngdoc",
"directive",
"@name",
"mdSliderContainer",
"@module",
"material",
".",
"components",
".",
"slider",
"@restrict",
"E",
"@description",
"The",
"<md",
"-",
"slider",
"-",
"container",
">",
"can",
"hold",
"the",
"slider",
"with",
"two",
"other",
"elements"... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/slider/slider.js#L43-L111 | train | A directive that can be used to create a slider container. | [
30522,
3853,
7358,
29566,
12380,
26455,
4305,
2890,
15277,
1006,
1007,
1063,
2709,
1063,
11486,
1024,
3853,
1006,
1007,
1063,
1065,
1010,
4012,
22090,
1024,
3853,
1006,
30524,
13075,
7471,
1027,
7358,
2099,
1012,
2012,
16344,
1006,
1005,
91... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FileFilters.js | _getCondensedForm | function _getCondensedForm(filter) {
if (!_.isArray(filter)) {
return "";
}
// Format filter in condensed form
if (filter.length > 2) {
return filter.slice(0, 2).join(", ") + " " +
StringUtils.format(Strings.FILE_FILTER_CLIPPED_SUFFIX, filter.l... | javascript | function _getCondensedForm(filter) {
if (!_.isArray(filter)) {
return "";
}
// Format filter in condensed form
if (filter.length > 2) {
return filter.slice(0, 2).join(", ") + " " +
StringUtils.format(Strings.FILE_FILTER_CLIPPED_SUFFIX, filter.l... | [
"function",
"_getCondensedForm",
"(",
"filter",
")",
"{",
"if",
"(",
"!",
"_",
".",
"isArray",
"(",
"filter",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"// Format filter in condensed form",
"if",
"(",
"filter",
".",
"length",
">",
"2",
")",
"{",
"return... | Get the condensed form of the filter set by joining the first two in the set with
a comma separator and appending a short message with the number of filters being clipped.
@param {Array.<string>} filter
@return {string} Condensed form of filter set if `filter` is a valid array.
Otherwise, return an empty string. | [
"Get",
"the",
"condensed",
"form",
"of",
"the",
"filter",
"set",
"by",
"joining",
"the",
"first",
"two",
"in",
"the",
"set",
"with",
"a",
"comma",
"separator",
"and",
"appending",
"a",
"short",
"message",
"with",
"the",
"number",
"of",
"filters",
"being",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L74-L85 | train | Returns condensed form of the filter | [
30522,
3853,
1035,
2131,
8663,
4181,
6924,
14192,
1006,
11307,
1007,
1063,
2065,
1006,
999,
1035,
1012,
18061,
11335,
2100,
1006,
11307,
1007,
1007,
1063,
2709,
1000,
1000,
1025,
1065,
1013,
1013,
4289,
11307,
1999,
25011,
2433,
2065,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js | function (oPathValue, oParameters) {
var oFunction = Basics.descend(oPathValue, "$Function", "string");
switch (oFunction.value) {
case "odata.concat": // 14.5.3.1.1 Function odata.concat
return Expression.concat(oParameters);
case "odata.fillUriTemplate": // 14.5.3.1.2 Function odata.fillUriTemplat... | javascript | function (oPathValue, oParameters) {
var oFunction = Basics.descend(oPathValue, "$Function", "string");
switch (oFunction.value) {
case "odata.concat": // 14.5.3.1.1 Function odata.concat
return Expression.concat(oParameters);
case "odata.fillUriTemplate": // 14.5.3.1.2 Function odata.fillUriTemplat... | [
"function",
"(",
"oPathValue",
",",
"oParameters",
")",
"{",
"var",
"oFunction",
"=",
"Basics",
".",
"descend",
"(",
"oPathValue",
",",
"\"$Function\"",
",",
"\"string\"",
")",
";",
"switch",
"(",
"oFunction",
".",
"value",
")",
"{",
"case",
"\"odata.concat\... | Handling of "14.5.3 Expression edm:Apply".
@param {object} oPathValue
path and value information pointing to the apply (see Expression object)
@param {object} oParameters
path and value information pointing to the parameter array (see Expression object)
@returns {sap.ui.base.SyncPromise}
a sync promise which resolves ... | [
"Handling",
"of",
"14",
".",
"5",
".",
"3",
"Expression",
"edm",
":",
"Apply",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js#L168-L181 | train | Returns an async function that can be used to generate a function call | [
30522,
3853,
1006,
6728,
8988,
10175,
5657,
1010,
6728,
5400,
22828,
2015,
1007,
1063,
13075,
1997,
4609,
7542,
1027,
24078,
1012,
18855,
1006,
6728,
8988,
10175,
5657,
1010,
1000,
1002,
3853,
1000,
1010,
1000,
5164,
1000,
1007,
1025,
6942,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
kriasoft/react-starter-kit | tools/start.js | start | async function start() {
if (server) return server;
server = express();
server.use(errorOverlayMiddleware());
server.use(express.static(path.resolve(__dirname, '../public')));
// Configure client-side hot module replacement
const clientConfig = webpackConfig.find(config => config.name === 'client');
clie... | javascript | async function start() {
if (server) return server;
server = express();
server.use(errorOverlayMiddleware());
server.use(express.static(path.resolve(__dirname, '../public')));
// Configure client-side hot module replacement
const clientConfig = webpackConfig.find(config => config.name === 'client');
clie... | [
"async",
"function",
"start",
"(",
")",
"{",
"if",
"(",
"server",
")",
"return",
"server",
";",
"server",
"=",
"express",
"(",
")",
";",
"server",
".",
"use",
"(",
"errorOverlayMiddleware",
"(",
")",
")",
";",
"server",
".",
"use",
"(",
"express",
".... | Launches a development web server with "live reload" functionality -
synchronizing URLs, interactions and code changes across multiple devices. | [
"Launches",
"a",
"development",
"web",
"server",
"with",
"live",
"reload",
"functionality",
"-",
"synchronizing",
"URLs",
"interactions",
"and",
"code",
"changes",
"across",
"multiple",
"devices",
"."
] | 8d6c018f3198dec2a580ecafb011a32f06e38dbf | https://github.com/kriasoft/react-starter-kit/blob/8d6c018f3198dec2a580ecafb011a32f06e38dbf/tools/start.js#L67-L232 | train | Starts the webpack server | [
30522,
2004,
6038,
2278,
3853,
2707,
1006,
1007,
1063,
2065,
1006,
8241,
1007,
2709,
8241,
1025,
8241,
1027,
4671,
1006,
1007,
1025,
8241,
1012,
2224,
1006,
7561,
7840,
8485,
4328,
20338,
8059,
1006,
1007,
1007,
1025,
8241,
1012,
2224,
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... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (element) {
if (element === null ||
!element.tagName ||
!element.childNodes) {
throw {
name: "StropheError",
message: "Cannot queue non-DOMElement."
};
}
this._data.push(element);
} | javascript | function (element) {
if (element === null ||
!element.tagName ||
!element.childNodes) {
throw {
name: "StropheError",
message: "Cannot queue non-DOMElement."
};
}
this._data.push(element);
} | [
"function",
"(",
"element",
")",
"{",
"if",
"(",
"element",
"===",
"null",
"||",
"!",
"element",
".",
"tagName",
"||",
"!",
"element",
".",
"childNodes",
")",
"{",
"throw",
"{",
"name",
":",
"\"StropheError\"",
",",
"message",
":",
"\"Cannot queue non-DOME... | PrivateFunction: _queueData
Queue outgoing data for later sending. Also ensures that the data
is a DOMElement. | [
"PrivateFunction",
":",
"_queueData",
"Queue",
"outgoing",
"data",
"for",
"later",
"sending",
".",
"Also",
"ensures",
"that",
"the",
"data",
"is",
"a",
"DOMElement",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L2539-L2550 | train | Queue an element into the data array. | [
30522,
3853,
1006,
5783,
1007,
1063,
2065,
1006,
5783,
1027,
1027,
1027,
19701,
1064,
1064,
999,
5783,
1012,
6415,
18442,
1064,
1064,
999,
5783,
1012,
2775,
3630,
6155,
1007,
1063,
5466,
1063,
2171,
1024,
1000,
2358,
18981,
21030,
18933,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | generateLocaleCurrencies | function generateLocaleCurrencies(localeData, baseCurrencies) {
const currenciesData = localeData.main('numbers/currencies');
const currencies = {};
Object.keys(currenciesData).forEach(code => {
let symbolsArray = [];
const symbol = currenciesData[code].symbol;
const symbolNarrow = currenciesData[code... | javascript | function generateLocaleCurrencies(localeData, baseCurrencies) {
const currenciesData = localeData.main('numbers/currencies');
const currencies = {};
Object.keys(currenciesData).forEach(code => {
let symbolsArray = [];
const symbol = currenciesData[code].symbol;
const symbolNarrow = currenciesData[code... | [
"function",
"generateLocaleCurrencies",
"(",
"localeData",
",",
"baseCurrencies",
")",
"{",
"const",
"currenciesData",
"=",
"localeData",
".",
"main",
"(",
"'numbers/currencies'",
")",
";",
"const",
"currencies",
"=",
"{",
"}",
";",
"Object",
".",
"keys",
"(",
... | To minimize the file even more, we only output the differences compared to the base currency | [
"To",
"minimize",
"the",
"file",
"even",
"more",
"we",
"only",
"output",
"the",
"differences",
"compared",
"to",
"the",
"base",
"currency"
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/tools/gulp-tasks/cldr/extract.js#L201-L225 | train | Generate the currencies for a locale | [
30522,
3853,
9699,
4135,
9289,
8586,
3126,
7389,
9243,
1006,
2334,
11960,
2696,
1010,
2918,
10841,
14343,
14767,
1007,
1063,
9530,
3367,
12731,
14343,
14767,
2850,
2696,
1027,
2334,
11960,
2696,
1012,
2364,
1006,
1005,
3616,
1013,
12731,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js | function(sPropertyName) {
var oProperty = this._oPropertySet[sPropertyName];
if (oProperty == null) {
throw "no such property with name " + sPropertyName;
}
if (oProperty.extensions != undefined) {
for (var i = -1, oExtension; (oExtension = oProperty.extensions[++i]) !== undefined;) {
if (!oEx... | javascript | function(sPropertyName) {
var oProperty = this._oPropertySet[sPropertyName];
if (oProperty == null) {
throw "no such property with name " + sPropertyName;
}
if (oProperty.extensions != undefined) {
for (var i = -1, oExtension; (oExtension = oProperty.extensions[++i]) !== undefined;) {
if (!oEx... | [
"function",
"(",
"sPropertyName",
")",
"{",
"var",
"oProperty",
"=",
"this",
".",
"_oPropertySet",
"[",
"sPropertyName",
"]",
";",
"if",
"(",
"oProperty",
"==",
"null",
")",
"{",
"throw",
"\"no such property with name \"",
"+",
"sPropertyName",
";",
"}",
"if",... | Get label of the property with specified name (identified by property
metadata annotation sap:label)
@param {string}
sPropertyName Property name
@returns {string} The label string
@public
@function
@name sap.ui.model.analytics.odata4analytics.EntityType#getLabelOfProperty | [
"Get",
"label",
"of",
"the",
"property",
"with",
"specified",
"name",
"(",
"identified",
"by",
"property",
"metadata",
"annotation",
"sap",
":",
"label",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L2602-L2619 | train | Returns the value of the extension for the given property. | [
30522,
3853,
1006,
11867,
18981,
15010,
18442,
1007,
1063,
13075,
6728,
18981,
15010,
1027,
2023,
1012,
1035,
6728,
18981,
15010,
13462,
1031,
11867,
18981,
15010,
18442,
1033,
1025,
2065,
1006,
6728,
18981,
15010,
1027,
1027,
19701,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
feathericons/feather | bin/build-sprite-string.js | buildSpriteString | function buildSpriteString(icons) {
const symbols = Object.keys(icons)
.map(icon => toSvgSymbol(icon, icons[icon]))
.join('');
return `<svg xmlns="${DEFAULT_ATTRS.xmlns}"><defs>${symbols}</defs></svg>`;
} | javascript | function buildSpriteString(icons) {
const symbols = Object.keys(icons)
.map(icon => toSvgSymbol(icon, icons[icon]))
.join('');
return `<svg xmlns="${DEFAULT_ATTRS.xmlns}"><defs>${symbols}</defs></svg>`;
} | [
"function",
"buildSpriteString",
"(",
"icons",
")",
"{",
"const",
"symbols",
"=",
"Object",
".",
"keys",
"(",
"icons",
")",
".",
"map",
"(",
"icon",
"=>",
"toSvgSymbol",
"(",
"icon",
",",
"icons",
"[",
"icon",
"]",
")",
")",
".",
"join",
"(",
"''",
... | Build an SVG sprite string containing SVG symbols.
@param {Object} icons
@returns {string} | [
"Build",
"an",
"SVG",
"sprite",
"string",
"containing",
"SVG",
"symbols",
"."
] | 8f658193d25e943b196a2367319b5d9e85ee9f9f | https://github.com/feathericons/feather/blob/8f658193d25e943b196a2367319b5d9e85ee9f9f/bin/build-sprite-string.js#L8-L14 | train | Build a sprite string from an object | [
30522,
3853,
16473,
18098,
7616,
18886,
3070,
1006,
18407,
1007,
1063,
9530,
3367,
9255,
1027,
4874,
1012,
6309,
1006,
18407,
1007,
1012,
4949,
1006,
12696,
1027,
1028,
2000,
2015,
2615,
5620,
24335,
14956,
1006,
12696,
1010,
18407,
1031,
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... |
eslint/eslint | lib/config/config-rule.js | combineArrays | function combineArrays(arr1, arr2) {
const res = [];
if (arr1.length === 0) {
return explodeArray(arr2);
}
if (arr2.length === 0) {
return explodeArray(arr1);
}
arr1.forEach(x1 => {
arr2.forEach(x2 => {
res.push([].concat(x1, x2));
});
});
ret... | javascript | function combineArrays(arr1, arr2) {
const res = [];
if (arr1.length === 0) {
return explodeArray(arr2);
}
if (arr2.length === 0) {
return explodeArray(arr1);
}
arr1.forEach(x1 => {
arr2.forEach(x2 => {
res.push([].concat(x1, x2));
});
});
ret... | [
"function",
"combineArrays",
"(",
"arr1",
",",
"arr2",
")",
"{",
"const",
"res",
"=",
"[",
"]",
";",
"if",
"(",
"arr1",
".",
"length",
"===",
"0",
")",
"{",
"return",
"explodeArray",
"(",
"arr2",
")",
";",
"}",
"if",
"(",
"arr2",
".",
"length",
"... | Mix two arrays such that each element of the second array is concatenated
onto each element of the first array.
For example:
combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]]
@param {Array} arr1 The first array to combine.
@param {Array} arr2 The second array to combine.
@returns {A... | [
"Mix",
"two",
"arrays",
"such",
"that",
"each",
"element",
"of",
"the",
"second",
"array",
"is",
"concatenated",
"onto",
"each",
"element",
"of",
"the",
"first",
"array",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-rule.js#L44-L59 | train | Combine two arrays of arrays | [
30522,
3853,
11506,
2906,
9447,
2015,
1006,
12098,
2099,
2487,
1010,
12098,
2099,
2475,
1007,
1063,
9530,
3367,
24501,
1027,
1031,
1033,
1025,
2065,
1006,
12098,
2099,
2487,
1012,
3091,
1027,
1027,
1027,
1014,
1007,
1063,
2709,
15044,
2906,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
vuejs/vuepress | packages/@vuepress/core/lib/node/dev/index.js | normalizeWatchFilePath | function normalizeWatchFilePath (filepath, baseDir) {
const { isAbsolute, relative } = require('path')
if (isAbsolute(filepath)) {
return relative(baseDir, filepath)
}
return filepath
} | javascript | function normalizeWatchFilePath (filepath, baseDir) {
const { isAbsolute, relative } = require('path')
if (isAbsolute(filepath)) {
return relative(baseDir, filepath)
}
return filepath
} | [
"function",
"normalizeWatchFilePath",
"(",
"filepath",
",",
"baseDir",
")",
"{",
"const",
"{",
"isAbsolute",
",",
"relative",
"}",
"=",
"require",
"(",
"'path'",
")",
"if",
"(",
"isAbsolute",
"(",
"filepath",
")",
")",
"{",
"return",
"relative",
"(",
"base... | Normalize file path and always return relative path,
@param {string} filepath user's path
@param {string} baseDir source directory
@returns {string} | [
"Normalize",
"file",
"path",
"and",
"always",
"return",
"relative",
"path"
] | 15784acc0cf2e87de3c147895b2c3977b0195d78 | https://github.com/vuejs/vuepress/blob/15784acc0cf2e87de3c147895b2c3977b0195d78/packages/@vuepress/core/lib/node/dev/index.js#L302-L308 | train | Normalize a watch file path | [
30522,
3853,
3671,
4697,
18866,
8873,
2571,
15069,
1006,
5371,
15069,
1010,
2241,
4313,
1007,
1063,
9530,
3367,
1063,
18061,
5910,
4747,
10421,
1010,
5816,
1065,
1027,
5478,
1006,
1005,
4130,
1005,
1007,
2065,
1006,
18061,
5910,
4747,
10421... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/_V2Requestor.js | getType | function getType(oNode) {
var oPropertyMetadata;
if (oNode.type) {
return {
$Type : oNode.type
};
}
if (oNode.id === "PATH") {
oPropertyMetadata = that.oModelInterface
.fetchMetadata(sMetaPath + "/" + oNode.value).getResult();
if (!oPropertyMetadata) {
throw new Error("Invali... | javascript | function getType(oNode) {
var oPropertyMetadata;
if (oNode.type) {
return {
$Type : oNode.type
};
}
if (oNode.id === "PATH") {
oPropertyMetadata = that.oModelInterface
.fetchMetadata(sMetaPath + "/" + oNode.value).getResult();
if (!oPropertyMetadata) {
throw new Error("Invali... | [
"function",
"getType",
"(",
"oNode",
")",
"{",
"var",
"oPropertyMetadata",
";",
"if",
"(",
"oNode",
".",
"type",
")",
"{",
"return",
"{",
"$Type",
":",
"oNode",
".",
"type",
"}",
";",
"}",
"if",
"(",
"oNode",
".",
"id",
"===",
"\"PATH\"",
")",
"{",... | /*
Determines the type of a node.
@param {object} oNode A node
@returns {object} A pseudo property with path, $Type (and poss. $v2Type) or undefined if
the type cannot be determined | [
"/",
"*",
"Determines",
"the",
"type",
"of",
"a",
"node",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_V2Requestor.js#L225-L248 | train | Returns the type of the filter | [
30522,
3853,
2131,
13874,
1006,
21058,
3207,
1007,
1063,
13075,
6728,
18981,
15010,
11368,
8447,
2696,
1025,
2065,
1006,
21058,
3207,
1012,
2828,
1007,
1063,
2709,
1063,
1002,
2828,
1024,
21058,
3207,
1012,
2828,
1065,
1025,
1065,
2065,
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... |
youzan/vant | build/build-entry.js | buildDocsEntry | function buildDocsEntry() {
const output = join('docs/src/docs-entry.js');
const getName = fullPath => fullPath.replace(/\/(en|zh)/, '.$1').split('/').pop().replace('.md', '');
const docs = glob
.sync([
join('docs/**/*.md'),
join('packages/**/*.md'),
'!**/node_modules/**'
])
.map(ful... | javascript | function buildDocsEntry() {
const output = join('docs/src/docs-entry.js');
const getName = fullPath => fullPath.replace(/\/(en|zh)/, '.$1').split('/').pop().replace('.md', '');
const docs = glob
.sync([
join('docs/**/*.md'),
join('packages/**/*.md'),
'!**/node_modules/**'
])
.map(ful... | [
"function",
"buildDocsEntry",
"(",
")",
"{",
"const",
"output",
"=",
"join",
"(",
"'docs/src/docs-entry.js'",
")",
";",
"const",
"getName",
"=",
"fullPath",
"=>",
"fullPath",
".",
"replace",
"(",
"/",
"\\/(en|zh)",
"/",
",",
"'.$1'",
")",
".",
"split",
"("... | generate webpack entry file for markdown docs | [
"generate",
"webpack",
"entry",
"file",
"for",
"markdown",
"docs"
] | 21589c9b9fd70b750deed1d31226b8d2c74d62c0 | https://github.com/youzan/vant/blob/21589c9b9fd70b750deed1d31226b8d2c74d62c0/build/build-entry.js#L82-L102 | train | Build the docs - entry. js file | [
30522,
3853,
3857,
3527,
6169,
4765,
2854,
1006,
1007,
1063,
9530,
3367,
6434,
1027,
3693,
1006,
1005,
9986,
2015,
1013,
5034,
2278,
1013,
9986,
2015,
1011,
4443,
30524,
1007,
1013,
1010,
1005,
1012,
1002,
1015,
1005,
1007,
1012,
3975,
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.commons/src/sap/ui/commons/Toolbar.js | getCountOfVisibleItemsWithVisibilityTrue | function getCountOfVisibleItemsWithVisibilityTrue(oLastVisibleItem) {
var iAllItemsBeforeBreak = 0;
var aLeftItemsWithVisibleTrue = getLeftItemsWithVisibilityTrue.call(this);
aLeftItemsWithVisibleTrue.forEach(function (item, i) {
if (item.getDomRef() === oLastVisibleItem) {
iAllItemsBeforeBreak = i + ... | javascript | function getCountOfVisibleItemsWithVisibilityTrue(oLastVisibleItem) {
var iAllItemsBeforeBreak = 0;
var aLeftItemsWithVisibleTrue = getLeftItemsWithVisibilityTrue.call(this);
aLeftItemsWithVisibleTrue.forEach(function (item, i) {
if (item.getDomRef() === oLastVisibleItem) {
iAllItemsBeforeBreak = i + ... | [
"function",
"getCountOfVisibleItemsWithVisibilityTrue",
"(",
"oLastVisibleItem",
")",
"{",
"var",
"iAllItemsBeforeBreak",
"=",
"0",
";",
"var",
"aLeftItemsWithVisibleTrue",
"=",
"getLeftItemsWithVisibilityTrue",
".",
"call",
"(",
"this",
")",
";",
"aLeftItemsWithVisibleTrue... | Get a real number of the all items that are not hidden due to overflow (are not on the second row) neither due to API
property's visibility(i.e. visibility is not false).
"Second row" items are the items which are not shown in the parent container due to css overflow:hidden, i.e.
overflowing items.
@param {Object} oLas... | [
"Get",
"a",
"real",
"number",
"of",
"the",
"all",
"items",
"that",
"are",
"not",
"hidden",
"due",
"to",
"overflow",
"(",
"are",
"not",
"on",
"the",
"second",
"row",
")",
"neither",
"due",
"to",
"API",
"property",
"s",
"visibility",
"(",
"i",
".",
"e"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/Toolbar.js#L1029-L1039 | train | Returns the number of items that have a visibility true | [
30522,
3853,
2131,
3597,
16671,
11253,
11365,
7028,
4221,
5244,
24415,
11365,
13464,
16344,
5657,
1006,
19330,
14083,
11365,
7028,
4221,
2213,
1007,
1063,
13075,
24264,
6894,
18532,
19022,
12879,
5686,
23890,
1027,
1014,
1025,
13075,
15669,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dvajs/dva | examples/user-dashboard/src/utils/request.js | request | async function request(url, options) {
const response = await fetch(url, options);
checkStatus(response);
const data = await response.json();
const ret = {
data,
headers: {},
};
if (response.headers.get('x-total-count')) {
ret.headers['x-total-count'] = response.headers.get('x-total-count');... | javascript | async function request(url, options) {
const response = await fetch(url, options);
checkStatus(response);
const data = await response.json();
const ret = {
data,
headers: {},
};
if (response.headers.get('x-total-count')) {
ret.headers['x-total-count'] = response.headers.get('x-total-count');... | [
"async",
"function",
"request",
"(",
"url",
",",
"options",
")",
"{",
"const",
"response",
"=",
"await",
"fetch",
"(",
"url",
",",
"options",
")",
";",
"checkStatus",
"(",
"response",
")",
";",
"const",
"data",
"=",
"await",
"response",
".",
"json",
"(... | Requests a URL, returning a promise.
@param {string} url The URL we want to request
@param {object} [options] The options we want to pass to "fetch"
@return {object} An object containing either "data" or "err" | [
"Requests",
"a",
"URL",
"returning",
"a",
"promise",
"."
] | 99ec56cbedbdba7e3e91befe341f109e038363c6 | https://github.com/dvajs/dva/blob/99ec56cbedbdba7e3e91befe341f109e038363c6/examples/user-dashboard/src/utils/request.js#L20-L37 | train | Request an arbitrary number of nodes | [
30522,
2004,
6038,
2278,
3853,
5227,
1006,
24471,
2140,
1010,
7047,
1007,
1063,
9530,
3367,
3433,
1027,
26751,
18584,
1006,
24471,
2140,
1010,
7047,
1007,
1025,
14148,
29336,
2271,
1006,
3433,
1007,
1025,
9530,
3367,
2951,
1027,
26751,
3433... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sass/node-sass | scripts/build.js | parseArgs | function parseArgs(args) {
var options = {
arch: process.arch,
platform: process.platform,
force: process.env.npm_config_force === 'true',
};
options.args = args.filter(function(arg) {
if (arg === '-f' || arg === '--force') {
options.force = true;
return false;
} else if (arg.subs... | javascript | function parseArgs(args) {
var options = {
arch: process.arch,
platform: process.platform,
force: process.env.npm_config_force === 'true',
};
options.args = args.filter(function(arg) {
if (arg === '-f' || arg === '--force') {
options.force = true;
return false;
} else if (arg.subs... | [
"function",
"parseArgs",
"(",
"args",
")",
"{",
"var",
"options",
"=",
"{",
"arch",
":",
"process",
".",
"arch",
",",
"platform",
":",
"process",
".",
"platform",
",",
"force",
":",
"process",
".",
"env",
".",
"npm_config_force",
"===",
"'true'",
",",
... | Parse arguments
@param {Array} args
@api private | [
"Parse",
"arguments"
] | 0c1a49eefa37544d16041c5fe5b2e3d9168004b7 | https://github.com/sass/node-sass/blob/0c1a49eefa37544d16041c5fe5b2e3d9168004b7/scripts/build.js#L93-L116 | train | Parse the args | [
30522,
3853,
11968,
17310,
10623,
2015,
1006,
12098,
5620,
1007,
1063,
13075,
7047,
1027,
1063,
7905,
1024,
2832,
1012,
7905,
1010,
4132,
1024,
2832,
1012,
4132,
1010,
2486,
1024,
2832,
1012,
4372,
2615,
1012,
27937,
2213,
1035,
9530,
8873,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/output/callHook.js | callHook | function callHook(name, getArgument, handleResult, output) {
getArgument = getArgument || defaultGetArgument;
handleResult = handleResult || defaultHandleResult;
var logger = output.getLogger();
var plugins = output.getPlugins();
logger.debug.ln('calling hook "' + name + '"');
// Create the J... | javascript | function callHook(name, getArgument, handleResult, output) {
getArgument = getArgument || defaultGetArgument;
handleResult = handleResult || defaultHandleResult;
var logger = output.getLogger();
var plugins = output.getPlugins();
logger.debug.ln('calling hook "' + name + '"');
// Create the J... | [
"function",
"callHook",
"(",
"name",
",",
"getArgument",
",",
"handleResult",
",",
"output",
")",
"{",
"getArgument",
"=",
"getArgument",
"||",
"defaultGetArgument",
";",
"handleResult",
"=",
"handleResult",
"||",
"defaultHandleResult",
";",
"var",
"logger",
"=",
... | Call a "global" hook for an output
@param {String} name
@param {Function(Output) -> Mixed} getArgument
@param {Function(Output, result) -> Output} handleResult
@param {Output} output
@return {Promise<Output>} | [
"Call",
"a",
"global",
"hook",
"for",
"an",
"output"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/callHook.js#L22-L58 | train | Call a hook | [
30522,
3853,
2655,
6806,
6559,
1006,
2171,
1010,
2131,
2906,
22850,
4765,
1010,
28213,
2229,
11314,
1010,
6434,
1007,
1063,
2131,
2906,
22850,
4765,
1027,
2131,
2906,
22850,
4765,
1064,
1064,
12398,
18150,
2906,
22850,
4765,
1025,
28213,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-extra-parens.js | checkCallNew | function checkCallNew(node) {
const callee = node.callee;
if (hasExcessParens(callee) && precedence(callee) >= precedence(node)) {
const hasNewParensException = callee.type === "NewExpression" && !isNewExpressionWithParens(callee);
if (
hasDo... | javascript | function checkCallNew(node) {
const callee = node.callee;
if (hasExcessParens(callee) && precedence(callee) >= precedence(node)) {
const hasNewParensException = callee.type === "NewExpression" && !isNewExpressionWithParens(callee);
if (
hasDo... | [
"function",
"checkCallNew",
"(",
"node",
")",
"{",
"const",
"callee",
"=",
"node",
".",
"callee",
";",
"if",
"(",
"hasExcessParens",
"(",
"callee",
")",
"&&",
"precedence",
"(",
"callee",
")",
">=",
"precedence",
"(",
"node",
")",
")",
"{",
"const",
"h... | Evaluate a new call
@param {ASTNode} node node to evaluate
@returns {void}
@private | [
"Evaluate",
"a",
"new",
"call"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-extra-parens.js#L373-L402 | train | Check call new | [
30522,
3853,
4638,
9289,
19666,
7974,
1006,
13045,
1007,
1063,
9530,
3367,
2655,
4402,
1027,
13045,
1012,
2655,
4402,
1025,
2065,
1006,
2038,
10288,
9623,
27694,
6132,
1006,
2655,
4402,
1007,
1004,
1004,
23359,
1006,
2655,
4402,
1007,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
muaz-khan/RecordRTC | WebGL-Recording/vendor/glge-compiled.js | getLastNumber | function getLastNumber(str){
var retval="";
for (var i=str.length-1;i>=0;--i)
if (str[i]>="0"&&str[i]<="9")
retval=str[i]+retval;
if (retval.length==0) return "0";
return retval;
} | javascript | function getLastNumber(str){
var retval="";
for (var i=str.length-1;i>=0;--i)
if (str[i]>="0"&&str[i]<="9")
retval=str[i]+retval;
if (retval.length==0) return "0";
return retval;
} | [
"function",
"getLastNumber",
"(",
"str",
")",
"{",
"var",
"retval",
"=",
"\"\"",
";",
"for",
"(",
"var",
"i",
"=",
"str",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"--",
"i",
")",
"if",
"(",
"str",
"[",
"i",
"]",
">=",
"\"0\"",
"&&",... | the exporter is buggy eg VCGLab | MeshLab and does not specify input_set | [
"the",
"exporter",
"is",
"buggy",
"eg",
"VCGLab",
"|",
"MeshLab",
"and",
"does",
"not",
"specify",
"input_set"
] | 3c6bad427b9da35c1cf617199ed13dda056c38ba | https://github.com/muaz-khan/RecordRTC/blob/3c6bad427b9da35c1cf617199ed13dda056c38ba/WebGL-Recording/vendor/glge-compiled.js#L18122-L18129 | train | Get last number in string | [
30522,
3853,
2131,
8523,
2102,
19172,
5677,
1006,
2358,
2099,
1007,
1063,
13075,
2128,
9189,
2389,
1027,
1000,
1000,
1025,
2005,
1006,
13075,
1045,
1027,
2358,
2099,
1012,
3091,
1011,
1015,
1025,
1045,
1028,
1027,
1014,
1025,
1011,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | HorizontalLStrategy | function HorizontalLStrategy(connector)
{
this.connector = connector;
this.destination;
this.startSegment;
this.endSegment;
this.strategyName = "horizontal_L";
this.isApplicable = function()
{
var destMiddle = Math.floor(this.connector.destination.left() + this.connector.destination.width() / 2);
var... | javascript | function HorizontalLStrategy(connector)
{
this.connector = connector;
this.destination;
this.startSegment;
this.endSegment;
this.strategyName = "horizontal_L";
this.isApplicable = function()
{
var destMiddle = Math.floor(this.connector.destination.left() + this.connector.destination.width() / 2);
var... | [
"function",
"HorizontalLStrategy",
"(",
"connector",
")",
"{",
"this",
".",
"connector",
"=",
"connector",
";",
"this",
".",
"destination",
";",
"this",
".",
"startSegment",
";",
"this",
".",
"endSegment",
";",
"this",
".",
"strategyName",
"=",
"\"horizontal_L... | A horizontal "L" connector routing strategy | [
"A",
"horizontal",
"L",
"connector",
"routing",
"strategy"
] | bf5e3028810a0ec7c267c6fe4bfad639b4819e35 | https://github.com/radare/radare2/blob/bf5e3028810a0ec7c267c6fe4bfad639b4819e35/shlr/www/graph/js-graph-it.js#L1442-L1523 | train | Horizontal L strategy | [
30522,
3853,
9876,
4877,
6494,
2618,
6292,
1006,
19400,
1007,
1063,
2023,
1012,
19400,
1027,
19400,
1025,
2023,
1012,
7688,
1025,
2023,
1012,
4627,
13910,
3672,
1025,
2023,
1012,
4515,
13910,
3672,
1025,
2023,
1012,
5656,
18442,
1027,
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... |
typeorm/typeorm | extra/typeorm-class-transformer-shim.js | ManyToOne | function ManyToOne(typeFunction, inverseSideOrOptions, options) {
return function (object, propertyName) {
class_transformer_1.Type(typeFunction)(object, propertyName);
};
} | javascript | function ManyToOne(typeFunction, inverseSideOrOptions, options) {
return function (object, propertyName) {
class_transformer_1.Type(typeFunction)(object, propertyName);
};
} | [
"function",
"ManyToOne",
"(",
"typeFunction",
",",
"inverseSideOrOptions",
",",
"options",
")",
"{",
"return",
"function",
"(",
"object",
",",
"propertyName",
")",
"{",
"class_transformer_1",
".",
"Type",
"(",
"typeFunction",
")",
"(",
"object",
",",
"propertyNa... | /* export | [
"/",
"*",
"export"
] | 360468b7913db8d988346fba1ee2d3f323498eef | https://github.com/typeorm/typeorm/blob/360468b7913db8d988346fba1ee2d3f323498eef/extra/typeorm-class-transformer-shim.js#L147-L151 | train | Creates a function that takes a single object and returns a function that takes a single object and returns a function that takes a single object and returns a function that takes a single object and a property name. | [
30522,
3853,
2116,
3406,
5643,
1006,
2828,
11263,
27989,
1010,
19262,
7363,
14604,
16790,
2015,
1010,
7047,
1007,
1063,
2709,
3853,
1006,
4874,
1010,
3200,
18442,
1007,
1063,
2465,
1035,
10938,
2121,
1035,
1015,
1012,
2828,
1006,
2828,
1126... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/mark/viewerMarkerHelper.js | getRange | function getRange() {
const selection = window.getSelection();
let range;
if (selection && selection.rangeCount) {
range = selection.getRangeAt(0).cloneRange();
} else {
range = document.createRange();
range.selectNodeContents(this.preview.$el[0]);
range.collapse(true);
}
return range;
} | javascript | function getRange() {
const selection = window.getSelection();
let range;
if (selection && selection.rangeCount) {
range = selection.getRangeAt(0).cloneRange();
} else {
range = document.createRange();
range.selectNodeContents(this.preview.$el[0]);
range.collapse(true);
}
return range;
} | [
"function",
"getRange",
"(",
")",
"{",
"const",
"selection",
"=",
"window",
".",
"getSelection",
"(",
")",
";",
"let",
"range",
";",
"if",
"(",
"selection",
"&&",
"selection",
".",
"rangeCount",
")",
"{",
"range",
"=",
"selection",
".",
"getRangeAt",
"("... | getRange
get current range
@returns {Range}
@ignore | [
"getRange",
"get",
"current",
"range"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/mark/viewerMarkerHelper.js#L207-L220 | train | Get the range of the preview element | [
30522,
3853,
2131,
24388,
2063,
1006,
1007,
1063,
9530,
3367,
4989,
1027,
3332,
1012,
4152,
12260,
7542,
1006,
1007,
1025,
2292,
2846,
1025,
2065,
1006,
4989,
1004,
1004,
4989,
1012,
2846,
3597,
16671,
1007,
1063,
2846,
1027,
4989,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/func-names.js | isObjectOrClassMethod | function isObjectOrClassMethod(node) {
const parent = node.parent;
return (parent.type === "MethodDefinition" || (
parent.type === "Property" && (
parent.method ||
parent.kind === "get" ||
parent.kind === "set"
... | javascript | function isObjectOrClassMethod(node) {
const parent = node.parent;
return (parent.type === "MethodDefinition" || (
parent.type === "Property" && (
parent.method ||
parent.kind === "get" ||
parent.kind === "set"
... | [
"function",
"isObjectOrClassMethod",
"(",
"node",
")",
"{",
"const",
"parent",
"=",
"node",
".",
"parent",
";",
"return",
"(",
"parent",
".",
"type",
"===",
"\"MethodDefinition\"",
"||",
"(",
"parent",
".",
"type",
"===",
"\"Property\"",
"&&",
"(",
"parent",... | Determines whether the current FunctionExpression node is a get, set, or
shorthand method in an object literal or a class.
@param {ASTNode} node - A node to check.
@returns {boolean} True if the node is a get, set, or shorthand method. | [
"Determines",
"whether",
"the",
"current",
"FunctionExpression",
"node",
"is",
"a",
"get",
"set",
"or",
"shorthand",
"method",
"in",
"an",
"object",
"literal",
"or",
"a",
"class",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/func-names.js#L95-L105 | train | isObjectOrClassMethod - is object or class method | [
30522,
3853,
11163,
2497,
20614,
2953,
26266,
11368,
6806,
2094,
1006,
13045,
1007,
1063,
9530,
3367,
6687,
1027,
13045,
1012,
6687,
1025,
2709,
1006,
6687,
1012,
2828,
1027,
1027,
1027,
1000,
4118,
3207,
16294,
22753,
1000,
1064,
1064,
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... |
zeit/pkg | prelude/bootstrap.js | openFromSnapshot | function openFromSnapshot (path_, cb) {
var cb2 = cb || rethrow;
var path = normalizePath(path_);
// console.log("openFromSnapshot", path);
var entity = VIRTUAL_FILESYSTEM[path];
if (!entity) return cb2(error_ENOENT('File or directory', path));
var dock = { path: path, entity: entity, position: ... | javascript | function openFromSnapshot (path_, cb) {
var cb2 = cb || rethrow;
var path = normalizePath(path_);
// console.log("openFromSnapshot", path);
var entity = VIRTUAL_FILESYSTEM[path];
if (!entity) return cb2(error_ENOENT('File or directory', path));
var dock = { path: path, entity: entity, position: ... | [
"function",
"openFromSnapshot",
"(",
"path_",
",",
"cb",
")",
"{",
"var",
"cb2",
"=",
"cb",
"||",
"rethrow",
";",
"var",
"path",
"=",
"normalizePath",
"(",
"path_",
")",
";",
"// console.log(\"openFromSnapshot\", path);",
"var",
"entity",
"=",
"VIRTUAL_FILESYSTE... | /////////////////////////////////////////////////////////////// open ////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// | [
"///////////////////////////////////////////////////////////////",
"open",
"//////////////////////////////////////////////////////////",
"///////////////////////////////////////////////////////////////"
] | 3775ab6decc2f8f013142e1282934c12fbd1881e | https://github.com/zeit/pkg/blob/3775ab6decc2f8f013142e1282934c12fbd1881e/prelude/bootstrap.js#L465-L484 | train | Open a file or directory from a snapshot | [
30522,
3853,
2330,
19699,
22225,
2532,
4523,
12326,
1006,
4130,
1035,
1010,
17324,
1007,
1063,
13075,
17324,
2475,
1027,
17324,
1064,
1064,
2128,
2705,
10524,
1025,
13075,
4130,
1027,
3671,
4697,
15069,
1006,
4130,
1035,
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... |
grpc/grpc | examples/node/static_codegen/route_guide/route_guide_client.js | pointSender | function pointSender(location) {
/**
* Sends the point, then calls the callback after a delay
* @param {function} callback Called when complete
*/
return function(callback) {
console.log('Visiting point ' + location.getLatitude()/COORD_FACTOR +
', ' + location.getLon... | javascript | function pointSender(location) {
/**
* Sends the point, then calls the callback after a delay
* @param {function} callback Called when complete
*/
return function(callback) {
console.log('Visiting point ' + location.getLatitude()/COORD_FACTOR +
', ' + location.getLon... | [
"function",
"pointSender",
"(",
"location",
")",
"{",
"/**\n * Sends the point, then calls the callback after a delay\n * @param {function} callback Called when complete\n */",
"return",
"function",
"(",
"callback",
")",
"{",
"console",
".",
"log",
"(",
"'Visiting... | Constructs a function that asynchronously sends the given point and then
delays sending its callback
@param {messages.Point} location The point to send
@return {function(function)} The function that sends the point | [
"Constructs",
"a",
"function",
"that",
"asynchronously",
"sends",
"the",
"given",
"point",
"and",
"then",
"delays",
"sending",
"its",
"callback"
] | cc75d93818410e2b0edd0fa3009a6def9ac403ca | https://github.com/grpc/grpc/blob/cc75d93818410e2b0edd0fa3009a6def9ac403ca/examples/node/static_codegen/route_guide/route_guide_client.js#L137-L148 | train | This function is the function that will send the point to the specified location | [
30522,
3853,
2685,
10497,
2121,
1006,
3295,
1007,
1063,
1013,
1008,
1008,
1008,
10255,
1996,
2391,
1010,
2059,
4455,
1996,
2655,
5963,
2044,
1037,
8536,
1008,
1030,
11498,
2213,
1063,
3853,
1065,
2655,
5963,
2170,
2043,
3143,
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... |
jantimon/html-webpack-plugin | lib/compiler.js | addTemplateToCompiler | function addTemplateToCompiler (mainCompiler, templatePath) {
const childCompiler = getChildCompiler(mainCompiler);
const isNew = childCompiler.addTemplate(templatePath);
if (isNew) {
clearCache(mainCompiler);
}
} | javascript | function addTemplateToCompiler (mainCompiler, templatePath) {
const childCompiler = getChildCompiler(mainCompiler);
const isNew = childCompiler.addTemplate(templatePath);
if (isNew) {
clearCache(mainCompiler);
}
} | [
"function",
"addTemplateToCompiler",
"(",
"mainCompiler",
",",
"templatePath",
")",
"{",
"const",
"childCompiler",
"=",
"getChildCompiler",
"(",
"mainCompiler",
")",
";",
"const",
"isNew",
"=",
"childCompiler",
".",
"addTemplate",
"(",
"templatePath",
")",
";",
"i... | Register a template for the current main compiler
@param {WebpackCompiler} mainCompiler
@param {string} templatePath | [
"Register",
"a",
"template",
"for",
"the",
"current",
"main",
"compiler"
] | 38db64ae8805de37d038e0ee0f6dfa2a26e2163a | https://github.com/jantimon/html-webpack-plugin/blob/38db64ae8805de37d038e0ee0f6dfa2a26e2163a/lib/compiler.js#L239-L245 | train | Add a template to the compiler | [
30522,
3853,
5587,
18532,
15725,
3406,
9006,
22090,
2099,
1006,
2364,
9006,
22090,
2099,
1010,
23561,
15069,
1007,
1063,
9530,
3367,
2775,
9006,
22090,
2099,
1027,
2131,
19339,
9006,
22090,
2099,
1006,
2364,
9006,
22090,
2099,
1007,
1025,
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... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (elem)
{
if (!elem) { return null; }
var str = "";
if (elem.childNodes.length === 0 && elem.nodeType ==
Strophe.ElementType.TEXT) {
str += elem.nodeValue;
}
for (var i = 0; i < elem.childNodes.length; i++) {
if (elem.c... | javascript | function (elem)
{
if (!elem) { return null; }
var str = "";
if (elem.childNodes.length === 0 && elem.nodeType ==
Strophe.ElementType.TEXT) {
str += elem.nodeValue;
}
for (var i = 0; i < elem.childNodes.length; i++) {
if (elem.c... | [
"function",
"(",
"elem",
")",
"{",
"if",
"(",
"!",
"elem",
")",
"{",
"return",
"null",
";",
"}",
"var",
"str",
"=",
"\"\"",
";",
"if",
"(",
"elem",
".",
"childNodes",
".",
"length",
"===",
"0",
"&&",
"elem",
".",
"nodeType",
"==",
"Strophe",
".",... | Function: getText
Get the concatenation of all text children of an element.
Parameters:
(XMLElement) elem - A DOM element.
Returns:
A String with the concatenated text of all text element children. | [
"Function",
":",
"getText",
"Get",
"the",
"concatenation",
"of",
"all",
"text",
"children",
"of",
"an",
"element",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L1118-L1135 | train | Returns the text of the last tag in the sequence | [
30522,
3853,
1006,
3449,
6633,
1007,
1063,
2065,
1006,
999,
3449,
6633,
1007,
1063,
2709,
19701,
1025,
1065,
13075,
2358,
2099,
1027,
1000,
1000,
1025,
2065,
1006,
3449,
6633,
1012,
2775,
3630,
6155,
1012,
3091,
1027,
1027,
1027,
1014,
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... | |
uber/deck.gl | modules/aggregation-layers/src/contour-layer/marching-squares.js | getVertexCode | function getVertexCode(weight, threshold) {
// threshold must be a single value or a range (array of size 2)
// Iso-bands
if (Array.isArray(threshold)) {
if (weight < threshold[0]) {
return 0;
}
return weight < threshold[1] ? 1 : 2;
}
// Iso-lines
return weight >= threshold ? 1 : 0;
} | javascript | function getVertexCode(weight, threshold) {
// threshold must be a single value or a range (array of size 2)
// Iso-bands
if (Array.isArray(threshold)) {
if (weight < threshold[0]) {
return 0;
}
return weight < threshold[1] ? 1 : 2;
}
// Iso-lines
return weight >= threshold ? 1 : 0;
} | [
"function",
"getVertexCode",
"(",
"weight",
",",
"threshold",
")",
"{",
"// threshold must be a single value or a range (array of size 2)",
"// Iso-bands",
"if",
"(",
"Array",
".",
"isArray",
"(",
"threshold",
")",
")",
"{",
"if",
"(",
"weight",
"<",
"threshold",
"[... | Utility methods | [
"Utility",
"methods"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/aggregation-layers/src/contour-layer/marching-squares.js#L19-L31 | train | Returns the vertex code for a given weight | [
30522,
3853,
2131,
16874,
10288,
16044,
1006,
3635,
1010,
11207,
1007,
1063,
1013,
1013,
11207,
2442,
2022,
1037,
2309,
3643,
2030,
1037,
2846,
1006,
9140,
1997,
2946,
1016,
1007,
1013,
1013,
11163,
1011,
4996,
2065,
1006,
9140,
1012,
18061... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sass/node-sass | scripts/install.js | checkAndDownloadBinary | function checkAndDownloadBinary() {
if (process.env.SKIP_SASS_BINARY_DOWNLOAD_FOR_CI) {
console.log('Skipping downloading binaries on CI builds');
return;
}
var cachedBinary = sass.getCachedBinary(),
cachePath = sass.getBinaryCachePath(),
binaryPath = sass.getBinaryPath();
if (sass.hasBinary(b... | javascript | function checkAndDownloadBinary() {
if (process.env.SKIP_SASS_BINARY_DOWNLOAD_FOR_CI) {
console.log('Skipping downloading binaries on CI builds');
return;
}
var cachedBinary = sass.getCachedBinary(),
cachePath = sass.getBinaryCachePath(),
binaryPath = sass.getBinaryPath();
if (sass.hasBinary(b... | [
"function",
"checkAndDownloadBinary",
"(",
")",
"{",
"if",
"(",
"process",
".",
"env",
".",
"SKIP_SASS_BINARY_DOWNLOAD_FOR_CI",
")",
"{",
"console",
".",
"log",
"(",
"'Skipping downloading binaries on CI builds'",
")",
";",
"return",
";",
"}",
"var",
"cachedBinary",... | Check and download binary
@api private | [
"Check",
"and",
"download",
"binary"
] | 0c1a49eefa37544d16041c5fe5b2e3d9168004b7 | https://github.com/sass/node-sass/blob/0c1a49eefa37544d16041c5fe5b2e3d9168004b7/scripts/install.js#L98-L151 | train | Check if binary exists and download it | [
30522,
3853,
4638,
5685,
7698,
11066,
21114,
2854,
1006,
1007,
1063,
2065,
1006,
2832,
1012,
4372,
2615,
1012,
13558,
1035,
21871,
2015,
1035,
12441,
1035,
8816,
1035,
2005,
1035,
25022,
1007,
1063,
10122,
1012,
8833,
1006,
1005,
25978,
881... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
catapult-project/catapult | tracing/third_party/oboe/src/lists.js | reverseList | function reverseList(list){
// js re-implementation of 3rd solution from:
// http://www.haskell.org/haskellwiki/99_questions/Solutions/5
function reverseInner( list, reversedAlready ) {
if( !list ) {
return reversedAlready;
}
return reverseInner(tail(list), cons(head(list... | javascript | function reverseList(list){
// js re-implementation of 3rd solution from:
// http://www.haskell.org/haskellwiki/99_questions/Solutions/5
function reverseInner( list, reversedAlready ) {
if( !list ) {
return reversedAlready;
}
return reverseInner(tail(list), cons(head(list... | [
"function",
"reverseList",
"(",
"list",
")",
"{",
"// js re-implementation of 3rd solution from:",
"// http://www.haskell.org/haskellwiki/99_questions/Solutions/5",
"function",
"reverseInner",
"(",
"list",
",",
"reversedAlready",
")",
"{",
"if",
"(",
"!",
"list",
")",
"{... | Reverse the order of a list | [
"Reverse",
"the",
"order",
"of",
"a",
"list"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L172-L185 | train | reverseList - reverse list | [
30522,
3853,
7901,
9863,
1006,
2862,
1007,
1063,
1013,
1013,
1046,
2015,
2128,
1011,
7375,
1997,
3822,
5576,
2013,
1024,
1013,
1013,
8299,
1024,
1013,
1013,
7479,
1012,
2038,
18690,
1012,
8917,
1013,
2038,
18690,
9148,
3211,
1013,
5585,
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... |
keplergl/kepler.gl | examples/demo-app/src/utils/cloud-providers/dropbox.js | overrideUrl | function overrideUrl(url) {
return url ? url.slice(0, url.indexOf('?')).replace(DOMAIN, CORS_FREE_DOMAIN) : null;
} | javascript | function overrideUrl(url) {
return url ? url.slice(0, url.indexOf('?')).replace(DOMAIN, CORS_FREE_DOMAIN) : null;
} | [
"function",
"overrideUrl",
"(",
"url",
")",
"{",
"return",
"url",
"?",
"url",
".",
"slice",
"(",
"0",
",",
"url",
".",
"indexOf",
"(",
"'?'",
")",
")",
".",
"replace",
"(",
"DOMAIN",
",",
"CORS_FREE_DOMAIN",
")",
":",
"null",
";",
"}"
] | Override dropbox cloud-providers url
https://www.dropbox.com/s/bxwwdb81z0jg7pb/keplergl_2018-11-01T23%3A22%3A43.940Z.json?dl=0
->
https://dl.dropboxusercontent.com/s/bxwwdb81z0jg7pb/keplergl_2018-11-01T23%3A22%3A43.940Z.json
@param metadata
@returns {DropboxTypes.sharing.FileLinkMetadataReference} | [
"Override",
"dropbox",
"cloud",
"-",
"providers",
"url",
"https",
":",
"//",
"www",
".",
"dropbox",
".",
"com",
"/",
"s",
"/",
"bxwwdb81z0jg7pb",
"/",
"keplergl_2018",
"-",
"11",
"-",
"01T23%3A22%3A43",
".",
"940Z",
".",
"json?dl",
"=",
"0",
"-",
">",
... | 779238435707cc54335c2d00001e4b9334b314aa | https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/examples/demo-app/src/utils/cloud-providers/dropbox.js#L115-L117 | train | Override the url with the CORS free domain | [
30522,
3853,
2058,
15637,
3126,
2140,
1006,
24471,
2140,
1007,
1063,
2709,
24471,
2140,
1029,
24471,
2140,
1012,
14704,
1006,
1014,
1010,
24471,
2140,
1012,
5950,
11253,
1006,
1005,
1029,
1005,
1007,
1007,
1012,
5672,
1006,
5884,
1010,
2522... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ReactTraining/react-router | packages/react-router/modules/withRouter.js | withRouter | function withRouter(Component) {
const displayName = `withRouter(${Component.displayName || Component.name})`;
const C = props => {
const { wrappedComponentRef, ...remainingProps } = props;
return (
<RouterContext.Consumer>
{context => {
invariant(
context,
`... | javascript | function withRouter(Component) {
const displayName = `withRouter(${Component.displayName || Component.name})`;
const C = props => {
const { wrappedComponentRef, ...remainingProps } = props;
return (
<RouterContext.Consumer>
{context => {
invariant(
context,
`... | [
"function",
"withRouter",
"(",
"Component",
")",
"{",
"const",
"displayName",
"=",
"`",
"${",
"Component",
".",
"displayName",
"||",
"Component",
".",
"name",
"}",
"`",
";",
"const",
"C",
"=",
"props",
"=>",
"{",
"const",
"{",
"wrappedComponentRef",
",",
... | A public higher-order component to access the imperative API | [
"A",
"public",
"higher",
"-",
"order",
"component",
"to",
"access",
"the",
"imperative",
"API"
] | 82ce94c3b4e74f71018d104df6dc999801fa9ab2 | https://github.com/ReactTraining/react-router/blob/82ce94c3b4e74f71018d104df6dc999801fa9ab2/packages/react-router/modules/withRouter.js#L10-L44 | train | A function that wraps a component with a router | [
30522,
3853,
2007,
22494,
3334,
1006,
6922,
1007,
1063,
9530,
3367,
4653,
18442,
1027,
1036,
2007,
22494,
3334,
1006,
1002,
1063,
6922,
1012,
4653,
18442,
1064,
1064,
6922,
1012,
2171,
1065,
1007,
1036,
1025,
9530,
3367,
1039,
1027,
24387,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | get_sector_list | function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {
var buf = [], buf_chain = [];
if(!chkd) chkd = [];
var modulus = ssz - 1, j = 0, jj = 0;
for(j=start; j>=0;) {
chkd[j] = true;
buf[buf.length] = j;
buf_chain.push(sectors[j]);
var addr = fat_addrs[Math.floor(j*4/ssz)];
jj = ((j*4) & modulus)... | javascript | function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {
var buf = [], buf_chain = [];
if(!chkd) chkd = [];
var modulus = ssz - 1, j = 0, jj = 0;
for(j=start; j>=0;) {
chkd[j] = true;
buf[buf.length] = j;
buf_chain.push(sectors[j]);
var addr = fat_addrs[Math.floor(j*4/ssz)];
jj = ((j*4) & modulus)... | [
"function",
"get_sector_list",
"(",
"sectors",
",",
"start",
",",
"fat_addrs",
",",
"ssz",
",",
"chkd",
")",
"{",
"var",
"buf",
"=",
"[",
"]",
",",
"buf_chain",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"chkd",
")",
"chkd",
"=",
"[",
"]",
";",
"var",
... | Follow the linked list of sectors for a given starting point | [
"Follow",
"the",
"linked",
"list",
"of",
"sectors",
"for",
"a",
"given",
"starting",
"point"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L1553-L1568 | train | Get sector list | [
30522,
3853,
2131,
1035,
4753,
1035,
2862,
1006,
11105,
1010,
2707,
1010,
6638,
1035,
5587,
2869,
1010,
7020,
2480,
1010,
10381,
2243,
2094,
1007,
1063,
13075,
20934,
2546,
1027,
1031,
1033,
1010,
20934,
2546,
1035,
4677,
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... |
apache/incubator-echarts | src/coord/calendar/Calendar.js | function (nthWeek, day, range) {
var rangeInfo = this._getRangeInfo(range);
if (nthWeek > rangeInfo.weeks
|| (nthWeek === 0 && day < rangeInfo.fweek)
|| (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek)
) {
return false;
}
var nthDay = (... | javascript | function (nthWeek, day, range) {
var rangeInfo = this._getRangeInfo(range);
if (nthWeek > rangeInfo.weeks
|| (nthWeek === 0 && day < rangeInfo.fweek)
|| (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek)
) {
return false;
}
var nthDay = (... | [
"function",
"(",
"nthWeek",
",",
"day",
",",
"range",
")",
"{",
"var",
"rangeInfo",
"=",
"this",
".",
"_getRangeInfo",
"(",
"range",
")",
";",
"if",
"(",
"nthWeek",
">",
"rangeInfo",
".",
"weeks",
"||",
"(",
"nthWeek",
"===",
"0",
"&&",
"day",
"<",
... | get date by nthWeeks and week day in range
@private
@param {number} nthWeek the week
@param {number} day the week day
@param {Array} range [d1, d2]
@return {Object} | [
"get",
"date",
"by",
"nthWeeks",
"and",
"week",
"day",
"in",
"range"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/calendar/Calendar.js#L426-L441 | train | Get the date info for a given week and day | [
30522,
3853,
1006,
23961,
2232,
28075,
1010,
2154,
1010,
2846,
1007,
1063,
13075,
2846,
2378,
14876,
1027,
2023,
1012,
1035,
2131,
24388,
12377,
14876,
1006,
2846,
1007,
1025,
2065,
1006,
23961,
2232,
28075,
1028,
2846,
2378,
14876,
1012,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/less.js | function () {
var name, nameLC, args, alpha_ret, index = i;
name = /^([\w-]+|%|progid:[\w\.]+)\(/.exec(current);
if (!name) { return; }
name = name[1];
nameLC = name.toLowerCase();
if (nameLC === 'u... | javascript | function () {
var name, nameLC, args, alpha_ret, index = i;
name = /^([\w-]+|%|progid:[\w\.]+)\(/.exec(current);
if (!name) { return; }
name = name[1];
nameLC = name.toLowerCase();
if (nameLC === 'u... | [
"function",
"(",
")",
"{",
"var",
"name",
",",
"nameLC",
",",
"args",
",",
"alpha_ret",
",",
"index",
"=",
"i",
";",
"name",
"=",
"/",
"^([\\w-]+|%|progid:[\\w\\.]+)\\(",
"/",
".",
"exec",
"(",
"current",
")",
";",
"if",
"(",
"!",
"name",
")",
"{",
... | A function call rgb(255, 0, 255) We also try to catch IE's `alpha()`, but let the `alpha` parser deal with the details. The arguments are parsed with the `entities.arguments` parser. | [
"A",
"function",
"call",
"rgb",
"(",
"255",
"0",
"255",
")",
"We",
"also",
"try",
"to",
"catch",
"IE",
"s",
"alpha",
"()",
"but",
"let",
"the",
"alpha",
"parser",
"deal",
"with",
"the",
"details",
".",
"The",
"arguments",
"are",
"parsed",
"with",
"th... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L854-L884 | train | Parse the call | [
30522,
3853,
1006,
1007,
1063,
13075,
2171,
1010,
2171,
15472,
1010,
12098,
5620,
1010,
6541,
1035,
2128,
2102,
1010,
5950,
1027,
1045,
1025,
2171,
1027,
1013,
1034,
1006,
1031,
1032,
1059,
1011,
1033,
1009,
1064,
1003,
1064,
4013,
5856,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | mxSelectionCellsHandler | function mxSelectionCellsHandler(graph)
{
mxEventSource.call(this);
this.graph = graph;
this.handlers = new mxDictionary();
this.graph.addMouseListener(this);
this.refreshHandler = mxUtils.bind(this, function(sender, evt)
{
if (this.isEnabled())
{
this.refresh();
}
});
this.graph.getSelectionMode... | javascript | function mxSelectionCellsHandler(graph)
{
mxEventSource.call(this);
this.graph = graph;
this.handlers = new mxDictionary();
this.graph.addMouseListener(this);
this.refreshHandler = mxUtils.bind(this, function(sender, evt)
{
if (this.isEnabled())
{
this.refresh();
}
});
this.graph.getSelectionMode... | [
"function",
"mxSelectionCellsHandler",
"(",
"graph",
")",
"{",
"mxEventSource",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"graph",
"=",
"graph",
";",
"this",
".",
"handlers",
"=",
"new",
"mxDictionary",
"(",
")",
";",
"this",
".",
"graph",
".",
... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxSelectionCellsHandler
An event handler that manages cell handlers and invokes their mouse event
processing functions.
Group: Events
Event: mxEvent.ADD
Fires if a cell has been added to the selection. The <code>state</code>
propert... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxSelectionCellsHandler"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L71737-L71760 | train | The selection cell event handler | [
30522,
3853,
25630,
11246,
18491,
29109,
4877,
11774,
3917,
1006,
10629,
1007,
1063,
25630,
18697,
7666,
8162,
3401,
1012,
2655,
1006,
2023,
1007,
1025,
2023,
1012,
10629,
1027,
10629,
1025,
2023,
1012,
28213,
2015,
1027,
2047,
25630,
29201,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/JSUtils.js | nextToken | function nextToken() {
if (curOffset >= length) {
return false;
}
if (stream) {
// Set the start of the next token to the current stream position.
stream.start = stream.pos;
}
while (!stream || stream.eol()) {
... | javascript | function nextToken() {
if (curOffset >= length) {
return false;
}
if (stream) {
// Set the start of the next token to the current stream position.
stream.start = stream.pos;
}
while (!stream || stream.eol()) {
... | [
"function",
"nextToken",
"(",
")",
"{",
"if",
"(",
"curOffset",
">=",
"length",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"stream",
")",
"{",
"// Set the start of the next token to the current stream position.",
"stream",
".",
"start",
"=",
"stream",
"."... | Get the next token, updating the style and token to refer to the current token, and updating the curOffset to point to the end of the token (relative to the start of the original text). | [
"Get",
"the",
"next",
"token",
"updating",
"the",
"style",
"and",
"token",
"to",
"refer",
"to",
"the",
"current",
"token",
"and",
"updating",
"the",
"curOffset",
"to",
"point",
"to",
"the",
"end",
"of",
"the",
"token",
"(",
"relative",
"to",
"the",
"star... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/JSUtils.js#L201-L218 | train | Returns true if the next token in the stream | [
30522,
3853,
2279,
18715,
2368,
1006,
1007,
1063,
2065,
1006,
12731,
3217,
21807,
3388,
1028,
1027,
3091,
1007,
1063,
2709,
6270,
1025,
1065,
2065,
1006,
5460,
1007,
1063,
1013,
1013,
2275,
1996,
2707,
1997,
1996,
2279,
19204,
2000,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/editor/ImageViewer.js | _handleFileSystemChange | function _handleFileSystemChange(event, entry, added, removed) {
// this may have been called because files were added
// or removed to the file system. We don't care about those
if (!entry || entry.isDirectory) {
return;
}
// Look for a viewer for the changed file... | javascript | function _handleFileSystemChange(event, entry, added, removed) {
// this may have been called because files were added
// or removed to the file system. We don't care about those
if (!entry || entry.isDirectory) {
return;
}
// Look for a viewer for the changed file... | [
"function",
"_handleFileSystemChange",
"(",
"event",
",",
"entry",
",",
"added",
",",
"removed",
")",
"{",
"// this may have been called because files were added",
"// or removed to the file system. We don't care about those",
"if",
"(",
"!",
"entry",
"||",
"entry",
".",
... | Handles file system change events so we can refresh
image viewers for the files that changed on disk due to external editors
@param {jQuery.event} event - event object
@param {?File} file - file object that changed
@param {Array.<FileSystemEntry>=} added If entry is a Directory, contains zero or more added children
@pa... | [
"Handles",
"file",
"system",
"change",
"events",
"so",
"we",
"can",
"refresh",
"image",
"viewers",
"for",
"the",
"files",
"that",
"changed",
"on",
"disk",
"due",
"to",
"external",
"editors"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/ImageViewer.js#L437-L451 | train | Handle file system change | [
30522,
3853,
1035,
5047,
8873,
4244,
27268,
6633,
22305,
2063,
1006,
2724,
1010,
4443,
1010,
2794,
1010,
3718,
1007,
1063,
1013,
1013,
2023,
2089,
2031,
2042,
2170,
2138,
6764,
2020,
2794,
1013,
1013,
2030,
3718,
2000,
1996,
5371,
2291,
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... |
websockets/ws | lib/extension.js | push | function push(dest, name, elem) {
if (dest[name] === undefined) dest[name] = [elem];
else dest[name].push(elem);
} | javascript | function push(dest, name, elem) {
if (dest[name] === undefined) dest[name] = [elem];
else dest[name].push(elem);
} | [
"function",
"push",
"(",
"dest",
",",
"name",
",",
"elem",
")",
"{",
"if",
"(",
"dest",
"[",
"name",
"]",
"===",
"undefined",
")",
"dest",
"[",
"name",
"]",
"=",
"[",
"elem",
"]",
";",
"else",
"dest",
"[",
"name",
"]",
".",
"push",
"(",
"elem",... | Adds an offer to the map of extension offers or a parameter to the map of
parameters.
@param {Object} dest The map of extension offers or parameters
@param {String} name The extension or parameter name
@param {(Object|Boolean|String)} elem The extension parameters or the
parameter value
@private | [
"Adds",
"an",
"offer",
"to",
"the",
"map",
"of",
"extension",
"offers",
"or",
"a",
"parameter",
"to",
"the",
"map",
"of",
"parameters",
"."
] | 995c527c87d0d4833d8093c18dcfa2e4a41d9582 | https://github.com/websockets/ws/blob/995c527c87d0d4833d8093c18dcfa2e4a41d9582/lib/extension.js#L36-L39 | train | Push an element to an array | [
30522,
3853,
5245,
1006,
4078,
2102,
1010,
2171,
1010,
3449,
6633,
1007,
1063,
2065,
1006,
4078,
2102,
1031,
2171,
1033,
1027,
1027,
1027,
6151,
28344,
1007,
4078,
2102,
1031,
2171,
1033,
1027,
1031,
3449,
6633,
1033,
1025,
2842,
4078,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/table/mergedTableRemoveRow.js | _updateRowspan | function _updateRowspan(tableData, startRowIndex, endRowIndex) {
util.range(startRowIndex, endRowIndex + 1).forEach(rowIndex => {
tableData[rowIndex].forEach((cell, cellIndex) => {
if (util.isExisty(cell.rowMergeWith)) {
const merger = tableData[cell.rowMergeWith][cellIndex];
if (merger.row... | javascript | function _updateRowspan(tableData, startRowIndex, endRowIndex) {
util.range(startRowIndex, endRowIndex + 1).forEach(rowIndex => {
tableData[rowIndex].forEach((cell, cellIndex) => {
if (util.isExisty(cell.rowMergeWith)) {
const merger = tableData[cell.rowMergeWith][cellIndex];
if (merger.row... | [
"function",
"_updateRowspan",
"(",
"tableData",
",",
"startRowIndex",
",",
"endRowIndex",
")",
"{",
"util",
".",
"range",
"(",
"startRowIndex",
",",
"endRowIndex",
"+",
"1",
")",
".",
"forEach",
"(",
"rowIndex",
"=>",
"{",
"tableData",
"[",
"rowIndex",
"]",
... | Update rowspan to row merger.
@param {Array.<Array.<object>>} tableData - table data
@param {number} startRowIndex - start row index
@param {number} endRowIndex - end row index
@private | [
"Update",
"rowspan",
"to",
"row",
"merger",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/mergedTableRemoveRow.js#L64-L84 | train | Update rowspan of the table data | [
30522,
3853,
1035,
10651,
10524,
13102,
2319,
1006,
2795,
2850,
2696,
1010,
2707,
10524,
22254,
10288,
1010,
2203,
10524,
22254,
10288,
1007,
1063,
21183,
4014,
1012,
2846,
1006,
2707,
10524,
22254,
10288,
1010,
2203,
10524,
22254,
10288,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/FileTreeView.js | function () {
if (!this.props.visible) {
return;
}
var node = Preact.findDOMNode(this),
selectedNode = $(node.parentNode).find(this.props.selectedClassName).closest("li"),
selectionViewInfo = this.props.selectionViewInfo;
... | javascript | function () {
if (!this.props.visible) {
return;
}
var node = Preact.findDOMNode(this),
selectedNode = $(node.parentNode).find(this.props.selectedClassName).closest("li"),
selectionViewInfo = this.props.selectionViewInfo;
... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"props",
".",
"visible",
")",
"{",
"return",
";",
"}",
"var",
"node",
"=",
"Preact",
".",
"findDOMNode",
"(",
"this",
")",
",",
"selectedNode",
"=",
"$",
"(",
"node",
".",
"parentNode",
")",
... | When the component has updated in the DOM, reposition it to where the currently
selected node is located now. | [
"When",
"the",
"component",
"has",
"updated",
"in",
"the",
"DOM",
"reposition",
"it",
"to",
"where",
"the",
"currently",
"selected",
"node",
"is",
"located",
"now",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L1051-L1096 | train | This method is called when the selection is completely scrolled out of the view area. | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
999,
2023,
1012,
24387,
1012,
5710,
1007,
1063,
2709,
1025,
1065,
13075,
13045,
1027,
3653,
18908,
1012,
2424,
9527,
3630,
3207,
1006,
2023,
1007,
1010,
3479,
3630,
3207,
1027,
1002,
1006,
13045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
facebook/relay | packages/relay-runtime/handlers/connection/RelayConnectionHandler.js | update | function update(store: RecordSourceProxy, payload: HandleFieldPayload): void {
const record = store.get(payload.dataID);
if (!record) {
return;
}
const {
EDGES,
END_CURSOR,
HAS_NEXT_PAGE,
HAS_PREV_PAGE,
PAGE_INFO,
PAGE_INFO_TYPE,
START_CURSOR,
} = RelayConnectionInterface.get(... | javascript | function update(store: RecordSourceProxy, payload: HandleFieldPayload): void {
const record = store.get(payload.dataID);
if (!record) {
return;
}
const {
EDGES,
END_CURSOR,
HAS_NEXT_PAGE,
HAS_PREV_PAGE,
PAGE_INFO,
PAGE_INFO_TYPE,
START_CURSOR,
} = RelayConnectionInterface.get(... | [
"function",
"update",
"(",
"store",
":",
"RecordSourceProxy",
",",
"payload",
":",
"HandleFieldPayload",
")",
":",
"void",
"{",
"const",
"record",
"=",
"store",
".",
"get",
"(",
"payload",
".",
"dataID",
")",
";",
"if",
"(",
"!",
"record",
")",
"{",
"r... | @public
A default runtime handler for connection fields that appends newly fetched
edges onto the end of a connection, regardless of the arguments used to fetch
those edges. | [
"@public"
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-runtime/handlers/connection/RelayConnectionHandler.js#L48-L208 | train | Update the record with the given handle field payload | [
30522,
3853,
10651,
1006,
3573,
1024,
2636,
8162,
3401,
21572,
18037,
1010,
18093,
1024,
5047,
3790,
4502,
8516,
10441,
2094,
1007,
1024,
11675,
1063,
9530,
3367,
2501,
1027,
3573,
1012,
2131,
1006,
18093,
1012,
2951,
3593,
1007,
1025,
2065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/BaseController.js | function (oEvent) {
var oSource = oEvent.getSource ? oEvent.getSource() : oEvent.target;
if (!this.oDisclaimerPopover) {
sap.ui.core.Fragment.load({
name: "sap.ui.documentation.sdk.view.LegalDisclaimerPopover"
}).then(function (oPopover) {
this.oDisclaimerPopover = oPopover;
oPopov... | javascript | function (oEvent) {
var oSource = oEvent.getSource ? oEvent.getSource() : oEvent.target;
if (!this.oDisclaimerPopover) {
sap.ui.core.Fragment.load({
name: "sap.ui.documentation.sdk.view.LegalDisclaimerPopover"
}).then(function (oPopover) {
this.oDisclaimerPopover = oPopover;
oPopov... | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"oSource",
"=",
"oEvent",
".",
"getSource",
"?",
"oEvent",
".",
"getSource",
"(",
")",
":",
"oEvent",
".",
"target",
";",
"if",
"(",
"!",
"this",
".",
"oDisclaimerPopover",
")",
"{",
"sap",
".",
"ui",
".",
... | Opens a legal disclaimer for Links Popover.
@param {sap.ui.base.Event} oEvent: the <code>Image</code> press event
@public | [
"Opens",
"a",
"legal",
"disclaimer",
"for",
"Links",
"Popover",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/BaseController.js#L134-L152 | train | Opens the legal disclaimer popover | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
9808,
8162,
3401,
1027,
1051,
18697,
3372,
1012,
4152,
8162,
3401,
1029,
1051,
18697,
3372,
1012,
4152,
8162,
3401,
1006,
1007,
1024,
1051,
18697,
3372,
1012,
4539,
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/date/Japanese.js | toJapanese | function toJapanese(oGregorian) {
var iEra = UniversalDate.getEraByDate(CalendarType.Japanese, oGregorian.year, oGregorian.month, oGregorian.day),
iEraStartYear = UniversalDate.getEraStartDate(CalendarType.Japanese, iEra).year;
return {
era: iEra,
year: oGregorian.year - iEraStartYear + 1,
month: oGrego... | javascript | function toJapanese(oGregorian) {
var iEra = UniversalDate.getEraByDate(CalendarType.Japanese, oGregorian.year, oGregorian.month, oGregorian.day),
iEraStartYear = UniversalDate.getEraStartDate(CalendarType.Japanese, iEra).year;
return {
era: iEra,
year: oGregorian.year - iEraStartYear + 1,
month: oGrego... | [
"function",
"toJapanese",
"(",
"oGregorian",
")",
"{",
"var",
"iEra",
"=",
"UniversalDate",
".",
"getEraByDate",
"(",
"CalendarType",
".",
"Japanese",
",",
"oGregorian",
".",
"year",
",",
"oGregorian",
".",
"month",
",",
"oGregorian",
".",
"day",
")",
",",
... | Find the matching japanese date for the given gregorian date
@param {object} oGregorian
@return {object} | [
"Find",
"the",
"matching",
"japanese",
"date",
"for",
"the",
"given",
"gregorian",
"date"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/date/Japanese.js#L53-L62 | train | Converts a gregorian date to a japanese date | [
30522,
3853,
2000,
3900,
9739,
6810,
1006,
13958,
2890,
20255,
2937,
1007,
1063,
13075,
29464,
2527,
1027,
5415,
13701,
1012,
2131,
6906,
3762,
13701,
1006,
8094,
13874,
1012,
2887,
1010,
13958,
2890,
20255,
2937,
1012,
2095,
1010,
13958,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/ExpressionParser.js | CONDITIONAL | function CONDITIONAL(fnCondition, fnThen, fnElse, aParts) {
return fnCondition(aParts) ? fnThen(aParts) : fnElse(aParts);
} | javascript | function CONDITIONAL(fnCondition, fnThen, fnElse, aParts) {
return fnCondition(aParts) ? fnThen(aParts) : fnElse(aParts);
} | [
"function",
"CONDITIONAL",
"(",
"fnCondition",
",",
"fnThen",
",",
"fnElse",
",",
"aParts",
")",
"{",
"return",
"fnCondition",
"(",
"aParts",
")",
"?",
"fnThen",
"(",
"aParts",
")",
":",
"fnElse",
"(",
"aParts",
")",
";",
"}"
] | Formatter function for executing the conditional operator with the given condition, "then"
and "else" clause.
@param {function} fnCondition - formatter function for the condition
@param {function} fnThen - formatter function for the "then" clause
@param {function} fnElse- formatter function for the "else" clause
@param... | [
"Formatter",
"function",
"for",
"executing",
"the",
"conditional",
"operator",
"with",
"the",
"given",
"condition",
"then",
"and",
"else",
"clause",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ExpressionParser.js#L339-L341 | train | Returns true if the condition is true else if the condition is false | [
30522,
3853,
18462,
1006,
1042,
15305,
16089,
3508,
1010,
1042,
3372,
10222,
1010,
1042,
11877,
3366,
1010,
4237,
2015,
1007,
1063,
2709,
1042,
15305,
16089,
3508,
1006,
4237,
2015,
1007,
1029,
1042,
3372,
10222,
1006,
4237,
2015,
1007,
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... |
adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js | _traverseRules | function _traverseRules(sheet, base) {
var i,
href = sheet.href,
cssRules;
// Deal with Firefox's SecurityError when accessing sheets
// from other domains. Chrome will safely return `undefined`.
try {
cssRules = sheet.cssR... | javascript | function _traverseRules(sheet, base) {
var i,
href = sheet.href,
cssRules;
// Deal with Firefox's SecurityError when accessing sheets
// from other domains. Chrome will safely return `undefined`.
try {
cssRules = sheet.cssR... | [
"function",
"_traverseRules",
"(",
"sheet",
",",
"base",
")",
"{",
"var",
"i",
",",
"href",
"=",
"sheet",
".",
"href",
",",
"cssRules",
";",
"// Deal with Firefox's SecurityError when accessing sheets",
"// from other domains. Chrome will safely return `undefined`.",
"try",... | traverse @import rules | [
"traverse"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js#L57-L84 | train | traverseRules - Traverse rules from a sheet | [
30522,
3853,
1035,
20811,
6820,
4244,
1006,
7123,
1010,
2918,
1007,
1063,
13075,
1045,
1010,
17850,
12879,
1027,
7123,
1012,
17850,
12879,
1010,
20116,
21338,
16308,
1025,
1013,
1013,
3066,
2007,
2543,
14876,
2595,
1005,
1055,
3036,
2121,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/CustomizingConfiguration.js | function(sControllerName, vObject) {
var oResultConfig;
findConfig(CONFIG_CONTROLLER_EXTENSIONS, vObject, function(oConfig) {
oResultConfig = oConfig[sControllerName];
return !!oResultConfig;
});
return oResultConfig;
} | javascript | function(sControllerName, vObject) {
var oResultConfig;
findConfig(CONFIG_CONTROLLER_EXTENSIONS, vObject, function(oConfig) {
oResultConfig = oConfig[sControllerName];
return !!oResultConfig;
});
return oResultConfig;
} | [
"function",
"(",
"sControllerName",
",",
"vObject",
")",
"{",
"var",
"oResultConfig",
";",
"findConfig",
"(",
"CONFIG_CONTROLLER_EXTENSIONS",
",",
"vObject",
",",
"function",
"(",
"oConfig",
")",
"{",
"oResultConfig",
"=",
"oConfig",
"[",
"sControllerName",
"]",
... | returns the configuration of the controller extensions for the given
controller name
@private | [
"returns",
"the",
"configuration",
"of",
"the",
"controller",
"extensions",
"for",
"the",
"given",
"controller",
"name"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/CustomizingConfiguration.js#L185-L192 | train | Returns the configuration of the controller extension | [
30522,
3853,
1006,
8040,
12162,
26611,
18442,
1010,
29536,
2497,
20614,
1007,
1063,
13075,
10848,
23722,
13535,
2239,
8873,
2290,
1025,
2424,
8663,
8873,
2290,
1006,
9530,
8873,
2290,
1035,
11486,
1035,
14305,
1010,
29536,
2497,
20614,
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... | |
nhn/tui.editor | src/js/extensions/colorSyntax.js | changeDecColorToHex | function changeDecColorToHex(color) {
let hexColor = parseInt(color, 10);
hexColor = hexColor.toString(16);
hexColor = doubleZeroPad(hexColor);
return hexColor;
} | javascript | function changeDecColorToHex(color) {
let hexColor = parseInt(color, 10);
hexColor = hexColor.toString(16);
hexColor = doubleZeroPad(hexColor);
return hexColor;
} | [
"function",
"changeDecColorToHex",
"(",
"color",
")",
"{",
"let",
"hexColor",
"=",
"parseInt",
"(",
"color",
",",
"10",
")",
";",
"hexColor",
"=",
"hexColor",
".",
"toString",
"(",
"16",
")",
";",
"hexColor",
"=",
"doubleZeroPad",
"(",
"hexColor",
")",
"... | change individual dec color value to hex color
@param {string} color - individual color value
@returns {string} - zero padded color string
@ignore | [
"change",
"individual",
"dec",
"color",
"value",
"to",
"hex",
"color"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/colorSyntax.js#L306-L312 | train | Change the color of a dec to a hex color | [
30522,
3853,
2904,
8586,
18717,
3406,
5369,
2595,
1006,
3609,
1007,
1063,
2292,
2002,
2595,
18717,
1027,
11968,
20240,
3372,
1006,
3609,
1010,
2184,
1007,
1025,
2002,
2595,
18717,
1027,
2002,
2595,
18717,
1012,
2000,
3367,
4892,
1006,
2385,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/moment/src/lib/duration/humanize.js | substituteTimeAgo | function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
} | javascript | function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
} | [
"function",
"substituteTimeAgo",
"(",
"string",
",",
"number",
",",
"withoutSuffix",
",",
"isFuture",
",",
"locale",
")",
"{",
"return",
"locale",
".",
"relativeTime",
"(",
"number",
"||",
"1",
",",
"!",
"!",
"withoutSuffix",
",",
"string",
",",
"isFuture",
... | helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize | [
"helper",
"function",
"for",
"moment",
".",
"fn",
".",
"from",
"moment",
".",
"fn",
".",
"fromNow",
"and",
"moment",
".",
"duration",
".",
"fn",
".",
"humanize"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/moment/src/lib/duration/humanize.js#L14-L16 | train | Substitute time with a suffix | [
30522,
3853,
7681,
7292,
23692,
1006,
5164,
1010,
2193,
1010,
2302,
6342,
26989,
2595,
1010,
2003,
11263,
11244,
1010,
2334,
2063,
1007,
1063,
2709,
2334,
2063,
1012,
5816,
7292,
1006,
2193,
1064,
1064,
1015,
1010,
999,
999,
2302,
6342,
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... |
GeekyAnts/vue-native-core | src/platforms/weex/runtime/modules/transition.js | getEnterTargetState | function getEnterTargetState (el, stylesheet, startClass, endClass, activeClass, vm) {
const targetState = {}
const startState = stylesheet[startClass]
const endState = stylesheet[endClass]
const activeState = stylesheet[activeClass]
// 1. fallback to element's default styling
if (startState) {
for (con... | javascript | function getEnterTargetState (el, stylesheet, startClass, endClass, activeClass, vm) {
const targetState = {}
const startState = stylesheet[startClass]
const endState = stylesheet[endClass]
const activeState = stylesheet[activeClass]
// 1. fallback to element's default styling
if (startState) {
for (con... | [
"function",
"getEnterTargetState",
"(",
"el",
",",
"stylesheet",
",",
"startClass",
",",
"endClass",
",",
"activeClass",
",",
"vm",
")",
"{",
"const",
"targetState",
"=",
"{",
"}",
"const",
"startState",
"=",
"stylesheet",
"[",
"startClass",
"]",
"const",
"e... | determine the target animation style for an entering transition. | [
"determine",
"the",
"target",
"animation",
"style",
"for",
"an",
"entering",
"transition",
"."
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/src/platforms/weex/runtime/modules/transition.js#L227-L265 | train | Get enter target state | [
30522,
3853,
2131,
29110,
7559,
18150,
9153,
2618,
1006,
3449,
1010,
6782,
21030,
2102,
1010,
2707,
26266,
1010,
2203,
26266,
1010,
3161,
26266,
1010,
1058,
2213,
1007,
1063,
9530,
3367,
7889,
12259,
1027,
1063,
1065,
9530,
3367,
4627,
1225... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TablePointerExtension.js | function(oTable, iColIndex) {
var aVisibleColumns = oTable._getVisibleColumns(),
oColumn;
if (iColIndex >= 0 && iColIndex < aVisibleColumns.length) {
oColumn = aVisibleColumns[iColIndex];
if (!oColumn.getAutoResizable() || !oColumn.getResizable()) {
return;
}
var iNewWidth = ColumnResiz... | javascript | function(oTable, iColIndex) {
var aVisibleColumns = oTable._getVisibleColumns(),
oColumn;
if (iColIndex >= 0 && iColIndex < aVisibleColumns.length) {
oColumn = aVisibleColumns[iColIndex];
if (!oColumn.getAutoResizable() || !oColumn.getResizable()) {
return;
}
var iNewWidth = ColumnResiz... | [
"function",
"(",
"oTable",
",",
"iColIndex",
")",
"{",
"var",
"aVisibleColumns",
"=",
"oTable",
".",
"_getVisibleColumns",
"(",
")",
",",
"oColumn",
";",
"if",
"(",
"iColIndex",
">=",
"0",
"&&",
"iColIndex",
"<",
"aVisibleColumns",
".",
"length",
")",
"{",... | /*
Computes the optimal width for a column and changes the width if the auto resize feature is activated for the column.
Experimental feature. | [
"/",
"*",
"Computes",
"the",
"optimal",
"width",
"for",
"a",
"column",
"and",
"changes",
"the",
"width",
"if",
"the",
"auto",
"resize",
"feature",
"is",
"activated",
"for",
"the",
"column",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js#L266-L282 | train | Calculates the width of the column if the column is auto - resizable. | [
30522,
3853,
1006,
27178,
3085,
1010,
24582,
18861,
3207,
2595,
1007,
1063,
13075,
20704,
17417,
3468,
25778,
2819,
3619,
1027,
27178,
3085,
1012,
1035,
2131,
11365,
7028,
25778,
2819,
3619,
1006,
1007,
1010,
1051,
25778,
2819,
2078,
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/model/odata/_ODataMetaModelUtils.js | function (o, sTypeClass) {
if (!o.extensions) {
return;
}
o.extensions.forEach(function (oExtension) {
if (oExtension.namespace === "http://www.sap.com/Protocols/SAPData") {
o["sap:" + oExtension.name] = oExtension.value;
Utils.addV4Annotation(o, oExtension, sTypeClass);
}
});
// a... | javascript | function (o, sTypeClass) {
if (!o.extensions) {
return;
}
o.extensions.forEach(function (oExtension) {
if (oExtension.namespace === "http://www.sap.com/Protocols/SAPData") {
o["sap:" + oExtension.name] = oExtension.value;
Utils.addV4Annotation(o, oExtension, sTypeClass);
}
});
// a... | [
"function",
"(",
"o",
",",
"sTypeClass",
")",
"{",
"if",
"(",
"!",
"o",
".",
"extensions",
")",
"{",
"return",
";",
"}",
"o",
".",
"extensions",
".",
"forEach",
"(",
"function",
"(",
"oExtension",
")",
"{",
"if",
"(",
"oExtension",
".",
"namespace",
... | Lift all extensions from the <a href="http://www.sap.com/Protocols/SAPData"> SAP
Annotations for OData Version 2.0</a> namespace up as attributes with "sap:" prefix.
@param {object} o
any object
@param {string} sTypeClass
the type class of the given object; supported type classes are "Property" and
"EntitySet" | [
"Lift",
"all",
"extensions",
"from",
"the",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"sap",
".",
"com",
"/",
"Protocols",
"/",
"SAPData",
">",
"SAP",
"Annotations",
"for",
"OData",
"Version",
"2",
".",
"0<",
"/",
"a",
">",
"namespace",
"up",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L910-L942 | train | Adds V4 annotations to the extension list | [
30522,
3853,
1006,
1051,
1010,
2358,
18863,
26266,
1007,
1063,
2065,
1006,
999,
1051,
1012,
14305,
1007,
1063,
2709,
1025,
1065,
1051,
1012,
14305,
1012,
18921,
6776,
1006,
3853,
1006,
1051,
10288,
29048,
1007,
1063,
2065,
1006,
1051,
10288... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | features/extra/cleanup.js | function(bucket, callback) {
var s3 = new AWS.S3({maxRetries: 100});
s3.deleteBucket({Bucket: bucket}, function(err, data) {
callback(err);
});
} | javascript | function(bucket, callback) {
var s3 = new AWS.S3({maxRetries: 100});
s3.deleteBucket({Bucket: bucket}, function(err, data) {
callback(err);
});
} | [
"function",
"(",
"bucket",
",",
"callback",
")",
"{",
"var",
"s3",
"=",
"new",
"AWS",
".",
"S3",
"(",
"{",
"maxRetries",
":",
"100",
"}",
")",
";",
"s3",
".",
"deleteBucket",
"(",
"{",
"Bucket",
":",
"bucket",
"}",
",",
"function",
"(",
"err",
",... | /*
Delete bucket | [
"/",
"*",
"Delete",
"bucket"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/cleanup.js#L73-L78 | train | Delete the specified bucket | [
30522,
3853,
1006,
13610,
1010,
2655,
5963,
1007,
1063,
13075,
1055,
2509,
1027,
2047,
22091,
2015,
1012,
1055,
2509,
1006,
1063,
4098,
13465,
5134,
1024,
2531,
1065,
1007,
1025,
1055,
2509,
1012,
3972,
12870,
24204,
3388,
1006,
1063,
13610... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
nodejs/node-gyp | lib/build.js | doBuild | function doBuild () {
// Enable Verbose build
var verbose = log.levels[log.level] <= log.levels.verbose
if (!win && verbose) {
argv.push('V=1')
}
if (win && !verbose) {
argv.push('/clp:Verbosity=minimal')
}
if (win) {
// Turn off the Microsoft logo on Windows
argv.pu... | javascript | function doBuild () {
// Enable Verbose build
var verbose = log.levels[log.level] <= log.levels.verbose
if (!win && verbose) {
argv.push('V=1')
}
if (win && !verbose) {
argv.push('/clp:Verbosity=minimal')
}
if (win) {
// Turn off the Microsoft logo on Windows
argv.pu... | [
"function",
"doBuild",
"(",
")",
"{",
"// Enable Verbose build",
"var",
"verbose",
"=",
"log",
".",
"levels",
"[",
"log",
".",
"level",
"]",
"<=",
"log",
".",
"levels",
".",
"verbose",
"if",
"(",
"!",
"win",
"&&",
"verbose",
")",
"{",
"argv",
".",
"p... | Actually spawn the process and compile the module. | [
"Actually",
"spawn",
"the",
"process",
"and",
"compile",
"the",
"module",
"."
] | 721eb691cf15556cc2700eda0558d5bad5f84232 | https://github.com/nodejs/node-gyp/blob/721eb691cf15556cc2700eda0558d5bad5f84232/lib/build.js#L186-L248 | train | Build the project. | [
30522,
3853,
2079,
8569,
4014,
2094,
1006,
1007,
1063,
1013,
1013,
9585,
12034,
9232,
3857,
13075,
12034,
9232,
1027,
8833,
1012,
3798,
1031,
8833,
1012,
2504,
1033,
1026,
1027,
8833,
1012,
30524,
2615,
1012,
5245,
1006,
1005,
1013,
18856,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | src/platforms/platform.dom.js | createResizer | function createResizer(handler) {
var maxSize = 1000000;
// NOTE(SB) Don't use innerHTML because it could be considered unsafe.
// https://github.com/chartjs/Chart.js/issues/5902
var resizer = createDiv(CSS_SIZE_MONITOR);
var expand = createDiv(CSS_SIZE_MONITOR + '-expand');
var shrink = createDiv(CSS_SIZE_MONIT... | javascript | function createResizer(handler) {
var maxSize = 1000000;
// NOTE(SB) Don't use innerHTML because it could be considered unsafe.
// https://github.com/chartjs/Chart.js/issues/5902
var resizer = createDiv(CSS_SIZE_MONITOR);
var expand = createDiv(CSS_SIZE_MONITOR + '-expand');
var shrink = createDiv(CSS_SIZE_MONIT... | [
"function",
"createResizer",
"(",
"handler",
")",
"{",
"var",
"maxSize",
"=",
"1000000",
";",
"// NOTE(SB) Don't use innerHTML because it could be considered unsafe.",
"// https://github.com/chartjs/Chart.js/issues/5902",
"var",
"resizer",
"=",
"createDiv",
"(",
"CSS_SIZE_MONITOR... | Implementation based on https://github.com/marcj/css-element-queries | [
"Implementation",
"based",
"on",
"https",
":",
"//",
"github",
".",
"com",
"/",
"marcj",
"/",
"css",
"-",
"element",
"-",
"queries"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/platforms/platform.dom.js#L178-L208 | train | Creates a resizer div | [
30522,
3853,
3443,
6072,
17629,
1006,
28213,
1007,
1063,
13075,
4098,
5332,
4371,
1027,
6694,
8889,
2692,
1025,
1013,
1013,
3602,
1006,
24829,
1007,
2123,
1005,
1056,
2224,
5110,
11039,
19968,
2138,
2009,
2071,
2022,
2641,
25135,
1012,
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... |
dcloudio/mui | examples/hello-mui/js/mui.js | function(target) {
parentNode = target.parentNode;
if (parentNode) {
if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) {
return parentNode;
} else {
parentNode = parentNode.parentNode;
if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) {
return parentNode;
}
}
}
} | javascript | function(target) {
parentNode = target.parentNode;
if (parentNode) {
if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) {
return parentNode;
} else {
parentNode = parentNode.parentNode;
if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) {
return parentNode;
}
}
}
} | [
"function",
"(",
"target",
")",
"{",
"parentNode",
"=",
"target",
".",
"parentNode",
";",
"if",
"(",
"parentNode",
")",
"{",
"if",
"(",
"parentNode",
".",
"classList",
".",
"contains",
"(",
"CLASS_OFF_CANVAS_WRAP",
")",
")",
"{",
"return",
"parentNode",
";... | hash to offcanvas | [
"hash",
"to",
"offcanvas"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/hello-mui/js/mui.js#L6002-L6014 | train | Returns the parent of the target node | [
30522,
3853,
1006,
4539,
1007,
1063,
6687,
3630,
3207,
1027,
4539,
1012,
6687,
3630,
3207,
1025,
2065,
1006,
6687,
3630,
3207,
1007,
1063,
2065,
1006,
6687,
3630,
3207,
1012,
2465,
9863,
1012,
3397,
1006,
2465,
1035,
2125,
1035,
10683,
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... | |
moment/luxon | src/duration.js | normalizeValues | function normalizeValues(matrix, vals) {
reverseUnits.reduce((previous, current) => {
if (!isUndefined(vals[current])) {
if (previous) {
convert(matrix, vals, previous, vals, current);
}
return current;
} else {
return previous;
}
}, null);
} | javascript | function normalizeValues(matrix, vals) {
reverseUnits.reduce((previous, current) => {
if (!isUndefined(vals[current])) {
if (previous) {
convert(matrix, vals, previous, vals, current);
}
return current;
} else {
return previous;
}
}, null);
} | [
"function",
"normalizeValues",
"(",
"matrix",
",",
"vals",
")",
"{",
"reverseUnits",
".",
"reduce",
"(",
"(",
"previous",
",",
"current",
")",
"=>",
"{",
"if",
"(",
"!",
"isUndefined",
"(",
"vals",
"[",
"current",
"]",
")",
")",
"{",
"if",
"(",
"prev... | NB: mutates parameters | [
"NB",
":",
"mutates",
"parameters"
] | 236f2badea297ee73421aa39a83e06177c1be6d0 | https://github.com/moment/luxon/blob/236f2badea297ee73421aa39a83e06177c1be6d0/src/duration.js#L137-L148 | train | Normalize the values of a given matrix | [
30522,
3853,
3671,
4697,
10175,
15808,
1006,
8185,
1010,
11748,
2015,
1007,
1063,
7901,
19496,
3215,
1012,
5547,
1006,
1006,
3025,
1010,
2783,
1007,
1027,
1028,
1063,
2065,
1006,
999,
2003,
8630,
28344,
1006,
11748,
2015,
1031,
2783,
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... |
NetEase/pomelo | lib/components/connector.js | function(route) {
if (!route) {
return null;
}
var idx = route.indexOf('.');
if (idx < 0) {
return null;
}
return route.substring(0, idx);
} | javascript | function(route) {
if (!route) {
return null;
}
var idx = route.indexOf('.');
if (idx < 0) {
return null;
}
return route.substring(0, idx);
} | [
"function",
"(",
"route",
")",
"{",
"if",
"(",
"!",
"route",
")",
"{",
"return",
"null",
";",
"}",
"var",
"idx",
"=",
"route",
".",
"indexOf",
"(",
"'.'",
")",
";",
"if",
"(",
"idx",
"<",
"0",
")",
"{",
"return",
"null",
";",
"}",
"return",
"... | Get server type form request message. | [
"Get",
"server",
"type",
"form",
"request",
"message",
"."
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/components/connector.js#L406-L415 | train | Get the route name from the route string | [
30522,
3853,
1006,
2799,
1007,
1063,
2065,
1006,
999,
2799,
1007,
1063,
2709,
19701,
1025,
1065,
13075,
8909,
2595,
1027,
2799,
1012,
5950,
11253,
1006,
1005,
1012,
1005,
1007,
1025,
2065,
1006,
8909,
2595,
1026,
1014,
1007,
1063,
2709,
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/filesystem/impls/appshell/node/FileWatcherManager.js | unwatchPath | function unwatchPath(path) {
Object.keys(_watcherMap).forEach(function (keyPath) {
if (keyPath.indexOf(path) === 0) {
_unwatchPath(keyPath);
}
});
} | javascript | function unwatchPath(path) {
Object.keys(_watcherMap).forEach(function (keyPath) {
if (keyPath.indexOf(path) === 0) {
_unwatchPath(keyPath);
}
});
} | [
"function",
"unwatchPath",
"(",
"path",
")",
"{",
"Object",
".",
"keys",
"(",
"_watcherMap",
")",
".",
"forEach",
"(",
"function",
"(",
"keyPath",
")",
"{",
"if",
"(",
"keyPath",
".",
"indexOf",
"(",
"path",
")",
"===",
"0",
")",
"{",
"_unwatchPath",
... | Un-watch a file or directory. For directories, unwatch all descendants.
@param {string} path File or directory to unwatch. | [
"Un",
"-",
"watch",
"a",
"file",
"or",
"directory",
".",
"For",
"directories",
"unwatch",
"all",
"descendants",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/node/FileWatcherManager.js#L88-L94 | train | Unwatch a file or directory | [
30522,
3853,
4895,
18866,
15069,
1006,
4130,
1007,
1063,
4874,
1012,
6309,
1006,
1035,
3422,
2121,
2863,
2361,
1007,
1012,
18921,
6776,
1006,
3853,
1006,
3145,
15069,
1007,
1063,
2065,
1006,
3145,
15069,
1012,
5950,
11253,
1006,
4130,
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... |
SheetJS/js-xlsx | xlsx.js | parse_PtgAreaErr3d | function parse_PtgAreaErr3d(blob, length, opts) {
var type = (blob[blob.l++] & 0x60) >> 5;
var ixti = blob.read_shift(2);
var w = 8;
if(opts) switch(opts.biff) {
case 5: blob.l += 12; w = 6; break;
case 12: w = 12; break;
}
blob.l += w;
return [type, ixti];
} | javascript | function parse_PtgAreaErr3d(blob, length, opts) {
var type = (blob[blob.l++] & 0x60) >> 5;
var ixti = blob.read_shift(2);
var w = 8;
if(opts) switch(opts.biff) {
case 5: blob.l += 12; w = 6; break;
case 12: w = 12; break;
}
blob.l += w;
return [type, ixti];
} | [
"function",
"parse_PtgAreaErr3d",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"var",
"type",
"=",
"(",
"blob",
"[",
"blob",
".",
"l",
"++",
"]",
"&",
"0x60",
")",
">>",
"5",
";",
"var",
"ixti",
"=",
"blob",
".",
"read_shift",
"(",
"2",
")"... | /* [MS-XLS] 2.5.198.30 ; [MS-XLSB] 2.5.97.21 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"5",
".",
"198",
".",
"30",
";",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"5",
".",
"97",
".",
"21"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L10331-L10341 | train | Parse an error in the PTG area. | [
30522,
3853,
11968,
3366,
1035,
13866,
6843,
5243,
2121,
2099,
29097,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
13075,
2828,
1027,
1006,
1038,
4135,
2497,
1031,
1038,
4135,
2497,
1012,
1048,
1009,
1009,
1033,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/quotes.js | isJSXLiteral | function isJSXLiteral(node) {
return node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment";
} | javascript | function isJSXLiteral(node) {
return node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment";
} | [
"function",
"isJSXLiteral",
"(",
"node",
")",
"{",
"return",
"node",
".",
"parent",
".",
"type",
"===",
"\"JSXAttribute\"",
"||",
"node",
".",
"parent",
".",
"type",
"===",
"\"JSXElement\"",
"||",
"node",
".",
"parent",
".",
"type",
"===",
"\"JSXFragment\"",... | Determines if a given node is part of JSX syntax.
This function returns `true` in the following cases:
- `<div className="foo"></div>` ... If the literal is an attribute value, the parent of the literal is `JSXAttribute`.
- `<div>foo</div>` ... If the literal is a text content, the parent of the literal is `JSXElemen... | [
"Determines",
"if",
"a",
"given",
"node",
"is",
"part",
"of",
"JSX",
"syntax",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/quotes.js#L151-L153 | train | Check if node is a JSX literal | [
30522,
3853,
2003,
22578,
2595,
22779,
7941,
1006,
13045,
1007,
1063,
2709,
13045,
1012,
6687,
1012,
2828,
1027,
1027,
1027,
1000,
1046,
2015,
18684,
4779,
3089,
8569,
2618,
1000,
1064,
1064,
13045,
1012,
6687,
1012,
2828,
1027,
1027,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
babel/babel | packages/babel-helper-module-transforms/src/index.js | buildExportInitializationStatements | function buildExportInitializationStatements(
programPath: NodePath,
metadata: ModuleMetadata,
loose: boolean = false,
) {
const initStatements = [];
const exportNames = [];
for (const [localName, data] of metadata.local) {
if (data.kind === "import") {
// No-open since these are explicitly set w... | javascript | function buildExportInitializationStatements(
programPath: NodePath,
metadata: ModuleMetadata,
loose: boolean = false,
) {
const initStatements = [];
const exportNames = [];
for (const [localName, data] of metadata.local) {
if (data.kind === "import") {
// No-open since these are explicitly set w... | [
"function",
"buildExportInitializationStatements",
"(",
"programPath",
":",
"NodePath",
",",
"metadata",
":",
"ModuleMetadata",
",",
"loose",
":",
"boolean",
"=",
"false",
",",
")",
"{",
"const",
"initStatements",
"=",
"[",
"]",
";",
"const",
"exportNames",
"=",... | Create a set of statements that will initialize all of the statically-known
export names with their expected values. | [
"Create",
"a",
"set",
"of",
"statements",
"that",
"will",
"initialize",
"all",
"of",
"the",
"statically",
"-",
"known",
"export",
"names",
"with",
"their",
"expected",
"values",
"."
] | 1969e6b6aa7d90be3fbb3aca98ea96849656a55a | https://github.com/babel/babel/blob/1969e6b6aa7d90be3fbb3aca98ea96849656a55a/packages/babel-helper-module-transforms/src/index.js#L310-L350 | train | Build the initialization statements for a module | [
30522,
3853,
3857,
10288,
6442,
5498,
20925,
22318,
12259,
8163,
1006,
2565,
15069,
1024,
13045,
15069,
1010,
27425,
1024,
11336,
11368,
8447,
2696,
1010,
6065,
1024,
22017,
20898,
1027,
6270,
1010,
1007,
1063,
9530,
3367,
1999,
12762,
12259,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ReactiveX/rxjs | docs_app/src/app/search/search-worker.js | handleMessage | function handleMessage(message) {
var type = message.data.type;
var id = message.data.id;
var payload = message.data.payload;
switch(type) {
case 'load-index':
makeRequest(SEARCH_TERMS_URL, function(searchInfo) {
index = createIndex(loadIndex(searchInfo));
self.postMessage({type: type,... | javascript | function handleMessage(message) {
var type = message.data.type;
var id = message.data.id;
var payload = message.data.payload;
switch(type) {
case 'load-index':
makeRequest(SEARCH_TERMS_URL, function(searchInfo) {
index = createIndex(loadIndex(searchInfo));
self.postMessage({type: type,... | [
"function",
"handleMessage",
"(",
"message",
")",
"{",
"var",
"type",
"=",
"message",
".",
"data",
".",
"type",
";",
"var",
"id",
"=",
"message",
".",
"data",
".",
"id",
";",
"var",
"payload",
"=",
"message",
".",
"data",
".",
"payload",
";",
"switch... | The worker receives a message to load the index and to query the index | [
"The",
"worker",
"receives",
"a",
"message",
"to",
"load",
"the",
"index",
"and",
"to",
"query",
"the",
"index"
] | 1037a1d1e6b80c7218e7ffdf8c0d96a612653a4f | https://github.com/ReactiveX/rxjs/blob/1037a1d1e6b80c7218e7ffdf8c0d96a612653a4f/docs_app/src/app/search/search-worker.js#L42-L59 | train | handle a message from the cluster | [
30522,
3853,
5047,
7834,
3736,
3351,
1006,
4471,
1007,
1063,
13075,
2828,
1027,
4471,
1012,
2951,
1012,
2828,
1025,
13075,
8909,
1027,
4471,
1012,
2951,
1012,
8909,
1025,
13075,
18093,
1027,
4471,
1012,
2951,
1012,
18093,
1025,
6942,
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 | lib/jsdoc/ui5/template/publish.js | makeSignature | function makeSignature(params) {
var r = ['('], desc;
if ( params ) {
for (var i = 0, p; (p = params[i]); i++) {
// ignore @param tags for 'virtual' params that are used to document members of config-like params
// (e.g. like "@param param1.key ...")
if (p.name && p.name.indexOf('.') == -1) {
if (i > 0... | javascript | function makeSignature(params) {
var r = ['('], desc;
if ( params ) {
for (var i = 0, p; (p = params[i]); i++) {
// ignore @param tags for 'virtual' params that are used to document members of config-like params
// (e.g. like "@param param1.key ...")
if (p.name && p.name.indexOf('.') == -1) {
if (i > 0... | [
"function",
"makeSignature",
"(",
"params",
")",
"{",
"var",
"r",
"=",
"[",
"'('",
"]",
",",
"desc",
";",
"if",
"(",
"params",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"p",
";",
"(",
"p",
"=",
"params",
"[",
"i",
"]",
")",
";",
"i",... | /* Build output for displaying function parameters. | [
"/",
"*",
"Build",
"output",
"for",
"displaying",
"function",
"parameters",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/ui5/template/publish.js#L1462-L1498 | train | Creates a signature string from an array of parameters | [
30522,
3853,
3084,
23773,
4017,
5397,
1006,
11498,
5244,
1007,
1063,
13075,
1054,
1027,
1031,
1005,
1006,
1005,
1033,
1010,
4078,
2278,
1025,
2065,
1006,
11498,
5244,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
1014,
1010,
1052,
1025,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js | sanitizeWithPolicy | function sanitizeWithPolicy(inputHtml, tagPolicy) {
var outputArray = [];
makeHtmlSanitizer(tagPolicy)(inputHtml, outputArray);
return outputArray.join('');
} | javascript | function sanitizeWithPolicy(inputHtml, tagPolicy) {
var outputArray = [];
makeHtmlSanitizer(tagPolicy)(inputHtml, outputArray);
return outputArray.join('');
} | [
"function",
"sanitizeWithPolicy",
"(",
"inputHtml",
",",
"tagPolicy",
")",
"{",
"var",
"outputArray",
"=",
"[",
"]",
";",
"makeHtmlSanitizer",
"(",
"tagPolicy",
")",
"(",
"inputHtml",
",",
"outputArray",
")",
";",
"return",
"outputArray",
".",
"join",
"(",
"... | Sanitizes HTML tags and attributes according to a given policy.
@param {string} inputHtml The HTML to sanitize.
@param {function(string, Array.<?string>)} tagPolicy A function that
decides which tags to accept and sanitizes their attributes (see
makeHtmlSanitizer above for details).
@return {string} The sanitized HTML. | [
"Sanitizes",
"HTML",
"tags",
"and",
"attributes",
"according",
"to",
"a",
"given",
"policy",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js#L3537-L3541 | train | Sanitize the input html with the given tag policy | [
30522,
3853,
2624,
25090,
4371,
24415,
18155,
2594,
2100,
1006,
7953,
11039,
19968,
1010,
6415,
18155,
2594,
2100,
1007,
1063,
13075,
6434,
2906,
9447,
1027,
1031,
1033,
1025,
2191,
11039,
19968,
8791,
25090,
6290,
1006,
6415,
18155,
2594,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.