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.toGlobalCoord(valueAxis.dataToCoord(0)); valueStart < min && (valueStart = min); valueStart > max && (valueStart = max); return valueStart; }
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.toGlobalCoord(valueAxis.dataToCoord(0)); valueStart < min && (valueStart = min); valueStart > max && (valueStart = max); return valueStart; }
[ "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.invalidParameterError('brightness', 'number above zero', options.brightness); } } if ('saturation' in options) { if (is.number(options.saturation) && options.saturation >= 0) { this.options.saturation = options.saturation; } else { throw is.invalidParameterError('saturation', 'number above zero', options.saturation); } } if ('hue' in options) { if (is.integer(options.hue)) { this.options.hue = options.hue % 360; } else { throw is.invalidParameterError('hue', 'number', options.hue); } } return this; }
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.invalidParameterError('brightness', 'number above zero', options.brightness); } } if ('saturation' in options) { if (is.number(options.saturation) && options.saturation >= 0) { this.options.saturation = options.saturation; } else { throw is.invalidParameterError('saturation', 'number above zero', options.saturation); } } if ('hue' in options) { if (is.integer(options.hue)) { this.options.hue = options.hue % 360; } else { throw is.invalidParameterError('hue', 'number', options.hue); } } return this; }
[ "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) .modulate({ brightness: 0.5, saturation: 0.5, hue: 90 }); @param {Object} [options] @param {Number} [options.brightness] Brightness multiplier @param {Number} [options.saturation] Saturation multiplier @param {Number} [options.hue] Degrees for hue rotation @returns {Sharp}
[ "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; return stat; }, { errorCount: 0, warningCount: 0, fixableErrorCount: 0, fixableWarningCount: 0 }); }
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; return stat; }, { errorCount: 0, warningCount: 0, fixableErrorCount: 0, fixableWarningCount: 0 }); }
[ "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 = parseInt(filteredDuration / gridLineNumbers); if (document.getElementById('grid')) { document.getElementById('grid').parentNode.removeChild(document.getElementById('grid')); } var grid = document.createElement('div'); grid.innerHTML = '<div class="header"></div><div class="body"></div>'; grid.id = 'grid'; for (var i = 1; i <= gridLineNumbers; i++) { var divForBorder = document.createElement('div'); var divForText = document.createElement('div'); if (i % 5 === 0 || i === 1) { var time = parseInt(filterOptions.filterByTime.start); if (i !== 1) { time += i * gridLineStepInTime; } //to String time = time > 500 ? (time / 1000).toFixed(2) + ' s' : time + ' ms'; divForText.setAttribute('data-time', time); } grid.querySelector('.body').appendChild(divForBorder); grid.querySelector('.header').appendChild(divForText); } document.querySelector('#sapUiSupportPerf').appendChild(grid); }
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 = parseInt(filteredDuration / gridLineNumbers); if (document.getElementById('grid')) { document.getElementById('grid').parentNode.removeChild(document.getElementById('grid')); } var grid = document.createElement('div'); grid.innerHTML = '<div class="header"></div><div class="body"></div>'; grid.id = 'grid'; for (var i = 1; i <= gridLineNumbers; i++) { var divForBorder = document.createElement('div'); var divForText = document.createElement('div'); if (i % 5 === 0 || i === 1) { var time = parseInt(filterOptions.filterByTime.start); if (i !== 1) { time += i * gridLineStepInTime; } //to String time = time > 500 ? (time / 1000).toFixed(2) + ' s' : time + ' ms'; divForText.setAttribute('data-time', time); } grid.querySelector('.body').appendChild(divForBorder); grid.querySelector('.header').appendChild(divForText); } document.querySelector('#sapUiSupportPerf').appendChild(grid); }
[ "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, localeData), generateLocaleCurrencies(localeData, baseCurrencies) ], true) // We remove "undefined" added by spreading arrays when there is no value .replace(/undefined/g, 'u'); // adding plural function after, because we don't want it as a string data = data.substring(0, data.lastIndexOf(']')) + `, plural]`; return `${HEADER} const u = undefined; ${getPluralFunction(locale)} export default ${data}; `; }
javascript
function generateLocale(locale, localeData, baseCurrencies) { // [ localeId, dateTime, number, currency, pluralCase ] let data = stringify([ locale, ...getDateTimeTranslations(localeData), ...getDateTimeSettings(localeData), ...getNumberSettings(localeData), ...getCurrencySettings(locale, localeData), generateLocaleCurrencies(localeData, baseCurrencies) ], true) // We remove "undefined" added by spreading arrays when there is no value .replace(/undefined/g, 'u'); // adding plural function after, because we don't want it as a string data = data.substring(0, data.lastIndexOf(']')) + `, plural]`; return `${HEADER} const u = undefined; ${getPluralFunction(locale)} export default ${data}; `; }
[ "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 && (!oField.getEditable || oField.getEditable())) { return true; } } return false; }
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 && (!oField.getEditable || oField.getEditable())) { return true; } } return false; }
[ "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 messages = metaProperty && getPropertyFromObject("messages", metaProperty.value); if (!messages) { context.report({ node: metaProperty, messageId: "expectedMessages" }); } }
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 messages = metaProperty && getPropertyFromObject("messages", metaProperty.value); if (!messages) { context.report({ node: metaProperty, messageId: "expectedMessages" }); } }
[ "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'), extendedProgressNode = globalProgressNode .find('.progress-extended'); if (extendedProgressNode.length) { extendedProgressNode.html( ($this.data('blueimp-fileupload') || $this.data('fileupload')) ._renderExtendedProgress(data) ); } globalProgressNode .find('.progress') .attr('aria-valuenow', progress) .children().first().css( 'width', 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'), extendedProgressNode = globalProgressNode .find('.progress-extended'); if (extendedProgressNode.length) { extendedProgressNode.html( ($this.data('blueimp-fileupload') || $this.data('fileupload')) ._renderExtendedProgress(data) ); } globalProgressNode .find('.progress') .attr('aria-valuenow', progress) .children().first().css( 'width', 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 lastGoodText; } if (messages.length === 1 && messages[0].fatal) { return lastGoodText; } lastGoodText = currentText; currentText = SourceCodeFixer.applyFixes(currentText, messages).output; } while (lastGoodText !== currentText); return lastGoodText; }
javascript
function isolateBadAutofixPass(originalText, config) { let lastGoodText = originalText; let currentText = originalText; do { let messages; try { messages = linter.verify(currentText, config); } catch (err) { return lastGoodText; } if (messages.length === 1 && messages[0].fatal) { return lastGoodText; } lastGoodText = currentText; currentText = SourceCodeFixer.applyFixes(currentText, messages).output; } while (lastGoodText !== currentText); return lastGoodText; }
[ "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 version of originalText that results in the same syntax error or crash after only one pass
[ "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(function (importData) { // Step 3: Actually do the import // @TODO: It would be cool to have some sort of dry run flag here return self.doImport(importData, importOptions); }).then(function (importData) { // Step 4: Report on the import return self.generateReport(importData); }).finally(() => self.cleanUp()); // Step 5: Cleanup any files }
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(function (importData) { // Step 3: Actually do the import // @TODO: It would be cool to have some sort of dry run flag here return self.doImport(importData, importOptions); }).then(function (importData) { // Step 4: Report on the import return self.generateReport(importData); }).finally(() => self.cleanUp()); // Step 5: Cleanup any files }
[ "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]) && !isArrayLike(target[name])) { animateToShallow( animatable, path ? path + '.' + name : name, source[name], target[name], time, delay, reverse ); } else { if (reverse) { objShallow[name] = source[name]; setAttrByPath(animatable, path, name, target[name]); } else { objShallow[name] = target[name]; } propertyCount++; } } else if (target[name] != null && !reverse) { setAttrByPath(animatable, path, name, target[name]); } } if (propertyCount > 0) { animatable.animate(path, false) .when(time == null ? 500 : time, objShallow) .delay(delay || 0); } }
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]) && !isArrayLike(target[name])) { animateToShallow( animatable, path ? path + '.' + name : name, source[name], target[name], time, delay, reverse ); } else { if (reverse) { objShallow[name] = source[name]; setAttrByPath(animatable, path, name, target[name]); } else { objShallow[name] = target[name]; } propertyCount++; } } else if (target[name] != null && !reverse) { setAttrByPath(animatable, path, name, target[name]); } } if (propertyCount > 0) { animatable.animate(path, false) .when(time == null ? 500 : time, objShallow) .delay(delay || 0); } }
[ "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 position in 100ms, delayed 100ms el._animateToShallow({ shape: { width: 500 }, style: { fill: 'red' } position: [10, 10] }, 100, 100)
[ "@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: false, touched: false, value: 0}; } if (!this.buttonEventDetails[id]) { this.buttonEventDetails[id] = {id: id, state: this.buttonStates[id]}; } buttonState = controller.buttons[id]; this.handleButton(id, buttonState); } // Check axes. this.handleAxes(); }
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: false, touched: false, value: 0}; } if (!this.buttonEventDetails[id]) { this.buttonEventDetails[id] = {id: id, state: this.buttonStates[id]}; } buttonState = controller.buttons[id]; this.handleButton(id, buttonState); } // Check axes. this.handleAxes(); }
[ "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(), name: control.getMetadata().getName(), type: 'sap-ui-control', content: [] }); subResult = results[results.length - 1].content; } else if (node.getAttribute('data-sap-ui-area')) { results.push({ id: node.id, name: 'sap-ui-area', type: 'data-sap-ui', content: [] }); subResult = results[results.length - 1].content; } while (childNode) { this._createRenderedTreeModel(childNode, subResult); childNode = childNode.nextElementSibling; } }
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(), name: control.getMetadata().getName(), type: 'sap-ui-control', content: [] }); subResult = results[results.length - 1].content; } else if (node.getAttribute('data-sap-ui-area')) { results.push({ id: node.id, name: 'sap-ui-area', type: 'data-sap-ui', content: [] }); subResult = results[results.length - 1].content; } while (childNode) { this._createRenderedTreeModel(childNode, subResult); childNode = childNode.nextElementSibling; } }
[ "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_OVERWRITE : Strings.STATUSBAR_INSERT); if (!doNotAnimate) { AnimationUtils.animateUsingClass($statusOverwrite[0], "flash", 1500); } }
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_OVERWRITE : Strings.STATUSBAR_INSERT); if (!doNotAnimate) { AnimationUtils.animateUsingClass($statusOverwrite[0], "flash", 1500); } }
[ "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]) { break; } // First, ensure that we're not comparing specials that // come earlier in the string than our current search position. // This can happen when the string position changes elsewhere. if (specials[i] < strCounter) { specialsCounter = i; } else if (query[queryCounter] === str[specials[i]]) { // we have a match! do the required tracking strCounter = specials[i]; // Upper case match check: // If the query and original string matched, but the original string // and the lower case version did not, that means that the original // was upper case. var upper = originalQuery[queryCounter] === originalStr[strCounter] && originalStr[strCounter] !== str[strCounter]; result.push(new SpecialMatch(strCounter, upper)); specialsCounter = i; queryCounter++; strCounter++; return true; } } return false; }
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]) { break; } // First, ensure that we're not comparing specials that // come earlier in the string than our current search position. // This can happen when the string position changes elsewhere. if (specials[i] < strCounter) { specialsCounter = i; } else if (query[queryCounter] === str[specials[i]]) { // we have a match! do the required tracking strCounter = specials[i]; // Upper case match check: // If the query and original string matched, but the original string // and the lower case version did not, that means that the original // was upper case. var upper = originalQuery[queryCounter] === originalStr[strCounter] && originalStr[strCounter] !== str[strCounter]; result.push(new SpecialMatch(strCounter, upper)); specialsCounter = i; queryCounter++; strCounter++; return true; } } return false; }
[ "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 class="file-panel">' + '<span class="cancel">删除</span>' + '<span class="rotateRight">向右旋转</span>' + '<span class="rotateLeft">向左旋转</span></div>').appendTo( $li ), $prgress = $li.find('p.progress span'), $wrap = $li.find( 'p.imgWrap' ), $info = $('<p class="error"></p>'), showError = function( code ) { switch( code ) { case 'exceed_size': text = '文件大小超出'; break; default: text = '上传失败,请重试'; break; } $info.text( text ).appendTo( $li ); }; if ( file.getStatus() === 'invalid' ) { showError( file.statusText ); } else { // @todo lazyload $wrap.text( '预览中' ); uploader.makeThumb( file, function( error, src ) { if ( error ) { $wrap.text( '不能预览' ); return; } var img = $('<img src="'+src+'">'); $wrap.empty().append( img ); }, thumbnailWidth, thumbnailHeight ); percentages[ file.id ] = [ file.size, 0 ]; file.ratation = 0; } file.on('statuschange', function( cur, prev ) { if ( prev === 'progress' ) { $prgress.hide().width(0); } else if ( prev === 'queued' ) { $li.off( 'mouseenter mouseleave' ); $btns.remove(); } // 成功 if ( cur === 'error' || cur === 'invalid' ) { showError( file.statusText ); percentages[ file.id ][ 1 ] = 1; } else if ( cur === 'queued' ) { percentages[ file.id ][ 1 ] = 0; } else if ( cur === 'progress' ) { $info.remove(); $prgress.css('display', 'block'); } $li.removeClass( 'state-' + prev ).addClass( 'state-' + cur ); }); $li.on( 'mouseenter', function() { $btns.stop().animate({height: 30}); }); $li.on( 'mouseleave', function() { $btns.stop().animate({height: 0}); }); $btns.on( 'click', 'span', function() { var index = $(this).index(), deg; switch ( index ) { case 0: uploader.removeFile( file ); return; case 1: file.ratation += 90; break; case 2: file.ratation -= 90; break; } // -webkit-transform: rotate(90deg); index && (deg = 'rotate(' + file.ratation + 'deg)', $wrap.css({ '-webkit-transform': deg, '-mos-transform': deg, '-o-transform': deg, 'transform': deg })); }); $li.appendTo( $queue ); }
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 class="file-panel">' + '<span class="cancel">删除</span>' + '<span class="rotateRight">向右旋转</span>' + '<span class="rotateLeft">向左旋转</span></div>').appendTo( $li ), $prgress = $li.find('p.progress span'), $wrap = $li.find( 'p.imgWrap' ), $info = $('<p class="error"></p>'), showError = function( code ) { switch( code ) { case 'exceed_size': text = '文件大小超出'; break; default: text = '上传失败,请重试'; break; } $info.text( text ).appendTo( $li ); }; if ( file.getStatus() === 'invalid' ) { showError( file.statusText ); } else { // @todo lazyload $wrap.text( '预览中' ); uploader.makeThumb( file, function( error, src ) { if ( error ) { $wrap.text( '不能预览' ); return; } var img = $('<img src="'+src+'">'); $wrap.empty().append( img ); }, thumbnailWidth, thumbnailHeight ); percentages[ file.id ] = [ file.size, 0 ]; file.ratation = 0; } file.on('statuschange', function( cur, prev ) { if ( prev === 'progress' ) { $prgress.hide().width(0); } else if ( prev === 'queued' ) { $li.off( 'mouseenter mouseleave' ); $btns.remove(); } // 成功 if ( cur === 'error' || cur === 'invalid' ) { showError( file.statusText ); percentages[ file.id ][ 1 ] = 1; } else if ( cur === 'queued' ) { percentages[ file.id ][ 1 ] = 0; } else if ( cur === 'progress' ) { $info.remove(); $prgress.css('display', 'block'); } $li.removeClass( 'state-' + prev ).addClass( 'state-' + cur ); }); $li.on( 'mouseenter', function() { $btns.stop().animate({height: 30}); }); $li.on( 'mouseleave', function() { $btns.stop().animate({height: 0}); }); $btns.on( 'click', 'span', function() { var index = $(this).index(), deg; switch ( index ) { case 0: uploader.removeFile( file ); return; case 1: file.ratation += 90; break; case 2: file.ratation -= 90; break; } // -webkit-transform: rotate(90deg); index && (deg = 'rotate(' + file.ratation + 'deg)', $wrap.css({ '-webkit-transform': deg, '-mos-transform': deg, '-o-transform': deg, 'transform': deg })); }); $li.appendTo( $queue ); }
[ "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(isRequire); if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) { if (currentScope.uninitialized || currentScope.initialized) { if (!hasRequires) { return false; } } } if (declarationCounts.uninitialized > 0) { if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) { return false; } } if (declarationCounts.initialized > 0) { if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) { if (!hasRequires) { return false; } } } if (currentScope.required && hasRequires) { return false; } recordTypes(statementType, declarations, currentScope); return true; }
javascript
function hasOnlyOneStatement(statementType, declarations) { const declarationCounts = countDeclarations(declarations); const currentOptions = options[statementType] || {}; const currentScope = getCurrentScope(statementType); const hasRequires = declarations.some(isRequire); if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) { if (currentScope.uninitialized || currentScope.initialized) { if (!hasRequires) { return false; } } } if (declarationCounts.uninitialized > 0) { if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) { return false; } } if (declarationCounts.initialized > 0) { if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) { if (!hasRequires) { return false; } } } if (currentScope.required && hasRequires) { return false; } recordTypes(statementType, declarations, currentScope); return true; }
[ "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 IPacketHeartbeat @constructor @param {packets.IPacketHeartbeat=} [properties] Properties to set
[ "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; } return buf; }
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; } return buf; }
[ "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(); self._setInitialFilter(); }); }
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(); self._setInitialFilter(); }); }
[ "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 - triggered whenever the filtered set changes (including on initialize). @constructor
[ "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 * @param {string} index - The name of the index * @param {string} type - The type of the document (use `_all` to fetch the first document matching the ID across all types) * @param {list} stored_fields - A comma-separated list of stored fields to return in the response * @param {string} parent - The ID of the parent document * @param {string} preference - Specify the node or shard the operation should be performed on (default: random) * @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode * @param {boolean} refresh - Refresh the shard containing the document before performing the operation * @param {string} routing - Specific routing value * @param {list} _source - True or false to return the _source field or not, or a list of fields to return * @param {list} _source_excludes - A list of fields to exclude from the returned _source field * @param {list} _source_includes - A list of fields to extract and return from the _source field * @param {number} version - Explicit version number for concurrency control * @param {enum} version_type - Specific version type */ const acceptedQuerystring = [ 'stored_fields', 'parent', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path' ] const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } return function get (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options options = {} } if (typeof params === 'function' || params == null) { callback = params params = {} options = {} } // check required parameters if (params['id'] == null) { const err = new ConfigurationError('Missing required parameter: id') return handleError(err, callback) } if (params['index'] == null) { const err = new ConfigurationError('Missing required parameter: index') return handleError(err, callback) } if (params.body != null) { const err = new ConfigurationError('This API does not require a body') return handleError(err, callback) } // validate headers object if (options.headers != null && typeof options.headers !== 'object') { const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) return handleError(err, callback) } var warnings = [] var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) if (method == null) { method = 'GET' } var ignore = options.ignore if (typeof ignore === 'number') { options.ignore = [ignore] } var path = '' if ((index) != null && (type) != null && (id) != null) { path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) } else { path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) } // build request object const request = { method, path, body: null, querystring } options.warnings = warnings.length === 0 ? null : warnings return makeRequest(request, options, callback) } }
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 * @param {string} index - The name of the index * @param {string} type - The type of the document (use `_all` to fetch the first document matching the ID across all types) * @param {list} stored_fields - A comma-separated list of stored fields to return in the response * @param {string} parent - The ID of the parent document * @param {string} preference - Specify the node or shard the operation should be performed on (default: random) * @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode * @param {boolean} refresh - Refresh the shard containing the document before performing the operation * @param {string} routing - Specific routing value * @param {list} _source - True or false to return the _source field or not, or a list of fields to return * @param {list} _source_excludes - A list of fields to exclude from the returned _source field * @param {list} _source_includes - A list of fields to extract and return from the _source field * @param {number} version - Explicit version number for concurrency control * @param {enum} version_type - Specific version type */ const acceptedQuerystring = [ 'stored_fields', 'parent', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path' ] const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } return function get (params, options, callback) { options = options || {} if (typeof options === 'function') { callback = options options = {} } if (typeof params === 'function' || params == null) { callback = params params = {} options = {} } // check required parameters if (params['id'] == null) { const err = new ConfigurationError('Missing required parameter: id') return handleError(err, callback) } if (params['index'] == null) { const err = new ConfigurationError('Missing required parameter: index') return handleError(err, callback) } if (params.body != null) { const err = new ConfigurationError('This API does not require a body') return handleError(err, callback) } // validate headers object if (options.headers != null && typeof options.headers !== 'object') { const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) return handleError(err, callback) } var warnings = [] var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) if (method == null) { method = 'GET' } var ignore = options.ignore if (typeof ignore === 'number') { options.ignore = [ignore] } var path = '' if ((index) != null && (type) != null && (id) != null) { path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) } else { path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) } // build request object const request = { method, path, body: null, querystring } options.warnings = warnings.length === 0 ? null : warnings return makeRequest(request, options, callback) } }
[ "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 partition2 = nodeMap[targetIn]; var newEdges = remainingEdges; // re-use array // Delete all edges between partition1 and partition2 for (var i = newEdges.length - 1; i >= 0; i--) { var edge = newEdges[i]; var src = edge[1]; var tgt = edge[2]; if (nodeMap[src] === partition1 && nodeMap[tgt] === partition2 || nodeMap[src] === partition2 && nodeMap[tgt] === partition1) { newEdges.splice(i, 1); } } // All edges pointing to partition2 should now point to partition1 for (var _i = 0; _i < newEdges.length; _i++) { var _edge = newEdges[_i]; if (_edge[1] === partition2) { // Check source newEdges[_i] = _edge.slice(); // copy newEdges[_i][1] = partition1; } else if (_edge[2] === partition2) { // Check target newEdges[_i] = _edge.slice(); // copy newEdges[_i][2] = partition1; } } // Move all nodes from partition2 to partition1 for (var _i2 = 0; _i2 < nodeMap.length; _i2++) { if (nodeMap[_i2] === partition2) { nodeMap[_i2] = partition1; } } return newEdges; }
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 partition2 = nodeMap[targetIn]; var newEdges = remainingEdges; // re-use array // Delete all edges between partition1 and partition2 for (var i = newEdges.length - 1; i >= 0; i--) { var edge = newEdges[i]; var src = edge[1]; var tgt = edge[2]; if (nodeMap[src] === partition1 && nodeMap[tgt] === partition2 || nodeMap[src] === partition2 && nodeMap[tgt] === partition1) { newEdges.splice(i, 1); } } // All edges pointing to partition2 should now point to partition1 for (var _i = 0; _i < newEdges.length; _i++) { var _edge = newEdges[_i]; if (_edge[1] === partition2) { // Check source newEdges[_i] = _edge.slice(); // copy newEdges[_i][1] = partition1; } else if (_edge[2] === partition2) { // Check target newEdges[_i] = _edge.slice(); // copy newEdges[_i][2] = partition1; } } // Move all nodes from partition2 to partition1 for (var _i2 = 0; _i2 < nodeMap.length; _i2++) { if (nodeMap[_i2] === partition2) { nodeMap[_i2] = partition1; } } return newEdges; }
[ "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._optionalParamsIds = isRegexPattern? null : patternLexer.getOptionalParamsIds(pattern); this._matchRegexp = isRegexPattern? pattern : patternLexer.compilePattern(pattern, router.ignoreCase); this.matched = new signals.Signal(); this.switched = new signals.Signal(); if (callback) { this.matched.add(callback); } this._priority = priority || 0; }
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._optionalParamsIds = isRegexPattern? null : patternLexer.getOptionalParamsIds(pattern); this._matchRegexp = isRegexPattern? pattern : patternLexer.compilePattern(pattern, router.ignoreCase); this.matched = new signals.Signal(); this.switched = new signals.Signal(); if (callback) { this.matched.add(callback); } this._priority = priority || 0; }
[ "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', ''); } if (!slider.attr('flex')) { slider.attr('flex', ''); } return function postLink(scope, element, attr, ctrl) { element.addClass('_md'); // private md component indicator for styling // We have to manually stop the $watch on ngDisabled because it exists // on the parent scope, and won't be automatically destroyed when // the component is destroyed. function setDisable(value) { element.children().attr('disabled', value); element.find('input').attr('disabled', value); } var stopDisabledWatch = angular.noop; if (attr.disabled) { setDisable(true); } else if (attr.ngDisabled) { stopDisabledWatch = scope.$watch(attr.ngDisabled, function (value) { setDisable(value); }); } scope.$on('$destroy', function () { stopDisabledWatch(); }); var initialMaxWidth; /** * @param {number} length of the input's string value */ ctrl.fitInputWidthToTextLength = function (length) { var input = element[0].querySelector('md-input-container'); if (input) { var computedStyle = getComputedStyle(input); var minWidth = parseInt(computedStyle.minWidth); var padding = parseInt(computedStyle.paddingLeft) + parseInt(computedStyle.paddingRight); initialMaxWidth = initialMaxWidth || parseInt(computedStyle.maxWidth); var newMaxWidth = Math.max(initialMaxWidth, minWidth + padding + (minWidth / 2 * length)); input.style.maxWidth = newMaxWidth + 'px'; } }; }; } }; }
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', ''); } if (!slider.attr('flex')) { slider.attr('flex', ''); } return function postLink(scope, element, attr, ctrl) { element.addClass('_md'); // private md component indicator for styling // We have to manually stop the $watch on ngDisabled because it exists // on the parent scope, and won't be automatically destroyed when // the component is destroyed. function setDisable(value) { element.children().attr('disabled', value); element.find('input').attr('disabled', value); } var stopDisabledWatch = angular.noop; if (attr.disabled) { setDisable(true); } else if (attr.ngDisabled) { stopDisabledWatch = scope.$watch(attr.ngDisabled, function (value) { setDisable(value); }); } scope.$on('$destroy', function () { stopDisabledWatch(); }); var initialMaxWidth; /** * @param {number} length of the input's string value */ ctrl.fitInputWidthToTextLength = function (length) { var input = element[0].querySelector('md-input-container'); if (input) { var computedStyle = getComputedStyle(input); var minWidth = parseInt(computedStyle.minWidth); var padding = parseInt(computedStyle.paddingLeft) + parseInt(computedStyle.paddingRight); initialMaxWidth = initialMaxWidth || parseInt(computedStyle.maxWidth); var newMaxWidth = Math.max(initialMaxWidth, minWidth + padding + (minWidth / 2 * length)); input.style.maxWidth = newMaxWidth + 'px'; } }; }; } }; }
[ "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-container> <span>Red</span> <md-slider min="0" max="255" ng-model="color.red" aria-label="red" id="red-slider"> </md-slider> <md-input-container> <input type="number" ng-model="color.red" aria-label="Red" aria-controls="red-slider"> </md-input-container> </md-slider-container> </hljs>
[ "@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.length - 2); } return filter.join(", "); }
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.length - 2); } return filter.join(", "); }
[ "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.fillUriTemplate return Expression.fillUriTemplate(oParameters); case "odata.uriEncode": // 14.5.3.1.3 Function odata.uriEncode return Expression.uriEncode(oParameters); default: return asyncError(oFunction, "unknown function: " + oFunction.value); } }
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.fillUriTemplate return Expression.fillUriTemplate(oParameters); case "odata.uriEncode": // 14.5.3.1.3 Function odata.uriEncode return Expression.uriEncode(oParameters); default: return asyncError(oFunction, "unknown function: " + oFunction.value); } }
[ "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 with the result object or is rejected with an error
[ "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'); clientConfig.entry.client = ['./tools/lib/webpackHotDevClient'] .concat(clientConfig.entry.client) .sort((a, b) => b.includes('polyfill') - a.includes('polyfill')); clientConfig.output.filename = clientConfig.output.filename.replace( 'chunkhash', 'hash', ); clientConfig.output.chunkFilename = clientConfig.output.chunkFilename.replace( 'chunkhash', 'hash', ); clientConfig.module.rules = clientConfig.module.rules.filter( x => x.loader !== 'null-loader', ); clientConfig.plugins.push(new webpack.HotModuleReplacementPlugin()); // Configure server-side hot module replacement const serverConfig = webpackConfig.find(config => config.name === 'server'); serverConfig.output.hotUpdateMainFilename = 'updates/[hash].hot-update.json'; serverConfig.output.hotUpdateChunkFilename = 'updates/[id].[hash].hot-update.js'; serverConfig.module.rules = serverConfig.module.rules.filter( x => x.loader !== 'null-loader', ); serverConfig.plugins.push(new webpack.HotModuleReplacementPlugin()); // Configure compilation await run(clean); const multiCompiler = webpack(webpackConfig); const clientCompiler = multiCompiler.compilers.find( compiler => compiler.name === 'client', ); const serverCompiler = multiCompiler.compilers.find( compiler => compiler.name === 'server', ); const clientPromise = createCompilationPromise( 'client', clientCompiler, clientConfig, ); const serverPromise = createCompilationPromise( 'server', serverCompiler, serverConfig, ); // https://github.com/webpack/webpack-dev-middleware server.use( webpackDevMiddleware(clientCompiler, { publicPath: clientConfig.output.publicPath, logLevel: 'silent', watchOptions, }), ); // https://github.com/glenjamin/webpack-hot-middleware server.use(webpackHotMiddleware(clientCompiler, { log: false })); let appPromise; let appPromiseResolve; let appPromiseIsResolved = true; serverCompiler.hooks.compile.tap('server', () => { if (!appPromiseIsResolved) return; appPromiseIsResolved = false; // eslint-disable-next-line no-return-assign appPromise = new Promise(resolve => (appPromiseResolve = resolve)); }); let app; server.use((req, res) => { appPromise .then(() => app.handle(req, res)) .catch(error => console.error(error)); }); function checkForUpdate(fromUpdate) { const hmrPrefix = '[\x1b[35mHMR\x1b[0m] '; if (!app.hot) { throw new Error(`${hmrPrefix}Hot Module Replacement is disabled.`); } if (app.hot.status() !== 'idle') { return Promise.resolve(); } return app.hot .check(true) .then(updatedModules => { if (!updatedModules) { if (fromUpdate) { console.info(`${hmrPrefix}Update applied.`); } return; } if (updatedModules.length === 0) { console.info(`${hmrPrefix}Nothing hot updated.`); } else { console.info(`${hmrPrefix}Updated modules:`); updatedModules.forEach(moduleId => console.info(`${hmrPrefix} - ${moduleId}`), ); checkForUpdate(true); } }) .catch(error => { if (['abort', 'fail'].includes(app.hot.status())) { console.warn(`${hmrPrefix}Cannot apply update.`); delete require.cache[require.resolve('../build/server')]; // eslint-disable-next-line global-require, import/no-unresolved app = require('../build/server').default; console.warn(`${hmrPrefix}App has been reloaded.`); } else { console.warn( `${hmrPrefix}Update failed: ${error.stack || error.message}`, ); } }); } serverCompiler.watch(watchOptions, (error, stats) => { if (app && !error && !stats.hasErrors()) { checkForUpdate().then(() => { appPromiseIsResolved = true; appPromiseResolve(); }); } }); // Wait until both client-side and server-side bundles are ready await clientPromise; await serverPromise; const timeStart = new Date(); console.info(`[${format(timeStart)}] Launching server...`); // Load compiled src/server.js as a middleware // eslint-disable-next-line global-require, import/no-unresolved app = require('../build/server').default; appPromiseIsResolved = true; appPromiseResolve(); // Launch the development server with Browsersync and HMR await new Promise((resolve, reject) => browserSync.create().init( { // https://www.browsersync.io/docs/options server: 'src/server.js', middleware: [server], open: !process.argv.includes('--silent'), ...(isDebug ? {} : { notify: false, ui: false }), }, (error, bs) => (error ? reject(error) : resolve(bs)), ), ); const timeEnd = new Date(); const time = timeEnd.getTime() - timeStart.getTime(); console.info(`[${format(timeEnd)}] Server launched after ${time} ms`); return server; }
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'); clientConfig.entry.client = ['./tools/lib/webpackHotDevClient'] .concat(clientConfig.entry.client) .sort((a, b) => b.includes('polyfill') - a.includes('polyfill')); clientConfig.output.filename = clientConfig.output.filename.replace( 'chunkhash', 'hash', ); clientConfig.output.chunkFilename = clientConfig.output.chunkFilename.replace( 'chunkhash', 'hash', ); clientConfig.module.rules = clientConfig.module.rules.filter( x => x.loader !== 'null-loader', ); clientConfig.plugins.push(new webpack.HotModuleReplacementPlugin()); // Configure server-side hot module replacement const serverConfig = webpackConfig.find(config => config.name === 'server'); serverConfig.output.hotUpdateMainFilename = 'updates/[hash].hot-update.json'; serverConfig.output.hotUpdateChunkFilename = 'updates/[id].[hash].hot-update.js'; serverConfig.module.rules = serverConfig.module.rules.filter( x => x.loader !== 'null-loader', ); serverConfig.plugins.push(new webpack.HotModuleReplacementPlugin()); // Configure compilation await run(clean); const multiCompiler = webpack(webpackConfig); const clientCompiler = multiCompiler.compilers.find( compiler => compiler.name === 'client', ); const serverCompiler = multiCompiler.compilers.find( compiler => compiler.name === 'server', ); const clientPromise = createCompilationPromise( 'client', clientCompiler, clientConfig, ); const serverPromise = createCompilationPromise( 'server', serverCompiler, serverConfig, ); // https://github.com/webpack/webpack-dev-middleware server.use( webpackDevMiddleware(clientCompiler, { publicPath: clientConfig.output.publicPath, logLevel: 'silent', watchOptions, }), ); // https://github.com/glenjamin/webpack-hot-middleware server.use(webpackHotMiddleware(clientCompiler, { log: false })); let appPromise; let appPromiseResolve; let appPromiseIsResolved = true; serverCompiler.hooks.compile.tap('server', () => { if (!appPromiseIsResolved) return; appPromiseIsResolved = false; // eslint-disable-next-line no-return-assign appPromise = new Promise(resolve => (appPromiseResolve = resolve)); }); let app; server.use((req, res) => { appPromise .then(() => app.handle(req, res)) .catch(error => console.error(error)); }); function checkForUpdate(fromUpdate) { const hmrPrefix = '[\x1b[35mHMR\x1b[0m] '; if (!app.hot) { throw new Error(`${hmrPrefix}Hot Module Replacement is disabled.`); } if (app.hot.status() !== 'idle') { return Promise.resolve(); } return app.hot .check(true) .then(updatedModules => { if (!updatedModules) { if (fromUpdate) { console.info(`${hmrPrefix}Update applied.`); } return; } if (updatedModules.length === 0) { console.info(`${hmrPrefix}Nothing hot updated.`); } else { console.info(`${hmrPrefix}Updated modules:`); updatedModules.forEach(moduleId => console.info(`${hmrPrefix} - ${moduleId}`), ); checkForUpdate(true); } }) .catch(error => { if (['abort', 'fail'].includes(app.hot.status())) { console.warn(`${hmrPrefix}Cannot apply update.`); delete require.cache[require.resolve('../build/server')]; // eslint-disable-next-line global-require, import/no-unresolved app = require('../build/server').default; console.warn(`${hmrPrefix}App has been reloaded.`); } else { console.warn( `${hmrPrefix}Update failed: ${error.stack || error.message}`, ); } }); } serverCompiler.watch(watchOptions, (error, stats) => { if (app && !error && !stats.hasErrors()) { checkForUpdate().then(() => { appPromiseIsResolved = true; appPromiseResolve(); }); } }); // Wait until both client-side and server-side bundles are ready await clientPromise; await serverPromise; const timeStart = new Date(); console.info(`[${format(timeStart)}] Launching server...`); // Load compiled src/server.js as a middleware // eslint-disable-next-line global-require, import/no-unresolved app = require('../build/server').default; appPromiseIsResolved = true; appPromiseResolve(); // Launch the development server with Browsersync and HMR await new Promise((resolve, reject) => browserSync.create().init( { // https://www.browsersync.io/docs/options server: 'src/server.js', middleware: [server], open: !process.argv.includes('--silent'), ...(isDebug ? {} : { notify: false, ui: false }), }, (error, bs) => (error ? reject(error) : resolve(bs)), ), ); const timeEnd = new Date(); const time = timeEnd.getTime() - timeStart.getTime(); console.info(`[${format(timeEnd)}] Server launched after ${time} ms`); return server; }
[ "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]['symbol-alt-narrow']; if (symbol && symbol !== code) { symbolsArray.push(symbol); } if (symbolNarrow && symbolNarrow !== symbol) { if (symbolsArray.length > 0) { symbolsArray.push(symbolNarrow); } else { symbolsArray = [undefined, symbolNarrow]; } } // if locale data are different, set the value if ((baseCurrencies[code] || []).toString() !== symbolsArray.toString()) { currencies[code] = symbolsArray; } }); return currencies; }
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]['symbol-alt-narrow']; if (symbol && symbol !== code) { symbolsArray.push(symbol); } if (symbolNarrow && symbolNarrow !== symbol) { if (symbolsArray.length > 0) { symbolsArray.push(symbolNarrow); } else { symbolsArray = [undefined, symbolNarrow]; } } // if locale data are different, set the value if ((baseCurrencies[code] || []).toString() !== symbolsArray.toString()) { currencies[code] = symbolsArray; } }); return currencies; }
[ "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 (!oExtension.namespace == odata4analytics.constants.SAP_NAMESPACE) { continue; } if (oExtension.name == "label") { return oExtension.value; } } } return null; }
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 (!oExtension.namespace == odata4analytics.constants.SAP_NAMESPACE) { continue; } if (oExtension.name == "label") { return oExtension.value; } } } return null; }
[ "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)); }); }); return res; }
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)); }); }); return res; }
[ "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 {Array} A mixture of the elements of the first and second arrays.
[ "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("Invalid filter path: " + oNode.value); } return { path : oNode.value, $Type : oPropertyMetadata.$Type, $v2Type : oPropertyMetadata.$v2Type }; } // oNode must have id "FUNCTION" and type undefined here. So it must be either ceiling, // floor or round and the return type is determined from the first and only parameter. return getType(oNode.parameters[0]); }
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("Invalid filter path: " + oNode.value); } return { path : oNode.value, $Type : oPropertyMetadata.$Type, $v2Type : oPropertyMetadata.$v2Type }; } // oNode must have id "FUNCTION" and type undefined here. So it must be either ceiling, // floor or round and the return type is determined from the first and only parameter. return getType(oNode.parameters[0]); }
[ "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(fullPath => { const name = getName(fullPath); return `'${name}': () => import('${path.relative(join('docs/src'), fullPath).replace(/\\/g, '/')}')`; }); const content = `${tips} export default { ${docs.join(',\n ')} }; `; fs.writeFileSync(output, content); }
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(fullPath => { const name = getName(fullPath); return `'${name}': () => import('${path.relative(join('docs/src'), fullPath).replace(/\\/g, '/')}')`; }); const content = `${tips} export default { ${docs.join(',\n ')} }; `; fs.writeFileSync(output, content); }
[ "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 + 1; return false; } }); return iAllItemsBeforeBreak; }
javascript
function getCountOfVisibleItemsWithVisibilityTrue(oLastVisibleItem) { var iAllItemsBeforeBreak = 0; var aLeftItemsWithVisibleTrue = getLeftItemsWithVisibilityTrue.call(this); aLeftItemsWithVisibleTrue.forEach(function (item, i) { if (item.getDomRef() === oLastVisibleItem) { iAllItemsBeforeBreak = i + 1; return false; } }); return iAllItemsBeforeBreak; }
[ "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} oLastVisibleItem The last visible item just before the first item that goes into the overflow (second row) @returns {int} The number of items that are not hidden due to overflow @private
[ "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'); } return ret; }
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'); } return ret; }
[ "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.substring(0, 13) === '--target_arch') { options.arch = arg.substring(14); } else if (arg === '-d' || arg === '--debug') { options.debug = true; } else if (arg.substring(0, 13) === '--libsass_ext' && arg.substring(14) !== 'no') { options.libsassExt = true; } return true; }); return options; }
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.substring(0, 13) === '--target_arch') { options.arch = arg.substring(14); } else if (arg === '-d' || arg === '--debug') { options.debug = true; } else if (arg.substring(0, 13) === '--libsass_ext' && arg.substring(14) !== 'no') { options.libsassExt = true; } return true; }); return options; }
[ "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 JS context for plugins var context = Api.encodeGlobal(output); return timing.measure( 'call.hook.' + name, // Get the arguments Promise(getArgument(output)) // Call the hooks in serie .then(function(arg) { return Promise.reduce(plugins, function(prev, plugin) { var hook = plugin.getHook(name); if (!hook) { return prev; } return hook.call(context, prev); }, arg); }) // Handle final result .then(function(result) { output = Api.decodeGlobal(output, context); return handleResult(output, result); }) ); }
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 JS context for plugins var context = Api.encodeGlobal(output); return timing.measure( 'call.hook.' + name, // Get the arguments Promise(getArgument(output)) // Call the hooks in serie .then(function(arg) { return Promise.reduce(plugins, function(prev, plugin) { var hook = plugin.getHook(name); if (!hook) { return prev; } return hook.call(context, prev); }, arg); }) // Handle final result .then(function(result) { output = Api.decodeGlobal(output, context); return handleResult(output, result); }) ); }
[ "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 ( hasDoubleExcessParens(callee) || !isIIFE(node) && !hasNewParensException && !( /* * Allow extra parens around a new expression if * there are intervening parentheses. */ (callee.type === "MemberExpression" && doesMemberExpressionContainCallExpression(callee)) ) ) { report(node.callee); } } if (node.arguments.length === 1) { if (hasDoubleExcessParens(node.arguments[0]) && precedence(node.arguments[0]) >= PRECEDENCE_OF_ASSIGNMENT_EXPR) { report(node.arguments[0]); } } else { node.arguments .filter(arg => hasExcessParens(arg) && precedence(arg) >= PRECEDENCE_OF_ASSIGNMENT_EXPR) .forEach(report); } }
javascript
function checkCallNew(node) { const callee = node.callee; if (hasExcessParens(callee) && precedence(callee) >= precedence(node)) { const hasNewParensException = callee.type === "NewExpression" && !isNewExpressionWithParens(callee); if ( hasDoubleExcessParens(callee) || !isIIFE(node) && !hasNewParensException && !( /* * Allow extra parens around a new expression if * there are intervening parentheses. */ (callee.type === "MemberExpression" && doesMemberExpressionContainCallExpression(callee)) ) ) { report(node.callee); } } if (node.arguments.length === 1) { if (hasDoubleExcessParens(node.arguments[0]) && precedence(node.arguments[0]) >= PRECEDENCE_OF_ASSIGNMENT_EXPR) { report(node.arguments[0]); } } else { node.arguments .filter(arg => hasExcessParens(arg) && precedence(arg) >= PRECEDENCE_OF_ASSIGNMENT_EXPR) .forEach(report); } }
[ "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 sl = this.connector.source.left(); var sw = this.connector.source.width(); var dt = this.connector.destination.top(); var dh = this.connector.destination.height(); var sourceMiddle = Math.floor(this.connector.source.top() + this.connector.source.height() / 2); if(destMiddle > sl && destMiddle < sl + sw) return false; if(sourceMiddle > dt && sourceMiddle < dt + dh) return false; return true; } /** * Chooses the longest segment as the "middle" segment. */ this.getMiddleSegment = function() { if(this.startSegment.length > this.endSegment.length) return this.startSegment; else return this.endSegment; } this.paint = function() { this.startSegment = this.connector.createSegment(); this.endSegment = this.connector.createSegment(); var destMiddleX = Math.floor(this.connector.destination.left() + this.connector.destination.width() / 2); var sl = this.connector.source.left(); var sw = this.connector.source.width(); var dt = this.connector.destination.top(); var dh = this.connector.destination.height(); this.startSegment.startY = Math.floor(this.connector.source.top() + this.connector.source.height() / 2); // decide which side of the source block to connect to if(Math.abs(destMiddleX - sl) < Math.abs(destMiddleX - (sl + sw))) { // use the left face this.startSegment.orientation = (destMiddleX < sl) ? LEFT : RIGHT; this.startSegment.startX = sl; } else { // use the right face this.startSegment.orientation = (destMiddleX > (sl + sw)) ? RIGHT : LEFT; this.startSegment.startX = sl + sw; } this.startSegment.length = Math.abs(destMiddleX - this.startSegment.startX); // decide which side of the destination block to connect to if(Math.abs(this.startSegment.startY - dt) < Math.abs(this.startSegment.startY - (dt + dh))) { // use the upper face this.endSegment.orientation = (this.startSegment.startY < dt) ? DOWN : UP; this.endSegment.length = Math.abs(this.startSegment.startY - dt); } else { // use the lower face this.endSegment.orientation = (this.startSegment.startY > (dt + dh)) ? UP : DOWN; this.endSegment.length = Math.abs(this.startSegment.startY - (dt + dh)); } } }
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 sl = this.connector.source.left(); var sw = this.connector.source.width(); var dt = this.connector.destination.top(); var dh = this.connector.destination.height(); var sourceMiddle = Math.floor(this.connector.source.top() + this.connector.source.height() / 2); if(destMiddle > sl && destMiddle < sl + sw) return false; if(sourceMiddle > dt && sourceMiddle < dt + dh) return false; return true; } /** * Chooses the longest segment as the "middle" segment. */ this.getMiddleSegment = function() { if(this.startSegment.length > this.endSegment.length) return this.startSegment; else return this.endSegment; } this.paint = function() { this.startSegment = this.connector.createSegment(); this.endSegment = this.connector.createSegment(); var destMiddleX = Math.floor(this.connector.destination.left() + this.connector.destination.width() / 2); var sl = this.connector.source.left(); var sw = this.connector.source.width(); var dt = this.connector.destination.top(); var dh = this.connector.destination.height(); this.startSegment.startY = Math.floor(this.connector.source.top() + this.connector.source.height() / 2); // decide which side of the source block to connect to if(Math.abs(destMiddleX - sl) < Math.abs(destMiddleX - (sl + sw))) { // use the left face this.startSegment.orientation = (destMiddleX < sl) ? LEFT : RIGHT; this.startSegment.startX = sl; } else { // use the right face this.startSegment.orientation = (destMiddleX > (sl + sw)) ? RIGHT : LEFT; this.startSegment.startX = sl + sw; } this.startSegment.length = Math.abs(destMiddleX - this.startSegment.startX); // decide which side of the destination block to connect to if(Math.abs(this.startSegment.startY - dt) < Math.abs(this.startSegment.startY - (dt + dh))) { // use the upper face this.endSegment.orientation = (this.startSegment.startY < dt) ? DOWN : UP; this.endSegment.length = Math.abs(this.startSegment.startY - dt); } else { // use the lower face this.endSegment.orientation = (this.startSegment.startY > (dt + dh)) ? UP : DOWN; this.endSegment.length = Math.abs(this.startSegment.startY - (dt + dh)); } } }
[ "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: 0 }; var nullDevice = windows ? '\\\\.\\NUL' : '/dev/null'; if (cb) { ancestor.open.call(fs, nullDevice, 'r', function (error, fd) { if (error) return cb(error); docks[fd] = dock; cb(null, fd); }); } else { var fd = ancestor.openSync.call(fs, nullDevice, 'r'); docks[fd] = dock; return fd; } }
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: 0 }; var nullDevice = windows ? '\\\\.\\NUL' : '/dev/null'; if (cb) { ancestor.open.call(fs, nullDevice, 'r', function (error, fd) { if (error) return cb(error); docks[fd] = dock; cb(null, fd); }); } else { var fd = ancestor.openSync.call(fs, nullDevice, 'r'); docks[fd] = dock; return fd; } }
[ "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.getLongitude()/COORD_FACTOR); call.write(location); _.delay(callback, _.random(500, 1500)); }; }
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.getLongitude()/COORD_FACTOR); call.write(location); _.delay(callback, _.random(500, 1500)); }; }
[ "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.childNodes[i].nodeType == Strophe.ElementType.TEXT) { str += elem.childNodes[i].nodeValue; } } return Strophe.xmlescape(str); }
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.childNodes[i].nodeType == Strophe.ElementType.TEXT) { str += elem.childNodes[i].nodeValue; } } return Strophe.xmlescape(str); }
[ "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(binaryPath)) { console.log('node-sass build', 'Binary found at', binaryPath); return; } try { mkdir.sync(path.dirname(binaryPath)); } catch (err) { console.error('Unable to save binary', path.dirname(binaryPath), ':', err); return; } if (cachedBinary) { console.log('Cached binary found at', cachedBinary); fs.createReadStream(cachedBinary).pipe(fs.createWriteStream(binaryPath)); return; } download(sass.getBinaryUrl(), binaryPath, function(err) { if (err) { console.error(err); return; } console.log('Binary saved to', binaryPath); cachedBinary = path.join(cachePath, sass.getBinaryName()); if (cachePath) { console.log('Caching binary to', cachedBinary); try { mkdir.sync(path.dirname(cachedBinary)); fs.createReadStream(binaryPath) .pipe(fs.createWriteStream(cachedBinary)) .on('error', function (err) { console.log('Failed to cache binary:', err); }); } catch (err) { console.log('Failed to cache binary:', err); } } }); }
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(binaryPath)) { console.log('node-sass build', 'Binary found at', binaryPath); return; } try { mkdir.sync(path.dirname(binaryPath)); } catch (err) { console.error('Unable to save binary', path.dirname(binaryPath), ':', err); return; } if (cachedBinary) { console.log('Cached binary found at', cachedBinary); fs.createReadStream(cachedBinary).pipe(fs.createWriteStream(binaryPath)); return; } download(sass.getBinaryUrl(), binaryPath, function(err) { if (err) { console.error(err); return; } console.log('Binary saved to', binaryPath); cachedBinary = path.join(cachePath, sass.getBinaryName()); if (cachePath) { console.log('Caching binary to', cachedBinary); try { mkdir.sync(path.dirname(cachedBinary)); fs.createReadStream(binaryPath) .pipe(fs.createWriteStream(cachedBinary)) .on('error', function (err) { console.log('Failed to cache binary:', err); }); } catch (err) { console.log('Failed to cache binary:', err); } } }); }
[ "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), reversedAlready)) } return reverseInner(list, emptyList); }
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), reversedAlready)) } return reverseInner(list, emptyList); }
[ "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, `You should not use <${displayName} /> outside a <Router>` ); return ( <Component {...remainingProps} {...context} ref={wrappedComponentRef} /> ); }} </RouterContext.Consumer> ); }; C.displayName = displayName; C.WrappedComponent = Component; if (__DEV__) { C.propTypes = { wrappedComponentRef: PropTypes.func }; } return hoistStatics(C, Component); }
javascript
function withRouter(Component) { const displayName = `withRouter(${Component.displayName || Component.name})`; const C = props => { const { wrappedComponentRef, ...remainingProps } = props; return ( <RouterContext.Consumer> {context => { invariant( context, `You should not use <${displayName} /> outside a <Router>` ); return ( <Component {...remainingProps} {...context} ref={wrappedComponentRef} /> ); }} </RouterContext.Consumer> ); }; C.displayName = displayName; C.WrappedComponent = Component; if (__DEV__) { C.propTypes = { wrappedComponentRef: PropTypes.func }; } return hoistStatics(C, Component); }
[ "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); if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz); if(!sectors[addr]) break; j = __readInt32LE(sectors[addr], jj); } return {nodes: buf, data:__toBuffer([buf_chain])}; }
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); if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz); if(!sectors[addr]) break; j = __readInt32LE(sectors[addr], jj); } return {nodes: buf, data:__toBuffer([buf_chain])}; }
[ "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 = (nthWeek - 1) * 7 - rangeInfo.fweek + day; var date = new Date(rangeInfo.start.time); date.setDate(rangeInfo.start.d + nthDay); return this.getDateInfo(date); }
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 = (nthWeek - 1) * 7 - rangeInfo.fweek + day; var date = new Date(rangeInfo.start.time); date.setDate(rangeInfo.start.d + nthDay); return this.getDateInfo(date); }
[ "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 === 'url') { return null; } i += name.length; if (nameLC === 'alpha') { alpha_ret = parsers.alpha(); if(typeof alpha_ret !== 'undefined') { return alpha_ret; } } $char('('); // Parse the '(' and consume whitespace. args = this.arguments(); if (! $char(')')) { return; } if (name) { return new(tree.Call)(name, args, index, env.currentFileInfo); } }
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 === 'url') { return null; } i += name.length; if (nameLC === 'alpha') { alpha_ret = parsers.alpha(); if(typeof alpha_ret !== 'undefined') { return alpha_ret; } } $char('('); // Parse the '(' and consume whitespace. args = this.arguments(); if (! $char(')')) { return; } if (name) { return new(tree.Call)(name, args, index, env.currentFileInfo); } }
[ "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.getSelectionModel().addListener(mxEvent.CHANGE, this.refreshHandler); this.graph.getModel().addListener(mxEvent.CHANGE, this.refreshHandler); this.graph.getView().addListener(mxEvent.SCALE, this.refreshHandler); this.graph.getView().addListener(mxEvent.TRANSLATE, this.refreshHandler); this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE, this.refreshHandler); this.graph.getView().addListener(mxEvent.DOWN, this.refreshHandler); this.graph.getView().addListener(mxEvent.UP, this.refreshHandler); }
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.getSelectionModel().addListener(mxEvent.CHANGE, this.refreshHandler); this.graph.getModel().addListener(mxEvent.CHANGE, this.refreshHandler); this.graph.getView().addListener(mxEvent.SCALE, this.refreshHandler); this.graph.getView().addListener(mxEvent.TRANSLATE, this.refreshHandler); this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE, this.refreshHandler); this.graph.getView().addListener(mxEvent.DOWN, this.refreshHandler); this.graph.getView().addListener(mxEvent.UP, this.refreshHandler); }
[ "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> property contains the <mxCellState> that has been added. Event: mxEvent.REMOVE Fires if a cell has been remove from the selection. The <code>state</code> property contains the <mxCellState> that has been removed. Parameters: graph - Reference to the enclosing <mxGraph>.
[ "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()) { if (!nextLine()) { return false; } } style = mode.token(stream, state); token = stream.current(); curOffset = lineStart + stream.pos; return true; }
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()) { if (!nextLine()) { return false; } } style = mode.token(stream, state); token = stream.current(); curOffset = lineStart + stream.pos; return true; }
[ "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 var viewer = _viewers[entry.fullPath]; // viewer found, call its refresh method if (viewer) { viewer.refresh(); } }
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 var viewer = _viewers[entry.fullPath]; // viewer found, call its refresh method if (viewer) { viewer.refresh(); } }
[ "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 @param {Array.<FileSystemEntry>=} removed If entry is a Directory, contains zero or more removed children
[ "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.rowspan) { merger.rowspan -= 1; } } else if (cell.rowspan > 1) { const lastMergedRowIndex = rowIndex + cell.rowspan - 1; cell.rowspan -= (endRowIndex - rowIndex + 1); if (lastMergedRowIndex > endRowIndex) { tableData[endRowIndex + 1][cellIndex] = util.extend({}, cell); } } }); }); }
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.rowspan) { merger.rowspan -= 1; } } else if (cell.rowspan > 1) { const lastMergedRowIndex = rowIndex + cell.rowspan - 1; cell.rowspan -= (endRowIndex - rowIndex + 1); if (lastMergedRowIndex > endRowIndex) { tableData[endRowIndex + 1][cellIndex] = util.extend({}, cell); } } }); }); }
[ "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; if (selectedNode.length === 0) { return; } var top = selectedNode.offset().top, baselineHeight = node.dataset.initialHeight, height = baselineHeight, scrollerTop = selectionViewInfo.get("offsetTop"); if (!baselineHeight) { baselineHeight = $(node).outerHeight(); node.dataset.initialHeight = baselineHeight; height = baselineHeight; } // Check to see if the selection is completely scrolled out of view // to prevent the extension from appearing in the working set area. if (top < scrollerTop - baselineHeight) { node.style.display = "none"; return; } node.style.display = "block"; // The selectionExtension sits on top of the other nodes // so we need to shrink it if only part of the selection node is visible if (top < scrollerTop) { var difference = scrollerTop - top; top += difference; height = parseInt(height, 10); height -= difference; } node.style.top = top + "px"; node.style.height = height + "px"; node.style.left = selectionViewInfo.get("width") - $(node).outerWidth() + "px"; }
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; if (selectedNode.length === 0) { return; } var top = selectedNode.offset().top, baselineHeight = node.dataset.initialHeight, height = baselineHeight, scrollerTop = selectionViewInfo.get("offsetTop"); if (!baselineHeight) { baselineHeight = $(node).outerHeight(); node.dataset.initialHeight = baselineHeight; height = baselineHeight; } // Check to see if the selection is completely scrolled out of view // to prevent the extension from appearing in the working set area. if (top < scrollerTop - baselineHeight) { node.style.display = "none"; return; } node.style.display = "block"; // The selectionExtension sits on top of the other nodes // so we need to shrink it if only part of the selection node is visible if (top < scrollerTop) { var difference = scrollerTop - top; top += difference; height = parseInt(height, 10); height -= difference; } node.style.top = top + "px"; node.style.height = height + "px"; node.style.left = selectionViewInfo.get("width") - $(node).outerWidth() + "px"; }
[ "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(); const serverConnection = record.getLinkedRecord(payload.fieldKey); const serverPageInfo = serverConnection && serverConnection.getLinkedRecord(PAGE_INFO); if (!serverConnection) { record.setValue(null, payload.handleKey); return; } const clientConnection = record.getLinkedRecord(payload.handleKey); let clientPageInfo = clientConnection && clientConnection.getLinkedRecord(PAGE_INFO); if (!clientConnection) { // Initial fetch with data: copy fields from the server record const connection = store.create( generateClientID(record.getDataID(), payload.handleKey), serverConnection.getType(), ); connection.setValue(0, NEXT_EDGE_INDEX); connection.copyFieldsFrom(serverConnection); let serverEdges = serverConnection.getLinkedRecords(EDGES); if (serverEdges) { serverEdges = serverEdges.map(edge => buildConnectionEdge(store, connection, edge), ); connection.setLinkedRecords(serverEdges, EDGES); } record.setLinkedRecord(connection, payload.handleKey); clientPageInfo = store.create( generateClientID(connection.getDataID(), PAGE_INFO), PAGE_INFO_TYPE, ); clientPageInfo.setValue(false, HAS_NEXT_PAGE); clientPageInfo.setValue(false, HAS_PREV_PAGE); clientPageInfo.setValue(null, END_CURSOR); clientPageInfo.setValue(null, START_CURSOR); if (serverPageInfo) { clientPageInfo.copyFieldsFrom(serverPageInfo); } connection.setLinkedRecord(clientPageInfo, PAGE_INFO); } else { const connection = clientConnection; // Subsequent fetches: // - updated fields on the connection // - merge prev/next edges, de-duplicating by node id // - synthesize page info fields let serverEdges = serverConnection.getLinkedRecords(EDGES); if (serverEdges) { serverEdges = serverEdges.map(edge => buildConnectionEdge(store, connection, edge), ); } const prevEdges = connection.getLinkedRecords(EDGES); const prevPageInfo = connection.getLinkedRecord(PAGE_INFO); connection.copyFieldsFrom(serverConnection); // Reset EDGES and PAGE_INFO fields if (prevEdges) { connection.setLinkedRecords(prevEdges, EDGES); } if (prevPageInfo) { connection.setLinkedRecord(prevPageInfo, PAGE_INFO); } let nextEdges = []; const args = payload.args; if (prevEdges && serverEdges) { if (args.after != null) { // Forward pagination from the end of the connection: append edges if ( clientPageInfo && args.after === clientPageInfo.getValue(END_CURSOR) ) { const nodeIDs = new Set(); mergeEdges(prevEdges, nextEdges, nodeIDs); mergeEdges(serverEdges, nextEdges, nodeIDs); } else { warning( false, 'RelayConnectionHandler: Unexpected after cursor `%s`, edges must ' + 'be fetched from the end of the list (`%s`).', args.after, clientPageInfo && clientPageInfo.getValue(END_CURSOR), ); return; } } else if (args.before != null) { // Backward pagination from the start of the connection: prepend edges if ( clientPageInfo && args.before === clientPageInfo.getValue(START_CURSOR) ) { const nodeIDs = new Set(); mergeEdges(serverEdges, nextEdges, nodeIDs); mergeEdges(prevEdges, nextEdges, nodeIDs); } else { warning( false, 'RelayConnectionHandler: Unexpected before cursor `%s`, edges must ' + 'be fetched from the beginning of the list (`%s`).', args.before, clientPageInfo && clientPageInfo.getValue(START_CURSOR), ); return; } } else { // The connection was refetched from the beginning/end: replace edges nextEdges = serverEdges; } } else if (serverEdges) { nextEdges = serverEdges; } else { nextEdges = prevEdges; } // Update edges only if they were updated, the null check is // for Flow (prevEdges could be null). if (nextEdges != null && nextEdges !== prevEdges) { connection.setLinkedRecords(nextEdges, EDGES); } // Page info should be updated even if no new edge were returned. if (clientPageInfo && serverPageInfo) { if (args.after == null && args.before == null) { // The connection was refetched from the beginning/end: replace // page_info clientPageInfo.copyFieldsFrom(serverPageInfo); } else if (args.before != null || (args.after == null && args.last)) { clientPageInfo.setValue( !!serverPageInfo.getValue(HAS_PREV_PAGE), HAS_PREV_PAGE, ); const startCursor = serverPageInfo.getValue(START_CURSOR); if (typeof startCursor === 'string') { clientPageInfo.setValue(startCursor, START_CURSOR); } } else if (args.after != null || (args.before == null && args.first)) { clientPageInfo.setValue( !!serverPageInfo.getValue(HAS_NEXT_PAGE), HAS_NEXT_PAGE, ); const endCursor = serverPageInfo.getValue(END_CURSOR); if (typeof endCursor === 'string') { clientPageInfo.setValue(endCursor, END_CURSOR); } } } } }
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(); const serverConnection = record.getLinkedRecord(payload.fieldKey); const serverPageInfo = serverConnection && serverConnection.getLinkedRecord(PAGE_INFO); if (!serverConnection) { record.setValue(null, payload.handleKey); return; } const clientConnection = record.getLinkedRecord(payload.handleKey); let clientPageInfo = clientConnection && clientConnection.getLinkedRecord(PAGE_INFO); if (!clientConnection) { // Initial fetch with data: copy fields from the server record const connection = store.create( generateClientID(record.getDataID(), payload.handleKey), serverConnection.getType(), ); connection.setValue(0, NEXT_EDGE_INDEX); connection.copyFieldsFrom(serverConnection); let serverEdges = serverConnection.getLinkedRecords(EDGES); if (serverEdges) { serverEdges = serverEdges.map(edge => buildConnectionEdge(store, connection, edge), ); connection.setLinkedRecords(serverEdges, EDGES); } record.setLinkedRecord(connection, payload.handleKey); clientPageInfo = store.create( generateClientID(connection.getDataID(), PAGE_INFO), PAGE_INFO_TYPE, ); clientPageInfo.setValue(false, HAS_NEXT_PAGE); clientPageInfo.setValue(false, HAS_PREV_PAGE); clientPageInfo.setValue(null, END_CURSOR); clientPageInfo.setValue(null, START_CURSOR); if (serverPageInfo) { clientPageInfo.copyFieldsFrom(serverPageInfo); } connection.setLinkedRecord(clientPageInfo, PAGE_INFO); } else { const connection = clientConnection; // Subsequent fetches: // - updated fields on the connection // - merge prev/next edges, de-duplicating by node id // - synthesize page info fields let serverEdges = serverConnection.getLinkedRecords(EDGES); if (serverEdges) { serverEdges = serverEdges.map(edge => buildConnectionEdge(store, connection, edge), ); } const prevEdges = connection.getLinkedRecords(EDGES); const prevPageInfo = connection.getLinkedRecord(PAGE_INFO); connection.copyFieldsFrom(serverConnection); // Reset EDGES and PAGE_INFO fields if (prevEdges) { connection.setLinkedRecords(prevEdges, EDGES); } if (prevPageInfo) { connection.setLinkedRecord(prevPageInfo, PAGE_INFO); } let nextEdges = []; const args = payload.args; if (prevEdges && serverEdges) { if (args.after != null) { // Forward pagination from the end of the connection: append edges if ( clientPageInfo && args.after === clientPageInfo.getValue(END_CURSOR) ) { const nodeIDs = new Set(); mergeEdges(prevEdges, nextEdges, nodeIDs); mergeEdges(serverEdges, nextEdges, nodeIDs); } else { warning( false, 'RelayConnectionHandler: Unexpected after cursor `%s`, edges must ' + 'be fetched from the end of the list (`%s`).', args.after, clientPageInfo && clientPageInfo.getValue(END_CURSOR), ); return; } } else if (args.before != null) { // Backward pagination from the start of the connection: prepend edges if ( clientPageInfo && args.before === clientPageInfo.getValue(START_CURSOR) ) { const nodeIDs = new Set(); mergeEdges(serverEdges, nextEdges, nodeIDs); mergeEdges(prevEdges, nextEdges, nodeIDs); } else { warning( false, 'RelayConnectionHandler: Unexpected before cursor `%s`, edges must ' + 'be fetched from the beginning of the list (`%s`).', args.before, clientPageInfo && clientPageInfo.getValue(START_CURSOR), ); return; } } else { // The connection was refetched from the beginning/end: replace edges nextEdges = serverEdges; } } else if (serverEdges) { nextEdges = serverEdges; } else { nextEdges = prevEdges; } // Update edges only if they were updated, the null check is // for Flow (prevEdges could be null). if (nextEdges != null && nextEdges !== prevEdges) { connection.setLinkedRecords(nextEdges, EDGES); } // Page info should be updated even if no new edge were returned. if (clientPageInfo && serverPageInfo) { if (args.after == null && args.before == null) { // The connection was refetched from the beginning/end: replace // page_info clientPageInfo.copyFieldsFrom(serverPageInfo); } else if (args.before != null || (args.after == null && args.last)) { clientPageInfo.setValue( !!serverPageInfo.getValue(HAS_PREV_PAGE), HAS_PREV_PAGE, ); const startCursor = serverPageInfo.getValue(START_CURSOR); if (typeof startCursor === 'string') { clientPageInfo.setValue(startCursor, START_CURSOR); } } else if (args.after != null || (args.before == null && args.first)) { clientPageInfo.setValue( !!serverPageInfo.getValue(HAS_NEXT_PAGE), HAS_NEXT_PAGE, ); const endCursor = serverPageInfo.getValue(END_CURSOR); if (typeof endCursor === 'string') { clientPageInfo.setValue(endCursor, END_CURSOR); } } } } }
[ "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; oPopover.openBy(oSource); }.bind(this)); return; // We continue execution in the promise } else if (this.oDisclaimerPopover.isOpen()) { this.oDisclaimerPopover.close(); } this.oDisclaimerPopover.openBy(oSource); }
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; oPopover.openBy(oSource); }.bind(this)); return; // We continue execution in the promise } else if (this.oDisclaimerPopover.isOpen()) { this.oDisclaimerPopover.close(); } this.oDisclaimerPopover.openBy(oSource); }
[ "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: oGregorian.month, day: oGregorian.day }; }
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: oGregorian.month, day: oGregorian.day }; }
[ "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 {any[]} aParts - the array of binding values @return {any} - the value of the "then" or "else" clause, depending on the value of the condition
[ "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.cssRules; } catch (e) { if (e.name !== "SecurityError") { throw e; } } if (href && cssRules) { if (rel.stylesheets[href] === undefined) { rel.stylesheets[href] = []; } rel.stylesheets[href].push(base); for (i = 0; i < cssRules.length; i++) { if (cssRules[i].href) { traverseRules(cssRules[i].styleSheet, base); } } } }
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.cssRules; } catch (e) { if (e.name !== "SecurityError") { throw e; } } if (href && cssRules) { if (rel.stylesheets[href] === undefined) { rel.stylesheets[href] = []; } rel.stylesheets[href].push(base); for (i = 0; i < cssRules.length; i++) { if (cssRules[i].href) { traverseRules(cssRules[i].styleSheet, base); } } } }
[ "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 (const key in startState) { targetState[key] = el.style[key] if ( process.env.NODE_ENV !== 'production' && targetState[key] == null && (!activeState || activeState[key] == null) && (!endState || endState[key] == null) ) { warn( `transition property "${key}" is declared in enter starting class (.${startClass}), ` + `but not declared anywhere in enter ending class (.${endClass}), ` + `enter active cass (.${activeClass}) or the element's default styling. ` + `Note in Weex, CSS properties need explicit values to be transitionable.` ) } } } // 2. if state is mixed in active state, extract them while excluding // transition properties if (activeState) { for (const key in activeState) { if (key.indexOf('transition') !== 0) { targetState[key] = activeState[key] } } } // 3. explicit endState has highest priority if (endState) { extend(targetState, endState) } return targetState }
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 (const key in startState) { targetState[key] = el.style[key] if ( process.env.NODE_ENV !== 'production' && targetState[key] == null && (!activeState || activeState[key] == null) && (!endState || endState[key] == null) ) { warn( `transition property "${key}" is declared in enter starting class (.${startClass}), ` + `but not declared anywhere in enter ending class (.${endClass}), ` + `enter active cass (.${activeClass}) or the element's default styling. ` + `Note in Weex, CSS properties need explicit values to be transitionable.` ) } } } // 2. if state is mixed in active state, extract them while excluding // transition properties if (activeState) { for (const key in activeState) { if (key.indexOf('transition') !== 0) { targetState[key] = activeState[key] } } } // 3. explicit endState has highest priority if (endState) { extend(targetState, endState) } return targetState }
[ "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 = ColumnResizeHelper._calculateAutomaticColumnWidth.apply(oTable, [oColumn, iColIndex]); if (iNewWidth) { oColumn._iNewWidth = iNewWidth; ColumnResizeHelper._resizeColumn(oTable, iColIndex); } } }
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 = ColumnResizeHelper._calculateAutomaticColumnWidth.apply(oTable, [oColumn, iColIndex]); if (iNewWidth) { oColumn._iNewWidth = iNewWidth; ColumnResizeHelper._resizeColumn(oTable, iColIndex); } } }
[ "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); } }); // after all SAP V2 annotations are lifted up add V4 annotations that are calculated // by multiple V2 annotations or that have a different default value switch (sTypeClass) { case "Property": if (o["sap:updatable"] === "false") { if (o["sap:creatable"] === "false") { o["Org.OData.Core.V1.Computed"] = oBoolTrue; } else { o["Org.OData.Core.V1.Immutable"] = oBoolTrue; } } break; case "EntitySet": if (o["sap:searchable"] !== "true") { o["Org.OData.Capabilities.V1.SearchRestrictions"] = { "Searchable" : oBoolFalse }; } break; default: // nothing to do } }
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); } }); // after all SAP V2 annotations are lifted up add V4 annotations that are calculated // by multiple V2 annotations or that have a different default value switch (sTypeClass) { case "Property": if (o["sap:updatable"] === "false") { if (o["sap:creatable"] === "false") { o["Org.OData.Core.V1.Computed"] = oBoolTrue; } else { o["Org.OData.Core.V1.Immutable"] = oBoolTrue; } } break; case "EntitySet": if (o["sap:searchable"] !== "true") { o["Org.OData.Capabilities.V1.SearchRestrictions"] = { "Searchable" : oBoolFalse }; } break; default: // nothing to do } }
[ "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.push('/nologo') } // Specify the build type, Release by default if (win) { // Convert .gypi config target_arch to MSBuild /Platform // Since there are many ways to state '32-bit Intel', default to it. // N.B. msbuild's Condition string equality tests are case-insensitive. var archLower = arch.toLowerCase() var p = archLower === 'x64' ? 'x64' : (archLower === 'arm' ? 'ARM' : (archLower === 'arm64' ? 'ARM64' : 'Win32')) argv.push('/p:Configuration=' + buildType + ';Platform=' + p) if (jobs) { var j = parseInt(jobs, 10) if (!isNaN(j) && j > 0) { argv.push('/m:' + j) } else if (jobs.toUpperCase() === 'MAX') { argv.push('/m:' + require('os').cpus().length) } } } else { argv.push('BUILDTYPE=' + buildType) // Invoke the Makefile in the 'build' dir. argv.push('-C') argv.push('build') if (jobs) { var j = parseInt(jobs, 10) if (!isNaN(j) && j > 0) { argv.push('--jobs') argv.push(j) } else if (jobs.toUpperCase() === 'MAX') { argv.push('--jobs') argv.push(require('os').cpus().length) } } } if (win) { // did the user specify their own .sln file? var hasSln = argv.some(function (arg) { return path.extname(arg) == '.sln' }) if (!hasSln) { argv.unshift(gyp.opts.solution || guessedSolution) } } var proc = gyp.spawn(command, argv) proc.on('exit', onExit) }
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.push('/nologo') } // Specify the build type, Release by default if (win) { // Convert .gypi config target_arch to MSBuild /Platform // Since there are many ways to state '32-bit Intel', default to it. // N.B. msbuild's Condition string equality tests are case-insensitive. var archLower = arch.toLowerCase() var p = archLower === 'x64' ? 'x64' : (archLower === 'arm' ? 'ARM' : (archLower === 'arm64' ? 'ARM64' : 'Win32')) argv.push('/p:Configuration=' + buildType + ';Platform=' + p) if (jobs) { var j = parseInt(jobs, 10) if (!isNaN(j) && j > 0) { argv.push('/m:' + j) } else if (jobs.toUpperCase() === 'MAX') { argv.push('/m:' + require('os').cpus().length) } } } else { argv.push('BUILDTYPE=' + buildType) // Invoke the Makefile in the 'build' dir. argv.push('-C') argv.push('build') if (jobs) { var j = parseInt(jobs, 10) if (!isNaN(j) && j > 0) { argv.push('--jobs') argv.push(j) } else if (jobs.toUpperCase() === 'MAX') { argv.push('--jobs') argv.push(require('os').cpus().length) } } } if (win) { // did the user specify their own .sln file? var hasSln = argv.some(function (arg) { return path.extname(arg) == '.sln' }) if (!hasSln) { argv.unshift(gyp.opts.solution || guessedSolution) } } var proc = gyp.spawn(command, argv) proc.on('exit', onExit) }
[ "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_MONITOR + '-shrink'); expand.appendChild(createDiv()); shrink.appendChild(createDiv()); resizer.appendChild(expand); resizer.appendChild(shrink); resizer._reset = function() { expand.scrollLeft = maxSize; expand.scrollTop = maxSize; shrink.scrollLeft = maxSize; shrink.scrollTop = maxSize; }; var onScroll = function() { resizer._reset(); handler(); }; addListener(expand, 'scroll', onScroll.bind(expand, 'expand')); addListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink')); return resizer; }
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_MONITOR + '-shrink'); expand.appendChild(createDiv()); shrink.appendChild(createDiv()); resizer.appendChild(expand); resizer.appendChild(shrink); resizer._reset = function() { expand.scrollLeft = maxSize; expand.scrollTop = maxSize; shrink.scrollLeft = maxSize; shrink.scrollTop = maxSize; }; var onScroll = function() { resizer._reset(); handler(); }; addListener(expand, 'scroll', onScroll.bind(expand, 'expand')); addListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink')); return resizer; }
[ "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 `JSXElement`. - `<>foo</>` ... If the literal is a text content, the parent of the literal is `JSXFragment`. In particular, this function returns `false` in the following cases: - `<div className={"foo"}></div>` - `<div>{"foo"}</div>` In both cases, inside of the braces is handled as normal JavaScript. The braces are `JSXExpressionContainer` nodes. @param {ASTNode} node The Literal node to check. @returns {boolean} True if the node is a part of JSX, false if not. @private
[ "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 with the "reexports" block. } else if (data.kind === "hoisted") { initStatements.push( buildInitStatement(metadata, data.names, t.identifier(localName)), ); } else { exportNames.push(...data.names); } } for (const data of metadata.source.values()) { if (!loose) { initStatements.push(...buildReexportsFromMeta(metadata, data, loose)); } for (const exportName of data.reexportNamespace) { exportNames.push(exportName); } } initStatements.push( ...chunk(exportNames, 100).map(members => { return buildInitStatement( metadata, members, programPath.scope.buildUndefinedNode(), ); }), ); return initStatements; }
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 with the "reexports" block. } else if (data.kind === "hoisted") { initStatements.push( buildInitStatement(metadata, data.names, t.identifier(localName)), ); } else { exportNames.push(...data.names); } } for (const data of metadata.source.values()) { if (!loose) { initStatements.push(...buildReexportsFromMeta(metadata, data, loose)); } for (const exportName of data.reexportNamespace) { exportNames.push(exportName); } } initStatements.push( ...chunk(exportNames, 100).map(members => { return buildInitStatement( metadata, members, programPath.scope.buildUndefinedNode(), ); }), ); return initStatements; }
[ "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, id: id, payload: true}); }); break; case 'query-index': self.postMessage({type: type, id: id, payload: {query: payload, results: queryIndex(payload)}}); break; default: self.postMessage({type: type, id: id, payload: {error: 'invalid message 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, id: id, payload: true}); }); break; case 'query-index': self.postMessage({type: type, id: id, payload: {query: payload, results: queryIndex(payload)}}); break; default: self.postMessage({type: type, id: id, payload: {error: 'invalid message 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) { r.push(', '); } r.push('<span'); var types = listTypes(p.type, true); if ( (desc = asPlainSummary(p.description)) || types ) { r.push(' title="'); if (types) { r.push('('); r.push(types); r.push(') '); } r.push(desc); r.push('"'); } r.push('>'); r.push(p.name); r.push('</span>'); if ( p.optional ) { r.push('<i class="help" title="Optional parameter">?</i>'); } } } } r.push(')'); return r.join(''); }
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) { r.push(', '); } r.push('<span'); var types = listTypes(p.type, true); if ( (desc = asPlainSummary(p.description)) || types ) { r.push(' title="'); if (types) { r.push('('); r.push(types); r.push(') '); } r.push(desc); r.push('"'); } r.push('>'); r.push(p.name); r.push('</span>'); if ( p.optional ) { r.push('<i class="help" title="Optional parameter">?</i>'); } } } } r.push(')'); return r.join(''); }
[ "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...